code: def flatten(data):
      
      if not data:
          return data
  
      if type(data[0]) in (list, tuple):
          return list(flatten(data[0])) + list(flatten(data[1:]))
  
      return list(data[:1]) + list(flatten(data[1:]))
docs: Returns a flattened version of a list.
  
      Courtesy of https://stackoverflow.com/a/12472564
  
      Args:
          data (`tuple` or `list`): Input data
  
      Returns:
          `list`