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 sys | |
import json | |
languages = dict( | |
python=dict(ext='py', comment='#'), | |
javascript=dict(ext='js', comment='//') | |
) | |
if len(sys.argv) < 2: |
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
"""Official evaluation script for SQuAD version 2.0. | |
In addition to basic functionality, we also compute additional statistics and | |
plot precision-recall curves if an additional na_prob.json file is provided. | |
This file is expected to map question ID's to the model's predicted probability | |
that a question is unanswerable. | |
""" | |
import argparse | |
import collections | |
import 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
// requires canvas, npm i canvas | |
var Canvas = require('canvas') | |
var fs = require('fs') | |
// Constants | |
var DIM = { width : 24, border : 1.3, font : 14 } | |
var COLOR = { light: '#ec9a97', text:'#3189cc' , border:'#e13d35' } | |
function paintCircularText(filePath=null, text=null, fill=false, border=true, callback=null){ |
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
5a6,8 | |
> import json | |
> | |
> import sklearn.metrics as metrics | |
6a10,11 | |
> from sklearn.metrics import precision_recall_curve | |
> from dvc.api import make_checkpoint | |
10c15 | |
< if len(sys.argv) != 3: | |
--- |
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
# extracted from: https://github.com/scikit-learn/scikit-learn/blob/0fb307bf3/sklearn/metrics/_classification.py#L1825 | |
def classification_report(data_dict): | |
"""Build a text report showing the main classification metrics. | |
Read more in the :ref:`User Guide <classification_report>`. | |
Parameters | |
---------- | |
report : string | |
Text summary of the precision, recall, F1 score for each class. | |
Dictionary returned if output_dict is True. Dictionary has the |
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
# !pip install requests urllib3 geopy pandas folium | |
# partially taken from: | |
# https://towardsdatascience.com/pythons-geocoding-convert-a-list-of-addresses-into-a-map-f522ef513fd6\ | |
import requests | |
import json | |
import urllib | |
from geopy.geocoders import Nominatim, GoogleV3 | |
import pandas as pd | |
import folium |
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
# requires: zmq | |
import sys | |
import zmq | |
import threading | |
from time import sleep | |
from filelock import FileLock, Timeout | |
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
#!/bin/env python | |
import argparse | |
from pathlib import Path | |
from shutil import rmtree | |
from typing import Any, List, Optional | |
# You must override this value! | |
PROJS_BASE = None | |
DEF_FILES = ["index", "readme", "todo", "meetings"] | |
FILES_W_CONTEXT = ["todo", "meetings"] |
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
#!/bin/bash | |
# If a requirements.txt file is supplied, it will be updated with the latest versions of each package. | |
# If a pyproject.toml is required, package upgrades will just be printed. | |
echo "Careful:" | |
echo " - Conda is required" | |
echo " - If any of your PYPY packages contain the strin 'http', it is possible that it gets astray, manually inspect it" | |
env_name="pkgs_upgrade" |
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
"""Generate __init__.py for a given folder | |
Very naive generator, just parses the AST of every subfile in the provided folder to get the list of exported variables. | |
ToDo := | |
- Recursively parse subfolders and previous __init__.py files | |
- Improve pkg base adding | |
""" | |
import os | |
import ast |
OlderNewer