code: def logdet(a):
      sign, logdet = np.linalg.slogdet(a)
      if (sign < 0).any():
          warnings.warn(
              "invalid value encountered in log", RuntimeWarning
          )
          return np.where(sign < 0, np.nan, logdet)
      else:
          return logdet
  
imports: import warnings
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: logdet(a) and returns: np, logdet