def get_regions(service_name, region_cls=None, connection_cls=None):
 endpoints = load_regions()
 if (service_name not in endpoints):
  raise BotoClientError(("Service '%s' not found in endpoints." % service_name))
 if (region_cls is None):
  region_cls = RegionInfo
 region_objs = []
 for (region_name, endpoint) in endpoints.get(service_name, {}).items():
  region_objs.append(region_cls(name=region_name, endpoint=endpoint, connection_cls=connection_cls))
 return region_objs

def get_regions ( service_name , region_cls = None , connection_cls = None ) : endpoints = load_regions ( ) if ( service_name not in endpoints ) : raise BotoClientError ( ( "Service '%s' not found in endpoints." % service_name ) ) if ( region_cls is None ) : region_cls = RegionInfo region_objs = [ ] for ( region_name , endpoint ) in endpoints . get ( service_name , { } ) . items ( ) : region_objs . append ( region_cls ( name = region_name , endpoint = endpoint , connection_cls = connection_cls ) ) return region_objs
given a service name .