code: def resolve_relpath(self, fullname, level):
          
          mod = sys.modules.get(fullname, None)
          if hasattr(mod, '__path__'):
              fullname += '.__init__'
  
          if level == 0 or not fullname:
              return ''
  
          bits = fullname.split('.')
          if len(bits) <= level:
              # This would be an ImportError in real code.
              return ''
  
          return '.'.join(bits[:-level]) + '.'
docs: Given an ImportFrom AST node, guess the prefix that should be tacked
          on to an alias name to produce a canonical name. `fullname` is the name
          of the module in which the ImportFrom appears.