Removes all polymeric and solvent groups from a list of groups
339149
public static List<Group> filterLigands(List<Group> allGroups) {

		List<Group> groups = new ArrayList<Group>();
		for (Group g : allGroups) {

			if ( g.isPolymeric())
				continue;

			if (!g.isWater()) {
				groups.add(g);
			}
		}

		return groups;
	}
1069188
def remove_from_group(name, items)
      group = group_items(name)

      items.each do |item|
        utf8_item = item.encode("UTF-8")
        deallocate(utf8_item)
        group.delete(utf8_item)
      end

      replace_group(name, group)

      return items
    end
964580
def clean_indexes(self):
        
        self.sort()
        for index, item in enumerate(self):
            item.index = index + 1
553295
def deleteAllGroups(server):
    '''
    
    '''

    try:
        client, key = _get_session(server)
    except Exception as exc:
        err_msg = 'Exception raised when connecting to spacewalk server ({0}): {1}'.format(server, exc)
        log.error(err_msg)
        return {'Error': err_msg}

    groups = client.systemgroup.listAllGroups(key)

    deleted_groups = []
    failed_groups = []

    for group in groups:
        if client.systemgroup.delete(key, group['name']) == 1:
            deleted_groups.append(group['name'])
        else:
            failed_groups.append(group['name'])

    ret = {'deleted': deleted_groups}
    if failed_groups:
        ret['failed'] = failed_groups
    return ret
1137343
def detuning_combinations(lists):
    
    """
    Nl = len(lists)
    comb = [[i] for i in range(lists[0])]
    for l in range(1, Nl):
        combn = []
        for c0 in comb:
            for cl in range(lists[l]):
                combn += [c0[:]+[cl]]
        comb = combn[:]
    return comb
987479
def purgeAutoSelected(self):
        """"""
        params = self._autoParams.allData()
        for p in params:
            comps_to_remove = []
            for comp in p['selection']:
                if self.indexByComponent(comp) is None:
                    comps_to_remove.append(comp)
            for orphaned in comps_to_remove:
                p['selection'].remove(orphaned)
504736
def clean_value(self):
        
        result = []
        for mdl in self:
            result.append(super(ListNode, mdl).clean_value())
        return result
1233664
def _clean_listofcomponents(listofcomponents):
    """"""
    def totuple(item):
        """return a tuple"""
        if isinstance(item, (tuple, list)):
            return item
        else:
            return (item, None)
    return [totuple(item) for item in listofcomponents]
993288
def clean(docs=False, bytecode=False, extra=''):
    ''''''
    patterns = ['build', 'dist', 'cover', 'docs/_build', '**/*.pyc', '*.egg-info', '.tox', '**/__pycache__']
    for pattern in patterns:
        print('Removing {0}'.format(pattern))
        lrun('rm -rf {0}'.format(pattern))
1232021
def resolve_remove_symbols(self, r, target_group_ids, rgroups):
        
        if 'matched' in target_group_ids:
            return r.get('c7n:matched-security-groups', ())
        elif 'network-location' in target_group_ids:
            for reason in r.get('c7n:NetworkLocation', ()):
                if reason['reason'] == 'SecurityGroupMismatch':
                    return list(reason['security-groups'])
        elif 'all' in target_group_ids:
            return rgroups
        return target_group_ids
405683
def sort_protein_group(pgroup, sortfunctions, sortfunc_index):
    """"""
    pgroup_out = []
    subgroups = sortfunctions[sortfunc_index](pgroup)
    sortfunc_index += 1
    for subgroup in subgroups:
        if len(subgroup) > 1 and sortfunc_index < len(sortfunctions):
            pgroup_out.extend(sort_protein_group(subgroup,
                                                 sortfunctions,
                                                 sortfunc_index))
        else:
            pgroup_out.extend(subgroup)
    return pgroup_out
907931
def _remove_otiose(lst):
    """"""
    listtype = type([])
    while type(lst) == listtype and len(lst) == 1:
        lst = lst[0]

    return lst
427552
def remove_umis(adj_list, cluster, nodes):
    ''' '''

    # list incomprehension: for x in nodes: for node in adj_list[x]: yield node
    nodes_to_remove = set([node
                           for x in nodes
                           for node in adj_list[x]] + nodes)

    return cluster - nodes_to_remove
1268256
def clean(self):
        
        for key, value in self.values.copy().items():
            if value is None:
                del self.values[key]
559587
def clear_all
      @redis.del(list_key)
      @redis.del(protected_key)
      @redis.del(hash_key)
      @redis.del(env_key)
      @redis.del(grouping_key)
      @redis.del(solved_key)
      @redis.del(ignored_logs_count_key)
      Logster::PATTERNS.each do |klass|
        @redis.del(klass.set_name)
      end
      @redis.keys.each do |key|
        @redis.del(key) if key.include?(Logster::RedisRateLimiter::PREFIX)
      end
    end
1290111
def clean(ctx, docs=False, bytecode=False, extra=''):
    ''''''
    patterns = ['build', 'dist', 'cover', 'docs/_build', '**/*.pyc', '*.egg-info', '.tox']
    for pattern in patterns:
        print('Removing {0}'.format(pattern))
        with ctx.cd(ROOT):
            ctx.run('rm -rf {0}'.format(pattern))
1268046
def ungroup_array2singles(input, **params):
    
    PARAM_FIELD_KEY = 'field.key'
    PARAM_FIELD_ARRAY = 'field.array'
    PARAM_FIELD_SINGLE = 'field.single'

    res = []
    field_key = params.get(PARAM_FIELD_KEY) if PARAM_FIELD_KEY in params else None
    field_array = params.get(PARAM_FIELD_ARRAY)
    field_single = params.get(PARAM_FIELD_SINGLE)
    for row in input:
        if row[field_array] and len(row[field_array]) > 0:
            for value in row[field_array]:
                res.append({field_single: value} if not field_key else {field_key: row[field_key], field_single: value})
    return res