✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ server366.web-hosting.com ​🇻​♯➤ 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 67.223.118.204 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.36
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/hc_python/lib/python3.12/site-packages/pydantic/_internal//_validate_call.py
from __future__ import annotations as _annotations

import inspect
from functools import partial
from typing import Any, Awaitable, Callable

import pydantic_core

from ..config import ConfigDict
from ..plugin._schema_validator import create_schema_validator
from . import _generate_schema, _typing_extra
from ._config import ConfigWrapper


class ValidateCallWrapper:
    """This is a wrapper around a function that validates the arguments passed to it, and optionally the return value."""

    __slots__ = (
        '__pydantic_validator__',
        '__name__',
        '__qualname__',
        '__annotations__',
        '__dict__',  # required for __module__
    )

    def __init__(
        self,
        function: Callable[..., Any],
        config: ConfigDict | None,
        validate_return: bool,
        namespace: dict[str, Any] | None,
    ):
        if isinstance(function, partial):
            func = function.func
            schema_type = func
            self.__name__ = f'partial({func.__name__})'
            self.__qualname__ = f'partial({func.__qualname__})'
            self.__module__ = func.__module__
        else:
            schema_type = function
            self.__name__ = function.__name__
            self.__qualname__ = function.__qualname__
            self.__module__ = function.__module__

        global_ns = _typing_extra.add_module_globals(function, None)
        # TODO: this is a bit of a hack, we should probably have a better way to handle this
        # specifically, we shouldn't be pumping the namespace full of type_params
        # when we take namespace and type_params arguments in eval_type_backport
        type_params = getattr(schema_type, '__type_params__', ())
        namespace = {
            **{param.__name__: param for param in type_params},
            **(global_ns or {}),
            **(namespace or {}),
        }
        config_wrapper = ConfigWrapper(config)
        gen_schema = _generate_schema.GenerateSchema(config_wrapper, namespace)
        schema = gen_schema.clean_schema(gen_schema.generate_schema(function))
        core_config = config_wrapper.core_config(self)

        self.__pydantic_validator__ = create_schema_validator(
            schema,
            schema_type,
            self.__module__,
            self.__qualname__,
            'validate_call',
            core_config,
            config_wrapper.plugin_settings,
        )

        if validate_return:
            signature = inspect.signature(function)
            return_type = signature.return_annotation if signature.return_annotation is not signature.empty else Any
            gen_schema = _generate_schema.GenerateSchema(config_wrapper, namespace)
            schema = gen_schema.clean_schema(gen_schema.generate_schema(return_type))
            validator = create_schema_validator(
                schema,
                schema_type,
                self.__module__,
                self.__qualname__,
                'validate_call',
                core_config,
                config_wrapper.plugin_settings,
            )
            if inspect.iscoroutinefunction(function):

                async def return_val_wrapper(aw: Awaitable[Any]) -> None:
                    return validator.validate_python(await aw)

                self.__return_pydantic_validator__ = return_val_wrapper
            else:
                self.__return_pydantic_validator__ = validator.validate_python
        else:
            self.__return_pydantic_validator__ = None

    def __call__(self, *args: Any, **kwargs: Any) -> Any:
        res = self.__pydantic_validator__.validate_python(pydantic_core.ArgsKwargs(args, kwargs))
        if self.__return_pydantic_validator__:
            return self.__return_pydantic_validator__(res)
        return res


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
12 May 2025 12.34 PM
root / root
0755
__pycache__
--
12 May 2025 12.34 PM
root / root
0755
__init__.py
0 KB
12 May 2025 12.34 PM
root / root
0644
_config.py
12.31 KB
12 May 2025 12.34 PM
root / root
0644
_core_metadata.py
3.438 KB
12 May 2025 12.34 PM
root / root
0644
_core_utils.py
23.699 KB
12 May 2025 12.34 PM
root / root
0644
_dataclasses.py
8.528 KB
12 May 2025 12.34 PM
root / root
0644
_decorators.py
31.205 KB
12 May 2025 12.34 PM
root / root
0644
_decorators_v1.py
6.058 KB
12 May 2025 12.34 PM
root / root
0644
_discriminated_union.py
25.815 KB
12 May 2025 12.34 PM
root / root
0644
_docs_extraction.py
3.702 KB
12 May 2025 12.34 PM
root / root
0644
_fields.py
14.584 KB
12 May 2025 12.34 PM
root / root
0644
_forward_ref.py
0.597 KB
12 May 2025 12.34 PM
root / root
0644
_generate_schema.py
102.905 KB
12 May 2025 12.34 PM
root / root
0644
_generics.py
21.686 KB
12 May 2025 12.34 PM
root / root
0644
_git.py
0.766 KB
12 May 2025 12.34 PM
root / root
0644
_internal_dataclass.py
0.141 KB
12 May 2025 12.34 PM
root / root
0644
_known_annotated_metadata.py
13.856 KB
12 May 2025 12.34 PM
root / root
0644
_mock_val_ser.py
7.144 KB
12 May 2025 12.34 PM
root / root
0644
_model_construction.py
30.626 KB
12 May 2025 12.34 PM
root / root
0644
_repr.py
4.462 KB
12 May 2025 12.34 PM
root / root
0644
_schema_generation_shared.py
4.739 KB
12 May 2025 12.34 PM
root / root
0644
_signature.py
6.146 KB
12 May 2025 12.34 PM
root / root
0644
_std_types_schema.py
28.204 KB
12 May 2025 12.34 PM
root / root
0644
_typing_extra.py
18.975 KB
12 May 2025 12.34 PM
root / root
0644
_utils.py
12.364 KB
12 May 2025 12.34 PM
root / root
0644
_validate_call.py
3.702 KB
12 May 2025 12.34 PM
root / root
0644
_validators.py
10.857 KB
12 May 2025 12.34 PM
root / root
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF