viruPVS/langchain-docs huggingface dataset:
tp_dict.__total__ = total
        return tp_dict
    __call__ = dict  # static method
    def __subclasscheck__(cls, other):
        # Typed dicts are only for static structural subtyping.
        raise TypeError('TypedDict does not support instance and class checks')
    __instancecheck__ = __subclasscheck__
def TypedDict(typename, fields=None, /, *, total=True, **kwargs):
    """A simple typed namespace. At runtime it is equivalent to a plain dict.
    TypedDict creates a dictionary type such that a type checker will expect all
    instances to have a certain set of keys, where each key is
    associated with a value of a consistent type. This expectation
    is not checked at runtime.
    Usage::
        class Point2D(TypedDict):
            x: int
            y: int
            label: str
        a: Point2D = {'x': 1, 'y': 2, 'label': 'good'}  # OK
        b: Point2D = {'z': 3, 'label': 'bad'}           # Fails type check
        assert Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first')
    The type info can be accessed via the Point2D.__annotations__ dict, and
    the Point2D.__required_keys__ and Point2D.__optional_keys__ frozensets.
    TypedDict supports an additional equivalent form::
        Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})
    By default, all keys must be present in a TypedDict. It is possible
    to override this by specifying totality::
        class Point2D(TypedDict, total=False):
class Point2D(TypedDict, total=False):
            x: int
            y: int
    This means that a Point2D TypedDict can have any of the keys omitted. A type
    checker is only expected to support a literal False or True as the value of
    the total argument. True is the default, and makes all items defined in the
    class body be required.
    The Required and NotRequired special forms can also be used to mark
    individual keys as being required or not required::
        class Point2D(TypedDict):
            x: int               # the "x" key must always be present (Required is the default)
            y: NotRequired[int]  # the "y" key can be omitted
    See PEP 655 for more details on Required and NotRequired.
    """
    if fields is None:
        fields = kwargs
    elif kwargs:
        raise TypeError("TypedDict takes either a dict or keyword arguments,"
                        " but not both")
    if kwargs:
        warnings.warn(
            "The kwargs-based syntax for TypedDict definitions is deprecated "
            "in Python 3.11, will be removed in Python 3.13, and may not be "
            "understood by third-party type checkers.",
            DeprecationWarning,
            stacklevel=2,
        )
    ns = {'__annotations__': dict(fields)}
    module = _caller()
    if module is not None:
        # Setting correct module is necessary to make typed dict classes pickleable.
        ns['__module__'] = module
    return _TypedDictMeta(typename, (), ns, total=total)
_TypedDict = type.__new__(_TypedDictMeta, 'TypedDict', (), {})
_TypedDict = type.__new__(_TypedDictMeta, 'TypedDict', (), {})
TypedDict.__mro_entries__ = lambda bases: (_TypedDict,)
@_SpecialForm
def Required(self, parameters):
    """Special typing construct to mark a TypedDict key as required.
    This is mainly useful for total=False TypedDicts.
    For example::
        class Movie(TypedDict, total=False):
            title: Required[str]
            year: int
        m = Movie(
            title='The Matrix',  # typechecker error if key is omitted
            year=1999,
        )
    There is no runtime checking that a required key is actually provided
    when instantiating a related TypedDict.
    """
    item = _type_check(parameters, f'{self._name} accepts only a single type.')
    return _GenericAlias(self, (item,))
@_SpecialForm
def NotRequired(self, parameters):
    """Special typing construct to mark a TypedDict key as potentially missing.
    For example::
        class Movie(TypedDict):
            title: str
            year: NotRequired[int]
        m = Movie(
            title='The Matrix',  # typechecker error if key is omitted
            year=1999,
        )
    """
    item = _type_check(parameters, f'{self._name} accepts only a single type.')
    return _GenericAlias(self, (item,))
