code: def _object_to_dict(obj):
      """
      Recursively get the attributes
      of an object as a dictionary.
  
      Args:
          obj: Object whose attributes are to be extracted.
  
      Returns:
          A dictionary or the object.
      """
      # https://stackoverflow.com/a/71366813
      data = {}
      if getattr(obj, "__dict__", None):
          for key, value in obj.__dict__.items():
              data[key] = _object_to_dict(value)
          return data
      return obj
  
file_path: pyjanitor/janitor/io.py
imports: from __future__ import annotations
  import inspect
  import os
  import subprocess
  from collections import defaultdict
  from glob import glob
  from io import StringIO
  from itertools import chain
  from typing import TYPE_CHECKING, Any, Iterable, NamedTuple, Union
  import pandas
  from .errors import JanitorError
  from .utils import check, deprecated_alias, import_message
label_desc: Use image node_id 6 for calling a global function with example usage: _object_to_dict(obj) and returns: obj, data