code: def _scalar_constrainer(support):
      """Helper for `constrainer` for scalar supports."""
  
      def nonzero(x):
          return tf.where(tf.equal(x, 0), 1e-6, x)
  
      constrainers = {
          Support.SCALAR_IN_0_1: tf.math.sigmoid,
          Support.SCALAR_GT_NEG1: softplus_plus_eps(-1 + 1e-6),
          Support.SCALAR_NON_ZERO: nonzero,
          Support.SCALAR_IN_NEG1_1: lambda x: tf.math.tanh(x)
          * (1 - 1e-6),
          Support.SCALAR_NON_NEGATIVE: tf.math.softplus,
          Support.SCALAR_POSITIVE: softplus_plus_eps(),
          Support.SCALAR_UNCONSTRAINED: tf.identity,
      }
      if support not in constrainers:
          raise NotImplementedError(support)
      return constrainers[support]
  
imports: import contextlib
  import os
  import re
  import traceback
  import unittest
  import hypothesis
  from hypothesis.extra import numpy
  import hypothesis.strategies
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.util.deferred_tensor import DeferredTensor
label_desc: Use image node_id 13 for calling a global function with example usage: _scalar_constrainer(support) and returns: constrainers, tf