Coverage for pydantic/utils.py: 100.00%

Shortcuts on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

336 statements  

1import warnings linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

2import weakref linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

3from collections import OrderedDict, defaultdict, deque linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

4from copy import deepcopy linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

5from itertools import islice, zip_longest linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

6from types import BuiltinFunctionType, CodeType, FunctionType, GeneratorType, LambdaType, ModuleType linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

7from typing import ( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

8 TYPE_CHECKING, 

9 AbstractSet, 

10 Any, 

11 Callable, 

12 Collection, 

13 Dict, 

14 Generator, 

15 Iterable, 

16 Iterator, 

17 List, 

18 Mapping, 

19 Optional, 

20 Set, 

21 Tuple, 

22 Type, 

23 TypeVar, 

24 Union, 

25) 

26 

27from typing_extensions import Annotated linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

28 

29from .errors import ConfigError linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

30from .typing import ( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

31 NoneType, 

32 WithArgsTypes, 

33 all_literal_values, 

34 display_as_type, 

35 get_args, 

36 get_origin, 

37 is_literal_type, 

38 is_union, 

39) 

40from .version import version_info linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

41 

42if TYPE_CHECKING: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

43 from inspect import Signature 

44 from pathlib import Path 

45 

46 from .config import BaseConfig 

47 from .dataclasses import Dataclass 

48 from .fields import ModelField 

49 from .main import BaseModel 

50 from .typing import AbstractSetIntStr, DictIntStrAny, IntStr, MappingIntStrAny, ReprArgs 

51 

52__all__ = ( linux-py3.8-compiled-no-deps-nolinux-py3.9-compiled-no-deps-nolinux-py3.10-compiled-no-deps-nolinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

53 'import_string', 

54 'sequence_like', 

55 'validate_field_name', 

56 'lenient_isinstance', 

57 'lenient_issubclass', 

58 'in_ipython', 

59 'deep_update', 

60 'update_not_none', 

61 'almost_equal_floats', 

62 'get_model', 

63 'to_camel', 

64 'is_valid_field', 

65 'smart_deepcopy', 

66 'PyObjectStr', 

67 'Representation', 

68 'GetterDict', 

69 'ValueItems', 

70 'version_info', # required here to match behaviour in v1.3 

71 'ClassAttribute', 

72 'path_type', 

73 'ROOT_KEY', 

74 'get_unique_discriminator_alias', 

75 'get_discriminator_alias_and_values', 

76) 

77 

78ROOT_KEY = '__root__' linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

79# these are types that are returned unchanged by deepcopy 

80IMMUTABLE_NON_COLLECTIONS_TYPES: Set[Type[Any]] = { linux-py3.8-compiled-no-deps-nolinux-py3.9-compiled-no-deps-nolinux-py3.10-compiled-no-deps-nolinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

81 int, 

82 float, 

83 complex, 

84 str, 

85 bool, 

86 bytes, 

87 type, 

88 NoneType, 

89 FunctionType, 

90 BuiltinFunctionType, 

91 LambdaType, 

92 weakref.ref, 

93 CodeType, 

94 # note: including ModuleType will differ from behaviour of deepcopy by not producing error. 

95 # It might be not a good idea in general, but considering that this function used only internally 

96 # against default values of fields, this will allow to actually have a field with module as default value 

97 ModuleType, 

98 NotImplemented.__class__, 

99 Ellipsis.__class__, 

100} 

101 

102# these are types that if empty, might be copied with simple copy() instead of deepcopy() 

103BUILTIN_COLLECTIONS: Set[Type[Any]] = { linux-py3.8-compiled-no-deps-nolinux-py3.9-compiled-no-deps-nolinux-py3.10-compiled-no-deps-nolinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

104 list, 

105 set, 

106 tuple, 

107 frozenset, 

108 dict, 

109 OrderedDict, 

110 defaultdict, 

111 deque, 

112} 

113 

114 

115def import_string(dotted_path: str) -> Any: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

116 """ 

117 Stolen approximately from django. Import a dotted module path and return the attribute/class designated by the 

118 last name in the path. Raise ImportError if the import fails. 

119 """ 

120 from importlib import import_module linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

121 

122 try: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

123 module_path, class_name = dotted_path.strip(' ').rsplit('.', 1) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

124 except ValueError as e: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

125 raise ImportError(f'"{dotted_path}" doesn\'t look like a module path') from e linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

