code: def get_dataframe_package(df):
      """Utility function to return the top level package (pandas/cudf)
      of DataFrame/Series/Index objects"""
      module = inspect.getmodule(df)
      package, _, _ = module.__name__.partition(".")
      return sys.modules[package]
  
imports: from __future__ import division, print_function
  import inspect
  import sys
label_desc: Use image node_id 5 for calling a global function with example usage: get_dataframe_package(df) and returns: sys