Reflection: Get all references

List of can be filtered by section, just like getAllMachineActions
method does.
557021
public function getAllMachineReferences($having_section = null)
	{
		if ($having_section === null) {
			return array_keys((array) @ $this->references);
		} else {
			return array_keys(array_filter((array) @ $this->references,
				function($a) use ($having_section) { return !empty($a[$having_section]); }));
		}
	}
1212866
@Exported(name="actions")
    @Nonnull
    public final List<? extends Action> getAllActions() {
        List<Action> _actions = getActions();
        boolean adding = false;
        for (TransientActionFactory<?> taf : TransientActionFactory.factoriesFor(getClass(), Action.class)) {
            Collection<? extends Action> additions = createFor(taf);
            if (!additions.isEmpty()) {
                if (!adding) { // need to make a copy
                    adding = true;
                    _actions = new ArrayList<>(_actions);
                }
                _actions.addAll(additions);
            }
        }
        return Collections.unmodifiableList(_actions);
    }
88519
@Transactional(readOnly = true)
	public Collection<Response> findAll() {
		return em.createQuery("FROM Response", Response.class).getResultList();
	}
249753
def referenceSetsGenerator(self, request):
        
        results = []
        for obj in self.getDataRepository().getReferenceSets():
            include = True
            if request.md5checksum:
                if request.md5checksum != obj.getMd5Checksum():
                    include = False
            if request.accession:
                if request.accession not in obj.getSourceAccessions():
                    include = False
            if request.assembly_id:
                if request.assembly_id != obj.getAssemblyId():
                    include = False
            if include:
                results.append(obj)
        return self._objectListGenerator(request, results)
468065
def all(self):
        
        result = self.invoke()
        if self.resolve_links:
            result.resolve_links()

        return result
680202
def getAllPlatformObjects(mode = None):
    

    listAll = []

    ############################################################################
    ############################################################################

    # --------------------------------------------------------------------------
    # Dinamically collecting all the "official" modules
    # --------------------------------------------------------------------------

    # A list that will contain all of the module names
    all_modules = []

    # Grabbing all the module names
    for _, name, _ in pkgutil.iter_modules(osrframework.wrappers.__path__):
        all_modules.append("osrframework.wrappers." + name)

    # Iterating through all the module names to grab them
    for moduleName in all_modules:
        # Importing the module
        my_module = importlib.import_module(moduleName)

        # Getting all the classNames.
        classNames = [m[0] for m in inspect.getmembers(my_module, inspect.isclass) if m[1].__module__ == moduleName]

        # Dinamically grabbing the first class of the module. IT SHOULD BE ALONE!
        MyClass = getattr(my_module, classNames[0])

        # Instantiating the object
        newInstance = MyClass()

        # Adding to the list!
        listAll.append(newInstance)

    # --------------------------------------------------------------------------
    # Loading user-defined wrappers under [OSRFrameworkHOME]/plugins/wrappers/
    # --------------------------------------------------------------------------

    # Creating the application paths
    paths = configuration.getConfigPath()

    newPath = os.path.abspath(paths["appPathWrappers"])

    # Inserting in the System Path
    if not newPath in sys.path:
        sys.path.append(newPath)

    userImportedModules = {}

    for module in os.listdir(newPath):
        if module[-3:] == '.py':
            current = module.replace('.py', '')
            userImportedModules[current] = __import__(current)

    del newPath

    userClasses = []

    # Iterating through all the files
    for userModule in userImportedModules.keys():

        my_module = userImportedModules[userModule]
        # Getting all the classNames.
        classNames = [m[0] for m in inspect.getmembers(my_module, inspect.isclass) if m[1].__module__ == userModule]

        # Dinamically grabbing the first class of the module. IT SHOULD BE ALONE!
        MyClass = getattr(my_module, classNames[0])

        # Instantiating the object
        newInstance = MyClass()

        # Adding to the list!
        userClasses.append(newInstance)

    # --------------------------------------------------------------------------
    # Overwriting original modules with the user plugins
    # --------------------------------------------------------------------------
    listToAdd = []
    for userClass in userClasses:
        overwritten = False
        for i, officialClass in enumerate(listAll):
            # Checking if the name is the same
            if str(userClass) == str(officialClass):
                # Replacing the official module if a user module exists for it
                listAll[i] = userClass
                # We stop iterating this loop
                overwritten = True
                break
        if not overwritten:
            # Appending the new class
            listToAdd.append(userClass)

    # Merging listAll and listToAdd
    listAll = listAll + listToAdd
    ############################################################################
    ############################################################################

    creds = credentials.getCredentials()

    for p in listAll:
        # Verify if there are credentials to be loaded
        if p.platformName.lower() in creds.keys():
            p.setCredentials(creds[p.platformName.lower()])

    if mode == None:
        return listAll
    else:
        # We are returning only those platforms which are required by the mode.
        selected = []
        for p in listAll:
            try:
                if p.isValidMode[mode]:
                    selected.append(p)
            except:
                pass
        return selected
