Flattens the group map
963196
protected void parseGroupMap(Map<String,Object> groupMap, Map<String,String> resultMap, String prefix) {
        Object obj;
        for (String groupKey : groupMap.keySet()) {
            obj = groupMap.get(groupKey);
            String key = prefix == null ? groupKey : prefix + "." + groupKey;
            if (obj instanceof Map)
                parseGroupMap(loader.getMap(groupKey, groupMap), resultMap, key); // Parse inner map
            else
                resultMap.put(key, decryptValue(obj.toString())); // String, Boolean and List values
        }
    }
795146
def flatten(list_to_flatten):
    """"""

    def genflatten(lst):
        for elem in lst:
            if isinstance(elem, (list, tuple)):
                for x in flatten(elem):
                    yield x
            else:
                yield elem

    return list(genflatten(list_to_flatten))
574793
def flatten(nested_list: list) -> list:
    """"""
    return list(sorted(filter(lambda y: y is not None,
                              list(map(lambda x: (nested_list.extend(x)  # noqa: T484
                                                  if isinstance(x, list) else x),
                                       nested_list)))))
1337369
def _flatten(self, iterator, **filter_options):
        '''
        
        '''
        resp = list()
        for entry in iterator:
            for tup in entry:
                if self._matches_filter(tup, **filter_options):
                    resp.append(tup)
        return resp
223218
def _flatten(lst):
    
    if not isinstance(lst, (list, tuple)):
        return [lst]
    result = []
    for item in lst:
        result.extend(_flatten(item))
    return result
410469
def flatten_dict(dic, parent_key='', sep='.'):
    
    items = []
    for key, value in dic.items():
        new_key = parent_key + sep + key if parent_key else key
        if isinstance(value, collections.MutableMapping):
            items.extend(flatten_dict(value, new_key, sep=sep).items())
        elif isinstance(value, list):
            for idx, elt in enumerate(value):
                items.extend(
                    flatten_dict(elt, new_key + sep + str(idx), sep=sep).items()
                )
        else:
            items.append((new_key, value))
    return dict(items)
1339177
def regroup(self, group):
        
        if util.config.future_deprecations:
            self.param.warning('%s.regroup is deprecated, use relabel '
                               'method with a group argument instead.'
                               % type(self).__name__)
        new_items = [el.relabel(group=group) for el in self.data.values()]
        return reduce(lambda x,y: x+y, new_items)
1360438
def decoded_group_addresses
      groups.map { |k,v| v.map { |a| a.decoded } }.flatten
    end
559359
def _perform_reduce(self, map_results, factory, group=False,
                        group_level=None):
        '''
        
        '''

        def get_group_key(key, group, group_level):
            if group:
                return key
            return key[0:group_level]

        if not group and group_level is None:
            keys = map(operator.itemgetter(0), map_results)
            values = map(operator.itemgetter(1), map_results)
            return self._reduce_values(factory, None, keys, values)
        else:
            groups = dict()
            for row in map_results:
                key, value = row[:2]
                group_key = get_group_key(key, group, group_level)
                if group_key not in groups:
                    groups[group_key] = list()
                groups[group_key].append((key, value))
            resp = list()
            for group_key, results in groups.iteritems():
                keys = map(operator.itemgetter(0), results)
                values = map(operator.itemgetter(1), results)
                resp.extend(
                    self._reduce_values(factory, group_key, keys, values))
            return resp
983991
def flatten(self, df, column_name):
        """"""
        _exp_list = [[md5, x] for md5, value_list in zip(df['md5'], df[column_name]) for x in value_list]
        return pd.DataFrame(_exp_list, columns=['md5',column_name])
535866
def flatten(value):
    """"""
    if isinstance(value, np.ndarray):
        def unflatten(vector):
            return np.reshape(vector, value.shape)
        return np.ravel(value), unflatten

    elif isinstance(value, float):
        return np.array([value]), lambda x: x[0]

    elif isinstance(value, tuple):
        if not value:
            return np.array([]), lambda x: ()

        flattened_first, unflatten_first = flatten(value[0])
        flattened_rest, unflatten_rest = flatten(value[1:])

        def unflatten(vector):
            N = len(flattened_first)
            return (unflatten_first(vector[:N]),) + unflatten_rest(vector[N:])

        return np.concatenate((flattened_first, flattened_rest)), unflatten

    elif isinstance(value, list):
        if not value:
            return np.array([]), lambda x: []
        flattened_first, unflatten_first = flatten(value[0])
        flattened_rest, unflatten_rest = flatten(value[1:])

        def unflatten(vector):
            N = len(flattened_first)
            return [unflatten_first(vector[:N])] + unflatten_rest(vector[N:])

        return np.concatenate((flattened_first, flattened_rest)), unflatten

    elif isinstance(value, dict):
        flattened = []
        unflatteners = []
        lengths = []
        keys = []
        for k, v in sorted(value.items(), key=itemgetter(0)):
            cur_flattened, cur_unflatten = flatten(v)
            flattened.append(cur_flattened)
            unflatteners.append(cur_unflatten)
            lengths.append(len(cur_flattened))
            keys.append(k)

        def unflatten(vector):
            split_ixs = np.cumsum(lengths)
            pieces = np.split(vector, split_ixs)
            return {key: unflattener(piece)
                    for piece, unflattener, key in zip(pieces,
                                                       unflatteners,
                                                       keys)}

        return np.concatenate(flattened), unflatten

    else:
        raise Exception("Don't know how to flatten type {}".format(type(value))
                        )
889547
def _flatten_per_cluster(per_cluster):
    """"""
    return np.sort(np.concatenate(list(per_cluster.values()))).astype(np.int64)
676706
private Map<String, String> flatten(Map<String, ?> input) {
        Map<String, String> result = new HashMap<String, String>();

        for (Map.Entry<String, ?> entry : input.entrySet()) {
            for (Map.Entry<String, String> flattened : flatten(entry)) {
                if (flattened.getValue() != null) {
                    result.put(flattened.getKey(), flattened.getValue());
                }
            }
        }

        return result;
    }
986171
def flatten(xs: Union[List, Tuple]) -> List:
    
    return (
        sum(map(flatten, xs), [])
        if (isinstance(xs, list) or isinstance(xs, tuple))
        else [xs]
    )
968494
def flatten_params(self, data, base_key=None):
        
        result = {}

        if data is None:
            return result

        map_data = None
        if not isinstance(data, collections.Mapping):
            map_data = []
            for idx, val in enumerate(data):
                map_data.append([str(idx), val])
        else:
            map_data = list(data.items())

        for key, value in map_data:
            if not base_key is None:
                key = base_key + "[" + key + "]"

            if isinstance(value, basestring) or not hasattr(value, "__iter__"):
                result[key] = value
            else:
                result.update(self.flatten_params(value, key))

        return result
1277535
def ungroupslice(groups,gslice):
  ''
  'coordinate transform: takes a match from seqingroups() and transforms to ungrouped coordinates'
  eltsbefore=0
  for i in range(gslice[0]): eltsbefore+=len(groups[i])-1
  x=eltsbefore+gslice[1]; return [x-1,x+gslice[2]-1]
1014447
def flatten_multidict(multidict):
    """"""
    return dict([(key, value if len(value) > 1 else value[0])
                 for (key, value) in multidict.iterlists()])