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/osascript | |
on run argv | |
set l to 0 | |
set t to 0 | |
repeat with j from 1 to (count argv) | |
set a to item j of argv | |
tell application a | |
repeat with x from 1 to (count windows) | |
set b to bounds of window x |
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 datetime | |
import re | |
class TimeDeltaType(object): | |
""" | |
Interprets a string as a timedelta for argument parsing. | |
With no default unit: | |
>>> tdtype = TimeDeltaType() |
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 zipfile | |
from lxml import etree | |
import pandas as pd | |
def read_docx(docx_file, **kwargs): | |
"""Read tables as DataFrames from a Word document | |
""" | |
ns = {'w': 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'} | |
with zipfile.ZipFile(docx_file).open('word/document.xml') as f: | |
root = etree.parse(f) |
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
.language as $lang | | |
{ | |
"metadata" : { | |
"kernelspec": { | |
"display_name": "Python 3 (ipykernel)", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { |
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 warnings | |
import sklearn | |
warnings.simplefilter('ignore') | |
from sklearn import * | |
X, y = datasets.make_multilabel_classification() | |
for clf in [tree.DecisionTreeClassifier(), | |
neighbors.KNeighborsClassifier(), | |
neural_network.MLPClassifier(), | |
multioutput.MultiOutputClassifier(linear_model.LogisticRegression()), |
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
"""datetime.fromisoformat backported from Python 3.7 | |
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 | |
-------------------------------------------- | |
1. This LICENSE AGREEMENT is between the Python Software Foundation | |
("PSF"), and the Individual or Organization ("Licensee") accessing and | |
otherwise using this software ("Python") in source or binary form and | |
its associated documentation. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 collections import defaultdict | |
import pandas as pd | |
class parametrized_function: | |
def __init__(self, _func, **kwargs): | |
self._func = _func | |
self.__doc__ = self._func.__doc__ | |
self.__name__ = self._func.__name__ | |
# TODO use inspect to automatically find parameters with defaults |
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
// ==UserScript== | |
// @name Show newlines in Sydney U qualtrics reports | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Joel Nothman | |
// @match https://sydney.au1.qualtrics.com/CP/Report.php?* | |
// @icon https://www.google.com/s2/favicons?domain=qualtrics.com | |
// @grant none | |
// ==/UserScript== |
NewerOlder