Skip to content

Instantly share code, notes, and snippets.

View brianray's full-sized avatar
🐍

Brian Ray brianray

🐍
  • Maven Wave Partners
  • Los Angeles | Chicago
View GitHub Profile
(py3k) USATLBRRAYMB:src brray$ git clone https://github.com/ian-r-rose/jupyterlab-google-drive.git ian_rose
Cloning into 'ian_rose'...
remote: Counting objects: 2025, done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 2025 (delta 23), reused 35 (delta 18), pack-reused 1982
Receiving objects: 100% (2025/2025), 1.31 MiB | 563.00 KiB/s, done.
Resolving deltas: 100% (1346/1346), done.
(py3k) USATLBRRAYMB:src brray$ cd ian_rose/
(py3k) USATLBRRAYMB:ian_rose brray$ jupyter labextension install .
> node node-version-check.js
(py3k) USATLBRRAYMB:ER_admission brray$ jupyter labextension uninstall @jupyterlab/google-drive
No labextension named "@jupyterlab/google-drive" installed
(py3k) USATLBRRAYMB:ER_admission brray$ jupyter labextension install @jupyterlab/google-drive
> node node-version-check.js
> npm pack @jupyterlab/google-drive
jupyterlab-google-drive-0.8.0.tgz
> node node-version-check.js
> npm install
WARN engine webpack@2.7.0: wanted: {"node":">=4.3.0 <5.0.0 || >=5.10"} (current: {"node":"4.2.6","npm":"2.14.12"})
npm WARN peerDependencies The peer dependency react@^15.6.1 included from @nteract/transform-vdom will no
(py3k) USATLBRRAYMB:ER_admission brray$ jupyter labextension uninstall @jupyterlab/google-drive
Uninstalling @jupyterlab/google-drive from /Users/brray/anaconda2/anaconda/envs/py3k/share/jupyter/lab/extensions
> node node-version-check.js
> npm install
WARN engine webpack@2.7.0: wanted: {"node":">=4.3.0 <5.0.0 || >=5.10"} (current: {"node":"4.2.6","npm":"2.14.12"})
npm WARN peerDependencies The peer dependency react@^15.6.1 included from @nteract/transform-vdom will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency react@^15.0.0 included from react-json-tree will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def transition_skip(fsm_obj):
pass
def transition_new_group(fsm_obj):
fsm_obj.group_current_level += 1
fsm_obj.current_group = RuleGroup(fsm_obj.current_group,
fsm_obj.group_current_level,
None)
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 = ''
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__)
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
class Rule:
def __init__(self):
self.prefix = ""
self.subject = ""
self.op = None
def __repr__(self):
op = self.op
if not op:
op = ''
@brianray
brianray / parser.py
Last active February 1, 2024 01:01
example language parser
# 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