Clear empty sute groups
350128
private function clearEmptyGroups()
    {
        foreach (Craft::$app->sites->getAllGroups() as $group) {
            if (count($group->getSites()) == 0) {
                Craft::$app->sites->deleteGroup($group);
            }
        }
    }
52169
private void clearMemberData()
   {
      m_reader = null;
      m_eventManager = null;
      m_file = null;
      m_root = null;
      m_resourceMap = null;
      m_projectDir = null;
      m_viewDir = null;
      m_outlineCodeVarData = null;
      m_outlineCodeVarMeta = null;
      m_projectProps = null;
      m_fontBases = null;
      m_taskSubProjects = null;
      m_parentTasks = null;
      m_taskOrder = null;
      m_nullTaskOrder = null;
   }
187972
def clear_batch *types
    types = [:insert, :update, :delete] if types.empty?
    types.each do |type|
      raise ArgumentError.new("Invalid type: #{type}") unless @pstmts.has_key?(type)
      @pstmts[type].values.each(&:clear_batch)
    end
    nil
  end
499173
def clear(self, size=-1, *, offset=0, chunk=None) -> None:
        '''
            
        '''

        self.mglo.clear(size, offset, chunk)
1296348
def clear(self):
        """"""
        for field in self.__privfields__:
            delattr(self, field)
            setattr(self, field, MPI(0))
1192979
def clear(self):
        
        for f in [x['content'] for x in self.metadata.values()]:
            os.remove(f)

        self.metadata = {}
        self._flush()
398975
public function clean($group = null)
	{
		$path = $this->directory . ($group ? DIRECTORY_SEPARATOR . $group : '');
		$root = ($path == $this->directory);

		if (is_dir($path))
		{
			foreach (new DirectoryIterator($path) as $file)
			{
				if (!$root || (!$file->isDot() && !in_array(strtolower($file->getFilename()), static::$skip)))
				{
					if ($file->isDir())
					{
						//$this->clean(($group ? $group . DIRECTORY_SEPARATOR : '') . $file->getFilename());
					}
					else
					{
						unlink($file->getPathname());
					}
				}
			}

			if (!$root)
			{
				@rmdir($path);
			}
		}
	}
1055089
function (groupId) {
        server.state.set('groups[' + groupId + ']', []);
        let hasNonEmptyGroups = false;
        server.state.get('groups').forEach(function (e) {
            if (!Utils.isNullOrEmpty(e)) {
                hasNonEmptyGroups = true;
            }
        });
        if (hasNonEmptyGroups) {
            log.info('Successfully deleted group:', groupId);
        } else {
            server.state.set('groups', []);
            log.info('Successfully deleted all groups');
        }
    }
1008708
protected function removeCurrentGroups()
    {
        $valuesToRemove = $this->getCurrentLdapAttributeValue($this->options['from_attribute']);
        $valuesToRemove = is_null($valuesToRemove) ? [] : $valuesToRemove;
        $valuesToRemove = is_array($valuesToRemove)  ? $valuesToRemove : [$valuesToRemove];

        foreach ($valuesToRemove as $value) {
            $this->addOperation(parent::toLdap($value), Batch::TYPE['REMOVE']);
        }
894102
def clear(self):
        """"""
        self._functions=[]
        self._args=[]
        self._kwargs=[]
        self._kind=[]
162866
def clean_empty(self, d=DEFAULT):
        
        if d is DEFAULT:
            d = self
        if isinstance(d, list):
            return [v for v in (self.clean_empty(v) for v in d) if v or v == 0]
        elif isinstance(d, type(self)):
            return type(self)({k: v for k, v in ((k, self.clean_empty(v)) for k, v in d.items()) if v or v == 0})
        elif isinstance(d, dict):
            return {k: v for k, v in ((k, self.clean_empty(v)) for k, v in d.items()) if v or v == 0}
        return d
1103912
private function resetCraftSitesServiceGroupsCache()
    {
        $obj = Craft::$app->sites;
        $refObject = new \ReflectionObject($obj);
        if ($refObject->hasProperty('_fetchedAllGroups')) {
            $refProperty = $refObject->getProperty('_fetchedAllGroups');
            $refProperty->setAccessible(true);
            $refProperty->setValue($obj, false);
        }
    }
49282
def clear(self):
        """"""
        self._points = _np.empty( (self.prealloc,self.dim) )
        self._slice_for_run_nr = []
        self.memleft = self.prealloc
690850
private function clearSigHandlers() {
        pcntl_signal(SIGTERM, SIG_DFL);
        pcntl_signal(SIGINT,  SIG_DFL);
        pcntl_signal(SIGQUIT, SIG_DFL);
        pcntl_signal(SIGUSR1, SIG_DFL);
        pcntl_signal(SIGUSR2, SIG_DFL);
        pcntl_signal(SIGCONT, SIG_DFL);
    }
1026391
def _clean_empty(d):
    """"""
    if not isinstance(d, (dict, list)):
        return d
    if isinstance(d, list):
        return [v for v in (_clean_empty(v) for v in d) if v is not None]
    return {
        k: v for k, v in
        ((k, _clean_empty(v)) for k, v in d.items())
        if v is not None
    }
742707
def _fill_empty_groups_old(self, probs, assignment):
        
        new_assignment = np.array(assignment.tolist())
        for k in range(self.numgrp):
            if np.count_nonzero(assignment==k) == 0:
                logger.info('Group {} became empty'.format(k))
                best = np.where(probs[:,k]==probs[:,k].max())[0][0]
                new_assignment[best] = k
                new_assignment = self._fill_empty_groups(probs, new_assignment)
        return new_assignment
605020
def remove(self):
        
        for cgroup in self.paths:
            remove_cgroup(cgroup)

        del self.paths
        del self.per_subsystem