text
stringlengths
0
20k
# Expose a limited set of classes and functions so callers outside of # the vcs package don't need to import deeper than `pip._internal.vcs`. # (The test directory may still need to import from a vcs sub-package.) # Import all vcs modules to register each VCS in the VcsSupport object. import pip._internal.vcs.bazaar im...
from typing import Optional from pip._internal.distributions.base import AbstractDistribution from pip._internal.index.package_finder import PackageFinder from pip._internal.metadata import BaseDistribution class InstalledDistribution(AbstractDistribution): """Represents an installed package. This does not ...
import abc from typing import Optional from pip._internal.index.package_finder import PackageFinder from pip._internal.metadata.base import BaseDistribution from pip._internal.req import InstallRequirement class AbstractDistribution(metaclass=abc.ABCMeta): """A base class for handling installable artifacts. ...
from pip._internal.distributions.base import AbstractDistribution from pip._internal.distributions.sdist import SourceDistribution from pip._internal.distributions.wheel import WheelDistribution from pip._internal.req.req_install import InstallRequirement def make_distribution_for_install_requirement( install_req...
import logging from typing import Iterable, Optional, Set, Tuple from pip._internal.build_env import BuildEnvironment from pip._internal.distributions.base import AbstractDistribution from pip._internal.exceptions import InstallationError from pip._internal.index.package_finder import PackageFinder from pip._internal....
from typing import Optional from pip._vendor.packaging.utils import canonicalize_name from pip._internal.distributions.base import AbstractDistribution from pip._internal.index.package_finder import PackageFinder from pip._internal.metadata import ( BaseDistribution, FilesystemWheel, get_wheel_distributio...
from typing import Callable, List, Optional from pip._internal.req.req_install import InstallRequirement from pip._internal.req.req_set import RequirementSet InstallRequirementProvider = Callable[ [str, Optional[InstallRequirement]], InstallRequirement ] class BaseResolver: def resolve( self, root_r...
"""Utilities to lazily create and visit candidates found. Creating and visiting a candidate is a *very* costly operation. It involves fetching, extracting, potentially building modules from source, and verifying distribution metadata. It is therefore crucial for performance to keep everything here lazy all the way dow...
import contextlib import functools import logging import os from typing import TYPE_CHECKING, Dict, List, Optional, Set, Tuple, cast from pip._vendor.packaging.utils import canonicalize_name from pip._vendor.resolvelib import BaseReporter, ResolutionImpossible from pip._vendor.resolvelib import Resolver as RLResolver ...
from typing import FrozenSet, Iterable, Optional, Tuple, Union from pip._vendor.packaging.specifiers import SpecifierSet from pip._vendor.packaging.utils import NormalizedName from pip._vendor.packaging.version import LegacyVersion, Version from pip._internal.models.link import Link, links_equivalent from pip._intern...
from pip._vendor.packaging.specifiers import SpecifierSet from pip._vendor.packaging.utils import NormalizedName, canonicalize_name from pip._internal.req.constructors import install_req_drop_extras from pip._internal.req.req_install import InstallRequirement from .base import Candidate, CandidateLookup, Requirement,...
from collections import defaultdict from logging import getLogger from typing import Any, DefaultDict from pip._vendor.resolvelib.reporters import BaseReporter from .base import Candidate, Requirement logger = getLogger(__name__) class PipReporter(BaseReporter): def __init__(self) -> None: self.reject_...
import collections import math from typing import ( TYPE_CHECKING, Dict, Iterable, Iterator, Mapping, Sequence, TypeVar, Union, ) from pip._vendor.resolvelib.providers import AbstractProvider from .base import Candidate, Constraint, Requirement from .candidates import REQUIRES_PYTHON_I...
from typing import List, Optional from pip._internal.utils import _log # init_logging() must be called before any call to logging.getLogger() # which happens at import of most modules. _log.init_logging() def main(args: (Optional[List[str]]) = None) -> int: """This is preserved for old console scripts that may ...
"""Backing implementation for InstallRequirement's various constructors The idea here is that these formed a major chunk of InstallRequirement's size so, moving them and support code dedicated to them outside of that class helps creates for better understandability for the rest of the code. These are meant to be used...
import collections import logging from typing import Generator, List, Optional, Sequence, Tuple from pip._internal.utils.logging import indent_log from .req_file import parse_requirements from .req_install import InstallRequirement from .req_set import RequirementSet __all__ = [ "RequirementSet", "InstallReq...
import logging from collections import OrderedDict from typing import Dict, List from pip._vendor.packaging.specifiers import LegacySpecifier from pip._vendor.packaging.utils import canonicalize_name from pip._vendor.packaging.version import LegacyVersion from pip._internal.req.req_install import InstallRequirement f...
""" Requirements file parsing """ import logging import optparse import os import re import shlex import urllib.parse from optparse import Values from typing import ( TYPE_CHECKING, Any, Callable, Dict, Generator, Iterable, List, Optional, Tuple, ) from pip._internal.cli import cmd...
"""Build Environment used for isolation during sdist building """ import logging import os import pathlib import site import sys import textwrap from collections import OrderedDict from types import TracebackType from typing import TYPE_CHECKING, Iterable, List, Optional, Set, Tuple, Type, Union from pip._vendor.cert...
"""Orchestrator for building wheels from InstallRequirements. """ import logging import os.path import re import shutil from typing import Iterable, List, Optional, Tuple from pip._vendor.packaging.utils import canonicalize_name, canonicalize_version from pip._vendor.packaging.version import InvalidVersion, Version ...
import importlib.util import os from collections import namedtuple from typing import Any, List, Optional from pip._vendor import tomli from pip._vendor.packaging.requirements import InvalidRequirement, Requirement from pip._internal.exceptions import ( InstallationError, InvalidPyProjectBuildRequires, Mi...
import email.message import importlib.metadata import os import pathlib import zipfile from typing import ( Collection, Dict, Iterable, Iterator, Mapping, Optional, Sequence, cast, ) from pip._vendor.packaging.requirements import Requirement from pip._vendor.packaging.utils import Norma...
from ._dists import Distribution from ._envs import Environment __all__ = ["NAME", "Distribution", "Environment"] NAME = "importlib"
import importlib.metadata from typing import Any, Optional, Protocol, cast class BadMetadata(ValueError): def __init__(self, dist: importlib.metadata.Distribution, *, reason: str) -> None: self.dist = dist self.reason = reason def __str__(self) -> str: return f"Bad metadata in {self.d...
import functools import importlib.metadata import logging import os import pathlib import sys import zipfile import zipimport from typing import Iterator, List, Optional, Sequence, Set, Tuple from pip._vendor.packaging.utils import NormalizedName, canonicalize_name from pip._internal.metadata.base import BaseDistribu...
# Extracted from https://github.com/pfmoore/pkg_metadata from email.header import Header, decode_header, make_header from email.message import Message from typing import Any, Dict, List, Union METADATA_FIELDS = [ # Name, Multiple-Use ("Metadata-Version", False), ("Name", False), ("Version", False), ...
import contextlib import functools import os import sys from typing import TYPE_CHECKING, List, Optional, Type, cast from pip._internal.utils.misc import strtobool from .base import BaseDistribution, BaseEnvironment, FilesystemWheel, MemoryWheel, Wheel if TYPE_CHECKING: from typing import Literal, Protocol else:...
import email.message import email.parser import logging import os import zipfile from typing import Collection, Iterable, Iterator, List, Mapping, NamedTuple, Optional from pip._vendor import pkg_resources from pip._vendor.packaging.requirements import Requirement from pip._vendor.packaging.utils import NormalizedName...
"""Configuration management setup Some terminology: - name As written in config files. - value Value associated with a name - key Name combined with it's section (section.name) - variant A single word describing where the configuration key-value pair came from """ import configparser import locale import os i...
from typing import List, Optional def main(args: Optional[List[str]] = None) -> int: """This is preserved for old console scripts that may still be referencing it. For additional details, see https://github.com/pypa/pip/issues/7498. """ from pip._internal.utils.entrypoints import _wrapper re...
"""Execute exactly this copy of pip, within a different environment. This file is named as it is, to ensure that this module can't be imported via an import statement. """ # /!\ This version compatibility check section must be Python 2 compatible. /!\ import sys # Copied from setup.py PYTHON_REQUIRES = (3, 7) def...
from typing import List, Optional __version__ = "24.0" def main(args: Optional[List[str]] = None) -> int: """This is an internal API only meant for use by pip's own console scripts. For additional details, see https://github.com/pypa/pip/issues/7498. """ from pip._internal.utils.entrypoints import _...
import os import sys # Remove '' and current working directory from the first entry # of sys.path, if present to avoid using current directory # in pip commands check, freeze, install, list and show, # when invoked as python -m pip <command> if sys.path[0] in ("", os.getcwd()): sys.path.pop(0) # If we are running...
"""Client middleware support.""" from collections.abc import Awaitable, Callable, Sequence from .client_reqrep import ClientRequest, ClientResponse __all__ = ("ClientMiddlewareType", "ClientHandlerType", "build_client_middlewares") # Type alias for client request handlers - functions that process requests and retur...
import re from typing import TYPE_CHECKING, Tuple, Type, TypeVar from .typedefs import Handler, Middleware from .web_exceptions import HTTPMove, HTTPPermanentRedirect from .web_request import Request from .web_response import StreamResponse from .web_urldispatcher import SystemRoute __all__ = ( "middleware", ...
import asyncio import sys import zlib from concurrent.futures import Executor from typing import Any, Final, Optional, Protocol, TypedDict, cast if sys.version_info >= (3, 12): from collections.abc import Buffer else: from typing import Union Buffer = Union[bytes, bytearray, "memoryview[int]", "memoryview...
import warnings from typing import Any, Dict, Iterable, List, Optional, Set # noqa from yarl import URL from .typedefs import LooseHeaders, StrOrURL from .web_response import Response __all__ = ( "HTTPException", "HTTPError", "HTTPRedirection", "HTTPSuccessful", "HTTPOk", "HTTPCreated", ...
import abc import os # noqa from typing import ( TYPE_CHECKING, Any, Callable, Dict, Iterator, List, Optional, Sequence, Type, Union, overload, ) import attr from . import hdrs from .abc import AbstractView from .typedefs import Handler, PathLike if TYPE_CHECKING: fro...
import logging access_logger = logging.getLogger("aiohttp.access") client_logger = logging.getLogger("aiohttp.client") internal_logger = logging.getLogger("aiohttp.internal") server_logger = logging.getLogger("aiohttp.server") web_logger = logging.getLogger("aiohttp.web") ws_logger = logging.getLogger("aiohttp.websock...
import asyncio import socket import weakref from typing import Any, Dict, Final, List, Optional, Tuple, Type, Union from .abc import AbstractResolver, ResolveResult __all__ = ("ThreadedResolver", "AsyncResolver", "DefaultResolver") try: import aiodns aiodns_default = hasattr(aiodns.DNSResolver, "getaddrinf...
""" Payload implementation for coroutines as data provider. As a simple case, you can upload data from file:: @aiohttp.streamer async def file_sender(writer, file_name=None): with open(file_name, 'rb') as f: chunk = f.read(2**16) while chunk: await writer.write(chunk) ...
"""WebSocket client for asyncio.""" import asyncio import sys from types import TracebackType from typing import Any, Optional, Type, cast import attr from ._websocket.reader import WebSocketDataQueue from .client_exceptions import ClientError, ServerTimeoutError, WSMessageTypeError from .client_reqrep import Client...
import asyncio import logging import warnings from functools import lru_cache, partial, update_wrapper from typing import ( TYPE_CHECKING, Any, AsyncIterator, Awaitable, Callable, Dict, Iterable, Iterator, List, Mapping, MutableMapping, Optional, Sequence, Tuple, ...
""" Internal cookie handling helpers. This module contains internal utilities for cookie parsing and manipulation. These are not part of the public API and may change without notice. """ import re from http.cookies import Morsel from typing import List, Optional, Sequence, Tuple, cast from .log import internal_logge...
"""Http related parsers and protocol.""" import asyncio import sys from typing import ( # noqa TYPE_CHECKING, Any, Awaitable, Callable, Iterable, List, NamedTuple, Optional, Union, ) from multidict import CIMultiDict from .abc import AbstractStreamWriter from .base_protocol impor...
import asyncio from contextlib import suppress from typing import Any, Optional, Tuple, Union from .base_protocol import BaseProtocol from .client_exceptions import ( ClientConnectionError, ClientOSError, ClientPayloadError, ServerDisconnectedError, SocketTimeoutError, ) from .helpers import ( ...
import io import warnings from typing import Any, Iterable, List, Optional from urllib.parse import urlencode from multidict import MultiDict, MultiDictProxy from . import hdrs, multipart, payload from .helpers import guess_filename from .payload import Payload __all__ = ("FormData",) class FormData: """Helper...
"""Helper methods to tune a TCP connection""" import asyncio import socket from contextlib import suppress from typing import Optional # noqa __all__ = ("tcp_keepalive", "tcp_nodelay") if hasattr(socket, "SO_KEEPALIVE"): def tcp_keepalive(transport: asyncio.Transport) -> None: sock = transport.get_ext...
from cpython.bytes cimport PyBytes_FromStringAndSize from cpython.exc cimport PyErr_NoMemory from cpython.mem cimport PyMem_Free, PyMem_Malloc, PyMem_Realloc from cpython.object cimport PyObject_Str from libc.stdint cimport uint8_t, uint64_t from libc.string cimport memcpy from multidict import istr DEF BUF_SIZE = 16...
"""Low-level http related exceptions.""" from textwrap import indent from typing import Optional, Union from .typedefs import _CIMultiDict __all__ = ("HttpProcessingError",) class HttpProcessingError(Exception): """HTTP error. Shortcut for raising HTTP errors with custom code, message and headers. co...
import asyncio import io import os import pathlib import sys from contextlib import suppress from enum import Enum, auto from mimetypes import MimeTypes from stat import S_ISREG from types import MappingProxyType from typing import ( # noqa IO, TYPE_CHECKING, Any, Awaitable, Callable, Final, ...
import asyncio from typing import Optional, cast from .client_exceptions import ClientConnectionResetError from .helpers import set_exception from .tcp_helpers import tcp_nodelay class BaseProtocol(asyncio.Protocol): __slots__ = ( "_loop", "_paused", "_drain_waiter", "_connection_...
"""WebSocket protocol versions 13 and 8.""" from ._websocket.helpers import WS_KEY, ws_ext_gen, ws_ext_parse from ._websocket.models import ( WS_CLOSED_MESSAGE, WS_CLOSING_MESSAGE, WebSocketError, WSCloseCode, WSHandshakeError, WSMessage, WSMsgType, ) from ._websocket.reader import WebSocke...
import sys from http import HTTPStatus from typing import Mapping, Tuple from . import __version__ from .http_exceptions import HttpProcessingError as HttpProcessingError from .http_parser import ( HeadersParser as HeadersParser, HttpParser as HttpParser, HttpRequestParser as HttpRequestParser, HttpRes...
""" Digest authentication middleware for aiohttp client. This middleware implements HTTP Digest Authentication according to RFC 7616, providing a more secure alternative to Basic Authentication. It supports all standard hash algorithms including MD5, SHA, SHA-256, SHA-512 and their session variants, as well as both 'a...
import datetime import functools import logging import os import re import time as time_mod from collections import namedtuple from typing import Any, Callable, Dict, Iterable, List, Tuple # noqa from .abc import AbstractAccessLogger from .web_request import BaseRequest from .web_response import StreamResponse KeyMe...
"""HTTP related errors.""" import asyncio import warnings from typing import TYPE_CHECKING, Optional, Tuple, Union from multidict import MultiMapping from .typedefs import StrOrURL if TYPE_CHECKING: import ssl SSLContext = ssl.SSLContext else: try: import ssl SSLContext = ssl.SSLContex...
import asyncio import contextlib import inspect import warnings from typing import ( Any, Awaitable, Callable, Dict, Iterator, Optional, Protocol, Union, overload, ) import pytest from .test_utils import ( BaseTestServer, RawTestServer, TestClient, TestServer, l...
import asyncio import logging import socket from abc import ABC, abstractmethod from collections.abc import Sized from http.cookies import BaseCookie, Morsel from typing import ( TYPE_CHECKING, Any, Awaitable, Callable, Dict, Generator, Iterable, List, Optional, Sequence, Tup...
import asyncio import signal import socket import warnings from abc import ABC, abstractmethod from typing import TYPE_CHECKING, Any, List, Optional, Set from yarl import URL from .typedefs import PathLike from .web_app import Application from .web_server import Server if TYPE_CHECKING: from ssl import SSLContex...
import asyncio import calendar import contextlib import datetime import heapq import itertools import os # noqa import pathlib import pickle import re import time import warnings from collections import defaultdict from collections.abc import Mapping from http.cookies import BaseCookie, Morsel, SimpleCookie from typin...
from types import SimpleNamespace from typing import TYPE_CHECKING, Mapping, Optional, Type, TypeVar import attr from aiosignal import Signal from multidict import CIMultiDict from yarl import URL from .client_reqrep import ClientResponse if TYPE_CHECKING: from .client import ClientSession _ParamT_contra = ...
__version__ = "3.13.2" from typing import TYPE_CHECKING, Tuple from . import hdrs as hdrs from .client import ( BaseConnector, ClientConnectionError, ClientConnectionResetError, ClientConnectorCertificateError, ClientConnectorDNSError, ClientConnectorError, ClientConnectorSSLError, Cli...
"""Low level HTTP server.""" import asyncio from typing import Any, Awaitable, Callable, Dict, List, Optional # noqa from .abc import AbstractStreamWriter from .http_parser import RawRequestMessage from .streams import StreamReader from .web_protocol import RequestHandler, _RequestFactory, _RequestHandler from .web_...
"""Async gunicorn worker for aiohttp.web""" import asyncio import inspect import os import re import signal import sys from types import FrameType from typing import TYPE_CHECKING, Any, Optional from gunicorn.config import AccessLogFormat as GunicornAccessLogFormat from gunicorn.workers import base from aiohttp impo...
import asyncio import logging import os import socket import sys import warnings from argparse import ArgumentParser from collections.abc import Iterable from contextlib import suppress from importlib import import_module from typing import ( TYPE_CHECKING, Any, Awaitable, Callable, Iterable as Typi...
import json import os from typing import ( TYPE_CHECKING, Any, Awaitable, Callable, Iterable, Mapping, Protocol, Tuple, Union, ) from multidict import CIMultiDict, CIMultiDictProxy, MultiDict, MultiDictProxy, istr from yarl import URL, Query as _Query Query = _Query DEFAULT_JSON_E...
"""HTTP Headers constants.""" # After changing the file content call ./tools/gen.py # to regenerate the headers parser import itertools from typing import Final, Set from multidict import istr METH_ANY: Final[str] = "*" METH_CONNECT: Final[str] = "CONNECT" METH_HEAD: Final[str] = "HEAD" METH_GET: Final[str] = "GET" ...
"""Reader for WebSocket protocol versions 13 and 8.""" from typing import TYPE_CHECKING from ..helpers import NO_EXTENSIONS if TYPE_CHECKING or NO_EXTENSIONS: # pragma: no cover from .reader_py import ( WebSocketDataQueue as WebSocketDataQueuePython, WebSocketReader as WebSocketReaderPython, ...
"""Helpers for WebSocket protocol versions 13 and 8.""" import functools import re from struct import Struct from typing import TYPE_CHECKING, Final, List, Optional, Pattern, Tuple from ..helpers import NO_EXTENSIONS from .models import WSHandshakeError UNPACK_LEN3 = Struct("!Q").unpack_from UNPACK_CLOSE_CODE = Stru...
"""Models for WebSocket protocol versions 13 and 8.""" import json from enum import IntEnum from typing import Any, Callable, Final, NamedTuple, Optional, cast WS_DEFLATE_TRAILING: Final[bytes] = bytes([0x00, 0x00, 0xFF, 0xFF]) class WSCloseCode(IntEnum): OK = 1000 GOING_AWAY = 1001 PROTOCOL_ERROR = 100...
"""WebSocket protocol versions 13 and 8.""" import asyncio import random import sys from functools import partial from typing import Final, Optional, Set, Union from ..base_protocol import BaseProtocol from ..client_exceptions import ClientConnectionResetError from ..compression_utils import ZLibBackend, ZLibCompress...
from cpython cimport PyBytes_AsString #from cpython cimport PyByteArray_AsString # cython still not exports that cdef extern from "Python.h": char* PyByteArray_AsString(bytearray ba) except NULL from libc.stdint cimport uint32_t, uint64_t, uintmax_t cpdef void _websocket_mask_cython(bytes mask, bytearray data)...
"""Reader for WebSocket protocol versions 13 and 8.""" import asyncio import builtins from collections import deque from typing import Deque, Final, Optional, Set, Tuple, Union from ..base_protocol import BaseProtocol from ..compression_utils import ZLibDecompressor from ..helpers import _EXC_SENTINEL, set_exception ...
"""WebSocket protocol versions 13 and 8."""
"""Reader for WebSocket protocol versions 13 and 8.""" import asyncio import builtins from collections import deque from typing import Deque, Final, Optional, Set, Tuple, Union from ..base_protocol import BaseProtocol from ..compression_utils import ZLibDecompressor from ..helpers import _EXC_SENTINEL, set_exception ...
''' Reference tzinfo implementations from the Python docs. Used for testing against as they are only correct for the years 1987 to 2006. Do not use these for real code. ''' from datetime import tzinfo, timedelta, datetime from pytz import HOUR, ZERO, UTC __all__ = [ 'FixedOffset', 'LocalTimezone', 'USTime...
'''Base classes and helpers for building zone specific tzinfo classes''' from datetime import datetime, timedelta, tzinfo from bisect import bisect_right try: set except NameError: from sets import Set as set import pytz from pytz.exceptions import AmbiguousTimeError, NonExistentTimeError __all__ = [] _time...
from threading import RLock try: from collections.abc import Mapping as DictMixin except ImportError: # Python < 3.3 try: from UserDict import DictMixin # Python 2 except ImportError: # Python 3.0-3.3 from collections import Mapping as DictMixin # With lazy loading, we might end up with...
''' Custom exceptions raised by pytz. ''' __all__ = [ 'UnknownTimeZoneError', 'InvalidTimeError', 'AmbiguousTimeError', 'NonExistentTimeError', ] class Error(Exception): '''Base class for all exceptions raised by the pytz library''' class UnknownTimeZoneError(KeyError, Error): '''Exception raised w...
''' $Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $ ''' from datetime import datetime from struct import unpack, calcsize from pytz.tzinfo import StaticTzInfo, DstTzInfo, memorized_ttinfo from pytz.tzinfo import memorized_datetime, memorized_timedelta def _byte_string(s): """Cast a string or byte string t...
dill
# This module contains abstractions for the input stream. You don't have to # looks further, there are no pretty code. # # We define two classes here. # # Mark(source, line, column) # It's just a record and its only use is producing nice error messages. # Parser does not use it for any other purposes. # # Reader(so...
__all__ = ['BaseDumper', 'SafeDumper', 'Dumper'] from .emitter import * from .serializer import * from .representer import * from .resolver import * class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): def __init__(self, stream, default_style=None, default_flow_style=False, ...
__all__ = ['BaseResolver', 'Resolver'] from .error import * from .nodes import * import re class ResolverError(YAMLError): pass class BaseResolver: DEFAULT_SCALAR_TAG = 'tag:yaml.org,2002:str' DEFAULT_SEQUENCE_TAG = 'tag:yaml.org,2002:seq' DEFAULT_MAPPING_TAG = 'tag:yaml.org,2002:map' yaml_im...
__all__ = ['BaseRepresenter', 'SafeRepresenter', 'Representer', 'RepresenterError'] from .error import * from .nodes import * import datetime, copyreg, types, base64, collections class RepresenterError(YAMLError): pass class BaseRepresenter: yaml_representers = {} yaml_multi_representers = {} ...
__all__ = ['Serializer', 'SerializerError'] from .error import YAMLError from .events import * from .nodes import * class SerializerError(YAMLError): pass class Serializer: ANCHOR_TEMPLATE = 'id%03d' def __init__(self, encoding=None, explicit_start=None, explicit_end=None, version=None, ta...
class Token(object): def __init__(self, start_mark, end_mark): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in self.__dict__ if not key.endswith('_mark')] attributes.sort() arguments = ', '.join(['%s=...
__all__ = ['BaseLoader', 'FullLoader', 'SafeLoader', 'Loader', 'UnsafeLoader'] from .reader import * from .scanner import * from .parser import * from .composer import * from .constructor import * from .resolver import * class BaseLoader(Reader, Scanner, Parser, Composer, BaseConstructor, BaseResolver): def __i...
from .error import * from .tokens import * from .events import * from .nodes import * from .loader import * from .dumper import * __version__ = '6.0.3' try: from .cyaml import * __with_libyaml__ = True except ImportError: __with_libyaml__ = False import io #--------------------------------------------...
__all__ = [ 'CBaseLoader', 'CSafeLoader', 'CFullLoader', 'CUnsafeLoader', 'CLoader', 'CBaseDumper', 'CSafeDumper', 'CDumper' ] from yaml._yaml import CParser, CEmitter from .constructor import * from .serializer import * from .representer import * from .resolver import * class CBaseLoader(CParser, BaseCon...
__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError'] class Mark: def __init__(self, name, index, line, column, buffer, pointer): self.name = name self.index = index self.line = line self.column = column self.buffer = buffer self.pointer = pointer def get_snippet...
# Abstract classes. class Event(object): def __init__(self, start_mark=None, end_mark=None): self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): attributes = [key for key in ['anchor', 'tag', 'implicit', 'value'] if hasattr(self, key)] argu...
class Node(object): def __init__(self, tag, value, start_mark, end_mark): self.tag = tag self.value = value self.start_mark = start_mark self.end_mark = end_mark def __repr__(self): value = self.value #if isinstance(value, list): # if len(value) == 0: ...
__all__ = ['Composer', 'ComposerError'] from .error import MarkedYAMLError from .events import * from .nodes import * class ComposerError(MarkedYAMLError): pass class Composer: def __init__(self): self.anchors = {} def check_node(self): # Drop the STREAM-START event. if self.ch...
"""Public API of the property caching library.""" from ._helpers import cached_property, under_cached_property __all__ = ( "cached_property", "under_cached_property", )
import os import sys from typing import TYPE_CHECKING __all__ = ("cached_property", "under_cached_property") NO_EXTENSIONS = bool(os.environ.get("PROPCACHE_NO_EXTENSIONS")) # type: bool if sys.implementation.name != "cpython": NO_EXTENSIONS = True # isort: off if TYPE_CHECKING: from ._helpers_py import ca...