Joins a relative import like `from .foo import bar` with this module as
    its parent module. If the module is not a root module or package root,
    it will be joined with the package root.

def join_import_from(self, import_spec):
    """
    Joins a relative import like `from .foo import bar` with this module as
    its parent module. If the module is not a root module or package root,
    it will be joined with the package root.
    """

    if not self.isroot and not self.ispkg:
      parent = self.name.rpartition('.')[0]
    else:
      parent = self.name
    return join_import_from(import_spec, parent)