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
| #!/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 |
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
| ''' | |
| 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: |
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
| import collections | |
| import types | |
| import inspect | |
| import functools | |
| class Tasker(object): | |
| ''' | |
| class to simplify running tasks in order | |
| ''' | |
| def __init__(self): |
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 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 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
| ''' | |
| 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 |
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
| 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: |
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
| 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)); |
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
| # -*- coding: utf-8 -*- | |
| from __future__ import print_function | |
| import sys | |
| import os | |
| filename = sys.argv[1] | |
| output_name = 'emoji' | |
| c_code =''' |
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
| 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 |
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
| ;; 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)) |