ó
mÜJ]c           @` s½  d  Z  d d l m Z m Z m Z m Z d d l Z e j e ƒ Z	 d d l
 m Z d d l m Z d d l m Z m Z d d l m Z d d	 l m Z m Z m Z m Z m Z d d
 l 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% d d l& m' Z' d d l( m) Z) d d d f Z* d „  Z+ d „  Z, d „  Z- d e f d „  ƒ  YZ. d Z/ d e' e. e e$ e% ƒ f d „  ƒ  YZ0 d „  Z1 e2 e3 e4 h Z5 d „  Z6 d S(   u`    Provide a base class for all objects (called Bokeh Models) that can go in
a Bokeh |Document|.

i    (   t   absolute_importt   divisiont   print_functiont   unicode_literalsN(   t   loads(   t
   itemgetter(   t	   iteritemst   string_typesi   (   t   serialize_json(   t   Anyt   Dictt   Instancet   Listt   String(   t   HasPropst   MetaHasProps(   t   find(   t   Event(   t   default(   t   PropertyCallbackManagert   EventCallbackManager(   t   with_metaclass(   t   make_idu   collect_modelsu	   get_classu   Modelc         ` s§   t  g  ƒ ‰ g  } g  ‰ ‡  ‡ ‡ f d †  } x | D] } t | | ƒ q4 WxU ˆ r¢ ˆ j d ƒ } | j ˆ k rN ˆ j | j ƒ | j | ƒ t | | ƒ qN qN W| S(   uî   Collect a duplicate-free list of all other Bokeh models referred to by
    this model, or by any of its references, etc, unless filtered-out by the
    provided callable.

    Iterate over ``input_values`` and descend through their structure
    collecting all nested ``Models`` on the go.

    Args:
        *discard (Callable[[Model], bool])
            a callable which accepts a *Model* instance as its single argument
            and returns a boolean stating whether to discard the instance. The
            latter means that the instance will not be added to collected
            models nor will its references be explored.

        *input_values (Model)
            Bokeh models to collect other models from

    Returns:
        None

    c         ` s<   |  j  ˆ k r8 t ˆ  ƒ o$ ˆ  |  ƒ r8 ˆ j |  ƒ n  d  S(   N(   t   idt   callablet   append(   t   obj(   t   discardt   idst   queued(    s*   lib/python2.7/site-packages/bokeh/model.pyt	   queue_oneY   s    (i    (   t   sett)   _visit_value_and_its_immediate_referencest   popR   t   addR   t!   _visit_immediate_value_references(   R   t   input_valuest	   collectedR   t   valueR   (    (   R   R   R   s*   lib/python2.7/site-packages/bokeh/model.pyt   collect_filtered_models>   s    	c          G` s   t  d |  Œ S(   uå   Collect a duplicate-free list of all other Bokeh models referred to by
    this model, or by any of its references, etc.

    Iterate over ``input_values`` and descend through their structure
    collecting all nested ``Models`` on the go. The resulting list is
    duplicate-free based on objects' identifiers.

    Args:
        *input_values (Model)
            Bokeh models to collect other models from

    Returns:
        list[Model] : all models reachable from this one.

    N(   R'   t   None(   R$   (    (    s*   lib/python2.7/site-packages/bokeh/model.pyt   collect_modelsi   s    c         C` sY   d d l  m } | d d l m } | t j } |  | k rE | |  St d |  ƒ ‚ d S(   uê   Look up a Bokeh model class, given its view model name.

    Args:
        view_model_name (str) :
            A view model name for a Bokeh model to look up

    Returns:
        Model: the model class corresponding to ``view_model_name``

    Raises:
        KeyError, if the model cannot be found

    Example:

        .. code-block:: python

            >>> from bokeh.model import get_class
            >>> get_class("Range1d")
            <class 'bokeh.models.ranges.Range1d'>

    i   (   t   models(   t   Figureu   View model name '%s' not foundN(   t    R*   t   plottingR+   t	   MetaModelt   model_class_reverse_mapt   KeyError(   t   view_model_nameR*   R+   t   d(    (    s*   lib/python2.7/site-packages/bokeh/model.pyt	   get_class{   s      	R.   c           B` s   e  Z d  Z i  Z d „  Z RS(   u½	   Specialize the construction of |Model| classes.

    This class is a `metaclass`_ for |Model| that is responsible for
    automatically cataloging all Bokeh models that get defined, so that the
    serialization machinery between Bokeh and BokehJS can function properly.

    .. note::
        It is worth pointing out explicitly that this relies on the rules
        for Metaclass inheritance in Python.

    Bokeh works by replicating Python model objects (e.g. plots, ranges,
    data sources, which are all |HasProps| subclasses) into BokehJS. In the
    case of using a Bokeh server, the Bokeh model objects can also be
    synchronized bidirectionally. This is accomplished by serializing the
    models to and from a JSON format, that includes the name of the model type
    as part of the payload, as well as a unique ID, and all the attributes:

    .. code-block:: javascript

        {
            type: "Plot",
            id: 100032,
            attributes: { ... }
        }

    Typically the type name is inferred automatically from the Python class
    name, and is set as the ``__view_model__`` class attribute on the Model
    class that is create. But it is also possible to override this value
    explicitly:

    .. code-block:: python

        class Foo(Model): pass

        class Bar(Model):
            __view_model__ == "Quux"

    This metaclass will raise an error if two Bokeh models are created that
    attempt to have the same view model name. The only exception made is if
    one of the models has a custom ``__implementation__`` in its class
    definition.

    This metaclass also handles subtype relationships between Bokeh models.
    Occasionally it may be necessary for multiple class types on the Python
    side to resolve to the same type on the BokehJS side. This is called
    subtyping, and is expressed through a ``__subtype__`` class attribute on
    a model:

    .. code-block:: python

        class Foo(Model): pass

        class Bar(Foo):
            __view_model__ = "Foo"
            __subtype__ = "Bar"

    In this case, python instances of ``Foo`` and ``Bar`` will both resolve to
    ``Foo`` models in BokehJS. In the context of a Bokeh server application,
    the original python types will be faithfully round-tripped. (Without the
    ``__subtype__`` specified, the above code would raise an error due to
    duplicate view model names.)

    .. _metaclass: https://docs.python.org/3/reference/datamodel.html#metaclasses

    c         C` s£   d | k r | | d <n  t  t |  ƒ j |  | | | ƒ } | j d | d ƒ } | t j k r’ t | d ƒ r’ t d | | t j | f ƒ ‚ n  | t j | <| S(   u/   

        Raises:
            Warning

        u   __view_model__u   __subtype__u   __implementation__ub   Duplicate __view_model__ or __subtype__ declaration of '%s' for class %s.  Previous definition: %s(   t   superR.   t   __new__t   getR/   t   hasattrt   Warning(   t   meta_clst
   class_namet   basest
   class_dictt   newclst   entry(    (    s*   lib/python2.7/site-packages/bokeh/model.pyR5   ç   s    	!(   t   __name__t
   __module__t   __doc__R/   R5   (    (    (    s*   lib/python2.7/site-packages/bokeh/model.pyR.   ¢   s   Auá  
<script>
(function() {
  var expanded = false;
  var ellipsis = document.getElementById("%(ellipsis_id)s");
  ellipsis.addEventListener("click", function() {
    var rows = document.getElementsByClassName("%(cls_name)s");
    for (var i = 0; i < rows.length; i++) {
      var el = rows[i];
      el.style.display = expanded ? "none" : "table-row";
    }
    ellipsis.innerHTML = expanded ? "&hellip;)" : "&lsaquo;&lsaquo;&lsaquo;";
    expanded = !expanded;
  });
})();
</script>
t   Modelc           B` sv  e  Z d  Z d „  Z d „  Z d „  Z e Z e d „  ƒ Z e	 d d ƒ Z
 e e d d ƒZ e e	 e e d ƒ ƒ d d	 ƒZ e e	 d d
 ƒZ e e	 e e d ƒ ƒ d d ƒZ e d „  ƒ Z e d „  ƒ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d d d „ Z! d „  Z" e# d „  ƒ Z$ d „  Z% d „  Z& d „  Z' RS(    uH    Base class for all objects stored in Bokeh  |Document| instances.

    c         O` sF   t  t |  ƒ j |  ƒ } | j d t ƒ  ƒ | _ d  | _ d  | _ | S(   Nu   id(	   R4   RB   R5   R!   R   t   _idR(   t	   _documentt   _temp_document(   t   clst   argst   kwargsR   (    (    s*   lib/python2.7/site-packages/bokeh/model.pyR5     s
    		c         K` s7   | j  d d  ƒ t t |  ƒ j |   t j |  ƒ d  S(   Nu   id(   R!   R(   R4   RB   t   __init__t   default_themet   apply_to_model(   t   selfRH   (    (    s*   lib/python2.7/site-packages/bokeh/model.pyRI      s    c         C` s    d |  j  j t |  d d  ƒ f S(   Nu   %s(id=%r, ...)u   id(   t	   __class__R?   t   getattrR(   (   RL   (    (    s*   lib/python2.7/site-packages/bokeh/model.pyt   __str__6  s    c         C` s   |  j  S(   N(   RC   (   RL   (    (    s*   lib/python2.7/site-packages/bokeh/model.pyR   ;  s    t   helpu  
    An arbitrary, user-supplied name for this model.

    This name can be useful when querying the document to retrieve specific
    Bokeh models.

    .. code:: python

        >>> plot.circle([1,2,3], [4,5,6], name="temp")
        >>> plot.select(name="temp")
        [GlyphRenderer(id='399d53f5-73e9-44d9-9527-544b761c7705', ...)]

    .. note::
        No uniqueness guarantees or other conditions are enforced on any names
        that are provided, nor is the name used directly by Bokeh for any
        reason.

    uÏ  
    An optional list of arbitrary, user-supplied values to attach to this
    model.

    This data can be useful when querying the document to retrieve specific
    Bokeh models:

    .. code:: python

        >>> r = plot.circle([1,2,3], [4,5,6])
        >>> r.tags = ["foo", 10]
        >>> plot.select(tags=['foo', 10])
        [GlyphRenderer(id='1de4c3df-a83d-480a-899b-fb263d3d5dd9', ...)]

    Or simply a convenient way to attach any necessary metadata to a model
    that can be accessed by ``CustomJS`` callbacks, etc.

    .. note::
        No uniqueness guarantees or other conditions are enforced on any tags
        that are provided, nor are the tags used directly by Bokeh for any
        reason.

    u   bokeh.models.callbacks.CustomJSuQ  
    A mapping of event names to lists of ``CustomJS`` callbacks.

    Typically, rather then modifying this property directly, callbacks should be
    added using the ``Model.js_on_event`` method:

    .. code:: python

        callback = CustomJS(code="console.log('tap event occurred')")
        plot.js_on_event('tap', callback)
    u¬   
    List of events that are subscribed to by Python callbacks. This is
    the set of events that will be communicated from BokehJS back to
    Python for this model.
    u”  
    A mapping of attribute names to lists of ``CustomJS`` callbacks, to be set up on
    BokehJS side when the document is created.

    Typically, rather then modifying this property directly, callbacks should be
    added using the ``Model.js_on_change`` method:

    .. code:: python

        callback = CustomJS(code="console.log('stuff')")
        plot.x_range.js_on_change('start', callback)

    c         C` s   |  j  d k	 r |  j  S|  j S(   uE    The |Document| this model is attached to (can be ``None``)

        N(   RE   R(   RD   (   RL   (    (    s*   lib/python2.7/site-packages/bokeh/model.pyt   document  s    c         C` sP   d |  j  j k r4 i |  j d 6|  j d 6|  j d 6Si |  j d 6|  j d 6Sd S(   uC   A Bokeh protocol "reference" to this model, i.e. a dict of the
        form:

        .. code-block:: python

            {
                'type' : << view model name >>
                'id'   : << unique model id >>
            }

        Additionally there may be a `subtype` field if this model is a subtype.

        u   __subtype__u   typeu   subtypeu   idN(   RM   t   __dict__t   __view_model__t   __subtype__R   (   RL   (    (    s*   lib/python2.7/site-packages/bokeh/model.pyt   ref–  s    


c         G` sŒ   t  | t ƒ r+ t | t ƒ r+ | j } n  | |  j k rJ g  |  j | <n  x; | D]3 } | |  j | k rp qQ n  |  j | j | ƒ qQ Wd  S(   N(   t
   isinstanceR   t
   issubclassR   t
   event_namet   js_event_callbacksR   (   RL   t   eventt	   callbackst   callback(    (    s*   lib/python2.7/site-packages/bokeh/model.pyt   js_on_event³  s    c         C` sÄ   | |  j  ƒ  k r+ t d | |  f ƒ ‚ n  t | t ƒ sM t d | ƒ ‚ n  | | j  ƒ  k rx t d | | f ƒ ‚ n  d d l m } | d t d | ƒ d d	 | | f ƒ } |  j | | ƒ d
 S(   u   Link two Bokeh model properties using JavaScript.

        This is a convenience method that simplifies adding a CustomJS callback
        to update one Bokeh model property whenever another changes value.

        Args:

            attr (str) :
                The name of a Bokeh property on this model

            other (Model):
                A Bokeh model to link to self.attr

            other_attr (str) :
                The property on ``other`` to link together

        Added in version 1.1

        Raises:

            ValueError

        Examples:

            This code with ``js_link``:

            .. code :: python

                select.js_link('value', plot, 'sizing_mode')

            is equivalent to the following:

            .. code:: python

                from bokeh.models import CustomJS
                select.js_on_change('value',
                    CustomJS(args=dict(other=plot),
                             code="other.sizing_mode = this.value"
                    )
                )

        u!   %r is not a property of self (%r)u    'other' is not a Bokeh model: %ru"   %r is not a property of other (%r)i    (   t   CustomJSRG   t   othert   codeu   other.%s = this.%sN(   t
   propertiest
   ValueErrorRV   RB   t   bokeh.models.callbacksR^   t   dictt   js_on_change(   RL   t   attrR_   t
   other_attrR^   t   cb(    (    s*   lib/python2.7/site-packages/bokeh/model.pyt   js_linkÁ  s    +(c         ` s  t  | ƒ d k r! t d ƒ ‚ n  d d l m ‰  t ‡  f d †  | Dƒ ƒ s\ t d ƒ ‚ n  | |  j ƒ  k r{ d | } n  d „  |  j j ƒ  Dƒ } | |  j k r³ g  |  j | <n  x; | D]3 } | |  j | k rÙ qº n  |  j | j | ƒ qº W|  j	 d | |  j ƒ d	 S(
   u‚   Attach a ``CustomJS`` callback to an arbitrary BokehJS model event.

        On the BokehJS side, change events for model properties have the
        form ``"change:property_name"``. As a convenience, if the event name
        passed to this method is also the name of a property on the model,
        then it will be prefixed with ``"change:"`` automatically:

        .. code:: python

            # these two are equivalent
            source.js_on_change('data', callback)
            source.js_on_change('change:data', callback)

        However, there are other kinds of events that can be useful to respond
        to, in addition to property change events. For example to run a
        callback whenever data is streamed to a ``ColumnDataSource``, use the
        ``"stream"`` event on the source:

        .. code:: python

            source.js_on_change('streaming', callback)

        i    uR   js_on_change takes an event name and one or more callbacks, got only one parameter(   R^   c         3` s   |  ] } t  | ˆ  ƒ Vq d  S(   N(   RV   (   t   .0t   x(   R^   (    s*   lib/python2.7/site-packages/bokeh/model.pys	   <genexpr>  s    u.   not all callback values are CustomJS instancesu	   change:%sc         S` s2   i  |  ]( \ } } g  | D] } | ^ q | “ q S(    (    (   Rj   t   kt   cbsRh   (    (    s*   lib/python2.7/site-packages/bokeh/model.pys
   <dictcomp>  s   	 u   js_property_callbacksN(
   t   lenRb   Rc   R^   t   allRa   t   js_property_callbackst   itemsR   t   trigger(   RL   RZ   R[   t   oldR\   (    (   R^   s*   lib/python2.7/site-packages/bokeh/model.pyRe   ú  s    c         C` s&   y |  t  | | ƒ k SWn g  SXd S(   u
   

        N(   RN   (   RL   t   sidet   plot(    (    s*   lib/python2.7/site-packages/bokeh/model.pyt   layout&  s    c         G` sN   | |  j  ƒ  k r1 t d |  j j | f ƒ ‚ n  t t |  ƒ j | | Œ d S(   uy   Add a callback on this object to trigger when ``attr`` changes.

        Args:
            attr (str) : an attribute name on this object
            *callbacks (callable) : callback functions to register

        Returns:
            None

        Example:

        .. code-block:: python

            widget.on_change('value', callback1, callback2, ..., callback_n)

        u9   attempted to add a callback on nonexistent %s.%s propertyN(   Ra   Rb   RM   R?   R4   RB   t	   on_change(   RL   Rf   R[   (    (    s*   lib/python2.7/site-packages/bokeh/model.pyRw   /  s    c         C` s   t  t |  ƒ ƒ S(   uE    Returns all ``Models`` that this object has references to.

        (   R   R)   (   RL   (    (    s*   lib/python2.7/site-packages/bokeh/model.pyt
   referencesD  s    c         C` s   t  |  j ƒ  | ƒ S(   uÄ    Query this object and all of its references for objects that
        match the given selector.

        Args:
            selector (JSON-like) :

        Returns:
            seq[Model]

        (   R   Rx   (   RL   t   selector(    (    s*   lib/python2.7/site-packages/bokeh/model.pyt   selectJ  s    c         C` s^   t  |  j | ƒ ƒ } t | ƒ d k r@ t d | | f ƒ ‚ n  t | ƒ d k rV d S| d S(   u5   Query this object and all of its references for objects that
        match the given selector.  Raises an error if more than one object
        is found.  Returns single matching object, or None if nothing is found
        Args:
            selector (JSON-like) :

        Returns:
            Model
        i   u*   Found more than one object matching %s: %ri    N(   t   listRz   Rn   Rb   R(   (   RL   Ry   t   result(    (    s*   lib/python2.7/site-packages/bokeh/model.pyt
   select_oneW  s    
c         C` sK   xD |  j  | ƒ D]3 } x* | j ƒ  D] \ } } t | | | ƒ q# Wq Wd S(   uÛ    Update objects that match a given selector with the specified
        attribute/value updates.

        Args:
            selector (JSON-like) :
            updates (dict) :

        Returns:
            None

        N(   Rz   Rq   t   setattr(   RL   Ry   t   updatesR   t   keyt   val(    (    s*   lib/python2.7/site-packages/bokeh/model.pyt
   set_selecth  s    c         C` s   t  |  j d | ƒ ƒ S(   u   Returns a dictionary of the attributes of this object,
        containing only "JSON types" (string, number, boolean,
        none, dict, list).

        References to other objects are serialized as "refs" (just
        the object ID and type info), so the deserializer will
        need to separately have the full attributes of those
        other objects.

        There's no corresponding ``from_json()`` because to
        deserialize an object is normally done in the context of a
        Document (since the Document can resolve references).

        For most purposes it's best to serialize and deserialize
        entire documents.

        Args:
            include_defaults (bool) : whether to include attributes
                that haven't been changed from the default

        t   include_defaults(   R   t   to_json_string(   RL   Rƒ   (    (    s*   lib/python2.7/site-packages/bokeh/model.pyt   to_jsonx  s    c         C` s)   |  j  d | ƒ } |  j | d <t | ƒ S(   uÒ   Returns a JSON string encoding the attributes of this object.

        References to other objects are serialized as references
        (just the object ID and type info), so the deserializer
        will need to separately have the full attributes of those
        other objects.

        There's no corresponding ``from_json_string()`` because to
        deserialize an object is normally done in the context of a
        Document (since the Document can resolve references).

        For most purposes it's best to serialize and deserialize
        entire documents.

        Args:
            include_defaults (bool) : whether to include attributes
                that haven't been changed from the default

        Rƒ   u   id(   t   _to_json_likeR   R   (   RL   Rƒ   t	   json_like(    (    s*   lib/python2.7/site-packages/bokeh/model.pyR„     s    c         ` s£   | d k rw i d d 6‰  ‡  f d †  } |  j d k	 rw t | | ƒ t | | ƒ ˆ  d d k rt |  j j ƒ  qt qw n  t t |  ƒ j | | | d | d | ƒd S(   u
   

        i    u   countc         ` s   ˆ  d c d 7<d  S(   Nu   counti   (    (   R   (   t   dirty(    s*   lib/python2.7/site-packages/bokeh/model.pyt
   mark_dirty¸  s    t   hintt   setterN(   R(   RD   R    t   _invalidate_all_modelsR4   RB   Rr   (   RL   Rf   Rs   t   newRŠ   R‹   R‰   (    (   Rˆ   s*   lib/python2.7/site-packages/bokeh/model.pyRr   «  s    c         C` sX   |  j  d k	 r1 |  j  | k	 r1 t d |  ƒ ‚ n  | j j |  ƒ | |  _  |  j ƒ  d S(   u¼    Attach a model to a Bokeh |Document|.

        This private interface should only ever called by the Document
        implementation to set the private ._document field properly

        uF   Models must be owned by only a single document, %r is already in a docN(   RD   R(   t   RuntimeErrort   themeRK   t   _update_event_callbacks(   RL   t   doc(    (    s*   lib/python2.7/site-packages/bokeh/model.pyt   _attach_documentÂ  s
    	c           C` s    d „  t  j j ƒ  Dƒ t  _ d  S(   Nc         S` s7   i  |  ]- \ } } t  | d  d ƒ d k r | | “ q S(   u   __implementation__N(   RN   R(   (   Rj   Rl   t   v(    (    s*   lib/python2.7/site-packages/bokeh/model.pys
   <dictcomp>Ò  s   	 	(   R.   R/   Rq   (    (    (    s*   lib/python2.7/site-packages/bokeh/model.pyt   _clear_extensionsÏ  s    c         C` s   d |  _ t j |  ƒ d S(   uÀ    Detach a model from a Bokeh |Document|.

        This private interface should only ever called by the Document
        implementation to unset the private ._document field properly

        N(   R(   RD   RJ   RK   (   RL   (    (    s*   lib/python2.7/site-packages/bokeh/model.pyt   _detach_documentÖ  s    	c   	      C` sâ   |  j  d | ƒ } t |  j d d ƒ } | d k	 r | |  j j k r i  } xE | j ƒ  D]. \ } } | |  j j k r| qX qX | | | <qX Wn | } xH | j ƒ  D]: \ } } t | t ƒ r  | t d ƒ k r  d | | <q  q  W| S(   uÙ   Returns a dictionary of the attributes of this object, in
        a layout corresponding to what BokehJS expects at unmarshalling time.

        This method does not convert "Bokeh types" into "plain JSON types,"
        for example each child Model will still be a Model, rather
        than turning into a reference, numpy isn't handled, etc.
        That's what "json like" means.

        This method should be considered "private" or "protected",
        for use internal to Bokeh; use ``to_json()`` instead because
        it gives you only plain JSON-compatible types.

        Args:
            include_defaults (bool) : whether to include attributes
                that haven't been changed from the default.

        Rƒ   u   __subtype__u   infN(	   t   properties_with_valuesRN   RM   R(   RS   Rq   RR   RV   t   float(	   RL   Rƒ   t	   all_attrst   subtypet   attrsRf   R&   Rl   R“   (    (    s*   lib/python2.7/site-packages/bokeh/model.pyR†   à  s    !c         ` sŽ  |  j  j } |  j  j } t |  d d ƒ } t ƒ  ‰  d „  } ‡  f d †  } d „  } d } | d 7} t ƒ  } d | }	 | d | | | f ƒ }
 | | |
 | d t | ƒ d |	 ƒ ƒ 7} |  j ƒ  j ƒ  } t	 | d t
 d ƒ ƒ} | } xt t | ƒ D]f \ } \ } } | t | ƒ d k r'd n d } | | | d ƒ | | d
 t | ƒ | ƒ ƒ 7} qù W| d 7} | t t d | d ˆ  ƒ 7} | S(   u
   

        u   _idc         S` s   d |  d S(   Nu!   <div style="display: table-row;">u   </div>(    (   t   c(    (    s*   lib/python2.7/site-packages/bokeh/model.pyt   row  s    c         ` s   d ˆ  |  f S(   Nu/   <div class="%s" style="display: none;">%s</div>(    (   R›   (   t   cls_name(    s*   lib/python2.7/site-packages/bokeh/model.pyt
   hidden_row  s    c         S` s   d |  d S(   Nu"   <div style="display: table-cell;">u   </div>(    (   R›   (    (    s*   lib/python2.7/site-packages/bokeh/model.pyt   cell  s    u    u   <div style="display: table;">u7   <span id="%s" style="cursor: pointer;">&hellip;)</span>u   <b title="%s.%s">%s</b>(u   idu   &nbsp;=&nbsp;u   , R€   i    i   u   )u   ,u   </div>t   ellipsis_idR   Nu   id&nbsp;=&nbsp;(   RM   R@   R?   RN   R(   R   t   reprR–   Rq   t   sortedR   t	   enumerateRn   t
   _HTML_REPRRd   (   RL   t   modulet   nameRC   Rœ   Rž   RŸ   t   htmlR    t   ellipsist   prefixt   propst   sorted_propst	   all_propst   it   propR&   t   end(    (   R   s*   lib/python2.7/site-packages/bokeh/model.pyt   _repr_html_  s,    			
	
,"6
N((   R?   R@   RA   R5   RI   RO   t   __repr__t   propertyR   R   R¦   R   R	   t   tagsR
   R   RY   t   subscribed_eventsRp   RQ   RU   R]   Ri   Re   Rv   Rw   Rx   Rz   R}   R‚   R…   R„   R(   Rr   R’   t   staticmethodR”   R•   R†   R°   (    (    (    s*   lib/python2.7/site-packages/bokeh/model.pyRB     sF   													9	,											
	-c         C` sV   t  |  t ƒ rE x@ |  j ƒ  D]" } t |  | ƒ } t | | ƒ q Wn t |  | ƒ d S(   uÒ    Visit all references to another Model without recursing into any
    of the child Model; may visit the same Model more than once if
    it's referenced more than once. Does not visit the passed-in value.

    N(   RV   R   t   properties_with_refsRN   R    (   R&   t   visitorRf   t   child(    (    s*   lib/python2.7/site-packages/bokeh/model.pyR#   8  s
    c         C` sæ   t  |  ƒ } | t k r d S| t k s= t | t t f ƒ r^ x¢ |  D] } t | | ƒ qD Wn„ t | t ƒ r§ xr t |  ƒ D]& \ } } t | | ƒ t | | ƒ qz Wn; t | t ƒ râ t | t	 ƒ rÒ | |  ƒ qâ t
 |  | ƒ n  d S(   ug   Recurse down Models, HasProps, and Python containers

    The ordering in this function is to optimize performance.  We check the
    most comomn types (int, float, str) first so that we can quickly return in
    the common case.  We avoid isinstance and issubclass checks in a couple
    places with `type` checks because isinstance checks can be slow.
    N(   t   typet   _common_typesR{   RW   t   tupleR    Rd   R   R   RB   R#   (   R   R·   t   typt   itemR€   R&   (    (    s*   lib/python2.7/site-packages/bokeh/model.pyR    H  s    !(7   RA   t
   __future__R    R   R   R   t   loggingt	   getLoggerR?   t   logt   jsonR   t   operatorR   t   sixR   R   t   core.json_encoderR   t   core.propertiesR	   R
   R   R   R   t   core.has_propsR   R   t
   core.queryR   t   eventsR   t   themesR   RJ   t   util.callback_managerR   R   t   util.futureR   t   util.serializationR   t   __all__R'   R)   R3   R.   R¤   RB   R#   t   intR—   t   strRº   R    (    (    (    s*   lib/python2.7/site-packages/bokeh/model.pyt   <module>
   s:   "(		+		'p%ÿ ÿ &	