Print out YAML using the block mode

def format_return_text(self, data, function, **kwargs):  # pylint: disable=unused-argument
        '''
        Print out YAML using the block mode
        '''
        # emulate the yaml_out output formatter. It relies on a global __opts__ object which
        # we can't obviously pass in
        try:
            try:
                outputter = data[next(iter(data))].get('out')
            except (StopIteration, AttributeError):
                outputter = None
            return salt.output.string_format(
                {x: y['return'] for x, y in six.iteritems(data)},
                out=outputter,
                opts=__opts__,
            )
        except Exception as exc:
            import pprint
            log.exception(
                'Exception encountered when trying to serialize %s',
                pprint.pformat(data)
            )
            return 'Got an error trying to serialze/clean up the response'