content
stringlengths
4
20k
# Millionaire Makers Drawing Platform # https://www.reddit.com/r/millionairemakers # # Drawing backend web server # # Contact /u/minlite for comments/suggestions import sys import time from flask import Flask, request, render_template, redirect, url_for from flask.ext.basicauth import BasicAuth from drawing import Dra...
import itertools import pickle import numpy as np from numpy.testing import assert_array_almost_equal import pytest from scipy.spatial.distance import cdist from sklearn.neighbors import DistanceMetric from sklearn.neighbors import BallTree from sklearn.utils import check_random_state from sklearn.utils._testing imp...
# -*- coding: utf-8 -*- import os.path from openerp import api, fields, models class IrAttachment(models.Model): """ Update partner to add a field about notification preferences """ _name = "ir.attachment" _inherit = 'ir.attachment' _fileext_to_type = { '7z': 'archive', 'aac': 'audi...
import functools import jax import jax.numpy as jnp from jax import lax from jax.interpreters import partial_eval as pe from jax import linear_util as lu from typing import Union, Optional, Callable, Any import numpy as np ScanAxis = Optional[int] class _Broadcast: pass broadcast = _Broadcast() def scan( ...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class RegexMatch(Choreography): def __init__(self, temboo_session): """ Create a ne...
#!/usr/bin/env python3 import logging import socket import os from time import sleep import seqlog server_url = os.getenv("SEQ_SERVER_URL", "http://localhost:5341/") api_key = os.getenv("SEQ_API_KEY", "") print("Logging to Seq server '{}' (API key = '{}').".format(server_url, api_key)) log_handler = seqlog.log_to_...
# getting started https://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_gui/py_video_display/py_video_display.html import numpy as np import time import cv2 import scipy.misc #cap = cv2.VideoCapture(0) # 0 for /dev/video0; 1 for /dev/video1; or a filename. #print("dimension", cap.get(3), cap.get(4...
import sys from nalulib import * import os if(len(sys.argv) < 3): print """ Compute the jitter for each NAL unit and the average jitter. Usage: %s <sent trace file> <received trace file> <sent trace file>: JSVM BitstreamExtractor trace file with a further column containing the timestamps corresponding t...
""" Module contains function which creates files: tex, pdf and jpg. """ import subprocess from .logic import gen_tex_file_content def create_tex_file(moves, ff_type, file='file.tex'): """ Function creates tex file from given moves. :param moves: list of tuples (Z, from, to) :param ff_type: type of flip...
#-*- coding: utf-8 -*- import urllib,re,string,urlparse,sys,os import xbmc, xbmcgui, xbmcaddon, xbmcplugin from resources.libs import main #Mash Up - by Mash2k3 2012. addon_id = 'plugin.video.movie25' selfAddon = xbmcaddon.Addon(id=addon_id) art = main.art prettyName = 'Cinemaxx.ru' MAINURL='http://cinemaxx.ru/' ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test for class attributes. """ import unittest import macaron from models import Team, Member, Song DB_FILE = ":memory:" class TestClassAttributes(unittest.TestCase): def setUp(self): macaron.macaronage(DB_FILE) macaron.create_table(Team) m...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type import sys import base64 import itertools import json import os.path import ntpath import types import pipes import glob import re import crypt import hashlib import string from functools import partial import operator as py_opera...
""" 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 ...
"""Module which contains the function to analyse aphorism and commentaries line There are two functions which are treating the references ``[W1 W2]`` and the footnotes *XXX*. The ``references`` function has to be used before the ``footnotes``. :Authors: Jonathan Boyle, Nicolas Gruel <<EMAIL>> :Copyright: IT Service...
# -*- coding: utf-8 -*- """ Exodus Add-on This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This progra...
"""Tests for Subreddit class.""" from __future__ import print_function, unicode_literals import warnings from praw import errors from praw.objects import Subreddit from six import text_type from .helper import OAuthPRAWTest, PRAWTest, betamax class SubredditTest(PRAWTest): def betamax_init(self): self.r...
"""Main entry point """ from pyramid.config import Configurator from campaign.resources import Root from mozsvc.config import load_into_settings from mozsvc.middlewares import _resolve_name from campaign.logger import Logging, LOG logger = None counter = None # TO prevent circular references, duplicate this func here...
__problem_title__ = "Stone Game II" __problem_url___ = "https://projecteuler.net/problem=325" __problem_description__ = "A game is played with two piles of stones and two players. At her " \ "turn, a player removes a number of stones from the larger pile. The " \ "num...
""" des """ class Battery(): def __init__(self, battery_size=70): self.battery_size = battery_size def describe_battery(self): print("This car has a " + str(self.battery_size) + "-kWh battery.") def get_range(self): if self.battery_size == 70: range = 240 elif ...
#!/usr/bin/python from scanner import Scanner import AST class Cparser(object): def __init__(self): self.scanner = Scanner() self.scanner.build() self.no_error = True tokens = Scanner.tokens precedence = ( ("nonassoc", 'IFX'), ("nonassoc", 'ELSE'), ("r...
""" Test palette positioning for toolbar and tray. """ from gi.repository import Gtk from sugar3.graphics.tray import HTray, TrayButton from sugar3.graphics.toolbutton import ToolButton import common test = common.Test() box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) theme_icons = Gtk.IconTheme.get_default()...
"""Test configs for reduce operators.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from tensorflow.lite.testing.zip_test_utils import create_tensor_data from tensorflow.lite.testing.zip_test_utils import make_...
""" Plots the vorticity field of a 2D cuIBM simulation. """ import os from snake.cuibm.simulation import CuIBMSimulation from snake.body import Body simulation = CuIBMSimulation() simulation.read_grid() for time_step in simulation.get_time_steps(): all_bodies = Body(file_path=os.path.join('{:0>7}'.format(time_ste...
#!/usr/bin/python """Test presentation of caret navigation by line.""" from macaroon.playback import * import utils sequence = MacroSequence() sequence.append(TypeAction("Line 1")) sequence.append(KeyComboAction("Return")) sequence.append(TypeAction("Line 2")) sequence.append(KeyComboAction("Return")) sequence.app...
from material import Material from subregion import SubRegion from sregion import SRegion from icool_composite import ICoolComposite from icoolobject import ICoolObject from nofield import NoField from repeat import Repeat class Drift(SRegion): """ Drift region. By default will generate a vacuum drift reg...
"""Tests for the bob_emploi.data_analysis.importer.deployments.usa.job_group_info module.""" import os import unittest from unittest import mock import airtablemock from bob_emploi.frontend.api import job_pb2 from bob_emploi.data_analysis.importer.deployments.usa import job_group_info from bob_emploi.data_analysis.l...
import logging import routes.mapper import ckan.lib.base as base import ckan.lib.helpers as h import ckan.plugins as p import ckan.plugins.toolkit as tk import urllib2 import urllib from ckan.common import _, json import collections from pylons import config import pylons from ckan.common import request, c import ckan....
from __future__ import with_statement import unittest import greenhouse import greenhouse.poller from test_base import TESTING_TIMEOUT, StateClearingTestCase class OneWayPoolTestCase(StateClearingTestCase): POOL = greenhouse.OneWayPool def empty_out(self, pool, size): return [] def test_shuts...
#!/usr/bin/env python ''' Copyright (C) 2005 Aaron Spike, <EMAIL> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This progra...
import errno import fcntl import itertools import os import random import select import socket import time import threading import unittest import subprocess32 from cloudify_hostpool.hosts import scan _MAGIC_NUMBER_LISTEN_PORT_RANGE = (10000, 11000, 3) _MAGIC_NUMBER_CONNECTION_PORT_RANGE = (20000, 21000, 3) _MAGIC_...
from __future__ import unicode_literals from smartmin.models import SmartModel from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from dash.orgs.models import Org @python_2_unicode_compatible class DashBlockType(SmartMo...
""" # Fhane creation ## Tutorial 1. Follow the steps of `population_data_unique.py` script. 2. Join the output file data `pop_output.csv` placed in the project folder with the locations data in `r_gind3`. 3. Run that script. """ from fahne_formatter import * from fahne_plotter import * def input_arguments_parser(a...
# -*- coding utf-8 -*- # classes/models/client.py # class:: Client from datetime import datetime, timedelta from flask import current_app from swtstore.classes.database import db from swtstore.classes.models import User from swtstore.classes import oauth class Client(db.Model): """ The third-party applicati...
# -*- coding: utf-8 -*- __author__ = 'Tom Chen' import urllib2,sys,re,time from sgmllib import SGMLParser from datetime import datetime,date from urllib import unquote,quote default_encoding = 'utf-8' #设置文件使用UTF-8编码 if sys.getdefaultencoding() != default_encoding: reload(sys) sys.setde...
""" categoryview.py Contains administrative views for working with categories. """ from admin_helpers import * from flask import redirect, flash, request, url_for from flask.ext.admin import BaseView, expose from flask.ext.admin.contrib.sqla import ModelView from flask.ext.admin.actions import action from remedy.rad...
"""Example use of the RCFR algorithm on Kuhn Poker.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from absl import app from absl import flags import tensorflow.compat.v1 as tf from open_spiel.python.algorithms import rcfr import pyspiel tf.enable_eag...
""" Elasticsearch Blueprint ======================= **Fabric environment:** .. code-block:: yaml blueprints: - blues.elasticsearch settings: elasticsearch: version: 1.5 # Version of elasticsearch to install (Required) cluster_name: foobar # Nam...
import numpy as np from tick.base_model import ModelSecondOrder, ModelSelfConcordant, \ LOSS_AND_GRAD from tick.hawkes.model.build.hawkes_model import (ModelHawkesExpKernLogLik as _ModelHawkesExpKernLogLik) from .base import ModelHawkes class ModelHawkesExpKernLo...
from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from collections import namedtuple from textwrap import dedent from pants.backend.jvm.tasks.jvm_compile.zinc.zinc_compile import ZincCompile from pants.base...
#!/usr/bin/python """ An application example that sends app metrics to Graphite through Statsd. Author: Oriana Baldizan Date: 21.12.16 """ import re import sys import time import socket import struct import statsd """ - hostname and port must match: /etc/statsd/localConfig.js - "testapp" is the prefix for your ...
import unittest from svgwrite.animate import Set, Animate, AnimateColor, AnimateMotion, AnimateTransform class TestSet(unittest.TestCase): def test_constructor(self): s = Set(debug=True) self.assertEqual(s.tostring(), '<set />') def test_set_href(self): s = Set(href='#test', debug=Tru...
from mien.wx.base import wx, AWList, elements from mien.wx.dataeditors import dataEdit, EDITABLETYPES import mien.nmpml from mien.interface.widgets import ATTRIBUTE_BROWSERS class ObjectEditor(wx.Panel): def __init__(self, master, obj, base): wx.Panel.__init__(self, master, -1) self.Show(True) self.sizer = wx.B...
"""Record models.""" from flask import current_app from intbitset import intbitset from invenio_collections.models import Collection from invenio_ext.sqlalchemy import db from sqlalchemy.event import listen from werkzeug import cached_property from .receivers import new_collection class Record(db.Model): ...
#!/usr/bin/env python2 """ Syncthing-GTK - Notifications Listens to syncing events on daemon and displays desktop notifications. """ from __future__ import unicode_literals from syncthing_gtk.tools import IS_WINDOWS, IS_GNOME DELAY = 5 # Display notification only after no file is downloaded for <DELAY> seconds ICON_...
"""Downloads files upon request in a thread/process safe way. DEPRECATED: Should be merged into chromite.lib.cache. """ from __future__ import print_function import hashlib import os import shutil import stat import time from chromite.lib import cros_logging as logging from chromite.lib import locking from chromite...
#! /usr/bin/python3 __author__ = 'huanpc' import asyncio import http.client from aiohttp import web import logging import sys import cloudAMPQclient import influxdb_client from prometheus_export import PrometheusClient import os PROTOCOL = 'http' HOST = '0.0.0.0' PORT = 9090 M2M_HOST = '127.0.0.1' if os.enviro...
"""Provides a handler for removing students from a class.""" from gkeepcore.local_csv_files import LocalCSVReader from gkeepcore.path_utils import user_from_log_path from gkeepcore.student import students_from_csv from gkeepserver.database import db, DatabaseException from gkeepserver.event_handler import EventHandle...
import os import sys def main(args, result): # Test if the tree file exists. try: open(args.tree, "r") except: # If the --tree was not used if args.tree == None: sys.exit("[Error] The stochastic mapping analysis requires a tree file as input.") else: sys.exit("[Error] Unable to open tree file \"%s\"" ...
import django_filters import itertools from django import forms from django.db.models import Q from django.utils.encoding import force_text # # Filters # class NumericInFilter(django_filters.BaseInFilter, django_filters.NumberFilter): """ Filters for a set of numeric values. Example: id__in=100,200,300 ...
# Enter your code here. Read input from STDIN. Print output to STDOUT n = input() arr = [int(i) for i in raw_input().strip().split()] mean = float (sum(arr)) / n print mean def calc_median(input_list): sorted_list = sorted(input_list) l = len(sorted_list) if(l%2 == 0): med = float (sorted_list[l/2...
import logging import os import time default_log_path = './logs' def formatted_logger(label, level=None, format=None, date_format=None, file_path=None): log = logging.getLogger(label) if level is None: level = logging.INFO elif level.lower() == 'debug': level = logging.DEBUG elif leve...
""" openclbuffers interface """ from novaclient import base class OpenCLBuffer(base.Resource): def __repr__(self): return "<OpenCL Buffer Id: %s>" % self.id class OpenCLBufferId(base.Resource): def __repr__(self): return "<OpenCL Buffer: %s Id>" % self.id class OpenCLBuffersManager(base.Mana...
from flask.ext.wtf import Form from wtforms import StringField, SubmitField, TextAreaField, BooleanField, SelectField from wtforms.validators import DataRequired, Length, Email, Regexp, ValidationError from ..models import Role, User from flask_pagedown.fields import PageDownField class NameForm(Form): name = Str...
import subprocess, json, os this_file_exist = lambda x: os.path.exists(filename) ####HELPER section def command_line(cmd): try: s = subprocess.check_output(cmd) return s.strip() except subprocess.CalledProcessError: return 0 def information(filename): """Returns the file exif"""...
"""Classes for converting parsed doc content into markdown pages.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import inspect def build_md_page(page_info): """Given a PageInfo object, return markdown for the page. Args: page_info: must be a...
{ "name": "Register for free events - Sale extension", "version": "8.0.1.0.0", "author": "Serv. Tecnol. Avanzados - Pedro M. Baeza, " "Antiun Ingeniería S.L.,", "Odoo Community Association (OCA)" "license": "AGPL-3", "category": "Website", "summary": "Combine free and...
import os class Options(object): """This class represents a set of options for the test runner. Attributes: test_path (str): Path to the test driver. policy_path (str): Path to ``test_filter.py``. component_name (str): Name of the component for the test driver. is_debug (bool)...
import setup_util import subprocess import sys import time import os def start(args, logfile, errfile): setup_util.replace_text("plain/src/main/resources/application.conf", "127.0.0.1", args.database_host) if os.name == 'nt': subprocess.check_call(".\sbt.bat assembly && del /f /s /q target\scala-2.10\cache", s...
#!/usr/bin/env python import gtk class EntryCompletionManager: def __init__(self): self.completions = gtk.ListStore(str) self.entries = [] self.enabled = False self.useContainsFunction = False self.inlineCompletions = False def start(self, matching, inline, com...
""" pagination.py """ from django.core.paginator import Paginator, EmptyPage class XPaginator(object): """ Example: XPaginator(objs, page).map(function_cb) """ def __init__(self, objs, page=0, page_size=10): try: self.paginator = Paginator(objs, page_size) s...
from __future__ import with_statement import datetime import threading import sickbeard from sickbeard import db, scheduler from sickbeard import search_queue from sickbeard import logger from sickbeard import ui #from sickbeard.common import * class BacklogSearchScheduler(scheduler.Scheduler): ...
from openerp import api, fields, models def format_code(code_seq): code = map(int, str(code_seq)) code_len = len(code) while len(code) < 14: code.insert(0, 0) while len(code) < 16: n = sum([(len(code) + 1 - i) * v for i, v in enumerate(code)]) % 11 if n > 1: f = 11 ...
from rally import consts from rally.plugins.openstack import scenario from rally.plugins.openstack.scenarios.ceilometer import utils as cutils from rally.plugins.openstack.scenarios.keystone import utils as kutils from rally.task import validation class CeilometerEvents(cutils.CeilometerScenario, kutils.KeystoneScena...
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import TestSCons import sys import os test = TestSCons.TestSCons() if sys.platform == 'win32': test.write('duplicate a file.bat', 'copy foo.in foo.out\n') copy = test.workpath('duplicate a file.bat') else: test.write('duplicate a file.sh', 'cp...
# -*- coding: utf-8 -*- ''' Production Configurations ''' from configurations import values # See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings from .common import Common class Production(Common): # INSTALLED_APPS INSTALLED_APPS = Common.INSTALLED_APPS # END INSTALL...
from database.db2 import db2, ConstDB2 from binascii import hexlify class Statistician: @staticmethod def count_uplink(dev_eui, start_ts=0, end_ts=-1): if end_ts == -1: end_ts = float('inf') info = [] pipe = db2.pipeline() dev_eui = hexlify(dev_eui).decode() ...
import CijUtil import numpy as np import numpy.testing as npt import unittest class TestInvertCijFunctions(unittest.TestCase): def setUp(self): self.inmatrix = np.matrix([[0.700, 0.200],[0.400, 0.600]]) self.inerrors = np.matrix([[0.007, 0.002],[0.004, 0.006]]) self.true_inv = np.matrix([[...
from __future__ import absolute_import __all__ = ['Serializer', 'JsonObjectSerializer', 'JsonSerializer'] import six import struct from autobahn.wamp.interfaces import IObjectSerializer, ISerializer from autobahn.wamp.exception import ProtocolError from autobahn.wamp import message class Ser...
#!/usr/bin/env python # # Searches through the whole source tree and updates # the generated *.gen/*.mod files in the docs folder, keeping all # documentation for the tools, builders and functions... # as well as the entity declarations for them. # Uses scons-proc.py under the hood... # import os import SConsDoc # Di...
#!/usr/bin/env python import sys sys.path.append('../') from ore_examples_helper import OreExample oreex = OreExample(sys.argv[1] if len(sys.argv)>1 else False) oreex.print_headline("Run ORE to produce NPV cube and exposures without horizon shift") oreex.run("Input/ore.xml") oreex.get_times("Output/log.txt") oreex....
import argparse import json import os import sys from datetime import datetime from EchoCourse import EchoCourse from EchoDownloader import EchoDownloader _DEFAULT_BEFORE_DATE = datetime(2100, 1, 1).date() _DEFAULT_AFTER_DATE = datetime(1900, 1, 1).date() def try_parse_date(date_string, fmt): try: retur...
''' @author: jnaous ''' try: from cStringIO import StringIO except ImportError: from StringIO import StringIO import xmlrpclib import urlparse import base64 import logging logger = logging.getLogger("TestClientTransport") class TestClientTransport(xmlrpclib.Transport): """Handles connections to XML-RPC se...
from discord import Message from discord.ext import commands from bashbot.command import session_exists from bashbot.terminal.sessions import sessions from bashbot.terminal.terminal import Terminal class ControlsCommand(commands.Cog): @commands.group( name='.controls', description='Manages termin...
""" MGCP (Media Gateway Control Protocol) [RFC 2805] """ from scapy.packet import Packet, bind_layers, bind_bottom_up from scapy.fields import StrFixedLenField, StrStopField from scapy.layers.inet import UDP class MGCP(Packet): name = "MGCP" longname = "Media Gateway Control Protocol" fields_desc = [Str...
from django.shortcuts import render from .models import Flight from .models import Passenger from .models import StartLane from .models import StartLaneScheduleField from .helpers import validate_password from .helpers import validate_user from .helpers import string_to_int_list from .helpers import update_personal_dat...
import numpy as np import pytest from numpy.testing import assert_allclose from ..utils import convert_normalization, compute_chi2_ref from ..core import LombScargle NORMALIZATIONS = ['standard', 'model', 'log', 'psd'] @pytest.fixture def data(N=100, period=1, theta=[10, 2, 3], dy=1, rseed=0): """Generate some...
""" UI URL definitions """ from django.conf.urls import patterns, url urlpatterns = patterns( 'ui', # Home page url(r'^$', 'views.homepage.default_view', name='homepage'), url(r'^download-to-buy/$', 'views.homepage.download_to_buy_view', name='download_to_buy'), # Item maintenance ur...
from __future__ import absolute_import import json from math import ceil import logging logger = logging.getLogger(__name__) from karaage.machines.models import Machine, Account from karaage.projects.models import Project from alogger import get_parser from .models import CPUJob, Queue """ Parse log files using a...
# foobar:~/carrotland USER$ cat readme.txt # Carrotland # ========== # The rabbits are free at last, free from that horrible zombie science experiment. They need a happy, safe home, where they can recover. # You have a dream, a dream of carrots, lots of carrots, planted in neat rows and columns! But first, you need...
import pandas as pd import matplotlib.pyplot as plt import matplotlib from datetime import timedelta from sklearn.cluster import KMeans matplotlib.style.use('ggplot') # Look Pretty # INFO: This dataset has call records for 10 users tracked over the course of 3 years. # Your job is to find out where the users likel...
# coding=utf-8 import vdebug.log import vim import re class Dispatcher: def __init__(self,runner): self.runner = runner def visual_eval(self): event = VisualEvalEvent() return event.execute(self.runner) def eval_under_cursor(self): event = CursorEvalEvent() return ...
from xbmcswift2 import Plugin STRINGS = { 'page': 30001, 'streams': 30100, 'videos': 30101, 'vodcasts': 30103, 'search': 30200, 'title': 30201 } STATIC_STREAMS = ( { 'title': 'Nasa TV HD', 'logo': 'public.jpg', 'stream_url': ('http://nasatv-lh.akamaihd.net/i/' ...
"""Accounts controller functions.""" import hashlib from webob.dec import wsgify from .. import contexts, conv, model, wsgihelpers # Controllers @wsgify def login(req): ctx = contexts.Ctx(req) user = model.get_user(ctx, check=True) return wsgihelpers.respond_json(ctx, {'login': 'ok', 'username': user...
from forms import Form from django.utils.encoding import StrAndUnicode from fields import IntegerField, BooleanField from widgets import Media, HiddenInput, TextInput from util import ErrorList, ValidationError __all__ = ('BaseFormSet', 'all_valid') # special field names TOTAL_FORM_COUNT = 'TOTAL_FORMS' INITIAL_FORM_...
"""instavision URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class...
""" GCode M130 M131 and M132 Adjust PID settings Author: Mathieu Monney email: zittix(at)xwaves(dot)net Website: http://www.xwaves.net License: CC BY-SA: http://creativecommons.org/licenses/by-sa/2.0/ """ from GCodeCommand import GCodeCommand class M130(GCodeCommand): def execute(self, g): extr = g.get...
""" Base utilities to build API operation managers and objects on top of. """ import abc import base64 import contextlib import hashlib import inspect import os import six from novaclient import exceptions from novaclient.openstack.common import strutils from novaclient import utils def getid(obj): """ Abs...
#!/usr/bin/env python """ Copyright 2010-2019 University Of Southern California 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 appli...
import os.path import subprocess import tempfile import unittest from Bio import SeqIO import deenurp from deenurp import wrap from deenurp.test import util from deenurp.util import which, MissingDependencyError @unittest.skipUnless(which('cmalign'), "cmalign not found.") class CmAlignTestCase(unittest.TestCase): ...
import paddle import warnings import paddle.nn as nn import numpy as np from .static_flops import static_flops, Table __all__ = ['flops'] def flops(net, input_size, custom_ops=None, print_detail=False): """Print a table about the FLOPs of network. Args: net (paddle.nn.Layer||paddle.static.Program): ...
from spack import * class FontWinitzkiCyrillic(Package): """X.org winitzki-cyrillic font.""" homepage = "http://cgit.freedesktop.org/xorg/font/winitzki-cyrillic" url = "https://www.x.org/archive/individual/font/font-winitzki-cyrillic-1.0.3.tar.gz" version('1.0.3', '777c667b080b33793528d5abf3247...
#!/usr/bin/python # # dor-bug robot # # ####################################################### import os import numpy as np import pickle from random import random, seed from math import sin, cos, asin, atan, sqrt def choose_randomly(Ls): N = len(Ls) return Ls[int(N*random())] TOLERANCE = 0.5 MAX_ITER = 10 ...
from __future__ import unicode_literals from django.db import models from django.contrib.auth.models import User class Provider(models.Model): class Meta: db_table = 'provider' app_label = 'management' name = models.CharField(max_length=50) config = models.TextField() description = ...
from __future__ import absolute_import from builtins import range import logging logger=logging.getLogger(__name__) from persistent import Persistent from .errors import * class Backend(Persistent): def __init__(self, name, backend_type = "INVALID"): self.name = name self.backend_type = backend_...
from __future__ import print_function, division import matplotlib matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from neuralnilm import Net, RealApplianceSource, BLSTMLayer, SubsampleLayer, DimshuffleLayer from lasagne.nonlinearities import sigmoid, rectify from lasagne.objectives import c...
import socket,asyncore import types import os, sys import re import time from threading import Thread import threading import traceback import simplejson from vyperlogix import misc from vyperlogix.misc import _utils logger = None def addto(instance): def decorator(f): import new ...
from CIM14.CPSM.Equipment.Wires.Switch import Switch class Disconnector(Switch): """A manually operated or motor operated mechanical switching device used for changing the connections in a circuit, or for isolating a circuit or equipment from a source of power. It is required to open or close circuits when negligi...
import wx import numpy import stars.visualization.layers as layers from stars.visualization.transforms import WorldToViewTransform from kernelDensityTime import KernelDensity from pysal.cg import bbcommon, get_rectangle_rectangle_intersection class wxTimeSeriesPlot: def __init__(self,layer): if not isinsta...
from requestbuilder import Arg from euca2ools.commands.ec2 import EC2Request class DeleteNetworkAcl(EC2Request): DESCRIPTION = 'Delete a VPC network ACL' ARGS = [Arg('NetworkAclId', metavar='ACL', help='ID of the network ACL to delete (required)')]
__author__ = 'gjp' import datetime from django.test import TestCase from fiware_cloto.cloto import information class InformationTests(TestCase): def setUp(self): self.body1 = "{\"windowsize\": 4}" self.expect1 = 4 self.body2 = "{\"windowsize\": notValidWindowSize}" self.info = in...