Validates stuff and checks dependencies
514286
def validate(object, context = Attributor::DEFAULT_ROOT_CONTEXT)
      raise "INVALID CONTEXT!! #{context}" unless context
      # Validate any requirements, absolute or conditional, and return.

      if object.nil? # == Attributor::UNSET
        # With no value, we can only validate whether that is acceptable or not and return.
        # Beyond that, no further validation should be done.
        return validate_missing_value(context)
      end

      # TODO: support validation for other types of conditional dependencies based on values of other attributes

      errors = validate_type(object, context)

      # End validation if we don't even have the proper type to begin with
      return errors if errors.any?

      if options[:values] && !options[:values].include?(object)
        errors << "Attribute #{Attributor.humanize_context(context)}: #{Attributor.errorize_value(object)} is not within the allowed values=#{options[:values].inspect} "
      end

      errors + type.validate(object, context, self)
    end
23381
def _compute_dependencies(self):
        """"""
        dm = self.__dep_map = {None: []}

        reqs = []
        # Including any condition expressions
        for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
            reqs.extend(parse_requirements(req))

        def reqs_for_extra(extra):
            for req in reqs:
                if not req.marker or req.marker.evaluate({'extra': extra}):
                    yield req

        common = frozenset(reqs_for_extra(None))
        dm[None].extend(common)

        for extra in self._parsed_pkg_info.get_all('Provides-Extra') or []:
            s_extra = safe_extra(extra.strip())
            dm[s_extra] = list(frozenset(reqs_for_extra(extra)) - common)

        return dm
155782
def validate(config):
    '''
    
    '''
    # Configuration for pkg beacon should be a list
    if not isinstance(config, list):
        return False, ('Configuration for pkg beacon must be a list.')

    # Configuration for pkg beacon should contain pkgs
    pkgs_found = False
    pkgs_not_list = False
    for config_item in config:
        if 'pkgs' in config_item:
            pkgs_found = True
            if isinstance(config_item['pkgs'], list):
                pkgs_not_list = True

    if not pkgs_found or not pkgs_not_list:
        return False, 'Configuration for pkg beacon requires list of pkgs.'
    return True, 'Valid beacon configuration'
1204782
def check_dependencies():
    

    # Check that git is installed
    if not shutil.which("git"):
        raise Error(_("You don't have git. Install git, then re-run!"))

    # Check that git --version > 2.7
    version = subprocess.check_output(["git", "--version"]).decode("utf-8")
    matches = re.search(r"^git version (\d+\.\d+\.\d+).*$", version)
    if not matches or pkg_resources.parse_version(matches.group(1)) < pkg_resources.parse_version("2.7.0"):
        raise Error(_("You have an old version of git. Install version 2.7 or later, then re-run!"))
684660
public final void validate() throws InvalidDependenciesDefinitionException {

        int errorCount = 0;
        final StringBuilder sb = new StringBuilder("Duplicate package entries in 'allowed' and 'forbidden': ");
        final List<Package<NotDependsOn>> list = getForbidden();
        for (int i = 0; i < list.size(); i++) {
            final String name = list.get(i).getName();
            final Package<DependsOn> dep = new Package<DependsOn>(name);
            if (getAllowed().indexOf(dep) > -1) {
                if (errorCount > 0) {
                    sb.append(", ");
                }
                sb.append(name);
                errorCount++;
            }
        }
        if (errorCount > 0) {
            throw new InvalidDependenciesDefinitionException(this, sb.toString());
        }
    }
466239
def check_dependencies(dependencies, module):
    
    if type(dependencies) == str:
        dependencies = [dependencies]
    elif type(dependencies) != list:
        raise TypeError('dependencies argument must be of type list or string')

    for dependency in dependencies:
        if dependency not in settings.INSTALLED_APPS:
            raise DependencyError('%s depends on %s, which should be in settings.INSTALLED_APPS' % (module, dependency))
943216
def check_dependencies(self):
        """"""
        deadlocks = []

        for task in self.iflat_tasks():
            for dep in task.deps:
                if dep.node.depends_on(task):
                    deadlocks.append((task, dep.node))

        if deadlocks:
            lines = ["Detect wrong list of dependecies that will lead to a deadlock:"]
            lines.extend(["%s <--> %s" % nodes for nodes in deadlocks])
            raise RuntimeError("\n".join(lines))
