docstr: This is to check "monai.__all__" should be consistent with
  the top-level folders except for "__pycache__", "_extensions" and "csrc" (cpp/cuda src)
docstr_tok: ["This","is","to","check","``","monai.__all__","''","should","be","consistent","with","the","top-level","folders","except","for","``","__pycache__","''",",","``","_extensions","''","and","``","csrc","''","(","cpp\/cuda","src",")"]
code: def test_public_api(self):
      """
      This is to check "monai.__all__" should be consistent with
      the top-level folders except for "__pycache__", "_extensions" and "csrc" (cpp/cuda src)
      """
      base_folder = os.path.dirname(monai.__file__)
      to_search = os.path.join(base_folder, "*", "")
      subfolders = [
          os.path.basename(x[:-1]) for x in glob.glob(to_search)
      ]
      to_exclude = ("__pycache__", "_extensions", "csrc")
      mod = []
      for code_folder in subfolders:
          if code_folder in to_exclude:
              continue
          mod.append(code_folder)
      self.assertEqual(sorted(monai.__all__), sorted(mod))
  
file_path: MONAI/tests/test_module_list.py
imports: from __future__ import annotations
  import glob
  import inspect
  import os
  import pathlib
  import unittest
  import monai
label_desc: Use image node_id 1 for calling the TestAllImport obj's underlying member method code with example usage: obj.test_public_api() without return types