This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# read davids results | |
import json | |
import pandas as pd | |
import os | |
def compute_best_epochs_david(directory='./trials', objective="max", folds=8): | |
# Get a list of all Excel files in the directory | |
files = [file for file in os.listdir(directory) if file.endswith('.json')] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
import argparse | |
def main(source_folder, destination_folder): | |
# Create the destination folder if it doesn't exist | |
if not os.path.exists(destination_folder): | |
os.makedirs(destination_folder) | |
# Traverse the source folder and its subdirectories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sources: | |
# http://www.idc-online.com/technical_references/pdfs/information_technology/Mutual_Recursion_in_Python.pdf | |
# https://library.oapen.org/handle/20.500.12657/26092 | |
def is_even(n): | |
if n == 0: | |
return True | |
else: | |
return is_odd(n-1) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# helper function to identify recursive functions | |
def count_recursions(code: str) -> int: | |
self_recursion_functions = set() | |
mutual_recursion_candidates = {} | |
mutual_recursion_functions = set() | |
nodes = ast.parse(code) | |
function_nodes = [] | |
# get all function nodes | |
for node in nodes.body: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import time | |
import asyncio | |
from datetime import datetime | |
import websockets # from websockets import WebSocketServer, WebSocketServerProtocol, ConnectionClosedError, ConnectionClosedOK | |
from functools import partial | |
import json | |
from response_object import ResponseObject | |
import redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* ONE-TIME SCRIPT TO RETRIEVE MUSIC PIECE INFORMATIONS FROM PETRUCCI-DB */ | |
/* DEV: Tarek Alakmeh, Dec 2016 */ | |
/* ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! | |
! ! ! ! ! ATTENTION: ! ! ! ! ! ! | |
! ! This Code isn't made for ! ! | |
! ! production: Just experi- ! ! | |
! ! mental purpose! Thx :) ! ! ! |