126 

127 module = import_module(module_path) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

128 try: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

129 return getattr(module, class_name) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

130 except AttributeError as e: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

131 raise ImportError(f'Module "{module_path}" does not define a "{class_name}" attribute') from e linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

132 

133 

134def truncate(v: Union[str], *, max_len: int = 80) -> str: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

135 """ 

136 Truncate a value and add a unicode ellipsis (three dots) to the end if it was too long 

137 """ 

138 warnings.warn('`truncate` is no-longer used by pydantic and is deprecated', DeprecationWarning) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

139 if isinstance(v, str) and len(v) > (max_len - 2): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

140 # -3 so quote + string + … + quote has correct length 

141 return (v[: (max_len - 3)] + '…').__repr__() linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

142 try: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

143 v = v.__repr__() linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

144 except TypeError: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

145 v = v.__class__.__repr__(v) # in case v is a type linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

146 if len(v) > max_len: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

147 v = v[: max_len - 1] + '…' linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

148 return v linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

149 

150 

151def sequence_like(v: Any) -> bool: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

152 return isinstance(v, (list, tuple, set, frozenset, GeneratorType, deque)) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

153 

154 

155def validate_field_name(bases: List[Type['BaseModel']], field_name: str) -> None: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

156 """ 

157 Ensure that the field's name does not shadow an existing attribute of the model. 

158 """ 

159 for base in bases: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

160 if getattr(base, field_name, None): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

161 raise NameError( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

162 f'Field name "{field_name}" shadows a BaseModel attribute; ' 

163 f'use a different field name with "alias=\'{field_name}\'".' 

164 ) 

165 

166 

167def lenient_isinstance(o: Any, class_or_tuple: Union[Type[Any], Tuple[Type[Any], ...], None]) -> bool: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

168 try: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

169 return isinstance(o, class_or_tuple) # type: ignore[arg-type] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

170 except TypeError: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

171 return False linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

172 

173 

174def lenient_issubclass(cls: Any, class_or_tuple: Union[Type[Any], Tuple[Type[Any], ...], None]) -> bool: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

175 try: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

176 return isinstance(cls, type) and issubclass(cls, class_or_tuple) # type: ignore[arg-type] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

177 except TypeError: linux-py3.9-compiled-no-deps-nolinux-py3.10-compiled-no-deps-nomacos-py3.9macos-py3.10windows-py3.9windows-py3.10

178 if isinstance(cls, WithArgsTypes): linux-py3.9-compiled-no-deps-nolinux-py3.10-compiled-no-deps-nomacos-py3.9macos-py3.10windows-py3.9windows-py3.10

179 return False linux-py3.9-compiled-no-deps-nolinux-py3.10-compiled-no-deps-nomacos-py3.9macos-py3.10windows-py3.9windows-py3.10

180 raise # pragma: no cover 

181 

182 

183def in_ipython() -> bool: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

184 """ 

185 Check whether we're in an ipython environment, including jupyter notebooks. 

186 """ 

187 try: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

188 eval('__IPYTHON__') linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

189 except NameError: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

190 return False linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

191 else: # pragma: no cover 

192 return True 

193 

194 

195KeyType = TypeVar('KeyType') linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

196 

197 

198def deep_update(mapping: Dict[KeyType, Any], *updating_mappings: Dict[KeyType, Any]) -> Dict[KeyType, Any]: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

199 updated_mapping = mapping.copy() linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

200 for updating_mapping in updating_mappings: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

201 for k, v in updating_mapping.items(): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

202 if k in updated_mapping and isinstance(updated_mapping[k], dict) and isinstance(v, dict): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

203 updated_mapping[k] = deep_update(updated_mapping[k], v) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

204 else: 

205 updated_mapping[k] = v linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

206 return updated_mapping linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

207 

208 

209def update_not_none(mapping: Dict[Any, Any], **update: Any) -> None: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

210 mapping.update({k: v for k, v in update.items() if v is not None}) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

211 

212 

213def almost_equal_floats(value_1: float, value_2: float, *, delta: float = 1e-8) -> bool: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

214 """ 

215 Return True if two floats are almost equal 

216 """ 

217 return abs(value_1 - value_2) <= delta linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

218 

219 

220def generate_model_signature( linux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

221 init: Callable[..., None], fields: Dict[str, 'ModelField'], config: Type['BaseConfig'] 

222) -> 'Signature': 

