input: Write a python function to generate the Cartesian product of a given list.
  assert cartesian_product([1, 2]) == [[1, 1], [1, 2], [2, 1], [2, 2]]
  assert cartesian_product(['a', 'b']) == [['a', 'a'], ['a', 'b'], ['b', 'a'], ['b', 'b']]
  assert cartesian_product([1, 2, 3]) == [[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]]
output: def cartesian_product(lst):
      import itertools
      return [list(p) for p in itertools.product(lst, repeat=2)]