Returns True if the settings contain a group with the name groupName.
        Works recursively when the groupName is a slash separated path.
322972
def containsSettingsGroup(groupName, settings=None):
    
    def _containsPath(path, settings):
        "Aux function for containsSettingsGroup. Does the actual recursive search."
        if len(path) == 0:
            return True
        else:
            head = path[0]
            tail = path[1:]
            if head not in settings.childGroups():
                return False
            else:
                settings.beginGroup(head)
                try:
                    return _containsPath(tail, settings)
                finally:
                    settings.endGroup()

    # Body starts here
    path = os.path.split(groupName)
    logger.debug("Looking for path: {}".format(path))
    settings = QtCore.QSettings() if settings is None else settings
    return _containsPath(path, settings)
338527
public function group($name, $settings = null, $callback = null)
    {
        if($this->cacheLoaded) {
            return true;
        }

        $groupName = trim($name, '/');
        $group = [];
        $group['route'] = '/' . $groupName;
        $group['before'] = $group['after'] = null;

        if (is_null($callback)) {
            $callback = $settings;
        } else {
            $group['before'][] = (!isset($settings['before']) ? null : $settings['before']);
            $group['after'][]  = (!isset($settings['after']) ? null : $settings['after']);
        }

        $groupCount = count($this->groups);
        if ($groupCount > 0) {
            $list = [];
            foreach ($this->groups as $key => $value) {
                if (is_array($value['before'])) {
                    foreach ($value['before'] as $k => $v) {
                        $list['before'][] = $v;
                    }
                    foreach ($value['after'] as $k => $v) {
                        $list['after'][] = $v;
                    }
                }
            }

            if (! is_null($group['before'])) {
                $list['before'][] = $group['before'][0];
            }

            if (! is_null($group['after'])) {
                $list['after'][] = $group['after'][0];
            }

            $group['before'] = $list['before'];
            $group['after'] = $list['after'];
        }

        $group['before'] = array_values(array_unique( (array) $group['before']));
        $group['after'] = array_values(array_unique( (array) $group['after']));

        array_push($this->groups, $group);

        if (is_object($callback)) {
            call_user_func_array($callback, [$this]);
        }

        $this->endGroup();

        return true;
    }
933756
public static List<Setting> groupsToSettings(List<Group> groups) {
    return groups.stream()
        .map(Group::getSettings)
        .flatMap(Collection::stream)
        .collect(Collectors.toList());
  }
909466
def is_in_groups? *groups
      groups = groups.flat_uniq
      groups.all? {|group| is_in_group? group}
    end
100346
def saveSettings(self, groupName=None):
        
        groupName = groupName if groupName else self.settingsGroupName
        settings = QtCore.QSettings()
        logger.info("Saving {} to: {}".format(groupName, settings.fileName()))

        settings.remove(groupName) # start with a clean slate
        settings.beginGroup(groupName)
        try:
            for itemNr, item in enumerate(self.items):
                key = "item-{:03d}".format(itemNr)
                value = repr(item.asDict())
                settings.setValue(key, value)
        finally:
            settings.endGroup()
266475
def group_exists(groupname):
    """"""
    try:
        grp.getgrnam(groupname)
        group_exists = True
    except KeyError:
        group_exists = False
    return group_exists
789124
public boolean containsKey(String field) {
		try {
			return getJedisCommands(groupName).hexists(key, field);
		} finally {
			getJedisProvider(groupName).release();
		}
	}
442539
public boolean containsKey(String group, String key) {
		group = StrUtil.nullToEmpty(group).trim();
		readLock.lock();
		try {
			final LinkedHashMap<String, String> valueMap = this.get(group);
			if (MapUtil.isNotEmpty(valueMap)) {
				return valueMap.containsKey(key);
			}
		} finally {
			readLock.unlock();
		}
		return false;
	}
26760
@Override
    public boolean deepContains(IGroupMember gm) throws GroupsException {
        if (this.contains(gm)) {
            return true;
        }

        boolean found = false;
        Iterator<IEntityGroup> it = getMemberGroups();
        while (it.hasNext() && !found) {
            IEntityGroup group = it.next();
            if (group != null) {
                found = group.deepContains(gm);
            } else {
                // Something bad has happened:  we've abruptly lost a group node to
                // which this group node refers.  This is an ERROR condition, but we
                // shouldn't simply throw an exception because we know (from
                // experience) it could make the portal unusable.  We definitely,
                // need, however, to send a strong message.
                String msg =
                        "Groups Integrety Error:  Group '"
                                + this.getName()
                                + "' refers to a child group that is no longer available";
                logger.error(msg);
            }
        }

        return found;
    }
144185
function containsPath(self, dirname) {
  return self.__paths__.some(function(p) {
    return p === dirname.substr(0, p.length);
  });
}
57362
def get_group_by_name(self, group_name: str) -> typing.Optional['Group']:
        
        VALID_STR.validate(group_name, 'get_group_by_name')
        for group in self.groups:

            if group.group_name == group_name:
                return group
        return None
825069
def filter_group_names(groups, patterns):
    
    group_names = [g['logGroupName'] for g in groups]
    matched = set()
    for p in patterns:
        matched.update(fnmatch.filter(group_names, p))
    return [g for g in groups if g['logGroupName'] in matched]
698822
public static List<String> getStringsWithGroup(String groupName,String...keys){
        try {
        	if(JedisProviderFactory.isCluster(groupName)){
        		return JedisProviderFactory.getMultiKeyJedisClusterCommands(groupName).mget(keys);
        	}else{
        		return JedisProviderFactory.getMultiKeyCommands(groupName).mget(keys);
        	}
		} finally {
			JedisProviderFactory.getJedisProvider(groupName).release();
		}
	}
393971
boolean isSubGroup(DiagnosticGroup group) {
    for (DiagnosticType type : group.types) {
      if (!matches(type)) {
        return false;
      }
    }
    return true;
  }
1033611
function inGroups(testGroups, filter){
            if (!filter.length){
                return true;
            } else {
                if (testGroups){
                    for (var i=0, len=testGroups.length; i < len; i++){
                        if (filter.indexOf("," + testGroups[i] + ",") > -1){
                            return true;
                        }
                    }
                }
                return false;
            }
        }
64069
public boolean hasGroupsInOtherOus() {

        if (m_hasGroupsInOtherOus == null) {
            // lazzy initialization
            m_hasGroupsInOtherOus = Boolean.FALSE;
            try {
                List<CmsGroup> groups = getGroups(true);
                Iterator<CmsGroup> itGroups = groups.iterator();
                while (itGroups.hasNext()) {
                    CmsGroup group = itGroups.next();
                    if (!group.getOuFqn().equals(getParamOufqn())) {
                        m_hasGroupsInOtherOus = Boolean.TRUE;
                        break;
                    }
                }
            } catch (Exception e) {
                // ignore
            }
        }
        return m_hasGroupsInOtherOus.booleanValue();
    }
1339860
private function groupIsSecure() : bool
    {
        foreach ($this->groupOptionsStack as $groupOptions) {
            if (isset($groupOptions['https']) && $groupOptions['https']) {
                return true;
            }
        }

        return false;
    }