code: def _validate_flow(f):
      graph_dict = f._get_graph_representation()
      addresses = f._get_deployments_addresses()
      for name, pod in f:
          if name != "gateway":
              for n in pod.needs:
                  assert (
                      name
                      in graph_dict[
                          n if n != "gateway" else "start-gateway"
                      ]
                  )
          else:
              for n in pod.needs:
                  assert "end-gateway" in graph_dict[n]
  
file_path: jina/tests/unit/orchestrate/flow/flow-example/test_flow_examples.py
imports: import os
  import pytest
  from jina import Flow
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_flow(f) without return types