o
    iB
                     @  s*   d dl mZ d dlmZ 	ddd
dZdS )    )annotations)IOFreceived_typestr
input_typestrictboolreturnc                 C  s   | |ksdS | t jjks|t jjkrdS | t jjks |t jjkr"dS t| tr/|t jjkr/dS t| tr9t|ts;dS tdd | 	dD }tdd |	dD }t jj|v s_t jj|v radS |rh|
|S t||dkS )aq  
    received_type and input_type are both strings of the form "T1,T2,...".

    If strict is True, the input_type must contain the received_type.
      For example, if received_type is "STRING" and input_type is "STRING,INT",
      this will return True. But if received_type is "STRING,INT" and input_type is
      "INT", this will return False.

    If strict is False, the input_type must have overlap with the received_type.
      For example, if received_type is "STRING,BOOLEAN" and input_type is "STRING,INT",
      this will return True.

    Supports pre-union type extension behaviour of ``__ne__`` overrides.
    TFc                 s      | ]}|  V  qd S Nstrip.0t r   8/mnt/c/Users/fbmor/ComfyUI/comfy_execution/validation.py	<genexpr>/       z&validate_node_input.<locals>.<genexpr>,c                 s  r
   r   r   r   r   r   r   r   0   r   r   )r   AnyTypeio_type	MatchType
isinstancelistCombor   setsplitissubsetlenintersection)r   r   r   received_typesinput_typesr   r   r   validate_node_input   s"   
r#   N)F)r   r   r   r   r   r   r	   r   )
__future__r   comfy_api.latestr   r#   r   r   r   r   <module>   s    