<s> from __future__ import absolute_import <EOL> from rest_framework . response import Response <EOL> from sentry . app import tsdb <EOL> from sentry . api . base import StatsMixin <EOL> from sentry . api . bases . project import ProjectEndpoint <EOL> from sentry . models import Group <EOL> class ProjectGroupStatsEndpoint ( ProjectEndpoint , StatsMixin ) : <EOL> def get ( self , request , project ) : <EOL> group_ids = request . GET . getlist ( '<STR_LIT:id>' ) <EOL> if not group_ids : <EOL> return Response ( status = <NUM_LIT> ) <EOL> group_list = Group . objects . filter ( project = project , id__in = group_ids ) <EOL> group_ids = [ g . id for g in group_list ] <EOL> if not group_ids : <EOL> return Response ( status = <NUM_LIT> ) <EOL> data = tsdb . get_range ( <EOL> model = tsdb . models . group , <EOL> keys = group_ids , <EOL> ** self . _parse_args ( request ) <EOL> ) <EOL> return Response ( { <EOL> str ( k ) : v <EOL> for k , v in data . items ( ) <EOL> } ) </s>
