Gets the {@link TicketBucket} for the given {@link Region}. Creates
one if it does not exist.

@param region {@link Region} to retrieve
@return a {@link TicketBucket} for this {@link Region}
762561
public synchronized TicketBucket getTicketBucket(Region region) {
    	TicketBucket tb = buckets.get(region);
    	if (tb == null) {
    		tb = new TicketBucket(rules);
    		buckets.put(region, tb);
    	}
    	
    	return tb;
    }
1284337
@SuppressWarnings("unchecked")
  public <T extends ConfigurationSection> T getSection(Class<T> sectionType) {
    for (ConfigurationSection s : sections) {
      if (sectionType.equals(s.getClass())) {
        return (T) s;
      }
    }
    return null;
  }
1126308
public ApiResponse<GetAnyLocationsResponse> getAnyLocationsWithHttpInfo(String region) throws ApiException {
        com.squareup.okhttp.Call call = getAnyLocationsValidateBeforeCall(region, null, null);
        Type localVarReturnType = new TypeToken<GetAnyLocationsResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
677574
public void addRegion(InfinispanBaseRegion region) {
		allRegions.put(ByteString.fromString(region.getCache().getName()), region);
	}
522944
public static Principal getPrincipalFromRequestContext(final RequestContext requestContext,
                                                           final TicketRegistrySupport ticketRegistrySupport) {
        val tgt = WebUtils.getTicketGrantingTicketId(requestContext);
        if (StringUtils.isBlank(tgt)) {
            throw new IllegalArgumentException("No ticket-granting ticket could be found in the context");
        }

        return ticketRegistrySupport.getAuthenticatedPrincipalFrom(tgt);
    }
1189155
public ArrayList<OvhInstanceGroup> project_serviceName_instance_group_GET(String serviceName, String region) throws IOException {
		String qPath = "/cloud/project/{serviceName}/instance/group";
		StringBuilder sb = path(qPath, serviceName);
		query(sb, "region", region);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t23);
	}
786359
func getRegionForBucket(name string) (string, error) {
	// Any region will work for the region lookup, but the request MUST use
	// PathStyle
	config := aws.NewConfig().WithRegion("us-west-1").WithS3ForcePathStyle(true)
	session := session.New()
	client := s3.New(session, config)
	params := s3.GetBucketLocationInput{
		Bucket: aws.String(name),
	}
	resp, err := client.GetBucketLocation(&params)
	if err != nil {
		return "", fmt.Errorf("failed to get location for bucket '%s', %s", name, err)
	}
	if resp.LocationConstraint == nil {
		// "US Standard", returns an empty region. So return any region in the US
		return "us-east-1", nil
	}
	return *resp.LocationConstraint, nil
}
474356
@Override
    public java.util.concurrent.Future<DescribeRegionsResult> describeRegionsAsync(
            com.amazonaws.handlers.AsyncHandler<DescribeRegionsRequest, DescribeRegionsResult> asyncHandler) {

        return describeRegionsAsync(new DescribeRegionsRequest(), asyncHandler);
    }
1361583
public OvhRegion serviceName_region_regionId_GET(String serviceName, String regionId) throws IOException {
		String qPath = "/dbaas/queue/{serviceName}/region/{regionId}";
		StringBuilder sb = path(qPath, serviceName, regionId);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhRegion.class);
	}
385487
public java.util.List<Region> getRegions() {
        if (regions == null) {
            regions = new com.amazonaws.internal.SdkInternalList<Region>();
        }
        return regions;
    }
520951
public GetAnyLocationsResponse getAnyLocations(String region) throws ApiException {
        ApiResponse<GetAnyLocationsResponse> resp = getAnyLocationsWithHttpInfo(region);
        return resp.getData();
    }
1120220
public static AddressInfo of(String region, String name) {
    return of(RegionAddressId.of(region, name));
  }
265650
public RegionInfo queryRegionInfo(String accessKey, String bucket) throws QiniuException {
        RegionIndex index = new RegionIndex(accessKey, bucket);
        RegionInfo info = regions.get(index);
        if (info == null) {
            UCRet ret = getRegionJson(index);
            try {
                info = RegionInfo.buildFromUcRet(ret);
            } catch (Exception e) {
                e.printStackTrace();
            }

            if (info != null) {
                regions.put(index, info);
            }
        }
        return info;
    }
212140
@Transformer
    public Ticket transformToTicket(TicketAck ticketAck) {
        Ticket ticket = new Ticket();
        ticket.setId(ticketAck.getId());
        return ticket;
    }
1046787
@Override
  public Volumes getAvailableVolumes(String regionSlug)
      throws DigitalOceanException, RequestUnsuccessfulException {
    checkBlankAndThrowError(regionSlug, "Missing required parameter - regionSlug.");

    Map<String, String> data = new HashMap<String, String>();
    data.put("region", regionSlug);
    return (Volumes) perform(new ApiRequest(ApiAction.AVAILABLE_VOLUMES, data)).getData();
  }
305188
public static RegionOperationId of(String project, String region, String operation) {
    return new RegionOperationId(project, region, operation);
  }
1223429
def get_elasticache_replication_groups_by_region(self, region):
        ''' '''

        # ElastiCache boto module doesn't provide a get_all_intances method,
        # that's why we need to call describe directly (it would be called by
        # the shorthand method anyway...)
        try:
            conn = elasticache.connect_to_region(region)
            if conn:
                response = conn.describe_replication_groups()

        except boto.exception.BotoServerError as e:
            error = e.reason

            if e.error_code == 'AuthFailure':
                error = self.get_auth_error_message()
            if not e.reason == "Forbidden":
                error = "Looks like AWS ElastiCache [Replication Groups] is down:\n%s" % e.message
            self.fail_with_error(error, 'getting ElastiCache clusters')

        try:
            # Boto also doesn't provide wrapper classes to ReplicationGroups
            # Because of that wo can't make use of the get_list method in the
            # AWSQueryConnection. Let's do the work manually
            replication_groups = response['DescribeReplicationGroupsResponse']['DescribeReplicationGroupsResult']['ReplicationGroups']

        except KeyError as e:
            error = "ElastiCache [Replication Groups] query to AWS failed (unexpected format)."
            self.fail_with_error(error, 'getting ElastiCache clusters')

        for replication_group in replication_groups:
            self.add_elasticache_replication_group(replication_group, region)