code: def flow_with_sharding(docker_images, polling):
      flow = Flow(
          name="test-flow-with-sharding", port=9090, protocol="grpc"
      ).add(
          name="test_executor_sharding",
          shards=2,
          replicas=2,
          uses=f"docker://{docker_images[0]}",
          uses_after=f"docker://{docker_images[1]}",
          polling=polling,
      )
      return flow
  
file_path: jina/tests/docker_compose/test_flow_docker_compose.py
imports: import os
  import pytest
  import requests
  from jina import Client, Document, Flow
  from jina.helper import random_port
  from jina.serve.runtimes.servers import BaseServer
  from tests.docker_compose.conftest import DockerComposeServices
  from tests.helper import _validate_custom_gateway_process, _validate_dummy_custom_gateway_response
label_desc: Use image node_id 1 for calling a global function with example usage: flow_with_sharding(docker_images, polling) and returns: flow