Return a rolling grouper, providing rolling functionality per group.
167889
def rolling(self, *args, **kwargs):
        
        from pandas.core.window import RollingGroupby
        return RollingGroupby(self, *args, **kwargs)
1253802
def x_rolls(self, number, count=0):
        '''
        '''
        for x in range(number):
            yield super(FuncRoll, self).roll(count, self._func)
887819
def group(self, *args, **kwargs):
        
        return super().group(
            *args, cls=kwargs.pop('cls', Group) or Group, **kwargs)
235181
def aggregate_group_loop(*args, **kwargs):
    """"""
    func = kwargs['func']
    del kwargs['func']
    return aggregate_np(*args, func=lambda x: func(x), **kwargs)
569809
def GroupBy(self: Iterable, f=None):
    
    if f and is_to_destruct(f):
        f = destruct_func(f)
    return _group_by(self, f)
470404
def group(self):
        ""
        if self._group:
            return self._group
        group =  get_ndmapping_label(self, 'group') if len(self) else None
        if group is None:
            return type(self).__name__
        return group
1158853
def grouped_t(wrap, size):
    
    return Transformation(
        'grouped({0})'.format(size),
        partial(grouped_impl, wrap, size),
        None
    )
285941
def __roll(self, unrolled):
        """"""
        rolled = []
        index = 0
        for count in range(len(self.__sizes) - 1):
            in_size = self.__sizes[count]
            out_size = self.__sizes[count+1]
            theta_unrolled = np.matrix(unrolled[index:index+(in_size+1)*out_size])
            theta_rolled = theta_unrolled.reshape((out_size, in_size+1))
            rolled.append(theta_rolled)
            index += (in_size + 1) * out_size
        return rolled
1033022
def cardinal_groupby(self):
        
        g, t = self._cardinal
        self[g] = self[g].astype(t)
        grpby = self.groupby(g)
        self[g] = self[g].astype('category')
        return grpby
937436
def _consolidate(blocks):
    

    # sort by _can_consolidate, dtype
    gkey = lambda x: x._consolidate_key
    grouper = itertools.groupby(sorted(blocks, key=gkey), gkey)

    new_blocks = []
    for (_can_consolidate, dtype), group_blocks in grouper:
        merged_blocks = _merge_blocks(list(group_blocks), dtype=dtype,
                                      _can_consolidate=_can_consolidate)
        new_blocks = _extend_blocks(merged_blocks, new_blocks)
    return new_blocks
1082165
def grouper(iterable, n):
    
    it = iter(iterable)
    while True:
        chunk = itertools.islice(it, n)
        try:
            first = next(chunk)
        except StopIteration:
            return

        yield itertools.chain([first], chunk)
1353779
def roll(cls, num, sides, add):
        """"""
        rolls = []
        for i in range(num):
            rolls.append(random.randint(1, sides))
        rolls.append(add)
        return rolls
1189813
def roll(self, count=0, func=sum):
        '''
        '''
        if count:
            return [func([die.roll() for die in self._dice]) for x in range(0, count)]
        else:
            return func([die.roll() for die in self._dice])
1050139
def group(self):
        """"""
        yield self.current
        # start enumerate at 1 because we already yielded the last saved item
        for num, item in enumerate(self.iterator, 1):
            self.current = item
            if num == self.limit:
                break
            yield item
        else:
            self.on_going = False
3203
def group(self, *args, **kwargs):
        
        return super().group(
            *args, cls=kwargs.pop('cls', AppGroup) or AppGroup, **kwargs)
1006981
def score_group(group_name=None):
    '''
    
    '''
    warnings.warn('Score_group is deprecated as of Compliance Checker v3.2.')
    def _inner(func):
        def _dec(s, ds):
            ret_val = func(s, ds)
            """
            if group_name != None and not isinstance(ret_val[0], tuple):
                return tuple([(group_name, ret_val[0])] + list(ret_val[1:]))
            """
            # multiple returns
            if not isinstance(ret_val, list):
                ret_val = [ret_val]

            def dogroup(r):
                cur_grouping = r.name

                if isinstance(cur_grouping, tuple):
                    cur_grouping = list(cur_grouping)
                elif not isinstance(cur_grouping, list):
                    cur_grouping = [cur_grouping]

                cur_grouping.insert(0, group_name)

                return Result(r.weight, r.value, tuple(cur_grouping), r.msgs)

            ret_val = [fix_return_value(x, func.__name__, func, s) for x in
                       ret_val]
            ret_val = list(map(dogroup, ret_val))

            return ret_val
        return wraps(func)(_dec)
    return _inner
1299080
def group(__decorated__, **Config):
  
  """
  _Group = Group(__decorated__, Config)

  if isclass(__decorated__): # convert the method of the class to static methods so that they could be accessed like object methods; ir: g1/t1(...).
    static(__decorated__)

  state.ActiveModuleMemberQ.insert(0, _Group)

  return _Group.Underlying