def flatten(the_list):
  """
  Flatten all the elements in the given list into a single list.
  For an example if the input list is [1, [2,3], [4,5,[6,7]]],
  the resulting list will be [1,2,3,4,5,6,7].

  Args:
    the_list  A list of items where each member item could be a list

  Returns:
    A single list with no lists as its elements
  """
  result = []
  for entry in the_list:
    if hasattr(entry, '__iter__'):
      result.extend(flatten(entry))
    else:
      result.append(entry)
  return result