Return either the compatibility of the given target, or the interpreter constraints.
    If interpreter constraints are supplied by the CLI flag, return those only.
498856
def compatibility_or_constraints(self, target):
    
    if self.get_options().is_flagged('interpreter_constraints'):
      return tuple(self.interpreter_constraints)
    return tuple(target.compatibility or self.interpreter_constraints)
543870
def _fulfills_version_spec(versions, oper, desired_version,
                           ignore_epoch=False):
    '''
    
    '''
    cmp_func = __salt__.get('pkg.version_cmp')
    # stripping "with_origin" dict wrapper
    if salt.utils.platform.is_freebsd():
        if isinstance(versions, dict) and 'version' in versions:
            versions = versions['version']
    for ver in versions:
        if (oper == '==' and fnmatch.fnmatch(ver, desired_version)) \
                or salt.utils.versions.compare(ver1=ver,
                                               oper=oper,
                                               ver2=desired_version,
                                               cmp_func=cmp_func,
                                               ignore_epoch=ignore_epoch):
            return True
    return False
772386
boolean isAssignableTo(Parameter target, VisitorState state) {
    if (state.getTypes().isSameType(type(), Type.noType)
        || state.getTypes().isSameType(target.type(), Type.noType)) {
      return false;
    }
    try {
      return state.getTypes().isAssignable(type(), target.type());
    } catch (CompletionFailure e) {
      // Report completion errors to avoid e.g. https://github.com/bazelbuild/bazel/issues/4105
      Check.instance(state.context)
          .completionError((DiagnosticPosition) state.getPath().getLeaf(), e);
      return false;
    }
  }
1010521
function compatible(value, descriptor) {
  if (!value) {
    // If we're a null, then we can't validate.
    return false;
  } else if (!descriptor) {
    return true;
  }

  const descriptorType = typeof descriptor;
  if (descriptorType === 'string') {
    return typeof value === descriptor;
  } else if (descriptorType === 'function') {
    return descriptor(value);
  } else if (descriptorType === 'object') {
    let matched = true;
    Object.keys(descriptor).forEach((key) => {
      const fromValue = value[key];
      const fromDescriptor = descriptor[key];
      if (!compatible(fromValue, fromDescriptor)) {
        matched = false;
      }
    });
    return matched;
  }

  throw new Error('Unknown descriptor type: ' + descriptorType);
}
747982
def check_requirements(self, reqs):
        # type: (Iterable[str]) -> Tuple[Set[Tuple[str, str]], Set[str]]
        
        missing = set()
        conflicting = set()
        if reqs:
            ws = WorkingSet(self._lib_dirs)
            for req in reqs:
                try:
                    if ws.find(Requirement.parse(req)) is None:
                        missing.add(req)
                except VersionConflict as e:
                    conflicting.add((str(e.args[0].as_requirement()),
                                     str(e.args[1])))
        return conflicting, missing
1180207
def find_compatible_interpreters(pex_python_path=None, compatibility_constraints=None):
  
  if pex_python_path:
    interpreters = []
    for binary in pex_python_path.split(os.pathsep):
      try:
        interpreters.append(PythonInterpreter.from_binary(binary))
      except Executor.ExecutionError:
        print("Python interpreter %s in PEX_PYTHON_PATH failed to load properly." % binary,
          file=sys.stderr)
    if not interpreters:
      die('PEX_PYTHON_PATH was defined, but no valid interpreters could be identified. Exiting.')
  else:
    # We may have been invoked with a specific interpreter not on the $PATH, make sure our
    # sys.executable is included as a candidate in this case.
    interpreters = OrderedSet([PythonInterpreter.get()])

    # Add all qualifying interpreters found in $PATH.
    interpreters.update(PythonInterpreter.all())

  return list(
    matched_interpreters(interpreters, compatibility_constraints)
    if compatibility_constraints
    else interpreters
  )
585956
public boolean isAssignableTo(Class<?> target) {

        LettuceAssert.notNull(target, "Target type must not be null");

        return LettuceClassUtils.isAssignable(target, getParameterType());
    }
318347
def satisfiable(self, **kwargs):
        
        if o.ABSTRACT_SOLVER in self.options or o.SYMBOLIC not in self.options:
            extra_constraints = kwargs.pop('extra_constraints', ())
            for e in extra_constraints:
                if self.solver.is_false(e):
                    return False

            return self._satisfiable
        else:
            return self.solver.satisfiable(**kwargs)
837492
private boolean meetsConstraint(String value, String constraint) {
        return (constraint == null) || constraint.equals(value);
    }
101200
def supports_version(self, guid_set):
        

        # Don't let the test run if we haven't parsed install.rdf yet.
        if self.supported_versions is None:
            raise Exception('Early compatibility test run before install.rdf '
                            'was parsed.')

        return self._compare_version(requirements=guid_set,
                                     support=self.supported_versions)
626901
def satisfies?(target)
      target = Version.coerce(target)

      if !version.zero? && greedy_match?(target)
        return false
      end

      OPERATORS[operator].call(self, target)
    end
1085013
def _classify_target_compile_workflow(self, target):
    """"""
    if target.has_sources('.java') or target.has_sources('.scala'):
      return self.get_scalar_mirrored_target_option('workflow', target)
    return None
33709
def satisfy_exact_match(self, args, kwargs):
        

        if self.args is None and self.kwargs is None:
            return False
        elif self.args is _any and self.kwargs is _any:
            return True
        elif args == self.args and kwargs == self.kwargs:
            return True
        elif len(args) != len(self.args) or len(kwargs) != len(self.kwargs):
            return False

        if not all(x == y or y == x for x, y in zip(args, self.args)):
            return False

        for key, value in self.kwargs.items():
            if key not in kwargs:
                return False
            elif not (kwargs[key] == value or value == kwargs[key]):
                return False

        return True
169089
def __ensure_type (targets):
    
    assert is_iterable_typed(targets, virtual_target.VirtualTarget)
    for t in targets:
        if not t.type ():
            get_manager().errors()("target '%s' has no type" % str (t))
1142856
def match_version(desired, available, cmp_func=None, ignore_epoch=False):
    '''
    
    '''
    oper, version = split_comparison(desired)
    if not oper:
        oper = '=='
    for candidate in available:
        if salt.utils.versions.compare(ver1=candidate,
                                       oper=oper,
                                       ver2=version,
                                       cmp_func=cmp_func,
                                       ignore_epoch=ignore_epoch):
            return candidate
    return None
745656
def is_np_compat():
    
    curr = ctypes.c_bool()
    check_call(_LIB.MXIsNumpyCompatible(ctypes.byref(curr)))
    return curr.value
648424
def _try_compile(source, name):
    
    try:
        c = compile(source, name, 'eval')
    except SyntaxError:
        c = compile(source, name, 'exec')
    return c