code: def flatten(xs: Union[List, Tuple]) -> List:
      
      return (
          sum(map(flatten, xs), [])
          if (isinstance(xs, list) or isinstance(xs, tuple))
          else [xs]
      )
docs: Flatten a nested list or tuple.