code: def _nested_dataframe_has_nans(X: pd.DataFrame) -> bool:
      """Check whether an input pandas of Series has nans.
  
      Parameters
      ----------
      X : pd.DataFrame where each cell is a pd.Series
  
      Returns
      -------
      True if x contains any NaNs, False otherwise.
      """
      cases = len(X)
      dimensions = len(X.columns)
      for i in range(cases):
          for j in range(dimensions):
              s = X.iloc[i, j]
              if hasattr(s, "size"):
                  for k in range(s.size):
                      if pd.isna(s.iloc[k]):
                          return True
              elif pd.isna(s):
                  return True
      return False
  
file_path: sktime/sktime/datatypes/_panel/_check.py
imports: import numpy
  import pandas
  from pandas.core.dtypes.cast import is_nested_object
  from sktime.datatypes._common import _req, _ret
  from sktime.datatypes._series._check import _index_equally_spaced, check_pddataframe_series
  from sktime.utils.validation._dependencies import _check_soft_dependencies
  from sktime.utils.validation.series import is_in_valid_index_types, is_integer_index
label_desc: Use image node_id 8 for calling a global function with example usage: _nested_dataframe_has_nans(X) and returns: False, True, True