src
stringlengths
721
1.04M
# Standard py.test configuration file. Fixtures defined here will be available in all modules. from cassandra.cluster import Cluster import pytest from log_entry import LogEntryStore # This variable tells py.test which files and folders to ignore collect_ignore = ["env"] @pytest.fixture(scope="module") def fixture...
# Gnu General Public License - see LICENSE.TXT import json from collections import defaultdict import threading import hashlib import os import cPickle import time from .downloadutils import DownloadUtils from .simple_logging import SimpleLogging from .item_functions import extract_item_info from .kodi_utils import H...
""" Django settings for <%= slug %> project. Generated by 'django-admin startproject' using Django 1.10.3. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import...
from shapely.geometry import MultiPolygon, Polygon # taken from http://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Python_Parsing def parse_poly(fname): """ Parse an Osmosis polygon filter file. Accept a sequence of lines from a polygon file, return a shapely.geometry.MultiPolygon object. ...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import absolute_import import boto import boto.s3 import boto.sqs import importlib import json from bac...
""" Adapter for an external cheat sheets service (i.e. for cheat.sh) Configuration parameters: upstream.url upstream.timeout """ # pylint: disable=relative-import import textwrap import requests from config import CONFIG from .adapter import Adapter def _are_you_offline(): return textwrap.dedent( ...
import os from lxml import etree from epubcreator.pyepub.pyepubwriter import epub from epubcreator.epubbase import ebook_metadata, ebook_data, files, images from epubcreator.misc import utils from epubcreator.misc.options import Options, Option class Ebook(Options): OPTIONS = [Option(name="includeOptionalFiles"...
# # 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 us...
# -*- coding: utf-8 -*- import fauxfactory import pytest from cfme import test_requirements from cfme.utils import error from cfme.utils.update import update from cfme.automate.explorer.domain import DomainCollection pytestmark = [test_requirements.automate] @pytest.yield_fixture(scope='module') def domain(applian...
"""Base class for a memory representation of any dataset""" class Dataset: """Represents a dataset read to memory""" def __init__(self, feature_names=[]): """Initializes a new instance of Dataset Parameters ---------- feature_names : list<str>, optional List of na...
"""Unit tests for pyatv.support.dns""" import io import typing import pytest from pyatv.support import dns @pytest.mark.parametrize( "name,expected", ( ("_http._tcp.local", (None, "_http._tcp", "local")), ("foo._http._tcp.local", ("foo", "_http._tcp", "local")), ("foo.bar._http._tcp....
# stdlib from typing import Optional # syft relative from . import collections from ...ast import add_classes from ...ast import add_dynamic_objects from ...ast import add_methods from ...ast import add_modules from ...ast.globals import Globals from ...core.node.abstract.node import AbstractNodeClient from ..misc.uni...
import pytest import sys import os import re import hubcheck pytestmark = [ pytest.mark.website, pytest.mark.tickets, pytest.mark.need_help, pytest.mark.reboot, pytest.mark.upgrade, pytest.mark.prod_safe_upgrade ] class TestNee...
# Copyright 2013, 2014, 2015, 2016, 2017 Kevin Reid <kpreid@switchb.org> # # This file is part of ShinySDR. # # ShinySDR 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 # ...
#!/usr/bin/env python3 import sys import os import argparse import yaml import math sys.path.append(os.path.join(sys.path[0], "..", "..", "..")) # load parent path of KicadModTree from KicadModTree import * # NOQA from KicadModTree.nodes.base.Pad import Pad # NOQA sys.path.append(os.path.join(sys.path[0], "..", "...
# # Drawing.py -- Drawing plugin for Ginga reference viewer # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # from ginga import GingaPlugin from ginga import colors from ginga.gw import Widgets from ginga.misc import ParamSet, Bunch from ginga.util import dp...
#!/usr/bin/env python #SBATCH --time=12:00:00 #SBATCH --mem-per-cpu=1024 #SBATCH --partition=guest #SBATCH --error=job.%J.err #SBATCH --output=job.%J.out #SBATCH --cpus-per-task=1 # # Author: Lei Xu <eddyxu@gmail.com> # # TODO(eddyxu): generalize this to all drivers from __future__ import print_function from subproces...
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: # timezone support for django > 1.4 from django.utils import timezone tz = timezone except ImportError: tz = d...
#! /usr/bin/env python import argparse import re import math import codecs from six.moves import reduce def uniq(ls): d = {} ret = [] for x in ls: if x not in d: d[x] = True ret.append(x) return ret # I know numpy has these functions, but I wanted to make this script...
# coding: utf-8 from multiprocessing import Process, Pipe import numpy as np from .._global import OptionalModule try: import cv2 except (ModuleNotFoundError, ImportError): cv2 = OptionalModule("opencv-python") try: from skimage.filters import threshold_otsu from skimage.morphology import label from skimage...
# Copyright (C) 2016 Ross Wightman. All Rights Reserved. # # 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 # =================================...
from collections import namedtuple from tkinter import Text, Tk import unittest from unittest.mock import Mock, NonCallableMagicMock, patch, sentinel, ANY from test.support import requires from idlelib.config import idleConf from idlelib.squeezer import count_lines_with_wrapping, ExpandingButton, \ Squeezer from i...
from .main import Slugify, UniqueSlugify from .alt_translates import * slugify = Slugify() unique_slugify = UniqueSlugify() slugify_unicode = Slugify(translate=None) slugify_url = Slugify() slugify_url.to_lower = True slugify_url.stop_words = ('a', 'an', 'the') slugify_url.max_length = 200 slugify_filename = Slugi...
# This file is part of the Trezor project. # # Copyright (C) 2012-2018 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distrib...
import json import pytest from . import jrequest, get_jwt_auth_header from tests import clear_db unauthorized_scenarios = [ ['GET', 'api/users', 'Authorization Required', 401], ] @pytest.mark.parametrize( 'method, url, error, status_code ', unauthorized_scenarios) def test_unauthorized_request(method, url, e...
from django.db import models from django.urls import reverse from django.utils.translation import gettext as _ from .helper import DefaultFields, DummyInterface from .location import Location class Person(DefaultFields, DummyInterface): name = models.CharField(max_length=100) given_name = models.CharField(ma...
import unittest from flask import json import app from models import * users_url = 'http://localhost:5000/users' recordings_url = 'http://localhost:5000/recordings' json_header = {'Content-type': 'application/json'} class BasicTestCase(unittest.TestCase): def setUp(self): self.app = app.create_app() ...
# Build Godot.NET.Sdk solution import os from SCons.Script import Dir def build_godot_net_sdk(source, target, env): # source and target elements are of type SCons.Node.FS.File, hence why we convert them to str module_dir = env["module_dir"] solution_path = os.path.join(module_dir, "editor/Godot.NET.Sd...
import base64 import hashlib import hmac import logging from django import http from django.conf import settings from django.core.files.storage import default_storage from django.views import generic logger = logging.getLogger("s3file") class S3MockView(generic.View): def post(self, request): success_ac...
# -*- coding: utf-8 -*- # # Roy Kokkelkoren <roy.kokkelkoren@gmail.com> # # This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with # the additional special exception to link portions of this program with the OpenSSL library. # See LICENSE for more details. # import os from o...
# -------------------------------------------------------------------------- # Source file provided under Apache License, Version 2.0, January 2004, # http://www.apache.org/licenses/ # (c) Copyright IBM Corp. 2015, 2016 # -------------------------------------------------------------------------- """ This example is th...
# This file is part of PyEMMA. # # Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER) # # PyEMMA is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either vers...
# coding: utf-8 """ Stakeholder engagement API This API enables Intelligent Engagement for your Business. iEngage is a platform that combines process, augmented intelligence and rewards to help you intelligently engage customers. OpenAPI spec version: 1.0 Generated by: https://github.com/swagger...
from app import app , db , login_manager from flask import render_template , request , flash , redirect , url_for ,g , jsonify from models import Users from flask.ext.login import login_user , logout_user , current_user , login_required from bson.objectid import ObjectId import json from bson import json_util @app.rou...
# 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 to in writing, software # distributed under the Li...
# Base exceptions for the Simpleline application. # # Base class for Simpleline Text UI framework. # # This file is part of Simpleline Text UI library. # # Copyright (C) 2020 Red Hat, Inc. # # Simpleline is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public Licen...
import csb.test as test from csb.io import MemoryStream from csb.bio.io.mrc import DensityMapReader, DensityMapWriter, DensityMapFormatError, HeaderInfo, ByteOrder @test.unit class TestDensityMapReader(test.Case): def setUp(self): super(TestDensityMapReader, self).setUp() ...
#!/usr/bin/env python3 # # Copyright (c) 2016 Supreeth Herle # # 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 applicabl...
import os import sys class ConfigHelper(): """ Manage all configuration information for the application """ def __init__(self): TRUE = "True" FALSE = "False" ERROR = 1 self.halo_key = os.getenv("HALO_API_KEY") self.halo_secret = os.getenv("HALO_API_SECRET_K...
## # Copyright (c) 2012-2015 Apple Inc. All rights reserved. # # 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 l...
#!/usr/bin/python # network.py - Copyright (C) 2010 Red Hat, Inc. # Written by Joey Boggs <jboggs@redhat.com> # # 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; version 2 of the License. # # This...
#!/usr/bin/env python3 from math import pi import os import random import torch import unittest import gpytorch from gpytorch.kernels import RBFKernel, MultitaskKernel from gpytorch.means import ConstantMean, MultitaskMean from gpytorch.likelihoods import MultitaskGaussianLikelihood from gpytorch.distributions impor...
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Encore Hu, <huyoo353@126.com>' import sys import os import time start = time.time() def _tokenize(textline): #print 'you call me' for x in textline: yield x tokenize = _tokenize class BaseChineseWordTokenizer(object): '''针对一行短语进行处理, 比如...
#!/usr/bin/python2.6 # Copyright 2020 Google LLC # # 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 a...
""" BIANA: Biologic Interactions and Network Analysis Copyright (C) 2009 Javier Garcia-Garcia, Emre Guney, Baldo Oliva 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 vers...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('persons', '0007_auto_20150711_2332'), ] operations = [ migrations.CreateModel( name='Activity', fiel...
#file : InMoov2.full3.byGael.Langevin.1.py # this script is provided as a basic guide # most parts can be run by uncommenting them # InMoov now can be started in modular pieces import random leftPort = "COM20" rightPort = "COM7" i01 = Runtime.createAndStart("i01", "InMoov") #inmoov = Runtime.createAndStart("alice", ...
# -*- coding: utf-8 -*- """ Merge Neural Gas Merge Neural Gas (MNG) [Strickert2003]_ is similar to the original Neural Gas algorithm, but each node, has an additional context vector (:math:`c`) associated; and the best matching unit is determined by a linear combination of both the weight and context vector (thus the ...
# Copyright (c) 2013 Johan Ceuppens. # All rights reserved. # Redistribution and use in source and binary forms are permitted # provided that the above copyright notice and this paragraph are # duplicated in all such forms and that any documentation, # advertising materials, and other materials related to such # dist...
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
from datetime import time from unittest import TestCase import pandas as pd from trading_calendars import get_calendar from trading_calendars.utils.pandas_utils import days_at_time from zipline.gens.sim_engine import ( MinuteSimulationClock, SESSION_START, BEFORE_TRADING_START_BAR, BAR, SESSION_END...
#!usr/bin/env python #coding=utf-8 import numpy as np import math import disposeWav pi = math.pi def MCLT(x): ''' Written by the MCLT definition, and it is slow. ''' M = len(x)/2 #M = 8192 h = (2*M)*[0] for n in range(M): h[n] = -math.sin((2.0*n+1.0)*math.pi/(4.0*M)) ...
#!/usr/bin/env python3 from argparse import ArgumentParser from base64 import encodebytes from os import environ, name, system from sys import argv def get_basic_auth(username, password): """Returns basic authentication. Args: username (str): the username (defaults to environment variable 'U') ...
### # Copyright (c) 2005, Jeremiah Fincher # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditi...
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Menu.slug' db.alter_column(u'blocks_menu', 'slug', self.gf('blocks.fields.SlugURLField')(...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' ********************************************************** * SpectraKeras - MLP * 20180926a * Uses: Keras, TensorFlow * By: Nicola Ferralis <feranick@hotmail.com> *********************************************************** ''' print(__doc__) import numpy as np import ...
import sys import unittest from StringIO import StringIO sys.path.append('../yeast') import ahttp import acore class FAKE_USER(acore.Acore): def read_all(self, arw, size=0, seps=()): for y in arw.aread(size, seps): yield y class FAKE(acore.ARW): def __init__(self, data): acore.A...
# -*- coding: utf-8 -*- import os import subprocess class BllExecuter: SHOW_LOGIN = str.encode('ShowLoginWindow') SHOW_LOGIN_OFF = str.encode('ShowLoginWindow =0\r\n') def __init__(self, workingDir, bllFullPath): self.workingDir = workingDir self.exeDir = self.workingDir + '\\exe\\' self.bllFullPath = bll...
from collections import Counter from django.utils import timezone from django.shortcuts import get_object_or_404 from Application.models import Item, UserProfile, Section, Status from Application.utilities.python_utilities import floor_log from Application.service.profile_services import get_profile, get_keywords_by_...
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Jocelyn Jaubert # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Rdc(CMakePackage): """ROCm Data Center Tool""" homepage = "https://github.com/Radeon...
""" Example 1, to be run within CASA. This script serves as a guideline for how to get data out of a CASA ms and into a format which visilens can use. We really don't need all that much information, so we keep only the columns we need. To keep the number of visibilities low, we first average the data a bit. In this p...
"""Slack platform for notify component.""" import asyncio import logging import os from urllib.parse import urlparse from aiohttp import BasicAuth, FormData from aiohttp.client_exceptions import ClientError from slack import WebClient from slack.errors import SlackApiError import voluptuous as vol from homeassistant....
# TODO: """ # register curl -v -X POST -d 'vkid=3sfddd&recovery_code=12o_pda_iod' http://127.0.0.1:8080/register_user # register with list of vk-friends curl -v -X POST -d 'vkid=id0013j&recovery_code=abc-check-reg&fr=id9616&&fr=id7987&fr=id6530' http://127.0.0.1:8080/register_user # create post curl -v -X POST --coo...
""" awslimitchecker/tests/test_utils.py The latest version of this package is available at: <https://github.com/jantman/awslimitchecker> ############################################################################## Copyright 2015-2018 Jason Antman <jason@jasonantman.com> This file is part of awslimitchecker, al...
# coding: utf-8 """ Copyright 2016 SmartBear Software 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 l...
from bson import json_util import multiprocessing from website.models import Conf from time import time, sleep import inspect import subprocess import json try: import signal except: print "signal cannot be imported" def execute(cmd, daemon=False): if daemon: _ = subprocess.Popen(cmd, shell=True,...
#!/usr/bin/env python import unittest class Solution: def __init__(self): self.twodig = set(map(lambda x: "%d" % x, range(10, 27))) self.onedig = set(map(lambda x: "%d" % x, range(1,10))) # @param s, a string # @return an integer def numDecodings(self, s): if len(s)==0: ...
# -*- coding: utf-8 -*- """ PlotItem.py - Graphics item implementing a scalable ViewBox with plotting powers. Copyright 2010 Luke Campagnola Distributed under MIT/X11 license. See license.txt for more infomation. This class is one of the workhorses of pyqtgraph. It implements a graphics item with plots, labels, and...
from tiltai.utils import tiltai_logs_format import socket from logbook import Logger, StderrHandler err = StderrHandler(format_string=tiltai_logs_format) log = Logger("sdn[docker]") def dockersdn(queue_name, resolver, storage): """ Get addresses and type of the socket from within docker container. A hostnam...
"""Generate patient data""" import barnum from demodata.util import * __copyright__ = "Copyright (C) 2017 Robert Down" __author__ = "Robert Down <robertdown@live.com>" __license__ = "GNU GPL3" def generate_patients(count=1): random.seed() patients = [] for x in range(0, count): sex = 'Male' if r...
import random import textwrap from configparser import ConfigParser def explain() -> str: """Explain Person Action Object""" return textwrap.dedent( """\ Person Action Object (PAO) The PAO is a system of encoding where you attribute a specific Person with an Action that includ...
# View more python learning tutorial on my Youtube and Youku channel!!! # Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg # Youku video tutorial: http://i.youku.com/pythontutorial """ Please note, this code is only for python 3+. If you are using python 2+, please modify the code acco...
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function import argparse import os import os.path import sys import tempfile import tfi import tfi.driver import tfi.driverconfig from tfi.resolve.model import _detect_model_file_kind, _model_mo...
# -*- Mode: python; tab-width: 8; indent-tabs-mode: nil -*- # vim: set ts=8 sts=4 et sw=4 tw=80: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os import utils ...
from __future__ import unicode_literals import logging from django.core.management.sql import emit_post_migrate_signal from django.db import migrations from django.db.models import Q from django.contrib.auth.models import Group from django.contrib.auth.models import Permission logger = logging.getLogger(__file__) d...
#!/usr/bin/env python """ fancyplotting.py -- make nice plots of tracts output. It mimics for the most part the output of fancyplotting.nb, but additionally provides a command-line interface and is generally more reusable that the originally-bundled Mathematica code. fancyplotting.py optionally uses seaborn or brewe...
# Created by Pearu Peterson, September 2002 from __future__ import division, print_function, absolute_import from numpy.testing import (assert_, assert_equal, assert_array_almost_equal, assert_array_almost_equal_nulp, assert_array_less, assert_allclose) import pyt...
# Copyright (c) 2017 Elias Riedel Gårding # Licensed under the MIT License from utilities import to_column_vector, int_to_bits, bits_to_int import numpy as np class Constellation: """A mapping m: ℤ2^n → ℝ^K.""" @classmethod def uniform(cls, n): "Equidistant points (K = 1)." # {-(2^n - 1...
from app.notify_client import _attach_current_user, NotifyAdminAPIClient class NotificationApiClient(NotifyAdminAPIClient): def __init__(self): super().__init__("a" * 73, "b") def init_app(self, app): self.base_url = app.config['API_HOST_NAME'] self.service_id = app.config['ADMIN_CLIE...
"""The sampling implementation of fractional factorial method This implementation is based on the formulation put forward in [`Saltelli et al. 2008 <http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470059974.html>`_] """ from scipy.linalg import hadamard import numpy as np from . import common_args from ..util im...
import os import sys import json from terminaltables import AsciiTable class Maze(object): def __init__(self, start_node, json_file, selected_objects=[]): self.start_node = start_node self.selected_objects = selected_objects self.result = [['Id', 'Room', 'Obj. collected']] self.js...
""" basic collect and runtest protocol implementations """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import bdb import os import sys from time import time import six from .reports import CollectErrorRepr from .reports import CollectReport from .repor...
#!c:\users\ekiefer\projects\django\my_edge\py34env\scripts\python.exe # # The Python Imaging Library # $Id$ # # this demo script illustrates how a 1-bit BitmapImage can be used # as a dynamically updated overlay # try: from tkinter import * except ImportError: from Tkinter import * from PIL import Image, Imag...
# Copyright 2012-2014 Red Hat, Inc. # # 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...
# -*- coding: utf-8 -*- # # Copyright (c) 2017, the cclib development team # # This file is part of cclib (http://cclib.github.io) and is distributed under # the terms of the BSD 3-Clause License. """Bridge for using cclib data in PyQuante (http://pyquante.sourceforge.net).""" from __future__ import print_fu...
# -*- coding: utf-8 -*- # # pipless documentation build configuration file, created by # sphinx-quickstart on Fri Sep 2 01:39:02 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
from __future__ import with_statement from os import path import yaml class Config(object): """ The config class captures the config state of Igor, this is primarily used for reading in the config yaml and creating the various paths used by igor to extract posts, templates, etc. """ config_fi...
from PySide import QtCore, QtGui from demoitem import DemoItem class DemoTextItem(DemoItem): STATIC_TEXT, DYNAMIC_TEXT = range(2) def __init__(self, text, font, textColor, textWidth, scene=None, parent=None, type=STATIC_TEXT, bgColor=QtGui.QColor()): super(DemoTextItem, self).__init__(sc...
from examples import NoRonoTest import z3 import time import random import sys def ResetZ3 (): z3._main_ctx = None z3.main_ctx() z3.set_param('smt.random_seed', random.SystemRandom().randint(0, sys.maxint)) iters = 10 min_hosts = 5 max_hosts = 1000 print "host dmz_time q_time h_time total" for hc in xrang...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
"""Dose GUI for TDD: main script / entry point.""" import sys, colorama from dose._legacy import DoseMainWindow from dose.misc import ucamel_method from dose.compat import wx, quote def main_wx(test_command=None): class DoseApp(wx.App): @ucamel_method def on_init(self): # Called by wxPython ...
from django import forms from django.forms import widgets from django.utils.translation import ugettext_lazy as _ from umessages.utils import get_user_model class CommaSeparatedUserInput(widgets.Input): input_type = 'text' def render(self, name, value, attrs=None): if value is None: value...
import sys import os.path sys.path.append(os.path.abspath(os.pardir)) import disaggregator as da import unittest import pandas as pd import numpy as np class ApplianceInstanceTestCase(unittest.TestCase): def setUp(self): indices = [pd.date_range('1/1/2013', periods=96, freq='15T'), pd.d...
# Author: Hubert Kario, (c) 2015 # Released under Gnu GPL v2.0, see LICENSE file for details """Example empty appd data test""" from __future__ import print_function import traceback from random import sample import sys import re import getopt from tlsfuzzer.runner import Runner from tlsfuzzer.messages import Connect...
#!/usr/bin/python # -*- coding: utf-8 -*- from deskctl import app from flask import g, render_template, make_response, session, request import traceback ################################################################################ ## standard error (uses render_template and thus standard page layout) def stderr(t...
# An infinite and sparse array; automatically set to all zeros. # By Nick O'Dell from array import array from collections import defaultdict from math import floor ALLOC_SIZE = 24 # Number of elements to allocate at once class infarray: def __init__(self, typecode, block_size = ALLOC_SIZE): self._initial_l...
""" mfdrn module. Contains the ModflowDrn class. Note that the user can access the ModflowDrn class as `flopy.modflow.ModflowDrn`. Additional information for this MODFLOW package can be found at the `Online MODFLOW Guide <http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?drn.htm>`_. """ import...