





from argparse import ArgumentParser

from .add_new_model import AddNewModelCommand
from .add_new_model_like import AddNewModelLikeCommand
from .convert import ConvertCommand
from .download import DownloadCommand
from .env import EnvironmentCommand
from .lfs import LfsCommands
from .pt_to_tf import PTtoTFCommand
from .run import RunCommand
from .serving import ServeCommand
from .user import UserCommands




def     __UpperCamelCase						()       ->     Optional[int]:
  lowercase__			    =						ArgumentParser('Transformers CLI tool'	,		usage='transformers-cli <command> [<args>]'	)
  lowercase__			    =						parser.add_subparsers(help='transformers-cli command helpers'	)

  # Register commands
  ConvertCommand.register_subcommand(_SCREAMING_SNAKE_CASE	)
  DownloadCommand.register_subcommand(_SCREAMING_SNAKE_CASE	)
  EnvironmentCommand.register_subcommand(_SCREAMING_SNAKE_CASE	)
  RunCommand.register_subcommand(_SCREAMING_SNAKE_CASE	)
  ServeCommand.register_subcommand(_SCREAMING_SNAKE_CASE	)
  UserCommands.register_subcommand(_SCREAMING_SNAKE_CASE	)
  AddNewModelCommand.register_subcommand(_SCREAMING_SNAKE_CASE	)
  AddNewModelLikeCommand.register_subcommand(_SCREAMING_SNAKE_CASE	)
  LfsCommands.register_subcommand(_SCREAMING_SNAKE_CASE	)
  PTtoTFCommand.register_subcommand(_SCREAMING_SNAKE_CASE	)

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

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

  # Run
  lowercase__			    =						args.func(_SCREAMING_SNAKE_CASE	)
  service.run()


if __name__ == "__main__":
      main()









def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	)       ->     bool:
  if not isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	):
    raise ValueError('Input series is not valid, valid series - [2, 4, 6]'	)
  if len(_SCREAMING_SNAKE_CASE	) == 0:
    raise ValueError('Input list must be a non empty list'	)
  if len(_SCREAMING_SNAKE_CASE	) == 1:
    return True
  lowercase__			    =						series[1] - series[0]
  for index in range(len(_SCREAMING_SNAKE_CASE	) - 1	):
    if series[index + 1] - series[index] != common_diff:
      return False
  return True




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	)       ->     float:
  if not isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	):
    raise ValueError('Input series is not valid, valid series - [2, 4, 6]'	)
  if len(_SCREAMING_SNAKE_CASE	) == 0:
    raise ValueError('Input list must be a non empty list'	)
  lowercase__			    =						0
  for val in series:
    answer += val
  return answer / len(_SCREAMING_SNAKE_CASE	)


if __name__ == "__main__":
      import doctest

      doctest.testmod()


