
    e                        d dl Z d dlZd dlZd dlZd dlmZ d dl mZmZ d dlm	Z	 d dl
mZ d dlZd dlmZ ddlmZmZmZmZmZmZmZmZ dd	lmZmZ dd
lmZmZmZ ddl m!Z! ddl"m#Z# ddl$m%Z% ddl&m'Z'm(Z(m)Z) ddl*m+Z+m,Z,m-Z- e+e_.        ddde/fdZ0 G d dej1        j2                  Z3 G d dej4        e3          Z5ej6        7                    e5j8                    G d dej4                  Z9ej.        :                    d          e9_;        ej.        <                                e9j=        _>        d Z? G d de          Zd%d!Z@d&d"ZA G d# d$ej4                  ZBdS )'    N)defaultdict	Parameter	Signature)Path)FunctionType)	extension   )DatasetDimensioned
DynamicMapHoloMapStoreStoreOptionsViewableElementutil)	OperationOperationCallable)KeywordsOptionsoptions_policy)Overlay)merge_options_to_dict)function)ParamsStreamstreams_list_from_dict   )OutputSettingslist_backendslist_formatszholoviews-examplesFc                    t           j                            t           j                            |                    }t           j                            |d          }t           j                            |          s t           j                            |d          }t           j                            |           r*|st          |  d           dS t          j        |            t          j	        ddd          }t           j                            |          }t           j        
                    |          rt          j        || |d	           dS t          d
|            dS )z4
    Copies the notebooks to the supplied path.
    z
./examplesz../exampleszA directory already exists, either delete it or set the force flagNz.ipynb_checkpointsz*.pycz*~T)ignoresymlinkszCannot find )ospathabspathdirnamejoinexistsprintshutilrmtreeignore_patternsisdircopytree)r&   verboseforcerootfilepathexample_dirr#   	tree_roots           7lib/python3.11/site-packages/holoviews/util/__init__.pyexamplesr8   #   s)    wrwt4455H',,x66K7>>+&& <gll8];;	w~~d  	T\\\]]]Fd#$8FFF,,I	w}}Y *	4FFFFFF(Y(()))))    c                   "     e Zd ZdZ fdZ xZS )OptsMetazn
    Improve error message when running something
    like: 'hv.opts.Curve()' without a plotting backend.
    c                     	 t                                          |          S # t          $ r d|d}t          |          d w xY w)NzNo entry for zz registered; this name may not refer to a valid object or you may need to run 'hv.extension' to select a plotting backend.)super__getattr__AttributeError)selfattrmsg	__class__s      r7   r>   zOptsMeta.__getattr__>   sl    	077&&t,,, 	0 	0 	0V V V V  !%%4/	0s	    $ !A)__name__
__module____qualname____doc__r>   __classcell__rC   s   @r7   r;   r;   8   sB         
0 0 0 0 0 0 0 0 0r9   r;   c                       e Zd ZdZdZg dZ ej        dd          Z fdZ	d Z
ed	             Zed
             Zed             Zedd            Zedd            Zedd            Zed             Zed             Zedd            Zed             Zedd            Zed             Zedd            Zed             Z xZS )optsa)  
    Utility function to set options at the global level or to provide an
    Options object that can be used with the .options method of an
    element or container.

    Option objects can be generated and validated in a tab-completable
    way (in appropriate environments such as Jupyter notebooks) using
    completers such as opts.Curve, opts.Image, opts.Overlay, etc.

    To set opts globally you can pass these option objects into opts.defaults:

    opts.defaults(*options)

    For instance:

    opts.defaults(opts.Curve(color='red'))

    To set opts on a specific object, you can supply these option
    objects to the .options method.

    For instance:

    curve = hv.Curve([1,2,3])
    curve.options(opts.Curve(color='red'))

    The options method also accepts lists of Option objects.
    N)title_formatcolor_index
size_indexscaling_factorscaling_methodsize_fnnormalize_lengthsgroup_indexcategory_indexstack_indexcolor_byFz
       Whether to be strict about the options specification. If not set
       to strict (default), any invalid keywords are simply skipped. If
       strict, invalid keywords prevent the options being applied.defaultdocc                 :     t                      j        |i | d S Nr=   __init__r@   argskwargsrC   s      r7   r]   zopts.__init__r   s%    $)&)))))r9   c                 N    |s|st                      S |r|st          di |S d S d S )N )r   )r@   r_   paramss      r7   __call__zopts.__call__u   sR     	%d 	%99 	%D 	%$$V$$$	% 	% 	% 	%r9   c           	         t           j        }t          |                                          t          |          z
  r@t	          d                    |d                    d |D                                           t          d |                                D                       sAt	          dd                    d |                                D                       z            d |                                D             }t          |          rt          |          st	          d          t          |          st          j        |j                  }|j        r9d	                    |j        j        |t          j        |j                            }n.||j        j        k    r|j        j         d
| }n|j        j        }|d |                                D             i}nbt%          t&                    }|                                D ]*\  }	}
|
                                D ]\  }}|||         |	<   +t'          |          }|S )z8Format option group kwargs into canonical options formatz%Keyword options {} must be one of  {},c              3   4   K   | ]}t          |          V  d S r[   repr.0gs     r7   	<genexpr>z0opts._group_kwargs_to_options.<locals>.<genexpr>   s(      $=$=T!WW$=$=$=$=$=$=r9   c              3   @   K   | ]}t          |t                    V  d S r[   )
