






'''simple docstring'''





def __UpperCAmelCase   (					A					:			list[int]		)    ->   Optional[int]:
			UpperCAmelCase_      :       List[Any]          =       []
			if len(_SCREAMING_SNAKE_CASE		) == 1:
						return [nums.copy()]
			for _ in range(len(_SCREAMING_SNAKE_CASE		)		):
						UpperCAmelCase_      :       str          =       nums.pop(0		)
						UpperCAmelCase_      :       Union[str, Any]          =       permute(_SCREAMING_SNAKE_CASE		)
						for perm in permutations:
									perm.append(_SCREAMING_SNAKE_CASE		)
						result.extend(_SCREAMING_SNAKE_CASE		)
						nums.append(_SCREAMING_SNAKE_CASE		)
			return result
def __UpperCAmelCase   (					A					:			int		)    ->   Union[str, Any]:




			def backtrack(A					:			str		):
						if start == len(_SCREAMING_SNAKE_CASE		) - 1:
									output.append(nums[:]		)
						else:
									for i in range(_SCREAMING_SNAKE_CASE			,       len(_SCREAMING_SNAKE_CASE		)		):
												UpperCAmelCase_    ,      UpperCAmelCase_      :       Any          =       nums[i], nums[start]
												backtrack(start + 1		)
												UpperCAmelCase_    ,      UpperCAmelCase_      :       Dict          =       nums[i], nums[start]  # backtrack

			UpperCAmelCase_      :       List[Any]          =       []
			backtrack(0		)
			return output


if __name__ == "__main__":
						import doctest

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






'''simple docstring'''





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_sentencepiece_available


UpperCAmelCase__  			=				{}

try:
					if not is_sentencepiece_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					UpperCAmelCase__  			=				['''BartphoTokenizer''']

if TYPE_CHECKING:
					try:
										if not is_sentencepiece_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .tokenization_bartpho import BartphoTokenizer

else:
					import sys

					UpperCAmelCase__  			=				_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)



