content string |
|---|
import sys
import mock
import pytest
from os.path import join, dirname
sys.path.insert(0, join(dirname(__file__), "..", "..", ".."))
sauce = pytest.importorskip("wptrunner.browsers.sauce")
from wptserve.config import ConfigBuilder
def test_sauceconnect_success():
with mock.patch.object(sauce.SauceConnect, "u... |
#!/usr/bin/env python3
"""
Copyright 2016 Hewlett Packard Enterprise Development LP.
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
... |
from gnuradio import gr
from gnuradio import audio
from gnuradio import digital
from gnuradio.eng_option import eng_option
from optparse import OptionParser
class my_top_block(gr.top_block):
def __init__(self):
gr.top_block.__init__(self)
parser = OptionParser(option_class=eng_option)
par... |
from django.db import models
class Building(models.Model):
name = models.CharField(max_length=10)
def __unicode__(self):
return u"Building: %s" % self.name
class Device(models.Model):
building = models.ForeignKey('Building')
name = models.CharField(max_length=10)
def __unicode__(self):
... |
#!/usr/bin/env python
import glob
import os
import sys
TARGET_PLATFORM = {
'cygwin': 'win32',
'darwin': 'darwin',
'linux2': 'linux',
'win32': 'win32',
}[sys.platform]
SHARED_LIBRARY_SUFFIX = {
'darwin': 'dylib',
'linux': 'so',
'win32': 'dll',
}[TARGET_PLATFORM]
STATIC_LIBRARY_SUFFIX = {
'darwin': 'a... |
import unittest
import tempfile
import random
import os
import stat
import numpy
import mdarray as mt
# Return random string of spaces and tabs
def rndb():
blanks = [' ', '\t']
l = [ random.choice(blanks) for i in range(random.randint(0, 5)) ]
random.shuffle(l)
return "".join(l)
atomicMasses = {
'... |
"""Remove legacy upgrade recipes."""
import warnings
from invenio_db import db
from sqlalchemy.sql import text
from invenio_upgrader import UpgradeBase, op
class LegacyRemoval(UpgradeBase):
"""Remove legacy upgrade recipes."""
_depends_on = []
legacy_upgrades = [
'invenio_2012_10_29_idxINDEX_... |
# -*- coding:Utf-8 -*-
from django.shortcuts import render_to_response, redirect
from django.template import RequestContext, loader
from django.views.generic import TemplateView
from django.utils.formats import get_format
from django.conf import settings
from django.http import (
HttpResponseRedirect,
HttpRes... |
# -*- coding: utf-8 -*-
{
'!langcode!': 'pt-br',
'!langname!': 'Português Brasileiro',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "campo1=\'novo_valor\'". Não é permitido atualizar ou apagar resultados de um... |
import threading
import time
import pytest
from mne.realtime import StimServer, StimClient
from mne.externals.six.moves import queue
from mne.utils import requires_good_network, run_tests_if_main
_server = None
_have_put_in_trigger = False
_max_wait = 10.
@requires_good_network
def test_connection():
"""Test T... |
#!/usr/bin/env python
"""This module contains RESTful API renderers for AFF4 objects and RDFValues."""
import itertools
import numbers
import re
from grr.lib import aff4
from grr.lib import rdfvalue
from grr.lib import registry
from grr.lib import utils
from grr.lib.rdfvalues import structs
class ApiObjectRendere... |
from .. import fixtures, config
from ..config import requirements
from .. import exclusions
from ..assertions import eq_
from .. import engines
from sqlalchemy import Integer, String, select, literal_column, literal
from ..schema import Table, Column
class LastrowidTest(fixtures.TablesTest):
run_deletes = 'each... |
"""
FastCGI (or SCGI, or AJP1.3 ...) server that implements the WSGI protocol.
Uses the flup python package: http://www.saddi.com/software/flup/
This is a adaptation of the flup package to add FastCGI server support
to run Django apps from Web servers that support the FastCGI protocol.
This module can be run standalo... |
import base64
import cPickle as pickle
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.utils.hashcompat import md5_constructor
class SessionManager(models.Manager):
def encode(self, session_dict):
"""
Returns the gi... |
from django import forms
from django.forms.models import modelformset_factory
from django.forms.utils import ErrorList
from django.shortcuts import render
from django.utils.safestring import mark_safe
from pootle.core.paginator import paginate
from pootle.i18n.gettext import ugettext as _
def form_set_as_table(forms... |
from openerp.addons.connector.connector import install_in_connector
install_in_connector() |
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
from horizon import tables
from openstack_dashboard import api
from openstack_dashboard.usage import base
class UsageView(tables.DataTableView):
usage_class = None
show_terminated = True
csv_template_name = None
pa... |
import logging
from dateutil import parser
from django.db import models, transaction
from django.db.models import Sum
from django.db.models.expressions import RawSQL
from django.utils import timezone
from framework.sessions import session
from osf.models.base import BaseModel, Guid
from osf.models.files import BaseFi... |
import unittest
from pylib.gtest import gtest_test_instance
class GtestTestInstanceTests(unittest.TestCase):
def testParseGTestListTests_simple(self):
raw_output = [
'TestCaseOne.',
' testOne',
' testTwo',
'TestCaseTwo.',
' testThree',
' testFour',
]
actual = gt... |
# -*- coding: utf-8 -*-
"""
Django local_settings for chisch project.
import by 'setting.py.
"""
# Open malicious authentication
OPEN_MRP = False
OPEN_SSM = False
# The name of the certificate
ACCESS_TOKEN_NAME = 'Access-Token'
# universal verify code
UNIVERSAL_VERIFY_CODE = "888888"
ALIYUN_OSS = {
'BUCKET_NAM... |
"""A module containing TensorFlow ops whose API may change in the future."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# pylint: disable=wildcard-import
from tensorflow.contrib.framework.python.framework.checkpoint_utils import *
from tensorflow.contr... |
import tweepy
import time
import urllib3
#from time import sleep
import logging
#Create variables for each key, secret, token
consumer_key = 'PzwW4qupC1qy3562g2wtCfMV1'
consumer_secret = 'wCivK4jYECDUbJCQBn9294EtGsYAgk2Z5V8wyLFM31tNjqNypW'
access_token = '869611298547421184-PfE7owxRC1RLC7bgzp14jdjvCcyjpyV'
access_toke... |
# coding: utf-8
# Python libs
from __future__ import absolute_import
# Salt libs
from salt.beacons import adb
# Salt testing libs
from salttesting import skipIf, TestCase
from salttesting.helpers import ensure_in_syspath
from salttesting.mock import NO_MOCK, NO_MOCK_REASON, patch, Mock
# Globals
adb.__salt__ = {}
... |
"""
DB-API Shortcuts
``get_object_or_404()`` is a shortcut function to be used in view functions for
performing a ``get()`` lookup and raising a ``Http404`` exception if a
``DoesNotExist`` exception was raised during the ``get()`` call.
``get_list_or_404()`` is a shortcut function to be used in view functions for
per... |
"""
`UEFI 2.4 spec Section 28 <http://uefi.org/>`_
Verify that all Secure Boot key/whitelist/blacklist UEFI variables are authenticated (BS+RT+AT)
and protected from unauthorized modification.
Use '-a modify' option for the module to also try to write/corrupt the variables.
"""
from chipsec.module_common import *
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Pygments
~~~~~~~~
Pygments is a syntax highlighting package written in Python.
It is a generic syntax highlighter for general use in all kinds of software
such as forum systems, wikis or other applications that need to prettify
source code. Hig... |
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
parse_duration,
parse_filesize,
int_or_none,
)
class AlphaPornoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?alphaporno\.com/videos/(?P<id>[^/]+)'
_TEST = {
'url': 'ht... |
# coding: utf-8
from __future__ import unicode_literals
import random
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
xpath_text,
int_or_none,
ExtractorError,
sanitized_Request,
)
class MioMioIE(InfoExtractor):
IE_NAME = 'miomio.tv'
_VALID_URL = r... |
"""
Blockdiag Tag
---------
This tag implements a liquid style tag for blockdiag [1]. You can use different
diagram types like blockdiag, seqdiag, packetdiag etc. [1]
[1] http://blockdiag.com/en/blockdiag/
Syntax
------
{% blockdiag {
<diagramm type> {
<CODE>
}
}
%}
Examples
-------... |
import django.utils.copycompat as copy
from django.contrib.gis.geos import *
from django.contrib.gis.geos.error import GEOSIndexError
from django.utils import unittest
def getItem(o,i): return o[i]
def delItem(o,i): del o[i]
def setItem(o,i,v): o[i] = v
def api_get_distance(x): return x.distance(Point(-200,-200))
de... |
import urllib
NEXMO_API = 'https://rest.nexmo.com/sms/json'
def send_msg(module):
failed = list()
responses = dict()
msg = {
'api_key': module.params.get('api_key'),
'api_secret': module.params.get('api_secret'),
'from': module.params.get('src'),
'text': module.params.get(... |
"""
sentry.web.forms
~~~~~~~~~~~~~~~~
: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
from django import forms
from django.utils.translation import ugettext_lazy as _
from sentry.constants import HTTP_... |
import cog
def go(classname, ints = [], floats = []):
cog.outl( '// generated, using cog:' )
for thisint in ints:
cog.outl('int ' + thisint + ' = 0;')
for thisfloat in floats:
cog.outl('float ' + thisfloat + ' = 0;')
for thisint in ints:
thisintTitlecase = thisint[0].upper() + t... |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.base.payload import Payload
from pants.base.payload_field import PrimitiveField
from pants.contrib.cpp.targets.cpp_target import CppTarget
class CppBinar... |
import datetime
import json
from airflow.exceptions import AirflowException
from airflow.models import DagRun, DagBag
from airflow.utils.state import State
def trigger_dag(dag_id, run_id=None, conf=None, execution_date=None):
dagbag = DagBag()
if dag_id not in dagbag.dags:
raise AirflowException("Da... |
import urllib,urllib2,re,cookielib,urlresolver,sys,os
import xbmc, xbmcgui, xbmcaddon, xbmcplugin
from resources.libs import main
#Mash Up - by Mash2k3 2012.
from t0mm0.common.addon import Addon
from resources.universal import playbackengine, watchhistory
addon_id = 'plugin.video.movie25'
selfAddon = xbmcaddon.Addon(... |
from __future__ import absolute_import, division, print_function, with_statement
import os
import sys
import traceback
from tornado.escape import utf8, native_str, to_unicode
from tornado.template import Template, DictLoader, ParseError, Loader
from tornado.test.util import unittest
from tornado.util import u, Object... |
# Ridiculously simple test of the os.startfile function for Windows.
#
# empty.vbs is an empty file (except for a comment), which does
# nothing when run with cscript or wscript.
#
# A possible improvement would be to have empty.vbs do something that
# we can detect here, to make sure that not only the os.startfile()
#... |
import sale_journal
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
import os
from telemetry.core import util
from trace_viewer import trace_viewer_project
def _FindAllFilesRecursive(source_paths, pred):
all_filenames = set()
for source_path in source_paths:
for dirpath, _, filenames in os.walk(source_path):
for f in filenames:
if f.startswith('.'):
c... |
from openerp.osv import fields, osv
from openerp.tools.translate import _
class account_change_currency(osv.osv_memory):
_name = 'account.change.currency'
_description = 'Change Currency'
_columns = {
'currency_id': fields.many2one('res.currency', 'Change to', required=True, help="Select a currency ... |
#encoding:utf-8
from gensim.models import Word2Vec
from gensim.models.word2vec import LineSentence
import pandas as pd
import numpy as np
import os
import sys
import math
import random
import processSeq
import warnings
import threading
from multiprocessing.dummy import Pool as ThreadPool
from sklearn imp... |
from __future__ import print_function
import os.path
import re
import sys
from wheel.cli import WheelError
from wheel.wheelfile import WheelFile
DIST_INFO_RE = re.compile(r"^(?P<namever>(?P<name>.+?)-(?P<ver>\d.*?))\.dist-info$")
def pack(directory, dest_dir, build_number):
"""Repack a previously unpacked whee... |
""" Implements TIFF sample plane.
"""
import numpy
import tif_lzw
__all__ = ['TiffSamplePlane']
def set_array(output_array, input_array):
dtype = numpy.uint8
numpy.frombuffer(output_array.data, dtype=dtype)[:] = numpy.frombuffer(input_array.data, dtype=dtype)
class TiffSamplePlane:
""" Image of a singl... |
"""Common TFGAN summaries."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.contrib.gan.python import namedtuples
from tensorflow.contrib.gan.python.eval.python import eval_utils
from tensorflow.python.framework import ops
from tensorflow.... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils.aws.core import AnsibleAWSModule
from ansible.module_utils.ec2 i... |
import sqlalchemy as sa
from neutron.db import api as db
from neutron.db import model_base
from neutron.db import models_v2
from neutron.db import securitygroups_db as sg_db
from neutron.extensions import securitygroup as ext_sg
from neutron import manager
from neutron.openstack.common import log as logging
from neutr... |
from f5.bigip.tm.asm.signature_statuses import Signature_Status
import pytest
from requests.exceptions import HTTPError
def get_sigstatid(request, mgmt_root):
sigcoll = mgmt_root.tm.asm.signature_statuses_s.get_collection()
# We obtain the ID for the resource to test and return the hashed id
hashid = str(... |
from openerp.osv import fields,osv
class ir_exports(osv.osv):
_name = "ir.exports"
_order = 'name'
_columns = {
'name': fields.char('Export Name'),
'resource': fields.char('Resource', select=True),
'export_fields': fields.one2many('ir.exports.line', 'export_id',
... |
import numpy
def cosspace(a, b, n=50):
return (a + b)/2 + (b - a)/2 * (numpy.cos(numpy.linspace(-numpy.pi, 0, n)))
def vander_chebyshev(x, n=None):
if n is None:
n = len(x)
T = numpy.ones((len(x), n))
if n > 1:
T[:,1] = x
for k in range(2,n):
T[:,k] = 2 * x * T[:,k-1] - T[:... |
import unittest
from ctypes import *
formats = "bBhHiIlLqQfd"
formats = c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, \
c_long, c_ulonglong, c_float, c_double, c_longdouble
class ArrayTestCase(unittest.TestCase):
def test_simple(self):
# create classes holding simple numeric types, and che... |
#!/usr/bin/env python3
import copy
import curses
import curses.ascii
from enum import Enum
import locale
import math
import sys
import signal
class Direction(Enum):
north, east, south, west = range(4)
def is_opp(self, other):
return ((self == Direction.north and other == Direction.south) or
... |
"""A `traverse` visitor for processing documentation."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
from tensorflow.python.util import tf_export
from tensorflow.python.util import tf_inspect
class DocGeneratorVisitor(object):
"""A visit... |
from openstack_dashboard.test.integration_tests import helpers
class TestUser(helpers.AdminTestCase):
USER_NAME = helpers.gen_random_resource_name("user")
def test_create_delete_user(self):
users_page = self.home_pg.go_to_identity_userspage()
password = self.TEST_PASSWORD
users_page.... |
# elected_office/urls.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
from django.conf.urls import re_path
from . import views_admin
urlpatterns = [
# views_admin
re_path(r'^$', views_admin.elected_office_list_view, name='elected_office_list', ),
re_path(r'^delete/$', views_admin.elected... |
from __future__ import unicode_literals
import getpass
from django.contrib.auth import get_user_model
from django.contrib.auth.password_validation import validate_password
from django.core.exceptions import ValidationError
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT... |
"""Tools for car beam pipelines."""
import apache_beam as beam
def BeamInit():
"""Initialize the beam program.
Typically first thing to run in main(). This call is needed before FLAGS
are accessed, for example.
"""
pass
def GetPipelineRoot(options=None):
"""Return the root of the beam pipeline.
Typ... |
"""
'library' XBlock (LibraryRoot)
"""
import logging
from xmodule.studio_editable import StudioEditableModule
from xblock.fields import Scope, String, List, Boolean
from xblock.fragment import Fragment
from xblock.core import XBlock
log = logging.getLogger(__name__)
# Make '_' a no-op so we can scrape strings
_ = ... |
from argparse import ArgumentParser
import random
import pprint
from couchbase.bucket import Bucket
ap = ArgumentParser()
ap.add_argument('-D', '--create-design', default=False,
action='store_true',
help='whether to create the design')
ap.add_argument('-n', '--number-of-terms', defau... |
from __future__ import print_function
__author__ = 'Julian Togelius, <EMAIL>'
from pybrain.rl.environments import Environment
from math import sqrt
import socket
import string
from scipy import zeros
class SimpleraceEnvironment(Environment):
firstCarScore = 0
secondCarScore = 0
lastStepCurrentWp = [0, 0... |
#/usr/bin/env python
import auxiliary_functions as aux
import PyDSTool as dst
from PyDSTool import common as cmn
import numpy as np
from matplotlib import pyplot as plt
import sys
#------------------------------------------------------------------------------#
def defineSystem():
'''
Create an object that def... |
# -*- coding: utf-8 -*-
"""
UY-specific form helpers.
"""
import re
from django.core.validators import EMPTY_VALUES
from django.forms.fields import Select, RegexField
from django.forms import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.contrib.localflavor.uy.util import get_vali... |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import unittest
import webapp2
import webtest
from google.appengine.ext import ndb
from dashboard import update_test_suites
from dashboard.common import descriptor
from dashboard.common import namespaced_stor... |
import os
import warnings
import numpy as np
from numpy.testing import assert_allclose, assert_array_equal
from nose.tools import assert_true, assert_false, assert_equal
import mne
from mne.io.kit.tests import data_dir as kit_data_dir
from mne.io import Raw
from mne.utils import _TempDir, requires_traits, run_tests_i... |
FORWARDDELETE_TESTS = {
'id': 'FD',
'caption': 'Forward-Delete Tests',
'command': 'forwardDelete',
'checkAttrs': True,
'checkStyle': False,
'Proposed': [
{ 'desc': '',
'tests': [
]
},
{ 'desc': 'forward-delete single characters',
'tests': ... |
"""
Truevision Targa Graphic (TGA) picture parser.
Author: Victor Stinner
Creation: 18 december 2006
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import FieldSet, UInt8, UInt16, Enum, RawBytes
from lib.hachoir_core.endian import LITTLE_ENDIAN
from lib.hachoir_parser.image.common import Palett... |
"""
Sample configuration file for the "mirror" script that will use
rsync://rsync.kernel.org to fetch a kernel file list and schedule jobs on new
kernel releases.
This file has to be valid python code executed by the "mirror" script. The file
may define and do anything but the following "names" are special:
- a globa... |
# -*- coding: utf-8 -*-
import os
import hashlib
from datetime import datetime
from flask import Blueprint, render_template, current_app, request, flash
from flask.ext.login import login_required, current_user
from ..extensions import db
from ..user import User
from ..utils import allowed_file, make_dir
from .forms... |
import data
PRD = 'prd'
from utils import *
def test_messaging(IndivoClient):
try:
BODY = 'body'
SUBJECT = 'subject'
MSG_ID = 'message_id'
SEVERITY = 'severity'
admin_client = IndivoClient(data.machine_app_email, data.machine_app_secret)
admin_client.set_app_id(data.app_email)
ac... |
import sys
import unittest
import numpy
from chainer.backends import cuda
from chainer import testing
from chainer.testing import attr
from chainer.utils import type_check as T
class TestConstant(unittest.TestCase):
def setUp(self):
self.x = T.Constant(10)
def test_str(self):
self.assertEq... |
# -*- coding: utf-8 -*-
"""
flask.debughelpers
~~~~~~~~~~~~~~~~~~
Various helpers to make the development experience better.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from ._compat import implements_to_string, text_type
from .app import Flask
from .bl... |
# -*- coding: utf-8 -*-
from gluon import current
#from gluon.html import *
from gluon.storage import Storage
from s3 import S3CustomController
THEME = "CRMT"
# =============================================================================
class index(S3CustomController):
""" Custom Home Page """
def __call... |
import widget
from browser import doc,html
class Slider(widget.Widget):
def __init__(self, id=None, label=False):
self._div_shell=html.DIV(Class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all")
widget.Widget.__init__(self, self._div_shell, 'slider', id)
self._handle=h... |
"""Embeds standalone JavaScript snippets in C++ code.
Each argument to the script must be a file containing an associated JavaScript
function (e.g., evaluate_script.js should contain an evaluateScript function).
This is called the exported function of the script. The entire script will be
put into a C-style string in ... |
"""
General tools for data management
"""
def copy_features(inLyr, outLyr, outDefn, only_geom=True):
"""
Copy the features of one layer to another layer...
If the layers have the same fields, this method could also copy
the tabular data
TODO: See if the input is a layer or not and make ar... |
"""Sanity test for ansible-doc."""
from __future__ import absolute_import, print_function
import re
from lib.sanity import (
SanityMultipleVersion,
SanityFailure,
SanitySuccess,
SanitySkipped,
SanityMessage,
)
from lib.util import (
SubprocessError,
display,
intercept_command,
)
from... |
"""The TensorBoard Distributions (a.k.a. compressed histograms) plugin.
See `http_api.md` in this directory for specifications of the routes for
this plugin.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from werkzeug import wrappers
from tensorboar... |
# -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsColorButton.
.. note:: 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 2 of the License, or
(at your option) any later version.
"""
__... |
import solr
import random
import json
import datetime
SOLR_NEW = solr.Solr('http://127.0.0.1:8983/solr/dc-collection')
SOLR=solr.SearchHandler(solr.Solr('https://registry.cdlib.org/solr',
post_headers = { 'X-Authentication-Token':'xxxyyyzzz'}), "/query")
def get_collection_urls():
q_collections=SOLR(q="*:*", rows... |
from django.utils.translation import ugettext as _, ugettext_lazy as _lazy
from django.core import urlresolvers
from django.http import HttpResponse, HttpResponseServerError
from flexi_auth.models import ObjectWithContext
from gasistafelice.rest.views.blocks.base import BlockSSDataTables, ResourceBlockAction, CREATE_... |
import errno
import logging
import os
import os.path
import subprocess
import sys
class GTKDoc(object):
"""Class that controls a gtkdoc run.
Each instance of this class represents one gtkdoc configuration
and set of documentation. The gtkdoc package is a series of tools
run consecutively which conve... |
from cinder.openstack.common import log as logging
LOG = logging.getLogger(__name__)
class FakeBrickLVM(object):
"""Logs and records calls, for unit tests."""
def __init__(self, vg_name, create, pv_list, vtype, execute=None):
super(FakeBrickLVM, self).__init__()
self.vg_size = '5.00'
... |
import logging
import dbus
_HARDWARE_MANAGER_INTERFACE = 'org.freedesktop.ohm.Keystore'
_HARDWARE_MANAGER_SERVICE = 'org.freedesktop.ohm'
_HARDWARE_MANAGER_OBJECT_PATH = '/org/freedesktop/ohm/Keystore'
_ohm_service = None
def _get_ohm():
global _ohm_service
if _ohm_service is None:
bus = dbus.Syst... |
# -*- 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
from pybb.compat import get_image_field_full_name, get_user_model_path, get_user_frozen_models
AUTH_USER = get_user_model_path()
class Migration(Schema... |
"""
WSGI config for Galaxy project.
"""
import os
from django.core.wsgi import get_wsgi_application
from galaxy import prepare_env
# For public Galaxy, we need to default /etc/galaxy/settings.py
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'galaxy.settings.custom')
# Prepare the galaxy environment.
prepare_env()... |
import time
from iis.extensions import db
from test_utils.base import BaseTestCase
from iis.util.daemons import daemonize
import iis.models
class TestDaemonize(BaseTestCase):
DAEMON_PID_PATH = "/tmp"
def test_no_exception_raised_and_returns_pid(self):
self.app.logger.debug("Testing daemonize")
... |
"""GCITimeline (Model) query functions.
"""
__authors__ = [
'"Madhusudan.C.S" <<EMAIL>>'
]
from soc.logic.models import timeline
from soc.logic.models import sponsor as sponsor_logic
import soc.models.timeline
import soc.modules.gci.models.timeline
class Logic(timeline.Logic):
"""Logic methods for the GC... |
import constants, sys
from escsm import HZSMModel, ISO2022CNSMModel, ISO2022JPSMModel, ISO2022KRSMModel
from charsetprober import CharSetProber
from codingstatemachine import CodingStateMachine
class EscCharSetProber(CharSetProber):
def __init__(self):
CharSetProber.__init__(self)
self._mCodingSM =... |
"""
The :mod:`sklearn.metrics` module includes score functions, performance metrics
and pairwise metrics and distance computations.
"""
from .ranking import auc
from .ranking import average_precision_score
from .ranking import coverage_error
from .ranking import label_ranking_average_precision_score
from .ranking imp... |
"""
Python implementation of the fast ICA algorithms.
Reference: Tables 8.3 and 8.4 page 196 in the book:
Independent Component Analysis, by Hyvarinen et al.
"""
# Authors: Pierre Lafaye de Micheaux, Stefan van der Walt, Gael Varoquaux,
# Bertrand Thirion, Alexandre Gramfort, Denis A. Engemann
# License: BS... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import re
from posixpath import normpath
if sys.version_info < (3, 0):
reload(sys)
sys.setdefaultencoding('utf-8')
from urlparse import urljoin, urlparse, urlunparse
else:
from urllib.parse import urljoin, urlparse, urlunparse
class SeleniumRes... |
"""
SQLite3 backend for django.
Python 2.4 requires pysqlite2 (http://pysqlite.org/).
Python 2.5 and later can use a pysqlite2 module or the sqlite3 module in the
standard library.
"""
import re
import sys
import datetime
from django.db import utils
from django.db.backends import *
from django.db.backends.signals i... |
"""Support for LIFX Cloud scenes."""
import asyncio
import logging
from typing import Any
import aiohttp
from aiohttp.hdrs import AUTHORIZATION
import async_timeout
import voluptuous as vol
from homeassistant.components.scene import Scene
from homeassistant.const import (
CONF_PLATFORM,
CONF_TIMEOUT,
CONF... |
from openerp import api, fields, models
class WizardIrModelMethods(models.TransientModel):
_name = 'wizard.ir.model.methods'
_description = 'Wizard Model Method'
_rec_name = ''
models_id = fields.Many2many('ir.model', 'ir_model_methotds_rel', 'wizard_model_id', 'model_id', string="Model list")
to... |
from boto.regioninfo import RegionInfo
class SQSRegionInfo(RegionInfo):
def __init__(self, connection=None, name=None, endpoint=None,
connection_cls=None):
from boto.sqs.connection import SQSConnection
super(SQSRegionInfo, self).__init__(connection, name, endpoint,
... |
import re
ASSIGNMENT_NAME = 'P6'
ASSIGNMENT_TEST_NUM = 7
EMAIL_SEND = 0
EAMIL_SEND_UPPER_BOUND = 0
def toset(x):
if x != None:
return set(x)
else:
return None
OUTPUT_RESULT_REG_EXP = []
SCRIPT_REG_EXP = []
SCRIPT_EXISTENCE_REG_EXP = []
FUNCTION_ORDER = ['get_level', 'g... |
#!/usr/bin/env python
"""Executable Python script for testing the action proxy.
/*
* 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 thi... |
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import cstr, getdate
from frappe.utils.file_manager import save_file
from .default_website import website_maker
from erpnext.accounts.doctype.account.account import RootNotEditable
def create_fiscal_year_and_company(args):
if... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
###############################################################################
# Module to define chemical reaction functionality
###############################################################################
from math import exp, log
import sqlite3
from numpy import pol... |
import skimage
from lxml import etree
import os
import glob
from sklearn.cross_validation import train_test_split
import numpy as np
from progress_bar import ProgressBar
from skimage import io
from scipy import misc
def create_sets(img_dir, train_set_proportion=.6, test_set_proportion=.2, val_set_proportion=.2):
'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.