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 __future__ import print_function | |
| import logging as log | |
| log.basicConfig(level=log.DEBUG) | |
| ######## The Base stuff | |
| ######## This is code we don't want to change | |
| ######## for example only |
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
| $ docker-machine stop | |
| $ VBoxManage list -l vms | grep CPU | |
| CPU exec cap: 100% | |
| Number of CPUs: 1 | |
| CPUID Portability Level: 0 | |
| CPUID overrides: None | |
| CPU exec cap: 100% | |
| Number of CPUs: 1 | |
| CPUID Portability Level: 0 | |
| CPUID overrides: None |
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
| cd /tmp | |
| wget http://launchpadlibrarian.net/137699828/libc6_2.17-0ubuntu5_amd64.deb | |
| wget http://launchpadlibrarian.net/137699829/libc6-dev_2.17-0ubuntu5_amd64.deb | |
| mkdir libc6_2.17 | |
| cd libc6_2.17 | |
| ar p ../libc6_2.17-0ubuntu5_amd64.deb data.tar.gz | tar zx | |
| ar p ../libc6-dev_2.17-0ubuntu5_amd64.deb data.tar.gz | tar zx | |
| cd - | |
| LD_LIBRARY_PATH=/tmp/libc6_2.17/lib/x86_64-linux-gnu/ /tmp/libc6_2.17/lib/x86_64-linux-gnu/ld-2.17.so bin/python local/lib/python2.7/site-packages/tensorflow/models/image/mnist/convolutional.py |
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
| data = open("C:\Users\tdoucet\Desktop\Test.csv") | |
| dict = {} | |
| for line in data: | |
| x = line.split(",") | |
| a = x[0] | |
| b = x[1] | |
| dict[a] = b | |
| level0 = [] | |
| level1 = [] |
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 stat_parser import Parser | |
| parser = Parser() | |
| parser.parse(sent) | |
| tree = parser.parse(sent) # returns nltk Tree instance | |
| tree |
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
| # Brian Ray <brianhray@gmail.com> | |
| # @brianray | |
| # https://medium.com/@brianray_7981/ | |
| # parser for POSH Syntax http://brianray.github.io/posh-syntax/ | |
| import re | |
| def transition_skip(fsm_obj): | |
| pass |
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 Rule: | |
| def __init__(self): | |
| self.prefix = "" | |
| self.subject = "" | |
| self.op = None | |
| def __repr__(self): | |
| op = self.op | |
| if not op: | |
| op = '' |
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
| FSM_MAP = ( | |
| # {'src':, 'dst':, 'condition':, 'callback': }, | |
| {'src': S_NEW_GROUP, | |
| 'dst': S_PRE, | |
| 'condition': "[A-Za-z|+|-|\d]", | |
| 'callback': T_APPEND_CHAR_PRE}, # 1 | |
| {'src': S_PRE, | |
| 'dst': S_PRE, | |
| 'condition': "[A-Za-z|+|-|\d]", | |
| 'callback': T_APPEND_CHAR_PRE}, # 2 |
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 RuleGroup: | |
| def __init__(self, parent, level, op): | |
| self.op = op | |
| self.parent = parent | |
| self.level = level | |
| self.rule_count = 1 | |
| self.rules = [Rule(), ] | |
| def __repr__(self): | |
| return "<RuleGroup: {}>".format(self.__dict__) |
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 Rule_Parse_FSM: | |
| def __init__(self, input_str): | |
| self.input_str = input_str | |
| self.current_state = S_NEW_GROUP | |
| self.group_current_level = 0 | |
| self.current_group = RuleGroup(None, self.group_current_level, None) | |
| self.current_char = '' |