parameters: ()
return_statement: return predicate
docstring: Create counters for bug statistics.
  
      Two entries are maintained: 'total' is an integer, represents the
      number of bugs. The 'categories' is a two level categorisation of bug
      counters. The first level is 'bug category' the second is 'bug type'.
      Each entry in this classification is a dictionary of 'count', 'type'
      and 'label'.
docstring_summary: Create counters for bug statistics.
docstring_tokens: Create counters for bug statistics .
function: def create_counters():
      """ Create counters for bug statistics.
  
      Two entries are maintained: 'total' is an integer, represents the
      number of bugs. The 'categories' is a two level categorisation of bug
      counters. The first level is 'bug category' the second is 'bug type'.
      Each entry in this classification is a dictionary of 'count', 'type'
      and 'label'. """
  
      def predicate(bug):
          bug_category = bug['bug_category']
          bug_type = bug['bug_type']
          current_category = predicate.categories.get(bug_category, dict())
          current_type = current_category.get(bug_type, {
              'bug_type': bug_type,
              'bug_type_class': category_type_name(bug),
              'bug_count': 0
          })
          current_type.update({'bug_count': current_type['bug_count'] + 1})
          current_category.update({bug_type: current_type})
          predicate.categories.update({bug_category: current_category})
          predicate.total += 1
  
      predicate.total = 0
      predicate.categories = dict()
      return predicate
function_tokens: def create_counters ( ) : def predicate ( bug ) : bug_category = bug [ 'bug_category' ] bug_type = bug [ 'bug_type' ] current_category = predicate . categories . get ( bug_category , dict ( ) ) current_type = current_category . get ( bug_type , { 'bug_type' : bug_type , 'bug_type_class' : category_type_name ( bug ) , 'bug_count' : 0 } ) current_type . update ( { 'bug_count' : current_type [ 'bug_count' ] + 1 } ) current_category . update ( { bug_type : current_type } ) predicate . categories . update ( { bug_category : current_category } ) predicate . total += 1 predicate . total = 0 predicate . categories = dict ( ) return predicate