def get_programs_for_credentials(user, programs_credentials):
 certified_programs = []
 programs = get_programs(user)
 for program in programs:
  for credential in programs_credentials:
   if (program[u'uuid'] == credential[u'credential'][u'program_uuid']):
    program[u'credential_url'] = credential[u'certificate_url']
    certified_programs.append(program)
 return certified_programs

def get_programs_for_credentials ( user , programs_credentials ) : certified_programs = [ ] programs = get_programs ( user ) for program in programs : for credential in programs_credentials : if ( program [ u'uuid' ] == credential [ u'credential' ] [ u'program_uuid' ] ) : program [ u'credential_url' ] = credential [ u'certificate_url' ] certified_programs . append ( program ) return certified_programs
given a user and an iterable of credentials .