text
stringlengths
17
737k
import sublime import sublime_plugin import os import urllib import json import threading import time import pprint import base64 import zipfile import shutil import sys try: # Python 3.x import urllib.parse from . import requests from . import context from .salesforce import util from .contex...
from typograf import RemoteTypograf import binascii def get_typograf_field_name(field_name): """ Return field_name with typograf prefix """ return 'typograf_{field}'.format(field=field_name) def get_typograf_hash_field_name(field_name): """ Return field_name with typograf prefix, and hash suffix """ ...
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2012 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
# -*- coding: utf-8 -*- """Test GUI component.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ from pytest import yield_fixture, fixture import numpy as np from numpy.testing import assert_arr...
import sys import logging import os.path import shlex import traceback import collections import tempfile import re import fnmatch import lldb from . import expressions from . import debugevents from . import disassembly from . import handles from . import terminal from . import formatters from . import PY2, is_string,...
#!/usr/bin/env python # # Load favorites for a Twitter user and output them to a file. # import os import twitter from time import sleep from sqlalchemy import desc from sqlalchemy.orm.exc import NoResultFound from myarchive.db.tables.file import TrackedFile from myarchive.db.tables.twittertables import RawTweet, Tw...
from dmoj.executors.mono_executor import MonoExecutor class Executor(MonoExecutor): ext = '.cs' name = 'MONOCS' command = 'mono-csc' command_paths = ['mono-csc', 'dmcs', 'mcs', 'gmcs'] test_program = '''\ using System; class test { static void Main() { string line; while (!st...
#!/usr/bin/env python3 import sys import types import opcode if sys.version_info <= (2, 8, 0): raise Exception("3.x only") omap = opcode.opmap class Compiler: def __init__(self): self.co_consts = [] self.co_freevars = [] self.co_kwonlyargcount =[] self.co_lnotab = [] ...
#!/usr/bin/env python # # igcollect - process stat # # Copyright (c) 2016, InnoGames GmbH # from argparse import ArgumentParser from collections import namedtuple from re import compile from subprocess import check_output from time import time from platform import system def parse_args(): parser = ArgumentParser(...
#!/usr/bin/python -W ignore # Script based off of gcalcli to print a daily schedule from the calendar # Ryan Tucker <rtucker@gmail.com> import cups from datetime import * from dateutil.tz import * from dateutil.parser import * import gcalcli import miniweather import os import random import re import shelve import sy...
#!/usr/bin/env python """A systray app to set the JACK configuration from QjackCtl presets via DBus. """ import argparse import logging import os import sys os.environ['NO_AT_BRIDGE'] = "1" # noqa import gi gi.require_version('Gtk', '3.0') # noqa from gi.repository import Gtk, GObject from gi.repository.GdkPixbuf i...
"""Base class for storage engine implementations.""" import abc import contextlib from .utils import TransactionMap class StorageEngine(metaclass=abc.ABCMeta): """ Base storage engine class. StorageEngine subclasses are required to be thread-safe. """ @abc.abstractmethod def __init__(self,...
# # Jasy - Web Tooling Framework # Copyright 2010-2012 Zynga Inc. # import polib, json import jasy.item.Abstract import jasy.core.Console as Console def getFormat(path): """ Returns the file format of the translation. One of: gettext, xlf, properties and txt """ if path: if path.endswith("....
import errno import json import logging import os import os.path from collections import namedtuple from contextlib import contextmanager from datetime import datetime from memoized import memoized from sqlalchemy import ( Column, Index, Integer, String, Text, and_, bindparam, func, ...
from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults from airflow.hooks.base_hook import BaseHook from airflow.plugins_manager import AirflowPlugin import cpgintegrate import requests import time class XComDatasetToCkan(BaseOperator): @apply_defaults def __init__(self, ...
# coding=utf-8 import logging import time class HarajsTime(object): """ Converting the string date to time using 'GMT'. """ tm_minute = 0 tm_hour = 0 tm_day = 0 tm_week = 0 tm_month = 0 tm_year = 0 lang = [ "دقيقه", # "minute" "ساعه", # "hour" "يوم", ...
#!/usr/bin/env python ################################################################################# # Copyright 2018 ROBOTIS CO., LTD. # # 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 __future__ import print_function from securityhandlerhelper import securityhandlerhelper dateTimeFormat = '%Y-%m-%d %H:%M' import arcrest from arcrest.agol import FeatureLayer from arcrest.agol import FeatureService from arcrest.ags import FeatureService from arcrest.hostedservice import AdminFeatureService fr...
#!/usr/bin/env python """ 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");...
import datetime import time from tdl.queue.processing_rules import ProcessingRules from tdl.queue.actions.publish_action import PublishAction from tdl.queue.transport.remote_broker import RemoteBroker class QueueBasedImplementationRunner: def __init__(self, config, deploy_processing_rules): self._config ...
from wires import * from models.post import Post from models.user import User from pdb import set_trace as debug def index(parameters): template = open('./templates/posts/index.html').read() posts = Post.all(Post.cxn, "posts") post_template = open('./templates/posts/show.html').read() rendered_posts ...
import os, sys from time import sleep import pyDMCC import bot.lib.lib as lib class Rail_Mover: def __init__(self): self.bot_config = lib.get_config() rail_motor_conf = self.bot_config["dagu_arm"]["rail_cape"]["rail_motor"] board_num = rail_motor_conf["board_num"] motor_num = ra...
# Copyright 2015 Metaswitch Networks # # 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 w...
from twisted.plugin import IPlugin from twisted.words.protocols import irc from txircd.module_interface import Command, ICommand, IModuleData, ModuleData from txircd.utils import ModeType, timestamp from zope.interface import implements irc.RPL_CREATIONTIME = "329" class ModeCommand(ModuleData): implements(IPlugi...
import numpy import chainer from chainer import cuda from chainer import function from chainer.functions.activation import lstm from chainer.functions.array import concat from chainer.functions.array import reshape from chainer.functions.array import split_axis from chainer.functions.array import stack from chainer.fu...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2019, GEM Foundation # # OpenQuake 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, ...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2014-2018 GEM Foundation # # OpenQuake 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 Licen...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2015-2021 GEM Foundation # # OpenQuake 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 Licen...
# -*- coding: utf-8 -*- """ Created on Mar 13, 2014 @author: StarlitGhost """ from twisted.plugin import IPlugin from desertbot.moduleinterface import IModule from desertbot.modules.commandinterface import BotCommand from zope.interface import implementer from desertbot.message import IRCMessage from bs4 import Beau...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # visa.py - High-level object-oriented VISA implementation # # Copyright © 2005 Gregor Thalhammer <gth@users.sourceforge.net>, # Torsten Bronger <bronger@physik.rwth-aachen.de>. # # This file is part of PyVISA. # # PyVISA is free software; you can redis...
"""Production settings and globals.""" from os import environ from base import * # Normally you should not import ANYTHING from Django directly # into your settings, but ImproperlyConfigured is an exception. from django.core.exceptions import ImproperlyConfigured def get_env_setting(setting): """ Get the envi...
import configparser import logging import math import os import time import fairseq import numpy as np import torch from fairseq.models.transformer import TransformerModel from fairseq.sequence_generator import SequenceGenerator from mmt import textencoder from mmt.alignment import make_alignment from mmt.tuning impo...
import json, time, os, argparse, re, sys, logging, math, random from datetime import datetime from apscheduler.schedulers.background import BackgroundScheduler import datetime as dt import pymysql import wolframalpha from dispatch import Dispatch from kvidata import KVIData from tbmath import TBMath from pytz import ...
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2014 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 option) a...
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com '''This is the main module in thumbor''' __version__ = "6.0.0rc1" __...
# -*- coding: utf-8 -*- import click # bitmerchant from bitmerchant.wallet import Wallet from bitmerchant.wallet.keys import PrivateKey from blockcypher import (create_hd_wallet, get_wallet_details, create_unsigned_tx, get_input_addresses, make_tx_signatures, broadcast_signed_transaction, get_blockch...
import cv2 import numpy as np from numpy.core.umath_tests import inner1d from itertools import combinations from argparse import ArgumentParser # color tuples BLACK = (0, 0, 0) WHITE = (255, 255, 255) RED = (0, 0, 255) GREEN = (0, 255, 0) def _main_static(imgfile, debug=False): img = cv2.imread(imgfile) if img i...
from . import database from . import themes DEFAULT_SETTINGS = { "title": "Timpani", "subtitle": "Your blog, run using Timpani.", "display_name": "full_name", "theme": "default", "posts_per_page": "5" } #Contains lambda functions that return true when the condition is valid #Name of the game is keep them simple ...
#-*- encoding: utf-8 -*- # python client for openstf STFService & Agent. # # Api: # start(adbprefix=None, service_port=1100, agent_port=1090) # stop(adbprefix=None, service_port=1100, agent_port=1090) # # wake() # return None # type(text) # return None # ascii_type(text) ...
import discord import requests import asyncio from modules.botModule import BotModule class RedditPost(BotModule): name = 'RedditPost' # name of your module description = 'RedditPost automatically posts recent posts from r/scuba' # description of its function help_text = 'This module has no callable f...
# Copyright (c) 2016 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from PyQt5.QtCore import pyqtSignal, pyqtProperty, pyqtSlot, QObject, QVariant #For communicating data and events to Qt. import UM.Application #To get the global container stack to find the current machine. import UM.Logge...
__author__ = "Andre Merzky, Ole Weidner" __copyright__ = "Copyright 2012-2013, The SAGA Project" __license__ = "MIT" """ Task interface """ import inspect import Queue import radical.utils.signatures as rus import radical.utils as ru import base as sbase import exceptions ...
import os import shutil import yaml import glob from momo.utils import run_cmd, mkdir_p, utf8_encode, txt_type, eval_path from momo.plugins.base import Plugin BASE_CONFIG_NAME = '__base__' class Mkdocs(Plugin): mkdocs_configs = { 'theme': 'readthedocs', } momo_configs = { 'momo_root_name...
from pdb import Pdb, line_prefix import sys import StringIO from vimpdb.proxy import ProxyToVim def capture(method): def decorated(self, line): self.capture_stdout() result = method(self, line) self.stop_capture() self.vim.showFeedback(self.pop_output()) return result ...
import warnings from collections import Counter, defaultdict, deque, abc from collections.abc import Sequence from concurrent.futures import ThreadPoolExecutor from functools import partial, wraps from heapq import merge, heapify, heapreplace, heappop from itertools import ( chain, compress, count, cyc...
# # CORE # Copyright (c)2011-2012 the Boeing Company. # See the LICENSE file included in this distribution. # # author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com> # ''' mobility.py: mobility helpers for moving nodes and calculating wireless range. ''' import sys, os, time, string, math, threading import heapq from...
#!/usr/bin/env python ''' Diego Martins de Siqueira download all images from a Tumblr ''' import urllib2 import re import os import sys import argparse API_URL = "http://#subdomain#.tumblr.com/api/read?type=photo&num=#chunck#&start=#start#" def createfolder(name): ''' if folder does not exist, create it. '''...
__author__ = 'mFoxRU' from time import sleep from win32gui import FindWindow, EnumChildWindows, GetClassName, \ GetWindowText, IsWindow class Hook(object): def __init__( self, window='MediaPlayerClassicW', class_name='#32770', fields=('Title', 'Author') )...
# -*- coding: utf-8 -*- """SQLAlchemy models for OCSPdash.""" import operator from datetime import datetime, timedelta, timezone from enum import Enum from oscrypto import asymmetric from sqlalchemy import Binary, Boolean, Column, DateTime, ForeignKey, Integer, String, Text from sqlalchemy.ext.declarative import dec...
from __future__ import annotations import numpy as np import scipy.sparse as sp import warnings import copy from ..utils import ( speye, sdiag, mkvc, timeIt, Identity, ) from ..maps import IdentityMap, Wires from ..objective_function import ComboObjectiveFunction from .base import ( BaseRegular...
""" Creates permissions for all installed apps that need permissions. """ from django.contrib.auth import models as auth_app from django.db.models import get_models, signals def _get_permission_codename(action, opts): return u'%s_%s' % (action, opts.object_name.lower()) def _get_all_permissions(opts): "Retu...
# pylint: disable=missing-docstring import os import sys import logging import warnings import percy from selenium import webdriver from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.webdri...
# Copyright 2022 Google # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
import MySQLdb import re import sys import json import os from subprocess import call # These three libraries define the Bookworm-specific methods. from CreateDatabase import * from ImportNewLibrary import * from WordsTableCreate import WordsTableCreate from tokenizeAndEncodeFiles import bookidlist # Import our data ...
import os import yaml import pytest import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from numpy.testing import assert_allclose from tardis.io.atom_data.base import AtomData from tardis.simulation import Simulation from tardis.io.config_reader import Configuration quantity_comparison = [ ('...
import psycopg2 import datetime import io import math import sys import numpy from collections import Counter import KernelFunctionsV1 as KF import operator import random class Document: userID = "" userLat = "" userLong = "" Feature_Freq = {} total_words = 0 #Feature_Prob = {} outsid...
#!/usr/bin/env python3.4 import ursgal import os import shutil class kojak_1_5_3( ursgal.UNode ): """ Kojak UNode Parameter options at http://www.kojak-ms.org/param/index.html Reference: Hoopmann MR, Zelter A, Johnson RS, Riffle M, Maccoss MJ, Davis TN, Moritz RL (2015) Kojak: Efficient analysis ...
# Copyright (c) 2015 Intracom socket_obj.A. Telecom Solutions. #All rights reserved. # # This program and the accompanying materials are made available under the # terms of the Eclipse Public License v1.0 which accompanies this distribution, # and is available at http://www.eclipse.org/legal/epl-v10.html """Unittest M...
''' Implement a quadtree ''' class Quadtree(): def __init__(xmin, ymin, xmax, ymax): self.xmin = xmin self.ymin = ymin self.xmax = xmax self.ymax = ymax def __newnode__(xmin, ymin, xmax, ymax): self.name = blah.blah self.xmin = xmin self.ymin = ymin ...
#!/usr/bin/env python from utils.munin.base import MuninGraph from apps.rss_feeds.models import FeedFetchHistory, PageFetchHistory import datetime graph_config = { 'graph_category' : 'NewsBlur', 'graph_title' : 'NewsBlur Users', 'graph_vlabel' : 'users', 'all.label': 'all', } last_day = datetime.da...
# 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 u...
import logging from PyQt5.QtWidgets import QComboBox, QDialog, QPushButton, QWidget, QLabel, QHBoxLayout, QVBoxLayout, QLineEdit, QCheckBox from typing import Optional, Any, List, Union, Callable, Dict from sas.system.config.config import config from sas.qtgui.Utilities.UI.PreferencesUI import Ui_preferencesUI impor...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import datetime import logging as std_logging import operator import unittest from decimal import Decimal import elasticsearch from django.apps import apps from django.conf import settings from django.test impor...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, you can obtain one at http://mozilla.org/MPL/2.0/. import pytest from mock import MagicMock from tests import test_utils from treeherder.log_parser.artifactbuildercollect...
"""Test D-Bus private tube support""" import base64 import dbus from dbus.connection import Connection from dbus.lowlevel import SignalMessage from servicetest import call_async, EventPattern, tp_name_prefix from gabbletest import exec_test, make_result_iq, acknowledge_iq, sync_stream from constants import * from tu...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Scribber, a text editor that focuses on minimalism. Icons provided by the Tango Desktop Project (http://tango.freedesktop.org/) """ import pygtk pygtk.require('2.0') import gtk import os import pango import re import ReSTExporter class ScribberView(gtk.Window): ...
import discord import json import random import requests import asyncio import sys import os raw = '' discToken = '' riotKey = '' regions = ['NA1', 'RU', 'KR', 'EUN1', 'EUW1', 'TR1', 'LA1', 'LA2', 'BR1', 'OC1', 'JP1'] if len(sys.argv) == 1: riotKey = os.environ.get('RIOTKEY') discToken = os.environ.get('DISCKE...
#!/usr/bin/env python # # $Id$ # import errno import os import _psutil_mswindows # import psutil exceptions we can override with our own from error import * try: import wmi except ImportError: wmi = None # --- module level constants (gets pushed up to psutil module) NUM_CPUS = _psutil_mswindows.get_num_cpu...
from django import template from django.conf import settings register = template.Library() def get_url(path, folder=None, media_root=settings.MEDIA_URL): if not path.startswith('http://') and not path.startswith('https://'): args = [media_root, folder, path] path = '/'.join([arg.rstrip('/') for arg in args if ar...
COMPILER = "gfortran" # Declare a list of all the avaliable driving functions DRIVING_OPTIONS = ["0.0", "t", "cos(t)", "t * cos(t)", "cos(t * pi)", "t * cos(t * pi)", "sin(t)", "t * sin(...
""" Utility dialogs for starcheat itself """ import os, sys, platform from PyQt5.QtWidgets import QDialog, QFileDialog, QMessageBox, QListWidgetItem from PyQt5 import QtGui from config import Config from gui_common import preview_icon import save_file, assets, logging import qt_options, qt_openplayer, qt_about # TOD...
""" Import and generation of meshes. """ import numpy as np import spfem.mesh import platform import meshpy.triangle import meshpy.tet import meshpy.gmsh_reader from meshpy.geometry import GeometryBuilder import os import matplotlib.pyplot as plt class Geometry(object): """Geometry contains metadat...
# The contents of this file are subject to the Mozilla Public 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.mozilla.org/MPL/ # # Software distributed under the License is distributed on an "AS IS"basis, #...
# Orca # # Copyright 2005-2007 Sun Microsystems Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This ...
import bpy from mathutils import Matrix, Vector from bpy.types import Panel def GetGridMatrix(srpytile_grid): """Returns the transform matrix of a sprytile grid""" class SprytileValidateGridList(bpy.types.Operator): bl_idname = "sprytile.validate_grids" bl_label = "Validate Material Grids" @classmeth...
import unittest from StringIO import StringIO from vcfiterator import VcfIterator class StringIOWrapper(StringIO): """ Wrapper to support xreadlines() """ def xreadlines(self): """ We don't mind memory usage for these tests.. """ lines = self.readlines() for lin...
# coding=utf-8 import os import bz2 import datetime import sys import xmlrpc.client import http.client import time import logging logger = logging.getLogger('updater') logger.setLevel(logging.DEBUG) loggerHandler = logging.FileHandler(os.path.curdir + '/update.log') loggerFormatter = logging.Formatter('%(asctime)s - %...
from __future__ import absolute_import from django.core.management.base import BaseCommand from zappa.zappa import Zappa from .zappa_command import ZappaCommand class Command(ZappaCommand): can_import_settings = True requires_system_checks = False help = '''Update the the lambda package for a given Za...
# Copyright (C) 2009-2014, Quentin "mefyl" Hocquet # # This software is provided "as is" without warranty of any kind, # either expressed or implied, including but not limited to the # implied warranties of fitness for a particular purpose. # # See the LICENSE file for more information. _OS = __import__('os') import a...
""" Vector Autoregression (VAR) processes References ---------- Lutkepohl (2005) New Introduction to Multiple Time Series Analysis """ from __future__ import division from collections import defaultdict from cStringIO import StringIO import numpy as np import numpy.linalg as npl from numpy.linalg import cholesky as...
import re import math from pyramid.view import view_config from snovault import ( AbstractCollection, TYPES, ) from snovault.elasticsearch import ELASTIC_SEARCH from snovault.resource_views import collection_view_listing_db from elasticsearch.helpers import scan from elasticsearch_dsl import Search from pyramid...
############################################################################ ## ## Copyright (C) 2006-2007 University of Utah. All rights reserved. ## ## This file is part of VisTrails. ## ## This file may be used under the terms of the GNU General Public ## License version 2.0 as published by the Free Software Foundat...
# -*- coding: utf-8 -*- # Copyright (c) 2015, MIT Probabilistic Computing Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
from collections import MutableMapping import sqlite3, pickle, os, functools, inspect class PersistentDict(MutableMapping): ''' From https://stackoverflow.com/questions/9320463/persistent-memoization-in-python ''' def __init__(self, dbpath, iterable=None, **kwargs): self.dbpath = os.path.j...
#!/usr/bin/env python #Copyright (C) 2011 by Benedict Paten (benedictpaten@gmail.com) # #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 rig...
"""Manage, delete, order compute instances.""" # :license: MIT, see LICENSE for more details. import click import SoftLayer from SoftLayer.CLI import environment from SoftLayer.CLI import exceptions from SoftLayer.CLI import formatting from SoftLayer.CLI import helpers from SoftLayer.CLI import template from SoftLaye...
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. # Django from django.db import models from django.utils.translation import ugettext_lazy as _ from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse # AWX from awx.main.fields import ImplicitRoleField from awx.main.cons...
# # Boot Manager support # # Mark Huang <mlhuang@cs.princeton.edu> # Copyright (C) 2007 The Trustees of Princeton University # # $Id$ # from PLC.Faults import * from PLC.Debug import log from PLC.Messages import Message, Messages from PLC.Persons import Person, Persons from PLC.Sites import Site, Sites from PLC.sendma...
import collections try: import unittest2 as unittest except ImportError: import unittest # NOQA import base64 import six import webtest from daybed.backends.exceptions import UserAlreadyExist class BaseWebTest(unittest.TestCase): """Base Web Test to test your cornice service. It setups the databas...
#!/usr/bin/env python3 ''' Pipelign.py A python based program to align virus sequences. The program takes as input a single FASTA formatted file Returns a FASTA formatted alignment file Different flavours are present: - GNU Parallel for Linux and MacOS - Joblib for Linux, MacO...
"""Celery Tasks for the FOIA application""" from celery.signals import task_failure from celery.schedules import crontab from celery.task import periodic_task, task from django.contrib.auth.models import User from django.core.mail import send_mail from django.template.defaultfilters import slugify from django.template...
## # Copyright (c) 2008-2010 Sprymix Inc. # All rights reserved. # # See LICENSE for details. ## import py import re from semantix.utils.debug import highlight from semantix.utils import markup def format_code_context(lines, lineno, window_size=4, colorize=False): lines = list(lines) result = [] star...
"""Renderer za XHTML dokumente koji sadrže samo liste. Kolokvij 2. veljače 2015. (Puljić)""" from pj import * class T(TipoviTokena): HTML, HEAD, BODY = '<html>', '<head>', '<body>' ZHTML, ZHEAD, ZBODY = '</html>', '</head>', '</body>' OL,ZOL,UL,ZUL,LI,ZLI = '<ol>','</ol>','<ul>','</ul>','<li>','</li>' ...
""" This class encapsulates the interactions with the SWS Enrollment resource. """ import logging from myuw.logger.timer import Timer from myuw.logger.logback import log_resp_time, log_exception, log_info from datetime import date from uw_sws.enrollment import enrollment_search_by_regid from myuw.dao.pws import get_re...
from django.test import Client from django.core.urlresolvers import reverse from django.contrib.auth import get_user_model import datetime from core.tests.base import BaseTestCase from profiles.utils import set_expiration_date class ProfileViewTestCase(BaseTestCase): def setUp(self): super(ProfileViewTe...
# -*- coding: utf-8 -*- ''' This module implements :class:`BaseSignal`, an array of signals. This is a parent class from which all signal objects inherit: :class:`AnalogSignal` and :class:`IrregularlySampledSignal` :class:`BaseSignal` inherits from :class:`quantities.Quantity`, which inherits from :class:`numpy.ar...
# -*- coding: utf-8 -*- """ ========================================================== File: WakaTime.py Description: Automatic time tracking for Sublime Text 2 and 3. Maintainer: WakaTime <support@wakatime.com> License: BSD, see LICENSE for more details. Website: https://wakatime.com/ =================...
from django.db import transaction from django.utils.translation import ugettext_lazy as _ from rest_framework.serializers import ValidationError from waldur_mastermind.marketplace import processors from waldur_mastermind.marketplace import models as marketplace_models from .utils import TimePeriod, is_interval_in_sch...
# 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...
""" Tests for discrete models Notes ----- DECIMAL_3 is used because it seems that there is a loss of precision in the Stata *.dta -> *.csv output, NOT the estimator for the Poisson tests. """ # pylint: disable-msg=E1101 import os import numpy as np from numpy.testing import (assert_, assert_raises, assert_almost_equa...