/third_party/python/Lib/test/ |
H A D | test_struct.py | 7 import struct namespace 38 self.assertEqual((struct.pack('=i', 1)[0] == 0), ISBIGENDIAN) 41 self.assertRaises(struct.error, struct.calcsize, 'Z') 43 sz = struct.calcsize('i') 44 self.assertEqual(sz * 3, struct.calcsize('iii')) 48 sz = struct.calcsize(fmt) 49 sz3 = struct.calcsize(fmt3) 52 self.assertRaises(struct.error, struct [all...] |
H A D | test_wave.py | 5 import struct namespace 120 b = b'SPAM' + struct.pack('<L', 0) 126 b = b'RIFF' + struct.pack('<L', 4) + b'SPAM' 132 b = b'RIFF' + struct.pack('<L', 4) + b'WAVE' 138 b = b'RIFF' + struct.pack('<L', 28) + b'WAVE' 139 b += b'fmt ' + struct.pack('<LHHLLHH', 16, 1, 1, 11025, 11025, 1, 8) 145 b = b'RIFF' + struct.pack('<L', 12) + b'WAVE' 146 b += b'data' + struct.pack('<L', 0) 151 b = b'RIFF' + struct.pack('<L', 36) + b'WAVE' 152 b += b'fmt ' + struct [all...] |
H A D | test_aifc.py | 9 import struct namespace 264 b1 = io.BytesIO(b'WRNG' + struct.pack('>L', 0)) 265 b2 = io.BytesIO(b'FORM' + struct.pack('>L', 4) + b'WRNG') 270 b = io.BytesIO(b'FORM' + struct.pack('>L', 4) + b'AIFF') 274 b = b'FORM' + struct.pack('>L', 4) + b'AIFC' 275 b += b'COMM' + struct.pack('>LhlhhLL', 38, 1, 0, 8, 277 b += b'NONE' + struct.pack('B', 14) + b'not compressed' + b'\x00' 283 b = b'FORM' + struct.pack('>L', 4) + b'AIFC' 284 b += b'COMM' + struct.pack('>LhlhhLL', 23, 1, 0, 8, 286 b += b'WRNG' + struct [all...] |
H A D | test_ioctl.py | 5 import os, struct namespace 18 rpgrp = struct.unpack("i", r)[0] 36 rpgrp = struct.unpack("i", r)[0] 79 set_winsz_opcode_maybe_neg, = struct.unpack("i", 80 struct.pack("I", termios.TIOCSWINSZ)) 82 our_winsz = struct.pack("HHHH",80,25,0,0)
|
H A D | test_sunau.py | 4 import struct namespace 135 b = struct.pack('>LLLLL', sunau.AUDIO_FILE_MAGIC, 20, 0, 141 b = struct.pack('>LLLLLL', sunau.AUDIO_FILE_MAGIC, 124, 0, 148 b = struct.pack('>LLLLLL', sunau.AUDIO_FILE_MAGIC, 24, 0, 0, 11025, 1) 153 b = struct.pack('>LLLLLL', sunau.AUDIO_FILE_MAGIC, 24, 0,
|
/third_party/protobuf/python/google/protobuf/internal/ |
H A D | well_known_types_test.py | 756 struct = struct_pb2.Struct() 757 self.assertIsInstance(struct, collections_abc.Mapping) 758 self.assertEqual(0, len(struct)) 759 struct_class = struct.__class__ 761 struct['key1'] = 5 762 struct['key2'] = 'abc' 763 struct['key3'] = True 764 struct.get_or_create_struct('key4')['subkey'] = 11.0 765 struct_list = struct.get_or_create_list('key5') 769 struct['key [all...] |
/third_party/skia/third_party/externals/angle2/scripts/ |
H A D | bmp_to_nv12.py | 12 import struct namespace 25 file_size, = struct.unpack("I", bmp_file.read(4)) 30 offset, = struct.unpack("I", bmp_file.read(4)) 32 headersize, = struct.unpack("I", bmp_file.read(4)) 33 width, = struct.unpack("i", bmp_file.read(4)) 34 height, = struct.unpack("i", bmp_file.read(4)) 35 planes, = struct.unpack("H", bmp_file.read(2)) 36 bpp, = struct.unpack("H", bmp_file.read(2)) 37 compression, = struct.unpack("i", bmp_file.read(4)) 38 image_size, = struct [all...] |
/third_party/libfuse/test/ |
H A D | test_custom_io.py | 11 import struct namespace 42 dummy_init_req_header = struct.pack( 43 fuse_in_header_fmt, struct.calcsize(fuse_in_header_fmt) + 44 struct.calcsize(fuse_init_in_fmt), FUSE_OP_INIT, unique_req, 0, 0, 0, 46 dummy_init_req_payload = struct.pack( 52 response_header = sock_recvall(sock, struct.calcsize(fuse_out_header_fmt)) 53 packet_len, _, unique_res = struct.unpack( 58 response_payload = struct.unpack(fuse_init_out_fmt, response_payload)
|
/third_party/mesa3d/src/gallium/drivers/zink/ |
H A D | zink_extensions.py | 31 def __init__(self, version, struct=()): 34 if not struct: 37 self.struct_version = struct 50 def struct(self): member in Version 53 # the sType of the extension's struct 55 # for VK_EXT_transform_feedback and struct="FEATURES" 56 def stype(self, struct: str): 59 + '_' + struct) 144 # feature/properties struct 149 def physical_device_struct(self, struct [all...] |
/third_party/python/Lib/ctypes/test/ |
H A D | test_byteswap.py | 1 import sys, unittest, struct, math, ctypes namespace 53 self.assertEqual(bin(struct.pack(">h", 0x1234)), "1234") 58 self.assertEqual(bin(struct.pack("<h", 0x1234)), "3412") 63 self.assertEqual(bin(struct.pack(">h", 0x1234)), "1234") 68 self.assertEqual(bin(struct.pack("<h", 0x1234)), "3412") 81 self.assertEqual(bin(struct.pack(">i", 0x12345678)), "12345678") 86 self.assertEqual(bin(struct.pack("<i", 0x12345678)), "78563412") 91 self.assertEqual(bin(struct.pack(">I", 0x12345678)), "12345678") 96 self.assertEqual(bin(struct.pack("<I", 0x12345678)), "78563412") 109 self.assertEqual(bin(struct [all...] |
H A D | test_numbers.py | 3 import struct namespace 8 # the struct module, use the struct module to calculate the 14 size = struct.calcsize(fmt) 15 a = struct.unpack(fmt, (b"\x00"*32)[:size])[0] 16 b = struct.unpack(fmt, (b"\xFF"*32)[:size])[0] 17 c = struct.unpack(fmt, (b"\x7F"+b"\x00"*32)[:size])[0] 18 d = struct.unpack(fmt, (b"\x80"+b"\xFF"*32)[:size])[0] 143 size = struct.calcsize(t._type_) 144 except struct [all...] |
/third_party/python/Lib/ |
H A D | xdrlib.py | 7 import struct namespace 39 """ Wrap any raised struct.errors in a ConversionError. """ 45 except struct.error as e: 66 self.__buf.write(struct.pack('>L', x)) 70 self.__buf.write(struct.pack('>l', x)) 81 except (TypeError, struct.error) as e: 85 except (TypeError, struct.error) as e: 92 self.__buf.write(struct.pack('>f', x)) 96 self.__buf.write(struct.pack('>d', x)) 164 return struct [all...] |
H A D | plistlib.py | 69 import struct namespace 482 ) = struct.unpack('>6xBBQQQ', trailer) 488 except (OSError, IndexError, struct.error, OverflowError, 498 return struct.unpack(f, self._fp.read(s))[0] 505 return struct.unpack(f'>{n}{_BINARY_FORMAT[size]}', data) 550 result = struct.unpack('>f', self._fp.read(4))[0] 553 result = struct.unpack('>d', self._fp.read(8))[0] 556 f = struct.unpack('>d', self._fp.read(8))[0] 672 self._fp.write(struct.pack(offset_format, *self._object_offsets)) 680 self._fp.write(struct [all...] |
H A D | wave.py | 76 import struct namespace 116 self.chunksize = struct.unpack_from(strflag+'L', file.read(4))[0] 117 except struct.error: 376 wFormatTag, self._nchannels, self._framerate, dwAvgBytesPerSec, wBlockAlign = struct.unpack_from('<HHLLH', chunk.read(14)) 377 except struct.error: 381 sampwidth = struct.unpack_from('<H', chunk.read(2))[0] 382 except struct.error: 600 self._file.write(struct.pack('<L4s4sLHHLLHH4s', 608 self._file.write(struct.pack('<L', self._datalength)) 617 self._file.write(struct [all...] |
/third_party/node/deps/npm/node_modules/node-gyp/gyp/pylib/packaging/ |
H A D | _elffile.py | 13 import struct namespace 49 except struct.error: 87 except struct.error as e: 91 return struct.unpack(fmt, self._f.read(struct.calcsize(fmt))) 102 except struct.error:
|
/third_party/skia/third_party/externals/dawn/generator/ |
H A D | dawn_json_generator.py | 322 def link_structure(struct, types): 323 struct.members = linked_record_members(struct.json_data['members'], types) 345 # Sort structures so that if struct A has struct B as a member, then B is 351 # It works by computing for each struct type what is the depth of its DAG of 357 for struct in structs: 358 struct.visited = False 359 struct.subdag_depth = 0 361 def compute_depth(struct) [all...] |
/third_party/python/Lib/multiprocessing/ |
H A D | shared_memory.py | 15 import struct namespace 255 Because values are packed into a memoryview as bytes, the struct 265 # - N * 8 bytes: `struct` format string for each element 322 requested_size = struct.calcsize( 335 struct.pack_into( 342 struct.pack_into( 348 struct.pack_into( 354 struct.pack_into( 364 struct.unpack_from( 377 v = struct [all...] |
/third_party/python/Lib/dbm/ |
H A D | __init__.py | 34 import struct namespace 169 (magic,) = struct.unpack("=l", s) 170 except struct.error: 180 (magic,) = struct.unpack("=l", s16[-4:]) 181 except struct.error:
|
/third_party/skia/experimental/tools/ |
H A D | mskp_parser.py | 14 import struct namespace 30 version, page_count = struct.unpack('II', src.read(8))[:2] 41 offset, size_x, size_y =struct.unpack('Qff', src.read(16)) 45 size_x, size_y =struct.unpack('ff', src.read(8))
|
/third_party/littlefs/scripts/ |
H A D | readtree.py | 3 import struct namespace 77 tail = struct.unpack('<II', mdir.tail.data) 94 nblocks = struct.unpack('<II', dirstruct.data) 106 struct.unpack('<HH', superblock[1].data[0:4].ljust(4, b'\xff')))) 113 tag = Tag(struct.unpack('<I', gstate[0:4].ljust(4, b'\xff'))[0]) 114 blocks = struct.unpack('<II', gstate[4:4+8].ljust(8, b'\xff')) 130 ' -> {%#x, %#x}' % struct.unpack('<II', mdir.tail.data)
|
/third_party/skia/third_party/externals/brotli/java/org/brotli/enc/ |
H A D | PreparedDictionaryGenerator.java | 134 IntBuffer struct = pointer.asIntBuffer(); in generate() 144 /* magic */ struct.put(0, MAGIC); in generate() 145 /* source_offset */ struct.put(1, totalItems); in generate() 146 /* source_size */ struct.put(2, sourceSize); in generate() 147 /* hash_bits */ struct.put(3, hashBits); in generate() 148 /* bucket_bits */ struct.put(4, bucketBits); in generate() 149 /* slot_bits */ struct.put(5, slotBits); in generate()
|
/third_party/python/Lib/zoneinfo/ |
H A D | _common.py | 1 import struct namespace 61 trans_list_utc = struct.unpack( 64 trans_idx = struct.unpack(f">{timecnt}B", fobj.read(timecnt)) 69 # Read the ttinfo struct, (utoff, isdst, abbrind) 72 *(struct.unpack(">lbb", fobj.read(6)) for i in range(typecnt)) 158 args = args + struct.unpack(">6l", stream.read(24))
|
/third_party/python/Tools/demo/ |
H A D | mcast.py | 20 import struct namespace 39 ttl_bin = struct.pack('@i', MYTTL) 68 mreq = group_bin + struct.pack('=I', socket.INADDR_ANY) 71 mreq = group_bin + struct.pack('@I', 0)
|
/third_party/skia/third_party/externals/angle2/third_party/logdog/logdog/ |
H A D | varint.py | 6 import struct namespace 32 w.write(struct.pack('B', byte)) 59 byte = struct.unpack('B', byte)[0]
|
/third_party/mesa3d/src/gallium/drivers/svga/svgadump/ |
H A D | svga_dump.py | 61 assert self.decl.class_type in ('struct', 'union') 227 struct, count = body[i] 230 print ' dump_%s((const %s *)body);' % (struct, struct) 231 print ' body += sizeof(%s);' % struct 327 for struct, count in body: 328 names.add(struct)
|