code: def translate_node_id(self, ni: PrefName, sctx: SchemaContext) -> QualName:
          
          p, s, loc = ni.partition(":")
          if not s:
              return (ni, sctx.default_ns)
          try:
              mdata = self.modules[sctx.text_mid]
          except KeyError:
              raise ModuleNotRegistered(*sctx.text_mid) from None
          try:
              return (loc, self.namespace(mdata.prefix_map[p]))
          except KeyError:
              raise UnknownPrefix(p, sctx.text_mid) from None
docs: Translate node identifier to a qualified name.
  
          Args:
              ni: Node identifier (with optional prefix).
              sctx: SchemaContext.
  
          Raises:
              ModuleNotRegistered: If `mid` is not registered in the data model.
              UnknownPrefix: If the prefix specified in `ni` is not declared.