code: def test_repeated_max_len():
      repeated = Repeated(
          dtype=Label(classes=["classA", "classB"]), max_len=2
      )
  
      with pytest.raises(ValueError):
          repeated.deserialize(
              *(
                  {"label": "classA"},
                  {"label": "classA"},
                  {"label": "classB"},
              )
          )
      assert repeated.deserialize(
          *({"label": "classA"}, {"label": "classB"})
      ) == (
          torch.tensor(0),
          torch.tensor(1),
      )
      with pytest.raises(ValueError):
          repeated.serialize(
              (torch.tensor(0), torch.tensor(0), torch.tensor(1))
          )
      assert repeated.serialize((torch.tensor(1), torch.tensor(0))) == (
          "classB",
          "classA",
      )
  
      # max_len < 1
      with pytest.raises(ValueError):
          Repeated(dtype=Label(classes=["classA", "classB"]), max_len=0)
      assert (
          Repeated(dtype=Label(classes=["classA", "classB"]), max_len=1)
          is not None
      )
  
      # type(max_len) is not int
      with pytest.raises(TypeError):
          Repeated(
              dtype=Label(classes=["classA", "classB"]), max_len=str
          )
  
file_path: lightning-flash/tests/core/serve/test_types/test_repeated.py
imports: import pytest
  import torch
  from flash.core.serve.types import Label, Repeated
  from flash.core.utilities.imports import _TOPIC_SERVE_AVAILABLE
label_desc: Use image node_id 3 for calling a global function with example usage: test_repeated_max_len() without return types