def Flatten(value):
  """Flattens nested lists/tuples into an one-level list. If value is not a
     list/tuple, it is converted to an one-item list. For example,
     (1, 2, [3, 4, ('56', '7')]) is converted to [1, 2, 3, 4, '56', '7'];
     1 is converted to [1].
  """
  if isinstance(value, (list, tuple)):
    result = []
    for item in value:
      result.extend(Flatten(item))
    return result
  return [value]