For all subsystems, return the information in which (sub-)cgroup this process is in.
    (Each process is in exactly cgroup in each hierarchy.)
    @return a generator of tuples (subsystem, cgroup)
507046
def _find_own_cgroups():
    
    try:
        with open('/proc/self/cgroup', 'rt') as ownCgroupsFile:
            for cgroup in _parse_proc_pid_cgroup(ownCgroupsFile):
                yield cgroup
    except IOError:
        logging.exception('Cannot read /proc/self/cgroup')
498794
public List<Group> getTopGroups() {
        if (root != null && root.getGroups() != null && root.getGroups().size() == 1) {
            return root.getGroups().get(0).getGroups();
        }
        return new ArrayList<Group>();
    }
879042
public static int getNumGroups(Structure structure) {
		int count = 0;
		for(int i=0; i<structure.nrModels(); i++) {
			for(Chain chain : structure.getChains(i)){
				count+= chain.getAtomGroups().size();
			}
		}
		return count;
	}
215293
def subsystems(self):
    """"""
    ret = set()
    for task_type in self.task_types():
      ret.update([dep.subsystem_cls for dep in task_type.subsystem_dependencies_iter()])
    return ret
178260
public java.util.List<OperatingSystem> getOperatingSystems() {
        if (operatingSystems == null) {
            operatingSystems = new com.amazonaws.internal.SdkInternalList<OperatingSystem>();
        }
        return operatingSystems;
    }
902416
public Set<? extends Processor<?, ?>> getAllProcessors() {
        IdentityHashMap<Processor<?, ?>, Void> all = new IdentityHashMap<>();
        all.put(this.getProcessor(), null);
        for (ProcessorGraphNode<?, ?> dependency: this.dependencies) {
            for (Processor<?, ?> p: dependency.getAllProcessors()) {
                all.put(p, null);
            }
        }
        return all.keySet();
    }
975773
public SubProcessBuilder subProcessDone() {
    BpmnModelElementInstance lastSubProcess = element.getScope();
    if (lastSubProcess != null && lastSubProcess instanceof SubProcess) {
      return ((SubProcess) lastSubProcess).builder();
    }
    else {
      throw new BpmnModelException("Unable to find a parent subProcess.");
    }
  }
1036650
def _init_cgroups(self):
        
        self.cgroups = find_my_cgroups()

        for subsystem in self._cgroup_subsystems:
            self.cgroups.require_subsystem(subsystem)
            if subsystem not in self.cgroups:
                sys.exit('Required cgroup subsystem "{}" is missing.'.format(subsystem))

        # Feature is still experimental, do not warn loudly
        self.cgroups.require_subsystem(BLKIO, log_method=logging.debug)
        if BLKIO not in self.cgroups:
            logging.debug('Cannot measure I/O without blkio cgroup.')

        self.cgroups.require_subsystem(CPUACCT)
        if CPUACCT not in self.cgroups:
            logging.warning('Without cpuacct cgroups, cputime measurement and limit '
                            'might not work correctly if subprocesses are started.')

        self.cgroups.require_subsystem(FREEZER)
        if FREEZER not in self.cgroups:
            if self._user is not None:
                # In sudo mode, we absolutely need at least one cgroup subsystem
                # to be able to find the process where we need to send signals to
                sys.exit('Cannot reliably kill sub-processes without freezer cgroup,'
                         + ' this is necessary if --user is specified.'
                         + ' Please enable this cgroup or do not specify --user.')
            else:
                logging.warning('Cannot reliably kill sub-processes without freezer cgroup.')

        self.cgroups.require_subsystem(MEMORY)
        if MEMORY not in self.cgroups:
            logging.warning('Cannot measure memory consumption without memory cgroup.')
        else:
            if systeminfo.has_swap() and (
                    not self.cgroups.has_value(MEMORY, 'memsw.max_usage_in_bytes')):
                logging.warning(
                    'Kernel misses feature for accounting swap memory, but machine has swap. '
                    'Memory usage may be measured inaccurately. '
                    'Please set swapaccount=1 on your kernel command line or disable swap with '
                    '"sudo swapoff -a".')

        self.cgroups.require_subsystem(CPUSET)
        self.cpus = None # to indicate that we cannot limit cores
        self.memory_nodes = None # to indicate that we cannot limit cores
        if CPUSET in self.cgroups:
            # Read available cpus/memory nodes:
            try:
                self.cpus = util.parse_int_list(self.cgroups.get_value(CPUSET, 'cpus'))
            except ValueError as e:
                logging.warning("Could not read available CPU cores from kernel: %s", e.strerror)
            logging.debug("List of available CPU cores is %s.", self.cpus)

            try:
                self.memory_nodes = util.parse_int_list(self.cgroups.get_value(CPUSET, 'mems'))
            except ValueError as e:
                logging.warning("Could not read available memory nodes from kernel: %s",
                                e.strerror)
            logging.debug("List of available memory nodes is %s.", self.memory_nodes)
