code: def register(self, uri, prefix):
          '''Registers the given URI and associates it with the given prefix.
  
          If the URI has already been registered, this is a no-op.
  
          :param uri: string
          :param prefix: string
          '''
          if not is_valid_schema_uri(uri):
              raise KeyError(
                  'cannot register invalid URI {} (prefix {})'.format(
                      uri, prefix))
          if not is_valid_prefix(prefix):
              raise ValueError(
                  'cannot register invalid prefix %q for URI %q'.format(
                      prefix, uri))
          if self._uri_to_prefix.get(uri) is None:
              self._uri_to_prefix[uri] = prefif register(self, uri, prefix):
          '''Registers the given URI and associates it with the given prefix.
  
          If the URI has already been registered, this is a no-op.
  
          :param uri: string
          :param prefix: string
          '''
          if not is_valid_schema_uri(uri):
              raise KeyError(
                  'cannot register invalid URI {} (prefix {})'.format(
                      uri, prefix))
          if not is_valid_prefix(prefix):
              raise ValueError(
                  'cannot register invalid prefix %q for URI %q'.format(
                      prefix, uri))
          if self._uri_to_prefix.get(uri) is None:
              self._uri_to_prefix[uri] = prefix
docs: Registers the given URI and associates it with the given prefix.
  
          If the URI has already been registered, this is a no-op.
  
          :param uri: string
          :param prefix: string