code: def df_to_engine(df, engine: Engine):
      if engine == Engine.PANDAS:
          if isinstance(df, pd.DataFrame):
              return df
          else:
              return df.to_pandas()
      elif engine == Engine.CUDF:
          import cudf
  
          if isinstance(df, cudf.DataFrame):
              return df
          else:
              return cudf.DataFrame.from_pandas(df)
      raise ValueError("Only engines pandas/cudf supported")
  
file_path: pygraphistry/graphistry/Engine.py
imports: import pandas
  from typing import Any, Optional, Union
  from enum import Enum
label_desc: Use image node_id 4 for calling a global function with example usage: df_to_engine(df, engine) and returns: df, df, df, cudf