isinstancedict)rk   vs     r7   rm   z0opts._group_kwargs_to_options.<locals>.<genexpr>   s,      BBQZ4((BBBBBBr9   z8The %s options must be specified using dictionary groupsc              3   4   K   | ]}t          |          V  d S r[   rh   rk   ks     r7   rm   z0opts._group_kwargs_to_options.<locals>.<genexpr>   s(      $D$DT!WW$D$D$D$D$D$Dr9   c                 D    g | ]}|ot          d  |D                       S )c              3   J   K   | ]}|d                                           V  dS )r   N)isupperrs   s     r7   rm   z;opts._group_kwargs_to_options.<locals>.<listcomp>.<genexpr>   s.      ;;!qt||~~;;;;;;r9   )all)rk   grps     r7   
<listcomp>z1opts._group_kwargs_to_options.<locals>.<listcomp>   s4    WWW3;3;;s;;;;;WWWr9   zNCannot mix target specification keys such as 'Image' with non-target keywords.z{}.{}.{}.c                     i | ]\  }}||	S rb   rb   )rk   ry   kwss      r7   
<dictcomp>z1opts._group_kwargs_to_options.<locals>.<dictcomp>   s    "K"K"KyC3s"K"K"Kr9   )r   _option_groupssetkeys	Exceptionformatr)   rx   valuesanyr   group_sanitizergrouplabelrC   rD   label_sanitizeritemsr   rp   )clsobjr`   groupstargetssanitized_group
identifieroptionsdfltdictry   entriesr}   s               r7   _group_kwargs_to_optionszopts._group_kwargs_to_options{   sJ    'v{{}}F+ 	FCJJ6HH$=$=f$=$=$===? ? @ @ @BB&--//BBBBB 	FVHH$D$Dfkkmm$D$D$DDDE F F F XWv}}WWWw<< 	%G 	%lmmmW 	%"239==Oy 4(//M*O(335 5

 "S]%;;; # 6JJJJ

 ]3
!"K"KFLLNN"K"K"KLGG"4((H & 4 4W'.}} 4 4OJ03HZ(--48nnGr9   c                     |}|0|r|                     d           }n/|                     d            n|r|                     d           }t          j        |||          S )z.Apply the groups to a single specified backendNc                 .    |                      d           S N)id)clonexs    r7   <lambda>z/opts._apply_groups_to_backend.<locals>.<lambda>   s    qww$w/?/? r9   c                 $    t          | dd           S )Nr   )setattrr   s    r7   r   z/opts._apply_groups_to_backend.<locals>.<lambda>   s    '!T4"8"8 r9   c                 8    |                      | j                  S r   )r   r   r   s    r7   r   z/opts._apply_groups_to_backend.<locals>.<lambda>   s    177ad7+;+; r9   backend)mapr   set_options)r   r   r   r   r   
obj_handles         r7   _apply_groups_to_backendzopts._apply_groups_to_backend   s{     
? : WW%?%?@@

889999 	=!;!;<<J'
GWMMMMr9   c                 $   ||pt           j        |fgS t          t                    }|                                D ]6\  }}d|                                vst          |d                   dk    r*|||pt           j                 |                                <   _t          |d                                                   dhz
  r*|||d         d                  |                                <   dgt          |d                                                   k    rId |                                D             }|||d         d                  |                                <   )t          d          d |                                D             S )zBGroup options by backend and filter out output group appropriatelyNoutputr   r   c                 &    i | ]\  }}|d k    ||S )r   rb   rk   rt   rq   s      r7   r~   z*opts._grouped_backends.<locals>.<dictcomp>   s#    KKKCAaQ(]]Aa]]]r9   z6The output options group must have the backend keywordc                     g | ]	\  }}||f
S rb   rb   )rk   bkbk_optss      r7   rz   z*opts._grouped_backends.<locals>.<listcomp>   s     DDD-2wWDDDr9   )r   current_backendr   rp   r   r   lenstripr   listr   )r   r   r   r   specr   filtereds          r7   _grouped_backendszopts._grouped_backends   st    ?5 5w?@@t$$#MMOO 		Z 		ZLD&v{{}},,F84D0E0Eq0H0HKQ9E$9:4::<<HHVH%**,,--; ZFL))45djjllCCVH%5%:%:%<%< = ===KK6<<>>KKKFN))45djjllCC XYYYDD8>>3C3CDDDDr9   Tc                 j   t          |t                    rQddlm} 	 |                    |          }n4# t
          $ r' |                    |j        j         d|           }Y nw xY w|r|                     ||          }| 	                    ||          D ]\  }}| 
                    ||||          }|S )a[  Applies nested options definition grouped by type.

        Applies options on an object or nested group of objects,
        returning a new object with the options applied. This method
        accepts the separate option namespaces explicitly (i.e. 'plot',
        'style', and 'norm').

        If the options are to be set directly on the object a
        simple format may be used, e.g.:

            opts.apply_groups(obj, style={'cmap': 'viridis'},
                                         plot={'show_title': False})

        If the object is nested the options must be qualified using
        a type[.group][.label] specification, e.g.:

            opts.apply_groups(obj, {'Image': {'plot':  {'show_title': False},
                                              'style': {'cmap': 'viridis}}})

        If no opts are supplied all options on the object will be reset.

        Args:
            options (dict): Options specification
                Options specification should be indexed by
                type[.group][.label] or option type ('plot', 'style',
                'norm').
            backend (optional): Backend to apply options to
                Defaults to current selected backend
            clone (bool, optional): Whether to clone object
                Options can be applied inplace with clone=False
            **kwargs: Keywords of options by type
                Applies options directly to the object by type
                (e.g. 'plot', 'style', 'norm') specified as
                dictionaries.

        Returns:
            Returns the object or a clone with the options applied
        r
   OptsSpec )ro   strutil.parserr   parseSyntaxErrorrC   rD   r   r   r   )	r   r   r   r   r   r`   r   backend_loopbackend_optss	            r7   apply_groupszopts.apply_groups   s    P gs## 	;......;"..11 ; ; ;"..}-9999; ;;  	@223??G*-*?*?*Q*Q 	W 	W&L,..sL,PUVVCC
s   3 .A$#A$c                    t          |t                    rOddlm} t	                      j        }n# t          $ r t                      }Y nw xY w|                    ||          }t          j
        ||          }|rDt          j                            |           |r#t          j                            d           |dfS |dfS )Nr   r   nsbackendsz*Options specification will not be applied.TF)ro   r   parserr   get_ipythonuser_nsr   globalsr   r   validation_error_messagesysstderrwrite)r   r   strictr   r   r   errmsgs          r7   _process_magiczopts._process_magic   s    gs## 	5((((((%--/RR---GIIrrr-nnWn44G6wRRR 	%JV$$$ %
  !MNNN}$~s   0 A
