def get_first_defined(data, keys, default_value=None):
 for key in keys:
  try:
   return data[key]
  except KeyError:
   pass
 return default_value

def get_first_defined ( data , keys , default_value = None ) : for key in keys : try : return data [ key ] except KeyError : pass return default_value
get the first defined key in data .