content stringlengths 4 20k |
|---|
import os
from webob import exc
from json import loads
from galaxy.util import (
copy_to_path,
copy_to_temp,
)
from pulsar.client.job_directory import verify_is_in_directory
from pulsar.web.framework import Controller
from pulsar.manager_factory import DEFAULT_MANAGER_NAME
from pulsar.manager_endpoint_util imp... |
from __future__ import absolute_import
from __future__ import division
import itertools
import sys
from signal import signal, SIGINT, default_int_handler
from pip.compat import WINDOWS
from pip.utils import format_size
from pip.utils.logging import get_indentation
from pip._vendor import six
from pip._vendor.progress... |
from __future__ import absolute_import, division, print_function
from re import compile
from ..scraper import _BasicScraper
from ..util import tagre
class VampireCheerleaders(_BasicScraper):
url = 'http://www.vampirecheerleaders.net/'
stripUrl = url + 'strips-vc/%s'
firstStripUrl = stripUrl % 'fang_servi... |
import pytest
from .. import helpers
BUSYBOX = helpers.BUSYBOX
class ExecTest(helpers.BaseTestCase):
def test_execute_command(self):
if not helpers.exec_driver_is_native():
pytest.skip('Exec driver not native')
container = self.client.create_container(BUSYBOX, 'cat',
... |
import pymongo
from django.core.management.base import BaseCommand
from django.conf import settings
from optparse import make_option
from crits.core.mongo_tools import mongo_connector
class Command(BaseCommand):
"""
Script Class.
"""
option_list = BaseCommand.option_list + (
make_option('--r... |
# -*- coding: utf-8 -*-
import logging
import re
import unicodedata
from openerp import _, api, fields, models, SUPERUSER_ID
from openerp.exceptions import UserError
from openerp.modules.registry import RegistryManager
from openerp.tools import ustr
from openerp.tools.safe_eval import safe_eval as eval
_logger = log... |
from optparse import make_option
from django.core.management.base import NoArgsCommand
def module_to_dict(module, omittable=lambda k: k.startswith('_')):
"""Converts a module namespace to a Python dictionary."""
return dict((k, repr(v)) for k, v in module.__dict__.items() if not omittable(k))
class Command(N... |
__all__ = ['Texture', 'TextureSource', 'ShotTexture']
from pyasm.search import *
from pyasm.biz import Project
class Texture(SObject):
SEARCH_TYPE = "prod/texture"
def get_relation(my, name):
from asset import Asset
relations = {}
relations['asset'] = Asset
relations['t... |
# -*- coding: utf-8 -*-
"""
pygments.lexers.diff
~~~~~~~~~~~~~~~~~~~~
Lexers for diff/patch formats.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups
from pygments.tok... |
from threading import Lock
import codecs
from ..structuredlog import log_levels
class BaseHandler(object):
"""A base handler providing message handling facilities to
derived classes.
:param inner: A handler-like callable that may receive messages
from a log user.
"""
def __ini... |
microcode = '''
# PFCMPEQ
# PFCMPGT
# PFCMPGE
''' |
import os
import sys
import getopt
try:
my_getopt = getopt.gnu_getopt
except AttributeError:
my_getopt = getopt.getopt
try:
# Python >=3.0
import configparser
except ImportError:
# Python <3.0
import ConfigParser as configparser
# for the generator modules
sys.path.insert(0, os.path.join('build', 'generato... |
"""Test the cloud.iot module."""
from aiohttp import web
import pytest
from homeassistant.components.cloud import DOMAIN
from homeassistant.components.cloud.client import CloudClient
from homeassistant.components.cloud.const import PREF_ENABLE_ALEXA, PREF_ENABLE_GOOGLE
from homeassistant.core import State
from homeass... |
"""
==========================================
Outlier detection with several methods.
==========================================
When the amount of contamination is known, this example illustrates two
different ways of performing :ref:`outlier_detection`:
- based on a robust estimator of covariance, which is assumin... |
from django.contrib.localflavor.de.forms import (DEZipCodeField, DEStateSelect,
DEIdentityCardNumberField)
from django.test import SimpleTestCase
class DELocalFlavorTests(SimpleTestCase):
def test_DEStateSelect(self):
f = DEStateSelect()
out = u'''<select name="states">
<option value="BW">Bad... |
# encoding: utf-8
from __future__ import unicode_literals
import re
import itertools
from .common import InfoExtractor
from ..compat import (
compat_str,
)
from ..utils import (
determine_ext,
unified_strdate,
)
class RutubeIE(InfoExtractor):
IE_NAME = 'rutube'
IE_DESC = 'Rutube videos'
_VAL... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
# TODO: Add RETURN documentation.
import datetime
import json
from ansible.module_utils.ba... |
from openerp.osv import fields,osv
from openerp.tools.sql import drop_view_if_exists
class report_timesheet_line(osv.osv):
_name = "report.timesheet.line"
_description = "Timesheet Line"
_auto = False
_columns = {
'name': fields.char('Year', required=False, readonly=True),
'user_id': fi... |
#!/usr/bin/env python
import os, sys
from distutils.core import setup
try:
import setuptools
# enable "setup.py develop", optional
except ImportError:
pass
if 'install' in sys.argv and \
'MAKEFLAGS' not in os.environ and \
'RPM_BUILD_ROOT' not in os.environ:
repl = raw_input('WARNING: Please... |
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.properties import NumericProperty, ReferenceListProperty,\
ObjectProperty
from kivy.vector import Vector
from kivy.clock import Clock
from random import randint
class PongBall(Widget):
velocity_x = NumericProperty(0)
velocity_y = Numeri... |
"""
Verifies that msvs_list_excluded_files=0 doesn't list files that would
normally be in _excluded_files, and that if that flag is not set, then they
are still listed.
"""
import os
import TestGyp
test = TestGyp.TestGyp(formats=['msvs'], workdir='workarea_all')
# with the flag set to 0
try:
os.environ['GYP_GENER... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import base64
import socket
import struct
import time
try:
from Crypto.Cipher import AES
except ImportError:
raise RuntimeError("You need to install PyCrypto.")
from . import pkcs7
from .exceptions import UnvalidEncodingAESKey, ... |
"""Tests for tensorflow.ops.math_ops.matrix_solve."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python import tf2
from tensorflow.python.client import session
from tensorflow.python.framework import constant_op
from... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'mr.S'
from kernel.module import Module
from entities.s_contacts import Contacts
from bottle import jinja2_view as view, request
module = Module(name="contacts", route="/admin/contacts", title="Контакты", is_admin=True)
@module.route('')
@view('ad... |
from openerp.osv import fields, osv
from openerp import tools
class sale_report(osv.osv):
_inherit = "sale.report"
_columns = {
'shipped': fields.boolean('Shipped', readonly=True),
'shipped_qty_1': fields.integer('# of Shipped Lines', readonly=True),
'warehouse_id': fields.many2one('sto... |
"""Tests for the context commands."""
from rust_test_common import *
class TestContext(TestBase):
def test_pt_to_test_name(self):
self._with_open_file('tests/multi-targets/tests/test_context.rs',
self._test_pt_to_test_name)
def _test_pt_to_test_name(self, view):
expected = [
... |
"""Python file with invalid syntax, used by scripts/linters/
python_linter_test. This file use datetime.datetime.now() which is not allowed.
"""
from __future__ import absolute_import # pylint: disable=import-only-modules
from __future__ import unicode_literals # pylint: disable=import-only-modules
import datetime
... |
# coding: utf-8
from __future__ import unicode_literals
from collections import OrderedDict
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.db.models import Manager
from django.db.models.query import QuerySet
from django.utils import six
from django.utils.encoding import (
... |
#!/usr/bin/env python2.4
from svc.scripting import *
import sys
import codecs
from xml.dom.minidom import parse
class DXML2TXT(Script):
options = {
'infile': String,
'outfile': String,
}
def transformFile(self, fr, fw):
dom = parse(fr)
for element in dom.getElementsByTagNa... |
"""Tests for `tf.data.Dataset.prefetch()`."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import time
from absl.testing import parameterized
from tensorflow.python.data.kernel_tests import test_base
from tensorflow.python.data.ops import dataset_ops
fr... |
import logging
import json
from django.http import HttpResponse
from django.utils.translation import ugettext as _
from desktop.lib.django_util import render
from indexer.management.commands import indexer_setup
LOG = logging.getLogger(__name__)
def collections(request, is_redirect=False):
return render('colle... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import signal
from abc import ABCMeta, abstractmethod
from functools import wraps
from ansible.errors import AnsibleError, AnsibleConnectionFailure
from ansible.module_utils.six import with_metaclass
try:
from scp import SCP... |
import unittest
class InvalidLangTestCase(unittest.TestCase):
def test_invalid_childname(self):
from kivy.lang import Builder, ParserException
from kivy.factory import FactoryException
try:
Builder.load_string('''
Widget:
FloatLayout:
size: self.parent.size
... |
import unittest
import os
from src.tools.ctags import ctags
class CodeAnalizerTestCase(unittest.TestCase):
def setUp(self):
self.filename = os.path.join(os.path.dirname(__file__),
"c_files", "for_ctags.c")
def test_parse_symbols(self):
symbols_expected =... |
from __future__ import absolute_import
from . import cache_util
from . import shell
@cache_util.cached
def which(cmd):
"""
Return the path to an executable which would be run if
the given cmd was called. If no cmd would be called, return None.
Python 3.3+ provides this behavior via the shutil.which(... |
"""Tests for tensorflow.ops.tf.gather."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import constant_op
from tensorflow.python.framework import dtypes
from tensorflow.python.ops import array_ops
from... |
"""
Test variable expansion of '<|(list.txt ...)' syntax commands.
"""
from __future__ import print_function
import os
import sys
import TestGyp
test = TestGyp.TestGyp(format='gypd')
expect = test.read('filelist.gyp.stdout')
if sys.platform == 'win32':
expect = expect.replace('/', r'\\').replace('\r\n', '\n')
t... |
# -*- coding: utf-8 -*-
from sage.all_cmdline import * # import sage library
_sage_const_2 = Integer(2)
_sage_const_1 = Integer(1)
_sage_const_0 = Integer(0)
_sage_const_4 = Integer(4) #!/usr/bin/env sage
from sage.all import *
# Number of layers
var("m")
assume(m, "integer")
assume(m > _sage_const_0)
# Number o... |
import sys, os, threading
from gi.repository import Gtk, Vte, GLib, Gdk, GObject
from archinstallergui import ArchInstallerGui
def feed_command(cmd):
return term.feed_child(cmd, len(cmd))
def feed_archey(bt):
feed_command("archey\n")
def main():
GObject.threads_init()
Gdk.threads_init()
win = ArchInstallerGui... |
import os
import sys
sys.path.insert(0, os.getcwd())
import argparse
import mlperf_loadgen as lg
import subprocess
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("--backend", choices=["tf","pytorch","onnxruntime","tf_estimator"], default="tf", help="Backend")
parser.add_argument("... |
import base64
import traceback
from bcloud.log import logger
def decode_flashget(link):
try:
l = base64.decodestring(link[11:len(link)-7].encode()).decode()
except ValueError:
logger.warn(traceback.format_exc())
l = base64.decodestring(link[11:len(link)-7].encode()).decode('gbk')
r... |
import os
import json
import time
import logging
try:
import urllib.request as urllib2
except ImportError:
import urllib2
log = logging.getLogger("travis.leader")
log.addHandler(logging.StreamHandler())
log.setLevel(logging.INFO)
TRAVIS_JOB_NUMBER = 'TRAVIS_JOB_NUMBER'
TRAVIS_BUILD_ID = 'TRAVIS_BUILD_ID'
POL... |
"""
Accessibility tests for LMS dashboard page.
Run just this test with:
SELENIUM_BROWSER=phantomjs paver test_bokchoy -d accessibility -t test_lms_dashboard_axs.py
"""
from ..tests.lms.test_lms_dashboard import BaseLmsDashboardTest
class LmsDashboardAxsTest(BaseLmsDashboardTest):
"""
Class to test lms stude... |
"""tf.data.Dataset interface to the MNIST dataset."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gzip
import os
import shutil
import tempfile
import numpy as np
from six.moves import urllib
import tensorflow as tf
def read32(bytestream):
""... |
from __future__ import absolute_import
import os
import re
from django.utils.unittest import TestCase
from django.contrib.gis.db.models import Union, Extent3D
from django.contrib.gis.geos import GEOSGeometry, Point, Polygon
from django.contrib.gis.utils import LayerMapping, LayerMapError
from .models import (City3D,... |
from .sub_resource import SubResource
class SecurityRule(SubResource):
"""Network security rule.
All required parameters must be populated in order to send to Azure.
:param id: Resource ID.
:type id: str
:param description: A description for this rule. Restricted to 140 chars.
:type descript... |
"""aliases for the bot"""
import logging
import plugins
logger = logging.getLogger(__name__)
def _initialise(bot):
"""load in bot aliases from memory, create defaults if none"""
if bot.memory.exists(["bot.command_aliases"]):
bot_command_aliases = bot.memory.get("bot.command_aliases")
else:
... |
from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type, string_types
import gettext
_ = gettext.gettext
from xml.dom import Node
DOCUMENT = Node.DOCUMENT_NODE
DOCTYPE = Node.DOCUMENT_TYPE_NODE
TEXT = Node.TEXT_NODE
ELEMENT = Node.ELEMENT_NODE
COMMENT = Node.COMMENT_N... |
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# Forward declared intermediate model
@python_2_unicode_compatible
class Membership(models.Model):
person = models.ForeignKey('Person')
... |
"""
Tools for formatting logging events.
"""
from datetime import datetime as DateTime
from twisted.python.compat import unicode
from twisted.python.failure import Failure
from twisted.python.reflect import safe_repr
from twisted.python._tzhelper import FixedOffsetTimeZone
from ._flatten import flatFormat, aFormatte... |
'''
New Simulator Test for Multi-ISO.
@author: Legion
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import time
test_obj_dict = test_state.TestStateDict()
test_stub = test_lib.lib_get_test_stub()
multi_iso = test_stub... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import math
import collections
from ansible import errors
def unique(a):
if isinstance(a,collections.Hashable):
c = set(a)
else:
c = []
for x in a:
if x not in c:
c.appe... |
# -*- coding: utf-8 -*-
from tempfile import NamedTemporaryFile
import mock
from mock import patch
from requests import RequestException
from tests import TestCase
import requests_mock
from yarn_api_client import hadoop_conf
import platform
import os
import sys
if sys.version_info[0] == 2:
_mock_exception_method... |
from core import perf_benchmark
from benchmarks import silk_flags
import ct_benchmarks_util
from measurements import smoothness
import page_sets
from telemetry import benchmark
class _Repaint(perf_benchmark.PerfBenchmark):
@classmethod
def AddBenchmarkCommandLineArgs(cls, parser):
parser.add_option('--mode',... |
__author__ = "Julian Debatin"
__copyright__ = "The authors"
__license__ = "Apache 2"
__email__ = "<EMAIL>"
__status__ = "Production"
from ModuroModel.Spa.SpaPcdbCdiInUa import SpaPcdbCdiInUa
class SpaPcdbCdiInDa(SpaPcdbCdiInUa):
def __init__(self, sim, simthread):
SpaPcdbCdiInUa.__init__(self, sim, simth... |
# coding: utf-8
from __future__ import absolute_import, unicode_literals
import datetime
import pytz
import factory
from django.contrib.auth.models import User
from django.template.defaultfilters import slugify
from django.conf import settings
from elephantblog.models import Entry, Category, CategoryTranslation
... |
from __future__ import print_function
import unittest as ut
import espressomd
import numpy as np
@ut.skipIf(not espressomd.has_features("HAT"),"Skipped because feature is disabled")
class HatTest(ut.TestCase):
def force(self, F_max, r_cut, r):
if r > 0 and r < r_cut:
return F_max * (1. - r/r_cu... |
"""GWT/Java library generator based on RequestFactory."""
__author__ = '<EMAIL> (Bob Vawter)'
from googleapis.codegen import java_generator
from googleapis.codegen import utilities
from googleapis.codegen.import_definition import ImportDefinition
class GwtGenerator(java_generator.BaseJavaGenerator):
"""The GWT co... |
"""
Custom Logger for SickRage
"""
from __future__ import unicode_literals
import io
import locale
import logging
import logging.handlers
import os
import platform
import re
import sys
import threading
import traceback
from logging import NullHandler
from urllib import quote
from github import InputFileContent
impo... |
from enum import IntEnum, unique
from time import time
from logbook import Logger
VALIDITY = 24 * 60 * 60 # Price validity period, 24 hours
REREQUEST = 4 * 60 * 60 # Re-request delay for failed fetches, 4 hours
TIMEOUT = 15 * 60 # Network timeout delay for connection issues, 15 minutes
pyfalog = Logger(__name__... |
from bisect import bisect_left
from collections import defaultdict
from itertools import chain
from logging import warning
from os.path import getsize
from subprocess import check_output
from time import strftime
from traceback import format_exc
from warnings import warn
from ._mdl import parse_error
from ._mdl import ... |
"""
:mod:`sof` --- SIBRA Opaque Field
=================================
"""
# Stdlib
import struct
# SCION
from lib.crypto.symcrypto import mac
from lib.defines import (
SIBRA_STEADY_ID_LEN,
SIBRA_EPHEMERAL_ID_LEN,
)
from lib.sibra.ext.info import ResvInfoBase
from lib.packet.packet_base import Serializable
fr... |
# coding: utf-8
"""Data lookup operations for MDN parsing."""
from __future__ import unicode_literals
from collections import namedtuple
from webplatformcompat.models import (
Browser, Feature, Section, Specification, Support, Version)
from .utils import is_new_id, normalize_name, slugify
class Data(object):
... |
from __future__ import absolute_import
from django.test import TestCase
from django.contrib.contenttypes.models import ContentType
from ..models import Author, Article, UrlArticle
class DefaultsTests(TestCase):
"""Test django views in django/views/defaults.py"""
fixtures = ['testdata.json']
non_existing... |
import os
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('OsmGpsMap', '1.0')
from gi.repository import GLib
from gi.repository import Gtk
from gi.repository import Gdk
from gi.repository import GObject
from gi.repository import OsmGpsMap
from . import stats
from gpxpy import parse
from gpxpy.gpx im... |
"""
Copyright (c) 2014-2015 F-Secure
See LICENSE for details
"""
from resource_api.errors import AuthorizationError, DoesNotExist, ValidationError
from .base_test import BaseTest
# NOTE: here we access self.entry_point._user to avoid test code duplication. In real life it should not be done.
class ResourceAuthoriz... |
#AUTHORS: Douman (<EMAIL>)
#CONTRIBUTORS: Diego de las Heras (<EMAIL>)
from novaprinter import prettyPrinter
from helpers import retrieve_url, download_file
from re import compile as re_compile
from html.parser import HTMLParser
class torlock(object):
url = "https://www.torlock.com"
name = "TorLock"
suppo... |
import numpy as np
import cv2
class Unbuffered(object):
def __init__(self, stream):
self.stream = stream
def write(self, data):
self.stream.write(data)
self.stream.flush()
def __getattr__(self, attr):
return getattr(self.stream, attr)
import sys
sys.stdout = Unbuffered(sys.stdout)... |
__all__ = ['montage2d']
import numpy as np
from .. import exposure
EPSILON = 1e-6
def montage2d(arr_in, fill='mean', rescale_intensity=False, grid_shape=None):
"""Create a 2-dimensional 'montage' from a 3-dimensional input array
representing an ensemble of equally shaped 2-dimensional images.
For examp... |
import io
import os
import setuptools
name = "google-cloud-recommender"
description = "Cloud Recommender API client library"
version = "2.2.0"
release_status = "Development Status :: 5 - Production/Stable"
dependencies = [
"google-api-core[grpc] >= 1.26.0, <2.0.0dev",
"proto-plus >= 1.10.0",
"packaging >=... |
"""TensorFlow Learn Utils (deprecated).
This module and all its submodules are deprecated. See
[contrib/learn/README.md](https://www.tensorflow.org/code/tensorflow/contrib/learn/README.md)
for migration instructions.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import pri... |
"""Support for the CO2signal platform."""
import logging
import CO2Signal
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
ATTR_ATTRIBUTION,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_TOKEN,
ENERGY_KILO_WATT_HOUR,
)
import homeassistan... |
from openerp.osv import fields,osv
from openerp.osv import orm
from openerp.tools.translate import _
def _get_answers(cr, uid, ids):
"""
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
@param ids: List of crm profiling’s IDs """
... |
import os
import platform
import random
import socket
import subprocess
import sys
import tempfile
sys.path.insert(0, '../')
import mongo_orchestration.process as process
from mongo_orchestration.errors import TimeoutError
from nose.plugins.attrib import attr
from tests import unittest, SkipTest
@attr('process')
... |
''' Convenience class for writing cron scripts'''
# pylint: disable=R0903
# Copyright 2014 42Lines, Inc.
# Original Author: Jim Browne
#
# 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
#
# ... |
from Tkinter import *
class Elevator():
lift_in_row = None
class Floor():
state_machine = {'moveup': 'green', 'movedown': 'green', 'stay': 'red', 'clear': 'white', 'open': 'blue'}
def __init__(self, canvas, floor_no, height):
self.canvas = canvas
self.rec = can... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para jumbofiles
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core i... |
from Screens.Screen import Screen
from Screens.ChoiceBox import ChoiceBox
from Screens.InputBox import InputBox
from Screens.MessageBox import MessageBox
from Screens.HelpMenu import HelpableScreen
from Components.ActionMap import HelpableActionMap, ActionMap
from Components.Sources.List import List
from Components.Sou... |
import datetime
import re
from bs4 import BeautifulSoup, Comment
from django.contrib.sites.models import Site
from django.template import Library
from django.utils.encoding import force_unicode
from django.utils.html import urlize
from django.utils.safestring import mark_safe
import lxml.html
register = Library()
... |
# -*- coding: utf-8 -*-
"""
werkzeug.security
~~~~~~~~~~~~~~~~~
Security related helpers such as secure password hashing tools.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import os
import hmac
import hashlib
import posi... |
from selenium.webdriver.common.keys import Keys
from tests.integration.tests.test_booleaninput import Test as TestBooleanInput
from . import VisualTest
class Test(VisualTest):
urls = TestBooleanInput.urls
def test_test_default_usecase(self):
self.driver.get('%s%s' % (self.live_server_url, TestBoolea... |
from cpp_type_generator import CppTypeGenerator
from json_schema import CachedLoad
import model
import unittest
from collections import defaultdict
class _FakeSchemaLoader(object):
def __init__(self, model):
self._model = model
def ResolveType(self, type_name, default):
parts = type_name.rsplit('.', 1)
... |
import re, time, random
from openerp import api
from openerp.osv import fields, osv
from openerp.tools.translate import _
import logging
_logger = logging.getLogger(__name__)
"""
account.invoice object:
- Add support for Belgian structured communication
- Rename 'reference' field labels to 'Communica... |
import math, logging
from . import bus, tmc
TMC_FREQUENCY=13200000.
Registers = {
"GCONF": 0x00, "GSTAT": 0x01, "IOIN": 0x04, "IHOLD_IRUN": 0x10,
"TPOWERDOWN": 0x11, "TSTEP": 0x12, "TPWMTHRS": 0x13, "TCOOLTHRS": 0x14,
"THIGH": 0x15, "XDIRECT": 0x2d, "MSLUT0": 0x60, "MSLUTSEL": 0x68,
"MSLUTSTART": 0x69... |
"""Definitions for the `BNSEjecta` class."""
# import astropy.constants as c
import numpy as np
from astrocats.catalog.source import SOURCE
from mosfit.constants import FOE, KM_CGS, M_SUN_CGS, C_CGS, G_CGS
from mosfit.modules.energetics.energetic import Energetic
# G_CGS = c.G.cgs.value
class BNSEjecta(Energetic):... |
"""
WSGI config for forocacao 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`... |
"""
Internationalization support.
"""
from __future__ import unicode_literals
import re
from django.utils.encoding import force_text
from django.utils.functional import lazy
from django.utils import six
__all__ = [
'activate', 'deactivate', 'override', 'deactivate_all',
'get_language', 'get_language_from_requ... |
'''This module contains utilities for following up search triggers'''
# JavaScript for searching the aLOG
redirect_javascript = """<script type="text/javascript">
function redirect(form,way)
{
// Set location to form and submit.
if(form != '')
{
document.forms[form].action=way;
... |
#!/usr/bin/env python
# File created on 09 Feb 2010
from __future__ import division
__author__ = "Rob Knight"
__copyright__ = "Copyright 2011, The QIIME Project"
__credits__ = ["Rob Knight", "Daniel McDonald", "Kyle Bittinger"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Kyle Bittinger"
__email__ =... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from os import path, walk
import re
from ansible.errors import AnsibleError
from ansible.module_utils.six import string_types
from ansible.module_utils._text import to_native, to_text
from ansible.plugins.action import ActionBase
... |
"""
Configuration options registration and useful routines.
"""
from oslo_config import cfg
import st2common.config as common_config
from st2common.constants.system import VERSION_STRING
CONF = cfg.CONF
def parse_args(args=None):
CONF(args=args, version=VERSION_STRING)
def register_opts():
_register_comm... |
import account_asset_report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
from PyQt4.QtCore import pyqtSignature
from PyQt4.QtGui import QWidget
from profit.lib import Signals
from profit.lib.widgets.ui_filterbar import Ui_FilterBar
class FilterBar(QWidget, Ui_FilterBar):
""" Widget with filter line edit and clear button.
"""
def __init__(self, parent=None):
""" Const... |
__author__ = 'Batchu Vishal'
import pygame
class OnBoard(pygame.sprite.Sprite):
'''
This class defines all inanimate objects that we need to display on our board.
Any object that is on the board and not a person, comes under this class (ex. Coins,Ladders,Walls etc)
Sets up the image and its position f... |
import re
import getpass
import sys
import os
import mimetypes
import shutil
import tempfile
from pip.backwardcompat import (md5, copytree, xmlrpclib, urllib, urllib2,
urlparse, string_types, HTTPError)
from pip.exceptions import InstallationError
from pip.util import (splitext, rmtree,
... |
# -*- encoding: utf-8 -*-
"""Test for Compute Resource UI
:Requirement: Computeresource Libvirt
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: ComputeResources-libvirt
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from random import choice
from fauxfactory import gen_string
fr... |
from __future__ import print_function
import sys
sys.path.insert(1,"../../")
from tests import pyunit_utils
from h2o.assembly import *
from h2o.utils.typechecks import assert_is_type
def h2oassembly_divide():
"""
Python API test: test all H2OAssembly static methods and they are:
H2OAssembly.divide(frame1, ... |
import pyarrow as pa
import numpy as np
import cv2
import base64
def get_field_and_data(key, value):
if isinstance(value, list):
assert len(value) > 0, "empty list is not supported"
sample = value[0]
if isinstance(sample, str):
# list of string will be converted to Tensor of St... |
"""
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... |
# -*- coding: utf-8 -*-
from django.conf.urls import url, patterns
from tcms.testcases.views import SimpleTestCaseView
from tcms.testcases.views import TestCaseCaseRunDetailPanelView
from tcms.testcases.views import TestCaseCaseRunListPaneView
from tcms.testcases.views import TestCaseReviewPaneView
from tcms.testcase... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.