code: def _gen_reduce_builtin(reducer):
      docstring = """Builtin reduce function that aggregates messages by {0}.
  
      Parameters
      ----------
      msg : str
          The message field.
      out : str
          The output node feature field.
      Examples
      --------
      >>> import dgl
      >>> reduce_func = dgl.function.{0}('m', 'h')
  
      The above example is equivalent to the following user defined function
      (if using PyTorch):
  
      >>> import torch
      >>> def reduce_func(nodes):
      >>>     return {{'h': torch.{0}(nodes.mailbox['m'], dim=1)}}
      """.format(
          reducer
      )
  
      def func(msg, out):
          return SimpleReduceFunction(reducer, msg, out)
  
      func.__name__ = str(reducer)
      func.__qualname__ = str(reducer)
      func.__doc__ = docstring
      return func
  
file_path: dgl/python/dgl/function/reducer.py
imports: from __future__ import absolute_import
  import sys
  from .base import BuiltinFunction
label_desc: Use image node_id 1 for calling a global function with example usage: _gen_reduce_builtin(reducer) and returns: func, SimpleReduceFunction