@typed_macro
def array(value, dtype = None):
  if dtype is not None:
    expected_elt_type = _get_type(dtype)
    print "Got dtype argument to array: %s, ignoring for now" % expected_elt_type

  if isinstance(value.type, ArrayT):
    return value 
  else:
    assert isinstance(value.type, TupleT), "Don't know how to make array from %s : %s" % (value, value.type)
    elt_types = value.type.elt_types
    assert all(isinstance(t, ScalarT) for t in elt_types), \
      "Can only make array from tuple of scalars, not %s : %s" % (value, value.type)
    elt_t = combine_type_list(value.type.elt_types)
    array_elts = _get_tuple_elts(value, cast_type = elt_t)
    array_t = make_array_type(elt_t, 1)
    return Array(elts = array_elts, type = array_t)
dataset/ETHPy150Open iskandr/parakeet/parakeet/lib/array_constructors.py/array/original