def __call__(self, command_name, response, stream=None):
        if stream is None:
            # Retrieve stdout on invocation instead of at import time
            # so that if anything wraps stdout we'll pick up those changes
            # (specifically colorama on windows wraps stdout).
            stream = self._get_default_stream()
        # I think the interfaces between non-paginated
        # and paginated responses can still be cleaned up.
        if is_response_paginated(response):
            response_data = response.build_full_result()
        else:
            response_data = response
        self._remove_request_id(response_data)
        if self._args.query is not None:
            response_data = self._args.query.search(response_data)
        try:
            self._format_response(command_name, response_data, stream)
        except __HOLE__ as e:
            # If the reading end of our stdout stream has closed the file
            # we can just exit.
            pass
        finally:
            # flush is needed to avoid the "close failed in file object
            # destructor" in python2.x (see http://bugs.python.org/issue11380).
            self._flush_stream(stream)
dataset/ETHPy150Open aws/aws-cli/awscli/formatter.py/FullyBufferedFormatter.__call__