code: def get_str_signature_from_docstring(
      doc: str, callable_name: str
  ) -> Optional[str]:
      if not doc or callable_name not in doc:
          return None
      else:
          # gets part of the docstring that contains the signature
          doc = re.sub(r"\s", "", doc.split("\n\n")[0])
          # gets signature
          signature_search_result = re.search(
              rf"{callable_name}\((.+)\)", doc
          )
          if signature_search_result:
              signature_str = signature_search_result.group(1)
              # decomposing "[]" optional  params
              params = re.findall(r"\[(.+?)\]", signature_str)
  
              if params:
                  # for instance in:
                  # numpy.matmul(x1, x2, /, out=None, *, casting='same_kind',
                  # order='K', dtype=None, subok=True[, signature, extobj, axes, axis])
                  # we have [, signature, extobj, axes, axis] , which we replace as normal params
                  for param in params[:-1]:
                      signature_str = signature_str.replace(
                          f"[{param}]", param
                      )
  
                  if re.search(rf"(?<={params[-1]})\],", signature_str):
                      signature_str = signature_str.replace(
                          f"[{params[-1]}],", params[-1]
                      )
                  else:
                      signature_str = signature_str.replace(
                          f"[{params[-1]}]",
                          f', {",".join([f"{param}=None" for param in params[-1].split(",") if param])}',
                      )
  
              # removes "/" and "*"
              signature_str = re.sub(r",(\/|\*)", "", signature_str)
              # removes dtypes
              signature_str = re.sub(
                  r"dtype=(\w+),", "dtype=None,", signature_str
              )
              return f"{callable_name}({signature_str})"
          else:
              return None
  
file_path: PySyft/packages/syft/src/syft/serde/signature.py
imports: import inspect
  from inspect import Parameter
  from inspect import Signature
  from inspect import _ParameterKind
  from inspect import _signature_fromstr
  import re
  from typing import Callable
  from typing import Optional
  from .deserialize import _deserialize
  from .recursive import recursive_serde_register
  from .serialize import _serialize
label_desc: Use image node_id 5 for calling a global function with example usage: get_str_signature_from_docstring(doc, callable_name) and returns: None, callable_name, str, signature_str, str, None