code: def GetRegion(region_name):
    
    regions = boto_ec2.regions()
    region = None
    valid_region_names = []
    for r in regions:
      valid_region_names.append(r.name)
      if r.name == region_name:
          region = r
          break
    if not region:
      logging.info( 'invalid region name: %s ' % (region_name))
      logging.info( 'Try one of these:\n %s' % ('\n'.join(valid_region_names)))
      assert(False)
    return  region
docs: Converts region name string into boto Region object.