223 """ 

224 Generate signature for model based on its fields 

225 """ 

226 from inspect import Parameter, Signature, signature linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

227 

228 from .config import Extra linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

229 

230 present_params = signature(init).parameters.values() linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

231 merged_params: Dict[str, Parameter] = {} linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

232 var_kw = None linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

233 use_var_kw = False linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

234 

235 for param in islice(present_params, 1, None): # skip self arg linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

236 if param.kind is param.VAR_KEYWORD: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

237 var_kw = param linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

238 continue linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

239 merged_params[param.name] = param linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

240 

241 if var_kw: # if custom init has no var_kw, fields which are not declared in it cannot be passed through linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

242 allow_names = config.allow_population_by_field_name linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

243 for field_name, field in fields.items(): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

244 param_name = field.alias linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

245 if field_name in merged_params or param_name in merged_params: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

246 continue linux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.10windows-py3.10

247 elif not param_name.isidentifier(): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

248 if allow_names and field_name.isidentifier(): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

249 param_name = field_name linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

250 else: 

251 use_var_kw = True linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

252 continue linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

253 

254 # TODO: replace annotation with actual expected types once #1055 solved 

255 kwargs = {'default': field.default} if not field.required else {} linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

256 merged_params[param_name] = Parameter( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

257 param_name, Parameter.KEYWORD_ONLY, annotation=field.outer_type_, **kwargs 

258 ) 

259 

260 if config.extra is Extra.allow: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

261 use_var_kw = True linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

262 

263 if var_kw and use_var_kw: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

264 # Make sure the parameter for extra kwargs 

265 # does not have the same name as a field 

266 default_model_signature = [ linux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

267 ('__pydantic_self__', Parameter.POSITIONAL_OR_KEYWORD), 

268 ('data', Parameter.VAR_KEYWORD), 

269 ] 

270 if [(p.name, p.kind) for p in present_params] == default_model_signature: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

271 # if this is the standard model signature, use extra_data as the extra args name 

272 var_kw_name = 'extra_data' linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

273 else: 

274 # else start from var_kw 

275 var_kw_name = var_kw.name linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

276 

277 # generate a name that's definitely unique 

278 while var_kw_name in fields: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

279 var_kw_name += '_' linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

280 merged_params[var_kw_name] = var_kw.replace(name=var_kw_name) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

281 

282 return Signature(parameters=list(merged_params.values()), return_annotation=None) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

283 

284 

285def get_model(obj: Union[Type['BaseModel'], Type['Dataclass']]) -> Type['BaseModel']: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

286 from .main import BaseModel linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

287 

288 try: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

289 model_cls = obj.__pydantic_model__ # type: ignore linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

290 except AttributeError: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

291 model_cls = obj linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

292 

293 if not issubclass(model_cls, BaseModel): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

294 raise TypeError('Unsupported type, must be either BaseModel or dataclass') linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

295 return model_cls linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

296 

297 

298def to_camel(string: str) -> str: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

299 return ''.join(word.capitalize() for word in string.split('_')) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

300 

301 

302T = TypeVar('T') linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

303 

304 

305def unique_list( linux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

306 input_list: Union[List[T], Tuple[T, ...]], 

307 *, 

308 name_factory: Callable[[T], str] = str, 

309) -> List[T]: 

310 """ 

311 Make a list unique while maintaining order. 

312 We update the list if another one with the same name is set 

313 (e.g. root validator overridden in subclass) 

314 """ 

315 result: List[T] = [] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

316 result_names: List[str] = [] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

317 for v in input_list: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

318 v_name = name_factory(v) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

319 if v_name not in result_names: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

320 result_names.append(v_name) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

321 result.append(v) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

322 else: 

323 result[result_names.index(v_name)] = v linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

324 

325 return result linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

326 

327 

328class PyObjectStr(str): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

329 """ 

330 String class where repr doesn't include quotes. Useful with Representation when you want to return a string 

331 representation of something that valid (or pseudo-valid) python. 

332 """ 

333 

334 def __repr__(self) -> str: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

335 return str(self) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

336 

337 

338class Representation: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

339 """ 

340 Mixin to provide __str__, __repr__, and __pretty__ methods. See #884 for more details. 

341 

342 __pretty__ is used by [devtools](https://python-devtools.helpmanual.io/) to provide human readable representations 

343 of objects. 

344 """ 

