code: def test_distributed_replicas(input_docs, hosts, as_list, use_stream):
      port1, port2 = random_port(), random_port()
      ports = [port1, port2]
      if not as_list:
          ports = f"{port1},{port2}"
      args1, args2 = _external_deployment_args(
          num_shards=1, port=port1
      ), _external_deployment_args(num_shards=1, port=port2)
      depl1 = Deployment(args1)
      depl2 = Deployment(args2)
      with depl1, depl2:
          flow = Flow().add(
              host=hosts,
              port=ports,
              external=True,
          )
          with flow:
              resp = flow.index(
                  inputs=input_docs, request_size=2, stream=use_stream
              )
  
          depl1_id = resp[0].tags["uuid"]
          assert any(
              [
                  depl1_id != depl_id
                  for depl_id in resp[1:, "tags__uuid"]
              ]
          )
  
file_path: jina/tests/integration/distributed-replicas/test_distributed_replicas.py
imports: import os
  import time
  import pytest
  from docarray import Document, DocumentArray
  from jina import Flow
  from jina.helper import random_port
  from jina.orchestrate.deployments import Deployment
  from jina.parsers import set_deployment_parser
label_desc: Use image node_id 5 for calling a global function with example usage: test_distributed_replicas(input_docs, hosts, as_list, use_stream) without return types