# Path: thrifty/setting_parsers.py
# _FLOAT_REGEX = r'[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?'
# _RANGE_REGEX = r'\s*-\s*'
# _FREQ_MAG_REGEX = r'[kKmM]?'
# _HERTZ_REGEX = r'[hH][zZ]'
# _FREQ_RANGE_PATTERN = re.compile(r'^({0})(?:{1}({0}))?\s*({2})({3})?$'.format(
#     _FLOAT_REGEX, _RANGE_REGEX, _FREQ_MAG_REGEX, _HERTZ_REGEX), re.IGNORECASE)
# _THRESHOLD_SYMBOL = r'constant|c|snr|s|stddev|d|'
# _THRESHOLD_TERM = r'^\s*(?=\S)(?:({0})\s*\*?\s*)?({1})\s*$'.format(
#     _FLOAT_REGEX, _THRESHOLD_SYMBOL)
# _SI_PREFIXES = {
#     'y': 1e-24,  # yocto
#     'z': 1e-21,  # zepto
#     'a': 1e-18,  # atto
#     'f': 1e-15,  # femto
#     'p': 1e-12,  # pico
#     'n': 1e-9,   # nano
#     'u': 1e-6,   # micro
#     'm': 1e-3,   # mili
#     'c': 1e-2,   # centi
#     'd': 1e-1,   # deci
#     'k': 1e3,    # kilo
#     'M': 1e6,    # mega
#     'G': 1e9,    # giga
#     'T': 1e12,   # tera
#     'P': 1e15,   # peta
#     'E': 1e18,   # exa
#     'Z': 1e21,   # zetta
#     'Y': 1e24,   # yotta
# }
# def metric_float(string):
# def freq_range(string):
# def normalize_freq_range(range_, bin_freq):
# def threshold(string):


import logging
from collections import namedtuple
from thrifty import setting_parsers
    """Base class for settings-related exceptions."""
    pass


class ConfigSyntaxError(Error):
    """Error raised when a config file's syntax is invalid."""
    def __init__(self, line_no, msg):
        Error.__init__(self)
        self.line_no = line_no
        self.msg = msg

    def __str__(self):
        return "line #%d: %s" % (self.line_no, self.msg)


class SettingKeyError(Error):
    """Error raised when a setting's definition does not exist."""
    def __init__(self, msg):
        Error.__init__(self)
        self.msg = msg

    def __str__(self):
        return repr(self.msg)


class Namespace(dict):
    """A hackish dict-like object with elements accessible as attributes.

    Similar to argparse's Namespace class."""
    # pylint: disable=no-member

# Path: thrifty/setting_parsers.py
# _FLOAT_REGEX = r'[-+]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][-+]?\d+)?'
# _RANGE_REGEX = r'\s*-\s*'
# _FREQ_MAG_REGEX = r'[kKmM]?'
# _HERTZ_REGEX = r'[hH][zZ]'
# _FREQ_RANGE_PATTERN = re.compile(r'^({0})(?:{1}({0}))?\s*({2})({3})?$'.format(
#     _FLOAT_REGEX, _RANGE_REGEX, _FREQ_MAG_REGEX, _HERTZ_REGEX), re.IGNORECASE)
# _THRESHOLD_SYMBOL = r'constant|c|snr|s|stddev|d|'
# _THRESHOLD_TERM = r'^\s*(?=\S)(?:({0})\s*\*?\s*)?({1})\s*$'.format(
#     _FLOAT_REGEX, _THRESHOLD_SYMBOL)
# _SI_PREFIXES = {
#     'y': 1e-24,  # yocto
#     'z': 1e-21,  # zepto
#     'a': 1e-18,  # atto
#     'f': 1e-15,  # femto
#     'p': 1e-12,  # pico
#     'n': 1e-9,   # nano
#     'u': 1e-6,   # micro
#     'm': 1e-3,   # mili
#     'c': 1e-2,   # centi
#     'd': 1e-1,   # deci
#     'k': 1e3,    # kilo
#     'M': 1e6,    # mega
#     'G': 1e9,    # giga
#     'T': 1e12,   # tera
#     'P': 1e15,   # peta
#     'E': 1e18,   # exa
#     'Z': 1e21,   # zetta
#     'Y': 1e24,   # yotta
# }
# def metric_float(string):
# def freq_range(string):
# def normalize_freq_range(range_, bin_freq):
# def threshold(string):


# Path: thrifty/settings.py
import logging
from collections import namedtuple
from thrifty import setting_parsers

    """Base class for settings-related exceptions."""
    pass


class ConfigSyntaxError(Error):
    """Error raised when a config file's syntax is invalid."""
    def __init__(self, line_no, msg):
        Error.__init__(self)
        self.line_no = line_no
        self.msg = msg

    def __str__(self):
        return "line #%d: %s" % (self.line_no, self.msg)


class SettingKeyError(Error):
    """Error raised when a setting's definition does not exist."""
    def __init__(self, msg):
        Error.__init__(self)
        self.msg = msg

    def __str__(self):
        return repr(self.msg)


class Namespace(dict):
    """A hackish dict-like object with elements accessible as attributes.

    Similar to argparse's Namespace class."""
    # pylint: disable=no-member

    def __init__(self, dict_):