def get_concrete_response(self):
        result = self.get_data_response()
        
        if type(result) == Redirection:
            invocation, args, kwargs = result.rendered_invocation
            rendered_invocation = make_cmd_invocation(invocation, args, kwargs)
            req = CMDRequest(rendered_invocation)
            return CMDController(req, self.manifest, self.model_mock)
        else:
            response = {
                'stdout': [result['body']],
                'stderr': [],
            }

        # now do middleware
        stdout = response['stdout']

        if hasattr(stdout, 'write'):
            # returned is a file, print out the contents through stdout
            print(stdout.write())
        else:
            for line in stdout:
                print(line)

        for line in response['stderr']:
            sys.stderr.write(line)
dataset/ETHPy150Open priestc/giotto/giotto/controllers/cmd.py/CMDController.get_concrete_response/original