parameters: (cls, username)
return_statement: return {'request_count': req_count, 'created_bins': len(uuids)}
docstring: Returns statistics for user :O
docstring_summary: Returns statistics for user :O
docstring_tokens: Returns statistics for user : O
function: def statistics_count(cls, username):
          """
          Returns statistics for user :O
          """
          def get_count(q):
              """
              Used for counting rows because SQLAlchemys count is slow af
              """
              count_q = q.statement.with_only_columns([func.count()]).order_by(None)
              count = q.session.execute(count_q).scalar()
              return count
          uuids = [x['uuid'] for x in DnsModel.find_by_user(username)]
          req_count = 0
  
          for uuid in uuids:
              req_count += get_count(cls.query.filter_by(uuid = uuid))
  
          return {'request_count': req_count, 'created_bins': len(uuids)}
function_tokens: def statistics_count ( cls , username ) : def get_count ( q ) : """
              Used for counting rows because SQLAlchemys count is slow af
              """ count_q = q . statement . with_only_columns ( [ func . count ( ) ] ) . order_by ( None ) count = q . session . execute ( count_q ) . scalar ( ) return count uuids = [ x [ 'uuid' ] for x in DnsModel . find_by_user ( username ) ] req_count = 0 for uuid in uuids : req_count += get_count ( cls . query . filter_by ( uuid = uuid ) ) return { 'request_count' : req_count , 'created_bins' : len ( uuids ) }