code stringlengths 1 199k |
|---|
from __future__ import division
from __future__ import print_function
from pyqtgraph import QtGui, QtCore #Provides usage of PyQt4's libraries which aids in UI design
import pyqtgraph as pg #Initiation of plotting code
import serial #Communication with the serial port is done using th... |
import re
list_re = re.compile(r'\((.*)\) \"(.*)\" \"(.*)\"')
class Response(object):
# There are three possible server completion responses
OK = "OK" # indicates success
NO = "NO" # indicates failure
BAD = "BAD" # indicates a protocol error
class ListResponse(object):
def __init__(self, list_res... |
import argparse
import bz2
import gzip
import os.path
import sys
from csvkit import CSVKitReader
from csvkit.exceptions import ColumnIdentifierError, RequiredHeaderError
def lazy_opener(fn):
def wrapped(self, *args, **kwargs):
self._lazy_open()
fn(*args, **kwargs)
return wrapped
class LazyFile(o... |
import arcpy, os
directory = ""
def re_source_admin():
#issue list
issues = []
#walk through each directory
for root, dirs, files in os.walk(directory):
#ignore file and personal geodatabases
specDir = root.split("\\")[-1]
dbsuffix = specDir.split(".")[-1]
if dbsuffix == ... |
import sys
import time
from subprocess import call
sys.path.append('../../')
from library.components.SensorModule import SensorModule as Sensor
from library.components.MetaData import MetaData as MetaData
class Raspistill(Sensor):
def __init__(self):
super(Raspistill, self).__init__()
# ISO100
... |
from msrest.serialization import Model
class ConnectionMonitorParameters(Model):
"""Parameters that define the operation to create a connection monitor.
All required parameters must be populated in order to send to Azure.
:param source: Required.
:type source:
~azure.mgmt.network.v2018_01_01.models... |
from projecteuler.FileReader import file_to_2D_array_of_ints
matrix = file_to_2D_array_of_ints("p081.txt", ",")
y_max = len(matrix) - 1
x_max = len(matrix[0]) - 1
for y in range(y_max, -1, -1):
for x in range(x_max, -1, -1):
if y == y_max and x == x_max:
continue
elif y == y_max:
... |
import unittest
from hamlpy.parser.core import (
ParseException,
Stream,
peek_indentation,
read_line,
read_number,
read_quoted_string,
read_symbol,
read_whitespace,
read_word,
)
from hamlpy.parser.utils import html_escape
class ParserTest(unittest.TestCase):
def test_read_whitesp... |
"""Molecule distribution package setuptools installer."""
import setuptools
HAS_DIST_INFO_CMD = False
try:
import setuptools.command.dist_info
HAS_DIST_INFO_CMD = True
except ImportError:
"""Setuptools version is too old."""
ALL_STRING_TYPES = tuple(map(type, ('', b'', u'')))
MIN_NATIVE_SETUPTOOLS_VERSION =... |
from django.contrib import admin
from xbee_module.models import xbee_module
admin.site.register(xbee_module); |
def represents_int(value):
try:
int(value)
return True
except ValueError:
return False
def bytes_to_gib(byte_value, round_digits=2):
return round(byte_value / 1024 / 1024 / float(1024), round_digits)
def count_to_millions(count_value, round_digits=3):
return round(count_value / f... |
import mmap
import os.path
import re
from collections import OrderedDict
from .base_handler import BaseHandler
from .iso9660 import ISO9660Handler
from utils import MmappedFile, ConcatenatedFile
class GDIParseError(ValueError):
pass
class GDIHandler(BaseHandler):
def test(self):
if not re.match('^.*\.gd... |
frame_len = .1
keys = {
'DOWN': 0x42,
'LEFT': 0x44,
'RIGHT': 0x43,
'UP': 0x41,
'Q': 0x71,
'ENTER': 0x0a,
}
apple_domain = 1000
food_values = {
'apple': 3,
}
game_sizes = {
's': (25, 20),
'm': (50, 40),
'l': (80, 40),
}
initial_size = 4 |
from distutils.core import setup
import sslserver
setup(name="django-sslserver",
version=sslserver.__version__,
author="Ted Dziuba",
author_email="tjdziuba@gmail.com",
description="An SSL-enabled development server for Django",
url="https://github.com/teddziuba/django-sslserver",
pac... |
"""
Dump Mapper
This script acts as a map/function over the pages in a set of MediaWiki
database dump files. This script allows the algorithm for processing a set of
pages to be spread across the available processor cores of a system for faster
analysis.
This script can also be imported as a module to expose the `map(... |
from __future__ import absolute_import
from __future__ import unicode_literals
import collections
import jsonschema
DEFAULT_GENERATE_CONFIG_FILENAME = 'generate_config.yaml'
GENERATE_OPTIONS_SCHEMA = {
'type': 'object',
'required': ['repo', 'database'],
'properties': {
'skip_default_metrics': {'type... |
"""
@file
@brief Buffer as a logging function.
"""
from io import StringIO
class BufferedPrint:
"""
Buffered display. Relies on :epkg:`*py:io:StringIO`.
Use it as follows:
.. runpython::
:showcode:
def do_something(fLOG=None):
if fLOG:
fLOG("Did something.")
... |
from django.contrib import admin
from bananas.apps.appointment.forms import AppointmentForm
from bananas.apps.appointment.models import Appointment
from bananas.apps.appointment.models import AppointmentType
@admin.register(Appointment)
class AppointmentAdmin(admin.ModelAdmin):
list_display = (
'time',
... |
import datetime
import os
class JobCommand(object):
def execute(self, context):
if context.getCurrentCommand() != 'begin':
raise Exception('illegal command ' + str(context.getCurrentCommand()))
command_list = CommandListCommand()
command_list.execute(context.next())
class Command... |
from copy import copy
import silk.utils.six as six
from silk.singleton import Singleton
def default_permissions(user):
if user:
return user.is_staff
return False
class SilkyConfig(six.with_metaclass(Singleton, object)):
defaults = {
'SILKY_DYNAMIC_PROFILING': [],
'SILKY_IGNORE_PATHS'... |
import django_dynamic_fixture as fixture
from unittest import mock
from django import urls
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.auth.models import User
from django.test import TestCase
from readthedocs.core.models import UserProfile
from readthedocs.projects.models import Pr... |
class Base(object):
def meth(self):
pass
class Derived1(Base):
def meth(self):
return super().meth()
class Derived2(Derived1):
def meth(self):
return super().meth()
class Derived3(Derived1):
pass
class Derived4(Derived3, Derived2):
def meth(self):
return super().meth(... |
import sys
def print_progress (iteration, total, prefix = '', suffix = '', decimals = 1, barLength = 100):
"""
Call in a loop to create terminal progress bar
@params:
iteration - Required : current iteration (Int)
total - Required : total iterations (Int)
prefix - Opti... |
import os
from conan.tools.files.files import save_toolchain_args
from conan.tools.gnu import Autotools
from conans.test.utils.mocks import ConanFileMock
from conans.test.utils.test_files import temp_folder
def test_source_folder_works():
folder = temp_folder()
os.chdir(folder)
save_toolchain_args({
... |
import sys
def diff(a,b):
return compareTree(a, b)
def getType(a):
if isinstance(a, dict):
return 'object'
elif isinstance(a, list):
return 'array'
elif isinstance(a, str):
return 'string'
elif isinstance(a, int):
return 'number'
elif isinstance(a, bool):
... |
"""Test segwit transactions and blocks on P2P network."""
from test_framework.mininode import *
from test_framework.test_framework import PlanbcoinTestFramework
from test_framework.util import *
from test_framework.script import *
from test_framework.blocktools import create_block, create_coinbase, add_witness_commitme... |
"""
Decorators module
"""
import logging
from docktors.core import decorated
from docktors.wdocker import DockerContainer
logger = logging.getLogger(__name__)
def docker(func=None, **kwargs):
"""
Decorator to startup and shutdown a docker container.
:param image: The name of the image to use.
:param com... |
import json
class JSONRenderer(object):
def render(self, data):
return json.dumps(data) |
from django.apps import AppConfig
class MemosConfig(AppConfig):
name = 'memos' |
from runner.koan import *
def function():
return "pineapple"
def function2():
return "tractor"
class Class(object):
def method(self):
return "parrot"
class AboutMethodBindings(Koan):
def test_methods_are_bound_to_an_object(self):
obj = Class()
self.assertEqual(True, obj.method.im... |
import sys
import os
import string
import getopt
import platform
import time
import re
from testutil import *
from testglobals import *
os.environ['TERM'] = 'vt100'
if sys.platform == "cygwin":
cygwin = True
else:
cygwin = False
global config
config = getConfig() # get it from testglobals
long_options = [
"co... |
"""
These settings are used by the ``manage.py`` command.
With normal tests we want to use the fastest possible way which is an
in-memory sqlite database but if you want to create South migrations you
need a persistant database.
Unfortunately there seems to be an issue with either South or syncdb so that
defining two r... |
import re
from .base import EventBuilder
from .._misc import utils
from .. import _tl
from ..types import _custom
class NewMessage(EventBuilder, _custom.Message):
"""
Represents the event of a new message. This event can be treated
to all effects as a `Message <telethon.tl.custom.message.Message>`,
so p... |
from __future__ import unicode_literals
import django
from django.core.exceptions import ValidationError
from django.db.models import Q
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase, Client
from django.test.client import RequestFactory
from django.test.utils import override... |
"""zigzi, Platform independent binary instrumentation module.
Copyright (c) 2016-2017 hanbum park <kese111@gmail.com>
All rights reserved.
For detailed copyright information see the file COPYING in the root of the
distribution archive.
"""
import argparse
from PEInstrument import *
from PEAnalyzeTool import *
from PEMa... |
"""
Clement Michard (c) 2015
"""
import os
import sys
import nltk
from emotion import Emotion
from nltk.corpus import WordNetCorpusReader
import xml.etree.ElementTree as ET
class WNAffect:
"""WordNet-Affect ressource."""
def __init__(self, wordnet16_dir, wn_domains_dir):
"""Initializes the WordNet-Affec... |
import cv2
import cv2.cv as cv
class Display:
def setup(self, fullscreen):
cv2.namedWindow('proj_0', cv2.WINDOW_OPENGL)
if fullscreen:
cv2.setWindowProperty('proj_0', cv2.WND_PROP_FULLSCREEN, cv.CV_WINDOW_FULLSCREEN)
def draw(self, image):
cv2.imshow('proj_0', image)
... |
from typing import Iterable, Callable, Optional, Any, List, Iterator
from dupescan.fs._fileentry import FileEntry
from dupescan.fs._root import Root
from dupescan.types import AnyPath
FSPredicate = Callable[[FileEntry], bool]
ErrorHandler = Callable[[EnvironmentError], Any]
def catch_filter(inner_filter: FSPredicate, e... |
import sys
import os
import subprocess
import shutil
import fix_rocks_network
import json
pxelinux_kernels_dir='/tftpboot/pxelinux/';
centos7_templates_dir='./centos7_ks'
centos7_dir='/export/rocks/install/centos7/';
centos7_ks_scripts_dir=centos7_dir+'/scripts/';
centos7_pxeboot_dir=centos7_dir+'/images/pxeboot';
def ... |
import logging
from . import constants
logger = logging.getLogger(constants.NAME) |
"""Prints a summary of the contents of the IPHAS source catalogue.
"""
import os
from astropy.io import fits
from astropy import log
import numpy as np
import sys
from dr2 import constants
n_sources = 0
n_r20 = 0
n_reliable = 0
n_deblend = 0
n_reliable_deblend = 0
n_pair = 0
n_saturated = 0
n_brightNeighb = 0
path = os... |
"""
WSGI config for asteria project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... |
from copy import copy
import sys
from textwrap import dedent
import warnings
import logging
import numpy
from six.moves import xrange
import theano
from theano.compat import izip
from six import integer_types
from theano.gradient import DisconnectedType
from theano import gof
from theano.gof import Apply, Constant, has... |
__all__ = ["melfilterbank", "windowing", "spectrogram", "resample"]
import melfilterbank
import windowing
import spectrogram
import resample |
from models.team import Team
from models.tournament import Tournament
from models.tree import ProbableTournamentTree
import unittest
import pdb
class TestTeam(unittest.TestCase):
def setUp(self):
self.tournament = Tournament()
self.teams = self.tournament.teams
self.usa = Team.get_for_countr... |
import pytest
from click.testing import CliRunner
from parkour import cli
import md5
def file_checksums_equal(file1, file2):
with open(file1) as f:
checksum1 = md5.new(f.read()).digest()
with open(file2) as f:
checksum2 = md5.new(f.read()).digest()
return checksum1==checksum2
def test_trimme... |
from flask import Flask
app = Flask(__name__)
@app.route('/')
def CMC():
return 'Welcome to the Container Master Class by Cerulean Canvas'
if __name__ == '__main__':
app.run(host='0.0.0.0') |
from flask import (Flask, session, render_template, request, redirect,
url_for, make_response, Blueprint, current_app)
import requests
import json
from datetime import datetime, timedelta
from flask.ext.cors import CORS, cross_origin
bp = Blueprint('audioTag', __name__)
def create_app(blueprint=bp):
... |
class Solution(object):
def titleToNumber(self, s):
"""
:type s: str
:rtype: int
"""
number = 0
for i in range(len(s)):
number = number * 26 + ord(s[i]) - ord('A') + 1
return number |
import unittest
class PilhaVaziaErro(Exception):
pass
class Pilha():
def __init__(self):
self.lista=[]
def empilhar(self,valor):
self.lista.append(valor)
def vazia(self):
return not bool(self.lista)
def topo(self):
try:
return self.lista[-1]
except... |
import unittest
import mock
class DynamicFieldsMixinTestCase(unittest.TestCase):
"""Test functionality of the DynamicFieldsMixin class."""
def test_restrict_dynamic_fields(self): |
import blueapi
teamNumber = 1540
eventKey = '2014pncmp'
def getTeamQualMatches(teamNumber,eventKey):
matches = []
for n in range(0,len(blueapi.getTeamEventMatches(eventKey,teamNumber))):
if blueapi.getTeamEventMatches(teamNumber,eventKey)[n]['comp_level'] == 'qm':
matches.append(blueapi.getT... |
"""
WSGI config for gevsckio project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gevsckio.settings")
from django.core.wsg... |
u'''\
:mod:`ecoxipy.pyxom` - Pythonic XML Object Model (PyXOM)
========================================================
This module implements the *Pythonic XML Object Model* (PyXOM) for the
representation of XML structures. To conveniently create PyXOM data structures
use :mod:`ecoxipy.pyxom.output`, for indexing use
... |
from abc import abstractmethod
from threading import Timer
from ctx.uncertainty.measurers import clear_dobson_paddy
class Event:
def __init__(self, type, **kwargs):
self.type = type
self.properties = kwargs
class Observer:
def update(self):
raise NotImplementedError("Not implemented")
cl... |
from tools import *
from default_record import *
from xen.xend import uuid
from xen.xend import XendDomain, XendNode
from xen.xend import BNVMAPI, BNStorageAPI
from xen.xend.server.netif import randomMAC
from xen.xend.ConfigUtil import getConfigVar
from xen.xend.XendAPIConstants import *
from xen.xend.XendAuthSessions ... |
from setuptools import setup, find_packages
setup(
name="mould",
version="0.1",
packages=find_packages(),
package_data={
"mould": ["*.tpl"],
},
install_requires=[
"Flask",
"Flask-Script",
"Flask-Testi... |
from __future__ import absolute_import
from .validates import * |
import hashlib
import hmac
import json
import requests
class GitHubResponse:
"""Wrapper for GET request response from GitHub"""
def __init__(self, response):
self.response = response
@property
def is_ok(self):
"""Check if request has been successful
:return: if it was OK
... |
import os
def Dir_toStdName(path):
if not (path[-1]=="/" or path[-1] == "//"):
path=path+"/"
return path
def Dir_getFiles(path):
path=Dir_toStdName(path)
allfiles=[]
files=os.listdir(path)
for f in files:
abs_path = path + f
if os.path.isdir(abs_path):
sub_files=Dir_getFiles(abs_path)
sub_files=[ f+'/... |
def get_related_fields(model):
pass
def get_table_size(model):
pass
def get_row_size(model):
pass |
import os, requests, tempfile, time, webbrowser
import lacuna.bc
import lacuna.exceptions as err
class Captcha(lacuna.bc.LacunaObject):
""" Fetches, displays, and solves graphical captchas.
General usage will be::
cap = my_client.get_captcha()
cap.showit() # display the captcha image
... |
"""Shows that debug is enabled"""
import platform
import core.module
import core.widget
import core.decorators
class Module(core.module.Module):
@core.decorators.every(minutes=60)
def __init__(self, config, theme):
super().__init__(config, theme, core.widget.Widget(self.full_text))
def full_text(sel... |
from ctypes import c_float, cast, POINTER
import numpy as np
import OpenGL.GL as gl
import openvr
from openvr.gl_renderer import OpenVrFramebuffer as OpenVRFramebuffer
from openvr.gl_renderer import matrixForOpenVrMatrix as matrixForOpenVRMatrix
from openvr.tracked_devices_actor import TrackedDevicesActor
import gltfut... |
__author__ = 'shinyorke_mbp' |
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^dropzone-drag-drop/$', include('dragdrop.urls', names... |
"""
The following tests that db connections works properly.
Make sure the default configurations match your connection to the database
"""
import pymysql
import warnings
warnings.filterwarnings("ignore")
from StreamingSQL.db import create_connection, execute_command
from StreamingSQL.fonts import Colors, Formats
"""Def... |
from app import app
import argparse
import os
import routes
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Run the MightySpring backend server.')
parser.add_argument('--debug',
'-d',
default=True)
parser.add_a... |
def clean_dict_repr(mw):
"""Produce a repr()-like output of dict mw with ordered keys"""
return '{' + \
', '.join('{k!r}: {v!r}'.format(k=k, v=v) for k, v in
sorted(mw.items())) +\
'}' |
from pandas import DataFrame, read_csv
import matplotlib.pyplot as plt
import pandas as pd
names = ['Bob','Jessica','Mary','John','Mel']
births = [968, 155, 77, 578, 973]
BabyDataSet = list(zip(names,births)) # zip pairs entries together and list combines the entries to a list
print(BabyDataSet)
df = pd.DataFrame(data ... |
import numpy as np
import itertools
from scipy.misc import comb as bincoef
import random
def sign_permutations(length):
""" Memory efficient generator: generate all n^2 sign permutations. """
# return a generator which generates the product of "length" smaller
# generators of (-1 or +1) (i.e. the unrolled s... |
import time
import json
import tornado.httpclient
http_client = tornado.httpclient.HTTPClient()
class HTTPServiceProxy(object):
def __init__(self, host='localhost', port=6999, cache_timeout=5.0):
self._host = host
self._port = port
self._cache_timeout = cache_timeout
self._cache = {}... |
"""Unit tests for gclient.py.
See gclient_smoketest.py for integration tests.
"""
import Queue
import copy
import logging
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
import gclient
import gclient_utils
import gclient_scm
from testing_support impor... |
from zang.exceptions.zang_exception import ZangException
from zang.configuration.configuration import Configuration
from zang.connectors.connector_factory import ConnectorFactory
from zang.domain.enums.http_method import HttpMethod
from docs.examples.credetnials import sid, authToken
url = 'https://api.zang.io/v2'
conf... |
import pytest
from mmb_perceptron.feature_extractor import FeatureExtractor
class TestFeatureExtractor(object):
"""Tests for feature extractors.
"""
def test_context_size(self):
f = FeatureExtractor()
assert f.context_size == (0, 0)
f.context_size = (1, 2)
assert f.context_si... |
from unittest import TestCase
from unittest.mock import Mock, patch, call, MagicMock
from flowirc.protocol import IRCClientProtocol
__author__ = 'Olle Lundberg'
class TestIRCClientProtocol(TestCase):
def setUp(self):
self.proto = IRCClientProtocol()
self.transport = Mock()
self.proto.message... |
"""
"""
from __future__ import absolute_import, print_function, unicode_literals
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'rest_framework',
'rest_fr... |
"""Print out a report about whats in a vectortile
Usage:
tileinfo.py [options] [SOURCE]
Options:
--srcformat=SRC_FORMAT Source file format: (tile | json)
--indent=INT|None JSON indentation level. Defaults to 4. Use 'None' to disable.
-h --help Show this screen.
--version Show version.
-... |
"""This script will create multiple projects from csv files and
add pdbs based on the csv names. It can also create peatsa jobs
and merge them back into the database"""
import pickle, sys, os, copy, time, types, math
import numpy
from PEATDB.Base import PDatabase
from PEATDB import Utils
from PEATDB.Actions import DBAc... |
from setuptools import setup, find_packages
with open("README.rst") as readme:
long_description = readme.read()
setup(
name='algos-py',
version='0.4.5',
license='MIT',
author='Aleksandr Lisianoi',
author_email='all3fox@gmail.com',
url='https://github.com/all3fox/algos-py',
packages=find_... |
import bonemapy
from distutils.core import setup
setup(
name = 'bonemapy',
version = bonemapy.__version__,
description = 'An ABAQUS plug-in to map bone properties from CT scans to 3D finite element bone/implant models',
license = 'MIT license',
keywords = ["ABAQUS", "plug-in","CT","finite","element"... |
import re
import sys
import logging
import boto.ec2
from texttable import Texttable
from pprint import PrettyPrinter
from optparse import OptionParser
PP = PrettyPrinter( indent=2 )
parser = OptionParser("usage: %prog [options]" )
parser.add_option( "-v", "--verbose", default=None, action="store_true",
... |
def read_data(file_name):
return pd.read_csv(file_name)
def preprocess(data):
# Data Preprocessing
data['GDP_scaled']=preprocessing.scale(data['GDP'])
data['CLPRB_scaled']=preprocessing.scale(data['CLPRB'])
data['EMFDB_scaled']=preprocessing.scale(data['EMFDB'])
data['ENPRP_scaled']=preprocessin... |
import os
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': 'db',
}
}
SECRET_KEY = ''
TEMPLATE_DIRS = (
'/srv/webldap/templates',
)
EMAIL_FROM = 'root@localhost'
REQ_EXPIRE_HRS = 48
REQ_EXPIRE_STR = '48 heures'
LDAP_URI = 'ldap://{... |
"""
Simplified sprite animation framework.
.. note:: This module is an evolving "work-in-progress" and should be treated
as such until such time as this notice disappears.
"""
from time import sleep, perf_counter
from PIL import Image
class dict_wrapper(object):
"""
Helper class to turn dictionaries i... |
from __future__ import unicode_literals
from django.db import models, migrations
def populate_target_amount(apps, schema_editor):
Entry = apps.get_model("momentum", "Entry")
for entry in Entry.objects.all():
entry.target_amount = entry.goal.target_amount
entry.save()
class Migration(migrations.M... |
import sys
from itertools import groupby
from time import time
from functools import partial
import re
import django
django.setup()
from django.db import transaction
from clldutils.dsv import reader
from clldutils.text import split_text
from clldutils.path import Path
from clldutils import jsonlib
import attr
from dpla... |
def count_keys_equal(A, n, m):
equal = [0] * (m + 1)
for i in range(0, n): # 0 1 2 3 4 5 6
key = A[i] # 1 3 0 1 1 3 1
equal[key] += 1
return equal
def count_keys_less(equal, m):
less = [0] * (m + 1)
less[0] = 0
for j in range(1, m+1): # 0 1 2 3 4 ... |
'''
Copyright 2011 Jean-Baptiste B'edrune, Jean Sigwald
Using New BSD License:
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions ... |
from mock import Mock, patch
from psutil import AccessDenied, TimeoutExpired
from thefuck.output_readers import rerun
class TestRerun(object):
def setup_method(self, test_method):
self.patcher = patch('thefuck.output_readers.rerun.Process')
process_mock = self.patcher.start()
self.proc_mock ... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Action'
db.create_table('gratitude_action', (
('id', self.gf('django.db.models.fields.AutoField')(primary_k... |
"""
The MIT License (MIT)
Copyright (c) 2015 Axel Mendoza <aekroft@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, co... |
from snowball.utils import SnowMachine
from snowball.climate import WeatherProbe
from snowball.water.phases import (
WaterVapor, IceCrystal, SnowFlake
)
def let_it_snow():
"""
Makes it snow, using a SnowMachine when weather doesn't allow it.
Returns a list of SnowFlakes.
Example::
>>> let_it... |
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
from inspect import isgenerator
class Element(object):
tag = ''
self_closing = False
def __init__(self, *children, **attrs):
if children and isinstance(children[0], dict):
self.attrs = children[0]
... |
from twisted.internet.defer import Deferred, DeferredList
from twisted.python.failure import Failure
from twisted.trial.unittest import TestCase
import smartanthill.litemq.exchange as ex
from smartanthill.exception import LiteMQResendFailed
class LiteMQCase(TestCase):
g_resent_nums = 0
def test_declare_exchange... |
import time
import numpy.numarray as na
import math
import os
import sys
import yaml
import m3.unit_conversion as m3u
from m3qa.calibrate import *
from m3qa.calibrate_sensors import *
from m3qa.calibrate_actuator_ec_a1r1 import *
import m3.actuator_ec_pb2 as aec
import m3qa.config_arm_a1r1 as a1r1
config_default_a1_j0=... |
from __future__ import absolute_import, division, print_function, \
unicode_literals
from mock import Mock, call
from os.path import dirname, join
from requests import HTTPError
from requests_mock import ANY, mock as requests_mock
from unittest import TestCase
from octodns.record import Record
from octodns.provider... |
from components.base.automotive_component import AutomotiveComponent
from config import project_registration as proj
from tools.ecu_logging import ECULogger as L
import random
class AbstractECU(AutomotiveComponent):
'''
This abstract class defines the interface of
an ECU as it is found in an automotive netw... |
import boto3
import logging
import argparse
import os
from botocore.exceptions import ClientError
from boto3.dynamodb.conditions import Key, Attr
import json
import decimal
import time
import datetime
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import contracts
fro... |
from django import template
from django.conf import settings
register = template.Library()
@register.assignment_tag
def get_google_maps_key():
return getattr(settings, 'GOOGLE_MAPS_KEY', "") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.