code: def normalize_ray_callback(cb):
      if isinstance(cb, RayDaskCallback):
          return cb._ray_callback
      elif isinstance(cb, RayCallback):
          return cb
      else:
          raise TypeError(
              "Callbacks must be either 'RayDaskCallback' or 'RayCallback' namedtuple"
          )
  
imports: import contextlib
  from collections import namedtuple, defaultdict
  from datetime import datetime
  from dask.callbacks import Callback
label_desc: Use image node_id 1 for calling a global function with example usage: normalize_ray_callback(cb) and returns: cb, cb