code: def _create_param_rules(cls, func):
      """Create ply.yacc rules based on a parameterized rule function
  
      Generates new methods (one per each pair of parameters) based on the
      template rule function `func`, and attaches them to `cls`. The rule
      function's parameters must be accessible via its `_params` attribute.
      """
      for xxx, yyy in func._params:
          # Use the template method's body for each new method
          def param_rule(self, p):
              func(self, p)
  
          # Substitute in the params for the grammar rule and function name
          param_rule.__doc__ = func.__doc__.replace("xxx", xxx).replace(
              "yyy", yyy
          )
          param_rule.__name__ = func.__name__.replace("xxx", xxx)
  
          # Attach the new method to the class
          setattr(cls, param_rule.__name__, param_rule)
  
file_path: catboost/contrib/python/pycparser/py3/pycparser/plyparser.py
imports: import warnings
label_desc: Use image node_id 3 for calling a global function with example usage: _create_param_rules(cls, func) without return types