def load_config(config_file):
    error = None
    paths = [config_file] if config_file else ["blockade.yaml",
                                               "blockade.yml"]
    try:
        for path in paths:
            try:
                with open(path) as f:
                    d = yaml.safe_load(f)
                    return BlockadeConfig.from_dict(d)
            except __HOLE__ as e:
                if e.errno != errno.ENOENT:
                    raise
    except Exception as e:
        error = e
    raise BlockadeError("Failed to load config (from --config, "
                        "./blockade.yaml, or ./blockade.yml)" +
                        (str(error) if error else ""))
dataset/ETHPy150Open dcm-oss/blockade/blockade/cli.py/load_config