code: def register_ac():
      import os
      import re
      from pathlib import Path
  
      home = str(Path.home())
      resource_path = "jina/resources/completions/jina.%s"
      regex = r"#\sJINA_CLI_BEGIN(.*)#\sJINA_CLI_END"
      _check = {"zsh": ".zshrc", "bash": ".bashrc", "fish": ".fish"}
  
      def add_ac(k, v):
          v_fp = os.path.join(home, v)
          if os.path.exists(v_fp) or os.environ.get(
              "SHELL", ""
          ).endswith(k):
              try:
                  with open(v_fp, encoding="utf-8") as fp:
                      sh_content = fp.read()
              except FileNotFoundError:
                  sh_content = ""
              with open(resource_path % k, encoding="utf-8") as fr:
                  if re.findall(regex, sh_content, flags=re.S):
                      _sh_content = re.sub(
                          regex, fr.read(), sh_content, flags=re.S
                      )
                  else:
                      _sh_content = sh_content + "\n\n" + fr.read()
              if _sh_content:
                  with open(v_fp, "w", encoding="utf-8") as fp:
                      fp.write(_sh_content)
  
      try:
          for k, v in _check.items():
              add_ac(k, v)
      except Exception:
          pass
  
file_path: jina/setup.py
imports: import os
  import subprocess
  import sys
  import platform
  from os import path
  from setuptools import Extension, find_packages, setup
  from setuptools.command.develop import develop
  from setuptools.command.egg_info import egg_info
  from setuptools.command.install import install
label_desc: Use image node_id 1 for calling a global function with example usage: register_ac() without return types