code: def test_export_api(tmpdir):
      with open(tmpdir / "test.yml", "w", encoding="utf-8") as fp:
          JAML.dump(api_to_dict(), fp)
      with open(tmpdir / "test.json", "w", encoding="utf-8") as fp:
          json.dump(api_to_dict(), fp)
  
imports: import json
  import os
  import subprocess
  import pytest
  from jina.checker import NetworkChecker
  from jina.jaml import JAML
  from jina.orchestrate.pods.factory import PodFactory
  from jina.parsers import set_deployment_parser
  from jina.parsers.ping import set_ping_parser
  from jina_cli.autocomplete import ac_table
  from jina_cli.export import api_to_dict
  from jina_cli.lookup import _build_lookup_table, lookup_and_print
  from tests.helper import _generate_pod_args
label_desc: Use image node_id 1 for calling a global function with example usage: test_export_api(tmpdir) without return types