def METHOD_NAME(yamlstr) -> Dict:
    """Parse a yaml string"""
    try:
        # PyYAML doesn't support json as well as it should, so if the input
        # is actually just json it is better to parse it with the standard
        # json parser.
        return cast(Dict, json.loads(yamlstr, object_pairs_hook=OrderedDict))
    except ValueError:
        yaml.constructor.SafeConstructor.yaml_constructors[
            TIMESTAMP_TAG
        ] = yaml.constructor.SafeConstructor.yaml_constructors[TAG_STR]
        yaml.SafeLoader.add_constructor(yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG, _dict_constructor)
        yaml.SafeLoader.add_multi_constructor("!", intrinsics_multi_constructor)
        return cast(Dict, yaml.safe_load(yamlstr))