text
stringlengths
0
20k
""" ELF file parser. This provides a class ``ELFFile`` that parses an ELF executable in a similar interface to ``ZipFile``. Only the read interface is implemented. Based on: https://gist.github.com/lyssdod/f51579ae8d93c8657a5564aefc2ffbca ELF header: https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.eheader.html ""...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. """ .. testsetup:: from packaging.version import parse, Version """ from __future__ import annotations import itertools import re fro...
####################################################################################### # # Adapted from: # https://github.com/pypa/hatch/blob/5352e44/backend/src/hatchling/licenses/parse.py # # MIT License # # Copyright (c) 2017-present Ofek Lev <oss@ofek.dev> # # Permission is hereby granted, free of charge, to any ...
"""Handwritten parser of dependency specifiers. The docstring for each __parse_* function contains EBNF-inspired grammar representing the implementation. """ from __future__ import annotations import ast from typing import NamedTuple, Sequence, Tuple, Union from ._tokenizer import DEFAULT_RULES, Tokenizer class N...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import annotations import operator import os import platform import sys from typing import AbstractSet, Any, Callable, Lit...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. __title__ = "packaging" __summary__ = "Core utilities for Python packages" __uri__ = "https://github.com/pypa/packaging" __version__ = "25...
from __future__ import annotations import contextlib import re from dataclasses import dataclass from typing import Iterator, NoReturn from .specifiers import Specifier @dataclass class Token: name: str text: str position: int class ParserSyntaxError(Exception): """The provided source text could n...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import annotations from typing import Any, Iterator from ._parser import parse_requirement as _parse_requirement from ._to...
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. class InfinityType: def __repr__(self) -> str: return "Infinity" def __hash__(self) -> int: return hash(repr(self...
"""PEP 656 support. This module implements logic to detect if the currently running Python is linked against musl, and what musl version is used. """ from __future__ import annotations import functools import re import subprocess import sys from typing import Iterator, NamedTuple, Sequence from ._elffile import ELF...
import os import types from collections.abc import MutableSequence from functools import total_ordering __version__ = "1.8.0" __all__ = ("FrozenList", "PyFrozenList") # type: Tuple[str, ...] NO_EXTENSIONS = bool(os.environ.get("FROZENLIST_NO_EXTENSIONS")) # type: bool @total_ordering class FrozenList(MutableSeq...
# cython: freethreading_compatible = True # distutils: language = c++ from cpython.bool cimport PyBool_FromLong from libcpp.atomic cimport atomic import copy import types from collections.abc import MutableSequence cdef class FrozenList: __class_getitem__ = classmethod(types.GenericAlias) cdef atomic[bint]...
VERSION = "3.6.0" #: Deprecated, will be removed in the next major release VERSION_TUPLE = (3, 6, 0)
from ._xxhash import ( xxh32, xxh32_digest, xxh32_intdigest, xxh32_hexdigest, xxh64, xxh64_digest, xxh64_intdigest, xxh64_hexdigest, xxh3_64, xxh3_64_digest, xxh3_64_intdigest, xxh3_64_hexdigest, xxh3_128, xxh3_128_digest, xxh3_128_intdigest, xxh3_128_hexd...
#!/usr/bin/env python # # Author: Mike McKerns (mmckerns @caltech and @uqfoundation) # Copyright (c) 2022-2025 The Uncertainty Quantification Foundation. # License: 3-clause BSD. The full license text is available at: # - https://github.com/uqfoundation/multiprocess/blob/master/LICENSE from _multiprocessing import *...
SHELL_NAMES = ( {"sh", "bash", "dash", "ash"} # Bourne. | {"csh", "tcsh"} # C. | {"ksh", "zsh", "fish"} # Common alternatives. | {"cmd", "powershell", "pwsh"} # Microsoft. | {"elvish", "xonsh", "nu"} # More exotic. ) class ShellDetectionFailure(EnvironmentError): pass
import io import os import re import sys from ._core import Process # FreeBSD: https://www.freebsd.org/cgi/man.cgi?query=procfs # NetBSD: https://man.netbsd.org/NetBSD-9.3-STABLE/mount_procfs.8 # DragonFlyBSD: https://www.dragonflybsd.org/cgi/web-man?command=procfs BSD_STAT_PPID = 2 # See https://docs.kernel.org/fil...
import collections Process = collections.namedtuple("Process", "args pid ppid")
import os import re from .._core import SHELL_NAMES, ShellDetectionFailure from . import proc, ps # Based on QEMU docs: https://www.qemu.org/docs/master/user/main.html QEMU_BIN_REGEX = re.compile( r"""qemu- (alpha |armeb |arm |m68k |cris |i386 |x86_64 ...
import errno import subprocess import sys from ._core import Process class PsNotAvailable(EnvironmentError): pass def iter_process_parents(pid, max_depth=10): """Try to look up the process tree via the output of `ps`.""" try: cmd = ["ps", "-ww", "-o", "pid=", "-o", "ppid=", "-o", "args="] ...
import importlib import os from ._core import ShellDetectionFailure __version__ = "1.5.4" def detect_shell(pid=None, max_depth=10): name = os.name try: impl = importlib.import_module(".{}".format(name), __name__) except ImportError: message = "Shell detection not implemented for {0!r}".f...
import contextlib import ctypes import os from ctypes.wintypes import ( BOOL, CHAR, DWORD, HANDLE, LONG, LPWSTR, MAX_PATH, PDWORD, ULONG, ) from shellingham._core import SHELL_NAMES INVALID_HANDLE_VALUE = HANDLE(-1).value ERROR_NO_MORE_FILES = 18 ERROR_INSUFFICIENT_BUFFER = 122 T...
Copyright 2014 Pallets Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistribution...
# coding: utf-8 """ webencodings.x_user_defined ~~~~~~~~~~~~~~~~~~~~~~~~~~~ An implementation of the x-user-defined encoding. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ from __future__ import unicode_literals import codecs ### Codec APIs class Code...
# coding: utf-8 """ webencodings.tests ~~~~~~~~~~~~~~~~~~ A basic test suite for Encoding. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ from __future__ import unicode_literals from . import (lookup, LABELS, decode, encode, iter_decode, iter_encode, ...
""" webencodings.labels ~~~~~~~~~~~~~~~~~~~ Map encoding labels to their name. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ # XXX Do not edit! # This file is automatically generated by mklabels.py LABELS = { 'unicode-1-1-utf-8': 'utf-8', 'utf-...
# coding: utf-8 """ webencodings ~~~~~~~~~~~~ This is a Python implementation of the `WHATWG Encoding standard <http://encoding.spec.whatwg.org/>`. See README for details. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ from __future__ import unicode_li...
""" webencodings.mklabels ~~~~~~~~~~~~~~~~~~~~~ Regenarate the webencodings.labels module. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ import json try: from urllib import urlopen except ImportError: from urllib.request import urlopen def asser...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
""" Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ import argparse import sy...
""" This module exists only to simplify retrieving the version number of chardet from within setuptools and from chardet subpackages. :author: Dan Blanchard (dan.blanchard@gmail.com) """ __version__ = "5.1.0" VERSION = __version__.split(".")
######################## BEGIN LICENSE BLOCK ######################## # # Contributor(s): # Jason Zavaglia # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the ...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
""" All of the Enums that are used throughout the chardet package. :author: Dan Blanchard (dan.blanchard@gmail.com) """ from enum import Enum, Flag class InputState: """ This enum represents the different states a universal detector can be in. """ PURE_ASCII = 0 ESC_ASCII = 1 HIGH_BYTE = 2 ...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
######################## BEGIN LICENSE BLOCK ######################## # This code was modified from latin1prober.py by Rob Speer <rob@lumino.so>. # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
from typing import TYPE_CHECKING, Tuple if TYPE_CHECKING: # TypedDict was introduced in Python 3.8. # # TODO: Remove the else block and TYPE_CHECKING check when dropping support # for Python 3.7. from typing import TypedDict class CodingStateMachineDict(TypedDict, total=False): class_t...
######################## BEGIN LICENSE BLOCK ######################## # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later ve...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
from typing import TYPE_CHECKING, Optional if TYPE_CHECKING: # TypedDict was introduced in Python 3.8. # # TODO: Remove the else block and TYPE_CHECKING check when dropping support # for Python 3.7. from typing import TypedDict class ResultDict(TypedDict): encoding: Optional[str] ...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
""" Metadata about languages used by our model training code for our SingleByteCharSetProbers. Could be used for other things in the future. This code is based on the language metadata from the uchardet project. """ from string import ascii_letters from typing import List, Optional # TODO: Add Ukrainian (KOI8-U) ...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
from .distro import ( NORMALIZED_DISTRO_ID, NORMALIZED_LSB_ID, NORMALIZED_OS_ID, LinuxDistribution, __version__, build_number, codename, distro_release_attr, distro_release_info, id, info, like, linux_distribution, lsb_release_attr, lsb_release_info, major...
from .distro import main if __name__ == "__main__": main()
""" 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...
""" 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...
# .-. .-. .-. . . .-. .-. .-. .-. # |( |- |.| | | |- `-. | `-. # ' ' `-' `-`.`-' `-' `-' ' `-' __title__ = "requests" __description__ = "Python HTTP for Humans." __url__ = "https://requests.readthedocs.io" __version__ = "2.31.0" __build__ = 0x023100 __author__ = "Kenneth Reitz" __author_email__ = "me@kennethrei...
""" 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 #:...
""" 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 ...
""" 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...
"""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: ...
""" 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...
#!/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...
""" 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...
# __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ 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 >...
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...
""" 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_...
""" 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...
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/'] ...
# actions.py from .exceptions import ParseException from .util import col, replaced_by_pep8 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)...
# common.py from .core import * from .helpers import DelimitedList, 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 b...
# 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 = ...
# 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...
# util.py import inspect import warnings import types import collections import itertools from functools import lru_cache, wraps from typing import Callable, List, Union, Iterable, TypeVar, cast _bslash = chr(92) C = TypeVar("C", bound=Callable) class __config_flags: """Internal class for defining compatibility ...
# exceptions.py import re import sys import typing from .util import ( col, line, lineno, _collapse_string_to_ranges, replaced_by_pep8, ) from .unicode import pyparsing_unicode as ppu class ExceptionWordUnicode(ppu.Latin1, ppu.LatinA, ppu.LatinB, ppu.Greek, ppu.Cyrillic): pass _extract_alp...
# 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: """ ...
""" pygments.regexopt ~~~~~~~~~~~~~~~~~ An algorithm that generates optimized regexes for matching long lists of literal strings. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from re import escape from os.path import ...
""" pygments.token ~~~~~~~~~~~~~~ Basic token types and the standard tokens. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ class _TokenType(tuple): parent = None def split(self): buf = [] node = self ...
""" pygments.console ~~~~~~~~~~~~~~~~ Format colored console output. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ esc = "\x1b[" codes = {} codes[""] = "" codes["reset"] = esc + "39;49;00m" codes["bold"] = esc + "01m" codes["faint...
""" pygments.modeline ~~~~~~~~~~~~~~~~~ A simple modeline parser (based on pymodeline). :copyright: Copyright 2006-2023 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...
""" 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`. ...
""" pygments.sphinxext ~~~~~~~~~~~~~~~~~~ Sphinx extension to generate automatic documentation of lexers, formatters and filters. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys from docutils import nodes from docutils...
""" pygments.filter ~~~~~~~~~~~~~~~ Module that implements the default filter. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ def apply_filters(stream, filters, lexer=None): """ Use this method to apply an iterable of filter...
""" Pygments ~~~~~~~~ Pygments is a syntax highlighting package written in Python. It is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code. Highlights are: * a wide range of common lan...
""" pygments.style ~~~~~~~~~~~~~~ Basic style object. :copyright: Copyright 2006-2023 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 ...
""" pygments.formatters.terminal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for terminal output with ANSI sequences. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pip._vendor.pygments.formatter import Formatter from pip._vendor.pyg...
""" pygments.formatters.pangomarkup ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for Pango markup output. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pip._vendor.pygments.formatter import Formatter __all__ = ['PangoMarkupForma...
""" pygments.formatters.bbcode ~~~~~~~~~~~~~~~~~~~~~~~~~~ BBcode formatter. :copyright: Copyright 2006-2023 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_bool_opt __al...
""" pygments.formatters.latex ~~~~~~~~~~~~~~~~~~~~~~~~~ Formatter for LaTeX fancyvrb output. :copyright: Copyright 2006-2023 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...
""" pygments.formatters.svg ~~~~~~~~~~~~~~~~~~~~~~~ Formatter for SVG output. :copyright: Copyright 2006-2023 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...