Ac                     |d n|g}|                      |||          \  }}|rd S t          dd          5  t          j        |t	          j        |                     d d d            d S # 1 swxY w Y   d S )Nr   TF)skip_invalidwarn_on_skipr   )r   r   r   apply_customizationsr   r   )r   r   r   r   r   failures         r7   
_linemagiczopts._linemagic  s    "?44	--gv-QQFFEBBB 	W 	W-gu}W7U7U7UVVV	W 	W 	W 	W 	W 	W 	W 	W 	W 	W 	W 	W 	W 	W 	W 	W 	W 	Ws   )A..A25A2c                 F   |rTt          |          dk    rAt          t          |                                                    dk    rt	          d          |                     |                     t          |                    |                    d                     dS )a#  Set default options for a session.

        Set default options for a session. whether in a Python script or
        a Jupyter notebook.

        Args:
           *options: Option objects used to specify the defaults.
           backend:  The plotting extension the options apply to
        r   r   z5opts.defaults only accepts "backend" keyword argumentr   N)	r   nextiterr   r   r   _expand_optionsr   get)r   r   r`   s      r7   defaultszopts.defaults  s      	Uc&kkQ&&4V[[]]0C0C+D+D	+Q+QSTTTs**+@+I+IJJTZT^T^_hTiTijjjjjr9   c                 n    t          t                    }d}|D ][}d|j        v r|j        d         }n'|t          j        }||j        d<   n|}||j        d<   d}||                             |           \|r|s j                            d|z              fd|                                D             S )z
        Given a list of flat Option objects which may or may not have
        'backend' in their kwargs, return a list of grouped backend
        Fr   NTz[All supplied Options objects already define a backend, backend override %r will be ignored.c                 F    g | ]\  }}|                     ||          fS rb   )r   )rk   r   or   s      r7   rz   z+opts._expand_by_backend.<locals>.<listcomp>8  s2    OOOWb!S((B//0OOOr9   )	r   r   r`   r   r   appendparamwarningr   )r   r   r   r   used_fallbackr   opts_backends   `      r7   _expand_by_backendzopts._expand_by_backend   s     T"" 
	- 
	-CCJ&&"z)4$4'3
9%%&(4
9% $< '',,,, 	P= 	PI EGNO P P P POOOOOOOr9   c                    t           j        }t           j        st          d          |t           j        vr0t          d                    t          |                              	 t          j        |p|          }n&# t          $ r}t          d| d          dd}~ww xY wi }t          |t                    rt          |          }|                                D ]\  }}|                    d          d	         }	|	|vrt          |	 d
          ||	         }
d |
j        D             ||<   |                                D ]\  }}t          |
j                                                  D ]!\  }}||j        v r|||         |         |<    nI"t          d |
j                                        D                       }|                     ||	||           |S )ah  
        Validates and expands a dictionaries of options indexed by
        type[.group][.label] keys into separate style, plot, norm and
        output options.

            opts._expand_options({'Image': dict(cmap='viridis', show_title=False)})

        returns

            {'Image': {'plot': dict(show_title=False), 'style': dict(cmap='viridis')}}
        zNo plotting extension is currently loaded. Ensure you load an plotting extension with hv.extension or import it explicitly from holoviews.plotting before applying any options.zCurrently selected plotting extension {ext} has not been loaded, ensure you load it with hv.extension({ext}) before setting options)extr   zThe zC backend is not loaded. Please load the backend using hv.extension.Nr{   r   z) type not found, could not apply options.c                     i | ]}|i S rb   rb   rj   s     r7   r~   z(opts._expand_options.<locals>.<dictcomp>b  s     C C C1B C C Cr9   c                 &    h | ]}|j         D ]}|S rb   )allowed_keywords)rk   
group_optskeywords      r7   	<setcomp>z'opts._expand_options.<locals>.<setcomp>i  sB     , , ,&'1'B, , $  , , , ,r9   )r   r   	renderers
ValueErrorr   ri   r   KeyErrorr   ro   r   r   r   splitr   sortedr   r   _options_error)r   r   r   r   backend_optionseexpandedobjspecoption_valuesobjtypeobj_optionsoptvaluerl   r   valid_optionss                   r7   r   zopts._expand_options:  sM     / 
	J ( ) ) )
 EO33 ' (.v$2G2Gv'H'HJ J J
	u#mG4NOOOOO 	u 	u 	ui1iiijjptt	ugt$$ 	5+G44G&-mmoo 	M 	M"G]mmC((+Go-- G!V!V!VWWW)'2K C C0B C C CHW+1133 M M
U%+K,>,D,D,F,F%G%G 
M 
MMAzj99949)!,S1 : %+ , ,*5*<*C*C*E*E, , , % %M
 &&sGWmLLLM s   'A? ?
B"	BB"c                    t           j        }t          j                    }t          |          }t	          |                    |                    }7|rt          d|d| dd| d	          t          d|d| dd          g }	fd	|D             D ]j}
t          j        |

                              |          }|-|j	        
                                D ]#\  }}||j        v r|	                    |
           $k|	r2t          j        j                            d|d| d|d|	           dS |rt          d|d| d|d| d	          t          d|d| d          )z}
        Generates an error message for an invalid option suggesting
        similar options through fuzzy matching.
        r   NzUnexpected option z for z type when using the z! extension. Similar options are: r{   z% extension. No similar options found.c                      g | ]
}|k    |S rb   rb   )rk   br   s     r7   rz   z'opts._options_error.<locals>.<listcomp>  s    >>>g1r9   r   zOption z& type not valid for selected backend (z.). Option only applies to following backends: zD type across all extensions. Similar options for current extension (z) are: z6 type across all extensions. No similar options found.)r   r   loaded_backendsr   r   fuzzy_matchr   r   r   r   r   r   r   r   mainr   )r   r   r   r   r   r   r   r}   matchesfoundlb
lb_options_gr   s      `          r7   r   zopts._options_errorr  s     //11m,,,--.. ;  "<c "< "<' "< "<3:"< "<18"< "< "< = = = ! ":c ": ":' ": ":3:": ": ": ; ; ;
 >>>>o>>> 	% 	%Br22266w??J!","3"9"9";"; % %J*555LL$$$%  	J$$'# ' 'g ' '+' '"' '( ( ( F 	Q \# \ \g \ \7F\ \QX\ \ \ ] ] ]  P# P Pg P P P Q Q Qr9   c           	        
 t          |t                    r{ddlm} |2t	                      j        }n# t          $ r t                      }Y nw xY w|                    dd                              dd          }|	                    ||          }g }|r| dnd}|D ]ۊ
d	
                    
fd
t          
j                  D                       }d
j        v rf
j                            d          d         }t          d
                    
