def _check_box_return_type(self, returned, return_type, expected_keys=None,<EOL>check_ax_title=True):
from matplotlib.axes import Axes<EOL>types = {'<STR_LIT>': dict, '<STR_LIT>': Axes, '<STR_LIT>': tuple}<EOL>if expected_keys is None:<EOL><INDENT>if return_type is None:<EOL><INDENT>return_type = '<STR_LIT>'<EOL><DEDENT>assert isinstance(returned, types[return_type])<EOL>if return_type == '<STR_LIT>':<EOL><INDENT>assert isinstance(returned.ax, Axes)<EOL>assert isinstance(returned.lines, dict)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if return_type is None:<EOL><INDENT>for r in self._flatten_visible(returned):<EOL><INDENT>assert isinstance(r, Axes)<EOL><DEDENT>return<EOL><DEDENT>assert isinstance(returned, Series)<EOL>assert sorted(returned.keys()) == sorted(expected_keys)<EOL>for key, value in returned.items():<EOL><INDENT>assert isinstance(value, types[return_type])<EOL>if return_type == '<STR_LIT>':<EOL><INDENT>if check_ax_title:<EOL><INDENT>assert value.get_title() == key<EOL><DEDENT><DEDENT>elif return_type == '<STR_LIT>':<EOL><INDENT>if check_ax_title:<EOL><INDENT>assert value.ax.get_title() == key<EOL><DEDENT>assert isinstance(value.ax, Axes)<EOL>assert isinstance(value.lines, dict)<EOL><DEDENT>elif return_type == '<STR_LIT>':<EOL><INDENT>line = value['<STR_LIT>'][<NUM_LIT:0>]<EOL>axes = line.axes<EOL>if check_ax_title:<EOL><INDENT>assert axes.get_title() == key<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise AssertionError<EOL><DEDENT><DEDENT><DEDENT>
Check box returned type is correct

Parameters
----------
returned : object to be tested, returned from boxplot
return_type : str
    return_type passed to boxplot
expected_keys : list-like, optional
    group labels in subplot case. If not passed,
    the function checks assuming boxplot uses single ax
check_ax_title : bool
    Whether to check the ax.title is the same as expected_key
    Intended to be checked by calling from ``boxplot``.
    Normal ``plot`` doesn't attach ``ax.title``, it must be disabled.