docs: def import_name(module_spec, name=None):
      """ Import identifier C{name} from module C{module_spec}.
  
          If name is omitted, C{module_spec} must contain the name after the
          module path, delimited by a colon (like a setuptools entry-point).
  
          @param module_spec: Fully qualified module name, e.g. C{x.y.z}.
          @param name: Name to import from C{module_spec}.
          @return: Requested object.
          @rtype: object
      """
      # Load module
      module_name = module_spec
      if name is None:
          try:
              module_name, name = module_spec.split(':', 1)
          except ValueError:
              raise ValueError("Missing object specifier in %r (syntax: 'package.module:object.attr')" % (module_spec,))
  
      try:
          module = __import__(module_name, globals(), {}, [name])
      except ImportError as exc:
          raise ImportError("Bad module name in %r (%s)" % (module_spec, exc))
  
      # Resolve the requested name
      result = module
      for attr in name.split('.'):
          result = getattr(result, attr)
  
      return result