
NXc           @  s  d  Z  d d l m Z d d l Z 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 m Z m Z d d l m Z d d d	 d
 d d d d d d d d d d d d d d d d d d d d d d  g Z d!   Z d"   Z e d d#  Z d d 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 e# f d0     YZ$ d e$ f d1     YZ% d e% f d2     YZ& d e% f d3     YZ' d e% f d4     YZ( d e% f d5     YZ) d e% f d6     YZ* d e$ f d7     YZ+ d e$ f d8     YZ, d9 Z- d: Z. d; Z/ d e% f d<     YZ0 d= Z1 d> Z2 d?   Z3 d@   Z4 d e$ f dA     YZ5 dB e$ f dC     YZ6 e dD  Z7 e dE    Z8 e e9 dF   Z: d S(G   sG   Top-level display functions for displaying object in different formats.i(   t   print_functionN(   t   _safe_get_formatter_method(   t   string_typest   cast_bytes_py2t   cast_unicodet   unicode_type(   t   skip_doctestt   displayt   display_prettyt   display_htmlt   display_markdownt   display_svgt   display_pngt   display_jpegt   display_latext   display_jsont   display_javascriptt   display_pdft   DisplayObjectt   TextDisplayObjectt   Prettyt   HTMLt   Markdownt   Matht   Latext   SVGt   JSONt
   Javascriptt   Imaget   clear_outputt   set_matplotlib_formatst   set_matplotlib_closet   publish_display_datac         C  s-   y t  j j |   SWn t k
 r( t SXd S(   s*   Check path, but don't let exceptions raiseN(   t   ost   patht   existst	   Exceptiont   False(   R"   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt   _safe_exists   s    c         C  sa   t  | t  s  t  |  t  r$ | Sx6 | j   D]( \ } } t |  j |  |  |  | <q1 W|  S(   sg   Like update, but merges sub-dicts instead of clobbering at the top level.

    Updates d1 in-place
    (   t
   isinstancet   dictt   itemst   _merget   get(   t   d1t   d2t   keyt   value(    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR*   &   s
      c         C  sb   | r i | |  6} n  | r? g  | D] } i | |  6^ q# } n  t  d | d | d |  g |  d S(   s  internal implementation of all display_foo methods

    Parameters
    ----------
    mimetype : str
        The mimetype to be published (e.g. 'image/png')
    objs : tuple of objects
        The Python objects to display, or if raw=True raw text data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    t   rawt   metadatat   includeN(   R   (   t   mimetypet   objsR0   R1   t   obj(    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt   _display_mimetype2   s
    #c         C  s3   d d l  m } | j   j j d |  d |  d S(   s  Publish data and metadata to all frontends.

    See the ``display_data`` message in the messaging documentation for
    more details about this message type.

    The following MIME types are currently implemented:

    * text/plain
    * text/html
    * text/markdown
    * text/latex
    * application/json
    * application/javascript
    * image/png
    * image/jpeg
    * image/svg+xml

    Parameters
    ----------
    data : dict
        A dictionary having keys that are valid MIME types (like
        'text/plain' or 'image/svg+xml') and values that are the data for
        that MIME type. The data itself must be a JSON'able data
        structure. Minimally all data should have the 'text/plain' data,
        which can be displayed by all frontends. If more than the plain
        text is given, it is up to the frontend to decide which
        representation to use.
    metadata : dict
        A dictionary for metadata related to the data. This can contain
        arbitrary key, value pairs that frontends can use to interpret
        the data. mime-type keys matching those in data can be used
        to specify metadata about particular representations.
    source : str, deprecated
        Unused.
        i(   t   InteractiveShellt   dataR1   N(   t   IPython.core.interactiveshellR7   t   instancet   display_pubt   publish(   R8   R1   t   sourceR7   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR    M   s    $c          O  s   | j  d t  } | j  d  } | j  d  } | j  d  } d d l m } | sj | j   j j } n  x} |  D]u } | r t d | d |  qq | | d | d | \ }	 }
 |	 s qq n  | r t |
 |  n  t d |	 d |
  qq Wd S(	   s  Display a Python object in all frontends.

    By default all representations will be computed and sent to the frontends.
    Frontends can decide which representation is used and how.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display.
    raw : bool, optional
        Are the objects to be displayed already mimetype-keyed dicts of raw display data,
        or Python objects that need to be formatted before display? [default: False]
    include : list or tuple, optional
        A list of format type strings (MIME types) to include in the
        format data dict. If this is set *only* the format types included
        in this list will be computed.
    exclude : list or tuple, optional
        A list of format type strings (MIME types) to exclude in the format
        data dict. If this is set all format types will be computed,
        except for those included in this argument.
    metadata : dict, optional
        A dictionary of metadata to associate with the output.
        mime-type keys in this dictionary will be associated with the individual
        representation formats, if they exist.
    R0   R2   t   excludeR1   i(   R7   R8   N(	   R+   R%   R9   R7   R:   t   display_formattert   formatR    R*   (   R4   t   kwargsR0   R2   R>   R1   R7   R@   R5   t   format_dictt   md_dict(    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR   w   s     c          O  s   t  d |  |  d S(   s  Display the pretty (default) representation of an object.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display, or if raw=True raw text data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    s
   text/plainN(   R6   (   R4   RA   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR      s    c          O  s   t  d |  |  d S(   s  Display the HTML representation of an object.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display, or if raw=True raw HTML data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    s	   text/htmlN(   R6   (   R4   RA   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR	      s    c          O  s   t  d |  |  d S(   s  Displays the Markdown representation of an object.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display, or if raw=True raw markdown data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    s   text/markdownN(   R6   (   R4   RA   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR
      s    c          O  s   t  d |  |  d S(   s  Display the SVG representation of an object.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display, or if raw=True raw svg data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    s   image/svg+xmlN(   R6   (   R4   RA   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR      s    c          O  s   t  d |  |  d S(   s  Display the PNG representation of an object.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display, or if raw=True raw png data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    s	   image/pngN(   R6   (   R4   RA   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR      s    c          O  s   t  d |  |  d S(   s  Display the JPEG representation of an object.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display, or if raw=True raw JPEG data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    s
   image/jpegN(   R6   (   R4   RA   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR      s    c          O  s   t  d |  |  d S(   s  Display the LaTeX representation of an object.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display, or if raw=True raw latex data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    s
   text/latexN(   R6   (   R4   RA   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR     s    c          O  s   t  d |  |  d S(   s  Display the JSON representation of an object.

    Note that not many frontends support displaying JSON.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display, or if raw=True raw json data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    s   application/jsonN(   R6   (   R4   RA   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR   !  s    c          O  s   t  d |  |  d S(   s  Display the Javascript representation of an object.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display, or if raw=True raw javascript data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    s   application/javascriptN(   R6   (   R4   RA   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR   4  s    c          O  s   t  d |  |  d S(   s  Display the PDF representation of an object.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display, or if raw=True raw javascript data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    metadata : dict (optional)
        Metadata to be associated with the specific mimetype output.
    s   application/pdfN(   R6   (   R4   RA   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR   E  s    c           B  sG   e  Z d  Z d Z e Z d d d d  Z d   Z d   Z	 d   Z
 RS(   s*   An object that wraps data to be displayed.t   rc         C  s   | d k	 r{ t | t  r{ | j d  rK | d k rK | } d } d } q{ t |  r{ | d k r{ d } | } d } q{ n  | |  _ | |  _ | d k r d n	 t |  |  _ |  j	   |  j
   d S(   s  Create a display object given raw data.

        When this object is returned by an expression or passed to the
        display function, it will result in the data being displayed
        in the frontend. The MIME type of the data should match the
        subclasses used, so the Png subclass should be used for 'image/png'
        data. If the data is a URL, the data will first be downloaded
        and then displayed. If

        Parameters
        ----------
        data : unicode, str or bytes
            The raw data or a URL or file to load the data from
        url : unicode
            A URL to download the data from.
        filename : unicode
            Path to a local file to load the data from.
        t   httpN(   t   NoneR'   R   t
   startswithR&   R8   t   urlR   t   filenamet   reloadt   _check_data(   t   selfR8   RH   RI   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt   __init__a  s    			!
c         C  sD   |  j  s+ |  j } d | j | j f } n t t |   j   } | S(   Ns   <%s.%s object>(   t   _show_mem_addrt	   __class__t
   __module__t   __name__t   superR   t   __repr__(   RL   t   clsRD   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyRS     s
    		c         C  s   d S(   s5   Override in subclasses if there's something to check.N(    (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyRK     s    c         C  sB  |  j  d k	 r? t |  j  |  j   } | j   |  _ Wd QXn |  j d k	 r>y y d d l m } Wn! t	 k
 r d d l
 m } n X| |  j  } | j   |  _ d } xV | j d j d  D]> } | j   } | j d  r | j d  d j   } Pq q W| r'|  j j | d  |  _ n  Wq>d |  _ q>Xn  d S(	   s%   Reload the raw data from file or URL.Ni(   t   urlopens   content-typet   ;t   charsett   =t   replace(   RI   RF   t   opent   _read_flagst   readR8   RH   t   urllib.requestRU   t   ImportErrort   urllib2t   headerst   splitt   stripRG   t   decode(   RL   t   fRU   t   responset   encodingt   sub(    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyRJ     s*    N(   RQ   RP   t   __doc__R[   R%   RN   RF   RM   RS   RK   RJ   (    (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR   [  s   $		c           B  s   e  Z d  Z d   Z RS(   s"   Validate that display data is textc         C  sH   |  j  d  k	 rD t |  j  t  rD t d |  j j |  j  f   n  d  S(   Ns   %s expects text, not %r(   R8   RF   R'   R   t	   TypeErrorRO   RQ   (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyRK     s    "(   RQ   RP   Rh   RK   (    (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR     s   c           B  s   e  Z d    Z RS(   c         C  s   |  j  S(   N(   R8   (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt   _repr_pretty_  s    (   RQ   RP   Rj   (    (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR     s   c           B  s   e  Z d    Z d   Z RS(   c         C  s   |  j  S(   N(   R8   (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt   _repr_html_  s    c         C  s
   |  j    S(   s   
        This method exists to inform other HTML-using modules (e.g. Markupsafe,
        htmltag, etc) that this object is HTML and does not need things like
        special characters (<>&) escaped.
        (   Rk   (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt   __html__  s    (   RQ   RP   Rk   Rl   (    (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR     s   	c           B  s   e  Z d    Z RS(   c         C  s   |  j  S(   N(   R8   (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt   _repr_markdown_  s    (   RQ   RP   Rm   (    (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR     s   c           B  s   e  Z d    Z RS(   c         C  s   |  j  j d  } d | S(   Nt   $s   $$%s$$(   R8   Rb   (   RL   t   s(    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt   _repr_latex_  s    (   RQ   RP   Rp   (    (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR     s   c           B  s   e  Z d    Z RS(   c         C  s   |  j  S(   N(   R8   (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyRp     s    (   RQ   RP   Rp   (    (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR     s   c           B  s8   e  Z d Z e d     Z e j d    Z d   Z RS(   c         C  s   |  j  S(   N(   t   _data(   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR8     s    c         C  s   | d  k r d  |  _ d  Sd d l m } t |  } | j |  } | j d  } | rl | d j   } n  t |  } | |  _ d  S(   Ni(   t   minidomt   svgi    (	   RF   Rq   t   xml.domRr   R   t   parseStringt   getElementsByTagNamet   toxmlR   (   RL   Rs   Rr   t   xt	   found_svg(    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR8     s    	c         C  s   |  j  S(   N(   R8   (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt
   _repr_svg_  s    N(   RQ   RP   RF   Rq   t   propertyR8   t   setterRz   (    (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR     s   c           B  sG   e  Z d  Z d Z d   Z e d    Z e j d    Z d   Z	 RS(   s   JSON expects a JSON-able dict or list
    
    not an already-serialized JSON string.
    
    Scalar types (None, number, string) are not allowed, only dict or list containers.
    c         C  sN   |  j  d  k	 rJ t |  j  t t f  rJ t d |  j j |  j  f   n  d  S(   Ns(   %s expects JSONable dict or list, not %r(   R8   RF   R'   R(   t   listRi   RO   RQ   (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyRK     s    (c         C  s   |  j  S(   N(   Rq   (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR8     s    c         C  s;   t  | t  r. t j d  t j |  } n  | |  _ d  S(   Ns4   JSON expects JSONable dict or list, not JSON strings(   R'   R   t   warningst   warnt   jsont   loadsRq   (   RL   R8   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR8     s    c         C  s   |  j  S(   N(   R8   (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt   _repr_json_  s    N(
   RQ   RP   Rh   RF   Rq   RK   R{   R8   R|   R   (    (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR     s   	sa   $("head").append($("<link/>").attr({
  rel:  "stylesheet",
  type: "text/css",
  href: "%s"
}));
s    $.getScript("%s", function () {
s   });
c           B  s)   e  Z d d d d d d   Z d   Z RS(   c         C  s   t  | t  r | g } n | d k r0 g  } n  t  | t  rK | g } n | d k r` g  } n  t  | t t f  s t d |   n  t  | t t f  s t d |   n  | |  _ | |  _ t t	 |   j
 d | d | d |  d S(   s  Create a Javascript display object given raw data.

        When this object is returned by an expression or passed to the
        display function, it will result in the data being displayed
        in the frontend. If the data is a URL, the data will first be
        downloaded and then displayed.

        In the Notebook, the containing element will be available as `element`,
        and jQuery will be available.  Content appended to `element` will be
        visible in the output area. 

        Parameters
        ----------
        data : unicode, str or bytes
            The Javascript source code or a URL to download it from.
        url : unicode
            A URL to download the data from.
        filename : unicode
            Path to a local file to load the data from.
        lib : list or str
            A sequence of Javascript library URLs to load asynchronously before
            running the source code. The full URLs of the libraries should
            be given. A single Javascript library URL can also be given as a
            string.
        css: : list or str
            A sequence of css files to load before running the source code.
            The full URLs of the css files should be given. A single css URL
            can also be given as a string.
        s   expected sequence, got: %rR8   RH   RI   N(   R'   R   RF   R}   t   tupleRi   t   libt   cssRR   R   RM   (   RL   R8   RH   RI   R   R   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyRM   #  s    				c         C  sr   d } x |  j  D] } | t | 7} q Wx |  j D] } | t | 7} q2 W| |  j 7} | t t |  j  7} | S(   Nt    (   R   t   css_tR   t   lib_t1R8   t   lib_t2t   len(   RL   RD   t   ct   l(    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt   _repr_javascript_Q  s    N(   RQ   RP   RF   RM   R   (    (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR   !  s   .s   PNG

s   c         C  s4   |  j  d  } |  | d | d !} t j d |  S(   s*   read the (width, height) from a PNG headert   IHDRi   i   s   >ii(   t   indext   structt   unpack(   R8   t   ihdrt   w4h4(    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt   _pngxy_  s    c         C  s   d } x` t  rh t j d |  | | d ! d } | | } |  | | d !d k r[ | } Pq	 | d 7} q	 Wt j d |  | d | d ! \ } } | | f S(	   s+   read the (width, height) from a JPEG headeri   s   >Hi   i    s   s   >HHi   i	   (   t   TrueR   R   (   R8   t   idxt
   block_sizet   iSOFt   ht   w(    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt   _jpegxyf  s    	!
'c           B  s   e  Z d  Z d Z d Z e e g Z d d d d d d d e e d d 
 Z d   Z	 d   Z
 d   Z d   Z d   Z d	   Z d
   Z RS(   t   rbu   jpegu   pngc         C  s  | d k	 r |  j |  } n{ | d k	 r< |  j |  } n] | d k rW t d   nB t | t  r | j d  s t |  r |  j |  } n d } | d k	 r | j   } | d k s | d k r |  j } n  | d k r'|  j	 } q'n7 t | t
  r'| d k r'| d  t k r'd } q'n  t |  j   |  _ | d k	 rN| n	 | d k |  _ |  j r|  j |  j k rt d	 |  j   n  | |  _ | |  _ | |  _ |	 |  _ |
 |  _ t t |   j d
 | d | d |  | r|  j   n  d S(   s
  Create a PNG/JPEG image object given raw data.

        When this object is returned by an input cell or passed to the
        display function, it will result in the image being displayed
        in the frontend.

        Parameters
        ----------
        data : unicode, str or bytes
            The raw image data or a URL or filename to load the data from.
            This always results in embedded image data.
        url : unicode
            A URL to download the data from. If you specify `url=`,
            the image data will not be embedded unless you also specify `embed=True`.
        filename : unicode
            Path to a local file to load the data from.
            Images from a file are always embedded.
        format : unicode
            The format of the image data (png/jpeg/jpg). If a filename or URL is given
            for format will be inferred from the filename extension.
        embed : bool
            Should the image data be embedded using a data URI (True) or be
            loaded using an <img> tag. Set this to True if you want the image
            to be viewable later with no internet connection in the notebook.

            Default is `True`, unless the keyword argument `url` is set, then
            default value is `False`.

            Note that QtConsole is not able to display images if `embed` is set to `False`
        width : int
            Width to which to constrain the image in html
        height : int
            Height to which to constrain the image in html
        retina : bool
            Automatically set the width and height to half of the measured
            width and height.
            This only works for embedded images because it reads the width/height
            from image data.
            For non-embedded images, you can just set the desired display width
            and height directly.
        unconfined: bool
            Set unconfined=True to disable max-width confinement of the image.
        metadata: dict
            Specify extra metadata to attach to the image.

        Examples
        --------
        # embedded image data, works in qtconsole and notebook
        # when passed positionally, the first arg can be any of raw image data,
        # a URL, or a filename from which to load image data.
        # The result is always embedding image data for inline images.
        Image('http://www.google.fr/images/srpr/logo3w.png')
        Image('/path/to/image.jpg')
        Image(b'RAW_PNG_DATA...')

        # Specifying Image(url=...) does not embed the image data,
        # it only generates `<img>` tag with a link to the source.
        # This will not work in the qtconsole or offline.
        Image(url='http://www.google.fr/images/srpr/logo3w.png')

        s6   No image data found. Expecting filename, url, or data.RE   u   jpgu   jpegu   pngt   pngi   t   jpegs"   Cannot embed the '%s' image formatR8   RH   RI   N(   RF   t	   _find_extt
   ValueErrorR'   R   RG   R&   t   lowert	   _FMT_JPEGt   _FMT_PNGt   bytest   _JPEGR   R@   t   embedt   _ACCEPTABLE_EMBEDDINGSt   widtht   heightt   retinat
   unconfinedR1   RR   R   RM   t   _retina_shape(   RL   R8   RH   RI   R@   R   R   R   R   R   R1   t   ext(    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyRM     s>    @!					%c         C  s}   |  j  s d S|  j d k r4 t |  j  \ } } n+ |  j d k r[ t |  j  \ } } n d S| d |  _ | d |  _ d S(   s3   load pixel-doubled width and height from image dataNR   R   i   (   R   R@   R   R8   R   R   R   (   RL   R   R   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR     s    	c         C  s9   |  j  r5 t t |   j   |  j r5 |  j   q5 n  d S(   s%   Reload the raw data from file or URL.N(   R   RR   R   RJ   R   R   (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyRJ     s    		c      	   C  s   |  j  s d } } } |  j r0 d |  j } n  |  j rI d |  j } n  |  j r[ d } n  d j d |  j d | d | d	 |  Sd  S(
   NR   s    width="%d"s    height="%d"s    class="unconfined"u(   <img src="{url}"{width}{height}{klass}/>RH   R   R   t   klass(   R   R   R   R   R@   RH   (   RL   R   R   R   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyRk     s    							c         C  s   i  } |  j  r |  j  | d <n  |  j r8 |  j | d <n  |  j rQ |  j | d <n  |  j rm | j |  j  n  | r |  j | f S|  j Sd S(   sB   shortcut for returning metadata with shape information, if definedR   R   R   N(   R   R   R   R1   t   updateR8   (   RL   t   md(    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt   _data_and_metadata  s    				c         C  s&   |  j  r" |  j d k r" |  j   Sd  S(   Nu   png(   R   R@   R   (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt
   _repr_png_  s    c         C  s5   |  j  r1 |  j d k s' |  j d k r1 |  j   Sd  S(   Nu   jpegu   jpg(   R   R@   R   (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt   _repr_jpeg_!  s    'c         C  s   t  | j d  d j    S(   Nt   .i(   R   Ra   R   (   RL   Ro   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR   %  s    N(   RQ   RP   R[   R   R   R   RF   R%   RM   R   RJ   Rk   R   R   R   R   (    (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR   y  s   f						t   Videoc           B  sD   e  Z d d d d d d   Z d   Z d   Z d   Z d   Z RS(   c      	   C  s   | d k r? | j d  s* | j d  r? | } d } t } n! t j j |  r` | } d } n  | |  _ | d k	 r{ | n	 | d k	 |  _ t t	 |   j
 d | d | d |  d S(   s  Create a video object given raw data or an URL.

        When this object is returned by an input cell or passed to the
        display function, it will result in the video being displayed
        in the frontend.

        Parameters
        ----------
        data : unicode, str or bytes
            The raw image data or a URL or filename to load the data from.
            This always results in embedded image data.
        url : unicode
            A URL to download the data from. If you specify `url=`,
            the image data will not be embedded unless you also specify `embed=True`.
        filename : unicode
            Path to a local file to load the data from.
            Videos from a file are always embedded.
        embed : bool
            Should the image data be embedded using a data URI (True) or be
            loaded using an <img> tag. Set this to True if you want the image
            to be viewable later with no internet connection in the notebook.

            Default is `True`, unless the keyword argument `url` is set, then
            default value is `False`.

            Note that QtConsole is not able to display images if `embed` is set to `False`
        mimetype: unicode
            Specify the mimetype in case you load in a encoded video.
        Examples
        --------
        Video('https://archive.org/download/Sita_Sings_the_Blues/Sita_Sings_the_Blues_small.mp4')
        Video('path/to/video.mp4')
        Video('path/to/video.mp4', embed=False)
        RE   t   httpsR8   RH   RI   N(   RF   RG   R%   R!   R"   R#   R3   R   RR   R   RM   (   RL   R8   RH   RI   R   R3   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyRM   *  s    #*			!c         C  s   |  j  s= |  j d  k	 r! |  j n |  j } d j |  } | S|  j d  k	 r t j   t j |  j  \ } } t |  j d  j	   } | j
 d  } n |  j } |  j } d j | |  } | S(   Nsk   <video src="{0}" controls>
      Your browser does not support the <code>video</code> element.
    </video>R   t   base64sw   <video controls>
 <source src="data:{0};base64,{1}" type="{0}">
 Your browser does not support the video tag.
 </video>(   R   RH   RF   RI   R@   t	   mimetypest   initt
   guess_typeRZ   R\   t   encodeR8   R3   (   RL   RH   t   outputR3   Rf   t   videot   video_encoded(    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyRk   Y  s    	!
		c         C  s   d  S(   N(    (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyRJ   r  s    c         C  s   d  S(   N(    (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR   v  s    c         C  s   d  S(   N(    (   RL   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR   y  s    N(   RQ   RP   RF   RM   Rk   RJ   R   R   (    (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR   (  s
   /			c         C  s   d d l  m } | j   r5 | j   j j |   n\ d d l m } t d d | j	 d d | j	 j
   t d d | j d d | j j
   d S(	   s   Clear the output of the current cell receiving output.

    Parameters
    ----------
    wait : bool [default: false]
        Wait to clear the output until new output is available to replace it.i(   R7   (   t   ios   [2Kt   filet   endR   N(   R9   R7   t   initializedR:   R;   R   t   IPython.utilsR   t   printt   stdoutt   flusht   stderr(   t   waitR7   R   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR   }  s    c          O  s   d d l  m } d d l m } i  } d d l m } | j   } | j | j  | j |   | j   } | | |  |  d S(   s  Select figure formats for the inline backend. Optionally pass quality for JPEG.

    For example, this enables PNG and JPEG output with a JPEG quality of 90%::

        In [1]: set_matplotlib_formats('png', 'jpeg', quality=90)

    To set this in your config files use the following::
    
        c.InlineBackend.figure_formats = {'png', 'jpeg'}
        c.InlineBackend.print_figure_kwargs.update({'quality' : 90})

    Parameters
    ----------
    *formats : strs
        One or more figure formats to enable: 'png', 'retina', 'jpeg', 'svg', 'pdf'.
    **kwargs :
        Keyword args will be relayed to ``figure.canvas.print_figure``.
    i(   R7   (   t   select_figure_formats(   t   InlineBackendN(	   R9   R7   t   IPython.core.pylabtoolsR   t   ipykernel.pylab.configR   R:   R   t   print_figure_kwargs(   t   formatsRA   R7   R   t   kwR   t   cfgt   shell(    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR     s    c         C  s)   d d l  m } | j   } |  | _ d S(   s  Set whether the inline backend closes all figures automatically or not.
    
    By default, the inline backend used in the IPython Notebook will close all
    matplotlib figures automatically after each cell is run. This means that
    plots in different cells won't interfere. Sometimes, you may want to make
    a plot in one cell and then refine it in later cells. This can be accomplished
    by::
    
        In [1]: set_matplotlib_close(False)
    
    To set this in your config files use the following::
    
        c.InlineBackend.close_figures = False
    
    Parameters
    ----------
    close : bool
        Should all matplotlib figures be automatically closed after each cell is
        run?
    i(   R   N(   R   R   R:   t   close_figures(   t   closeR   R   (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyR     s    (;   Rh   t
   __future__R    R   R   R!   R   R~   t   IPython.core.formattersR   t   IPython.utils.py3compatR   R   R   R   t   IPython.testing.skipdoctestR   t   __all__R&   R*   R%   RF   R6   R    R   R   R	   R
   R   R   R   R   R   R   R   t   objectR   R   R   R   R   R   R   R   R   R   R   R   R   t   _PNGR   R   R   R   R   R   R   R   R   (    (    (    sL   /data/av2000/mvv/env_mvv/lib/python2.7/site-packages/IPython/core/display.pyt   <module>   sj   "			*	2										P" ;		U