src stringlengths 721 1.04M |
|---|
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models, _
from odoo.osv import expression
class FleetVehicle(models.Model):
_inherit = ['mail.thread', 'mail.activity.mixin']
_nam... |
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
import os
import shutil
import sys
import tempfile
import allauth
from django.conf import settings
from django.core.management.base import BaseCommand
from django.c... |
# Written by George Milescu
# see LICENSE.txt for license information
import sys
import time
from traceback import print_exc
from collections import deque
from threading import Lock
from Tribler.Core.BitTornado.bencode import bencode
from Tribler.Core.BitTornado.BT1.MessageID import *
from Tribler.Core.simpledefs imp... |
"""
Tests for the Account Deletion (Retirement) view.
"""
from mock import patch
import pytest
from django.urls import reverse
from django.core import mail
from rest_framework.test import APITestCase
from rest_framework import status
from openedx.core.djangoapps.user_api.models import UserRetirementStatus
from opene... |
import time
import threading
import atexit
from src.Server.Server import Server
from src.Server.PlayerHandler import PlayerHandler
from src.Server.RuleHandler import RuleHandler
from src.Base.Rule import Rule
from src.Base.OptionsParser import load_configuration
start_time = time.time()
def test_rule(server_object):
... |
import pkg_resources
import math
from itcc import tools
ff_cache = {}
caflisch_dat = None
r_probe = 1.4
pij_bonded = 0.8875
pij_nonbonded = 0.3516
class Caflisch(object):
def __init__(self, data):
self.data = data
assert len(self.data) == 5
def _r_min(self):
return self.data[1]
... |
"""Script to create a user-friendly index of IPHAS image meta data.
"""
import numpy as np
from astropy.table import Table
from astropy.table import Column
from dr2.constants import IPHASQC
# Index of images found by the DR2 pipeline
# ie. produced by dr2.images.prepare_images()
t = Table.read('iphas-images-pipeline.f... |
from django import forms
from django.forms import ValidationError
from django.core.validators import URLValidator
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext_lazy as _
import re
from Kraggne.utils import MakePattern, clean_url
from Kraggne.models import MenuItem, F... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from flask import request, url_for, flash, redirect
from flask.ext.admin import expose
from flask.ext.admin.babel import gettext
from flask.ext.admin.actions import action
from studio.core.engines import db
from express.models.account import (... |
# coding=UTF-8
# Author: Dennis Lutter <lad1337@gmail.com>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of SickRage.
#
# SickRage 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 vers... |
import os
import sys
import unittest
from pyactiveresource.activeresource import ActiveResource
from pyactiveresource.testing import http_fake
import haravan
class TestCase(unittest.TestCase):
def setUp(self):
ActiveResource.site = None
ActiveResource.headers=None
haravan.HaravanResource.... |
import rospy
from sensor_msgs.msg import Image
from std_msgs.msg import String
from cv_bridge import CvBridge
import cv2
import numpy as np
import tensorflow as tf
from tensorflow.models.image.imagenet import classify_image
class RosTensorFlow():
def __init__(self):
classify_image.maybe_download_and_extra... |
author__ = 'ramapriyasridharan'
import matplotlib.pyplot as plt
import numpy as np
import argparse
import pandas as pd
import scipy as sp
import scipy.stats, math
import sys
import os
import ConfigParser
WARMUP_SECS = 20
COOLDOWN_SECS = 70
def mean_confidence_interval(data, confidence=0.95):
# a = 1.0*np.a... |
# encoding: utf8
from __future__ import unicode_literals
from django.db import models, migrations
import datetime
class Migration(migrations.Migration):
dependencies = [
('calculate_calories', '0005_auto_20140627_1125'),
]
operations = [
migrations.CreateModel(
name='Temp',
... |
from django.db import migrations
# This can be deleted when doing next squash of migrations because it's a one time update
def migrate_well_disinfected(apps, schema_editor):
well = apps.get_model('wells', 'well')
code = apps.get_model('wells', 'welldisinfectedcode')
disinfected = code.objects.filter(well... |
import sys
import os
from cffi import FFI
import atexit
import numpy as np
import warnings
"""PySoundCard is an audio library based on PortAudio, CFFI and NumPy
PySoundCard can play and record audio data. Audio devices are supported
through PortAudio[1], which is a free, cross-platform, open-source
audio I/O library ... |
"""Block logic.
Shapes are composed of many blocks while they are falling.
Once they have finished falling, they become independant.
"""
from __future__ import division
import pygame
import struct
from collections import namedtuple
from fallingsky.util import Coord
class Blocks(object):
rgba_codes = { # nam... |
from flask import abort, current_app
from werkzeug.utils import cached_property
from app.models import JSONModel
from app.models.contact_list import ContactLists
from app.models.job import (
ImmediateJobs,
PaginatedJobs,
PaginatedUploads,
ScheduledJobs,
)
from app.models.organisation import Organisatio... |
"""
Ported by Massimo Vassalli [http://mv.nanoscopy.eu massimo.vassalli@gmail.com]
"""
import scipy.sparse as sparse
import scipy.sparse.linalg as splin
import numpy.linalg as linalg
import numpy as np
def pwc_tvdip(y, lamb=[1.0], display=True, stoptol=1e-3, maxiter=60, full=False):
# Performs discrete total varia... |
"""
Deep Q network,
The mountain car example
"""
import gym
from RL_brain import DeepQNetwork
env = gym.make('MountainCar-v0')
print(env.action_space)
print(env.observation_space)
print(env.observation_space.high)
print(env.observation_space.low)
RL = DeepQNetwork(n_actions=3, n_features=2, learning_rate=0.0005, e... |
# -*- coding: utf-8 -*-
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
# (c) 2016 Open Source Geospatial Foundation - all rights reserved
# (c) 2014 - 2015 Centre for Maritime Research and Experimentation (CMRE)
# (c) 2013 - 2014 German Aerospace Center (DLR)
# This code is licensed under the GPL 2.0 license, available at the root
# application directory.
import os
import tempfile
import... |
import datetime, os, socket
from flask import abort, Flask, json, jsonify, redirect, request, render_template, Response, send_from_directory, url_for
from flask.ext.admin import Admin
from flask.ext.mongoengine import MongoEngine
from flask.ext.mongorest import MongoRest
from flask.ext.mongorest.views import ResourceV... |
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 24 14:13:47 2017
@author: ishort
"""
import math
import Useful
import ToolBox
#import numpy
#JB#
#from matplotlib.pyplot import plot, title, show, scatter
#storage for fits (not all may be used)
uw = []
uwa = []
uwb = []
uwStage = []
uwbStage = []
uwu ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import subprocess
import logging
from enum import Enum
class LedStatusTypes(Enum):
"""Enum of led status types resp. colors"""
ok = 1 # green
sensor_broken = 2 # red
request_error = 3 # orange
pairing_succeeded = 4 # blue
class SensorTypes(Enum):... |
# 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 (t... |
import asyncio
import time
from collections import OrderedDict
class KeyNotInDictException(Exception):
pass
class KeyVanishedException(Exception):
pass
class AlreadyWaitingForItException(Exception):
pass
class DictContainer:
def __init__(self, max_size):
self.__requested_keys = set()
... |
import string
import parse as _parse # avoid potential name conflicts with parse methods
# NOTE: All the Formatter docstrings mostly copied from the string docs page (Formatter does
# not have its own docstrings... <sad_face>).
class Formatter():
'''Re-implementation of `string.Formatter` (using the composition p... |
# :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import traceback
from PySide import QtGui
from .selector import SelectorWidget
from .options import OptionsWidget
from .worker import Worker
from ..backend.processor.foreground import ForegroundProcessor
class E... |
from tojauth import TOJAuth
from asyncdb import AsyncDB
import mod
import com
import imc.async
from imc.proxy import Proxy
import config
class ProblemMg:
_accessid = 6
TITLE_LEN_MIN = 1
TITLE_LEN_MAX = 100
def __init__(self, mod_idendesc, get_link_fn):
ProblemMg.db = AsyncDB(config.CORE_DBNAM... |
from datetime import timedelta
from bluebottle.bb_projects.models import ProjectPhase
from bluebottle.test.factory_models.accounts import BlueBottleUserFactory
from bluebottle.test.factory_models.utils import LanguageFactory
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.ut... |
import plotly.tools as pl_tools
from plotly_system_stats.config import config
def build_config():
d = {}
d = dict(
all_stream_ids=[],
streams={},
figures={},
plots={},
)
config.set('plotly', d)
if config.get('plotly') is None:
build_config()
class... |
from model.contact import Contact
from model.group import Group
import random
def test_remove_contact_from_group(app, db, orm):
if len(db.get_group_list()) == 0:
app.group.create(Group(name="New one"))
if len(db.get_contact_list()) == 0:
app.contact.add(Contact(firstname="Anna", middlename="Jo... |
# coding: utf-8
"""
Qc API
Qc API # noqa: E501
The version of the OpenAPI document: 3.0.0
Contact: cloudsupport@telestream.net
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from telestream_cloud_qc.configuration import Configuration
class... |
# -*- Mode: Python -*-
# Id: asyncore.py,v 2.51 2000/09/07 22:29:26 rushing Exp
# Author: Sam Rushing <rushing@nightmare.com>
# ======================================================================
# Copyright 1996 by Sam Rushing
#
# All Rights Reserved
#
# Permission to use, copy, modify,... |
'''
Created on 29 jan. 2015
@author: Gena
'''
from PyQt4 import QtCore, QtGui
class PreprocessorWidget(QtGui.QWidget):
'''
classdocs
'''
def __init__(self, preprocessor, parent=None):
'''
Constructor
'''
super(PreprocessorWidget, self).__init__(parent)
self.p... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import datetime, timedelta
from openerp import SUPERUSER_ID
from openerp import api, fields, models, _
import openerp.addons.decimal_precision as dp
from openerp.exceptions import UserError
from openerp.too... |
# -*- coding: utf-8 -*-
{
'!langcode!': 'es',
'!langname!': 'Español',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN',
'%s %... |
# Copyright 2020 The TensorFlow 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
#!/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 BIP68 implementation
#
from test_framework.test_framework import PresidentielcoinTestF... |
import os
import shutil
import tempfile
from mock import patch
from mock import Mock, MagicMock
from zope.interface import implements
from twisted.trial import unittest
from twisted.test import proto_helpers
from twisted.internet import defer, error, task, tcp
from twisted.internet.endpoints import TCP4ServerEndpoin... |
#!/usr/bin/python3 -u
# -*- coding: utf-8 -*-
import sys
import time
import telebot # Librería de la API del bot.
from telebot import types # Tipos para la API del bot.
from priv.__init__ import token as tk
bot = telebot.TeleBot(tk()) # Creamos el objeto de nuestro bot.
###############################################... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Author: Olivier Sigaud
Module: RunRegressionNN
Description: Functions to run a neural net to create a controller
'''
import os
import numpy as np
import random as rd
from Utils.ReadSetupFile import ReadSetupFile
from Utils.FileReading import getStateAndCommandData, ... |
#!/usr/bin/env python
"""
===================================================================
RRTController.py - Rapidly-Exploring Random Trees Motion Controller
===================================================================
Uses Rapidly-exploring Random Tree Algorithm to generate paths given the starting p... |
r"""
Replacement utilities that are optimized for speed using numba but not numpy.
Notes
-----
#. Written by David C. Stauffer in July 2020.
#. Moved into a submodule by David C. Stauffer in February 2021.
"""
#%% Imports
from __future__ import annotations
import doctest
import math
from typing import Sequence
impo... |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: dataERP - Vlad Nafureanu (vladnfr@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
# ... |
"""Support for Plum Lightpad devices."""
import logging
from aiohttp import ContentTypeError
from requests.exceptions import ConnectTimeout, HTTPError
import voluptuous as vol
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, EVENT_HOMEAS... |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
def gen_forward():
kernels = [3, 5, 7, 15, 31, 63, 127, 255]
seqs = [32 * x for x in [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,... |
#-*- coding=utf-8 -*-
from FinalLogger import logger
from Constant import inst_strategy, suffix_list
import urllib
import json
import sqlite3
conn = sqlite3.connect('futures.db3', check_same_thread = False)
for i in inst_strategy.keys() :
daybar_table = i + suffix_list[0]
cmd = "DROP TABLE IF EXISTS " + daybar... |
#!/usr/bin/env python3
# -*- coding:utf-8 -*-
__author__ = ""
'''
'''
import asyncio,logging
logging.basicConfig(level=logging.INFO)
import aiomysql
def log(sql,args=()):
logging.info('SQL: %s' % sql)
async def create_pool(loop,**kw):
logging.info('create database connection pool...')
global _pool
... |
from django.core.mail.message import EmailMultiAlternatives
from django.template import engines
from django.template.loader import render_to_string
from django.urls import reverse
from celery import shared_task
from celery.utils.log import get_task_logger
from common.utils import full_url
from private_sharing.models ... |
# 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, software
# distributed under ... |
import views
__author__ = 'tmehta'
from django.conf.urls import patterns, url
urlpatterns = patterns('',
url(r'^login/$', views.login_user, name='login'),
url(r'^logout/$', views.logout_user, name='logout'),
url(r'^signup/$', views.signup, name='si... |
###############################################################################
##
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or without
## modification, ... |
# Copyright 2016 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... |
<<<<<<< HEAD
<<<<<<< HEAD
import re
import time
def main():
s = "\13hello\14 \13world\14 " * 1000
p = re.compile(r"([\13\14])")
timefunc(10, p.sub, "", s)
timefunc(10, p.split, s)
timefunc(10, p.findall, s)
def timefunc(n, func, *args, **kw):
t0 = time.perf_counter()
try:
for i in ... |
#
# 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... |
# encoding: utf-8
import common
from common import outdir, TRAVIS
import logging as ll
import unittest as ut
from ibcao import *
import cartopy.crs as ccrs
import matplotlib
import matplotlib.pyplot as plt
import os
import os.path
class IbcaoDepthTest (ut.TestCase):
def setUp (self):
self.i = IBCAO ()
def... |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2018 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... |
#
# Copyright (c) 2011 Thomas Graf <tgraf@suug.ch>
#
"""Module providing access to network links
This module provides an interface to view configured network links,
modify them and to add and delete virtual network links.
The following is a basic example:
import netlink.core as netlink
import netlink.route.l... |
import mock
import pytest
from functools import partial
from helga_xkcd import command
MOCK_CLIENT = 'irc'
MOCK_CHANNEL = 'bots'
MOCK_NICK = 'crlane'
MOCK_MESSAGE = 'foobar'
MOCK_CMD = '!xkcd'
MOCK_ARGS = [
MOCK_CLIENT,
MOCK_CHANNEL,
MOCK_NICK,
MOCK_MESSAGE,
MOCK_CMD
]
@pytest.fixture
def moc... |
# Copyright (C) 2017-2019 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution
# License: GNU Affero General Public License version 3, or any later version
# See top-level LICENSE file for more information
# flake8: noqa
import os
stub_content_root_dir = '08e832925... |
# This file is part of Merlin/Arthur.
# Merlin/Arthur is the Copyright (C)2009,2010 of Elliot Rosemarine.
# Individual portions may be copyright by individual contributors, and
# are included in this collective work with permission of the copyright
# owners.
# This program is free software; you can redistribute it an... |
# 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, print_function, unicode_literals
import functools
import getpass
import hashlib
import os
import pkgutil
import shutil
imp... |
import re
from datetime import datetime
from unittest.mock import patch
import pytest
from faker.providers.company.en_PH import Provider as EnPhCompanyProvider
from faker.providers.company.fil_PH import Provider as FilPhCompanyProvider
from faker.providers.company.hu_HU import Provider as HuHuCompanyProvider
from fa... |
from .Board import Board
from .LocalBoard import LocalBoard
from .Move import Move
class GlobalBoard(Board):
""" Represents the meta-board composed of a 3x3 grid of smaller tic-tac-toe boards
the optional 'board' parameter is used internally clone GlobalBoard objects
"""
def __init__(self, board=None... |
# Copyright 2016-2021 Peppy Player peppy.player@gmail.com
#
# This file is part of Peppy Player.
#
# Peppy Player 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 you... |
#!/usr/bin/env python
"""
Test pycacheback
"""
import os
import shutil
import random
import copy
from pycacheback import pyCacheBack
import unittest
class TestpyCacheBack(unittest.TestCase):
def testSimple(self):
"""A simple 'smoke test' for the extended dictionary."""
# make an extended dictio... |
from base64 import b64encode
import mock
from changes.constants import Result
from changes.lib.artifact_store_mock import ArtifactStoreMock
from changes.models.failurereason import FailureReason
from changes.models.itemstat import ItemStat
from changes.models.testresult import TestResult, TestResultManager, logger
fr... |
import datetime
from django import forms
from django.utils import simplejson
from django.utils.safestring import mark_safe
class JQueryAutoCompleteTextInput(forms.TextInput):
"""
A text input with jQuery auto completion, using the auto-complete
plugin from Corey Hart.
(http://www.codenothing.com/... |
# RADIUS tests
# Copyright (c) 2013-2016, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
from remotehost import remote_compatible
import binascii
import hashlib
import hmac
import logging
logger = logging.getLogger()
import os
import sele... |
#!/usr/bin/env python
from setuptools import setup
long_desc = '''
Encrypted JSON Transport Protocol
---------------------------------
EJTP is an overlay protocol that allows the pluggable use of underlying transports, such as UDP, TCP, HTTP, IRC, Email and carrier pigeon to provide a cryptographically secure netwo... |
import json
from config import *
from utils import *
from get_auth import TOKEN, PROJECT_ID
# Create network
create_volume_url = "http://{}:8776/v2/{}/volumes".format(IP, PROJECT_ID)
token_headers = {
'X-Auth-Token': TOKEN,
'Content-Type': 'application/json'
}
# Get network for DELETE
get_list_url = create_v... |
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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
... |
from __future__ import print_function
import logging
from django.http import HttpResponse
from django.views.generic import View
from django.template.loader import render_to_string
from django.conf import settings
from gc_apps.gis_shapefiles.models import ShapefileInfo
from gc_apps.worldmap_layers.models import World... |
import numpy as np
#import numarray as numar
from numpy.random import *
from scipy import *
from scipy.io import *
from scipy.spatial.distance import euclidean
from numpy import *
import matplotlib
import pylab
import os # For issuing commands to the OS.
import sys # F... |
from datetime import datetime
from dateutil.relativedelta import relativedelta
from feedrsub.database import db
from feedrsub.models.period import PERIOD, Period
from feedrsub.models.populate_db import populate_periods
def test_populate_periods(session):
populate_periods()
daily = Period.query.filter_by(na... |
import numpy as np
from .frequencyadaptive import FrequencyAdaptive
class FrequencyWeighting(object):
def __init__(self):
super(FrequencyWeighting, self).__init__()
def __numpy_ufunc__(self, *args, **kwargs):
raise NotImplementedError()
def _wdata(self, scale):
return np.ones(len... |
from flask import Flask
from flask import request
from flask import jsonify
from flask import Response
from flask_cors import CORS
from database import session
from models import Address
from urllib import parse
from utils import replace_if_short_address
app = Flask(__name__)
CORS(app)
@app.route('/cj/secluded_place... |
#!/usr/bin/env python
"""
Domain Tutorial for RLPy
=================================
Assumes you have created the ChainMDPTut.py domain according to the
tutorial and placed it in the Domains/ directory.
Tests the agent using SARSA with a tabular representation.
"""
__author__ = "Robert H. Klein"
from rlpy.Domains impo... |
# 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 model 'TemplateAvaliacao'
db.create_table('Avaliacao_templateavaliacao', (
('id', sel... |
from django.conf.urls import url
from . import views
app_name = "lastfm"
# The pattern for matching an Album/Artist/Track slug:
slug_chars = "[\w.,:;=@&+%()$!°’~-]+" # noqa: W605
urlpatterns = [
url(regex=r"^$", view=views.HomeView.as_view(), name="home"),
url(
regex=r"^library/$", view=views.Sc... |
'''Vaibhavi Rangarajan, UWNetID = vaibhavi
EightPuzzle with Heuristics.py
A QUIET2 Solving Tool problem formulation.
QUIET = Quetzal User Intelligence Enhancing Technology.
The XML-like tags used here serve to identify key sections of this
problem formulation. It is important that COMMON_CODE come
before all the othe... |
#Some Codes from "Rename tracks to take source filename", -- Set pan for selected track(s) (SPK77)
#This script by junh1024 sets pans of tracks according to their suffixes. Useful for say, film dialogue. See global variables below for pans.
from reaper_python import *
from contextlib import contextmanager
# import os
... |
from . import *
# Graphics Stuff
import matplotlib.pyplot as plt
class Graph(object):
"""docstring for Graph"""
def __init__(self, Experiment):
self.Experiment = Experiment
self.numberOfStimulantsAdded = 0
self.nameToUse = 0
def plot(self):
print ''
log(self.Exp... |
# 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 a... |
"""Provides NetBase class for generating networks from configurations.
NetBase provides interface for building CNNs.
It should be inherited by all network classes in order to provide
basic functionality, ie computing outputs, creating computational
graph, managing dropout, etc.
NetBaseParams is the parametrization of ... |
MAIN_LIST_FOCUS = "main_list_focus"
STATUS_BG = "#06a"
STATUS_BG_FOCUS = "#08d"
# name, fg, bg, mono, fg_h, bg_h
PALLETE = [
(MAIN_LIST_FOCUS, 'default', 'brown', "default", "white", "#060"), # a60
('main_list_lg', 'light gray', 'default', "default", "g100", "default"),
('main_list_dg', 'dark gray', 'd... |
# ====================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... |
# Copyright 2016-2017 Capital One Services, LLC
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from c7n.actions import BaseAction
from c7n.exceptions import PolicyValidationError
from c7n.manager import resources
from c7n.query import QueryResourceManager, TypeInfo
from c7n.utils import... |
from flask import Flask, render_template, session, redirect, url_for, request
from flask import logging, g
from settings import users
from functions import fetch_pending_orders_data, fetch_products_data,\
fetch_suppliers_data, get_user_id, suppDataCheck, suppDataInsert, \
suppDataUpdate, setActiveTab, appendP... |
# -*- coding: utf-8 -*-
#
# 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
#... |
###################################################################
# ./mkQueryPage starts a web server to take and process user search
###################################################################
import findBestPears
import scorePages
import textblob_aptagger
from textblob import TextBlob
from textblob impor... |
# Copyright 2014 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 ag... |
__author__ = 'nick'
from pymongo import MongoClient
class DocLabeler:
"""
Class to manually label the instances in the database
"""
def __init__(self):
"""
Sole constructor. Creates database connection and auto executes the labeling process
:return:
"""
self.... |
"""plot_gini.py
Plot the Gini of the income distribution as a function of the number of
households in cities.
"""
from __future__ import division
import csv
import numpy as np
import itertools
from matplotlib import pylab as plt
#
# Parameters and functions
#
income_bins = [1000,12500,17500,22500,27500,32500,37500,42... |
#!/usr/bin/env python
from setuptools import setup
import django_litetest
setup(
name='django-litetest',
version=django_litetest.__version__,
description='A lightweight Django "test" command for quick unittest runs.',
long_description=open('README.rst').read(),
license='Apache Software License, ... |
#!/usr/bin/python
import sys
import os
from nwb import nwb_file
from nwb import nwb_utils as ut
import numpy as np
# dataset to use
#BASE = "ec013.156"
BASE = "ec013.157"
print ("Warning -- experiment time is hard-coded. Needs to be read from file")
if BASE == "ec013.156":
DATE = "Sat Jul 08 2006 12:00:00"
else:... |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2018 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 Softwa... |
# -*- coding: utf-8 -*-
"""The encoding manager."""
class EncodingManager(object):
"""Class that implements the encoding manager."""
_decoders = {}
@classmethod
def DeregisterDecoder(cls, decoder):
"""Deregisters a decoder for a specific encoding method.
Args:
decoder (type): decoder class.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.