code: def test_issue_shards_missmatch_endpoint_and_shard_with_lists():
      class MyDoc(BaseDoc):
          text: str
          embedding: NdArray[128]
  
      class MyDocWithMatchesAndScores(MyDoc):
          matches: DocList[MyDoc]
          scores: List[float]
  
      class MyExec(Executor):
          @requests(on="/search")
          def foo(
              self, docs: DocList[MyDoc], **kwargs
          ) -> DocList[MyDocWithMatchesAndScores]:
              res = DocList[MyDocWithMatchesAndScores]()
              for doc in docs:
                  new_doc = MyDocWithMatchesAndScores(
                      id=doc.id,
                      text=doc.text,
                      embedding=doc.embedding,
                      matches=[
                          MyDoc(text="m", embedding=np.random.rand(128))
                      ],
                      scores=[1.0 for _ in docs],
                  )
                  res.append(new_doc)
              return res
  
      d = Deployment(uses=MyExec, shards=2)
      with d:
          res = d.post(
              on="/search",
              inputs=DocList[MyDoc](
                  [MyDoc(text="hey ha", embedding=np.random.rand(128))]
              ),
              return_type=DocList[MyDocWithMatchesAndScores],
          )
          assert len(res) == 1
          for doc in res:
              assert len(doc.scores) == 2
              assert len(doc.matches) == 2
  
imports: import os
  import time
  from typing import Any, AsyncGenerator, AsyncIterator, Dict, Generator, Iterator, List, Optional, Union
  import numpy
  import pytest
  from docarray import BaseDoc, DocList
  from docarray.documents import ImageDoc, TextDoc
  from docarray.documents.legacy import LegacyDocument
  from docarray.typing import AnyTensor, ImageUrl, NdArray
  from jina import Client, Deployment, Executor, Flow, dynamic_batching, requests
  from jina.excepts import RuntimeFailToStart
  from jina.helper import random_port
  import uuid
label_desc: Use image node_id 37 for calling a global function with example usage: test_issue_shards_missmatch_endpoint_and_shard_with_lists() and returns: res