code: def layer_optimizer(layer):
      """Decorator to turn a function into the optimization pass.
  
      Example::
  
          @layer_optimizer(MyLayer)
          def init_mylayer(self, layer):
              layer.set_attr('new_attribute', 'some_value')
  
      Args:
          layer (_type_): _description_
      """
  
      def decorator(function):
          return optimizer_pass(layer)(function)
  
      return decorator
  
imports: import importlib
  import inspect
  import os
  from hls4ml.utils.string_utils import convert_to_snake_case
label_desc: Use image node_id 2 for calling a global function with example usage: layer_optimizer(layer) and returns: decorator, optimizer_pass