code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
from pypers.core.step import Step
from pypers.steps.mothur import Mothur
import os
import json
import re
class MothurSeqError(Mothur):
spec = {
'name' : 'MothurSeqError',
'version' : '20151109',
'descr' : [
'The seq.error command reads a query alignment file and a referenc... | frankosan/pypers | pypers/steps/mothur/MothurSeqError.py | Python | gpl-3.0 | 2,540 |
# -*- coding: utf-8 -*-
# This file is part of IRIS: Infrastructure and Release Information System
#
# Copyright (C) 2013 Intel Corporation
#
# IRIS is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2.0 as published by the Free Software Foundation.... | gttechsign/iris-panel | iris/packagedb/apiurls.py | Python | gpl-2.0 | 1,448 |
#!/usr/bin/python3
#https://docs.python.org/2.6/library/logging.html
import logging
import logging.handlers
def setup(lfile, level):
#levels:
#logging.DEBUG,
#logging.INFO
#logging.WARNING
#logging.ERROR
#logging.CRITICAL
#log handle
mylog = logging.getLogger(lfile)
mylog.se... | thirschbuechler/ubuntu-recentquicklists | log3.py | Python | mit | 756 |
VGG_MEAN = [104, 117, 123]
def create_yahoo_image_loader(expand_dims=True):
"""Yahoo open_nsfw image loading mechanism
Approximation of the image loading mechanism defined in
https://github.com/yahoo/open_nsfw/blob/79f77bcd45076b000df71742a59d726aa4a36ad1/classify_nsfw.py#L40
"""
import numpy as ... | sankit1/cv-tricks.com | Tensorflow-tutorials/Not-Safe-For-Work-Detection/image_utils.py | Python | mit | 4,492 |
# Definition for a binary tree node
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param A : root node of tree
# @return a list of list of integers
def zigzagLevelOrder(self, A):
output, temp = list(),... | purushothamc/myibitsolutions | trees/zigzag_traversal.py | Python | gpl-3.0 | 1,147 |
# -*- coding: utf-8 -*-
"""
Note views
"""
import os
from django.conf import settings
from django.views import generic
from django.shortcuts import get_object_or_404
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext_lazy as _
from django.contrib import messages
from django.util... | emencia/emencia-django-bazar | bazar/views/note.py | Python | mit | 6,422 |
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/boto/ec2/cloudwatch/dimension.py | Python | agpl-3.0 | 1,532 |
'''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
from multiprocessing import Process
import threading
import functools
import time
import os
import sys
import signal
import simplejson as json
import zmq
from keylime import config
from keylime import crypto
from keylim... | mit-ll/python-keylime | keylime/revocation_notifier.py | Python | bsd-2-clause | 5,242 |
"""Util for Conversation."""
import re
def create_matcher(utterance):
"""Create a regex that matches the utterance."""
# Split utterance into parts that are type: NORMAL, GROUP or OPTIONAL
# Pattern matches (GROUP|OPTIONAL): Change light to [the color] {name}
parts = re.split(r"({\w+}|\[[\w\s]+\] *)",... | fbradyirl/home-assistant | homeassistant/components/conversation/util.py | Python | apache-2.0 | 1,195 |
# -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <codecell>
from pyndamics import Simulation
# <markdowncell>
# From http://wiki.scipy.org/Cookbook/CoupledSpringMassSystem
# <codecell>
sim=Simulation()
sim.add("x1'=y1",0.5,plot=1)
sim.add("y1'=(-b1 * y1 - k1 * (x1 - L1) + k2 * (x2 - x1 - L2)) / m1",0.0,plot=F... | bblais/pyndamics | examples/Systems of Equations.py | Python | mit | 5,694 |
"""
EINLEITUNG
Willkommen in der Lernreihe fuer die Programmiersprache Python!
Hier werden wir uns mit den Grundlagen, aber auch Fortgeschrittenen
Themen Python's auseinandersetzen.
Jeder kann in diesem Moment sein erstes Python Programm schreiben
und ausfuehren, ohne ein Programm zu installieren.
Dazu gibt es im ... | PlayLucky/PythonTutorials | Chapter1-BuildingACalculator/Lesson0-Hello.py | Python | mit | 1,717 |
# Copyright 2015 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... | petewarden/tensorflow | tensorflow/python/kernel_tests/conv_ops_test.py | Python | apache-2.0 | 128,733 |
# usr/bin/python
def averagepitch_calc(y):
s=0 # Filter out the unvoiced regions
length=len(y)
for i in range(0,length):
val=y[i]
if val[0] == '-':
y[i] = '0'
count =0 # Calculate the average only on the voiced reg... | saikrishnar/AudioRenderingofSTEM | systems/technique4/code/pitchChangeDetector.py | Python | apache-2.0 | 3,129 |
# This file is part of the myhdl library, a Python package for using
# Python as a Hardware Description Language.
#
# Copyright (C) 2003-2008 Jan Decaluwe
#
# The myhdl 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 t... | hgomersall/myhdl | myhdl/test/core/test_traceSignals.py | Python | lgpl-2.1 | 5,575 |
from Screen import Screen
from Components.ActionMap import ActionMap
from Components.Harddisk import harddiskmanager
from Components.MenuList import MenuList
from Components.Label import Label
from Components.Pixmap import Pixmap
from Screens.MessageBox import MessageBox
import Components.Task
# [iq
from Components.co... | pli3/enigma2-git | lib/python/Screens/HarddiskSetup.py | Python | gpl-2.0 | 7,215 |
from hwt.synthesizer.interface import Interface
from hwt.synthesizer.unit import Unit
from ipCorePackager.constants import INTF_DIRECTION
def connect_to_const(val, intf: Interface):
"""
Connect constant to all output ports, used mainly during the debbug
to dissable interface
"""
if intf._interface... | Nic30/HWToolkit | hwt/synthesizer/interfaceLevel/emptyUnit.py | Python | mit | 873 |
from libqtile.command.graph import * # noqa
from libqtile.log_utils import logger
logger.warning(
'libqtile.command_graph is deprecated. '
'It has been moved to libqtile.command.graph'
)
| ramnes/qtile | libqtile/command_graph.py | Python | mit | 197 |
# coding: utf-8
from django.conf.urls import patterns, url
from klebercode.blog.views import (EntryYearArchiveView, EntryMonthArchiveView,
EntryDayArchiveView, EntryListView,
EntryDateDetailView,
# EntryDetailViewA... | klebercode/klebercode | klebercode/blog/urls.py | Python | gpl-2.0 | 1,391 |
# 各組分別在各自的 .py 程式中建立應用程式 (第1步/總共3步)
from flask import Blueprint, render_template
# 利用 Blueprint建立 ag1, 並且 url 前綴為 /ag1, 並設定 template 存放目錄
ag6_40323152 = Blueprint('ag6_40323152', __name__, url_prefix='/ag6_40323152', template_folder='templates')
# 展示傳回 Brython 程式
@ag6_40323152.route('/A')
def task1():
outstring =... | 2015fallhw/cdw2 | users/s2a/g6/ag6_40323152_task1.py | Python | agpl-3.0 | 7,671 |
# -----------------------------------------------------------------------------
# yacc_nodoc.py
#
# Rule with a missing doc-string
# -----------------------------------------------------------------------------
import sys
if ".." not in sys.path: sys.path.insert(0,"..")
import ply.yacc as yacc
from calclex import tok... | dpac-vlsi/SynchroTrace | util/ext/ply/test/yacc_nodoc.py | Python | bsd-3-clause | 1,506 |
# Copyright 2010-2014 Google
# 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, so... | legrosbuffle/or-tools | ortools/graph/__init__.py | Python | apache-2.0 | 732 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# 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 compli... | aristanetworks/arista-ovs-nova | nova/image/s3.py | Python | apache-2.0 | 16,276 |
# coding: utf-8
"""
OpenAPI spec version:
Generated by: https://github.com/swagger-api/swagger-codegen.git
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
... | detiber/lib_openshift | lib_openshift/models/v1_persistent_volume_status.py | Python | apache-2.0 | 5,219 |
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from juakstore.registration.forms import RegistrationForm
class SimpleBackendViewTests(TestCase):
urls = 'registration.backends.simple.urls'
def test_all... | CSC301H-Fall2013/JuakStore | Storefront/juakstore/juakregister/tests/simple_backend.py | Python | mit | 3,480 |
#!/usr/bin/env python
import os
import re
import sys
import codecs
import argparse
import itertools
from pylinkgrammar.linkgrammar import Parser, ParseOptions
PARSE_VIA_REGEX = True
# Make sure utf8 chars don't break consumers (e.g. if consuming via a pipe from Node)
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
... | ross-nordstrom/LogicSolver | parser/lib/parse.py | Python | mit | 26,869 |
listaidademenorde18 = []
listaidademaiorde18 = []
while True:
try:
idade = int(input('Digite a idade da pessoa: '))
break
except ValueError:
pass
if idade < 18:
listaidademenorde18.append(idade)
else:
listaidademaiorde18.append(idade)
print(listaidademenorde18)
print(listaidademaior... | bigown/SOpt | Python/Algorithm/ExceptElse.py | Python | mit | 370 |
# -*- coding:utf-8 -*-
import time
from spiders.__Global_function import get_localtime
REPORT_SAVEDIR = "/var/lib/spider_save/reports"
LOGGING_SAVEDIR = "/var/lib/spider_save/logging"
# now_time = get_localtime(time.strftime("%Y-%m-%d", time.localtime()))
now_time = 20150101
end_time = 20991212
| AnselCmy/ARPS | report_crawler/report_crawler/spiders/__Global_variable.py | Python | mit | 299 |
from django import forms
from django.contrib.auth import get_user_model
from django.contrib.auth.forms import (
ReadOnlyPasswordHashField,
PasswordResetForm as DjangoPasswordResetForm)
from django.contrib.auth.tokens import default_token_generator
from django.contrib.sites.models import get_current_site
from dj... | funkbit/django-funky-user | funky_user/forms.py | Python | bsd-2-clause | 3,202 |
#! /usr/bin/env python
# Copyright 2007 Andreas Berger
#
# 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 prog... | 0xalen/opencaster_isdb-tb | libs/dvbobjects/dvbobjects/PSI/INT.py | Python | gpl-2.0 | 2,848 |
# Programar em Python #27 - Ficheiros (Ler e Escrever)
escreverFicheiro = open('27-Ficheiros-Ler-e-Escrever.txt', 'w');
escreverFicheiro.write('Eu estou a escrever na primeira linha deste ficheiro!\n');
escreverFicheiro.write('Agora estou a escrever na segunda linha!');
escreverFicheiro.close();
lerFicheiro = open('2... | caffeinealgorithm/youtube-videos-source-code | Programar em Python/27-Ficheiros-Ler-e-Escrever.py | Python | mit | 406 |
#!/usr/bin/env python3
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
d = generate_distutils_setup(
packages=['lg_builder'],
package_dir={'': 'src'},
scripts=['scripts/lg-ros-build'],
install_requires=['catkin_pkg', 'python-debian', 'rospkg']
)
setup(**d... | EndPointCorp/lg_ros_nodes | lg_builder/setup.py | Python | apache-2.0 | 322 |
"""codebloga URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.9/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-b... | sartim/codebloga | codebloga/urls.py | Python | gpl-3.0 | 1,956 |
"""Pretraining on TPUs."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from absl import app
from absl import flags
import absl.logging as _logging # pylint: disable=unused-import
import numpy as np
import tensorflow as tf
import model_utils... | zihangdai/xlnet | train.py | Python | apache-2.0 | 9,662 |
#! /usr/bin/env python
"""
plock[pbtest]% python ~/mwa/bin/make_beam.py -f P00_w.fits -v
# INFO:make_beam: Computing for 2011-09-27 14:05:06+00:00
# INFO:make_beam: Created primary beam for 154.24 MHz and delays=0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# INFO:make_beam: XX beam written to P00_w_beamXX.fits
# INFO:make_beam: YY... | ryandougherty/mwa-capstone | MWA_Tools/scripts/make_beam.py | Python | gpl-2.0 | 4,701 |
from django.utils.translation import ugettext_lazy as _
from livesettings import *
SHIP_MODULES = config_get('SHIPPING', 'MODULES')
# No need to add the choice, since it is in by default
# SHIP_MODULES.add_choice(('shipping.modules.per', _('Per piece')))
SHIPPING_GROUP = config_get_group('SHIPPING')
config_register... | mitchellzen/pops | satchmo/apps/shipping/modules/per/config.py | Python | bsd-3-clause | 1,029 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
validation.py |github|
----------------------
Validates the code against :py:obj:`batman` for transit light curves
and against a direct (brute force) integration of the radiance map for
planet-planet occultations.
.. plot::
:align: center
from script... | rodluger/planetplanet | scripts/validation.py | Python | gpl-3.0 | 7,672 |
#!/usr/bin/env python
# -*- 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 Licen... | Fokko/incubator-airflow | airflow/bin/cli.py | Python | apache-2.0 | 44,259 |
#coding:utf-8
#################################
#Copyright(c) 2014 dtysky
#################################
import G2R
class HpcBgSp(G2R.SpSyntax):
def Show(self,Flag,Attrs,UT,Tmp,FS):
sw=''
AttrsOrg=dict(Attrs)
nameHpc,AttrsHpc=self.Check(Flag['hpc'],Attrs['hpc'],UT,FS)
nameBg,AttrsBg=self.Check(Flag,Attrs[F... | dtysky/Gal2Renpy | Gal2Renpy/SpSyntax/HpcBgSp.py | Python | mit | 750 |
import pandas as pd
| masterxyth/bcvotes | testing.py | Python | gpl-3.0 | 20 |
"""
Processes to fetch data from GBIF data base
Author: Nils Hempelmann (info@nilshempelmann.de)
"""
from pywps.Process import WPSProcess
from flyingpigeon.log import init_process_logger
import logging
logger = logging.getLogger(__name__)
class GBIFfetchProcess(WPSProcess):
def __init__(self):
WPSProc... | KatiRG/flyingpigeon | flyingpigeon/processes/wps_sdm_gbiffetch.py | Python | apache-2.0 | 4,860 |
import shutil
import os
import hashlib
import dockbot
def gen_hash(data):
return hashlib.sha256(data).hexdigest()
class Image(object):
def __init__(self, root, name, path, platform = None, projects = [],
modes = None, slave = False, remote = False):
self.root = root
self.con... | CauldronDevelopmentLLC/dockbot | dockbot/Image.py | Python | gpl-3.0 | 6,147 |
#!/usr/bin/python
import logging
import pyvips
logging.basicConfig(level=logging.DEBUG)
a = pyvips.Image.black(100, 100)
a.write_to_file("x.v")
| kleisauke/pyvips | examples/try9.py | Python | mit | 149 |
# This file was created automatically by SWIG 1.3.29.
# Don't modify this file, modify the SWIG interface instead.
import _richtext
import new
new_instancemethod = new.instancemethod
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
if (name == "thisown"): return self.this.own(value)
i... | ktan2020/legacy-automation | win/Lib/site-packages/wx-3.0-msw/wx/richtext.py | Python | mit | 189,832 |
#!/usr/bin/python
import re, csv, sys
from urlparse import urlparse
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize, sent_tokenize
from nltk.text import TextCollection
#process command line arguments
if len(sys.argv) < 2:
print "ERROR: arg1: must specify the input file"
print " ... | satybald/twitter-modeling-lda | source code/preprocess.py | Python | mit | 5,802 |
import scipy.stats as meas
def evaluation(predict, gold):
"""
pearsonr of predict and gold
:param predict: list
:param gold: list
:return: mape
"""
pearsonr = meas.pearsonr(predict, gold)[0]
return pearsonr
def eval_file(predict_file, gold_feature_file):
predict = open(predict_fi... | fssqawj/classification_task | stst/evaluation.py | Python | mit | 2,319 |
# Copyright 2017 MakeMyTrip (Kunal Aggarwal, Avinash Jain)
#
# This file is part of WebGuard.
#
# WebGuard 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)... | makemytrip/webGuard-Server | api/urls.py | Python | gpl-3.0 | 2,078 |
# 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... | dtroyer/python-openstacksdk | openstack/cloud/_security_group.py | Python | apache-2.0 | 16,266 |
# Copyright 2012, Nachi Ueno, NTT MCL, 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
#
# Unles... | shakamunyi/neutron-dvr | neutron/agent/securitygroups_rpc.py | Python | apache-2.0 | 12,495 |
from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from datetime import date, time, datetime
from django.core.validators import RegexValidator
# Create your models here.
#list of all choices for colleges
College = (
('CAMD', 'CAMD'),
('CCIS', 'CCIS'),
... | ServiceLearningB/ServiceLearningNew | submit_reports/models.py | Python | mit | 5,288 |
import urllib2
from pyosm.parsing import iter_osm_file, iter_osm_change_file
class Api(object):
def __init__(self, base_url='https://api.openstreetmap.org/api'):
self._base = base_url
self.USER_AGENT = 'pyosm/1.0 (http://github.com/iandees/pyosm)'
def _get(self, path, params={}):
head... | iandees/pyosm | pyosm/api.py | Python | mit | 2,668 |
""" A set of common tools to be used in pilot commands
"""
__RCSID__ = '$Id$'
import sys
import time
import os
import pickle
import getopt
import imp
import urllib2
import signal
def printVersion( log ):
log.info( "Running %s" % " ".join( sys.argv ) )
try:
with open( "%s.run" % sys.argv[0], "w" ) as fd:
... | petricm/DIRAC | WorkloadManagementSystem/PilotAgent/pilotTools.py | Python | gpl-3.0 | 18,473 |
LISTSHINE_API_BASE = 'https://send.listshine.com/api/v1/'
| sircco/pylistshine | pylistshine/constants.py | Python | apache-2.0 | 58 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import decimal
import unittest
from django.template.defaultfilters import (
add, addslashes, capfirst, center, cut, date, default, default_if_none,
dictsort, dictsortreversed, divisibleby, escape, escapejs_filter,
filesizeform... | TimBuckley/effective_django | tests/defaultfilters/tests.py | Python | bsd-3-clause | 34,161 |
#!/usr/bin/python
# -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
### BEGIN LICENSE
# This file is in the public domain
### END LICENSE
import sys
import os.path
import unittest
sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), "..")))
from firstboot import AboutFi... | System25/gecosws-config-assistant | tests/test_example.py | Python | gpl-2.0 | 836 |
# -*- encoding: utf8 -*-
import os
brown = os.path.join(os.path.dirname(__file__), 'english-brown.txt')
cmudict = os.path.join(os.path.dirname(__file__), 'english-cmudict.dx1')
| jacksonllee/lxa5 | linguistica/datasets/__init__.py | Python | mit | 179 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2015 Cristian van Ee <cristian at cvee.org>
# Copyright 2015 Igor Gnatenko <i.gnatenko.brain@gmail.com>
# Copyright 2018 Adam Miller <admiller@redhat.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future_... | dpassante/ansible | lib/ansible/modules/dnf.py | Python | gpl-3.0 | 51,820 |
import py_isear.enums as enums
import csv
class IsearSubset:
def __init__(self,
labels,
values):
self.labels = labels
self.values = values
class IsearDataSet:
def __init__(self,
data=IsearSubset([], []),
target=IsearSubset... | sinmaniphel/py_isear_dataset | py_isear/isear_loader.py | Python | gpl-3.0 | 6,006 |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#
# This library is free software; you can redistribute it and/or
# modify it under the ... | FedoraScientific/salome-kernel | bin/searchFreePort.py | Python | lgpl-2.1 | 4,236 |
#! /usr/bin/env python
###############################################################################
#
# simulavr - A simulator for the Atmel AVR family of microcontrollers.
# Copyright (C) 2001, 2002 Theodore A. Roth
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of th... | simark/simulavr | regress/test_opcodes/test_BLD.py | Python | gpl-2.0 | 2,630 |
from django.conf.urls import url
import trigger.views
urlpatterns = [
url(r'^(?P<trigger_id>\d+)/render/$', trigger.views.render_trigger_params, name='render_trigger_params'),
]
| theju/dtwt | trigger/urls.py | Python | mit | 185 |
# coding: utf-8
"""Tests for IPython.lib.pretty."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from collections import Counter, defaultdict, deque, OrderedDict
import types
import string
import unittest
import nose.tools as nt
from IPython.lib import pretty... | unnikrishnankgs/va | venv/lib/python3.5/site-packages/IPython/lib/tests/test_pretty.py | Python | bsd-2-clause | 11,154 |
SQL = """
create table users
(
username varchar primary_key unique not null, -- username
password varchar not null, -- encrypted password
is_superuser boolean not null default 0, -- is admin user
created timestamp not null, -- user creation timestamp
... | Outernet-Project/broadcast-portal | broadcast/migrations/sessions/01_add_users_table.py | Python | gpl-3.0 | 594 |
from django.conf.urls import patterns, url
from corpus import views
from corpus import api
urlpatterns = patterns(
'',
# Next item to label
url(r'^next_segment_to_label/(?P<relation_id>\d+)/',
views.next_segment_to_label,
name='next_segment_to_label'),
url(r'^next_document_to_label/(?P... | machinalis/iepy | iepy/webui/corpus/urls.py | Python | bsd-3-clause | 2,591 |
# -*- coding: utf-8 -*-
#
# EAV-Django is a reusable Django application which implements EAV data model
# Copyright © 2009—2010 Andrey Mikhaylenko
#
# This file is part of EAV-Django.
#
# EAV-Django is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Pu... | buremba/eav-django | eav/forms.py | Python | lgpl-3.0 | 9,003 |
from distutils.core import setup
setup(
name='TFCommon',
version='0.2',
packages=[''],
url='',
license='',
author='Alex M. Wang',
author_email='nanqiao15@126.com',
description='Common modules for tensorflow developer', requires=['six', 'tensorflow']
)
| MU94W/TFCommon | setup.py | Python | mit | 285 |
# 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... | sachinpro/sachinpro.github.io | tensorflow/python/training/momentum_test.py | Python | apache-2.0 | 17,251 |
# coding=utf-8
from __future__ import absolute_import, division, print_function
__author__ = "Gina Häußge <osd@foosel.net>"
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
fr... | JackGavin13/octoprint-test-not-finished | src/octoprint/server/api/connection.py | Python | agpl-3.0 | 3,323 |
#!/usr/bin/env python
# encoding: utf-8
__author__ = "Carlos González Sesmero"
# When import with * symbol.
__all__ = ["filecorrector", "mailing", "utilidades"]
# print("Importamos {} en el path {}".format(__name__, __path__)) | carlos-gs/MiStuRe | misture_core/MISTURE/utils/__init__.py | Python | gpl-3.0 | 227 |
"""
Test receiving delayed (offline) messages on a text channel.
"""
import datetime
from twisted.words.xish import domish
from gabbletest import exec_test
from servicetest import assertEquals
import constants as cs
def test(q, bus, conn, stream):
m = domish.Element((None, 'message'))
m['from'] = 'foo@bar.... | Ziemin/telepathy-gabble | tests/twisted/text/test-text-delayed.py | Python | lgpl-2.1 | 1,382 |
from morsel.panda import *
from morsel.morselc import ShaderProgram as CShaderProgram
#-------------------------------------------------------------------------------
class ShaderProgram(CShaderProgram):
def __init__(self, filename = None, node = None, **kargs):
super(ShaderProgram, self).__init__(filename)
... | kralf/morsel | python/lib/morsel/utility/shader_program.py | Python | gpl-2.0 | 416 |
# We use the signal handler for long running condor jobs to save
# output and stop the solver
def signal_handler(signal, frame):
logging.warning('Received external Interrupt signal. Solvers will stop and save data')
logging.warning('Exiting.')
exit(0)
import signal
signal.signal(signal.SIGINT, signal_handl... | daajoe/asp_horn_backdoors | signal_handling.py | Python | gpl-2.0 | 370 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-23 20:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('podcast', '0015_show_type'),
]
operations = [
migrations.AlterField(
... | richardcornish/django-itunespodcast | podcast/migrations/0016_auto_20170923_2000.py | Python | bsd-3-clause | 478 |
from wayf.utils import ShibbolethMetadata
# optional for now , getUserRealm
import time
from django.shortcuts import render_to_response
from django.conf import settings
from django.http import HttpResponseRedirect
from django.utils.http import urlencode
from django.template import RequestContext
def wayf(request):
... | JensTimmerman/django-wayf | wayf/views.py | Python | gpl-3.0 | 9,435 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'G:\WorkDir\gas-sensing_resistors\SC_spectrum\SC_main.ui'
#
# Created: Wed Jan 20 20:49:15 2016
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from Rt_mplCa... | cygnushan/measurement | SC_spectrum/Ui_SC_main.py | Python | mit | 31,084 |
# pylint: disable-msg=C0111,C0103
import unittest
from traits.api import Event
from openmdao.main.api import Assembly, Component, Driver, set_as_top, VariableTree
from openmdao.main.container import _get_entry_group
from openmdao.main.datatypes.api import Float, Int, VarTree
from openmdao.main.driver import GradientO... | HyperloopTeam/FullOpenMDAO | lib/python2.7/site-packages/openmdao.main-0.13.0-py2.7.egg/openmdao/main/test/test_driver.py | Python | gpl-2.0 | 3,731 |
import urllib.parse
import sys
from ccs import core
from ccs import constants
from . import response
def ticker():
s = __name__.split(".")[1]
r = sys._getframe().f_code.co_name
# complete request
cr = core.request(s, r)
return core.get(core.hostname(s), cr, core.header(s), core.compression(s), c... | Honzin/ccs | dev/exmo/public/__init__.py | Python | agpl-3.0 | 1,507 |
import logging
import os
import pickle
import subprocess
import sys
import uuid
from datetime import datetime
from mwclient import Site
from PythonConfluenceAPI import ConfluenceAPI
import Configuration
from CustomModules.Mechanics import ContributionComparator, ExclusionsDict, MysqlConnector
from CustomModules.SQL_Co... | daymer/xWIKI_Karma | Comparer_task_builder.py | Python | apache-2.0 | 10,592 |
#! /usr/bin/env python
# -*- coding=utf-8 -*-
def addDigits(num):
while(1):
sum= 0
for i in xrange(len(str(num))):
sum+= int(str(num)[i])
if len(str(sum))== 1:
return sum
else:
num= sum
| ccqpein/Arithmetic-Exercises | Add-Digits/add_digits.py | Python | apache-2.0 | 260 |
# -*- coding: utf-8 -*-
import importlib
import io
import json
import os
import kolibri
EXTERNAL_PLUGINS_PREFIX = "kolibri_"
def is_external_plugin(appname):
"""
Returns true when the given app is an external plugin.
Implementation note: does a simple check on the name to see if it's
prefixed with ... | lyw07/kolibri | kolibri/utils/i18n.py | Python | mit | 1,177 |
from itertools import combinations
import pytest
import networkx as nx
from networkx.algorithms.flow import boykov_kolmogorov
from networkx.algorithms.flow import edmonds_karp
from networkx.algorithms.flow import preflow_push
from networkx.algorithms.flow import shortest_augmenting_path
from networkx.algorithms.flow i... | sserrot/champion_relationships | venv/Lib/site-packages/networkx/algorithms/flow/tests/test_gomory_hu.py | Python | mit | 4,616 |
#!/usr/bin/env python
from htcondor_dag import Dag, autorun
# Two jobs, each writes text to its output file
def print_sum(a, b):
print a + b
autorun(report_hostname=True)
dag = Dag('htcondor_ex1')
dag.defer(print_sum, output="res1.txt")(1, 2)
dag.defer(print_sum, output="res2.txt")(3, 4)
dag.write()
| candlerb/htcondor_dag.py | examples/htcondor_ex1.py | Python | gpl-2.0 | 312 |
#!/usr/bin/env python
import os
import sys
import unittest
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..",
"scripts")))
from topic_compare import ROSTopicCompare
import rospy
import time
def eps_equal(a, b, err=0.001):
return abs(... | AtsushiSakai/jsk_visualization_packages | jsk_topic_tools/test/test_topic_compare.py | Python | mit | 1,425 |
from __future__ import absolute_import, unicode_literals
import io
import itertools
import logging
import os.path
import re
from mopidy import compat
from mopidy.compat import configparser
from mopidy.config import keyring
from mopidy.config.schemas import * # noqa
from mopidy.config.types import * # noqa
from mopi... | dbrgn/mopidy | mopidy/config/__init__.py | Python | apache-2.0 | 9,890 |
from django import template
from django.template.loader import get_template
import itertools
register = template.Library()
def grouper(n, iterable, fillvalue=None):
"grouper(3, 'ABCDEFG', 'x') --> ABC DEF Gxx"
args = [iter(iterable)] * n
return itertools.izip_longest(fillvalue=fillvalue, *args)
@registe... | alixedi/django_reform | reform/templatetags/reform.py | Python | bsd-3-clause | 1,627 |
# -*- coding: utf-8 -*-
from django.db import connection
from django_orm.postgresql.aggregates import Unaccent
from django.utils.unittest import TestCase
from .models import Person
class TestUnaccent(TestCase):
def setUp(self):
self.p1 = Person.objects.create(name='Andréi')
self.p2 = Person.objec... | EnTeQuAk/django-orm | tests/aggregates_unaccent_app/tests.py | Python | bsd-3-clause | 671 |
"""Support for Nanoleaf Lights."""
import logging
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_EFFECT, ATTR_HS_COLOR,
ATTR_TRANSITION, PLATFORM_SCHEMA, SUPPORT_BRIGHTNESS,
SUPPORT_COLOR, SUPPORT_COLOR_TEMP, SUPPORT_EFFECT,
SUPPORT_TRANSIT... | MartinHjelmare/home-assistant | homeassistant/components/nanoleaf/light.py | Python | apache-2.0 | 6,951 |
import datetime
import pytz
from dateutil.tz import tzoffset
from django.utils import timezone
from radioco.apps.radioco.utils import memorize
timestamp = datetime.datetime(2009, 1, 1) # any unambiguous timestamp will work here
class GMT(tzoffset):
"""
GMT implementation, it has a fixed offset
"""
... | iago1460/django-radio | radioco/apps/radioco/tz_utils.py | Python | gpl-3.0 | 3,902 |
"""
Transfer Student Management Command
"""
from textwrap import dedent
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.db import transaction
from opaque_keys.edx.keys import CourseKey
from common.djangoapps.student.models import CourseEnrollment
from comm... | eduNEXT/edunext-platform | common/djangoapps/student/management/commands/transfer_students.py | Python | agpl-3.0 | 3,295 |
#!/usr/bin/env python
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2017 DataONE
#
# Licensed under the Apache License, Version 2.0 (t... | DataONEorg/d1_python | utilities/src/d1_util/create_object_on_member_node.py | Python | apache-2.0 | 3,005 |
from sklearn import svm
from scipy.misc import imresize
import glob
import cv2
import numpy as np
import pickle
from sklearn.model_selection import train_test_split
import matplotlib.image as mpimg
from sklearn.preprocessing import LabelBinarizer
from keras.models import Sequential
from keras.layers.core import Dense,... | strotz/SDC-Projects | project4/cardetect.py | Python | mit | 3,317 |
# benchmark.py Simple benchmark for umqtt.simple
# Assumes simple.py (from micropython-lib) is copied to ESP8266
# Outcome with mosquitto running on a Raspberry Pi on wired network,
# Wemos D1 Mini running on WiFi: echo received in max 154 ms min 27 ms
import ubinascii
from simple import MQTTClient
from machine import... | peterhinch/micropython-samples | ESP8266/benchmark.py | Python | mit | 1,796 |
"""Module to handle entering building"""
from game import entry_fee_checker
from game import resource
class AlreadyOccupiedError(Exception):
pass
class NotEnoughEntryFeeError(Exception):
pass
class NotPickedEnoughEntryFeeError(Exception):
pass
class EnterBuildingHandler(object):
def __init__(self, building... | chiang831/LeHavre | src/game/enter_building_handler.py | Python | gpl-2.0 | 1,876 |
import cv2
import numpy as np
from picamera.array import PiRGBArray
from picamera import PiCamera
import scipy.misc
import cPickle
import os
import time
os.chdir("//home//pi/Desktop//Image_db/")
import warnings
warnings.filterwarnings('error', category=DeprecationWarning)
def rgb2gray(rgb):
return np.dot(rgb[:,:... | mdomarsaleem/Facial_Plan | Database creation/database_cv.py | Python | mit | 3,294 |
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 t... | wimac/home | Dropbox/skel/bin/sick-beard/sickbeard/searchBacklog (MOU-CDQT5R1's conflicted copy 2012-04-11).py | Python | gpl-2.0 | 7,632 |
"""The test for sensor device automation."""
from datetime import timedelta
import pytest
import homeassistant.components.automation as automation
from homeassistant.components.sensor import DOMAIN
from homeassistant.components.sensor.device_trigger import ENTITY_TRIGGERS
from homeassistant.const import CONF_PLATFORM... | sdague/home-assistant | tests/components/sensor/test_device_trigger.py | Python | apache-2.0 | 14,830 |
from flask import session
from appconfig import *
class UserModel:
def __init__(self):
from models import Tag
from models import Post
from models import User
self.Tag = Tag.Tag
self.Post = Post.Post
self.User = User.User
def login(self, email, password):
... | goors/flask-microblog | UserModel.py | Python | apache-2.0 | 2,758 |
# Copyright (c) 2014 Kontron Europe GmbH
#
# 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 License, or (at your option) any later version.
#
# This library is... | kontron/python-ipmi | pyipmi/interfaces/__init__.py | Python | lgpl-2.1 | 1,238 |
import pytest
import json
import re
from datetime import datetime, timedelta
from CommonServerPython import parse_date_range, DemistoException
from CortexDataLake import FIRST_FAILURE_TIME_CONST, LAST_FAILURE_TIME_CONST
HUMAN_READABLE_TIME_FROM_EPOCH_TIME_TEST_CASES = [(1582210145000000, False, '2020-02-20T14:49:05'),... | VirusTotal/content | Packs/CortexDataLake/Integrations/CortexDataLake/CortexDataLake_test.py | Python | mit | 13,261 |
"""
A fake data generator
"""
import random
import numpy as np
from deepchem.data import NumpyDataset
from deepchem.feat import GraphData
class FakeGraphGenerator:
"""Generates a random graphs which can be used for testing or other purposes.
The generated graph supports both node-level and graph-level labels.
... | deepchem/deepchem | deepchem/utils/fake_data_generator.py | Python | mit | 5,524 |
from setuptools import setup
from tofuroll import get_version
setup(
name='tofuroll',
version=get_version(),
url='http://github.com/nathanielksmith/tofuroll',
description='A basic framework for creating command line applications',
author='Nathaniel K Smith',
author_email='nathanielksmith@gmail.... | nathanielksmith/tofuroll | setup.py | Python | gpl-3.0 | 738 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.