code: def check_list_of_dict_table(
      obj, return_metadata=False, var_name="obj"
  ):
      metadata = dict()
  
      if not isinstance(obj, list):
          msg = f"{var_name} must be a list of dict, found {type(obj)}"
          return _ret(False, msg, None, return_metadata)
  
      if not np.all([isinstance(x, dict) for x in obj]):
          msg = (
              f"{var_name} must be a list of dict, but elements at following "
              f"indices are not dict: {np.where(not isinstance(x, dict) for x in obj)}"
          )
          return _ret(False, msg, None, return_metadata)
  
      for i, d in enumerate(obj):
          for key in d.keys():
              if not isinstance(d[key], PRIMITIVE_TYPES):
                  msg = (
                      "all entries must be of primitive type (str, int, float), but "
                      f"found {type(d[key])} at index {i}, key {key}"
                  )
  
      # we now know obj is a list of dict
      # check whether there any nans; compute only if requested
      if _req("is_univariate", return_metadata):
          multivariate_because_one_row = np.any(
              [len(x) > 1 for x in obj]
          )
          if not multivariate_because_one_row:
              all_keys = np.unique(
                  [key for d in obj for key in d.keys()]
              )
              multivariate_because_keys_different = len(all_keys) > 1
              multivariate = multivariate_because_keys_different
          else:
              multivariate = multivariate_because_one_row
          metadata["is_univariate"] = not multivariate
      if _req("has_nans", return_metadata):
          metadata["has_nans"] = np.any(
              [pd.isnull(d[key]) for d in obj for key in d.keys()]
          )
      if _req("is_empty", return_metadata):
          metadata["is_empty"] = len(obj) < 1 or np.all(
              [len(x) < 1 for x in obj]
          )
      if _req("n_instances", return_metadata):
          metadata["n_instances"] = len(obj)
  
      return _ret(True, None, metadata, return_metadata)
  
imports: import numpy
  import pandas
  from sktime.datatypes._common import _req, _ret
label_desc: Use image node_id 5 for calling a global function with example usage: check_list_of_dict_table(obj, return_metadata, var_name) and returns: _ret, _ret, _ret