code: def fill_overload(
      cli_entrypoint,
      doc_str_title,
      doc_str_return,
      return_type,
      filepath,
      overload_fn,
      class_method,
      indent=" " * 4,
      regex_tag=None,
  ):
      a = _cli_to_schema(api_to_dict(), cli_entrypoint)
      if class_method:
          cli_args = [
              f'{indent}{indent}{k[0]}: Optional[{k[1]["type"]}] = {k[1]["default_literal"]}'
              for k in a
          ]
          args_str = ", \n".join(
              cli_args + [f"{indent}{indent}**kwargs"]
          )
          signature_str = f"def {overload_fn}(\n{indent}{indent}self,*,\n{args_str})"
          if return_type:
              signature_str += f" -> {return_type}:"
              return_str = (
                  f"\n{indent}{indent}:return: {doc_str_return}"
              )
          else:
              signature_str += ":"
              return_str = ""
      else:
          cli_args = [
              f'{indent}{k[0]}: Optional[{k[1]["type"]}] = {k[1]["default_literal"]}'
              for k in a
          ]
          args_str = ", \n".join(cli_args + [f"{indent}**kwargs"])
          signature_str = f"def {overload_fn}(*, \n{args_str})"
          if return_type:
              signature_str += f" -> {return_type}:"
              return_str = f"\n{indent}:return: {doc_str_return}"
          else:
              signature_str += ":"
              return_str = ""
      if class_method:
          doc_str = "\n".join(
              f'{indent}{indent}:param {k[0]}: {k[1]["description"]}'
              for k in a
          )
          noqa_str = "\n".join(
              f"{indent}{indent}.. # noqa: DAR{j}"
              for j in ["202", "101", "003"]
          )
      else:
          doc_str = "\n".join(
              f'{indent}:param {k[0]}: {k[1]["description"]}' for k in a
          )
          noqa_str = "\n".join(
              f"{indent}.. # noqa: DAR{j}"
              for j in ["202", "101", "003"]
          )
      if class_method:
          final_str = f'@overload\n{indent}{signature_str}\n{indent}{indent}"""{doc_str_title}\n\n{doc_str}{return_str}\n\n{noqa_str}\n{indent}{indent}"""'
          final_code = re.sub(
              rf"(# overload_inject_start_{regex_tag or cli_entrypoint}).*(# overload_inject_end_{regex_tag or cli_entrypoint})",
              f"\\1\n{indent}{final_str}\n{indent}\\2",
              open(filepath).read(),
              0,
              re.DOTALL,
          )
      else:
          final_str = f'@overload\n{signature_str}\n{indent}"""{doc_str_title}\n\n{doc_str}{return_str}\n\n{noqa_str}\n{indent}"""'
          final_code = re.sub(
              rf"(# overload_inject_start_{regex_tag or cli_entrypoint}).*(# overload_inject_end_{regex_tag or cli_entrypoint})",
              f"\\1\n{final_str}\n{indent}\\2",
              open(filepath).read(),
              0,
              re.DOTALL,
          )
  
      with open(filepath, "w", encoding="utf-8") as fp:
          fp.write(final_code)
      return {regex_tag or cli_entrypoint: doc_str}
  
imports: import re
  from jina_cli.export import api_to_dict
label_desc: Use image node_id 2 for calling a global function with example usage: fill_overload(cli_entrypoint, doc_str_title, doc_str_return, return_type, filepath, overload_fn, class_method, indent, regex_tag) and returns: dict