def munge_catalog_program(catalog_program):
 return {'id': catalog_program['uuid'], 'name': catalog_program['title'], 'subtitle': catalog_program['subtitle'], 'category': catalog_program['type'], 'marketing_slug': catalog_program['marketing_slug'], 'organizations': [{'display_name': organization['name'], 'key': organization['key']} for organization in catalog_program['authoring_organizations']], 'course_codes': [{'display_name': course['title'], 'key': course['key'], 'organization': ({'display_name': course['owners'][0]['name'], 'key': course['owners'][0]['key']} if course['owners'] else {}), 'run_modes': [{'course_key': run['key'], 'run_key': CourseKey.from_string(run['key']).run, 'mode_slug': 'verified'} for run in course['course_runs']]} for course in catalog_program['courses']], 'banner_image_urls': {'w1440h480': catalog_program['banner_image']['large']['url'], 'w726h242': catalog_program['banner_image']['medium']['url'], 'w435h145': catalog_program['banner_image']['small']['url'], 'w348h116': catalog_program['banner_image']['x-small']['url']}}

def munge_catalog_program ( catalog_program ) : return { 'id' : catalog_program [ 'uuid' ] , 'name' : catalog_program [ 'title' ] , 'subtitle' : catalog_program [ 'subtitle' ] , 'category' : catalog_program [ 'type' ] , 'marketing_slug' : catalog_program [ 'marketing_slug' ] , 'organizations' : [ { 'display_name' : organization [ 'name' ] , 'key' : organization [ 'key' ] } for organization in catalog_program [ 'authoring_organizations' ] ] , 'course_codes' : [ { 'display_name' : course [ 'title' ] , 'key' : course [ 'key' ] , 'organization' : ( { 'display_name' : course [ 'owners' ] [ 0 ] [ 'name' ] , 'key' : course [ 'owners' ] [ 0 ] [ 'key' ] } if course [ 'owners' ] else { } ) , 'run_modes' : [ { 'course_key' : run [ 'key' ] , 'run_key' : CourseKey . from_string ( run [ 'key' ] ) . run , 'mode_slug' : 'verified' } for run in course [ 'course_runs' ] ] } for course in catalog_program [ 'courses' ] ] , 'banner_image_urls' : { 'w1440h480' : catalog_program [ 'banner_image' ] [ 'large' ] [ 'url' ] , 'w726h242' : catalog_program [ 'banner_image' ] [ 'medium' ] [ 'url' ] , 'w435h145' : catalog_program [ 'banner_image' ] [ 'small' ] [ 'url' ] , 'w348h116' : catalog_program [ 'banner_image' ] [ 'x-small' ] [ 'url' ] } }
make a program from the catalog service look like it came from the programs service .