code: def _print_docker_log_stream(
      stream: Iterable[Dict[str, Any]],
      message_key: str,
      newline: bool = False,
  ):
      last_message = None
      for item in stream:
          if message_key in item:
              if item[message_key] != last_message:
                  click.echo(
                      "[Docker] " + item[message_key], nl=newline
                  )
                  last_message = item[message_key]
  
file_path: tfx/tfx/tools/cli/container_builder/builder.py
imports: import os
  from typing import Any, Dict, Iterable, Optional
  import click
  import docker
  from docker import utils
  from tfx.tools.cli.container_builder import dockerfile
  from tfx.tools.cli.container_builder import labels
label_desc: Use image node_id 2 for calling a global function with example usage: _print_docker_log_stream(stream, message_key, newline) without return types