code: def l1_l2_regularizer(scale_l1=1.0, scale_l2=1.0, scope=None):
      """Returns a function that can be used to apply L1 L2 regularizations.
  
      Args:
        scale_l1: A scalar multiplier `Tensor` for L1 regularization.
        scale_l2: A scalar multiplier `Tensor` for L2 regularization.
        scope: An optional scope name.
  
      Returns:
        A function with signature `l1_l2(weights)` that applies a weighted sum of
        L1 L2 regularization.
  
      Raises:
        ValueError: If scale is negative or if scale is not a float.
      """
      if isinstance(scale_l1, numbers.Integral):
          raise ValueError(
              "scale_l1 cannot be an integer: %s" % (scale_l1,)
          )
      if isinstance(scale_l2, numbers.Integral):
          raise ValueError(
              "scale_l2 cannot be an integer: %s" % (scale_l2,)
          )
      scope = scope or "l1_l2_regularizer"
      if scale_l1 == 0.0:
          return l2_regularizer(scale_l2, scope)
      if scale_l2 == 0.0:
          return l1_regularizer(scale_l1, scope)
      return sum_regularizer(
          [l1_regularizer(scale_l1), l2_regularizer(scale_l2)],
          scope=scope,
      )
  
file_path: tensornets/tensornets/contrib_layers/regularizers.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numbers
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import nn
  from tensorflow.python.ops import standard_ops
  from tensorflow.python.platform import tf_logging
label_desc: Use image node_id 3 for calling a global function with example usage: l1_l2_regularizer(scale_l1, scale_l2, scope) and returns: sum_regularizer, l2_regularizer, l1_regularizer