src stringlengths 721 1.04M |
|---|
from sqlalchemy.ext.compiler import compiles
from .. import util
from .impl import DefaultImpl
from .base import alter_table, AddColumn, ColumnName, \
format_table_name, format_column_name, ColumnNullable, alter_column,\
format_server_default,ColumnDefault, format_type, ColumnType
class MSSQLImpl(DefaultImpl)... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'playlist.ui'
#
# Created by: PyQt4 UI code generator 4.12.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
... |
#!/usr/bin/env python3
# Copyright (C) 2013-2014 Florian Festi
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... |
# -*- coding: utf-8 -*-
"""
This module allows activation and deactivation
of DPMS (Display Power Management Signaling)
by clicking on 'DPMS' in the status bar.
Written and contributed by @tasse:
Andre Doser <dosera AT tf.uni-freiburg.de>
"""
from os import system
class Py3status:
def __init__(self):
... |
import sys,getopt,re
sys.path.insert(0, "/usr/lib/portage/pym")
import portage,portage_const,portage_dep
# TODO: use new names from trunk
isvalidatom = portage.isvalidatom
catpkgsplit = portage.catpkgsplit
catsplit = portage.catsplit
dep_getcpv = portage.dep_getcpv
dep_getkey = portage.dep_getkey
EXIT_SUCCESS = 0
EXI... |
# coding=utf-8
# pylint: disable-msg=E1101,W0612
import pytest
from datetime import datetime, timedelta
from numpy import nan
import numpy as np
import pandas as pd
import pandas._libs.index as _index
from pandas.core.dtypes.common import is_integer, is_scalar
from pandas import (Index, Series, DataFrame, isnull,
... |
__author__ = 'Tom Schaul, tom@idsia.ch'
from scipy import ndarray
from pybrain.rl.tasks import EpisodicTask
from pybrain.utilities import Named, drawIndex
class POMDPTask(EpisodicTask, Named):
""" Partially observable episodic MDP (with discrete actions)
Has actions that can be performed, and observations i... |
"""
urlresolver Kodi Addon
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed... |
# -*- coding: utf-8 -*-
import falcon
import falcon.testing
import json
from keyard.app import resource
from keyard.app.utils import prepare_app
class TestIntegrationKeyardResource(falcon.testing.TestBase):
def before(self):
self.resource = resource.KeyardResource()
self.api.add_route('/keyard',... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Ereshkigal is an AutoSSH tunnel monitor
# It gives a curses user interface to monitor existing SSH tunnel that are managed with autossh.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as... |
import operator
import networkx as nx
from scipy.stats import gmean
from Src.BioAnalyzer.Analysis.GenePrioritization.Steps.NetworkAnalysis.NetworkScoreAnalyzers.NetworkScoreAnalyzerBase \
import NetworkScoreAnalyzerBase
class GeneNetworkScoreAnalyzer(NetworkScoreAnalyzerBase):
def __init__(self):
pas... |
from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpResponseForbidden, HttpRequest
from django.core.exceptions import *
from django.core.urlresolvers import reverse
from django.conf import settings
import urllib
import urlparse
from smart_ui_server import utils
from smart_ui_server.ui.views import... |
# -*- coding: utf-8 -*-
__author__= "Luis C. Pérez Tato (LCPT) , Ana Ortega (AO_O) "
__copyright__= "Copyright 2016, LCPT, AO_O"
__license__= "GPL"
__version__= "3.0"
__email__= "l.pereztato@ciccp.es, ana.ortega@ciccp.es "
import os
from miscUtils import LogMessages as lmsg
from miscUtils import string_utils as su
f... |
"""Extensions to the ase Atoms class
"""
import numpy as np
from ase import Atoms
from ase.io import read, write
from ase.data import covalent_radii
from ase.calculators.neighborlist import NeighborList
class Cluster(Atoms):
"""A class for cluster structures
to enable simplified manipulation"""
def __in... |
__author__ = 'etosch'
import unittest
import BlockTests
import ConstraintTests
import SurveyTests
import surveyman.examples.SimpleSurvey as simple
import surveyman.examples.example_survey as example
import surveyman.examples.subblock_example as sub
import surveyman.jsonValidator as validator
import json
unittest.TextT... |
# String to Integer (atoi)
#
# Implement atoi to convert a string to an integer.
#
# Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases.
#
# Notes: It is intended for this problem to be specified vaguely (ie, no... |
import os
from tinydb import TinyDB
from tinydb.middlewares import CachingMiddleware
from tinydb.storages import MemoryStorage, JSONStorage
doc = {'none': [None, None], 'int': 42, 'float': 3.1415899999999999,
'list': ['LITE', 'RES_ACID', 'SUS_DEXT'],
'dict': {'hp': 13, 'sp': 5},
'bool': [True, Fa... |
import unittest
from re import error
from os.path import join, dirname, abspath
from boomer.skills.core import load_regex_from_file, load_regex, \
load_vocab_from_file, load_vocabulary
from boomer.util.log import getLogger
__author__ = 'eward'
logger = getLogger(__name__)
class MockEmitter(object):
def __in... |
# coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import filter
from pants.base.exceptions import TaskError
from pants.base.... |
#---------------------------------------------------------------------------
# Copyright 2012 The Open Source Electronic Health Record Agent
# Copyright 2017 Sam Habiel. writectrl methods.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licen... |
from core.himesis import Himesis, HimesisPreConditionPatternLHS
import uuid
class HMM1_then1_ConnectedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HMM1_then1_ConnectedLHS.
"""
#... |
import freemail
from django.core.management.base import BaseCommand
from django.core.paginator import Paginator
from django.db import transaction
from django.db.models import Q
from django.db.models.functions import Lower
from lily.accounts.models import Website, Account
from lily.contacts.models import Contact, Funct... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-25 08:58
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('candidates', '0018_auto_20160524_1224'),
]
... |
import inspect
import json
import socket
import sys
import execnet
import logging
from remoto.process import check
class BaseConnection(object):
"""
Base class for Connection objects. Provides a generic interface to execnet
for setting up the connection
"""
executable = ''
remote_import_system... |
# Software License Agreement (BSD License)
#
# Copyright (c) 2009-2014, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Redistribution and use of this software in source and binary forms, with or
# without modification, are permitted provided that the following conditions
# are met:
#
# Redistributions of source ... |
###############################################################################
# SpiralArmsPotential.py: class that implements the spiral arms potential
# from Cox and Gomez (2002)
#
# https://arxiv.org/abs/astro-ph/0207635
#
# Phi(r, phi, z) = -4*pi*G*H*rho0*exp(-(r-r0)/Rs)*sum(Cn/(Kn*Dn)... |
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# ---------------------... |
# -*- coding: utf-8 -*-
import re
import urllib.parse
from bs4 import BeautifulSoup
from pyload.core.utils.misc import eval_js
from ..anticaptchas.ReCaptcha import ReCaptcha
from ..base.simple_downloader import SimpleDownloader
class ZippyshareCom(SimpleDownloader):
__name__ = "ZippyshareCom"
__type__ = "... |
from flask_assets import Environment, Bundle
assets = Environment()
global_css = ["css/vendor/bootstrap.css", "css/global.css"]
global_js = ["js/vendor/jquery.js", "js/vendor/angular.js", "js/angular/common.js",
"js/header.js"]
def make_css(name, assets):
return Bundle(*assets, filters="cssmin", ou... |
def extractIsekaiFiction(item):
"""
'Isekai Fiction'
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if not (chp or vol or frag) or 'preview' in item['title'].lower():
return None
if 'Upstart Pastry Chef' in item['tags']:
return buildReleaseMessageWithType(item, 'Upstart Pastry C... |
#!/usr/bin/python
# -*- coding:utf-8 -*-
"""
主程序入口
@author:alex
@date:15-2-13
@time:上午11:44
@contact:alexliyu2012@gmail.com
"""
__author__ = 'alex'
import sys
import os
import ConfigParser
import uuid
from subprocess import Popen, PIPE
from utils.heartbeat import HeartBeatManager
from utils.tools import *
... |
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either... |
"""Check that instantiating a class with
`abc.ABCMeta` as metaclass fails if it defines
abstract methods.
"""
# pylint: disable=too-few-public-methods, missing-docstring
# pylint: disable=abstract-class-not-used, abstract-class-little-used
# pylint: disable=abstract-method
__revision__ = 0
import abc
class GoodClas... |
# **********************************************************************
#
# Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# ***********************************************************... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) All rights reserved:
# 2013-2014 Servicios Tecnológicos Avanzados (http://serviciosbaeza.com)
# Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
#
# This program is f... |
from zope.interface import Interface, implements
from webut.skin import iskin
from ldaptor.protocols.ldap import ldapclient, ldapsyntax
from ldaptor.protocols.ldap import distinguishedname, ldapconnector
from ldaptor.protocols import pureldap
from ldaptor import ldapfilter, interfaces
from twisted.internet import react... |
"""
Python Interchangeable Virtual Instrument Library
Copyright (c) 2012-2016 Alex Forencich
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... |
#!/usr/bin/env python
#coding=utf-8
from django.db import models
from django.contrib.auth.models import User
from django.contrib import admin
from django.utils.translation import ugettext as _T
from djangobbs.addresses.models import Person
from djangobbs.accounts.config import LOGO_FOLDER
from cPickle imp... |
#!/usr/bin/python
"""
starter code for the evaluation mini-project
start by copying your trained/tested POI identifier from
that you built in the validation mini-project
the second step toward building your POI identifier!
start by loading/formatting the data
"""
import pickle
import sys
sys.p... |
import math
import time
import random
t1 = time.time()
# A1:16
# A2:8
# A3:4
# A4:2
# A5:1
'''
def getRandom(n):
return random.randint(1,n)
def getbatch(env,l):
i = getRandom(l)-1
t = env[i]
env.pop(i)
if t == 1:
return env
if t == 2:
return env+[1]
if t == 4:
retu... |
# =================================================================
# =================================================================
"""Wrapper around ElementTree, using either the native implementation or lxml.
This module creates a wrapper around the ElementTree library, picking an
appropriate implementation for... |
#!/usr/bin/python
# Copyright 2012 OpenStack, LLC.
#
# 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 a... |
# Generated by Django 2.0 on 2018-06-23 18:27
from django.db import migrations, models
import django.db.models.deletion
import localized_fields.fields.char_field
import localized_fields.fields.text_field
import localized_fields.fields.uniqueslug_field
import localized_fields.mixins
import tk.material.fields
import tk.... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import sys
sys.path.append(os.path.abspath('src/cygnet_adapter'))
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
... |
from __future__ import absolute_import
import os
import rollbar
import logging
from celery import Celery
from celery._state import connect_on_app_finalize
from celery.signals import task_failure
from django.conf import settings
@connect_on_app_finalize
def add_unlock_chord_task_shim(app):
"""
Override nati... |
"""
Copyright 2011 Jeff Garzik
AuthServiceProxy has the following improvements over python-jsonrpc's
ServiceProxy class:
- HTTP connections persist for the life of the AuthServiceProxy object
(if server supports HTTP/1.1)
- sends protocol 'version', per JSON-RPC 1.1
- sends proper, incrementing 'id'
... |
import time
import sys
"""
Goal here is to decrypt cipher by brute force
Using bytes seemed to improve speed to a certain degree
"""
cipher =[0x5499fa99, 0x1ee7d8da, 0x5df0b78b, 0x1cb0c18c, 0x10f09fc5, 0x4bb7fdae, 0x7fcb95ac,
0xe494fbae, 0x8f5d90a3, 0xc766fdd7, 0xb7399ecc, 0xbf4af592, 0xf35c9dc2, 0x272be2... |
from __future__ import division, print_function
import logging
import numpy as np
import scipy as sc
import skimage
from skimage import transform
import theano
import theano.tensor as T
import lasagne
import sys
import cPickle as pickle
from datetime import datetime
from collections import OrderedDict
from mscoco_threa... |
# -*- coding: utf-8 -*-
"""The status view."""
import ctypes
import sys
import time
try:
import win32api
import win32console
except ImportError:
win32console = None
from dfvfs.lib import definitions as dfvfs_definitions
import plaso
from plaso.cli import tools
from plaso.cli import views
from plaso.lib impor... |
#################################################################################
## _________ ____ ________ _______ __ _____ __ __ __________ __
## / ____/ | / __ \/_ __/ / / / ___// / / / | / //_// ____/ __ \/ /
## / __/ / /| | / /_/ / / / / /_/ /\__ \/ /_/ / /| | / ,< / __/ / /_/ / /
## ... |
from decodes.core import *
import math, random
class Interval(object):
"""
an interval class
"""
def __init__(self, a=0,b=1):
""" Interval Constructor.
:param a: First number of the interval.
:type a: float
:param b: Second number of the interval.
... |
from __future__ import print_function, absolute_import
from collections import defaultdict
import types as pytypes
import weakref
import threading
import contextlib
import operator
import numba
from numba import types, errors
from numba.typeconv import Conversion, rules
from . import templates
from .typeof import typ... |
from rest_framework.decorators import detail_route
from rest_framework.response import Response
from rest_framework import status
from core.models import Identity, Group
from api.v2.serializers.details import IdentitySerializer
from api.v2.views.base import AuthViewSet
from api.v2.views.mixins import MultipleFieldLoo... |
import ckan.plugins as p
#from ckan.lib.base import BaseController, config
import ckan.lib.base as base
import ckan.lib.helpers as h
import ckan.model as model
import ckan.logic as logic
import ckan.logic.schema as schema
import ckan.new_authz as new_authz
import ckan.lib.captcha as captcha
import ckan.lib.navl.dictiza... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Canal para voxfilme
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os, sys
from core imp... |
# -*- coding: utf-8 -*-
"""
Django settings for gchiam_cc project.
For more information on this file, see
https://docs.djangoproject.com/en/dev/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/dev/ref/settings/
"""
# Build paths inside the project like this: os.p... |
import zlib
import base64
import uuid
import urllib
from datetime import datetime
from lxml import etree
from lxml.builder import ElementMaker
def create(_clock=None, _uuid=None, _zlib=None, _base64=None,
_urllib=None, **kwargs):
"""Create a URL string which can be used to redirect a samlp:AuthnReques... |
# Copyright 2016 IBM Corporation
#
# 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 require... |
#!/usr/bin/env python3
import sys
import argparse
import os
import argparse
import yaml
import json
from attrdict import AttrDict
class ConfigKWArg:
def __init__(self, name, example, type=str, default=None, required=False, short_name=None, nargs=1, help=None):
self.name = name
self.type = type
... |
# Copyright 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""A clone of the default copy.deepcopy that doesn't handle cyclic
structures or complex types except for dicts and lists. This is
because gyp copies so large structur... |
import io
import pytest
from aiobotocore import response
from botocore.exceptions import IncompleteReadError
# https://github.com/boto/botocore/blob/develop/tests/unit/test_response.py
async def assert_lines(line_iterator, expected_lines):
for expected_line in expected_lines:
line = await line_iterator._... |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2011 Piston Cloud Computing, Inc.
# Copyright 2012-2013 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache Lic... |
#
# Copyright 2015 Quantopian, Inc.
#
# 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 wr... |
#----------------------------------------------------------------------
# This file was generated by E:\Projects\github\MyTerm\icon\img2py.py
#
from wx.lib.embeddedimage import PyEmbeddedImage
icon16 = PyEmbeddedImage(
"iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAABB1J"
"REFUWIXll11v00gU... |
from Mariana.abstraction import Abstraction_ABC
__all__ = ["SingleLayerRegularizer_ABC", "L1", "L2", "ActivationL1"]
class SingleLayerRegularizer_ABC(Abstraction_ABC) :
"""An abstract regularization to be applied to a layer."""
def apply(self, layer) :
"""Apply to a layer and update networks's log"""
hyps = {}... |
"""
WRITEME
"""
import inspect
import os
import StringIO
import theano
from theano.sandbox.cuda import CudaNdarrayType
from theano.gof import local_optimizer
from theano.sandbox.cuda.opt import register_opt
from theano.sandbox.cuda import gpu_from_host, host_from_gpu
from .unshared_conv import FilterActs
from .unshar... |
from typing import (
TYPE_CHECKING,
AbstractSet,
Any,
Dict,
Hashable,
Iterable,
List,
Mapping,
NamedTuple,
Optional,
Sequence,
Set,
Tuple,
Union,
)
import pandas as pd
from . import dtypes, pdcompat
from .alignment import deep_align
from .utils import Frozen, di... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Utility functions"""
import warnings
import scipy.ndimage
import scipy.sparse
import numpy as np
import numba
from numpy.lib.stride_tricks import as_strided
from .._cache import cache
from .exceptions import ParameterError
# Constrain STFT block sizes to 256 KB
MAX_M... |
# -*- coding: utf-8 -*-
#
# 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
#... |
# This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (a... |
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2015 Ensky Lin <enskylin@gmail.com>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU A... |
#!/usr/bin/env python3
# Copyright (c) 2018 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert... |
"""
rohmu - object_storage.base
Copyright (c) 2016 Ohmu Ltd
See LICENSE for details
"""
from ..errors import StorageError
import logging
class BaseTransfer:
def __init__(self, prefix):
self.log = logging.getLogger(self.__class__.__name__)
if not prefix:
prefix = ""
elif prefix... |
import logging
import math
import re
from itertools import zip_longest
import bitstring
from django.conf import settings
from django.contrib.staticfiles.templatetags.staticfiles import static
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.core.validators imp... |
import pytest
def test_file_upgrade(upgrader, file_1):
value = upgrader.upgrade('file', file_1, target_version='2')
assert value['schema_version'] == '2'
assert value['status'] == 'current'
def test_file_upgrade2(root, upgrader, file_2, file, threadlocals, dummy_request):
context = root.get_by_uuid(... |
# Copyright 2018 The TensorFlow Authors. 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 applica... |
#!/usr/bin/env python
"""@See preprocessed data
"""
from numpy import*
import matplotlib.pyplot as plt
from GestureModel import*
from Creator import*
from Classifier import*
def plotResults(gr_points,gr_sig, b_points,b_sig,name_model):
from scipy import linalg
import matplotlib.pyplot as plt
gr_points ... |
# flake8: noqa
# -*- coding: utf-8 -*-
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 'NewsEntry.image_width'
db.add_column(u'multilingual_news_newsentry', 'image_w... |
import urllib
import config
import requests
import loggers
from requests.exceptions import ConnectionError
class Request(object):
_api_key = None
_raw_file = False
# We are only going to work with JSON here, deal with it B)
_headers = {'Accept': 'application/json', 'Content-Type': 'application/json'}
... |
# Copyright 2017 - , Dr.-Ing. Patrick Siegl
# SPDX-License-Identifier: BSD-2-Clause
#!/usr/bin/python
import subprocess
import sys
import operator
import multiprocessing
import re
kernel = "seismic-rtm.elf"
def bench( kernel, iterations, variants ):
res = {}
g_cmd = "./%s --timesteps=4000 --width=2000 --height=... |
from decimal import Decimal
from django.db import models
from django.conf import settings
from django.utils import timezone
# Create your models here.
from game.contrib.calculate import calculate_score
from game.control.models import Control
class Plot(models.Model):
plot = models.URLField()
answer = models... |
# Script to sniff whether DR2 has appeared and grab everything once it appears
import os
import time
from datetime import datetime, timedelta
import pytz
import subprocess
import hashlib
_DR2_URL= 'http://cdn.gea.esac.esa.int/Gaia/gdr2/'
_MD5_FILENAME= 'MD5SUM.txt'
_CEST= pytz.timezone('Europe/Brussels')
_TIME_START_... |
import mock
from mock import patch, call
from freezegun import freeze_time
from datetime import datetime
from django.test import TestCase
from tests.fixtures import contact_object
from modules.text_reminder import TextReminder
from jobs import text_reminder_job
FAKE_NOW = datetime(2017, 7, 17, 0, 0)
class TextRemind... |
"""Pushover platform for notify component."""
import logging
import voluptuous as vol
from homeassistant.const import CONF_API_KEY
import homeassistant.helpers.config_validation as cv
from homeassistant.components.notify import (
ATTR_DATA, ATTR_TARGET, ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA,
BaseNo... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Renaming field 'Notice.user'
db.rename_column('notification_notice', 'user_id', 'recipient_id')
#... |
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'Stock'
db.create_table('orders_stock', (
('id... |
"""
helper class for creating decision responses
"""
class Layer1Decisions:
"""
Use this object to build a list of decisions for a decision response.
Each method call will add append a new decision. Retrieve the list
of decisions from the _data attribute.
"""
def __init__(self):
self.... |
# -*- coding: utf-8 -*-
#
# Mako documentation build configuration file
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented ... |
''' This application was developed for gathering financial data
from the Bittrex API with the purpose of storing it locally, and to be
easily accessed by different analysis tools including Excel, and Python, or
any software that can deal with CSV files. '''
__title__ = 'Bittrex Data Collector'
__author__ = 'Jacob Wee... |
from __future__ import division
from itertools import count
from math import sqrt
from functools import wraps
import bisect
import uuid
from hashlib import md5
from toolz import merge, partial, first, partition
from operator import getitem, setitem
from datetime import datetime
import pandas as pd
import numpy as np
i... |
from django.conf import settings
from django.conf.urls import patterns, url, include
from . import app_settings
from . import registry
from .views import (map_screenshot, history_delete,
serve_attachment, JSSettings, Convert)
if app_settings['ACTION_HISTORY_ENABLED']:
from .models import LogEnt... |
#!/usr/bin/env python
import pprint
from operator import itemgetter
from socket import inet_aton
from struct import unpack
from urllib import urlopen
pp = pprint.PrettyPrinter(indent=4, width=50)
iplist = {}
#fetch remote datacenter list and convert to searchable datastructure
external_list = 'https://raw.github.com/... |
#!/usr/bin/env python
import base64
import os
from avocado import Test
from avocado import main
class WhiteBoard(Test):
"""
Simple test that saves test custom data to the test whiteboard
:param whiteboard_data_file: File to be used as source for whiteboard data
:param whiteboard_data_size: Size of... |
# Eve W-Space
# Copyright (C) 2013 Andrew Austin and other contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option... |
from basic_game.descriptors import Descriptor
from basic_game.directions import directions
from basic_game.language import list_prefix, normalize_input, get_noun, prepositions
from basic_game.objects import Container
from basic_game.writer import DEBUG, ConsoleWriter
from basic_game.verbs import BaseVerb
class BasicGa... |
from datetime import datetime, date
from caspy.domain import models as domain
from caspy import models as db
from caspy import django_orm as orm
import pytest
class TestGetField:
def test_foreign(self):
class X:
pass
o = X()
assert orm.get_field(o) is o
assert orm.get_f... |
# Copyright (c) 2017 David Sorokin <david.sorokin@gmail.com>
#
# Licensed under BSD3. See the LICENSE.txt file in the root of this distribution.
class InvalidExprException(Exception):
"""Raised when the expression is invalid."""
def __init__(self, message):
"""Initializes a new instance."""
se... |
from pilkit.lib import Image, ImageDraw
from pilkit.processors import (Resize, ResizeToFill, ResizeToFit, SmartCrop,
SmartResize)
from nose.tools import eq_, assert_true
from pilkit.processors.resize import Thumbnail
from .utils import create_image
import mock
def test_smartcrop():
... |
# -*- coding: utf-8 -*-
from __future__ import print_function, division
from scipy.optimize import (
minimize,
Bounds,
# LinearConstraint,
NonlinearConstraint,
# BFGS,
SR1,
)
import numpy as np
from time import time
class SciPyEndPoseSolver(object):
"""
Uses SciPy to solve a constrain... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.