def get_running_instructor_tasks(course_id):
 instructor_tasks = InstructorTask.objects.filter(course_id=course_id)
 for state in READY_STATES:
  instructor_tasks = instructor_tasks.exclude(task_state=state)
 return instructor_tasks.order_by('-id')

def get_running_instructor_tasks ( course_id ) : instructor_tasks = InstructorTask . objects . filter ( course_id = course_id ) for state in READY_STATES : instructor_tasks = instructor_tasks . exclude ( task_state = state ) return instructor_tasks . order_by ( '-id' )
returns a query of instructortask objects of running tasks for a given course .