Get a representative for each component.
505233
public function findDistinct()
	{
		$a = [];
		foreach ($this->parents as $x => $r) {
			$a[$this->find($x)] = null;
		}
		return array_keys($a);
	}
501646
public final <C extends CalendarComponent> ComponentList<C> getComponents(final String name) {
        return getComponents().getComponents(name);
    }
1153909
public List<Object> getAll() {
		List<Object> components = new ArrayList<Object>();

		synchronized (_lock) {
			for (Reference reference : _references)
				components.add(reference.getComponent());
		}

		return components;
	}
1122162
def iter_components(self):
        """"""

        names = self.list_components()

        for name in names:
            yield self.get_component(name)
1133035
function collectComponent(component) {
    var name = component.constructor.name;
    (components[name] || (components[name] = [])).push(component);
  }
526212
def _get_representative_batch(merged):
    
    out = {}
    for mgroup in merged:
        mgroup = sorted(list(mgroup))
        for x in mgroup:
            out[x] = mgroup[0]
    return out
89237
def getComponentList(self):
        '''
        
        '''

        component_list = []

        for x in self.discountcombocomponent_set.all():
            for y in range(0,x.quantity):
                component_list += [x]

        component_list.sort(key=lambda x: x.quantity, reverse=True)
        return component_list
1192228
def get_parts(self, parts=None, reference_level=0):
        """"""
        if parts is None:
            parts = list()
            new_reference_level = reference_level
        else:
            self._level_in_section = self._level + reference_level
            new_reference_level = self._level_in_section
            parts.append(self.my_osid_object)
        if self._child_parts is None:
            if self.has_magic_children():
                self.generate_children()
            else:
                return parts
        for part in self._child_parts:
            part.get_parts(parts, new_reference_level)
            # Don't need to append here, because parts is passed by reference
            # so appending is redundant
            # child_parts = part.get_parts(parts, new_reference_level)
            # known_part_ids = [str(part.ident) for part in parts]
            #
            # for child_part in child_parts:
            #     if str(child_part.ident) not in known_part_ids:
            #         parts.append(child_part)
            #         known_part_ids.append(str(child_part.ident))
        return parts
894729
def _selectionParameters(self, param):
        """"""
        components = param['selection']
        if len(components) == 0:
            return []
        # extract the selected component names
        editable_sets = []
        for comp in components:
            # all the keys (component names) for the auto details for components in selection
            details = comp.auto_details()
            editable_sets.append(set(details.keys()))
        editable_paramters = set.intersection(*editable_sets)
        # do not allow selecting of filename from here
        return list(editable_paramters)
761464
public synchronized List<String> getComponents() {
        List<String> compos = new ArrayList<>();
        for (Map.Entry<String, String> entry : componentVersions.entrySet()) {
            compos.add(entry.getKey());
        }
        return compos;
    }
311263
public static Collection<Component> getComponentsList() {
    TransactionLogger instance = getInstance();
    if (instance == null) {
      return null;
    }

    return instance.components.values();
  }
688699
def get(user_name, repo_name, component_id, params={})
      update_and_validate_user_repo_params(user_name, repo_name)
      normalize! params

      get_request("/2.0/repositories/#{user}/#{repo.downcase}/components/#{component_id}", params)
    end
341647
def build_component_order(self):
        
        present_components = [item for item in self.__dict__.values() if isinstance(item, Component) and item.enabled]
        result = [None] * len(present_components)
        used_prios = set()
        for component in present_components:
            index = component.priority % len(present_components)
            if index in used_prios:
                raise ValueError("Duplicate priority: {}".format(component.priority))
            used_prios.add(index)

            result[index] = component

        # Check if predecessors are valid
        for i, component in enumerate(result):
            if any(i < result.index(pre) for pre in component.predecessors):
                raise ValueError("Component {} comes before at least one of its predecessors".format(component))

        return result
1260315
public List<ICalComponent> getComponents(T component) {
		return new ArrayList<ICalComponent>(component.getComponents().values());
	}
971080
def getmembers(_object, _predicate):
    """"""
    # This should be:
    #return inspect.getmembers(_object, _predicate)

    # ... and it is re-implemented as:
    observers = []
    for key in dir(_object):
        try: m = getattr(_object, key)
        except AttributeError: continue
        if _predicate(m): observers.append((key, m))
        pass
    return observers
781158
def get_components_for_species( alignment, species ):
    """"""
    # If the number of components in the alignment is less that the requested number
    # of species we can immediately fail
    if len( alignment.components ) < len( species ): return None
    # Otherwise, build an index of components by species, then lookup 
    index = dict( [ ( c.src.split( '.' )[0], c ) for c in alignment.components ] )
    try: return [ index[s] for s in species ]
    except: return None
303506
public function listComponentDetails()
    {
        if ($this->detailsCache !== null) {
            return $this->detailsCache;
        }

        $details = [];
        foreach ($this->listComponents() as $componentAlias => $componentClass) {
            $details[$componentAlias] = $this->makeComponent($componentClass)->componentDetails();
        }

        return $this->detailsCache = $details;
    }