This file contains hidden or 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
| require('dplyr') | |
| require('tidyr') | |
| require('ggplot2') | |
| # Read all cross-validation files and concatenate the dataframes. | |
| tables = lapply(Sys.glob("cv_*.txt"), function (filename) { | |
| read.csv(filename, sep=" ", header=FALSE, | |
| col.names=c('File', 'Neighbors', 'Method', 'Accuracy')) | |
| }) |
This file contains hidden or 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
| function _jpu () { | |
| squeue -h | awk '{print $4}' | sort | uniq -c | sort -b -h -r | |
| } | |
| alias jpu=_jpu |
This file contains hidden or 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
| from docker import Client | |
| cli = Client() | |
| imgs = cli.images(all=True) | |
| conts = cli.containers(filters={'status': 'running'}) | |
| # Make a map from image id to the name (tag) of the image. | |
| # If no name is set, just use the id. | |
| img_map = {} |
This file contains hidden or 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
| amino_acid_masses = { | |
| 'A': 71.0788, | |
| 'R': 156.1875, | |
| 'N': 114.1038, | |
| 'D': 115.0886, | |
| 'C': 103.1388, | |
| 'E': 129.1155, | |
| 'Q': 128.1307, | |
| 'G': 57.0519, | |
| 'H': 137.1411, |
This file contains hidden or 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 sys | |
| import textwrap | |
| from itertools import dropwhile, takewhile | |
| from collections import Counter | |
| common_english_words = [ | |
| 'the', 'of', 'and', 'to', 'a', 'in', 'for', 'is', 'on', 'that', 'by', | |
| 'this', 'with', 'i', 'you', 'it', 'not', 'or', 'be', 'are', 'from', |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import unittest | |
| class symbol(object): | |
| CACHE = {} | |
| def __new__(cls, name): | |
| if not isinstance(name, basestring): |
This file contains hidden or 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.path | |
| from gwf import * | |
| class source(object): | |
| def __init__(self, path): | |
| self.path = path | |
| def __call__(self, func): |
This file contains hidden or 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
| """Script for parsing the international UN days page.""" | |
| from datetime import datetime, timedelta | |
| import requests | |
| import requests_cache | |
| requests_cache.install_cache('ido_cache', expire_after=timedelta(weeks=4)) | |
| from bs4 import BeautifulSoup |
This file contains hidden or 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 sys | |
| import argparse | |
| import json | |
| def save_nb(fileobj, cells, metadata, nbformat, nbformat_minor): | |
| json.dump({ | |
| 'cells': cells, | |
| 'metadata': metadata, | |
| 'nbformat': nbformat, |
This file contains hidden or 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
| # This is an empty gist. |