parameters: (self, nums)
return_statement: return res
docstring: :type nums: List[int]
          :rtype: List[List[int]]
docstring_summary: :type nums: List[int]
          :rtype: List[List[int]]
docstring_tokens: : type nums : List [ int ] : rtype : List [ List [ int ]]
function: def permute(self, nums):
          """
          :type nums: List[int]
          :rtype: List[List[int]]
          """
          res, n = list(), len(nums)
          def _permute(nums, i):
              if i == n:
                  res.append(nums.copy())
                  return
                  
              for k in range(i, n):
                  nums[i], nums[k] = nums[k], nums[i]
                  _permute(nums, i + 1)
                  nums[i], nums[k] = nums[k], nums[i]
          
          _permute(nums, 0)
          return res
function_tokens: def permute ( self , nums ) : res , n = list ( ) , len ( nums ) def _permute ( nums , i ) : if i == n : res . append ( nums . copy ( ) ) return for k in range ( i , n ) : nums [ i ] , nums [ k ] = nums [ k ] , nums [ i ] _permute ( nums , i + 1 ) nums [ i ] , nums [ k ] = nums [ k ] , nums [ i ] _permute ( nums , 0 ) return res