see tqdm.tqdm for arguments
(self, iterable=None, desc=None, total=None, leave=True, file=None,
ncols=None, mininterval=0.1, maxinterval=10.0, miniters=None,
ascii=None, disable=False, unit='it', unit_scale=False,
dynamic_ncols=False, smoothing=0.3, bar_format=None, initial=0,
position=None, postfix=None, unit_divisor=1000, write_bytes=False,
lock_args=None, nrows=None, colour=None, delay=0.0, gui=False,
**kwargs)
| 952 | @envwrap("TQDM_", is_method=True, types={'total': float, 'ncols': int, 'miniters': float, |
| 953 | 'position': int, 'nrows': int}) |
| 954 | def __init__(self, iterable=None, desc=None, total=None, leave=True, file=None, |
| 955 | ncols=None, mininterval=0.1, maxinterval=10.0, miniters=None, |
| 956 | ascii=None, disable=False, unit='it', unit_scale=False, |
| 957 | dynamic_ncols=False, smoothing=0.3, bar_format=None, initial=0, |
| 958 | position=None, postfix=None, unit_divisor=1000, write_bytes=False, |
| 959 | lock_args=None, nrows=None, colour=None, delay=0.0, gui=False, |
| 960 | **kwargs): |
| 961 | """see tqdm.tqdm for arguments""" |
| 962 | if file is None: |
| 963 | file = sys.stderr |
| 964 | |
| 965 | if write_bytes: |
| 966 | # Despite coercing unicode into bytes, py2 sys.std* streams |
| 967 | # should have bytes written to them. |
| 968 | file = SimpleTextIOWrapper( |
| 969 | file, encoding=getattr(file, 'encoding', None) or 'utf-8') |
| 970 | |
| 971 | file = DisableOnWriteError(file, tqdm_instance=self) |
| 972 | |
| 973 | if disable is None and hasattr(file, "isatty") and not file.isatty(): |
| 974 | disable = True |
| 975 | |
| 976 | if total is None and iterable is not None: |
| 977 | try: |
| 978 | total = len(iterable) |
| 979 | except (TypeError, AttributeError): |
| 980 | total = None |
| 981 | if total == float("inf"): |
| 982 | # Infinite iterations, behave same as unknown |
| 983 | total = None |
| 984 | |
| 985 | if disable: |
| 986 | self.iterable = iterable |
| 987 | self.disable = disable |
| 988 | with self._lock: |
| 989 | self.pos = self._get_free_pos(self) |
| 990 | self._instances.remove(self) |
| 991 | self.n = initial |
| 992 | self.total = total |
| 993 | self.leave = leave |
| 994 | return |
| 995 | |
| 996 | if kwargs: |
| 997 | self.disable = True |
| 998 | with self._lock: |
| 999 | self.pos = self._get_free_pos(self) |
| 1000 | self._instances.remove(self) |
| 1001 | raise ( |
| 1002 | TqdmDeprecationWarning( |
| 1003 | "`nested` is deprecated and automated.\n" |
| 1004 | "Use `position` instead for manual control.\n", |
| 1005 | fp_write=getattr(file, 'write', sys.stderr.write)) |
| 1006 | if "nested" in kwargs else |
| 1007 | TqdmKeyError("Unknown argument(s): " + str(kwargs))) |
| 1008 | |
| 1009 | # Preprocess the arguments |
| 1010 | if ( |
| 1011 | (ncols is None or nrows is None) and (file in (sys.stderr, sys.stdout)) |
nothing calls this directly
no test coverage detected