class NewType:
    """NewType creates simple unique types with almost zero runtime overhead.
    NewType(name, tp) is considered a subtype of tp
    by static type checkers. At runtime, NewType(name, tp) returns
    a dummy callable that simply returns its argument.
    Usage::
        UserId = NewType('UserId', int)
Usage::
        UserId = NewType('UserId', int)
        def name_by_id(user_id: UserId) -> str:
            ...
        UserId('user')          # Fails type check
        name_by_id(42)          # Fails type check
        name_by_id(UserId(42))  # OK
        num = UserId(5) + 1     # type: int
    """
    __call__ = _idfunc
    def __init__(self, name, tp):
        self.__qualname__ = name
        if '.' in name:
            name = name.rpartition('.')[-1]
        self.__name__ = name
        self.__supertype__ = tp
        def_mod = _caller()
        if def_mod != 'typing':
            self.__module__ = def_mod
    def __mro_entries__(self, bases):
        # We defined __mro_entries__ to get a better error message
        # if a user attempts to subclass a NewType instance. bpo-46170
        superclass_name = self.__name__
        class Dummy:
            def __init_subclass__(cls):
                subclass_name = cls.__name__
                raise TypeError(
                    f"Cannot subclass an instance of NewType. Perhaps you were looking for: "
                    f"`{subclass_name} = NewType({subclass_name!r}, {superclass_name})`"
                )
        return (Dummy,)
    def __repr__(self):
        return f'{self.__module__}.{self.__qualname__}'
    def __reduce__(self):
        return self.__qualname__
    def __or__(self, other):
        return Union[self, other]
    def __ror__(self, other):
        return Union[other, self]
def __ror__(self, other):
        return Union[other, self]
# Python-version-specific alias (Python 2: unicode; Python 3: str)
Text = str
# Constant that's True when type checking, but False here.
TYPE_CHECKING = False
class IO(Generic[AnyStr]):
    """Generic base class for TextIO and BinaryIO.
    This is an abstract, generic version of the return of open().
    NOTE: This does not distinguish between the different possible
    classes (text vs. binary, read vs. write vs. read/write,
    append-only, unbuffered).  The TextIO and BinaryIO subclasses
    below capture the distinctions between text vs. binary, which is
    pervasive in the interface; however we currently do not offer a
    way to track the other distinctions in the type system.
    """
    __slots__ = ()
    @property
    @abstractmethod
    def mode(self) -> str:
        pass
    @property
    @abstractmethod
    def name(self) -> str:
        pass
    @abstractmethod
    def close(self) -> None:
        pass
    @property
    @abstractmethod
    def closed(self) -> bool:
        pass
    @abstractmethod
    def fileno(self) -> int:
        pass
    @abstractmethod
    def flush(self) -> None:
        pass
    @abstractmethod
    def isatty(self) -> bool:
        pass
    @abstractmethod
    def read(self, n: int = -1) -> AnyStr:
        pass
    @abstractmethod
    def readable(self) -> bool:
        pass
    @abstractmethod
    def readline(self, limit: int = -1) -> AnyStr:
        pass
    @abstractmethod
pass
    @abstractmethod
    def readlines(self, hint: int = -1) -> List[AnyStr]:
        pass
    @abstractmethod
    def seek(self, offset: int, whence: int = 0) -> int:
        pass
    @abstractmethod
    def seekable(self) -> bool:
        pass
    @abstractmethod
    def tell(self) -> int:
        pass
    @abstractmethod
    def truncate(self, size: int = None) -> int:
        pass
    @abstractmethod
    def writable(self) -> bool:
        pass
    @abstractmethod
    def write(self, s: AnyStr) -> int:
        pass
    @abstractmethod
    def writelines(self, lines: List[AnyStr]) -> None:
        pass
    @abstractmethod
    def __enter__(self) -> 'IO[AnyStr]':
        pass
    @abstractmethod
    def __exit__(self, type, value, traceback) -> None:
        pass
class BinaryIO(IO[bytes]):
    """Typed version of the return of open() in binary mode."""
    __slots__ = ()
    @abstractmethod
    def write(self, s: Union[bytes, bytearray]) -> int:
        pass
    @abstractmethod
    def __enter__(self) -> 'BinaryIO':
        pass
