Skip to content

Instantly share code, notes, and snippets.

View master-fury's full-sized avatar
🎯
Focusing

Manish Kumar master-fury

🎯
Focusing
View GitHub Profile
@master-fury
master-fury / prepare_dataset.py
Created March 29, 2024 19:38
Dataset Preparation: Code Repo to CSV File
import pandas as pd
from datasets import Dataset
import os
import csv
def extract_code(directory_path: str, output_csv_path: str):
"""
Read the folders, sub-folders and files to extract code. Storing them in a csv format.
Currently supporting the below formats -