code: def construct_runtime_container_args(
      cargs, uses_metas, uses_with, pod_type
  ):
      """
      Construct a set of Namespace arguments into a list of arguments to pass to a container entrypoint
      :param cargs: The namespace arguments
      :param uses_metas: The uses_metas to override
      :param uses_with: The uses_with to override
      :param pod_type: The pod_type
      :return: Arguments to pass to container
      """
      import json
  
      from jina.helper import ArgNamespace
      from jina.parsers import set_pod_parser
  
      taboo = {
          "uses_with",
          "uses_metas",
          "volumes",
          "uses_before",
          "uses_after",
          "workspace_id",
          "noblock_on_start",
          "env",
          "env_from_secret",
          "image_pull_secrets",
      }
  
      if pod_type == PodRoleType.HEAD:
          taboo.add("uses")
          taboo.add("workspace")
  
      if pod_type in {PodRoleType.WORKER, PodRoleType.GATEWAY}:
          taboo.add("polling")
  
      non_defaults = ArgNamespace.get_non_defaults_args(
          cargs,
          set_pod_parser(),
          taboo=taboo,
      )
      _args = ArgNamespace.kwargs2list(non_defaults)
      container_args = ["executor"] + _args
      if uses_metas is not None:
          container_args.extend(
              ["--uses-metas", json.dumps(uses_metas)]
          )
      if uses_with is not None:
          container_args.extend(["--uses-with", json.dumps(uses_with)])
      container_args.append("--native")
      return container_args
  
file_path: jina/jina/orchestrate/deployments/config/helper.py
imports: import os
  from typing import Dict, Optional
  from hubble.executor.helper import is_valid_docker_uri, parse_hub_uri
  from hubble.executor.hubio import HubIO
  from jina.constants import __default_composite_gateway__, __default_executor__, __default_grpc_gateway__, __default_http_gateway__, __default_websocket_gateway__, __dynamic_base_gateway_hubble__
  from jina.enums import PodRoleType
label_desc: Use image node_id 5 for calling a global function with example usage: construct_runtime_container_args(cargs, uses_metas, uses_with, pod_type) and returns: container_args