code: def configure_metadata_service(existing_env):
      empty_profile = False
      if not existing_env:
          empty_profile = True
      env = {}
  
      # Set Metadata Service as default.
      env["METAFLOW_DEFAULT_METADATA"] = "service"
      # Set URL for the Metadata Service.
      env["METAFLOW_SERVICE_URL"] = click.prompt(
          cyan("[METAFLOW_SERVICE_URL]") + " URL for Metaflow Service.",
          default=existing_env.get("METAFLOW_SERVICE_URL"),
          show_default=True,
      )
      # Set internal URL for the Metadata Service.
      env["METAFLOW_SERVICE_INTERNAL_URL"] = click.prompt(
          cyan("[METAFLOW_SERVICE_INTERNAL_URL]")
          + yellow(" (optional)")
          + " URL for Metaflow Service "
          + "(Accessible only within VPC [AWS] or a Kubernetes cluster [if the service runs in one]).",
          default=existing_env.get(
              "METAFLOW_SERVICE_INTERNAL_URL",
              env["METAFLOW_SERVICE_URL"],
          ),
          show_default=True,
      )
      # Set Auth Key for the Metadata Service.
      env["METAFLOW_SERVICE_AUTH_KEY"] = click.prompt(
          cyan("[METAFLOW_SERVICE_AUTH_KEY]")
          + yellow(" (optional)")
          + " Auth Key for Metaflow Service.",
          default=existing_env.get("METAFLOW_SERVICE_AUTH_KEY", ""),
          show_default=True,
      )
      return env
  
imports: import json
  import os
  import sys
  from os.path import expanduser
  from metaflow.util import to_unicode
  from metaflow._vendor import click
  from metaflow.util import to_unicode
  from .util import echo_always, makedirs
label_desc: Use image node_id 19 for calling a global function with example usage: configure_metadata_service(existing_env) and returns: env