Load yaml file or string. Args: f (str): File path or a python string. Returns: dict: Loaded dict.
(f)
| 36 | |
| 37 | |
| 38 | def 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 | |
| 54 | def dict2str(opt, indent_level=1): |
no test coverage detected