Allows you to import Python modules from the top level of a GitHub repository. Basically, golang's import semantics but in Python fashion.
>>> import githubimport
>>> from MineRobber9000.test_modules import blah
>>> blah.foo()
"bar"| class BatchSendToSQS: | |
| """ | |
| >>> with BatchSendToSQS(someQueue, batch_size=10) as sqs_batcher: | |
| >>> sqs_batcher.add_msg({'data': 'booba'}) | |
| >>> ... | |
| >>> sqs_batcher.add_msg({'data': 'piu piu'}) | |
| """ | |
| def __init__(self, queue: "boto3.sqs.Queue", batch_size: int): | |
| self.queue = queue | 
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| import lxml.etree | |
| import lxml.html | |
| import requests | |
| xml_sample = """<?xml version="1.0" encoding="UTF-8"?> | |
| <foo:Results xmlns:foo="http://www.foo.com" xmlns="http://www.bah.com"> | |
| <foo:Recordset setCount="2"> | 
| import sqlalchemy as sa | |
| import sqlalchemy.orm as orm | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy.ext.declarative import declared_attr | |
| from sqlalchemy.orm import scoped_session, sessionmaker | |
| DBSession = scoped_session(sessionmaker()) | |
| class BaseMixin(object): | |
| query = DBSession.query_property() | |
| id = sa.Column(sa.Integer, primary_key=True) | 
| # Aliases | |
| alias g='git' | |
| compdef g=git | |
| alias gst='git status' | |
| compdef _git gst=git-status | |
| alias gl='git pull' | |
| compdef _git gl=git-pull | |
| alias gup='git fetch && git rebase' | |
| compdef _git gup=git-fetch | |
| alias gp='git push' |