3 sr>cCs|j||�dS)z� Add a representer for the given type. Multi-representer is a function accepting a Dumper instance and an instance of the given data type or subtype and producing the corresponding representation node. N)�add_multi_representer)r?Zmulti_representerrrrr r@ sr@cs eZdZdZ�fdd�Z�ZS)�YAMLObjectMetaclassz' The metaclass for YAMLObject. csNtt|�j|||�d|krJ|ddk rJ|jj|j|j�|jj||j �dS)N�yaml_tag) �superrA�__init__� yaml_loaderr;rB� from_yaml� yaml_dumperr>�to_yaml)�cls�name�basesr,)� __class__rr rDszYAMLObjectMetaclass.__init__)�__name__� __module__� __qualname__�__doc__rD� __classcell__rr)rLr rAsrAc@s<eZdZdZfZeZeZdZ dZ e dd��Z e dd��Z dS)� YAMLObjectza An object that can dump itself to a YAML stream and load itself from a YAML stream. NcCs |j||�S)zC Convert a representation node to a Python object. )Zconstruct_yaml_object)rIrr*rrr rF*szYAMLObject.from_yamlcCs|j|j|||jd�S)zC Convert a Python object to a representation node. )Z flow_style)Zrepresent_yaml_objectrB�yaml_flow_style)rIrr0rrr rH1s zYAMLObject.to_yaml)rMrNrOrP� __slots__rrErrGrBrS� classmethodrFrHrrrr rRs rR)� metaclass)N)N)%�error�tokensrr)rr� __version__ZcyamlZ__with_libyaml__� ImportErrorrrr r r r rrrrrrr+r'r1r2r4r5r6r9r;r=r>r@�typerArRrrrr �s^