code: def find_related_imports(self, fullname):
          
          related = self._related_cache.get(fullname)
          if related is not None:
              return related
  
          modpath, src, _ = self.get_module_source(fullname)
          if src is None:
              return []
  
          maybe_names = list(self.generate_parent_names(fullname))
  
          co = compile(src, modpath, 'exec')
          for level, modname, namelist in scan_code_imports(co):
              if level == -1:
                  modnames = [modname, '%s.%s' % (fullname, modname)]
              else:
                  modnames = [
                      '%s%s' % (self.resolve_relpath(fullname, level), modname)
                  ]
  
              maybe_names.extend(modnames)
              maybe_names.extend(
                  '%s.%s' % (mname, name)
                  for mname in modnames
                  for name in namelist
              )
  
          return self._related_cache.setdefault(fullname, sorted(
              set(
                  mitogen.core.to_text(name)
                  for name in maybe_names
                  if sys.modules.get(name) is not None
                  and not is_stdlib_name(name)
                  and u'six.moves' not in name  # TODO: crap
              )
          ))
docs: Return a list of non-stdlib modules that are directly imported by
          `fullname`, plus their parents.
  
          The list is determined by retrieving the source code of
          `fullname`, compiling it, and examining all IMPORT_NAME ops.
  
          :param fullname: Fully qualified name of an _already imported_ module
              for which source code can be retrieved
          :type fullname: str