code stringlengths 1 199k |
|---|
from peewee import (
Model,
IntegerField,
CharField,
BooleanField,
TextField,
)
from playhouse.db_url import connect
from settings import DATABASE_URL
if DATABASE_URL:
db = connect(DATABASE_URL)
else:
db = None
class BaseModel(Model):
class Meta:
database = db
class Installation(... |
def hello(value):
return "Hello From API test module "+ value +" ! ! ! " |
__author__ = 'sathley'
from .entity import AppacitiveEntity
from .error import ValidationError, UserAuthError
from .utilities import http, urlfactory, customjson
from .appcontext import ApplicationContext
from .response import AppacitiveCollection
from .link import Link
import logging
user_logger = logging.getLogger(__... |
from asyncio.test_utils import TestCase
import json
from unittest.mock import patch, Mock
from githubxml import usuario
dct = {'following_url': 'https://api.github.com/users/renzon/following{/other_user}', 'hireable': False,
'avatar_url': 'https://avatars.githubusercontent.com/u/3457115?v=3', 'blog': 'https://ad... |
'''Does a scatter plot. Inherits from plot, not linear plot,
although I could have done it either way (it's an oddity of how
matplotlib operates, very consistent across both scatter and linear
plotting.'''
from plot_root import plot
class scatter_plot(plot):
def __init__(self,x,y):
self.x = x
self.... |
from _prology import *
_ = L
A = Predicate("A")
A(_.A).known_when(Equal(_.T, 3))
C = Predicate("C")
C(_.Z).known_when(A(_.Z))
B = Predicate("B")
B(_.B).known_when(A(_.T), Equal(_.T, 1))
print(B(_.B).all()) |
'''
Author: Hans Erik Heggem
Email: hans.erik.heggem@gmail.com
Project: Master's Thesis - Autonomous Inspection Of Wind Blades
Repository: Master's Thesis - CV (Computer Vision)
'''
from Settings.TestData import TestData
from TestUnits.Test_main import Test_main
'''
@brief Subclass due to limitations with the test... |
from __future__ import division, print_function, absolute_import
import warnings
import numpy as np
from numpy.testing import assert_, assert_equal, run_module_suite
from scipy.sparse import csr_matrix, csgraph
def test_cs_graph_components():
D = np.eye(4, dtype=bool)
with warnings.catch_warnings():
war... |
"""
Context to keep track of the qframe that is currently being operated on.
NB! Not thread safe and not safe for interleaved operations on multiple frames.
"""
_current_qframe = None
def set_current_qframe(qframe):
global _current_qframe
_current_qframe = qframe
def get_current_qframe():
return _current_qf... |
try:
theFilehandle = open('fileTraversal.py','r') #open the file using open; don't forget the permissions, duh!!
fileContent = theFilehandle.readlines() #grab the file contents, its readlines and not a readline
theFilehandle.close() #close the damn file som!
FilteredOP = [] #create an empty arraylist fo... |
"""
Full CI based on determinants rather than on CSFs.
The approach is the one introduced by
Olsen J Chem Phys 89 2185 (1988)
It is also described in the book
Molecular electronic structure theory,
by Helgaker, Olsen, Jorgensen.
There it is called 'Minimal operator count (MOC) method'
written by Simon Sala
Notation:
Bo... |
import sys
import argparse as argp
import traceback as trb
def parse_commandline():
"""
"""
parser = argp.ArgumentParser(prog='scaleAffinity.py')
parser.add_argument('-s', '--scales', type=str, dest='signalScales',
help='File containing scale information')
parser.add_argument... |
'''
email发送
@author: 15th
@data: 2017.2.28
'''
import re
import time
import smtplib
from email.header import Header
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.utils import parseaddr, formataddr
from simpleat.conf import settings
from . import template
_SMTP_SERVER = s... |
print("this is a new file") |
"""
The MIT License (MIT)
Copyright (c) 2018 Zuse Institute Berlin, www.zib.de
Permissions are granted as stated in the license file you have obtained
with this software. If you find the library useful for your purpose,
please refer to README.md for how to cite IPET.
@author: Gregor Hendel
"""
from .StatisticReader imp... |
"""
ADD A DESCRIPTION OF WHAT THIS FILE IS FOR
"""
__author__ = 'brsch'
import helper_functions
import os
proj_cwd = os.path.dirname(os.getcwd())
data_dir = proj_cwd + r'\data'
def pull_cases_by_court(court_id):
"""
Given a court id, pull_cases_by_court will iterate through every cluster online, check if the ca... |
from .resource import Resource
from .proxy_resource import ProxyResource
from .backup_long_term_retention_policy import BackupLongTermRetentionPolicy
from .backup_long_term_retention_vault import BackupLongTermRetentionVault
from .tracked_resource import TrackedResource
from .restore_point import RestorePoint
from .rec... |
import pytest
import os
from mock import Mock, patch
import json
import sqlalchemy
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy import and_, or_
import glob, datetime
from app.controllers.messaging_controller import *
from utils.common import PageType, DbEngine, json2obj
... |
import subprocess
from molecule import util
from molecule.command import base
LOG = util.get_logger(__name__)
class Destroy(base.Base):
"""
Destroys all instances created by molecule.
Usage:
destroy [--platform=<platform>] [--provider=<provider>] [--debug]
Options:
--platform=<platform> ... |
from django.contrib import messages
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.views.generic import View
from django.views.generic.detail import SingleObjectMixin
from .utils import get_django_model_admin
class ModelToolsView(SingleObjectMixin, View):
"""A special view that run ... |
import copy, sys
from NodeStructures import *
from WatchDog import *
def _computeMatrix(graph):
matrix, temp = [], []
while len(temp) < len(graph.nodes):
temp.append(0)
while len(matrix) < len(graph.nodes):
matrix.append(temp[:])
for node in graph.nodes:
for edge in node.out:
... |
from django.apps import AppConfig
class WebcmdConfig(AppConfig):
name = 'webcmd' |
from battle import Battle
class Game_start(object):
def __init__(self):
nick = input("Wpisz swoj nick: ")
self.nick = nick
new_battle = Battle() |
import logging
import os
import sys
import json
import re
import tempfile
import shutil
import glob
import textwrap
from abc import ABCMeta
try:
JSONDecodeError = json.decoder.JSONDecodeError
except AttributeError:
JSONDecodeError = ValueError
import pyp2rpm.exceptions as exc
import pyp2rpm.logger
from pyp2rpm ... |
bl_info = {
"name": "Tomb Raider .SAT file importer",
"author": "Israel Jacquez",
"version": (1, 0),
"blender": (2, 78, 0),
"location": "File > Import-Export",
"description": "Import .SAT file",
"warning": "",
"wiki_url": "https://github.com/ijacquez/trsat",
"tracker_url": "https://g... |
from KMCLib import *
import numpy
cell_vectors = [[1.0,0.0,0.0],
[0.0,1.0,0.0],
[0.0,0.0,1.0]]
basis_points = [[0.0, 0.0, 0.0]]
unit_cell = KMCUnitCell(cell_vectors=cell_vectors,
basis_points=basis_points)
xRep = 1
yRep = 1
zRep = 20
numPoints = xRep*(zRep+4)*yRep... |
import unittest
from vodem.api import unlock_nck_time
class TestUnlockNckTime(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.valid_response = {
'unlock_nck_time': '',
}
def test_call(self):
resp = unlock_nck_time()
self.assertEqual(self.valid_response, ... |
import peewee as pw
from .db import EnumField, base_model
class StorageGroup(base_model):
"""Storage group for the archive.
Attributes
----------
name : string
The group that this node belongs to (Scinet, DRAO hut, . . .).
notes : string
Any notes about this storage group.
"""
... |
from __future__ import print_function, unicode_literals
import os
import json
import time
import datetime
import traceback
import dropbox
from logging import getLogger, StreamHandler, FileHandler, DEBUG, INFO, WARN, ERROR
logger = getLogger(__name__)
sh = StreamHandler()
fh = FileHandler("/pws/log/uploader.log")
sh.set... |
"""<frame> template"""
from ..environment import env
frame = env.from_string("""\
<frame {% if src -%} src="{{ src }}" {% endif -%}
{% if frameborder -%} frameborder="{{ frameborder }}" {% endif -%}
{% if longdesc -%} longdesc="{{ longdesc }}" {% endif -%}
{% if marginheight -%} marginheight="{{ ma... |
import os
from pip.req import parse_requirements
from setuptools import setup, find_packages
README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read()
install_reqs = parse_requirements("requirements.txt")
reqs = [str(ir.req) for ir in install_reqs]
os.chdir(os.path.normpath(os.path.join(os.path.abspat... |
import pandas as pd
import pytest
import pytz
from qstrader.simulation.event import SimulationEvent
@pytest.mark.parametrize(
"sim_event_params,compare_event_params,expected_result",
[
(
('2020-01-01 00:00:00', 'pre_market'),
('2020-01-01 00:00:00', 'pre_market'),
Tru... |
from __init__ import *
import json, requests
import h5py
def query(lon, lat, coordsys='gal', mode='full'):
url = 'http://argonaut.skymaps.info/gal-lb-query-light'
payload = {'mode': mode}
if coordsys.lower() in ['gal', 'g']:
payload['l'] = lon
payload['b'] = lat
elif coordsys.lower() in ... |
from pydatajson import threading_helper
from pydatajson.validators.url_validator import UrlValidator
class DistributionDownloadUrlsValidator(UrlValidator):
def validate(self):
async_results = []
for dataset in self.catalog.get('dataset', []):
distribution_urls = \
[distri... |
class SoccerPlayer():
pass |
import pytest
import supriya
import supriya.assets.synthdefs
@pytest.fixture(autouse=True)
def shutdown_sync_servers(shutdown_scsynth):
pass
@pytest.fixture
def server(persistent_server):
persistent_server.reset()
persistent_server.add_synthdef(supriya.assets.synthdefs.default)
yield persistent_server
d... |
def tag_token(pushbots, platform, token, tag):
return pushbots.tag(platform=platform, token=token, tag=tag)
def tag_alias(pushbots, platform, alias, tag):
return pushbots.tag(platform=platform, alias=alias, tag=tag)
def tag_data(pushbots, data):
return pushbots.tag(data=data) |
from .schedule import Schedule
from .command import Command |
from sympy import simplify, Eq
class Parser(object):
@staticmethod
def solve(validated_input_str):
# Escape input_str
# Start doing real shit
# Check if equation is passed with right and left side
split_equation = validated_input_str.split('=')
if len(split_equation) == 2... |
from collections import Iterable
print isinstance([], Iterable)
ls = [1, 2, 3]
for index, value in enumerate(ls):
print index, value
ls = [x for x in range(1, 11)]
for x in ls:
print x
ls = (x for x in range(0, 11))
print ls.next()
for x in ls:
print x
def gen():
yield 99
for x in gen():
print x |
import pycqed.instrument_drivers.physical_instruments.ZurichInstruments.ZI_base_instrument as zibase
class ZI_base_instrument_qudev(zibase.ZI_base_instrument):
"""
Class to override functionality of ZI_base_instrument using
multi-inheritance in ZI_HDAWG_qudev and acquisition_devices.uhfqa.
"""
def _... |
"""A general interval timer that fires :class:GTimerEvent`s."""
import campy.private.platform as _platform
class GTimer:
"""An interval timer that generates :class:GTimerEvent`s at a fixed rate."""
def __init__(self, milliseconds):
"""Create a :class:`GTimer` that can generate :class:`GTimerEvent`s.
... |
__author__ = 'zfei'
from time import sleep
import pprint
from api.btc2cnyapi import BTCChina
from settings import *
class Bot:
def __init__(self):
self.trader = BTCChina(API_ACCESS, API_SECRET)
self.portfolio = []
self.profit = 0
def get_lowest_market_ask(self, market_depth):
ret... |
from __future__ import unicode_literals
import os
from logging import getLogger
from collections import OrderedDict
import tagulous
from urlparse import urlparse
from django.db import models
from django.conf import settings
from django.utils.encoding import python_2_unicode_compatible
from django.utils import timezone
... |
import pandas as pd
import numpy as np
import itertools
import parasail
__all__ = ['CachedNWDistance',
'computeCDR3PWDist',
'aligned_mm_metric',
'nw_metric']
def computeCDR3PWDist(seqs, gap_open=3, gap_extend=3, matrix=parasail.blosum62, useIdentity=False, cache=None):
"""Compute pa... |
import _plotly_utils.basevalidators
class BordercolorsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self,
plotly_name="bordercolorsrc",
parent_name="scatterternary.hoverlabel",
**kwargs
):
super(BordercolorsrcValidator, self).__init__(
... |
from unittest import TestCase
from unittest import mock
import requests
from django.db import models
from django_rest_model.db.models import RestModel
from django_rest_model.db.query import RestQuerySet, BaseQuerySet
from rest_framework import serializers
from rest_framework.exceptions import APIException
base_url = '... |
from hwt.interfaces.utils import propagateClkRstn, addClkRstn
from hwt.simulator.simTestCase import SimTestCase
from hwt.synthesizer.unit import Unit
from hwtLib.amba.axi4Lite import Axi4Lite
from hwtLib.amba.axiLite_comp.sim.ram import Axi4LiteSimRam
from hwtLib.amba.axi_comp.builder import AxiBuilder
from hwtLib.amba... |
"""
Implement an algorithm to print all valid (e.g., properly opened and
closed) combinations of n-pairs of parentheses.
EXAMPLE:
input: 3 (e.g., 3 pairs of parentheses)
output: ()()(), ()(()), (())(), ((()))
"""
import unittest
def gen_parenthesis(count):
if count == 0:
return set()
elif count == 1... |
import sys
if sys.version_info < (2, 7):
print ("Must use python 2.7 or greater\n")
sys.exit()
elif sys.version_info[0] > 2:
print ("Incompatible with Python 3\n")
sys.exit()
try:
import wx
import wx.lib.scrolledpanel as scrolled
except ImportError:
print ("You do not appear to have wxpython installed.\n")... |
from typing import List
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def postorderTraversal(self, root: TreeNode) -> List[int]:
if not root:
return []
res = []
stac... |
"""
python -> CSS font obfuscator
by n.bush
"""
import string
import random
def mess_maker(size=6, chars=string.ascii_uppercase + string.ascii_lowercase + string.digits):
return ''.join(random.choice(chars) for x in range(size))
def headache(text):
charlist = list(text)
obfuscated = []
class_a = mess_ma... |
import redis
from graphscale.kvetch.kvetch_utils import data_to_body, body_to_data
from uuid import uuid4
import pytest
@pytest.mark.skip
def test_redis():
redis_instance = redis.StrictRedis(host='localhost', port=6379, db=0, decode_responses=True)
redis_instance.set('foo', 'bar')
assert redis_instance.get(... |
"""TF-Slim grouped API. Please see README.md for details and usage."""
from piecewisecrf.slim import inception_model as inception
from piecewisecrf.slim import losses
from piecewisecrf.slim import ops
from piecewisecrf.slim import scopes
from piecewisecrf.slim import variables
from piecewisecrf.slim.scopes import arg_s... |
import xml.etree.cElementTree as xml
import json
class Tree ():
def __init__ (self, treePath):
self.rootName = "applications"
self.root = None
self.currentContext = None
self.contextTrail = []
self.contextPath = []
try:
self.readTreeFromDisk (treePath)
except:
print "could not read tree '" + treePa... |
"""Defines user table"""
from database_setup import Base
from sqlalchemy import Column, String, Integer
class User(Base):
''' Defines product specs table and columns '''
__tablename__ = 'user'
id = Column(Integer, primary_key=True)
name = Column(String(250), nullable=False)
email = Column(String(100... |
"""Methods and classes for storing and manipulating the global
geometry of the physical problem.
"""
import numpy as np
from pydft.base import testmode
cell = None
"""Cell: default geometry to use globally throughout the code when no other
geometry is explicitly specified.
"""
def get_cell(cell_=None):
"""Returns t... |
import fnmatch
import os
import sys
import subprocess
IGNORE_FILES = [
]
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
def execute(argv, env=os.environ):
try:
output = subprocess.check_output(argv, stderr=subprocess.STDOUT, env=env)
return output
except subprocess.CalledProcessEr... |
class Beer:
def __init__(self, abv=None, ibu=None, name=None, desc=None):
self.abv=self.sanitize(abv)
self.ibu=self.sanitize(ibu)
self.name=self.sanitize(name)
self.desc=self.sanitize(desc)
def sanitize(self, value):
return value.encode('ascii','ignore').strip() |
from markupsafe import escape
from marshmallow import post_dump
from marshmallow.fields import Boolean, Decimal, Field, Function, Integer, List, Method, Nested, String
from marshmallow_enum import EnumField
from indico.core.marshmallow import mm
from indico.modules.events.contributions.schemas import ContributionSchema... |
from datetime import datetime
import markdown
from sqlalchemy.sql.expression import asc
import prefs
from models import Post
def post_list(session, thread_id, number=prefs.POSTS_PER_PAGE, page=None, start_at=None):
return session.query(Post).filter_by(thread_id=thread_id).order_by(asc(Post.time)).limit(number).all(... |
def given_nth_value(arr, k, str_):
if not arr:
return 'No values in the array'
if k < 0 or isinstance(k, str):
return 'Incorrect value for k'
str_ = str_.lower()
if str_ not in ('min', 'max'):
return "Valid entries: 'max' or 'min'"
try:
arr = set(int(a) for a in arr)
... |
import numpy as np
import theano.tensor as T
import lasagne
from lasagne.layers.base import Layer
import math
class StandardNormalLogDensityLayer(lasagne.layers.MergeLayer):
def __init__(self, x, **kwargs):
input_lst = [x]
super(StandardNormalLogDensityLayer, self).__init__(input_lst, **kwargs)
... |
import os
import sys
import fnmatch
import shlex
import difflib
import time
from optparse import OptionParser
from yaml import load, dump
try:
from yaml import CLoader as Loader, CDumper as Dumper
except ImportError:
from yaml import Loader, Dumper
def cmdsplit(args):
if os.sep == '\\':
args = args.... |
from PJ import app
if __name__ == "__main__":
app.run(debug=True, host='0.0.0.0') |
import json
import requests
import responses
from nose.tools import (
assert_equal,
assert_is_instance,
assert_is_none,
assert_is_not_none,
assert_not_equal,
assert_raises
)
from gocardless_pro.errors import MalformedResponseError
from gocardless_pro import resources
from gocardless_pro import list_response... |
"""Tests for the :mod:`campy.datastructures.queue` module.""" |
import defaults, sys
defaults.xkbFile = sys.argv[1]
import xkb, dead_keys, codecs
from terminators import terminators
keyTemplate = """key %(QWERTYNAME)s {
label: '%(UPPERNAME)s'
base: '%(LOWERNAME)s'
shift, capslock: '%(UPPERNAME)s'
shift+capslock: '%(LOWER2NAME)s'
... |
import pytest
def pytest_addoption(parser):
parser.addoption("--config", action="store", help="cacus config") |
__author__ = 'CubexX'
import time
from sqlalchemy import BigInteger, Column, Integer
from confstat import cache
from confstat.models import Base
from main import make_db_session
class UserStat(Base):
__tablename__ = 'user_stats'
id = Column('id', Integer, primary_key=True)
uid = Column('uid', Integer)
c... |
import functions
import sklearnClassify
import random
def learnfunction(path, pathTweet, numberUsedAll, numberUnlabeled, algorithm, removeWords):
numberForTraining = int (0.8 * numberUsedAll)
numberForTesting = int (0.2 * numberUsedAll)
input_list, input_score = functions.readTestComment(path, numberUsedAll... |
import unittest
from httmock import all_requests, HTTMock
import tenthousandfeet
class TestAuth(unittest.TestCase):
def test_auth_token_header(self):
token = 'abc123'
request_headers = {}
client = tenthousandfeet.TenThousandFeet(token,
endpoint=tenthousandfeet.TES... |
__version__ = "0.1"
from argparse import ArgumentParser
from PIL import Image
DEF_WIDTH = 8
DEF_HEIGHT = 8
DEF_NAME = "font"
def main():
parser = ArgumentParser(description="Bitmap font to C converter",
epilog="Copyright (C) 2015 Juan J Martinez <jjm@usebox.net>",
... |
"""
@file multiAVratioTest.py
@author Simon Box, Craig Rafter
@date 29/01/2016
Code to run the "simpleT" SUMO model for various AVratios.
"""
import sys
import os
import subprocess
import time
sys.path.insert(0, '../sumoAPI')
import GPSControl
import sumoConnect
import readJunctionData
import traci
import numpy ... |
"""
A variety of push utility functions
"""
from pylib.util.git_util import GitUtil
__author__ = 'edelman@room77.com (Nicholas Edelman)'
__copyright__ = 'Copyright 2013 Room77, Inc.'
class PushUtil(object):
@classmethod
def get_deployspec_name(cls, cluster_name):
"""given a cluster returns the deployspec name
... |
"""
We have an array A of integers, and an array queries of queries.
For the i-th query val = queries[i][0], index = queries[i][1], we add val to A[index]. Then, the answer to the i-th query is the sum of the even values of A.
(Here, the given index = queries[i][1] is a 0-based index, and each query permanently modifi... |
from sys import argv
script, user_name = argv
prompt = '>'
print("Hi %s, I'm the %s script." % (user_name, script))
print("I'd like to ask you a few question.")
print("Do you like me %s?" % user_name)
likes = input(prompt)
print("Where do you live %s?" % user_name)
lives = input(prompt)
print("What kind of computer do ... |
from sys import argv
USAGE = '''%s <pi file> <offset> <length>'''
if __name__ == '__main__':
if len(argv) < 4:
print USAGE % argv[0]
exit(1)
offset = int(argv[2])
length = int(argv[3])
with open(argv[1]) as fd:
data = fd.read()
print data[offset : offset + length] |
import os
from collections import OrderedDict
import cPickle as pickle
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from matplotlib.cm import get_cmap
from matplotlib import style
from scipy import stats
from scipy import integrate
def plot_monthly_respon... |
import os.path
import uuid
import six
import yaml
from yamlfred.utils import (
text_representer, text_constructor,
Include, include_representer, include_constructor,
)
yaml.add_representer(six.text_type, text_representer)
yaml.add_constructor("tag:yaml.org,2002:str", text_constructor)
yaml.add_representer(Inclu... |
urban_ts = dict()
rural_ts = dict()
for i in [1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011]:
urban_ts[i] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
rural_ts[i] = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,... |
from PySide import QtCore, QtGui
import sdi_rc
class MainWindow(QtGui.QMainWindow):
sequenceNumber = 1
windowList = []
def __init__(self, fileName=None):
super(MainWindow, self).__init__()
self.init()
if fileName:
self.loadFile(fileName)
else:
self.set... |
__version__="1.0.0rc1" |
import sys
import os
import random
import traci
import sumolib
from ts_core.utils.ts_logging import setup_logging
from ts_core.optimization.optimizer_base import LightControl
import logging
logger = logging.getLogger('ts_core')
def make_d_objs() -> dict():
out = {
"trafficlight": traci.trafficlight
}
de... |
'''
Created on Dec 29, 2013
@author: ted
'''
from __future__ import division
from builtins import str
from builtins import range
from past.utils import old_div
import argparse
import random
from pulp import LpVariable, LpBinary, lpSum, value, LpProblem, LpMaximize
try:
from src.dippy import DipProblem
from src.... |
"""
Created on Thu Nov 19 06:14:32 2015
@author: testuser
"""
import scipy.cluster.vq as vq
from scipy import misc
import scipy.ndimage as nd
import numpy as np
import itertools
import sys
import time
def gencode(image, k, oldcenters=None):
t1 = time.time()
npix = image.size / 3
P = np.reshape(image, (npix, 3), o... |
from euphorie.client.browser.risk import IdentificationView
from euphorie.client.model import Risk
from euphorie.content.risk import IFrenchEvaluation as IFr
from euphorie.content.risk import IKinneyEvaluation as IKi
from euphorie.content.survey import Survey
from euphorie.testing import EuphorieIntegrationTestCase
fro... |
__author__ = 'jerry'
from unittest import TestCase
from game import Player
from game import Game
from utils.misc import compute_ts_length
class TestPlayer(TestCase):
def test_player_time_on_court(self):
player = Player.Player(399725)
game = Game.Game(1349077)
time_on_court = player.time_on_c... |
STATE_REGISTER = 1
STATE_REGISTER_CONFIRM = 2
PRIORITY_ACTIVITY_HIGHLIGHT = 1
PRIORITY_ACTIVITY_NORMAL = 2
PRIORITY_ACTIVITY_OLD = 3 |
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 field 'Submission.invert'
db.add_column('net_submission', 'invert', self.gf('django.db.models.fields.BooleanField')(default=Fa... |
from __future__ import print_function
from ImageD11.columnfile import columnfile
from ImageD11 import transform, parameters, unitcell, grain, gv_general
import numpy as np, time
from matplotlib import pylab
import numba
def k_to_g(k, cosomega, sinomega, chiwedge, out = None ):
""" Rotate k vector to g vector, e.g. ... |
import os
import shutil
import tempfile
import uuid
import ziphmm
def create_hmm(resource_name):
return ziphmm.HiddenMarkovModel.from_file(locate(resource_name))
def create_seq(resource_name):
return ziphmm.Sequence.from_file(locate(resource_name))
def create_ziphmm_directory(parent_directory):
ziphmm_direc... |
__all__ = ['Enum']
def Enum(*names):
class EnumClass(object):
__slots__ = names
def __iter__(self): return iter(constants)
def __len__(self): return len(constants)
def __getitem__(self, i): return constants[i]
def __repr__(self): return 'Enum' + str(names)
d... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('opensky', '0020_auto_20150402_0903'),
]
operations = [
migrations.RenameField(
model_name='office',
old_name='phone',
... |
import bpy
bpy.types.Scene.bf_author = "Francois Tarlier"
bpy.types.Scene.bf_category = "Grading"
bpy.types.Scene.bf_description = "All the action movies today have these colors ( transformers,iron man etc.) , it works well (as in this case) combined with glow and glare filters and edge enhanced."
Scene = bpy.context.s... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Alarm',
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False,... |
import rejit.common
import rejit.ir_compiler as ir_compiler
class VMError(rejit.common.RejitError): pass
class VMMatcher:
def __init__(self, dfa):
self._description = dfa.description
self._ir, self._variables = ir_compiler.IRCompiler().compile_to_ir(dfa,True)
self._runtime_limit = 10000
... |
"""
I-Games - Games Inteligentes Neuropedagógicos
:Author: *Instituto Tércio Pacitti (NCE/UFRJ)*
:Contact: carlo@nce.ufrj.br
:Date: $Date: 2012/06/02 $
:Status: This is a "work in progress"
:Revision: $Revision: 0.01 $
:Home: `LABASE <http://labase.nce.ufrj.br/>`__
:Copyright: ©2011, `GPL <http://is.gd/3Udt>`__.
"""
im... |
"""MountDisk is a class for mapping a user homedisk to a different logon server. As is the case with Samba connections"""
import cereconf
from Cerebrum import Utils
from Cerebrum import Errors
from Cerebrum import Constants
from Cerebrum.Disk import Host
from Cerebrum.Utils import Factory
Cerebrum = Factory.get('Databa... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('student', '0004_student_dob'),
]
operations = [
migrations.CreateModel(
name='course',
fields=[
('id', models.Aut... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.