content
stringlengths
4
20k
from ansible.module_utils.basic import * from ydk.providers import NetconfServiceProvider from ydk.services import CRUDService from ydk.models.cisco_ios_xr.Cisco_IOS_XR_spirit_install_instmgr_oper import SoftwareInstall def main(): module = AnsibleModule( argument_spec = dict( host = dict(requi...
BNP_SWITCH_RESOURCE_NAME = 'bnp_switch' BNP_CREDENTIAL_RESOURCE_NAME = 'bnp_credential' NAME = 'name' TRUNK = 'trunk' ACCESS = 'access' BIND_IGNORE = 'bind_ignore' BIND_SUCCESS = 'bind_success' BIND_FAILURE = 'bind_failure' HP_VIF_TYPE = 'hp-ironic' SUPPORTED_PROTOCOLS = ['snmpv1', 'snmpv2c', '...
#! /usr/bin/python # -*- coding: utf-8 -*- import unittest from MyHearthStone.ext import card_creator as cc from MyHearthStone.utils.game import Type __author__ = 'fyabc' class TestCardCreator(unittest.TestCase): data1 = { 'id': 1, 'type': Type.Minion, 'rarity': 2, 'klass': 4, 'cost': 3, 'attac...
#coding:utf-8 import time import random import numpy as np from StateBuffer import state_buffer class Agent: def __init__(self, environment, replay_memory, deep_q_network, args): print 'Initializing the Agent...' self.env = environment self.mem = replay_memory self.net = ...
#!/usr/bin/env python r"""used to sample dataset to keep balance """ import sys import random def Usage(): print 'sol_sample.py filename out_file pattern sample_rate' sys.exit() if len(sys.argv) != 5: Usage() filename = sys.argv[1] out_filename = sys.argv[2] pattern = sys.argv[3] sample_rate = int(sys.ar...
from rest_framework import serializers class Tag(object): def __init__(self, name, related_tags, equivalent_names): self.name = name self.related_tags = related_tags self.equivalent_names = equivalent_names class TagSerializer(serializers.Serializer): name = serializers.CharField() ...
from unittest import TestCase from domain_shared_contacts_client.contacts_helper import ( convert_organization, create_organization, ) class OrganizationTestCase(TestCase): def setUp(self): self.data = { 'name': 'Federation of International Touch', 'title': 'Event Director', ...
from collections import defaultdict from multiprocessing import Pool import os.path import random import igraph from numpy import * import numpy.random as nprandom import pandas as pd from sklearn.metrics import adjusted_rand_score from sklearn import svm """ The names of the datasets used for training. """ TRA...
""" This configuration is to run the MixedModuleStore on a localdev environment """ # We intentionally define lots of variables that aren't used, and # want to import all variables from base settings files # pylint: disable=W0401, W0614 from .dev import * MODULESTORE = { 'default': { 'ENGINE': 'xmodule.m...
import logging as _logging from scli import prompt from scli.constants import ParameterName from scli.constants import ParameterSource from scli.operation.base import OperationBase from scli.operation.base import OperationResult from scli.parameter import Parameter from scli.resources import ListSolutionStackOpMessage...
from django.conf import settings # Number of messages to display per page. MESSAGES_PER_PAGE = getattr(settings,'ROSETTA_MESSAGES_PER_PAGE',10) # Enable Google translation suggestions ENABLE_TRANSLATION_SUGGESTIONS = getattr(settings,'ROSETTA_ENABLE_TRANSLATION_SUGGESTIONS',True) """ When running WSGI daemon mode,...
from __future__ import absolute_import import json from datetime import timedelta from django.utils.timezone import now from django.test.utils import override_settings from django.test import TestCase from django.conf import settings from django.core.urlresolvers import reverse from django.test.client import Client f...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import warnings from django.forms import * from django.test import TestCase from django.utils.translation import ugettext_lazy, override from forms_tests.models import Cheese from i18n import TransRealMixin class FormsRegressionsTestCase(TransRealMixi...
#!/usr/bin/env python """ Tools for assisting in parsing data to input into analysis procedure. """ #============================================================================================= # Imports #============================================================================================= from assaytools i...
#On the name of ALLAH and may the blessing and peace of Allah #be upon the Messenger of Allah Mohamed Salla Allahu Aliahi Wassalam. """ maclaurin_cos is a function to compute cos(x) using maclaurin series and the interval of convergence is -inf < x < +inf cos(x) = 1- x^2/2! + x^4/4! - x^6/6! ........... """ from ma...
# coding: utf-8 """ Swaggy Jenkins Jenkins API clients generated from Swagger / Open API specification # noqa: E501 OpenAPI spec version: 1.0.1 Contact: <EMAIL> Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import unittest import swaggyjenkins from s...
from visidata import * def open_ttf(p): return TTFTablesSheet(p.name, source=p) open_otf = open_ttf class TTFTablesSheet(Sheet): rowtype = 'font tables' columns = [ ColumnAttr('cmap'), ColumnAttr('format', type=int), ColumnAttr('language', type=int), ColumnAttr('length', ...
""" Test doekbase.data_api.service_core module """ __author__ = 'Dan Gunter <<EMAIL>>' __date__ = '12/27/15' from twisted import internet from doekbase.data_api import service_core as sc from doekbase.data_api import exceptions as dapi_exc from doekbase.data_api.taxonomy.taxon.service import ttypes as tax_ttypes from ...
from django.http import HttpResponse class TastypieError(Exception): """A base exception for other tastypie-related errors.""" pass class HydrationError(TastypieError): """Raised when there is an error hydrating data.""" pass class NotRegistered(TastypieError): """ Raised when the requeste...
import sys from PyQt5.QtCore import QAbstractTableModel, QModelIndex, Qt from PyQt5.QtGui import QColor, QIcon, QPixmap from PyQt5.QtWidgets import QApplication, QTableView from templates.tempData import ( columnCount, columns, colors, headers, rowCount, tableData) class PalettedTableModel(QAbstractTableModel):...
# -*- coding: utf-8 -*- """User forms.""" from flask_wtf import Form from wtforms import PasswordField, StringField from wtforms.validators import DataRequired, Email, EqualTo, Length from .models import User class RegisterForm(Form): """Register form.""" username = StringField(u'用户名', ...
import sys, getopt, argparse from seldon.xgb import * import json if __name__ == '__main__': parser = argparse.ArgumentParser(prog='xgboost_train') parser.add_argument('--client', help='client', required=True) parser.add_argument('--zkHosts', help='zookeeper') parser.add_argument('--inputPath', help='...
# -*- coding: utf-8 -*- # concerts/scrapers/emptybottle.py import calendar, datetime, iso8601, os, pytz, sys, time from collections import namedtuple import requests from bs4 import BeautifulSoup as bs from .venue import Venue TODAY = datetime.datetime.today() class EmptyBottle(Venue): """ Scraper object f...
import signal from abc import ABCMeta class AbstractQueueError(Exception, metaclass=ABCMeta): """ Abstract base exception representing for error scenarios encountered in the queue dispatcher or worker.""" def __init__(self, *args, worker_process_name=None, queue_message=None, **kwargs): if not worker...
#!/usr/bin/python import os; import subprocess; import sys from numpy import * mthlim_vec = array([0, 4]); mthlim_str = array(["un","sp"]); execfile = 'compute_diag' for m in mthlim_vec: diagfile_out = "diagfile.out" + ".mthlim" + str(m); f_diag = open(diagfile_out,'w') f_diag.write('') f_diag.clo...
import random from functools import wraps from flask import (session, flash, g, redirect, abort, url_for, request, render_template as flask_render_template) from ..models import Session from ..models.user import UserOperator user_op = UserOperator(Session()) def render_templat...
from sqlalchemy import * from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import relation, sessionmaker, relationship from sqlalchemy import ForeignKey from sqlalchemy import Enum from db import Base, Session from enums import SkillsEnum class VolunteerSkills(Base): __tablename__ = 'volunte...
"""psycopg extensions to the DBAPI-2.0 This module holds all the extensions to the DBAPI-2.0 provided by psycopg. - `connection` -- the new-type inheritable connection class - `cursor` -- the new-type inheritable cursor class - `lobject` -- the new-type inheritable large object class - `adapt()` -- exposes the PEP-24...
from django.db import models # Create your models here. class VoteCount(models.Model): accessed_at = models.DateTimeField(blank=True, null=True, db_index=True) idea = models.ForeignKey('Ideation', to_field='idea_id') votes_count = models.IntegerField(blank=True, null=True) total_votes_needed = models.I...
import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union from google.api_core import gapic_v1 # type: ignore from google.api_core import grpc_helpers_async # type: ignore from google.api_core import operations_v1 # type: ignore from google.auth import credentials as ga_credenti...
from __future__ import print_function import json from pprint import pprint import random import sys import threading import time import six from streamsx.topology import topology from streamsx.topology import context from streamsx.topology import functions from streamsx import rest from speyer import client from sp...
# -*- coding: utf-8 -*- """ Created on Sat Dec 24 23:18:55 2016 @author: sashank """ import psycopg2 def getUserRatingsDict(): """ Takes the Ratings DB and converts it into dict for easy analysis """ userRatings = {} conn = psycopg2.connect(database='sashank',user='sashank',password='x',host='loc...
# XXX TO DO: # - popup menu # - support partial or total redisplay # - key bindings (instead of quick-n-dirty bindings on Canvas): # - up/down arrow keys to move focus around # - ditto for page up/down, home/end # - left/right arrows to expand/collapse & move out/in # - more doc strings # - add icons for "file", ...
#!/usr/bin/python """ Custom module for the macos_install Ansible role to install software packed in the .dmg format. @author: pipersniper """ from ansible.module_utils.basic import * import subprocess import shutil import os def install_app(appfile, mount_path, new_path, force): wd = os.getcwd() changed ...
import random from time import sleep import pytest from bs4 import BeautifulSoup from charitybot2.api.api import private_api_service from charitybot2.api_calls.private_api_calls import PrivateApiCalls from charitybot2.models.donation import Donation from charitybot2.paths import console_script_path, private_api_script...
"""Statistical Language Processing tools. (Chapter 22) We define Unigram and Ngram text models, use them to generate random text, and show the Viterbi algorithm for segmentatioon of letters into words. Then we show a very simple Information Retrieval system, and an example working on a tiny sample of Unix manual pages...
"""This example illustrates how to get a file for a report. Tags: reports.files.get """ __author__ = ('<EMAIL> (Jonathon Imperiosi)') import argparse import pprint import sys from apiclient import sample_tools from oauth2client import client # Declare command-line flags. argparser = argparse.ArgumentParser(add_hel...
# -*- coding: utf-8 -*- """ The following image extraction implementation was taken from an old copy of Reddit's source code. """ __title__ = 'newspaper' __author__ = 'Lucas Ou-Yang' __license__ = 'MIT' __copyright__ = 'Copyright 2014, Lucas Ou-Yang' import logging import math import io import traceback import urllib....
#!/usr/bin/python from __future__ import with_statement from struct import * import sys import os #default_path="/home/mingwei/Downloads/eglibc-2.13/build/../installdir/lib/" default_path="/home/bip/installdir/lib/" target_dir="./target_elf" def main(): cmd = sys.argv[1]; if(cmd == "-i"): #instrument elf if(che...
gb_code = "junktown2" gb_name = "Junktown Keys II GB" date = "2017-04-01" base_id = 800 profiles = ( ("sa1", "SA Row 1"), ("sa3", "SA Row 3"), ("dsa", "DSA"), ) keys = ( ("brotherhood", "BoS Helmet"), ("lucky38", "Lucky 38"), ("v21", "Vault 21"), ("mininuke", "Mini Nuke"), ) colorways = ( ...
import maya.cmds as cmds from capture_gui.vendor.Qt import QtCore, QtWidgets import capture_gui.lib as lib import capture_gui.plugin class CameraPlugin(capture_gui.plugin.Plugin): """Camera widget. Allows to select a camera. """ id = "Camera" section = "app" order = 10 def __init__(sel...
# coding: utf-8 """ this module contains all stuff related to internationalization and messages """ import traceback import re __all__ = ['TEMPLATE_PATTERN', 'convert_from_cammel_case_to_spaces', 'StoryLanguage', 'format_traceback', 'pluralize',] TEMPLATE_PATTERN ...
# -*- encoding: utf-8 -*- """Test class for PuppetModule CLI @Requirement: Puppetmodule @CaseAutomation: Automated @CaseLevel: Acceptance @CaseComponent: CLI @TestType: Functional @CaseImportance: High @Upstream: No """ from robottelo.cli.factory import make_org, make_product, make_repository from robottelo.cli...
# coding: utf-8 import asyncio from typing import ( Text, ) import aioredis class BaseRedisStore(object): def __init__(self, host: Text='localhost', port: int=6379, db_id: int=0, min_pool_size: int=5, max_pool_size: int=10, ...
#!/usr/bin/env python """ Copyright (c) 2006-2014 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import re import sys from lib.core.common import Backend from lib.core.common import dataToStdout from lib.core.common import getSQLSnippet from lib.core.common import getUni...
"""Tests for the raise statement.""" from test import support import sys import types import unittest def get_tb(): try: raise OSError() except: return sys.exc_info()[2] class Context: def __enter__(self): return self def __exit__(self, exc_type, exc_value, exc_tb): ...
"""Support for tracking the proximity of a device.""" import logging import voluptuous as vol from homeassistant.const import ( CONF_DEVICES, CONF_UNIT_OF_MEASUREMENT, CONF_ZONE) import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.helpers.event i...
from django.views.generic import WeekArchiveView from django.views.generic.dates import _date_from_string class PatchedWeekArchiveView(WeekArchiveView): fk_date_field = None def get_dated_items(self): """ Return (date_list, items, extra_context) for this request. """ year = se...
from xbmcgui import Action, Control from resources.lib.views import register_exception_hooks class _BaseWindow(object): ALIGN_LEFT = 0 ALIGN_RIGHT = 1 ALIGN_CENTER_X = 2 ALIGN_CENTER_Y = 4 ALIGN_CENTER = 6 ALIGN_TRUNCATED = 8 ALIGN_JUSTIFY = 10 def __new__(cls, *args, **kwargs): ...
import time import logging from itertools import takewhile, chain import os from Globals import InitializeClass from collections import defaultdict from Products.ZenUtils import Map from Products.ZenUtils.guid.interfaces import IGlobalIdentifier from Products.ZenEvents.ZenEventClasses import Status_Ping, Status_Snmp f...
"""The instance interfaces extension.""" import webob from webob import exc from nova.api.openstack import common from nova.api.openstack.compute.schemas.v3 import attach_interfaces from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova.api import validation from nova import compute f...
""" WSGI config for balls 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`` se...
from random import random from math import log from math import exp def uniform_discrete(m, k): """Discrete Uniform distribution. Given that the algorithm will output j if and only if: (j-1)/n <= U(0, 1) <= j/n U belongs to [(j-1)/n, j/n) iff n * U belongs to [j-1, j]. But this will occur i...
import uuid from oslo.config import cfg import webob from nova.api.openstack.compute.contrib import evacuate as evacuate_v2 from nova.api.openstack.compute.plugins.v3 import evacuate as evacuate_v21 from nova.api.openstack import extensions from nova.compute import api as compute_api from nova.compute import vm_state...
#!/usr/bin/python # -*- coding: utf-8 -*- READ_PACKETS_MAX = 700000 TYPE_DEGITAL = '' TYPE_BS = 'BS_' TYPE_CS = 'CS_' EIT_PID = (0x12, 0x26, 0x27) SDT_PID = (0x11,) TAG_SED = 0x4D # Short event descriptor TAG_EED = 0x4E # Extended event descriptor TAG_CD = 0x54 # Content descriptor TAG_SD = 0x48 # Service descrip...
import numpy import chainer import chainer.functions as F import chainer.links as L from chainer import reporter embed_init = chainer.initializers.Uniform(.25) def sequence_embed(embed, xs, dropout=0.): """Efficient embedding function for variable-length sequences This output is equally to "return [F.d...
""" Query Twitter GET Search and dump values to stdout. REF: https://dev.twitter.com/docs/api/1.1/get/search/tweets Copyright (C) 2012 Michael Curry. See LICENSE or COPYRIGHT files for details. """ import sys import os import pprint import argparse import requests import requests.auth import simplejson as json try: ...
import modules.options_helper as opt_helper from modules.file.file_helper import File import sys def main(options): # available config keys options_registry = ["path","find","replace_with"] # verify config option provided match registry opt_helper.check_options(options, options_re...
from copy import deepcopy from test_plus.test import TestCase from django.test.testcases import TransactionTestCase import instanotifier.parser.rss.test_utils as parser_utils from instanotifier.notification import services from instanotifier.notification.models import RssNotification from instanotifier.notification.s...
from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals from __future__ import division # Standard imports from future import standard_library standard_library.install_aliases() from builtins import next from builtins import * from builtins import object impo...
try: from __pypy__ import identity_dict as idict except ImportError: idict = None from collections import MutableMapping class IdentityDictPurePython(MutableMapping): __slots__ = "_dict _keys".split() def __init__(self): self._dict = {} self._keys = {} # id(obj) -> obj def __ge...
''' Copyright 2017 Nick Curtis 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 following disclaimer. 2. Redistribut...
import datetime from django.conf import settings from django.db.backends.utils import truncate_name, typecast_date, typecast_timestamp from django.db.models.sql import compiler from django.db.models.sql.constants import MULTI from django.utils import six from django.utils.six.moves import zip, zip_longest from django....
from msrest.serialization import Model class ServerUpdate(Model): """An update request for an Azure SQL Database server. Variables are only populated by the server, and will be ignored when sending a request. :param administrator_login: Administrator username for the server. Once created it can...
from __future__ import unicode_literals import datetime import os from builtins import str from medusa import app, logger from medusa.common import DOWNLOADED, Quality from medusa.name_parser.parser import InvalidNameException, InvalidShowException, NameParser from medusa.tv import Episode, Series name_presets = ( ...
import time start = time.time() import argparse import cv2 import os import pickle import sys import numpy as np np.set_printoptions(precision=2) from sklearn.mixture import GMM import openface fileDir = os.path.dirname(os.path.realpath(__file__)) #modelDir = os.path.join(fileDir, '..', 'models') modelDir = os.path...
""" Code to train the FasterRCNN network used in our experiments. Based on the 'train.py' code in longcw's pytorch implementation: https://github.com/longcw/faster_rcnn_pytorch """ import os import torch import numpy as np from datetime import datetime import faster_rcnn.network as network #from faster_rcnn.faster_rc...
# -*- coding: utf-8 -*- """Provide functions for the creation and manipulation of Rays. A ray begins as a single point and extends infinitely in a direction. The first vector is the origin of the ray. The second vector is the direction of the ray relative to the origin. The following functions will normalise the ray...
import datetime import os from subprocess import call from time import sleep from time import time import heroku3 from app import HEROKU_APP_NAME from app import db from app import logger from util import elapsed from util import get_sql_answer from util import get_sql_answers from util import run_sql from util impor...
ANSIBLE_METADATA = { 'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community' } from ansible.module_utils.basic import AnsibleModule from ansible_common_f5.base import F5_NAMED_OBJ_ARGS from ansible_common_f5.base import F5_PROVIDER_ARGS from ansible_common_f5.bigip import F5BigIpNamed...
import os import sys from .metadata import MetadataUpdateRunner from .sync import SyncFromUpstreamRunner from .tree import GitTree, HgTree, NoVCSTree from .base import Step, StepRunner, exit_clean, exit_unclean from .state import SavedState, UnsavedState def setup_paths(sync_path): sys.path.insert(0, os.path.abs...
# -*- coding: utf-8 -*- u"""HTTP Basic Auth Login :copyright: Copyright (c) 2019 Bivio Software, Inc. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function from pykern.pkdebug import pkdc, pkdlog, pkdp from pykern import pkc...
import unittest, warnings, os from ZSI import version from ZSI.wstools.logging import gridLog from ServiceTest import main, CONFIG_PARSER, DOCUMENT, LITERAL, BROKE, TESTS os.environ['GRIDLOG_ON'] = '1' os.environ['GRIDLOG_DEST'] = "gridlog-udp://portnoy.lbl.gov:15100" # General targets def dispatch(): """Run all ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from allauth.socialaccount.tests import OAuth2TestsMixin from allauth.tests import MockedResponse, TestCase from .provider import SpotifyOAuth2Provider class SpotifyOAuth2Tests(OAuth2TestsMixin, TestCase): provider_id = SpotifyOAuth2Provider.id ...
# -*- coding: utf-8 -*- from navmazing import NavigateToSibling from widgetastic.widget import Checkbox, Text, View from widgetastic_manageiq import Accordion, ManageIQTree from widgetastic_patternfly import Button, Dropdown, Input from cfme.base import Server from cfme.base.login import BaseLoggedInPage from cfme.bas...
"""Tests for xmodule.util.date_utils""" from nose.tools import assert_equals, assert_false # pylint: disable=E0611 from xmodule.util.date_utils import get_default_time_display, get_time_display, almost_same_datetime from datetime import datetime, timedelta, tzinfo from pytz import UTC, timezone def test_get_default...
""" Documentation testing Inspired by: https://github.com/cprogrammer1994/ModernGL/blob/master/tests/test_documentation.py by Szabolcs Dombi This version is simplified: * Only test if the attribute or method is present in the class. Function parameters are not inspected. * Include ignore pattern in the implemented se...
try: set except NameError: from sets import Set as set # Python 2.3 fallback from django.core.exceptions import ImproperlyConfigured from django.db import models from django.forms.models import BaseModelForm, BaseModelFormSet, fields_for_model from django.contrib.admin.options import flatten_fieldsets, BaseM...
import re import string import numpy as np import random import copy import math import decimal def remove_nonchars(corpus): corpus = corpus.replace("\n"," ") pattern = re.compile('[^a-zA-Z ]') corpus = pattern.sub('', corpus) corpus = re.sub(' +',' ',corpus) return corpus.lower() def transition_m...
from logging.config import fileConfig from sqlalchemy import engine_from_config from sqlalchemy import pool from alembic import context # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config # Interpret the config file for Python logging. # Th...
from flatland import ( Dict, Integer, List, Sequence, SkipAll, SkipAllFalse, String, Unevaluated, ) from flatland.schema.base import Root import pytest def test_dsl_of(): with pytest.raises(TypeError): Sequence.of() t1 = Sequence.of(Integer) assert t1.member_schem...
import math import numpy as np from numpy import linalg as LA from skfeature.utility.sparse_learning import generate_diagonal_matrix from skfeature.utility.sparse_learning import calculate_l21_norm def rfs(X, Y, **kwargs): """ This function implementS efficient and robust feature selection via joint ...
# -*- coding: utf-8 -*- """ Created on Sat Feb 28 19:31:24 2015 Plot the gravity potential of the EGM96 gravity field model at a spherical surface. Ignore tides for simplicity. EGM96 coefficients available at: ftp://cddis.gsfc.nasa.gov/pub/egm96/general_info/readme.egm96 Reference for the mathematics: http://www.ngs...
import os.path from datetime import datetime from google.auth.transport.requests import Request from google.oauth2.credentials import Credentials from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient.discovery import Resource, build SCOPES = [ # Google Spreadseets # https://developers.go...
#!/usr/bin/python """ This is the code to accompany the Lesson 3 (decision tree) mini-project. Use a Decision Tree to identify emails from the Enron corpus by author: Sara has label 0 Chris has label 1 """ # enable python 3 style printing from __future__ import print_function import sys from ti...
from optparse import make_option import threading from blinkpy.tool.commands.command import Command class AbstractLocalServerCommand(Command): server = None launch_path = '/' def __init__(self): options = [ make_option('--httpd-port', action='store', type='int', default=8127, help='P...
# -*- coding: utf-8 -*- import logging from datetime import date, timedelta from functools import partial import requests from flask_login import AnonymousUserMixin from flask.globals import current_app from flask_babel import gettext from werkzeug.local import LocalProxy from sipa.model.user import BaseUser from sip...
from flask_analytics.providers.base import BaseProvider class Chartbeat(BaseProvider): uid = None domain = None def __init__(self, uid=None, domain=None): self.uid = uid self.domain = domain @property def template(self): return """<script type="text/javascript"> var ...
import SimpleXMLRPCServer from SimpleXMLRPCServer import SimpleXMLRPCServer import cluster_constants from cluster_constants import * import utils from utils import * import os import subprocess import re def main(): print ("init") server = SimpleXMLRPCServer(('0.0.0.0', int(SLAVE_DAEMON_PORT))) server.regi...
from __future__ import print_function import six.moves.cPickle as pickle import gzip import os import sys import timeit import numpy import theano import theano.tensor as T __docformat__ = 'restructedtext en' def shared_dataset(data_xy, borrow=True): """ Function that loads the dataset into shared variables ...
""" Module implementing the VCS status monitor thread class for Subversion. """ from __future__ import unicode_literals import os import pysvn from VCS.StatusMonitorThread import VcsStatusMonitorThread import Preferences class SvnStatusMonitorThread(VcsStatusMonitorThread): """ Class implementing the VCS...
import os import sys import glob import lcm import time import math import random messageTypes = {} messageTypeToModule = {} def loadMessageTypes(typesDict, typesModule, verbose=False): originalSize = len(typesDict) for name, value in typesModule.__dict__.iteritems(): if hasattr(value, '_get_packed_...
#!/usr/bin/python # ReportLab tools import re from reportlab.lib.units import inch from reportlab.lib.pagesizes import letter, A4 from reportlab.lib.utils import simpleSplit from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts import TTFont from reportlab.pdfgen import canvas class RlChessDiagr...
# -*- coding: utf-8 -*- import pytest from time import sleep from cfme.base.ui import Server from cfme.cloud.availability_zone import AvailabilityZone from cfme.cloud.instance import Instance from cfme.cloud.provider import CloudProvider from cfme.utils.providers import ProviderFilter from cfme.cloud.provider.ec2 impo...
"""VariableAssignment unit tests.""" import pytest from vivid.classes.attribute import Attribute from vivid.classes.relation_symbol import RelationSymbol from vivid.classes.attribute_structure import AttributeStructure from vivid.classes.attribute_system import AttributeSystem from vivid.classes.vocabulary import Voca...
import os, sys; sys.path.insert(0, os.path.join("..", "..")) from pattern.search import search from pattern.en import Sentence, parse # The pattern.search module contains a number of pattern matching tools # to search a string syntactically (word function) or semantically (word meaning). # If you only need to mat...
#!/usr/bin/env python """ Copyright (C) 2012 Legoktm Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publi...
import unittest from appkit import loggertools class TestLogging(unittest.TestCase): def test_set_handler(self): class FooHandler(loggertools.DefaultHandler): pass loggertools.setHandler(FooHandler) logger = loggertools.getLogger('foo') self.assertTrue(isinstance(lo...
import os import unittest from copy import copy from PIL import Image from flask.ext.imagine.filters.downscale import DownscaleFilter class TestDownscaleFilter(unittest.TestCase): image_png = None image_jpg = None image_tif = None image_bmp = None image_vertical = None def setUp(self): ...
from six import moves from tempest.api.image import base from tempest.common.utils import data_utils from tempest import config from tempest import test CONF = config.CONF class CreateRegisterImagesTest(base.BaseV1ImageTest): """Here we test the registration and creation of images.""" @test.idempotent_id('...