def get_course_or_program_context(self, enterprise_customer, course_id=None, program_uuid=None):
context_data = {}<EOL>if course_id:<EOL><INDENT>context_data.update({'<STR_LIT>': course_id, '<STR_LIT>': True})<EOL>if not self.preview_mode:<EOL><INDENT>try:<EOL><INDENT>catalog_api_client = CourseCatalogApiServiceClient(enterprise_customer.site)<EOL><DEDENT>except ImproperlyConfigured:<EOL><INDENT>raise Http404<EOL><DEDENT>course_run_details = catalog_api_client.get_course_run(course_id)<EOL>course_start_date = '<STR_LIT>'<EOL>if course_run_details['<STR_LIT:start>']:<EOL><INDENT>course_start_date = parse(course_run_details['<STR_LIT:start>']).strftime('<STR_LIT>')<EOL><DEDENT>context_data.update({<EOL>'<STR_LIT>': course_run_details['<STR_LIT:title>'],<EOL>'<STR_LIT>': course_start_date,<EOL>})<EOL><DEDENT>else:<EOL><INDENT>context_data.update({<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>'<STR_LIT>': datetime.datetime.now().strftime('<STR_LIT>'),<EOL>})<EOL><DEDENT><DEDENT>else:<EOL><INDENT>context_data.update({<EOL>'<STR_LIT>': program_uuid,<EOL>'<STR_LIT>': True,<EOL>})<EOL><DEDENT>return context_data<EOL>
Return a dict having course or program specific keys for data sharing consent page.