j                            d          dd                             d	z   }n	
j        }d}d}	|                    |	                    ||||                     |S )a2  
        Given a list of Option objects (such as those returned from
        OptsSpec.parse_options) or an %opts or %%opts magic string,
        return a list of corresponding option builder reprs. The
        namespace is typically given as 'hv' if fully qualified
        namespaces are desired.
        r   r   Nz%%opts z%optsr   r{   , c              3   <   K   | ]}| d j         |         V  dS =N)r`   )rk   rt   options     r7   rm   z&opts._builder_reprs.<locals>.<genexpr>  s8      WWAq776=#377WWWWWWr9   r   z{ns}opts.{element}({spec}{kws}))r   r   r}   element)ro   r   r   r   r   r   r   r   replaceparse_optionsr)   r   r`   keyr   ri   r   r   )r   r   	namespacer   r   reprsr}   r  r   opts_formatr  s             @r7   _builder_reprszopts._builder_reprs  s    gs## 	=((((((z)mm3 111		2221oohr22::72FFG,,W,<<G  )1	____r 
	Y 
	YF))WWWWAVAVWWWWWCfj   ***3//2CHHVZ%5%5c%:%:122%>??@@4G *;KLL++r#w+WWXXXXs   3 AAc                      dfd	} fdD             }t          t          |                    }t          t          dt          j                  gd |D             z             }||_        t          |          S )Nc                 P   |n d| }d d}|                     dd           }t          |                                          }|r1|                     |g                   }|t          |          z
  }ni }t                      }	t	          j                    D ]t}
t          |                     |
                               g                     }|	t          |          z  }	||k    rt          |fi |c S t          ||z
            ||
<   u||	z
  }|rY|sWd}d                    d |	                                D                       }t          |                    ||	                    }d
}|r	 |                     t          t          |                    ||           nX# t          $ rK}t          |          d                                         t          |          dd          z   }d}Y d }~nd }~ww xY w|rt          ||z             t          |fi |S )Nr{   zIn opts.z(...), r   )elementszF{prefix}keywords supplied are mixed across backends. Keyword(s) {info}r
  c              3      K   | ]:\  }}d                      d                    d |D                       |          V  ;dS )z{} are invalid for {}r
  c              3   4   K   | ]}t          |          V  d S r[   rh   rk   els     r7   rm   zBopts._create_builder.<locals>.builder.<locals>.<genexpr>.<genexpr>  s*      McMc[]dSUhhMcMcMcMcMcMcr9   N)r   r)   r   s      r7   rm   z8opts._create_builder.<locals>.builder.<locals>.<genexpr>  so       %D %D),1 &=%C%CDIIMcMcabMcMcMcDcDcef%g%g %D %D %D %D %D %Dr9   )infoprefixFr   r   T)r   r   r   _element_keywordsr   r   r   r   r)   r   r   r   r   r   r   r   lower)r   r   r}   r  r   r   allowed_kwsinvalid
mismatchedall_valid_kwsloaded_backendvalidrB   r  reraiser   completionsr  s                   r7   builderz%opts._create_builder.<locals>.builder  s   "l7770C0CT0C0CD0000Fggi..Gsxxzz??D *!33G>EY 4 H HHOQ[!1!11
!$&+&;&=&= D DN 5 5n E E I I'SU V VWWE!SZZ/Mu}}&t33s3333315dUl1C1CJ~... Kg K/C99 %D %D0:0@0@0B0B%D %D %D D DD$SZZT&Z%I%IJJJ)G 3#&&tDMM':':GWkZZZZ! # # #a&&)//++c!ffQRRj8C"GGGGGG#  3$Vc\2224''3'''s   <2F/ /
H9AG??Hc                 &    g | ]}|j         v|S rb   _no_completionrk   rt   r   s     r7   rz   z(opts._create_builder.<locals>.<listcomp>  s&    SSS1q@R7R7RQ7R7R7Rr9   r   c                 B    g | ]}t          |t           j                  S rb   )r   KEYWORD_ONLY)rk   kws     r7   rz   z(opts._create_builder.<locals>.<listcomp>  s5     !: !: !:%' "+2y/E!F!F !: !: !:r9   r[   )r   r   r   r   POSITIONAL_OR_KEYWORD__signature__classmethod)r   r  r)  r*  filtered_keywordssorted_kw_set	signatures   ```    r7   _create_builderzopts._create_builder  s    '	( '	( '	( '	( '	( '	( '	(R TSSSSSSs#45566y1PQQR!: !:+8!: !: !:: ; ;	 !*7###r9   c                    |t          j                    vri S i }t          j        |          }||n|                                }|D ]x}d|v rt	          |t
                    r|n|f}g }|d                    |                   }t          j        D ]"}|	                    ||         j
                   #|||d         <   y|S )z9Returns a dictionary of element names to allowed keywordsNr{   r   )r   r   r   r   ro   tupler)   r   r   extendr   )	r   r   r  mappingr   r  element_keywordsr   r   s	            r7   r   zopts._element_keywords  s     %/1111I-00'3889M9M9O9O 	3 	3Gg~~x!+GU!;!;Kgg'G!%chhw&7&78G / I I ''(GHHHH"2GGAJr9   c           
      @   
  j          j         _         t                      }                     |          }|                                D ]h\  }}t          j        d          5  |t          |          z  }t           |                     ||                     d d d            n# 1 swxY w Y   i fd|D             }t          t          |                    }ddl
