def get_libraries(notebook_path):
with open(notebook_path) as f:
cell_type = cell.get('cell_type')
sources = cell.get('source')
if "from" in source and "import" in source:
lib = source.replace("\n", "").split("from")[-1].split("import")[0].strip()
module = source.replace("\n", "").split("import")[-1].split(" as ")[0].strip()
data.append(f"{lib}.{module}")
if "from" not in source and "import" in source:
library = source.replace("\n", "").split("import")[-1].split(" as ")[0].strip()
print("❎ No library found in notebook:", notebook_path)
print(f"✅ {len(data)} librarie(s) found in notebook:", notebook_path)