Set the limit on number of file descriptors
    that this process can open.
171712
def set_file_limits(n):
    '''
    

    '''

    try:
        resource.setrlimit(resource.RLIMIT_NOFILE, (n, n))
        return True
    except ValueError:
        return False
540725
def load_limits(self, config=None):
        """"""
        # For each plugins, call the load_limits method
        for p in self._plugins:
            self._plugins[p].load_limits(config)
1368536
def shrink(self, amount):
        """"""
        # Grow/shrink the pool if necessary.
        # Remove any dead threads from our list
        for t in self._threads:
            if not t.isAlive():
                self._threads.remove(t)
                amount -= 1

        # calculate the number of threads above the minimum
        n_extra = max(len(self._threads) - self.min, 0)

        # don't remove more than amount
        n_to_remove = min(amount, n_extra)

        # put shutdown requests on the queue equal to the number of threads
        # to remove. As each request is processed by a worker, that worker
        # will terminate and be culled from the list.
        for n in range(n_to_remove):
            self._queue.put(_SHUTDOWNREQUEST)
1025013
def setXlimits(self, lims):
        
        # update all "linked", plots
        self.specPlot.setXlim(lims)
        for plot in self.responsePlots.values():
            plot.setXlim(lims)
        # ridiculous...
        sizes = self.splittersw.sizes()
        if len(sizes) > 1:
            if self.badbadbad:
                sizes[0] +=1
                sizes[1] -=1
            else:
                sizes[0] -=1
                sizes[1] +=1
            self.badbadbad = not self.badbadbad
            self.splittersw.setSizes(sizes)

        self._ignore_range_signal = False
968447
private void setLimits(Surface surface, int gridH, int gridV)
    {
        Check.notNull(surface);

        if (gridH == 0)
        {
            limitRight = 0;
        }
        else
        {
            limitRight = Math.max(0, surface.getWidth() - UtilMath.getRounded(width, gridH));
        }
        if (gridV == 0)
        {
            limitTop = 0;
        }
        else
        {
            limitTop = Math.max(0, surface.getHeight() - UtilMath.getRounded(height, gridV));
        }
        limitLeft = 0;
        limitBottom = 0;

        moveLocation(1.0, 0.0, 0.0);
    }
1286215
def Start(self,
            file_size=0,
            maximum_pending_files=1000,
            use_external_stores=False):
    """"""
    super(MultiGetFileLogic, self).Start()

    self.state.files_hashed = 0
    self.state.use_external_stores = use_external_stores
    self.state.file_size = file_size
    self.state.files_to_fetch = 0
    self.state.files_fetched = 0
    self.state.files_skipped = 0

    # Counter to batch up hash checking in the filestore
    self.state.files_hashed_since_check = 0

    # A dict of file trackers which are waiting to be checked by the file
    # store.  Keys are vfs urns and values are FileTrack instances.  Values are
    # copied to pending_files for download if not present in FileStore.
    self.state.pending_hashes = {}

    # A dict of file trackers currently being fetched. Keys are vfs urns and
    # values are FileTracker instances.
    self.state.pending_files = {}

    # The maximum number of files we are allowed to download concurrently.
    self.state.maximum_pending_files = maximum_pending_files

    # As pathspecs are added to the flow they are appended to this array. We
    # then simply pass their index in this array as a surrogate for the full
    # pathspec. This allows us to use integers to track pathspecs in dicts etc.
    self.state.indexed_pathspecs = []
    self.state.request_data_list = []

    # The index of the next pathspec to start. Pathspecs are added to
    # indexed_pathspecs and wait there until there are free trackers for
    # them. When the number of pending_files falls below the
    # "maximum_pending_files" count] = we increment this index and start of
    # downloading another pathspec.
    self.state.next_pathspec_to_start = 0

    # Number of blob hashes we have received but not yet scheduled for download.
    self.state.blob_hashes_pending = 0
526724
def set_data_length(self, length):
        # type: (int) -> None
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('Directory Record not yet initialized')

        len_diff = length - self.info_len
        if len_diff > 0:
            # If we are increasing the length, update the last alloc_desc up
            # to the max of 0x3ffff800, and throw an exception if we overflow.
            new_len = self.alloc_descs[-1][0] + len_diff
            if new_len > 0x3ffff800:
                raise pycdlibexception.PyCdlibInvalidInput('Cannot increase the size of a UDF file beyond the current descriptor')
            self.alloc_descs[-1][0] = new_len
        elif len_diff < 0:
            # We are decreasing the length.  It's possible we are removing one
            # or more alloc_descs, so run through the list updating all of the
            # descriptors and remove any we no longer need.
            len_left = length
            alloc_descs_needed = 0
            index = 0
            while len_left > 0:
                this_len = min(len_left, 0x3ffff800)
                alloc_descs_needed += 1
                self.alloc_descs[index][0] = this_len
                index += 1
                len_left -= this_len

            self.alloc_descs = self.alloc_descs[:alloc_descs_needed]

        self.info_len = length
367688
private void applyVerticalLimit()
    {
        if (mover.getY() < limitBottom && limitBottom != Integer.MIN_VALUE)
        {
            mover.teleportY(limitBottom);
        }
        else if (mover.getY() > limitTop && limitTop != Integer.MAX_VALUE)
        {
            mover.teleportY(limitTop);
        }
    }
113225
def reset(self):
        
        self.reached_limit = False
        self.count = 0
        self.seen.clear()
1131750
def __buildLimit(self, query ,limitResMax):
        """"""
        limit = query._getParameters()['limit']
        if limitResMax>0 and limitResMax < limit:
            query = UpdateParameter(query, 'limit', limitResMax)
            query = UpdateParameter(query, 'nocount', 'true')        
        elif  limitResMax>0 and  limitResMax >= limit:
            query = UpdateParameter(query, 'nocount', 'true')
        return query
529577
public void setFileExtensions(String fileExtensions) {
		if ("".equals(fileExtensions.trim()))
			return;
		String[] split = fileExtensions.split("\\s*,\\s*");
		for (String string : split) {
			this.fileExtensions.add(string);
		}
	}
378913
public void setFileSize() {
        if (arr[DatenFilm.FILM_GROESSE].isEmpty())
            arr[DatenFilm.FILM_GROESSE] = FileSize.laengeString(arr[DatenFilm.FILM_URL]);
    }
1044996
def _check_limit(self):
        """"""

        # First compress
        self._compress()

        # Then check the max size
        if len(self._store) >= self._max_size:
            self._store.popitem(last=False)
638623
public void setFileExtensions(final String fileExtensions) {
    this.fileExtensions = IterableExtensions.<String>toList(((Iterable<String>)Conversions.doWrapArray(fileExtensions.trim().split("\\s*,\\s*"))));
  }
202966
public static void reset(File directory, int processNumber) {
    try (DefaultProcessCommands processCommands = new DefaultProcessCommands(directory, processNumber, true)) {
      // nothing else to do than open file and reset the space of specified process
    }
  }
722484
private function setLimitAndSetOffset()
    {
        if ($this->perPage === null) {
            $this->offset = null;
            $this->limit = null;
        } else {
            $this->offset = ($this->currentPage - 1) * $this->perPage;
            $this->limit = $this->perPage;
        }
    }
1033647
public void setLinearUpperLimits(float limitX, float limitY, float limitZ) {
        Native3DGenericConstraint.setLinearUpperLimits(getNative(), limitX, limitY, limitZ);
    }