input: Write a python function to generate all possible permutations of a sequence of numbers.
  assert permutations([1, 2, 3]) == [[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
  assert permutations([0, 1]) == [[0, 1], [1, 0]]
  assert permutations([1]) == [[1]]
  assert permutations([]) == []
output: def permutations(sequence):
      if len(sequence) == 0:
          return [[]]
      elif len(sequence) == 1:
          return [sequence]
      else:
          result = []
          for i in range(len(sequence)):
              for perm in permutations(sequence[:i] + sequence[i+1:]):
                  result.append([sequence[i]] + perm)
          return result