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 python3 | |
| # /// script | |
| # requires-python = ">=3.10" | |
| # dependencies = [ | |
| # "pyopensky>=2.15", | |
| # "duckdb>=1.1.0", | |
| # "pandas>=2.0.0", | |
| # "matplotlib>=3.5.0", | |
| # "seaborn>=0.12.0", | |
| # "tabulate>=0.9.0", |
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
| {"schemaVersion": 1, "label": "coverage", "message": "0%", "color": "red"} |
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 | |
| from moviepy.editor import VideoFileClip | |
| import moviepy.video.fx.all as vfx | |
| def main(fname_in, fname_out, duration="1.0"): | |
| duration = float(duration) | |
| clip = VideoFileClip(fname_in) | |
| clip = (clip |
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
| [general] | |
| accounts = Gmail | |
| maxsyncaccounts = 3 | |
| socktimeout = 90 | |
| [Account Gmail] | |
| localrepository = Gmail-Local | |
| remoterepository = Gmail-Remote | |
| [Repository Gmail-Local] |
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
| [program:autossh40000] | |
| command=bash -c "sleep 15 && exec /usr/lib/autossh/autossh -nN -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -o ServerAliveCountMax=3 -M 40010 -R 0.0.0.0:40000:localhost:22 [email protected]" | |
| autorestart=true | |
| user=pi |
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
| # Toy examples that demonstrate how to configure | |
| # nolearn.lasagne.NeuralNet and what data to send in for | |
| # classification problems with single and multiple classes, and | |
| # regression problems with and without multiple targets. | |
| from lasagne.layers import DenseLayer | |
| from lasagne.layers import InputLayer | |
| from lasagne.nonlinearities import softmax | |
| from nolearn.lasagne import NeuralNet | |
| import numpy as np |
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
| class Func(BaseEstimator): | |
| def __init__(self, func): | |
| self.func = func | |
| def fit(self, X, y=None): | |
| return self | |
| def transform(self, X): | |
| return self.func(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 cProfile | |
| from functools import wraps | |
| def profile(func): | |
| @wraps(func) | |
| def wrapper(*args, **kwargs): | |
| cProfile.runctx( | |
| 'result = func(*args, **kwargs)', | |
| globals(), |
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
| def query_children(context, levels=3, more_conditions=None): | |
| selects = [] | |
| for level in range(levels): | |
| alias = Node.__table__ | |
| conditions = [Node.__table__.c.id == context.id] | |
| for depth in range(level + 1): | |
| alias, old_alias = Node.__table__.alias(), alias | |
| conditions.append(alias.c.parent_id == old_alias.c.id) | |
| if more_conditions: |
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 zope.testbrowser.browser import Browser | |
| def _zope_testbrowser_pyquery(self): | |
| from pyquery import PyQuery | |
| return PyQuery(self.contents) | |
| Browser.pyquery = property(_zope_testbrowser_pyquery) | |
| # This will allow you to do in your tests: | |
| # >>> "Home" in browser.pyquery('#navigation').text() |
NewerOlder