code: def l_2nd(beta):
      def loss_2nd(y_true, y_pred):
          b_ = np.ones_like(y_true)
          b_[y_true != 0] = beta
          x = K.square((y_true - y_pred) * b_)
          t = K.sum(
              x,
              axis=-1,
          )
          return K.mean(t)
  
      return loss_2nd
  
imports: import time
  import numpy
  import scipy.sparse
  import tensorflow
  from tensorflow.python.keras import backend
  from tensorflow.python.keras.callbacks import History
  from tensorflow.python.keras.layers import Dense, Input
  from tensorflow.python.keras.models import Model
  from tensorflow.python.keras.regularizers import l1_l2
  from ..utils import preprocess_nxgraph
label_desc: Use image node_id 1 for calling a global function with example usage: l_2nd(beta) and returns: loss_2nd, K