201404
public ServiceReference<?>[] fetchReferences() {
        try {
            LOGGER.debug("Try to locate a suitable service for objectClass = "
                    + serviceInterface + " and filter = " + filterString);
            return bundleContext.getAllServiceReferences(serviceInterface, filterString);
        } catch (InvalidSyntaxException e) {
            LOGGER.error("Creation of filter failed: {}", e.getMessage(), e);
            throw new RuntimeException("Creation of filter failed", e);
        }
    }
1163050
private List<ClassDocImpl> getClasses(boolean filtered) {
        if (allClasses != null && !filtered) {
            return allClasses;
        }
        if (allClassesFiltered != null && filtered) {
            return allClassesFiltered;
        }
        ListBuffer<ClassDocImpl> classes = new ListBuffer<>();
        for (Symbol enumerated : sym.members().getSymbols(NON_RECURSIVE)) {
            if (enumerated != null) {
                ClassSymbol s = (ClassSymbol)enumerated;
                ClassDocImpl c = env.getClassDoc(s);
                if (c != null && !c.isSynthetic())
                    c.addAllClasses(classes, filtered);
            }
        }
        if (filtered)
            return allClassesFiltered = classes.toList();
        else
            return allClasses = classes.toList();
    }
726160
public function getAllMachineViews($having_section = null)
	{
		if ($having_section === null) {
			return array_keys((array) @ $this->views);
		} else {
			return array_keys(array_filter((array) @ $this->views,
				function($a) use ($having_section) { return !empty($a[$having_section]); }));
		}
	}
938019
def reffinder(sectionObj):
    
    text = sectionObj['text']
    reftags = [x for x in refTagRegEx.finditer(text)]
    if reftags:
        references = []
        for tag in reftags:
            references.append(int(tag.group(1)))

        sectionObj['references'] = references

        text = refTagRegEx.sub('', text)
        sectionObj['text'] = text

    return sectionObj
1362868
def get_all_classes(module_name):
    """"""
    module = importlib.import_module(module_name)
    return getmembers(module, lambda m: isclass(m) and not isabstract(m))
439969
public static List<Instance> findAllScopedInstances( AbstractApplication app ) {

		List<Instance> instanceList = new ArrayList<> ();
		List<Instance> todo = new ArrayList<> ();
		todo.addAll( app.getRootInstances());

		while( ! todo.isEmpty()) {
			Instance current = todo.remove( 0 );
			todo.addAll( current.getChildren());
			if( isTarget( current ))
				instanceList.add( current );
		}

		return instanceList;
	}
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))
1104310
@Override
	public List<CPDefinitionGroupedEntry> findAll() {
		return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
106702
@RequestMapping(value = "/scope", method = GET, produces = APPLICATION_JSON_VALUE)
	public List<Scope> allScopes() {
		return this.scopeService.getAllScopes();
	}
779582
@Nonnull
  public ApiFuture<List<DocumentSnapshot>> getAll(
      @Nonnull DocumentReference... documentReferences) {
    Preconditions.checkState(isEmpty(), READ_BEFORE_WRITE_ERROR_MSG);

    return firestore.getAll(documentReferences, /*fieldMask=*/ null, transactionId);
  }
1032789
private Map<String, Reference> getReferences(ReadGroupSet readGroupSet) 
      throws IOException, GeneralSecurityException {
    Set<String> referenceSetIds = Sets.newHashSet();
    if (!Strings.isNullOrEmpty(readGroupSet.getReferenceSetId())) {
      LOG.info("Found reference set from read group set: " + 
          readGroupSet.getReferenceSetId());
      referenceSetIds.add(readGroupSet.getReferenceSetId());
    }
    if (readGroupSet.getReadGroups() != null) {
      LOG.info("Found read groups");
      for (ReadGroup readGroup : readGroupSet.getReadGroups()) {
        if (!Strings.isNullOrEmpty(readGroup.getReferenceSetId())) {
          LOG.info("Found reference set from read group: " + 
              readGroup.getReferenceSetId());
          referenceSetIds.add(readGroup.getReferenceSetId());
        }
      }
    }
    
    Map<String, Reference> references = Maps.newHashMap();
    for (String referenceSetId : referenceSetIds) {
      LOG.info("Getting reference set " + referenceSetId);
      ReferenceSet referenceSet = getApi().referencesets().get(referenceSetId).execute();
      if (referenceSet == null || referenceSet.getReferenceIds() == null) {
        continue;
      }
      for (String referenceId : referenceSet.getReferenceIds()) {
        LOG.fine("Getting reference  " + referenceId);
        Reference reference = getApi().references().get(referenceId).execute();
        if (!Strings.isNullOrEmpty(reference.getName())) {
          references.put(reference.getName(), reference);
          LOG.fine("Adding reference  " + reference.getName());
        }
      }
    }
    return references;
  }