code: def count_group_cached(group_id, failures=False, broker=None):
      
      if not broker:
          broker = get_broker()
      group_list = broker.cache.get('{}:{}:keys'.format(broker.list_key, group_id))
      if group_list:
          if not failures:
              return len(group_list)
          failure_count = 0
          for task_key in group_list:
              task = SignedPackage.loads(broker.cache.get(task_key))
              if not task['success']:
                  failure_count += 1
          return failure_count
docs: Count the results in a group in the cache backend