MCPcopy Create free account
hub / github.com/numpy/numpy / asbytes

Function asbytes

numpy/compat/py3k.py:39–42  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

37 return str(s)
38
39def asbytes(s):
40 if isinstance(s, bytes):
41 return s
42 return str(s).encode('latin1')
43
44def asstr(s):
45 if isinstance(s, bytes):

Callers 14

centerFunction · 0.90
ljustFunction · 0.90
rjustFunction · 0.90
fromregexFunction · 0.90
__init__Method · 0.90
writeMethod · 0.90
writelinesMethod · 0.90
test_arrayMethod · 0.90
test_header_footerMethod · 0.90
test_gft_from_gzipMethod · 0.90
countMethod · 0.90

Calls 1

encodeMethod · 0.80

Tested by 9

__init__Method · 0.72
writeMethod · 0.72
writelinesMethod · 0.72
test_arrayMethod · 0.72
test_header_footerMethod · 0.72
test_gft_from_gzipMethod · 0.72
countMethod · 0.72
test_check_on_fieldsMethod · 0.72