code: def test_layers_batching_all(name, kwargs, in_data, out_data):
      cfg = {"@layers": name, **kwargs}
      model = registry.resolve({"config": cfg})["config"]
      if "expand_window" in name:
          return
      if "LSTM" in name:
          model = with_padded(model)
          util_batch_unbatch_list(model, in_data, out_data)
      else:
          if isinstance(in_data, OPS.xp.ndarray) and in_data.ndim == 2:
              if (
                  isinstance(out_data, OPS.xp.ndarray)
                  and out_data.ndim == 2
              ):
                  util_batch_unbatch_array(model, in_data, out_data)
          if isinstance(in_data, Ragged):
              if (
                  isinstance(out_data, OPS.xp.ndarray)
                  and out_data.ndim == 2
              ):
                  util_batch_unbatch_ragged(model, in_data, out_data)
  
imports: from typing import List, Optional
  import numpy
  import pytest
  import srsly
  from numpy.testing import assert_almost_equal
  from thinc.api import Dropout, Model, NumpyOps, registry, with_padded
  from thinc.backends import NumpyOps
  from thinc.compat import has_torch
  from thinc.types import Array2d, Floats2d, FloatsXd, Padded, Ragged, Shape
  from thinc.util import data_validation, get_width
label_desc: Use image node_id 5 for calling a global function with example usage: test_layers_batching_all(name, kwargs, in_data, out_data) without return types