def __getstate__(self) -> Dict[(str, Any)]:
    dict_copy = copy.copy(self.__dict__)
    dict_copy.pop('_flags_cache', None)
    dict_copy['_metadata'] = copy.copy(dict_copy['_metadata'])
    ref_type = self._metadata.ref_type
    if is_container_annotation(ref_type):
        if is_dict_annotation(ref_type):
            dict_copy['_metadata'].ref_type = Dict
        elif is_list_annotation(ref_type):
            dict_copy['_metadata'].ref_type = List
        else:
            assert False
    if (sys.version_info < (3, 7)):
        element_type = self._metadata.element_type
        if _is_union(element_type):
            raise OmegaConfBaseException('Serializing structured configs with `Union` element type requires python >= 3.7')
    return dict_copy
def __getstate__(self) -> Dict[(str, Any)]:
    dict_copy = copy.copy(self.__dict__)
    dict_copy.pop('_flags_cache', None)
    dict_copy['_metadata'] = copy.copy(dict_copy['_metadata'])
    ref_type = self._metadata.ref_type
    if is_container_annotation(ref_type):
        if is_dict_annotation(ref_type):
            dict_copy['_metadata'].ref_type = Dict
        elif is_list_annotation(ref_type):
            dict_copy['_metadata'].ref_type = List
        else:
            assert False
    if (sys.version_info < (3, 7)):
        element_type = self._metadata.element_type
        if _is_union(element_type):
            raise OmegaConfBaseException('Serializing structured configs with `Union` element type requires python >= 3.7')
    return dict_copy