Home
last modified time | relevance | path

Searched refs:bytearray (Results 1 – 25 of 324) sorted by relevance

12345678910>>...13

/external/python/cpython2/Doc/c-api/
Dbytearray.rst8 .. index:: object: bytearray
15 This subtype of :c:type:`PyObject` represents a Python bytearray object.
20 This instance of :c:type:`PyTypeObject` represents the Python bytearray type;
21 it is the same object as ``bytearray`` in the Python layer.
28 Return true if the object *o* is a bytearray object or an instance of a
29 subtype of the bytearray type.
34 Return true if the object *o* is a bytearray object, but not an instance of a
35 subtype of the bytearray type.
43 Return a new bytearray object from any object, *o*, that implements the
51 Create a new bytearray object from *string* and its length, *len*. On
[all …]
/external/python/cpython3/Doc/c-api/
Dbytearray.rst8 .. index:: object: bytearray
13 This subtype of :c:type:`PyObject` represents a Python bytearray object.
18 This instance of :c:type:`PyTypeObject` represents the Python bytearray type;
19 it is the same object as :class:`bytearray` in the Python layer.
27 Return true if the object *o* is a bytearray object or an instance of a
28 subtype of the bytearray type.
33 Return true if the object *o* is a bytearray object, but not an instance of a
34 subtype of the bytearray type.
42 Return a new bytearray object from any object, *o*, that implements the
50 Create a new bytearray object from *string* and its length, *len*. On
[all …]
/external/python/cpython2/Lib/test/
Dtest_bytes.py240 for f in bytes, bytearray:
257 b = bytearray([0x1a, 0x2b, 0x30])
295 self.assertFalse(bytearray().endswith(b"anything"))
481 type2test = bytearray
484 self.assertRaises(TypeError, hash, bytearray())
496 b = bytearray(20)
515 b = bytearray(b'hello')
518 b = bytearray(b'hello1') # test even number of items
521 b = bytearray()
527 return bytearray(map(ord, s))
[all …]
Dtest_base64.py22 eq(base64.encodestring(bytearray('abc')), 'YWJj\n')
38 eq(base64.decodestring(bytearray("YWJj\n")), "abc")
81 eq(base64.b64encode(bytearray('abcd')), 'YWJjZA==')
83 '\xd3V\xbeo\xf7\x1d', altchars=bytearray('*$'))
97 eq(base64.standard_b64encode(bytearray('abcd')), 'YWJjZA==')
101 eq(base64.urlsafe_b64encode(bytearray('\xd3V\xbeo\xf7\x1d')), '01a-b_cd')
120 eq(base64.b64decode(bytearray("YWJj")), "abc")
134 eq(base64.standard_b64decode(bytearray("YWJj")), "abc")
138 eq(base64.urlsafe_b64decode(bytearray('01a-b_cd')), '\xd3V\xbeo\xf7\x1d')
174 eq(base64.b32encode(bytearray('abcd')), 'MFRGGZA=')
[all …]
Dtest_getargs2.py528 self.assertRaises(TypeError, getargs_c, bytearray('a'))
539 self.assertRaises(TypeError, getargs_w, bytearray('bytes'), 3)
542 memoryview(bytearray('bytes')), 3)
546 buffer(bytearray('bytes')), 3)
553 self.assertRaises(TypeError, getargs_w_hash, bytearray('bytes'))
556 memoryview(bytearray('bytes')))
560 buffer(bytearray('bytes')))
569 buf = bytearray('bytearray')
571 self.assertEqual(buf, bytearray('[ytearra]'))
572 buf = bytearray(b'memoryview')
[all …]
Dtest_hmac.py342 a, b = bytearray(b"foobar"), bytearray(b"foobar")
346 a, b = bytearray(b"foobar"), bytearray(b"foo")
350 a, b = bytearray(b"foobar"), bytearray(b"foobaz")
354 a, b = bytearray(b"foobar"), b"foobar"
359 a, b = bytearray(b"foobar"), b"foo"
364 a, b = bytearray(b"foobar"), b"foobaz"
/external/python/cpython3/Lib/test/
Dtest_bytes.py200 bytearray(size - 4)
360 for f in bytes, bytearray:
377 b = bytearray([0x1a, 0x2b, 0x30])
414 self.assertEqual(bytearray([0x1a, 0x2b, 0x30]).hex(), '1a2b30')
430 self.assertEqual(dot_join([bytearray(b"ab"), b"cd"]), b"ab.:cd")
431 self.assertEqual(dot_join([b"ab", bytearray(b"cd")]), b"ab.:cd")
440 dot_join([bytearray(b"ab"), "cd", b"ef"])
483 self.assertFalse(bytearray().endswith(b"anything"))
707 for fill_type in (bytes, bytearray):
714 for fill_type in (bytes, bytearray):
[all …]
Dtest_getargs2.py703 self.assertEqual(getargs_c(bytearray(b'a')), 97)
714 self.assertRaises(TypeError, getargs_y, bytearray(b'bytearray'))
723 self.assertEqual(getargs_y_star(bytearray(b'bytearray')), b'bytearray')
732 self.assertRaises(TypeError, getargs_y_hash, bytearray(b'bytearray'))
743 buf = bytearray(b'bytearray')
745 self.assertEqual(buf, bytearray(b'[ytearra]'))
746 buf = bytearray(b'memoryview')
748 self.assertEqual(buf, bytearray(b'[emoryvie]'))
760 self.assertRaises(TypeError, getargs_C, bytearray(b'a'))
770 self.assertRaises(TypeError, getargs_s, bytearray(b'bytearray'))
[all …]
Dtest_audioop.py37 self.assertEqual(audioop.max(bytearray(), w), 0)
50 self.assertEqual(audioop.minmax(bytearray(), w),
67 self.assertEqual(audioop.maxpp(bytearray(), w), 0)
77 self.assertEqual(audioop.avg(bytearray(), w), 0)
95 self.assertEqual(audioop.avgpp(bytearray(), w), 0)
107 self.assertEqual(audioop.rms(bytearray(), w), 0)
123 self.assertEqual(audioop.cross(bytearray(), w), -1)
135 self.assertEqual(audioop.add(bytearray(), bytearray(), w), b'')
154 self.assertEqual(audioop.bias(bytearray(), w, bias), b'')
199 self.assertEqual(audioop.lin2lin(bytearray(datas[w]), w, w),
[all …]
Dtest_hmac.py350 h = hmac.HMAC(bytearray(b"key"), bytearray(b"hash this!"),
459 a, b = bytearray(b"foobar"), bytearray(b"foobar")
463 a, b = bytearray(b"foobar"), bytearray(b"foo")
467 a, b = bytearray(b"foobar"), bytearray(b"foobaz")
471 a, b = bytearray(b"foobar"), b"foobar"
476 a, b = bytearray(b"foobar"), b"foo"
481 a, b = bytearray(b"foobar"), b"foobaz"
Dtest_codeccallbacks.py40 UnicodeDecodeError.__init__(self, "ascii", bytearray(b""), 0, 1, "bad")
46 UnicodeDecodeError.__init__(self, "ascii", bytearray(b""), 0, 1, "bad")
386 ["ascii", bytearray(b"g\xfcrk"), 1, 2, "ouch"],
391 ["ascii", bytearray(b"g\xfcrk"), 1, 3, "ouch"],
445 UnicodeDecodeError("ascii", bytearray(b"\xff"), 0, 1, "ouch")
474 UnicodeDecodeError("ascii", bytearray(b"a\xffb"), 1, 2, "ouch")),
514 UnicodeDecodeError("ascii", bytearray(b"a\xffb"), 1, 2, "ouch")),
540 UnicodeDecodeError("ascii", bytearray(b"\xff"), 0, 1, "ouch")
613 UnicodeDecodeError("ascii", bytearray(b"a" + b + b"b"),
635 UnicodeDecodeError("ascii", bytearray(b"\xff"), 0, 1, "ouch")
[all …]
Dtest_format.py57 ba_format = bytearray(b_format)
69 ba_output = bytearray(b_output)
323 testcommon(b"%c", bytearray(b"Z"), b"Z")
333 testcommon(b"%b", bytearray(b"def"), b"def")
338 testcommon(b"%s", bytearray(b"def"), b"def")
362 test_exc(b'no format', bytearray(b'1'), TypeError,
/external/python/cpython3/Lib/ctypes/test/
Dtest_frombuffer.py46 (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))
/external/python/cpython2/Lib/ctypes/test/
Dtest_frombuffer.py83 self.assertRaises(TypeError, Array.from_buffer, bytearray(10))
84 self.assertRaises(TypeError, Structure.from_buffer, bytearray(10))
85 self.assertRaises(TypeError, Union.from_buffer, bytearray(10))
86 self.assertRaises(TypeError, _CFuncPtr.from_buffer, bytearray(10))
87 self.assertRaises(TypeError, _Pointer.from_buffer, bytearray(10))
88 self.assertRaises(TypeError, _SimpleCData.from_buffer, bytearray(10))
/external/pdfium/fxbarcode/pdf417/
DBC_PDF417BarcodeMatrix.cpp59 std::vector<uint8_t> bytearray = m_matrix[0]->getScaledRow(xScale); in getScaledMatrix() local
60 size_t xMax = bytearray.size(); in getScaledMatrix()
67 bytearray = m_matrix[i / yScale]->getScaledRow(xScale); in getScaledMatrix()
70 m_matrixOut[k + l] = bytearray[l]; in getScaledMatrix()
/external/avb/test/
Dimage_handler_unittest.py123 self.assertEqual(ih.read(14), bytearray('Barfoo43Barfoo'))
125 self.assertEqual(ih.read(2), bytearray('43'))
130 self.assertEqual(ih.read(4), bytearray('\x02\x03\x04\x01'))
134 self.assertEqual(ih.read(12), bytearray('43Barfoo43\x00\x00'))
136 self.assertEqual(ih.read(5), bytearray('\x02\x03\x04Fo'))
140 self.assertEqual(ih.read(16), bytearray('\x00\x00'))
/external/python/cpython2/Modules/
D_randommodule.c471 unsigned char *bytearray; in random_getrandbits() local
484 bytearray = (unsigned char *)PyMem_Malloc(bytes); in random_getrandbits()
485 if (bytearray == NULL) { in random_getrandbits()
495 bytearray[i+0] = (unsigned char)r; in random_getrandbits()
496 bytearray[i+1] = (unsigned char)(r >> 8); in random_getrandbits()
497 bytearray[i+2] = (unsigned char)(r >> 16); in random_getrandbits()
498 bytearray[i+3] = (unsigned char)(r >> 24); in random_getrandbits()
502 result = _PyLong_FromByteArray(bytearray, bytes, 1, 0); in random_getrandbits()
503 PyMem_Free(bytearray); in random_getrandbits()
/external/chromium-trace/catapult/third_party/pyserial/serial/
Dserialutil.py11 bytearray
19 class bytearray(list): class
36 return bytearray(list.__getslice__(self, i, j))
40 return bytearray(list.__getitem__(self, item))
46 other = bytearray(other)
69 elif isinstance(seq, bytearray):
74 b = bytearray()
166 line = bytearray()
/external/python/cpython3/Lib/email/
Dquoprimime.py84 def header_length(bytearray): argument
94 return sum(len(_QUOPRI_HEADER_MAP[octet]) for octet in bytearray)
97 def body_length(bytearray): argument
104 return sum(len(_QUOPRI_BODY_MAP[octet]) for octet in bytearray)
Dbase64mime.py50 def header_length(bytearray): argument
52 groups_of_3, leftover = divmod(len(bytearray), 3)
/external/bcc/examples/networking/dns_matching/
Ddns_matching.py17 b = bytearray()
35 leaf.p = (c_ubyte * 4).from_buffer(bytearray(4))
86 packet_bytearray = bytearray(packet_str)
/external/flatbuffers/python/flatbuffers/
Dcompat.py30 binary_types = (bytes,bytearray)
37 binary_types = (str,bytearray)
/external/u-boot/drivers/misc/
Dspltest_sandbox.c21 for (i = 0; i < sizeof(plat->bytearray); i++) in sandbox_spl_probe()
22 printf(" %02x", plat->bytearray[i]); in sandbox_spl_probe()
/external/python/cpython3/Doc/library/
Dstdtypes.rst902 (such as :class:`str`, :class:`bytes` and :class:`bytearray`) also use
971 concatenation with a :class:`bytearray` object. :class:`bytearray`
1023 object: bytearray
1031 and value restrictions imposed by *s* (for example, :class:`bytearray` only
1452 :term:`bytes-like object` (e.g. :class:`bytes` or :class:`bytearray`). In
1453 this case, if *object* is a :class:`bytes` (or :class:`bytearray`) object,
2290 Binary Sequence Types --- :class:`bytes`, :class:`bytearray`, :class:`memoryview`
2295 object: bytearray
2300 :class:`bytearray`. They are supported by :class:`memoryview` which uses
2410 .. index:: object: bytearray
[all …]
/external/tensorflow/tensorflow/python/kernel_tests/
Ddecode_bmp_op_test.py59 byte_string = bytes(bytearray(encoded_bytes))
134 byte_string = bytes(bytearray(encoded_bytes))

12345678910>>...13