code: def saml_name_id_format_to_hash_type(name_format):
      
      msg = "saml_name_id_format_to_hash_type is deprecated and will be removed."
      _warnings.warn(msg, DeprecationWarning)
  
      name_id_format_to_hash_type = {
          NAMEID_FORMAT_TRANSIENT: UserIdHashType.transient,
          NAMEID_FORMAT_PERSISTENT: UserIdHashType.persistent,
          NAMEID_FORMAT_EMAILADDRESS: UserIdHashType.emailaddress,
          NAMEID_FORMAT_UNSPECIFIED: UserIdHashType.unspecified,
      }
  
      return name_id_format_to_hash_type.get(
          name_format, UserIdHashType.transient
      )
docs: Translate pySAML2 name format to satosa format
  
      :type name_format: str
      :rtype: satosa.internal_data.UserIdHashType
      :param name_format: SAML2 name format
      :return: satosa format