

def load_config(path=None, defaults=None):
    "\n    Loads and parses an INI style configuration file using Python's built-in\n    configparser module. If path is specified, load it.\n    If ``defaults`` (a list of strings) is given, try to load each entry as a\n    file, without throwing any error if the operation fails.\n    If ``defaults`` is not given, the following locations listed in the\n    DEFAULT_FILES constant are tried.\n    To completely disable defaults loading, pass in an empty list or ``False``.\n    Returns the SafeConfigParser instance used to load and parse the files.\n    "
    if (defaults is None):
        defaults = DEFAULT_FILES
    config = ConfigParser(allow_no_value=True)
    if defaults:
        config.read(defaults)
    if path:
        with open(path) as fh:
            config.read_file(fh)
    return config

dataset/ETHPy150Open GaretJax/lancet/lancet/settings.py load_config/original