1364705
public java.util.List<String> getInstanceGroupTypes() {
        if (instanceGroupTypes == null) {
            instanceGroupTypes = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return instanceGroupTypes;
    }
592124
public List<FacesConfigFlowDefinitionFlowCallType<FacesConfigFlowDefinitionType<T>>> getAllFlowCall()
   {
      List<FacesConfigFlowDefinitionFlowCallType<FacesConfigFlowDefinitionType<T>>> list = new ArrayList<FacesConfigFlowDefinitionFlowCallType<FacesConfigFlowDefinitionType<T>>>();
      List<Node> nodeList = childNode.get("flow-call");
      for(Node node: nodeList)
      {
         FacesConfigFlowDefinitionFlowCallType<FacesConfigFlowDefinitionType<T>>  type = new FacesConfigFlowDefinitionFlowCallTypeImpl<FacesConfigFlowDefinitionType<T>>(this, "flow-call", childNode, node);
         list.add(type);
      }
      return list;
   }
798064
public static SystemManager getCurrent()
  {
    SystemManager system = _systemLocal.get();

    if (system == null) {
      WeakReference<SystemManager> globalRef = _globalSystemRef;

      if (globalRef != null) {
        system = globalRef.get();
      }
    }

    return system;
  }
684352
public java.util.List<String> getInstanceGroupIds() {
        if (instanceGroupIds == null) {
            instanceGroupIds = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return instanceGroupIds;
    }
1104496
public java.util.List<InstanceGroup> getInstanceGroups() {
        if (instanceGroups == null) {
            instanceGroups = new com.amazonaws.internal.SdkInternalList<InstanceGroup>();
        }
        return instanceGroups;
    }
458917
private ThreadGroup getRootThreadGroup() {
	
	    if ( rootThreadGroup != null )
	        return rootThreadGroup;
	    
	    ThreadGroup tg = Thread.currentThread( ).getThreadGroup( );
	    ThreadGroup ptg;
	    while ( (ptg = tg.getParent( )) != null )
	        tg = ptg;
	    
	    return tg;
		
	}
25166
def scan_cgroups(subsys_name, filters=list()):
    
    status = SubsystemStatus()
    if subsys_name not in status.get_all():
        raise NoSuchSubsystemError("No such subsystem found: " + subsys_name)

    if subsys_name not in status.get_available():
        raise EnvironmentError("Disabled in the kernel: " + subsys_name)

    if subsys_name not in status.get_enabled():
        raise EnvironmentError("Not enabled in the system: " + subsys_name)

    subsystem = _get_subsystem(subsys_name)
    mount_point = status.get_path(subsys_name)
    return _scan_cgroups_recursive(subsystem, mount_point, mount_point, filters)
494350
public List<FacesConfigLifecycleType<FacesConfigType<T>>> getAllLifecycle()
   {
      List<FacesConfigLifecycleType<FacesConfigType<T>>> list = new ArrayList<FacesConfigLifecycleType<FacesConfigType<T>>>();
      List<Node> nodeList = childNode.get("lifecycle");
      for(Node node: nodeList)
      {
         FacesConfigLifecycleType<FacesConfigType<T>>  type = new FacesConfigLifecycleTypeImpl<FacesConfigType<T>>(this, "lifecycle", childNode, node);
         list.add(type);
      }
      return list;
   }
1187517
public Set<ClassExpression> getGeneratorSubConcepts() {
		if (gens.size() == 1)
			return gens.iterator().next().getSubConcepts();
		
		Set<ClassExpression> all = new HashSet<ClassExpression>();		
		for (TreeWitnessGenerator twg : gens) 
			all.addAll(twg.getSubConcepts());
		return all;
	}