def _load_config(path: str) -> dict:
__, ext = os.path.splitext(path)<EOL>if ext in ['<STR_LIT>', '<STR_LIT>']:<EOL><INDENT>import ruamel.yaml<EOL>loader = ruamel.yaml.safe_load<EOL><DEDENT>else:<EOL><INDENT>loader = json.load<EOL><DEDENT>with open(path) as f:<EOL><INDENT>config = loader(f)<EOL><DEDENT>return config<EOL>
Given a file path, parse it based on its extension (YAML or JSON)
and return the values as a Python dictionary. JSON is the default if an
extension can't be determined.