code: def _get_image_repo(image: str) -> str:
      """Extracts image name before ':' which is REPO part of the image name."""
      image_fields = image.split(":")
      if len(image_fields) > 2:
          raise ValueError(f'Too many ":" in the image name: {image}')
      return image_fields[0]
  
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 1 for calling a global function with example usage: _get_image_repo(image) and returns: image_fields