code: def validate_dataframe(df, mandatory_columns):
      columns_exist = all(
          [col in df.columns for col in mandatory_columns]
      )
  
      if not columns_exist:
          raise MissingColumns(
              f"Columns {mandatory_columns} are missing from the dataframe."
          )
  
      return df
  
file_path: mindsdb/mindsdb/integrations/utilities/datasets/dataset.py
imports: from pathlib import Path
  import pandas
label_desc: Use image node_id 3 for calling a global function with example usage: validate_dataframe(df, mandatory_columns) and returns: df