"""simple docstring"""





# Copyright 2021 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from argparse import ArgumentParser

from accelerate.commands.config import get_config_parser
from accelerate.commands.env import env_command_parser
from accelerate.commands.launch import launch_command_parser
from accelerate.commands.test import test_command_parser
from accelerate.commands.tpu import tpu_command_parser



def      lowerCamelCase_()->    Tuple:
							_SCREAMING_SNAKE_CASE		:						List[str]			  =    ArgumentParser("""Accelerate CLI tool"""     ,	usage="""accelerate <command> [<args>]"""     ,	allow_abbrev=__SCREAMING_SNAKE_CASE  )
							_SCREAMING_SNAKE_CASE		:						int			  =    parser.add_subparsers(help="""accelerate command helpers"""  )

							# Register commands
							get_config_parser(subparsers=__SCREAMING_SNAKE_CASE  )
							env_command_parser(subparsers=__SCREAMING_SNAKE_CASE  )
							launch_command_parser(subparsers=__SCREAMING_SNAKE_CASE  )
							tpu_command_parser(subparsers=__SCREAMING_SNAKE_CASE  )
							test_command_parser(subparsers=__SCREAMING_SNAKE_CASE  )

							# Let's go
							_SCREAMING_SNAKE_CASE		:						Optional[Any]			  =    parser.parse_args()

							if not hasattr(__SCREAMING_SNAKE_CASE     ,	"""func"""  ):
														parser.print_help()
														exit(1  )

							# Run
							args.func(__SCREAMING_SNAKE_CASE  )


if __name__ == "__main__":
			main()



"""simple docstring"""





from __future__ import annotations



def      lowerCamelCase_(__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE     ,	__SCREAMING_SNAKE_CASE     ,	)->    tuple:
							if (electron_conc, hole_conc, intrinsic_conc).count(0  ) != 1:
														raise ValueError("""You cannot supply more or less than 2 values"""  )
							elif electron_conc < 0:
														raise ValueError("""Electron concentration cannot be negative in a semiconductor"""  )
							elif hole_conc < 0:
														raise ValueError("""Hole concentration cannot be negative in a semiconductor"""  )
							elif intrinsic_conc < 0:
														raise ValueError(
														    """Intrinsic concentration cannot be negative in a semiconductor"""  )
							elif electron_conc == 0:
														return (
														    "electron_conc",
														    intrinsic_conc**2 / hole_conc,
														)
							elif hole_conc == 0:
														return (
														    "hole_conc",
														    intrinsic_conc**2 / electron_conc,
														)
							elif intrinsic_conc == 0:
														return (
														    "intrinsic_conc",
														    (electron_conc * hole_conc) ** 0.5,
														)
							else:
														return (-1, -1)


if __name__ == "__main__":
			import doctest

			doctest.testmod()


