Returns the default bucket from a list of buckets, i.e. the largest bucket.

    :param buckets: List of buckets.
    :return: The largest bucket in the list.
320099
def get_default_bucket_key(buckets: List[Tuple[int, int]]) -> Tuple[int, int]:
    
    return max(buckets)
1000469
def tuple(self):
        
        return tuple(getattr(self, k) for k in self.__class__.defaults)
399479
private static BucketConfiguration createDefaultConfig(String hostname, int numNodes, int bucketStartPort, int numVBuckets, int numReplicas) {
        BucketConfiguration defaultConfig = new BucketConfiguration();
        defaultConfig.type = BucketType.COUCHBASE;
        defaultConfig.hostname = hostname;
        defaultConfig.numNodes = numNodes;
        if (numReplicas > -1) {
            defaultConfig.numReplicas = numReplicas;
        }

        defaultConfig.bucketStartPort = bucketStartPort;
        defaultConfig.numVBuckets = numVBuckets;
        return defaultConfig;
    }
1024097
def get_time_buckets(start, end):
        ''''''
        d = DatalakeRecord.TIME_BUCKET_SIZE_IN_MS
        first_bucket = start / d
        last_bucket = end / d
        return list(range(
            int(first_bucket),
            int(last_bucket) + 1))
132070
def get_bucket(self, name):
        ""
        for bucket in self:
            for k,v in self[bucket].items():
                if k == name:
                    return bucket
172543
public Acl getDefaultBucketAcl(String bucketName) {
    // [START getDefaultBucketAcl]
    Acl acl = storage.getDefaultAcl(bucketName, User.ofAllAuthenticatedUsers());
    // [END getDefaultBucketAcl]
    return acl;
  }
414826
def _get_pool(self):
        
        if self.pool:
            return self.pool
        if hadoop().pool:
            return hadoop().pool
1259210
private static int getBucketCount(SimpleOrderedMap<Object> solrFacets, int defaultCount) {
        List<SimpleOrderedMap<Object>> solrBuckets = (List<SimpleOrderedMap<Object>>) solrFacets.get("buckets");
        if (solrBuckets == null) {
            for (int i = 0; i < solrFacets.size(); i++) {
                if (solrFacets.getName(i).equals("count")) {
                    return (int) solrFacets.getVal(i);
                }
            }
        }
        return defaultCount;
    }
1360125
function sort(array, bucketSize) {
  if (array.length === 0) {
    return array;
  }

  // Determine minimum and maximum values
  var i;
  var minValue = array[0];
  var maxValue = array[0];
  for (i = 1; i < array.length; i++) {
    if (array[i] < minValue) {
      minValue = array[i];
    } else if (array[i] > maxValue) {
      maxValue = array[i];
    }
  }

  // Initialise buckets
  var DEFAULT_BUCKET_SIZE = 5;
  bucketSize = bucketSize || DEFAULT_BUCKET_SIZE;
  var bucketCount = Math.floor((maxValue - minValue) / bucketSize) + 1;
  var buckets = new Array(bucketCount);
  for (i = 0; i < buckets.length; i++) {
    buckets[i] = [];
  }

  // Distribute input array values into buckets
  for (i = 0; i < array.length; i++) {
    buckets[Math.floor((array[i] - minValue) / bucketSize)].push(array[i]);
  }

  // Sort buckets and place back into input array
  array.length = 0;
  for (i = 0; i < buckets.length; i++) {
    insertionSort(buckets[i]);
    for (var j = 0; j < buckets[i].length; j++) {
      array.push(buckets[i][j]);
    }
  }

  return array;
}
356279
def get_bucket_for(self, node):
        
        for index, bucket in enumerate(self.buckets):
            if node.long_id < bucket.range[1]:
                return index
        # we should never be here, but make linter happy
        return None
159079
def buckets(self):
        

        # No cached value
        if self.__buckets is None:

            # Get response
            response = self.__service.tables().list(
                projectId=self.__project,
                datasetId=self.__dataset).execute()

            # Extract buckets
            self.__buckets = []
            for table in response.get('tables', []):
                table_name = table['tableReference']['tableId']
                bucket = self.__mapper.restore_bucket(table_name)
                if bucket is not None:
                    self.__buckets.append(bucket)

        return self.__buckets
1372724
private synchronized void legacyInitBuckets(SparseIntArray inUseCounts) {
    Preconditions.checkNotNull(inUseCounts);

    // clear out all the buckets
    mBuckets.clear();

    // create the new buckets
    final SparseIntArray bucketSizes = mPoolParams.bucketSizes;
    if (bucketSizes != null) {
      for (int i = 0; i < bucketSizes.size(); ++i) {
        final int bucketSize = bucketSizes.keyAt(i);
        final int maxLength = bucketSizes.valueAt(i);
        int bucketInUseCount = inUseCounts.get(bucketSize, 0);
        mBuckets.put(
            bucketSize,
            new Bucket<V>(
                getSizeInBytes(bucketSize),
                maxLength,
                bucketInUseCount,
                mPoolParams.fixBucketsReinitialization));
      }
      mAllowNewBuckets = false;
    } else {
      mAllowNewBuckets = true;
    }
  }
400247
def bucket_keys_to_guarantee_result_set_size(self, bucket_key, N, tree_depth):
        

        if tree_depth == len(bucket_key):
            #print 'Returning leaf bucket key %s with %d vectors' % (self.bucket_key, self.vector_count)
            # This is a leaf so just return the bucket key (we reached the bucket leaf)
            return [self.bucket_key]

        # If not leaf, this is a subtree node.

        hash_char = bucket_key[tree_depth]
        if hash_char == '0':
            other_hash_char = '1'
        else:
            other_hash_char = '0'

        # Check if child has enough results
        if hash_char in self.childs:
            if self.childs[hash_char].vector_count < N:
                # If not combine buckets of both child subtrees
                listA = self.childs[hash_char].collect_all_bucket_keys()
                listB = self.childs[other_hash_char].collect_all_bucket_keys()
                return listA + listB
            else:
                # Child subtree has enough results, so call method on child
                return self.childs[hash_char].bucket_keys_to_guarantee_result_set_size(bucket_key, N, tree_depth+1)
        else:
            # That subtree is not existing, so just follow the other side
            return self.childs[other_hash_char].bucket_keys_to_guarantee_result_set_size(bucket_key, N, tree_depth+1)
774406
def get(self, url=None, delimiter="/"):
        
        params = {'Delimiter': delimiter}
        bucket, obj_key = _parse_url(url)

        if bucket:
            params['Bucket'] = bucket
        else:
            return self.call("ListBuckets", response_data_key="Buckets")

        if obj_key:
            params['Prefix'] = obj_key

        objects = self.call("ListObjects", response_data_key="Contents",
                            **params)
        if objects:
            for obj in objects:
                obj['url'] = "s3://{0}/{1}".format(bucket, obj['Key'])

        return objects
1011112
def get_objects(self):
        
        bucket = self._get_bucket()
        objs = []
        for key in bucket:
            objs.append(key)
        return objs
195206
def _get_bucket(self, client_kwargs):
        
        return _oss.Bucket(self.client, endpoint=self._endpoint,
                           bucket_name=client_kwargs['bucket_name'])
404160
def get_buckets(self, bucket_type=None, timeout=None):
        
        msg_code = riak.pb.messages.MSG_CODE_LIST_BUCKETS_REQ
        codec = self._get_codec(msg_code)
        msg = codec.encode_get_buckets(bucket_type,
                                       timeout, streaming=False)
        resp_code, resp = self._request(msg, codec)
        return resp.buckets