text
stringlengths
475
200k
# -*- encoding: utf-8 -*- import unittest from trac.test import Mock from trac.versioncontrol import NoSuchChangeset, NoSuchNode from trac.versioncontrol.api import * from trac.versioncontrol.web_ui import * from trac.wiki.tests import formatter def _get_changeset(rev): if rev == '1': return Mock(messag...
"""SCons.Tool.sgilink Tool-specific initialization for the SGI MIPSPro linker on SGI. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2...
#!/usr/bin/python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| |/ /...
"""Polymorphic models and queries. The standard NDB Model class only supports 'functional polymorphism'. That is, you can create a subclass of Model, and then subclass that class, as many generations as necessary, and those classes will share all the same properties and behaviors of their base classes. However, subcl...
# -*- coding: utf-8 -*- from copy import deepcopy import json import logging import os from collections import namedtuple, defaultdict from component_generator import constants, templates, utils try: from os import getcwdu as getcwd except ImportError: # Hurray we're using Python 3! from os import getcwd l...
import argparse import errno import pdb import subprocess import tempfile import time from arrowhead.core import Arrow, Step from arrowhead.errors import ProgrammingError from arrowhead.errors import GraphvizNotInstalled from arrowhead.inspector import print_dot_graph from arrowhead.inspector import print_flow_state ...
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 distrib...
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import logging import os import sys # Note throughout the distinction between the artifact_root (which is where the artifacts are # originally built and where the cache restores them to) ...
# Copyright (c) 2010-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 agree...
# Lint as: python3 # Copyright 2020 The TensorFlow 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 ...
from __future__ import print_function import os import json import subprocess try: import websocket import psutil except: os.system("pip install wheel websocket-client psutil") import websocket import psutil try: import thread except ImportError: import _thread as thread import time FNULL =...
# Copyright (C) 2011-2012 CRS4. # # This file is part of Seal. # # Seal 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. # # Seal is dis...
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim:ts=4:et:sw=4: """ Common output functions for the preprocessor. Need the global OPTION object """ from typing import List from typing import Optional import src.api.errmsg from src.api.errmsg import register_warning CURRENT_FILE: List[str] = [] # The current fi...
import re from aviation_weather.components import Component from aviation_weather.exceptions import WeatherGroupDecodeError class WeatherGroup(Component): # TODO: see FMH-1 12.6.8 for specific formatting instructions INTENSITIES = { "-": "light", "": "moderate", "+": "heavy", ...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Joseph Callen <jcallen () csc.com> # Copyright: (c) 2018, Ansible Project # Copyright: (c) 2018, Abhijeet Kasurde <[EMAIL]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_impo...
#!/usr/bin/env python # Copyright (c) 2015 Dagan Martinez # Under the MIT license # import modules - tweetalysis includes Tweepy print("Setting up...") from tweetalysis import* import json import os import sys # Authenticate application and create API object key = open("keys/consumer_key", "r").read().replace("\n", "...
#!/usr/bin/python # # Copyright (C) 2012 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program...
import json import time from twisted.internet.defer import inlineCallbacks from Tribler.Core.TorrentChecker.torrent_checker import TorrentChecker from Tribler.Core.Utilities.network_utils import get_random_port from Tribler.Core.simpledefs import NTFY_CHANNELCAST, NTFY_TORRENTS from Tribler.Test.Core.Modules.RestApi.b...
import pickle import gzip import numpy as np import theano import theano.tensor as tt import matplotlib import matplotlib.pyplot as plt # load MNIST ######################################################################## with gzip.open('mnist.pkl.gz', 'rb') as f: try: train_xy, valid_xy, test_xy = pickle.load(f, ...
from note import Note istiklal = [] # MAIN TRACK istiklal.append([ Note("B4", "4", 0.75), # Kork Note("E5", "4", 0.75), # ma Note("F#5", "4", 0.75), # sön Note("G5", "4", 0.75), # mez Note("D#5", "8.", 0.75), # bu Note("F#5", "16", 0.75), # $a Note("E5", "2.", 0.75), # fak Note(...
# -*- coding: utf-8 -*- """ TV Portuguesa 2014 fightnight""" import xbmc, xbmcgui, xbmcaddon, xbmcplugin,re,sys, urllib, urllib2,time,datetime,os,requests,json,htmlentitydefs user_agent = 'Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2049.0 Safari/537.36' tvporpath ...
"""helpers.py: a collection of helpful utilities for tests""" from os import path import configparser from datetime import datetime, timedelta import pymysql.cursors import prosper.common.prosper_config as p_config CONN = None def get_config(config_filename): """parse test config file Args: config_fi...
#!/usr/bin/env python # coding: utf-8 # Copyright 2013 The Font Bakery 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/LIC...
#!/usr/bin/env python # -*- coding: utf-8 -*- from nose.tools import * from utilities import run_all import mapnik if hasattr(mapnik,'Expression'): mapnik.Filter = mapnik.Expression map_ = '''<Map> <Style name="s"> <Rule> <Filter><![CDATA[(([region]>=0) and ([region]<=50))]]></Filter> ...
import pickle,sys,socket,subprocess,os,random from datetime import datetime from time import mktime,sleep #from planetlab import Monitor from configobj import ConfigObj PLE_CONF_FILE='/etc/ple.conf' TEJO_CONF_FILE='/etc/tejo.conf' def getRTT_TCP(hostname, yanoama_root,port=22): try: script_to_run=yanoa...
# this script records scale readings from adam gfk 600 import serial import time ser = serial.Serial('/dev/ttyUSB0') rows_per_read=13 # it is found that adam scale comes with 13 lines of readings no_of_readings=3 # totally how many readings will be done sleep_time_seconds=2 # the interval of neighbouring readings. #...
""" Django settings for test_project project. Generated by 'django-admin startproject' using Django 2.1.7. For more information on this file, see https://docs.djangoproject.com/en/2.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.1/ref/settings/ """ import ...
from p2pool.bitcoin import networks from p2pool.util import math # CHAIN_LENGTH = number of shares back client keeps # REAL_CHAIN_LENGTH = maximum number of shares back client uses to compute payout # REAL_CHAIN_LENGTH must always be <= CHAIN_LENGTH # REAL_CHAIN_LENGTH must be changed in sync with all other clients # ...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Simon Montagu # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. ...
# Rekall Memory Forensics # # Copyright 2013 Google Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or (at # your option) any later v...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Red Hat, inc # Written by Seth Vidal # based on the mount modules from salt and puppet # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metacl...
# -*- coding: utf-8 -*- ######################################################################## # # (C) 2017, Matej Vadnjal, Arnes <matej> <[EMAIL]> # # This file is part of upsconfer # # upsconfer is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publish...
import nltk from nltk import wsd from nltk.corpus import wordnet as wn from utils.nltk_normalization import NltkNormalizer class SynsetAnalyzer: def __init__(self): NltkNormalizer.install_nltk_corpora('averaged_perceptron_tagger') self.normalizer = NltkNormalizer() self.lem = nltk.WordNet...
# -*- coding:utf-8 -*- #--------------------------------------------------------------------- # # Visor Geográfico # # Copyright (C) 2007 Ecotrust # Copyright (C) 2007 Aaron Racicot # Copyright (C) 2009 Germán Carrillo (http://geotux.tuxfamily.org) # #-----------------------------------------------------------------...
""" Extract target mol_id from PCBA JSON files. """ import argparse import glob import os from vs_utils.utils.public_data import PcbaJsonParser def parse_args(input_args=None): """ Parse command-line arguments. Parameters ---------- input_args : list, optional Input arguments. If not provided, default...
''' test for creating vm with password set. @author: SyZhao ''' import apibinding.inventory as inventory import zstackwoodpecker.test_util as test_util import zstackwoodpecker.test_lib as test_lib import zstackwoodpecker.test_state as test_state import test_stub vm = None root_password_list = ["passwo...
# inputs # --name name of the file to be outputed # --x1 value of the x coord of c1 # --x2 value of the x coord of c2 # --y2 value of the y coord of c2 # --x3 value of the x coord of c3 # --y3 value of the y coord of c3 # --x4 value of the x coord of c4 # --y4 value of the y coord ...
""" Simulation stuff specific to using Eclipse RCP. For example View IDs and Editor IDs etc.""" from storytext.javaswttoolkit import simulator as swtsimulator from storytext.javaswttoolkit import util import storytext.guishared from storytext.definitions import UseCaseScriptError import org.eclipse.swtbot.eclipse.fin...
import datetime import six from babbage.api import map_is_class from babbage.query.parser import Parser from babbage.model.binding import Binding from babbage.exc import QueryException class Cuts(Parser): """ Handle parser output for cuts. """ start = "cuts" def cut(self, ast): value = ast[2] ...
from s2protocol import protocol34835 as proto # The typeinfo id for an empty struct, handled specially. EMPTY_STRUCT_ID = 78 def fieldToGo(name): if name.startswith('m_'): name = name[2:] return name[0].upper() + name[1:] def genReadInt(offset, bits): if offset == 0: return 'readBits(r,...
import collections import sys import os from cdagline import DagLine class BlastLine(object): __slots__ = ('query', 'subject', 'pctid', 'hitlen', 'nmismatch', 'ngaps', \ 'qstart', 'qstop', 'sstart', 'sstop', 'evalue', 'score') def __init__(self, sline): args = sline.split("\t") ...
""" Results views for runs. """ from django.shortcuts import get_object_or_404 from django.template.response import TemplateResponse from moztrap.view.utils.auth import login_maybe_required from moztrap import model from moztrap.view.filters import RunFilterSet from moztrap.view.lists import decorators as lists fro...
from __future__ import print_function import gym import tensorflow as tf import tensorlayer as tl from rlflow.core import tf_utils from rlflow.policies.f_approx import Network from rlflow.algos.grad import PolicyGradient from rlflow.core.input import InputStreamDownsamplerProcessor, InputStreamSequentialProcessor, Inp...
#pylint: disable=E1103, E1101 import copy import logging import re from django.conf import settings from django.utils.translation import ugettext as _ from xmodule.contentstore.content import StaticContent from xmodule.contentstore.django import contentstore from xmodule.modulestore import Location from xmodule.modu...
""" Test functions for linalg.decomp module """ from __future__ import division, print_function, absolute_import __usage__ = """ Build linalg: python setup_linalg.py build Run tests if scipy is installed: python -c 'import scipy;scipy.linalg.test()' Run tests if linalg is not installed: python tests/test_decomp...
# Copyright (c) 2012 Rackspace Hosting # 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 req...
""" Tests for actual use of the indexes after creating models with them. """ from django.db import IntegrityError from django.test import TransactionTestCase from django.utils import timezone from testapp.models import User, Room, RoomBookingText, JobText, ComparisonText, RoomBookingQ, JobQ, ComparisonQ class Partia...
__author__ = 'Keith Kikta' __copyright__ = "Copyright 2015, EPM Junkie" __license__ = "BSD" __version__ = "1.0" __maintainer__ = "Keith Kikta" __email__ = "[EMAIL]" __status__ = "Alpha" import sys import io from getopt import getopt, GetoptError from difflib import SequenceMatcher use_minidom = False try: from lxm...
#!/usr/bin/env python # # vim: set expandtab:ts=4:sw=4 # # Authors: Jasper Capel # Robert van Leeuwen # # Funtion: Handles authentication to various OpenStack API's and # other authentication based (Keystone) functions # # This software is released under the terms of the Apache License. # from keystoneclie...
""" mbed SDK Copyright (c) 2011-2016 ARM Limited 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...
class LogStatement: def pull_info(self, log): self.address = log.current_address def keep(self): """ Override in subclasses if this logging statement doesn't stand on its own but just sets state for future logging statements. It will be processed and then deleted from the Log object list of logging stat...
#! /usr/bin/env python import screed import sys import os.path def is_pair(name1, name2): if name1.endswith('/1') and name2.endswith('/2'): s1 = name1.split('/')[0] s2 = name2.split('/')[0] if s1 == s2: assert(s1) return True return False infile = sys.a...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Exercise the getchaintips API. We introduce a network split, work # on chains of different lengths, an...
import numpy as np from mitgcm_surface_tracer.tracer_processing import reset_cut from numpy.testing import assert_allclose def test_reset_cut(): # Case with no phase n = 5 dt_model = 2 dt_tracer = 2 iters = np.array(range(n)) reset_frq = 4 cut_time = 2 reset_pha = 0 mask, reset_ite...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', ...
from unittest.mock import MagicMock, patch import orjson from zerver.lib.test_classes import ZulipTestCase from zerver.models import Message, Stream, get_realm, get_user class TestIntegrationsDevPanel(ZulipTestCase): zulip_realm = get_realm("zulip") def test_check_send_webhook_fixture_message_for_error(se...
from pokemongo_bot import inventory from pokemongo_bot.inventory import Pokemon from pokemongo_bot.inventory import Pokemons from pokemongo_bot.human_behaviour import sleep, action_delay from pokemongo_bot.base_task import BaseTask from pokemongo_bot.worker_result import WorkerResult from datetime import datetime, time...
# 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 # d...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <[EMAIL]> # Copyright (c) 2013 Rémi Alvergnat <[EMAIL]> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Publi...
# coding: utf-8 from __future__ import unicode_literals import re import time from .common import InfoExtractor from ..utils import ( determine_ext, js_to_json, sanitized_Request, ) class IPrimaIE(InfoExtractor): _VALID_URL = r'https?://play\.iprima\.cz/(?:.+/)?(?P<id>[^?#]+)' _TESTS = [{ ...
from JumpScale import j import os def service_view(s): """ generate a dict that represent a service from a service object """ producers = [v.key for v in s.model.producers] service = { 'key': s.model.key, 'role': s.model.role, 'name': s.name, 'data': j.data.serialize...
# (c) Copyright 2014 Brocade Communications Systems Inc. # All Rights Reserved. # # Copyright 2014 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 # # ...
from test_support import * print_test("Sequence Unpacking (test_unpack.py)", 2) t = (1, 2, 3) l = [4, 5, 6] class Seq: def __getitem__(self, i): if i >= 0 and i < 3: return i raise IndexError a = -1 b = -1 c = -1 # unpack tuple print_test("tuple", 3) a, b, c = t assert a == 1...
from django.conf import settings from django.db import models from datetime import datetime, timedelta, date from utils import update_filename, save_to_restcat from django.contrib.auth.models import User from sorl.thumbnail import ImageField import uuid from freggies import fruit_choices, fruit_tuple, veg_choices, veg_...
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-05-29 10:38 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('iati', '0002_auto_20170424_1434'), ] operations = [ migrations.AddField( ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Bottle is a fast and simple micro-framework for small web applications. It offers request dispatching (Routes) with url parameter support, templates, a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and template engines - all in a single file an...
# -*- coding: utf-8 -*- # pylint: disable=bad-continuation """ Command line interface. """ # Copyright ⓒ 2015 1&1 Group # # 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.apac...
# # Copyright (C) 2010 Sorcerer # # This file is part of UrTSB. # # UrTSB 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. # # UrTSB is...
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitsend Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitsendTestFramework from test_framework.util import * class I...
#!/usr/bin/env python # -*- coding: utf-8 -*- import cherrypy import htpc import logging from htpc.manageusers import Manageusers from sqlobject import SQLObject, SQLObjectNotFound from sqlobject.col import StringCol SESSION_KEY = '_cp_username' logger = logging.getLogger('authentication') def check_credentials(us...
""" tests for Quicklook Pipeline steps in desispec.quicklook.procalgs """ import unittest import numpy as np import os import shutil import desispec from desispec.quicklook import procalgs as PA from pkg_resources import resource_filename from desispec.test.test_ql_qa import xy2hdr from desispec.preproc import parse_s...
#!/usr/bin/python2.4 # # Copyright 2010 Google 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 require...
"""Data structures in Foam-Files that can't be directly represented by Python-Structures""" from __future__ import division from copy import deepcopy import math import re # import FoamFileGenerator in the end to avoid circular dependencies from PyFoam.ThirdParty.six import integer_types,PY3,string_types if PY3: ...
from numpy import cos from skyfield import framelib from skyfield.api import Topos, load, wgs84 from skyfield.constants import AU_M, ERAD from skyfield.positionlib import Geocentric def test_radec_and_altaz_angles_and_rates(): # HORIZONS test data in Skyfield repository: authorities/radec-altaz-rates ts = load...
from axelrod import Player class Cooperator(Player): """A player who only ever cooperates.""" name = 'Cooperator' classifier = { 'memory_depth': 0, 'stochastic': False, 'inspects_source': False, 'manipulates_source': False, 'manipulates_state': False } @st...
#! /usr/bin/env python import sys import os import argparse import collections import re from archipelago import model from archipelago import profile from archipelago import utility def parse_fieldname_and_value(labels): if not labels: return collections.OrderedDict() fieldname_value_map = collection...
""" Core components of Home Assistant. Home Assistant is a Home Automation framework for observing the state of entities and react to changes. """ import asyncio from concurrent.futures import ThreadPoolExecutor import datetime import enum import logging import os import pathlib import re import sys import threading f...
__source__ = 'https://leetcode.com/problems/partition-list/' # https://github.com/kamyu104/LeetCode/blob/master/Python/partition-list.py # Time: O(n) # Space: O(1) # Two Pointers # # Description: Leetcode # 86. Partition List # # Given a linked list and a value x, # partition it such that all nodes less than x come be...
# Copyright 2013 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. import sys import unittest from metrics import keychain_metric from telemetry.core import browser_options from telemetry.results import page_test_results fr...
''' tests/metrics.py are functions that expose the tests to the user and continuous integration environment Copyright (c) 2017 Vanessa Sochat 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 t...
# Copyright (C) 2013 Jaedyn K. Draper # # 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, di...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <[EMAIL]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metad...
import datetime import csv from django.contrib.auth.decorators import login_required from django.shortcuts import render from django.http import HttpResponse from django.contrib.auth.models import User from django_pandas.io import read_frame, pd # from wye.base.constants import WorkshopStatus from wye.workshops.models ...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012, 2013, 2014, 2015 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your...
import unittest from PyQt5.QtCore import Qt from PyQt5.QtTest import QTest import sys import os topLevelPath = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')) sys.path.insert(0, topLevelPath) sys.path.insert(0, os.path.join(topLevelPath, 'tests')) from qutepart import Qutepart import base clas...
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2014, Red Hat, Inc. # Tim Bielawa <[EMAIL]> # Magnus Hedemark <[EMAIL]> # Copyright 2017, Dag Wieers <[EMAIL]> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, ...
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz (aahz at pobox.com) # and Tim Peters """ These are the test cases for the Decim...
# -*- encoding:utf-8 -*- """ lazy工具模块 """ from __future__ import print_function from __future__ import absolute_import from __future__ import division import sys import weakref class LazyFunc(object): """描述器类:作用在类中需要lazy的对象方法上""" def __init__(self, func): """ 外部使用eg: class B...
""" redrock.plotspec ================ Visualization tools for plotting spectra. """ import numpy as np from . import zwarning class PlotSpec(object): def __init__(self, targets, templates, zscan, zfit, truth=None, archetypes=False): """TODO: document """ #- Isolate imports of optional ...
# vim: ts=4:sw=4:expandtab # -*- coding: UTF-8 -*- # BleachBit # Copyright (C) 2008-2020 Andrew Ziem # https://www.bleachbit.org # # 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...
# -*- coding: utf-8 -*- # # base.py # ObjectModel # # Created by Alexander Rudy on 2011-10-12. # Copyright 2011 Alexander Rudy. All rights reserved. # Version 0.6.1 # u""" .. _AstroObjectAPI: :mod:`base` – AstroObject API ======================================== The API is the foundation of the :mod:`AstroOb...
# -*- coding:utf-8 -*- import unittest from swf.models.event import Event from swf.models.history import History import swf.constants from ..mocks.event import mock_get_workflow_execution_history class TestEvent(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def t...
import numpy as np def find_local_extremas(x): x = np.asarray(x) xmax = np.asarray([]) imax = np.asarray([]) xmin = np.asarray([]) imin = np.asarray([]) Nt = x.size if len(x) != max(x.shape): print('Entry must be a vector.') index_nan = np.argwhere(np.isnan(x)) ...
# -*- coding: utf-8 -*- # This file is part of beets. # Copyright 2016, Adrian Sampson. # # 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 t...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Cloudbase Solutions Srl # # 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/licens...
# -*- coding: utf-8 -*- from __future__ import absolute_import import mock from datetime import datetime from uuid import UUID from sentry.coreapi import ( APIError, APIUnauthorized, Auth, ClientApiHelper, InvalidFingerprint, InvalidTimestamp, get_interface, CspApiHelper, APIForbidden, ) from sentry.testuti...
# encoding: utf-8 from __future__ import absolute_import, division, print_function, unicode_literals import os import unittest from datetime import timedelta from decimal import Decimal from django.conf import settings from django.test import TestCase from django.test.utils import override_settings from django.utils...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import distutils.spawn import logging try: # py3 from shlex import quote except ImportError: # py2 from pipes import quote import ray from ray.tune.cluster_info import get_ssh_key, get_ssh_user log...
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
#!/usr/bin/env python data = { "default_prefix": "OSVC_COMP_ZPOOL_", "example_value": """ [ { "name": "rpool", "prop": "failmode", "op": "=", "value": "continue" }, { "name": "rpool", "prop": "dedupditto", "op": "<", "value": 1 }, { "name": "rpool", "prop": "dedupditto", "op": ">", "va...