conda create --name neurokone python=3.8 deepspeed pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.6 -c pytorch -c conda-forge -c deepspeed
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
"""Fetches cert and private key from specified keyvault using MSI auth | |
and stores these in specified folder.""" | |
import os | |
from msrestazure.azure_active_directory import MSIAuthentication | |
from azure.keyvault import KeyVaultClient | |
from OpenSSL import crypto | |
import base64 | |
import argparse |
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
class MainClass: | |
DYN_METHOD_REGISTRY = {} | |
def __init__(self): | |
print(f"This class has dynamically added methods: {self.DYN_METHOD_REGISTRY.keys()}") | |
def runmethods(self): | |
for name, fp in self.DYN_METHOD_REGISTRY.items(): |
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
class Table(Base): | |
id = Column(Integer, primary_key=True) | |
_name = Column('name', String(24)) | |
@property | |
def name(self): | |
return self._name; | |
@name.setter | |
def name(self, value): |
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
. | |
├── deploy.py | |
├── project | |
│ ├── application.py | |
│ ├── apps | |
│ │ ├── articles | |
│ │ │ ├── forms.py | |
│ │ │ ├── __init__.py | |
│ │ │ ├── models.py | |
│ │ │ └── views.py |
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
""" | |
Monkeypatching Pandas Dataframe to include `to_bcp_sql` method | |
that uploads dataframe to mssql server using mssql-tools `bcp`. | |
Requires mssql-tools to be installed on system and in PATH. | |
Partly inspired by https://gist.github.com/ajsmith007/d1adb79e152f5f23503b | |
ToDo: | |
* Add docs |
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 time | |
def timeit(value_dict=None, print_values=True): | |
"""Decorator for timing functions with different parameters. | |
Arguments: | |
value_dict - dict where to save the timings, uses function args tupple as key | |
print_values - boolean for printing timings to std out | |
Usage: |
These are my notes basically. At first i created this gist just as a reminder for myself. But feel free to use this for your project as a starting point. If you have questions you can find me on twitter @thomasf https://twitter.com/thomasf This is how i used it on a Debian Wheezy testing (https://www.debian.org/releases/testing/)
Discuss, ask questions, etc. here https://news.ycombinator.com/item?id=7445545
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 struct | |
import numpy as np | |
""" | |
Loosely inspired by http://abel.ee.ucla.edu/cvxopt/_downloads/mnist.py | |
which is GPL licensed. | |
""" | |
def read(dataset = "training", path = "."): |
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/sh | |
# | |
# Pre-commit hook for clearing output cells from commited analysis Jupyter notebooks. | |
# | |
echo "Running pre-commit hook to clear output from deliver/*.ipynb notebooks." | |
for notebook in git diff --cached --name-only -- 'deliver/*.ipynb' | |
do | |
echo "Clearing output from $notebook" | |
jupyter nbconvert --ClearOutputPreprocessor.enabled=True --ClearOutputPreprocessor.remove_metadata_fields=[] --to notebook --inplace $notebook |
NewerOlder