def get_course_by_id(course_key, depth=0):
 with modulestore().bulk_operations(course_key):
  course = modulestore().get_course(course_key, depth=depth)
 if course:
  return course
 else:
  raise Http404('Course not found: {}.'.format(unicode(course_key)))

def get_course_by_id ( course_key , depth = 0 ) : with modulestore ( ) . bulk_operations ( course_key ) : course = modulestore ( ) . get_course ( course_key , depth = depth ) if course : return course else : raise Http404 ( 'Course not found: {}.' . format ( unicode ( course_key ) ) )
given a course id .