'intantiates the processing class (Direct or Grouped) and returns it.'

def get_group_by_class(self, definition):

    group_by = definition['group']
    series = definition['series']
    if ('formatter' in definition):
        formatter = {group_by: definition['formatter']}
    else:
        formatter = {}
    return self.ProcessClass([group_by], series, formatter)