m
m}  | 
d
j                  g
fd|D             z             }	|	 j        _        d S )NCRITICALc                 &    g | ]}|j         v|S rb   r,  r.  s     r7   rz   z(opts._update_backend.<locals>.<listcomp>  s&    TTT1AS8S8SQ8S8S8Sr9   r   r   r_   c                 2    g | ]} |j                   S rb   )r0  )rk   r1  r   s     r7   rz   z(opts._update_backend.<locals>.<listcomp>  s8     !: !: !:%' "+2y/E!F!F !: !: !:r9   )__original_docstring__rG   r   r   r   r   logging_levelr   r8  r   inspectr   r   VAR_POSITIONALr]   r3  )r   r   all_keywordsr=  r  keywordsr5  r6  r   r7  r   s   `         @r7   _update_backendzopts._update_backend  s   %-),C&uu0099!1!7!7!9!9 	@ 	@GX$Z00 @ @H-W++GX>>@ @ @@ @ @ @ @ @ @ @ @ @ @ @ @ @ @
 UTTTTTTs#4556600000000Iyy1IJJK!: !: !: !:+8!: !: !:: ; ;	 &/"""s   &8B**B.	1B.	)NNTr[   )FNNN)rD   rE   rF   rG   rB  r-  r   Booleanr   r]   rd   r4  r   r   r   r   r   r   r   r   r   r   r  r8  r   rH  rH   rI   s   @r7   rK   rK   I   sC        8 "R R RN U]5 /F G G GF
* * * * *% % % ! ! [!F N N [N E E [E& 3 3 3 [3j    [ W W W [W k k [k P P [P2 4 4 4 [4n )Q )Q [)QV    [@ 0$ 0$ [0$d    [( / / [/ / / / /r9   rK   )	metaclassc                   >     e Zd ZdZ fdZed             Zd Z xZS )r   a  
    Utility function to set output either at the global level or on a
    specific object.

    To set output globally use:

    output(options)

    Where options may be an options specification string (as accepted by
    the IPython opts magic) or an options specifications dictionary.

    For instance:

    output("backend='bokeh'") # Or equivalently
    output(backend='bokeh')

    To set save output from a specific object do disk using the
    'filename' argument, you can supply the object as the first
    positional argument and supply the filename keyword:

    curve = hv.Curve([1,2,3])
    output(curve, filename='curve.png')

    For compatibility with the output magic, you can supply the object
    as the second argument after the string specification:

    curve = hv.Curve([1,2,3])
    output("filename='curve.png'", curve)

    These two modes are equivalent to the IPython output line magic and
    the cell magic respectively.
    c                 :     t                      j        |i | d S r[   r\   r^   s      r7   r]   zoutput.__init__B  s%    $)&)))))r9   c                    g dt           j        j        t           j        j        fd                                D             }fdt          |          D             d|vrt           j        d<   dd         v r$d                             d          d         d<   d                    fdt          	                                          D                       }t          d	| d
           d S )N)filenamer  modec                 :    g | ]\  }}|v	||         k    |S rb   rb   )rk   rt   rq   r   	deprecates      r7   rz   zoutput.info.<locals>.<listcomp>K  s6    XXXca0B0BqHUVKGWGWGWGWGWr9   c                 "    i | ]}||         S rb   rb   )rk   rt   r   s     r7   r~   zoutput.info.<locals>.<dictcomp>L  s    444!71:444r9   r   :r   r
  c              3   2   K   | ]}| d |         V  dS r  rb   )rk   rt   pairss     r7   rm   zoutput.info.<locals>.<genexpr>R  s5      OOQ00E!H00OOOOOOr9   zoutput())r   output_settingsr   r   r   r   r   r   r)   r   r+   )r   r   rG  r   rR  r   rV  s      @@@@r7   r  zoutput.infoF  s
   000	'/(1XXXXXW]]__XXX4444vd||444D  $4E)%	"""$Y/55c::1=E)99OOOO&:N:NOOOOO####$$$$$r9   c                    d}d\  }}t          |          dk    rt          d          t          |          dk    r$t          |d         t                    s	|d         }n4t          |          dk    r	|d         }nt          |          dk    r|\  }}t          |t                    r~|r t
          j                            |i           }|                                D ]'}|t
          j        j	        vrt          d|           (d }t          j        j        d||||d	| d S ||S t          j        j        d||d
| d S )Nz6For help with hv.util.output call help(hv.util.output)rI  r
   z9The opts utility accepts one or two positional arguments.r   r   zInvalid keyword: c                 N    	 ddl m} n# t          $ r Y d S w xY w ||            d S )Nr   )display)IPython.displayr[  ImportError)r   rendererr[  s      r7   
display_fnz#output.__call__.<locals>.display_fni  sO    7777777"   FFs   	 
)linecellcell_runnerhelp_prompt)r`  rc  rb   )r   	TypeErrorro   r   r   r   rX  extract_keywordsr   allowedr   r   )r@   r_   r   rc  r`  r   rt   r_  s           r7   rd   zoutput.__call__V  s   N	ct99q==WXXXt99>>*T!Wc":":>q'CCYY!^^7DDYY!^^KT3c;'' 	X K/@@rJJ\\^^ < <E1999"#:q#:#:;;; :   !( Md*5@M MDKM M M M M_J!(WdWWwWWWWWr9   )	rD   rE   rF   rG   r]   r4  r  rd   rH   rI   s   @r7   r   r      st         B* * * * * % % [%X X X X X X Xr9   r   )r7  c                    	 | t           j        vrKt           j        }t           j        t           j        vrd}t          |            |rt          j        |           t           j        |          S # t
          $ rU}d}d                    d t           j        D                       }t          |                    | |                    |d}~ww xY w)zM
    Helper utility to access the active renderer for a given extension.
    NzICould not find a {name!r} renderer, available renderers are: {available}.r
  c              3   4   K   | ]}t          |          V  d S r[   rh   rs   s     r7   rm   zrenderer.<locals>.<genexpr>  s(      ??!d1gg??????r9   )name	available)r   r   r   r	   set_current_backendr]  r)   r   )ri  prev_backendr   rB   rj  s        r7   r^  r^  {  s    Mu&& 0L$EO;;#dOOO 8),777t$$ M M MZII??u?????	#**$)*DDEE1LMs   A*A- -
C7ACCc                   Z    e Zd ZdZddddZ ee          ZdZd Z	e
d             Zd	 Zd
S )r	   z
    Helper utility used to load holoviews extensions. These can be
    plotting extensions, element extensions or anything else that can be
    registered to work with HoloViews.
    mplbokehplotly)
matplotlibro  rp  Fc                     |                     di           }t          j        j        j        d"i |  fd|D             }t          |                                          D ]0\  }}| j        v r"|                    | j        |         f           1|sdg}dg}t          |          }d }|D ]\  }}		 t          |           n0# t          $ r#  j                            | d| d           Y nw xY w	 t          d|	            ||}n# t          j        $ r;}
 j                            d| d	| d
|
j         d|
j         d	           Y d }
~
nPd }
~
wt           $ r@}
 j                            d| dt#          |
          j         d|
 d           Y d }
~
nd }
~
ww xY wt'                      t(          j        j        d<   t/          d|          t(          j        j        d<   t/          d|          t(          j        j        d<   ni# t'                      t(          j        j        d<   t/          d|          t(          j        j        d<   t/          d|          t(          j        j        d<   w xY w j        |         D ]F}	  |             # t           $ r,}
 j                            | d| d|
            Y d }
