content string |
|---|
"""\
Acora - a multi-keyword search engine based on Aho-Corasick trees.
Usage::
>>> from acora import AcoraBuilder
Collect some keywords::
>>> builder = AcoraBuilder('ab', 'bc', 'de')
>>> builder.add('a', 'b')
Generate the Acora search engine::
>>> ac = builder.build()
Search a string for all occ... |
"""
GUI-specific interface functions for Flock on Microsoft Windows.
"""
__revision__ = "$Rev$"
__date__ = "$Date$"
__author__ = "$Author$"
import os
import time
from win32com.shell import shellcon
from win32com.shell import shell
from shotfactory04.gui import windows
class Gui(windows.Gui):
"""
Special fun... |
"""This Module Parse xls/xslx files and return data in json."""
import xlrd, datetime
from collections import OrderedDict
import simplejson as json
""" This function take 5 arguments:
inp = Input file
outp = Output file
sheet = Worksheet to work with in input file.
start = Starting row
end = Endin... |
""" This script converts a file into a format that
doxygen can understand and process. It can be used
as an INPUT_FILTER in doxygen. """
import sys, os
# Explicitly include these files. Besides these, all
# files ending in _src will be explicitly included too.
INCLUDE_FILES = ["fltnames.h", "dblnames.h",
... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import os
import re
from ansible.module_utils._text import to_text
from ansible.module_utils.basic import env_fallback
from ansible.module_utils.connection import exec_command
from ansible.module_utils.network.common.utils import to... |
import wsme
from wsme import types
from glance.api.v2.model.metadef_property_item_type import ItemType
from glance.common.wsme_utils import WSMEModelTransformer
class PropertyType(types.Base, WSMEModelTransformer):
# When used in collection of PropertyTypes, name is a dictionary key
# and not included as sep... |
from openerp.osv import fields, osv
class lunch_order_order(osv.TransientModel):
""" lunch order meal """
_name = 'lunch.order.order'
_description = 'Wizard to order a meal'
def order(self,cr,uid,ids,context=None):
return self.pool.get('lunch.order.line').order(cr, uid, ids, context=context) |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Tic-Tac-Toe
# Plays the game of tic-tac-toe against a human opponent
# global constants
X = "X"
O = "O"
EMPTY = " "
TIE = "TIE"
NUM_SQUARES = 9
def display_instruct():
"""Display game instructions."""
print(
"""
Welcome to the greatest intellectual cha... |
from openerp import fields, models, api, _
from openerp.exceptions import ValidationError
import logging
_logger = logging.getLogger(__name__)
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
@api.model
def _compute_dispense_qty(self, ):
rx_line = self.prescription_order_line_id
... |
'''
@author: MengLai
'''
import os
import tempfile
import uuid
import time
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
test_stub = test_lib.lib_get_test_stub()
test_obj_dict = test_state.TestStateDict()
tm... |
from __future__ import absolute_import, division, print_function
import os, struct, sys, time
from serial import Serial
from serial import SerialException
from builtins import range
from . import ispBase, intelHex
class Stk500v2(ispBase.IspBase):
def __init__(self):
self.serial = None
self.seq = 1
self.lastAd... |
""" Python 'raw-unicode-escape' Codec
Written by Marc-Andre Lemburg (<EMAIL>).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
class Codec(codecs.Codec):
# Note: Binding these as C functions will result in the class not
# converting them to methods. This is intended... |
"""These functions are executed via gyp-flock-tool when using the Makefile
generator. Used on systems that don't have a built-in flock."""
import fcntl
import os
import struct
import subprocess
import sys
def main(args):
executor = FlockTool()
executor.Dispatch(args)
class FlockTool(object):
"""This class e... |
#!python
# coding=utf-8
from copy import copy
from collections import OrderedDict
import numpy as np
import pandas as pd
from pocean.utils import (
create_ncvar_from_series,
dict_update,
downcast_dataframe,
generic_masked,
get_default_axes,
get_dtype,
get_mapped_axes_variables,
get_mas... |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from scipy import special
from scipy import stats
from tensorflow.contrib.distributions.python.ops import gamma as gamma_lib
from tensorflow.contrib.distributions.python.ops import kullback_... |
from unittest import TestCase
from DownloaderForReddit.utils.importers import text_importer
class TestTextImporter(TestCase):
def test_remove_forbidden_chars(self):
text = ' this \n is a\nname-for-import '
clean = text_importer.remove_forbidden_chars(text)
self.assertEqual('thisisaname-... |
import copy
class TestConfiguration(object):
def __init__(self, version, architecture, build_type):
self.version = version
self.architecture = architecture
self.build_type = build_type
@classmethod
def category_order(cls):
"""The most common human-readable order in which t... |
"""Contains extensions to Atom objects used with Google Spreadsheets.
"""
__author__ = '<EMAIL> (Laura Beth Lincoln)'
try:
from xml.etree import cElementTree as ElementTree
except ImportError:
try:
import cElementTree as ElementTree
except ImportError:
try:
from xml.etree import ElementTree
e... |
import os
import sys
import argparse
try:
import boto.s3
except:
raise RuntimeError("""
S3 upload requires boto to be installed
Use one of:
'pip install -U boto'
'apt-get install python-boto'
'easy_install boto'
""")
import boto.s3
def list_buckets(conn):
return conn.get_all_buckets()... |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
import re
import time
HAS_PB_SDK = True
try:
from profitbricks.client import ProfitBri... |
from measurements import record_per_area
from telemetry.core import wpr_modes
from telemetry.unittest import options_for_unittests
from telemetry.unittest import page_test_test_case
from telemetry.unittest import test
class RecordPerAreaUnitTest(page_test_test_case.PageTestTestCase):
"""Smoke test for record_per_ar... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Python-nvd3 is a Python wrapper for NVD3 graph library.
NVD3 is an attempt to build re-usable charts and chart components
for d3.js without taking away the power that d3.js gives you.
Project location : https://github.com/areski/python-nvd3
"""
from .NVD3Chart import NVD... |
#!/usr/bin/python
#coding:utf-8
import mybaselib
import logging
import jieba
import jieba.analyse
import numpy as np
import csv
import sys
import stat
import os
import re
reload(sys)
sys.setdefaultencoding('utf-8')
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
class Row(object):
def __init__(s... |
"""Xcode-ninja wrapper project file generator.
This updates the data structures passed to the Xcode gyp generator to build
with ninja instead. The Xcode project itself is transformed into a list of
executable targets, each with a build step to build with ninja, and a target
with every source and resource file. This a... |
#!/usr/bin/env python
from ROOT import TMVA, TFile, TTree, TCut, gROOT
from os.path import isfile
from keras.models import Sequential
from keras.layers.core import Dense, Activation
from keras.regularizers import l2
from keras import initializations
from keras.optimizers import SGD
# Setup TMVA
TMVA.Tools.Instance()... |
from core.loggers import log
from distutils import spawn
from core import messages
import subprocess
# Minify PHP code removing white spaces and comments.
# Returns None in case of errors.
def minify_php(original_code):
php_binary = spawn.find_executable('php')
if not php_binary:
log.debug(messages.u... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
from ansible.module_utils.basic import AnsibleModule
try:
from ansible.module_utils.network.avi.avi import (
avi_common_argument_spec, HAS_AVI, avi_ansible_api)
except ... |
from collections import MutableMapping
from threading import RLock
try: # Python 2.7+
from collections import OrderedDict
except ImportError:
from .packages.ordered_dict import OrderedDict
__all__ = ['RecentlyUsedContainer']
_Null = object()
class RecentlyUsedContainer(MutableMapping):
"""
Provid... |
import re
import os
import sys
from pybindgen.typehandlers import base as typehandlers
from pybindgen import ReturnValue, Parameter
from pybindgen.cppmethod import CustomCppMethodWrapper, CustomCppConstructorWrapper
from pybindgen.typehandlers.codesink import MemoryCodeSink
from pybindgen.typehandlers import ctypepars... |
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'G:i'
DATETIME_FORMAT = 'j. F Y G:i'
YEAR_MONTH_FORMAT = 'F Y'
MONTH_DAY_FORMAT = 'j. F'
SHORT_DATE_FORMAT = 'd.m.Y'
SHORT_DATETIME_FORMAT = 'd.m.Y G:i'
FIRST_DAY_OF_WEEK = 1 # Monday
# The *_INPUT_FORMATS strings use the Python strftime format syntax,
# see http://docs.python.org... |
"""API for the network abstraction APIs.
"""
from django.views import generic
from openstack_dashboard import api
from openstack_dashboard.api.rest import urls
from openstack_dashboard.api.rest import utils as rest_utils
@urls.register
class SecurityGroups(generic.View):
"""API for Network Abstraction
Hand... |
class Getch:
"""
Gets a single character from standard input. Does not echo to
the screen.
"""
def __init__(self):
try:
self.impl = _GetchWindows()
except ImportError:
try:
self.impl = _GetchMacCarbon()
except(AttributeError, Impo... |
import model.base
import tornado.gen
import json
from MySQLdb import escape_string
class Snippet(object):
@staticmethod
@tornado.gen.coroutine
def get_snippets(id_from, count):
result = yield model.MatrixDB.query("select * from snippet_snippet order by createAt desc limit {0}, {1}".format(id_from,... |
# -*- coding: utf-8 -*-
"""
Setup Tool
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
def index():
""" Show the index """
return dict()
# ----------------------------------------------------------... |
"""Platform for Flexit AC units with CI66 Modbus adapter."""
import logging
from typing import List
from pyflexit.pyflexit import pyflexit
import voluptuous as vol
from homeassistant.components.climate import PLATFORM_SCHEMA, ClimateEntity
from homeassistant.components.climate.const import (
HVAC_MODE_COOL,
S... |
from optparse import make_option
from django.conf import settings
from django.db import connections, router, transaction, models, DEFAULT_DB_ALIAS
from django.core.management import call_command
from django.core.management.base import NoArgsCommand, CommandError
from django.core.management.color import no_style
from d... |
from nova.api.openstack import common
from nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import compute
from nova import exception
ALIAS = "os-server-diagnostics"
authorize = extensions.os_compute_authorizer(ALIAS)
class ServerDiagnosticsController(wsgi.Controller):
def __in... |
import sys
from oslo_config import cfg
from oslo_log import log as logging
from neutron.agent.common import config
from neutron.common import config as common_config
from neutron.i18n import _LI
from neutron.plugins.hyperv.agent import config as hyperv_config
from neutron.plugins.hyperv.agent import l2_agent
LOG = l... |
ANSIBLE_METADATA = {'metadata_version': '1.0',
'status': ['preview'],
'supported_by': 'community'}
RETURNS = '''
name:
description: Name of the Blueprint
returned: always
type: str
sample: My-Blueprint
id:
description: AOS unique ID assigned to the Blueprint
return... |
import math
def _float_check_precision(precision_digits=None, precision_rounding=None):
assert (precision_digits is not None or precision_rounding is not None) and \
not (precision_digits and precision_rounding),\
"exactly one of precision_digits and precision_rounding must be specified"
if pr... |
# PYTHON_ARGCOMPLETE_OK
"""
pytest: unit and functional testing with Python.
"""
# else we are imported
from _pytest.config import main, UsageError, cmdline, hookspec, hookimpl
from _pytest.fixtures import fixture, yield_fixture
from _pytest.assertion import register_assert_rewrite
from _pytest.freeze_support import... |
import ir_model
import res_users
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
import locale
import os
import subprocess
import sys
import tempfile
import unittest
class Error(Exception):
"""Base class for errors in this module."""
pass
class ArgumentError(Error):
"""A function received a bad argument."""
pass
class EnvVarUndefinedError(Error):
"""An expected environment variable ... |
from celery.task.control import inspect
# def setup_task(service):
# service.app = app
# print(service)
# result = None
# if service.query_predicate == self.NS.whyis.globalChangeQuery:
# result = process_resource
# else:
# result = process_nanopub
# result.service = lambda : se... |
""" Automatic installation screen """
from gi.repository import Gtk
import os
import sys
import logging
if __name__ == '__main__':
# Insert the parent directory at the front of the path.
# This is used only when we want to test this screen
base_dir = os.path.dirname(__file__) or '.'
parent_dir = os.pa... |
from sympy.mpmath import *
def test_special():
assert inf == inf
assert inf != -inf
assert -inf == -inf
assert inf != nan
assert nan != nan
assert isnan(nan)
assert --inf == inf
assert abs(inf) == inf
assert abs(-inf) == inf
assert abs(nan) != abs(nan)
assert isnan(inf - in... |
import time
from datetime import datetime
from openerp.osv import fields, osv
from openerp.tools.translate import _
class hr_action_reason(osv.osv):
_name = "hr.action.reason"
_description = "Action Reason"
_columns = {
'name': fields.char('Reason', required=True, help='Specifies the reason for S... |
# -*- coding: utf-8 -*-
"""
Tests for xblock_utils.py
"""
import unittest
from uuid import UUID
from django.conf import settings
from openedx.core.lib import blockstore_api as api
# A fake UUID that won't represent any real bundle/draft/collection:
BAD_UUID = UUID('12345678-0000-0000-0000-000000000000')
@unittest.... |
#!/usr/bin/env python2
import ctypes
from ctypes import byref
from time import sleep
class SensorData(ctypes.Structure):
_fields_ = (
('a', ctypes.c_uint16),
('b', ctypes.c_uint16),
('c', ctypes.c_uint8),
('d', ctypes.c_double),
('e', ctypes.c_uint32),
)
class Thrus... |
"""Config flow for Soma."""
import logging
from api.soma_api import SomaApi
from requests import RequestException
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_HOST, CONF_PORT
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
DEFAULT_PORT = 300... |
import logging
import os
import sys
import subprocess
import time
_suffixes = [
[("k", "kb"), 0],
[("m", "mb"), 0],
[("g", "gb"), 0],
[("t", "tb"), 0],
]
log = logging.getLogger(__name__)
for i, s in enumerate(_suffixes):
if i == 0:
s[1] = 1024
else:
s[1] = _suffixes[i-1][1] * 1024
def human_size(size):
... |
import unittest
import simplejson as json
class ForJson(object):
def for_json(self):
return {'for_json': 1}
class NestedForJson(object):
def for_json(self):
return {'nested': ForJson()}
class ForJsonList(object):
def for_json(self):
return ['list']
class DictForJson(dict):
... |
import numpy as np
from itertools import product, chain
from splipy import Surface, Volume, SplineObject, BSplineBasis
from splipy import surface_factory, volume_factory, curve_factory
from splipy.io import G2
from splipy.utils import ensure_listlike
from .master import MasterIO
import re
import warnings
from scipy.spa... |
import json
import pytest
from pynYNAB.Client import nYnabClient
from pynYNAB.ClientFactory import nYnabClientFactory
from pynYNAB.exceptions import NoBudgetNameException
from pynYNAB.schema.catalog import BudgetVersion
class MockConnection2(object):
id = '12345'
@pytest.fixture
def factory():
return nYna... |
from __future__ import unicode_literals, division, absolute_import
import re
import copy
import logging
log = logging.getLogger('utils.qualities')
class QualityComponent(object):
""""""
def __init__(self, type, value, name, regexp=None, modifier=None, defaults=None):
"""
:param type: Type of ... |
"""
Enrollment API for creating, updating, and deleting enrollments. Also provides access to enrollment information at a
course level, such as available course modes.
"""
import importlib
import logging
from django.conf import settings
from django.core.cache import cache
from opaque_keys.edx.keys import CourseKey
fr... |
import json
from flask import current_app as app
from superdesk import get_resource_service
from superdesk.services import BaseService
from eve.utils import ParsedRequest
from superdesk.notification import push_notification
from apps.archive.common import get_user
from eve.utils import config
from superdesk.utc import ... |
#!/usr/bin/env python
"""
This script generated test_cases for test_distribution_version.py.
To do so it outputs the relevant files from /etc/*release, the output of distro.linux_distribution()
and the current ansible_facts regarding the distribution version.
This assumes a working ansible version in the path.
"""
... |
"Some automation of Windows Media player"
__revision__ = "$Revision$"
#import os
import time
import sys
try:
from pywinauto import application
except ImportError:
import os.path
pywinauto_path = os.path.abspath(__file__)
pywinauto_path = os.path.split(os.path.split(pywinauto_path)[0])[... |
from datetime import datetime
import re
import random
import asyncio
import functools
import urllib.parse
import requests
from cloudbot import hook
from cloudbot.util import timeformat, formatting
reddit_re = re.compile(r'.*(((www\.)?reddit\.com/r|redd\.it)[^ ]+)', re.I)
base_url = "http://reddit.com/r/{}/.json"
s... |
import pytest
from yandextank.stepper.load_plan import create, Const, Line, Composite, Stairway, StepFactory
from yandextank.stepper.util import take
class TestLine(object):
def test_get_rps_list(self):
lp = create(["line(1, 100, 10s)"])
rps_list = lp.get_rps_list()
assert len(rps_list) ==... |
"""fuse_gmock_files.py v0.1.0
Fuses Google Mock and Google Test source code into two .h files and a .cc file.
SYNOPSIS
fuse_gmock_files.py [GMOCK_ROOT_DIR] OUTPUT_DIR
Scans GMOCK_ROOT_DIR for Google Mock and Google Test source
code, assuming Google Test is in the GMOCK_ROOT_DIR/../googletest
... |
"""
Tests for geography support in PostGIS 1.5+
"""
import os
from django.contrib.gis import gdal
from django.contrib.gis.measure import D
from django.test import TestCase
from models import City, County, Zipcode
class GeographyTest(TestCase):
def test01_fixture_load(self):
"Ensure geography features load... |
# Python Standard Library Imports
import logging
# External Imports
from sqlalchemy import Column
from sqlalchemy import String, INTEGER, FLOAT
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
# Custom Imports
import c... |
# coding: utf-8
from __future__ import division, unicode_literals
"""
This module provides conversion between the Atomic Simulation Environment
Atoms object and pymatgen Structure objects.
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "1.0"
__maintainer__ = ... |
"""
The ``Parser`` tries to convert the available Python code in an easy to read
format, something like an abstract syntax tree. The classes who represent this
tree, are sitting in the :mod:`jedi.parser.tree` module.
The Python module ``tokenize`` is a very important part in the ``Parser``,
because it splits the code ... |
"""
This file contains implementation override of SearchFilterGenerator which will allow
* Filter by all courses in which the user is enrolled in
"""
from microsite_configuration import microsite
from student.models import CourseEnrollment
from search.filter_generator import SearchFilterGenerator
from openedx.core... |
from __future__ import absolute_import
import os
from six.moves.urllib.request import pathname2url
from django.conf import settings
from django.contrib.staticfiles.storage import staticfiles_storage
from django import template
from horizon import themes as hz_themes
register = template.Library()
def get_theme(req... |
import json
from odoo import models
from odoo.http import request
import odoo
class Http(models.AbstractModel):
_inherit = 'ir.http'
def webclient_rendering_context(self):
return {
'menu_data': request.env['ir.ui.menu'].load_menus(request.debug),
'session_info': json.dumps(s... |
import datetime
import time
from collections import defaultdict
import django_filters
from django.conf import settings
from rest_framework import (exceptions,
filters,
pagination,
viewsets)
from rest_framework.response import Response
... |
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.flatpages.models import FlatPage
from django.contrib.sites.models import Site
from django.test import TestCase, modify_settings, override_settings
from .settings import FLATPAGES_TEMPLATES
class TestDataMixin(object):
... |
import unittest
import json
import flask
import friendsNet.resources as resources
import friendsNet.database as database
DB_PATH = 'db/friendsNet_test.db'
ENGINE = database.Engine(DB_PATH)
COLLECTION_JSON = "application/vnd.collection+json"
HAL_JSON = "application/hal+json"
MEDIA_ITEM_PROFILE = "/profiles/media_item... |
#!/usr/bin/env python
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test
class Tox(test):
def finalize_options(self):
test.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import tox
... |
try:
from thread import get_ident as _get_ident
except ImportError:
from dummy_thread import get_ident as _get_ident
try:
from _abcoll import KeysView, ValuesView, ItemsView
except ImportError:
pass
class OrderedDict(dict):
'Dictionary that remembers insertion order'
# An inherited dict maps ... |
"""Tests for the document fields."""
import copy
import unittest
from grow.documents import document_fields
class DocumentFieldsTestCase(unittest.TestCase):
def testContains(self):
doc_fields = document_fields.DocumentFields({
'foo': 'bar',
}, None)
self.assertEquals(True, '... |
'''
DOCUMENTATION:
cache: yaml
short_description: File backed, using Python's pickle.
description:
- File backed cache that uses Python's pickle serialization as a format, the files are per host.
version_added: "2.3"
author: Brian Coca (@bcoca)
'''
# Make coding more python3-ish
from __futu... |
"""Fixtures for use with gabbi tests."""
from __future__ import absolute_import
import logging
import os
import shutil
import subprocess
import tempfile
import threading
import time
from unittest import case
import uuid
import warnings
import fixtures
from gabbi import fixture
import numpy
from oslo_config import cf... |
"""py.test hacks to support XFAIL/XPASS"""
from __future__ import print_function, division
import sys
import functools
import os
from sympy.core.compatibility import get_function_name
try:
import py
from py.test import skip, raises
USE_PYTEST = getattr(sys, '_running_pytest', False)
except ImportError:
... |
from distutils.core import Extension
import os
import sys
from lib.cpy_distutils import (
Install, InstallLib, BuildExtDynamic, BuildExtStatic
)
# Development Status Trove Classifiers significant for Connector/Python
DEVELOPMENT_STATUSES = {
'a': '3 - Alpha',
'b': '4 - Beta',
'rc': '4 - Beta', # Ther... |
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._text import to_native
from ansible.module_utils.aws.batch import... |
import os
import subprocess
import threading
from telemetry.core import util
from telemetry.core.backends.chrome import android_browser_finder
from telemetry.core.platform import profiler
util.AddDirToPythonPath(util.GetChromiumSrcDir(), 'build', 'android')
try:
from pylib import constants # pylint: disable=F0401
... |
from __future__ import with_statement
import random, sys, time
from bisect import insort, bisect_left
from functools import wraps
from whoosh.compat import xrange
# These must be valid separate characters in CASE-INSENSTIVE filenames
IDCHARS = "0123456789abcdefghijklmnopqrstuvwxyz"
if hasattr(time, "perf_counter")... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutClassMethods in the Ruby Koans
#
from runner.koan import *
class AboutClassAttributes(Koan):
class Dog:
pass
def test_objects_are_objects(self):
fido = self.Dog()
self.assertEqual(__, isinstance(fido, object))
def t... |
from django import forms
from django.contrib import admin
from .models import (
Author, BinaryTree, CapoFamiglia, Chapter, ChildModel1, ChildModel2,
Consigliere, EditablePKBook, ExtraTerrestrial, Fashionista, Holder,
Holder2, Holder3, Holder4, Inner, Inner2, Inner3, Inner4Stacked,
Inner4Tabular, NonAut... |
"""Run specific test on specific environment."""
import logging
import os
import sys
import tempfile
import time
import zipfile
from pylib import constants
from pylib.base import test_run
from pylib.remote.device import appurify_sanitized
from pylib.remote.device import remote_device_helper
from pylib.utils import zi... |
import GemRB
from GUIDefines import *
from ie_stats import *
import LUProfsSelection
SkillWindow = 0
DoneButton = 0
MyChar = 0
def RedrawSkills():
ProfsPointsLeft = GemRB.GetVar ("ProfsPointsLeft")
if not ProfsPointsLeft:
DoneButton.SetState(IE_GUI_BUTTON_ENABLED)
else:
DoneButton.SetState(IE_GUI_BUTTON_DISABL... |
'''
Generate the prebuilt libs of engine
'''
import os
import subprocess
import shutil
import sys
import excopy
import json
from argparse import ArgumentParser
if sys.platform == 'win32':
import _winreg
TESTS_PROJ_PATH = "tests/lua-tests"
ANDROID_SO_PATH = "project/proj.android/libs"
ANDROID_A_PATH = "project/p... |
#
# Use this module to retrive the fields you need according to the type
# of the OpenOffice operation:
# * Insert a Field
# * Insert a RepeatIn
#
import xmlrpclib
import time
sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')
def get(object, level=3, ending=None, ending_excl=None, recur=None, roo... |
from __future__ import print_function
__author__ = 'Frank Sehnke, <EMAIL>'
#@PydevCodeAnalysisIgnore
#########################################################################
# OpenGL viewer for the FlexCube Environment
#
# The FlexCube Environment is a Mass-Spring-System composed of 8 mass points.
# These resemble a... |
"""Test deprecation of RPC calls."""
from test_framework.test_framework import TurbocoinTestFramework
# from test_framework.util import assert_raises_rpc_error
class DeprecatedRpcTest(TurbocoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.setup_clean_chain = True
self.e... |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import math
from operator import itemgetter
from colormath.color_objects import sRGBColor, LabColor
from colormath.color_conversions import convert_color
pen_sets = {
'precise-v5': {
'black': (59,... |
""" OpenERP core library."""
#----------------------------------------------------------
# Running mode flags (gevent, prefork)
#----------------------------------------------------------
# Is the server running with gevent.
import sys
evented = False
if sys.modules.get("gevent") is not None:
evented = True
# Is ... |
"""Functional tests for cumulative_logsumexp op."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
fr... |
from boto.beanstalk.exception import simple
from tests.compat import unittest
class FakeError(object):
def __init__(self, code, status, reason, body):
self.code = code
self.status = status
self.reason = reason
self.body = body
class TestExceptions(unittest.TestCase):
def test... |
"""Support for WeMo binary sensors."""
import asyncio
import logging
import async_timeout
import requests
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.exceptions import PlatformNotReady
from . import SUBSCRIPTION_REGISTRY
_LOGGER = logging.getLogger(__name__)
def setup_... |
from pyrser import meta, parsing
@meta.rule(parsing.Parser, "Base.ignore_cxx")
def ignore_cxx(self) -> bool:
"""Consume comments and whitespace characters."""
self._stream.save_context()
while not self.read_eof():
idxref = self._stream.index
if self._stream.peek_char in " \t\v\f\r\n":
... |
"""
Signal handlers for invalidating cached data.
"""
from django.conf import settings
from django.dispatch.dispatcher import receiver
from xmodule.modulestore.django import SignalHandler
from .api import clear_course_from_cache
from .tasks import update_course_in_cache
@receiver(SignalHandler.course_published)
def... |
import btk
import unittest
import _TDDConfigure
import numpy
class SeparateKnownVirtualMarkersFilterTest(unittest.TestCase):
def test_Constructor(self):
skvm = btk.btkSeparateKnownVirtualMarkersFilter()
labels = skvm.GetVirtualReferenceFrames()
num = 19
self.assertEqual(labels.size(... |
from sulley import *
s_initialize("INVITE_VALID")
s_static('\r\n'.join(['INVITE sip:<EMAIL> SIP/2.0',
'CSeq: 1 INVITE',
'Via: SIP/2.0/UDP 192.168.3.102:5068;branch=z9hG4bKlm4zshdowki1t8c7ep6j0yavq2ug5r3x;rport',
'From: "nnp" <sip:<EMAIL>>;tag=so08p5k39wuv1dczfnij7bet4l2m6hrq',
'Call-ID: rzxd6tm98v0eal1cifg2py7sj3wk54... |
from __future__ import unicode_literals
from django.core.exceptions import FieldError
from django.test import TestCase
from .models import Choice, Poll, User
class ReverseLookupTests(TestCase):
def setUp(self):
john = User.objects.create(name="John Doe")
jim = User.objects.create(name="Jim Bo")... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.