code: def resolve_frompath(pkgpath, relpath, level=0):
      
      if level == 0:
          return relpath
      parts = pkgpath.split('.') + ['_']
      parts = parts[:-level] + (relpath.split('.') if relpath else [])
      return '.'.join(parts)
docs: Resolves the path of the module referred to by 'from ..x import y'.