


def 							__lowercase   ( __lowerCAmelCase							:				list[int]   ):
							a__             =     []
							if len(__lowerCAmelCase   ) == 1:
														return [nums.copy()]
							for _ in range(len(__lowerCAmelCase   )   ):
														a__             =     nums.pop(0   )
														a__             =     permute(__lowerCAmelCase   )
														for perm in permutations:
																					perm.append(__lowerCAmelCase   )
														result.extend(__lowerCAmelCase   )
														nums.append(__lowerCAmelCase   )
							return result






def 							__lowercase   ( __lowerCAmelCase							:				Optional[int]   ):

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

							a__             =     []
							backtrack(0   )
							return output


if __name__ == "__main__":
						import doctest

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








from argparse import ArgumentParser

from .env import EnvironmentCommand






def 							__lowercase   ( ):
							a__             =     ArgumentParser('Diffusers CLI tool'					,    usage='diffusers-cli <command> [<args>]'   )
							a__             =     parser.add_subparsers(help='diffusers-cli command helpers'   )

							# Register commands
							EnvironmentCommand.register_subcommand(__lowerCAmelCase   )

							# Let's go
							a__             =     parser.parse_args()

							if not hasattr(__lowerCAmelCase					,    'func'   ):
														parser.print_help()
														exit(1   )

							# Run
							a__             =     args.func(__lowerCAmelCase   )
							service.run()


if __name__ == "__main__":
						main()




