


'''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
__snake_case    						=sys.version_info >= (3, 10)





def 	a_					( lowerCamelCase	:     List[Any]=None	, lowerCamelCase	:     Tuple=None				):
   return field(default_factory=lambda: default	, metadata=lowerCamelCase				)

@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_      (  __lowercase		):
     lowerCamelCase				:	List[Any]		=     '''titi'''
     lowerCamelCase				:	List[str]		=     '''toto'''




class 		UpperCAmelCase_      (  __lowercase		):
     lowerCamelCase				:	List[str]		=     '''titi'''
     lowerCamelCase				:	Any		=     '''toto'''
     lowerCamelCase				:	Union[str, Any]		=     42




@dataclass
class 		UpperCAmelCase_      :
     lowerCamelCase				:	BasicEnum		=     "toto"





     def 							__UpperCAmelCase      ( self       :      Dict    )				->  Union[str, Any]:
        lowerCAmelCase     =			BasicEnum(self.foo    )




@dataclass
class 		UpperCAmelCase_      :
     lowerCamelCase				:	MixedTypeEnum		=     "toto"





     def 							__UpperCAmelCase      ( self       :      int    )				->  Dict:
        lowerCAmelCase     =			MixedTypeEnum(self.foo    )




@dataclass
class 		UpperCAmelCase_      :
     lowerCamelCase				:	Optional[int]		=     None
     lowerCamelCase				:	Optional[float]		=     field(default=__lowercase       ,	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 							__UpperCAmelCase      ( self       :      List[str]    )				->  Optional[int]:
        lowerCAmelCase     =			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=__lowercase       ,	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 							__UpperCAmelCase      ( self       :      Any    ,      UpperCAmelCase__       :      argparse.ArgumentParser    ,      UpperCAmelCase__       :      argparse.ArgumentParser    )				->  Dict:
        self.assertEqual(len(a._actions    )    ,      len(b._actions    )    )
        for x, y in zip(a._actions    ,      b._actions    ):
           lowerCAmelCase     =			{k: v for k, v in vars(UpperCAmelCase__    ).items() if k != 'container'}
           lowerCAmelCase     =			{k: v for k, v in vars(UpperCAmelCase__    ).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'    ,      UpperCAmelCase__    ) and yy.get('choices'    ,      UpperCAmelCase__    ):
              for expected_choice in yy["choices"] + xx["choices"]:
                 self.assertEqual(xx['type'](UpperCAmelCase__    )    ,      yy['type'](UpperCAmelCase__    )    )
              del xx["type"], yy["type"]

           self.assertEqual(UpperCAmelCase__    ,      UpperCAmelCase__    )





     def 							__UpperCAmelCase      ( self       :      List[Any]    )				->  Tuple:
        lowerCAmelCase     =			HfArgumentParser(UpperCAmelCase__    )

        lowerCAmelCase     =			argparse.ArgumentParser()
        expected.add_argument('--foo'    ,      type=UpperCAmelCase__    ,      required=UpperCAmelCase__    )
        expected.add_argument('--bar'    ,      type=UpperCAmelCase__    ,      required=UpperCAmelCase__    )
        expected.add_argument('--baz'    ,      type=UpperCAmelCase__    ,      required=UpperCAmelCase__    )
        expected.add_argument('--flag'    ,      type=UpperCAmelCase__    ,      default=UpperCAmelCase__    ,      const=UpperCAmelCase__    ,      nargs='?'    )
        self.argparsersEqual(UpperCAmelCase__    ,      UpperCAmelCase__    )

        lowerCAmelCase     =			['--foo', '1', '--baz', 'quux', '--bar', '0.5']
        ((lowerCAmelCase)     ,  )     =			parser.parse_args_into_dataclasses(UpperCAmelCase__    ,      look_for_args_file=UpperCAmelCase__    )
        self.assertFalse(example.flag    )





     def 							__UpperCAmelCase      ( self       :      int    )				->  int:
        lowerCAmelCase     =			HfArgumentParser(UpperCAmelCase__    )

        lowerCAmelCase     =			argparse.ArgumentParser()
        expected.add_argument('--foo'    ,      default=4_2    ,      type=UpperCAmelCase__    )
        expected.add_argument('--baz'    ,      default='toto'    ,      type=UpperCAmelCase__    ,      help='help message'    )
        self.argparsersEqual(UpperCAmelCase__    ,      UpperCAmelCase__    )





     def 							__UpperCAmelCase      ( self       :      Any    )				->  str:
        lowerCAmelCase     =			argparse.ArgumentParser()
        expected.add_argument('--foo'    ,      type=UpperCAmelCase__    ,      default=UpperCAmelCase__    ,      const=UpperCAmelCase__    ,      nargs='?'    )
        expected.add_argument('--baz'    ,      type=UpperCAmelCase__    ,      default=UpperCAmelCase__    ,      const=UpperCAmelCase__    ,      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=UpperCAmelCase__    ,      dest='baz'    )
        expected.add_argument('--opt'    ,      type=UpperCAmelCase__    ,      default=UpperCAmelCase__    )

        lowerCAmelCase     =			[WithDefaultBoolExample]
        if is_python_no_less_than_3_10:
           dataclass_types.append(UpperCAmelCase__    )

        for dataclass_type in dataclass_types:
           lowerCAmelCase     =			HfArgumentParser(UpperCAmelCase__    )
           self.argparsersEqual(UpperCAmelCase__    ,      UpperCAmelCase__    )

           lowerCAmelCase     =			parser.parse_args([]    )
           self.assertEqual(UpperCAmelCase__    ,      Namespace(foo=UpperCAmelCase__    ,      baz=UpperCAmelCase__    ,      opt=UpperCAmelCase__    )    )

           lowerCAmelCase     =			parser.parse_args(['--foo', '--no_baz']    )
           self.assertEqual(UpperCAmelCase__    ,      Namespace(foo=UpperCAmelCase__    ,      baz=UpperCAmelCase__    ,      opt=UpperCAmelCase__    )    )

           lowerCAmelCase     =			parser.parse_args(['--foo', '--baz']    )
           self.assertEqual(UpperCAmelCase__    ,      Namespace(foo=UpperCAmelCase__    ,      baz=UpperCAmelCase__    ,      opt=UpperCAmelCase__    )    )

           lowerCAmelCase     =			parser.parse_args(['--foo', 'True', '--baz', 'True', '--opt', 'True']    )
           self.assertEqual(UpperCAmelCase__    ,      Namespace(foo=UpperCAmelCase__    ,      baz=UpperCAmelCase__    ,      opt=UpperCAmelCase__    )    )

           lowerCAmelCase     =			parser.parse_args(['--foo', 'False', '--baz', 'False', '--opt', 'False']    )
           self.assertEqual(UpperCAmelCase__    ,      Namespace(foo=UpperCAmelCase__    ,      baz=UpperCAmelCase__    ,      opt=UpperCAmelCase__    )    )





     def 							__UpperCAmelCase      ( self       :      Dict    )				->  Union[str, Any]:
        lowerCAmelCase     =			HfArgumentParser(UpperCAmelCase__    )

        lowerCAmelCase     =			argparse.ArgumentParser()
        expected.add_argument(
            '--foo'    ,      default='toto'    ,      choices=['titi', 'toto', 4_2]    ,      type=make_choice_type_function(['titi', 'toto', 4_2]    )    ,      )
        self.argparsersEqual(UpperCAmelCase__    ,      UpperCAmelCase__    )

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

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

        lowerCAmelCase     =			parser.parse_args(['--foo', '42']    )
        self.assertEqual(args.foo    ,      4_2    )
        lowerCAmelCase     =			parser.parse_args_into_dataclasses(['--foo', '42']    )[0]
        self.assertEqual(enum_ex.foo    ,      MixedTypeEnum.fourtytwo    )





     def 							__UpperCAmelCase      ( self       :      int    )				->  Dict:

        @dataclass
        class 		UpperCAmelCase_      :
             lowerCamelCase				:	Literal["titi", "toto", 42]		=     "toto"




        lowerCAmelCase     =			HfArgumentParser(UpperCAmelCase__    )

        lowerCAmelCase     =			argparse.ArgumentParser()
        expected.add_argument(
            '--foo'    ,      default='toto'    ,      choices=('titi', 'toto', 4_2)    ,      type=make_choice_type_function(['titi', 'toto', 4_2]    )    ,      )
        self.argparsersEqual(UpperCAmelCase__    ,      UpperCAmelCase__    )

        lowerCAmelCase     =			parser.parse_args([]    )
        self.assertEqual(args.foo    ,      'toto'    )

        lowerCAmelCase     =			parser.parse_args(['--foo', 'titi']    )
        self.assertEqual(args.foo    ,      'titi'    )

        lowerCAmelCase     =			parser.parse_args(['--foo', '42']    )
        self.assertEqual(args.foo    ,      4_2    )





     def 							__UpperCAmelCase      ( self       :      Union[str, Any]    )				->  List[Any]:
        lowerCAmelCase     =			HfArgumentParser(UpperCAmelCase__    )

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

        self.argparsersEqual(UpperCAmelCase__    ,      UpperCAmelCase__    )

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

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





     def 							__UpperCAmelCase      ( self       :      Tuple    )				->  Union[str, Any]:
        lowerCAmelCase     =			argparse.ArgumentParser()
        expected.add_argument('--foo'    ,      default=UpperCAmelCase__    ,      type=UpperCAmelCase__    )
        expected.add_argument('--bar'    ,      default=UpperCAmelCase__    ,      type=UpperCAmelCase__    ,      help='help message'    )
        expected.add_argument('--baz'    ,      default=UpperCAmelCase__    ,      type=UpperCAmelCase__    )
        expected.add_argument('--ces'    ,      nargs='+'    ,      default=[]    ,      type=UpperCAmelCase__    )
        expected.add_argument('--des'    ,      nargs='+'    ,      default=[]    ,      type=UpperCAmelCase__    )

        lowerCAmelCase     =			[OptionalExample]
        if is_python_no_less_than_3_10:
           dataclass_types.append(UpperCAmelCase__    )

        for dataclass_type in dataclass_types:
           lowerCAmelCase     =			HfArgumentParser(UpperCAmelCase__    )

           self.argparsersEqual(UpperCAmelCase__    ,      UpperCAmelCase__    )

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

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





     def 							__UpperCAmelCase      ( self       :      Any    )				->  List[str]:
        lowerCAmelCase     =			HfArgumentParser(UpperCAmelCase__    )

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





     def 							__UpperCAmelCase      ( self       :      Dict    )				->  Optional[Any]:
        lowerCAmelCase     =			HfArgumentParser(UpperCAmelCase__    )

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





     def 							__UpperCAmelCase      ( self       :      Union[str, Any]    )				->  Any:
        lowerCAmelCase     =			HfArgumentParser(UpperCAmelCase__    )

        lowerCAmelCase     =			{
            'foo': 1_2,
            'bar': 3.14,
            'baz': '42',
            'flag': True,
        }

        lowerCAmelCase     =			parser.parse_dict(UpperCAmelCase__    )[0]
        lowerCAmelCase     =			BasicExample(**UpperCAmelCase__    )
        self.assertEqual(UpperCAmelCase__    ,      UpperCAmelCase__    )





     def 							__UpperCAmelCase      ( self       :      List[Any]    )				->  List[Any]:
        lowerCAmelCase     =			HfArgumentParser(UpperCAmelCase__    )

        lowerCAmelCase     =			{
            'foo': 1_2,
            'bar': 3.14,
            'baz': '42',
            'flag': True,
            'extra': 4_2,
        }

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





     def 							__UpperCAmelCase      ( self       :      int    )				->  List[str]:
        lowerCAmelCase     =			HfArgumentParser(UpperCAmelCase__    )

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

        lowerCAmelCase     =			BasicExample(**UpperCAmelCase__    )
        self.assertEqual(UpperCAmelCase__    ,      UpperCAmelCase__    )





     def 							__UpperCAmelCase      ( self       :      Optional[int]    )				->  List[Any]:
        lowerCAmelCase     =			HfArgumentParser(UpperCAmelCase__    )

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





     def 							__UpperCAmelCase      ( self       :      Any    )				->  int:
        lowerCAmelCase     =			HfArgumentParser(UpperCAmelCase__    )
        self.assertIsNotNone(UpperCAmelCase__    )













"""simple docstring"""




import unittest

import numpy as np

def 			lowerCAmelCase__     (     UpperCamelCase__     ,   UpperCamelCase__     ,   UpperCamelCase__     ,   UpperCamelCase__ = None     ,   ):



  '''simple docstring'''
  _a  :       List[Any]             =	np.shape(UpperCamelCase__				)
  _a  :       Any             =	np.shape(UpperCamelCase__				)
  _a  :       Union[str, Any]             =	np.shape(UpperCamelCase__				)

  if shape_a[0] != shape_b[0]:
    _a  :       int             =	(
        """Expected the same number of rows for A and B. """
        F"""Instead found A of size {shape_a} and B of size {shape_b}"""
    )
    raise ValueError(UpperCamelCase__				)

  if shape_b[1] != shape_c[1]:
    _a  :       Tuple             =	(
        """Expected the same number of columns for B and C. """
        F"""Instead found B of size {shape_b} and C of size {shape_c}"""
    )
    raise ValueError(UpperCamelCase__				)

  _a  :       int             =	pseudo_inv
  if a_inv is None:
    try:
      _a  :       Optional[int]             =	np.linalg.inv(UpperCamelCase__				)
    except np.linalg.LinAlgError:
      raise ValueError(
          """Input matrix A is not invertible. Cannot compute Schur complement."""				)

  return mat_c - mat_b.T @ a_inv @ mat_b






class        UpperCamelCase			(	unittest.TestCase      ):


 def _lowercase	(     self		:						int							)					->       None:
   _a  :       str             =	np.array([[1, 2, 1], [2, 1, 2], [3, 2, 4]]							)
   _a  :       Tuple             =	np.array([[0, 3], [3, 0], [2, 3]]							)
   _a  :       Optional[int]             =	np.array([[2, 1], [6, 3]]							)

   _a  :       Optional[Any]             =	schur_complement(UpperCAmelCase__							,						UpperCAmelCase__							,						UpperCAmelCase__							)

   _a  :       Union[str, Any]             =	np.block([[a, b], [b.T, c]]							)

   _a  :       int             =	np.linalg.det(UpperCAmelCase__							)
   _a  :       Union[str, Any]             =	np.linalg.det(UpperCAmelCase__							)
   _a  :       List[Any]             =	np.linalg.det(UpperCAmelCase__							)

   self.assertAlmostEqual(UpperCAmelCase__							,						det_a * det_s							)


 def _lowercase	(     self		:						int							)					->       None:
   _a  :       Optional[int]             =	np.array([[1, 2, 1], [2, 1, 2], [3, 2, 4]]							)
   _a  :       Optional[int]             =	np.array([[0, 3], [3, 0], [2, 3]]							)
   _a  :       Union[str, Any]             =	np.array([[2, 1], [6, 3]]							)

   with self.assertRaises(UpperCAmelCase__							):
     schur_complement(UpperCAmelCase__							,						UpperCAmelCase__							,						UpperCAmelCase__							)







 def _lowercase	(     self		:						List[Any]							)					->       None:
   _a  :       Any             =	np.array([[1, 2, 1], [2, 1, 2], [3, 2, 4]]							)
   _a  :       Dict             =	np.array([[0, 3], [3, 0], [2, 3]]							)
   _a  :       List[Any]             =	np.array([[2, 1, 3], [6, 3, 5]]							)

   with self.assertRaises(UpperCAmelCase__							):
     schur_complement(UpperCAmelCase__							,						UpperCAmelCase__							,						UpperCAmelCase__							)


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 unittest.main()