345 

346 __slots__: Tuple[str, ...] = tuple() linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

347 

348 def __repr_args__(self) -> 'ReprArgs': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

349 """ 

350 Returns the attributes to show in __str__, __repr__, and __pretty__ this is generally overridden. 

351 

352 Can either return: 

353 * name - value pairs, e.g.: `[('foo_name', 'foo'), ('bar_name', ['b', 'a', 'r'])]` 

354 * or, just values, e.g.: `[(None, 'foo'), (None, ['b', 'a', 'r'])]` 

355 """ 

356 attrs = ((s, getattr(self, s)) for s in self.__slots__) linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

357 return [(a, v) for a, v in attrs if v is not None] linux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

358 

359 def __repr_name__(self) -> str: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

360 """ 

361 Name of the instance's class, used in __repr__. 

362 """ 

363 return self.__class__.__name__ linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

364 

365 def __repr_str__(self, join_str: str) -> str: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

366 return join_str.join(repr(v) if a is None else f'{a}={v!r}' for a, v in self.__repr_args__()) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

367 

368 def __pretty__(self, fmt: Callable[[Any], Any], **kwargs: Any) -> Generator[Any, None, None]: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

369 """ 

370 Used by devtools (https://python-devtools.helpmanual.io/) to provide a human readable representations of objects 

371 """ 

372 yield self.__repr_name__() + '(' linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

373 yield 1 linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

374 for name, value in self.__repr_args__(): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

375 if name is not None: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

376 yield name + '=' linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

377 yield fmt(value) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

378 yield ',' linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

379 yield 0 linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

380 yield -1 linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

381 yield ')' linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

382 

383 def __str__(self) -> str: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

384 return self.__repr_str__(' ') linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

385 

386 def __repr__(self) -> str: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

387 return f'{self.__repr_name__()}({self.__repr_str__(", ")})' linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

388 

389 

390class GetterDict(Representation): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

391 """ 

392 Hack to make object's smell just enough like dicts for validate_model. 

393 

394 We can't inherit from Mapping[str, Any] because it upsets cython so we have to implement all methods ourselves. 

395 """ 

396 

397 __slots__ = ('_obj',) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

398 

399 def __init__(self, obj: Any): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

400 self._obj = obj linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

401 

402 def __getitem__(self, key: str) -> Any: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

403 try: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

404 return getattr(self._obj, key) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

405 except AttributeError as e: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

406 raise KeyError(key) from e linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

407 

408 def get(self, key: Any, default: Any = None) -> Any: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

409 return getattr(self._obj, key, default) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

410 

411 def extra_keys(self) -> Set[Any]: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

412 """ 

413 We don't want to get any other attributes of obj if the model didn't explicitly ask for them 

414 """ 

415 return set() linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

416 

417 def keys(self) -> List[Any]: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

418 """ 

419 Keys of the pseudo dictionary, uses a list not set so order information can be maintained like python 

420 dictionaries. 

421 """ 

422 return list(self) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

423 

424 def values(self) -> List[Any]: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

425 return [self[k] for k in self] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

426 

427 def items(self) -> Iterator[Tuple[str, Any]]: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

428 for k in self: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

429 yield k, self.get(k) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

430 

431 def __iter__(self) -> Iterator[str]: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

432 for name in dir(self._obj): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

433 if not name.startswith('_'): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

434 yield name linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

435 

436 def __len__(self) -> int: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

437 return sum(1 for _ in self) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

438 

439 def __contains__(self, item: Any) -> bool: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

440 return item in self.keys() linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

441 

442 def __eq__(self, other: Any) -> bool: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

443 return dict(self) == dict(other.items()) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

444 

445 def __repr_args__(self) -> 'ReprArgs': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

446 return [(None, dict(self))] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

447 

448 def __repr_name__(self) -> str: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

449 return f'GetterDict[{display_as_type(self._obj)}]' linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

450 

451 

452class ValueItems(Representation): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

453 """ 

454 Class for more convenient calculation of excluded or included fields on values. 

455 """ 

456 

457 __slots__ = ('_items', '_type') linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

458 

459 def __init__(self, value: Any, items: Union['AbstractSetIntStr', 'MappingIntStrAny']) -> None: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

460 items = self._coerce_items(items) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

461 

462 if isinstance(value, (list, tuple)): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

