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
"""Lists all e-mails for a given IMAP account, largest first. Can be useful when freeing up space. | |
Requires imapclient==2.1.0 and python3.6 or higher. | |
""" | |
from collections import namedtuple | |
from email.header import decode_header | |
from imapclient import IMAPClient |
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
"""Helper module for logging. | |
Example Usage: | |
from log import get_logger, get_out_dir_of_logger | |
LOG = get_logger(__name__) | |
LOG.info('Logging to %s' % get_out_dir_of_logger(LOG)) | |
""" |
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
'''Trains a simple convnet on the MNIST dataset with adversarial training. | |
During the adversarial train step's feed-forward pass, the dropout masks can be | |
reused by setting REUSE_DROPOUT to True | |
For more info, see https://stackoverflow.com/questions/53395329/should-dropout-masks-be-reused-during-adversarial-training | |
Requirements: | |
- tensorflow==1.12.0 | |
- cleverhans bleeding edge: pip install git+https://github.com/tensorflow/cleverhans.git#egg=cleverhans |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef int bool; | |
#define true 1 | |
#define false 0 | |
const unsigned int N_CHILDREN = 1000000; | |
const unsigned int N_GIFT_PREF = 10; |
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 sys, getopt | |
import tensorflow as tf | |
usage_str = 'python tensorflow_rename_variables.py --checkpoint_dir=path/to/dir/ ' \ | |
'--replace_from=substr --replace_to=substr --add_prefix=abc --dry_run' | |
def rename(checkpoint_dir, replace_from, replace_to, add_prefix, dry_run): | |
checkpoint = tf.train.get_checkpoint_state(checkpoint_dir) |