

"""simple docstring"""

def 				__UpperCamelCase   (    a__: List[str] ,	a__: Optional[Any]			)				->			Tuple:




					"""simple docstring"""



					if len(str(a__			)			) == 1 or len(str(a__			)			) == 1:
										return a * b

					__lowercase												=			max(len(str(a__			)			) ,	len(str(a__			)			)			)
					__lowercase												=			ma // 2

					__lowercase						, __lowercase												=			divmod(a__ ,	10**ma			)
					__lowercase						, __lowercase												=			divmod(a__ ,	10**ma			)

					__lowercase												=			karatsuba(a__ ,	a__			)
					__lowercase												=			karatsuba((aa + aa) ,	(ba + ba)			)
					__lowercase												=			karatsuba(a__ ,	a__			)

					return (z * 10 ** (2 * ma)) + ((y - z - x) * 10 ** (ma)) + (x)





def 				__UpperCamelCase   (    )				->			List[Any]:




					"""simple docstring"""



					print(karatsuba(1_54_63 ,	2_34_89			)			)


if __name__ == "__main__":
							main()





"""simple docstring"""

import json
import logging
import os
import subprocess
from argparse import ArgumentParser


a__ :	List[str]						= logging.getLogger(__name__)





def 				__UpperCamelCase   (    )				->			Optional[Any]:




					"""simple docstring"""



					__lowercase												=			ArgumentParser()
					__lowercase						, __lowercase												=			parser.parse_known_args()
					for arg in unknown:
										if arg.startswith(('''-''', '''--''')			):
															parser.add_argument(arg.split('''='''			)[0]			)

					return parser.parse_args()





def 				__UpperCamelCase   (    )				->			int:




					"""simple docstring"""



					__lowercase												=			parse_args()
					__lowercase												=			88_88
					__lowercase												=			int(os.environ['''SM_NUM_GPUS''']			)
					__lowercase												=			json.loads(os.environ['''SM_HOSTS''']			)
					__lowercase												=			len(a__			)
					__lowercase												=			os.environ['''SM_CURRENT_HOST''']
					__lowercase												=			hosts.index(a__			)
					__lowercase												=			'''INFO'''

					if num_nodes > 1:
										__lowercase												=			f'''python -m torch.distributed.launch \
                --nnodes={num_nodes}  \
                --node_rank={rank}  \
                --nproc_per_node={num_gpus}  \
                --master_addr={hosts[0]}  \
                --master_port={port} \
                ./run_glue.py \
                {"".join(["nested fstring" for parameter,value in args.__dict__.items()]			)}'''
					else:
										__lowercase												=			f'''python -m torch.distributed.launch \
            --nproc_per_node={num_gpus}  \
            ./run_glue.py \
            {"".join(["nested fstring" for parameter,value in args.__dict__.items()]			)}'''
					try:
										subprocess.run(a__ ,	shell=a__			)
					except Exception as e:
										logger.info(a__			)


if __name__ == "__main__":
							main()


