'''simple docstring'''


import importlib
import sys
from argparse import REMAINDER, ArgumentParser
from pathlib import Path

import torch_xla.distributed.xla_multiprocessing as xmp





def       lowerCAmelCase					(		):


	"""simple docstring"""
	__UpperCAmelCase							=			ArgumentParser(
	    description=(
	        '''PyTorch TPU distributed training launch '''
	        '''helper utility that will spawn up '''
	        '''multiple distributed processes'''
	    )       )

	# Optional arguments for the launch helper
	parser.add_argument('''--num_cores'''    ,					type=UpperCamelCase__    ,					default=1    ,					help='''Number of TPU cores to use (1 or 8).'''       )

	# positional
	parser.add_argument(
	    '''training_script'''    ,					type=UpperCamelCase__    ,					help=(
	        '''The full path to the single TPU training '''
	        '''program/script to be launched in parallel, '''
	        '''followed by all the arguments for the '''
	        '''training script'''
	    )    ,					)

	# rest from the training program
	parser.add_argument('''training_script_args'''    ,					nargs=UpperCamelCase__       )

	return parser.parse_args()





def       lowerCAmelCase					(		):


	"""simple docstring"""
	__UpperCAmelCase							=			parse_args()

	# Import training_script as a module.
	__UpperCAmelCase							=			Path(args.training_script       )
	sys.path.append(str(script_fpath.parent.resolve()       )       )
	__UpperCAmelCase							=			script_fpath.stem
	__UpperCAmelCase							=			importlib.import_module(UpperCamelCase__       )

	# Patch sys.argv
	__UpperCAmelCase							=			[args.training_script] + args.training_script_args + ['''--tpu_num_cores''', str(args.num_cores       )]
	xmp.spawn(mod._mp_fn    ,					args=()    ,					nprocs=args.num_cores       )


if __name__ == "__main__":
					main()

'''simple docstring'''


import requests
from bsa import BeautifulSoup





def       lowerCAmelCase					(		UpperCamelCase__				:   str = "AAPL"       ):


	"""simple docstring"""
	__UpperCAmelCase							=			f"""https://in.finance.yahoo.com/quote/{symbol}?s={symbol}"""
	__UpperCAmelCase							=			BeautifulSoup(requests.get(UpperCamelCase__       ).text    ,					'''html.parser'''       )
	__UpperCAmelCase							=			'''My(6px) Pos(r) smartphone_Mt(6px)'''
	return soup.find('''div'''    ,					class_=class_       ).find('''span'''       ).text


if __name__ == "__main__":
					for symbol in "AAPL AMZN IBM GOOG MSFT ORCL".split():
										print(F"""Current {symbol:<4} stock price is {stock_price(symbol):>8}""")
