code: def heuristics(values):
      """
      Decorator for specifying how the values of certain meta-parameters may be computed.
      This is useful for cases where auto-tuning is prohibitevely expensive, or just not applicable.
  
      .. highlight:: python
      .. code-block:: python
  
          @triton.heuristics(values={'BLOCK_SIZE': lambda args: 2 ** int(math.ceil(math.log2(args[1])))})
          @triton.jit
          def kernel(x_ptr, x_size, **META):
              BLOCK_SIZE = META['BLOCK_SIZE'] # smallest power-of-two >= x_size
      :param values: a dictionary of meta-parameter names and functions that compute the value of the meta-parameter.
                     each such function takes a list of positional arguments as input.
      :type values: dict[str, Callable[[list[Any]], Any]]
      """
  
      def decorator(fn):
          return Heuristics(fn, fn.arg_names, values)
  
      return decorator
  
imports: from __future__ import annotations
  import builtins
  import time
  from typing import Dict
  from ..testing import do_bench
  from .jit import KernelInterface
label_desc: Use image node_id 2 for calling a global function with example usage: heuristics(values) and returns: decorator, Heuristics