code: def yaml_parse(yamlstr):
      
      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 json.loads(yamlstr)
      except ValueError:
          yaml.SafeLoader.add_multi_constructor("!", intrinsics_multi_constructor)
          return yaml.safe_load(yamlstr)
docs: Parse a yaml string