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 sys | |
class DataGenerator: | |
def copy_files(self, src_dir: str, dest_dir: str) -> None: | |
try: | |
if not os.path.exists(dest_dir): | |
os.makedirs(dest_dir) | |
for filename in os.listdir(src_dir): |
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
Host * | |
User mcardus | |
IdentityFile ~/.ssh/id_rsa |
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
# ZSHRC # | |
## ZSH CONF ## | |
### Mac OS Home ### | |
export HOME="/Users/$(whoami)" | |
export ZSH=$HOME"/.oh-my-zsh" | |
ZSH_THEME="agnoster" |
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 unittest | |
class DummyTestCase(unittest.TestCase): | |
def setUp(self): | |
self.my_data = [1,2,3,4,5] | |
def test_length(self): | |
self.assertEqual(len(self.my_data),5) | |
def tearDown(self): |
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
from functools import reduce | |
class MyData(object): | |
def __init__(self, data): | |
self.data = data | |
def get_data(self): | |
return self.data |
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
version: 1 | |
formatters: | |
human: | |
format: | | |
{ | |
"name" : "%(name)s", | |
"timestamp" : "%(asctime)s", | |
"severity" : "%(levelname)s", | |
"message" : "%(message)s" | |
} |
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 yaml | |
import logging | |
import logging.config | |
import functools | |
import json | |
def setup_logging( | |
default_path= 'logging_properties.yml', | |
default_level=logging.DEBUG, |
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
def trainModel(inputPath: String) = { | |
log.info("Training model from data in path: " + inputPath) | |
val file: File = new File(inputPath) | |
val iter = new BasicLineIterator(file) | |
val cache = new AbstractCache[VocabWord] | |
val tokenizer = new DefaultTokenizerFactory | |
tokenizer.setTokenPreProcessor(new CommonPreprocessor) | |
try { | |
_paragraphVectors = new ParagraphVectors.Builder().minWordFrequency(1).iterations(5).epochs(1).layerSize(100).learningRate(0.025).windowSize(5).iterate(iter).trainWordVectors(false).vocabCache(cache).tokenizerFactory(tokenizer).sampling(0).build |
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
# Provision Docker Ubuntu 16 | |
# It installs docker and configure current user to being able to acces docker without sudo | |
#Docker user | |
USER=$(whoami) | |
#Install Docker | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt-get update |
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
# Ubuntu base provisioning | |
# It installs base packets, python pip, ansible and git | |
# Upgrade system | |
sudo apt-get update && sudo apt-get -y upgrade | |
# Install essential packages | |
sudo apt-get install -y build-essential python git libpq-dev python-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev |
NewerOlder