text
stringlengths
17
737k
""" Functions used in realfast system. Originally a helper script, so strucutre is odd and needs reworking. """ import uuid import rtpipe.RT as rt import rtpipe.calpipe as cp import rtpipe.parsesdm as ps import rtpipe.parsecands as pc import rtpipe.candvis as cv import cPickle as pickle import os, glob, time, shutil, s...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ test_ehrcorral ---------------------------------- Tests for `ehrcorral` module. """ from __future__ import print_function from __future__ import division from __future__ import absolute_import from __future__ import unicode_literals import unittest from ehrcorral i...
''' Created on 21.01.2016 @author: fabian ''' import unittest import logging import uuid import os import datetime from pyvcsshark.parser.gitparser import GitParser from tests.datastoremock import DatastoreMock class GitParserTest(unittest.TestCase): parser = None def setUp(self): # Setup l...
import unittest from overrides import overrides import somepackage class SuperClass(object): def some_method(self): """Super Class Docs""" return 'super' class SubClass(SuperClass): @overrides def some_method(self): return 'sub' class Subber(SuperClass): @overrides de...
#!/usr/bin/env python3 import copy import nose.tools as nose import src.simulator as sim def test_get_bin_addr_unpadded(): """get_bin_addr should return unpadded binary address of word address""" nose.assert_equal( sim.get_bin_addr(180), '10110100') def test_get_bin_addr_padded(): """ge...
import xarray from importlib import import_module from .core import BlueskyRun __all__ = ['Projector', 'project_xarray'] class ProjectionError(Exception): pass def get_run_projection(run: BlueskyRun, projection_name: str = None): """Finds a projection in the run. If projection_name is provided, searc...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase from django.template import Template, Context from . import utils class GravatarTemplateTagTests(TestCase): def setUp(self): self.user = utils.create_user() def test_gravatar_url(self): """ ...
# Standard Library import json import logging import uuid import maya # Third-Party import django_rq from algoliasearch_django.decorators import disable_auto_indexing from openpyxl import Workbook from openpyxl.writer.excel import save_virtual_workbook # Django from django.apps import apps from django.contrib.auth.m...
# -*- coding: utf-8 -*- # # Copyright (C) 2012 Edgewall Software # Copyright (C) 2006-2011, Herbert Valerio Riedel <hvr@gnu.org> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://...
# Standard Library import csv import logging import time from io import BytesIO # Third-Party import pydf from auth0.v3.authentication import GetToken from auth0.v3.exceptions import Auth0Error from auth0.v3.management import Auth0 from django_rq import job from openpyxl import Workbook from openpyxl.writer.excel imp...
import mock import unittest import tempfile from openquake.commonlib.oqvalidation import OqParam TMP = tempfile.gettempdir() class OqParamTestCase(unittest.TestCase): def test_unknown_parameter(self): # if the job.ini file contains an unknown parameter, print a warning with mock.patch('logging.w...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ openslides.utils.management.commands.syncdb ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Overrides the Django syncdb command to setup the database. :copyright: (c) 2011-2013 by the OpenSlides team, see AUTHORS. :license: GNU GPL, see LICENSE for mor...
class API_Error(Exception): pass class UnknownError(Exception): error_code = 1 error_msg = """ Unknown error occurred. Try again later. """ class ApplicationDisabledError(Exception): error_code = 2 error_msg = """ Application is disabled. Enable your application or use test mode You need to swit...
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Alexandru Bleotu <alexandru.bleotu@morganstanley.com>` Tests for cluster related functions in salt.utils.vmware ''' # Import python libraries from __future__ import absolute_import import logging # Import Salt testing libraries from salttesting import TestCase, skipIf ...
from docker import Client import sys,time, os class Redomat: def __init__(self,client=None): if client is None: raise Exception("client is not set") self.client = client self.current_stage = "undefined" self.current_image = "undefined" self.build_id = "%s-%s"%(time.strftime("%F-%H%M%S"), os.getenv('LOGN...
# -*- coding: utf-8 -*- __version__ = '2.2.1' try: # Fix for setup.py version import from watson.form.types import Form, Multipart __all__ = ['Form', 'Multipart'] except: # pragma: no cover pass # pragma: no cover
import os import unittest from config import Config from ariane_docker import exceptions __author__ = 'mffrench' class ConfigurationTest(unittest.TestCase): def test_bad_conf_file(self): try: Config().parse(os.path.dirname(__file__) + os.sep + "some_unknown_file") except exceptions.Ar...
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
#!/usr/bin/env python2 # Util - functions that are used both by client and server # PIR - Goldbergs Protocol # CS 54701 Project- Craig West & Michael #TODO: do all of our multiplications need to be mod n? #all coefficients in the created polynomials must be in Zn #the polyEval function must produce outputs in Zn # fr...
#!/usr/bin/python # -*- coding: utf-8 -*- from .gameobject import GAME_OBJECT_TYPES from ..structures import * class Structure(Structure): """ Base structure for WDB/DBC files This contains standard build branching such as PTR/Beta/Live builds running concurrently The changed builds can still be overwritten """...
#! /usr/bin/python # -*- coding: utf-8 -*- """ Histology analyser GUI """ import logging logger = logging.getLogger(__name__) import sys import os.path path_to_script = os.path.dirname(os.path.abspath(__file__)) sys.path.append(os.path.join(path_to_script, "../extern/dicom2fem/src")) from PyQt4 import QtCore from P...
import sys import time import threading from functools import wraps def progress(function): """Shows a progress bar while a function runs.""" @wraps(function) def wrap_function(*args, **kwargs): stop = False def progress_bar(): while not stop: sys.stdout.write('...
import pygame, sys, math class Wall(pygame.sprite.Sprite): def __init__(self, pos=[0,0], size=None): pygame.sprite.Sprite.__init__(self, self.containers) self.image = pygame.image.load("rsc/wall/wall.png") if size: self.image = pygame.transform.scale(self.image, [size,size]) ...
#!/usr/bin/env python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
import os import sys import vtkAll as vtk from ddapp import botpy import math import time import types import functools import numpy as np from collections import defaultdict from ddapp import transformUtils from ddapp import lcmUtils from ddapp.timercallback import TimerCallback from ddapp.asynctaskqueue import Async...
## GUI ## TODO: set minimum sizes of windows ## TODO: add library viewer with scoring and queueing funcionality ## TODO: remove bottom lines/copy to main ## TODO: debug message window with levels of messages (basic score up/down ## etc for users and more complex for devs) using "logging" module? ## TODO: add dele...
#!/usr/bin/env python #PPM.py by pbsds for python 2.7 #AGPL3 licensed # #Numpy is required #PIL is needed to write images to disk # #Credits: # # - Steven for most of the documentation on DSiBrew and his frame decoding example on his talkpage # - Remark for help on the 8x8 tiling on the preview image. # - Jsafive for s...
__author__ = 'jameskreft' import requests import feedparser from bs4 import BeautifulSoup import re from operator import itemgetter from pubs_ui import app import json from urlparse import urljoin from copy import deepcopy from itsdangerous import URLSafeTimedSerializer import arrow import natsort from ..custom_filter...
class TorgGenerator: class Error (RuntimeError): pass AntigenFieldOrder = ["name", "date", "reassortant", "annotations", "passage", "lab_id", "clade"] SerumFieldOrder = ["name", "serum_id", "reassortant", "annotations", "passage", "species", "clade"] def __init__(self): # self.name = None ...
from __future__ import print_function from collections import namedtuple import numpy as np import tensorflow as tf from model import LSTMPolicy import six.moves.queue as queue import scipy.signal import threading def discount(x, gamma): return scipy.signal.lfilter([1], [1, -gamma], x[::-1], axis=0)[::-1] def pr...
""" Code here relates to analysis of two-photon project folders which are arranged to contain ephys (ABFs), traditional imaging (TIFs), and two-photon imaging (linescans, single scans, t-series, and z-series) data. PROJECT FOLDER STRUCTURE There is a new project format. Here, each patched cell gets a parent folder: ...
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2013 SF Isle of Man Limited # # PyBossa is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
#! /usr/bin/env python # -*- coding: utf-8 -*- from pycket.cont import continuation, label, call_cont from pycket.exposeprim import make_call_method from pycket.error import SchemeException from pycket import values from pycket import values_struct from rpython.rlib import jit def make_proxy(proxied="inner", properti...
import numpy as np from openmdao.core.group import Group, Component, IndepVarComp from openmdao.solvers.newton import Newton from openmdao.solvers.scipy_gmres import ScipyGMRES from openmdao.units.units import convert_units as cu from openmdao.api import Problem from pycycle.components import Compressor, Shaft, FlowS...
import os import copy import numpy as np import pandas as pd pd.options.display.max_colwidth = 100 from pyemu.pst.pst_utils import SFMT,IFMT,FFMT,pst_config from pyemu.utils.helpers import run PP_FMT = {"name": SFMT, "x": FFMT, "y": FFMT, "zone": IFMT, "tpl": SFMT, "parval1": FFMT} PP_NAMES = ["name","x","y",...
""" (c) 2013 LinkedIn Corp. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License");?you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing...
# -*- coding: utf-8 -*- """ pygments.lexers.text ~~~~~~~~~~~~~~~~~~~~ Lexers for non-source code file types. :copyright: 2006-2008 by Armin Ronacher, Georg Brandl, Tim Hatch <tim@timhatch.com>, Ronny Pfannschmidt, Dennis Kaarsemaker, Kuma...
# Copyright (c) 2016 Canonical Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """DataPlatform module for the management of multimodal mechanical datasets. The `samples` module provides a base class `SampleData` implementing a generic data model and data paltform API, allowing to define by inheritance specific data platform classes for specific mech...
## # See the file COPYRIGHT for copyright information. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
''' Implementation of a Threaded Modbus Server ------------------------------------------ ''' from binascii import b2a_hex import SocketServer import serial import socket from pymodbus.constants import Defaults from pymodbus.factory import ServerDecoder from pymodbus.datastore import ModbusServerContext from pymodbus...
import os import re import csv import yaml from itertools import chain import pytz from io import StringIO from os import path from functools import wraps import unicodedata from urllib.parse import urlparse from collections import namedtuple from datetime import datetime, timedelta, timezone import dateutil import ...
import datetime import logging import hashlib import hmac import json import traceback from app.models import SocialNetworkApp, SocialNetworkAppUser, Initiative, Idea, Campaign from app.sync import save_sn_post, publish_idea_cp, save_sn_comment, publish_comment_cp, save_sn_vote, \ delete_post, del...
import os import logging import requests import flask import datetime from flask import Flask, request, flash, redirect, render_template, url_for, jsonify from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config.update(dict( SQLALCHEMY_DATABASE_URI='sqlite:///kraken.db', DEBUG=True, SECRE...
from app import app from flask import render_template @app.route("/") def index(): return render_template('index.html')
#-*-coding:utf-8-*- from flask import render_template, request, redirect, url_for, Flask, session, jsonify from app import app, db from app.forms import AcademyForm from app.models import Academy import sys reload(sys) sys.setdefaultencoding('UTF8') @app.route('/') @app.route('/main') def academy(): return rend...
import os import requests class APIWrapper(object): def __init__(self, base_url=None, auth_token=None): if base_url: self.base_url = base_url else: self.base_url = "http://api.football-data.org/v1" if auth_token: self.headers = { 'X-A...
#!/usr/bin/env python3 #-*- coding: UTF-8 -*- import requests as _req class Api(object): """Main object for working with api""" def __init__(self, nick, passwd): super(Api, self).__init__() self.domain = "http://shikimori.org/api/" self.nick = nick self.passwd = passwd ...
""" Analysis of px4 logs """ #pylint: disable=invalid-name, missing-docstring, no-member, broad-except #pylint: disable=wildcard-import, unused-wildcard-import from __future__ import print_function import pandas import numpy as np try: from . import mapping except ImportError as e: print(e) FLIGHT_MODES = [...
''' Linear Algebra Helper Routines ''' __docformat__ = "restructuredtext en" from warnings import warn import numpy import scipy import scipy.sparse as sparse from scipy.linalg.lapack import get_lapack_funcs from scipy.linalg import calc_lwork __all__ = ['approximate_spectral_radius', 'infinity_norm', 'norm', 'resid...
#!/usr/bin/env python # Copyright (c) 2001-2002, MetaSlash Inc. All rights reserved. """ Check python source code files for possible errors and print warnings Contact Info: http://pychecker.sourceforge.net/ pychecker-list@lists.sourceforge.net """ import string import types import sys import imp import os impo...
# -*- coding: utf-8 -*- import sys import os import types from functools import partial import pytest from django.conf import settings from django.db import connections from django.test.client import Client, RequestFactory from django.utils.importlib import import_module from django.contrib.auth.models import Anonymo...
#! /usr/bin/env python3 """ @name: Install.add_user @author: D. Brian Kimmel @contact: D.BrianKimmel@gmail.com @copyright: (c) 2015-2015 by D. Brian Kimmel @license: MIT License @note: Created Dec 8, 2015 @Summary: Add a 'PyHouse' user. """ # Import system stuff import os import platform import pw...
from flask import Flask from flask import request from flask import jsonify import requests import twitter from twitter import TwitterError import yaml from os.path import dirname app = Flask(__name__) class InvalidAuthorization(Exception): status_code = 401 def __init__(self, message, status_code=401, paylo...
# -*- coding: utf-8 -*- """ Pygments ~~~~~~~~ Pygments is a syntax highlighting package written in Python. It aims to be a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code. Highlights are: ...
# -*- coding: utf-8 -*- """PyMzn can also be used to dynamically change a model during runtime. For example, it can be useful to add constraints incrementally or change the solving statement dynamically. To dynamically modify a model, you can use the class ``MiniZincModel``, which can take an optional model file as inp...
'''contains main protocol logic like assembly of proof-of-timeline and parsing deck info''' import warnings from binascii import hexlify, unhexlify from pypeerassets import paproto, Kutil from pypeerassets.pautils import * from pypeerassets import constants, transactions from .networks import query, networks def fin...
# -*- coding: utf-8 -*- """ Interface to numerical ODE solvers. """ from __future__ import print_function from __future__ import absolute_import from builtins import object from future.utils import with_metaclass from abc import ABCMeta, abstractmethod import time import numpy as np import warnings import sys # Compat...
############################################################## # core routines for software pyroSAR # John Truckenbrodt 2014-2017 ############################################################## """ This script gathers central functions and object instances for general applications Please refer to the descriptions of the...
#!/usr/bin/env python # Full license can be found in License.md # Full author list can be found in .zenodo.json file # DOI:10.5281/zenodo.1199703 # ---------------------------------------------------------------------------- import copy import datetime as dt import errno import functools import importlib import inspect...
import collections import glob import numpy as np import os import re import string import pandas as pds from pysat.utils.time import create_datetime_index def process_parsed_filenames(stored, two_digit_year_break=None): """Accepts dict with data parsed from filenames and creates a pandas Series object form...
# -- coding: utf-8 -- '''Create a basic text-grid screen using Pygame''' import os import pygame import sys import time from colors import * from pkg_resources import resource_stream, resource_filename if sys.version_info[0] < 3: range = xrange # Key Constants KEY_UP = 257 KEY_DOWN = 258 KEY_LEFT = 259 KEY_RIGHT...
#!/usr/bin/env python3 ''' This helper is inspired by https://github.com/zalando/kmsclient & https://github.com/zalando-stups/taupage/blob/master/runtime/opt/taupage/bin/decrypt-kms.py ''' import boto3 import base64 import requests import sys # so far use ireland only region_name = "eu-west-1" def awsKmsClient(regio...
from . import messages from . import message import socket, time, random, struct from .llTypes import * from . import packet from .extensions.objectAccountant import objectAccountant from .extensions.simMonitor import simMonitor class region: host = "" port = 0 clientPort = 0 sock = None agent_id =...
# -*- coding: utf-8 -*- """ Functions for manipulating wiki-text. Unless otherwise noted, all functions take a unicode string as the argument and return a unicode string. """ # # (C) Pywikipedia bot team, 2008-2011 # # Distributed under the terms of the MIT license. # __version__ = '$Id$' import pywikibot import r...
# Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Helpful routines for regression testing # # Add python-bitcoinrpc to module search path: import os import sys sys.path.append...
import os import sys from datetime import datetime from flask import Flask, render_template, request, session, jsonify, json from flask.ext.sqlalchemy import SQLAlchemy from core import db from models import Transaction #from forms import DonateForm, MinnPostForm, ConfirmForm, TexasWeeklyForm from forms import MinnP...
import os import tempfile import threading import socket import subprocess from flask import Flask, render_template, redirect, url_for from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.wtf import Form from flask_bootstrap import Bootstrap from wtforms.fields import TextField from wtforms.validators import R...
#!/usr/bin/env python from __future__ import print_function from future.standard_library import install_aliases install_aliases() from urllib.parse import urlparse, urlencode from urllib.request import urlopen, Request from urllib.error import HTTPError import json import os from flask import Flask from flask impor...
from gevent.monkey import patch_all patch_all() import random import urlparse import json from datetime import datetime, timedelta import pystache import twilio.twiml import urllib2 from flask import (abort, after_this_request, Flask, request, render_template, url_for) from flask_cache import Ca...
from functools import reduce from typing import Tuple, Dict, Any import pandas as pd import streamlit as st import numpy as np import altair as alt hide_menu_style = """ <style> #MainMenu {visibility: hidden;} </style> """ st.markdown(hide_menu_style, unsafe_allow_html=True) delaware =...
from datetime import date import tornado.escape import tornado.ioloop import tornado.web import rethinkdb as r r.connect( "localhost", 28015).repl() import json import urlparse import random import string import itertools def id_generator(size=6, chars=string.ascii_uppercase + string.digits): return ''.join(random...
#!/usr/bin/env python import urllib import json import os from flask import Flask from flask import request from flask import make_response # Flask app should start in global layout app = Flask(__name__) @app.route('/webhook', methods=['POST']) def webhook(): req = request.get_json(silent=True, force=True) ...
import stream, faker, bottle, itertools class User: def __init__(self, name, email): self.name = name self.email = email def __repr__(self): return 'User: %s <%s>' % (self.name, self.email) def user_factory(): return User(faker.name.name(), faker.internet.email()) bottle.debug(Tr...
from flask import Flask from redis import Redis import os import socket app = Flask(__name__) redis = Redis(host='redis', port=6379) host = socket.gethostname() @app.route('/') def hello(): redis.incr('global_hits') redis.incr(host) return 'Global: {global_hits}, Local: {local_hits}, host: {host}'.format( ...
# -*- coding: utf-8 -*- import csv from datetime import datetime import json import os from urllib.parse import quote, urlencode from urllib.request import urlopen from flask import make_response, request, Flask import googlemaps app = Flask(__name__) gmaps = googlemaps.Client(key='AIzaSyB8ri2uUrjtGX2tgOoK_vMSo8Byu...
from bottle import get,run,Bottle app = Bottle() @app.get('/') def welcome(): return "Hello, welcome to knowurcoding! This is automatically deployed. Check the time."
from datetime import date import tornado.escape import tornado.ioloop import tornado.web import rethinkdb as r r.connect( "localhost", 28015).repl() import json import urlparse import random import string import itertools from datetime import datetime def id_generator(size=6, chars=string.ascii_uppercase + string.digi...
#!/usr/bin/env python import urllib import json import os from flask import Flask from flask import request from flask import make_response from flask import render_template import sys import logging import datetime # import pickle # Flask app should start in global layout app = Flask(__name__) app.logger.addHand...
import os, sys, ujson from flask import Flask, render_template, url_for # Check command line to see if in production if len(sys.argv) >= 2 and sys.argv[1] == 'prod': # In production app = Flask(__name__, static_url_path='/mtg-cube/static') else: app = Flask(__name__) app.debug = True @app.route('/mtg-cube') d...
# ********************************************************************* # The MIT License (MIT) # # Copyright (c) 2016 Christopher Asakawa, Mathew O'Brien, Nicholas McHale, Corey Aing # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files #...
import webapp2, os, jinja2, json, datetime, random, hashlib from google.appengine.api import users from google.appengine.api import memcache from google.appengine.ext import ndb from google.appengine.ext.webapp import template from models import * from helpers import * import geo.geotypes jinja_environment = jinja2.En...
# -*- coding: UTF-8 -*- import os from pp.store import redis from flask import Flask, Response, render_template app = Flask(__name__) @app.route('/') def index(): return render_template('main.html') @app.route('/json') def people_json(): resp = redis.get('people.json') or '[]' return Response(resp, 200,...
""" arbitrage.py Check for arbitrage opportunities. USAGE: python arbitrage.py [--all] --all Display all arbitrage opportunities, not just profitable ones """ from models import * from decimal import * import utils import sys # the coinex transaction fee TRANSAC_FEE = 0.002 # the minimum amount of to_currency r...
#!/usr/bin/env python import requests import urllib import json import os import re from flask import Flask from flask import request from flask import make_response from datetime import datetime as DateTime, timedelta as TimeDelta # Flask app should start in global layout app = Flask(__name__) @app.route('/webhoo...
# coding=utf8 # Esqueleto de código Python para uso no Dojo-SE # Escrito por Wagner Luís de Araújo Menezes Macêdo <wagnerluis1982@gmail.com>. # # Para executar os testes, chame o interpretador Python com esse arquivo como # parâmetro. Ex: python <caminho_do_arquivo> import unittest corretos = [1,2,1] suspeitos = ['...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import codecs import json import time import datetime import re import logging from datetime import date from django import forms from django.contrib.auth import authenticate, login, logout from django.contrib.auth.models import User from django.contrib...
from django.contrib import admin from django.utils import html from apps.user.models import User from apps.user.admin import UserAdmin as apps_UserAdmin from django.utils.encoding import force_text from django.urls import reverse from .models import Profile,ProfileImage admin.site.unregister(User) class ProfileInli...
#!/usr/bin/env python """ An automated way to follow the Semantic Versioning Specification """ import os import re import logging import sys import traceback import itertools from sys import exit from argparse import RawTextHelpFormatter from argparse import ArgumentParser from subprocess import call from subprocess...
#!/usr/bin/env python # bot.py runs domfuzz, jsfunfuzz, or Lithium for a limited amount of time. # It stores jobs using ssh, using directory 'mv' for synchronization. import os import platform import random import shutil import socket import subprocess import sys import time import uuid import tempfile from glob imp...
import irc_socket import requests import sqlite3 import os import json import gspread from oauth2client.client import SignedJwtAssertionCredentials import time import random import threading import datetime import pytz import showerThoughtFetcher import collections from config import SOCKET_ARGS class Bot(object): ...
import json import logging import tornado.httpserver import tornado.ioloop import tornado.web from tornado.options import define, options from settings import * class MainHandler(tornado.web.RequestHandler): def post(self): logging.debug(json.dumps(self.request)) application = tornado.web.Application([...
# Pybot discord-unstable build # Misha Larionov and Nicholas Carr # github.com/MishaLarionov/pybot/tree/discord-unstable # Licensed under MIT License # See license.txt for full license # TODO: # Move responses into a separate .py file print("Loading... (This may take a while)") #Import all the stuff import cfg, time...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import urllib import subprocess from time import sleep from selenium import webdriver from telegram.ext import Updater, CommandHandler, MessageHandler, Filters from telegram.error import BadRequest from StringIO import StringIO import logging logging.basicConfig...
# encoding=utf8 import asyncio import os import random import subprocess import sys import time import aiohttp import psutil import pyping from discord.ext import commands from utils import checks from utils.bootstrap import Bootstrap from utils.buildinfo import * from utils.channel_logger import Channel_Logger from...
#! /usr/bin/python import sys, socket, string, re, os from flask import Flask #from flask.ext.sqlalchemy import SQLAlchemy from webapp import Command from sqlalchemy import create_engine global HOST, PORT, PASS, NICK, CHANNEL, db HOST = "irc.twitch.tv" PORT = 6667 PASS = os.environ['bot_pass'] NICK = 'zojibot' ''' app...
#!/usr/bin/env python3 # Python standard modules import argparse import json import logging import random import re import sys from os import path # Non-standard modules import discord from discord.ext import commands description = """\ A rudimentary bot based on discord.py's basic_bot.py and discord.py's \ playlist.p...
# Point-and-shoot camera for Raspberry Pi w/camera and Adafruit PiTFT. # This must run as root (sudo python cam.py) due to framebuffer, etc. # # Adafruit invests time and resources providing this open source code, # please support Adafruit and open-source development by purchasing # products from Adafruit, thanks! # ...
#!/usr/local/bin/python # -- coding: utf-8 -- import nltk from __future__ import division # ------------------------------------------------------------------------------ # Work through the http://nltk.org/book/ # -- gene + github at ology dot net not dot com # # Handy links: # http://nltk.org/ # http://stackoverflow....
import bpy import mathutils from mathutils import Vector import csv #from dateutil.parser import parse from datetime import datetime from math import ceil import os # If true, we only create a subset of data points. DEBUG=False # If DEBUG is true, this is how frequently to take a sample from the dataset # ie. 5 would...