src
stringlengths
721
1.04M
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
# coding: utf-8 from __future__ import ( unicode_literals, division, print_function, absolute_import ) import re import pytest from ww import s, g, f def test_lshift(): res = s >> """ This is a long text And it's not indented """ assert isinstance(res, s) s == "This is a long text\nAnd...
#Copyright (c) 2008, Media Modifications Ltd. #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, publish,...
import json import random from math import sin, cos from django.conf import settings from django.core.exceptions import ValidationError from django.shortcuts import get_object_or_404 from tastypie import fields from tastypie import http from tastypie.authentication import MultiAuthentication, Authentication, BasicAu...
""" CISCO_SESS_BORDER_CTRLR_STATS_MIB The main purpose of this MIB is to define the statistics information for Session Border Controller application. This MIB categorizes the statistics information into following types\: 1. RADIUS Messages Statistics \- Represents statistics of various RADIUS messages for RADIUS s...
# pylint: disable=invalid-name, no-member, unused-argument """ passing varyings to fragment """ import numpy as np from vispy import app, gloo from vispy.util.transforms import translate, perspective, rotate # note the 'color' and 'v_color' in vertex vertex = """ uniform mat4 u_model; // Model matrix uniform...
''' A MLP network for MNIST digits classification Project: https://github.com/roatienza/dl-keras Usage: python3 <this file> ''' from __future__ import absolute_import from __future__ import division from __future__ import print_function # numpy package import numpy as np from keras.models import Sequential from kera...
# coding: utf-8 import unittest import doctest from hcsvlab_robochef.griffith.ingest import * from hcsvlab_robochef.griffith import ingest from hcsvlab_robochef.rdf.map import * def unittests(): res = doctest.DocTestSuite(ingest) res.addTest(unittest.makeSuite(UnitTest)) return res class UnitTest(unittest.Te...
## ## Copyright 2007, Red Hat, Inc ## see AUTHORS ## ## This software may be freely redistributed under the terms of the GNU ## general public license. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave...
# bridge.py # # Copyright (C) 2013 Yi-Wei Ci <ciyiwei@hotmail.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; either version 2 of the License, or # ...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """ The module file for vyos_facts """ ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': [u'preview'], 'suppo...
import warnings import numpy as np from numpy.random import standard_normal as noise from nipy.testing import * from nipy.io.api import load_image from nipy.modalities.fmri.api import FmriImageList, fmri_generator from nipy.core.image.generators import * from nipy.fixes.scipy.stats.models.regression import OLSModel as...
#This file, along with Lib_Java.py specify to the CodeGenerater how to compile CodeDog source code into Java source code. import progSpec import codeDogParser from progSpec import cdlog, cdErr, logLvl from codeGenerator import codeItemRef, codeUserMesg, codeAllocater, codeParameterList, makeTagText, codeAction, getMode...
#!/usr/bin/env python """Creates the media files and database fixtures for Vesa's Music Trainer.""" import logging import os import re from typing import Dict, Optional from resource_base import BuildTarget LOGGER = logging.getLogger(__name__) HTML_TEMPLATE = """<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transit...
""" Test PUF adjust-ratio file contents. """ import pytest @pytest.mark.parametrize('kind', ['puf']) def test_ratios(kind, cps_ratios, puf_ratios, growfactors, cps_start_year, puf_start_year): """ Check contents of puf_ratios dataframe. (Note that there are no cps_ratios data.) """ ...
# -*- coding: utf-8 -*- import os from rms import Run import time import math ###################################################################################################################################### # Программа для управления ранами. Руководство по использованию ...
''' Created on Mar 18, 2014 @author: Dario Bonino <dario.bonino@polito.it> Copyright (c) 2014 Dario Bonino 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/LICE...
""" Test starting and stopping iohub server """ from builtins import object from psychopy.tests import skip_under_vm from psychopy.tests.test_iohub.testutil import startHubProcess, stopHubProcess @skip_under_vm class TestKeyboard(object): """ Keyboard Device tests. Starts iohub server, runs test set, then ...
# -*- coding: utf-8 -*- # vim: sw=4 ts=4 fenc=utf-8 et # ============================================================================== # Copyright © 2008 UfSoft.org - Pedro Algarvio <ufs@ufsoft.org> # # Please view LICENSE for additional licensing information. # ========================================================...
from datetime import datetime, date import types import tempfile import tarfile import ocgis from ocgis import RequestDataset import datetime as dt import os from flyingpigeon import analogs from pywps.Process import WPSProcess import logging class AnalogsProcess(WPSProcess): def __init__(self): # defini...
import zstackwoodpecker.test_state as ts_header import os TestAction = ts_header.TestAction def path(): return dict(initial_formation="template5", checking_point=1, faild_point=100000, path_list=[ [TestAction.add_image, 'image1', 'root', os.environ.get('isoForVmUrl')], [TestAction.create_vm_by_image, 'image1',...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # django-hierarkey documentation build configuration file, created by # sphinx-quickstart on Sun Apr 3 00:09:59 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 ...
import torch from torch import nn, Tensor from typing import Iterable, Dict from ..SentenceTransformer import SentenceTransformer class CosineSimilarityLoss(nn.Module): """ CosineSimilarityLoss expects, that the InputExamples consists of two texts and a float label. It computes the vectors u = model(inpu...
import re def index(i,j,k): ''' Fargo3d index calculator. Input: Strings i,j,k, with the value of the desired index on each direction. Output: The monodimentional fargo3d index. ''' value = '' print i,j,k #Trivial option if i == 'i' and j == 'j' and k == 'k': value += 'l' ...
#!/usr/bin/env python """Assess Juju under various proxy network conditions. This test is dangerous to run on your own host. It will change the host's network and can lock you out of your host. There are checks to ensure the host matches expectations so that the network can be reset. While the test is running, other p...
""" WSGI config for qn 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`` setti...
## @package ChirpPython # # Python Chirp bindings. # # The objects and methods provided by this package correspond to the native # C API in @ref chirp_reli.h and chirp_swig_wrap.h # # The SWIG-based Python bindings provide a higher-level interface that # revolves around: # # - @ref Chirp.Client # - @ref Chirp.Stat impo...
from unittest import TestCase import pyutf8 class TestValidUTF8Bytes(TestCase): def test_valid_utf8_bytes(self): valid_utf8_bytes = pyutf8.valid_utf8_bytes self.assertEquals( "invalid U+11ffff: ", valid_utf8_bytes("invalid U+11ffff: " + ''.join(map(chr, [244, 159, 191, 191]))...
# import ast # import json # import ruamel.yaml as ry # from ruamel.yaml.comments import CommentedSeq # from dolo.compiler.symbolic import check_expression # from dolo.compiler.recipes import recipes # from dolo.misc.termcolor import colored # class Compare: # def __init__(self): # self.d = {} # def ...
#!/usr/bin/env python # ********************************************************************** # # Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. # # This copy of Ice is licensed to you under the terms described in the # ICE_LICENSE file included in this distribution. # # *************************************...
#!/usr/bin/env python # -*- coding: utf-8 -*- '''W3C SRGS parser Copyright (C) 2010 Yosuke Matsusaka Intelligent Systems Research Institute, National Institute of Advanced Industrial Science and Technology (AIST), Japan All rights reserved. Licensed under the Eclipse Public License -v 1.0 (EPL) ht...
import os import json import codecs from base import BaseJSONFormat class JSONFormat(BaseJSONFormat): extension = 'json' build_per_ratio = True @classmethod def populate_argument_parser(cls, parser): group = parser.add_argument_group("JSON format options") group.add_argument("--jso...
# -*- coding: utf-8 -*- # 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...
import logging from lnst.Common.Parameters import Param from lnst.Common.IpAddress import ipaddress from lnst.Controller import HostReq, DeviceReq, RecipeParam from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe from lnst.Recipes.ENRT.ConfigMixins.OffloadSubConfigMixin import ( OffloadSubConfigMixin) from l...
#!/usr/bin/python import logging, os, unittest import common from autotest_lib.client.common_lib import enum, global_config, host_protections from autotest_lib.database import database_connection from autotest_lib.frontend import setup_django_environment from autotest_lib.frontend.afe import frontend_test_utils, model...
# Software License Agreement (BSD License) # # Copyright (c) 2009, Willow Garage, Inc. # 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...
""" .. moduleauthor:: Stephen Raymond Ferg and Robert Lugg (active) .. default-domain:: py .. highlight:: python Version |release| """ from __future__ import print_function from __future__ import division from __future__ import unicode_literals from __future__ import absolute_import from builtins import str from bui...
from .base import * # noqa DEBUG = True HOST = 'http://localhost:8000' SECRET_KEY = 'secret' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': base_dir_join('db.sqlite3'), } } STATIC_ROOT = 'staticfiles' STATIC_URL = '/static/' MEDIA_ROOT = 'mediafiles' MEDIA_URL...
# vim: set fileencoding=utf-8 : # # (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.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; either version 2 of the License, or # ...
# This file is part of e-Giełda. # Copyright (C) 2014-2015 Mateusz Maćkowski and Tomasz Zieliński # # e-Giełda 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 ...
# Copyright (C) 2010-2012 Red Hat, Inc. # This work is licensed under the GNU GPLv2 or later. # Save domain as a statefile import os import libvirt from libvirt import libvirtError from libvirttestapi.src import sharedmod from libvirttestapi.utils import utils required_params = ('guestname', 'filepath',) optional_p...
import os.path import subprocess release = False __version__ = '0.2' _repository_path = os.path.split(__file__)[0] _git_file_path = os.path.join(_repository_path, '__git_version__.py') def _minimal_ext_cmd(cmd): # construct minimal environment env = {} for k in ['SYSTEMROOT', 'PATH']: v = os.env...
from types import (MobTypes, ObjectTypes) import numpy as np import utils class BaseEntity(object): '''Prototype class with position methods''' def __init__(self, eid, x, y, z, pitch, yaw): self.eid = eid self.x = x self.y = y self.z = z self.pitch = pitch self...
""" Test class for mauscelery.mausworker module. Mock objects are used to mimic a process pool for asynchronous function calls. """ # This file is part of MAUS: http://micewww.pp.rl.ac.uk:8080/projects/maus # # MAUS is free software: you can redistribute it and/or modify # it under the terms of the GNU General Pub...
from decimal import Decimal from flask import render_template from flask_mail import Message from html2text import html2text from premailer import transform as email_transform from baseframe import __ from . import app, mail, rq from .models import CURRENCY_SYMBOL, LINE_ITEM_STATUS, Assignee, LineItem, Order @rq....
import matplotlib.pyplot as plt import numpy as np import matplotlib.colors as colors import urllib from mpl_toolkits.axes_grid1.inset_locator import inset_axes import matplotlib.cm as cm Low_Temp_Color = 'k' Mid_Temp_Color = 'g' High_Temp_Color = 'r' #Temp_Color = 0.5 Cloudy_Sim_Color = 'cyan' markersize = 20 SDSS_Fil...
# -*- coding: utf-8 -*- #============================================================================= # # File : feeds.py # Author : Hodonou SOUNTON # Team : drxos, kiah, fall, geolov, sadj # Site : http://reysh.com ...
# -*- coding: utf-8 -*- import datetime from django.db import transaction from django.db.models import F from common import utils, debug, cache from www.misc.decorators import cache_required from www.misc import consts from www.message.interface import UnreadCountBase from www.account.interface import UserBase from w...
import os import numpy as np from datetime import datetime from wopr.database import task_engine as engine, Base from wopr.models import crime_table, MasterTable, sf_crime_table,\ sf_meta_table, shp2table from wopr.helpers import download_crime from datetime import datetime, date from sqlalchemy import Column, Inte...
# -*- coding:utf-8 -*- # Created by Hans-Thomas on 2011-05-12. #============================================================================= # testrunner.py --- Running tests #============================================================================= from __future__ import absolute_import, unicode_literals impor...
import os import multiprocessing import asyncore import datetime class Status(object): """process status enum""" REDY, RUNN, RSTT, STNG, KLNG, STPD, EXTD = \ 'READY', 'RUNNING', 'RESTARTING', \ 'STOPPING', 'KILLING', 'STOPPED', 'EXITED' class Process(asyncore.file_dispatcher): """main p...
''' Created on 25.07.2016 @author: mkennert ''' from decimal import Decimal from kivy.properties import ListProperty, NumericProperty, ObjectProperty from kivy.uix.gridlayout import GridLayout from crossSectionInformation.rectInformation import RectangleInformation from crossSectionView.rectView import Re...
import sys class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Codec: def serialize(self, root): result = [] self.serializeHelper(root, result) result.reverse() return ",".join(result) def serializeHelper(self...
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # File name: apriori_SGS_fede_timestat.py # Created by: gemusia # Creation date: 11-07-2017 # Last modified: 12-08-2017 08:48:12 # Purpose:computation of apriori statistics of particles, # statistic derived from scratch # - test of possible substitution of ...
#!/usr/bin/env python # encoding: utf-8 from t import T import socket class P(T): def __init__(self): T.__init__(self) def verify(self,head='',context='',ip='',port='',productname={},keywords='',hackinfo=''): timeout=3 result = {} result['result']=False target_url...
from datetime import datetime import json import os from urlparse import urlparse from pymongo.connection import Connection import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web from tornado.options import define, options MONGO_URL = "" # found with $>heroku config we_live = True...
from corehq.apps.export.views import ExportsPermissionsMixin from django.core.urlresolvers import reverse from corehq.apps.app_manager.dbaccessors import get_brief_apps_in_domain from corehq.apps.reports.models import ReportConfig, FormExportSchema, CaseExportSchema from dimagi.utils.decorators.memoized import memoized...
#!/usr/bin/python3 """ Proof-of-concept systemd environment generator that makes sure that bin dirs are always after matching sbin dirs in the path. (Changes /sbin:/bin:/foo/bar to /bin:/sbin:/foo/bar.) This generator shows how to override the configuration possibly created by earlier generators. It would be easier ...
# -*- coding: utf-8 -*- # Django settings import os.path from os import environ from django.template.defaultfilters import slugify PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) DEBUG = True TEMPLATE_DEBUG = DEBUG # serve media through the staticfiles app. SERVE_MEDIA = DEBUG INTERNAL_...
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutExceptions(Koan): class MySpecialError(RuntimeError): pass def test_exceptions_inherit_from_exception(self): mro = self.MySpecialError.mro() self.assertEqual('RuntimeError', mro[1].__name__) se...
#!/usr/bin/env python from openpyxl import Workbook __version__ = '0.3.0' import datetime from twitter import Twitter, OAuth, oauth_dance from tweetlist import TweetList from ux import write_and_flush, get_screenname, get_start_date, \ prompt_to_open_file, print_copyright from output import save_to_csv, write_to_...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2011 Midokura KK # Copyright (C) 2011 Nicira, Inc # Copyright 2011 OpenStack Foundation # 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...
# -*- coding: utf-8 -*- # $Id$ """ Test Manager WUI - TestBox. """ __copyright__ = \ """ Copyright (C) 2012-2014 Oracle Corporation This file is part of VirtualBox Open Source Edition (OSE), as available from http://www.virtualbox.org. This file is free software; you can redistribute it and/or modify it under the te...
import curses from datetime import date, timedelta import locale from textwrap import fill from pymetweather.forecasts import WeatherForecast from pymetweather.get_args import get_command_line_args, get_config_args locale.setlocale(locale.LC_ALL, '') class WeatherPrinter(object): def __init__(self, forecast, sc...
# -*- coding: utf-8 -*- # # Язык Embeddecy documentation build configuration file, created by # sphinx-quickstart on Fri Sep 29 10:45:50 2017. # # 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 # autogener...
import time from cloudbrain.subscribers.rabbitmq import PikaSubscriber from cloudbrain_examples.settings import (base_routing_key, metric_name, num_channels, buffer_size, rabbitmq_address, rabbitmq_user, rabbitmq_pwd) def _print_callback(unsed_ch, unsed_method, unsed_prope...
from __future__ import print_function, division import numpy as np try: from scipy import special as scipy_special except ImportError: scipy_special = None # Precomputed factorials FACTORIALS = [1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800, 39916800, 479001600, 6227020800, 8717829120...
#!/usr/bin/env python3 import sys import os import re from Bio import SeqIO import argparse def main(args): if len(args) is not 4: print("get_seqs.py SORTED_tmhmm_output_filepath SORTED_input_fasta_filepath output_file") tmhmm_out_fh = open(args[1], 'rU') input_seq_fh = open(args[2], 'rU') ...
import os import shutil from pombola.config import config IN_TEST_MODE = True base_dir = os.path.abspath( os.path.join( os.path.split(__file__)[0], '..', '..' ) ) # Change the data dir in testing, and delete it to ensure that we have a clean # slate. Also print out a little warning - adds clutter to the test output b...
# Copyright 2019 Tecnativa - David Vidal # Copyright 2020 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo.addons.sale_order_product_recommendation.tests import ( test_recommendation_common) class RecommendationCaseTests(test_recommendation_common.Recommendation...
import functools import os from flask import Blueprint from flask import abort from flask import flash from flask import g from flask import redirect from flask import render_template from flask import request from flask import session from flask import url_for from peewee import * from wtforms import Form from wtform...
import logging, sys, blessings from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL colors = True format = '{levelname: <8} {msg}' term = blessings.Terminal() logging.basicConfig() class Logger(logging.Logger): def __init__(self, name, level = DEBUG): super(Logger, self).__init__(name, level) ...
from flask_restful import Resource from flask import Response from bson.objectid import ObjectId from bson.json_util import dumps from utils.deepzoom import get_slide, PILBytesIO class Tile(Resource): def __init__(self, db, config): """initialize DeepZoom resource Args: db: mongo db connection config: appl...
# -*- coding: utf-8 -*- import traceback from datetime import timedelta from django.core import mail from django.core.mail import EmailMultiAlternatives, mail_admins from django.core.management.base import BaseCommand from django.template.loader import render_to_string from django.utils.translation import ugettext_laz...
import pygame import Game as dm def opties(): pygame.mixer.music.load("music.mp3") pygame.mixer.music.play(loops=0, start=0.0) size = width, height = 340,240 screen = pygame.display.set_mode(size) redSquare = pygame.image.load('achtergrondSpelers.png').convert() white = (255,255,255) w = ...
from OpenGLCffi.EGL import params @params(api='egl', prms=['dpy', 'attrib_list', 'layers', 'max_layers', 'num_layers']) def eglGetOutputLayersEXT(dpy, attrib_list, layers, max_layers, num_layers): pass @params(api='egl', prms=['dpy', 'attrib_list', 'ports', 'max_ports', 'num_ports']) def eglGetOutputPortsEXT(dpy, at...
""" read_graph.py -- Used for reading graph node and edge information from an adjacency matrix contained within a file. """ __author__ = 'Tom' class Graph: def __init__(self): self.num_nodes = 0 self.edge_weights = dict() def read_graph(self, infile): """ Reads a file to popul...
# -*- coding: utf-8 -*- # # Copyright 2015 Tarek Galal <tare2.galal@gmail.com> # # This file is part of Gajim-OMEMO plugin. # # The Gajim-OMEMO plugin 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 ver...
from datetime import datetime from radar.database import db from radar.models.consents import Consent, CONSENT_TYPE from radar.models.demographics import Ethnicity, Nationality from radar.models.diagnoses import Diagnosis from radar.models.groups import ( Group, GROUP_CODE_NHS, GROUP_CODE_RADAR, GROUP_...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Node classes for the AST for a Mojo IDL file.""" # Note: For convenience of testing, you probably want to define __eq__() methods # for all node types; it...
# -*- coding: utf-8 -*- """ This module contains the tool of emencia.recipe.patch """ from setuptools import setup, find_packages version = '0.1' long_description = ( open('README.rst').read() + '\n' + '\n' + 'Download\n' '********\n' ) entry_point = 'emencia.recipe.patch:Recipe' entry_points = {"z...
# Licensed to the StackStorm, Inc ('StackStorm') 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 th...
# -*- coding: utf-8 -*- try: from collections import OrderedDict except ImportError: OrderedDict = dict from collections import defaultdict from inspect import getargspec from colander import Invalid from pkg_resources import get_distribution from pkg_resources import resource_filename from pyramid.config im...
import os import re import json dataTypes = {'string':[],'integer':[],'boolean':[]} def collectDataTypes(jdir): for root, dirs, files in os.walk(jdir): path = root.split(os.sep) for f in files: fn=os.path.join(root, f) if fn.endswith('.java'): ff = open(fn)....
# Cameralogger - record and decorate camera images for timelapses etc. # Copyright (C) 2017 Steve Marple. # # 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 #...
from channels import Group as channelsGroup from channels.sessions import channel_session import random from .models import Group as OtreeGroup, Subsession as OtreeSubsession, Constants import json import channels import logging from otree import constants_internal import django.test from otree.common_internal import ...
# from hearthbreaker.agents.basic_agents import RandomAgent from hearthbreaker.agents.trade.possible_play import PlayMixin from hearthbreaker.agents.trade.trade import TradeMixin, AttackMixin from hearthbreaker.agents.trade.util import Util import hearthbreaker.cards.battlecries class BattlecryType: @staticmethod...
import os import platform from twisted.internet import defer from .. import data, helper from p2pool.util import pack P2P_PREFIX = 'a5725982'.decode('hex') #pchmessagestart P2P_PORT = 9338 ADDRESS_VERSION = 0 #pubkey_address RPC_PORT = 9337 RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue( ...
import json from datetime import datetime import dateutil.parser from django.utils.http import urlencode from django.test import TestCase from django.core.urlresolvers import reverse from tastypie.models import ApiKey from tastypie.resources import Resource from tastypie import fields from corehq.apps.groups.models i...
# # Copyright 2018 PyWren Team # # 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...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Test the implemented estimators against each other on simple data sets. """ import numpy as np from KDEpy.NaiveKDE import NaiveKDE from KDEpy.TreeKDE import TreeKDE from KDEpy.FFTKDE import FFTKDE import itertools import pytest N = 2 ** 5 estimators = [NaiveKDE, Tree...
""" Display number of pending updates for OpenSUSE Linux. Configuration parameters: cache_timeout: How often we refresh this module in seconds (default 600) format: Display format to use (default 'zypper: [\?color=update {update}]') thresholds: specify color thresholds to use (defau...
import xml.etree.cElementTree as ET import simplejson, optparse, sys, os def elem_to_internal(elem,strip=1): """Convert an Element into an internal dictionary (not JSON!).""" d = {} for key, value in elem.attrib.items(): d['@'+key] = value # loop over subelements to merge them for subele...
import sys sys.path.append('..') sys.path.append('../..') import unittest from html_txt import HtmlTxt from file_manager import FileManager class HtmlTxtTests(unittest.TestCase): def test2_htmltxt1(self): file1 = FileManager('test_files/test1.html') file2 = FileManager('test_files/test2.html') ...
import fileinput import re import sys ############# ## Globals ## ############# scope = [] mode = 0 in_indicies = False surface_done = False ignore_next_line = False on_first_entity = True found_key_value = False indent = " " WHITE_SPACE = r'(?:(?!\n)\s)+' NUM_PATTE...
# Copyright 2013 X35 # # This file is part of gamemod. # # gamemod 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. # ...
from default import * from library import * import tools sys.path.append(os.path.join(CWD, 'external')) if 'linux' in sys.platform: sys.path.append(os.path.join(CWD, 'system', 'linux')) elif 'win32' in sys.platform: sys.path.append(os.path.join(CWD, 'system', 'win32')) elif 'darwin' in sys.platform: sys.p...
# -*- coding: utf-8 -*- # Generated by Django 1.10.3 on 2017-03-15 16:02 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import s3direct.fields class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ ...
#!/usr/bin/python import sys, string, re, os, commands, time, math #from scipy import stats #import scipy as sp import numpy as np #import matplotlib as mpl #from matplotlib import pyplot as plt class SNP: def __init__(self, name, num_env, t): self.name = name self.num_env = [F...
#!/usr/bin/env python import re, glob, string # as swap1.py except that we here use a regex with comments and compile it: arg = r'[^,]+' call = re.compile(r""" (?P<start> # preserve start of function string superLibFunc # name of function to match \s* # optional whitespace ...