


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
SCREAMING_SNAKE_CASE_		     = sys.version_info >= (3, 1_0)



def      __lowercase     (   _SCREAMING_SNAKE_CASE=None				,		_SCREAMING_SNAKE_CASE=None			)				->     int:


      '''simple docstring'''


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

@dataclass
class 	UpperCamelCase__				:



     '''simple docstring'''

     __snake_case					:			int
     __snake_case					:			float
     __snake_case					:			str
     __snake_case					:			bool

@dataclass
class 	UpperCamelCase__				:



     '''simple docstring'''

     __snake_case					:			int				=    42
     __snake_case					:			str				=    field(default="toto"							,   metadata={"help": "help message"}     )

@dataclass
class 	UpperCamelCase__				:



     '''simple docstring'''

     __snake_case					:			bool				=    False
     __snake_case					:			bool				=    True
     __snake_case					:			Optional[bool]				=    None

class 	UpperCamelCase__				(   lowerCAmelCase_     ):



     '''simple docstring'''

     __snake_case					:			Dict				=    "titi"
     __snake_case					:			Optional[int]				=    "toto"

class 	UpperCamelCase__				(   lowerCAmelCase_     ):



     '''simple docstring'''

     __snake_case					:			str				=    "titi"
     __snake_case					:			Optional[Any]				=    "toto"
     __snake_case					:			Tuple				=    42

@dataclass
class 	UpperCamelCase__				:



     '''simple docstring'''

     __snake_case					:			BasicEnum				=    "toto"






     def        SCREAMING_SNAKE_CASE__						(							self		:					List[Any] )  ->	Dict:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE	=		BasicEnum(self.foo )

@dataclass
class 	UpperCamelCase__				:



     '''simple docstring'''

     __snake_case					:			MixedTypeEnum				=    "toto"






     def        SCREAMING_SNAKE_CASE__						(							self		:					List[str] )  ->	str:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE	=		MixedTypeEnum(self.foo )

@dataclass
class 	UpperCamelCase__				:



     '''simple docstring'''

     __snake_case					:			Optional[int]				=    None
     __snake_case					:			Optional[float]				=    field(default=lowerCAmelCase_							,   metadata={"help": "help message"}     )
     __snake_case					:			Optional[str]				=    None
     __snake_case					:			Optional[List[str]]				=    list_field(default=[]     )
     __snake_case					:			Optional[List[int]]				=    list_field(default=[]     )

@dataclass
class 	UpperCamelCase__				:



     '''simple docstring'''

     __snake_case					:			List[int]				=    list_field(default=[]     )
     __snake_case					:			List[int]				=    list_field(default=[1, 2, 3]     )
     __snake_case					:			List[str]				=    list_field(default=["Hallo", "Bonjour", "Hello"]     )
     __snake_case					:			List[float]				=    list_field(default=[0.1, 0.2, 0.3]     )

@dataclass
class 	UpperCamelCase__				:



     '''simple docstring'''

     __snake_case					:			List[int]				=    field()
     __snake_case					:			str				=    field()
     __snake_case					:			BasicEnum				=    field()






     def        SCREAMING_SNAKE_CASE__						(							self		:					Tuple )  ->	Optional[int]:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE	=		BasicEnum(self.required_enum )

@dataclass
class 	UpperCamelCase__				:



     '''simple docstring'''

     __snake_case					:			int
     __snake_case					:			"BasicEnum"				=    field()
     __snake_case					:			"Optional[bool]"				=    None
     __snake_case					:			"str"				=    field(default="toto"							,   metadata={"help": "help message"}     )
     __snake_case					:			"List[str]"				=    list_field(default=["Hallo", "Bonjour", "Hello"]     )


if is_python_no_less_than_3_10:

      @dataclass
      class 	UpperCamelCase__				:



           '''simple docstring'''

           __snake_case					:			bool				=    False
           __snake_case					:			bool				=    True
           __snake_case					:			bool | None				=    None

      @dataclass
      class 	UpperCamelCase__				:



           '''simple docstring'''

           __snake_case					:			int | None				=    None
           __snake_case					:			float | None				=    field(default=lowerCAmelCase_							,   metadata={"help": "help message"}     )
           __snake_case					:			str | None				=    None
           __snake_case					:			list[str] | None				=    list_field(default=[]     )
           __snake_case					:			list[int] | None				=    list_field(default=[]     )



