def gating_enabled(default=None):
 def wrap(f):
  def function_wrapper(course, *args):
   if (not course.enable_subsection_gating):
    return default
   return f(course, *args)
  return function_wrapper
 return wrap

def gating_enabled ( default = None ) : def wrap ( f ) : def function_wrapper ( course , * args ) : if ( not course . enable_subsection_gating ) : return default return f ( course , * args ) return function_wrapper return wrap
decorator that checks the enable_subsection_gating course flag to see if the subsection gating feature is active for a given course .