code: def forward(
      model: Model[InT, InT], X: InT, is_train: bool
  ) -> Tuple[InT, Callable]:
      rate = model.attrs["dropout_rate"]
      is_enabled = model.attrs["is_enabled"] and is_train
      if rate == 0 or not is_enabled:
          return X, lambda dY: dY
      elif isinstance(X, Ragged):
          data_r, backprop = _dropout_ragged(model, X, is_train)
          return cast(InT, data_r), backprop
      elif isinstance(X, Padded):
          data_p, backprop = _dropout_padded(model, X, is_train)
          return cast(InT, data_p), backprop
      elif isinstance(X, Sequence):
          data_l, backprop = _dropout_lists(model, X, is_train)
          return cast(InT, data_l), backprop
      else:
          data_a, backprop = _dropout_array(
              model, cast(ArrayXd, X), is_train
          )
          return cast(InT, data_a), backprop
  
file_path: thinc/thinc/layers/dropout.py
imports: from typing import Callable, List, Sequence, Tuple, TypeVar, Union, cast
  from ..config import registry
  from ..model import Model
  from ..types import ArrayXd, Padded, Ragged
label_desc: Use image node_id 2 for calling a global function with example usage: forward(model, X, is_train) and returns: X,  function, cast,  backprop, cast,  backprop, cast,  backprop, cast,  backprop