# Path: ml_collections/config_flags/config_path.py
# _AST_SPLIT_CONFIG_PATH = {
#     ast.Attribute: lambda n: (*_split_node(n.value), n.attr),
#     ast.Index: lambda i: _split_node(i.value),
#     ast.Name: lambda n: (n.id,),
#     ast.Slice: lambda i: slice(*map(_split_node, (i.lower, i.upper, i.step))),
#     ast.Subscript: lambda n: (*_split_node(n.value), _split_node(n.slice)),
#     type(None): lambda n: None
# }
# def _split_node(node):
# def split(config_path: str) -> Tuple[Any]:
# def _get_item_or_attribute(config, field):
# def _get_holder_field(config_path: str, config: Any) -> Tuple[Any, str]:
# def get_value(config_path: str, config: Any):
# def get_type(config_path: str, config: Any):
# def set_value(config_path: str, config: Any, value: Any):
# 
# Path: ml_collections/config_flags/tuple_parser.py
# class TupleParser(flags.ArgumentParser):
#   def parse(self, argument):
#   def flag_type(self):
# def _convert_str_to_tuple(string):


import dataclasses
import errno
import imp
import os
import re
import sys
import traceback
import ml_collections
from typing import Any, Dict, Generic, List, MutableMapping, Optional, Tuple, Type, TypeVar
from absl import flags
from absl import logging
from ml_collections.config_flags import config_path
from ml_collections.config_flags import tuple_parser
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Lint as: python 3
"""Configuration commmand line parser."""



FLAGS = flags.FLAGS

# Forward for backwards compatability.
GetValue = config_path.get_value
GetType = config_path.get_type
SetValue = config_path.set_value

# Prevent this module being considered for `FLAGS.find_module_defining_flag`.
flags._helpers.disclaim_module_ids.add(id(sys.modules[__name__]))  # pylint: disable=protected-access

_FIELD_TYPE_TO_PARSER = {
    float: flags.FloatParser(),
    bool: flags.BooleanParser(),

# Path: ml_collections/config_flags/config_path.py
# _AST_SPLIT_CONFIG_PATH = {
#     ast.Attribute: lambda n: (*_split_node(n.value), n.attr),
#     ast.Index: lambda i: _split_node(i.value),
#     ast.Name: lambda n: (n.id,),
#     ast.Slice: lambda i: slice(*map(_split_node, (i.lower, i.upper, i.step))),
#     ast.Subscript: lambda n: (*_split_node(n.value), _split_node(n.slice)),
#     type(None): lambda n: None
# }
# def _split_node(node):
# def split(config_path: str) -> Tuple[Any]:
# def _get_item_or_attribute(config, field):
# def _get_holder_field(config_path: str, config: Any) -> Tuple[Any, str]:
# def get_value(config_path: str, config: Any):
# def get_type(config_path: str, config: Any):
# def set_value(config_path: str, config: Any, value: Any):
# 
# Path: ml_collections/config_flags/tuple_parser.py
# class TupleParser(flags.ArgumentParser):
#   def parse(self, argument):
#   def flag_type(self):
# def _convert_str_to_tuple(string):


# Path: ml_collections/config_flags/config_flags.py
import dataclasses
import errno
import imp
import os
import re
import sys
import traceback
import ml_collections
from typing import Any, Dict, Generic, List, MutableMapping, Optional, Tuple, Type, TypeVar
from absl import flags
from absl import logging
from ml_collections.config_flags import config_path
from ml_collections.config_flags import tuple_parser

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Lint as: python 3
"""Configuration commmand line parser."""



FLAGS = flags.FLAGS

# Forward for backwards compatability.
GetValue = config_path.get_value
GetType = config_path.get_type
SetValue = config_path.set_value

# Prevent this module being considered for `FLAGS.find_module_defining_flag`.
flags._helpers.disclaim_module_ids.add(id(sys.modules[__name__]))  # pylint: disable=protected-access

_FIELD_TYPE_TO_PARSER = {
    float: flags.FloatParser(),
    bool: flags.BooleanParser(),

    tuple: tuple_parser.TupleParser(),