content stringlengths 4 20k |
|---|
import discord
from discord.ext import commands
from __main__ import send_cmd_help
class Doujin:
"""Doujin commands."""
def __init__(self, bot):
self.bot = bot
self.session = self.bot.http.session
@commands.group(pass_context=True)
async def doujin(self, ctx):
"""Doujin commands"""
... |
import re
from django import forms
from django.db.models import get_model, Q
from django.utils.translation import ugettext_lazy as _
Product = get_model('catalogue', 'Product')
Range = get_model('offer', 'Range')
class RangeForm(forms.ModelForm):
class Meta:
model = Range
exclude = ('included_p... |
{
'name': 'Help Documentation',
'version': '8.0.1.0.0',
'category': 'Knowledge Management',
'sequence': 14,
'summary': '',
'description': """
""",
'author': 'ADHOC SA',
'website': 'www.adhoc.com.ar',
'images': [
],
'depends': [
'document_page_extension',
],
... |
import bpy
from mathutils import Vector
w = 1 # weight
coos = [
{
"point": [
-0.6314261555671692,
-0.3624125123023987,
-4.673041398284283e-10
],
"lh": {
"co": [
-0.3986741602420807,
-1.1438326835632324,
-6.253572104597538e-10
],
"... |
"""
WSGI config for migweb 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... |
# coding=utf-8
"""
Test AI Django models.
"""
import copy
import ddt
from django.test import TestCase
from django.test.utils import override_settings
from openassessment.test_utils import CacheResetTest
from openassessment.assessment.models import (
AIClassifierSet, AIClassifier, AIGradingWorkflow, AI_CLASSIFIER_S... |
from oslo.db import exception as db_exc
from sqlalchemy.orm import exc
import neutron.db.api as db
from neutron.openstack.common import excutils
from neutron.openstack.common import log as logging
from neutron.plugins.vmware.dbexts import models
from neutron.plugins.vmware.dbexts import networkgw_db
LOG = logging.get... |
#v.0.1.0
import os, time, sys, random, xbmc
from ..common.url import URL
from ..common.fileops import readFile, writeFile, deleteFile, checkPath
if sys.version_info >= (2, 7):
import json as _json
else:
import simplejson as _json
try:
import fanarttv_info as settings
except ImportError:
clowncar = ''
t... |
"""Sheets for statements about relations between process content/comments."""
from colander import drop
from colander import OneOf
from adhocracy_core.interfaces import IPredicateSheet
from adhocracy_core.interfaces import ISheet
from adhocracy_core.interfaces import ISheetReferenceAutoUpdateMarker
from adhocracy_core... |
VERSION = "v0.02 2006-09-22"
import sys
import os
import struct
import getopt
import random
import tempfile
# Parameters
MAXMIFFILESIZE = 1024 * 1024 # Arbitrary maximum size of MIF file
tempdir = None
dumpcounter = 0
def mkdtemp(template):
'''
Create a unique temporary directory.
tempfile.m... |
from django.test import TestCase
from old.controller.servicios import tfg_services
from model.models import Profesor
################### PROPUESTA ########################
#Usar como username que es unico el email de la ugr
class TfgServicesTests(TestCase):
def setUp(self):
self.prof1_username = '<... |
"""An interface for publishing rich data to frontends.
There are two components of the display system:
* Display formatters, which take a Python object and compute the
representation of the object in various formats (text, HTML, SVG, etc.).
* The display publisher that is used to send the representation data to the... |
"""Unit tests for `biggus._init._ArrayAdapter`."""
import unittest
from biggus._init import _ArrayAdapter
class Test___init__(unittest.TestCase):
def test_concrete(self):
class FakeConcrete(object):
shape = ()
class FakeAdapter(_ArrayAdapter):
def _apply_keys(self):
... |
import os
import sys
import json
import logging
import numpy as np
logging.basicConfig(level=logging.INFO)
from robo.fmin import entropy_search
from hpolib.benchmarks.ml.svm_benchmark import SvmOnMnist, SvmOnVehicle, SvmOnCovertype, SvmOnAdult, SvmOnHiggs, SvmOnLetter
from hpolib.benchmarks.ml.residual_networks impo... |
import clientConfig as cConf
import Pyro4
from mmp_tracer_api import objID
from comsol_api import MMPComsolDummy
from mupif import PyroUtil, Property, PropertyID, FieldID, ValueType
import logging
logger = logging.getLogger()
import time as timeTime
start = timeTime.time()
logger.info('Timer started')
# locate namese... |
"""
Scrape the schedule for accepted talks.
Produces a JSON file suitable for passing as a --data argument to email-authors.
I use this to to send a preview of when their talks are scheduled (see
email-templates/check-schedule-template.txt).
"""
import argparse
import dateutil.parser
import json
import lxml.html
impo... |
import re
import urllib
import random
from htmlentitydefs import name2codepoint
from BeautifulSoup import BeautifulSoup
from browser import Browser, BrowserError
class GSError(Exception):
""" Google Sets Error """
pass
class GSParseError(Exception):
"""
Parse error in Google Sets result... |
# -*- coding: utf-8 -*-
"""
amqp.five
~~~~~~~~~~~
Compatibility implementations of features
only available in newer Python versions.
"""
from __future__ import absolute_import
__all__ = ['Counter', 'reload', 'UserList', 'UserDict',
'Queue', 'Empty', 'Full', 'LifoQueue', 'builtins',
... |
#!/usr/bin/env python
"""
ldap.controls.readentry - classes for the Read Entry controls
(see RFC 4527)
See http://www.python-ldap.org/ for project details.
$Id: readentry.py,v 1.4 2011/07/28 08:57:12 stroeder Exp $
"""
import ldap
from pyasn1.codec.ber import encoder,decoder
from ldap.controls import LDAPControl,KN... |
import ldap
import logging
from ldap.filter import filter_format
import openerp.exceptions
from openerp import tools
from openerp.osv import fields, osv
from openerp import SUPERUSER_ID
from openerp.modules.registry import RegistryManager
_logger = logging.getLogger(__name__)
class CompanyLDAP(osv.osv):
_name = '... |
from __future__ import unicode_literals
import webnotes
from webnotes import _
@webnotes.whitelist()
def runserverobj():
"""
Run server objects
"""
import webnotes.model.code
from webnotes.model.bean import Bean
from webnotes.utils import cint
wrapper = None
method = webnotes.form_dict.get('method')
arg = w... |
"""
WSGI config for recipe 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... |
# encoding: 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 'StaffMember.facebook'
db.add_column('staff_staffmember', 'facebook', self.gf('django.db.mo... |
# coding=utf-8
"""
The JCollectdCollector is capable of receiving Collectd network traffic
as sent by the JCollectd jvm agent (and child Collectd processes).
Reason for developing this collector is allowing to use JCollectd, without
the need for Collectd.
A few notes:
This collector starts a UDP server to receive d... |
"""
APIs for configuring credit eligibility requirements and tracking
whether a user has satisfied those requirements.
"""
import logging
from openedx.core.djangoapps.credit.exceptions import InvalidCreditRequirements, InvalidCreditCourse
from openedx.core.djangoapps.credit.models import (
CreditCourse,
Credi... |
from __future__ import division, absolute_import, print_function
from numpy.testing import (dec, assert_, assert_raises, run_module_suite,
SkipTest, KnownFailureException)
import nose
def test_slow():
@dec.slow
def slow_func(x, y, z):
pass
assert_(slow_func.slow)
def t... |
from ginga.tkw import ImageViewTk
from ginga.aggw.ImageViewCanvasTypesAgg import *
class ImageViewCanvasError(ImageViewTk.ImageViewTkError):
pass
class ImageViewCanvas(ImageViewTk.ImageViewZoom,
DrawingMixin, CanvasMixin, CompoundMixin):
def __init__(self, logger=None, rgbmap=None,... |
import base64
import gzip
import io
import os
import six
from cloudbaseinit import exception
from cloudbaseinit.openstack.common import log as logging
from cloudbaseinit.plugins.common.userdataplugins.cloudconfigplugins import (
base
)
DEFAULT_PERMISSIONS = 0o644
BASE64_MIME = 'application/base64'
GZIP_MIME = '... |
from openerp.osv import fields,osv
from openerp import tools
AVAILABLE_PRIORITIES = [
('0', 'Low'),
('1', 'Normal'),
('2', 'High')
]
class crm_claim_report(osv.osv):
""" CRM Claim Report"""
_name = "crm.claim.report"
_auto = False
_description = "CRM Claim Report"
_columns = {
... |
'''
GCE external inventory script
=================================
Generates inventory that Ansible can understand by making API requests
Google Compute Engine via the libcloud library. Full install/configuration
instructions for the gce* modules can be found in the comments of
ansible/test/gce_tests.py.
When run a... |
#!/usr/bin/env python
import os
import re
import time
import select
import subprocess
import sys
from requests.exceptions import ConnectionError
sys.path.insert(0, '/srv/newsblur')
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import fabfile
NEWSBLUR_USERNAME = 'sclay'
IGNORE_HOSTS = [
'push',
]
def main(ro... |
"""
sentry.db.models.manager
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
import six
import threading
import weakref
from django.conf import ... |
def _is_package_installed(module, name, locallib, cpanm):
cmd = ""
if locallib:
os.environ["PERL5LIB"] = "%s/lib/perl5" % locallib
cmd = "%s perl -M%s -e '1'" % (cmd, name)
res, stdout, stderr = module.run_command(cmd, check_rc=False)
if res == 0:
return True
else:
return F... |
import unittest
from pulsar import send, new_event_loop, get_application
from pulsar.apps.test import dont_run_with_thread
from .manage import server, Echo, EchoUdpServerProtocol
class TestEchoUdpServerThread(unittest.TestCase):
concurrency = 'thread'
server_cfg = None
@classmethod
def setUpClass(c... |
#!/usr/bin/env python
"""
This is MIDAS' lightweight ORM
"""
import sqlite3
from helpers.utilities import to_ascii
class TyORM():
"""
This is Tripyarn's lightweight ORM class
"""
def __init__(self, filename):
self.conn = sqlite3.connect(filename)
self.cursor = self.conn.cursor()
... |
import optparse
import sys
import matplotlib
matplotlib.use('Agg')
from pylab import *
# Class that parses a file and plots several graphs
class Plotter:
def __init__(self):
pass
def parse(self,filename):
""" Parse the data file and accumulate values for plots.
"""
# Initiali... |
import wx
class StaticTextFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, 'Static Text Example', size=(400, 300))
panel = wx.Panel(self, -1)
wx.StaticText(panel, -1, "This is an example of static text", (100, 100))
rev = wx.StaticText(panel, -1, "Static Text W... |
"""Stub file for ClusterResolver to maintain backwards compatibility."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# This file (and all files in this directory in general) is a backwards
# compatibility shim that exists to re-export ClusterResolvers s... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import time
import threading
import RPi.GPIO as GPIO
DEBUG_MODE = False
SW_PIN = 20
#
E_EDGE_BIT = 0x01
R_EDGE_BIT = 0x02
F_EDGE_BIT = 0x04
#
L_PRESS_BIT = 0x01
L_PRESS_CNT_MAX = 30
#
POLLING_INT = 0.05
class Switch():
def __init__(self, PIN):
# Set GPIO pin inp... |
from com.ibm.staf import STAFUtil
import base64
def getRequest(dict):
requestTmp = ' '
for k, v in dict.items():
if v != '' and v != 'false' and k != 'machine' and k != 'START':
if v == 'true':
requestTmp += ' ' + str(k) + ' ';
else:
requestTmp += ' ' + str(k) + ' ' + str(v);
return requestTmp;
de... |
from __future__ import print_function
import tensorflow as tf
from keras.datasets import cifar10
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Dropout, Activation, Convolution2D, GlobalAveragePooling2D, merge
from keras.utils import np_utils
from k... |
"""
Common functionalities for AMT Driver
"""
import time
from xml.etree import ElementTree
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import importutils
import six
from ironic.common import boot_devices
from ironic.common import exception... |
"""BO chromaticity correction configuration.
Values in _template_dict are arbitrary. They are used just to compare with
corresponding values when a new configuration is tried to be inserted in the
servconf database.
"""
from copy import deepcopy as _dcopy
def get_dict():
"""Return configuration type dictionary."... |
# -*- coding:utf-8 -*-
from __future__ import absolute_import
import gettext
import os
from os import path
import unittest
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase, TestCase
from django.test.utils import override_settings
from django.util... |
"""The JuiceNet integration."""
import asyncio
from datetime import timedelta
import logging
import aiohttp
from pyjuicenet import Api, TokenError
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import CONF_ACCESS_TOKEN
from homeassistant.core impo... |
"""Pubsub tests."""
import time
import unittest
import six
from google_cloud_utils import pubsub
from tests.test_libs import helpers
from tests.test_libs import test_utils
ACK_DEADLINE = 3
# Additional amount of time to sleep to let ack deadline elapse.
ACK_DEADLINE_WINDOW = 1
PROJECT_NAME = 'fake-project'
@test... |
"""
Test functions for sm.rlm
"""
import numpy as np
from numpy.testing import assert_almost_equal, assert_allclose
from scipy import stats
import statsmodels.api as sm
from statsmodels.robust.robust_linear_model import RLM
from nose import SkipTest
DECIMAL_4 = 4
DECIMAL_3 = 3
DECIMAL_2 = 2
DECIMAL_1 = 1
class Check... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainwindow.ui'
#
# by: PyQt5 UI code generator 5.0.1-snapshot-2a99e59669ee
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWind... |
from i3pystatus.core.command import run_through_shell
from i3pystatus.updates import Backend
class Yay(Backend):
"""
This module counts the available updates using yay.
By default it will only count aur packages. Thus it can be used with the
pacman backend like this:
.. code-block:: python
... |
import json
import requests
from zone import Zone
from hotwater import HotWater
from base import EvohomeBase, EvohomeClientInvalidPostData
class ControlSystem(EvohomeBase):
def __init__(self, client, location, gateway, data=None):
super(ControlSystem, self).__init__()
self.client = client
... |
# coding=utf-8
"""
Behave BDD runner.
See _bdd_utils#get_path_by_env for information how to pass list of features here.
Each feature could be file, folder with feature files or folder with "features" subfolder
Other args are tag expressionsin format (--tags=.. --tags=..).
See https://pythonhosted.org/behave/behave.htm... |
from __future__ import with_statement
from bisect import bisect_left
import operator
import os
import java.lang.Character
# this is intended as a stopgap measure; at the very least it should
# be refactored so that we can avoid its slow startup time
# requires java 6 for `normalize` function
# XXX - change so we bind... |
from __future__ import absolute_import, unicode_literals
import json
from django.core.urlresolvers import reverse
from django.forms import widgets
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
fro... |
"""Tests for decode_image."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import numpy as np
from tensorflow.python.framework import errors_impl
from tensorflow.python.ops import image_ops
from tensorflow.python.ops import io_ops
import... |
import sys
import unittest
import os
import glob
import geopm_context
import geopmpy.io
import geopmpy.error
import geopmpy.topo
import util
import geopm_test_launcher
import check_trace
class TestIntegration_trace(unittest.TestCase):
@classmethod
def setUpClass(cls):
sys.stdout.write('(' + os.path.b... |
from . import AWSObject, AWSProperty, Tags
from .compat import policytypes
from .validators import integer, boolean
VALID_TARGET_TYPES = ('AWS::RDS::DBInstance', 'AWS::RDS::DBCluster',
'AWS::Redshift::Cluster', 'AWS::DocDB::DBInstance',
'AWS::DocDB::DBCluster')
def validat... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test runner that will limit the output of tests to a result set relevant for a
particular diff in Git. That is a diff between revisions or a diff between two
branches' tips.
This test runner will work with both Python 2.7 as well as 3.x.
"""
## Created: 23 May 2015 Gu... |
"""
PageObjects related to the AcidBlock
"""
from bok_choy.page_object import PageObject
from bok_choy.promise import Promise
from .utils import wait_for_xblock_initialization
class AcidView(PageObject):
"""
A :class:`.PageObject` representing the rendered view of the :class:`.AcidBlock`.
"""
url = N... |
#!/usr/bin/env python3
import re
import struct
import sys
import numpy as np
import matplotlib.pyplot as plt
import EbbUtils as eu
import PlotUtils as pu
def tryint(s):
try:
return int(s)
except:
return s
def alphanum_key(s):
""" Turn a string into a list of string and number chunks.
... |
#!/usr/bin/env python
'''
read a DTI streamline model and class them into fiber bundles
according to vertex color, the basic prerequisite is that:
all vertice in a streamline are assigned with constant color
Copyright Chapstudio 2010-2011
Haipeng Cai @ May 8, 2011
'''
import os
import sys
import string
import re
# ... |
"""Interactive debugging with PDB, the Python Debugger."""
import argparse
import functools
import sys
import types
from typing import Any
from typing import Callable
from typing import Generator
from typing import List
from typing import Optional
from typing import Tuple
from typing import Type
from typing import TYPE... |
from webkitpy.layout_tests.models import test_expectations
from webkitpy.common.net import layouttestresults
TestExpectations = test_expectations.TestExpectations
TestExpectationParser = test_expectations.TestExpectationParser
class BuildBotPrinter(object):
# This output is parsed by buildbots and must only be... |
# -*- coding: utf-8 -*-
from flask import request
from marshmallow import Schema, fields
from marshmallow.compat import text_type as _text_type
from webargs.flaskparser import FlaskParser, abort as _abort
import warnings
FIELD_MAPPING = {
# type, [use_function] (preprocessing)
fields.Integer: (int, None),
... |
class TimingRecord(object):
def __init__(self, tid, timestamp, value):
self._tid = tid
self._timestamp = timestamp
self._value = value
def serialize(self):
return {
"tid": self._tid,
"timestamp": self._timestamp,
"value": self._value
... |
#!/usr/bin/python3
import socket
import os
import stopwords.stopstrip as stopstrip
print("Setting up....\n\n\n")
ircsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#This is the name of the server and channel we’ll be connecting to. We could hard code these, but having a variable makes a couple of steps easier... |
from flask import g
def read_letter_freq():
letterfreq = g.get("letterfreq", None)
if letterfreq:
return letterfreq
else:
letterfreq = {}
with open("res/letterfreq.txt") as f:
lines = f.readlines()
for line in lines:
letter, freq = line.split("... |
from django.contrib import admin
from geonode.services.models import Service
from geonode.base.admin import ResourceBaseAdminForm
class ServiceAdminForm(ResourceBaseAdminForm):
class Meta:
model = Service
fields = '__all__'
class ServiceAdmin(admin.ModelAdmin):
list_display = ('id', 'name'... |
from nab.detectors.base import AnomalyDetector
from nab.detectors.context_ose.cad_ose import ContextualAnomalyDetectorOSE
class ContextOSEDetector(AnomalyDetector):
"""
This detector uses Contextual Anomaly Detector - Open Source Edition
2016, Mikhail Smirnov <EMAIL>
https://github.com/smirmik/CAD
"""
... |
# -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('maps', '24_initial'),
]
operations = [
migrations.AlterField(
model_name='map',
name='abstract_en',
field=models.TextField(help... |
import sys
import os
import math
from hashlib import sha256 as SHA256
# convert a large integer to a big-endian bitstring
def encode_mpi(n):
if n >= 256:
return encode_mpi(n / 256) + chr(n % 256)
else:
return chr(n)
# convert a large integer to a big-endian bitstring, padded with \x00s to
# a... |
# -*- coding: utf-8 -*-
from openerp import models, fields, api, _
from openerp.tools.safe_eval import safe_eval as eval
from openerp.exceptions import UserError
class AccountInvoiceRefund(models.TransientModel):
"""Refunds invoice"""
_name = "account.invoice.refund"
_description = "Invoice Refund"
... |
'''
Created on Jul 2, 2015
@author: hijungshin
'''
from moviepy.editor import *
import sys
import moviepy.video.fx.all as vfx
from video import Video
import numpy as np
import util
if __name__ == "__main__":
input1 = sys.argv[1]
input2 = sys.argv[2]
output = sys.argv[3]
myvideo1 = V... |
from django.template import defaultfilters as filters
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from horizon import tables
from openstack_dashboard import api
class RegisterIdPLink(tables.LinkAction):
name = "register"
verbose_name = _("Regis... |
from django.forms import MultipleChoiceField, ValidationError
from django.test import SimpleTestCase
class MultipleChoiceFieldTest(SimpleTestCase):
def test_multiplechoicefield_1(self):
f = MultipleChoiceField(choices=[('1', 'One'), ('2', 'Two')])
with self.assertRaisesMessage(ValidationError, "'... |
from sympy.vector.basisdependent import BasisDependent, \
BasisDependentAdd, BasisDependentMul, BasisDependentZero
from sympy.core import S, Pow
from sympy.core.expr import AtomicExpr
from sympy.core.assumptions import StdFactKB
from sympy import ImmutableMatrix as Matrix
from sympy.core.compatibility import u
imp... |
from gnuradio import gr, gr_unittest
import analog_swig as analog
class test_simple_squelch(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_block()
def tearDown(self):
self.tb = None
def test_simple_squelch_001(self):
# Test set/gets
alpha = 0.0001
... |
from PyQt5 import QtCore, QtGui
import util
from config import Settings
FormClass, BaseClass = util.THEME.loadUiType("client/login.ui")
class LoginWidget(FormClass, BaseClass):
finished = QtCore.pyqtSignal(str, str)
request_quit = QtCore.pyqtSignal()
remember = QtCore.pyqtSignal(bool)
def __init__(... |
'''Example WordCountTopology'''
import sys
import heronpy.api.api_constants as constants
from heronpy.api.topology import TopologyBuilder
from heronpy.api.stream import Grouping
from examples.src.python.spout import WordSpout
from examples.src.python.bolt import CountBolt
# Topology is defined using a topology builde... |
import unittest
import sys
import os
import subprocess
import shutil
from copy import copy
from test.support import (run_unittest, TESTFN, unlink,
captured_stdout, skip_unless_symlink)
import sysconfig
from sysconfig import (get_paths, get_platform, get_config_vars,
ge... |
"""Testsuite for TokenRewriteStream class."""
# don't care about docstrings
# pylint: disable-msg=C0111
import unittest
import antlr3
import testbase
class T1(testbase.ANTLRTest):
def setUp(self):
self.compileGrammar()
def _parse(self, input):
cStream = antlr3.StringStream(input)
le... |
from django.test.client import RequestFactory
from onadata.apps.main.tests.test_base import TestBase
from onadata.libs.utils.viewer_tools import (
export_def_from_filename,
generate_enketo_form_defaults,
get_client_ip)
class TestViewerTools(TestBase):
def test_export_def_from_filename(self):
... |
import pytest
from openshift_checks.package_version import PackageVersion
from openshift_checks import OpenShiftCheckException
def task_vars_for(openshift_release, deployment_type):
service_type_dict = {'origin': 'origin',
'openshift-enterprise': 'atomic-openshift'}
service_type = se... |
from invenio.bibdocfile import BibRecDocs
def get_filenames(recid):
"""
Returns names of the files associated with specific record
and their derivatives. Takes as a parameter the recid of a
record.
Example:
input: recID 999 (record with files ['thesis.ps.gz', 'random.pdf']... |
from nose.tools import eq_
from django.core.urlresolvers import reverse
from mkt.api.tests.test_oauth import RestOAuth
from mkt.constants.features import APP_FEATURES, FeatureProfile
class TestConfig(RestOAuth):
def setUp(self):
super(TestConfig, self).setUp()
self.url = reverse('api-features-f... |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Title(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "heatmap.colorbar"
_path_str = "heatmap.colorbar.title"
_valid_props = {"font", "side", "text"... |
from asp.codegen.ast_tools import *
from tinycu_sm import *
import asp.codegen.python_ast as python_ast
import asp.codegen.cpp_ast as cpp_ast
import asp.verify as verify
class CppLambda(cpp_ast.FunctionBody):
def __init__(self, capture, rettype, args):
self.rettype = rettype
self.args = args
... |
import numpy
from numpy import *
from scipy import *
from fit_toolbox import fit, functions
from data_processing_toolbox import movingaverage as mva
from qt import plot
def find_initial_values_lorentzian(x_data,y_data,moving_average = 2, plot_res = False):
'''
finds the initial values for a lorentzian dip or ... |
"""Script to download sdk/extras packages on the bots from google storage.
The script expects arguments that specify zips file in the google storage
bucket named: <dir in SDK extras>_<package name>_<version>.zip. The file will
be extracted in the android_tools/sdk/extras directory on the test bots. This
script will no... |
import os
import warnings
try:
import unittest2 as unittest
except ImportError:
import unittest # noqa
from cassandra import ConsistencyLevel
from cassandra.cqlengine import connection
from cassandra.cqlengine.management import create_keyspace_simple, CQLENG_ALLOW_SCHEMA_MANAGEMENT
import cassandra
from test... |
#!/usr/bin/env python
import xwiimote
import select
import errno
def print_wiimotes(wiimotes):
print "+--------------------------------------------+"
print "| %-40s %i |" % (xwiimote.iface.get_name(xwiimote.IFACE_CORE), len(wiimotes['all']))
print "+--------------------------------------------+"
for d... |
import sys
import os
import threading
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
from AlarmPlugin import IMonitorPlugin
import pyudev
class MonitorUSB(IMonitorPlugin):
def run(self):
self.AlarmRaised = False
self.isActive = False
context = pyudev.Context()
monitor = pyud... |
from sympy import (symbols, Symbol, product, factorial, rf, sqrt, cos,
Function, Product, Rational, Sum, oo, exp, log, S)
from sympy.utilities.pytest import raises
from sympy import simplify
a, k, n, m, x = symbols('a,k,n,m,x', integer=True)
f = Function('f')
def test_karr_convention():
# Test ... |
# -*- coding: utf-8 -*-
'''
Local settings
- Run in Debug mode
- Use console backend for emails
- Add Django Debug Toolbar
- Add django-extensions as app
'''
from .common import * # noqa
# DEBUG
# ------------------------------------------------------------------------------
DEBUG = env.bool('DJANGO_DEBUG', default... |
# Wrapper for loading templates from eggs via pkg_resources.resource_string.
from __future__ import unicode_literals
import warnings
from django.apps import apps
from django.template.base import Origin, TemplateDoesNotExist
from django.utils import six
from django.utils.deprecation import RemovedInDjango21Warning
fr... |
from bottle import PluginError, request, response, HTTPResponse, BottleException
import inspect
from biicode.common.utils.bson_encoding import encode_bson, decode_bson
from bson.errors import InvalidBSON
from biicode.common.utils.bii_logging import logger
from biicode.server.conf import BII_MAX_MEMORY_PER_REQUEST
cla... |
import os.path
import re
import urllib.parse
import shutil
import yaml
from jasy.core.Util import executeCommand
import jasy.core.Console as Console
def getRevision(path=None):
"""Returns the last revision/hash of the svn."""
return executeCommand("svnversion", "Could not figure out SVN revision. Is there a... |
#!/usr/bin/env python
##########
#
# Create a wordcloud with the option to use a mask. If a mask is
# provided, the option to use colors from the mask is provided
#
# text can either be local .txt file or twitter screen name
# specified with text=@screen_name
#
# i.e. python tweetcloud.py text=alice.txt [stopwords=s... |
import argparse
import os
import pprint
import sys
from twisted.internet import defer, task
@defer.inlineCallbacks
def _txmain(reactor, url):
from yarrharr.fetch import MaybeUpdated, poll_feed
from yarrharr.tests.test_fetch import FetchFeed
f = FetchFeed(url=url)
result = yield poll_feed(f)
ppri... |
# -*- coding: utf-8 -*-
""" Sahana Eden Staff Module Automated Tests
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to de... |
"""The Dexcom integration."""
import asyncio
from datetime import timedelta
import logging
from pydexcom import AccountError, Dexcom, SessionError
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_UNIT_OF_MEASUREMENT, CONF_USERNAME
from homeassistant.core import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.