code: def generalized_pareto_constraint(loc, scale, conc):
      """Maps `s` to support based on `loc`, `scale` and `conc`."""
  
      def constrain(x):
          conc_ = tf.convert_to_tensor(conc)
          loc_ = tf.convert_to_tensor(loc)
          # When conc is very small but negative, the maximum of the support is
          # infinite, so we treat it as if it were non-negative.
          return tf.where(
              (conc_ >= 0.0) | ~tf.math.is_finite(scale / conc_),
              tf.math.softplus(x) + loc_,
              loc_ - tf.math.sigmoid(x) * scale / conc_,
          )
  
      return constrain
  
imports: import collections
  import inspect
  from absl import logging
  import hypothesis.strategies
  import tensorflow.compat.v2
  from tensorflow_probability.python import bijectors
  from tensorflow_probability.python.distributions import lkj
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import hypothesis_testlib
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 13 for calling a global function with example usage: generalized_pareto_constraint(loc, scale, conc) and returns: constrain, tf