code: def findModuleOfName(self, dotted_name, level, filename, extrapath=None):
          
          if dotted_name.endswith('.*'):
              return dotted_name[:-2]
          name = dotted_name
  
          # extrapath is None only in a couple of test cases; in real life it's
          # always present
          if level and level > 1 and extrapath:
              # strip trailing path bits for each extra level to account for
              # relative imports
              # from . import X has level == 1 and nothing is stripped (the level > 1 check accounts for this case)
              # from .. import X has level == 2 and one trailing path component must go
              # from ... import X has level == 3 and two trailing path components must go
              extrapath = extrapath.split(os.path.sep)
              level -= 1
              extrapath = extrapath[0:-level]
              extrapath = os.path.sep.join(extrapath)
  
          while name:
              candidate = self.isModule(name, extrapath)
              if candidate:
                  return candidate
              candidate = self.isPackage(name, extrapath)
              if candidate:
                  return candidate
              name = name[:name.rfind('.')]
          self.warn(dotted_name, '%s: could not find %s', filename, dotted_name)
          return dotted_name
docs: Given a fully qualified name, find what module contains it.