src
stringlengths
721
1.04M
import unittest import sys from mantid.kernel import ConfigService, ConfigPropertyObserver if sys.version_info.major == 2: import mock else: from unittest import mock class ConfigObserverTest(unittest.TestCase): def setUp(self): self.config = ConfigService.Instance() self._search_director...
from django.contrib.auth.models import User from django.test import TestCase, Client import json from binder.json import jsonloads from django.test import TestCase from .testapp.models import Animal, ContactPerson, Zoo class M2MStoreErrorsTest(TestCase): """ (T30296) When model saving fails due to model validati...
#!/usr/bin/env python # Copyright 2017 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...
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals from datetime import datetime, date from decimal import Decimal from base import GAETestCase from recommendation_app.model import Recommendation from routes.recommendations import rest from gaegraph.model import Node from mock import Mock ...
# coding=utf-8 # Copyright 2020 The TensorFlow GAN Authors. # # 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 applicabl...
import datetime, sys from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.utils.timezone import utc from tendo import singleton from archive_chan.models import Board, Update from archive_chan.lib.scraper import BoardScraper from archive_chan.settings import A...
""" Tests for pika.connection.Connection """ # Suppress pylint warnings concerning access to protected member # pylint: disable=W0212 # Suppress pylint messages concerning missing docstrings # pylint: disable=C0111 # Suppress pylint messages concerning invalid method name # pylint: disable=C0103 try: import mo...
# An opaque Data class with Base encoding and decoding functionality # ----------------------------------------------------------------------------- # A collection of classes for storing binary data and converting it into # various base-encoded strings for text representations useful for # over-the-wire transmission. #...
# Copyright (c) 2014 Oscar Campos <oscar.campos@member.fsf.org> # See LICENSE for details import re import sys import urlparse try: import cPickle as pickle except ImportError: import pickle try: import cStringIO as StringIO except ImportError: from StringIO import StringIO _queryprog = None def...
""" AJAX for Registry Viewer plugin """ from yapsy.IPlugin import IPlugin from flask import Response from Registry import Registry import binascii import json import logging class FaRegviewAjax(IPlugin): def __init__(self): self.display_name = 'Regview Ajax' self.popularity = 0 self.cache...
# -*- coding: utf-8 -*- import os import sys root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) sys.path.append(root + '/python') import ccxt # noqa: E402 exchange = ccxt.kraken({ 'apiKey': 'YOUR_API_KEY', 'secret': 'YOUR_API_SECRET', 'enableRateLimit': True, # requir...
""" This module calculates transfer matrix optics. Basic usages look like this: :: # Setup the layers layers = ['Air', 'SiO2_2', 'TiO2_2', 'GaAs_2'] # Assign the thickness to each layer. # Assuimg the first and the last layers are infinite. thicknesses = [0, 170, 135, 300] tm_layer = TM...
''' Programa basado en el trabajo de Daniel Bates http://www.cl.cam.ac.uk/~db434/ cuyo codigo fuente se puede ver en: http://www.cl.cam.ac.uk/~db434/files/setblockdemo.py ''' from math import sin, cos, radians,degrees, sqrt, pow , acos class coordinate3d: """Class used to represent a point in 3D space.""" def __...
from abc import ABCMeta, abstractmethod, abstractproperty import Wire ############################################################### # Abstract Chip Class #AbstractMethod Action: What function the chip performs #AbstractProperty Name: Debugging tool retrieving the name of the chip ###################...
# -*- coding: utf-8 -*- import scrapy import json from getComment.items import GetcommentItem import codecs #需要加入cookie,不然有些页面没有权限 class GetcommentSpider(scrapy.Spider): name = "getComment" allowed_domains = ["douban.com"] cookie={ '__utma':"30149280.901747088.1445074673.1463148044.1463205092.69", ...
# -*- coding:utf-8 -*- """ DATA MODEL This module will encapsulate all the DB operations It has the creation scrript, DAOs to encapsulte sql and , a few helper clases that represent the objects modeld in the DB that will be used by the webservices, """ import datetime import sqlite3 as lite ##################### ...
def make_contact_sheet(fnames,(ncols,nrows),(photow,photoh), (marl,mart,marr,marb), padding): """\ Make a contact sheet from a group of filenames: fnames A list of names of the image files ncols Number of columns in the contact sheet n...
#! /usr/bin/python -u # (Note: The -u disables buffering, as else we don't get Julius's output.) # # Command and Control Application for Julius # # How to use it: # julius -quiet -input mic -C julian.jconf 2>/dev/null | ./command.py # # Copyright (C) 2008, 2009 Siegfried-Angel Gevatter Pujals <rainct@ubunt...
import cv import cv2 import numpy as np import math def get_features (cnt, approx = 5): return cv2.approxPolyDP (cnt, approx, False) def simplify_feature (feature): simple = [] prev = None for v in feature: dist = 5000 if prev is not None: dist = np.linalg.norm (v - prev) if dist > 2: simple.append (...
import random import parameters import track import obstacle class LevelGenerator: def __init__(self, zfinish, nx, ny): self.zfinish = zfinish self.nx = nx self.ny = ny self.track = track.Track(zfinish,nx,ny) parameters.scene.track = self.track def add_static_obstacle...
""" General utility methods """ from __future__ import (absolute_import, division, print_function, unicode_literals) import errno from functools import wraps import os from future.builtins import ( # noqa bytes, dict, int, list, object, range, str, ascii, chr, hex, input, next, oct, ope...
# # 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...
"""Test parameters description""" import pytest from ocelot import * """lattice elements descripteion""" Q1 = Quadrupole(l=0.4, k1=-1.3, eid="Q1") Q2 = Quadrupole(l=0.8, k1=1.4, eid="Q2") Q3 = Quadrupole(l=0.4, k1=-1.7, eid="Q3") Q4 = Quadrupole(l=0.5, k1=1.19250444829, eid="Q4") B = Bend(l=2.7, k1=-.06, angle=2*p...
import json from django import forms from django.core import validators from django.core.exceptions import ValidationError from django.utils.text import format_lazy from django.utils.translation import ugettext_lazy as _ from django_mysql.validators import ( ListMaxLengthValidator, ListMinLengthValidator, ...
#!/usr/bin/python # # Copyright (c) 2011 Rime Project. # # 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, m...
# -*- coding: utf-8 -*- """tastyc configuration module""" import copy import sys import os.path from ast import * import gc from tasty import state from tasty.exc import TastySyntaxError from tasty.types import * from tasty.tastyc import bases from tasty.tastyc.codegen import to_source from tasty.tastyc.analyzati...
#!/usr/bin/env python2 """ Syncthing-GTK - FolderEditorDialog Universal dialog handler for all Syncthing settings and editing """ from __future__ import unicode_literals from gi.repository import Gtk, Gdk from syncthing_gtk.tools import check_device_id from syncthing_gtk.editordialog import EditorDialog, strip_v from...
# Copyright (c) 2021, Manfred Moitzi # License: MIT License from typing import Dict, TYPE_CHECKING, cast import math import ezdxf from time import perf_counter from ezdxf.math import Vec3, Matrix44, X_AXIS, OCS from ezdxf import zoom, disassemble from ezdxf.entities import copy_attrib_as_text if TYPE_CHECKING: fr...
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2018-07-27 07:36 from __future__ import unicode_literals import address.models from django.db import migrations, models import django.db.models.deletion import taggit.managers class Migration(migrations.Migration): initial = True dependencies = [ ...
''' Created on 1.12.2016 @author: Darren '''''' from leetcode.BinaryTreeMaximumPathSum import Solution Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. top() -- Get the top element. ...
""" Page objects for UI-level acceptance tests. """ import os from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise, BrokenPromise ORA_SANDBOX_URL = os.environ.get('ORA_SANDBOX_URL') class PageConfigurationError(Exception): """ A page object was not configured correctly. """ ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: resnet-dorefa.py import argparse import numpy as np import os import cv2 import tensorflow as tf from tensorpack import * from tensorpack.dataflow import dataset from tensorpack.tfutils.varreplace import remap_variables from dorefa import get_dorefa from imagenet...
# FermiLib plugin to interface with Psi4 # # Copyright (C) 2017 ProjectQ-Framework (www.projectq.ch) # # This program 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 License, or ...
# Copyright (c) 2019, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
# 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
import re class CourseException(Exception): def __init__(self, msg, err): super(CourseException, self).__init__() self.msg = msg self.err = err def __str__(self): return "CourseError : " + self.msg def __repr__(self): return '<CourseException msg : "%s", errcode :...
import collections import sys from .compat import recursive_repr, abc from _pmem import ffi # XXX refactor to make this import unneeded? # XXX: refactor to allocate this instead of hardcoding it. LIST_POBJPTR_ARRAY_TYPE_NUM = 30 class PersistentList(abc.MutableSequence): """Persistent version of the 'list' ...
# ----------------------------------------------------------------------------- # Copyright (c) 2014--, The Qiita Development Team. # # Distributed under the terms of the BSD 3-clause License. # # The full license is in the file LICENSE, distributed with this software. # ------------------------------------------------...
import sys import pygame import os import inspect from pygame.locals import * currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(currentdir) sys.path.insert(0,parentdir) from scripts import player from scripts import background from scripts import projec...
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import collections f...
""" Testing that we work in the downstream packages """ import importlib import subprocess import sys import numpy as np # noqa import pytest from pandas.compat import PY36 from pandas import DataFrame from pandas.util import testing as tm def import_module(name): # we *only* want to skip if the module is tru...
# pylint: disable=missing-docstring import logging import requests from games.models import Game, Genre from games.util.steam import get_store_info, create_steam_installer from platforms.models import Platform from common.util import slugify LOGGER = logging.getLogger(__name__) def run(): response = requests.get...
#This code modifies a language identified gold standard from a 2-tag system (Eng|Span) to a 3-tag system(Eng|Span|Other) #INPUT csv file with TOKEN, POS, LANG ##Lang = Eng | Span ##delimiter= , quotechar= " #OUTPUT csv with TOKEN, POS, Lang ##Lang = Eng | Span | Other ##delimiter= , quotechar= " ##file name = i...
#!/usr/bin/env python2.7 import cgi import json import os import SimpleHTTPServer import SocketServer import subprocess import sys import threading VERSION = 'v0.4.11' hostname = '' try: command = "bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || wget -q -O - icanhazip.com'" hostname = subprocess....
""" Classes for implementing the coefficients of transport equations. TC_base defines the interface. The classes derived from TC_base in this module define common PDE's. .. inheritance-diagram:: proteus.TransportCoefficients :parts: 1 """ from __future__ import print_function from __future__ import absolute_import...
#would like to use difflib here eventually hashLine = ('#' * 80) + '\n' class Verify(object): def str_equal(self, expected, actual, errMessage=None): if self == expected: return if expected is None: raise AssertionError("{0} expected is None".format(errMessage)) i...
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import print_function import sys from collections import Iterable from collections import MutableMapping from collections import defaultdict from decimal import Decimal from hashlib import sha1 import logging from deep...
import io import socket import struct import time import picamera # Connect a client socket to my_server:8000 (change my_server to the # hostname of your server) client_socket = socket.socket() client_socket.connect(('169.254.251.208', 8000)) # Make a file-like object out of the connection connection = client_socket....
""" send documents representing object data to elasticsearch for supported file extensions. note: we truncate outbound documents to DOC_SIZE_LIMIT characters (to bound memory pressure and request size to elastic) a little knowledge on deletes and delete markers: if bucket versioning is on: - `aws s3api delete-obje...
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
from django.shortcuts import redirect from django.views.generic import ListView, CreateView, DeleteView, DetailView from django.core.urlresolvers import reverse from .models import Journey from .forms import CreateJourneyForm # Create your views here. class JourneyList(ListView): model = Journey template_...
#!/usr/bin/python import sys from nwb import nwb_file from nwb import nwb_utils as utils """ Example extending the format: using MyNewTimeSeries type. This example uses an extension specified in file "examples/e-timeseries.py". The extension specified in that file defines a new type of TimeSeries (named "MyNewTimeSer...
"""All serializers for the extension.""" import json from django.core.exceptions import ValidationError from django.contrib.gis.geos import Point from django.utils import timezone from django.utils.dateparse import parse_datetime from rest_framework.serializers import BaseSerializer from geokey_airquality.models im...
#@+leo-ver=5-thin #@+node:2014fall.20141212095015.1775: * @file wsgi.py # coding=utf-8 # 上面的程式內容編碼必須在程式的第一或者第二行才會有作用 ################# (1) 模組導入區 # 導入 cherrypy 模組, 為了在 OpenShift 平台上使用 cherrypy 模組, 必須透過 setup.py 安裝 #@@language python #@@tabwidth -4 #@+<<declarations>> #@+node:2014fall.20141212095015.1776: ** <<declar...
import math as m import numpy as np import scipy.sparse as sparse from scipy.sparse.linalg import spsolve import time import matplotlib.pylab as plt def ffunc_constant(x, a): """ Constant valued forcing function :param x: point at which to evaluate the forcingg function :param a: parameter values, in t...
""" This page is in the table of contents. Gcode step is an export plugin to convert gcode from float position to number of steps. An export plugin is a script in the export_plugins folder which has the getOutput function, the globalIsReplaceable variable and if it's output is not replaceable, the writeOutput function...
import StringIO from twisted.trial import unittest from opennsa import nsa from opennsa.topology import gole from . import topology as testtopology TEST_PATH_1 = { 'source_stp' : nsa.STP('Aruba', 'A2'), 'dest_stp' : nsa.STP('Curacao', 'C3'), 'paths' : [ [ nsa.Link('Aruba', 'A2', 'A4'), nsa.Link...
from pandas import read_csv, concat, DataFrame print('Reading database...') tp = read_csv('merged_2014-2016.txt', header=0, sep='\t', iterator=True, chunksize=10000, encoding='cp1252', error_bad_lines=False) print('Concatenating database...') db = concat(tp, ignore_index=True) print("Number of grant entries in the da...
from sqlalchemy import Integer, String, ForeignKey, func, desc, and_, or_ from sqlalchemy.orm import interfaces, relationship, mapper, \ clear_mappers, create_session, joinedload, joinedload_all, \ subqueryload, subqueryload_all, polymorphic_union, aliased,\ class_mapper from sqlalchemy import exc as sa_exc...
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2019, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
#! /usr/bin/env python # -*- coding: UTF8 -*- """ ############################################################ Graphic handling classes ############################################################ :Author: *Carlo E. T. Oliveira* :Contact: carlo@nce.ufrj.br :Date: 2014/09/17 :Status: This is a "work in progress" :Revis...
import abc import logging import numpy as np import torch import torch.nn.functional as F from torch import nn as nn import rlkit.torch.pytorch_util as ptu from rlkit.policies.base import ExplorationPolicy from rlkit.torch.core import torch_ify, elem_or_tuple_to_numpy from rlkit.torch.distributions import ( Delta...
# -*- coding: utf-8 -*- # # gPrime - A web-based genealogy program # # Copyright (C) 2013 Vassilii Khachaturov # # 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 Lic...
"""Collect hourly event announcements for PSO2 Take announcement data from a third party source, convert it into a string, and store it for later reads. Update at least once before reading. """ # The current source is already translated into English. In the event that the # flyergo source is discontinued, this module...
# 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...
""" Desky ----- Wrap your web app in desktop frame """ import sys, subprocess import socket import time from PyQt4.Qt import * import json MAX_PORT_SCAN_TRIES = 10 # 20 secs def print_help(): """ Prints help for commands """ print "Usage : `python desky.py` for running app" print "`python desky.py pack` fo...
#!/usr/bin/env python # Based on the script found here: http://cloudbuzz.wordpress.com/2011/02/15/336/ import boto.ec2 csv_file = open('instances.csv','w+') def process_instance_list(connection): map(build_instance_list,connection.get_all_instances()) def build_instance_list(reservation): map(write_instances,r...
from redlock import RedLock import time def test_default_connection_details_value(): """ Test that RedLock instance could be created with default value of `connection_details` argument. """ lock = RedLock("test_simple_lock") def test_simple_lock(): """ Test a RedLock can be acquired. ...
# Copyright (C) 2010, Walter Bender, Sugar Labs # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is di...
"""Test save graph on VT and get links.""" import pytest import vt_graph_api import vt_graph_api.errors test_graph = vt_graph_api.VTGraph( "Dummy api key", verbose=False, private=False, name="Graph test", user_editors=["agfernandez"], group_viewers=["virustotal"]) def test_save_graph(mocker): """Test sa...
from django.conf import settings from django.db import models from django.utils import timezone from djmoney.models.fields import MoneyField from jsonfield import JSONField from phonenumber_field.modelfields import PhoneNumberField from orchestra.models.core.mixins import CertificationMixin from orchestra.models.core.m...
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from colle...
# 151 currencies, 22650 currency pairs, 364 days (period 1) 134 days (period 2) => 3,035,100(20,100/from_c) - 8,221,950 entries(8361.157) print('importing packages') import time import sqlite3 import json import requests import datetime import math import pytz from datetime import date from multiprocessing.pool impor...
#!/usr/bin/env python # -*- coding: utf-8 -*- from setuptools import setup with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() requirements = [ 'Click>=6.0', # TODO: put package requirements here ] test_requirem...
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations ######################################################################### ## This is a sample controller ## - index is the default action of any application ## - user is required for authentication and authorization...
# Fuck you Disyer. Stealing my fucking paypal. GET FUCKED: toontown.coghq.DistributedCogHQExteriorDoor from direct.interval.IntervalGlobal import * from direct.distributed.ClockDelta import * from toontown.toonbase import ToontownGlobals from direct.directnotify import DirectNotifyGlobal from direct.fsm import Cla...
############################################################################## # 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...
from abstract.event_manager import EventManager, Mods from pygame import locals as const from ship import Ship # Missing Mouse button constants const.MOUSEKEY_LEFT = 1 const.MOUSEKEY_MIDDLE = 2 const.MOUSEKEY_RIGHT = 3 const.MOUSEKEY_SCROLLUP = 4 const.MOUSEKEY_SCROLLDOWN = 5 # Start up our pause_handler pause_hand...
import sys, os import pygame from pygame.locals import * from pygame.color import * from gamelib import data class Spritesheet: def __init__(self, filename): self.sheet = pygame.image.load(os.path.join('data',filename)).convert() def imgat(self,rect,colorkey=None): rect = Rect(rect) image = pygame.Surface(rect....
# Configuration file for ipython. c = get_config() #------------------------------------------------------------------------------ # InteractiveShellApp configuration #------------------------------------------------------------------------------ # A Mixin for applications that start InteractiveShell instances. # #...
#!/usr/bin/env python # -*- coding: utf-8 -*- import math, random, sys from cStringIO import StringIO from ZODB.utils import p64, u64 from ZODB.BaseStorage import TransactionRecord from ZODB.FileStorage import FileStorage # Stats of a 43.5 GB production Data.fs # µ σ # size of ob...
''' Created on 13/07/2014 @author: Alex Montes Barrios ''' import math class gledajfilmDecrypter: def __init__(self, param1, param2): _loc3_ = False; _loc4_ = True; self.Rcon = [1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145]; ...
# encoding: utf-8 # # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Contact: Kyle Lahnakoski (kyle@lahnakoski.com) # from __future__ import unicode_literals impor...
import sys from osgbench import * def usage(): print "usage." return -1 def main(argv=sys.argv): if len(argv) != 2: return usage() filename = argv[1] print "Loading %s..." % filename scene = loadScene(filename) print "Traversing..." travscene = scene.clone() g = createGr...
from django import template from ebooklib import epub register = template.Library() def posts_epub_link(posts): book = epub.EpubBook() # add metadata book.set_title('Articles de Vincent Jousse') book.set_language('fr') book.add_author('Vincent Jousse') for post in posts: print pos...
############################################################################## # # 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 ...
import tensorflow as tf import copy class ImagePool: def __init__(self, pool_size): self.pool_size = pool_size if self.pool_size > 0: self.num_imgs = 0 self.images = [] def query(self, images): if self.pool_size == 0: return images ret_imgs ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals import sys from intelmq.lib import utils from intelmq.lib.bot import Bot from intelmq.lib.message import Event class DansParserBot(Bot): def process(self): report = self.receive_message() if report is None or not report.contains("r...
import logging import os import numpy as np import pandas as pd from logutils import BraceMessage as __ from tqdm import tqdm import simulators from mingle.models.broadcasted_models import two_comp_model from mingle.utilities.chisqr import chi_squared from mingle.utilities.phoenix_utils import load_starfish_spectrum ...
""" Sequence preprocessing functionality. Extends sklearn transformers to sequences. """ import numpy as np from sklearn.base import ClassifierMixin, BaseEstimator, TransformerMixin, clone from sklearn.model_selection import GridSearchCV, train_test_split from sklearn.pipeline import make_pipeline from sklearn.prepro...
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2015-2021 GEM Foundation # # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Licen...
from scipy.signal.signaltools import _next_regular from matplotlib import pyplot as plt from numpy.fft import fft, rfftn, irfftn, fftshift # for real data can take advantage of symmetries import numpy as np import codecs, json # from scipy.signal import remez, freqz, lfilter # lpf = remez(21, [0, 0.2, 0.3, 0.5], [1.0, ...
# -*- coding: utf-8 -*- from nose.tools import * # flake8: noqa from framework.auth.core import Auth from website.models import Node, NodeLog from website.util import permissions from website.util.sanitize import strip_html from api.base.settings.defaults import API_BASE from tests.base import ApiTestCase, fake fr...
#!/bin/env python # Automatically translated python version of # OpenSceneGraph example program "osggeometryshaders" # !!! This program will need manual tuning before it will work. !!! import sys from osgpypp import osg from osgpypp import osgViewer # Translated from file 'osggeometryshaders.cpp' # OpenSceneGrap...
ELEMENTS_ELECTRONS = { "H":1, "HE":2, "LI":3, "BE":4, "B":5, "C":6, "N":7, "O":8, "F":9, "NE":10, "NA":11, "MG":12, "AL":13, "SI":14, "P":15, "S":16, "CL":17, "AR":18, "K":19, "CA":20, "SC":21, "TI":22, "V":23, "CR":24, "MN":25, "FE":26, "CO":27, "NI":28, "CU":29, "ZN":30, "GA":31, "GE":32, "AS":33, "SE":3...
from django.contrib import admin from apps.congress.models import Edition, Company, Speaker, Tag, Track, ActivityFormat, Activity class TagAdmin(admin.ModelAdmin): search_fields = ["name"] class EditionAdmin(admin.ModelAdmin): list_display = ["start", "end", "name", "description"] search_fields = ["nam...
# -*- coding: utf-8 -*- """ g_octave.info ~~~~~~~~~~~~~ This module implements a Python object to store the external dependencies and the licenses as named on the gentoo-x86 tree. :copyright: (c) 2010 by Rafael Goncalves Martins :license: GPL-2, see LICENSE for more details. """ from __futur...
#!/usr/bin/python import re import time import sys import os work_path = '/home/vpu_data' def to_unix(date): if len(date) < 14: date = date + '0' * (14 - len(date)) return int(time.mktime(time.strptime(date, "%Y%m%d%H%M%S"))) def convert(file_name): hex_num = re.findall(r'/(\w{16})_', file_name...
# Copyright 2014-2015, Damian Johnson and The Tor Project # See LICENSE for licensing information """ Handles making requests and formatting the responses. """ import code import socket import stem import stem.control import stem.descriptor.remote import stem.interpreter.help import stem.util.connection import stem....
# Authored by Tan Tack Poh # Logo recognition algorithm (SIFT Feature Detection) for Bill.eGoat # import libraries import os import sys import getopt import numpy as np import cv2 from matplotlib import pyplot as plt """ This function initiates the SIFT detector, which relies on keypoints, descriptors and mat...