






'''simple docstring'''
import argparse
import json
import os
import sys
import tempfile
import unittest
from argparse import Namespace
from dataclasses import dataclass, field
from enum import Enum
from pathlib import Path
from typing import List, Literal, Optional

import yaml

from transformers import HfArgumentParser, TrainingArguments
from transformers.hf_argparser import make_choice_type_function, string_to_bool


# Since Python 3.10, we can use the builtin `|` operator for Union types
# See PEP 604: https://peps.python.org/pep-0604
UpperCamelCase__ =			sys.version_info >= (3, 10)




def 		__SCREAMING_SNAKE_CASE					(  _UpperCamelCase=None						,		_UpperCamelCase=None							):


   """simple docstring"""




   return field(default_factory=lambda: default						,		metadata=_UpperCamelCase							)


@dataclass
class        _UpperCAmelCase						:
    __lowerCamelCase:   int
    __lowerCamelCase:   float
    __lowerCamelCase:   str
    __lowerCamelCase:   bool


@dataclass
class        _UpperCAmelCase						:
    __lowerCamelCase:   int		       =    42
    __lowerCamelCase:   str		       =    field(default='toto'				,					metadata={'help': 'help message'}			)


@dataclass
class        _UpperCAmelCase						:
    __lowerCamelCase:   bool		       =    False
    __lowerCamelCase:   bool		       =    True
    __lowerCamelCase:   Optional[bool]		       =    None


class        _UpperCAmelCase						(		snake_case			):
    __lowerCamelCase:   List[Any]		       =    'titi'
    __lowerCamelCase:   Optional[Any]		       =    'toto'


class        _UpperCAmelCase						(		snake_case			):
    __lowerCamelCase:   List[Any]		       =    'titi'
    __lowerCamelCase:   List[str]		       =    'toto'
    __lowerCamelCase:   Tuple		       =    42


@dataclass
class        _UpperCAmelCase						:
    __lowerCamelCase:   BasicEnum		       =    "toto"




    def 				lowerCAmelCase__				(			self  :       Any			):






       '''simple docstring'''






       lowercase_	:    List[Any]           =     BasicEnum(self.foo			)


@dataclass
class        _UpperCAmelCase						:
    __lowerCamelCase:   MixedTypeEnum		       =    "toto"




    def 				lowerCAmelCase__				(			self  :       str			):






       '''simple docstring'''






       lowercase_	:    List[str]           =     MixedTypeEnum(self.foo			)


@dataclass
class        _UpperCAmelCase						:
    __lowerCamelCase:   Optional[int]		       =    None
    __lowerCamelCase:   Optional[float]		       =    field(default=snake_case				,					metadata={'help': 'help message'}			)
    __lowerCamelCase:   Optional[str]		       =    None
    __lowerCamelCase:   Optional[List[str]]		       =    list_field(default=[]			)
    __lowerCamelCase:   Optional[List[int]]		       =    list_field(default=[]			)


@dataclass
class        _UpperCAmelCase						:
    __lowerCamelCase:   List[int]		       =    list_field(default=[]			)
    __lowerCamelCase:   List[int]		       =    list_field(default=[1, 2, 3]			)
    __lowerCamelCase:   List[str]		       =    list_field(default=['Hallo', 'Bonjour', 'Hello']			)
    __lowerCamelCase:   List[float]		       =    list_field(default=[0.1, 0.2, 0.3]			)


@dataclass
class        _UpperCAmelCase						:
    __lowerCamelCase:   List[int]		       =    field()
    __lowerCamelCase:   str		       =    field()
    __lowerCamelCase:   BasicEnum		       =    field()




    def 				lowerCAmelCase__				(			self  :       List[str]			):






       '''simple docstring'''






       lowercase_	:    List[Any]           =     BasicEnum(self.required_enum			)


@dataclass
class        _UpperCAmelCase						:
    __lowerCamelCase:   int
    __lowerCamelCase:   "BasicEnum"		       =    field()
    __lowerCamelCase:   "Optional[bool]"		       =    None
    __lowerCamelCase:   "str"		       =    field(default='toto'				,					metadata={'help': 'help message'}			)
    __lowerCamelCase:   "List[str]"		       =    list_field(default=['Hallo', 'Bonjour', 'Hello']			)


