File: //usr/local/CyberCP/lib/python3.10/site-packages/websockets/__pycache__/imports.cpython-310.pyc
o
�h�
� @ sP d dl mZ d dlZd dlmZ d dlmZ dgZdd
d�Z dddd�Z dS )� )�annotationsN)�Iterable)�Any�lazy_import�name�str�source� namespace�dict[str, Any]�returnr c C s\ d}|| dkr|d7 }|t |�k sJ d��|| dkst||d� |d| g|�}t|| �S )aN
Import ``name`` from ``source`` in ``namespace``.
There are two use cases:
- ``name`` is an object defined in ``source``;
- ``name`` is a submodule of ``source``.
Neither :func:`__import__` nor :func:`~importlib.import_module` does
exactly this. :func:`__import__` is closer to the intended behavior.
r �.� z%importing from parent isn't supportedN)�len�
__import__�getattr)r r r �level�module� r �E/usr/local/CyberCP/lib/python3.10/site-packages/websockets/imports.py�import_name s
�
r �aliases�dict[str, str] | None�deprecated_aliases�Nonec s� � du ri � �du ri �t ���t � ��t �����@ r J d����@ r(J d����@ r0J d���d �d� ���fdd �}|�d
<