Returns the list of AbstractTargets which are used as sources.
            The extra properties specified for sources are not represented.
            The only used of this rule at the moment is the '--dump-tests'
            feature of the test system.
504910
def sources (self):
        
        if self.source_targets_ == None:
            self.source_targets_ = []
            for s in self.sources_:
                self.source_targets_.append(resolve_reference(s, self.project_)[0])

        return self.source_targets_
933929
def targets_to_build (self):
        
        result = []

        if not self.built_main_targets_:
            self.build_main_targets ()

        # Collect all main targets here, except for "explicit" ones.
        for n, t  in self.main_target_.iteritems ():
            if not t.name () in self.explicit_targets_:
                result.append (t)

        # Collect all projects referenced via "projects-to-build" attribute.
        self_location = self.get ('location')
        for pn in self.get ('projects-to-build'):
            result.append (self.find(pn + "/"))

        return result
1097839
def _compute_unnecessary_deps(self, target, actual_deps):
    
    # Flatten the product deps of this target.
    product_deps = set()
    for dep_entries in actual_deps.values():
      product_deps.update(dep_entries)

    # Determine which of the DEFAULT deps in the declared set of this target were used.
    used = set()
    unused = set()
    for dep, _ in self._analyzer.resolve_aliases(target, scope=Scopes.DEFAULT):
      if dep in used or dep in unused:
        continue
      # TODO: What's a better way to accomplish this check? Filtering by `has_sources` would
      # incorrectly skip "empty" `*_library` targets, which could then be used as a loophole.
      if isinstance(dep, (Resources, UnpackedJars)):
        continue
      # If any of the target's jars or classfiles were used, consider it used.
      if product_deps.isdisjoint(self._analyzer.files_for_target(dep)):
        unused.add(dep)
      else:
        used.add(dep)

    # If there were no unused deps, break.
    if not unused:
      return {}

    # For any deps that were used, count their derived-from targets used as well.
    # TODO: Refactor to do some of this above once tests are in place.
    for dep in list(used):
      for derived_from in dep.derived_from_chain:
        if derived_from in unused:
          unused.remove(derived_from)
          used.add(derived_from)

    # Prune derived targets that would be in the set twice.
    for dep in list(unused):
      if set(dep.derived_from_chain) & unused:
        unused.remove(dep)

    if not unused:
      return {}

    # For any deps that were not used, determine whether their transitive deps were used, and
    # recommend those as replacements.
    replacements = {}
    for dep in unused:
      replacements[dep] = set()
      for t in dep.closure():
        if t in used or t in unused:
          continue
        if not product_deps.isdisjoint(self._analyzer.files_for_target(t)):
          replacements[dep].add(t.concrete_derived_from)

    return replacements
509723
def _get_original_targets(data):
    
    work_dir = os.path.join(_sv_workdir(data), "raw")
    batch = dd.get_batch(data) or dd.get_sample_name(data)
    return (glob.glob(os.path.join(work_dir, "*-%s.target.bed" % batch))[0],
            glob.glob(os.path.join(work_dir, "*-%s.antitarget.bed" % batch))[0])
492099
def listTargets(self):
        '''
            
        '''
        sql = 'select * from {}'.format(self.TABLE_ITEMS)
        cursor = self.db.execute(sql)

        return [(iid, name, path) for iid, name, path in cursor]
573291
def sources(
            self):
        
        sourceResultsList = []
        sourceResultsList[:] = [dict(l) for l in self.sourceResultsList]
        return sourceResultsList
86638
def get_global_sources(self):
        
        sources = []
        if self.sources:
            for source in self.sources:
                if None in source.streams:
                    sources.append(source.streams[None])
        return sources
872770
public static List<String> getSourcePaths() throws PackageManager.NameNotFoundException, IOException {
        ApplicationInfo applicationInfo = getPackageManager().getApplicationInfo(getPackageName(), 0);
        File sourceApk = new File(applicationInfo.sourceDir);
        File dexDir = new File(applicationInfo.dataDir, SECONDARY_FOLDER_NAME);
        File instantRunDir = new File(applicationInfo.dataDir, INSTANT_RUN_DEX_DIR_PATH); //default instant-run dir

        List<String> sourcePaths = new ArrayList<>();
        sourcePaths.add(applicationInfo.sourceDir); //add the default apk path

        if (instantRunDir.exists()) { //check if app using instant run
            for(final File dexFile : instantRunDir.listFiles()) { //add all sources from instan-run
                sourcePaths.add(dexFile.getAbsolutePath());
            }
        }

        //the prefix of extracted file, ie: test.classes
        String extractedFilePrefix = sourceApk.getName() + EXTRACTED_NAME_EXT;
        //the total dex numbers
        int totalDexNumber = getMultiDexPreferences().getInt(KEY_DEX_NUMBER, 1);

        for (int secondaryNumber = 2; secondaryNumber <= totalDexNumber; secondaryNumber++) {
            //for each dex file, ie: test.classes2.zip, test.classes3.zip...
            String fileName = extractedFilePrefix + secondaryNumber + EXTRACTED_SUFFIX;
            File extractedFile = new File(dexDir, fileName);
            if (extractedFile.isFile()) {
                sourcePaths.add(extractedFile.getAbsolutePath());
                //we ignore the verify zip part
            }
        }

        return sourcePaths;
    }
