code: def _attach(doc, component):
      if not hasattr(doc, "components"):
          doc.components = set()
  
      doc.components.add(component)
  
file_path: distributed/distributed/dashboard/components/__init__.py
imports: from __future__ import annotations
  import weakref
  from bokeh.core.properties import without_property_validation
label_desc: Use image node_id 3 for calling a global function with example usage: _attach(doc, component) without return types