class 	UpperCamelCase__				(   unittest.TestCase     ):



     '''simple docstring'''

     def        SCREAMING_SNAKE_CASE__						(							self		:					List[str]		,lowerCamelCase__		:					argparse.ArgumentParser		,lowerCamelCase__		:					argparse.ArgumentParser )  ->	Tuple:




           '''simple docstring'''


           self.assertEqual(len(a._actions )		,len(b._actions ) )
           for x, y in zip(a._actions		,b._actions ):
                 SCREAMING_SNAKE_CASE	=		{k: v for k, v in vars(lowerCamelCase__ ).items() if k != """container"""}
                 SCREAMING_SNAKE_CASE	=		{k: v for k, v in vars(lowerCamelCase__ ).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"""		,lowerCamelCase__ ) and yy.get("""choices"""		,lowerCamelCase__ ):
                       for expected_choice in yy["choices"] + xx["choices"]:
                             self.assertEqual(xx["""type"""](lowerCamelCase__ )		,yy["""type"""](lowerCamelCase__ ) )
                       del xx["type"], yy["type"]

                 self.assertEqual(lowerCamelCase__		,lowerCamelCase__ )






     def        SCREAMING_SNAKE_CASE__						(							self		:					Dict )  ->	Dict:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE	=		HfArgumentParser(lowerCamelCase__ )

           SCREAMING_SNAKE_CASE	=		argparse.ArgumentParser()
           expected.add_argument("""--foo"""		,type=lowerCamelCase__		,required=lowerCamelCase__ )
           expected.add_argument("""--bar"""		,type=lowerCamelCase__		,required=lowerCamelCase__ )
           expected.add_argument("""--baz"""		,type=lowerCamelCase__		,required=lowerCamelCase__ )
           expected.add_argument("""--flag"""		,type=lowerCamelCase__		,default=lowerCamelCase__		,const=lowerCamelCase__		,nargs="""?""" )
           self.argparsersEqual(lowerCamelCase__		,lowerCamelCase__ )

           SCREAMING_SNAKE_CASE	=		["""--foo""", """1""", """--baz""", """quux""", """--bar""", """0.5"""]
           ((SCREAMING_SNAKE_CASE      ),            )	=		parser.parse_args_into_dataclasses(lowerCamelCase__		,look_for_args_file=lowerCamelCase__ )
           self.assertFalse(example.flag )






     def        SCREAMING_SNAKE_CASE__						(							self		:					Union[str, Any] )  ->	Any:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE	=		HfArgumentParser(lowerCamelCase__ )

           SCREAMING_SNAKE_CASE	=		argparse.ArgumentParser()
           expected.add_argument("""--foo"""		,default=42		,type=lowerCamelCase__ )
           expected.add_argument("""--baz"""		,default="""toto"""		,type=lowerCamelCase__		,help="""help message""" )
           self.argparsersEqual(lowerCamelCase__		,lowerCamelCase__ )






     def        SCREAMING_SNAKE_CASE__						(							self		:					Union[str, Any] )  ->	int:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE	=		argparse.ArgumentParser()
           expected.add_argument("""--foo"""		,type=lowerCamelCase__		,default=lowerCamelCase__		,const=lowerCamelCase__		,nargs="""?""" )
           expected.add_argument("""--baz"""		,type=lowerCamelCase__		,default=lowerCamelCase__		,const=lowerCamelCase__		,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=lowerCamelCase__		,dest="""baz""" )
           expected.add_argument("""--opt"""		,type=lowerCamelCase__		,default=lowerCamelCase__ )

           SCREAMING_SNAKE_CASE	=		[WithDefaultBoolExample]
           if is_python_no_less_than_3_10:
                 dataclass_types.append(lowerCamelCase__ )

           for dataclass_type in dataclass_types:
                 SCREAMING_SNAKE_CASE	=		HfArgumentParser(lowerCamelCase__ )
                 self.argparsersEqual(lowerCamelCase__		,lowerCamelCase__ )

                 SCREAMING_SNAKE_CASE	=		parser.parse_args([] )
                 self.assertEqual(lowerCamelCase__		,Namespace(foo=lowerCamelCase__		,baz=lowerCamelCase__		,opt=lowerCamelCase__ ) )

                 SCREAMING_SNAKE_CASE	=		parser.parse_args(["""--foo""", """--no_baz"""] )
                 self.assertEqual(lowerCamelCase__		,Namespace(foo=lowerCamelCase__		,baz=lowerCamelCase__		,opt=lowerCamelCase__ ) )

                 SCREAMING_SNAKE_CASE	=		parser.parse_args(["""--foo""", """--baz"""] )
                 self.assertEqual(lowerCamelCase__		,Namespace(foo=lowerCamelCase__		,baz=lowerCamelCase__		,opt=lowerCamelCase__ ) )

                 SCREAMING_SNAKE_CASE	=		parser.parse_args(["""--foo""", """True""", """--baz""", """True""", """--opt""", """True"""] )
                 self.assertEqual(lowerCamelCase__		,Namespace(foo=lowerCamelCase__		,baz=lowerCamelCase__		,opt=lowerCamelCase__ ) )

                 SCREAMING_SNAKE_CASE	=		parser.parse_args(["""--foo""", """False""", """--baz""", """False""", """--opt""", """False"""] )
                 self.assertEqual(lowerCamelCase__		,Namespace(foo=lowerCamelCase__		,baz=lowerCamelCase__		,opt=lowerCamelCase__ ) )






     def        SCREAMING_SNAKE_CASE__						(							self		:					Dict )  ->	Optional[Any]:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE	=		HfArgumentParser(lowerCamelCase__ )

           SCREAMING_SNAKE_CASE	=		argparse.ArgumentParser()
           expected.add_argument(
               """--foo"""		,default="""toto"""		,choices=["""titi""", """toto""", 42]		,type=make_choice_type_function(["""titi""", """toto""", 42] )		,)
           self.argparsersEqual(lowerCamelCase__		,lowerCamelCase__ )

           SCREAMING_SNAKE_CASE	=		parser.parse_args([] )
           self.assertEqual(args.foo		,"""toto""" )
           SCREAMING_SNAKE_CASE	=		parser.parse_args_into_dataclasses([] )[0]
           self.assertEqual(enum_ex.foo		,MixedTypeEnum.toto )

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

           SCREAMING_SNAKE_CASE	=		parser.parse_args(["""--foo""", """42"""] )
           self.assertEqual(args.foo		,42 )
           SCREAMING_SNAKE_CASE	=		parser.parse_args_into_dataclasses(["""--foo""", """42"""] )[0]
           self.assertEqual(enum_ex.foo		,MixedTypeEnum.fourtytwo )






     def        SCREAMING_SNAKE_CASE__						(							self		:					str )  ->	List[str]:




           '''simple docstring'''


           @dataclass
           class 	UpperCamelCase__				:



                '''simple docstring'''

                __snake_case					:			Literal["titi", "toto", 42]				=    "toto"
           SCREAMING_SNAKE_CASE	=		HfArgumentParser(lowerCamelCase__ )

           SCREAMING_SNAKE_CASE	=		argparse.ArgumentParser()
           expected.add_argument(
               """--foo"""		,default="""toto"""		,choices=("""titi""", """toto""", 42)		,type=make_choice_type_function(["""titi""", """toto""", 42] )		,)
           self.argparsersEqual(lowerCamelCase__		,lowerCamelCase__ )

           SCREAMING_SNAKE_CASE	=		parser.parse_args([] )
           self.assertEqual(args.foo		,"""toto""" )

           SCREAMING_SNAKE_CASE	=		parser.parse_args(["""--foo""", """titi"""] )
           self.assertEqual(args.foo		,"""titi""" )

           SCREAMING_SNAKE_CASE	=		parser.parse_args(["""--foo""", """42"""] )
           self.assertEqual(args.foo		,42 )






     def        SCREAMING_SNAKE_CASE__						(							self		:					Optional[int] )  ->	Optional[Any]:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE	=		HfArgumentParser(lowerCamelCase__ )

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

           self.argparsersEqual(lowerCamelCase__		,lowerCamelCase__ )

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

           SCREAMING_SNAKE_CASE	=		parser.parse_args("""--foo_int 1 --bar_int 2 3 --foo_str a b c --foo_float 0.1 0.7""".split() )
           self.assertEqual(lowerCamelCase__		,Namespace(foo_int=[1]		,bar_int=[2, 3]		,foo_str=["""a""", """b""", """c"""]		,foo_float=[0.1, 0.7] ) )






     def        SCREAMING_SNAKE_CASE__						(							self		:					int )  ->	Dict:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE	=		argparse.ArgumentParser()
           expected.add_argument("""--foo"""		,default=lowerCamelCase__		,type=lowerCamelCase__ )
           expected.add_argument("""--bar"""		,default=lowerCamelCase__		,type=lowerCamelCase__		,help="""help message""" )
           expected.add_argument("""--baz"""		,default=lowerCamelCase__		,type=lowerCamelCase__ )
           expected.add_argument("""--ces"""		,nargs="""+"""		,default=[]		,type=lowerCamelCase__ )
           expected.add_argument("""--des"""		,nargs="""+"""		,default=[]		,type=lowerCamelCase__ )

           SCREAMING_SNAKE_CASE	=		[OptionalExample]
           if is_python_no_less_than_3_10:
                 dataclass_types.append(lowerCamelCase__ )

           for dataclass_type in dataclass_types:
                 SCREAMING_SNAKE_CASE	=		HfArgumentParser(lowerCamelCase__ )

                 self.argparsersEqual(lowerCamelCase__		,lowerCamelCase__ )

                 SCREAMING_SNAKE_CASE	=		parser.parse_args([] )
                 self.assertEqual(lowerCamelCase__		,Namespace(foo=lowerCamelCase__		,bar=lowerCamelCase__		,baz=lowerCamelCase__		,ces=[]		,des=[] ) )

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






     def        SCREAMING_SNAKE_CASE__						(							self		:					Tuple )  ->	List[str]:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE	=		HfArgumentParser(lowerCamelCase__ )

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






     def        SCREAMING_SNAKE_CASE__						(							self		:					str )  ->	Union[str, Any]:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE	=		HfArgumentParser(lowerCamelCase__ )

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






     def        SCREAMING_SNAKE_CASE__						(							self		:					Tuple )  ->	Dict:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE	=		HfArgumentParser(lowerCamelCase__ )

           SCREAMING_SNAKE_CASE	=		{
               """foo""": 12,
               """bar""": 3.14,
               """baz""": """42""",
               """flag""": True,
           }

           SCREAMING_SNAKE_CASE	=		parser.parse_dict(lowerCamelCase__ )[0]
           SCREAMING_SNAKE_CASE	=		BasicExample(**lowerCamelCase__ )
           self.assertEqual(lowerCamelCase__		,lowerCamelCase__ )






     def        SCREAMING_SNAKE_CASE__						(							self		:					List[Any] )  ->	List[Any]:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE	=		HfArgumentParser(lowerCamelCase__ )

           SCREAMING_SNAKE_CASE	=		{
               """foo""": 12,
               """bar""": 3.14,
               """baz""": """42""",
               """flag""": True,
               """extra""": 42,
           }

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






     def        SCREAMING_SNAKE_CASE__						(							self		:					Dict )  ->	Optional[Any]:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE	=		HfArgumentParser(lowerCamelCase__ )

           SCREAMING_SNAKE_CASE	=		{
               """foo""": 12,
               """bar""": 3.14,
               """baz""": """42""",
               """flag""": True,
           }
           with tempfile.TemporaryDirectory() as tmp_dir:
                 SCREAMING_SNAKE_CASE	=		os.path.join(lowerCamelCase__		,"""temp_json""" )
                 os.mkdir(lowerCamelCase__ )
                 with open(temp_local_path + """.json"""		,"""w+""" ) as f:
                       json.dump(lowerCamelCase__		,lowerCamelCase__ )
                 SCREAMING_SNAKE_CASE	=		parser.parse_yaml_file(Path(temp_local_path + """.json""" ) )[0]

           SCREAMING_SNAKE_CASE	=		BasicExample(**lowerCamelCase__ )
           self.assertEqual(lowerCamelCase__		,lowerCamelCase__ )






     def        SCREAMING_SNAKE_CASE__						(							self		:					Optional[int] )  ->	int:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE	=		HfArgumentParser(lowerCamelCase__ )

           SCREAMING_SNAKE_CASE	=		{
               """foo""": 12,
               """bar""": 3.14,
               """baz""": """42""",
               """flag""": True,
           }
           with tempfile.TemporaryDirectory() as tmp_dir:
                 SCREAMING_SNAKE_CASE	=		os.path.join(lowerCamelCase__		,"""temp_yaml""" )
                 os.mkdir(lowerCamelCase__ )
                 with open(temp_local_path + """.yaml"""		,"""w+""" ) as f:
                       yaml.dump(lowerCamelCase__		,lowerCamelCase__ )
                 SCREAMING_SNAKE_CASE	=		parser.parse_yaml_file(Path(temp_local_path + """.yaml""" ) )[0]
           SCREAMING_SNAKE_CASE	=		BasicExample(**lowerCamelCase__ )
           self.assertEqual(lowerCamelCase__		,lowerCamelCase__ )






     def        SCREAMING_SNAKE_CASE__						(							self		:					Any )  ->	str:




           '''simple docstring'''


           SCREAMING_SNAKE_CASE	=		HfArgumentParser(lowerCamelCase__ )
           self.assertIsNotNone(lowerCamelCase__ )









def      __lowercase     (   _SCREAMING_SNAKE_CASE				,		_SCREAMING_SNAKE_CASE			)				->     float:


      '''simple docstring'''


      def get_matched_characters(_SCREAMING_SNAKE_CASE				,		_SCREAMING_SNAKE_CASE			) -> str:
            SCREAMING_SNAKE_CASE	=		[]
            SCREAMING_SNAKE_CASE	=		min(len(_stra			)				,		len(_stra			)			) // 2
            for i, l in enumerate(_stra			):
                  SCREAMING_SNAKE_CASE	=		int(max(0				,		i - limit			)			)
                  SCREAMING_SNAKE_CASE	=		int(min(i + limit + 1				,		len(_stra			)			)			)
                  if l in _stra[left:right]:
                        matched.append(_SCREAMING_SNAKE_CASE			)
                        SCREAMING_SNAKE_CASE	=		F"""{_stra[0:_stra.index(_SCREAMING_SNAKE_CASE			)]} {_stra[_stra.index(_SCREAMING_SNAKE_CASE			) + 1:]}"""

            return "".join(_SCREAMING_SNAKE_CASE			)

      # matching characters
      SCREAMING_SNAKE_CASE	=		get_matched_characters(_SCREAMING_SNAKE_CASE				,		_SCREAMING_SNAKE_CASE			)
      SCREAMING_SNAKE_CASE	=		get_matched_characters(_SCREAMING_SNAKE_CASE				,		_SCREAMING_SNAKE_CASE			)
      SCREAMING_SNAKE_CASE	=		len(_SCREAMING_SNAKE_CASE			)

      # transposition
      SCREAMING_SNAKE_CASE	=		(
          len([(ca, ca) for ca, ca in zip(_SCREAMING_SNAKE_CASE				,		_SCREAMING_SNAKE_CASE			) if ca != ca]			) // 2
      )

      if not match_count:
            SCREAMING_SNAKE_CASE	=		0.0
      else:
            SCREAMING_SNAKE_CASE	=		(
                1
                / 3
                * (
                    match_count / len(_SCREAMING_SNAKE_CASE			)
                    + match_count / len(_SCREAMING_SNAKE_CASE			)
                    + (match_count - transpositions) / match_count
                )
            )

      # common prefix up to 4 characters
      SCREAMING_SNAKE_CASE	=		0
      for ca, ca in zip(stra[:4]				,		stra[:4]			):
            if ca == ca:
                  prefix_len += 1
            else:
                  break

      return jaro + 0.1 * prefix_len * (1 - jaro)


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      print(jaro_winkler("""hello""", """world"""))


