code: def _check_dataset(df, features=None):
      """
      Validate input dataset and ensure it is a pandas DataFrame with the specified features.
  
      Parameters
      ----------
      df : pd.DataFrame
          The input dataset to be validated.
      features : list, optional
          A list of feature column names that should be present in the input dataset, by default None.
  
      Raises
      ------
      AssertionError
          If the input dataset is not a pandas DataFrame.
      ValueError
          If the input dataset does not contain all the specified features.
      """
      if not isinstance(df, pd.DataFrame):
          raise AssertionError("only accept pandas DataFrame")
  
      if features is not None:
          features = set(features)
          cols = set(df.columns.values)
          missing_features = features - cols
          if missing_features:
              raise ValueError(
                  f"df doesn't contain all model features, missing: {missing_features}"
              )
  
imports: import numpy
  import pandas
  import psutil
label_desc: Use image node_id 4 for calling a global function with example usage: _check_dataset(df, features) without return types