348405
function validateExcess(dir, file, shrinkwrap, opts, scope, cb) {  // jshint ignore:line
    file = file.toLowerCase();

    // don't consider node_modules/.bin
    if (file === '.bin') {
        return cb();
    }

    // consider top-level scoped packages only; e.g. those nested at the level
    // node_modules/{*}
    var isScopedDir = file[0] === '@';
    if (isScopedDir) {
        return findExcess(path.join(dir, scope + '/' + file), shrinkwrap, opts,
          file, cb);
    }

    // the file is in excess if it does not exist in the package.json's
    // dev dependencies; this step is skipped if we are not analyzing
    // dev dependencies
    if (opts.dev && shrinkwrap.devDependencies &&
        lowercaseContains(Object.keys(shrinkwrap.devDependencies), file)) {
        return cb();
    }

    // the file is in excess if it does not exist in the package.json's
    // regular dependencies
    if (shrinkwrap.dependencies && lowercaseContains(Object.keys(shrinkwrap.dependencies), file)) {
        return cb();
    }

    // if all checks pass up until this point, the file is in excess
    return cb(null, [file]);
}
1170453
function checkPkg(pkgDir, scopes) {
  var errors;
  try {
    var config = {packageDir: pkgDir};
    if (scopes) {
      config.scopeList = scopes;
    }
    var checked = checkDeps.sync(config);
    if (checked.error.length) {
      errors = checked.error;
    }
  } finally {
    // eslint-disable-next-line no-unsafe-finally
    return errors;
  }
}
1041495
def missing_dependencies():
    """"""
    missing_deps = []
    for dependency in DEPENDENCIES:
        if not dependency.check() and not dependency.optional:
            missing_deps.append(dependency)
    if missing_deps:
        return status(deps=missing_deps, linesep='<br>')
    else:
        return ""
654006
def CheckDependencies(self, verbose_output=True):
    
    print('Checking availability and versions of dependencies.')
    check_result = True

    for module_name, dependency in sorted(self.dependencies.items()):
      if module_name == 'sqlite3':
        result, status_message = self._CheckSQLite3()
      else:
        result, status_message = self._CheckPythonModule(dependency)

      if not result and module_name == 'lzma':
        dependency.name = 'backports.lzma'
        result, status_message = self._CheckPythonModule(dependency)

      if not result and not dependency.is_optional:
        check_result = False

      self._PrintCheckDependencyStatus(
          dependency, result, status_message, verbose_output=verbose_output)

    if check_result and not verbose_output:
      print('[OK]')

    print('')
    return check_result
498996
def _validate_dependencies_met():
    
    # Method added in `cryptography==1.1`; not available in older versions
    from cryptography.x509.extensions import Extensions
    if getattr(Extensions, "get_extension_for_class", None) is None:
        raise ImportError("'cryptography' module missing required functionality.  "
                          "Try upgrading to v1.3.4 or newer.")

    # pyOpenSSL 0.14 and above use cryptography for OpenSSL bindings. The _x509
    # attribute is only present on those versions.
    from OpenSSL.crypto import X509
    x509 = X509()
    if getattr(x509, "_x509", None) is None:
        raise ImportError("'pyOpenSSL' module missing required functionality. "
                          "Try upgrading to v0.14 or newer.")
21791
void validate() throws IOException {
		validate(platform, "platform");
		validate(jdk, "JDK");
		validate(executable, "executable name");
		validate(mainClass, "main class");
		validate(outDir, "output folder");

		if (outDir.exists()) {
			if (new File(".").equals(outDir)) {
				throw new IOException("Output directory equals working directory, aborting");
			}
			if (new File("/").equals(outDir)) {
				throw new IOException("Output directory points to root folder.");
			}
		}

		if (classpath.isEmpty()) {
			throw new IOException("Empty class path. Please check your commandline or configuration.");
		}
	}
322176
def has_resolved_dependencies(self):
        """"""
        for dependency in self.dependencies:
            if dependency.state != Task.State.DONE:
                return False

        return True
1194748
private void validate() throws MojoExecutionException {
		if ((file == null && libId == null) || (file != null && libId != null)) {
			getLog()
					.warn(
							"You specified <file> and <libId>.  The <libId> always wins.");
		}

		// check that COM target exists
		if (file != null && !file.exists()) {
			getLog().warn("Can't find file: " + file);
			throw new MojoExecutionException(
					"The native COM target file couldn't be found: " + file);
		}
	}
171363
def has_dependencies(node, dag):
    """"""
    for downstream_nodes in dag.values():
        if node in downstream_nodes:
            return True
    return False
1137978
def validate_version(self):
        """"""
        installed = get_installed_version()
        if not versions_compatible(*self.dbt_version):
            msg = IMPOSSIBLE_VERSION_ERROR.format(
                package=self.project_name,
                version_spec=[
                    x.to_version_string() for x in self.dbt_version
                ]
            )
            raise DbtProjectError(msg)

        if not versions_compatible(installed, *self.dbt_version):
            msg = INVALID_VERSION_ERROR.format(
                package=self.project_name,
                installed=installed.to_version_string(),
                version_spec=[
                    x.to_version_string() for x in self.dbt_version
                ]
            )
            raise DbtProjectError(msg)