code stringlengths 1 199k |
|---|
import unittest
import prass
import common
class TestFpsParsing(unittest.TestCase):
def test_number(self):
self.assertEqual(23.976, prass.parse_fps_string("23.976"))
self.assertEqual(24, prass.parse_fps_string("24"))
def test_division(self):
self.assertAlmostEqual(23.976, prass.parse_fps... |
from validr import T
from . import case
@case({
T.bool: [
(True, True),
('True', True),
('true', True),
('TRUE', True),
('Yes', True),
('YES', True),
('yes', True),
('ON', True),
('on', True),
('Y', True),
('y', True),
(... |
import contextlib
import hou
from ..vendor import six
def children_as_string(node):
return [c.name() for c in node.children()]
def imprint(node, data):
"""Store attributes with value on a node
Depending on the type of attribute it creates the correct parameter
template. Houdini uses a template per type,... |
"""
Implementation of Smiles2Vec and ChemCeption models as part of the ChemNet
transfer learning protocol.
"""
__author__ = "Vignesh Ram Somnath"
__license__ = "MIT"
import numpy as np
import tensorflow as tf
from typing import Dict
from deepchem.data.datasets import pad_batch
from deepchem.models import KerasModel
fro... |
import sys
import re
import time as sleeper
import operator
from datetime import date, datetime, time
from threading import Thread, Event
from hydeengine import url
from hydeengine.file_system import File, Folder
class SiteResource(object):
def __init__(self, a_file, node):
super(SiteResource, self).__init_... |
import threading
from qrl.core.Singleton import Singleton
from pyqryptonight import pyqryptonight
class Qryptonight(object, metaclass=Singleton):
def __init__(self):
self.lock = threading.Lock()
self._qn = pyqryptonight.Qryptonight()
def hash(self, blob):
with self.lock:
retu... |
import pytest
from flexget.api.app import base_message
from flexget.components.seen.db import SeenEntry
from flexget.components.series.api import ObjectsContainer as OC
from flexget.components.series.db import (
AlternateNames,
Episode,
EpisodeRelease,
Season,
SeasonRelease,
Series,
SeriesTa... |
import urllib
from collections import OrderedDict
from itertools import starmap
from mock import Mock
from model_mommy import mommy
from django.test import TestCase
from django.utils.timezone import now
from getpaid.backends.webpay import PaymentProcessor
import getpaid
class PaymentProcessorTestCase(TestCase):
REQ... |
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0009_auto_20180207_1426'),
('results', '0014_scenarioresult_sign_failed'),
]
operations = [
migrations.CreateModel(
name=... |
import unittest
import mock
from hpOneView.connection import connection
from hpOneView.resources.settings.firmware_bundles import FirmwareBundles
from hpOneView.resources.resource import ResourceClient
class FirmwareBundlesTest(unittest.TestCase):
def setUp(self):
self.host = '127.0.0.1'
self.connec... |
from . import main
from flask import render_template, redirect, flash, url_for, request
from flask_login import login_required, current_user, logout_user, login_user
from .forms import LoginForm, EditForm
from app.models import User, NewsPost, OriginsPost, IntersPost
from app import db
"""登录"""
@main.route('/login/', m... |
"""For uploading files to a remove server via FTP"""
from __future__ import with_statement
import os
import sys
import ftplib
import cPickle
import time
import syslog
class FtpUpload(object):
"""Uploads a directory and all its descendants to a remote server.
Keeps track of when a file was last uploaded, so it i... |
from django.conf.urls import patterns, include, url
from django.contrib import admin
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls)),
url(r'^dummy/', 'dummy.views.index', name="dummy"),
) |
from __future__ import unicode_literals
class Messages(object):
M001 = ("Download successful but linking failed")
M002 = ("Creating a shortcut link for 'en' didn't work (maybe you "
"don't have admin permissions?), but you can still load the "
"model via its full package name: nlp = spac... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/lair/structure/interior/shared_lair_cave_giant_interior_graul.iff"
result.attribute_template_id = -1
result.stfName("lair_n","cave_giant_interior_graul")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ###... |
import unittest
import numpy
from chainer import testing
from chainer import utils
def _setup_tensor(_min, _max, shape, dtype, threshold=None):
y = numpy.random.uniform(_min, _max, shape).astype(dtype)
if threshold is not None:
y[y < threshold] = 0
return y
@testing.parameterize(*testing.product({
... |
verification = balanced.BankAccountVerification.find('/verifications/BZ2Sy2Z4Bp2mARnCLztiu2VG')
verification.confirm(amount_1=1, amount_2=1) |
import cgi, cgitb
import serial
import sys
import time
from time import time,sleep
import re
import json
form = cgi.FieldStorage() # instantiate only once!
puerto = form.getvalue('puerto')
velocidad = form.getvalue('velocidad')
databit = form.getvalue('databit')
if (databit == "5"):
databit = serial.FIVEBITS
if (datab... |
import os
from utils import parse_file, get_file_content
from nose import with_setup
test_files = {
'test1.txt': "some junk\nref test2.txt",
'test2.txt': "some other junk",
'test3.txt': "some junk\nsome other junk",
'test4.txt': "junk\nref test1.txt\nref test2.txt",
'test5.txt': "junk\nsome junk\nso... |
from pyx import text
from pyx.graph.axis import tick
class _Itexter:
def labels(self, ticks):
"""fill the label attribute of ticks
- ticks is a list of instances of tick
- for each element of ticks the value of the attribute label is set to
a string appropriate to the attributes nu... |
import logging
from logging import Logger
from typing import Optional
import sqlalchemy
from sqlalchemy import (
Table,
Column,
Integer,
String,
DateTime,
Index,
and_,
desc,
MetaData,
)
from sqlalchemy.engine import Engine
from sqlalchemy.sql.sqltypes import Boolean
from slack_sdk.oa... |
'''
Processing of Doxygen generated XML.
'''
import os
import os.path
import sys
import time
import string
import getopt
import glob
import re
import xml.dom.minidom
def usage():
print '''
Usage:
%s options
Options:
--xmldir Directory with the Doxygen xml result files.
--output Write the o... |
"""
swat-s1 plc1.py
"""
from minicps.devices import PLC
from utils import PLC1_DATA, STATE, PLC1_PROTOCOL
from utils import PLC_PERIOD_SEC, PLC_SAMPLES
from utils import IP, LIT_101_M, LIT_301_M, FIT_201_THRESH
import time
PLC1_ADDR = IP['plc1']
PLC2_ADDR = IP['plc2']
PLC3_ADDR = IP['plc3']
FIT101 = ('FIT101', 1)
MV101... |
from multiprocessing import Pool
def f(x):
return x*3
p = Pool(processes=5)
print p.apply_async(f, (3,)) |
'''
we can solve this in many ways
1. store address of nodes in hash map. if visited node already in hash then it's loop
2. use two pointers, fst pointer incremented by 1 and second pointer incremented 2,
check both pointers pointing same node then it's loop
3. change node data structure add visited field
'''
class Nod... |
from nltk import ngrams
def ngrams_tokenizer(tweet, n=1):
return [' '.join(tupl) for tupl in list(ngrams(tweet.split(), n))]
def tokenize_tweets(labeled_tweets, n=1):
return [(ngrams_tokenizer(tweet, n), category) for (tweet, category) in labeled_tweets] |
from __future__ import absolute_import, unicode_literals
from gaebusiness.gaeutil import SaveCommand, ModelSearchCommand
from gaeforms.ndb.form import ModelForm
from gaegraph.business_base import UpdateNode
from autoajuda_app.model import Autoajuda
class AutoajudaPublicForm(ModelForm):
"""
Form used to show pro... |
class Stack:
"""
A simple implementation of a stack.
"""
def __init__(self):
"""
Initializes an empty stack.
"""
self._first = None
self.length = 0
class Node:
"""
A single element of the linked list.
"""
def __init__(self, valu... |
import os
import pandas as pd
from ..core.status import Status
from ..core.turbine import PowerCurve
np = pd.np
def chckMake(path):
"""Make a folder if it doesn't exist"""
if not os.path.exists(path):
os.makedirs(path)
def _is_save_path_valid(full_path):
if ((os.name == 'nt') and (len(full_path)>=26... |
try:
import unittest2 as unittest
except ImportError:
import unittest
from rope.refactor import similarfinder
from ropetest import testutils
class SimilarFinderTest(unittest.TestCase):
def setUp(self):
super(SimilarFinderTest, self).setUp()
self.project = testutils.sample_project()
s... |
import unittest
import os
import sys
sys.path.append('..')
from rdm.db import DBConnection, DBContext, OrangeConverter, RSDConverter, AlephConverter, TreeLikerConverter
from rdm.wrappers import Wordification, RSD, Aleph, TreeLiker
from tests.conf import TEST_DB, TEST_DB_POSTGRES, RESULTS_FOLDER
class TestWrappers(unitt... |
import os.path
from distutils.core import setup
README = open(os.path.join(os.path.dirname(__file__), "README.rst")).read()
CLASSIFIERS = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT Lice... |
from swgpy.object import *
def create(kernel):
result = Installation()
result.template = "object/installation/faction_perk/turret/shared_dish_lg.iff"
result.attribute_template_id = -1
result.stfName("turret_n","dish_large")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return result |
from __future__ import absolute_import
import numpy as np
import matplotlib.pyplot as plt
from .. import utils
from ..config import DEFAULT_POPULATION_COLORS
class NeuroVis(object):
'''This class is used to visualize firing activity of single neurons.
This class implements several conveniences for visualizing f... |
""" The Packer class, used to pack and unpack Nescient containers, as well as packer-specific exceptions. """
import os
import hmac # Generating authentication tags with SHA-2 # TODO: Re-implement this in Cython
from contextlib import ExitStack
from hashlib import pbkdf2_hmac # PBKDF2 Key derivation # TODO: Re-implem... |
from __future__ import print_function
from numpy import *
import math
import os
"""
NAME
paint_lens_qso
PURPOSE
to get the complete properties of lens and qso, given redshifts, velocity dispersion, i band magnitude of qso.
INITIALISATION
change the inputs at the beginning: z_om10_g (... |
__version__ = '$Id$'
from pywikibot import family
class Family(family.WikimediaFamily):
def __init__(self):
super(Family, self).__init__()
self.name = 'incubator'
self.langs = {
'incubator': 'incubator.wikimedia.org',
}
def ssl_pathprefix(self, code):
return "... |
class Config_struct(object):
def __init__(self, struct_name="Base Config Structure"):
self.name = struct_name
def register_config_setting(self, setting, configuration):
setattr(self, setting, configuration)
def register_opt_config_settings(self, opts):
self.opt = Config_struct("optio... |
print( -97989513389222316022151446562729620153292831887555425160965597396
^ 23716683549865351578586448630079789776107310103486834795830390982)
print( -53817081128841898634258263553430908085326601592682411889506742059
^ 37042558948907407488299113387826240429667200950043601129661240876)
print( -2616751204258737... |
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 pr... |
from __future__ import unicode_literals
import copy
import json
import os
from django.utils.unittest import TestCase
from wirecloud.commons.utils.template.parsers import TemplateParser
from wirecloud.commons.utils.template.writers.json import write_json_description
from wirecloud.commons.utils.template.writers.rdf impo... |
'''
A sample of usage of IPDB generic callbacks
'''
from pyroute2 import IPDB
def cb(ipdb, msg, action):
if action == 'RTM_NEWLINK' and \
msg.get_attr('IFLA_IFNAME', '').startswith('bala_port'):
# get corresponding interface -- in the case of
# post-callbacks it is created already
... |
import logging
log = logging.getLogger(".fontstyle")
FONT_SANS_SERIF = 0
FONT_SERIF = 1
FONT_MONOSPACE = 2
class FontStyle(object):
"""
Defines a font style. Controls the font face, size, color, and
attributes. In order to remain generic, the only font faces available
are FONT_SERIF and FONT_SANS_... |
from prospector.formatters.base import Formatter
__all__ = (
'TextFormatter',
)
class TextFormatter(Formatter):
summary_labels = (
('started', 'Started'),
('completed', 'Finished'),
('time_taken', 'Time Taken', lambda x: '%s seconds' % x),
('formatter', 'Formatter'),
('pr... |
from urbansim.abstract_variables.abstract_travel_time_variable_for_non_interaction_dataset import abstract_travel_time_variable_for_non_interaction_dataset
class travel_time_hbw_am_drive_alone_from_home_to_work(abstract_travel_time_variable_for_non_interaction_dataset):
"""Travel time frome home zone to work zone.
... |
"""Cern Analysis Preservation utils for CADI database."""
import json
from itertools import islice
import requests
from elasticsearch_dsl import Q
from flask import current_app, abort
from invenio_db import db
from invenio_search import RecordsSearch
from cap.modules.deposit.api import CAPDeposit
from cap.modules.depos... |
import logging
from celery.result import AsyncResult
from django.http import HttpResponse
from pulp.server.async.tasks import TaskResult
from pulp.server.compat import json, json_util, http_responses
from pulp.server.exceptions import OperationPostponed
from pulp.server.webservices import serialization
_LOG = logging.g... |
from camelot.admin.validator.entity_validator import EntityValidator
from camelot.admin.entity_admin import EntityAdmin
class PersonValidator(EntityValidator):
def objectValidity(self, entity_instance):
messages = super(PersonValidator,self).objectValidity(entity_instance)
if (not entity_instance.fi... |
from pathlib import Path
import re
from ..base import AppiObject, constant
from ..util import extract_bash_file_vars
from .repository import Repository
__all__ = [
'Profile',
]
class Profile(AppiObject):
"""A portage profile.
Currently, this only allows to retrieve the system make.conf. By "system",
it ... |
from setuptools import find_packages, setup
from smartanthill_phc import (__author__, __description__, __email__,
__license__, __title__, __url__, __version__)
setup(
name=__title__,
version=__version__,
description=__description__,
long_description=open("README.rst").read()... |
"""
FindConnections
"""
import unittest
import nest
@nest.check_stack
class FindConnectionsTestCase(unittest.TestCase):
"""Find connections and test if values can be set."""
def test_FindConnections(self):
"""FindConnections"""
nest.ResetKernel()
a = nest.Create("iaf_neuron", 3)
... |
import sys
from xml.dom import minidom
def main(argv):
x = minidom.parse(open(argv[0]))
y = x.childNodes[0]
l = []
for z in y.childNodes:
if z.nodeType != z.TEXT_NODE:
l.append((z.childNodes[1].childNodes[0].attributes.items()[0][1], z.childNodes[1].childNodes[0].childNodes[0].data))... |
import pytest
from cfme import test_requirements
from cfme.utils.wait import wait_for
pytestmark = [
test_requirements.configuration
]
@pytest.mark.tier(3)
def test_send_test_email(smtp_test, random_string, appliance):
""" This test checks whether the mail sent for testing really arrives.
Polarion:
... |
import os
tests_dir = os.path.dirname(os.path.abspath(__file__))
lib_dir = os.path.abspath(os.path.join(tests_dir, '../..'))
def run_ctest(executable):
import subprocess
environ = {}
environ.update(os.environ)
ld_library_path = environ.get('LD_LIBRARY_PATH', '')
ld_library_path += ':%s' % lib_dir
... |
import bpy
from bpy.props import BoolProperty, FloatProperty
from bpy.props import CollectionProperty
from bpy.props import IntProperty
def float3_update(self, context):
if not hasattr(context, "material") or not context.material:
return
mat = context.material
nodes = mat.node_tree.nodes
if self... |
from django.conf import settings
MAP_GOOGLE_MAPS_API_KEY = getattr(settings, 'GOOGLE_MAPS_API_KEY', 'ABQIAAAANRcMfC_cyoA3QdUOo_Hu5hTQAu85EtnTZTzCCgC_HtAMXZ3pxBTahN958SX-8H5LbiYHW6TGxvNEwg') |
__doc__="""ProductMap
ProductMap finds various software packages installed on a device.
$Id: ProductMap.py,v 1.7 2010/10/14 19:44:47 egor Exp $"""
__version__ = '$Revision: 1.7 $'[11:-2]
from ZenPacks.community.WMIDataSource.WMIPlugin import WMIPlugin
from Products.DataCollector.plugins.DataMaps import MultiArgs
class ... |
from .mbcharsetprober import MultiByteCharSetProber
from .codingstatemachine import CodingStateMachine
from .chardistribution import GB2312DistributionAnalysis
from .mbcssm import GB2312SMModel
class GB2312Prober(MultiByteCharSetProber):
def __init__(self):
MultiByteCharSetProber.__init__(self)
self... |
from django.conf.urls.defaults import *
from store.models import *
from sitemaps import *
from django.contrib.sitemaps import FlatPageSitemap
from django.contrib import admin
admin.autodiscover()
sitemaps = {
'products': ProductSitemap,
'creators': CreatorSitemap,
}
urlpatterns = patterns('',
... |
"""Usage:
redact-bulk [-nqd] PATH
redact-bulk [-nqd] [--dry-run] [--output=FILE] [--fill-with=BYTE] PATH
redact-bulk -h | --help
redact-bulk -v | --version
This program redacts features from a disk image, based on annotated Bulk Extractor reports
produced by BitCurator. Can redact based on a single feature file... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import copy
import os
import json
import tempfile
from yaml import YAMLError
from ansible.errors import AnsibleFileNotFound, AnsibleParserError
from ansible.errors.yaml_strings import YAML_SYNTAX_ERROR
from ansible.module_utils.basi... |
import os
from collections import namedtuple
from monitor import Monitor
FileInfo = namedtuple(
'FileInfo',
[
'size', # file size
'mode', # file access mode
'user_id', # user id
'group_id', # group id
'time_modify', # time of last modification
'type', # file type, constant fr... |
from ui_channel.camera_status import CameraStatus
from dashboard.models import Process, Job
from clients import get_exposure_monitoring
from astropy.time import Time
import io
import os
import json
import logging
from log import get_logger
import datetime
import time
desi_spectro_redux = os.environ.get('DESI_SPECTRO_RE... |
import os
import socket
import hashlib
VERSION = '0.2 beta'
LHOST = '0.0.0.0'
UPLINK = 4090
DOWNLINK = 4091
PROJECTFOLDER = '/var/projects'
def sha256sum(target):
sha256 = hashlib.sha256()
with open(target, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
sha256.update(chunk)
re... |
import unittest
import os
from ariba import megares_data_finder
modules_dir = os.path.dirname(os.path.abspath(megares_data_finder.__file__))
data_dir = os.path.join(modules_dir, 'tests', 'data')
class TestMegaresDataFinder(unittest.TestCase):
def test_zips_from_index_page_string(self):
'''test _zips_from_in... |
from __future__ import absolute_import
from __future__ import print_function
import os
import shutil
import tempfile
import time
from optparse import OptionGroup, SUPPRESS_HELP
from ConfigParser import SafeConfigParser
import dns.resolver
from ipaserver.install import certs, installutils, bindinstance, dsinstance
from ... |
import os
import logging
from slugify import slugify
from datetime import datetime
logger = logging.getLogger(__name__)
ABSTRACT_TEMPLATE_MODEL_DATE_LATLON = "Image shot by {model} on {date} at {lat}, {lon} (latitude, longitude)"
ABSTRACT_TEMPLATE_MODEL_DATE = "Image shot by {model} on {date}"
ABSTRACT_TEMPLATE_MODEL =... |
from __future__ import print_function, unicode_literals
import os
import sys
from preupg.xml_manager import html_escape
from preupg.utils import FileHelper, ModuleSetUtils
from preupg import settings
from preupg.xmlgen import xml_tags
from preupg.xmlgen.script_utils import ModuleHelper
from preupg.exception import Empt... |
import logging
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _, ungettext
from mss.lib.xmlrpc import XmlRpc
xmlrpc = XmlRpc()
logger = logging.getLogger(__name__)
class Steps:
PREINST = "preinst"
DOWNLOAD = "download"
MEDIAS_AUTH = "medias_auth"
MEDIAS_ADD... |
from __future__ import unicode_literals
from django.contrib.gis.db import models
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from locations... |
import dbus
from volti.defs import *
class Notification:
""" Desktop notifications """
def __init__(self, main_instance):
""" Constructor """
self.main = main_instance
bus = dbus.SessionBus()
obj = bus.get_object('org.freedesktop.Notifications',
'/org/freedesktop/... |
from django.conf.urls import url, include
from .views import WebookView
urlpatterns = [
url(r"^(?P<name>[\w-]+)$", WebookView.as_view()),
url(r"^(?P<name>[\w-]+)/$", WebookView.as_view()),
url(r"^$", WebookView.as_view()),
] |
import sys
from os.path import abspath, dirname, join
from subprocess import check_call
from releaser import make_release, update_feedstock, short, no, chdir, set_config, insert_step_func, yes
from releaser.make_release import steps_funcs as make_release_steps
from releaser.update_feedstock import steps_funcs as update... |
from fontaine.namelist import codepointsInNamelist
class Charset:
common_name = u'Google Fonts: Greek Core'
native_name = u''
abbreviation = 'GREK'
def glyphs(self):
glyphs = codepointsInNamelist("charsets/internals/google_glyphsets/Greek/GF-greek-core.nam")
return glyphs |
"""This module contains an object that represents a Telegram InlineQuery"""
from telegram import TelegramObject, User, Location
class InlineQuery(TelegramObject):
"""This object represents a Telegram InlineQuery.
Note:
* In Python `from` is a reserved word, use `from_user` instead.
Attributes:
... |
import bpy
from bpy.props import EnumProperty, FloatProperty
from sverchok.node_tree import SverchCustomTreeNode
from sverchok.data_structure import (zip_long_repeat, enum_item_4, updateNode)
from sverchok.utils.pulga_physics_modular_core import SvAlignForce
from sverchok.dependencies import scipy, Cython
class SvPulga... |
"""
Test that lldb watchpoint works for multiple threads.
"""
import os, time
import unittest2
import re
import lldb
from lldbtest import *
import lldbutil
class WatchpointForMultipleThreadsTestCase(TestBase):
mydir = os.path.join("functionalities", "watchpoint", "multiple_threads")
@unittest2.skipUnless(sys.pl... |
"""Merge master-chromium to master within the Android tree."""
import logging
import optparse
import os
import re
import shutil
import subprocess
import sys
import merge_common
AUTOGEN_MESSAGE = 'This commit was generated by merge_to_master.py.'
WEBVIEW_PROJECT = 'frameworks/webview'
def _GetAbsPath(project):
"""Retu... |
from stetl.util import Util, etree
from stetl.filter import Filter
from stetl.packet import FORMAT
log = Util.get_log("xmlvalidator")
class XmlSchemaValidator(Filter):
"""
Validates an etree doc and prints result to log.
consumes=FORMAT.etree_doc, produces=FORMAT.etree_doc
"""
# Constructor
def ... |
"""
Functions for network matched-filter detection of seismic data.
Designed to cross-correlate templates generated by template_gen function
with data and output the detections.
:copyright:
EQcorrscan developers.
:license:
GNU Lesser General Public License, Version 3
(https://www.gnu.org/copyleft/lesser.htm... |
from collections import Mapping
from urlparse import urlparse
from mo_dots import wrap, Data
_value2json = None
_json2value = None
_Log = None
def _late_import():
global _value2json
global _json2value
global _Log
from mo_json import value2json as _value2json
from mo_json import json2value as _json2v... |
import sys, os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'django_browserid.tests.settings'
from django_browserid import __version__
extensions = ['sphinx.ext.autodoc']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'd... |
from django.test import TestCase
from django.core.management.base import CommandError
from mock import patch
from pgreport.management.commands import progress_report as pr
from xmodule.exceptions import NotFoundError
class ProgressReportCommandTestCase(TestCase):
"""For unit test."""
def setUp(self):
se... |
from update import update
from zika_upload import zika_upload
from update import parser
class zika_update(update, zika_upload):
def __init__(self, **kwargs):
update.__init__(self, **kwargs)
zika_upload.__init__(self, **kwargs)
if __name__=="__main__":
args = parser.parse_args()
connVDB = zik... |
import json
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from poster.encode import multipart_encode, MultipartParam
from twisted.internet import defer
from test.support.integration.soledad_test_base import SoledadTestBase
class Re... |
"""
Tests for group REST management.
"""
from django.core.urlresolvers import reverse
from rest_framework.test import APITestCase
from core.models import Group
from core.tests.utils import set_users
from rest.tests.utils import set_clients
LIST_URL = reverse('group-list')
class Group_GET_list_Test(APITestCase):
"""... |
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):
# Changing field 'WebSite.name'
db.alter_column(u'core_website', 'name', self.gf('django.db.models.f... |
import os
from django.conf.urls import patterns, include, url
from django.conf import settings
from django.contrib import admin
from firestarter import paypal
admin.autodiscover()
urlpatterns = patterns('firestarter.views',
# Examples:
url(r'^$', 'home', name='home'),
url(r'^questions/$', 'questions', name=... |
from __future__ import unicode_literals
_ = lambda s: s # noqa: force translations
TRANSLATIONS = (
_('French region'),
_('French intermunicipal (EPCI)'),
_('French county'),
_('French district'),
_('French town'),
_('French canton'),
_('Iris (Insee districts)'),
_('Country'),
_('Wo... |
import logging
import functools
from privacyidea.lib.error import TokenAdminError
from privacyidea.lib.error import ParameterError
from privacyidea.lib import _
log = logging.getLogger(__name__)
def check_token_locked(func):
"""
Decorator to check if a token is locked or not.
The decorator is to be used in ... |
from binascii import b2a_hex
import httpserver
import json
import logging
import networkserver
import socket
from time import time
import traceback
import config
WithinLongpoll = httpserver.AsyncRequest
class _SentJSONError(BaseException):
def __init__(self, rv):
self.rv = rv
class JSONRPCHandler(httpserver.HTTPHand... |
"""
Account constants
"""
NAME_MIN_LENGTH = 2
NAME_MAX_LENGTH = 255
USERNAME_MIN_LENGTH = 2
USERNAME_MAX_LENGTH = 30
EMAIL_MIN_LENGTH = 3
EMAIL_MAX_LENGTH = 254
PASSWORD_MIN_LENGTH = 2
PASSWORD_MAX_LENGTH = 75
PINCODE_MIN_LENGTH=6
PINCODE_MAX_LENGTH=6
CITY_MIN_LENGTH=3
AADHAR_MIN_LENGTH=12
AADHAR_MAX_LENGTH=12
ACCOUNT_... |
from newspipe.bootstrap import db
class Icon(db.Model):
url = db.Column(db.String(), primary_key=True)
content = db.Column(db.String(), default=None)
mimetype = db.Column(db.String(), default="application/image") |
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):
# Changing field 'BaseItem.duplicate_of'
db.alter_column(u'core_baseitem', 'duplicate_of_id', self.g... |
import hr_document
import report
import wizard |
from . import models
from . import controllers |
import frappe
import unittest
test_records = frappe.get_test_records('Weekly Salary Slip')
class TestWeeklySalarySlip(unittest.TestCase):
pass |
from __future__ import absolute_import, print_function, unicode_literals, division
import serpy
from datetime import datetime
from jormungandr.interfaces.v1.serializer.base import PbField, PbNestedSerializer, NestedPbField
from jormungandr.interfaces.v1.serializer.jsonschema.fields import Field, TimeType, DateTimeType
... |
""" ModelMiscView.py
This file ...
"""
from django.views.generic import TemplateView
from django import __version__
if int(__version__.split('.')[0]) < 2:
from django.core.urlresolvers import reverse
else:
from django.urls import reverse
from signetsim.views.HasWorkingModel import HasWorkingModel
from signetsim.view... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.