code: def reg_func_covariates(
      config_lagged_regressors: ConfigLaggedRegressors, model
  ):
      """
      Regularization of lagged covariates to induce sparsity
  
      Parameters
      ----------
          config_lagged_regressors : configure.ConfigLaggedRegressors
              Configurations for lagged regressors
          model : TimeNet
              TimeNet model object
  
      Returns
      -------
          scalar
              Regularization loss
      """
      reg_covariate_loss = 0.0
      weights = model.get_covar_weights()
      for covariate, configs in config_lagged_regressors.items():
          reg_lambda = configs.reg_lambda
          if reg_lambda is not None:
              loss = torch.mean(
                  utils_torch.penalize_nonzero(weights[covariate])
              ).squeeze()
              reg_covariate_loss += reg_lambda * loss
  
      return reg_covariate_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 8 for calling a global function with example usage: reg_func_covariates(config_lagged_regressors, model) and returns: reg_covariate_loss