code: def testFiniteGradientAtDifficultPoints(self, skewness):
      def make_fn(attr):
          x = np.array([-100, -20, -5.0, 0.0, 5.0, 20, 100]).astype(
              self.dtype
          )
          return (
              lambda m, s, g: getattr(  # pylint: disable=g-long-lambda
                  two_piece_normal.TwoPieceNormal(
                      m, scale=s, skewness=g, validate_args=True
                  ),
                  attr,
              )(x)
          )
  
      loc = tf.constant(0.0, self.dtype)
      scale = tf.constant(1.0, self.dtype)
  
      # 'log_cdf' currently fails at -100 in fp64 and at -100, -20 in fp32.
      # 'log_survival_function' currently fails at 100, 20 in fp64 and at 100,
      #   20, 5 in fp32.
      # We've already tried the following ideas to solve these problems:
      # * Implementing the log_cdf method directly using the Log Normal
      #   distribution function (log_ndtr) when value < loc;
      # * Implementing the cdf method using the Gamma distribution function; and
      # * Implementing the cdf method using the Student's t distribution function
      #   when value < loc.
      for attr in ("prob", "cdf", "survival_function", "log_prob"):
          value, grads = self.evaluate(
              gradient.value_and_gradient(
                  make_fn(attr),
                  [loc, scale, tf.constant(skewness, self.dtype)],
              )
          )
          self.assertAllFinite(value)
          self.assertAllFinite(grads[0])  # d/d loc
          self.assertAllFinite(grads[1])  # d/d scale
          self.assertAllFinite(grads[2])
  
imports: import itertools
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import two_piece_normal
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 17 for calling the _TwoPieceNormalTest obj's underlying member method code with example usage: obj.testFiniteGradientAtDifficultPoints(skewness) and returns: function