check if group with given name is already exists
761162
def is_group_name_exists(self, group_name):
        
        groups = self.m["groups"]
        for g in groups:
            if (g["group_name"] == group_name):
                return True
        return False
487614
def exists_uda(self, name, database=None):
        
        return len(self.list_udas(database=database, like=name)) > 0
1185548
def exists(self, name):
        
        with self.pipe as pipe:
            return pipe.exists(self.redis_key(name))
509349
def replication_group_exists(name, region=None, key=None, keyid=None, profile=None):
    '''
    
    '''
    return bool(describe_replication_groups(name=name, region=region, key=key, keyid=keyid,
                profile=profile))
1173262
def member_of(self, group):
        
        if isinstance(group, Group):
            group = group.name
        return self.groups.filter(name=group).exists()
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]
865998
public boolean hasGroup(String groupName) {
        boolean result = false;
        for (Group item : getGroupsList()) {
            if (item.getName().equals(groupName)) {
                result = true;
            }
        }
        return result;
    }
628201
def user_exists_in_group(user_name, group_name, region=None, key=None, keyid=None,
                         profile=None):
    '''
    
    '''
    # TODO this should probably use boto.iam.get_groups_for_user
    users = get_group_members(
        group_name=group_name, region=region, key=key, keyid=keyid,
        profile=profile
    )
    if users:
        for _user in users:
            if user_name == _user['user_name']:
                log.debug('IAM user %s is already in IAM group %s.', user_name, group_name)
                return True
    return False
856339
def has_name_in(cls, names):
        """"""
        return cls.sha512.in_({
            cls.hash_name(name)
            for name in names
        })
730208
public function existsRouteGroup(string $groupName): bool
  {
    foreach ($this->routeGroups as $routeGroup)
    {
      if ( strcasecmp($routeGroup->getName(),$groupName)==0 ) {
        return true;
      }
    }

    return false;
  }
253195
def exists(cls, id):
        """"""
        return bool(redisco.get_client().exists(cls._key[str(id)]) or
                    redisco.get_client().sismember(cls._key['all'], str(id)))
371524
def get_group(self, name):
        

        groups = self.get_groups()
        for group in groups:
            if group['contactgroupname'] == name:
                return group

        msg = 'No group named: "{name}" found.'
        raise FMBaseError(msg.format(name=name))
1028712
protected final boolean isGroupNameValid(String name) {
        if (name == null) {
            return false;
        }

        if (!name.startsWith(DuracloudGroup.PREFIX)) {
            return false;
        }

        if (DuracloudGroup.PUBLIC_GROUP_NAME.equalsIgnoreCase(name)) {
            return false;
        }

        return name.substring(DuracloudGroup.PREFIX.length()).matches(
            "\\A(?![_.@\\-])[a-z0-9_.@\\-]+(?<![_.@\\-])\\Z");
    }
1035578
def exists(*nictag, **kwargs):
    '''
    
    '''
    ret = {}
    if not nictag:
        return {'Error': 'Please provide at least one nictag to check.'}

    cmd = 'nictagadm exists -l {0}'.format(' '.join(nictag))
    res = __salt__['cmd.run_all'](cmd)

    if not kwargs.get('verbose', False):
        ret = res['retcode'] == 0
    else:
        missing = res['stderr'].splitlines()
        for nt in nictag:
            ret[nt] = nt not in missing

    return ret
535888
private boolean existsInDatabase(IEntityGroup group) throws GroupsException {
        IEntityGroup ug = this.find(group.getLocalKey());
        return ug != null;
    }
959410
def _name_exists(self, name):
        
        for i in range(self.count()):
            if self.tabText(i) == name:
                return True
        return False
1155070
def _check_device_exists_in_device_group(self, device_name):
        '''
        '''

        dg = self._get_device_group(self.devices[0])
        dg.devices_s.devices.load(name=device_name, partition=self.partition)