environment/lib/python2.7/site-packages/IPython/core/formatters.py
def format(self, obj, include=None, exclude=None):
        """Return a format data dict for an object.

        By default all format types will be computed.

        The following MIME types are currently implemented:

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

        Parameters
        ----------
        obj : object
            The Python object whose format data will be computed.
        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 string (MIME types) to exclue in the format
            data dict. If this is set all format types will be computed,
            except for those included in this argument.

        Returns
        -------
        format_dict : dict
            A dictionary of key/value pairs, one or each format that was
            generated for the object. The keys are the format types, which
            will usually be MIME type strings and the values and JSON'able
            data structure containing the raw data for the representation in
            that format.
        """
        format_dict = {}

        # If plain text only is active
        if self.plain_text_only:
            formatter = self.formatters['text/plain']
            try:
                data = formatter(obj)
            except:
                # FIXME: log the exception
                raise
            if data is not None:
                format_dict['text/plain'] = data
            return format_dict

        for format_type, formatter in self.formatters.items():
            if include is not None:
                if format_type not in include:
                    continue
            if exclude is not None:
                if format_type in exclude:
                    continue
            try:
                data = formatter(obj)
            except:
                # FIXME: log the exception
                raise
            if data is not None:
                format_dict[format_type] = data
        return format_dict
def format(self, obj, include=None, exclude=None):
        """Return a format data dict for an object.

        By default all format types will be computed.

        The following MIME types are currently implemented:

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

        Parameters
        ----------
        obj : object
            The Python object whose format data will be computed.
        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 string (MIME types) to exclue in the format
            data dict. If this is set all format types will be computed,
            except for those included in this argument.

        Returns
        -------
        format_dict : dict
            A dictionary of key/value pairs, one or each format that was
            generated for the object. The keys are the format types, which
            will usually be MIME type strings and the values and JSON'able
            data structure containing the raw data for the representation in
            that format.
        """
        format_dict = {}

        # If plain text only is active
        if self.plain_text_only:
            formatter = self.formatters['text/plain']
            try:
                data = formatter(obj)
            except:
                # FIXME: log the exception
                raise
            if data is not None:
                format_dict['text/plain'] = data
            return format_dict

        for format_type, formatter in self.formatters.items():
            if include is not None:
                if format_type not in include:
                    continue
            if exclude is not None:
                if format_type in exclude:
                    continue
            try:
                data = formatter(obj)
            except:
                # FIXME: log the exception
                raise
            if data is not None:
                format_dict[format_type] = data
        return format_dict
Return a format data dict for an object.

        By default all format types will be computed.

        The following MIME types are currently implemented:

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

        Parameters
        ----------
        obj : object
            The Python object whose format data will be computed.
        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 string (MIME types) to exclue in the format
            data dict. If this is set all format types will be computed,
            except for those included in this argument.

        Returns
        -------
        format_dict : dict
            A dictionary of key/value pairs, one or each format that was
            generated for the object. The keys are the format types, which
            will usually be MIME type strings and the values and JSON'able
            data structure containing the raw data for the representation in
            that format.