code: 
  
  """simple docstring"""
  
  
  
  
  import importlib
  import sys
  from argparse import REMAINDER, ArgumentParser
  from pathlib import Path
  
  import torch_xla.distributed.xla_multiprocessing as xmp
  def      __SCREAMING_SNAKE_CASE		(		):
  					"""simple docstring"""
  					A    =      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=lowercase__    ,							default=1    ,							help="Number of TPU cores to use (1 or 8)."   )
  
  					# positional
  					parser.add_argument(
  					    "training_script"    ,							type=lowercase__    ,							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=lowercase__   )
  
  					return parser.parse_args()
  def      __SCREAMING_SNAKE_CASE		(		):
  					"""simple docstring"""
  					A    =      parse_args()
  
  					# Import training_script as a module.
  					A    =      Path(args.training_script   )
  					sys.path.append(str(script_fpath.parent.resolve()   )   )
  					A    =      script_fpath.stem
  					A    =      importlib.import_module(lowercase__   )
  
  					# Patch sys.argv
  					A    =      [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()
  
  
  
  
  
  
style_context: 
  
  """simple docstring"""
  
  
  
  
  import os
  
  from ...utils import logging
  from .utils import DataProcessor, InputExample
  
  
  __A  :					List[Any]												=	logging.get_logger(__name__)
  
  
  
  
  
  class     __UpperCamelCase				(     _A		):
  
  
  		def __init__(self				:	Dict  ,  __SCREAMING_SNAKE_CASE				:	int  ,  __SCREAMING_SNAKE_CASE				:	Any=None):
  							A    =      language
  							A    =      train_language
  
  
  		def       SCREAMING_SNAKE_CASE__     (self				:	Tuple  ,  __SCREAMING_SNAKE_CASE				:	Tuple):
  							A    =      self.language if self.train_language is None else self.train_language
  							A    =      self._read_tsv(os.path.join(__SCREAMING_SNAKE_CASE  ,  F"""XNLI-MT-1.0/multinli/multinli.train.{lg}.tsv"""))
  							A    =      []
  							for i, line in enumerate(__SCREAMING_SNAKE_CASE):
  												if i == 0:
  																	continue
  												A    =      F"""train-{i}"""
  												A    =      line[0]
  												A    =      line[1]
  												A    =      "contradiction" if line[2] == "contradictory" else line[2]
  												if not isinstance(__SCREAMING_SNAKE_CASE  ,  __SCREAMING_SNAKE_CASE):
  																	raise ValueError(F"""Training input {text_a} is not a string""")
  												if not isinstance(__SCREAMING_SNAKE_CASE  ,  __SCREAMING_SNAKE_CASE):
  																	raise ValueError(F"""Training input {text_b} is not a string""")
  												if not isinstance(__SCREAMING_SNAKE_CASE  ,  __SCREAMING_SNAKE_CASE):
  																	raise ValueError(F"""Training label {label} is not a string""")
  												examples.append(InputExample(guid=__SCREAMING_SNAKE_CASE  ,  text_a=__SCREAMING_SNAKE_CASE  ,  text_b=__SCREAMING_SNAKE_CASE  ,  label=__SCREAMING_SNAKE_CASE))
  							return examples
  
  
  		def       SCREAMING_SNAKE_CASE__     (self				:	List[str]  ,  __SCREAMING_SNAKE_CASE				:	Tuple):
  							A    =      self._read_tsv(os.path.join(__SCREAMING_SNAKE_CASE  ,  "XNLI-1.0/xnli.test.tsv"))
  							A    =      []
  							for i, line in enumerate(__SCREAMING_SNAKE_CASE):
  												if i == 0:
  																	continue
  												A    =      line[0]
  												if language != self.language:
  																	continue
  												A    =      F"""test-{i}"""
  												A    =      line[6]
  												A    =      line[7]
  												A    =      line[1]
  												if not isinstance(__SCREAMING_SNAKE_CASE  ,  __SCREAMING_SNAKE_CASE):
  																	raise ValueError(F"""Training input {text_a} is not a string""")
  												if not isinstance(__SCREAMING_SNAKE_CASE  ,  __SCREAMING_SNAKE_CASE):
  																	raise ValueError(F"""Training input {text_b} is not a string""")
  												if not isinstance(__SCREAMING_SNAKE_CASE  ,  __SCREAMING_SNAKE_CASE):
  																	raise ValueError(F"""Training label {label} is not a string""")
  												examples.append(InputExample(guid=__SCREAMING_SNAKE_CASE  ,  text_a=__SCREAMING_SNAKE_CASE  ,  text_b=__SCREAMING_SNAKE_CASE  ,  label=__SCREAMING_SNAKE_CASE))
  							return examples
  
  
  		def       SCREAMING_SNAKE_CASE__     (self				:	str):
  							return ["contradiction", "entailment", "neutral"]
  
  __A  :					Optional[int]												=	{
      'xnli': XnliProcessor,
  }
  
  __A  :					Union[str, Any]												=	{
      'xnli': 'classification',
  }
  
  __A  :					Tuple												=	{
      'xnli': 3,
  }
  
  
  
  
  
  