code: def namespace_for(uri: Union[URIRef, Namespace, str]) -> str:
      
      uri = str(uri)
      if uri not in namespaces.values():
          namespaces[AnonNS().ns] = uri
      return [k for k, v in namespaces.items() if uri == v][0]
docs: Reverse namespace lookup.  Note that returned namespace may not be unique
      :param uri: namespace URI
      :return: namespace