






"""simple docstring"""



def 						_SCREAMING_SNAKE_CASE (    __snake_case			:  List[str]		,					__snake_case			:  Union[str, Any]    ):





  '''simple docstring'''





  lowercase							    =       [1]
  for i in range(2		,					__snake_case    ):
    factorials.append(factorials[-1] * i    )
  assert 0 <= k < factorials[-1] * n, "k out of bounds"

  lowercase							    =       []
  lowercase							    =       list(range(__snake_case    )    )

  # Find permutation
  while factorials:
    lowercase							    =       factorials.pop()
    lowercase    ,     lowercase							    =       divmod(__snake_case		,					__snake_case    )
    permutation.append(elements[number]    )
    elements.remove(elements[number]    )
  permutation.append(elements[0]    )

  return permutation


if __name__ == "__main__":
    import doctest

    doctest.testmod()










"""simple docstring"""



from argparse import ArgumentParser

from .env import EnvironmentCommand
def 						_SCREAMING_SNAKE_CASE (    ):





  '''simple docstring'''





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

  # Register commands
  EnvironmentCommand.register_subcommand(__snake_case    )

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

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

  # Run
  lowercase							    =       args.func(__snake_case    )
  service.run()


if __name__ == "__main__":
    main()


