code: def _safe_cond(a):
      """Compute condition while protecting from LinAlgError"""
      try:
          return np.linalg.cond(a)
      except np.linalg.LinAlgError:
          if np.any(np.isnan(a)):
              return np.nan
          else:
              return np.inf
  
imports: import numpy
  from scipy.linalg import solve_sylvester
  import pandas
  from statsmodels.compat.pandas import Appender
  from statsmodels.tools.data import _is_using_pandas
  from scipy.linalg.blas import find_best_blas_type
  from .None import _initialization, _representation, _kalman_filter, _kalman_smoother, _simulation_smoother, _cfa_simulation_smoother, _tools
label_desc: Use image node_id 31 for calling a global function with example usage: _safe_cond(a) and returns: np, np, np