Returns the smallest valid poolSize in the current historical dataset.

@param poolSize - current poolSize
@param forecast - expected throughput at current poolSize
@return - smallest valid poolSize found
974861
private Integer getSmallestValidPoolSize(Integer poolSize, Double forecast) {
        Integer smallestPoolSize = threadStats.firstKey();
        Integer nextPoolSize = threadStats.higherKey(smallestPoolSize);
        Integer pruneSize = -1;
        boolean validSmallData = false;
        while (!validSmallData && nextPoolSize != null) {
            ThroughputDistribution smallestPoolSizeStats = getThroughputDistribution(smallestPoolSize, false);;
            // prune data that is too old or outside believable range
            if (pruneData(smallestPoolSizeStats, forecast)) {
                pruneSize = smallestPoolSize;
                smallestPoolSize = nextPoolSize;
                nextPoolSize = threadStats.higherKey(smallestPoolSize);
                if (pruneSize > hangBufferPoolSize && pruneSize > coreThreads) {
                    threadStats.remove(pruneSize);
                }
            } else {
                validSmallData = true;
            }
        }
        return smallestPoolSize;
    }
714942
public synchronized int getPoolMaximum(PoolInfo poolInfo, ResourceType type) {
    Integer max = (typePoolInfoToMax == null) ? null :
        typePoolInfoToMax.get(type, poolInfo);
    return max == null ? Integer.MAX_VALUE : max;
  }
574632
static DBaseFileAttributePool getPool(URL dbaseFile) {
		DBaseFileAttributePool pool = null;
		if (dbaseFile != null) {
			if (pools == null) {
				pools = new WeakValueTreeMap<>();
			}
			pool = pools.get(dbaseFile.toExternalForm());
			if (pool == null) {
				pool = new DBaseFileAttributePool(dbaseFile);
				pools.put(dbaseFile.toExternalForm(), pool);
			}
		}
		return pool;
	}
774913
public ArrayList<net.minidev.ovh.api.me.consumption.OvhTransaction> consumption_usage_forecast_GET() throws IOException {
		String qPath = "/me/consumption/usage/forecast";
		StringBuilder sb = path(qPath);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, t7);
	}
651546
def MaxPooling(
        inputs,
        pool_size,
        strides=None,
        padding='valid',
        data_format='channels_last'):
    
    if strides is None:
        strides = pool_size
    layer = tf.layers.MaxPooling2D(pool_size, strides, padding=padding, data_format=data_format)
    ret = layer.apply(inputs, scope=tf.get_variable_scope())
    return tf.identity(ret, name='output')
959668
protected boolean incrementPoolSize(int expectingMaxSize) {

        Integer maxSize = null;
        long currentOverflowPoolSize;
        try {
            lock.lockInterruptibly();
            int currentMaxSize = poolAdapter.getMaxPoolSize();
            boolean incrementMaxPoolSize = currentMaxSize < maxOverflowPoolSize;
            if (currentMaxSize > expectingMaxSize) {
                LOGGER.info("Pool size changed by other thread, expected {} and actual value {}", expectingMaxSize, currentMaxSize);
                return incrementMaxPoolSize;
            }
            if (!incrementMaxPoolSize) {
                return false;
            }
            currentOverflowPoolSize = overflowPoolSize.incrementAndGet();
            poolAdapter.setMaxPoolSize(++currentMaxSize);
            maxSize = currentMaxSize;
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
            return false;
        } finally {
            lock.unlock();
        }
        LOGGER.info("Pool size changed from previous value {} to {}", expectingMaxSize, maxSize);
        maxPoolSizeHistogram.update(maxSize);
        overflowPoolSizeHistogram.update(currentOverflowPoolSize);
        return true;
    }
547377
public synchronized int getPoolGroupMinimum(String poolGroupName,
                                              ResourceType type) {
    Integer min = (typePoolGroupNameToMin == null) ? null :
        typePoolGroupNameToMin.get(type, poolGroupName);
    return min == null ? 0 : min;
  }
578114
public static IntTuple zero(int size)
    {
        if (size >= 0 && size < ZERO_POOL_SIZE)
        {
            return ZEROS[size];
        }
        return createZero(size);
    }
389782
def determine_pool_size(job_vector):
    

    available_threads = cpu_count()
    total_jobs = len(job_vector)
    threads_to_pass = total_jobs
    if total_jobs >= available_threads:
        threads_to_pass = available_threads
    if threads_to_pass > 90:
        threads_to_pass = 90
    print("There are {} threads available.\nThere are {} jobs:\nMaking a pool with {} threads".format(
        available_threads, total_jobs, threads_to_pass), file = sys.stderr)
    return threads_to_pass
1044486
int adjustPoolSize(int poolSize, int poolAdjustment) {
        if (threadPool == null)
            return poolSize; // arguably should return 0, but "least change" is safer... This happens during shutdown.

        int newPoolSize = poolSize + poolAdjustment;
        lastAction = LastAction.NONE;

        if (poolAdjustment != 0) {
            // don't shrink below coreThreads
            if (poolAdjustment < 0 && newPoolSize >= coreThreads) {
                lastAction = LastAction.SHRINK;
                setPoolSize(newPoolSize);
            } else if (poolAdjustment > 0 && newPoolSize <= maxThreads) {
                lastAction = LastAction.GROW;
                setPoolSize(newPoolSize);
            } else {
                newPoolSize = poolSize;
            }
        }

        return newPoolSize;
    }
307066
public V get(ResourceType type, PoolInfo poolInfo) {
    Map<PoolInfo, V> poolInfoMap = typePoolInfoMap.get(type);
    if (poolInfoMap == null) {
      return null;
    }
    return poolInfoMap.get(poolInfo);
  }
738825
public OvhProjectForecast project_serviceName_forecast_GET(String serviceName, Date toDate) throws IOException {
		String qPath = "/cloud/project/{serviceName}/forecast";
		StringBuilder sb = path(qPath, serviceName);
		query(sb, "toDate", toDate);
		String resp = exec(qPath, "GET", sb.toString(), null);
		return convertTo(resp, OvhProjectForecast.class);
	}
190214
public Map<PoolInfo, PoolInfoMetrics> getPoolInfoMetrics(ResourceType type) {
    return schedulersForTypes.get(type).getPoolInfoMetrics();
  }
996157
public double[] getPrediction(Instance instance) {
        int predictionMode = this.getLearnerToUse(instance, this.predictionFunction);
        return getPrediction(instance, predictionMode);
    }
105584
def mpool(self,
              k_height,
              k_width,
              d_height=2,
              d_width=2,
              mode="VALID",
              input_layer=None,
              num_channels_in=None):
        """"""
        return self._pool("mpool", pooling_layers.max_pooling2d, k_height,
                          k_width, d_height, d_width, mode, input_layer,
                          num_channels_in)
1187674
def apool(self,
              k_height,
              k_width,
              d_height=2,
              d_width=2,
              mode="VALID",
              input_layer=None,
              num_channels_in=None):
        """"""
        return self._pool("apool", pooling_layers.average_pooling2d, k_height,
                          k_width, d_height, d_width, mode, input_layer,
                          num_channels_in)
897081
static public EntryInfoPool createEntryInfoPool(String poolName, int size){
       final String methodName = "createEntryInfoPool()";
       EntryInfoPool pool = new EntryInfoPool(poolName, size);
       //pools.add(pool);
       if (tc.isDebugEnabled())
          Tr.debug(tc, methodName+" poolName=" + poolName);
       return pool;
   }