def dependency_impl(self, name, display_name, kwargs):
    (disabled, required, feature) = extract_required_kwarg(kwargs, self.subproject)
    if disabled:
        mlog.log('Dependency', mlog.bold(display_name), 'skipped: feature', mlog.bold(feature), 'disabled')
        return self.notfound_dependency()
    has_fallback = ('fallback' in kwargs)
    if (('default_options' in kwargs) and (not has_fallback)):
        mlog.warning('The "default_options" keyworg argument does nothing without a "fallback" keyword argument.', location=self.current_node)
    if ((name == '') and required and (not has_fallback)):
        raise InvalidArguments('Dependency is both required and not-found')
    if (('<' in name) or ('>' in name) or ('=' in name)):
        raise InvalidArguments("Characters <, > and = are forbidden in dependency names. To specifyversion\n requirements use the 'version' keyword argument instead.")
    (identifier, cached_dep) = self._find_cached_dep(name, display_name, kwargs)
    if cached_dep:
        if has_fallback:
            (dirname, varname) = self.get_subproject_infos(kwargs)
            self.verify_fallback_consistency(dirname, varname, cached_dep)
        if (required and (not cached_dep.found())):
            m = 'Dependency {!r} was already checked and was not found'
            raise DependencyException(m.format(display_name))
        return DependencyHolder(cached_dep, self.subproject)
    if has_fallback:
        (dirname, varname) = self.get_subproject_infos(kwargs)
        if (dirname in self.subprojects):
            return self.get_subproject_dep(name, display_name, dirname, varname, kwargs)
    wrap_mode = self.coredata.get_builtin_option('wrap_mode')
    forcefallback = ((wrap_mode == WrapMode.forcefallback) and has_fallback)
    if ((name != '') and (not forcefallback)):
        self._handle_featurenew_dependencies(name)
        kwargs['required'] = (required and (not has_fallback))
        dep = dependencies.find_external_dependency(name, self.environment, kwargs)
        kwargs['required'] = required
        if dep.found():
            for_machine = self.machine_from_native_kwarg(kwargs)
            self.coredata.deps[for_machine].put(identifier, dep)
            return DependencyHolder(dep, self.subproject)
    if has_fallback:
        return self.dependency_fallback(name, display_name, kwargs)
    return self.notfound_dependency()
def dependency_impl(self, name, display_name, kwargs):
    (disabled, required, feature) = extract_required_kwarg(kwargs, self.subproject)
    if disabled:
        mlog.log('Dependency', mlog.bold(display_name), 'skipped: feature', mlog.bold(feature), 'disabled')
        return self.notfound_dependency()
    has_fallback = ('fallback' in kwargs)
    if (('default_options' in kwargs) and (not has_fallback)):
        mlog.warning('The "default_options" keyworg argument does nothing without a "fallback" keyword argument.', location=self.current_node)
    if ((name == ) and required and (not has_fallback)):
        raise InvalidArguments('Dependency is both required and not-found')
    if (('<' in name) or ('>' in name) or ('=' in name)):
        raise InvalidArguments("Characters <, > and = are forbidden in dependency names. To specifyversion\n requirements use the 'version' keyword argument instead.")
    (identifier, cached_dep) = self._find_cached_dep(name, display_name, kwargs)
    if cached_dep:
        if has_fallback:
            (dirname, varname) = self.get_subproject_infos(kwargs)
            self.verify_fallback_consistency(dirname, varname, cached_dep)
        if (required and (not cached_dep.found())):
            m = 'Dependency {!r} was already checked and was not found'
            raise DependencyException(m.format(display_name))
        return DependencyHolder(cached_dep, self.subproject)
    if has_fallback:
        (dirname, varname) = self.get_subproject_infos(kwargs)
        if (dirname in self.subprojects):
            return self.get_subproject_dep(name, display_name, dirname, varname, kwargs)
    wrap_mode = self.coredata.get_builtin_option('wrap_mode')
    forcefallback = ((wrap_mode == WrapMode.forcefallback) and has_fallback)
    if ((name != ) and (not forcefallback)):
        self._handle_featurenew_dependencies(name)
        kwargs['required'] = (required and (not has_fallback))
        dep = dependencies.find_external_dependency(name, self.environment, kwargs)
        kwargs['required'] = required
        if dep.found():
            for_machine = self.machine_from_native_kwarg(kwargs)
            self.coredata.deps[for_machine].put(identifier, dep)
            return DependencyHolder(dep, self.subproject)
    if has_fallback:
        return self.dependency_fallback(name, display_name, kwargs)
    return self.notfound_dependency()