@staticmethod
def _write_container_output(output_itr, stdout=None, stderr=None):
    """
        Based on the data returned from the Container output, via the iterator, write it to the appropriate streams

        Parameters
        ----------
        output_itr: Iterator
            Iterator returned by the Docker Attach command
        stdout: samcli.lib.utils.stream_writer.StreamWriter, optional
            Stream writer to write stdout data from Container into
        stderr: samcli.lib.utils.stream_writer.StreamWriter, optional
            Stream writer to write stderr data from the Container into
        """
    for stdout_data, stderr_data in output_itr:
        if stdout_data and stdout:
            stdout.write(stdout_data)
        if stderr_data and stderr:
            stderr.write(stderr_data)
