Collect cyclic garbage, and return the strongly connected
    components that were keeping the garbage alive.
332301
def key_cycles():
    
    graph = garbage()
    sccs = graph.strongly_connected_components()
    return [scc for scc in sccs if _is_orphan(scc, graph)]
1006340
def recycle(self):
        '''
        '''

        for connection in self._connections:
            self._connection_pool.no_wait_release(connection)

        self._connections.clear()
1018052
def get_connected_components(graph):
    

    list_of_components = []
    component = []  # Not strictly necessary due to the while loop structure, but it helps the automated analysis tools

    # Store a list of all unreached vertices
    unreached = set(graph.get_all_node_ids())
    to_explore = deque()

    while len(unreached) > 0:
        # This happens when we reach the end of a connected component and still have more vertices to search through
        if len(to_explore) == 0:
            n = unreached.pop()
            unreached.add(n)
            to_explore.append(n)
            component = []
            list_of_components.append(component)

        # This is the BFS that searches for connected vertices
        while len(to_explore) > 0:
            n = to_explore.pop()
            if n in unreached:
                component.append(n)
                unreached.remove(n)
                nodes = graph.neighbors(n)
                for n in nodes:
                    if n in unreached:
                        to_explore.append(n)

    return list_of_components
908925
void recycleSegment(final CommitLogSegment segment)
    {
        boolean archiveSuccess = CommitLog.instance.archiver.maybeWaitForArchiving(segment.getName());
        activeSegments.remove(segment);
        if (!archiveSuccess)
        {
            // if archiving (command) was not successful then leave the file alone. don't delete or recycle.
            discardSegment(segment, false);
            return;
        }
        if (isCapExceeded())
        {
            discardSegment(segment, true);
            return;
        }

        logger.debug("Recycling {}", segment);
        segmentManagementTasks.add(new Callable<CommitLogSegment>()
        {
            public CommitLogSegment call()
            {
                return segment.recycle();
            }
        });
    }
1240139
def _get_components(self):
        
        return tuple([self._getitem__components(i) for
                     i in range(self._len__components())])
129591
private void scavenge()
    {
        Thread thread = Thread.currentThread();
        ClassLoader old_loader = thread.getContextClassLoader();
        try
        {
            if (_handler==null)
                return;
            
            ClassLoader loader = _handler.getClassLoader();
            if (loader!=null)
                thread.setContextClassLoader(loader);
            
            long now = System.currentTimeMillis();
            
            // Since Hashtable enumeration is not safe over deletes,
            // we build a list of stale sessions, then go back and invalidate them
            Object stale=null;
            

            synchronized(AbstractSessionManager.this)
            {
                // For each session
                for (Iterator i = _sessions.values().iterator(); i.hasNext(); )
                {
                    Session session = (Session)i.next();
                    long idleTime = session._maxIdleMs;
                    if (idleTime > 0 && session._accessed + idleTime < now) {
                        // Found a stale session, add it to the list
                        stale=LazyList.add(stale,session);
                    }
                }
            }
            
            // Remove the stale sessions
            for (int i = LazyList.size(stale); i-->0;)
            {
                // check it has not been accessed in the meantime
                Session session=(Session)LazyList.get(stale,i);
                long idleTime = session._maxIdleMs;
                if (idleTime > 0 && session._accessed + idleTime < System.currentTimeMillis())    
                {
                    session.invalidate();
                    int nbsess = this._sessions.size();
                    if (nbsess < this._minSessions)
                        this._minSessions = nbsess;
                }
            }
        }
        finally
        {
            thread.setContextClassLoader(old_loader);
        }
    }
1002296
def all(self, components_in_and=True):
        ''''''
        self.components_in_and = components_in_and
        return [obj for obj in iter(self)]
108167
def collect_usage_pieces(self, ctx):
        
        rv = [self.options_metavar]
        for param in self.get_params(ctx):
            rv.extend(param.get_usage_pieces(ctx))
        return rv
901952
def connected_objects(self, from_obj):
        
        return self.to_content_type.get_all_objects_for_this_type(pk__in=self.connected_object_ids(from_obj))
26887
function collectDependencies(){
	const files = glob.sync(posix.resolve(__dirname, "../Tone/!(shim)/!(Tone).js"));
	const modules = files.map(f => f.slice(0, -3));
	let reqString = modules.map(r => {
		const relativePath = posix.relative(posix.resolve(__dirname, "../Tone"), r);
		// const exportName = r.split("/")[r.split("/").length - 1];
		// return `export { default as ${exportName} } from "./${relativePath}";`;
		// return `import "./${relativePath}";`;
		return `require("./${relativePath}");`;
	}).join("\n");
	// reqString += "\nexport { default } from \"./core/Tone\";\n";
	reqString += "\nmodule.exports = require(\"./core/Tone\").default;\n";
	fs.writeFileSync(posix.resolve(__dirname, "../Tone/index.js"), reqString);
}
25788
def connected_components(G):
    
    result = []
    vertices = set(G.vertices)
    while vertices:
        n = vertices.pop()
        group = {n}
        queue = Queue()
        queue.put(n)
        while not queue.empty():
            n = queue.get()
            neighbors = set(G.vertices[n])
            neighbors.difference_update(group)
            vertices.difference_update(neighbors)
            group.update(neighbors)
            for element in neighbors:
                queue.put(element)
        result.append(group)
    return result
240745
private boolean recycle(Segment seg) {
        if(_recycleList.size() < _recycleLimit) {
            return _recycleList.add(seg);
        }
        
        return false;
    }
675777
void recycle() {
        for (int i = 0 ; i < size; i ++) {
            array[i] = null;
        }
        size = 0;
        insertSinceRecycled = false;

        recycler.recycle(this);
    }
1036252
def split(self, meta=False):
        
        return [self.substructure(c, meta, False) for c in connected_components(self)]
483914
def collect_modules(self):
        """"""
        for path, dirlist, filelist in os.walk(self.root):
            for name in fnmatch.filter(filelist, self.filter):
                if self.is_git_file(path, name):
                    yield (os.path.join(path, name), [])
372498
@Override
   void recycle(final PoolEntry poolEntry)
   {
      metricsTracker.recordConnectionUsage(poolEntry);

      connectionBag.requite(poolEntry);
   }
192958
protected function garbageCollect()
    {
        foreach (Finder::create()->files()->name('*.json')->date('< ' . $this->gc_lifetime . ' hour ago')->in(
            $this->dirname
        ) as $file) {
            $this->files->delete($file->getRealPath());
        }
    }