def GetPlace(pm):
  locality = pm.get('locality', None)
  state = pm.get('state', None)
  country = pm.get('country', None)
  if country == 'United States':
    if locality and state:
      return '%s, %s' % (locality, STATE_MAP[state])
  elif locality and country:
    return '%s, %s' % (locality, pm['iso_country_code'])
  return locality or state or pm.get('country', None)
dataset/ETHPy150Open viewfinderco/viewfinder/clients/experimental/viewfinder.py/GetPlace/original