code: def find_stack_level() -> int:
      """Find the first place in the stack that is not inside janitor
      (tests notwithstanding).
  
      Adapted from Pandas repo.
  
      Returns:
          Stack level number
      """
  
      import inspect
  
      import janitor as jn
  
      pkg_dir = os.path.abspath(os.path.dirname(jn.__file__))
      test_dir = os.path.join(os.path.dirname(pkg_dir), "tests")
  
      # https://stackoverflow.com/questions/17407119/python-inspect-stack-is-slow
      frame = inspect.currentframe()
      n = 0
      while frame:
          fname = inspect.getfile(frame)
          if fname.startswith(pkg_dir) and not fname.startswith(
              test_dir
          ):
              frame = frame.f_back
              n += 1
          else:
              break
      return n
  
imports: from __future__ import annotations
  import importlib
  import os
  import socket
  import sys
  from functools import singledispatch, wraps
  from pathlib import Path
  from typing import Any, Callable, Dict, Iterable, List, Union
  from warnings import warn
  import numpy
  import pandas
label_desc: Use image node_id 18 for calling a global function with example usage: find_stack_level() and returns: n