src stringlengths 721 1.04M |
|---|
'''
AUDIO CLASSICAL COMPOSER IDENTIFICATION BASED ON:
A SPECTRAL BANDWISE FEATURE-BASED SYSTEM
'''
import essentia
from essentia.standard import *
import glob
import numpy as np
import arff
from essentia.standard import *
from scipy import stats
# Dataset creation with specific attributes (spectral features) and a s... |
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 20 10:51:13 2016
@author: noa
"""
# Theoretical time evolution of minijet gradient
def theory(M):
return np.arctan((1.0 - np.cos(M))/(2.0 * np.sin(M) - 1.5 * M)) * 180.0 / np.pi
# Currently uses graphical comparison method - inefficient and slow
# Also accuracy dep... |
#!/usr/bin/env python
######################
from __future__ import with_statement
import unittest, sys, math, re, os, optparse
import numpy, astropy, astropy.io.fits as pyfits
from scipy import interpolate
import ldac, utilities
######################
__cvs_id__ = "$Id: measure_unstacked_photometry.py,v 1.15 2010-0... |
# -*- coding: utf-8 -*-
from django.forms import ModelForm, TextInput
from django.utils.translation import ugettext_lazy as _
from markitup.widgets import MarkItUpWidget
from taggit.forms import TagWidget
from common.forms import ModelFormRequestUser
from models import Method, MethodBonus
class MethodForm(ModelFormR... |
# ./sedater/test/test_options.py
# Author: Ulli Goschler <ulligoschler@gmail.com>
# Created: Mon, 05.10.2015 - 12:59:56
# Modified: Thu, 10.12.2015 - 19:41:38
import unittest
from sedater.options import CLIParser
class TestCommandLineParameters(unittest.TestCase):
def setUp(self):
self.cli = CLIParse... |
# -------------------------------------------------------------------------------
# Name: Perennial Network
# Purpose: Script generates perennial network using NHD data inputs
#
# Author: Sara Bangen (sara.bangen@gmail.com)
#
# ----------------------------------------------------------------------------... |
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.5'
# jupytext_version: 1.8.0
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# +
import importlib
from sklearn.datasets import load... |
class Node:
def __init__(self, value):
self.value = value
self.left = None
self.right = None
class BinaryTree(object):
def __init__(self, root_val):
self.root = Node(root_val)
def preorder_traversal(self, start, traversal):
""" Root -> left -> right """
if... |
import numpy as np
# from matplotlib import pyplot as plt
from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtGui import *
class RVLoadHistogram(QGraphicsView):
'''A histogram for the maximum load across the reachable area'''
def __init__(self, ik):
width = 330
height = 120
... |
import os
import sys
import xml.sax.handler
import xml.sax
import codecs
import re
import time
import json
reload(sys)
sys.setdefaultencoding('utf8')
releaseCounter = 0
if ( __name__ == "__main__"):
trackslength = []
#trackoffsets = []
disclength = []
prevcombinenum = ''
trackcombinenum = ''
par... |
import tornado
from tornado.httpclient import HTTPRequest
from tornado.web import Application
from tornado.websocket import websocket_connect
from tornado.testing import AsyncHTTPTestCase, gen_test
def message_processed_callback(*args, **kwargs):
print 'Callback(args=%r, kwargs=%r)' % (args, kwargs)
class Realt... |
"""A community solution object."""
import numpy as np
import pandas as pd
from optlang.interface import OPTIMAL
from cobra.core import Solution, get_solution
def _group_species(values, ids, species, what="reaction"):
"""Format a list of values by id and species."""
df = pd.DataFrame({values.name: values, wha... |
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... |
# -*- coding: utf-8 -*-
import re
import os
import datetime
import pytz
import scrapelib
import lxml.html
from pupa.scrape import Scraper, Bill, VoteEvent
from pupa.utils import convert_pdf
from ._utils import canonicalize_url
session_details = {
'100th-special': {
'speaker': 'Madigan',
'preside... |
# coding: utf-8
# In[1]:
# Alexander Hebert
# ECE 6390
# Computer Project #2
# In[2]:
# Tested using Python v3.4 and IPython v2
##### Import libraries
# In[3]:
import numpy as np
# In[4]:
import scipy
# In[5]:
import sympy
# In[6]:
from IPython.display import display
# In[7]:
from sympy.interactiv... |
# © 2019 James R. Barlow: github.com/jbarlow83
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import sys
from pathlib import Path
from subprocess import D... |
# -*- coding: UTF-8 -*-
import sys
from setuptools import find_packages, setup
_version = '0.2.5'
_packages = find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"])
_short_description = ("pylint-common is a Pylint plugin to improve Pylint "
"error analysis of the standard Python li... |
# coding=utf8
# Copyright (c) 2016 Strack
import os
import warnings
from tempfile import mkdtemp
import logging
import cgtk_log
log = cgtk_log.cgtk_log(level=logging.INFO)
class TemporaryDirectory(object):
"""
Create and return a temporary directory. This has the same
behavior as mkdtemp but can be use... |
# 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 use ... |
from .feature import Feature
from urllib import request
import os
import cv2
import dlib
import numpy as np
from .. import utils
class ROIFeature(Feature):
r"""
Mouth ROI Extraction pipeline using OpenCV and dlib
Similar functionality, but without facial alignment, exists in DCTFeature. It will
soon ... |
#!/usr/bin/env python3
# Copyright (c) 2014-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 the abandontransaction RPC.
The abandontransaction RPC marks a transaction and all its in-wallet... |
# -*- coding: utf-8 -*-
"""Bindings related to unrooted recocilation.
Using `fasturec` and `gsevol`.
"""
import tempfile
from collections import defaultdict
from bindings.base import launch
from bindings import gsevol as Gse
from bindings.utils import wrap_in_tempfile
def launch_fasturec(params, timeout=300, stdin=N... |
#!/usr/bin/python
# coding: UTF-8
# Driver for SSD1306 OLED display on the RPi using I2C interface
# Written by: Ron Ritchey
#
# Enabled by Richard Hull's excellent luma.oled project (https://github.com/rm-hull/luma.oled)
#
from __future__ import unicode_literals
import time, math,logging
import lcd_display_driver
... |
from __future__ import absolute_import
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from navigation.api import register_top_menu
from navigation.api import register_links
from project_setup.api import register_setup
from project_tools.api import register_tool
from .conf.se... |
#
# Copyright (c) 2013+ Anton Tyurin <noxiouz@yandex.ru>
# Copyright (c) 2013+ Evgeny Safronov <division494@gmail.com>
# Copyright (c) 2011-2014 Other contributors as noted in the AUTHORS file.
#
# This file is part of Cocaine-tools.
#
# Cocaine is free software; you can redistribute it and/or modify
# it under the ter... |
# Copyright (C) 2016- The University of Notre Dame This software is distributed
# under the GNU General Public License.
# See the file COPYING for details.
#
## @package resource_monitor
#
# Python resource_monitor bindings.
#
# The objects and methods provided by this package correspond to the native
# C API in @ref c... |
#!/usr/bin/env python
"""
Draw tonerow
Generate an ASCII diagram of a 12-tone tonerow (musical serialism).
use: tonerow.py | draw_row.py [-h] [-s SHELL]
"""
__author__ = 'Chris Horn <hammerhorn@gmail.com>'
import argparse
from cjh.cli import Cli
from cjh.config import Config
################
# PROCEDURES #
#... |
from typing import Optional
from dvc.exceptions import DvcException, InvalidArgumentError
# Experiment refs are stored according baseline git SHA:
# refs/exps/01/234abcd.../<exp_name>
EXPS_NAMESPACE = "refs/exps"
EXPS_STASH = f"{EXPS_NAMESPACE}/stash"
EXEC_NAMESPACE = f"{EXPS_NAMESPACE}/exec"
EXEC_APPLY = f"{EXEC_N... |
from collections import Mapping
try:
reduce
except NameError:
from functools import reduce
try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
import operator
import os
with open(os.path.join(os.path.dirname(__file__), 'VERSION.txt')) as f:
__version... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
setup(
name='quokka-flask-htmlbuilder',
version='0.13',
url='http://github.com/quokkaproject/flask-htmlbuilder',
license='MIT',
author='QuokkaProject',
author_email='rochacbruno@gmail.com',
description='Fork of Flex... |
# coding= utf-8
# Copyright (c) 2015 Rackspace, 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 o... |
from django.test import TestCase
from django_mailbox.models import Message
from batch_apps.models import App, Day, Execution
from batch_apps.generator import get_current_date_in_gmt8
from batch_apps.integration import (
execute_end_to_end_tasks,
get_unexecuted_due_executions,
get_unprocessed_unmatched_ema... |
from tests.conftest import get_token
def edit_post(postsetup, token, title='title', content='content', tags='',
action='save', url='/1/edit'):
return postsetup.app.post(url, data={
'token': token,
'title': title,
'content': content,
'tags': tags,
'action': action
... |
import csv
from unidecode import unidecode
from django.http import HttpResponse
def export_as_csv_action(description="Export selected objects as CSV file",
fields=None, exclude=None, header=True):
"""
This function returns an export csv action
'fields' and 'exclude' work like in ... |
# -*- coding: utf-8 -*-
from odoo import models, fields, api
TRAILER_TYPES = [('b','B'),
('be','BE')]
class Trailer(models.Model):
_name = 'eqpt.trailer'
_description = "Trailer equipment"
_inherits = {'eqpt.equipment':'eqpt_id'}
eqpt_id = fields.Many2one('eqpt.equipment')
eqpt_... |
"""
Usage:
>>> import qtLearn.windows.reparent.reparentWindow
>>> qtLearn.windows.reparent.reparentWindow.main()
"""
import sys
import time
import Qt.QtWidgets as QtWidgets
import qtLearn.uiUtils as uiUtils
import qtLearn.widgets.nodesMayaWidget as nodeMayaWidget
import qtLearn.windows.reparent.forms.ui_getNodes as... |
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from base.form_utils import RequiredFieldForm
from .models import Product
#class BundleAddProductForm(forms.Form):
#
# product = forms.ModelChoiceField(Product.objects.all())
#
#
#class BundleForm(RequiredFieldForm):
#
# def __init__(self, *arg... |
from django.db import models
from django.contrib.auth.models import User
import datetime
from django.db.models.signals import post_save
from django.dispatch import receiver
class User_Data(models.Model):
USER = 'user'
ADMIN = 'admin'
ROL_CHOICES = (
(USER, 'USER'),
(ADMIN, 'ADMIN'),
... |
#!/usr/bin/env python3
# Copyright (c) 2015-2021 Agalmic Ventures LLC (www.agalmicventures.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limit... |
#Copyright 2013 Paul Barton
#
#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 is distributed in the hope tha... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import sigi.apps.utils
class Migration(migrations.Migration):
dependencies = [
('contatos', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Mesorregiao',
... |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... |
from pychron.experiment.automated_run.persistence import AutomatedRunPersister
from pychron.experiment.automated_run.spec import AutomatedRunSpec
__author__ = 'ross'
import unittest
runs = [('references', 'bu-j-1', 'b1'), ('A', '11111', 'u1'),
('references', 'bu-j-2', 'b2'), ('B','22222','u2'), ('B','33333',... |
# -*- coding: utf-8 -*-
import numpy as np
from .. import FeatureExtractor
class GenerativeExtractor(FeatureExtractor):
"""Abstract base class for a generative feature extractor.
Compared to simple feature extractors, generators perform the additional
task of generating class label candidates. This mean... |
import pytest
from nex.constants.instructions import Instructions
from nex.constants.commands import Commands
from nex.constants.specials import Specials
from nex.state import Mode, GlobalState
from nex import box
from nex.box_writer import write_to_dvi_file
from nex.state import ExecuteCommandError
from nex.utils imp... |
"""
author: Family
date: 10/20/2014
"""
import json
import urllib2
import time
from echonest import settings
from echonest.models import MatchedTrack
import fp
def process(ingest, retry=0):
json_data = {'track_id': None}
#if settings.REMOTE_ENABLED:
try:
scraped = urllib2.urlopen(settings.REMOTE_... |
import mahotas
import scipy.ndimage
import scipy.misc
import numpy as np
import gzip
import cPickle
import glob
import os
import h5py
#param_path = 'D:/dev/Rhoana/membrane_cnn/results/good3/'
param_path = 'D:/dev/Rhoana/membrane_cnn/results/stumpin/'
param_files = glob.glob(param_path + "*.h5")
target_boundaries = ma... |
#!/usr/bin/env python
# encoding: utf-8
import sys
import os
import redis
from relo.core.log import logger
dirname = os.path.dirname(os.path.abspath(__file__))
up_dir = os.path.dirname(dirname)
sys.path.append(up_dir)
from relo.core.interfaces import Backend
class REDISDB(Backend):
name = "redis"
expiretime... |
# COPYRIGHT 2007 BY BBN TECHNOLOGIES CORP.
# BY USING THIS SOFTWARE THE USER EXPRESSLY AGREES: (1) TO BE BOUND BY
# THE TERMS OF THIS AGREEMENT; (2) THAT YOU ARE AUTHORIZED TO AGREE TO
# THESE TERMS ON BEHALF OF YOURSELF AND YOUR ORGANIZATION; (3) IF YOU OR
# YOUR ORGANIZATION DO NOT AGREE WITH THE TERMS OF THIS AGR... |
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Computer'
db.create_table('server_computer', (
('id', self.gf('django.db.models.... |
import os
import sys
import glob
import shutil
import subprocess
def cmd(c):
x = os.system(c)
assert x == 0, c
def fail(subject, email=None, filename='/dev/null', mailer='mail'):
assert mailer in ['mailx', 'mail', 'mutt']
import os
if email is not None:
if filename == '/dev/null':
... |
#!/usr/bin/env python2
import wx, os, sqlite3
import wxGUI
wx.USE_UNICODE = 1
SRC_DIR = os.getcwd()
DATA_DIR = os.path.join(os.path.split(SRC_DIR)[0], 'data')
def filepath(text):
""" If text contains no slashes, add the default data directory """
directory, filename = os.path.split(text)
if director... |
#!/usr/bin/env python
import numpy as np
from barak.convolve import convolve_constant_dv
from astropy.io import fits
class Up_parse:
"""
The class is to parse a UVES_popler output file.
It provides wavelength, flux, sigma_error, mask (valid pixels) arrays.
"""
def __init__(self, path_to_fits... |
"""
Copyright (C) 2019 Quinn D Granfor <spootdev@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
... |
import pytest
import networkx as nx
from networkx.testing import almost_equal
def validate_grid_path(r, c, s, t, p):
assert isinstance(p, list)
assert p[0] == s
assert p[-1] == t
s = ((s - 1) // c, (s - 1) % c)
t = ((t - 1) // c, (t - 1) % c)
assert len(p) == abs(t[0] - s[0]) + abs(t[1] - s[... |
'''the ChiantiPy - CHIANTI Python package
calculates various aspects of emission line and continua from the
CHIANTI atomic database for astrophysical spectroscopy'''
import os
import constants
import filters
import mputil
#
#try:
# chInteractive = int(os.environ['CHIANTIPY_INTERACTIVE'])
#except:
# chInteractive ... |
"""Łapka's persistence layer.
Represent and operate on data stored in a persistence storage (like a database).
"""
import pickle
_pickle_path = 'fetched_data.pickle'
class AnimalBase:
"""Base class for Animals persistence."""
def __init__(self, **kwargs):
"""Create an animal instance."""
... |
from setuptools import setup, find_packages
import os
VERSION = "0.8.1"
CLASSIFIERS = [
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Operating System :: OS Independent'... |
# etexample03.py
#
# David J. Lampert (djlampert@gmail.com)
#
# last updated: 03/22/2015
#
# this example shows how to use the ETCalculator class to compute hourly
# reference evapotranspiration from the other time series after using the
# ClimateProcessor class to extract and aggregate the climate data from the
# Wor... |
#!/usr/bin/env python
#
# Copyright 2015, 2016 Adam Victor Brandizzi
#
# This file is part of Inelegant.
#
# Inelegant 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... |
import sys
import os.path
sys.path.append(os.path.abspath('../../'))
sys.path.append(os.path.abspath('../../site/cwsite'))
import src.util.DBSetup
from src.util.MLClass import MLClass
from src.util.FileSystem import FileSystem
from src.util.AstNetwork import AstNetwork
from src.util.Assignment import Assignment
from m... |
# Author: Jose G Perez
# Version 1.0
# Last Modified: January 31, 2018
import numpy as np
import cv2
import os
SIFT = cv2.xfeatures2d.SIFT_create(contrastThreshold=0.05, edgeThreshold=100, sigma=2)
def kp_to_array(kp):
array = np.zeros((len(kp), 7), dtype=np.float32)
for idx in range(array.shape[0]):
k... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.forms import (CharField, DateField, FileField, Form, IntegerField,
ValidationError)
from django.forms.formsets import BaseFormSet, formset_factory
from django.forms.util import ErrorList
from django.test import TestCase
class Choice(Form... |
# Copyright (c) 2015, Bartlomiej Puget <larhard@gmail.com>
# 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... |
'''
This file is part of Telegram Desktop,
the official desktop version of Telegram messaging app, see https://telegram.org
Telegram Desktop 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... |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-10 14:23
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... |
# -*- coding: utf-8 -*-
'''
p2p server.
winxos 2015-12-04
'''
import socket
import threading
import os
import time
port = 9010
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # DGRAM -> UDP
is_exit = False
class getcmd(threading.Thread):
global s, clients
def __init__(self):
threading.Thread.__... |
# Copyright 2014-2016 Presslabs SRL
#
# 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 wri... |
#
# Advene: Annotate Digital Videos, Exchange on the NEt
# Copyright (C) 2008-2017 Olivier Aubert <contact@olivieraubert.net>
#
# Advene 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 ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import json
import boto3
table = boto3.resource("dynamodb").Table(os.environ.get("RAMBLINGS_TABLE_NAME"))
# def update_item_rating(vote):
# table.update_item(
# Key={
# 'username': 'janedoe',
# 'last_name': 'Doe'
# },
# UpdateE... |
# 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... |
#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import glob
import os
import sys
import ah_bootstrap
from setuptools import setup
#A dirty hack to get around some early import/configurations ambiguities
if sys.version_info[0] >= 3:
import builtins
else:
import __builtin_... |
import datetime
import re
import unicodedata
# The maximum length of an editable description, such as a player desc
# or editstr line.
MAX_DESCLINE_LENGTH = 256
class SuiGeneris(object):
"""Factory for when you want an object distinguishable from all other
objects.
"""
def __init__(self, name):
... |
import pytest
import warnings
from pytest_warnings import _setoption
from helper_test_a import deprecated_a
from helper_test_b import user_warning_b
def test_warnings():
warnings.warn("Foo", DeprecationWarning)
warnings.warn("Foo", DeprecationWarning)
warnings.warn("Foo", DeprecationWarning)
warnings... |
#!/usr/bin/env python
from setuptools import setup
from setuptools.command.test import test as TestCommand
import os
import sys
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'test_settings')
PACKAGES = [
'payments',
'payments.authorizenet',
'payments.braintree',
'payments.cybersource',
'payments... |
#!/usr/bin/python3
# Copyright (C) 2014-2017 Cyrille Defranoux
#
# This file is part of Homewatcher.
#
# Homewatcher 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 y... |
"""
Our implementation of knuth-liang
"""
from string import digits
from collections import OrderedDict
from .language_patterns import LanguagePatterns
class KnuthLiang(object):
"""
This class implements knuth-liang
"""
__slots__ = ['language_patterns', 'limit_left', 'limit_right']
def __init__... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on Feb 22, 2014
@author: Chunwei Yan @ PKU
@mail: yanchunwei@outlook.com
'''
import theano
import numpy
from theano import tensor as T
rng = numpy.random
class LogisticRegression(object):
'''
pass in the dataset as a matrix
'''
def __init__(se... |
""" Module used to colorize strings """
red_color = ""
green_color = ""
yellow_color = ""
orange_color = ""
blue_color = ""
violet_color = ""
reset = ""
def debug():
return violet_color + "[DEBUG]" + reset
def module():
return violet_color + "[MODULE]" + reset
def core():
return orange_color + "[_COR... |
"""Tests for environment variable parsing functions"""
from unittest.mock import patch
import os
import pytest
from odl_video.envs import (
EnvironmentVariableParseException,
get_any,
get_bool,
get_int,
get_key,
get_list_of_str,
get_string,
parse_env,
)
FAKE_ENVIRONS = {
"true": ... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Presidentielcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test REST interface
#
from test_framework.test_framework import PresidentielcoinTestFramew... |
# encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'ChangeStatusLog.auto_approved'
db.add_column('review_changestatuslog', 'auto_approved', se... |
#!/usr/bin/env python
"""
Unit test for the RabbitMQ collectd plugin. Meant to be run with pytest.
"""
# Copyright (C) 2015 SignalFx, Inc.
import collections
import mock
import sys
import sample_responses
class MockCollectd(mock.MagicMock):
"""
Mocks the functions and objects provided by the collectd module... |
import tarfile
from datetime import datetime
from os import path, getenv, remove
import sh
directories = ['.screenly', 'screenly_assets']
default_archive_name = "screenly-backup"
static_dir = "screenly/static"
def create_backup(name=default_archive_name):
home = getenv('HOME')
archive_name = "{}-{}.tar.gz".f... |
"""Provide a PySide ImageViewer window.
"""
import sys
from PySide import QtCore, QtGui
import photo.index
from photo.listtools import LazyList
from photo.qt.image import Image
from photo.qt.filterDialog import FilterDialog
from photo.qt.imageInfoDialog import ImageInfoDialog
from photo.qt.overviewWindow import Overvi... |
# -*- coding: utf-8 -*-
import logging
from algorithms.logistic_vw import LogisticVWClassifier
from algorithms.libffm import LibFFMClassifier
from algorithms.dummy import DummyClassifier
from hccf.utils.logs import load_dict_config
from hccf.settings import LOGGING
from hccf.clustering import FeatureClustering
from ... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-02 09:11
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('competences', '__first__'),
... |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2015 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... |
# 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 os
from textw... |
# See LICENSE.rst for BSD 3-clause license info
# -*- coding: utf-8 -*-
"""
desimodel.weather
=================
Model of the expected weather conditions at KPNO during the DESI survey.
To generate a random time series of expected FWHM seeing in arcsecs and
atmospheric transparency, use, for example::
n = 10000
... |
"""
This module provides interface for low-level private/public keypair operation
PKey object of this module is wrapper around OpenSSL EVP_PKEY object.
"""
from ctypes import c_char, c_char_p, c_void_p, c_int, c_long, POINTER
from ctypes import create_string_buffer, byref, memmove, CFUNCTYPE
from ctypescrypto import... |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as publish... |
"""Test `Word Break`."""
import unittest
from backrefs import uniprops
import re
class TestWordBreak(unittest.TestCase):
"""Test `Word Break` access."""
def test_table_integrity(self):
"""Test that there is parity between Unicode and ASCII tables."""
re_key = re.compile(r'^\^?[a-z0-9./]+$')
... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Test the Q spectrum processing using a synthesised image as specified
in Section 5 of the "Fitting freeform shapes with orthogonal bases" document.
"""
from __future__ import print_function, absolute_import, division
__author__ = "npdata"
__copyright__ = "... |
# -*- coding: utf-8 -*-
from openerp.api import depends, multi
from openerp.fields import Many2one, Many2many, Boolean
from openerp.models import TransientModel
from openerp.addons.training_management.models.model_names import ModelNames
from openerp.addons.training_management.utils.action_utils import ActionUtils
fr... |
# -*- encoding: utf-8 -*-
#
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Vauxoo - http://www.vauxoo.com/
# All Rights Reserved.
# info Vauxoo (info@vauxoo.com)
#
# Coded by: Jorge Angel Naranjo (jorge_nr@vauxoo.com)
#
#
# This program is free software: you can red... |
'''
Copyright (c) 2011-2012 Johannes Mitlmeier
This file is part of Jazzy.
Jazzy is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
Th... |
r"""
This model provides the form factor, $P(q)$, for a micelle with a spherical
core and Gaussian polymer chains attached to the surface, thus may be applied
to block copolymer micelles. To work well the Gaussian chains must be much
smaller than the core, which is often not the case. Please study the
reference caref... |
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the... |
# coding: utf-8
#
# Copyright 2010-2014 Ning, Inc.
# Copyright 2014-2020 Groupon, Inc
# Copyright 2020-2021 Equinix, Inc
# Copyright 2014-2021 The Billing Project, LLC
#
# The Billing Project, LLC licenses this file to you under the Apache License, version 2.0
# (the "License"); you may not use this file except in com... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.