parameters: (request, option)
docstring: Generate the jtable data for counts.
  
      :param request: The request for this jtable.
      :type request: :class:`django.http.HttpRequest`
      :param option: Action to take.
      :type option: str of either 'jtlist', 'jtdelete', or 'inline'.
      :returns: :class:`django.http.HttpResponse`
docstring_summary: Generate the jtable data for counts.
docstring_tokens: Generate the jtable data for counts .
function: def generate_counts_jtable(request, option):
      """
      Generate the jtable data for counts.
  
      :param request: The request for this jtable.
      :type request: :class:`django.http.HttpRequest`
      :param option: Action to take.
      :type option: str of either 'jtlist', 'jtdelete', or 'inline'.
      :returns: :class:`django.http.HttpResponse`
      """
  
      if option == "jtlist":
          count = mongo_connector(settings.COL_COUNTS)
          counts = count.find_one({'name': 'counts'})
          response = {}
          response['Result'] = "OK"
          response['Records'] = []
          if counts:
              for k, v in sorted(counts['counts'].items()):
                  record = {}
                  record['type'] = k
                  record['count'] = v
                  record['id'] = 0
                  record['url'] = ""
                  response['Records'].append(record)
          return HttpResponse(json.dumps(response,
                                         default=json_handler),
                              content_type="application/json")
      else:
          return render(request, 'error.html',
                                    {'data': request,
                                     'error': "Invalid request"})
function_tokens: def generate_counts_jtable ( request , option ) : if option == "jtlist" : count = mongo_connector ( settings . COL_COUNTS ) counts = count . find_one ( { 'name' : 'counts' } ) response = { } response [ 'Result' ] = "OK" response [ 'Records' ] = [ ] if counts : for k , v in sorted ( counts [ 'counts' ] . items ( ) ) : record = { } record [ 'type' ] = k record [ 'count' ] = v record [ 'id' ] = 0 record [ 'url' ] = "" response [ 'Records' ] . append ( record ) return HttpResponse ( json . dumps ( response , default = json_handler ) , content_type = "application/json" ) else : return render ( request , 'error.html' , { 'data' : request , 'error' : "Invalid request" } )