def ignore(ignore_reason):
  """A decorator to be applied to benchmark-creating functions.

  The benchmark returned by the decorated function will have should_ignore set
  to True and ignore_reason set as the decorator's argument.

  Args:
    ignore_reason: A string describing the reason for ignoring the benchmark.

  Returns:
    A decorator that adds the supplied ignore_reason to the benchmark.
  """
  def add_ignore_reason(benchmark_function):
    def wrapper():
      benchmark = benchmark_function()
      benchmark.should_ignore = True
      benchmark.ignore_reason = ignore_reason
      return benchmark
    return wrapper
  return add_ignore_reason