def resolve_rule(self, rule_path, requesting_module=None):
    if not anvil.util.is_rule_path(rule_path):
      raise NameError('The rule path "%s" is missing a semicolon' % (rule_path))
    (module_path, rule_name) = string.rsplit(rule_path, ':', 1)
    if self.module_resolver.can_resolve_local:
      if not len(module_path) and not requesting_module:
        module_path = '.'
    if not len(module_path) and not requesting_module:
      raise KeyError('Local rule "%s" given when no resolver defined' % (
          rule_path))

    module = requesting_module
    if len(module_path):
      requesting_path = None
      if requesting_module:
        requesting_path = os.path.dirname(requesting_module.path)
      full_path = self.module_resolver.resolve_module_path(
          module_path, requesting_path)
      module = self.modules.get(full_path, None)
      if not module:
        # Module not yet loaded - need to grab it
        module = self.module_resolver.load_module(
            full_path, self.rule_namespace)
        if module:
          self.add_module(module)
        else:
          raise IOError('Module "%s" not found', module_path)

    return module.get_rule(rule_name)
Gets a rule by path, supporting module lookup and dynamic loading.
dataset/ETHPy150Open google/anvil-build/anvil/project.py/Project.resolve_rule