def set_schema_location(self, ns_uri, schema_location, replace=False):
        """Sets the schema location of the given namespace.

        If ``replace`` is ``True``, then any existing schema location is
        replaced.  Otherwise, if the schema location is already set to a
        different value, an exception is raised.  If the schema location is set
        to None, it is effectively erased from this set (this is not considered
        "replacement".)

        Args:
            ns_uri (str): The namespace whose schema location is to be set
            schema_location (str): The schema location URI to set, or None
            replace (bool): Whether to replace any existing schema location

        Raises:
            NamespaceNotFoundError: If the given namespace isn't in this set.
            ConflictingSchemaLocationError: If replace is False,
                schema_location is not None, and the namespace already has a
                different schema location in this set.
        """
        ni = self.__lookup_uri(ns_uri)

        if ni.schema_location == schema_location:
            return
        elif replace or ni.schema_location is None:
            ni.schema_location = schema_location
        elif schema_location is None:
            ni.schema_location = None  # Not considered "replacement".
        else:
            raise ConflictingSchemaLocationError(ns_uri, ni.schema_location, schema_location)
def set_schema_location ( self , ns_uri , schema_location , replace = False ) : ni = self . __lookup_uri ( ns_uri ) if ni . schema_location == schema_location : return elif replace or ni . schema_location is None : ni . schema_location = schema_location elif schema_location is None : ni . schema_location = None else : raise ConflictingSchemaLocationError ( ns_uri , ni . schema_location , schema_location )
Sets the schema location of the given namespace.

        If ``replace`` is ``True``, then any existing schema location is
        replaced.  Otherwise, if the schema location is already set to a
        different value, an exception is raised.  If the schema location is set
        to None, it is effectively erased from this set (this is not considered
        "replacement".)

        Args:
            ns_uri (str): The namespace whose schema location is to be set
            schema_location (str): The schema location URI to set, or None
            replace (bool): Whether to replace any existing schema location

        Raises:
            NamespaceNotFoundError: If the given namespace isn't in this set.
            ConflictingSchemaLocationError: If replace is False,
                schema_location is not None, and the namespace already has a
                different schema location in this set.