class TextIO(IO[str]):
    """Typed version of the return of open() in text mode."""
    __slots__ = ()
    @property
    @abstractmethod
    def buffer(self) -> BinaryIO:
        pass
    @property
    @abstractmethod
    def encoding(self) -> str:
        pass
    @property
    @abstractmethod
    def errors(self) -> Optional[str]:
        pass
    @property
    @abstractmethod
pass
    @property
    @abstractmethod
    def line_buffering(self) -> bool:
        pass
    @property
    @abstractmethod
    def newlines(self) -> Any:
        pass
    @abstractmethod
    def __enter__(self) -> 'TextIO':
        pass
class _DeprecatedType(type):
    def __getattribute__(cls, name):
        if name not in ("__dict__", "__module__") and name in cls.__dict__:
            warnings.warn(
                f"{cls.__name__} is deprecated, import directly "
                f"from typing instead. {cls.__name__} will be removed "
                "in Python 3.12.",
                DeprecationWarning,
                stacklevel=2,
            )
        return super().__getattribute__(name)
class io(metaclass=_DeprecatedType):
    """Wrapper namespace for IO generic classes."""
    __all__ = ['IO', 'TextIO', 'BinaryIO']
    IO = IO
    TextIO = TextIO
    BinaryIO = BinaryIO
io.__name__ = __name__ + '.io'
sys.modules[io.__name__] = io
Pattern = _alias(stdlib_re.Pattern, 1)
Match = _alias(stdlib_re.Match, 1)
class re(metaclass=_DeprecatedType):
    """Wrapper namespace for re type aliases."""
    __all__ = ['Pattern', 'Match']
    Pattern = Pattern
    Match = Match
re.__name__ = __name__ + '.re'
sys.modules[re.__name__] = re
def reveal_type(obj: T, /) -> T:
    """Reveal the inferred type of a variable.
    When a static type checker encounters a call to ``reveal_type()``,
When a static type checker encounters a call to ``reveal_type()``,
    it will emit the inferred type of the argument::
        x: int = 1
        reveal_type(x)
    Running a static type checker (e.g., mypy) on this example
    will produce output similar to 'Revealed type is "builtins.int"'.
    At runtime, the function prints the runtime type of the
    argument and returns it unchanged.
    """
    print(f"Runtime type is {type(obj).__name__!r}", file=sys.stderr)
    return obj
def dataclass_transform(
    *,
    eq_default: bool = True,
    order_default: bool = False,
    kw_only_default: bool = False,
    field_specifiers: tuple[type[Any] | Callable[..., Any], ...] = (),
    **kwargs: Any,
) -> Callable[[T], T]:
    """Decorator to mark an object as providing dataclass-like behaviour.
    The decorator can be applied to a function, class, or metaclass.
    Example usage with a decorator function::
        T = TypeVar("T")
        @dataclass_transform()
        def create_model(cls: type[T]) -> type[T]:
            ...
            return cls
        @create_model
        class CustomerModel:
            id: int
            name: str
    On a base class::
        @dataclass_transform()
        class ModelBase: ...
        class CustomerModel(ModelBase):
            id: int
            name: str
    On a metaclass::
        @dataclass_transform()
        class ModelMeta(type): ...
        class ModelBase(metaclass=ModelMeta): ...
        class CustomerModel(ModelBase):
            id: int
            name: str
class CustomerModel(ModelBase):
            id: int
            name: str
    The ``CustomerModel`` classes defined above will
    be treated by type checkers similarly to classes created with
    ``@dataclasses.dataclass``.
    For example, type checkers will assume these classes have
    ``__init__`` methods that accept ``id`` and ``name``.
    The arguments to this decorator can be used to customize this behavior:
    - ``eq_default`` indicates whether the ``eq`` parameter is assumed to be
        ``True`` or ``False`` if it is omitted by the caller.
    - ``order_default`` indicates whether the ``order`` parameter is
        assumed to be True or False if it is omitted by the caller.
    - ``kw_only_default`` indicates whether the ``kw_only`` parameter is
        assumed to be True or False if it is omitted by the caller.
    - ``field_specifiers`` specifies a static list of supported classes
        or functions that describe fields, similar to ``dataclasses.field()``.
    - Arbitrary other keyword arguments are accepted in order to allow for
        possible future extensions.
    At runtime, this decorator records its arguments in the
    ``__dataclass_transform__`` attribute on the decorated object.
    It has no other runtime effect.
    See PEP 681 for more details.
    """
    def decorator(cls_or_fn):
        cls_or_fn.__dataclass_transform__ = {
            "eq_default": eq_default,
            "order_default": order_default,
            "kw_only_default": kw_only_default,
            "field_specifiers": field_specifiers,
            "kwargs": kwargs,
        }
        return cls_or_fn
    return decorator
