Decorate to update bucket size after operation.
328327
def update_bucket_size(f):
    """"""
    @wraps(f)
    def inner(self, *args, **kwargs):
        res = f(self, *args, **kwargs)
        self.bucket.size += self.file.size
        return res
    return inner
647316
def do_updateCapacity(self,args):
        """"""
        parser = CommandArgumentParser("updateMinMax")
        parser.add_argument('-m','--min',dest='min',type=int,help='new values');
        parser.add_argument('-M','--max',dest='max',type=int,help='new values');
        parser.add_argument('-d','--desired',dest='desired',type=int,help='desired');
        args = vars(parser.parse_args(args))

        minSize = args['min']
        maxSize = args['max']
        desired = args['desired']
        
        print "Setting desired capacity to {}-{}, {}".format(minSize,maxSize,desired)
        client = AwsConnectionFactory.getAsgClient()
        client.update_auto_scaling_group(AutoScalingGroupName=self.scalingGroup,MinSize=minSize,MaxSize=maxSize,DesiredCapacity=desired)
        #client.set_desired_capacity(AutoScalingGroupName=self.scalingGroup,DesiredCapacity=value,HonorCooldown=True)
        print "Scaling activity in progress"
545257
def OnSize(self, event):
        """"""

        # Store window size in config

        size = event.GetSize()

        config["window_size"] = repr((size.width, size.height))
610512
def update(self, size):
        
        if not isinstance(size, int):
            raise ValueError('{} type can not be displayed. '
                             'Please change it to Int.'.format(type(size)))

        self.current_size += size
        self.display_queue.put((self.current_size, self.total_length))
605429
public void add(long n)
    {
        int index = Arrays.binarySearch(bucketOffsets, n);
        if (index < 0)
        {
            // inexact match, take the first bucket higher than n
            index = -index - 1;
        }
        // else exact match; we're good
        buckets.incrementAndGet(index);
    }
839418
def _update_length(self):
        """"""
        action_length = 4 + len(self.field.pack())
        overflow = action_length % 8
        self.length = action_length
        if overflow:
            self.length = action_length + 8 - overflow
929742
def resize(new_size)
      return unless @resize_enabled

      bucket_width = new_width # find new bucket width
      local_init(new_size, bucket_width, @last_priority)

      i = 0
      while i < @cached_buckets.size
        bucket = @cached_buckets[i]
        @size -= bucket.size
        while obj = bucket.pop
          self << obj
        end
        i += 1
      end
    end
440560
def pass_bucket(f):
    """"""
    @wraps(f)
    def decorate(*args, **kwargs):
        bucket_id = kwargs.pop('bucket_id')
        bucket = Bucket.get(as_uuid(bucket_id))
        if not bucket:
            abort(404, 'Bucket does not exist.')
        return f(bucket=bucket, *args, **kwargs)
    return decorate
869483
def wrap(self, data, many):
        """"""
        if not many:
            return data
        else:
            data = {'parts': data}
            multipart = self.context.get('multipart')
            if multipart:
                data.update(MultipartObjectSchema(context={
                    'bucket': multipart.bucket}).dump(multipart).data)
            return data
1112572
private void resize(int newCapacity) {
        // assert (newCapacity & -newCapacity) == newCapacity; // power of 2
        int newLength = newCapacity * 2;

        long[] oldTable = table;
        int oldLength = oldTable.length;
        if (oldLength == 2*MAXIMUM_CAPACITY) { // can't expand any further
            if (threshold == MAXIMUM_CAPACITY-1)
                throw new IllegalStateException("Capacity exhausted.");
            threshold = MAXIMUM_CAPACITY-1;  // Gigantic map!
            return;
        }
        if (oldLength >= newLength)
            return;

        long[] newTable = new long[newLength];
        threshold = (newCapacity * 3) / 4;

        for (int j = 0; j < oldLength; j += 2) {
            long key = oldTable[j];
            if (key != 0) {
                long value = oldTable[j+1];
                int i = hash(key, newLength);
                while (newTable[i] != 0)
                    i = nextKeyIndex(i, newLength);
                newTable[i] = key;
                newTable[i + 1] = value;
            }
        }
        table = newTable;
    }
571711
def update_slice(self, blob):
        """"""

        nexpand, ncontract = blob['nexpand'], blob['ncontract']
        self.scale *= nexpand / (2. * ncontract)
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;
    }
  }
1351606
def update(self, instance, oldValue, newValue, subKey):
    """"""
    histogram = self.__get__(instance, None)
    histogram[subKey] += newValue - oldValue
959178
def update(self, obj, size):
        '''
        '''
        self.number += 1
        self.total  += size
        if self.high < size:  # largest
           self.high = size
           try:  # prefer using weak ref
               self.objref, self.weak = Weakref.ref(obj), True
           except TypeError:
               self.objref, self.weak = obj, False
1230678
private void repairDataSize()
   {
      try
      {
         long dataSize = quotaPersister.getWorkspaceDataSize(rName, wsName);

         ChangesItem changesItem = new ChangesItem();
         changesItem.updateWorkspaceChangedSize(dataSize);

         quotaPersister.setWorkspaceDataSize(rName, wsName, 0); // workaround

         Runnable task = new ApplyPersistedChangesTask(wqm.getContext(), changesItem);
         task.run();
      }
      catch (UnknownDataSizeException e)
      {
         if (LOG.isTraceEnabled())
         {
            LOG.trace(e.getMessage(), e);
         }
      }
   }
522822
def size_changed(self, settings, key, user_data):
        
        RectCalculator.set_final_window_rect(self.settings, self.guake.window)
1211071
def get_size(
            self,
            bucket: str,
            key: str
    ) -> int:
        
        blob_obj = self._get_blob_obj(bucket, key)
        return blob_obj.size