def get_context_first_matching_object(context, context_lookups):
 for key in context_lookups:
  context_object = context.get(key)
  if context_object:
   return (key, context_object)
 return (None, None)

def get_context_first_matching_object ( context , context_lookups ) : for key in context_lookups : context_object = context . get ( key ) if context_object : return ( key , context_object ) return ( None , None )
return the first object found in the context .