All modules for which code is available
_markupbase
ast
html.parser
langchain.agents.agent
langchain.agents.agent_iterator
langchain.agents.agent_toolkits.conversational_retrieval.openai_functions
langchain.agents.agent_toolkits.vectorstore.base
langchain.agents.agent_toolkits.vectorstore.toolkit
langchain.agents.agent_types
langchain.agents.chat.base
langchain.agents.chat.output_parser
langchain.agents.conversational.base
langchain.agents.conversational.output_parser
langchain.agents.conversational_chat.base
langchain.agents.conversational_chat.output_parser
langchain.agents.format_scratchpad.log
langchain.agents.format_scratchpad.log_to_messages
langchain.agents.format_scratchpad.openai_functions
langchain.agents.format_scratchpad.openai_tools
langchain.agents.format_scratchpad.xml
langchain.agents.initialize
langchain.agents.load_tools
langchain.agents.loading
langchain.agents.mrkl.base
langchain.agents.mrkl.output_parser
langchain.agents.openai_assistant.base
langchain.agents.openai_functions_agent.agent_token_buffer_memory
langchain.agents.openai_functions_agent.base
langchain.agents.openai_functions_multi_agent.base
langchain.agents.output_parsers.json
langchain.agents.output_parsers.openai_functions
langchain.agents.output_parsers.openai_tools
langchain.agents.output_parsers.react_json_single_input
langchain.agents.output_parsers.react_single_input
langchain.agents.output_parsers.self_ask
langchain.agents.output_parsers.xml
langchain.agents.react.base
langchain.agents.react.output_parser
langchain.agents.schema
langchain.agents.self_ask_with_search.base
langchain.agents.structured_chat.base
langchain.agents.structured_chat.output_parser
langchain.agents.tools
langchain.agents.structured_chat.output_parser
langchain.agents.tools
langchain.agents.utils
langchain.agents.xml.base
langchain.callbacks.file
langchain.callbacks.streaming_aiter
langchain.callbacks.streaming_aiter_final_only
langchain.callbacks.streaming_stdout_final_only
langchain.callbacks.tracers.logging
langchain.chains.api.base
langchain.chains.api.openapi.chain
langchain.chains.api.openapi.requests_chain
langchain.chains.api.openapi.response_chain
langchain.chains.base
langchain.chains.combine_documents.base
langchain.chains.combine_documents.map_reduce
langchain.chains.combine_documents.map_rerank
langchain.chains.combine_documents.reduce
langchain.chains.combine_documents.refine
langchain.chains.combine_documents.stuff
langchain.chains.constitutional_ai.base
langchain.chains.constitutional_ai.models
langchain.chains.conversation.base
langchain.chains.conversational_retrieval.base
langchain.chains.elasticsearch_database.base
langchain.chains.ernie_functions.base
langchain.chains.example_generator
langchain.chains.flare.base
langchain.chains.flare.prompts
langchain.chains.graph_qa.arangodb
langchain.chains.graph_qa.base
langchain.chains.graph_qa.cypher
langchain.chains.graph_qa.cypher_utils
langchain.chains.graph_qa.falkordb
langchain.chains.graph_qa.hugegraph
langchain.chains.graph_qa.kuzu
langchain.chains.graph_qa.nebulagraph
langchain.chains.graph_qa.neptune_cypher
langchain.chains.graph_qa.sparql
langchain.chains.hyde.base
langchain.chains.llm
langchain.chains.llm_checker.base
langchain.chains.llm_math.base
langchain.chains.llm_requests
langchain.chains.llm_math.base
langchain.chains.llm_requests
langchain.chains.llm_summarization_checker.base
langchain.chains.loading
langchain.chains.mapreduce
langchain.chains.moderation
langchain.chains.natbot.base
langchain.chains.natbot.crawler
langchain.chains.openai_functions.base
langchain.chains.openai_functions.citation_fuzzy_match
langchain.chains.openai_functions.extraction
langchain.chains.openai_functions.openapi
langchain.chains.openai_functions.qa_with_structure
langchain.chains.openai_functions.tagging
langchain.chains.openai_functions.utils
langchain.chains.openai_tools.extraction
langchain.chains.prompt_selector
langchain.chains.qa_generation.base
langchain.chains.qa_with_sources.base
langchain.chains.qa_with_sources.loading
langchain.chains.qa_with_sources.retrieval
langchain.chains.qa_with_sources.vector_db
langchain.chains.query_constructor.base
langchain.chains.query_constructor.ir
langchain.chains.query_constructor.parser
langchain.chains.query_constructor.schema
langchain.chains.retrieval_qa.base
langchain.chains.router.base
langchain.chains.router.embedding_router
langchain.chains.router.llm_router
langchain.chains.router.multi_prompt
langchain.chains.router.multi_retrieval_qa
langchain.chains.sequential
langchain.chains.sql_database.query
langchain.chains.transform
langchain.embeddings.cache
langchain.evaluation.agents.trajectory_eval_chain
langchain.evaluation.comparison.eval_chain
langchain.evaluation.criteria.eval_chain
langchain.evaluation.embedding_distance.base
langchain.evaluation.exact_match.base
langchain.evaluation.loading
langchain.evaluation.parsing.base
langchain.evaluation.parsing.json_distance
langchain.evaluation.parsing.base
langchain.evaluation.parsing.json_distance
langchain.evaluation.parsing.json_schema
langchain.evaluation.qa.eval_chain
langchain.evaluation.qa.generate_chain
langchain.evaluation.regex_match.base
langchain.evaluation.schema
langchain.evaluation.scoring.eval_chain
langchain.evaluation.string_distance.base
langchain.hub
langchain.indexes.base
langchain.indexes.graph
langchain.indexes.vectorstore
langchain.memory.buffer
langchain.memory.buffer_window
langchain.memory.chat_memory
langchain.memory.combined
langchain.memory.entity
langchain.memory.kg
langchain.memory.motorhead_memory
langchain.memory.readonly
langchain.memory.simple
langchain.memory.summary
langchain.memory.summary_buffer
langchain.memory.token_buffer
langchain.memory.utils
langchain.memory.vectorstore
langchain.memory.zep_memory
langchain.model_laboratory
langchain.output_parsers.boolean
langchain.output_parsers.combining
langchain.output_parsers.datetime
langchain.output_parsers.enum
langchain.output_parsers.ernie_functions
langchain.output_parsers.fix
langchain.output_parsers.json
langchain.output_parsers.loading
langchain.output_parsers.openai_functions
langchain.output_parsers.openai_tools
langchain.output_parsers.pandas_dataframe
langchain.output_parsers.pydantic
langchain.output_parsers.rail_parser
langchain.output_parsers.regex
langchain.output_parsers.regex_dict
langchain.output_parsers.retry
langchain.output_parsers.structured
langchain.output_parsers.xml
langchain.output_parsers.yaml
langchain.prompts.example_selector.ngram_overlap
langchain.retrievers.contextual_compression
langchain.retrievers.document_compressors.base
langchain.retrievers.document_compressors.chain_extract
langchain.retrievers.document_compressors.chain_filter
langchain.retrievers.document_compressors.chain_filter
langchain.retrievers.document_compressors.cohere_rerank
langchain.retrievers.document_compressors.embeddings_filter
langchain.retrievers.ensemble
langchain.retrievers.merger_retriever
langchain.retrievers.multi_query
langchain.retrievers.multi_vector
langchain.retrievers.parent_document_retriever
langchain.retrievers.re_phraser
langchain.retrievers.self_query.base
langchain.retrievers.self_query.chroma
langchain.retrievers.self_query.dashvector
langchain.retrievers.self_query.deeplake
langchain.retrievers.self_query.elasticsearch
langchain.retrievers.self_query.milvus
langchain.retrievers.self_query.mongodb_atlas
langchain.retrievers.self_query.myscale
langchain.retrievers.self_query.opensearch
langchain.retrievers.self_query.pinecone
langchain.retrievers.self_query.qdrant
langchain.retrievers.self_query.redis
langchain.retrievers.self_query.supabase
langchain.retrievers.self_query.timescalevector
langchain.retrievers.self_query.vectara
langchain.retrievers.self_query.weaviate
langchain.retrievers.time_weighted_retriever
langchain.retrievers.web_research
langchain.runnables.hub
langchain.runnables.openai_functions
langchain.smith.evaluation.config
langchain.smith.evaluation.name_generation
langchain.smith.evaluation.progress
langchain.smith.evaluation.runner_utils
langchain.smith.evaluation.string_run_evaluator
langchain.storage.encoder_backed
langchain.storage.file_system
langchain.storage.in_memory
langchain.text_splitter
langchain.tools.render
langchain.tools.retriever
langchain.utils.ernie_functions
langchain_community.adapters.openai
langchain.utils.ernie_functions
langchain_community.adapters.openai
langchain_community.agent_toolkits.ainetwork.toolkit
langchain_community.agent_toolkits.amadeus.toolkit
langchain_community.agent_toolkits.azure_cognitive_services
langchain_community.agent_toolkits.base
langchain_community.agent_toolkits.clickup.toolkit
langchain_community.agent_toolkits.file_management.toolkit
langchain_community.agent_toolkits.github.toolkit
langchain_community.agent_toolkits.gitlab.toolkit
langchain_community.agent_toolkits.gmail.toolkit
langchain_community.agent_toolkits.jira.toolkit
langchain_community.agent_toolkits.json.base
langchain_community.agent_toolkits.json.toolkit
langchain_community.agent_toolkits.multion.toolkit
langchain_community.agent_toolkits.nasa.toolkit
langchain_community.agent_toolkits.nla.tool
langchain_community.agent_toolkits.nla.toolkit
langchain_community.agent_toolkits.office365.toolkit
langchain_community.agent_toolkits.openapi.base
langchain_community.agent_toolkits.openapi.planner
langchain_community.agent_toolkits.openapi.spec
langchain_community.agent_toolkits.openapi.toolkit
langchain_community.agent_toolkits.playwright.toolkit
langchain_community.agent_toolkits.powerbi.base
langchain_community.agent_toolkits.powerbi.chat_base
langchain_community.agent_toolkits.powerbi.toolkit
langchain_community.agent_toolkits.slack.toolkit
langchain_community.agent_toolkits.spark_sql.base
langchain_community.agent_toolkits.spark_sql.toolkit
langchain_community.agent_toolkits.sql.base
langchain_community.agent_toolkits.sql.toolkit
langchain_community.agent_toolkits.steam.toolkit
langchain_community.agent_toolkits.zapier.toolkit
langchain_community.cache
langchain_community.callbacks.aim_callback
langchain_community.callbacks.argilla_callback
langchain_community.callbacks.arize_callback
langchain_community.callbacks.arthur_callback
langchain_community.callbacks.clearml_callback