~
?d }
~
ww xY w|t          d          t)          j        |           dd l}|                    dd          r|dk    r|                    d           |j        j        dk    rZdt<          j        v rd|j        _        d S dt@          j!        v sd t@          j!        v r$d!|j        _         "                                 d S d S d S )#Nconfigc                 @    g | ]}|j         v |j         |         fS rb   )	_backends)rk   argr@   s     r7   rz   z&extension.__call__.<locals>.<listcomp>  s;     - - -#T^++ ,-+++r9   rq  )rq  rn  z could not be imported, ensure z is installed.zholoviews.plotting.z
HoloViews z. extension could not be loaded. The installed z	 version z# is less than the required version r{   z
Holoviews zE extension could not be imported, it raised the following exception: z('z')r   figholomapz backend hook z" failed with following exception: z&None of the backends could be importedr   enable_mathjaxFro  mathjaxrX   zgoogle.colabcolab
VSCODE_CWD
VSCODE_PIDvscoderb   )#popr   rs  r   updater   r   ru  r   r   
__import__r]  r   VersionErrorversionmin_versionr   typerD   r    r   rX  rf  r!   _backend_hooksrk  panelr   r	   commsr   modulesr%   environ_ignore_bokeh_warnings)r@   r_   rc   rs  importsp_valselected_backendr   impr   hookpns   `            r7   rd   zextension.__call__  s   Hb)) **6***- - - - - - -fllnn-- 	7 	7GAtDN""4>!#45666 	. >D,-GDzz# 	D 	DLGSg7#### g g g
""g#e#eg#e#e#efffffg\666777#+'.$$ > > >
""= = =%,= =78y= =,-M= = => > > > > > > >  U U U
""T T T:>q'':JT TNOT T TU U U U U U U UU
 <I??%-i87CE77S7S%-e4;G	SZ;[;[%-i88 <I??%-i87CE77S7S%-e4;G	SZ;[;[%-i8[[[[+G4 D DDDFFFF  D D DJ&&' (C (C (C (C?@(C (C D D D D D D D DDD #FGGG!"2333::&.. 	$3Cw3N3NLL###9?i'',,")	rz))\RZ-G-G"*	++--- ('
 .H-Gsm   5C*C21C26DHF1EHF6FHFHA&I- 
J
K"J<<Kc                 F    | j         |                             |           dS )z6Registers a hook which is run when a backend is loadedN)r  r   )r   r   callbacks      r7   register_backend_callbackz#extension.register_backend_callback  s&     	7#**844444r9   c                 J    dd l }ddlm} |                    d|d           d S )Nr   )BokehUserWarningr#   zreference already known)categorymessage)warningsbokeh.util.warningsr  filterwarnings)r@   r  r  s      r7   r  z extension._ignore_bokeh_warnings  s@    8888883CMfgggggr9   N)rD   rE   rF   rG   ru  r   r   r  _loadedrd   r4  r  r  rb   r9   r7   r	   r	     s           %!#% %I
 ![&&NG= = =~ 5 5 [5h h h h hr9   r	   autocdnc                    |pt           j        }t          |          }|sO|dk    rI|dk    s*t          |t                    r.|                    d          r|                     ddd          } n||s|                     d          } |r |j        di |}t          |t                    r!t	          |	                                          }t          |t                    r{d |j
                                        D             }	|                    d          }
|d	k    r|
r|
d
         dk    r|
d
         }|
d
         |	v rd                    |
dd
                   }|                    | ||||          S )ap  
    Saves the supplied object to file.

    The available output formats depend on the backend being used. By
    default and if the filename is a string the output format will be
    inferred from the file extension. Otherwise an explicit format
    will need to be specified. For ambiguous file extensions such as
    html it may be necessary to specify an explicit fmt to override
    the default, e.g. in the case of 'html' output the widgets will
    default to fmt='widgets', which may be changed to scrubber widgets
    using fmt='scrubber'.

    Arguments
    ---------
    obj: HoloViews object
        The HoloViews object to save to file
    filename: string or IO object
        The filename or BytesIO/StringIO object to save to
    fmt: string
        The format to save the object as, e.g. png, svg, html, or gif
        and if widgets are desired either 'widgets' or 'scrubber'
    backend: string
        A valid HoloViews rendering backend, e.g. bokeh or matplotlib
    resources: string or bokeh.resource.Resources
        Bokeh resources used to load bokehJS components. Defaults to
        CDN, to embed resources inline for offline usage use 'inline'
        or bokeh.resources.INLINE.
    toolbar: bool or None
        Whether to include toolbars in the exported plot. If None,
        display the toolbar unless fmt is `png` and backend is `bokeh`.
        If `True`, always include the toolbar.  If `False`, do not include the
        toolbar.
    title: string
        Custom title for exported HTML file
    **kwargs: dict
        Additional keyword arguments passed to the renderer,
        e.g. fps for animations
    ro  pngNT)toolbarr   r   )r  c                     g | ]	}|D ]}|
S rb   rb   )rk   tformatsmfmts      r7   rz   zsave.<locals>.<listcomp>   s<     + + +h!)+ +  + + + +r9   r{   r  html)fmt	resourcestitlerb   )r   r   r^  ro   r   endswithrK   instancer   absolutemode_formatsr   r   r)   save)r   rO  r  r   r  r  r  r`   renderer_obj	supportedformatss              r7   r  r    s   N ..GG$$L%wE\\j377\H<M<Me<T<T\hhtWDhAA		W	hhth$$ 7,|,66v66(D!! ,x((**++(C   .+ +,*C*J*J*L*L + + +	..%%&==W=)>)>"+C2;)##xx--HS(y#(  * * *r9   c                    |pt           j        }t          |          }|r |j        di |}|dk    rC|                    |           }t          |          dk    r|                    |j                  S |                    |           S )a  
    Renders the HoloViews object to the corresponding object in the
    specified backend, e.g. a Matplotlib or Bokeh figure.

    The backend defaults to the currently declared default
    backend. The resulting object can then be used with other objects
    in the specified backend. For instance, if you want to make a
    multi-part Bokeh figure using a plot type only available in
    HoloViews, you can use this function to return a Bokeh figure that
    you can use like any hand-constructed Bokeh figure in a Bokeh
    layout.

    Arguments
    ---------
    obj: HoloViews object
        The HoloViews object to render
    backend: string
        A valid HoloViews rendering backend
    **kwargs: dict
        Additional keyword arguments passed to the renderer,
        e.g. fps for animations

    Returns
    -------
    rendered:
        The rendered representation of the HoloViews object, e.g.
        if backend='matplotlib' a matplotlib Figure or FuncAnimation
    rq  r   )fpsrb   )	r   r   r^  r  get_plotr   animr  get_plot_state)r   r   r`   r  plots        r7   renderr  +  s    : ..GG$$L 7,|,66v66,$$S))t99q==99!19222&&s+++r9   c                      e Zd ZdZ ej        d d          Z ej        i d          Z ej	        dd          Z
 ej	        dd          Z ej	        d	d
          Z ej        dg eefddej        Zd ZddZddZd Zd ZdS )Dynamica  
    Dynamically applies a callable to the Elements in any HoloViews
    object. Will return a DynamicMap wrapping the original map object,
    which will lazily evaluate when a key is requested. By default
    Dynamic applies a no-op, making it useful for converting HoloMaps
    to a DynamicMap.

    Any supplied kwargs will be passed to the callable and any streams
    will be instantiated on the returned DynamicMap. If the supplied
    operation is a method on a parameterized object which was
    decorated with parameter dependencies Dynamic will automatically
    create a stream to watch the parameter changes. This default
    behavior may be disabled by setting watch=False.
    c                     | S r[   rb   r   s    r7   r   zDynamic.<lambda>c  s     r9   z@
        Operation or user-defined callable to apply dynamicallyrW   z2
        Keyword arguments passed to the function.Ta  
         If Dynamic is applied to another DynamicMap, determines whether
         linked streams and links attached to its Callable inputs are
         transferred to the output of the utility.

         For example if the Dynamic utility is applied to a DynamicMap
         with an RangeXY, this switch determines whether the
         corresponding visualization should update this stream with
         range changes originating from the newly generated axes.a  
         Determines whether the output of the operation should inherit
         the .dataset property of the input to the operation. Helpful
         for tracking data providence for user supplied functions,
         which do not make use of the clone method. Should be disabled
         for operations where the output is not derived from the input
         and instead depends on some external state.FzA
        Whether the cloned DynamicMap will share the same cache.z=
        List of streams to attach to the returned DynamicMap)rX   class_rY   c                    |                     dd          }t          j        | |          | _        |                     |          |                     ||          }t          |t                    rqt          | j        j	        |          }| j        j
        r
|j        |d<    |j        di |}| j        j	        r%t          fd|j        D                       |_        n|                     ||          }|S )NwatchT)shared_datar  streamsplot_idc                 .    g | ]\  }}| j         | fS rb   )callable)rk   rt   rq   r  s      r7   rz   z$Dynamic.__call__.<locals>.<listcomp>  sC     "A "A "A.2a $%&7h&7&;"< "A "A "Ar9   rb   )r  r   ParamOverridesr  _dynamic_operation_get_streamsro   r   rp   r  link_inputs_plot_idr   data_make_dynamic)r@   map_objrc   r  r  r`   dmapr  s          @r7   rd   zDynamic.__call__  s'   

