Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/python/mozrelease/mozrelease/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 872 B image not shown  

Quelle  chunking.py

  Sprache: Python
 

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from copy import copy


class ChunkingError(Exception):
    pass


def getChunk(things, chunks, thisChunk):
    if thisChunk > chunks:
        raise ChunkingError(
            "thisChunk (%d) is greater than total chunks (%d)" % (thisChunk, chunks)
        )
    possibleThings = copy(things)
    nThings = len(possibleThings)
    for c in range(1, chunks + 1):
        n = nThings // chunks
        # If our things aren't evenly divisible by the number of chunks
        # we need to append one more onto some of them
        if c <= (nThings % chunks):
            n += 1
        if c == thisChunk:
            return possibleThings[0:n]
        del possibleThings[0:n]

Messung V0.5 in Prozent
C=82 H=85 G=83

¤ Dauer der Verarbeitung: 0.15 Sekunden  (vorverarbeitet am  2026-06-05) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.