code: def add_callback(obj, callback, args=()):
      
      callbacks = obj._callbacks
      node = Node(callback, args)
      # Store a single callback directly in _callbacks
      if callbacks is None:
          obj._callbacks = node
          return node
      # Otherwise use a dllist.
      if not isinstance(callbacks, dllist):
          obj._callbacks = dllist()
          obj._callbacks.insert(callbacks)
          callbacks = obj._callbacks
      callbacks.insert(node)
      return node
docs: Add a callback to an object.