def _get_prerequisite_milestone(prereq_content_key):
 milestones = milestones_api.get_milestones('{usage_key}{qualifier}'.format(usage_key=prereq_content_key, qualifier=GATING_NAMESPACE_QUALIFIER))
 if (not milestones):
  log.warning('Could not find gating milestone for prereq UsageKey %s', prereq_content_key)
  return None
 if (len(milestones) > 1):
  log.warning('Multiple gating milestones found for prereq UsageKey %s', prereq_content_key)
 return milestones[0]

def _get_prerequisite_milestone ( prereq_content_key ) : milestones = milestones_api . get_milestones ( '{usage_key}{qualifier}' . format ( usage_key = prereq_content_key , qualifier = GATING_NAMESPACE_QUALIFIER ) ) if ( not milestones ) : log . warning ( 'Could not find gating milestone for prereq UsageKey %s' , prereq_content_key ) return None if ( len ( milestones ) > 1 ) : log . warning ( 'Multiple gating milestones found for prereq UsageKey %s' , prereq_content_key ) return milestones [ 0 ]
get gating milestone associated with the given content usage key .