Parses out information from a path/string that looks like. ... key=value<separator...
(path: str, separator: str = "/")
| 220 | |
| 221 | |
| 222 | def get_values_from_path(path: str, separator: str = "/") -> Dict[str, str]: |
| 223 | """Parses out information from a path/string that looks like. |
| 224 | |
| 225 | ...<separator>key=value<separator... |
| 226 | """ |
| 227 | dict_output = {} |
| 228 | underscore_split = path.split(separator) |
| 229 | for item in underscore_split: |
| 230 | if "=" not in item: |
| 231 | continue |
| 232 | |
| 233 | key, value = item.split("=") |
| 234 | dict_output[key] = value |
| 235 | return dict_output |
| 236 | |
| 237 | |
| 238 | def get_checkpoint_name_from_path(path: str) -> str: |
no outgoing calls
no test coverage detected