def _Connect(region):
 ec2_region = None
 for r in regions():
  if (r.name == region):
   ec2_region = r
   break
 assert (ec2_region is not None), ('"%s" not in the list of ec2 regions: %s' % (region, ', '.join(kValidRegions)))
 return boto.connect_ec2(region=ec2_region)

def _Connect ( region ) : ec2_region = None for r in regions ( ) : if ( r . name == region ) : ec2_region = r break assert ( ec2_region is not None ) , ( '"%s" not in the list of ec2 regions: %s' % ( region , ', ' . join ( kValidRegions ) ) ) return boto . connect_ec2 ( region = ec2_region )
verify region and return an ec2 connection object .