HEX
Server: LiteSpeed
System: Linux us-phx-web1284.main-hosting.eu 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: u300739242 (300739242)
PHP: 8.2.30
Disabled: system, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/jsons/__pycache__/_common_impl.cpython-37.pyc
B

�P�e��	@s�dZddlZddlZddlmZddlmZmZmZm	Z	m
Z
ddlmZddl
mZddlmZed�ZeeeeefZeeeeeeeeef	ZdZe	d	�ZGd
d�d�Zed(eeeegefeeed
�dd��Z ed�dd�Z!ee"ed�dd�Z#ee"ed�dd�Z$eeeed�dd�Z%e"eeeeeefd�dd�Z&ed�dd�Z'ee"eed �d!d"�Z(eed#�d$d%�Z)eeed#�d&d'�Z*dS))z�
PRIVATE MODULE: do not import (from) it directly.

This module contains implementations of common functionality that can be used
throughout `jsons`.
�N)�
import_module)�Callable�Optional�Tuple�TypeVar�Any)�cached)�get_union_params)�UnknownClassErrorz-meta�Tc@sTeZdZdZdZe�Ze�Ze�Z	e�Z
e�Ze�Ze�Z
dZe�Zedd��ZdS)�StateHolderzH
    This class holds the registered serializers and deserializers.
    rFcOs2|js.||jkr.d�||�}tj|f|�|�dS)NzP{} Use suppress_warning({}) or suppress_warnings(True) to turn off this message.)�_suppress_warnings�_suppressed_warnings�format�warnings�warn)�cls�msg�code�args�kwargsZmsg_�r�C/opt/alt/python37/lib/python3.7/site-packages/jsons/_common_impl.py�_warn&szStateHolder._warnN)�__name__�
__module__�__qualname__�__doc__Z
_fork_counter�listZ_classes_serializersZ_classes_deserializers�dictZ_serializersZ_deserializers�_validatorsZ_classes_validators�_announced_classesr
�setr�classmethodrrrrrrsrF)r�transformer�fully_qualified�returncCsP|p
dd�}t|�}|r ||�St|�}|rDt|�}|rDd�||�}||�}|S)a_
    Return the name of a class.
    :param cls: the class of which the name if to be returned.
    :param transformer: any string transformer, e.g. ``str.lower``.
    :param fully_qualified: if ``True`` return the fully qualified name (i.e.
    complete with module name).
    :return: the name of ``cls``, transformed if a transformer is given.
    cSs|S)Nr)�xrrr�<lambda>:�z get_class_name.<locals>.<lambda>z{}.{})�_get_special_cases�_get_simple_name�_get_moduler)rr$r%�cls_name�modulerrr�get_class_name.sr/)rcCst|d�r|jdkr|jSdS)NrzNewType.<locals>.new_type)�hasattrrr)rrrrr*Gs

r*)�cls_str�sourcer&c
Cs�tt|d�}|r|Sd|kr0d|kr0t|||�Sy:|�d�}d�|dd��}|d}t|�}t||�}Wn&tttfk
r�t	|||�}YnX|S)N�[�]�.���)
�getattr�builtins�_get_generic_cls_from_str�split�joinr�ImportError�AttributeError�
ValueError�_lookup_announced_class)r1r2�	fork_instrZsplitted�module_namer-Z
cls_modulerrr�get_cls_from_strMs
rBcsL|�d�\}}|dd�}t|���}��fdd�|�d�D�}|t|�S)Nr3rr6csg|]}t|������qSr)rB�strip)�.0�s)r@r2rr�
<listcomp>csz-_get_generic_cls_from_str.<locals>.<listcomp>�,)r:rB�tuple)r1r2r@Z
origin_strZsubtypes_str�origin�subtypesr)r@r2rr9^sr9)r�
cls_from_meta�
cls_from_type�inferred_clscCs2|||g}|r|||g}x|D]}|r|SqWdS)Nr)rrKrLrM�order�elemrrr�determine_precedencehs


rP)�json_objr@r&cCs>t|t�r:t|kr:|tdd}t|||�}||tfSdS)N�classes�/)NN)�
isinstancer�	META_ATTRrB)rQr@r1rrrr�get_cls_and_metaxs
rVcCs@|ttdtfk}|s<t|���}d|ks0d|ko:tt|�k}|S)N�union�optional)r�object�NoneTyper/�lowerr	)r�resultr-rrr�can_match_with_none�sr])r1r2r@r&cCs*|j�|�}|s&d�|�}t|||��|S)NzdCould not find a suitable type for "{}". Make sure it can be imported or that is has been announced.)r!�getrr
)r1r2r@rrrrrr?�sr?)rr&cCsf|dkrt|�}t|dd�}|s,t|dd�}|sbt|�}|�d�d}|�d�d}|�d�d}|S)Nr�_namer3rr5r6z'>)�typer7�reprr:)rr-rrrr+�sr+cCs(tjj}t|dd�}|r$||kr$|SdS)Nr)�str�	__class__rr7)r�builtin_moduler.rrrr,�sr,)NF)+rr8r�	importlibr�typingrrrrrZjsons._cacherZjsons._compatibility_implr	Zjsons.exceptionsr
r`rZrb�int�float�boolZ	JSON_KEYSrrHr"rZVALID_TYPESrUrrr/r*rYrBr9rPrVr]r?r+r,rrrr�<module>s>*