def _validate_data(self, source, data, metadata=None):
if not isinstance(source, basestring):<EOL><INDENT>raise TypeError('<STR_LIT>' % source)<EOL><DEDENT>if not isinstance(data, dict):<EOL><INDENT>raise TypeError('<STR_LIT>' % data)<EOL><DEDENT>if metadata is not None:<EOL><INDENT>if not isinstance(metadata, dict):<EOL><INDENT>raise TypeError('<STR_LIT>' % data)<EOL><DEDENT><DEDENT>
Validate the display data.

        Parameters
        ----------
        source : str
            The fully dotted name of the callable that created the data, like
            :func:`foo.bar.my_formatter`.
        data : dict
            The formata data dictionary.
        metadata : dict
            Any metadata for the data.