163949
public Set<SourceFile> getDependencies() {

		Set<SourceFile> sourceFiles = new TreeSet<SourceFile>();

		// Include all of the standard dependencies.
		for (Template t : dependencies.values()) {
			sourceFiles.add(t.sourceFile);
		}

		// Add the files that were looked-up but not found as well as the files
		// included via the file_contents() function.
		sourceFiles.addAll(otherDependencies);

		return Collections.unmodifiableSet(sourceFiles);
	}
628625
def _compute_sources_for_target(self, target):
    """"""
    def resolve_target_sources(target_sources):
      resolved_sources = []
      for tgt in target_sources:
        if tgt.has_sources():
          resolved_sources.extend(tgt.sources_relative_to_buildroot())
      return resolved_sources

    sources = [s for s in target.sources_relative_to_buildroot() if self._sources_predicate(s)]
    # TODO: Make this less hacky. Ideally target.java_sources will point to sources, not targets.
    if hasattr(target, 'java_sources') and target.java_sources:
      sources.extend(resolve_target_sources(target.java_sources))
    return sources
1361095
def get(self, context):
    
    if self.get_options().recursive:
      requested_targets = context.targets(exclude_scopes=Scope(self.get_options().exclude_scopes))
    else:
      requested_targets = list(context.target_roots)

    expanded_targets = list(requested_targets)
    # We want to act on targets derived from the specified, e.g., if acting on a binary
    # jar_library we actually want to act on the derived java_library wrapping the decompiled
    # sources.
    for t in requested_targets:
      expanded_targets.extend(context.build_graph.get_all_derivatives(t.address))

    return tuple(sorted(
      [t for t in expanded_targets if isinstance(t, JvmTarget) and t.has_sources('.java')],
      key=lambda t: t.address.spec))
1125497
def calculate_sources(self, targets):
    """"""
    sources = set()
    for target in targets:
      sources.update(
        source for source in target.sources_relative_to_buildroot()
        if source.endswith(self._PYTHON_SOURCE_EXTENSION)
      )
    return sources
774574
private List<SourceFile> getBuiltinExterns(CompilerOptions options) {
    try {
      return CommandLineRunner.getBuiltinExterns(options.getEnvironment());
    } catch (IOException e) {
      throw new BuildException(e);
    }
  }
762567
public java.util.List<SourceDetail> getSourceDetails() {
        if (sourceDetails == null) {
            sourceDetails = new com.amazonaws.internal.SdkInternalList<SourceDetail>();
        }
        return sourceDetails;
    }
69602
private List<TestCaseDef> getBaseValidCases( FunctionInputDef inputDef, VarTupleSet validTuples, List<TestCaseDef> baseCases)
    {
    logger_.debug( "{}: Extending valid base test cases", inputDef);

    Iterator<TestCaseDef> validBaseCases =
      IteratorUtils.filteredIterator(
        baseCases.iterator(),
        testCase -> testCase.getInvalidVar() == null);

    List<TestCaseDef> testCases = extendBaseCases( inputDef, validTuples, validBaseCases);

    logger_.info( "{}: Extended {} valid base test cases", inputDef, testCases.size());
    return testCases;
   }
1048328
public List<Reference> getAllReferences(SystemUnderTest systemUnderTest, Specification specification)
    {
        final Criteria crit = sessionService.getSession().createCriteria(Reference.class);
        crit.createAlias("specification", "spec");
        crit.add(Restrictions.eq("spec.name", specification.getName()));
        crit.createAlias("spec.repository", "repo");
        crit.add(Restrictions.eq("repo.uid", specification.getRepository().getUid()));
        crit.createAlias("systemUnderTest", "sut");
        crit.add(Restrictions.eq("sut.name", systemUnderTest.getName()));
        crit.createAlias("sut.project", "sp");
        crit.add(Restrictions.eq("sp.name", systemUnderTest.getProject().getName()));

        @SuppressWarnings("unchecked")
        List<Reference> references = crit.list();
		HibernateLazyInitializer.initCollection(references);
        return references;
    }
113074
public ArrayList getAllPubSubOutputHandlerMatchTargets()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "getAllPubSubOutputHandlerMatchTargets");

    ArrayList outputHandlerList;

    // Get from the HashMap, with synch, there may be other accessors
    synchronized(_targets)
    {
      outputHandlerList = new ArrayList(_targets.size());
      Iterator itr = _targets.keySet().iterator();

      while (itr.hasNext())
      {
        Object key = itr.next();

        if (key instanceof ControllableProxySubscription)
          outputHandlerList.add(
            ((ControllableProxySubscription) key).getOutputHandler());

      }
    }

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(
        tc,
        "getAllPubSubOutputHandlerMatchTargets",
        outputHandlerList);

    return outputHandlerList;
  }