<s> """<STR_LIT>""" <EOL> import array <EOL> import sys <EOL> from numba import types <EOL> _pep3118_int_types = set ( '<STR_LIT>' ) <EOL> _pep3118_scalar_map = { <EOL> '<STR_LIT:f>' : types . float32 , <EOL> '<STR_LIT:d>' : types . float64 , <EOL> '<STR_LIT>' : types . complex64 , <EOL> '<STR_LIT>' : types . complex128 , <EOL> } <EOL> _type_map = { <EOL> bytearray : types . ByteArray , <EOL> array . array : types . PyArray , <EOL> } <EOL> _type_map [ memoryview ] = types . MemoryView <EOL> if sys . version_info >= ( <NUM_LIT:3> , ) : <EOL> _type_map [ bytes ] = types . Bytes <EOL> def decode_pep3118_format ( fmt , itemsize ) : <EOL> """<STR_LIT>""" <EOL> if fmt in _pep3118_int_types : <EOL> name = '<STR_LIT>' % ( itemsize * <NUM_LIT:8> , ) <EOL> if fmt . isupper ( ) : <EOL> name = '<STR_LIT:u>' + name <EOL> return types . Integer ( name ) <EOL> try : <EOL> return _pep3118_scalar_map [ fmt . lstrip ( '<STR_LIT:=>' ) ] <EOL> except KeyError : <EOL> raise ValueError ( "<STR_LIT>" % ( fmt , ) ) <EOL> def get_type_class ( typ ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> return _type_map [ typ ] <EOL> except KeyError : <EOL> return types . Buffer <EOL> def infer_layout ( val ) : <EOL> """<STR_LIT>""" <EOL> if sys . version_info >= ( <NUM_LIT:3> , ) : <EOL> return ( '<STR_LIT:C>' if val . c_contiguous else <EOL> '<STR_LIT:F>' if val . f_contiguous else <EOL> '<STR_LIT:A>' ) <EOL> if val . ndim == <NUM_LIT:1> and val . strides [ <NUM_LIT:0> ] == val . itemsize : <EOL> return '<STR_LIT:C>' <EOL> return '<STR_LIT:A>' </s>
