Module Import alias ImportFrom alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpSub Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Return Call NameLoad Call NameLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpSub Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Return Call NameLoad Call NameLoad Call AttributeLoad Str attr Call AttributeLoad NameLoad attr decorator_list ClassDef bases body Expr Str Assign NameStore NameLoad Assign NameStore Str Assign NameStore Num Assign NameStore Num Assign NameStore Dict NameLoad NameLoad Str Str Assign NameStore Dict NameLoad NameLoad NameLoad NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return BinOpAdd AttributeLoad NameLoad attr Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return BinOpAdd BinOpAdd AttributeLoad NameLoad attr Call NameLoad NameLoad Str decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return CompareIsNot Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore IfExp NameLoad Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore Call AttributeLoad Str attr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str Call NameLoad Call AttributeLoad NameLoad attr Str orelse Assign NameStore Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Return Call AttributeLoad Str attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad BinOpMult BinOpMult Num Num Num body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad decorator_list
N/A N/A datetime django.core.cache cache utils.sql query_to_dicts utils.enum EnumMetaclass topreq_data_hits_available N/A N/A days N/A N/A N/A Evaluates toprequesters by the number of hits available as an average
    over the time period.

    Keyword arguments:
    days -- number of days to look back

     N/A start_time N/A N/A N/A N/A datetime date today N/A N/A datetime timedelta N/A int days N/A N/A list N/A query_to_dicts N/A N/A 
        SELECT
            h.requester_id,
            h.requester_name,
            count(DISTINCT hitgroup.group_id) as "projects",
            coalesce(round(CAST (sum(hitgroup.grp_hits) as NUMERIC), 0), 0) as hits,
            coalesce(sum(hitgroup.grp_hits * h.reward), 0) as reward,
            max(hitgroup.grp_last_posted) as "last_posted"
        FROM
            main_hitgroupcontent h
            LEFT JOIN main_requesterprofile p
                ON h.requester_id = p.requester_id
            LEFT JOIN (
            SELECT
                mv.group_id,
                coalesce(avg(mv.hits_available), 0) as "grp_hits",
                max(mv.start_time) as "grp_last_posted"
            FROM (
                SELECT group_id, hits_available, start_time
                FROM hits_mv
                WHERE
                    start_time > '{0}'
                ) mv
            GROUP BY mv.group_id
            ) hitgroup
                ON h.group_id = hitgroup.group_id
        WHERE
            coalesce(p.is_public, true) = true
        GROUP BY h.requester_id, h.requester_name
        ORDER BY reward DESC
        LIMIT 1000; format N/A N/A start_time isoformat N/A topreq_data_hits_posted N/A N/A days N/A N/A N/A Evaluates toprequesters by the number of hits posted in a period.

    Keyword arguments:
    days -- number of days to look back

     N/A start_time N/A N/A N/A N/A datetime date today N/A N/A datetime timedelta N/A int days N/A N/A list N/A query_to_dicts N/A N/A 
        SELECT
            h.requester_id,
            h.requester_name,
            coalesce(count(distinct mv.group_id), 0) as "projects",
            coalesce(sum(mv.hits_posted), 0) as "hits",
            coalesce(sum(mv.hits_posted * h.reward), 0) as "reward",
            max(mv.start_time) as "last_posted"
        FROM
            main_hitgroupcontent h
            LEFT JOIN main_requesterprofile p
                ON h.requester_id = p.requester_id
            LEFT JOIN (
                SELECT group_id, hits_posted, start_time
                FROM hits_mv
                WHERE
                    start_time > '{0}' AND
                    hits_posted > 0
            ) mv
                ON h.group_id = mv.group_id
        WHERE
            coalesce(p.is_public, true) = true
        GROUP BY h.requester_id, h.requester_name
        ORDER BY reward DESC
        LIMIT 1000; format N/A N/A start_time isoformat N/A ToprequestersReport N/A N/A N/A Enum representing available toprequesters reports. N/A __metaclass__ EnumMetaclass N/A cache_key_base TOPREQUESTERS_CACHED_ N/A AVAILABLE 0 N/A POSTED 1 N/A display_names N/A AVAILABLE POSTED Hits available Hits posted N/A REPORT_FUNCTION N/A AVAILABLE POSTED topreq_data_hits_available topreq_data_hits_posted get_cache_key N/A N/A cls report_type N/A N/A N/A Returns string key, under which the report should be cached. N/A N/A N/A cls cache_key_base N/A str report_type N/A classmethod __get_cache_key_for_meta N/A N/A cls report_type N/A N/A N/A Returns string key, under which the report should be cached. N/A N/A N/A N/A cls cache_key_base N/A str report_type _meta N/A classmethod is_cached N/A N/A cls report_type N/A N/A N/A True is there is something under report key in the cache. N/A N/A N/A N/A cls get_report_data report_type None N/A classmethod get_report_data N/A N/A cls report_type N/A N/A N/A Returns report data if available or None. N/A N/A N/A cache get N/A N/A cls get_cache_key report_type N/A classmethod get_report_meta N/A N/A cls report_type N/A N/A N/A Returns meta data related to the report. N/A N/A N/A cache get N/A N/A cls __get_cache_key_for_meta report_type N/A classmethod get_available_as_str N/A N/A cls N/A N/A N/A Returns a string consising of lines:

            [available] id - Display name

        Example:

            [x] 0 - Hits available
            [ ] 1 - Hits posted

         N/A lines N/A N/A N/A rid name N/A N/A N/A cls display_names iteritems N/A N/A in_cache N/A N/A cls is_cached rid N/A in_cache N/A in_cache [x] [ ] N/A meta N/A N/A cls get_report_meta rid N/A meta N/A N/A meta N/A N/A  ({0} days), updated: {1:%Y-%m-%d %H:%M:%S}, elapsed: {2}s format N/A N/A meta get days N/A N/A meta get start_time N/A int N/A N/A meta get elapsed N/A N/A meta N/A N/A N/A lines append N/A N/A 
{0} {1} - {2}{3} format in_cache rid name meta N/A N/A N/A lines append N/A N/A N/A join lines N/A classmethod store N/A N/A cls report_type data meta cache_expiry N/A None N/A N/A 60 60 4 N/A N/A Stores the data under correct cache key.

        Keyword arguments:

        report_type -- type of the report to relate the data to
        data -- report data
        meta -- report meta data
        cache_expiry -- how long the data should remain in cache

         N/A N/A N/A cls __store_meta report_type meta cache_expiry N/A N/A N/A cache set N/A N/A cls get_cache_key report_type data cache_expiry N/A classmethod __store_meta N/A N/A cls report_type meta cache_expiry N/A N/A N/A Stores meta data. Adding this method to allow manual update of
        reports meta data.

         N/A N/A N/A cache set N/A N/A cls __get_cache_key_for_meta report_type meta cache_expiry N/A classmethod purge N/A N/A cls report_type N/A N/A N/A Deletes all the data related to the given report type from cache. N/A N/A N/A cache delete N/A N/A cls get_cache_key report_type N/A classmethod N/A