






"""simple docstring"""


def        UpperCAmelCase      (					a__ ):





						'''simple docstring'''






						lowerCAmelCase   :List[Any]						=			[]
						if len(a__ ) == 1:
												return [nums.copy()]
						for _ in range(len(a__ ) ):
												lowerCAmelCase   :str						=			nums.pop(0 )
												lowerCAmelCase   :int						=			permute(a__ )
												for perm in permutations:
																		perm.append(a__ )
												result.extend(a__ )
												nums.append(a__ )
						return result


def        UpperCAmelCase      (					a__ ):





						'''simple docstring'''






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

						lowerCAmelCase   :Union[str, Any]						=			[]
						backtrack(0 )
						return output


if __name__ == "__main__":
		import doctest

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







"""simple docstring"""


from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


__SCREAMING_SNAKE_CASE   =   {
    'configuration_transfo_xl': ['TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP', 'TransfoXLConfig'],
    'tokenization_transfo_xl': ['TransfoXLCorpus', 'TransfoXLTokenizer'],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__SCREAMING_SNAKE_CASE   =   [
		    'TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'AdaptiveEmbedding',
		    'TransfoXLForSequenceClassification',
		    'TransfoXLLMHeadModel',
		    'TransfoXLModel',
		    'TransfoXLPreTrainedModel',
		    'load_tf_weights_in_transfo_xl',
		]

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__SCREAMING_SNAKE_CASE   =   [
		    'TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'TFAdaptiveEmbedding',
		    'TFTransfoXLForSequenceClassification',
		    'TFTransfoXLLMHeadModel',
		    'TFTransfoXLMainLayer',
		    'TFTransfoXLModel',
		    'TFTransfoXLPreTrainedModel',
		]


if TYPE_CHECKING:
		from .configuration_transfo_xl import TRANSFO_XL_PRETRAINED_CONFIG_ARCHIVE_MAP, TransfoXLConfig
		from .tokenization_transfo_xl import TransfoXLCorpus, TransfoXLTokenizer

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_transfo_xl import (
				    TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST,
				    AdaptiveEmbedding,
				    TransfoXLForSequenceClassification,
				    TransfoXLLMHeadModel,
				    TransfoXLModel,
				    TransfoXLPreTrainedModel,
				    load_tf_weights_in_transfo_xl,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_transfo_xl import (
				    TF_TRANSFO_XL_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFAdaptiveEmbedding,
				    TFTransfoXLForSequenceClassification,
				    TFTransfoXLLMHeadModel,
				    TFTransfoXLMainLayer,
				    TFTransfoXLModel,
				    TFTransfoXLPreTrainedModel,
				)

else:
		import sys

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