7D))%dF33**733##GU33gz** 	B F.7  F v! 5$+$4y! 7=**6**Dv! B  "A "A "A "A6:i"A "A "A B B	 %%gxAADr9   c                 f
   t          | j        j        t                    r
t	          t                    }g i }}| j        j                                        D ]\  }}t          |t          j                  st          dt          |          z            t          j        |j                  rFt          |j        t                    r,|j        |k    r|||j                 |j        <   i ||j        <   |||<   t!          |          }|d |                                D             z  }n| j        j        }g }| j        j        |D ]8}t          j        |          r t          |t                    r |            }nMt          |t                    s8t%          j        |          s$t          dt          |          j        z            t          t*                    rfd|j                                        D             }	t          |t.                    sCd |j                                        D             fd|	                                D             }	 |j        di |	 |                    |           :i }| j        j                                        D ]s\  }
}dt8          j        v r"dd	lm} t          ||          r|j        j         }t          |t          j                  r$t          |j        t          j!                  r|||
<   t|t/          j"        |          z  }t          |tF                    r8t%          j$        |          }tK          t%          j&        ||z                       }t%          j        d
          p$t          tN                    otQ          d          }|r|r|                               | j        j        )                                D ]}t%          j        |d
          r|                    |           .t          |tN                    rtQ          |d          rtK          |j*        +                    dg                     }|tK          |j*        +                    di           )                                          z  }d |D             }|                    t/          |d
                     t          j,        |          \  }}|rBd}t[          |.                    d/                    d |D                                           |S )aC  
        Generates a list of streams to attach to the returned DynamicMap.
        If the input is a DynamicMap any streams that are supplying values
        for the key dimension of the input are inherited. And the list
        of supplied stream classes and instances are processed and
        added to the list.
        zXStream dictionary must map operation keywords to parameter names. Cannot handle %r type.c                 ,    g | ]\  }} ||           S ))renamerb   )rk   streamr  s      r7   rz   z(Dynamic._get_streams.<locals>.<listcomp>  s)    YYY~vvVV6222YYYr9   z:Streams must be Stream classes or instances, found %s typec                 b    i | ]+\  }}||j         v |j                             |          ,S r[   )r  r   )rk   rt   rq   ops      r7   r~   z(Dynamic._get_streams.<locals>.<dictcomp>  sA     7 7 7daiAII bdhhqkk,5IIr9   c                     i | ]\  }}||	S rb   rb   r   s      r7   r~   z(Dynamic._get_streams.<locals>.<dictcomp>  s    GGG1q!GGGr9   c                 D    i | ]\  }}                     ||          |S rb   )r   )rk   rt   rq   reverses      r7   r~   z(Dynamic._get_streams.<locals>.<dictcomp>  s-    PPP1w{{1a00!PPPr9   r  r   )WidgetT)has_deps_dinfodependenciesr1  c                     g | ]=}t          |t          j                  t          |j        t          j                  ;|>S rb   )ro   r   r   ownerParameterized)rk   ds     r7   rz   z(Dynamic._get_streams.<locals>.<listcomp>  sV     H H HZ5?5S5S H(%2EFFH! H H Hr9   )
parameters
watch_onlyzPThe supplied streams list contains objects that are not Stream instances: {objs}r
  c              3      K   | ]}|V  d S r[   rb   r  s     r7   rm   z'Dynamic._get_streams.<locals>.<genexpr>  s$      7T7Tb2	7T7T7T7T7T7Tr9   )objsrb   )0ro   r  r  rp   r   r   r   r   r   r  rD  isclassr  
issubclassr   ri  r   	operationr   is_param_methodrD   r   contentsr   _renamer  r   r`   r   r  panel.widgets.baser  r   r  from_paramsr   dimensioned_streamsr   unique_iteratorr   hasattrr   r  r   _process_streamsrd  r   r)   )r@   r  r  r  stream_specsrc   ri  r  r  updatesrt   rq   r  dim_streamshas_dependenciesr   r  r'  r#  rB   r  r  s                       @@r7   r  zDynamic._get_streams  s@    dfnd++ 	*!$''G#%r&L6>//11 % %a!!U_55 0$ &R'+Aww&/ 0 0 0 ?17++ %
17F0K0K %v~~37(00+-((#$F4LL1&99L YYYYYYLL6>LV" 	# 	#Fv&& 8:ff+E+E 8 00 8D4H4P4P 8 !]!%f!6"7 8 8 8"i(( )7 7 7 7fo6K6K6M6M 7 7 7!&&11 QGG0D0D0F0FGGGGPPPPPPPG(((((NN6""""FM'')) 	 	DAq#+%%555555a(( &A!U_-- *QWeFY2Z2Z q	6%f--- gz** 	H27;;K4/+0EFFGGG !0dCCC S&r<88RWR=R=R 	 	 	NN2 V]))++ 	K 	KE#ED999 Ku%%%%E<00 KWUH5M5M K#EL$4$4^R$H$HIIU\%5%5dB%?%?%F%F%H%H I IIH H\ H H HvDIIIJJJ099w 	W6CCJJdii7T7TG7T7T7T.T.TJUUVVVr9   Nc                     |i }t          j         j        j                  r2t          j         j        j                  |u r  j        j        di |S t           j        j        t                    r9 fd|                                D             }  j        j        j        ||fi |S   j        j        |fi |S )Nc                 B    i | ]\  }}|j         j        j        v ||S rb   )r  r  r   )rk   rt   rq   r@   s      r7   r~   z$Dynamic._process.<locals>.<dictcomp>  s1    UUUtq!df>N>T9T9Ta9T9T9Tr9   rb   )	r   r  r  r  get_method_ownerro   r   r   process_element)r@   r  r  r`   s   `   r7   _processzDynamic._process  s    >F 011 	7d6KDFL\6]6]ah6h6h#46#--f---()44 	7UUUUv||~~UUUF346#3GSKKFKKK#46#G66v666r9   c                      fd fdfd} j         j        } j         j        }t          |t                    st          j                  }d|i}t          |g j         j        ||          S )zx
        Generate function to dynamically apply the operation.
        Wraps an existing HoloMap or DynamicMap.
        c                     t          t                    s| fS t          t                    r)j        r"| s t	          fdj        D                       } | |          fS )Nc              3   (   K   | ]}|         V  d S r[   rb   )rk   rt   r`   s     r7   rm   z>Dynamic._dynamic_operation.<locals>.resolve.<locals>.<genexpr>  s'      DD!F1IDDDDDDr9   )ro   r   r   _posarg_keysr:  )r  r`   r  s    `r7   resolvez+Dynamic._dynamic_operation.<locals>.resolve  s|    gw// EG|#GZ00 EW5I ERU EDDDDw/CDDDDD$$r9   c                    t          t          j        j        j                  fi |}                    | ||          }j        j        r=t          | t                    r(t          |t                    r|j	        | j
        |_	        |S r[   )rp   r   resolve_dependent_kwargsr  r`   r  link_datasetro   r   _datasetdataset)r  r  r`   	processedr@   s       r7   applyz)Dynamic._dynamic_operation.<locals>.apply  s    $7FFQQ&QQFgsF;;I# 5
