code: def list_profiles_in(path):
      """list profiles in a given root directory"""
      files = os.listdir(path)
      profiles = []
      for f in files:
          try:
              full_path = os.path.join(path, f)
          except UnicodeError:
              continue
          if os.path.isdir(full_path) and f.startswith("profile_"):
              profiles.append(f.split("_", 1)[-1])
      return profiles
  
imports: from __future__ import print_function
  import os
  from traitlets.config.application import Application
  from IPython.core.application import BaseIPythonApplication, base_flags
  from IPython.core.profiledir import ProfileDir
  from IPython.utils.importstring import import_item
  from IPython.paths import get_ipython_dir, get_ipython_package_dir
  from IPython.utils import py3compat
  from traitlets import Unicode, Bool, Dict, observe
label_desc: Use image node_id 1 for calling a global function with example usage: list_profiles_in(path) and returns: profiles