code: def is_leaf_directory(path):
      for entry in os.scandir(path):
          if entry.is_dir():
              return False
      return True
  
imports: import os
  import json
  import re
label_desc: Use image node_id 1 for calling a global function with example usage: is_leaf_directory(path) and returns: True, False