code: def regularize_layer_params(
      layer, penalty, tags={"regularizable": True}, **kwargs
  ):
      """
      Computes a regularization cost by applying a penalty to the parameters
      of a layer or group of layers.
  
      Parameters
      ----------
      layer : a :class:`Layer` instances or list of layers.
      penalty : callable
      tags: dict
          Tag specifications which filter the parameters of the layer or layers.
          By default, only parameters with the `regularizable` tag are included.
      **kwargs
          keyword arguments passed to penalty.
  
      Returns
      -------
      Theano scalar
          a scalar expression for the cost
      """
      layers = (
          [
              layer,
          ]
          if isinstance(layer, Layer)
          else layer
      )
      all_params = []
  
      for layer in layers:
          all_params += layer.get_params(**tags)
  
      return apply_penalty(all_params, penalty, **kwargs)
  
file_path: Lasagne/lasagne/regularization.py
imports: import theano.tensor
  from .layers import Layer, get_all_params
label_desc: Use image node_id 4 for calling a global function with example usage: regularize_layer_params(layer, penalty, tags) and returns: apply_penalty