code: def logpdf(x, shape, loc=0.0, scale=1.0, skewness=1.0):
      """
      Log PDF for the Skew-t distribution
  
      Parameters
      ----------
      x : np.array
          random variables
  
      shape : float
          The degrees of freedom for the skew-t distribution
  
      loc : np.array
          The location parameter for the skew-t distribution
  
      scale : float
          The scale of the distribution
  
      skewness : float
          Skewness parameter (if 1, no skewness, if > 1, +ve skew, if < 1, -ve skew)
  
      """
      m1 = (np.sqrt(shape) * sp.gamma((shape - 1.0) / 2.0)) / (
          np.sqrt(np.pi) * sp.gamma(shape / 2.0)
      )
      loc = loc + (skewness - (1.0 / skewness)) * scale * m1
      result = np.zeros(x.shape[0])
      result[x - loc < 0] = (
          np.log(2.0)
          - np.log(skewness + 1.0 / skewness)
          + ss.t.logpdf(
              x=skewness * x[(x - loc) < 0],
              loc=loc[(x - loc) < 0] * skewness,
              df=shape,
              scale=scale[(x - loc) < 0],
          )
      )
      result[x - loc >= 0] = (
          np.log(2.0)
          - np.log(skewness + 1.0 / skewness)
          + ss.t.logpdf(
              x=x[(x - loc) >= 0] / skewness,
              loc=loc[(x - loc) >= 0] / skewness,
              df=shape,
              scale=scale[(x - loc) >= 0],
          )
      )
      return result
  
imports: import sys
  import numpy
  import pandas
  import scipy.stats
  import scipy.special
  from ..None import families
  from ..None import output
  from ..None import tests
  from ..None import tsm
  from ..None import gas
  from ..None import data_check
label_desc: Use image node_id 1 for calling a global function with example usage: logpdf(x, shape, loc, scale, skewness) and returns: result