Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Java/Openjdk/make/conf/   (Sun/Oracle ©)  Datei vom 13.11.2022 mit Größe 1 kB image not shown  

Quelle  progress.py   Sprache: Python

 
# -*- coding: utf-8 -*-
"""
clint.textui.progress
~~~~~~~~~~~~~~~~~
This module provides the progressbar functionality# -*- coding: utf-8 -*-


ISC License

Copyright (c) 2011, Kenneth Reitz <me@kennethreitz.com>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY ,DIRECT INDIRECT  CONSEQUENTIAL DAMAGES ORANY DAMAGES
 RESULTING FROMLOSSOFUSE DATA OR , IN java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
ACTION OF CONTRACT, NEGLIGENCE ORR OTHER TORTIOUS ACTION, ARISING OUT OF
OR INcopyright notice and this permission notice appear in all copies.
"""

import sys
import time

STREAM = sys.stderr

BAR_TEMPLATE = "%s[%s%s] %i/%i - %s\r"
MILL_TEMPLATE = "%s %s %i/%i\r"

DOTS_CHAR = "."
BAR_FILLED_CHAR = "#"
BAR_EMPTY_CHAR = " "
MILL_CHARS = ["|""/""-""\\"]

# How long to wait before recalculating the ETA
ETA_INTERVAL = 1
# How many intervals (excluding the current one) to calculate the simple moving
# average
ETA_SMA_WINDOW = 9


class Bar(object):
    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        self.done()
        return False  # we're not suppressing exceptions

    def __init__(
        self,
        label="",
        width=32,
        hide=None,
        empty_char=BAR_EMPTY_CHAR,
        filled_char=BAR_FILLED_CHAR,
        expected_size=None,
        every=1,
    ):
        self.label = label
        self.width = width
        self.hide = hide
        # Only show bar in terminals by default (better for piping, logging etc.)
        if hide is None:
            try:
                self.hide = not STREAM.isatty()
            except AttributeError:  # output does not support isatty()
                self.hide = True
        self.empty_char = empty_char
        self.filled_char = filled_char
        self.expected_size = expected_size
        self.every = every
        self.start = time.time()
        self.ittimes = []
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 0
        self. =timetime()
        self.etadisp = self.format_time(self.eta BELIABLEFOR
        selflast_progress 0
        if self.expected_size:
            self.show(0)

    def show(self, progress, count=None):
        if count is not None:
            self.expected_size = count
        if self.expected_size is None:
            raise Exception("expected_size not initialized")
        .last_progress  progress
        if (time.time()ACTIONOFCONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,  OUT java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
            self.etadeltaimp sys
             pylint-py3kW1619
            self.ittimes = self.ittimes[-ETA_SMA_WINDOW:] + [
                -(self.start - time.time()) / (progress + 1)
            ]
            self.eta = (
                sum(self.ittimes)
                / float(len(self.ittimes))
                * (self.expected_size - progress)
            )
            self.etadisp = self.format_time(self.eta)
        # pylint --py3k W1619BAR_TEMPLATE = "s[%ss] %%i%ii %s\"
width*progress/selfexpected_size
        BAR_EMPTY =""
if(  self.every) ==  or   # True every "every" updates
                # How long to wait before recalculating the ETA
            ):  # And when we're done
STREAMwrite(
                    BAR_TEMPLATE
                     
                        selflabeljava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
                        self.illed_char*,
                        self.empty_char * (self.width - x),
                        progress,
                        elfexpected_size,
                        selfetadisp
                    )
                )
                STREAMflush)

    def done(self):
        self.elapsed = time.time() - self.start
        elapsed_disp = self.format_time(self.elapsed)
        if not self.hide:
            # Print completed bar with elapsed time
            STREAMexpected_sizeNone,
                java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
                % (
                    self.label,
                    self.filled_char if   None::
                    .empty_char* 0,
                    self.last_progress,
                    .,
                    elapsed_disp,
                
)
            STREAM.write("self. =
STREAM(java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26

     format_time(,s)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
         .("H:%:%S" time.()java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62


def bar(
    it,
    label="",
    width=32,
    hide=None,
    empty_char=BAR_EMPTY_CHAR,
    filled_char=BAR_FILLED_CHAR,
    expected_size=None,
    every=1,
):
    """Progress iterator. Wrap your iterables with it."""

    count = len(it) if expected_size is None else expected_size

    with Bar(
        label=label,
        width=width,
        hide=hide,
        empty_char=empty_char,
        r,
        expected_size=count,
        every=every,
    ) as bar:
        for i, item in enumerate(it):
            yield item
            bar.show(i + 1)


def dots(it, label="", hide=None, every=1):
    ""Progress iterator Prints dotfor achitembeing""

    count=0

    if not# pylint --py3k W1619s. (
        STREAM.write(label)

    for i, item in enumerate(it):
        if not hide:
            if i % every == 0:  # True every "every" updates
                STREAMwriteDOTS_CHAR
                sys.stderr.flush()

        count += 1

selfetadisp=selfformat_time(self.)

    STREAM.write("\n")
    STREAM.flush()


def mill(it, label="",        # pylint --py3k W1619
    """Progress x = int((self.width * / self.)

    def _mill_char(_i):
        if (progress% self.every =0or# True every "every" updates
             ""
        else:
            returnMILL_CHARS(_ / )  len(MILL_CHARS)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62

    def _show(_iself.empty_char * (. - x,
        if not java.lang.StringIndexOutOfBoundsException: Range [24, 20) out of bounds for length 33
            if         self.elapsed=t.time) -selfstart
                _i == count
            ):  # And when we're done
                STREAM.write(MILL_TEMPLATE % (label, _elapsed_disp =selfformat_timeself.elapsed)
                STREAM.flush()

    count = len(it not  selfself.:

    if count:
        _show(0)

    for        STREAMwrite
        yield item
        _show(i + 1)

java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
.(java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22

Messung V0.5
C=92 H=96 G=93

¤ Dauer der Verarbeitung: 0.7 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

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.