OXIESEC PANEL
- Current Dir:
/
/
opt
/
alt
/
python311
/
lib
/
python3.11
/
site-packages
/
jsons
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
09/05/2025 09:34:01 AM
rwxr-xr-x
📄
__init__.py
11.57 KB
05/08/2024 06:42:59 PM
rw-r--r--
📁
__pycache__
-
05/08/2024 06:42:59 PM
rwxr-xr-x
📄
_cache.py
1.23 KB
05/08/2024 06:42:59 PM
rw-r--r--
📄
_common_impl.py
5.89 KB
05/08/2024 06:42:59 PM
rw-r--r--
📄
_compatibility_impl.py
3.06 KB
05/08/2024 06:42:59 PM
rw-r--r--
📄
_datetime_impl.py
4.98 KB
05/08/2024 06:42:59 PM
rw-r--r--
📄
_dump_impl.py
4.01 KB
05/08/2024 06:42:59 PM
rw-r--r--
📄
_extra_impl.py
1.7 KB
05/08/2024 06:42:59 PM
rw-r--r--
📄
_fork_impl.py
1.39 KB
05/08/2024 06:42:59 PM
rw-r--r--
📄
_key_transformers.py
1.32 KB
05/08/2024 06:42:59 PM
rw-r--r--
📄
_lizers_impl.py
5.73 KB
05/08/2024 06:42:59 PM
rw-r--r--
📄
_load_impl.py
8.16 KB
05/08/2024 06:42:59 PM
rw-r--r--
📄
_multitasking.py
2.34 KB
05/08/2024 06:42:59 PM
rw-r--r--
📄
_package_info.py
376 bytes
05/08/2024 06:42:59 PM
rw-r--r--
📄
_transform_impl.py
1.48 KB
05/08/2024 06:42:59 PM
rw-r--r--
📄
_validation.py
2.64 KB
05/08/2024 06:42:59 PM
rw-r--r--
📁
classes
-
05/08/2024 06:42:59 PM
rwxr-xr-x
📄
decorators.py
6.62 KB
05/08/2024 06:42:59 PM
rw-r--r--
📁
deserializers
-
05/08/2024 06:42:59 PM
rwxr-xr-x
📄
exceptions.py
6.02 KB
05/08/2024 06:42:59 PM
rw-r--r--
📁
serializers
-
05/08/2024 06:42:59 PM
rwxr-xr-x
Editing: _transform_impl.py
Close
""" PRIVATE MODULE: do not import (from) it directly. This module contains functionality for loading stuff from json. """ from typing import Type, List, Any, Dict, Callable from jsons._common_impl import T from jsons._dump_impl import dump from jsons._load_impl import load def transform( obj: object, cls: Type[T], *, mapper: Callable[[Dict[str, Any]], Dict[str, Any]] = None, dump_cls: type = None, dump_args: List[Any] = None, dump_kwargs: List[Dict[str, Any]] = None, **kwargs) -> T: """ Transform the given ``obj`` to an instance of ``cls``. :param obj: the object that is to be transformed into a type of ``cls``. :param cls: the type that ``obj`` is to be transformed into. :param mapper: a callable that takes the dumped dict and returns a mapped dict right before it is loaded into ``cls``. :param dump_cls: the ``cls`` parameter that is given to ``dump``. :param dump_args: the ``args`` parameter that is given to ``dump``. :param dump_kwargs: the ``kwargs`` parameter that is given to ``dump``. :param kwargs: any keyword arguments that are given to ``load``. :return: an instance of ``cls``. """ dump_args_ = dump_args or [] dump_kwargs_ = dump_kwargs or {} dumped = dump(obj, dump_cls, *dump_args_, **dump_kwargs_) mapper_ = mapper or (lambda x: x) dumped_mapped = mapper_(dumped) return load(dumped_mapped, cls, **kwargs)