463 items = self._normalize_indexes(items, len(value)) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

464 

465 self._items: 'MappingIntStrAny' = items linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

466 

467 def is_excluded(self, item: Any) -> bool: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

468 """ 

469 Check if item is fully excluded. 

470 

471 :param item: key or index of a value 

472 """ 

473 return self.is_true(self._items.get(item)) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

474 

475 def is_included(self, item: Any) -> bool: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

476 """ 

477 Check if value is contained in self._items 

478 

479 :param item: key or index of value 

480 """ 

481 return item in self._items linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

482 

483 def for_element(self, e: 'IntStr') -> Optional[Union['AbstractSetIntStr', 'MappingIntStrAny']]: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

484 """ 

485 :param e: key or index of element on value 

486 :return: raw values for element if self._items is dict and contain needed element 

487 """ 

488 

489 item = self._items.get(e) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

490 return item if not self.is_true(item) else None linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

491 

492 def _normalize_indexes(self, items: 'MappingIntStrAny', v_length: int) -> 'DictIntStrAny': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

493 """ 

494 :param items: dict or set of indexes which will be normalized 

495 :param v_length: length of sequence indexes of which will be 

496 

497 >>> self._normalize_indexes({0: True, -2: True, -1: True}, 4) 

498 {0: True, 2: True, 3: True} 

499 >>> self._normalize_indexes({'__all__': True}, 4) 

500 {0: True, 1: True, 2: True, 3: True} 

501 """ 

502 

503 normalized_items: 'DictIntStrAny' = {} linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

504 all_items = None linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

505 for i, v in items.items(): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

506 if not (isinstance(v, Mapping) or isinstance(v, AbstractSet) or self.is_true(v)): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

507 raise TypeError(f'Unexpected type of exclude value for index "{i}" {v.__class__}') linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

508 if i == '__all__': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

509 all_items = self._coerce_value(v) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

510 continue linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

511 if not isinstance(i, int): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

512 raise TypeError( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

513 'Excluding fields from a sequence of sub-models or dicts must be performed index-wise: ' 

514 'expected integer keys or keyword "__all__"' 

515 ) 

516 normalized_i = v_length + i if i < 0 else i linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

517 normalized_items[normalized_i] = self.merge(v, normalized_items.get(normalized_i)) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

518 

519 if not all_items: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

520 return normalized_items linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

521 if self.is_true(all_items): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

522 for i in range(v_length): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

523 normalized_items.setdefault(i, ...) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

524 return normalized_items linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

525 for i in range(v_length): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

526 normalized_item = normalized_items.setdefault(i, {}) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

527 if not self.is_true(normalized_item): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

528 normalized_items[i] = self.merge(all_items, normalized_item) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

529 return normalized_items linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

530 

531 @classmethod linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

532 def merge(cls, base: Any, override: Any, intersect: bool = False) -> Any: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

533 """ 

534 Merge a ``base`` item with an ``override`` item. 

535 

536 Both ``base`` and ``override`` are converted to dictionaries if possible. 

537 Sets are converted to dictionaries with the sets entries as keys and 

538 Ellipsis as values. 

539 

540 Each key-value pair existing in ``base`` is merged with ``override``, 

541 while the rest of the key-value pairs are updated recursively with this function. 

542 

543 Merging takes place based on the "union" of keys if ``intersect`` is 

544 set to ``False`` (default) and on the intersection of keys if 

545 ``intersect`` is set to ``True``. 

546 """ 

547 override = cls._coerce_value(override) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

548 base = cls._coerce_value(base) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

549 if override is None: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

550 return base linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

551 if cls.is_true(base) or base is None: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

552 return override linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

553 if cls.is_true(override): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

554 return base if intersect else override linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

555 

556 # intersection or union of keys while preserving ordering: 

557 if intersect: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

558 merge_keys = [k for k in base if k in override] + [k for k in override if k in base] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

559 else: 

560 merge_keys = list(base) + [k for k in override if k not in base] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

561 

562 merged: 'DictIntStrAny' = {} linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

563 for k in merge_keys: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

564 merged_item = cls.merge(base.get(k), override.get(k), intersect=intersect) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

565 if merged_item is not None: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

566 merged[k] = merged_item linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

567 

568 return merged linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

569 

570 @staticmethod linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

571 def _coerce_items(items: Union['AbstractSetIntStr', 'MappingIntStrAny']) -> 'MappingIntStrAny': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

572 if isinstance(items, Mapping): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

573 pass linux-py3.7-compiled-no-deps-nolinux-py3.8-compiled-no-deps-nolinux-py3.9-compiled-no-deps-nolinux-py3.10-compiled-no-deps-nomacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

574 elif isinstance(items, AbstractSet): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

575 items = dict.fromkeys(items, ...) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

576 else: 

577 class_name = getattr(items, '__class__', '???') linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

578 raise TypeError(f'Unexpected type of exclude value {class_name}') linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

579 return items linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

580 

581 @classmethod linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

582 def _coerce_value(cls, value: Any) -> Any: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

583 if value is None or cls.is_true(value): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

584 return value linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

585 return cls._coerce_items(value) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

586 

587 @staticmethod linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

588 def is_true(v: Any) -> bool: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

589 return v is True or v is ... linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

590 

591 def __repr_args__(self) -> 'ReprArgs': linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

592 return [(None, self._items)] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

593 

594 

595class ClassAttribute: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

596 """ 

597 Hide class attribute from its instances 

598 """ 

599 

600 __slots__ = ( linux-py3.8-compiled-no-deps-nolinux-py3.9-compiled-no-deps-nolinux-py3.10-compiled-no-deps-nolinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

601 'name', 

602 'value', 

603 ) 

604 

605 def __init__(self, name: str, value: Any) -> None: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

606 self.name = name linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

607 self.value = value linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

608 

609 def __get__(self, instance: Any, owner: Type[Any]) -> None: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

610 if instance is None: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

611 return self.value linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

612 raise AttributeError(f'{self.name!r} attribute of {owner.__name__!r} is class-only') linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

613 

614 

615path_types = { linux-py3.8-compiled-no-deps-nolinux-py3.9-compiled-no-deps-nolinux-py3.10-compiled-no-deps-nolinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

616 'is_dir': 'directory', 

617 'is_file': 'file', 

618 'is_mount': 'mount point', 

619 'is_symlink': 'symlink', 

620 'is_block_device': 'block device', 

621 'is_char_device': 'char device', 

622 'is_fifo': 'FIFO', 

623 'is_socket': 'socket', 

624} 

625 

626 

627def path_type(p: 'Path') -> str: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

628 """ 

629 Find out what sort of thing a path is. 

630 """ 

631 assert p.exists(), 'path does not exist' linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

632 for method, name in path_types.items(): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

633 if getattr(p, method)(): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

634 return name linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

635 

636 return 'unknown' linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

637 

638 

639Obj = TypeVar('Obj') linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

640 

641 

642def smart_deepcopy(obj: Obj) -> Obj: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

643 """ 

644 Return type as is for immutable built-in types 

645 Use obj.copy() for built-in empty collections 

646 Use copy.deepcopy() for non-empty collections and unknown objects 

647 """ 

648 

649 obj_type = obj.__class__ linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

650 if obj_type in IMMUTABLE_NON_COLLECTIONS_TYPES: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

651 return obj # fastest case: obj is immutable and not collection therefore will not be copied anyway linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

652 elif not obj and obj_type in BUILTIN_COLLECTIONS: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

653 # faster way for empty collections, no need to copy its members 

654 return obj if obj_type is tuple else obj.copy() # type: ignore # tuple doesn't have copy method linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

655 return deepcopy(obj) # slowest way when we actually might need a deepcopy linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

656 

657 

658def is_valid_field(name: str) -> bool: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

659 if not name.startswith('_'): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

660 return True linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

661 return ROOT_KEY == name linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

662 

663 

664def is_valid_private_name(name: str) -> bool: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

665 return not is_valid_field(name) and name not in { linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

666 '__annotations__', 

667 '__classcell__', 

668 '__doc__', 

669 '__module__', 

670 '__orig_bases__', 

671 '__qualname__', 

672 } 

673 

674 

675_EMPTY = object() linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

676 

677 

678def all_identical(left: Iterable[Any], right: Iterable[Any]) -> bool: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

679 """ 

680 Check that the items of `left` are the same objects as those in `right`. 

681 

682 >>> a, b = object(), object() 

683 >>> all_identical([a, b, a], [a, b, a]) 

684 True 

685 >>> all_identical([a, b, [a]], [a, b, [a]]) # new list object, while "equal" is not "identical" 

686 False 

687 """ 

