def emit_certificate_event(event_name, user, course_id, course=None, event_data=None):
 event_name = '.'.join(['edx', 'certificate', event_name])
 if (course is None):
  course = modulestore().get_course(course_id, depth=0)
 context = {'org_id': course.org, 'course_id': unicode(course_id)}
 data = {'user_id': user.id, 'course_id': unicode(course_id), 'certificate_url': get_certificate_url(user.id, course_id)}
 event_data = (event_data or {})
 event_data.update(data)
 with tracker.get_tracker().context(event_name, context):
  tracker.emit(event_name, event_data)

def emit_certificate_event ( event_name , user , course_id , course = None , event_data = None ) : event_name = '.' . join ( [ 'edx' , 'certificate' , event_name ] ) if ( course is None ) : course = modulestore ( ) . get_course ( course_id , depth = 0 ) context = { 'org_id' : course . org , 'course_id' : unicode ( course_id ) } data = { 'user_id' : user . id , 'course_id' : unicode ( course_id ) , 'certificate_url' : get_certificate_url ( user . id , course_id ) } event_data = ( event_data or { } ) event_data . update ( data ) with tracker . get_tracker ( ) . context ( event_name , context ) : tracker . emit ( event_name , event_data )
emits certificate event .