Checks the artifact cache for the specified list of VersionedTargetSets.

    Returns a tuple (cached, uncached, uncached_causes) of VersionedTargets that were
    satisfied/unsatisfied from the cache.
557964
def do_check_artifact_cache(self, vts, post_process_cached_vts=None):
    
    if not vts:
      return [], [], []

    read_cache = self._cache_factory.get_read_cache()
    items = [(read_cache, vt.cache_key, vt.current_results_dir if self.cache_target_dirs else None)
             for vt in vts]
    res = self.context.subproc_map(call_use_cached_files, items)

    cached_vts = []
    uncached_vts = []
    uncached_causes = []

    # Note that while the input vts may represent multiple targets (for tasks that overrride
    # check_artifact_cache_for), the ones we return must represent single targets.
    # Once flattened, cached/uncached vts are in separate lists. Each uncached vts is paired
    # with why it is missed for stat reporting purpose.
    for vt, was_in_cache in zip(vts, res):
      if was_in_cache:
        cached_vts.extend(vt.versioned_targets)
      else:
        uncached_vts.extend(vt.versioned_targets)
        uncached_causes.extend(repeat(was_in_cache, len(vt.versioned_targets)))
        if isinstance(was_in_cache, UnreadableArtifact):
          self._cache_key_errors.update(was_in_cache.key)

    if post_process_cached_vts:
      post_process_cached_vts(cached_vts)
    for vt in cached_vts:
      vt.update()
    return cached_vts, uncached_vts, uncached_causes
1332766
def _should_force_django_cache_miss(cls):
        
        cached_response = DEFAULT_REQUEST_CACHE.get_cached_response(SHOULD_FORCE_CACHE_MISS_KEY)
        return False if not cached_response.is_found else cached_response.value
370009
@Override
    public Set<SourceVersion> getSourceVersions() {
        return Collections.unmodifiableSet(
                EnumSet.range(SourceVersion.RELEASE_9, SourceVersion.latest()));
    }
916298
private Set<Artifact> findThriftDependencies() throws IOException, MojoExecutionException {
    Set<Artifact> thriftDependencies = new HashSet<Artifact>();

    Set<Artifact> deps = new HashSet<Artifact>();
    deps.addAll(project.getArtifacts());
    deps.addAll(project.getDependencyArtifacts());

    Map<String, Artifact> depsMap = new HashMap<String, Artifact>();
    for (Artifact dep : deps) {
      depsMap.put(dep.getId(), dep);
    }

    for (Artifact artifact : deps) {
      // This artifact has an idl classifier.
      if (isIdlCalssifier(artifact, classifier)) {
        thriftDependencies.add(artifact);
      } else {
        if (isDepOfIdlArtifact(artifact, depsMap)) {
          // Fetch idl artifact for dependency of an idl artifact.
          try {
            Artifact idlArtifact = MavenScroogeCompilerUtil.getIdlArtifact(
              artifact,
              artifactFactory,
              artifactResolver,
              localRepository,
              remoteArtifactRepositories,
              classifier);
            thriftDependencies.add(idlArtifact);
          } catch (MojoExecutionException e) {
            /* Do nothing as this artifact is not an idl artifact
             binary jars may have dependency on thrift lib etc.
             */
            getLog().debug("Could not fetch idl jar for " + artifact);
          }
        }
      }
    }
    return thriftDependencies;
  }
764843
function () {
      var doUniqueArtifactIdsCheck = function (artifactsIds) {
        var duplicateArtifactIds = [];
        artifactsIds.forEach(function (artifactId) {
          var artifactIdUnderTest = artifactId;

          function filterById (id) {
            return id === artifactIdUnderTest;
          }

          var arrayByUniqueArtifactIds = artifactsIds.filter(filterById);
          if (arrayByUniqueArtifactIds.length > 1 && duplicateArtifactIds.indexOf(artifactIdUnderTest) < 0) {
            duplicateArtifactIds.push(artifactIdUnderTest);
          }
        });
        duplicateArtifactIds.forEach(function (artifactId) {
          errors.push(
            'RuleViolation identified: WebPackage contains multiple artifacts with \'artifactId\'=\'' +
            artifactId + '\'');
        });
      };
      //
      var collectArtifactIds = function (next) {
        var artifactsIds = [];
        if (doc.artifacts) {
          Object.keys(doc.artifacts).forEach(function (artifactType) {
            doc.artifacts[ artifactType ].forEach(function (artifact) {
              artifactsIds.push(artifact.artifactId);
            });
          });
        }
        next(artifactsIds);
      };
      collectArtifactIds(doUniqueArtifactIdsCheck);
    }
