code: def _vector_constrainer(support):
      """Helper for `constrainer` for vector supports."""
  
      def l1norm(x):
          x = tf.concat([x, tf.ones_like(x[..., :1]) * 1e-6], axis=-1)
          x = x / tf.linalg.norm(x, ord=1, axis=-1, keepdims=True)
          return tf.math.abs(x)
  
      def l2norm(x):
          norm_sq = tf.reduce_sum(tf.square(x), axis=-1, keepdims=True)
          return tf.concat([2 * x, norm_sq - 1], axis=-1) / (
              norm_sq + 1
          )
  
      constrainers = {
          Support.VECTOR_UNCONSTRAINED: identity_fn,
          Support.VECTOR_STRICTLY_INCREASING: lambda x: tf.cumsum(
              tf.abs(x) + 1e-3, axis=-1
          ),
          Support.VECTOR_POSITIVE_WITH_L1_NORM_1_SIZE_GT1: l1norm,
          Support.VECTOR_SIZE_TRIANGULAR: identity_fn,
          Support.VECTOR_WITH_L2_NORM_1_SIZE_GT1: l2norm,
      }
      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 14 for calling a global function with example usage: _vector_constrainer(support) and returns: constrainers, tf, unknown