<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_ret(self, ret, out, retcode=0):
        '''
        Print the output from a single return to the terminal
        '''
        import salt.output
        # Handle special case commands
        if self.config['fun'] == 'sys.doc' and not isinstance(ret, Exception):
            self._print_docs(ret)
        else:
            # Determine the proper output method and run it
            salt.output.display_output(ret,
                                       out=out,
                                       opts=self.config,
                                       _retcode=retcode)
        if not ret:
            sys.stderr.write('ERROR: No return received\n')
            sys.exit(2)