855900
protected boolean onCacheMiss(T target) {
        boolean cached = matcher.matches(target);
        map.put(target, cached);
        return cached;
    }
1192600
def densely_packed_versions
      if @densely_packed_versions.nil?
        @densely_packed_versions = DenselyPackedSet.new(versions.map{|pkg_version| pkg_version.version})
        Debug.log.debug { "Package Versions for '#{@name}' :" }
        versions.each do |v|
          Debug.log.debug { "    #{v.to_s(true)}" }
        end
      end
      @densely_packed_versions
    end
257218
def check_cache(cache):
    
    if isinstance(cache, BaseCache):
        return cache
    elif cache is False:
        return DictCache()
    elif cache is None:
        return DummyCache()
    else:
        raise ValueError('Provided cache must implement BaseCache')
9829
def _get_all_refs(self, dep, handled_refs=None):
        
        if handled_refs is None:
            handled_refs = [dep]
        else:
            if dep in handled_refs:
                return []
        res = []
        if dep in self.future_values_key_item:
            res.extend(
                self.future_values_key_item[dep]["dependencies"].values())
            add = []
            for h_d in res:
                add.extend(self._get_all_refs(h_d, handled_refs))
            res.extend(add)
        return list(set(res))
885286
def feature_cache():
    
    providername = provider_check()
    if providername:
        cache_path = "netshowlib.%s.cache" % providername
        cache_module = import_module(cache_path)
        return cache_module.Cache()
    return None
920580
def artifacts(self):
        
        if self._artifact_manager is None:
            self._artifact_manager = ArtifactManager(session=self._session)
        return self._artifact_manager
89252
@Override
    public List<String> findVersions(final Artifact artifact) {
        return Arrays.asList(new String[]{artifact.getVersion()});
    }
70246
def _get_available_versions(self):
        '''
        
        '''
        solvables = self.zypper.nolock.xml.call('se', '-xv', self.name).getElementsByTagName('solvable')
        if not solvables:
            raise CommandExecutionError('No packages found matching \'{0}\''.format(self.name))

        return sorted(set([slv.getAttribute(self._attr_solvable_version)
                           for slv in solvables if slv.getAttribute(self._attr_solvable_version)]))
547744
def get_all_cached_commit_times(root_folder):
    
    result = []
    location = cache_location(root_folder)

    if os.path.exists(location):
        try:
            result = json.load(open(location))
        except (TypeError, ValueError) as error:
            log.warning("Failed to open gitmit cached commit_times\tlocation=%s\terror=%s", location, error)
        else:
            if type(result) is not list or not all(type(item) is dict for item in result):
                log.warning("Gitmit cached commit_times needs to be a list of dictionaries\tlocation=%s\tgot=%s", location, type(result))
                result = []

    return result
641953
public Version getHighestMatch(List<Version> versions)
   {
      Version matched = null;
      for (Version version : versions)
      {
         if (includes(version))
         {
            if (matched == null || version.compareTo(matched) > 0)
            {
               matched = version;
            }
         }
      }
      return matched;
   }
557745
def get_installed_targets():
        """"""
        try:
            cache = cmsis_pack_manager.Cache(True, True)
            results = []
            for pack in ManagedPacks.get_installed_packs(cache=cache):
                pack_path = os.path.join(cache.data_path, pack.get_pack_name())
                pack = CmsisPack(pack_path)
                results += list(pack.devices)
            return sorted(results, key=lambda dev:dev.part_number)
        except FileNotFoundError:
            # cmsis-pack-manager can raise this exception if the cache is empty.
            pass
1287018
def compute_reverse_dependencies(
        self, targets: Iterable[BuildTarget]
    ) -> Mapping[str, Iterable[BuildTarget]]:
        
        result = defaultdict(list)
        for target in targets:
            for dependency in target.dependencies:
                result[dependency].append(target)
        return result