/third_party/python/Lib/test/ |
H A D | test_bytes.py | 1 """Unit tests for the bytes and bytearray types. 206 bytearray(size - 4) 211 # Issue #34974: bytes and bytearray constructors replace unexpected 402 # XXX Shouldn't bytes and bytearray agree on what to raise? 422 for f in bytes, bytearray: 439 b = bytearray([0x1a, 0x2b, 0x30]) 476 self.assertEqual(bytearray([0x1a, 0x2b, 0x30]).hex(), '1a2b30') 549 self.assertEqual(dot_join([bytearray(b"ab"), b"cd"]), b"ab.:cd") 550 self.assertEqual(dot_join([b"ab", bytearray(b"cd")]), b"ab.:cd") 563 dot_join([bytearray( [all...] |
H A D | test_audioop.py | 40 self.assertEqual(audioop.max(bytearray(), w), 0) 53 self.assertEqual(audioop.minmax(bytearray(), w), 70 self.assertEqual(audioop.maxpp(bytearray(), w), 0) 80 self.assertEqual(audioop.avg(bytearray(), w), 0) 98 self.assertEqual(audioop.avgpp(bytearray(), w), 0) 110 self.assertEqual(audioop.rms(bytearray(), w), 0) 126 self.assertEqual(audioop.cross(bytearray(), w), -1) 138 self.assertEqual(audioop.add(bytearray(), bytearray(), w), b'') 157 self.assertEqual(audioop.bias(bytearray(), [all...] |
H A D | test_memoryview.py | 406 rw_type = bytearray 556 ba = bytearray(size) 571 m = memoryview(bytearray(b'\xff'*size)) 576 m = memoryview(bytearray(b'\xff'*size)) 580 m = memoryview(bytearray(b'\xff'*size)) 584 m = memoryview(bytearray(b'\xff'*size)).cast('B', (64, 2)) 589 m = memoryview(bytearray(b'\xff'*size)).cast('B', (2, 64)) 594 m = memoryview(bytearray(b'\xff'*size)) 600 m = memoryview(bytearray(b'\xff'*size)) 606 m = memoryview(bytearray( [all...] |
H A D | test_hmac.py | 427 h = hmac.HMAC(bytearray(b"key"), bytearray(b"hash this!"), 430 self.fail("Constructor call with bytearray arguments raised exception.") 591 a, b = bytearray(b"foobar"), bytearray(b"foobar") 595 a, b = bytearray(b"foobar"), bytearray(b"foo") 599 a, b = bytearray(b"foobar"), bytearray(b"foobaz") 602 # Testing byte and bytearray o [all...] |
H A D | test_codeccallbacks.py | 53 UnicodeDecodeError.__init__(self, "ascii", bytearray(b""), 0, 1, "bad") 59 UnicodeDecodeError.__init__(self, "ascii", bytearray(b""), 0, 1, "bad") 363 ["ascii", bytearray(b"g\xfcrk"), 1, 2, "ouch"], 368 ["ascii", bytearray(b"g\xfcrk"), 1, 3, "ouch"], 422 UnicodeDecodeError("ascii", bytearray(b"\xff"), 0, 1, "ouch") 451 UnicodeDecodeError("ascii", bytearray(b"a\xffb"), 1, 2, "ouch")), 491 UnicodeDecodeError("ascii", bytearray(b"a\xffb"), 1, 2, "ouch")), 517 UnicodeDecodeError("ascii", bytearray(b"\xff"), 0, 1, "ouch") 590 UnicodeDecodeError("ascii", bytearray(b"a" + b + b"b"), 612 UnicodeDecodeError("ascii", bytearray( [all...] |
H A D | test_format.py | 51 # if formatstr is a str, test str, bytes, and bytearray; 52 # otherwise, test bytes and bytearray 58 ba_format = bytearray(b_format) 70 ba_output = bytearray(b_output) 324 testcommon(b"%c", bytearray(b"Z"), b"Z") 334 testcommon(b"%b", bytearray(b"def"), b"def") 339 testcommon(b"%s", bytearray(b"def"), b"def") 363 test_exc(b'no format', bytearray(b'1'), TypeError,
|
/third_party/python/Lib/ctypes/test/ |
H A D | test_frombuffer.py | 46 (c_char * 16).from_buffer(memoryview(bytearray(b"a" * 16))[::-1]) 80 a = [c_char.from_buffer(memoryview(bytearray(b'a')))] 126 self.assertRaises(TypeError, Array.from_buffer, bytearray(10)) 127 self.assertRaises(TypeError, Structure.from_buffer, bytearray(10)) 128 self.assertRaises(TypeError, Union.from_buffer, bytearray(10)) 129 self.assertRaises(TypeError, _CFuncPtr.from_buffer, bytearray(10)) 130 self.assertRaises(TypeError, _Pointer.from_buffer, bytearray(10)) 131 self.assertRaises(TypeError, _SimpleCData.from_buffer, bytearray(10))
|
H A D | test_buffers.py | 27 self.assertEqual(len(bytearray(create_string_buffer(0))), 0) 28 self.assertEqual(len(bytearray(create_string_buffer(1))), 1)
|
/third_party/python/Lib/test/test_capi/ |
H A D | test_getargs.py | 816 self.assertEqual(getargs_c(bytearray(b'a')), 97) 827 self.assertRaises(TypeError, getargs_y, bytearray(b'bytearray')) 836 self.assertEqual(getargs_y_star(bytearray(b'bytearray')), b'bytearray') 845 self.assertRaises(TypeError, getargs_y_hash, bytearray(b'bytearray')) 856 buf = bytearray(b'bytearray') [all...] |
/third_party/mesa3d/src/vulkan/overlay-layer/ |
H A D | mesa-overlay-control.py | 13 VERSION_HEADER = bytearray('MesaOverlayControlVersion', 'utf-8') 14 DEVICE_NAME_HEADER = bytearray('DeviceName', 'utf-8') 15 MESA_VERSION_HEADER = bytearray('MesaVersion', 'utf-8') 80 self.cmd = bytearray(4096) 81 self.param = bytearray(4096) 188 conn.send(bytearray(':capture=1;', 'utf-8')) 190 conn.send(bytearray(':capture=0;', 'utf-8'))
|
/third_party/python/Lib/email/ |
H A D | quoprimime.py | 84 def header_length(bytearray): 90 :param bytearray: An array of bytes (a.k.a. octets). 94 return sum(len(_QUOPRI_HEADER_MAP[octet]) for octet in bytearray) 97 def body_length(bytearray): 100 :param bytearray: An array of bytes (a.k.a. octets). 104 return sum(len(_QUOPRI_BODY_MAP[octet]) for octet in bytearray)
|
H A D | base64mime.py | 51 def header_length(bytearray): 53 groups_of_3, leftover = divmod(len(bytearray), 3)
|
/third_party/python/Objects/ |
H A D | bytearrayobject.c | 1 /* PyByteArray (bytearray) implementation */ 14 class bytearray "PyByteArrayObject *" "&PyByteArray_Type" 270 // result->ob_bytes is NULL if result is an empty bytearray: in PyByteArray_Concat() 365 PyErr_SetString(PyExc_IndexError, "bytearray index out of range"); in bytearray_getitem() 384 PyErr_SetString(PyExc_IndexError, "bytearray index out of range"); in bytearray_subscript() 423 "bytearray indices must be integers or slices, not %.200s", in bytearray_subscript() 467 tricky here because the bytearray object has already been in bytearray_setslice_linear() 473 shrunk. Otherwise, the bytearray is restored in its previous in bytearray_setslice_linear() 479 /* memmove() removed bytes, the bytearray object cannot be in bytearray_setslice_linear() 542 "can't set bytearray slic in bytearray_setslice() [all...] |
/third_party/skia/third_party/externals/angle2/scripts/ |
H A D | bmp_to_nv12.py | 50 converted_pixels = bytearray(pixels) 60 uv_buffer = bytearray(width * height / 2) 70 y_buffer = bytearray(width * height)
|
/third_party/skia/third_party/externals/oboe/samples/drumthumper/src/main/cpp/ |
H A D | DrumPlayerJNI.cpp | 78 JNIEnv* env, jobject, jbyteArray bytearray, jint index, jfloat pan, jint channels) { in Java_com_plausiblesoftware_drumthumper_DrumPlayer_loadWavAssetNative() 79 int len = env->GetArrayLength (bytearray); in Java_com_plausiblesoftware_drumthumper_DrumPlayer_loadWavAssetNative() 82 env->GetByteArrayRegion (bytearray, 0, len, reinterpret_cast<jbyte*>(buf)); in Java_com_plausiblesoftware_drumthumper_DrumPlayer_loadWavAssetNative() 77 Java_com_plausiblesoftware_drumthumper_DrumPlayer_loadWavAssetNative( JNIEnv* env, jobject, jbyteArray bytearray, jint index, jfloat pan, jint channels) Java_com_plausiblesoftware_drumthumper_DrumPlayer_loadWavAssetNative() argument
|
/third_party/python/Lib/test/test_asyncio/ |
H A D | test_unix_events.py | 457 self.data = bytearray() 878 self.assertEqual(bytearray(), tr._buffer) 886 self.assertEqual(bytearray(b''), tr._buffer) 894 self.assertEqual(bytearray(b'ta'), tr._buffer) 900 tr._buffer = bytearray(b'previous') 904 self.assertEqual(bytearray(b'previousdata'), tr._buffer) 911 m_write.assert_called_with(5, bytearray(b'data')) 913 self.assertEqual(bytearray(b'data'), tr._buffer) 925 self.assertEqual(bytearray(), tr._buffer) 965 tr._buffer = bytearray( [all...] |
H A D | test_sock_lowlevel.py | 92 self.loop.sock_recv_into(sock, bytearray())) 118 data = bytearray(1024) 155 data = bytearray(1024) 343 array = bytearray(DATA_SIZE) 404 buf = bytearray(4096) 413 buf = bytearray(8192)
|
H A D | test_proactor_events.py | 57 self.proactor.recv_into.assert_called_with(self.sock, bytearray(self.buffer_size)) 62 self.loop._proactor.recv_into.assert_called_with(self.sock, bytearray(self.buffer_size)) 75 called_buf = bytearray(self.buffer_size) 78 self.protocol.data_received.assert_called_with(bytearray(buf)) 165 tr._buffer = bytearray(b'data') 418 self.protocol.data_received.assert_called_with(bytearray(msg)) 426 self.protocol.data_received.assert_called_with(bytearray(msgs[1])) 435 self.protocol.data_received.assert_called_with(bytearray(msg)) 442 self.protocol.data_received.assert_called_with(bytearray(msgs[4])) 568 data = bytearray( [all...] |
/third_party/python/Lib/encodings/ |
H A D | punycode.py | 12 base = bytearray() 80 result = bytearray() 109 result = bytearray()
|
H A D | idna.py | 168 result = bytearray() 237 result = bytearray()
|
/third_party/python/Lib/ |
H A D | hashlib.py | 203 if not isinstance(password, (bytes, bytearray)): 205 if not isinstance(salt, (bytes, bytearray)): 292 buf = bytearray(_bufsize) # Reusable buffer to reduce allocations.
|
/third_party/qrcodegen/python/ |
H A D | qrcodegen.py | 127 datacodewords = bytearray([0] * (len(bb) // 8)) 185 allcodewords: bytes = self._add_ecc_and_interleave(bytearray(datacodewords)) 339 def _add_ecc_and_interleave(self, data: bytearray) -> bytes: 357 dat: bytearray = data[k : k + shortblocklen - blockecclen + (0 if i < numshortblocks else 1)] 366 result = bytearray() 528 result = bytearray([0] * (degree - 1) + [1]) # Start off with the monomial x^0 547 result = bytearray([0] * len(divisor))
|
/third_party/curl/tests/ |
H A D | negtelnetserver.py | 143 buffer = bytearray() 154 for byte_int in bytearray(data): 229 self.tcp.sendall(bytearray(message_ints))
|
/third_party/mesa3d/.gitlab-ci/bare-metal/ |
H A D | serial_buffer.py | 113 line = bytearray() 138 line = bytearray()
|
/third_party/skia/third_party/externals/brotli/scripts/dictionary/ |
H A D | step-02-rfc-to-bin.py | 32 output.write(bytearray(dictionary))
|