code: def init(
      model: Model[InT, OutT],
      X: Optional[InT] = None,
      Y: Optional[OutT] = None,
  ) -> None:
      key_transform = model.get_ref(KEY_TRANSFORM_REF)
      width = get_width(X) if X is not None else None
      if width:
          model.set_dim("nO", width)
          if key_transform.has_dim("nO"):
              key_transform.set_dim("nO", width)
  
      # Randomly initialize the parameter, as though it were an embedding.
      Q = model.ops.alloc1f(model.get_dim("nO"))
      Q += model.ops.xp.random.uniform(-0.1, 0.1, Q.shape)
      model.set_param("Q", Q)
  
      X_array = X.dataXd if X is not None else None
      Y_array = Y.dataXd if Y is not None else None
  
      key_transform.initialize(X_array, Y_array)
  
file_path: thinc/thinc/layers/parametricattention_v2.py
imports: from typing import Callable, Optional, Tuple, cast
  from ..config import registry
  from ..model import Model
  from ..types import Floats2d, Ragged
  from ..util import get_width
  from .noop import noop
label_desc: Use image node_id 3 for calling a global function with example usage: init(model, X, Y) without return types