code: def _regularize_weights(weights, reg_lambda):
      """
      Regularization of weights
  
      Parameters
      ----------
          weights : torch.Tensor
              Model weights to be regularized towards zero
          reg_lambda : float
              Regularization strength
  
      Returns
      -------
          torch.Tensor
              Regularization loss
      """
      reg_loss = 0.0
      if reg_lambda is not None:
          for offset in weights.keys():
              reg_loss += reg_lambda * reg_func_abs(weights[offset])
      return reg_loss
  
imports: from __future__ import annotations
  import logging
  import math
  import os
  import sys
  from collections import OrderedDict
  from typing import TYPE_CHECKING, Iterable, Optional, Union
  import numpy
  import pandas
  import pytorch_lightning
  import torch
  from neuralprophet import utils_torch
  from neuralprophet.hdays_utils import get_country_holidays
  from neuralprophet.logger import ProgressBar
label_desc: Use image node_id 6 for calling a global function with example usage: _regularize_weights(weights, reg_lambda) and returns: reg_loss