def print_diff(from_path, to_path, from_label=None, to_label=None):
  if not from_label:
    from_label = from_path
  if not to_label:
    to_label = to_path
  command = [{"from_label": from_label, "from_path": from_path, "to_label": to_label, "to_path": to_path} % piece for piece in DIFF_COMMAND.split()]
  p = shell_command(command, wait=False)

  # color the result only when the stdout is terminal
  use_colors = sys.stdout.isatty()
  for line in p.stdout:
    if use_colors:
      if line.startswith('+'):
        line = color_text(line, 'green')
      elif line.startswith('-'):
        line = color_text(line, 'red')
      elif line.startswith('@@'):
        line = color_text(line, 'cyan')
    sys.stdout.write(line)
  sys.stdout.write("\n")


##
## Date and time utilities
##
dataset/ETHPy150Open bloomreach/zinc/zinc.py/print_diff/swapped operands of `%`