def Flatten(li):
  flat = []
  for x in li:
    if type(x) == list:
      flat.extend(Flatten(x))
    else:
      flat.append(x)
  return flat
Returns a generator that is a flattened out version of the original
dataset/ETHPy150Open spranesh/Redhawk/redhawk/utils/util.py/Flatten