def _prepare_argument(ctxt, bld, inp, tyinp, where='input operand'):
 if isinstance(tyinp, types.ArrayCompatible):
  ary = ctxt.make_array(tyinp)(ctxt, bld, inp)
  shape = cgutils.unpack_tuple(bld, ary.shape, tyinp.ndim)
  strides = cgutils.unpack_tuple(bld, ary.strides, tyinp.ndim)
  return _ArrayHelper(ctxt, bld, shape, strides, ary.data, tyinp.layout, tyinp.dtype, tyinp.ndim, inp)
 elif (tyinp in (types.number_domain | set([types.boolean]))):
  return _ScalarHelper(ctxt, bld, inp, tyinp)
 else:
  raise NotImplementedError('unsupported type for {0}: {1}'.format(where, str(tyinp)))

def _prepare_argument ( ctxt , bld , inp , tyinp , where = 'input operand' ) : if isinstance ( tyinp , types . ArrayCompatible ) : ary = ctxt . make_array ( tyinp ) ( ctxt , bld , inp ) shape = cgutils . unpack_tuple ( bld , ary . shape , tyinp . ndim ) strides = cgutils . unpack_tuple ( bld , ary . strides , tyinp . ndim ) return _ArrayHelper ( ctxt , bld , shape , strides , ary . data , tyinp . layout , tyinp . dtype , tyinp . ndim , inp ) elif ( tyinp in ( types . number_domain | set ( [ types . boolean ] ) ) ) : return _ScalarHelper ( ctxt , bld , inp , tyinp ) else : raise NotImplementedError ( 'unsupported type for {0}: {1}' . format ( where , str ( tyinp ) ) )
returns an instance of the appropriate helper class to handle the argument .