<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _output_format(self, out, fmt_j=None, fmt_p=None):

 """
 Output formatting handler
 """

        if self.output_format == 'pandas':
            if fmt_p is not None:
                return fmt_p(out)
            else:
                return self._convert_output(out)
        if fmt_j:
            return fmt_j(out)
        return out