src
stringlengths
721
1.04M
#! /usr/bin/env python #Generate stack from input rasters import os import sys import argparse import numpy as np from pygeotools.lib import malib #Hack to work around file open limit #import resource #resource.setrlimit(resource.RLIMIT_CORE,(resource.RLIM_INFINITY, resource.RLIM_INFINITY)) def getparser(): pa...
#!/usr/bin/env python # -*- coding: utf-8 -*- """check_duplicate_files.py Finds all duplicate files in given directories using a hash-algorithm. After scanning the filesystem for possible duplicate files (all files with a unique filesize are dismissed, except for Images when selecting the perceptual hash algorithm)....
# -*- coding: utf-8 -*- from openprocurement.auctions.core.utils import ( apply_patch, context_unpack, get_now, json_view, opresource, save_auction, ) from openprocurement.auctions.core.validation import ( validate_question_data, validate_patch_question_data, ) from openprocurement.aucti...
# -*- coding: utf-8 -*- # vim:fenc=utf-8 """ trustpaylib =========== TrustPay payment solution constants and utils. """ import sys import hmac import hashlib import collections try: unicode from urllib import urlencode except NameError: def unicode(s): return s from urllib.parse import urlen...
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
''' Created on 21/05/2013 @author: Mads M. Pedersen (mmpe@dtu.dk) ''' import sys from qtpy.QtCore import Signal, Qt from qtpy.QtWidgets import QWidget, QHBoxLayout, QSlider, QApplication, \ QMainWindow, QVBoxLayout, QDoubleSpinBox from mmpe.functions.Decorators import postpone_until_last_call_finishes import num...
# This file is part of thermotools. # # Copyright 2015, 2016 Computational Molecular Biology Group, Freie Universitaet Berlin (GER) # # thermotools 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...
# Generated by Django 2.2.13 on 2020-12-15 21:24 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('styles', '0007_auto_20201109_0112'), ] operations = [ migrations.AlterFie...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Openstack, LLC # Copyright 2012 Nebula, Inc. # Copyright (c) 2012 X.commerce, a business unit of eB...
import os import re import smtplib from email.MIMEMultipart import MIMEMultipart from email.MIMEText import MIMEText from email.MIMEBase import MIMEBase from email import encoders # set your directory for log or anything when you wanna say fuck SET_DIR = os.path.dirname(os.path.abspath(' ')) NAME_FILE = 'log-myisp.txt...
#!/usr/bin/env python3 # Copyright (c) 2017 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test bitcoin-cli""" from test_framework.test_framework import BitcoinTestFramework from test_framework.util ...
import sys, os, re extensions = [ ] templates_path = [ 'templates' ] source_suffix = '.txt' master_doc = 'index' # General information about the project. project = 'wisent' copyright = '2012, Jochen Voss' m = re.search(r'AC_INIT\(wisent, *(([0-9]+\.[0-9]+)[^, ]*),', open("../../configure.ac").read(), ...
#!/bin/env python # -*- python -*- # # Copyright 2003 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at ...
# This file is part of Plex:CS. # # Plex:CS 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. # # Plex:CS is distributed in the hop...
# Modified version of skiplist # http://code.activestate.com/recipes/ # 576930-efficient-running-median-using-an-indexable-skipli/ # import sys from random import random from math import log ispy3k = int(sys.version[0]) >= 3 if not ispy3k: range = xrange __all__ = ['skiplist'] class Node(object): __slo...
""" class ProofType(Enum): merkle_proof_2017 = 0 class SignatureType(Enum): signed_content = 0, signed_transaction = 1 Signature --------- | |-- EmbeddedSignature: signs "contents" directly | |-- TransactionSignature: "contents" are embedded in transaction. Merkle proof for multiple """ import...
# -*- coding: utf-8 -*- # Copyright 2017 Ainara Galdona - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp import models, fields, api class StockQuant(models.Model): _inherit = 'stock.quant' @api.multi @api.depends('lot_id.life_date', 'lot_id.mrp_date') def _co...
# Licensed to Elasticsearch B.V under one or more agreements. # Elasticsearch B.V licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information import aiohttp import datetime import os from fastapi import FastAPI from fastapi.encoders import jsonable_encoder fr...
# Copyright 2018 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...
# tests stolen from https://github.com/martinrusev/django-redis-sessions from django.utils.importlib import import_module from django.conf import settings import time from nose.tools import eq_ session_engine = import_module(settings.SESSION_ENGINE).SessionStore() def test_modify_and_keys(): eq_(session_engine....
#!/usr/bin/env python import sys import re PROTOCOL_ENHANCEMENT = [ 'spf', 'base64', 'sender-id', 'dkim', 'dmarc' ] DOMAIN_VERIFICATION = [ 'google-site-verification', 'office365ms', 'amazonses', 'salesforce-pardot', 'yandex-veri...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
#!/usr/bin/python -tt ##################################################################################################################### # CSE 591: Security and Vulnerability Analysis # # Team 5: # # Kartheek Nallepalli # Bhargavi Rajagopalan # Priya Pipada # Ayush Maheshwari # Nikhil Aourpally # # # This is the dr...
#!/usr/bin/env python # __init__.py ### IMPORTS ### import os import sys import os.path import time import json from datetime import datetime from flask import Flask, g, render_template, request from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy import create_engine from sqlalchemy.orm impo...
from __future__ import unicode_literals from django.conf import settings from daydreamer.tests.views import generic class TestCase(generic.TestCase): """ Common utilities for testing clickjacking view behaviors. Clickjacking middleware is disabled by default with the clickjacking_middleware_ena...
#!/usr/bin/env python from __future__ import print_function from __future__ import absolute_import import argparse import logging import time from zhue.model.bridge import Bridge from yaml import load as yaml_load import requests _LOGGER = logging.getLogger(__name__) def parse_args(): ON_OFF_CHOICE = ['on', '...
# Name: wxlib.py # Purpose: XML handlers for wx.lib classes # Author: Roman Rolinsky <rolinsky@femagsoft.com> # Created: 05.09.2007 # RCS-ID: $Id$ import wx import wx.xrc as xrc import wx.lib.foldpanelbar as fpb from wx.lib.ticker_xrc import wxTickerXmlHandler from wx.tools.XR...
# Copyright (c) 2013, Raphael Kimmig # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this # list of conditions and the fo...
# -*- coding: UTF-8 -*- # Genro # Copyright (c) 2004 Softwell sas - Milano see LICENSE for details # Author Giovanni Porcari, Francesco Cavazzana, Saverio Porcari, Francesco Porcari import os import time, datetime from logging.handlers import TimedRotatingFileHandler from logging import Formatter import logging gnrl...
# -*- coding: utf-8; -*- # # This file is part of Superdesk. # # Copyright 2013, 2014 Sourcefabric z.u. and contributors. # # For the full copyright and license information, please see the # AUTHORS and LICENSE files distributed with this source code, or # at https://www.sourcefabric.org/superdesk/license import os im...
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2013-Today Carlos Eduardo Vercelino - CLVsol # # 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 #...
#This file is part of Tryton. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. from string import Template import time from ..model import ModelView, ModelSQL, fields from ..tools import datetime_strftime from ..pyson import Eval, And from ..transaction imp...
# -*- coding: utf-8 -*- # #################################################################### # Copyright (C) 2005-2010 by the FIFE team # http://www.fifengine.net # This file is part of FIFE. # # FIFE is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public #...
import cgi import json from wsgiref import simple_server import falcon from mclib import mc_info class MCInfo(object): def on_get(self, req, resp): host = req.get_param('host', required=True) port = req.get_param_as_int('port', min=1024, max=65565) ...
import discord from discord.ext import commands from .utils import checks import urllib class SimplyGoogle: """A non sarcastic google command""" def __init__(self, bot): self.bot = bot @commands.command(pass_context=True, no_pm=True) async def google(self, ctx, text): """Its google, y...
# Generated by Django 2.2.13 on 2020-06-29 18:27 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("wagtailcore", "0045_assign_unlock_grouppagepermission"), ("cms", "0024_lettertemplatepage"), ] operations ...
""" Video block for python-markdown This is aimed to provide best output even without this extension Title is case insensitive, title is no use, can also be `[video]`. This is only to avoid the quick reference link Format: [Video: Title of the Video] ![poster](http://link.to.poster/link.png) [download.m...
# -*- coding: utf-8 -*- # Copyright 2007-2011 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
import sys import matplotlib as mpl from matplotlib.backends.backend_agg import FigureCanvasAgg from PyQt4 import QtGui, QtCore from PyQt4.QtCore import * from PyQt4.QtGui import * def mathTex_to_QPixmap(mathTex, fs): #---- set up a mpl figure instance ---- fig = mpl.figure.Figure() fig.patch.set_facec...
import __builtin__ # because we override sorted in this module import pkg_resources def compare(a, b): if a < b: return -1 elif a == b: return 0 else: # a > b return 1 def extract(item): if isinstance(item, dict): version = item['version'] revision = item['...
import sys import os import numpy as np import array class ploadparticles(object): def __init__(self, ns, wdir=None, datatype=None): self.ns = ns if wdir == None: self.wdir = os.getcwd()+'/' else: self.wdir = wdir if datatype == None: dat...
import simtk.unit as units from intermol.decorators import accepts_compatible_units from intermol.forces.abstract_dihedral_type import AbstractDihedralType class ImproperHarmonicDihedralType(AbstractDihedralType): __slots__ = ['xi', 'k', 'improper'] @accepts_compatible_units(None, None, None, None, ...
#encoding: utf-8 import os import sys import glob import re import codecs from difflib import HtmlDiff from recognize import run_main import Levenshtein as L import requests import datetime import multiprocessing from config_manager import Config, run_all_confs_for_page LOGIN_URL = 'https://dhattupages.appspot.com/a...
import gym import numpy as np from humanrl import frame BARRIER_COLOR = [181, 83, 40] BARRIER_ROWS = (157, 175) INITIAL_BARRIER_PIXELS = 336 SHIP_COLOR = [50, 132, 50] SHIP_ROWS = (185, 195) def barrier_damage(image): is_barrier = np.sum(np.abs(image - BARRIER_COLOR), axis=2) == 0 return INITIAL_BARRIER_PIX...
#!BPY # """ # Name: 'YASim (.xml)' # Blender: 245 # Group: 'Import' # Tooltip: 'Loads and visualizes a YASim FDM geometry' # """ __author__ = "Melchior FRANZ < mfranz # aon : at >" __url__ = ["http://www.flightgear.org/", "http://cvs.flightgear.org/viewvc/source/utils/Modeller/yasim_import.py"] __version__ = "0.2" __...
import gensim import logging import os.path class LineCorpus(gensim.corpora.textcorpus.TextCorpus): # Creates the corpus object that reads the document line by line def get_texts(self): with open(self.input) as f: for l in f: yield l.split() logging.basicConfig(format='%(asc...
from django.db import IntegrityError from django.shortcuts import get_object_or_404 from rest_framework.permissions import IsAuthenticated from rest_framework.exceptions import NotFound from rest_framework.response import Response from rest_framework import generics, status from dixit.game.models import Player from ...
from _ProbDistExt import * class SquareMatrix(SquareMatrixBase): #---+----|----+----|----+----|----+----|----+----|----+----|----+----| """ Encapsulates a square matrix of floating point values (underlying C++ implementation stores these as doubles). """ def __init__(self, dimension, v...
#! /usr/bin/env python # -*- coding: utf-8 -*- # eLyXer -- convert LyX source files to HTML output. # # Copyright (C) 2009 Alex Fernández # # 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 Foundat...
# - Class to create a double-linked circular list. from DoubleNode import DoubleNode class DoubleLoopList(): def __init__(self): self.head = None # Master reference to the first item in the list self.tail = None # Master reference...
""" Module simplifying manipulation of XML described at http://libvirt.org/ """ from virttest.libvirt_xml import base, accessors class VolXMLBase(base.LibvirtXMLBase): """ Accessor methods for VolXML class. Properties: name: string, operates on XML name tag uuid: string, operates on uui...
import sys from setuptools import find_packages, setup py_version = sys.version_info[:2] py_version_dotted = '{0.major}.{0.minor}'.format(sys.version_info) supported_py_versions = ('2.7', '3.3', '3.4', '3.5', '3.6') if py_version_dotted not in supported_py_versions: sys.stderr.write('WARNING: django-local-sett...
import base64 import hashlib import os from mediawords.db import DatabaseHandler from mediawords.util.log import create_logger from mediawords.util.perl import decode_object_from_bytes_if_needed __HASH_SALT_PREFIX = "{SSHA256}" __HASH_LENGTH = 64 # SHA-256 hash length __SALT_LENGTH = 64 __MIN_PASSWORD_LENGTH = 8 _...
# coding: utf-8 from __future__ import unicode_literals from itertools import chain import json from mock import Mock import pytest from requests.exceptions import Timeout from six.moves import map # pylint:disable=redefined-builtin from six.moves.urllib.parse import urlencode, urlunsplit # pylint:disable=import-...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org) # 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 witho...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import sys import os from s3stash.nxstashref import NuxeoStashRef from deepharvest.deepharvest_nuxeo import DeepHarvestNuxeo from deepharvest.mediajson import MediaJson from dplaingestion.mappers.ucldc_nuxeo_mapper import UCLDCNuxeoM...
import urllib from io import BytesIO from xml.etree import ElementTree import psycopg2 import requests from entity import Product, Store def create_sql(table, entity): entity_dict = entity.to_dict() columns = ', '.join(entity_dict.keys()) placeholders = ', '.join(f'%({k})s' for k in entity_dict.keys()) inse...
# Copyright 2016 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 unittest #from zope.testing import doctestunit #from zope.component import testing from Testing import ZopeTestCase as ztc from Products.Five import fiveconfigure from Products.PloneTestCase import PloneTestCase as ptc from Products.PloneTestCase.layer import PloneSite ptc.setupPloneSite() import meetshaus.si...
# Copyright 2015 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 a...
def write(x): print(x,end="") class treeprinter: """ Prints an abstract syntax tree as a XML-Document tree has to be instaneceof node (tree is the AST to be printed) """ def __init__(self,tree): self.tree = tree def printt(self): if not self....
import unittest from drastic.models.user import User from drastic.models.group import Group from drastic.models.errors import UserConflictError from nose.tools import raises class UserTest(unittest.TestCase): _multiprocess_can_split_ = True def test_create(self): user = User.create(username="test", ...
import logging import sys try: import pyfire except ImportError: logging.exception("Could not start the campfire backend") logging.fatal(""" If you intend to use the campfire backend please install pyfire: pip install pyfire """) sys.exit(-1) from errbot.backends.base import Message, build...
#!/usr/bin/env python ## This tool runs RAxML's parsimony inference on a phytab input. ## If N = # of nodes requested in job runner, then N RAxML jobs will run simultaneously. Make sure that the ## number of processors ('ppn') in the job runner matches the 'numthreads' commandline argument -T. ## ## Usage: ./ph...
from django.core.management.base import BaseCommand from datasets.models import * from django.db import transaction import sys import json from datasets.utils import stem def chunks(l, n): """Yield successive ``n``-sized chunks from ``l``. Examples: >>> chunks([1, 2, 3, 4, 5], 2) #doctest: +ELLIPSIS ...
# Copyright 2016, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
# # 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...
#!/usr/bin/python # -*- coding: utf-8 -*- import click from shellfoundry.utilities.config.config_context import ConfigContext from shellfoundry.utilities.config.config_file_creation import ConfigFileCreation from shellfoundry.utilities.config.config_providers import ( GlobalConfigProvider, LocalConfigProvider...
from django.db import models from django.utils.functional import cached_property as buffered_property from django.utils import timezone class Category(models.Model): name = models.CharField(max_length=32) def __str__(self): return self.name class Feature(models.Model): name = models.CharField(m...
#!/usr/bin/env python # Based on code by Kirk Strauser <kirk@strauser.com> # Rev: 1139; Date: 2008-04-16 # (also see code in pathos.pp) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of so...
""" module of functions for testing mesh data """ __author__ = "Bence Somogyi" __copyright__ = "Copyright 2014" __version__ = "0.1" __maintainer__ = "Bence Somogyi" __email__ = "bencesomogyi@ivt.tugraz.at" __status__ = "Prototype" import numpy import pyCFD_VTK_tools.vtkTools as vtkTools def write_element...
"""Define `lrange.lrange` class `xrange`, py3k's `range` analog for large integers See help(lrange.lrange) >>> r = lrange(2**100, 2**101, 2**100) >>> len(r) == 1 True >>> for i in r: ... print i, 1267650600228229401496703205376 >>> for i in r: ... print i, 1267650600228229401496703205376 >>> 2...
# -*- coding: utf-8 -*- """ Copyright [2009-2017] EMBL-European Bioinformatics Institute 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...
#!/usr/bin/python # -*- coding: utf-8 -*- """ This file is part of XBMC Mega Pack Addon. Copyright (C) 2014 Wolverine (xbmcmegapack@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 Softwar...
#!/usr/bin/python # -*- coding: UTF-8 -*- # --------------------------------------------------------------------------- # ___ __ ___ ___ ____ ____ __ # | \ | \ | | / | | | \ Automatic # |__/ |__/ | | | |__ |__ | | Conference # | |\...
#------------------------------------------------------------------------------- # Name: mapper_amsre_UHAM_lead_fraction.py # Purpose: # # Author: Morten Wergeland Hansen # Modified: Morten Wergeland Hansen # # Created: 18.02.2015 # Last modified:24.02.2015 09:26 # Copyright: (c) NERSC # License: #-----------...
#!/usr/bin/python # -*- coding: utf-8 -*- import sys from analyser import Analyser from generator import DataGenerator, convert_pin from ic_parser import load_line from classes import Chip OPTIMIZE_CMD_ALL = True # использовать CMD_SET_ALL вместо CMD_SET OPTIMIZE_CMD_TEST = True # использовать...
#!/usr/bin/env python3 # Copyright (c) 2017 The Doriancoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Check RPC argument consistency.""" from collections import defaultdict import os import re import sys #...
""" Flask-SphinxSearch ------------- Flask extension to work with the Sphinx search engine (http://sphinxsearch.com/) """ from setuptools import setup setup( name='Flask-SphinxSearch', version='0.1', url='https://github.com/matchbox/flask-sphinxsearch/', license='Apache', author='Paul Swartz', ...
# Copyright 2020 DeepMind Technologies Limited. 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 a...
from setuptools import setup, Extension from Cython.Distutils import build_ext # This line only needed if building with NumPy in Cython file. from numpy import get_include from os import system import os # compile the fortran modules without linking module_list = [ 'parkind.f90', 'parrrtm.f90', 'rrlw_cld.f...
#!/usr/bin/python # This file is part of AutoPA - automatic extraction of pre-aspiration # from speech segments in audio files. # # Copyright (c) 2016 Yaniv Sheena import os import re import sys import numpy as np if __name__ == "__main__": if len(sys.argv) != 2: raise ValueError("expected 1 value - r...
# Copyright (c) 2012 Santosh Philip # ======================================================================= # Distributed under the MIT License. # (See accompanying file LICENSE or copy at # http://opensource.org/licenses/MIT) # ======================================================================= """ script to ...
#!/usr/bin/python3 # -*- coding: utf-8 -*- '''Pychemqt, Chemical Engineering Process simulator Copyright (C) 2009-2017, Juan José Gómez Romera <jjgomera@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 Softwar...
# Spirit of Ryuu # 2017/8/15 # Kevin import time import tensorflow as tf import numpy as np import gzip import _pickle as cPickle from mnist_to_tf import load_from_minst from abc import ABCMeta, abstractmethod, abstractproperty from tensorflow.python.client import timeline from merge_tracing import * class ISNNLayer(...
# Copyright 2016 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest import loading_graph_view import request_dependencies_lens from request_dependencies_lens_unittest import TestRequests class MockContentCl...
from django.contrib.contenttypes.models import ContentType from . import models class TurnGeneration(object): realm_types = { 'testrealm': 'sample_app.testrealm', } agent_types = { 'testagent': 'sample_app.testagent', } permissions = { 'turngeneration.add_generator': '_i...
import json from django.conf import settings from django.test import TestCase from django.core.cache import cache import mock from nose.tools import ok_, eq_ from airmozilla.base import mozillians from airmozilla.base.tests.testbase import Response VOUCHED_FOR_USERS = """ { "count": 1, "next": null, "results...
# Copyright (C) 2010-2011 Richard Lincoln # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish...
# -*- coding: utf-8 -*- """ brickv (Brick Viewer) Copyright (C) 2009-2012 Olaf Lüke <olaf@tinkerforge.com> Copyright (C) 2012-2014 Matthias Bolte <matthias@tinkerforge.com> Copyright (C) 2014 Philipp Kroos <philipp.kroos@fh-bielefeld.de> tab_window.py: Detachable container to be used in a TabBar (e.g. TabWidget) This...
from collections import OrderedDict from multiprocessing import Array from multiprocessing.connection import Connection import numpy as np import pyaudio from urh.dev.native.Device import Device from urh.util.Logger import logger class SoundCard(Device): DEVICE_LIB = pyaudio ASYNCHRONOUS = False DEVICE_...
# Copyright NuoBiT Solutions, S.L. (<https://www.nuobit.com>) # Eric Antones <eantones@nuobit.com> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) from odoo import models, fields from odoo.addons.component.core import Component from odoo.addons.queue_job.job import job class PayrollSageLabourAgreemen...
import torch import torch.nn as nn import torchvision import torchvision.transforms as transforms # Device configuration device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') # Hyper-parameters sequence_length = 28 input_size = 28 hidden_size = 128 num_layers = 2 num_classes = 10 batch_size = 100 nu...
""" Author: Joshua Chen Date: 2015-12-30 Location: Shenzhen Desc: Application that makes use of the acl library to maintain a View database. """ from lib import * from acl import * import re import sys class View: """ Represents a view entry in the view database. When we process the view config, only the view...
# orm/deprecated_interfaces.py # Copyright (C) 2005-2012 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from sqlalchemy import event, util from .interfaces import EXT_CONTINUE ...
from ctypes import cdll, c_int, CFUNCTYPE, POINTER, pointer, c_ubyte from enum import Enum, IntEnum from ..util import get_config from .utils import Wrapper libwiringpi = Wrapper('/usr/local/lib/libwiringPi.so.2.32') wiringPiISR_cb = CFUNCTYPE(None) wiringPiPiSPIDataRW_data = POINTER(c_ubyte) class PinModes(IntE...
import sys import os import numpy as np import scipy.sparse as sp import scipy.sparse.linalg as spla from .. import N, solve, ones, flatten_sparse_matrix, diag_add, dot import pytest this_dir = os.path.dirname(__file__) sys.path.insert(0, os.path.join(this_dir, os.pardir)) DTYPES = ['f8', np.complex128] @pytest....
# # Copyright 2016-2019 Crown Copyright # # 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 i...
# -*- coding: utf-8 -*- # Third Party Stuff from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( ...
#!/usr/bin/env python """ heatsequer heatmap plot module """ # amnonscript from __future__ import absolute_import __version__ = "0.9" import heatsequer as hs import sys import numpy as np import matplotlib as mpl mpl.use('Qt5Agg') import matplotlib.pyplot as plt #from matplotlib.pyplot import * def plotexp(ex...