code
stringlengths
1
199k
from sdk.data.CANFrame import CANFrame from sdk.data.CANResponseFilter import CANResponseFilter from sdk.data.Query import Query from sdk.data.Request import Request from sdk.data.SniffQuery import SniffQuery def test_query_serialization(): wait_time = 1000 can_frame = CANFrame(1, bytearray([0x02, 0x00, 0x00, 0...
__author__ = """Chris Tabor (dxdstudio@gmail.com)""" if __name__ == '__main__': from os import getcwd from os import sys sys.path.append(getcwd()) from MOAL.helpers.display import Section from MOAL.helpers.display import prnt from random import choice from MOAL.languages.formal_language_theory.grammars.cont...
"""Crosswind playbook parameters.""" from makani.control import control_types as m def GetPlaybook(test_site): """Creates crosswind playbook. Crosswind playbooks are outer loop control commands that change with wind speed. Args: test_site: Integer specifying test site, as defined in TestSite enum. Returns...
import sys from collections import OrderedDict from Library import getHomepath sys.path.insert(0, getHomepath() + '/distributions/') from abstract_dist import * from numpy import linspace import math, psutil MALLOC_LIMIT = 4095 class dist_linear(abstract_dist): pass def distHelp(): ''' Help method that give...
"""A generic serializer for python dictionaries.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import collections import logging from future.builtins import str from future.utils import iteritems from future.utils import iterkeys from future.utils impo...
import threading import bisect from collections import defaultdict import time from typing import Callable, DefaultDict, Dict, List, Optional from dataclasses import dataclass, field import ray def start_metrics_pusher( interval_s: float, collection_callback: Callable[[], Dict[str, float]], controller_handl...
from __future__ import with_statement import optparse import functools import re import os import os.path import posixpath try: from com.xhaus.jyson import JysonCodec as json # jython embedded in buck except ImportError: import json # python test case def relpath(path, start=posixpath.curdir): """ Return a rela...
from copy import deepcopy from mock import Mock, patch import pytest from f5_cccl.resource import Resource from f5_cccl.resource.ltm.virtual_address import VirtualAddress va_cfg = { "name": "192.168.100.100", "partition": "Test", "default_route_domain": 0, "address": "192.168.100.100", "autoDelete":...
'''This module generates a docker environment for a job''' from __future__ import division from fabric.api import sudo, run, settings from logging import getLogger from os.path import ( join as join_path, normpath) from time import sleep from tests.comparison.leopard.controller import ( SHOULD_BUILD_IMPALA,...
import os ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:postgres@localhost/rtrss_test' DATA_DIR = os.path.join(ROOT_DIR, 'data') TESTING = True SECRET_KEY = 'development key' FILESTORAGE_SETTINGS = { 'URL': 'file:///non-existent-direc...
"""Example of customizing evaluation with RLlib. Pass --custom-eval to run with a custom evaluation function too. Here we define a custom evaluation method that runs a specific sweep of env parameters (SimpleCorridor corridor lengths). ------------------------------------------------------------------------ Sample outp...
""" Created on Thu Aug 25 10:19:07 2016 @author: AmatVictoriaCuramIII """ import numpy as np import pandas as pd from pandas_datareader import data sp500 = data.DataReader('^GSPC', 'yahoo', start='1/1/1900', end='01/01/2050') sp500['Close'].plot(grid=True, figsize=(8, 5)) sp500['42d'] = np.round(pd.rolling_mean(sp500['...
from django.shortcuts import render, render_to_response, RequestContext def all_projects(request): return render_to_response('projects.html', locals(), context_instance=RequestContext(request))
import collections import functools import itertools import re from oslo_config import cfg from oslo_log import log as logging from oslo_utils import strutils import six import six.moves.urllib.parse as urlparse import webob from webob import exc from jacket.compute.cloud import task_states from jacket.compute.cloud im...
from sqlalchemy import * from test.lib import * from sqlalchemy.engine import default class CompileTest(fixtures.TestBase, AssertsExecutionResults): __requires__ = 'cpython', @classmethod def setup_class(cls): global t1, t2, metadata metadata = MetaData() t1 = Table('t1', metadata, ...
from .example_source import add_two def test_external_method(): assert add_two(2) == 4
""" 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 this file to you under the Apache License, Version 2.0 (the "License"); you may not use this ...
import os def check_ping(): hostname = "8.8.8.8" response = os.system("ping -t 1" + hostname) if response == 0: ping_status = hostname + " is up" else: ping_status = hostname + " is down" return ping_status ping = check_ping() print(ping)
import os import sys import logging from logging import handlers from typing import List, Tuple, Optional from dataclasses import asdict, dataclass from dataclasses_json import dataclass_json, LetterCase from aiohttp.web import View, Application, run_app from aiohttp import web import markdown from jinja2 import Enviro...
from model.contact import Contact def test_add_contact(app): old_contacts = app.contact.get_contact_list() contact = Contact(firstname="alena", middlename="alexandrovna", lastname="pushniakova", nickname="lena", title="none", company="Whil", address="2 Townsend ", home="2Townsend...
from SockClient import SockClient class UdpClient(SockClient): pass
from pathlib import Path from typing import Any, Dict, List import requests from pandas import DataFrame from lib.data_source import DataSource from lib.utils import table_merge from lib.utils import table_rename def _output_ch_data(data: DataFrame) -> DataFrame: # Make sure all records have the country code and ma...
__version__ = "1.5.4" from deriva.core.utils.core_utils import * from deriva.core.base_cli import BaseCLI, KeyValuePairArgs from deriva.core.deriva_binding import DerivaBinding, DerivaPathError, DerivaClientContext from deriva.core.deriva_server import DerivaServer from deriva.core.ermrest_catalog import ErmrestCatalog...
class Loader: cache = dict(resource={}, client={}) def __init__(self, factory): self.factory = factory def __getattr__(self, attr): if attr == "__all__": return list(self.cache[self.factory]) if attr == "__path__" or attr == "__loader__": return None i...
"""passlib.utils.compat - python 2/3 compatibility helpers""" import sys PY2 = sys.version_info < (3,0) PY3 = sys.version_info >= (3,0) PY_MAX_25 = sys.version_info < (2,6) # py 2.5 or earlier PY27 = sys.version_info[:2] == (2,7) # supports last 2.x release PY_MIN_32 = sys.version_info >= (3,2) # py 3.2 or later PYPY =...
""" Vericred API Vericred's API allows you to search for Health Plans that a specific doctor accepts. Visit our [Developer Portal](https://developers.vericred.com) to create an account. Once you have created an account, you can create one Application for Production and another for our Sandbox (select the approp...
"""Tests for tfx.orchestration.beam.beam_dag_runner.""" import os import tempfile from typing import Any, Dict, List import absl.testing.absltest from tfx import types from tfx.dsl.compiler import compiler from tfx.dsl.components.base import base_component from tfx.dsl.components.base import base_executor from tfx.dsl....
""" Url Title Plugin (botwot plugins.urltitle) """ import re from bs4 import BeautifulSoup import requests from pyaib.plugins import observe, plugin_class @plugin_class class UrlTitle(object): def __init__(self, context, config): pass @observe("IRC_MSG_PRIVMSG") def observe_privmsg(self, context, msg): """ Look ...
import random from org.myrobotlab.framework import MRLListener leftPort = "COM8" rightPort = "COM6" i01 = Runtime.createAndStart("i01", "InMoov") i01.mouth = Runtime.createAndStart("i01.mouth","NaturalReaderSpeech") i01.startAll(leftPort, rightPort) torso = i01.startTorso("COM8") i01.torso.topStom.detach("i01.left"); i...
""" Elliptic Curve Library Copyright 2015 Ivan Sarno 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...
"""Generic TFX schema_gen executor.""" import os from typing import Any, Dict, List from absl import logging import tensorflow_data_validation as tfdv from tfx import types from tfx.dsl.components.base import base_executor from tfx.types import artifact_utils from tfx.types import standard_component_specs from tfx.util...
import json import os import unittest from transformers.models.xlm.tokenization_xlm import VOCAB_FILES_NAMES, XLMTokenizer from transformers.testing_utils import slow from .test_tokenization_common import TokenizerTesterMixin class XLMTokenizationTest(TokenizerTesterMixin, unittest.TestCase): tokenizer_class = XLMT...
"""Support for Template fans.""" import logging import voluptuous as vol from homeassistant.components.fan import ( ATTR_DIRECTION, ATTR_OSCILLATING, ATTR_SPEED, DIRECTION_FORWARD, DIRECTION_REVERSE, ENTITY_ID_FORMAT, SPEED_HIGH, SPEED_LOW, SPEED_MEDIUM, SUPPORT_DIRECTION, SU...
''' :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)` :copyright: © 2013 by the SaltStack Team, see AUTHORS for more details :license: Apache 2.0, see LICENSE for more details. tests.unit.version_test ~~~~~~~~~~~~~~~~~~~~~~~ Test salt's regex git describe version parsing ''' import re fro...
from twisted.internet.protocol import Protocol from twisted.internet.protocol import Factory from twisted.protocols.basic import LineReceiver from twisted.internet import reactor from calvin.utilities.calvinlogger import get_logger _log = get_logger(__name__) class RawDataProtocol(Protocol): """A Calvin Server obje...
from django import forms from django.core.cache import cache from django.db.models import signals from django.utils.translation import ugettext_lazy as _ from any_urlfield import EXTERNAL_SCHEMES from any_urlfield.cache import get_object_cache_keys from any_urlfield.forms.fields import ExtendedURLField class UrlType(ob...
"""The Virtual File System (VFS) file-like object interface.""" import abc import os class FileIO(object): """Class that implements the VFS file-like object interface.""" def __init__(self, resolver_context): """Initializes the file-like object. Args: resolver_context (Context): resolver context. ...
import random from enum import Enum from itertools import product from typing import Union, List, Dict, Tuple, Callable import numpy as np import scipy import scipy.spatial from rl_coach.core_types import ActionType, ActionInfo from rl_coach.utils import eps class Space(object): """ A space defines a set of val...
from zaqar.tests.functional import base from zaqar.tests.functional import helpers class TestHealth(base.V1_1FunctionalTestBase): server_class = base.ZaqarAdminServer config_file = 'wsgi_mongodb_pooled.conf' def setUp(self): super(TestHealth, self).setUp() self.base_url = ("{url}/{version}"....
from SimpleLoop import * event = createEvent(lambda x: "Eat my shorts", None) recycleEvent(event) event2 = createEvent(lambda x: "Eat my baggy pants too", None) if event == event2: print "And this is how we recycle"
import re from migrate.changeset import UniqueConstraint, ForeignKeyConstraint from sqlalchemy import Boolean from sqlalchemy import CheckConstraint from sqlalchemy import Column from sqlalchemy.engine import reflection from sqlalchemy.exc import OperationalError from sqlalchemy.exc import ProgrammingError from sqlalch...
from __future__ import absolute_import import unittest import mock import pytest from artman import tasks from artman.pipelines import code_generation from artman.pipelines import gapic_generation from artman.pipelines import grpc_generation class GapicConfigPipelineTests(unittest.TestCase): @mock.patch.object(gapi...
"""Support for operations that can be applied to the server. Contains classes and utilities for creating operations that are to be applied on the server. """ import errors import random import util import sys PROTOCOL_VERSION = '0.22' WAVELET_APPEND_BLIP = 'wavelet.appendBlip' WAVELET_SET_TITLE = 'wavelet.setTitle' WAV...
import getopt import sys import codecs def main(argv): infile = '' outfile = '' try: opts, args = getopt.getopt(argv, "hi:o:", ["infile=", "outfile="]) except getopt.GetoptError: print('SCRIPT -i <inputfile> -o <outputfile>') sys.exit(1) for opt, arg in opts: if opt ...
import sys, os, inspect from swiftclient.shell import main def get_script_dir(follow_symlinks=True): if getattr(sys, 'frozen', False): # py2exe, PyInstaller, cx_Freeze path = os.path.abspath(sys.executable) else: path = inspect.getabsfile(get_script_dir) if follow_symlinks: path = os...
from glanceclient import Client import keystoneclient.v2_0.client as ksclient from novaclient.v1_1 import client as nclient import os auth = {} auth['username'] = os.environ.get('OS_USERNAME') auth['password'] = os.environ.get('OS_PASSWORD') auth['auth_url'] = 'http://10.0.2.15:5000/v2.0/' auth['tenant_name'] = os.envi...
""" Copyright (c) 2014-2015 F-Secure See LICENSE for details """ AppName = "F-Secure Lokki" Custom = "FSCRetail" # or x86,x86_arm Targets = "Release" CustomSub = "production" WPUtil = "wputil" Device = "Device" Version = "3.0.0.0"
import os, pickle, re from .. import build from .. import dependencies from .. import mesonlib from .. import mlog from .. import compilers import json import subprocess from ..mesonlib import MesonException, OrderedSet from ..mesonlib import classify_unity_sources from ..mesonlib import File from ..compilers import Co...
from __future__ import absolute_import import os import httplib as http import requests import urlparse import waffle import json from flask import request from flask import send_from_directory from flask import Response from flask import stream_with_context from flask import g from django.core.urlresolvers import reve...
from GithubRep import GithubRep __author__ = 'evilkhaoskat' import os def clone_rep(repository, dir_to=""): """ clones repository and writes into stdout result of command execution using torsocks :param repository: link to github repository :param dir_to: another directory can be mentioned for cloning o...
import json from categories.category_hierarchy_generator import get_category_raw_dict, get_category_hierarchy def get_category_list_data_json(): return json.dumps(get_category_raw_dict()) def get_category_list_dict(): return get_category_raw_dict() def sanitize(path): if path == '': return [] re...
import requests url = 'http://34.210.157.84:9080/events/schema/azureFunctions' headers = {'X-Events-API-AccountName': 'customer1_b7686ddf-6680-43f3-bbeb-303c027344e2', 'X-Events-API-Key': '50c4c457-d91a-44b6-a6e1-437d1f35e50a', 'Accept': 'application/vnd.appd.events+json;v=1'} appd = requests.delete(url, headers=header...
import traceback from .. import worker from .. import profiler class Executor: def __init__( self, work_method, pre_work_method, post_work_method, update_current_task, on_success, on_timeout, on_failure, worker_profiling_handler, worker...
import copy import json import mock import unittest import uuid from cfgm_common.vnc_db import DBBase from svc_monitor import config_db from svc_monitor import instance_manager from svc_monitor import snat_agent from vnc_api.vnc_api import * ROUTER_1 = { 'fq_name': ['default-domain', 'demo', 'router1'], 'parent...
import proto # type: ignore from google.ads.googleads.v10.common.types import ( feed_item_set_filter_type_infos, ) from google.ads.googleads.v10.enums.types import feed_item_set_status __protobuf__ = proto.module( package="google.ads.googleads.v10.resources", marshal="google.ads.googleads.v10", manifes...
from __future__ import annotations from textwrap import dedent import pytest from pants.backend.python.dependency_inference import import_parser from pants.backend.python.dependency_inference.import_parser import ( ParsedPythonImports, ParsePythonImportsRequest, ) from pants.backend.python.target_types import P...
from openzwave.network import ZWaveNode from Firefly import logging from Firefly.components.zwave.zwave_device import ZwaveDevice from Firefly.const import DEVICE_TYPE_MOTION, MOTION, MOTION_ACTIVE, MOTION_INACTIVE, STATE from Firefly.helpers.metadata.metadata import metaMotion TITLE = 'Aeotec DSB05 MultiSensor' DEVICE...
""" This module implements: - minemeld.ft.vt.Notifications, the Miner node for VirusTotal Notifications feed """ import logging import os import yaml from . import json LOG = logging.getLogger(__name__) _VT_NOTIFICATIONS = 'https://www.virustotal.com/intelligence/hunting/notifications-feed/?key=' class Notifications(...
from unittest import mock from neutron_lib.plugins import constants from oslo_serialization import jsonutils import webob from gbpservice.neutron.services.servicechain.plugins.ncp import ( plugin as ncp_plugin) from gbpservice.neutron.services.servicechain.plugins.ncp import config # noqa from gbpservice.neutron.s...
"""Use trained LaserTagger model to make predictions.""" import argparse import csv import os import subprocess import language_tool_python import nltk from custom_post_processing_utils import post_processing import preprocess_utils TEMP_FOLDER_NAME = "temp_custom_predict" TEMP_FOLDER_PATH = "~/" + TEMP_FOLDER_NAME GCP...
import os import requests from requests.auth import HTTPBasicAuth if 'API_URL' in os.environ: API_URL = os.environ['API_URL'] API_USER = os.environ['API_USER'] API_PASSWORD = os.environ['API_PASSWORD'] else: API_URL = "http://localhost:8000/api/v1/" API_USER = "ken" API_PASSWORD = "emily" AUTH =...
"""Unit tests for the Share driver module.""" import time import ddt import mock from manila import exception from manila import network from manila.share import configuration from manila.share import driver from manila import test from manila.tests import utils as test_utils from manila import utils def fake_execute_w...
from django.contrib.sites.models import RequestSite from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, Http404 from django.shortcuts import render_to_response from django.template import RequestContext from ...
"""@package src.wi.tests.account_test @author Piotr Wójcik @author Krzysztof Danielowski @date 12.10.2012 """ from wi.tests import WiTestCase import random import unittest class AccountTests(WiTestCase, unittest.TestCase): def _email_change(self, email): driver = self.driver self.base_url = self.TES...
""" Stdin: N/A Stdout: N/A Author: Jey Han Lau Date: Jul 16 """ import argparse import sys import codecs import random import time import os import math import cPickle import operator import tensorflow as tf import numpy as np import gensim.models as g import tdlm_config as cf from ut...
import mock import sys from neutron import context as n_context from neutron.plugins.common import constants from neutron.tests import base with mock.patch.dict(sys.modules, { 'networking_cisco': mock.Mock(), 'networking_cisco.plugins': mock.Mock().plugins, 'networking_cisco.plugins.cisco': mock.Mock().cisc...
import usb.core import usb.util from array import array import argparse import sys VENDOR_ID = 0x1d57 PRODUCT_ID = 0x0005 def write_eeprom (addr, data): if (addr & 3) != 0: raise "Address must be aligned to 4 bytes" if (len(data) & 3) != 0: raise "Data must be chunks of 4 bytes" for i in ran...
class SessionHandler(object): def session_from_session_key(self, session_key, type=None): raise NotImplementedError def session_from_public_key(self, public_key): raise NotImplementedError def get_public_key(self, session): raise NotImplementedError def get_private_key(self, sess...
import sys from setuptools import setup import moflow if sys.version_info[0:2] < (2, 6): sys.exit('Requires Python 2.6 or later') setup_data = { 'name': 'moflow', 'description': 'A Python package for MODFLOW and related programs', 'version': moflow.__version__, 'author': moflow.__author__, 'auth...
from .fixed import Fixed class origin(object): def __init__(self, origin): self.origin = origin def __enter__(self): return self def __exit__(self, type, value, traceback): pass def fixed(self, *f_args, **f_kwargs): origin = self.origin class _Fixed(Fixed): ...
from pysnmp.hlapi.v3arch.auth import * from pysnmp.hlapi.v3arch.context import * from pysnmp.hlapi.v3arch.lcd import * from pysnmp.hlapi.varbinds import * from pysnmp.hlapi.v3arch.twisted.transport import * from pysnmp.entity.rfc3413 import ntforg from pysnmp.smi.rfc1902 import * from twisted.internet import reactor fr...
from django.utils.module_loading import import_string import django_comments from django_comments.feeds import LatestCommentFeed from django_comments.signals import comment_was_posted, comment_will_be_posted default_app_config = 'django_comments_xtd.apps.CommentsXtdConfig' def get_model(): from django_comments_xtd....
""" Flask-PyMongo ------------- PyMongo support for Flask applications. Installation ============ Flask-PyMongo is pip-installable: pip install Flask-PyMongo You can install the latest development snapshot like so: pip install http://github.com/dcrosta/flask-pymongo/tarball/master#egg=Flask-PyMongo-dev Upgradin...
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals debug = False debug_plot = False plot = False paper_plot = False BLOCK = False MEMLEAK_TEST = False
__version__ = '0.1.6'
from __future__ import unicode_literals import unittest, sys import slumber class UtilsTestCase(unittest.TestCase): def test_url_join_http(self): self.assertEqual(slumber.url_join("http://example.com/"), "http://example.com/") self.assertEqual(slumber.url_join("http://example.com/", "test"), "http:/...
""" Copyright (C) 2012, Nezar Abdennur <nabdennur@gmail.com> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the followi...
from google.net.proto import ProtocolBuffer import array import _dummy_thread as thread __pychecker__ = """maxreturns=0 maxbranches=0 no-callinit unusednames=printElemNumber,debug_strs no-special""" if hasattr(ProtocolBuffer, 'ExtendableProtocolMessage'): _extension_runtime = True _ExtendableProt...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('warehouse', '0013_auto_20141223_0824'), ] operations = [ migrations.AlterModelOptions( name='message', options={'ordering': ('tim...
"""Utility script to upload a collection of benchmark files to an s3 bucket By default we use what ever aws credintials you have set up, but you can explicitly specify an aws credential file with '--credentials' and a specific profile from that credential with '--profile' """ from __future__ import print_function impor...
""" Markdown extensions for freelinks and wikilinks, with optional @target handling. """ import re from markdown import util, inlinepatterns from markdown.extensions.wikilinks import (WikiLinkExtension, WikiLinks) from tiddlyweb.fixups import quote FRONTBOUND = r'(?:^|(?<=[\s|\(]))' FREELINKRAW = r'\[\[([^]]+?)...
"""Initial docstring.""" class SomeClass(object): """Class docstring."""
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[:,k...
"""Testing for `hera_mc.daemon_status`.""" from math import floor import pytest from astropy.time import Time, TimeDelta from ..daemon_status import DaemonStatus @pytest.fixture(scope='function') def daemon_data(): column_names = ['name', 'hostname', 'time', 'status'] column_values = ['test_daemon', 'test_host'...
from __future__ import unicode_literals from __future__ import absolute_import from django.db import models from django.forms import fields from coloree.validators import is_html_color_code from coloree.widgets import ColorPickerWidget class HtmlColorCodeField(models.CharField): """ A CharField that checks that...
import copy try: from ..vendor.lexicon import Lexicon from ..vendor.fluidity import StateMachine, state, transition except ImportError: from lexicon import Lexicon from fluidity import StateMachine, state, transition from ..util import debug from ..exceptions import ParseError def is_flag(value): re...
from vsdConnect import connectVSD import sys import argparse parser = argparse.ArgumentParser(description='Download original image files from SMIR to a specific folder.') parser.add_argument('--targetFolder', dest='targetFolder', default="./", help='folder to store images in') parser.add_argument('--...
import os import sys import re import yaml import uuid import glob from lib.tarantool_server import TarantoolServer cluster_uuid = '' try: cluster_uuid = yaml.load(server.admin("box.space._schema:get('cluster')", silent = True))[0][1] uuid.UUID('{' + cluster_uuid + '}') print 'ok - cluster uuid' exc...
from .utils import rel DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. 'NAME': '', # Or path...
from builtins import str import logging logger = logging.getLogger(__name__) import os import sys from optparse import make_option from os.path import join from django.db import models from django.conf import settings from django.utils.translation import ugettext as _ from django.utils.encoding import force_text from d...
import os from unittest import TestCase from tempfile import NamedTemporaryFile from redislite.db import DB from redislite.storage.file import Storage from . import randomword class TestStorageFile(TestCase): def setUp(self): with NamedTemporaryFile(delete=False) as fp: self.filename = fp.name ...
import os.path from django.conf import settings from pybb.util import filter_blanks, rstrip_str PYBB_TOPIC_PAGE_SIZE = getattr(settings, 'PYBB_TOPIC_PAGE_SIZE', 10) PYBB_FORUM_PAGE_SIZE = getattr(settings, 'PYBB_FORUM_PAGE_SIZE', 20) PYBB_AVATAR_WIDTH = getattr(settings, 'PYBB_AVATAR_WIDTH', 80) PYBB_AVATAR_HEIGHT = ge...
from PyObjCTools.TestSupport import * from Quartz.CoreGraphics import * try: long except NameError: long = int class TestCGBase (TestCase): def testConstants(self): self.assertIsInstance(CGFLOAT_MIN, float) self.assertIsInstance(CGFLOAT_MAX, float) self.assertIsInstance(CGFLOAT_IS_DO...
import numpy as np from scipy.sparse.linalg import gmres from pySDC.core.Errors import ParameterError from pySDC.core.Problem import ptype from pySDC.implementations.datatype_classes.mesh import mesh, imex_mesh from pySDC.implementations.problem_classes.boussinesq_helpers.build2DFDMatrix import get2DMesh from pySDC.imp...
from __future__ import unicode_literals from unittest import TestCase from django.http import HttpResponse, HttpResponseRedirect, \ HttpResponsePermanentRedirect from .http import GET from ..middleware import UturnMiddleware def optional_redirect(request, redirect=None): if redirect: ...
""" Translates the ADC2004 melody f0 annotations to a set of JAMS files. The original data is found online at the following URL: http://www.iua.upf.es/mtg/ismir2004/contest/melodyContest/FullSet.zip To parse the entire dataset, you simply need to provide the path to the unarchived folder. Example: ./adc2004melody_p...
from django.test import TestCase from cyidentity.cyfullcontact.tests.util import create_sample_contact_info class FullContactModelsTestCase(TestCase): def setUp(self): self.contact_info = create_sample_contact_info() def test_organization_names(self): names = [organization.name for organization ...
"""SCons.Tool.gs Tool-specific initialization for Ghostscript. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ __revision__ = "src/engine/SCons/Tool/gs.py 5023 2010/06/14 22:05:46 scons" import SCons.Action impo...
from .... import sim_options as o from ....state_plugins.sim_action_object import SimActionObject from ....state_plugins.sim_action import SimActionData def SimIRStmt_PutI(engine, state, stmt): # value to put with state.history.subscribe_actions() as data_deps: data = engine.handle_expression(state, stm...
"""OpenGL.GL, the core GL library and extensions to it""" from OpenGL.GL.VERSION.GL_1_1 import * from OpenGL.GL.glget import * from OpenGL.GL.pointers import * from OpenGL.GL.images import * from OpenGL.GL.exceptional import * from OpenGL.error import * from OpenGL.GL.glget import * from OpenGL.GL.VERSION.GL_1_2 import...