Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_ipython_profiles():
"""Helper function to find all ipython profiles"""
if hasattr(itango, "get_ipython_profiles"):
return itango.get_ipython_profiles()
ret = []
ipydir = get_ipython_dir()
if os.path.isdir(ipydir):
for i in os.listdir(ipydir):
fullname = os.path.join(ipydir, i)
if i.startswith("ipy_profile_") and i.endswith(".py"):
if os.path.isfile(fullname):
ret.append(i[len("ipy_profile_"):i.rfind(".")])
return ret