code: def timed_agg(
      df,
      filepath,
      plot_width=int(900),
      plot_height=int(900 * 7.0 / 12),
      cache_ranges=True,
  ):
      global CACHED_RANGES
      start = time.time()
      cvs = ds.Canvas(
          plot_width,
          plot_height,
          x_range=CACHED_RANGES[0],
          y_range=CACHED_RANGES[1],
      )
      agg = cvs.points(df, p.x, p.y)
      end = time.time()
      if cache_ranges:
          CACHED_RANGES = (cvs.x_range, cvs.y_range)
      img = export_image(tf.shade(agg), filepath, export_path=".")
      return img, end - start
  
imports: from __future__ import annotations
  import time
  import os, os.path, sys, glob, argparse, resource, multiprocessing
  import pandas
  import dask.dataframe
  import numpy
  import datashader
  import feather
  import fastparquet
  from datashader.utils import export_image
  from datashader import transfer_functions
  from dask import distributed
label_desc: Use image node_id 9 for calling a global function with example usage: timed_agg(df, filepath, plot_width, plot_height, cache_ranges) and returns: img,  unknown