code: def assert_function_style(name, member, doc, args):
      code = inspect.getsource(member)
      has_return = re.findall(r"\s*return \S+", code, re.MULTILINE)
      if has_return and "Returns:" not in doc:
          innerfunction = [
              inspect.getsource(x)
              for x in member.__code__.co_consts
              if inspect.iscode(x)
          ]
          return_in_sub = [
              ret
              for code_inner in innerfunction
              for ret in re.findall(
                  r"\s*return \S+", code_inner, re.MULTILINE
              )
          ]
          if len(return_in_sub) < len(has_return):
              raise ValueError(
                  "{} needs a 'Returns:' section".format(member),
                  member.__module__,
              )
  
      has_raise = re.findall(r"^\s*raise \S+", code, re.MULTILINE)
      if (
          has_raise
          and "Raises:" not in doc
          and not any(
              ["NotImplementedError" in row for row in has_raise]
          )
      ):
          innerfunction = [
              inspect.getsource(x)
              for x in member.__code__.co_consts
              if inspect.iscode(x)
          ]
          raise_in_sub = [
              ret
              for code_inner in innerfunction
              for ret in re.findall(
                  r"\s*raise \S+", code_inner, re.MULTILINE
              )
          ]
          if len(raise_in_sub) < len(has_raise):
              raise ValueError(
                  "{} needs a 'Raises:' section".format(member),
                  member.__module__,
              )
  
      if len(args) > 0 and "Args:" not in doc:
          raise ValueError(
              "{} needs a 'Args' section".format(member),
              member.__module__,
          )
  
      assert_blank_before(
          name, member, doc, ["Args:", "Raises:", "Returns:"]
      )
  
file_path: baal/tests/documentation_test.py
imports: import importlib
  import inspect
  import re
  import sys
  from itertools import compress
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: assert_function_style(name, member, doc, args) without return types