Skip to content

Instantly share code, notes, and snippets.

View bowbahdoe's full-sized avatar

Ethan McCue bowbahdoe

View GitHub Profile
#!/usr/bin/env python
'''
module for regularly sending certain files to a remote host
'''
# For the transferring of files
import pysftp
# For filewalking, as needed for image files
import os
'''
Module containing all libwallaby functions
'''
def import_funcs(name):
'''
cheap hack to import all functions from submodules to global namespace
'''
modu = __import__(name, globals(), locals())
attributes = dir(modu)
for i in attributes:
import collections
import types
import inspect
import functools
class Tasker(object):
'''
class to simplify running tasks in order
'''
def __init__(self):
from config import REQUIRED_TIMES
from config import LEFT_MOTOR_PORT
from config import RIGHT_MOTOR_PORT
from config import BACK_MOTOR_PORT
from movement import marshmallow_drive_forwards as dw
from movement import marshmallow_turn_right as tr
from wallaby import motor, all_off
'''
This defines an object to keep track of the game
This allows us to abstract the game logic from the rendering
'''
from board import Board
from key import Team
from key import Orientation
import enum
import itertools
def makeTree(files,parents):
tree = []
for e,i in enumerate(files):
index = e
tree.append([i])
while True:
if parents[index] == "-1":
tree[e].append("-1")
break
else:
import sys
import os
filename = sys.argv[1]
c_code ='''
#include <stdlib.h>
#include <stdio.h>
int main(){
int cell_size = 1000;
char * ptr = (char*)(calloc(cell_size * sizeof(char), 0));
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
import os
filename = sys.argv[1]
output_name = 'emoji'
c_code ='''
import re
import requests
import phonenumbers as pn
from requests.exceptions import RequestException
from bs4 import BeautifulSoup
from pymongo import MongoClient
client = MongoClient('localhost', 27017)
db = client.scraped_data
collection = db.phone_numbers
;; BASIC LISP SYNTAX TUTORIAL
;; Calls the function '+' on the arguments 2 and 2
;; Returns the value 4
(+ 2 2)
;; Calls the function 'println' on the result of
;; the call to (+ 2 2). Returns no value
(println (+ 2 2))