src stringlengths 721 1.04M |
|---|
"""
============================================================
Parameter estimation using grid search with cross-validation
============================================================
This examples shows how a classifier is optimized by cross-validation,
which is done using the :class:`sklearn.model_selection.GridS... |
from cornflake import fields
from cornflake.exceptions import ValidationError
from cornflake.sqlalchemy_orm import ModelSerializer
from radar.api.serializers.common import (
EnumLookupField,
GroupField,
MetaMixin,
StringLookupField,
UserMixin,
)
from radar.exceptions import PermissionDenied
from ra... |
"""
Units - units tool for openaps
"""
from openaps.uses.use import Use
from openaps.uses.registry import Registry
from openaps.glucose.convert import Convert as GlucoseConvert
import json
import argparse
def set_config (args, device):
return device
def display_device (device):
return ''
use = Registry( )
... |
"""
Given two binary trees s and t, check if t is a subtree of s.
A subtree of a tree t is a tree consisting of a node in t and
all of its descendants in t.
Example 1:
Given s:
3
/ \
4 5
/ \
1 2
Given t:
4
/ \
1 2
Return true, because t is a subtree of s.
Example 2:
Given s:
3
... |
# -*- coding: utf-8 -*-
# -*- Channel PedroPolis -*-
# -*- Created for Alfa-addon -*-
# -*- By the Alfa Develop Group -*-
import sys
PY3 = False
if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int
if PY3:
import urllib.parse as urlparse # Es... |
"""
home_view.py
ist303-miye
Copyright (C) 2017
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 distribut... |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Tweets quotes randomized by quotes.py.
https://twitter.com/quote_bot_6
"""
import json
import os
import argparse
import logging
import twython
from src import quotes
from src import utils
PATH_TO_LOG = os.path.join(utils.PATH_TO_SRC, "..", "bot_quotes.log")
PATH_TO_KE... |
# coding: utf-8
"""
EVE Swagger Interface
An OpenAPI for EVE Online
OpenAPI spec version: 0.4.6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class PutFleetsFleetIdWingsWingIdNaming(object):
"""
NOT... |
'''
Copyright (C) 2021 Gitcoin Core
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This progra... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'K:\Library\Python\AssetsBrowser\ui\window\main.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def se... |
from django import forms
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
from django.conf import settings
class TagAutoCompleteInput(forms.TextInput):
class Media:
css = {
'all': (settings.STATIC_URL + 'pinax/css/jquery.autocomplete.css',)
}
... |
# peppy Copyright (c) 2006-2009 Rob McMullen
# Licenced under the GPLv2; see http://peppy.flipturn.org for more info
"""FlagShip programming language editing support.
Major mode for editing FlagShip files.
Supporting actions and minor modes should go here only if they are uniquely
applicable to this major mode and ca... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Einstellungen.ui'
#
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_SettingsWindow(object):
def setupUi(self, SettingsWindow):
... |
from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the relevant file
with open(path.join(here, 'README.rst'), encoding='utf-8') as... |
# coding: utf-8
"""
Salt Edge Account Information API
API Reference for services # noqa: E501
OpenAPI spec version: 5.0.0
Contact: support@saltedge.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import swagger_cl... |
from importlib import import_module
import os
from toolz import merge
from trading_calendars import register_calendar, get_calendar
from zipline import run_algorithm
# These are used by test_examples.py to discover the examples to run.
def load_example_modules():
example_modules = {}
for f in os.listdir(os.... |
#/usr/bin/env python
# -*- coding: utf-8 -*-
# -*- Python -*-
# import sys
from omniORB import CORBA, URI
# from omniORB import any
from omniORB import any, cdrMarshal, cdrUnmarshal
import OpenRTM_aist
import RTC
from CorbaNaming import *
import SDOPackage
# from EmbryonicRtc import *
# class RtmEnv :
# rtm ... |
"""Creates a Container VM with the provided Container manifest."""
from container_helper import GenerateManifest
COMPUTE_URL_BASE = 'https://www.googleapis.com/compute/v1/'
def GlobalComputeUrl(project, collection, name):
return ''.join([COMPUTE_URL_BASE, 'projects/', project,
'/global/', collect... |
# import the modules I'm gonna need
import glob, string, csv, os
# input the files to use
inputdirectory = 'C:\Users\Michele\Documents\Research\CurvilinearAnisotropy\WillametteRiver\willamette_elevations\willamette\centerline_elevation\\'
outputfile1 = 'C:\Users\Michele\Documents\Research\CurvilinearAnisotropy\Willame... |
import numpy as _np
from matplotlib.widgets import AxesWidget as _AxesWidget
from matplotlib.colors import is_color_like as _is_color_like
from matplotlib.axes import Axes as _mplAxes
from matplotlib.figure import Figure as _mplFigure
from IPython.display import display as _ipydisplay
from pyemma.util.types import is... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-25 18:03
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import wagtail.wagtailcore.fields
class Migration(migrations.Migration):
dependencies = [
('wagtailimages', '0010_chan... |
#!/usr/bin/env python
# encoding: utf-8
"""
Python wrapper around Windows Azure storage and management APIs
Authors:
Sriram Krishnan <sriramk@microsoft.com>
Steve Marx <steve.marx@microsoft.com>
Tihomir Petkov <tpetkov@gmail.com>
License:
GNU General Public Licence (GPL)
This file is part of ... |
# $Id$
__author__ = 'Martin Felder'
from scipy import sqrt
from pybrain.supervised.trainers import BackpropTrainer
class RPropMinusTrainer(BackpropTrainer):
""" Train the parameters of a module according to a supervised dataset (possibly sequential)
by RProp without weight backtracking (aka RProp-, cf. ... |
from django.http import JsonResponse
from data_2015_fall.models import *
import simplejson
from collections import defaultdict
from operator import itemgetter
# ===================================================
# Classes
# ===================================================
class Expert(object):
def __init__(se... |
# Copyright 2011 OpenStack Foundation.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance w... |
{'_0_0_mc': {'currentLabel': 'empty_white'},
'_0_1_mc': {'currentLabel': 'empty_white'},
'_0_2_mc': {'currentLabel': 'empty_white'},
'_0_3_mc': {'currentLabel': 'empty_white'},
'_0_4_mc': {'currentLabel': 'empty_white'},
'_0_5_mc': {'currentLabel': 'empty_white'},
'_0_6_mc': {'currentLabel': 'empty_white'},
'_0_... |
from platform import system
from ._base import Question
class ChoiceSelect(Question):
def __init__(self, name, query, choices=None, size=7,
default="", color=None, colormap=None):
super().__init__(name, query, default, color, colormap)
self._keys_in_use = [
"Enter", "A... |
#!/usr/bin/env python
# This file is part of tcollector.
# Copyright (C) 2013 The tcollector Authors.
#
# 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, o... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: Rafael Figueroa
"""
dp = True
import numpy as np
DEBUG = False
class H:
"""Hybrid Automata Model"""
def __init__(self, Q, Init_X, Init_qID, state_names = None):
self.q = Q #list of q
self.Init_X = Init_X
self.Init_qID = Init_q... |
# Copyright (c) 2008-2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy... |
# encoding: utf-8
''' Core logics to arrange the word flashcards
Wordbook
A wordbook contains words with their explanations.
Memory
The memory refers to the user's proficiency of words. It records the number of
times the user had recognize each word.
Progress (of task)
Every time the user starts server (more precise... |
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from database_setup import Category, Base, Item, User
engine = create_engine('postgresql://catalog:password@localhost/catalog')
# engine = create_engine('sqlite:///catalog.db')
# Bind the engine to the metadata of the Base class so that th... |
from __future__ import absolute_import
from abc import ABCMeta, abstractmethod
import copy
from data_utils import build_k_indices
from learning_model import *
from regularizer import *
from helpers import save_numpy_array
import numpy as np
class Model(object):
"""
Author: Kaicheng Yu
Machine learning mo... |
from cStringIO import StringIO
from datetime import datetime
import transaction
from pyramid.httpexceptions import HTTPFound, HTTPNotFound
from pyramid.security import authenticated_userid
from pyramid.renderers import render
from pyramid.response import Response
from trumpet.models.sitecontent import SiteText
fro... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""stream data access models"""
from flask import Blueprint, render_template
from micromongo import *
__all__ = ["Entry", "Plugin", "blueprint", "url_prefix"]
blueprint = Blueprint("stream", __name__,
template_folder="templates",
static_folder="static",
)
url_p... |
import os
import datetime
from glob import glob
import re
from tendo import singleton
import paramiko
from scp import SCPClient
from ftplib import FTP
from string import Template
from tempfile import mkstemp
import logging
import io
import utils
log_stream = io.StringIO()
logger = logging.getLogger(__... |
# -*- coding: utf-8 -*-
"""
XMS Client module
"""
from __future__ import absolute_import, division, print_function
try:
from urllib.parse import quote_plus, urlencode
except ImportError:
from urllib import quote_plus, urlencode
import logging
import requests
import clx.xms.__about__
from clx.xms import des... |
# -*- 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 'NoteReferenceNS'
db.create_table(u'main_notereferencens', (
(u'notesection_ptr',... |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import yaml
from .ssa_geo_ts_repository import GeoLocationRepository
from os import path
class YamlGeoLocationError(Exception):
pass
class YamlGeoLocationRepository(GeoLocationRepository):
"""
Provide a yaml-based key-location map for gis-i... |
from django import forms
from django.contrib.admin import widgets
#from django.forms.extras import SelectDateWidget
from coffee_capsules.models import Purchase, PurchaseItem, Request
from coffee_capsules.widgets import SelectedReadonly
class PurchaseForm(forms.ModelForm):
class Meta:
model = Purchase
... |
#!/usr/bin/env python
# This Python file uses the following encoding: utf-8
#
# Copyright (C) 2010-2018 Davide Andreoli <dave@gurumeditation.it>
#
# This file is part of EpyMC, an EFL based Media Center written in Python.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... |
'''
run the CCR scorer on all the groups, including no restriction to a single group
'''
import os
import sys
import json
import subprocess
import multiprocessing
from collections import defaultdict
targets = json.load(open('../../trec-kba-ccr-and-ssf-query-topics-2013-07-16.json'))['targets']
groups = set()
for targ i... |
# From https://gist.github.com/ccsevers/10295174
import os.path
import numpy as np
from .utils import take_subset
from pylearn2.datasets.dataset import Dataset
from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix
from pylearn2.utils.iteration import (SequentialSubsetIterator,
FiniteDatasetIterator,... |
import os
import subprocess as sp
import multiprocessing as mp
import argparse
import lvdb
THIS_FILE_PATH = os.path.dirname(os.path.realpath(__file__))
def llvm_repo(suffix):
return 'https://git.llvm.org/git/' + suffix
def patch(patch_file):
lvdb.set_trace()
sp.call(['git', 'stash'])
sp.check_call([... |
# -*- coding: utf-8 -
#
# This file is part of dj-revproxy released under the MIT license.
# See the NOTICE for more information.
import os
import types
import uuid
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
from django.conf import settings
from restkit.tee import Te... |
# -*- coding: utf-8 -*-
#
# kryptomime documentation build configuration file, created by
# sphinx-quickstart on Wed Nov 20 12:30:16 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... |
import psycopg2 as dbapi2
from flask import request
from flask_login import current_user, login_required, login_user, logout_user
from datetime import date
from dsn_conf import get_dsn
dsn = get_dsn()
def select_suggestions():
with dbapi2.connect(dsn) as connection:
try:
cursor = connection.c... |
# 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... |
# -*- coding: utf-8 -*-
"""
RED Plugin
Copyright (C) 2014-2015 Matthias Bolte <matthias@tinkerforge.com>
Copyright (C) 2014 Olaf Lüke <olaf@tinkerforge.com>
program_page_ruby.py: Program Wizard Ruby Page
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public ... |
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 26 13:54:24 2016
These functions set up the Hamiltonians for various ways of dealing with Cr7Mn
dimers, including the full Spin-1 treatment, the truncated Spin-1/2 treatment,
and the Spin-1/2 rotating frame treatment.
@author: ccollett
"""
import qutip as qt
... |
import unittest
import mock
import sys
import os
sys.path.append(os.path.join(
os.path.dirname(os.path.abspath(os.path.dirname(__file__))),
"lazy_record"))
import base
from base import Base
import lazy_record
class MyModel(Base):
__attributes__ = {
"name": str,
}
__validates__ = {
... |
#!/usr/bin/env python
# XMMS2 - X Music Multiplexer System
# Copyright (C) 2003-2006 XMMS2 Team
#
# This library 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 2.1 of the Licens... |
# This file is part of OpenDrift.
#
# OpenDrift 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, version 2
#
# OpenDrift is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without ev... |
"""AWS Higher Level Abstractions
This module contains higher-level AWS abstractions to make working with
AWS instances and collections of instances easier and less error-prone.
:class:`EC2Instance` is responsible for maintaining information about
itself and updating its state when asked to. The executer passed in
mus... |
#!/usr/bin/env python
"""
General instructions:
python setup.py build
python setup.py install
To include parts that depend on R's survival module, do:
python setup.py build --with-R
Info: This package depends on numpy, and optionally R, RInside
"""
from distutils.core import setup, Extension
import subprocess
... |
# -*- coding: utf-8
# Copyright 2015 Kurt Momberg <kurtqm (at) yahoo(dot)com(dot)ar>
# > Based on work by Klimenko Artyem <aklim007(at)gmail(dot)com>
# >> Based on work by Rob Cherry <zsend(at)lxrb(dot)com>
# >>> Based on work by Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
# License: GNU GPLv2
import struct
imp... |
import os
from django.db import models
from django.contrib.contenttypes import generic
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy as _
from django.core.files.storage import FileSystemStorage
from django.conf import settings
from managers import LinksM... |
"""
StanhopeFramers Tables
"""
import io
import subprocess
import pandas
from stanhope import utils
pandas.set_option('display.max_rows', 999)
pandas.set_option('display.width', 999)
pandas.set_option('display.max_colwidth', 999)
class Table(object):
def __init__(self, *tables):
self.tables = tables or ... |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
r"""
# .---. .-----------
# / \ __ / ------
# / / \( )/ ----- (`-') _ _(`-') <-. (`-')_
# ////// '\/ ` --- ( OO).-/( (OO ).-> .-> \( OO) ) .->
# //// / // : : --- (,------... |
# -*- coding: utf-8 -*-
"""
Copyright (C) 2012-2017, Leif Theden <leif.theden@gmail.com>
This file is part of pytmx.
pytmx 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, ... |
"""
Support for Belkin WeMo lights.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/light.wemo/
"""
import logging
from datetime import timedelta
import blumate.util as util
import blumate.util.color as color_util
from blumate.components.light import (
... |
# 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 t... |
from __future__ import absolute_import
from datetime import datetime
from django.utils import timezone
from sentry.models import ProjectKey
from sentry.testutils import AcceptanceTestCase
class ProjectKeysTest(AcceptanceTestCase):
def setUp(self):
super(ProjectKeysTest, self).setUp()
self.user =... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from decimal import Decimal
from datetime import date, datetime, time, timedelta
from unittest import SkipTest
from django.test.utils import override_settings
from django.test import TestCase
from django.utils import timezone
from import_export import w... |
# -*- 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):
# Changing field 'RuleGroup.action'
db.alter_column('rcal_rulegroup', 'action', self.gf('django.db.models.f... |
import bpy
import mathutils
from Block import Block
class Transparent(Block):
"""A block with a texture that contains transparent or translucent pixels"""
def makeObject(self, x, y, z, metadata):
mesh = bpy.data.meshes.new(name="Block")
mesh.from_pydata([[-0.5,-0.5,-0.5],[0.5,-0.5,-0.5],[-... |
import abc
import logging
import socket
from ballast.compat import unicode
from ballast.exception import BallastException, BallastConfigurationException
from ballast.discovery import ServerList, Server
try:
from dns import resolver, rdatatype, exception
from dns.rdtypes.IN.A import A
from dns.rdtypes.ANY.C... |
import components
def AclContentCacheSimpleTest ():
"""ACL content cache test"""
ctx = components.Context (['a', 'b', 'cc'],\
['ip_a', 'ip_b', 'ip_cc'])
net = components.Network (ctx)
a = components.EndHost(ctx.a, net, ctx)
b = components.EndHost(ctx.b, net, ctx)
... |
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
# Copyright 2014 by Eapii Authors, see AUTHORS for more details.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENCE, distributed with this software.
#------------... |
import abc
class DNABase(metaclass=abc.ABCMeta):
'''
DNABase is the base class for all dna. It defines the abstract methods that
all DNA should have, as well as an __lt__ method for sorting.
'''
__slots__ = ()
#TODO: Add helpers for calling type(self)(...) everywhere
@abc.abstractmethod
... |
import itertools
import gobject
import libqtile.hook
from libqtile.config import Key
from libqtile.command import lazy
def simple_key_binder(mod, keynames=None):
"""
Bind keys to mod+group position or to the keys specified as
second argument.
"""
def func(dgroup):
# unbind all
... |
# Django settings for project project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'... |
# Copyright 2017 The UAI-SDK 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 applicable... |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.18
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... |
# This is the part of the code that sends the emails
import os
import threading
from datetime import datetime, timedelta, date
import calendar
import re
import time
from util.email_sender import send_email
from database.user import get_users, User
from database.feed import get_feed_reports
from database.rules import... |
"""Logging plugins for magicbus."""
from magicbus.compat import ntob, unicodestr
import datetime
import sys
from magicbus.plugins import SimplePlugin
class StreamLogger(SimplePlugin):
default_format = '[%(timestamp)s] (Bus %(bus)s) %(message)s\n'
def __init__(self, bus, stream, level=None, format=None, enc... |
# This is used to draw three comparisons for SGD+BN, SVRG+BN and Streaming SVRG +BN
import matplotlib
import matplotlib.pyplot as plt
plt.switch_backend('agg')
import pylab
import numpy as np
import sys
# all the methods are with BN layers!!!
def deminish(a) :
end_factor=0.4
length = len(a)
for i in ... |
from __future__ import print_function
path = '/home/mkloewer/python/swm/'
import os; os.chdir(path) # change working directory
import numpy as np
from scipy import sparse
import time as tictoc
from netCDF4 import Dataset
import glob
import matplotlib.pyplot as plt
# OPTIONS
runfolder = [2,3]
## read data
for r,i in z... |
#!/usr/bin/env python
# Author: Jeffrey M Kidd
# 2 September 2011
# add-ANC-to-vcf.py
# adds ancestral annotation based on ensemble takes from genome data archive
# you'll have to do your own filtering based on qual etc.
import sys
import os
import genomedata
import math
from genomedata import Genome
from optparse im... |
from django import forms
from models import TestModel, TestModelNoValidate, TestElement
from validatedfile.fields import QuotaValidator
class TestModelForm(forms.ModelForm):
class Meta:
model = TestModel
class TestModelNoValidateForm(forms.ModelForm):
class Meta:
model = TestModelNoValidat... |
import json
from datetime import datetime
import happybase
from pyspark import SparkContext, SparkConf
TTransportException = happybase._thriftpy.transport.TTransportException
def get_create_table(table_name, conn, families={'info': dict()}):
try:
# what exception would be raised if table does not exist, a... |
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
#
# Copyright (C) University College London, 2007-2012, all rights reserved.
#
# This file is part of HemeLB and is provided to you under the terms of
# the GNU LGPL. Please see LICENSE in the top level directory for full
# details.
#
import wx
# from wx.lib.masked import NumCtrl, EVT_NUM
from HemeLbSetupTool.Bind... |
#
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#
import logging
import dns.name
import re
try:
from xml.etree import cElementTree as etree
except ImportError:
from xml.etree import ElementTree as etree
from ipapython import ipa_log_manager, ipautil
from ipaserver.dnssec.opendnssec impor... |
from __future__ import (absolute_import, print_function, unicode_literals, division)
__author__ = 'emil'
from .ServerSide import (Manager)
from .Utils import (InvalidUserInput, DummyLogger, RemoteExecutionLogger, WrappedProxy, Commandline)
from .Environments import (communication_environment, execution_environment, E... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/home/grossmj/workspace/git/gns3-gui/gns3/modules/dynamips/ui/atm_bridge_configuration_page.ui'
#
# Created: Sun Mar 16 11:16:57 2014
# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
from PyQt... |
import sys
import numpy as np
import ctypes as ct
import pyopencl as cl
import pyopencl.array
import time
import argparse
FUT_BLOCK_DIM = "16"
cl_group_size = np.int32(512)
synchronous = False
fut_opencl_src = """typedef char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long int64_t;
typede... |
"""
Stub implementation of LTI Provider.
What is supported:
------------------
1.) This LTI Provider can service only one Tool Consumer at the same time. It is
not possible to have this LTI multiple times on a single page in LMS.
"""
import base64
import hashlib
import logging
import os
import textwrap
from uuid i... |
# TmLibrary - TissueMAPS library for distibuted image analysis routines.
# Copyright (C) 2016 Markus D. Herrmann, University of Zurich and Robin Hafen
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Softwa... |
# Copyright (c) 2013 - The IBus Cangjie authors
#
# This file is part of ibus-cangjie, the IBus Cangjie input method engine.
#
# ibus-cangjie 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... |
# GemRB - Infinity Engine Emulator
# Copyright (C) 2003 The GemRB Project
#
# 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 versi... |
def find_rigid_transform(a, b, visualize=False):
"""
Args:
a: a 3xN array of vertex locations
b: a 3xN array of vertex locations
Returns: (R,T) such that R.dot(a)+T ~= b
Based on Arun et al, "Least-squares fitting of two 3-D point sets," 1987.
See also Eggert et al, "Estimating 3-D ... |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import inspect
import types
from django.apps import apps
from django.core.checks import Error, Tags, register
@register(Tags.models)
def check_all_models(app_configs=None, **kwargs):
errors = []
for model in apps.get_models():
... |
#
# libtcod 1.5.1 python wrapper
# Copyright (c) 2008,2009,2010 Jice & Mingos
# 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 co... |
#! /usr/bin/env python
import requests
from pprint import pprint
class Words(object):
"""A class that interfaces with the Words API at https://wordsapi.com"""
pretty_print_error = ValueError('You must enter \'on\' or \'off\' to toggle the pretty print setting. Please enter a valid input.')
detail_error ... |
#!/usr/bin/python
"""
A module to calculate the current, the conductance and the TMR from
a set of rate arrays.
The rate arrays are supposed to be stored in a h5 file in the job directory.
The result is stored in a h5 file. The name of the dataset contains all
parameters. They are also stored as attributes in the datas... |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Resources\ui_files\export_wizard.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_ExportWizard(object):
def setupUi(self, ... |
import mock
from chroma_core.models import VolumeNode
from tests.unit.lib.iml_unit_test_case import IMLUnitTestCase
from chroma_core.services.plugin_runner import AgentPluginHandlerCollection
from tests.unit.chroma_core.helpers import synthetic_host, synthetic_volume_full
from tests.unit.chroma_core.helpers import loa... |
# -*- coding: utf-8 -*-
# © 2016 Serpent Consulting Services Pvt. Ltd. (http://www.serpentcs.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import http
from openerp.http import request
from openerp.addons.website_sale.controllers.main import QueryURL, website_sale
class WebsiteSale... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.