As an introduction into Luigi, I am following this tutorial with some modifications, e.g. installation using conda.
The problems and solutions described in the examples below have led to the development of sciluigi,
| from pymongo import MongoClient | |
| MONGO_URI = '' | |
| DATABASE_NAME = '' | |
| client = MongoClient(MONGO_URI) | |
| db = client[DATABASE_NAME] | |
| collections = db.collection_names() | |
| def readable_size(file_size): |
| /* -------------------------------------------------------------------------- */ | |
| // All Bootstrap 4 Sass Mixins [Cheat sheet] | |
| // Updated to Bootstrap v4.5.x | |
| // @author https://anschaef.de | |
| // @see https://github.com/twbs/bootstrap/tree/master/scss/mixins | |
| /* -------------------------------------------------------------------------- */ | |
| /* | |
| // ########################################################################## */ | |
| // New cheat sheet for Bootstrap 5: |
| # coding:utf-8 | |
| from elasticsearch import Elasticsearch | |
| import json | |
| # Define config | |
| host = "127.0.0.1" | |
| port = 9200 | |
| timeout = 1000 | |
| index = "index" |
| """ | |
| Create train, valid, test iterators for CIFAR-10 [1]. | |
| Easily extended to MNIST, CIFAR-100 and Imagenet. | |
| [1]: https://discuss.pytorch.org/t/feedback-on-pytorch-for-kaggle-competitions/2252/4 | |
| """ | |
| import torch | |
| import numpy as np |
As an introduction into Luigi, I am following this tutorial with some modifications, e.g. installation using conda.
The problems and solutions described in the examples below have led to the development of sciluigi,
| """ | |
| AWS Batch wrapper for Luigi | |
| From the AWS website: | |
| AWS Batch enables you to run batch computing workloads on the AWS Cloud. | |
| Batch computing is a common way for developers, scientists, and engineers | |
| to access large amounts of compute resources, and AWS Batch removes the | |
| undifferentiated heavy lifting of configuring and managing the required |
| --- | |
| - name: Create Instance in AWS | |
| hosts: localhost | |
| connection: local | |
| gather_facts: false | |
| vars: | |
| aws_access_key: "xxxxxx" | |
| aws_secret_key: "xxxxxx" | |
| security_token: "xxxxxx" |
| import psycopg2 | |
| from sshtunnel import SSHTunnelForwarder | |
| # For interactive work (on ipython) it's easier to work with explicit objects | |
| # instead of contexts. | |
| # Create an SSH tunnel | |
| tunnel = SSHTunnelForwarder( | |
| ('128.199.169.188', 22), | |
| ssh_username='<username>', |
| """IPython startup script to detect and inject VIRTUAL_ENV's site-packages dirs. | |
| IPython can detect virtualenv's path and injects it's site-packages dirs into sys.path. | |
| But it can go wrong if IPython's python version differs from VIRTUAL_ENV's. | |
| This module fixes it looking for the actual directories. We use only old stdlib | |
| resources so it can work with as many Python versions as possible. | |
| References: | |
| http://stackoverflow.com/a/30650831/443564 |