content stringlengths 4 20k |
|---|
#Note: code gotten from _pydev_imports_tipper.
import sys
def _imp(name, log=None):
try:
return __import__(name)
except:
if '.' in name:
sub = name[0:name.rfind('.')]
if log is not None:
log.AddContent('Unable to import', name, 'trying with'... |
# pylint: skip-file
# -*- coding: utf-8 -*-
# Module: NetflixHttpSubRessourceHandler
# Created on: 07.03.2017
class NetflixHttpSubRessourceHandler(object):
"""
Represents the callable internal server routes &
translates/executes them to requests for Netflix
"""
def __init__(self, nx_common, netfl... |
import logging
from webkitpy.tool.comments import bug_comment_from_commit_text
from webkitpy.tool.steps.abstractstep import AbstractStep
from webkitpy.tool.steps.options import Options
_log = logging.getLogger(__name__)
class CloseBugForLandDiff(AbstractStep):
@classmethod
def options(cls):
return A... |
import time
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from django.test import LiveServerTestCase
from tests.test_utils import ECDTestCase
class FunctionalTestCase(ECDTestCase, LiveServerTestCase):
"""
Class which provides functional testing capabilities. It subclasses ... |
"""Interfaces with TotalConnect alarm control panels."""
import logging
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME,
STATE_ALARM_ARMED_NIGHT,
STATE_ALARM_DISARMED,
STATE_ALARM_ARMING,
STATE_ALARM_D... |
import time
from openerp.report import report_sxw
class ir_module_reference_print(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(ir_module_reference_print, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'time': time,
'fin... |
import serial
import struct
import time
_SAMPLE_RATE = 250.0 # Hz
_START_BYTE = bytes(0xA0) # start of data packet
_END_BYTE = bytes(0xC0) # end of data packet
_ADS1299_Vref = 4.5 # reference voltage for ADC in ADS1299. Set by its hardware
_ADS1299_gain = 24.0 # assumed gain for ADS1299. Set by its Arduino code
... |
from __future__ import division, absolute_import, print_function
from numpy.distutils.ccompiler import simple_version_match
from numpy.distutils.fcompiler import FCompiler
compilers = ['SunFCompiler']
class SunFCompiler(FCompiler):
compiler_type = 'sun'
description = 'Sun or Forte Fortran 95 Compiler'
#... |
from rml2txt import parseString, parseNode
#.apidoc title: RML to TXT engine
""" This engine is the minimalistic renderer of RML documents into text files,
using spaces and newlines to format.
It was needed in some special applications, where legal reports need to be
printed in special (dot-matrix) print... |
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse
from django.test import TestCase
from misago.users.tokens import make_password_change_token
class ForgottenPasswordViewsTests(TestCase):
def test_request_view_returns_200(self):
"""request new password view return... |
import inspect
import time
import uuid
from oslo_utils import timeutils
from six import moves
from novadocker.virt.docker import client as docker_client
class MockClient(object):
def __init__(self, endpoint=None):
self._containers = {}
self.name = None
# Fake repository
self._re... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""Unit tests for helpers.py."""
from __future__ import unicode_literals
import unittest
from collections import OrderedDict
from batchupload.helpers import (
flip_name,
flip_names,
get_all_template_entries,
cleanString,
output_block_template
)
class Tes... |
import os
from . import CoreSettings
class Base18Settings(CoreSettings):
# Application definition
INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.co... |
from __future__ import division, absolute_import, print_function
import sys
from numpy.core import arange
from numpy.testing import (
run_module_suite, assert_, assert_equal, dec
)
from numpy.lib import deprecate
import numpy.lib.utils as utils
if sys.version_info[0] >= 3:
from io import StringIO
else:
... |
from django.conf.urls import include, patterns, url
from django.views.decorators.csrf import csrf_exempt
from django.shortcuts import redirect
from reviews.urls import review_patterns
from stats.urls import stats_patterns
from . import views
ADDON_ID = r"""(?P<addon_id>[^/<>"']+)"""
# These will all start with /add... |
"""Support for Genius Hub water_heater devices."""
from typing import List
from homeassistant.components.water_heater import (
SUPPORT_OPERATION_MODE,
SUPPORT_TARGET_TEMPERATURE,
WaterHeaterDevice,
)
from homeassistant.const import STATE_OFF
from homeassistant.helpers.typing import ConfigType, HomeAssistan... |
import logging
from contextlib import contextmanager
from io import StringIO
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.core import mail
from django.core.files.temp import NamedTemporaryFile
from django.core.management import color
from django.db import connection... |
import sys
import cStringIO
from lxml import etree
import copy
from openerp.report.render.rml2pdf import utils
class _flowable(object):
def __init__(self, template, doc, localcontext = None):
self._tags = {
'title': self._tag_title,
'spacer': self._tag_spacer,
'para': s... |
class ModuleDocFragment(object):
# Cisco Intersight doc fragment
DOCUMENTATION = '''
options:
api_private_key:
description:
- 'Filename (absolute path) of a PEM formatted file that contains your private key to be used for Intersight API authentication.'
type: path
required: yes
api_uri:
... |
## Definitions helpful in frozen environments (eg py2exe)
import os, sys, zipfile
def listdir(path):
"""Replacement for os.listdir that works in frozen environments."""
if not hasattr(sys, 'frozen'):
return os.listdir(path)
(zipPath, archivePath) = splitZip(path)
if archivePath is None:
... |
import os
from collections import Counter, OrderedDict
from django.apps import apps
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils import lru_cache
from django.utils._os import upath
from django.utils.functional import cached_property
from django.utils.module... |
"""
Configures acls for various users/groups so they can access the cobbler command
line as non-root. Now that CLI is largely remoted (XMLRPC) this is largely just
useful for not having to log in (access to shared-secret) file but also grants
access to hand-edit various config files and other useful things.
Copyright... |
from __future__ import division, absolute_import, print_function
import sys
import numpy as np
from numpy.compat import sixu
from numpy.testing import (
run_module_suite, assert_, assert_equal, assert_array_equal,
assert_raises
)
# Switch between new behaviour when NPY_RELAXED_STRIDES_CHECKING is set.
NPY_... |
class CodeParser:
def __init__(self, req_pattern='// REQ:', test_pattern='@Test', method_pattern='public void '):
self.req_test_mapping = dict()
self.req_pattern = req_pattern
self.test_pattern = test_pattern
self.method_pattern = method_pattern
def get_requirements_and_test_cas... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# http://www.ianlewis.org/en/parsing-email-attachments-python
from email.Header import decode_header
import email
from base64 import b64decode
import sys
from email.Parser import Parser as EmailParser
from email.utils import parseaddr
# cStringIO
from io import StringIO
... |
import unittest
import env
import vmaccess
import os
from Utils.WAAgentUtil import waagent
waagent.LoggerInit('/tmp/test.log','/dev/null')
class TestIPhablesRule(unittest.TestCase):
def test_insert_rule_if_not_exists(self):
rule = 'INPUT -p tcp -m tcp --dport 9998 -j DROP'
vmaccess._insert_rule_if... |
from webiopi.decorators.rest import request, response, api # Modified
from webiopi.utils.types import M_JSON
class GPIOPort():
IN = 0
OUT = 1
LOW = False
HIGH = True
def __init__(self, channelCount):
self.digitalChannelCount = channelCount
def checkDigitalChannel(se... |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 26 11:41:37 2016
@author: ChristnachJeanClaude
"""
import sys
# import logging
# from autologging import traced, TRACE
# @traced
class SegmentGenerator:
def __init__(self, filename):
try:
fh = open(filename)
except IOE... |
"""
(c) 2011, 2012 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see
http://wiki.quantsoftware.org/index.php?title=QSTK_License
for license details.
This package includes code for representing and learning HMM's.
Most of the code in this package was derived from the... |
import glob
import os
import sys
import textwrap
from setuptools import setup, find_packages
here = os.path.split(__file__)[0]
PACKAGE_NAME = 'wptrunner'
PACKAGE_VERSION = '1.14'
# Dependencies
with open(os.path.join(here, "requirements.txt")) as f:
deps = f.read().splitlines()
# Browser-specific requirements
... |
# -*- 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 'WMSSource.display_name'
db.add_column('lizard_wms_wmssource', 'display_name',
... |
"""Validate requirements."""
from collections import deque
import json
import operator
import os
import re
import subprocess
import sys
from typing import Dict, Set
from stdlib_list import stdlib_list
from tqdm import tqdm
from homeassistant.const import REQUIRED_PYTHON_VER
import homeassistant.util.package as pkg_ut... |
import os
import shutil
from i3pystatus.core.color import ColorRangeModule
from i3pystatus.core.util import make_vertical_bar, make_bar
from .pulse import *
from i3pystatus import Module
import subprocess
class PulseAudio(Module, ColorRangeModule):
"""
Shows volume of default PulseAudio sink (output).
-... |
import pymetar
WEATHERCODE_FILE = 'settings/weather.txt'
def handler_weather_weather(type, source, parameters):
if not parameters:
reply(type, source, u'hmmmm?')
return
try:
rf=pymetar.ReportFetcher(parameters.strip())
fr=rf.FetchReport()
except Exception, ex:
results = u'Whether and if such code?'
ret... |
from cvxopt import matrix,spmatrix,sparse,uniform,normal,setseed
from cvxopt.blas import dot,dotu
from cvxopt.solvers import qp
from cvxopt.lapack import syev
import numpy as np
import math as math
from kernel import Kernel
from svdd import SVDD
import pylab as pl
import matplotlib.pyplot as plt
class LatentSVDD:
... |
import unittest
import numpy
import six
import chainer
from chainer.backends import cuda
from chainer import gradient_check
from chainer import links
from chainer import testing
from chainer.testing import attr
from chainer.testing import condition
from chainer.utils import type_check
def _as_mat(x):
if x.ndim ... |
"""Utility functions for Windows builds.
These functions are executed via gyp-win-tool when using the ninja generator.
"""
import os
import re
import shutil
import subprocess
import string
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
# A regex matching an argument corresponding to the output fil... |
"""
Tests For Volume Number Weigher.
"""
import mock
from oslo_config import cfg
from cinder import context
from cinder.db.sqlalchemy import api
from cinder.openstack.common.scheduler import weights
from cinder.scheduler.weights import volume_number
from cinder import test
from cinder.tests.unit.scheduler import fake... |
""" module used to build the django wsgi application """
from __future__ import print_function
import os
import re
import sys
import time
try:
from StringIO import StringIO
except:
from io import StringIO
from imp import reload
from django.conf import settings
from django.core.management.validation impor... |
"""Get Netscaler details."""
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer import utils
@click.command()
@click.argument('identifier')
@environment.pass_env
def cli(env, identifier):
"""Get Netscaler details."""
mgr = SoftLayer.LoadBal... |
"""Audio latency performance test.
Benchmark measuring how fast we can continuously repeat a short sound clip. In
the ideal scenario we'd have zero latency processing script, seeking back to the
beginning of the clip, and resuming audio playback.
Performance is recorded as the average latency of N playbacks. I.e., ... |
from browser import document
SDL_INIT_VIDEO=0
SDL_GL_DOUBLEBUFFER=1
SDL_GL_DEPTH_SIZE=2
SDL_DOUBLEBUF=3
SDL_ANYFORMAT=4
SDL_ACTIVEEVENT=5
SDL_ALLEVENTS=5
SDL_KEYDOWN=6
SDL_KEYUP=7
SDL_MOUSEMOTION=8
SDL_MOUSEBUTTONDOWN=9
SDL_MOUSEBUTTONUP=10
SDL_JOYAXISMOTION=11
SDL_JOYBALLMOTION=12
SDL_JOYHATMOTION=13
SDL_JOYBUTTON... |
from yowsup.structs import ProtocolTreeNode
from yowsup.layers.protocol_iq.protocolentities import ResultIqProtocolEntity
class SuccessAddParticipantsIqProtocolEntity(ResultIqProtocolEntity):
'''
<iq type="result" from="{{group_jid}}" id="{{id}}">
<add type="success" participant="{{jid}}"></add>
... |
# Samuel DeLaughter
# 4/10/15
from SimpleXMLRPCServer import SimpleXMLRPCServer
from threading import Thread
import logging
import socket
import time
import iot
class gateway(iot.device):
#The class defining gateway devices
def __init__(self):
iot.device.__init__(self)
self.id = 0
self.ip = socket.gethostbyn... |
"""Provides a convenient wrapper for spawning a test lighttpd instance.
Usage:
lighttpd_server PATH_TO_DOC_ROOT
"""
import codecs
import contextlib
import httplib
import os
import random
import shutil
import socket
import subprocess
import sys
import tempfile
import time
from pylib import constants
from pylib impo... |
from novaclient import base
from novaclient import utils
class Extension(utils.HookableMixin):
"""Extension descriptor."""
SUPPORTED_HOOKS = ('__pre_parse_args__', '__post_parse_args__')
def __init__(self, name, module):
self.name = name
self.module = module
self._parse_extension... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
################################################################################
# Documentation
################################################################################
ANSIBLE_METADATA = {'metadata_version': '1.1', 'statu... |
import unittest
from autothreadharness.harness_case import HarnessCase
class Commissioner_8_1_2(HarnessCase):
role = HarnessCase.ROLE_COMMISSIONER
case = '8 1 2'
golden_devices_required = 1
def on_dialog(self, dialog, title):
pass
if __name__ == '__main__':
unittest.main() |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import inspect
import logging
import unittest
from flask.blueprints import Blueprint
from flask_admin import BaseView
from flask_admin.menu import MenuLink, MenuView
fr... |
import os
from distutils.version import StrictVersion
try:
from passlib.apache import HtpasswdFile
import passlib
except ImportError:
passlib_installed = False
else:
passlib_installed = True
def create_missing_directories(dest):
destpath = os.path.dirname(dest)
if not os.path.exists(destpath)... |
# Tests some corner cases with isinstance() and issubclass(). While these
# tests use new style classes and properties, they actually do whitebox
# testing of error conditions uncovered when using extension types.
import unittest
from test import support
import sys
class TestIsInstanceExceptions(unittest.TestCase... |
__author__ = "Francisco Fuentes Barrera <<EMAIL>>"
__copyright__ = "Copyright (C) 2015, Junta de Andalucía" + \
"<<EMAIL>>"
__license__ = "GPL-2"
import logging
import gettext
from gettext import gettext as _
from gi.repository import Gtk
from gecosws_config_assistant.view.GladeWindow import GladeWindow
gettext.... |
from django.conf import settings
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from re import compile
from guardian.shortcuts import get_anonymous_user
class LoginRequiredMiddleware(object):
"""
Requires a user to be logged in to access any page that is not white-l... |
"""
Builds test executable(s), runs them and checks for failures.
The conventions are:
- premake4.lua defines all_tests.sln which contains one or more
test projects
- we build Release version of all projects
- they end up as obj-rel/test_*.exe executables
- we run all those test executables
- a test e... |
"""
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
import sys
from django.db.backends import *
from django.db.backends.postgresql_psycopg2.operations import DatabaseOperations
from django.db.backends.postgresql_psycopg2.client import DatabaseClient
from django.db.b... |
from contextlib import contextmanager
import warnings
import sys
from django.contrib.auth import get_user_model
from django.utils import six
class WagtailTestUtils(object):
def login(self):
# Create a user
user = get_user_model().objects.create_superuser(username='test', email='<EMAIL>', password... |
import os
import sys
import xbmc
import xbmcaddon
import xbmcvfs
import lib.common
from lib.common import log
ADDONPATH = lib.common.ADDONPATH
import json as jsoninterface
def get_installedversion():
# retrieve current installed version
json_query = xbmc.executeJSONRPC('{ "jsonrpc": "2.0", "method": "Appl... |
from neutron.common import log
from neutron.services.metering.drivers import abstract_driver
class NoopMeteringDriver(abstract_driver.MeteringAbstractDriver):
@log.log
def update_routers(self, context, routers):
pass
@log.log
def remove_router(self, context, router_id):
pass
@lo... |
#!/usr/bin/python
""" Creates a splash screen that is linked to the python logging system. """
# define authorship information
__authors__ = ['Eric Hulser']
__author__ = ','.join(__authors__)
__credits__ = []
__copyright__ = 'Copyright (c) 2011, Projex Software'
__license__ = 'L... |
#!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# create a rendering window and renderer
ren1 = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren1)
renWin.StereoCapableWindowOn()
iren = vtk.vtkRenderWindowInte... |
import sys
from completers import ClusterCompleter
class CmdSshMaster(ClusterCompleter):
"""
sshmaster [options] <cluster> [<remote-command>]
SSH to a cluster's master node
Example:
$ sshmaster mycluster
You can also execute commands without directly logging in:
$ starcluster ... |
import cairo
import math
WIDTH, HEIGHT = 256, 256
def main():
"""Main function"""
# Image surfaces provide the ability to render to memory buffers either
# allocated by cairo or by the calling code.
# List of supported surfaces: http://www.cairographics.org/manual/cairo-surfaces.html
surface = ca... |
from datetime import date
import itertools
from django.conf import settings
from django.db.models import *
from apps.activity.base_activity import BaseActivity
from apps.canvas_auth.models import User
from canvas import util
from canvas.redis_models import RedisLastBumpedBuffer
from drawquest.apps.drawquest_auth.deta... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ogr2ogrtopostgislist.py
---------------------
Date : November 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
****************... |
"""
magicball.py
~~~~~~~~
Exposes the `MagicBall` object.
:copyright: (c) 2017 by Sean Callaway.
:license: MIT, see LICENSE for more details.
"""
import random
class MagicBall(object):
"""Defines a magic 8 ball."""
def __init__(self):
"""Setup the 8ball with responses."""
... |
"""Convolutional Neural Network Estimator for MNIST, built with tf.layers."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
from tensorflow.contrib import learn
from tensorflow.contrib.learn.python.learn.estimat... |
from openerp import models, fields, api
from datetime import datetime
from dateutil.relativedelta import relativedelta
class clv_insured_card(models.Model):
_name = 'clv_insured_card'
name = fields.Char('Printed Name', required=True, size=64, help='Name printed on the card.')
code = fields.Char(size=64, s... |
"""Unit tests for uncompiled implementation of coder impls."""
from __future__ import absolute_import
import logging
import unittest
# Run all the standard coder test cases.
from apache_beam.coders.coders_test_common import *
class SlowCoders(unittest.TestCase):
def test_using_slow_impl(self):
try:
# ... |
'''
A pure python version of the hdr_histogram code
Ported from
https://github.com/HdrHistogram/HdrHistogram (Java)
https://github.com/HdrHistogram/HdrHistogram_c (C)
Coding / Decoding of histograms using the
HdrHistogram V1 compressed transportable format
Written by Alec Hothan
Licensed under the Apache License, V... |
# -*- coding: utf-8 -*-
"""
sphinx.websupport.storage.sqlalchemystorage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An SQLAlchemy storage backend.
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from datetime import datetime
import sql... |
"""This file contains the TestCommandLog class."""
import unittest
import mock
import pygame
from src.CommandLog import CommandLog
from src.CustomEvent import CustomEvent
from src.Point import Point
class TestCommandLog(unittest.TestCase):
"""This test class unit tests the CommandLog class."""
def setUp(sel... |
"""
Settings and configuration for Django.
Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
"""
import importlib
import os
import time # Needed for Windows... |
#!/usr/bin/env python
import subprocess
import os
import errno
import collections
import glob
import argparse
class Platform(object):
pass
class simulator_platform(Platform):
directory = 'darwin_ios'
sdk = 'iphonesimulator'
arch = 'i386'
triple = 'i386-apple-darwin11'
version_min = '-miphoneos... |
import numpy as np
from osgeo import gdal
import mayavi.mlab as mlab
import utils
import shapeways_io
gdal.UseExceptions()
def main():
z, x, y = read('data/alaska/clipped_elev.tif')
rgb, _, _ = read('data/alaska/clipped_map.tif')
rgb = np.swapaxes(rgb.T, 0, 1)
fig = mlab.figure()
surf = mlab.m... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import json
from ansible.compat.tests.mock import patch
from ansible.modules.network.nxos import nxos_hsrp
from .nxos_module import TestNxosModule, load_fixture, set_module_args
class TestNxosHsrpModule(TestNxosModule):
mod... |
try:
import http.client as httplib
except ImportError:
import httplib
import zlib
import io
from socket import timeout as SocketTimeout
from ._collections import HTTPHeaderDict
from .exceptions import (
ProtocolError, DecodeError, ReadTimeoutError, ResponseNotChunked
)
from .packages.six import string_type... |
import unittest
import sys
from os.path import join, dirname
from cStringIO import StringIO
sys.path.insert(0, join(dirname(__file__), "..", ".."))
from wptrunner import hosts
class HostsTest(unittest.TestCase):
def do_test(self, input, expected):
host_file = hosts.HostsFile.from_file(StringIO(input))
... |
""" Python 'undefined' Codec
This codec will always raise a ValueError exception when being
used. It is intended for use by the site.py file to switch off
automatic string to Unicode coercion.
Written by Marc-Andre Lemburg (<EMAIL>).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codec... |
import copy
import time
import sys
import argparse
from astropy import log, __version__
from .hub import SAMPHubServer
__all__ = ['hub_script']
def hub_script(timeout=0):
"""
This main function is executed by the ``samp_hub`` command line tool.
"""
parser = argparse.ArgumentParser(prog="samp_hub "... |
'''
Copyright (c) 2014, K. Kumar (<EMAIL>)
All rights reserved.
'''
###################################################################################################
# Set up input deck
###################################################################################################
# Set path to TLE catalog file... |
'''
Created on Jan 30, 2015
@author: <EMAIL>
'''
import os
from biokbase.Transform import script_utils, drivers
from bzrlib.config import ConfigObj
import random
import sys
from biokbase.Transform.drivers import TransformTaskRunnerDriver
import inspect
KEEP_VENV = 'KB_KEEP_TEST_VENV'
#CLIENT_SHORTCUTS = {drivers.WS_... |
from __future__ import absolute_import, division, unicode_literals
from . import _base
from ..constants import cdataElements, rcdataElements, voidElements
from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)
class LintError(Exception):
pass
class Filter(_base.Filter):
def __i... |
from subprocess import call
from os import path
import hitchpostgres
import hitchselenium
import hitchpython
import hitchserve
import hitchredis
import hitchtest
import hitchsmtp
# Get directory above this file
PROJECT_DIRECTORY = path.abspath(path.join(path.dirname(__file__), '..'))
class ExecutionEngine(hitchtest... |
import sys
import os
from miasm2.core.cpu import ParseAst
from miasm2.arch.mips32.arch import mn_mips32, base_expr, variable
from miasm2.core import parse_asm
from miasm2.expression.expression import *
from miasm2.core import asmblock
from elfesteem.strpatchwork import StrPatchwork
from miasm2.analysis.machine import ... |
import base64, errno, subprocess, os, datetime
import cPickle as pickle
from mercurial import util
from mercurial.i18n import _
propertycache = util.propertycache
def encodeargs(args):
def encodearg(s):
lines = base64.encodestring(s)
lines = [l.splitlines()[0] for l in lines]
return ''.joi... |
from datetime import datetime, timedelta
from math import ceil
from apscheduler.util import convert_to_datetime, timedelta_seconds
class IntervalTrigger(object):
def __init__(self, interval, start_date=None):
if not isinstance(interval, timedelta):
raise TypeError('interval must be a timedelt... |
from templeplus.pymod import PythonModifier
from toee import *
import tpdp
from utilities import *
print "Registering sp-Magic Circle Outward Fixed"
# args: (0-4)
# 0 - spell_id
# 1 - duration
# 2 - Type Flag (1-Good, 2- Evil, 3- Law, 4- Chaos)
# 3 - aoe id
# 4 - spare
#List of spells protection from evil grants immu... |
"""
=======================================================
Scalable learning with polynomial kernel aproximation
=======================================================
This example illustrates the use of :class:`PolynomialCountSketch` to
efficiently generate polynomial kernel feature-space approximations.
This is us... |
import warnings
from django.conf.urls import url
from django.utils.deprecation import RemovedInDjango110Warning
from . import views
# Test deprecated behavior of passing strings as view to url().
# Some of these can be removed in Django 1.10 as they aren't convertable to
# callables.
with warnings.catch_warnings():
... |
# -*- 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 'GeneratedCertificate.enabled'
db.add_column('certificates_generatedcertificate', 'enabled',
... |
# -*- coding: utf-8 -*-
"""
***************************************************************************
ClipVectorByMask.py
---------------------
Date : November 2012
Copyright : (C) 2012 by Victor Olaya
Email : volayaf at gmail dot com
********************... |
"""
Copyright 2016-2017 Ellation, 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 writing, sof... |
from django.db import models
from Profiler.models import Student
from .Assignment import *
class AssignmentResponseManager(models.Manager):
def addAssignmentResponse(self, request):
""" add assignment response """
A = Assignment.objects.getAssignmentByCode(request)
S = Student.objects.getS... |
#! /usr/bin/env python
from __future__ import division, absolute_import, print_function
# System imports
from distutils.util import get_platform
import os
import sys
import unittest
import struct
# Import NumPy
import numpy as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0: BadLi... |
"""Defines the public namespace for SQL expression constructs.
Prior to version 0.9, this module contained all of "elements", "dml",
"default_comparator" and "selectable". The module was broken up
and most "factory" functions were moved to be grouped with their associated
class.
"""
__all__ = [
'Alias', 'Claus... |
"""Base Manager class.
Managers are responsible for a certain aspect of the system. It is a logical
grouping of code relating to a portion of the system. In general other
components should be using the manager to make changes to the components that
it is responsible for.
For example, other components that need to d... |
from __future__ import print_function
import aerospike
import sys
from optparse import OptionParser
################################################################################
# Options Parsing
################################################################################
usage = "usage: %prog [options] [REQ... |
import socket
import struct
import logging
import datetime
import os
import signal
from Crypto.Cipher import XOR
ECHO_REPLY = 0
ECHO_REQUEST = 8
PORT = 14900
def set_logger(log_file_name):
"""
Установка нужных настроек логирования
:param log_file_name: имя файла-лога
:return: -
"""
logging.ba... |
{
'name': 'Invoice Picking Directly',
'version': '1.0',
"category" : "Warehouse Management",
'complexity': "easy",
'description': """
Invoice Wizard for Delivery.
============================
When you send or deliver goods, this module automatically launch
the invoicing wizard if the delivery is to... |
# encoding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
unified_strdate,
js_to_json,
)
class ScreenwaveMediaIE(InfoExtractor):
_VALID_URL = r'https?://player\d?\.screenwavemedia\.com/(?:play/)?[a-zA-Z]+\.php\?.*\bid=(?P... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.