





from typing import TYPE_CHECKING

from ...utils import _LazyModule


lowercase    : str    	=  {"""tokenization_byt5""": ["""ByT5Tokenizer"""]}


if TYPE_CHECKING:
       from .tokenization_byta import ByTaTokenizer
else:
       import sys

       lowercase    : Optional[int]    	=  _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)













def     SCREAMING_SNAKE_CASE			(      lowerCAmelCase					):
       _UpperCamelCase              =						[]
       if len(lowerCAmelCase					) == 1:
              return [nums.copy()]
       for _ in range(len(lowerCAmelCase					)					):
              _UpperCamelCase              =						nums.pop(0					)
              _UpperCamelCase              =						permute(lowerCAmelCase					)
              for perm in permutations:
                     perm.append(lowerCAmelCase					)
              result.extend(lowerCAmelCase					)
              nums.append(lowerCAmelCase					)
       return result


def     SCREAMING_SNAKE_CASE			(      lowerCAmelCase					):

       def backtrack(lowerCAmelCase					):
              if start == len(lowerCAmelCase					) - 1:
                     output.append(nums[:]					)
              else:
                     for i in range(lowerCAmelCase    ,       len(lowerCAmelCase					)					):
                            _UpperCamelCase       ,		_UpperCamelCase              =						nums[i], nums[start]
                            backtrack(start + 1					)
                            _UpperCamelCase       ,		_UpperCamelCase              =						nums[i], nums[start]  # backtrack

       _UpperCamelCase              =						[]
       backtrack(0					)
       return output


if __name__ == "__main__":
       import doctest

       # use res to print the data in permute2 function
       lowercase    : Optional[Any]    	=  permutea([1, 2, 3])
       print(res)
       doctest.testmod()






