Skip to content

Instantly share code, notes, and snippets.

[4.8502882289326867e-14, 8.820403952763587e-14, 1.0250590153123516e-13, 1.6954166246183968e-13, 1.908753789966549e-13, 2.004836996365545e-13, 3.5909784960471013e-13, 5.166693869401628e-13, 7.550572170701337e-13, 9.448695131203987e-13, 1.0156517689399418e-12, 1.1252632977953388e-12, 1.2755835948385307e-12, 1.718926371953829e-12, 5.561410412067812e-12, 5.612637550150243e-12, 8.453230126630751e-12, 8.725636132121303e-12, 1.613513316811227e-11, 1.9752204589154072e-11, 3.992415416880054e-11, 5.064793173473998e-11, 6.907684718699313e-11, 7.573645788325202e-11, 1.9359271945838294e-10, 2.5869603101103545e-10, 3.2604244542604767e-10, 6.107383625965949e-10, 3.054349088416707e-09, 3.948608349010387e-09, 4.447405216487758e-09, 1.0212339772102215e-06, 1.3008598108779382e-06, 1.3008598108779382e-06, 1.3008598108779382e-06, 1.3008598108779382e-06, 1.3008598108779382e-06, 1.3008598108779382e-06, 1.3008598108779382e-06, 1.3008598108779382e-06, 1.3008598108779382e-06, 1.3008598108779382e-06, 1.3008598108779382e-06, 1.300859810
import os
import re
def fix_moodle_output(assn_dir, outdir):
for (_, _, filenames) in os.walk(assn_dir):
for filename in filenames:
# Remove spaces so we can use this as a package name
name = filename.split("_")[0].replace(" ", "").replace("-", "")
if not os.path.exists("%s/%s" % (outdir, name)):
os.makedirs("%s/%s" % (outdir, name))
@Slater-Victoroff
Slater-Victoroff / needle.py
Created May 17, 2019 01:09
Demo script for needle-in-a-haystack problems
"""
Demo script for Needle-in-a-haystack problems
"""
from functools import partial
import numpy as np
from indicoio.custom import vectorize
from scipy.spatial.distance import cdist
from scipy.stats import gmean
"""
Collection of methods built to assist in data augmentation for extraction datasets
"""
from ast import literal_eval
import json
import random
from collections import defaultdict
from functools import partial
from typing import Iterable, Dict, Callable