def _get_shape(value):
  """
  User might pass a scalar, a tuple of integer values, or a literal array of integers
  as the 'shape' argument of array constructor. Normalize those all into a tuple
  """
  if isinstance(value.type, ArrayT):
    assert value.__class__ is Array, "Don't know how to convert %s into tuple" % value
    elts = value.elts 
    
    elt_types = get_types(elts)
    assert all(isinstance(t, IntT) for t in elt_types), \
      "Shape elements must be integers, not %s" % elt_types
    return Tuple(elts = elts, type = make_tuple_type(elt_types))
  elif isinstance(value.type, TupleT):
    assert all(isinstance(t, ScalarT) for t in value.type.elt_types), \
      (value, value.type) % "Shape tuple %s : %s has non-scalar elements"
    return value
  elif isinstance(value.type, ScalarT):
    assert isinstance(value.type, IntT), \
      "Can't make shape tuple from non-integer scalar %s : %s" % (value, value.type)
    return make_tuple((value,))
  assert False, "Can't make shape tuple from value %s : %s" % (value, value.type)
dataset/ETHPy150Open iskandr/parakeet/parakeet/lib/lib_helpers.py/_get_shape/swapped operands of `%`