def get_course_run(course_key, user):
 catalog_integration = CatalogIntegration.current()
 if catalog_integration.enabled:
  api = create_catalog_api_client(user, catalog_integration)
  data = get_edx_api_data(catalog_integration, user, 'course_runs', resource_id=unicode(course_key), cache_key=(catalog_integration.CACHE_KEY if catalog_integration.is_cache_enabled else None), api=api, querystring={'exclude_utm': 1})
  return (data if data else {})
 else:
  return {}

def get_course_run ( course_key , user ) : catalog_integration = CatalogIntegration . current ( ) if catalog_integration . enabled : api = create_catalog_api_client ( user , catalog_integration ) data = get_edx_api_data ( catalog_integration , user , 'course_runs' , resource_id = unicode ( course_key ) , cache_key = ( catalog_integration . CACHE_KEY if catalog_integration . is_cache_enabled else None ) , api = api , querystring = { 'exclude_utm' : 1 } ) return ( data if data else { } ) else : return { }
get a course runs data from the course catalog service .