code: def resolve_pname(self, pname: PrefName,
                        mid: ModuleId) -> Tuple[YangIdentifier, ModuleId]:
          
          p, s, loc = pname.partition(":")
          try:
              mdata = self.modules[mid]
          except KeyError:
              raise ModuleNotRegistered(*mid) from None
          try:
              return (loc, mdata.prefix_map[p]) if s else (p, mdata.main_module)
          except KeyError:
              raise UnknownPrefix(p, mid) from None
docs: Return the name and module identifier in which the name is defined.
  
          Args:
              pname: Name with an optional prefix.
              mid: Identifier of the module in which `pname` appears.
  
          Raises:
              ModuleNotRegistered: If `mid` is not registered in the data model.
              UnknownPrefix: If the prefix specified in `pname` is not declared.