def ErrorBufferContext(context, printer):
  """Prints the buffer data relevant to an error.

  Args:
    context: The buffer context.
    printer: A function to do the printing.
  """
  if context is None:
    printer('No vim buffer was loaded.')
    return

  # Find out what buffer we're printing from.
  if context['buffer'] is None:
    printer('Checking the current buffer.', end='', verbose=True)
  else:
    printer(context['buffer'] % 'Checking buffer %s.', end='', verbose=True)
  printer(' Relevant buffer data:', verbose=True)
  printer('Found:', verbose=False)

  # Print the relevant buffer lines
  (start, end) = (context['start'], context['end'])
  # Empty buffer.
  if not context['data']:
    printer('An empty buffer.')
    return

  buflines = list(PrefixWithIndex(context['data']))
  # They're looking at a specific line.
  if end > start:
    for i, bufline in enumerate(buflines[start:end]):
      if context['line'] == i + start:
        printer(bufline + ' <<<<', color=vroom.color.BOLD)
      else:
        printer(bufline)
  # They're looking at the whole buffer.
  else:
    for bufline in buflines:
      printer(bufline)
dataset/ETHPy150Open google/vroom/vroom/output.py/ErrorBufferContext/swapped operands of `%`