def get_programs_credentials(user):
 programs_credentials = get_user_program_credentials(user)
 credentials_data = []
 for program in programs_credentials:
  try:
   program_data = {u'display_name': program[u'title'], u'subtitle': program[u'subtitle'], u'credential_url': program[u'credential_url']}
   credentials_data.append(program_data)
  except KeyError:
   log.warning(u'Program structure is invalid: %r', program)
 return credentials_data

def get_programs_credentials ( user ) : programs_credentials = get_user_program_credentials ( user ) credentials_data = [ ] for program in programs_credentials : try : program_data = { u'display_name' : program [ u'title' ] , u'subtitle' : program [ u'subtitle' ] , u'credential_url' : program [ u'credential_url' ] } credentials_data . append ( program_data ) except KeyError : log . warning ( u'Program structure is invalid: %r' , program ) return credentials_data
return program credentials data required for display .