688 for left_item, right_item in zip_longest(left, right, fillvalue=_EMPTY): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

689 if left_item is not right_item: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

690 return False linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

691 return True linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

692 

693 

694def get_unique_discriminator_alias(all_aliases: Collection[str], discriminator_key: str) -> str: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

695 """Validate that all aliases are the same and if that's the case return the alias""" 

696 unique_aliases = set(all_aliases) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

697 if len(unique_aliases) > 1: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

698 raise ConfigError( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

699 f'Aliases for discriminator {discriminator_key!r} must be the same (got {", ".join(sorted(all_aliases))})' 

700 ) 

701 return unique_aliases.pop() linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

702 

703 

704def get_discriminator_alias_and_values(tp: Any, discriminator_key: str) -> Tuple[str, Tuple[str, ...]]: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

705 """ 

706 Get alias and all valid values in the `Literal` type of the discriminator field 

707 `tp` can be a `BaseModel` class or directly an `Annotated` `Union` of many. 

708 """ 

709 is_root_model = getattr(tp, '__custom_root_type__', False) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

710 

711 if get_origin(tp) is Annotated: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

712 tp = get_args(tp)[0] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

713 

714 if hasattr(tp, '__pydantic_model__'): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

715 tp = tp.__pydantic_model__ linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

716 

717 if is_union(get_origin(tp)): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

718 alias, all_values = _get_union_alias_and_all_values(tp, discriminator_key) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

719 return alias, tuple(v for values in all_values for v in values) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

720 elif is_root_model: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

721 union_type = tp.__fields__[ROOT_KEY].type_ linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

722 alias, all_values = _get_union_alias_and_all_values(union_type, discriminator_key) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

723 

724 if len(set(all_values)) > 1: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

725 raise ConfigError( linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

726 f'Field {discriminator_key!r} is not the same for all submodels of {display_as_type(tp)!r}' 

727 ) 

728 

729 return alias, all_values[0] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

730 

731 else: 

732 try: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

733 t_discriminator_type = tp.__fields__[discriminator_key].type_ linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

734 except AttributeError as e: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

735 raise TypeError(f'Type {tp.__name__!r} is not a valid `BaseModel` or `dataclass`') from e linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

736 except KeyError as e: linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

737 raise ConfigError(f'Model {tp.__name__!r} needs a discriminator field for key {discriminator_key!r}') from e linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

738 

739 if not is_literal_type(t_discriminator_type): linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

740 raise ConfigError(f'Field {discriminator_key!r} of model {tp.__name__!r} needs to be a `Literal`') linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

741 

742 return tp.__fields__[discriminator_key].alias, all_literal_values(t_discriminator_type) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

743 

744 

745def _get_union_alias_and_all_values( linux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yeslinux-py3.10-mypy0.910linux-py3.10-mypy0.920linux-py3.10-mypy0.921macos-py3.8macos-py3.9macos-py3.10windows-py3.8windows-py3.9windows-py3.10

746 union_type: Type[Any], discriminator_key: str 

747) -> Tuple[str, Tuple[Tuple[str, ...], ...]]: 

748 zipped_aliases_values = [get_discriminator_alias_and_values(t, discriminator_key) for t in get_args(union_type)] linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

749 # unzip: [('alias_a',('v1', 'v2)), ('alias_b', ('v3',))] => [('alias_a', 'alias_b'), (('v1', 'v2'), ('v3',))] 

750 all_aliases, all_values = zip(*zipped_aliases_values) linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10

751 return get_unique_discriminator_alias(all_aliases, discriminator_key), all_values linux-py3.7-compiled-no-deps-nolinux-py3.7-compiled-yes-deps-nolinux-py3.7-compiled-yes-deps-yeslinux-py3.8-compiled-no-deps-nolinux-py3.8-compiled-yes-deps-nolinux-py3.8-compiled-yes-deps-yeslinux-py3.9-compiled-no-deps-nolinux-py3.9-compiled-yes-deps-nolinux-py3.9-compiled-yes-deps-yeslinux-py3.10-compiled-no-deps-nolinux-py3.10-compiled-yes-deps-nolinux-py3.10-compiled-yes-deps-yesmacos-py3.7macos-py3.8macos-py3.9macos-py3.10windows-py3.7windows-py3.8windows-py3.9windows-py3.10