src
stringlengths
721
1.04M
from functools import reduce from io import BufferedReader from provdbconnector.exceptions.utils import ParseException, NoDocumentException import six from prov.model import ProvDocument import logging log = logging.getLogger(__name__) def form_string(content): """ Take a string or BufferedReader as argumen...
import datetime from django.db import models, connection from seymour.feeds.models import Feed, Item, AccountFeed class Account(models.Model): openid = models.CharField('openid', max_length=255, null=True) firstname = models.CharField('first name', max_length=100, null=True) lastname = models.CharField('l...
# Copyright 2015 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 required by applica...
import json import uuid from datetime import datetime, timedelta from django.conf import settings from django.contrib import messages from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse from django.db import connection from django.db.models import Count, Q, Sum from djang...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
# FIXME: Move these messages to somewhere else NUMERIC_REPLIES = { '001' : 'Welcome to the Internet Relay Network %s', '002' : 'Your host is %s, running version %s', '003' : 'This server was created %s', '004' : '<servername> <version> <available user modes> <available channel modes>', '31...
# -*- coding: utf-8 -*- from __future__ import print_function import os import sys import time import subprocess # Import parameters from the setup file. sys.path.append('.') from setup import ( # noqa setup_dict, get_project_files, print_success_message, print_failure_message, _lint, _test, _test_all, ...
import sys, os, math, time import arcpy from arcpy import env from arcpy.sa import * arcpy.CheckOutExtension("spatial") #Metadata exists in one of two standard formats (finds the correct name for each field) def acquireMetadata(metadata, band): band = str(band) metadatalist = [] if ("RADIANCE_M...
""" https://leetcode.com/problems/validate-stack-sequences/ https://leetcode.com/submissions/detail/218117451/ """ from typing import List class Solution: def validateStackSequences(self, pushed: List[int], popped: List[int]) -> bool: if pushed == popped: return True a = [] w...
import datetime import json from django.conf import settings from django.contrib.messages.storage.base import Message from django.utils.functional import Promise from django.utils import six def encode_message(message): return {'class': message.tags, 'message': message.message} class JsonitEncoder(json.JSONEnc...
""" sentry.models.release ~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function from django.db import models from django.utils import timezone from sentry.db.models impo...
from __future__ import absolute_import from django.utils.translation import ugettext as _ from django.utils.timezone import now from django.conf import settings from django.core import validators from django.core.exceptions import ValidationError from django.db import connection from django.db.models import Q from dja...
from django.shortcuts import render_to_response, render, redirect from ..models.author import Author def signupInSite(request): if request.method == 'GET': return render(request, 'users/signup.html', {}) elif request.method == 'POST': author = Author() author.name = request.POST['n...
# coding=utf-8 # Author: Maxime Petazzoni # maxime.petazzoni@bulix.org # # This file is part of pTFTPd. # # pTFTPd 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 Licens...
# -*- coding: UTF-8 -*- # ----------------------------------------------------------------------------- # xierpa server # Copyright (c) 2014+ buro@petr.com, www.petr.com, www.xierpa.com # # X I E R P A 3 # Distribution by the MIT License. # # -----------------------------------------------------------...
#=========================================================================== # # Broker connection # #=========================================================================== from . import config import paho.mqtt.client as mqtt #=========================================================================== class Clien...
# Copyright 2014 Cloudera Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, so...
import time import logging import mxnet as mx class Speedometer(object): def __init__(self, batch_size, total_iter, frequent=50): self.batch_size = batch_size self.total_iter = total_iter self.frequent = frequent self.init = False self.tic = 0 self.last_count = 0 ...
import os.path import re # don't use slots since we only have a few of these guys class _sampleRec(): def __init__(self, name, mean, std, condition): self.name = name self.mean = int(mean) self.std = int(std) self.condition = int(condition) class EbseqExtras(): def __init__(s...
''' Widget class ============ The :class:`Widget` class is the base class required for creating Widgets. This widget class was designed with a couple of principles in mind: * *Event Driven* Widget interaction is built on top of events that occur. If a property changes, the widget can respond to the change in the...
# -*- coding: utf-8 -*- # HORTON: Helpful Open-source Research TOol for N-fermion systems. # Copyright (C) 2011-2016 The HORTON Development Team # # This file is part of HORTON. # # HORTON is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by th...
#!/usr/bin/python # # 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 b...
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-04-19 14:29 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Interfa...
import hashlib from werkzeug.security import generate_password_hash, check_password_hash from flask import request #from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from flask_login import UserMixin,AnonymousUserMixin from app import login_manager from app import db from datetime import datetime ...
from Ft.Xml import Domlette from xml.dom import Node source_1 = """<?xml version="1.0"?> <elementList> <element> <x> <y>a</y> </x> </element> <element> <x> <y>z</y> </x> </element> </elementList>""" def Test(tester): tester.startGroup('Predi...
"""Play menu.""" import wx, application, logging from .base import BaseMenu from functions.sound import queue, set_volume, get_previous, get_next from config import config logger = logging.getLogger(__name__) class PlayMenu(BaseMenu): """The play menu.""" def __init__(self, parent): self.name = '&Pla...
from setuptools import setup, find_packages import os version = '1.0' requires = [ 'setuptools', 'openprocurement.api>=2.3', 'openprocurement.tender.openeu', ] test_requires = requires + [ 'webtest', 'python-coveralls', ] docs_requires = requires + [ 'sphinxcontrib-httpdomain', ] entry_poin...
""" Tests for Course API forms. """ from itertools import product from urllib import urlencode import ddt from django.contrib.auth.models import AnonymousUser from django.http import QueryDict from openedx.core.djangoapps.util.test_forms import FormTestMixin from student.tests.factories import UserFactory from xmodu...
import logging import os from dvc.exceptions import DvcException from dvc.path_info import PathInfo from dvc.utils import resolve_output from dvc.utils.fs import remove logger = logging.getLogger(__name__) class GetDVCFileError(DvcException): def __init__(self): super().__init__( "the given ...
# 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...
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emanuel Cino <ecino@compassion.ch> # # The licence is in the file __openerp__.p...
#!/usr/bin/python import os from collections import namedtuple import yaml from click import command, confirm, echo, option, prompt, secho from pocket import Pocket from rules import DEFAULT_RULES, compile_rules PocketItem = namedtuple('PocketItem', ['id', 'url', 'tags', 'title']) def save_config(path, cfg_dict):...
#!/usr/bin/env python2 # transpiled with BefunCompile v1.3.0 (c) 2017 import sys import zlib, base64 _g = ("AR+LCAAAAAAABACdUDGOAyEM/AoHW7FBYna5XIKQdQ9B3BUr0VJZKXj8mZAUKXMuzGA8nsHsse3h8/x1uaq3g/RxHNpa8PtcxQ3btQEu/YP8NMA0pWdODzAm0sSU4TLf" + "qw1hRUVItKFGrJ36QD5ThIum/DDZPM4ldiHuaApBkqAaUC1Qfz/6Q3l59bFAFZFs54tluRSpdadv...
# # Similar to the 1a_checkalistars, we draw the alignment stars, this time on the combi image (to make a "nice" map) # execfile("../config.py") from kirbybase import KirbyBase, KBError from variousfct import * import star #import shutil import f2n #from datetime import datetime, timedelta # Read reference image i...
# -*- coding: utf-8 -*- ############################################################################### # This program 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 import unittest """80. Remove Duplicates from Sorted Array II https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/description/ Given a sorted array _nums_ , remove the duplicates [**in- place**](https://en.wikipedia.org/wiki/In-place_algorithm) such that duplicates appeared at most _t...
# # 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 us...
import requests import logging def save_rss(feed, city, cursor): section, url = feed url = url % city logging.info('%s', city) logging.info('%s', section) logging.info('%s', url) listing = requests.get(url).text cursor.execute("""INSERT INTO rss (section, url, raw, city) """ ...
# # Samples a 2d double-well distribution using Umbrella sampling in the temperature (parallel version) # # Usage: # > mpirun -np N python gaussian.py # where "N" is the number of cores to run on, e.g. 4 # import usample.usample import numpy as np import emcee # # Sample a 2D Gaussian # # Define the log probability ...
#!/usr/bin/env python import inspect import sys from optparse import OptionParser from . import checkin from . import init from . import rebase from . import reset from . import sync from . import tag from . import update from . import version commands = [ init, rebase, checkin, sync, reset, tag, update, version...
#!/usr/bin/env python ################################################################################### # # # This script should be executed as the last thing that happens during # # the configuration phase of a server. It will perform the health check # # defined in the load balanceri(s) co...
# -*- coding: utf-8 -*- # # CommAI-env documentation build configuration file, created by # sphinx-quickstart on Wed Aug 3 14:31:58 2016. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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 -*- """ Copyright (C) 2016 Dariusz Suchojad <dsuch at zato.io> Licensed under LGPLv3, see LICENSE.txt for terms and conditions. """ from __future__ import absolute_import, division, print_function, unicode_literals # stdlib import logging import time from datetime import datetime, timedelta # Z...
select_recog_info = ("select syslog_recognition.dev_file_name, header_re, tag_re from \ syslog_recognition join device_file on syslog_recognition.dev_file_name = device_file.dev_file_name") select_parsing_info = (" SELECT * FROM syslog_attr where dev_file_name=%s order by attr_order") select_storage_info = (" SE...
import numpy as np def binData(data, binS, axis): """This method takes a dataset, and return the binned one. This cannot be used with FWS data processed from hdf5 files with axis being set to 'energies'. Parameters ---------- data : :class:`BaseType` or any nPDyn dataType d...
#!/usr/bin/env python # Holy import! from __future__ import division from numpy import * from matplotlib import pyplot as P from agent import OptHighestSNR, RandomChannel, IndividualQ, FixChannel from channel.simple import SimpleChannel from traffic.simple import SimpleTraffic from environment import Environment impo...
from django.contrib import admin from .models import Cert from .cert import revoke_certificates class CertAdmin(admin.ModelAdmin): list_display = ('user', 'install_link', 'is_valid', 'valid_until') fields = ('user', 'country', 'state', 'locality', 'organization', 'organizational_unit', 'common_name'...
import pandas as pd import pandas.util.testing as tm import pytest from pytest import param import ibis import ibis.common.exceptions as com pytestmark = pytest.mark.pandas join_type = pytest.mark.parametrize( 'how', [ 'inner', 'left', 'right', 'outer', param( ...
########################################################################### # # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/l...
#-*- coding: utf-8 -*- from __future__ import division from PyQt4.QtCore import SIGNAL from PyQt4.QtGui import QDialog, QKeySequence, QMessageBox import ui_TestDialog class TestDialog(QDialog, ui_TestDialog.Ui_testDialog): """ Dialog whith which user interacts when performing a test on words. """ de...
#!/usr/bin/env python ######################### # Make Illumination correction images ########################## import astropy, astropy.io.fits as pyfits, illummodels, os.path, sys, re from numpy import * ######################## __cvs_id__ = "$Id: interpolatemodel.py,v 1.3 2009-04-20 23:09:43 dapple Exp $" ######...
# -*- coding: utf-8 -*- __author__ = 'ke4roh' # Copyright © 2016 James E. Scarborough # # 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) an...
# /usr/bin/env python3 # -*- coding: utf-8 -*- # A program to figure out the basics of file I/O data = """\ I met a traveller from an antique land Who said: Two vast and trunkless legs of stone Stand in the desert. Near them, on the sand, Half sunk, a shattered visage lies, whose frown, And wrinkled lip, and sneer of c...
# -*- coding: utf-8 -*- """ Created on Fri Jul 3 11:57:19 2015 @author: mdmiah """ import numpy as np import random import cv2 import sys import modelInputs import modelMake import ensembleInputs import ensembleMake def predictionsFor(u, labels, brisks, colors): global probs count = colors.shape[0] trai...
# Copyright (c) 2015, MapR Technologies # # 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...
import shlex import typing from os.path import relpath from denite import util, process from denite.base.source import Base from denite.util import Nvim, UserContext, Candidates, Candidate def _candidate(result: typing.List[typing.Any], path: str) -> Candidate: return { 'word': result[3], 'abbr':...
import os import sys import subprocess as sub import numpy as np import time import logging import tistools_helpers.tistools_helpers as tistools_helpers #SRM:set up logger for the general error messages logger = logging.getLogger(__name__) handler = logging.FileHandler("analysis.log") formatter = logging.Formatter('%(...
# -*- coding: UTF8 -*- from tinydb import TinyDB, Query from tinydb.operations import delete import os import operator # from tinydb.storages import MemoryStorage from uuid import uuid1 from datetime import datetime as dt from datetime import timedelta as td import matplotlib.pyplot as plt Y_M_D_H_M_S = "%Y-%m-%d %H:%...
import base64 from zope.interface import implements from twisted.internet import reactor, defer, protocol from twisted.internet.defer import inlineCallbacks, returnValue, succeed from twisted.web.client import Agent from twisted.web.http_headers import Headers from twisted.web.iweb import IBodyProducer class receiv...
"""Implementation of Doubly-Linked list with a head and tail.""" from linked_list import LinkedList from linked_list import Node class Dll(object): """Doubly-Linked List class object.""" def __init__(self): """Doubly-linked list initialization. Composed of some attributes from linked-list, a...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
# Author: Samuel Genheden samuel.genheden@gmail.com """ Program to parse RESP charges and make Gromacs residue template file (.rtp) Atoms in the PDB file need to be in the same order as in the charge file The atom types file need to have an atomtype definition on each line NAME1 TYPE1 NAME2 TYPE2 ... Us...
import sys import os sys.path.insert(0, os.path.abspath( os.path.join( os.path.abspath( os.path.dirname(__file__)), '../../'))) from fakeredis import FakeStrictRedis, FakePipeline from StringIO import StringI...
# coding: utf-8 from django.utils.translation import ugettext_lazy as _ from django.db import models from django_deferred_polymorph.models import SubDeferredPolymorphBaseModel import decimal import datetime from .manager import TaxManager # TODO: Versionized Tax (Tax should NEVER get changed, as this may # create an ...
#!/usr/bin/python from setuptools import setup # to install type: # python setup.py install --root=/ def readme(): with open('README.rst', encoding="utf8") as f: return f.read() setup (name='Tashaphyne', version='0.3.5', description='Tashaphyne Arabic Light Stemmer', long_description = readme()...
# Copyright (c) 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
#!/usr/bin/python # # dofit.py (Based on fitxsp.py) # # Load data and perform a model fit using PyXspec # # Requires: xspec # Make sure to set: # export VERSIONER_PYTHON_PREFER_32_BIT=yes # (only for heasoft earlier than 6.16) # import sys from xspec import * from optparse import OptionParser import os,os...
#! /usr/bin/env python """ Gisto - Gitso is to support others Gitso is a utility to facilitate the connection of VNC @author: Aaron Gerber ('gerberad') <gerberad@gmail.com> @author: Derek Buranen ('burner') <derek@buranen.info> @author: AustP @copyright: 2008 - 2014 Gitso is free software: you can redistribute it a...
# vim: ts=4:sw=4:expandtab # -*- coding: UTF-8 -*- # BleachBit # Copyright (C) 2014 Andrew Ziem # http://bleachbit.sourceforge.net # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either versi...
""" Helpers for analyzing synthetic EIS data """ import os import numpy as np from sunpy.util.metadata import MetaDict from sunpy.map import Map from sunpy.io.fits import get_header from sunpy.visualization.colormaps.cm import hinodexrt import astropy.units as u import astropy.io.fits import h5py __all__ = ['EISCube'...
# -*- coding: utf-8 -*- """ Created on Thu Jun 23 10:45:10 2016 @author: Mathias Aschwanden (mathias.aschwanden@gmail.com) Very simple test BoxModelSystem with only 2 boxes: An upper ocean box and a deep ocean box. The upper ocean is connected to the land and atmosphere by two fluid flows: river inflow and evaporat...
from django.contrib import admin from django.contrib.auth.models import Group, Permission from .models import Experiment from djmanager.utils import get_subclass_ct_pk, get_allowed_exp_for_user from djsend.models import BaseGlobalSetting, BaseSettingBlock from django.contrib.contenttypes.models import ContentType from ...
from oeqa.selftest.base import oeSelfTest from oeqa.utils.commands import bitbake, get_bb_vars from oeqa.utils.decorators import testcase import glob import os import shutil class Archiver(oeSelfTest): @testcase(1345) def test_archiver_allows_to_filter_on_recipe_name(self): """ Summary: T...
# -*- coding: utf-8 -*- """ Created on Mon Jul 11 2016 @author: Kirby Urner Uses API documented at http://www.omdbapi.com/ to query IMDB movie database. """ import requests # from collections import namedtuple import json # Movie = namedtuple("Movie", "status_code content") class Movie: def __init__(self,...
# Copyright (C) 2011 Mark Burnett # # 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 i...
#----------------------------------------------------------- # Threaded, Gevent and Prefork Servers #----------------------------------------------------------- import datetime import errno import logging import os import os.path import platform import random import select import signal import socket import subprocess ...
#! /usr/bin/env python # -*- coding: utf-8 -*- import os BASE_DIR = os.path.dirname(os.path.dirname(__file__)) SECRET_KEY = '_*zjhswt9umayc3hl4(a3trs3fz+zgh9l@o^1(bo#%jl@t4jqu' DEBUG = True TEMPLATE_DEBUG = True ALLOWED_HOSTS = ['*'] TEST_PROJECT_APPS = ( 'app', ) INSTALLED_APPS = ( 'django.contrib.admin',...
from django.conf import settings from django.core.urlresolvers import reverse from django.db import models from django.template.defaultfilters import slugify from mptt.models import MPTTModel, TreeForeignKey class ForumCategory(MPTTModel): parent = TreeForeignKey( 'self', blank=True, null=True, related_n...
# -*- coding: utf-8 -*- """ Sympy helpers """ from __future__ import absolute_import, division, print_function import numpy as np import six import utool as ut import ubelt as ub def custom_sympy_attrs(mat): import sympy def matmul(other, hold=True): if hold: new = sympy.MatMul(mat, other)...
# encoding: UTF-8 import os from django.contrib.auth.models import User from django.db import models from django.db.models.signals import pre_delete, pre_save from django.dispatch import receiver class Category(models.Model): title = models.CharField(max_length=50) position = models.IntegerField(name='positio...
"""Testing facility for conkit.io.FastaIO""" __author__ = "Felix Simkovic" __date__ = "09 Sep 2016" import os import unittest from conkit.io.clustal import ClustalParser from conkit.io._iotools import create_tmp_f class TestClustalParser(unittest.TestCase): def test_read_1(self): seq = """CLUSTAL W se...
# -*- coding: utf-8 -*- # # Copyright 2013-2015 BigML # # 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 ...
""" Render the policy execution to gif or video. Gifs are generated with pure python code. To render a video, it just saves a bunch of images to a directory. Then it's very easy to render a video with ffmpeg. Like: ffmpeg -framerate 8 -pattern_type glob -i '*.png' out.mp4 """ import gym import imageio import matplotl...
#!/usr/bin/env python """ freesmartphone.org Framework Daemon (C) 2008-2010 Michael 'Mickey' Lauer <mlauer@vanille-media.de> (C) 2008-2009 Openmoko, Inc. GPLv2 or later Package: framework.patterns Module: processguard """ __version__ = "0.3.0" import gobject import os, signal, types MAX_READ = 4096 import loggin...
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from urlparse import urlparse, parse_qsl except ImportError as e: from urllib.parse import urlparse, parse_qsl from .database import SQLiteDatabase schemes = { 'sqlite': SQLiteDatabase } def parseresult_to_dict(parsed): # urlparse in python 2.6 i...
""" """ from io import BytesIO from itertools import count import tarfile from time import time, sleep from click import progressbar from logbook import Logger import pandas as pd import requests from six.moves.urllib.parse import urlencode from boto import connect_s3 import tarfile from . import core as bundles fro...
#! /usr/bin/env python import os __dir__ = os.path.dirname(__file__) from test_all import run_tests, assertion, hashlib from elfesteem.minidump_init import Minidump def test_MD_windows(assertion): md = open(__dir__+'/binary_input/windows.dmp', 'rb').read() assertion('82a09a9d801bddd1dc94dfb9ba6eddf0', ...
import bpy from . import quote from .curve import Curve def add_material_animation(op, anim_info, material_id): anim_id = anim_info.anim_id data = anim_info.material[material_id] animation = op.gltf['animations'][anim_id] material = op.get('material', material_id) name = '%s@%s (Material)' % ( ...
from django.core.urlresolvers import reverse from eats.models import Entity from eats.tests.views.view_test_case import ViewTestCase class EntityDeleteViewTestCase (ViewTestCase): def setUp (self): super(EntityDeleteViewTestCase, self).setUp() user = self.create_django_user('user', 'user@example...
#!/usr/bin/env python #Copyright 2012-2013 SAP 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
# -*- coding:utf-8 -*- __author__ = 'Qian' import hmac import uuid import hashlib from MyDBUtils.yq_NoSQL import RedisDB class SessionData(dict): def __init__(self, session_id, hmac_key): self.session_id = session_id self.hmac_key = hmac_key class Session(SessionData): def __init__(self, s...
# # Memcached protocol implementation # Nikolay Mihaylov nmmm@nmmm.nu # # For Memcached telnet protocol see: # http://blog.elijaa.org/?post/2010/05/21/Memcached-telnet-command-summary import asynchat import time try: from cStringIO import StringIO except ImportError: from StringIO import StringIO class Memca...
#! /usr/bin/python3 """Destroy a quantity of an asset.""" import struct import json import logging logger = logging.getLogger(__name__) from counterpartylib.lib import util from counterpartylib.lib import config from counterpartylib.lib import script from counterpartylib.lib import message_type from counterpartylib....
""" MetPX Copyright (C) 2004-2007 Environment Canada MetPX comes with ABSOLUTELY NO WARRANTY; For details type see the file named COPYING in the root of the source directory tree. """ """ ############################################################################################# # Name: MasterConfigurator.py # # Au...
import configparser import os import re import subprocess import zipfile from io import BytesIO from urllib.request import urlopen from setuptools import find_packages, setup HERE = os.path.abspath(os.path.dirname(__file__)) TOMATO_DIR = "src" def get_version(): """ Read version from __init__.py Raises: ...
# Copyright 2014 # The Cloudscaling Group, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy # of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
from django.conf import settings from django.test import TestCase from corehq.apps.sms.models import SMSLog from corehq.apps.sms.util import get_available_backends from corehq.apps.smsbillables.models import * from corehq.apps.smsbillables import generator class TestGatewayFee(TestCase): def setUp(self): ...
from seth import auth from seth.tests import IntegrationTestBase from seth.classy.rest import generics class DefaultAuthenticatedResource(generics.GenericApiView): authentication_policy = None def get(self, **kwargs): return {} class BaseAuthenticatedTestCase(IntegrationTestBase): def extend_a...
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, division, unicode_literals ## ## This is part of Pybble, a WMS (Whatever Management System) based on ## Jinja2/Haml, Werkzeug, Flask, and Optimism. ## ## Pybble is Copyright © 2009-2014 by Matthias Urlichs <matthias@urlichs.de>, ## it is li...