def read_config(path, fallback=None):
    is_json = os.path.splitext(path)[1] == ".json"
    try:
        with open(path, "r") as f:
            contents = f.read() or "{}"
            return json.loads(contents) if is_json else yaml.load(contents)
    except __HOLE__ as e:
        if fallback is not None and e.errno == errno.ENOENT:
            return fallback

        raise e
    except (JSONDecodeError, yaml.parser.ParserError) as e:
        raise ParserError(e, path)
dataset/ETHPy150Open msanders/cider/cider/_sh.py/read_config