7G(D(D 59g..53<3E3M%,_	"r9   c                  :     | |          \  } } |g| R i |S r[   rb   )r  r`   r   r  r  s      r7   dynamic_operationz5Dynamic._dynamic_operation.<locals>.dynamic_operation  s8    wsF++HC5-s---f---r9   )fnr`   )inputsr  r  operation_kwargs)	r  r  r`   ro   r   r   r  r   r  )r@   r  r  r  	op_kwargsr  r  s   ``   @@r7   r  zDynamic._dynamic_operation  s    
	% 	% 	% 	% 	%	 	 	 	 		. 	. 	. 	. 	. 	. F$	FM	)Y// 	. )U333I!9-I !2G9-1V-?+42;= = = 	=r9   c                    t          |t                    rFt          ||          }t          |t                    rt	          |          |j        j        dd<   |S t          |j        	                                 }t          j        |          }d t          |j        |          D             }t          |fd|it          ||          S )z
        Accepts a HoloMap and a dynamic callback function creating
        an equivalent DynamicMap from the HoloMap.
        )r  Nc           	      ~    g | ]:\  }}|                     t          t          j        |                               ;S )r   )r   r   r   r  )rk   r  r   s      r7   rz   z)Dynamic._make_dynamic.<locals>.<listcomp>'  sI     . . .	6T%9&%A%A B BCC . . .r9   r  )kdims)ro   r   r   r   r   r  r  zipr  r   r   get_param_valuesr  rp   )r@   hmap
dynamic_fnr  r  
dim_valuesrc   r  s           r7   r  zDynamic._make_dynamic  s    
 dO,, 	j':::D$(( 5*.t**$QQQ'K$)..**+
&t,,. .TZ,,. . .*SSgSfE9R9R9RSSSr9   rb   )TrI  )rD   rE   rF   rG   r   Callabler  Dictr`   rJ  r  r  r  ClassSelectorr   rp   r   disallow_refsr  rd   r  r  r  r  rb   r9   r7   r  r  S  sp         {{ 9C D D DI UZ )5 6 6 6F  %- 3E F F FK !5= 48 9 9 9L  %- 4D E E EK "e! W"dD\ H@ W WCGCUW WG  (V V V Vp	7 	7 	7 	7 =  =  =FT T T T Tr9   r  )r  Nr  NNr[   )CrD  r%   r,   r   collectionsr   r   r   pathlibr   typesr   r   pyviz_commsr	   _pyviz_extensioncorer   r   r   r   r   r   r   r   core.operationr   r   core.optionsr   r   r   core.overlayr   	core.utilr   operation.elementr   r  r   r   r   settingsr   r    r!   rX  __file__r8   parameterizedParameterizedMetaclassr;   ParameterizedFunctionrK   _backend_switch_hooksr   rH  r   _generate_docstringrG   _generate_signaturer]   r3  r^  r  r  r  rb   r9   r7   <module>r)     s    				  



 # # # # # # ( ( ( ( ( ( ( (              5 5 5 5 5 5	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 : 9 9 9 9 9 9 9 < < < < < < < < < < " " " " " " - - - - - - ( ( ( ( ( ( < < < < < < < < < < A A A A A A A A A A&  'U * * * **0 0 0 0 0u"9 0 0 0"Q/ Q/ Q/ Q/ Q/5&( Q/ Q/ Q/ Q/h   " "4#7 8 8 8UX UX UX UX UXU( UX UX UXn &::U:KK % 5 I I K K M M M&Yh Yh Yh Yh Yh  Yh Yh Yhx>* >* >* >*B%, %, %, %,PVT VT VT VT VTe) VT VT VT VT VTr9   