src
stringlengths
721
1.04M
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: miha@reciprocitylabs.com # Maintained By: miha@reciprocitylabs.com from dateutil.parser import parse from flask import current_app from sqlalchemy ...
import operator import asyncio import re import logging from enum import IntEnum from aioethereum import create_ethereum_client from aioethereum.errors import BadResponseError from .utils import hex_to_dec, wei_to_ether, ether_to_gwei, ether_to_wei GAS_AMOUNT = 21000 GAS_PRICE = 20 # Gwei DEFAUT_FEE = wei_to_ether...
# 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 may ...
from __future__ import absolute_import, print_function, unicode_literals, division from time import sleep # This file is part of the ISIS IBEX application. # Copyright (C) 2012-2016 Science & Technology Facilities Council. # All rights reserved. # # This program is distributed in the hope that it will be useful. # Thi...
#!/usr/bin/env python # This script aims to help developers locate forms and view code that needs to # use the new CSRF protection in Django 1.2. It tries to find all the code that # may need the steps described in the CSRF documentation. It does not modify # any code directly, it merely attempts to locate it. Deve...
import secrets import logging import traceback import sys from datetime import datetime def main(): logging.basicConfig(filename='neopapi.log', level=logging.DEBUG, format='%(asctime)s|%(levelname)s|%(name)s|%(msg)s', datefmt="%x-%X") logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) ...
from __future__ import division,print_function from os import environ import sys HOME=environ['HOME'] PROJECT_ROOT=HOME+'/Panzer/NCSU/Spatial and Temporal/crater' EXPTS = PROJECT_ROOT+'/expts' sys.path.extend([PROJECT_ROOT,EXPTS]) sys.dont_write_bytecode = True from george.lib import * from expts.csvParser import parse...
#!/usr/bin/env python import json import logging import optparse import os import shlex import shutil import signal import socket from subprocess import Popen, CalledProcessError, PIPE import sys import time import unittest import urllib2 import MySQLdb import environment from vtctl import vtctl_client from mysql_f...
# ----------------------------------------------------------------------------- # Copyright (c) 2009-2016 Nicolas P. Rougier. All rights reserved. # Distributed under the (new) BSD License. # ----------------------------------------------------------------------------- """ Vertex Array objects are OpenGL objects that s...
#!/usr/bin/python # -*- coding: utf-8 -*- """Tests for the file-like object implementation using pyvhdi.""" import unittest from dfvfs.lib import errors from dfvfs.path import os_path_spec from dfvfs.path import vhdi_path_spec from tests import test_lib as shared_test_lib from tests.file_io import test_lib @shared...
# Copyright 2012 OpenStack Foundation # # 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...
import traceback from lib.FileManager.workers.baseWorkerCustomer import BaseWorkerCustomer class NewFile(BaseWorkerCustomer): def __init__(self, path, session, *args, **kwargs): super(NewFile, self).__init__(*args, **kwargs) self.path = path self.session = session def run(self): ...
import os from datetime import datetime, date, timedelta from urlparse import urlparse import yaml from flask import Blueprint, redirect from flask.ext.mako import render_template import ofcourse from ofcourse.util import app_path, get_hw_keys participants_bp = Blueprint('participants_bp', ...
# -*- coding: utf-8 -*- import logging from time import time from django.db import models from wechat_sdk.messages import EventMessage from system.official_account.models import OfficialAccount logger_response = logging.getLogger(__name__) class ResponseManager(models.Manager): """ 微信服务器响应消息记录表 Manager ...
#!/usr/bin/env python # # Copyright 2007 Google 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 o...
test = { 'name': 'Problem 7', 'points': 3, 'suites': [ { 'cases': [ { 'answer': '7b94a2861b435311f9fceeb5e6f092c4', 'choices': [ 'the restaurants in restaurants', 'the names of restaurants in restaurants', 'the extracted values for each res...
## ## pyunoserver.py ## Login : <uli@pu.smp.net> ## Started on Fri Aug 28 02:13:03 2009 Uli Fouquet ## $Id$ ## ## Copyright (C) 2009 Uli Fouquet ## 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 Foundatio...
""" Converts MethodSchema's (data configurations) into Deform schemas. There is also a helper function (get_method_schema_preview) for turning the created schema into HTML for preview purposes on the methods page. """ from collections import namedtuple from datetime import date from beaker.cache import cache_r...
#!/usr/bin/env python from wsgiref.simple_server import make_server import os, os.path, sys import cgi, urlparse import random, string import subprocess import time site_name = 'http://crashes.sirikata.com' id_file = 'data/__id' def str_to_bool(v): return not (len(v) == 0 or v.lower() in ['no', 'false', '0']) d...
from logging import Logger from typing import Dict, Type, Callable, List, Optional import psutil from core.base_solution import BaseSolution from core.core_system import CoreSystem from core.utilities.type_aliases import Vector __author__ = "Guido Pio Mariotti" __copyright__ = "Copyright (C) 2016 Guido Pio Mariotti"...
import logging from collections.abc import Mapping from copy import deepcopy from itertools import chain from funcy import cached_property, get_in, lcat, once, project from dvc import dependency, output from dvc.hash_info import HashInfo from dvc.parsing import FOREACH_KWD, JOIN, DataResolver, EntryNotFound from dvc....
#!/usr/bin/env python #***************************************************************************** # Universal Transverse Mercator (UTM) conversion # Copyright (c) 2013-2015, Kjeld Jensen <kjeld@frobomind.org> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification...
# types.py import bpy from bpy.types import PropertyGroup from bpy.props import BoolProperty, IntProperty, FloatProperty, StringProperty, PointerProperty, EnumProperty, FloatVectorProperty from functools import partial def get_unused_component_types(scene=None, context=None): # Unused arguments del scene, co...
import pygame from pygame.locals import * import gui screen = pygame.display.set_mode( (640, 480), FULLSCREEN ) # try adding DOUBLEBUF | HWSURFACE # pygame.mouse.set_visible(0) app = gui.App() c = gui.Container(width=640,height=480) ## ## dialog 1 ## t1 = gui.Table() t1.tr() t1.add(gui.Label("Gal Test")) ...
from PySide.QtGui import * from polygon import Polygon from path import Path from aref import ARef from sref import SRef from graphicsitems import * import os class MyRect(QGraphicsRectItem): def __init__(self, x, y, w, h, scene=None): super().__init__(x, y, w, h, scene) def paint(self, painter, opti...
#!/usr/bin/env python # # cmakedash - a dash docset generator for CMake import os import re import subprocess from bs4 import BeautifulSoup, NavigableString, Tag from docsetgenerator import DocsetGenerator class CMakeDocsetGenerator (DocsetGenerator): def __init__(self): DocsetGenerator.__init__(self) self....
''' .. module:: skrf.io.general ======================================== general (:mod:`skrf.io.general`) ======================================== General io functions for reading and writing skrf objects .. autosummary:: :toctree: generated/ read read_all read_all_networks write write_all ...
#!/usr/bin/python3 # ============================================================================ # Manage files in S3 # ============================================================================ import boto3 import os import pandas as pd import logging import zipfile from airbnb_config import ABConfig AWS_S3_BUCKET...
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi. Copyright Camptocamp SA # Donors: Hasa Sàrl, Open Net Sàrl and Prisme Solutions Informatique SA # # This program is free software: you can redistribute it and/or modify # it unde...
# vim: fenc=utf-8 foldmethod=marker # call this script with nao-dummy.html as argument. import os import sys import math from subprocess import call, Popen, PIPE if not len(sys.argv) > 1: print("No file argument given.") sys.exit() infile = sys.argv[1] if not os.path.isfile(infile): print("No valid file ...
#!/usr/bin/python #Install the modules we need #from pyfirmata import Arduino, util, INPUT from mcpi import minecraft from mcpi import minecraftstuff from time import sleep import server import serial # Set up a connection to the Arduino/Shrimp if we need it #PORT = "/dev/tty.SLAB_USBtoUART" #ser = serial.Serial(PORT...
# -*- coding: utf-8 -*- # Generated by Django 1.11.2 on 2017-10-23 21:00 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_depende...
""" test generic validation lookup function """ import mongomock #from mock import patch #from nose.tools import raises from dwm import Dwm # Setup mongomock db DB = mongomock.MongoClient().db DB.genericLookup.insert({"find": "BADVALUE"}) # Setup Dwm instance FIELDS = { 'field1': { 'lookup': ['generi...
#!/usr/bin/env python from .Event import Event from .HTMLEvent import HTMLEvent from .MouseEvent import MouseEvent import logging log = logging.getLogger("Thug") # Introduced in DOM Level 2 class EventTarget(object): def __init__(self): if log.ThugOpts.Personality.isIE() and log.ThugOpts.Personality.bro...
''' Show a streaming, updating representation of Fourier Series. The example was inspired by `this video`_. Use the ``bokeh serve`` command to run the example by executing: bokeh serve fourier_animated.py at your command prompt. Then navigate to the URL http://localhost:5006/fourier_animated in your brows...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 MORITA Kazutaka. # 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.or...
# (C) Datadog, Inc. 2015-present # (C) Takumi Sakamoto <takumi.saka@gmail.com> 2014 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) import re from six.moves.urllib.parse import urlparse from datadog_checks.base import AgentCheck, ConfigurationError from datadog_checks.base.utils.subproces...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of Poseidon. # # Poseidon 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 ve...
#! /usr/bin/env python3 """Flappy Bird, implemented using Pygame.""" import math import os from random import randint from collections import deque import pygame from pygame.locals import * FPS = 60 ANIMATION_SPEED = 0.18 # pixels per millisecond WIN_WIDTH = 284 * 2 # BG image size: 284x512 px; tiled twice WI...
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
#!/usr/bin/env python # Rapache - Apache Configuration Tool # Copyright (C) 2008 Stefano Forenza, Jason Taylor, Emanuele Gentili # # 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 versi...
from __future__ import division from __future__ import print_function from caffe_all import * import numpy as np import unittest # Helper class that allows python layers to be added to NetSpec easily. Just use # Py.YourLayer(bottom1, bottom2, ..., parameter1=.., ...) # parameter1 will automatically be passed to You...
# udis86 - scripts/ud_opcode.py # # Copyright (c) 2009, 2013 Vivek Thampi # 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 copyrig...
from __future__ import division import os import sys import time import threading import re import random from ..runtime import min_version, runtime_info from ..utils import timestamp from ..metric import Metric from ..metric import Breakdown from ..frame import Frame class ProfilerConfig(object): def __init__...
import os import csv import json TSV_FOLDER = "../data/tsv/" FIELDNAMES = ("tract", "apn", "issue_date", "final_date", "lot", "permit_number", "owner", "contractor", "applicant", "location", "approval_status", "sub_code", "sub_code_description", "work_code", "work_code_description", "census...
# -*- coding: utf-8 -*- """Tests for time-varying functional connectivity graphs module.""" import pytest import scipy as sp from scipy import io import numpy as np import os from numpy import testing from dyconnmap import tvfcg, tvfcg_ts, tvfcg_cfc, tvfcg_compute_windows from dyconnmap.fc import PAC, PLV, plv def ...
from datetime import timedelta from django.test import TestCase from django.utils import timezone from course.models import Course, CourseInstance from userprofile.models import User from .cache import CachedCourseMenu from .models import LinkService, LTIService, MenuItem from .templatetags import external_services a...
# -*- coding:utf-8 -*- ''' WSGI config for tennisranking 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 ...
#!/bin/python # exmaple 1: parse a url with re module # this take a string with a url and split the protocol, ip or nameserver and port # if port don't exist and the protocol is http the port is 80. import re url = raw_input('url : ') # check if the url has the form protocol://hostname:port # protocol is character ...
import json import requests from enum import Enum class Health(Enum): unknown = 0 ok = 1 conn_err = 2 bad_status = 3 bad_protocol = 4 # cool trick found here: # http://stackoverflow.com/questions/24481852/serialising-an-enum-member-to-json class EnumEncoder(json.JSONEncoder): def default(self...
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
#!/usr/bin/python2 """>> sqlcl << command line query tool by Tamas Budavari <budavari@jhu.edu> Usage: sqlcl [options] sqlfile(s) Options: -s url : URL with the ASP interface (default: pha) -f fmt : set output format (html,xml,csv - default: csv) -q query : specify query on the command line -l :...
''' 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 program is distributed in the hope that it will be...
#!python3.0.1 # -*- coding: utf-8 -*- """ ƒf[ƒ^ƒx[ƒX“o˜^ –kŠC“¹ JR–kŠC“¹ ”ŸŠÙü ”ŸŠÙ‰w ‚Í‚±‚¾‚Ä 0 0 """ import os import sqlite3 import sys import re from collections import defaultdict if 1 < len(sys.argv): fn = sys.argv[1] else: fn = 'jr.txt' dbname = 'jr.db' if os.access(d...
""" Computing Riemann Theta Functions This module implements the algorithms for computing Riemann theta functions and their derivatives featured in the paper *"Computing Riemann Theta Functions"* by Deconinck, Heil, Bobenko, van Hoeij, and Schmies [CRTF]. **DEFINITION OF THE RIEMANN THETA FUNCTION:** Let `g` be a ...
# # 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...
# -*- coding: utf-8 -*- # # Copyright (C) 2016 Hewlett Packard Enterprise Development LP # # 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 # # U...
#THESE LINES ARE NEEDED TO ADD THE GradingScriptLibrary path to the system path so they can be imported!!! import os,sys,inspect cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile( inspect.currentframe() ))[0],"../../"))) if cmd_subfolder not in sys.path: sys.path.insert(0, ...
import re def match_regexp(reg): """ Get filter, which check if string matches regular expression """ compiled_reg = re.compile(reg) def check_regexp(text): return compiled_reg.match(text) is not None return check_regexp def do_not_match_regexp(reg): """ Get filter, which ch...
#!/usr/bin/env python3 """ Run a command without network access. """ import argparse import glob import os import signal import sys from typing import List import command_mod import subtask_mod class Options: """ Options class """ def __init__(self) -> None: self._args: argparse.Namespace =...
""" This is a pure Python implementation of the P-Series algorithm https://en.wikipedia.org/wiki/Harmonic_series_(mathematics)#P-series For doctests run following command: python -m doctest -v p_series.py or python3 -m doctest -v p_series.py For manual testing run: python3 p_series.py """ def p_series(nth_term: int...
# -*- coding: utf-8 -*- # Scrapy settings for votes_14e project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/late...
# coding: utf-8 # # Copyright 2014 The Oppia Authors. 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 requi...
###################################################################### # This file is an ad hoc script used to simulate data for the b-tea # pipeline. TE can be estimated using a simulation approach based on # modifying real data to introduce differences in RNA/RFP data. # This script uses samtools to subsample exist...
#!/usr/bin/env python # Copyright (c) 2016 Marco Giusti # See LICENSE for details. from setuptools import setup def get_version(filename="nvd3.py", varname="__version__"): glb = {} with open(filename) as fp: for line in fp: if varname in line: exec(line, glb) ...
# coding=utf-8 # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import os import re from builtins import str from pants.backend.jvm import argfile from ...
""" Copyright 2013 Steven Diamond 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...
# -*- coding: utf-8 -*- import src.arch.zx48k.optimizer.helpers as helpers def test_new_tmp_val(): """ Test new tmp val is different each time, and starts with the UNKNOWN_PREFIX """ a, b = helpers.new_tmp_val(), helpers.new_tmp_val() assert a != b, "Values must be different" assert all(helpe...
# Django base settings for {{cookiecutter.project_name}} project. from os.path import abspath, basename, dirname, join, normpath from sys import path ########## PATH CONFIG # Absolute filesystem path to the Django project folder: PROJECT_ROOT = dirname(dirname(dirname(abspath(__file__)))) # Absolute filesystem path ...
from django import http import mock from six.moves.urllib_parse import quote from olympia.addons import decorators as dec from olympia.addons.models import Addon from olympia.amo.tests import TestCase, addon_factory class TestAddonView(TestCase): def setUp(self): super(TestAddonView, self).setUp() ...
from __future__ import unicode_literals from collections import OrderedDict from django import forms from django.core.mail import EmailMultiAlternatives from django.forms.utils import flatatt from django.template import loader from django.utils.encoding import force_bytes from django.utils.html import format_html, fo...
import errno import stat import pwd import os from OpenSSL import crypto def convertDERtoPEM(key): return crypto.dump_publickey(crypto.FILETYPE_PEM, crypto.load_publickey(crypto.FILETYPE_ASN1, key)) def convertPEMtoDER(key): return crypto.dump_publickey(crypto.FILETYPE_ASN1, crypto.load_publickey(crypto.FILE...
""" Tools for Energy Model Optimization and Analysis (Temoa): An open source framework for energy systems optimization modeling Copyright (C) 2015, NC State University 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 S...
""" [7/23/2012] Challenge #80 [difficult] (Multi-word anagrams) https://www.reddit.com/r/dailyprogrammer/comments/x0vj7/7232012_challenge_80_difficult_multiword_anagrams/ In [today's easy problem](http://www.reddit.com/r/dailyprogrammer/comments/x0v3e/7232012_challenge_80_easy_anagrams/), we investigated anagrams tha...
''' Copyright 2011 Jesse Yates 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 wr...
#!/usr/bin/env python # # Simple DMRG tutorial. This code integrates the following concepts: # - Infinite system algorithm # - Finite system algorithm # # Copyright 2013 James R. Garrison and Ryan V. Mishmash. # Open source under the MIT license. Source code at # <https://github.com/simple-dmrg/simple-dmrg/> # Thi...
# Copyright (c) 2013 - The C3PX authors. # # This file is part of C3PX. # # C3PX 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 your option) any later versio...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2009-2010: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel <h.goebel@goebel-consult.de> # # This file is part of Shinken. # # Shinken is free software: you can re...
#!/usr/bin/python # -*- coding: ascii -*- '''========================================================================== qxjsonrpc - JSON-RPC backend for the qooxdoo JavaScript library (C) 2007 - Viktor Ferenczi (python@cx.hu) - Licence: GNU LGPL -----------------------------------------------------------------...
# Copyright 2011 OpenStack Foundation # (c) Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 # # ...
#!/usr/bin/env python """ Varnish Plugin for NewRelic """ from xml.etree import ElementTree import helper import logging import subprocess import json import time import requests class NewRelicVarnishPlugin(helper.Controller): """ The NewRelicVarnish plugin polls varnishstat utility for stats and reports to NewR...
#!/usr/bin/env python3 from gi.repository import Gtk, Pango class NickName(): servers = {} active_server = None active_channel = None def __init__(self, MainWindow): self.MainWindow = MainWindow self.position = [0, 9, 1, 1] def prebuild(self): self.MainWindow.ui_plugin...
""" WSGI config for sosleep 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`` ...
# -*- coding: iso-8859-1 -*- """ MoinMoin - MoinMoin.macro Hits tested @copyright: 2007-2008 MoinMoin:ReimarBauer @license: GNU GPL, see COPYING for details. """ import os from MoinMoin import caching, macro from MoinMoin.logfile import eventlog from MoinMoin.PageEditor import PageEditor from ...
# -*- coding: utf-8 -*- # Copyright © 2012-2015 Roberto Alsina and others. # 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 t...
# coding=utf-8 import pytest import sacredboard.bootstrap as bootstrap @pytest.fixture def app(): return bootstrap.Flask(__name__) @pytest.fixture() def app_config(): return { "http.serve_on_endpoint": "/", "http.port": 5000, "debug": False } @pytest.mark.parametrize("config_st...
#!/usr/bin/env python import time import unittest import boostertest class TestAppserverCreateWebdav(boostertest.BoosterTestCase): """ Test the appserver-create-webdav action """ def setUp(self): """ Set the action and other commonly used fixture data """ self.params = {} self.para...
import os from unittest import TestCase from rosie.cli.actions import InitConfigAction class TestInitConfigAction(TestCase): config_file_path = 'test_file.py' def tearDown(self): if os.path.exists(self.config_file_path): os.remove(self.config_file_path) def test_action_gets_file_nam...
"""Added fields to EntitySetItem to support profiles and removed Linkage Revision ID: 9dcef7592cea Revises: 3174fef04825 Create Date: 2020-07-21 13:42:06.509804 """ from itertools import groupby, takewhile from alembic import op import sqlalchemy as sa revision = "9dcef7592cea" down_revision = "4c9e198c5b31" def ...
from __future__ import division from __future__ import print_function import warnings import pandas import numpy import pdb import ilmpy.signal_spaces as signal_spaces import ilmpy.meaning_spaces as meaning_spaces import random import copy import itertools class _Learner (): """ This is a private base class ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import url from . import views urlpatterns = [ url( regex=r'^(?P<organization_id>\d+)/(?P<group_id>\d+)/players$', view=views.GroupPlayerListGenericAPIView.as_view(), name='group_players_list' ), ...
# JTAG files generator # calculates DAC values for different S/N cuts (3 to 12) and generates JTAG (txt) files, update creation date # by Jan Dreyling-Eschweiler, telescope-coor@desy.de # First version: 4. September 2015 # ----------------------- # modules import re import math import numpy as np import time ########...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # from __future__ import absolute_import, unicode_literals import os from PIL import Image, ExifTags import magic from oclubs.access import fs from oclubs.exceptions import UploadNotSupported from oclubs.objs.base import BaseObject, Property ORIENTATION = next((key for...
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, cint, nowdate, add_days, comma_and from frappe import msgprint, _ from frappe.model.document import ...
#!/usr/bin/env python """Unit tests for M2Crypto.X509. Contributed by Toby Allsopp <toby@MI6.GEN.NZ> under M2Crypto's license. Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2004-2005 OSAF. All Rights Reserved. Author: Heikki Toivonen """ import base64 import logging import os impo...
# -*- coding: utf-8 -*- from eve.tests import TestBase from eve.utils import api_prefix from eve.tests.test_settings import MONGO_DBNAME import simplejson as json class TestRenders(TestBase): def test_default_render(self): r = self.test_client.get('/') self.assertEqual(r.content_type, 'applicati...
# # Copyright 2012, 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 a...
##script for creating a histogram ## Load necessary modules import pylab as plt import numpy as np import os BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) f=open(os.path.join(BASE_DIR,'cox_regression','CESC','coeffs_normalized_pvalues_adjusted.txt')) data=[i.s...
from numpy import abs, exp, power, array, sqrt, pi from scipy.special import gamma #TODO: This file should eventually be replaced, by moving the existing functions (used for GARCH based models) # into the GARCH folder, with Cythonizations class Score(object): @staticmethod def score(y,loc,scale,shape): ...
# -*- coding: utf-8 -*- # This file is part of Shoop. # # Copyright (c) 2012-2015, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals import json import six from django...