repo stringclasses 454
values | file_path stringlengths 5 201 | extension stringclasses 1
value | content stringlengths 8 509k | num_lines int64 3 16.9k | size_bytes int64 8 511k |
|---|---|---|---|---|---|
tqdm | tests/tests_rich.py | .py | """Test `tqdm.rich`."""
from pytest import importorskip, mark
@mark.filterwarnings("ignore:rich is experimental/alpha:"
"tqdm.std.TqdmExperimentalWarning")
def test_rich_no_total(capsys):
"""Test `tqdm.rich` on an iterable without a length, e.g. a generator"""
rich = importorskip('tqdm.ri... | 33 | 912 |
tqdm | tests/tests_tqdm.py | .py | # Advice: use repr(our_file.read()) to print the full output of tqdm
# (else '\r' will replace the previous lines and you'll see only the latest.
import csv
import os
import re
import sys
from contextlib import contextmanager
from functools import wraps
from warnings import catch_warnings, simplefilter
from pytest imp... | 1,986 | 67,858 |
tqdm | tests/conftest.py | .py | """Shared pytest config."""
import sys
from pytest import fixture
from tqdm import tqdm
@fixture(autouse=True)
def pretest_posttest():
"""Fixture for all tests ensuring environment cleanup"""
try:
sys.setswitchinterval(1)
except AttributeError:
sys.setcheckinterval(100) # deprecated
... | 28 | 739 |
tqdm | examples/coroutine_pipe.py | .py | """
Inserting `tqdm` as a "pipe" in a chain of coroutines.
Not to be confused with `asyncio.coroutine`.
"""
from functools import wraps
from tqdm.auto import tqdm
def autonext(func):
@wraps(func)
def inner(*args, **kwargs):
res = func(*args, **kwargs)
next(res)
return res
return i... | 70 | 1,256 |
tqdm | examples/parallel_bars.py | .py | from concurrent.futures import ThreadPoolExecutor
from functools import partial
from multiprocessing import Pool, RLock, freeze_support
from random import random
from threading import RLock as TRLock
from time import sleep
from tqdm.auto import tqdm, trange
from tqdm.contrib.concurrent import process_map, thread_map
... | 54 | 1,906 |
tqdm | examples/wrapping_generators.py | .py | import numpy as np
from tqdm.contrib import tenumerate, tmap, tzip
for _ in tenumerate(range(int(1e6)), desc="builtin enumerate"):
pass
for _ in tenumerate(np.random.random((999, 999)), desc="numpy.ndenumerate"):
pass
for _ in tzip(np.arange(1e6), np.arange(1e6) + 1, desc="builtin zip"):
pass
mapped = ... | 16 | 428 |
tqdm | examples/7zx.py | .py | """Usage:
7zx.py [--help | options] <zipfiles>...
Options:
-h, --help Print this help and exit
-v, --version Print version and exit
-c, --compressed Use compressed (instead of uncompressed) file sizes
-s, --silent Do not print one row per zip file
-y, --yes Assume yes to all queries (for ... | 118 | 4,455 |
tqdm | examples/include_no_requirements.py | .py | # How to import tqdm in any frontend without enforcing it as a dependency
try:
from tqdm.auto import tqdm
except ImportError:
def tqdm(*args, **kwargs):
if args:
return args[0]
return kwargs.get('iterable', None)
__all__ = ['tqdm']
| 12 | 270 |
tqdm | examples/tqdm_requests.py | .py | """An example of wrapping manual tqdm updates for `requests.get`.
See also: tqdm_wget.py.
Usage:
tqdm_requests.py [options]
Options:
-h, --help
Print this help message and exit
-u URL, --url URL : string, optional
The url to fetch.
[default: https://cgi.cdcl.ml/matryoshka.zip]
-o FILE, --output FILE ... | 50 | 1,462 |
tqdm | examples/tqdm_wget.py | .py | """An example of wrapping manual tqdm updates for `urllib` reporthook.
See also: tqdm_requests.py.
# `urllib.urlretrieve` documentation
> If present, the hook function will be called once
> on establishment of the network connection and once after each block read
> thereafter. The hook will be passed three arguments; ... | 111 | 3,543 |
tqdm | examples/redirect_print.py | .py | """Redirecting writing
If using a library that can print messages to the console, editing the library
by replacing `print()` with `tqdm.write()` may not be desirable.
In that case, redirecting `sys.stdout` to `tqdm.write()` is an option.
To redirect `sys.stdout`, create a file-like class that will write
any input st... | 51 | 1,484 |
tqdm | examples/async_coroutines.py | .py | """Asynchronous examples using `asyncio`, `async` and `await`."""
import asyncio
from tqdm.asyncio import tqdm, trange
def count(start=0, step=1):
i = start
while True:
new_start = yield i
if new_start is None:
i += step
else:
i = new_start
async def main():
... | 37 | 944 |
tqdm | examples/simple_examples.py | .py | """
# Simple tqdm examples and profiling
# Benchmark
for i in range(int(1e8)):
pass
# Basic demo
import tqdm
for i in tqdm.trange(int(1e8)):
pass
# Some decorations
import tqdm
for i in tqdm.trange(int(1e8), miniters=int(1e6), ascii=True,
desc="cool", dynamic_ncols=True):
pass
# Nes... | 65 | 1,352 |
colorama | demos/demo08.py | .py | import fixpath
from colorama import colorama_text, Fore
def main():
"""automatically reset stdout"""
with colorama_text():
print(Fore.GREEN + 'text is green')
print(Fore.RESET + 'text is back to normal')
print('text is back to stdout')
if __name__ == '__main__':
main()
| 15 | 306 |
colorama | demos/demo01.py | .py | #!/usr/bin/python
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# print grid of all colors and brightnesses
# uses stdout.write to write chars with no newline nor spaces between them
# This should run more-or-less identically on Windows and Unix.
import sys
# Add parent dir to sys path, s... | 48 | 2,019 |
colorama | demos/demo07.py | .py | import fixpath
import colorama
# Demonstrate cursor relative movement: UP, DOWN, FORWARD, and BACK in colorama.CURSOR
up = colorama.Cursor.UP
down = colorama.Cursor.DOWN
forward = colorama.Cursor.FORWARD
back = colorama.Cursor.BACK
def main():
"""
expected output:
1a2
aba
3a4
"""
colorama... | 27 | 559 |
colorama | demos/demo09.py | .py | # https://www.youtube.com/watch?v=F5a8RLY2N8M&list=PL1_riyn9sOjcKIAYzo7f8drxD-Yg9La-D&index=61
# Generic colorama demo using command line arguments
# By George Ogden
from colorama import Fore, Back, Style, init
import argparse
parser = argparse.ArgumentParser("colorama demo")
def format(module):
return list(map(la... | 21 | 893 |
colorama | demos/demo06.py | .py | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import fixpath
import colorama
from colorama import Fore, Back, Style, Cursor
from random import randint, choice
from string import printable
# Demonstrate printing colored, random characters at random positions on the screen
# Fore, Back and ... | 42 | 1,749 |
colorama | demos/demo04.py | .py | #!/usr/bin/python
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# check that stripped ANSI in redirected stderr does not affect stdout
import sys
import fixpath
from colorama import init, Fore
init()
print(Fore.GREEN + 'GREEN set on stdout. ', end='')
print(Fore.RED + 'RED redirected stde... | 13 | 438 |
colorama | demos/demo02.py | .py | #!/usr/bin/python
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# Simple demo of changing foreground, background and brightness.
import fixpath
from colorama import just_fix_windows_console, Fore, Back, Style
just_fix_windows_console()
print(Fore.GREEN + 'green, '
+ Fore.RED + 'red,... | 24 | 576 |
colorama | demos/demo03.py | .py | #!/usr/bin/python
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# Demonstrate the different behavior when autoreset is True and False.
import fixpath
from colorama import init, Fore, Back, Style
init(autoreset=True)
print(Fore.CYAN + Back.MAGENTA + Style.BRIGHT + 'Line 1: colored, with a... | 16 | 644 |
colorama | demos/demo05.py | .py | #!/usr/bin/python
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# Demonstrate the difference between colorama initialized with wrapping on and off.
# The point of the demonstration is to show how the ANSI wrapping on Windows can be disabled.
# The unwrapped cases will be interpreted with A... | 22 | 945 |
colorama | colorama/winterm.py | .py | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
try:
from msvcrt import get_osfhandle
except ImportError:
def get_osfhandle(_):
raise OSError("This isn't windows!")
from . import win32
# from wincon.h
class WinColor:
BLACK = 0
BLUE = 1
GREEN = 2
CYAN ... | 196 | 7,135 |
colorama | colorama/initialise.py | .py | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import atexit
import contextlib
import sys
from .ansitowin32 import AnsiToWin32
def _wipe_internal_state_for_tests():
global orig_stdout, orig_stderr
orig_stdout = None
orig_stderr = None
global wrapped_stdout, wrapped_stderr... | 118 | 3,200 |
colorama | colorama/ansi.py | .py | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
'''
This module generates ANSI character codes to printing colors to terminals.
See: http://en.wikipedia.org/wiki/ANSI_escape_code
'''
CSI = '\033['
OSC = '\033]'
BEL = '\a'
def code_to_chars(code):
return CSI + str(code) + 'm'
def set_t... | 103 | 2,506 |
colorama | colorama/ansitowin32.py | .py | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import re
import sys
import os
from .ansi import AnsiFore, AnsiBack, AnsiStyle, Style, BEL
from .winterm import enable_vt_processing, WinTerm, WinColor, WinStyle
from .win32 import windll, winapi_test
winterm = None
if windll is not None:
... | 278 | 11,112 |
colorama | colorama/win32.py | .py | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
# from winbase.h
STDOUT = -11
STDERR = -12
ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004
try:
import ctypes
from ctypes import LibraryLoader
windll = LibraryLoader(ctypes.WinDLL)
from ctypes import wintypes
except (AttributeErro... | 181 | 6,181 |
colorama | colorama/tests/utils.py | .py | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from contextlib import contextmanager
from io import StringIO
import sys
import os
class StreamTTY(StringIO):
def isatty(self):
return True
class StreamNonTTY(StringIO):
def isatty(self):
return False
@contextmanager
... | 50 | 1,079 |
colorama | colorama/tests/ansi_test.py | .py | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import sys
from unittest import TestCase, main
from ..ansi import Back, Fore, Style
from ..ansitowin32 import AnsiToWin32
stdout_orig = sys.stdout
stderr_orig = sys.stderr
class AnsiTest(TestCase):
def setUp(self):
# sanity chec... | 77 | 2,839 |
colorama | colorama/tests/isatty_test.py | .py | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import sys
from unittest import TestCase, main
from ..ansitowin32 import StreamWrapper, AnsiToWin32
from .utils import pycharm, replace_by, replace_original_by, StreamTTY, StreamNonTTY
def is_a_tty(stream):
return StreamWrapper(stream, No... | 58 | 1,866 |
colorama | colorama/tests/winterm_test.py | .py | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import sys
from unittest import TestCase, main, skipUnless
from unittest.mock import Mock, patch
from ..winterm import WinColor, WinStyle, WinTerm
class WinTermTest(TestCase):
@patch('colorama.winterm.win32')
def testInit(self, mockW... | 128 | 3,646 |
colorama | colorama/tests/ansitowin32_test.py | .py | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
from io import StringIO, TextIOWrapper
from unittest import TestCase, main
from unittest.mock import MagicMock, Mock, patch
from contextlib import ExitStack
from ..ansitowin32 import AnsiToWin32, StreamWrapper
from ..win32 import ENABLE_VIRTUAL... | 287 | 10,521 |
colorama | colorama/tests/initialise_test.py | .py | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import sys
from unittest import TestCase, main, skipUnless
from unittest.mock import patch, Mock
from ..ansitowin32 import StreamWrapper
from ..initialise import init, just_fix_windows_console, _wipe_internal_state_for_tests
from .utils import ... | 186 | 6,678 |
rich-cli | tests/test_main.py | .py | import click
from click import Command
from click.decorators import FC, Parameter
from click.testing import CliRunner
class DuplicateOptionsError(ValueError):
pass
def test_duplicate_option_flags_raises_exception(monkeypatch):
"""Create a test that will monkeypatch the click.option decorators
so that th... | 42 | 1,524 |
rich-cli | src/rich_cli/__main__.py | .py | from operator import itemgetter
import sys
from typing import TYPE_CHECKING, List, NoReturn, Optional, Tuple
import click
from pygments.util import ClassNotFound
from rich.console import Console, RenderableType
from rich.markup import escape
from rich.text import Text
console = Console()
error_console = Console(stder... | 940 | 27,292 |
rich-cli | src/rich_cli/markdown.py | .py | from typing import Any
from rich.console import Console, ConsoleOptions, RenderResult
from rich.markdown import Markdown, TextElement
from rich.padding import Padding
from rich.syntax import Syntax
class CodeBlock(TextElement):
"""A code block with syntax highlighting."""
style_name = "markdown.code_block"
... | 33 | 993 |
rich-cli | src/rich_cli/pager.py | .py | from enum import auto
from typing import Iterable, List
from rich.console import Console, ConsoleOptions, RenderResult
from rich.measure import Measurement
from rich.segment import Segment
from textual import events
from textual.app import App
from textual.widgets import ScrollView
class PagerRenderable:
def __... | 81 | 2,525 |
rich-cli | src/rich_cli/win_vt.py | .py | """
A decorator to enable windows virtual terminal processing, which allows terminals to use
the ansi control codes for color supported by Linux / MacOS.
"""
__all__ = ["enable_windows_virtual_terminal_processing"]
from contextlib import contextmanager
import ctypes
import platform
WINDOWS = platform.system() == "... | 62 | 1,779 |
tablib | tests/test_tablib_dbfpy_packages_fields.py | .py | #!/usr/bin/env python
"""Tests for tablib._vendor.dbfpy."""
import unittest
from tablib._vendor.dbfpy import fields
class DbfFieldDefTestCompareCase(unittest.TestCase):
"""dbfpy.fields.DbfFieldDef comparison test cases, via child classes."""
def setUp(self) -> None:
self.length = 10
self.a ... | 43 | 1,206 |
tablib | tests/test_tablib.py | .py | #!/usr/bin/env python
"""Tests for Tablib."""
import datetime as dt
import doctest
import json
import pickle
import re
import tempfile
import unittest
from decimal import Decimal
from io import BytesIO, StringIO
from pathlib import Path
from uuid import uuid4
import xlrd
from odf import opendocument, table
from openp... | 2,123 | 75,499 |
tablib | tests/test_tablib_dbfpy_packages_utils.py | .py | #!/usr/bin/env python
"""Tests for tablib._vendor.dbfpy."""
import datetime as dt
import unittest
from tablib._vendor.dbfpy import utils
class UtilsUnzfillTestCase(unittest.TestCase):
"""dbfpy.utils.unzfill test cases."""
def test_unzfill_with_nul(self):
# Arrange
text = b"abc\0xyz"
... | 171 | 4,082 |
tablib | src/tablib/utils.py | .py | __lazy_modules__ = {"io"}
from io import BytesIO, StringIO
def normalize_input(stream):
"""
Accept either a str/bytes stream or a file-like object and always return a
file-like object.
"""
if isinstance(stream, str):
return StringIO(stream, newline='')
elif isinstance(stream, bytes):
... | 16 | 369 |
tablib | src/tablib/exceptions.py | .py | class TablibException(Exception):
"""Tablib common exception."""
class InvalidDatasetType(TablibException, TypeError):
"""Only Datasets can be added to a Databook."""
class InvalidDimensions(TablibException, ValueError):
"""The size of the column or row doesn't fit the table dimensions."""
class Inval... | 23 | 635 |
tablib | src/tablib/__init__.py | .py | """ Tablib. """
__lazy_modules__ = {"tablib.core"}
try:
# Generated by setuptools-scm.
from ._version import version as __version__
except ImportError:
# Some broken installation.
__version__ = None
from .core import ( # noqa: F401
Databook,
Dataset,
InvalidDatasetType,
InvalidDimen... | 23 | 404 |
tablib | src/tablib/core.py | .py | """
tablib.core
~~~~~~~~~~~
This module implements the central Tablib objects.
:copyright: (c) 2016 by Kenneth Reitz. 2019 Jazzband.
:license: MIT, see LICENSE for more details.
"""
__lazy_modules__ = {
"copy",
"operator",
"tablib.exceptions",
"tablib.utils",
}
from copy import c... | 967 | 28,978 |
tablib | src/tablib/formats/_csv.py | .py | """ Tablib - *SV Support.
"""
__lazy_modules__ = {"csv", "io"}
import csv
from io import StringIO
class CSVFormat:
title = 'csv'
extensions = ('csv',)
DEFAULT_DELIMITER = ','
@classmethod
def export_stream_set(cls, dataset, **kwargs):
"""Returns CSV representation of Dataset as file-li... | 64 | 1,719 |
tablib | src/tablib/formats/_df.py | .py | """ Tablib - DataFrame Support.
"""
try:
from pandas import DataFrame
except ImportError:
DataFrame = None
class DataFrameFormat:
title = 'df'
extensions = ('df',)
@classmethod
def detect(cls, stream):
"""Returns True if given stream is a DataFrame."""
if DataFrame is None:
... | 42 | 1,112 |
tablib | src/tablib/formats/_tsv.py | .py | """ Tablib - TSV (Tab Separated Values) Support.
"""
from ._csv import CSVFormat
class TSVFormat(CSVFormat):
title = 'tsv'
extensions = ('tsv',)
DEFAULT_DELIMITER = '\t'
| 12 | 186 |
tablib | src/tablib/formats/_cli.py | .py | """Tablib - Command-line Interface table export support.
Generates a representation for CLI from the dataset.
Wrapper for tabulate library.
"""
__lazy_modules__ = {"tabulate"}
from tabulate import tabulate as Tabulate
class CLIFormat:
""" Class responsible to export to CLI Format """
title = 'cli'
... | 24 | 645 |
tablib | src/tablib/formats/_ods.py | .py | """ Tablib - ODF Support.
"""
__lazy_modules__ = {"datetime", "io", "numbers"}
import datetime as dt
import numbers
from io import BytesIO
from odf import number, opendocument, style, table, text
import tablib
bold = style.Style(name="bold", family="paragraph")
bold.addElement(style.TextProperties(
fontweight=... | 258 | 8,793 |
tablib | src/tablib/formats/_latex.py | .py | """Tablib - LaTeX table export support.
Generates a LaTeX booktabs-style table from the dataset.
"""
__lazy_modules__ = {"re"}
import re
class LATEXFormat:
title = 'latex'
extensions = ('tex',)
TABLE_TEMPLATE = """\
%% Note: add \\usepackage{booktabs} to your preamble
%%
\\begin{table}[!htbp]
\\c... | 136 | 4,176 |
tablib | src/tablib/formats/_dbf.py | .py | """ Tablib - DBF Support.
"""
__lazy_modules__ = {
"io",
"os",
"tablib._vendor",
"tempfile",
}
import io
import os
import tempfile
from .._vendor.dbfpy import dbf, dbfnew
from .._vendor.dbfpy import record as dbfrecord
class DBFFormat:
title = 'dbf'
extensions = ('csv',)
DEFAULT_ENCODI... | 75 | 2,001 |
tablib | src/tablib/formats/__init__.py | .py | """ Tablib - formats
"""
__lazy_modules__ = {
"functools",
"importlib",
"importlib.util",
"tablib.exceptions",
"tablib.formats._csv",
"tablib.formats._json",
"tablib.formats._tsv",
"tablib.utils",
}
from functools import partialmethod
from importlib import import_module
from importlib.... | 145 | 5,400 |
tablib | src/tablib/formats/_xlsx.py | .py | """ Tablib - XLSX Support.
"""
__lazy_modules__ = {
"io",
"openpyxl",
"openpyxl.reader",
"openpyxl.reader.excel",
"openpyxl.styles",
"openpyxl.utils",
"openpyxl.workbook",
}
import re
from io import BytesIO
from openpyxl.reader.excel import ExcelReader, load_workbook
from openpyxl.styles ... | 219 | 7,228 |
tablib | src/tablib/formats/_yaml.py | .py | """ Tablib - YAML Support.
"""
__lazy_modules__ = {"yaml"}
import yaml
import tablib
class YAMLFormat:
title = 'yaml'
extensions = ('yaml', 'yml')
@classmethod
def export_set(cls, dataset):
"""Returns YAML representation of Dataset."""
return yaml.safe_dump(
dataset._pa... | 66 | 1,649 |
tablib | src/tablib/formats/_xls.py | .py | """ Tablib - XLS Support.
"""
__lazy_modules__ = {"datetime", "io", "xlrd", "xlrd.xldate"}
import datetime
import re
from io import BytesIO
import xlrd
import xlwt
from xlrd.xldate import xldate_as_datetime
import tablib
# special styles
wrap = xlwt.easyxf("alignment: wrap on")
bold = xlwt.easyxf("font: bold on")
... | 185 | 5,631 |
tablib | src/tablib/formats/_rst.py | .py | """ Tablib - reStructuredText Support
"""
__lazy_modules__ = {"itertools", "statistics", "textwrap"}
from itertools import zip_longest
from statistics import median
from textwrap import TextWrapper
JUSTIFY_LEFT = 'left'
JUSTIFY_CENTER = 'center'
JUSTIFY_RIGHT = 'right'
JUSTIFY_VALUES = (JUSTIFY_LEFT, JUSTIFY_CENTER,... | 270 | 9,286 |
tablib | src/tablib/formats/_json.py | .py | """ Tablib - JSON Support
"""
__lazy_modules__ = {"decimal", "json", "uuid"}
import decimal
import json
from uuid import UUID
import tablib
def serialize_objects_handler(obj):
if isinstance(obj, (decimal.Decimal, UUID)):
return str(obj)
elif hasattr(obj, 'isoformat'):
return obj.isoformat()... | 66 | 1,609 |
tablib | src/tablib/formats/_html.py | .py | """ Tablib - HTML export support.
"""
__lazy_modules__ = {"xml", "xml.etree"}
from html.parser import HTMLParser
from xml.etree import ElementTree as ET
class HTMLFormat:
BOOK_ENDINGS = 'h3'
title = 'html'
extensions = ('html', )
@classmethod
def export_set(cls, dataset):
"""HTML repre... | 120 | 3,708 |
tablib | src/tablib/formats/_sql.py | .py | """Tablib - SQL INSERT Export Support."""
__lazy_modules__ = {
"datetime",
"decimal",
"tablib.exceptions",
}
import datetime
import decimal
from ..exceptions import UnsupportedFormat
class SQLFormat:
"""Export Dataset rows as SQL INSERT statements."""
title = 'sql'
extensions = ('sql',)
... | 78 | 2,598 |
tablib | src/tablib/formats/_jira.py | .py | """Tablib - Jira table export support.
Generates a Jira table from the dataset.
"""
class JIRAFormat:
title = 'jira'
@classmethod
def export_set(cls, dataset):
"""Formats the dataset according to the Jira table syntax:
||heading 1||heading 2||heading 3||
|col A1|col A2|col A3... | 41 | 1,087 |
tablib | src/tablib/_vendor/dbfpy/header.py | .py | import datetime
import io
import struct
import sys
from . import fields
from .utils import getDate
__version__ = "$Revision: 1.6 $"[11:-2]
__date__ = "$Date: 2010/09/16 05:06:39 $"[7:-2]
__all__ = ["DbfHeader"]
"""DBF header definition.
TODO:
- handle encoding of the character fields
(encoding information s... | 273 | 9,385 |
tablib | src/tablib/_vendor/dbfpy/utils.py | .py | import datetime
import time
__version__ = "$Revision: 1.4 $"[11:-2]
__date__ = "$Date: 2007/02/11 08:57:17 $"[7:-2]
"""String utilities.
TODO:
- allow strings in getDateTime routine;
"""
"""History (most recent first):
11-feb-2007 [als] added INVALID_VALUE
10-feb-2007 [als] allow date strings padded with spac... | 170 | 4,834 |
tablib | src/tablib/_vendor/dbfpy/fields.py | .py | import datetime
import struct
from functools import total_ordering
from . import utils
__version__ = "$Revision: 1.14 $"[11:-2]
__date__ = "$Date: 2009/05/26 05:16:51 $"[7:-2]
__all__ = ["lookupFor"] # field classes added at the end of the module
"""DBF fields definitions.
TODO:
- make memos work
"""
"""Histor... | 475 | 14,560 |
tablib | src/tablib/_vendor/dbfpy/dbfnew.py | .py | #!/usr/bin/python
__version__ = "$Revision: 1.4 $"[11:-2]
__date__ = "$Date: 2006/07/04 08:18:18 $"[7:-2]
__all__ = ["dbf_new"]
from .dbf import Dbf
from .fields import (
DbfCharacterFieldDef,
DbfDateFieldDef,
DbfDateTimeFieldDef,
DbfLogicalFieldDef,
DbfNumericFieldDef,
)
from .header import DbfH... | 189 | 5,362 |
tablib | src/tablib/_vendor/dbfpy/record.py | .py | import sys
from . import utils
__version__ = "$Revision: 1.7 $"[11:-2]
__date__ = "$Date: 2007/02/11 09:05:49 $"[7:-2]
__all__ = ["DbfRecord"]
"""DBF record definition.
"""
"""History (most recent first):
11-feb-2007 [als] __repr__: added special case for invalid field values
10-feb-2007 [als] added .rawFromS... | 263 | 8,433 |
tablib | src/tablib/_vendor/dbfpy/dbf.py | .py | #! /usr/bin/env python
from . import header, record
from .utils import INVALID_VALUE
__version__ = "$Revision: 1.7 $"[11:-2]
__date__ = "$Date: 2007/02/11 09:23:13 $"[7:-2]
__author__ = "Jeff Kunce <kuncej@mail.conservation.state.mo.us>"
__all__ = ["Dbf"]
"""DBF accessing helpers.
FIXME: more documentation needed
... | 296 | 9,220 |
bazel | combine_distfiles.py | .py | # pylint: disable=g-bad-file-header
# pylint: disable=g-direct-third-party-import
#
# Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
... | 51 | 1,683 |
bazel | third_party/def_parser/def_parser_test.py | .py | # Copyright 2017 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 113 | 4,223 |
bazel | third_party/py/dataclasses/dataclasses/__init__.py | .py | import sys
import copy
import types
import inspect
__all__ = ['dataclass',
'field',
'Field',
'FrozenInstanceError',
'InitVar',
'MISSING',
# Helper functions.
'fields',
'asdict',
'astuple',
'make_dataclass',
... | 1,057 | 40,539 |
bazel | third_party/py/abseil/setup.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 75 | 2,533 |
bazel | third_party/py/abseil/absl/app.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 481 | 15,352 |
bazel | third_party/py/abseil/absl/command_name.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 64 | 2,262 |
bazel | third_party/py/abseil/absl/testing/xml_reporter.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 559 | 21,358 |
bazel | third_party/py/abseil/absl/testing/absltest.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 2,578 | 95,906 |
bazel | third_party/py/abseil/absl/testing/_bazelize_command.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 69 | 2,302 |
bazel | third_party/py/abseil/absl/testing/_pretty_print_reporter.py | .py | # Copyright 2018 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 92 | 3,140 |
bazel | third_party/py/abseil/absl/testing/flagsaver.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 195 | 6,552 |
bazel | third_party/py/abseil/absl/testing/parameterized.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 707 | 27,120 |
bazel | third_party/py/abseil/absl/logging/__init__.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 1,241 | 41,407 |
bazel | third_party/py/abseil/absl/logging/converter.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 215 | 6,353 |
bazel | third_party/py/abseil/absl/flags/_flagvalues.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 1,419 | 51,333 |
bazel | third_party/py/abseil/absl/flags/argparse_flags.py | .py | # Copyright 2018 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 389 | 14,437 |
bazel | third_party/py/abseil/absl/flags/_argument_parser.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 630 | 20,534 |
bazel | third_party/py/abseil/absl/flags/_validators_classes.py | .py | # Copyright 2021 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 173 | 6,157 |
bazel | third_party/py/abseil/absl/flags/_validators.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 353 | 14,144 |
bazel | third_party/py/abseil/absl/flags/__init__.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 224 | 7,665 |
bazel | third_party/py/abseil/absl/flags/_exceptions.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 109 | 3,657 |
bazel | third_party/py/abseil/absl/flags/_flag.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 489 | 17,271 |
bazel | third_party/py/abseil/absl/flags/_helpers.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 402 | 13,430 |
bazel | third_party/py/abseil/absl/flags/_defines.py | .py | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 928 | 31,800 |
bazel | third_party/py/frozendict/frozendict/__init__.py | .py | import collections
import operator
import functools
import sys
try:
from collections import OrderedDict
except ImportError: # python < 2.7
OrderedDict = NotImplemented
iteritems = getattr(dict, 'iteritems', dict.items) # py2-3 compatibility
class frozendict(collections.abc.Mapping):
"""
An immuta... | 65 | 1,507 |
bazel | third_party/py/concurrent/__init__.py | .py | from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
| 4 | 76 |
bazel | third_party/py/concurrent/futures/process.py | .py | # Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Implements ProcessPoolExecutor.
The follow diagram and text describe the data-flow through the system:
|======================= In-process =====================|== Out-of-process ==|
+----------+ +----------... | 346 | 14,324 |
bazel | third_party/py/concurrent/futures/_compat.py | .py | from keyword import iskeyword as _iskeyword
from operator import itemgetter as _itemgetter
import sys as _sys
def namedtuple(typename, field_names):
"""Returns a new subclass of tuple with named fields.
>>> Point = namedtuple('Point', 'x y')
>>> Point.__doc__ # docstring for the new cla... | 102 | 4,645 |
bazel | third_party/py/concurrent/futures/_base.py | .py | # Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
from __future__ import with_statement
import functools
import logging
import threading
import time
try:
from collections import namedtuple
except ImportError:
from third_party.py.concurrent.futures._compat im... | 576 | 19,681 |
bazel | third_party/py/concurrent/futures/__init__.py | .py | # Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Execute computations asynchronously using threads or processes."""
__author__ = 'Brian Quinlan (brian@sweetapp.com)'
from third_party.py.concurrent.futures._base import (FIRST_COMPLETED,
... | 19 | 965 |
bazel | third_party/py/concurrent/futures/thread.py | .py | # Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Implements ThreadPoolExecutor."""
from __future__ import with_statement
import atexit
import threading
import weakref
import sys
from third_party.py.concurrent.futures import _base
try:
import queue
except I... | 145 | 4,810 |
bazel | third_party/py/mock/setup.py | .py | #! /usr/bin/env python
# Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
from mock import __version__
import os
NAME = 'mock'
MODULES = ['mock']
DESCRIPTION = 'A Python Mocking and Patching Library for Testing'
URL = "... | 73 | 2,134 |
bazel | third_party/py/mock/__init__.py | .py | # mock.py
# Test tools for mocking and patching.
# Copyright (C) 2007-2012 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# mock 1.0
# http://www.voidspace.org.uk/python/mock/
# Released subject to the BSD License
# Please see http://www.voidspace.org.uk/python/license.shtml
# Scripts m... | 2,368 | 75,527 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.