if is_python_no_less_than_3_10:


 @dataclass
 class        _UpperCAmelCase						:
     __lowerCamelCase:   bool		       =    False
     __lowerCamelCase:   bool		       =    True
     __lowerCamelCase:   bool | None		       =    None


 @dataclass
 class        _UpperCAmelCase						:
     __lowerCamelCase:   int | None		       =    None
     __lowerCamelCase:   float | None		       =    field(default=snake_case				,					metadata={'help': 'help message'}			)
     __lowerCamelCase:   str | None		       =    None
     __lowerCamelCase:   list[str] | None		       =    list_field(default=[]			)
     __lowerCamelCase:   list[int] | None		       =    list_field(default=[]			)





class        _UpperCAmelCase						(		unittest.TestCase			):




    def 				lowerCAmelCase__				(			self  :       Any  ,     a  :       argparse.ArgumentParser  ,     a  :       argparse.ArgumentParser			):






       '''simple docstring'''






       self.assertEqual(len(a._actions			)  ,     len(b._actions			)			)
       for x, y in zip(a._actions  ,     b._actions			):
          lowercase_	:    str           =     {k: v for k, v in vars(a			).items() if k != "container"}
          lowercase_	:    List[Any]           =     {k: v for k, v in vars(a			).items() if k != "container"}

          # Choices with mixed type have custom function as "type"
          # So we need to compare results directly for equality
          if xx.get("choices"  ,     a			) and yy.get("choices"  ,     a			):
             for expected_choice in yy["choices"] + xx["choices"]:
                self.assertEqual(xx["type"](a			)  ,     yy["type"](a			)			)
             del xx["type"], yy["type"]

          self.assertEqual(a  ,     a			)




    def 				lowerCAmelCase__				(			self  :       List[str]			):






       '''simple docstring'''






       lowercase_	:    str           =     HfArgumentParser(a			)

       lowercase_	:    Any           =     argparse.ArgumentParser()
       expected.add_argument("--foo"  ,     type=a  ,     required=a			)
       expected.add_argument("--bar"  ,     type=a  ,     required=a			)
       expected.add_argument("--baz"  ,     type=a  ,     required=a			)
       expected.add_argument("--flag"  ,     type=a  ,     default=a  ,     const=a  ,     nargs="?"			)
       self.argparsersEqual(a  ,     a			)

       lowercase_	:    Tuple           =     ["--foo", "1", "--baz", "quux", "--bar", "0.5"]
       ((lowercase_)    ,		)	:    List[str]           =     parser.parse_args_into_dataclasses(a  ,     look_for_args_file=a			)
       self.assertFalse(example.flag			)




    def 				lowerCAmelCase__				(			self  :       Optional[Any]			):






       '''simple docstring'''






       lowercase_	:    int           =     HfArgumentParser(a			)

       lowercase_	:    Optional[int]           =     argparse.ArgumentParser()
       expected.add_argument("--foo"  ,     default=4_2  ,     type=a			)
       expected.add_argument("--baz"  ,     default="toto"  ,     type=a  ,     help="help message"			)
       self.argparsersEqual(a  ,     a			)




    def 				lowerCAmelCase__				(			self  :       List[str]			):






       '''simple docstring'''






       lowercase_	:    Optional[int]           =     argparse.ArgumentParser()
       expected.add_argument("--foo"  ,     type=a  ,     default=a  ,     const=a  ,     nargs="?"			)
       expected.add_argument("--baz"  ,     type=a  ,     default=a  ,     const=a  ,     nargs="?"			)
       # A boolean no_* argument always has to come after its "default: True" regular counter-part
       # and its default must be set to False
       expected.add_argument("--no_baz"  ,     action="store_false"  ,     default=a  ,     dest="baz"			)
       expected.add_argument("--opt"  ,     type=a  ,     default=a			)

       lowercase_	:    str           =     [WithDefaultBoolExample]
       if is_python_no_less_than_3_10:
          dataclass_types.append(a			)

       for dataclass_type in dataclass_types:
          lowercase_	:    Tuple           =     HfArgumentParser(a			)
          self.argparsersEqual(a  ,     a			)

          lowercase_	:    str           =     parser.parse_args([]			)
          self.assertEqual(a  ,     Namespace(foo=a  ,     baz=a  ,     opt=a			)			)

          lowercase_	:    Union[str, Any]           =     parser.parse_args(["--foo", "--no_baz"]			)
          self.assertEqual(a  ,     Namespace(foo=a  ,     baz=a  ,     opt=a			)			)

          lowercase_	:    Tuple           =     parser.parse_args(["--foo", "--baz"]			)
          self.assertEqual(a  ,     Namespace(foo=a  ,     baz=a  ,     opt=a			)			)

          lowercase_	:    Dict           =     parser.parse_args(["--foo", "True", "--baz", "True", "--opt", "True"]			)
          self.assertEqual(a  ,     Namespace(foo=a  ,     baz=a  ,     opt=a			)			)

          lowercase_	:    Tuple           =     parser.parse_args(["--foo", "False", "--baz", "False", "--opt", "False"]			)
          self.assertEqual(a  ,     Namespace(foo=a  ,     baz=a  ,     opt=a			)			)




    def 				lowerCAmelCase__				(			self  :       Union[str, Any]			):






       '''simple docstring'''






       lowercase_	:    List[Any]           =     HfArgumentParser(a			)

       lowercase_	:    str           =     argparse.ArgumentParser()
       expected.add_argument(
           "--foo"  ,     default="toto"  ,     choices=["titi", "toto", 4_2]  ,     type=make_choice_type_function(["titi", "toto", 4_2]			)  ,     )
       self.argparsersEqual(a  ,     a			)

       lowercase_	:    List[Any]           =     parser.parse_args([]			)
       self.assertEqual(args.foo  ,     "toto"			)
       lowercase_	:    Union[str, Any]           =     parser.parse_args_into_dataclasses([]			)[0]
       self.assertEqual(enum_ex.foo  ,     MixedTypeEnum.toto			)

       lowercase_	:    Tuple           =     parser.parse_args(["--foo", "titi"]			)
       self.assertEqual(args.foo  ,     "titi"			)
       lowercase_	:    Any           =     parser.parse_args_into_dataclasses(["--foo", "titi"]			)[0]
       self.assertEqual(enum_ex.foo  ,     MixedTypeEnum.titi			)

       lowercase_	:    Any           =     parser.parse_args(["--foo", "42"]			)
       self.assertEqual(args.foo  ,     4_2			)
       lowercase_	:    str           =     parser.parse_args_into_dataclasses(["--foo", "42"]			)[0]
       self.assertEqual(enum_ex.foo  ,     MixedTypeEnum.fourtytwo			)




    def 				lowerCAmelCase__				(			self  :       List[Any]			):






       '''simple docstring'''






       @dataclass
       class        _UpperCAmelCase						:
           __lowerCamelCase:   Literal["titi", "toto", 42]		       =    "toto"


       lowercase_	:    int           =     HfArgumentParser(a			)

       lowercase_	:    List[Any]           =     argparse.ArgumentParser()
       expected.add_argument(
           "--foo"  ,     default="toto"  ,     choices=("titi", "toto", 4_2)  ,     type=make_choice_type_function(["titi", "toto", 4_2]			)  ,     )
       self.argparsersEqual(a  ,     a			)

       lowercase_	:    Any           =     parser.parse_args([]			)
       self.assertEqual(args.foo  ,     "toto"			)

       lowercase_	:    List[Any]           =     parser.parse_args(["--foo", "titi"]			)
       self.assertEqual(args.foo  ,     "titi"			)

       lowercase_	:    str           =     parser.parse_args(["--foo", "42"]			)
       self.assertEqual(args.foo  ,     4_2			)




    def 				lowerCAmelCase__				(			self  :       List[str]			):






       '''simple docstring'''






       lowercase_	:    List[Any]           =     HfArgumentParser(a			)

       lowercase_	:    List[str]           =     argparse.ArgumentParser()
       expected.add_argument("--foo_int"  ,     nargs="+"  ,     default=[]  ,     type=a			)
       expected.add_argument("--bar_int"  ,     nargs="+"  ,     default=[1, 2, 3]  ,     type=a			)
       expected.add_argument("--foo_str"  ,     nargs="+"  ,     default=["Hallo", "Bonjour", "Hello"]  ,     type=a			)
       expected.add_argument("--foo_float"  ,     nargs="+"  ,     default=[0.1, 0.2, 0.3]  ,     type=a			)

       self.argparsersEqual(a  ,     a			)

       lowercase_	:    Dict           =     parser.parse_args([]			)
       self.assertEqual(
           a  ,     Namespace(foo_int=[]  ,     bar_int=[1, 2, 3]  ,     foo_str=["Hallo", "Bonjour", "Hello"]  ,     foo_float=[0.1, 0.2, 0.3]			)  ,     )

       lowercase_	:    Union[str, Any]           =     parser.parse_args("--foo_int 1 --bar_int 2 3 --foo_str a b c --foo_float 0.1 0.7".split()			)
       self.assertEqual(a  ,     Namespace(foo_int=[1]  ,     bar_int=[2, 3]  ,     foo_str=["a", "b", "c"]  ,     foo_float=[0.1, 0.7]			)			)




    def 				lowerCAmelCase__				(			self  :       int			):






       '''simple docstring'''






       lowercase_	:    Optional[Any]           =     argparse.ArgumentParser()
       expected.add_argument("--foo"  ,     default=a  ,     type=a			)
       expected.add_argument("--bar"  ,     default=a  ,     type=a  ,     help="help message"			)
       expected.add_argument("--baz"  ,     default=a  ,     type=a			)
       expected.add_argument("--ces"  ,     nargs="+"  ,     default=[]  ,     type=a			)
       expected.add_argument("--des"  ,     nargs="+"  ,     default=[]  ,     type=a			)

       lowercase_	:    int           =     [OptionalExample]
       if is_python_no_less_than_3_10:
          dataclass_types.append(a			)

       for dataclass_type in dataclass_types:
          lowercase_	:    Optional[Any]           =     HfArgumentParser(a			)

          self.argparsersEqual(a  ,     a			)

          lowercase_	:    Any           =     parser.parse_args([]			)
          self.assertEqual(a  ,     Namespace(foo=a  ,     bar=a  ,     baz=a  ,     ces=[]  ,     des=[]			)			)

          lowercase_	:    Optional[int]           =     parser.parse_args("--foo 12 --bar 3.14 --baz 42 --ces a b c --des 1 2 3".split()			)
          self.assertEqual(a  ,     Namespace(foo=1_2  ,     bar=3.14  ,     baz="42"  ,     ces=["a", "b", "c"]  ,     des=[1, 2, 3]			)			)




    def 				lowerCAmelCase__				(			self  :       Optional[int]			):






       '''simple docstring'''






       lowercase_	:    List[str]           =     HfArgumentParser(a			)

       lowercase_	:    Any           =     argparse.ArgumentParser()
       expected.add_argument("--required_list"  ,     nargs="+"  ,     type=a  ,     required=a			)
       expected.add_argument("--required_str"  ,     type=a  ,     required=a			)
       expected.add_argument(
           "--required_enum"  ,     type=make_choice_type_function(["titi", "toto"]			)  ,     choices=["titi", "toto"]  ,     required=a  ,     )
       self.argparsersEqual(a  ,     a			)




    def 				lowerCAmelCase__				(			self  :       int			):






       '''simple docstring'''






       lowercase_	:    str           =     HfArgumentParser(a			)

       lowercase_	:    str           =     argparse.ArgumentParser()
       expected.add_argument("--foo"  ,     type=a  ,     required=a			)
       expected.add_argument(
           "--required_enum"  ,     type=make_choice_type_function(["titi", "toto"]			)  ,     choices=["titi", "toto"]  ,     required=a  ,     )
       expected.add_argument("--opt"  ,     type=a  ,     default=a			)
       expected.add_argument("--baz"  ,     default="toto"  ,     type=a  ,     help="help message"			)
       expected.add_argument("--foo_str"  ,     nargs="+"  ,     default=["Hallo", "Bonjour", "Hello"]  ,     type=a			)
       self.argparsersEqual(a  ,     a			)




    def 				lowerCAmelCase__				(			self  :       List[Any]			):






       '''simple docstring'''






       lowercase_	:    Tuple           =     HfArgumentParser(a			)

       lowercase_	:    Any           =     {
           "foo": 1_2,
           "bar": 3.14,
           "baz": "42",
           "flag": True,
       }

       lowercase_	:    Dict           =     parser.parse_dict(a			)[0]
       lowercase_	:    Optional[Any]           =     BasicExample(**a			)
       self.assertEqual(a  ,     a			)




    def 				lowerCAmelCase__				(			self  :       Tuple			):






       '''simple docstring'''






       lowercase_	:    Dict           =     HfArgumentParser(a			)

       lowercase_	:    Union[str, Any]           =     {
           "foo": 1_2,
           "bar": 3.14,
           "baz": "42",
           "flag": True,
           "extra": 4_2,
       }

       self.assertRaises(a  ,     parser.parse_dict  ,     a  ,     allow_extra_keys=a			)




    def 				lowerCAmelCase__				(			self  :       Any			):






       '''simple docstring'''






       lowercase_	:    Optional[Any]           =     HfArgumentParser(a			)

       lowercase_	:    Optional[Any]           =     {
           "foo": 1_2,
           "bar": 3.14,
           "baz": "42",
           "flag": True,
       }
       with tempfile.TemporaryDirectory() as tmp_dir:
          lowercase_	:    str           =     os.path.join(a  ,     "temp_json"			)
          os.mkdir(a			)
          with open(temp_local_path + ".json"  ,     "w+"			) as f:
             json.dump(a  ,     a			)
          lowercase_	:    int           =     parser.parse_yaml_file(Path(temp_local_path + ".json"			)			)[0]

       lowercase_	:    Union[str, Any]           =     BasicExample(**a			)
       self.assertEqual(a  ,     a			)




    def 				lowerCAmelCase__				(			self  :       List[Any]			):






       '''simple docstring'''






       lowercase_	:    Tuple           =     HfArgumentParser(a			)

       lowercase_	:    Optional[int]           =     {
           "foo": 1_2,
           "bar": 3.14,
           "baz": "42",
           "flag": True,
       }
       with tempfile.TemporaryDirectory() as tmp_dir:
          lowercase_	:    int           =     os.path.join(a  ,     "temp_yaml"			)
          os.mkdir(a			)
          with open(temp_local_path + ".yaml"  ,     "w+"			) as f:
             yaml.dump(a  ,     a			)
          lowercase_	:    Optional[int]           =     parser.parse_yaml_file(Path(temp_local_path + ".yaml"			)			)[0]
       lowercase_	:    List[Any]           =     BasicExample(**a			)
       self.assertEqual(a  ,     a			)





    def 				lowerCAmelCase__				(			self  :       Optional[Any]			):






       '''simple docstring'''






       lowercase_	:    Union[str, Any]           =     HfArgumentParser(a			)
       self.assertIsNotNone(a			)












'''simple docstring'''
def 		__SCREAMING_SNAKE_CASE					(  _UpperCamelCase							):


   """simple docstring"""




   lowercase_	:    Any           =     False
   while is_sorted is False:  # Until all the indices are traversed keep looping
      lowercase_	:    List[str]           =     True
      for i in range(0						,		len(_UpperCamelCase							) - 1						,		2							):  # iterating over all even indices
         if input_list[i] > input_list[i + 1]:
            lowercase_    ,		lowercase_	:    Union[str, Any]           =     input_list[i + 1], input_list[i]
            # swapping if elements not in order
            lowercase_	:    Any           =     False

      for i in range(1						,		len(_UpperCamelCase							) - 1						,		2							):  # iterating over all odd indices
         if input_list[i] > input_list[i + 1]:
            lowercase_    ,		lowercase_	:    Tuple           =     input_list[i + 1], input_list[i]
            # swapping if elements not in order
            lowercase_	:    List[Any]           =     False
   return input_list


if __name__ == "__main__":
 print('Enter list to be sorted')
 UpperCamelCase__ =			[int(x) for x in input().split()]
 # inputing elements of the list in one line
 UpperCamelCase__ =			odd_even_sort(input_list)
 print('The sorted list is')
 print(sorted_list)




