code stringlengths 0 21.5M | repo_name stringlengths 4 92 | path stringlengths 1 189 | language stringlengths 0 26 | license stringclasses 11
values | size int64 0 21.5M |
|---|---|---|---|---|---|
"""
pygments.formatters.groff
~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for groff output.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import math
from pip._vendor.pygments.formatter import Formatter
from pip._vendor.pygments.util import... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/formatters/groff.py | Python | mit | 5,086 |
"""
pygments.formatters.html
~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for HTML output.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import functools
import os
import sys
import os.path
from io import StringIO
from pip._vendor.pygments.f... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/formatters/html.py | Python | mit | 35,441 |
"""
pygments.formatters.img
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for Pixmap output.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import sys
from pip._vendor.pygments.formatter import Formatter
from pip._vendor.pygments.util... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/formatters/img.py | Python | mit | 21,938 |
"""
pygments.formatters.irc
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for IRC output
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pip._vendor.pygments.formatter import Formatter
from pip._vendor.pygments.token import Keyword, Name, Co... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/formatters/irc.py | Python | mit | 5,871 |
"""
pygments.formatters.latex
~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for LaTeX fancyvrb output.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from io import StringIO
from pip._vendor.pygments.formatter import Formatter
from pip._vendo... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/formatters/latex.py | Python | mit | 19,351 |
"""
pygments.formatters.other
~~~~~~~~~~~~~~~~~~~~~~~~~
Other formatters: NullFormatter, RawTokenFormatter.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pip._vendor.pygments.formatter import Formatter
from pip._vendor.pygments... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/formatters/other.py | Python | mit | 5,073 |
"""
pygments.formatters.pangomarkup
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for Pango markup output.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pip._vendor.pygments.formatter import Formatter
__all__ = ['PangoMarkupForma... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/formatters/pangomarkup.py | Python | mit | 2,212 |
"""
pygments.formatters.rtf
~~~~~~~~~~~~~~~~~~~~~~~
A formatter that generates RTF files.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pip._vendor.pygments.formatter import Formatter
from pip._vendor.pygments.util import get_i... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/formatters/rtf.py | Python | mit | 5,014 |
"""
pygments.formatters.svg
~~~~~~~~~~~~~~~~~~~~~~~
Formatter for SVG output.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pip._vendor.pygments.formatter import Formatter
from pip._vendor.pygments.token import Comment
from pip... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/formatters/svg.py | Python | mit | 7,335 |
"""
pygments.formatters.terminal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for terminal output with ANSI sequences.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pip._vendor.pygments.formatter import Formatter
from pip._vendor.pyg... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/formatters/terminal.py | Python | mit | 4,674 |
"""
pygments.formatters.terminal256
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for 256-color terminal output with ANSI sequences.
RGB-to-XTERM color conversion routines adapted from xterm256-conv
tool (http://frexx.de/xterm-256-notes/data/xterm256-conv2.tar.bz2)
by Wolfgang Frisch.
Formatt... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/formatters/terminal256.py | Python | mit | 11,753 |
"""
pygments.lexer
~~~~~~~~~~~~~~
Base lexer classes.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import time
from pip._vendor.pygments.filter import apply_filters, Filter
from pip._vendor.pygments.filters im... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/lexer.py | Python | mit | 32,005 |
"""
pygments.lexers
~~~~~~~~~~~~~~~
Pygments lexers.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import sys
import types
from fnmatch import fnmatch
from os.path import basename
from pip._vendor.pygments.lexers._mapping... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/lexers/__init__.py | Python | mit | 11,174 |
# Automatically generated by scripts/gen_mapfiles.py.
# DO NOT EDIT BY HAND; run `make mapfiles` instead.
LEXERS = {
'ABAPLexer': ('pip._vendor.pygments.lexers.business', 'ABAP', ('abap',), ('*.abap', '*.ABAP'), ('text/x-abap',)),
'AMDGPULexer': ('pip._vendor.pygments.lexers.amdgpu', 'AMDGPU', ('amdgpu',), ('*... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py | Python | mit | 70,232 |
"""
pygments.lexers.python
~~~~~~~~~~~~~~~~~~~~~~
Lexers for Python and related languages.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import keyword
from pip._vendor.pygments.lexer import Lexer, RegexLexer, include, by... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/lexers/python.py | Python | mit | 53,376 |
"""
pygments.modeline
~~~~~~~~~~~~~~~~~
A simple modeline parser (based on pymodeline).
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
__all__ = ['get_filetype_from_buffer']
modeline_re = re.compile(r'''
(?: vi | vim... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/modeline.py | Python | mit | 986 |
"""
pygments.plugin
~~~~~~~~~~~~~~~
Pygments plugin interface. By default, this tries to use
``importlib.metadata``, which is in the Python standard
library since Python 3.8, or its ``importlib_metadata``
backport for earlier versions of Python. It falls back on
``pkg_resources`` if not fou... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/plugin.py | Python | mit | 2,591 |
"""
pygments.regexopt
~~~~~~~~~~~~~~~~~
An algorithm that generates optimized regexes for matching long lists of
literal strings.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from re import escape
from os.path import ... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/regexopt.py | Python | mit | 3,072 |
"""
pygments.scanner
~~~~~~~~~~~~~~~~
This library implements a regex based scanner. Some languages
like Pascal are easy to parse but have some keywords that
depend on the context. Because of this it's impossible to lex
that just by using a regular expression lexer like the
`RegexLexer`.
... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/scanner.py | Python | mit | 3,092 |
"""
pygments.sphinxext
~~~~~~~~~~~~~~~~~~
Sphinx extension to generate automatic documentation of lexers,
formatters and filters.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import sys
from docutils import nodes
from docutils... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/sphinxext.py | Python | mit | 4,630 |
"""
pygments.style
~~~~~~~~~~~~~~
Basic style object.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pip._vendor.pygments.token import Token, STANDARD_TYPES
# Default mapping of ansixxx to RGB colors.
_ansimap = {
# dark
... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/style.py | Python | mit | 6,257 |
"""
pygments.styles
~~~~~~~~~~~~~~~
Contains built-in styles.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pip._vendor.pygments.plugin import find_plugin_styles
from pip._vendor.pygments.util import ClassNotFound
#: Maps sty... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/styles/__init__.py | Python | mit | 3,419 |
"""
pygments.token
~~~~~~~~~~~~~~
Basic token types and the standard tokens.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
class _TokenType(tuple):
parent = None
def split(self):
buf = []
node = self
... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/token.py | Python | mit | 6,184 |
"""
pygments.util
~~~~~~~~~~~~~
Utility functions.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from io import TextIOWrapper
split_path_re = re.compile(r'[/\\ ]')
doctype_lookup_re = re.compile(r'''
<!DOCTYPE\s+(
... | castiel248/Convert | Lib/site-packages/pip/_vendor/pygments/util.py | Python | mit | 9,110 |
# module pyparsing.py
#
# Copyright (c) 2003-2022 Paul T. McGuire
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, cop... | castiel248/Convert | Lib/site-packages/pip/_vendor/pyparsing/__init__.py | Python | mit | 9,171 |
# actions.py
from .exceptions import ParseException
from .util import col
class OnlyOnce:
"""
Wrapper for parse actions, to ensure they are only called once.
"""
def __init__(self, method_call):
from .core import _trim_arity
self.callable = _trim_arity(method_call)
self.call... | castiel248/Convert | Lib/site-packages/pip/_vendor/pyparsing/actions.py | Python | mit | 6,426 |
# common.py
from .core import *
from .helpers import delimited_list, any_open_tag, any_close_tag
from datetime import datetime
# some other useful expressions - using lower-case class name since we are really using this as a namespace
class pyparsing_common:
"""Here are some common low-level expressions that may ... | castiel248/Convert | Lib/site-packages/pip/_vendor/pyparsing/common.py | Python | mit | 12,936 |
#
# core.py
#
import os
import typing
from typing import (
NamedTuple,
Union,
Callable,
Any,
Generator,
Tuple,
List,
TextIO,
Set,
Sequence,
)
from abc import ABC, abstractmethod
from enum import Enum
import string
import copy
import warnings
import re
import sys
from collections.... | castiel248/Convert | Lib/site-packages/pip/_vendor/pyparsing/core.py | Python | mit | 213,344 |
import railroad
from pip._vendor import pyparsing
import typing
from typing import (
List,
NamedTuple,
Generic,
TypeVar,
Dict,
Callable,
Set,
Iterable,
)
from jinja2 import Template
from io import StringIO
import inspect
jinja2_template_source = """\
<!DOCTYPE html>
<html>
<head>
{... | castiel248/Convert | Lib/site-packages/pip/_vendor/pyparsing/diagram/__init__.py | Python | mit | 23,685 |
# exceptions.py
import re
import sys
import typing
from .util import col, line, lineno, _collapse_string_to_ranges
from .unicode import pyparsing_unicode as ppu
class ExceptionWordUnicode(ppu.Latin1, ppu.LatinA, ppu.LatinB, ppu.Greek, ppu.Cyrillic):
pass
_extract_alphanums = _collapse_string_to_ranges(Excepti... | castiel248/Convert | Lib/site-packages/pip/_vendor/pyparsing/exceptions.py | Python | mit | 9,023 |
# helpers.py
import html.entities
import re
import typing
from . import __diag__
from .core import *
from .util import _bslash, _flatten, _escape_regex_range_chars
#
# global helpers
#
def delimited_list(
expr: Union[str, ParserElement],
delim: Union[str, ParserElement] = ",",
combine: bool = False,
... | castiel248/Convert | Lib/site-packages/pip/_vendor/pyparsing/helpers.py | Python | mit | 39,129 |
# results.py
from collections.abc import MutableMapping, Mapping, MutableSequence, Iterator
import pprint
from weakref import ref as wkref
from typing import Tuple, Any
str_type: Tuple[type, ...] = (str, bytes)
_generator_type = type((_ for _ in ()))
class _ParseResultsWithOffset:
__slots__ = ["tup"]
def __... | castiel248/Convert | Lib/site-packages/pip/_vendor/pyparsing/results.py | Python | mit | 25,341 |
# testing.py
from contextlib import contextmanager
import typing
from .core import (
ParserElement,
ParseException,
Keyword,
__diag__,
__compat__,
)
class pyparsing_test:
"""
namespace class for classes useful in writing unit tests
"""
class reset_pyparsing_context:
"""
... | castiel248/Convert | Lib/site-packages/pip/_vendor/pyparsing/testing.py | Python | mit | 13,402 |
# unicode.py
import sys
from itertools import filterfalse
from typing import List, Tuple, Union
class _lazyclassproperty:
def __init__(self, fn):
self.fn = fn
self.__doc__ = fn.__doc__
self.__name__ = fn.__name__
def __get__(self, obj, cls):
if cls is None:
cls = ... | castiel248/Convert | Lib/site-packages/pip/_vendor/pyparsing/unicode.py | Python | mit | 10,787 |
# util.py
import warnings
import types
import collections
import itertools
from functools import lru_cache
from typing import List, Union, Iterable
_bslash = chr(92)
class __config_flags:
"""Internal class for defining compatibility and debugging flags"""
_all_names: List[str] = []
_fixed_names: List[st... | castiel248/Convert | Lib/site-packages/pip/_vendor/pyparsing/util.py | Python | mit | 6,805 |
# __
# /__) _ _ _ _ _/ _
# / ( (- (/ (/ (- _) / _)
# /
"""
Requests HTTP Library
~~~~~~~~~~~~~~~~~~~~~
Requests is an HTTP library, written in Python, for human beings.
Basic GET usage:
>>> import requests
>>> r = requests.get('https://www.python.org')
>>> r.status_code
200
>... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/__init__.py | Python | mit | 5,178 |
# .-. .-. .-. . . .-. .-. .-. .-.
# |( |- |.| | | |- `-. | `-.
# ' ' `-' `-`.`-' `-' `-' ' `-'
__title__ = "requests"
__description__ = "Python HTTP for Humans."
__url__ = "https://requests.readthedocs.io"
__version__ = "2.28.1"
__build__ = 0x022801
__author__ = "Kenneth Reitz"
__author_email__ = "me@kennethrei... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/__version__.py | Python | mit | 440 |
"""
requests._internal_utils
~~~~~~~~~~~~~~
Provides utility functions that are consumed internally by Requests
which depend on extremely few external helpers (such as compat)
"""
import re
from .compat import builtin_str
_VALID_HEADER_NAME_RE_BYTE = re.compile(rb"^[^:\s][^:\r\n]*$")
_VALID_HEADER_NAME_RE_STR = re.c... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/_internal_utils.py | Python | mit | 1,397 |
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import os.path
import socket # noqa: F401
from pip._vendor.urllib3.exceptions import ClosedPoolError, ConnectTimeoutError
from pip._vendor.urllib3.exceptions import HTTPErro... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/adapters.py | Python | mit | 21,443 |
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:param method: method for the ... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/api.py | Python | mit | 6,377 |
"""
requests.auth
~~~~~~~~~~~~~
This module contains the authentication handlers for Requests.
"""
import hashlib
import os
import re
import threading
import time
import warnings
from base64 import b64encode
from ._internal_utils import to_native_string
from .compat import basestring, str, urlparse
from .cookies imp... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/auth.py | Python | mit | 10,187 |
#!/usr/bin/env python
"""
requests.certs
~~~~~~~~~~~~~~
This module returns the preferred default CA certificate bundle. There is
only one — the one from the certifi package.
If you are packaging Requests, e.g., for a Linux distribution or a managed
environment, you can change the definition of where() to return a s... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/certs.py | Python | mit | 575 |
"""
requests.compat
~~~~~~~~~~~~~~~
This module previously handled import compatibility issues
between Python 2 and Python 3. It remains for backwards
compatibility until the next major version.
"""
from pip._vendor import chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#:... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/compat.py | Python | mit | 1,286 |
"""
requests.cookies
~~~~~~~~~~~~~~~~
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import calendar
import copy
import time
from ._internal_utils import to_native_string
from .compat import Morsel, MutableMapping, cookieli... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/cookies.py | Python | mit | 18,560 |
"""
requests.exceptions
~~~~~~~~~~~~~~~~~~~
This module contains the set of Requests' exceptions.
"""
from pip._vendor.urllib3.exceptions import HTTPError as BaseHTTPError
from .compat import JSONDecodeError as CompatJSONDecodeError
class RequestException(IOError):
"""There was an ambiguous exception that occur... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/exceptions.py | Python | mit | 3,823 |
"""Module containing bug report helper(s)."""
import json
import platform
import ssl
import sys
from pip._vendor import idna
from pip._vendor import urllib3
from . import __version__ as requests_version
charset_normalizer = None
try:
from pip._vendor import chardet
except ImportError:
chardet = None
try:
... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/help.py | Python | mit | 3,879 |
"""
requests.hooks
~~~~~~~~~~~~~~
This module provides the capabilities for the Requests hooks system.
Available hooks:
``response``:
The response generated from a Request.
"""
HOOKS = ["response"]
def default_hooks():
return {event: [] for event in HOOKS}
# TODO: response is the only one
def dispatch_... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/hooks.py | Python | mit | 733 |
"""
requests.models
~~~~~~~~~~~~~~~
This module contains the primary objects that power Requests.
"""
import datetime
# Import encoding now, to avoid implicit import later.
# Implicit import within threads may cause LookupError when standard library is in a ZIP,
# such as in Embedded Python. See https://github.com/p... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/models.py | Python | mit | 35,287 |
import sys
# This code exists for backwards compatibility reasons.
# I don't like it either. Just look the other way. :)
for package in ('urllib3', 'idna', 'chardet'):
vendored_package = "pip._vendor." + package
locals()[package] = __import__(vendored_package)
# This traversal is apparently necessary such... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/packages.py | Python | mit | 695 |
"""
requests.sessions
~~~~~~~~~~~~~~~~~
This module provides a Session object to manage and persist settings across
requests (cookies, auth, proxies).
"""
import os
import sys
import time
from collections import OrderedDict
from datetime import timedelta
from ._internal_utils import to_native_string
from .adapters im... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/sessions.py | Python | mit | 30,180 |
r"""
The ``codes`` object defines a mapping from common names for HTTP statuses
to their numerical codes, accessible either as attributes or as dictionary
items.
Example::
>>> import requests
>>> requests.codes['temporary_redirect']
307
>>> requests.codes.teapot
418
>>> requests.codes['\o/']
... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/status_codes.py | Python | mit | 4,235 |
"""
requests.structures
~~~~~~~~~~~~~~~~~~~
Data structures that power Requests.
"""
from collections import OrderedDict
from .compat import Mapping, MutableMapping
class CaseInsensitiveDict(MutableMapping):
"""A case-insensitive ``dict``-like object.
Implements all methods and operations of
``Mutable... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/structures.py | Python | mit | 2,912 |
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import codecs
import contextlib
import io
import os
import re
import socket
import struct
import sys
import tempfile
import warnings
import zipfile
from collections... | castiel248/Convert | Lib/site-packages/pip/_vendor/requests/utils.py | Python | mit | 33,240 |
__all__ = [
"__version__",
"AbstractProvider",
"AbstractResolver",
"BaseReporter",
"InconsistentCandidate",
"Resolver",
"RequirementsConflicted",
"ResolutionError",
"ResolutionImpossible",
"ResolutionTooDeep",
]
__version__ = "0.8.1"
from .providers import AbstractProvider, Ab... | castiel248/Convert | Lib/site-packages/pip/_vendor/resolvelib/__init__.py | Python | mit | 537 |
castiel248/Convert | Lib/site-packages/pip/_vendor/resolvelib/compat/__init__.py | Python | mit | 0 | |
__all__ = ["Mapping", "Sequence"]
try:
from collections.abc import Mapping, Sequence
except ImportError:
from collections import Mapping, Sequence
| castiel248/Convert | Lib/site-packages/pip/_vendor/resolvelib/compat/collections_abc.py | Python | mit | 156 |
class AbstractProvider(object):
"""Delegate class to provide requirement interface for the resolver."""
def identify(self, requirement_or_candidate):
"""Given a requirement, return an identifier for it.
This is used to identify a requirement, e.g. whether two requirements
should have t... | castiel248/Convert | Lib/site-packages/pip/_vendor/resolvelib/providers.py | Python | mit | 5,872 |
class BaseReporter(object):
"""Delegate class to provider progress reporting for the resolver."""
def starting(self):
"""Called before the resolution actually starts."""
def starting_round(self, index):
"""Called before each round of resolution starts.
The index is zero-based.
... | castiel248/Convert | Lib/site-packages/pip/_vendor/resolvelib/reporters.py | Python | mit | 1,583 |
import collections
import operator
from .providers import AbstractResolver
from .structs import DirectedGraph, IteratorMapping, build_iter_view
RequirementInformation = collections.namedtuple(
"RequirementInformation", ["requirement", "parent"]
)
class ResolverException(Exception):
"""A base class for all e... | castiel248/Convert | Lib/site-packages/pip/_vendor/resolvelib/resolvers.py | Python | mit | 17,592 |
import itertools
from .compat import collections_abc
class DirectedGraph(object):
"""A graph structure with directed edges."""
def __init__(self):
self._vertices = set()
self._forwards = {} # <key> -> Set[<key>]
self._backwards = {} # <key> -> Set[<key>]
def __iter__(self):
... | castiel248/Convert | Lib/site-packages/pip/_vendor/resolvelib/structs.py | Python | mit | 4,794 |
"""Rich text and beautiful formatting in the terminal."""
import os
from typing import IO, TYPE_CHECKING, Any, Callable, Optional, Union
from ._extension import load_ipython_extension # noqa: F401
__all__ = ["get_console", "reconfigure", "print", "inspect"]
if TYPE_CHECKING:
from .console import Console
# Glo... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/__init__.py | Python | mit | 5,944 |
import colorsys
import io
from time import process_time
from pip._vendor.rich import box
from pip._vendor.rich.color import Color
from pip._vendor.rich.console import Console, ConsoleOptions, Group, RenderableType, RenderResult
from pip._vendor.rich.markdown import Markdown
from pip._vendor.rich.measure import Measure... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/__main__.py | Python | mit | 8,808 |
# Auto generated by make_terminal_widths.py
CELL_WIDTHS = [
(0, 0, 0),
(1, 31, -1),
(127, 159, -1),
(768, 879, 0),
(1155, 1161, 0),
(1425, 1469, 0),
(1471, 1471, 0),
(1473, 1474, 0),
(1476, 1477, 0),
(1479, 1479, 0),
(1552, 1562, 0),
(1611, 1631, 0),
(1648, 1648, 0),... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_cell_widths.py | Python | mit | 10,096 |
EMOJI = {
"1st_place_medal": "🥇",
"2nd_place_medal": "🥈",
"3rd_place_medal": "🥉",
"ab_button_(blood_type)": "🆎",
"atm_sign": "🏧",
"a_button_(blood_type)": "🅰",
"afghanistan": "🇦🇫",
"albania": "🇦🇱",
"algeria": "🇩🇿",
"american_samoa": "🇦🇸",
"andorra": "🇦🇩",
... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_emoji_codes.py | Python | mit | 140,235 |
from typing import Callable, Match, Optional
import re
from ._emoji_codes import EMOJI
_ReStringMatch = Match[str] # regex match object
_ReSubCallable = Callable[[_ReStringMatch], str] # Callable invoked by re.sub
_EmojiSubMethod = Callable[[_ReSubCallable, str], str] # Sub method of a compiled re
def _emoji_re... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_emoji_replace.py | Python | mit | 1,064 |
CONSOLE_HTML_FORMAT = """\
<!DOCTYPE html>
<head>
<meta charset="UTF-8">
<style>
{stylesheet}
body {{
color: {foreground};
background-color: {background};
}}
</style>
</head>
<html>
<body>
<code>
<pre style="font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace">{code}</pre>
</co... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_export_format.py | Python | mit | 2,114 |
from typing import Any
def load_ipython_extension(ip: Any) -> None: # pragma: no cover
# prevent circular import
from pip._vendor.rich.pretty import install
from pip._vendor.rich.traceback import install as tr_install
install()
tr_install()
| castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_extension.py | Python | mit | 265 |
from __future__ import absolute_import
import inspect
from inspect import cleandoc, getdoc, getfile, isclass, ismodule, signature
from typing import Any, Collection, Iterable, Optional, Tuple, Type, Union
from .console import Group, RenderableType
from .control import escape_control_codes
from .highlighter import Rep... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_inspect.py | Python | mit | 9,695 |
from datetime import datetime
from typing import Iterable, List, Optional, TYPE_CHECKING, Union, Callable
from .text import Text, TextType
if TYPE_CHECKING:
from .console import Console, ConsoleRenderable, RenderableType
from .table import Table
FormatTimeCallable = Callable[[datetime], Text]
class LogRen... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_log_render.py | Python | mit | 3,225 |
from typing import Iterable, Tuple, TypeVar
T = TypeVar("T")
def loop_first(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
"""Iterate and generate a tuple with a flag for first value."""
iter_values = iter(values)
try:
value = next(iter_values)
except StopIteration:
return
yiel... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_loop.py | Python | mit | 1,236 |
from .palette import Palette
# Taken from https://en.wikipedia.org/wiki/ANSI_escape_code (Windows 10 column)
WINDOWS_PALETTE = Palette(
[
(12, 12, 12),
(197, 15, 31),
(19, 161, 14),
(193, 156, 0),
(0, 55, 218),
(136, 23, 152),
(58, 150, 221),
(204, 2... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_palettes.py | Python | mit | 7,063 |
from typing import Optional
def pick_bool(*values: Optional[bool]) -> bool:
"""Pick the first non-none bool or return the last value.
Args:
*values (bool): Any number of boolean or None values.
Returns:
bool: First non-none boolean.
"""
assert values, "1 or more values required"
... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_pick.py | Python | mit | 423 |
import sys
from fractions import Fraction
from math import ceil
from typing import cast, List, Optional, Sequence
if sys.version_info >= (3, 8):
from typing import Protocol
else:
from pip._vendor.typing_extensions import Protocol # pragma: no cover
class Edge(Protocol):
"""Any object that defines an edg... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_ratio.py | Python | mit | 5,472 |
"""
Spinners are from:
* cli-spinners:
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software withou... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_spinners.py | Python | mit | 19,919 |
from typing import List, TypeVar
T = TypeVar("T")
class Stack(List[T]):
"""A small shim over builtin list."""
@property
def top(self) -> T:
"""Get top of stack."""
return self[-1]
def push(self, item: T) -> None:
"""Push an item on to the stack (append in stack nomenclature)... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_stack.py | Python | mit | 351 |
"""
Timer context manager, only used in debug.
"""
from time import time
import contextlib
from typing import Generator
@contextlib.contextmanager
def timer(subject: str = "time") -> Generator[None, None, None]:
"""print the elapsed time. (only used in debugging)"""
start = time()
yield
elapsed = t... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_timer.py | Python | mit | 417 |
"""Light wrapper around the Win32 Console API - this module should only be imported on Windows
The API that this module wraps is documented at https://docs.microsoft.com/en-us/windows/console/console-functions
"""
import ctypes
import sys
from typing import Any
windll: Any = None
if sys.platform == "win32":
windl... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_win32_console.py | Python | mit | 22,820 |
import sys
from dataclasses import dataclass
@dataclass
class WindowsConsoleFeatures:
"""Windows features available."""
vt: bool = False
"""The console supports VT codes."""
truecolor: bool = False
"""The console supports truecolor."""
try:
import ctypes
from ctypes import LibraryLoader... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_windows.py | Python | mit | 1,926 |
from typing import Iterable, Sequence, Tuple, cast
from pip._vendor.rich._win32_console import LegacyWindowsTerm, WindowsCoordinates
from pip._vendor.rich.segment import ControlCode, ControlType, Segment
def legacy_windows_render(buffer: Iterable[Segment], term: LegacyWindowsTerm) -> None:
"""Makes appropriate W... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_windows_renderer.py | Python | mit | 2,783 |
import re
from typing import Iterable, List, Tuple
from ._loop import loop_last
from .cells import cell_len, chop_cells
re_word = re.compile(r"\s*\S+\s*")
def words(text: str) -> Iterable[Tuple[int, int, str]]:
position = 0
word_match = re_word.match(text, position)
while word_match is not None:
... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/_wrap.py | Python | mit | 1,840 |
from abc import ABC
class RichRenderable(ABC):
"""An abstract base class for Rich renderables.
Note that there is no need to extend this class, the intended use is to check if an
object supports the Rich renderable protocol. For example::
if isinstance(my_object, RichRenderable):
con... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/abc.py | Python | mit | 890 |
import sys
from itertools import chain
from typing import TYPE_CHECKING, Iterable, Optional
if sys.version_info >= (3, 8):
from typing import Literal
else:
from pip._vendor.typing_extensions import Literal # pragma: no cover
from .constrain import Constrain
from .jupyter import JupyterMixin
from .measure imp... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/align.py | Python | mit | 10,368 |
import re
import sys
from contextlib import suppress
from typing import Iterable, NamedTuple, Optional
from .color import Color
from .style import Style
from .text import Text
re_ansi = re.compile(
r"""
(?:\x1b\](.*?)\x1b\\)|
(?:\x1b([(@-Z\\-_]|\[[0-?]*[ -/]*[@-~]))
""",
re.VERBOSE,
)
class _AnsiToken(Named... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/ansi.py | Python | mit | 6,820 |
from typing import Optional, Union
from .color import Color
from .console import Console, ConsoleOptions, RenderResult
from .jupyter import JupyterMixin
from .measure import Measurement
from .segment import Segment
from .style import Style
# There are left-aligned characters for 1/8 to 7/8, but
# the right-aligned ch... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/bar.py | Python | mit | 3,264 |
import sys
from typing import TYPE_CHECKING, Iterable, List
if sys.version_info >= (3, 8):
from typing import Literal
else:
from pip._vendor.typing_extensions import Literal # pragma: no cover
from ._loop import loop_last
if TYPE_CHECKING:
from pip._vendor.rich.console import ConsoleOptions
class Box... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/box.py | Python | mit | 9,864 |
import re
from functools import lru_cache
from typing import Callable, List
from ._cell_widths import CELL_WIDTHS
# Regex to match sequence of the most common character ranges
_is_single_cell_widths = re.compile("^[\u0020-\u006f\u00a0\u02ff\u0370-\u0482]*$").match
@lru_cache(4096)
def cached_cell_len(text: str) -> ... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/cells.py | Python | mit | 4,503 |
import platform
import re
from colorsys import rgb_to_hls
from enum import IntEnum
from functools import lru_cache
from typing import TYPE_CHECKING, NamedTuple, Optional, Tuple
from ._palettes import EIGHT_BIT_PALETTE, STANDARD_PALETTE, WINDOWS_PALETTE
from .color_triplet import ColorTriplet
from .repr import Result, ... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/color.py | Python | mit | 17,957 |
from typing import NamedTuple, Tuple
class ColorTriplet(NamedTuple):
"""The red, green, and blue components of a color."""
red: int
"""Red component in 0 to 255 range."""
green: int
"""Green component in 0 to 255 range."""
blue: int
"""Blue component in 0 to 255 range."""
@property
... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/color_triplet.py | Python | mit | 1,054 |
from collections import defaultdict
from itertools import chain
from operator import itemgetter
from typing import Dict, Iterable, List, Optional, Tuple
from .align import Align, AlignMethod
from .console import Console, ConsoleOptions, RenderableType, RenderResult
from .constrain import Constrain
from .measure import... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/columns.py | Python | mit | 7,131 |
import inspect
import io
import os
import platform
import sys
import threading
import zlib
from abc import ABC, abstractmethod
from dataclasses import dataclass, field
from datetime import datetime
from functools import wraps
from getpass import getpass
from html import escape
from inspect import isclass
from itertools... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/console.py | Python | mit | 95,885 |
from typing import Optional, TYPE_CHECKING
from .jupyter import JupyterMixin
from .measure import Measurement
if TYPE_CHECKING:
from .console import Console, ConsoleOptions, RenderableType, RenderResult
class Constrain(JupyterMixin):
"""Constrain the width of a renderable to a given number of characters.
... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/constrain.py | Python | mit | 1,288 |
from itertools import zip_longest
from typing import (
Iterator,
Iterable,
List,
Optional,
Union,
overload,
TypeVar,
TYPE_CHECKING,
)
if TYPE_CHECKING:
from .console import (
Console,
ConsoleOptions,
JustifyMethod,
OverflowMethod,
RenderResult... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/containers.py | Python | mit | 5,497 |
import sys
import time
from typing import TYPE_CHECKING, Callable, Dict, Iterable, List, Union
if sys.version_info >= (3, 8):
from typing import Final
else:
from pip._vendor.typing_extensions import Final # pragma: no cover
from .segment import ControlCode, ControlType, Segment
if TYPE_CHECKING:
from .c... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/control.py | Python | mit | 6,630 |
from typing import Dict
from .style import Style
DEFAULT_STYLES: Dict[str, Style] = {
"none": Style.null(),
"reset": Style(
color="default",
bgcolor="default",
dim=False,
bold=False,
italic=False,
underline=False,
blink=False,
blink2=False,
... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/default_styles.py | Python | mit | 7,954 |
import os
import platform
from pip._vendor.rich import inspect
from pip._vendor.rich.console import Console, get_windows_console_features
from pip._vendor.rich.panel import Panel
from pip._vendor.rich.pretty import Pretty
def report() -> None: # pragma: no cover
"""Print a report to the terminal with debugging ... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/diagnose.py | Python | mit | 972 |
import sys
from typing import TYPE_CHECKING, Optional, Union
from .jupyter import JupyterMixin
from .segment import Segment
from .style import Style
from ._emoji_codes import EMOJI
from ._emoji_replace import _emoji_replace
if sys.version_info >= (3, 8):
from typing import Literal
else:
from pip._vendor.typin... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/emoji.py | Python | mit | 2,501 |
class ConsoleError(Exception):
"""An error in console operation."""
class StyleError(Exception):
"""An error in styles."""
class StyleSyntaxError(ConsoleError):
"""Style was badly formatted."""
class MissingStyle(StyleError):
"""No such style."""
class StyleStackError(ConsoleError):
"""Style... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/errors.py | Python | mit | 642 |
import io
from typing import IO, TYPE_CHECKING, Any, List
from .ansi import AnsiDecoder
from .text import Text
if TYPE_CHECKING:
from .console import Console
class FileProxy(io.TextIOBase):
"""Wraps a file (e.g. sys.stdout) and redirects writes to a console."""
def __init__(self, console: "Console", fi... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/file_proxy.py | Python | mit | 1,616 |
# coding: utf-8
"""Functions for reporting filesizes. Borrowed from https://github.com/PyFilesystem/pyfilesystem2
The functions declared in this module should cover the different
usecases needed to generate a string representation of a file size
using several different units. Since there are many standards regarding
f... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/filesize.py | Python | mit | 2,507 |
import re
from abc import ABC, abstractmethod
from typing import List, Union
from .text import Span, Text
def _combine_regex(*regexes: str) -> str:
"""Combine a number of regexes in to a single regex.
Returns:
str: New regex with all regexes ORed together.
"""
return "|".join(regexes)
clas... | castiel248/Convert | Lib/site-packages/pip/_vendor/rich/highlighter.py | Python | mit | 9,585 |