code: def process_func(func, func_name, func_doc_items, content):
      """
      Adds docstrings to a function.
  
      Raises
      ------
      Exception
          If the docstring marker is not found in the content (source code).
      """
  
      def replace_marker_if_present(marker_name, new_text):
          marker = f"<{marker_prefix}{marker_name}"
          if marker in content:
              return content.replace(
                  marker, add_indent(new_text, indent)
              )
          raise Exception(
              f"Cannot find {marker} in {func_name} docstring"
          )
  
      ori_docstring = ast.get_docstring(func)
      marker_prefix = func_name.split(".", 1)[-1]
      indent = " " * (func.col_offset + 4)
  
      if DOC_FUNC in ori_docstring:
          func_params = extract_params(func)
          param_docstring = generate_params_docstring(
              func_name, func_params, func_doc_items["params"]
          )
          content = replace_marker_if_present(DOC_FUNC, param_docstring)
  
      if DOC_RETURN in ori_docstring:
          return_docstring = generate_returns_docstring(
              func_name, func_doc_items["returns"]
          )
          content = replace_marker_if_present(
              DOC_RETURN, return_docstring
          )
  
      return content
  
imports: import ast
  import json
  import re
  import argparse
  import textwrap
  import os
  from collections import defaultdict
label_desc: Use image node_id 6 for calling a global function with example usage: process_func(func, func_name, func_doc_items, content) and returns: content, content