src
stringlengths
721
1.04M
# Copyright 2019 RnD at Spoon Radio # # 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 # -*- coding: utf-8 -*- """Train the CTC model (CSJ corpus).""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from os.path import join, isfile, abspath import sys import time import tensorflow as tf from setproctitle import setproc...
import copy import numpy as np from netCDF4 import Dataset from ladim.gridforce import ROMS from ladim.sample import sample2D class Grid(object): def __init__(self, config): # Make a virtual grid, subgrid of original i0, i1 = 80, 175 j0, j1 = 30, 110 self._i0 = i0 self._j...
# # 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 # ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from pyHMI.Colors import * from pyHMI.DS_ModbusTCP import ModbusTCPDevice from pyHMI.Tag import Tag import time import tkinter as tk from tkinter import ttk class Devices(object): # init datasource # PLC TBox plc = ModbusTCPDevice('localhost', port=502, time...
from unittest import TestCase from uuid import uuid1 from mock import Mock from deferrable.metadata import MetadataProducerConsumer from deferrable.pickling import dumps class TestMetadataProducerConsumer(TestCase): def setUp(self): self.item = {'id': uuid1(), 'metadata': {'premade': dumps(10)}} s...
""" This module describes behaviour of Hero objects. """ import asyncio import logging import math from datetime import datetime from random import randint from simple_commander.game.unit import Unit from simple_commander.utils.constants import UNITS class Hero(Unit): def __init__(self, x, y, angle, hits=0, sp...
# -*- coding: utf-8 -*- # Generated by Django 1.9.1 on 2016-03-30 10:50 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django.utils.timezone class Migration(migrations.Migration): initial = True depen...
# Copyright (C) 2017-2020 The Sipwise Team - http://sipwise.com # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the Free # Software Foundation, either version 3 of the License, or (at your option) # any later version. # # Th...
""" File: textfielddemo.py Author: Kenneth A. Lambert """ from breezypythongui import EasyFrame class TextFieldDemo(EasyFrame): """Converts an input string to uppercase and displays the result.""" def __init__(self): """Sets up the window and widgets.""" EasyFrame.__init__(self) # L...
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 import os from django.conf.urls.defaults import * urlpatterns = [] # load the rapidsms configuration from rapidsms.config import Config conf = Config(os.environ["RAPIDSMS_INI"]) # iterate each of the active rapidsms apps (from the ini), # and (attempt to) import ...
# -*- coding: utf-8 -*- msg = """ Delivered-To: support@barely3am.com Received: by 10.112.40.50 with SMTP id u18csp916705lbk; Sun, 19 Apr 2015 05:50:04 -0700 (PDT) X-Received: by 10.42.151.4 with SMTP id c4mr13784232icw.77.1429447803846; Sun, 19 Apr 2015 05:50:03 -0700 (PDT) Return-Path: <advertisebz09...
# #+ Copyright (c) 2014, 2015 Rikard Lindstrom <ornotermes@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
#!/usr/bin/env python # encoding: utf-8 # # Copyright © 2014 The Alfred Bundler Team # MIT Licence. See http://opensource.org/licenses/MIT from __future__ import print_function, unicode_literals import os import imp import sys import time import types import inspect import logging import unittest from common import ...
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: # # This file is part of the E-Cell System # # Copyright (C) 1996-2016 Keio University # Copyright (C) 2008-2016 RIKEN # Copyright (C) 2005-2009 The Molecular Sciences Institute # #:::::::::::::::::::::::::::::::::::::::...
s = ''' nit yqmg mqrqn bxw mtjtm nq rqni fiklvbxu mqrqnl xwg dvmnzxu lqjnyxmt xatwnl, rzn nit uxnntm xmt zlzxuuk mtjtmmtg nq xl rqnl. nitmt vl wq bqwltwlzl qw yivbi exbivwtl pzxuvjk xl mqrqnl rzn nitmt vl atwtmxu xamttetwn xeqwa tsftmnl, xwg nit fzruvb, nixn mqrqnl ntwg nq gq lqet qm xuu qj nit jquuqyvwa: xbbtfn tutbnm...
# -*- coding: utf-8 -*- # 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. import os import imp import sys import shutil i...
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
# Simple Substitution Cipher Hacker # http://inventwithpython.com/hacking (BSD Licensed) import os, re, copy, pprint, pyperclip, simpleSubCipher, makeWordPatterns if not os.path.exists('wordPatterns.py'): makeWordPatterns.main() # create the wordPatterns.py file import wordPatterns LETTERS = 'ABCDEFGHIJ...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
from copy import deepcopy from netjsonconfig import OpenVpn as BaseOpenVpn # adapt OpenVPN schema in order to limit it to 1 item only limited_schema = deepcopy(BaseOpenVpn.schema) limited_schema['properties']['openvpn'].update( {'additionalItems': False, 'minItems': 1, 'maxItems': 1} ) # server mode only limited_...
# Copyright 2018 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
# This code is licensed under the MIT License (see LICENSE file for details) import contextlib import threading import queue # import weakref import ctypes import numpy from OpenGL import GL from PyQt5 import Qt from . import shared_resources IMAGE_TYPE_TO_GL_FORMATS = { 'G': (GL.GL_R32F, GL.GL_RED), 'Ga': ...
#!/usr/bin/env python # $Id: Misc.py,v 1.1 2006-09-06 09:50:10 skyostil Exp $ """Miscellaneous functions/objects used by Cheetah but also useful standalone. Meta-Data ================================================================================ Author: Mike Orr <iron@mso.oz.net> License: This software is rel...
from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from exercise.models import ( CourseChapter, BaseExercise, StaticExercise, ExerciseWithAttachment, Submission, SubmittedFile, ) def real_class(obj): """ Returns the leaf class name of an exercise....
from SloppyCell.ReactionNetworks import * import Nets reload(Nets) import Experiments as Expts import Calculations as Calcs m = Model([ Expts.ErkMekTraverse2EGF.expt, Expts.ErkMekTraverse2NGF.expt, Expts.Raf1LandrethEGF.expt, Expts.Rap1YorkNGF.expt, Expts.RasGree...
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for the Earth and Planetary Sciences # Copyright (C) 2012 - 2019 by the BurnMan team, released under the GNU # GPL v2 or later. # This is a standalone program that converts the Holland and Powell data format # into the standard burnman format ...
from spectrum import CORRELOGRAMPSD, CORRELATION, pcorrelogram, marple_data from spectrum import data_two_freqs from pylab import log10, plot, savefig, linspace from numpy.testing import assert_array_almost_equal, assert_almost_equal def test_correlog(): psd = CORRELOGRAMPSD(marple_data, marple_data, lag=15) ...
############################################################################## # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core ...
# -*- coding: utf-8 -*- from __future__ import print_function, division, unicode_literals, absolute_import from builtins import range, str, bytes import os import nibabel as nb import numpy as np from ...utils.misc import package_check from ...utils import NUMPY_MMAP from ..base import (BaseInterface, TraitedSpec, ...
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Author: # mail: # Copyright: # Contributions: # # This program is free software: you can redistribute it and/or modify # it under the terms o...
# -*- coding: utf-8 -*- # Copyright 2019–2020 The Matrix.org Foundation C.I.C. # # 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 re...
# -*- coding: utf-8 -*- """Conversion tool from Brain Vision EEG to FIF""" # Authors: Teon Brooks <teon.brooks@gmail.com> # Christian Brodbeck <christianbrodbeck@nyu.edu> # Eric Larson <larson.eric.d@gmail.com> # # License: BSD (3-clause) import os import time import re import warnings import numpy...
""" Fast Weights Cell. Ba et al. Using Fast Weights to Attend to the Recent Past https://arxiv.org/abs/1610.06258 """ from tensorflow.python.ops import array_ops from tensorflow.python.ops import init_ops from tensorflow.python.ops import math_ops from tensorflow.python.ops import nn_ops from tensorflow.python.ops im...
#: List of CPP variables that should be defined in config.h in order to enable this suite. need_cpp_vars = [ ] #: List of keywords that are automatically added to all the tests of this suite. keywords = [ ] subsuites = [ "base1", "base2", "base3", "base4", "basepar", "bs", "gw1", "gw2", "dftu", "nuc", "paw1", "paw2"...
#!/usr/bin/python ######################################################################################## #Script to filter out isoforms from peptide files in FASTA ENSEMBL or NCBI format. This #script can also add an easier to read species label to each sequence within the file. # #Sample ENSEMBL usage: python isofor...
############################################################################ # # Copyright (C) 2004-2005 Trolltech AS. All rights reserved. # # This file is part of the example classes of the Qt Toolkit. # # This file may be used under the terms of the GNU General Public # License version 2.0 as published by the Fr...
#!/usr/bin/env python # simple test cases for two phase commit extensions to psycopg2 # # Copyright (C) 2008 Mariano Reingart <mariano@nsis.com.ar> # # 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 F...
from collections import Counter, defaultdict from .machine_learning import split_data import math import random import re import glob def tokenize(message): message = message.lower() # convert to lowercase all_words = re.findall("[a-z0-9']+", message) # extract the words return se...
from __future__ import unicode_literals import os, uuid, json, math import param from ...core import OrderedDict, NdMapping from ...core.options import Store from ...core.util import (dimension_sanitizer, safe_unicode, unique_array, unicode, isnumeric) from ...core.traversal import hierarch...
# -*- coding: utf-8 -*- """ Created on Thu Feb 25 17:58:31 2016 Markov Chain Monte Carol ( or something like that, MCMC) @author: katar """ import numpy import random """ Concept: 1) define a markov chain 2) run a monte carlo simulation using the markov chain to """ stateNames =['tropics','ci...
from webtest import TestApp from tg.support.middlewares import StatusCodeRedirect from tg.support.middlewares import DBSessionRemoverMiddleware from tg.support.middlewares import MingSessionRemoverMiddleware def FakeApp(environ, start_response): if environ['PATH_INFO'].startswith('/error'): start_response...
"""Tests for polynomial module. """ from __future__ import division import numpy as np import numpy.polynomial.polynomial as poly from numpy.testing import ( TestCase, assert_almost_equal, assert_raises, assert_equal, assert_, run_module_suite) def trim(x) : return poly.polytrim(x, tol=1e-6) T0 ...
'''Train a simple deep CNN on the CIFAR10 small images dataset. GPU run command with Theano backend (with TensorFlow, the GPU is automatically used): THEANO_FLAGS=mode=FAST_RUN,device=gpu,floatx=float32 python cifar10_cnn.py It gets down to 0.65 test logloss in 25 epochs, and down to 0.55 after 50 epochs. (it's s...
import re from flask import jsonify from app import db from subscriptions import subscriptions from sqlalchemy.orm import validates from citmodel import CITModel class User(CITModel): """ A Model to define Users and their information Attributes userId (int): The primary key of the User email (string): The User'...
import unittest from lxml import etree import should_be.all # noqa from xmlmapper import xml_helpers as xh class TestXMLHelpers(unittest.TestCase): def setUp(self): self.elem_name = 'some_elem' self.elem = etree.Element(self.elem_name) self.attr_name = 'some_attr' self.attr_val...
# ---------------------------------------------------------------------------- # Copyright 2014 Nervana Systems 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.o...
class Student: """This is a very simple Student class""" course_marks = {} name = "" family = "" def __init__(self, name, family): self.name = name self.family = family def addCourseMark(self, course, mark): """Add the course to the course dictionary, this will overide the old mark if one exists.""" ...
#!/bin/env python #Busybar widget """ Rick Lawson Heavily borrowed from ProgressBar.py which I got off the net but can't remember where Feel free to add credits. Comments by Stewart Midwinter: I added a Quit button so you can stop the app. I also set up a timer so that the BusyBar stops after a certain period. Nex...
# -*- coding: utf-8 -*- from __future__ import print_function import base64 import cgi import hashlib import hmac import logging import requests try: import simplejson as json except ImportError: import json import time from functools import wraps # pypi import six from six.moves.urllib.parse import urlencod...
#!/usr/bin/python # # Python ISO7816 (as part of EMV Framework) # Copyrigh 2012 Albert Puigsech Galicia <albert@puigsech.com> # # This code 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; eithe...
class BasePage(object): """Base class to initialize the base page that will be called from all pages""" def __init__(self, driver): self.driver = driver def send_value_to_element_id(self, key, value): self.driver.find_element_by_id(key).send_keys(value) def send_value_to_xpath(self, k...
# Copyright 2013 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 required by applicable law or ...
import argparse import docker import logging from pythonjsonlogger import jsonlogger from importlib import import_module from time import time, sleep from beam.models.service import Service EXCLUDED_ATTRIBUTES = [ 'TAGS' ] class Beam(object): def __init__(self, args=[]): self.log = self.init_logge...
"""Class to perform under-sampling by generating centroids based on clustering.""" # Authors: Guillaume Lemaitre <g.lemaitre58@gmail.com> # Fernando Nogueira # Christos Aridas # License: MIT from __future__ import division, print_function import numpy as np from scipy import sparse from sklearn.cl...
import os from threading import Thread from tkinter import * from tkinter.ttk import * from pydub import AudioSegment from pydub.playback import play class Core(Tk): def get_w(self): return self._w class Application(Frame): def __init__(self, master=None, **kw): super().__init__(master, **k...
# -*- coding: utf-8 -*- import os, sys print("CWD: " + os.getcwd() ) # Load configuration file before pyplot config_path = os.path.abspath('../matplotlib/') sys.path.append(config_path) import configuration as config # Library path lib_path = os.path.abspath('../../lib') sys.path.append(lib_path) import framemanager...
#!/usr/bin/env python # encoding: utf-8 import unittest from pprint import pprint from cStringIO import StringIO from rdflib import Graph, Namespace from FuXi.Rete.RuleStore import SetupRuleStore from FuXi.Rete.Util import generateTokenSet from FuXi.DLP.DLNormalization import NormalFormReduction EX = Namespace('http:/...
# -*- coding: utf-8 -*- # # cds-indico documentation build configuration file, created by # sphinx-quickstart on Sun Nov 29 13:19:24 2009. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
""" Examples ======== my_app/models.py ---------------- from django.db import models class CustomerType(models.Model): name = models.CharField(max_length=50) def __unicode__(self): return self.name class Customer(models.Model): name = models.CharField(max_length=50) ...
"""The base of a Kolibri plugin is the inheritence from :class:`.KolibriPluginBase`. """ from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import logging import sys from importlib import import_module from django.utils.module_loading import module_has...
# # Copyright (C) 2015 Uninett AS # # This file is part of Network Administration Visualized (NAV). # # NAV is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License version 3 as published by # the Free Software Foundation. # # This program is distributed in the hope...
# -*- coding: utf-8 -*- """ pyvisa-sim.parser ~~~~~~~~~~~~~~~~~ Parser function :copyright: 2014 by PyVISA-sim Authors, see AUTHORS for more details. :license: MIT, see LICENSE for more details. """ import os from io import open, StringIO from contextlib import closing from traceback import forma...
from PIL import Image import random size = (640, 640) black = (0,0,0) white = (255,255,255) def draw(size): im = Image.new("RGB", size) ll = [] for i in range(size[0]): for j in range(size[1]): if random.random()>0.5: ll.append(white) else: ...
#!/opt/anaconda2/bin/python # -*- coding: utf-8 -*- from __future__ import print_function """ ################################################################################ # # Copyright (c) 2015 Wojciech Migda # All rights reserved # Distributed under the terms of the MIT license # #############################...
#!/usr/bin/env python from __future__ import division, print_function import os from math import log from collections import namedtuple, OrderedDict, deque import time import threading import json import gc try: from Queue import Queue except ImportError: from queue import Queue import io import logging from fr...
from django.http import Http404, HttpResponseRedirect from django.shortcuts import render, get_object_or_404 from django.template import RequestContext from django.contrib import messages from django.contrib.auth.decorators import login_required from django.utils.translation import ugettext as _ from django.utils impor...
from direct.directnotify import DirectNotifyGlobal from pandac.PandaModules import * from toontown.toonbase import TTLocalizer from toontown.toonbase import ToontownGlobals from direct.interval.IntervalGlobal import * from direct.distributed.PyDatagram import PyDatagram from direct.distributed.PyDatagramIterator import...
# -*- coding: utf-8 -*- import logging import multiprocessing import psycopg2 import pyramid.threadlocal from sqlalchemy.sql import text from ..models.base import DBSession from ..models.order_line import SOrderLine log = logging.getLogger(__name__) Is_Importing = False def _get_origin_connection(host, port, dbnam...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'main.ui' # # Created: Wed Apr 08 10:31:45 2015 # by: PyQt4 UI code generator 4.11.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attribute...
"""Support for sensors through the SmartThings cloud API.""" from __future__ import annotations from collections import namedtuple from typing import Sequence from pysmartthings import Attribute, Capability from homeassistant.components.sensor import SensorEntity from homeassistant.const import ( AREA_SQUARE_MET...
# # $Id$ # from defines import * class crc: def __init__(self, parent=None): self.attributes = {} # initialize attributes self.attributes["Match"] = 1 # Match attribute set to 1 tells the main program we can be used to match self.attribute...
# This file is part of the myhdl library, a Python package for using # Python as a Hardware Description Language. # # Copyright (C) 2003-2009 Jan Decaluwe # # The myhdl library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License as # published by t...
""" plugins/Paypal.py Author: Trey Stout Date Added: Mon Jul 24 15:29:48 CDT 2006 New interface to the same old shit... """ ## STD LIBS from md5 import md5 from datetime import date, datetime from xml.dom import minidom from pprint import pprint, pformat from math import floor import time ## OUR LIBS from AZTKAPI i...
################################################################################ # # Copyright 2014-2015 William Barsse # ################################################################################ # # This file is part of ToySM Extensions. # # ToySM Extensions is free software: you can redistribute it and/or modi...
from wordfreq import ( word_frequency, available_languages, cB_to_freq, top_n_list, random_words, random_ascii_words, tokenize ) from nose.tools import ( eq_, assert_almost_equal, assert_greater, raises ) def test_freq_examples(): # Stopwords are most common in the correct language assert_greater(...
# LOFAR IMAGING PIPELINE # # flag_baseline node # John Swinbank, 2010 # swinbank@transientsk...
"""Provide pre-made queries on top of the recorder component.""" from collections import defaultdict from datetime import timedelta from itertools import groupby import logging import time import voluptuous as vol from homeassistant.const import ( HTTP_BAD_REQUEST, CONF_DOMAINS, CONF_ENTITIES, CONF_EX...
import copy import functools import os import pprint import threading from enum import Enum from tkinter import Toplevel, StringVar, BooleanVar, messagebox, IntVar from tkinter.constants import * import tkinter.font as tkfont from tkinter.ttk import Notebook, Frame, Label, Button, Style, Combobox, Entry, Checkbutton, S...
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # Copyright (c) 2011 Blue Pines Technologies LLC, Brad Carleton # www.bluepines.org # Copyright (c) 2012 42 Lines Inc., Jim Browne # # Permission is hereby granted, free of charge, to any person obtaining a # copy...
#!/usr/bin/python from soldiers import *; from towers import *; from economy import Economy; from output import ConsoleOutput; import time; import math; import random; import gamemap; import copy; #from pprint import pformat #import pygame; #from pygame.locals import *; from termcolor import colored; #from utils impo...
import time import pytest import config from urbansearch.utils import db_utils OCCURS_IN = config.get('neo4j', 'occurs_in_name') RELATES_TO = config.get('neo4j', 'relates_to_name') if not ('TEST' in OCCURS_IN and 'TEST' in RELATES_TO): raise ValueError('Not adjusting production DB! {} {}'.format(RELATES_TO, ...
try: import threading as _threading except ImportError: import dummy_threading as _threading import cahal_tests import unittest import sys ...
"""This file is part of MuNoJaBo. MuNoJaBo 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 ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ It produces a report with the summary of the fusion genes found. Also FASTQ and FASTA files containing the supporting reads corresponding to each fusion gene is generated. Author: Daniel Nicorici, Daniel.Nicorici@gmail.com Copyright (c) 2009-2021 Daniel Nicorici Th...
# coding=utf-8 # Copyright 2020 The Trax Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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...
# # ndmtk - Network Discovery and Management Toolkit # Copyright (C) 2016 Paul Greenberg @greenpau # See LICENSE.txt for licensing details # # File: setup.py # from __future__ import print_function; try: from setuptools import setup; except ImportError: from ez_setup import use_setuptools; use_setuptools(...
from flask import g import os from werkzeug.datastructures import FileStorage from shuttl.Models.Website import Website from shuttl.Models.organization import Organization from shuttl.Models.Reseller import Reseller from shuttl.Models.FileTree.Directory import Directory from shuttl.Models.FileTree.FileObjects.Template...
import numpy as np import unittest as ut try: import scipy.spatial.transform as sst except ImportError: pass import espressomd.rotation import unittest_decorators as utx @utx.skipIfUnmetModuleVersionRequirement('scipy', '>=1.4.0') class TestRotation(ut.TestCase): """ Tests for the rotation utility f...
"""Implementation of a web server API that serves up Fibonacci numbers. TODO: Add some additional error handling: - Need some handling around the query parameter on the API. What if it is not supplied for example? """ import web from fibonacci import Fibonacci urls = ( '/fibonacci', 'Fibon...
# -*- coding: utf-8 -*- from django_jinja import library from django.template.loader import render_to_string __author__ = 'AlexStarov' @library.global_function() def block_products(products, request, ): from django.middleware.csrf import get_token request_csrf_token = get_token(request, ) # request_csrf_...
# Copyright 2010 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Answers's custom publication.""" __metaclass__ = type __all__ = [ 'AnswersBrowserRequest', 'AnswersLayer', 'answers_request_publication_factory', ] from zope....
# # TUI for RHN Registration # Copyright (c) 2000--2016 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. Y...
import struct import six from .bit_field import BitField class Byte(BitField): """The byte sized bit field primitive. :type name: str, optional :param name: Name, for referencing later. Names should always be provided, but if not, a default name will be given, defaults to None :type defau...
import re from django.core.exceptions import ViewDoesNotExist from django.core.urlresolvers import RegexURLPattern, RegexURLResolver from django.conf import settings def extract_views_from_urlpatterns(urlpatterns, base='', namespace=None): """ Return a list of views from a list of urlpatterns. Each obje...
import ast from django.db import models from django.utils.translation import ugettext as _ class TUIDUser(models.Model): """Represents a TUID user with various properties returned from CAS""" class Meta: verbose_name = _('TUID User') verbose_name_plural = _('TUID Users') uid = models.Char...
#!/usr/bin/env python # -*- coding: iso-8859-15 -*- # # pKaTool - analysis of systems of titratable groups # Copyright (C) 2010 Jens Erik Nielsen # # 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...
# -*- coding: utf-8 -*- # Copyright(C) 2019 Budget Insight # # This file is part of a weboob module. # # This weboob module is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the ...
import os from unittest import TestCase from textwrap import dedent from nose.tools import raises import pyexcel_io.manager as manager from pyexcel_io._compact import OrderedDict from pyexcel_io.fileformat._csv import CSVBookReader, CSVBookWriter from pyexcel_io.fileformat.tsv import TSVBookReader, TSVBookWriter clas...
import re from deltas import wikitext_split from deltas import wikitext_split_w_cjk from deltas.segmenters import ParagraphsSentencesAndWhitespace from revscoring.datasources import Datasource from revscoring.datasources.meta import filters, frequencies, mappers from . import base class Revision(base.BaseRevision...