MCPcopy Create free account
hub / github.com/DragonisCV/RAM / yaml_load

Function yaml_load

ram/utils/options.py:38–51  ·  view source on GitHub ↗

Load yaml file or string. Args: f (str): File path or a python string. Returns: dict: Loaded dict.

(f)

Source from the content-addressed store, hash-verified

36
37
38def yaml_load(f):
39 """Load yaml file or string.
40
41 Args:
42 f (str): File path or a python string.
43
44 Returns:
45 dict: Loaded dict.
46 """
47 if os.path.isfile(f):
48 with open(f, 'r') as f:
49 return yaml.load(f, Loader=ordered_yaml()[0])
50 else:
51 return yaml.load(f, Loader=ordered_yaml()[0])
52
53
54def dict2str(opt, indent_level=1):

Callers 2

_merge_from_baseFunction · 0.85
parse_optionsFunction · 0.85

Calls 1

ordered_yamlFunction · 0.85

Tested by

no test coverage detected