text stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 231 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k | score float64 0 0.34 |
|---|---|---|---|---|---|---|
#!/usr/bin/env python
#
# 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 "Li... | gf53520/kafka | kafka-merge-pr.py | Python | apache-2.0 | 19,703 | 0.004213 |
# -*- coding:utf-8 -*-
from ...errors.httpforbiddenexception import HttpForbiddenException
import saklient
# module saklient.cloud.errors.dontcreateinsandboxexception
class DontCreateInSandboxException(HttpForbiddenException):
## 要求された操作は許可されていません。ゾーンをまたぐ一部のリソースは課金対象です。料金をご確認の上、他のゾーンで作成してください。
## @param... | hnakamur/saklient.python | saklient/cloud/errors/dontcreateinsandboxexception.py | Python | mit | 899 | 0.009331 |
from __future__ import division
__author__ = 'Vladimir Iglovikov'
'''
Merges prediction for https://www.kaggle.com/c/grupo-bimbo-inventory-demand competition
Expm1(Mean([Log1p(x), Log1p(y)]))
'''
import os
import numpy as np
import sys
import pandas as pd
import time
files = sys.argv[1:]
try:
files.remove('mean_l... | ternaus/submission_merger | src/mean_log_merger_bimbo.py | Python | mit | 753 | 0.009296 |
from __future__ import absolute_import, print_function
__all__ = ['DummyProvider']
from django.http import HttpResponse
from sentry.identity.base import Provider
from sentry.pipeline import PipelineView
class AskEmail(PipelineView):
def dispatch(self, request, pipeline):
if 'email' in request.POST:
... | looker/sentry | src/sentry/identity/providers/dummy.py | Python | bsd-3-clause | 857 | 0 |
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generates Dart source files from a mojom.Module."""
import mojom.generate.generator as generator
import mojom.generate.module as mojom
import mojom.gener... | mohamed--abdel-maksoud/chromium.src | mojo/public/tools/bindings/generators/mojom_dart_generator.py | Python | bsd-3-clause | 11,104 | 0.007745 |
"""NIAGADSOFINQUERY API application.
simplePostwithPython.py get -n <titlename> -i <individualnum> -s <snpnum> -f <tfampath> -p <tpedpath> -a <apitoken>
Usage:
simplePostwithPython.py get -n <titlename> -i <individualnum> -s <snpnum> -f <tfampath> -p <tpedpath> -a <apitoken>
simplePostwithPython.py (-h | --help)... | light940929/niagadsofinquery | testexample/simplePostwithPython.py | Python | mit | 3,247 | 0.00616 |
# 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... | rahulunair/nova | nova/tests/functional/test_server_faults.py | Python | apache-2.0 | 5,378 | 0 |
import os
import datetime
import time
IDLE_TIME = 2 * 60
STRESS_ITERATION_TIME = 10 * 60
STRESS_LEVELS = [2,10,25,50,75,100]
# ENDPOINTS = ["http://10.102.44.201/index.php/Special:Random", "http://10.102.44.202/index.php/Special:Random", "http://10.102.44.203/index.php/Special:Random"]
def do_stress():
print("... | skonefal/workloadsutils | ab_util.py | Python | apache-2.0 | 972 | 0.013374 |
# coding=utf-8
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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/li... | ramineni/myironic | ironic/tests/drivers/test_pxe.py | Python | apache-2.0 | 44,025 | 0.000409 |
import random
import sys
class MarkovChain(object):
def __init__(self, separator = None, corpus = None):
self.separator = separator
self.corpus = corpus
self.chain = self.setChain()
def setChain(self):
chain = {}
if self.separator is None:
allItems = self.co... | gglyptodon/marcook | markovchain.py | Python | gpl-3.0 | 1,417 | 0.015526 |
# -*- coding: utf-8 -*-
"""
module that specified how we choose paramaters based on current search database
properties
"""
from __future__ import absolute_import, division, print_function
#import six
import utool as ut
#import numpy as np
#import vtool as vt
#from ibeis.algo.hots import hstypes
#from ibeis.algo.hots im... | SU-ECE-17-7/ibeis | _broken/_old_qt_hs_matcher/automated_params.py | Python | apache-2.0 | 2,697 | 0.003708 |
#!/usr/bin/env python
import freenect
import signal
import matplotlib.pyplot as mp
from misc.demo import frame_convert
mp.ion()
image_rgb = None
image_depth = None
keep_running = True
def display_depth(dev, data, timestamp):
global image_depth
data = frame_convert.pretty_depth(data)
mp.gray()
mp.f... | Dining-Engineers/left-luggage-detection | misc/demo/demo_mp_async.py | Python | gpl-2.0 | 1,051 | 0 |
""" Notices indicate how a regulation has changed since the last version. This
module contains code to compile a regulation from a notice's changes. """
from bisect import bisect
from collections import defaultdict
import copy
import itertools
import logging
from regparser.grammar.tokens import Verb
from regparser.tr... | EricSchles/regulations-parser | regparser/notice/compiler.py | Python | cc0-1.0 | 21,565 | 0.000139 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2014 Mick Krippendorf <m.krippendorf@freenet.de>
__version__ = '0.2.5a'
__date__ = '2014-09-27'
__author__ = 'Mick Krippendorf <m.krippendorf@freenet.de>'
__license__ = 'MIT'
import pprint
from hornet import *
from hornet.symbols import (
A, Adj,... | pillmuncher/hornet | src/examples/parsing.py | Python | mit | 12,639 | 0.003561 |
try:
import json
except ImportError:
import simplejson as json
from UserList import UserList
class Resource(object):
"""Object wrapper for resources.
Provides an object interface to resources returned by the Soundcloud API.
"""
def __init__(self, obj):
self.obj = obj
def __getst... | Fauxmoehawkeen/soundcloud-python-master | soundcloud/resource.py | Python | bsd-2-clause | 1,625 | 0 |
# Copyright (c) 2014 by Ecreall under licence AGPL terms
# available on http://www.gnu.org/licenses/agpl.html
# licence: AGPL
# author: Vincent Fretin, Amen Souissi
import transaction
from substanced.util import get_oid
from dace.processinstance.event import DelayedCallback
from dace.util import (
find_catalog... | ecreall/dace | dace/objectofcollaboration/system.py | Python | agpl-3.0 | 2,093 | 0.000478 |
#!/usr/bin/python
#
# Copyright (c) 2017 Julien Stroheker, <juliens@microsoft.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | e-gob/plataforma-kioscos-autoatencion | scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/cloud/azure/azure_rm_acs.py | Python | bsd-3-clause | 27,547 | 0.002868 |
import logging
import requests
from django.conf import settings
from django.contrib.sites.models import Site
from django.core.mail import EmailMultiAlternatives
from django.template.loader import get_template
from django.utils import timezone
from invitations.models import Invitation
logger = logging.getLogger('email... | phildini/logtacts | invitations/consumers.py | Python | mit | 1,739 | 0.004025 |
import unittest
import armv6instrdecode
import globals
import utils
import logging
import ARMCPU
import pdb
# if ConditionPassed(cond) then
# Rd = Rn + shifter_operand
# if S == 1 and Rd == R15 then
# if CurrentModeHasSPSR() then
# CPSR = SPSR
# else UNPREDICTABLE
# else if S == 1 then
# N Flag... | jsymolon/ARMSim | TestBKPT.py | Python | gpl-2.0 | 1,495 | 0.002676 |
"""Tests for the Abode cover device."""
from unittest.mock import patch
from homeassistant.components.abode import ATTR_DEVICE_ID
from homeassistant.components.cover import DOMAIN as COVER_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_FRIENDLY_NAME,
SERVICE_CLOSE_COVER,
SERVICE_OPEN_COV... | partofthething/home-assistant | tests/components/abode/test_cover.py | Python | apache-2.0 | 2,112 | 0.000473 |
#!/usr/bin/env python3
import uuid
from setuptools import setup, find_packages
import pathlib
import pkg_resources
with pathlib.Path('requirements.txt').open() as requirements_txt:
reqs = [
str(requirement)
for requirement
in pkg_resources.parse_requirements(requirements_txt)
]
setup(
... | meerkat-code/meerkat_api | setup.py | Python | mit | 539 | 0 |
# -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2012, 2013 CERN.
##
## Invenio 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 opt... | labordoc/labordoc-next | modules/webdeposit/lib/webdeposit_workflow.py | Python | gpl-2.0 | 7,407 | 0.00216 |
# -*- mode: python; coding: utf-8; -*-
VERSION = (1, 3, 3)
__version__ = '.'.join(map(str, VERSION))
__author__ = 'Joe Vasquez'
__email__ = 'joe.vasquez@gmail.com'
__license__ = 'MIT' | jobscry/vz-blog | __init__.py | Python | mit | 183 | 0.005464 |
from datetime import date
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from django.conf import settings
from django.utils.translation import ugettext as _
from django.utils.dateformat import format as format_date
from django.shortcuts import get_object_or_404
from dj... | romanvm/romans_blog | blog/views.py | Python | gpl-3.0 | 4,713 | 0.001061 |
# Copyright (C) 2012 University of Southern California
# This software is licensed under the GPLv3 license, included in
# ./GPLv3-LICENSE.txt in the source distribution
from collections import defaultdict
import itertools
import logging
import os
import shlex
import sys
from magi.util import helpers
from magi.util.ex... | deter-project/magi | magi/testbed/emulab.py | Python | gpl-2.0 | 7,564 | 0.006478 |
"""
Small Modification of src/examples/Geometry/geometry_demos.py
"""
from OCC.gp import *
from OCC.Geom import *
from OCC.TColGeom import *
from OCC.TColgp import *
from OCC.GeomConvert import *
from OCC.BRepBuilderAPI import *
from OCC.TopoDS import *
from OCC.STEPControl import *
from OCC.Display.SimpleGui import... | GeoMop/PythonOCC_Examples | src/bspline_surface.py | Python | gpl-2.0 | 3,394 | 0.003536 |
"""
Nonlinear cartoon+texture decomposition ipol demo web app
"""
from lib import base_app, build, http, image
from lib.misc import ctime
from lib.misc import prod
from lib.base_app import init_app
import shutil
import cherrypy
from cherrypy import TimeoutError
import os.path
import time
from math import ceil
class a... | juan-cardelino/matlab_demos | ipol_demo-light-1025b85/app_available/blmv_nonlinear_cartoon_texture_decomposition/app.py | Python | gpl-2.0 | 11,626 | 0.006795 |
#pylint: disable=R0901,R0902,R0904
from __future__ import (absolute_import, division, print_function)
from six.moves import range
import numpy as np
import os
from PyQt4.QtGui import QSizePolicy
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
from ... | wdzhou/mantid | scripts/HFIR_4Circle_Reduction/mplgraphicsview3d.py | Python | gpl-3.0 | 9,817 | 0.001121 |
#-------------------------------------------------------------------------------
# PROJECT: VHDL Code Generator
# NAME: Dynamic AND Gate
#
# LICENSE: GNU-GPL V3
#-------------------------------------------------------------------------------
__isBlock__ = True
__className__ = "ANDGate"
__win__ = "ANDGat... | BlakeTeam/VHDLCodeGenerator | blocks/Standard Library/Gate AND.py | Python | gpl-3.0 | 2,291 | 0.014841 |
# Raymond Hettingers
# http://code.activestate.com/recipes/576647/
from itertools import permutations
def queen_gf(n):
cols = range(n)
for ans in permutations(cols):
if (n == len(set(ans[i]+i for i in cols)) ==
len(set(ans[i]-i for i in cols))):
yield ans
| yehnan/python_book_yehnan | ch06/ch06_8queen_hettingers_gf.py | Python | gpl-2.0 | 315 | 0.003175 |
../../../../../share/pyshared/twisted/test/test_usage.py | Alberto-Beralix/Beralix | i386-squashfs-root/usr/lib/python2.7/dist-packages/twisted/test/test_usage.py | Python | gpl-3.0 | 56 | 0.017857 |
# Copyright 2012, 2013 Arndt Droullier, Nive GmbH. All rights reserved.
# Released under GPL3. See license.txt
#
__doc__ = """
Image
-----
The image element inserts images into the web page.
Images uploaded as fullsize will be be linked as pop ups.
If the Python Image Library (PIL) is installed automated image conve... | nive/nive_cms | nive_cms/image.py | Python | gpl-3.0 | 2,927 | 0.015032 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .Menu import MenuBox | Loki88/RSA-Test | ui/Menu/__init__.py | Python | agpl-3.0 | 72 | 0.013889 |
import unittest
import unittest.mock
import functools
from g1.asyncs import kernels
from g1.operations.databases.bases import interfaces
from g1.operations.databases.servers import connections
# I am not sure why pylint cannot lint contextlib.asynccontextmanager
# correctly; let us disable this check for now.
#
# py... | clchiou/garage | py/g1/operations/databases/servers/tests/test_connections.py | Python | mit | 8,015 | 0 |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def StorageIORMConfigOption(vim, *args, **kwargs):
'''Configuration setting ranges for IO... | xuru/pyvisdk | pyvisdk/do/storage_iorm_config_option.py | Python | mit | 1,080 | 0.009259 |
from os.path import dirname, join
import unittest
from cvsgit.cvs import CVS
from cvsgit.changeset import Change
class Test(unittest.TestCase):
def test_rcsfilename(self):
"""Find the RCS file for a working copy path.
"""
cvs = CVS(join(dirname(__file__), 'data', 'zombie'), None)
... | ustuehler/git-cvs | tests/test_cvs.py | Python | isc | 727 | 0.001376 |
#!/usr/bin/python
import re,cgi,cgitb,sys
import os
import urllib
import Cookie
import datetime
import meowaux as mew
cgitb.enable()
login_signup="""
<ul class='nav navbar-nav' style='float:right; margin-top:7px; margin-right:5px; ' >
<li>
<form action='/login' style='display:inline;' >
<button class='bt... | abetusk/www.meowcad.com | cgi/about.py | Python | agpl-3.0 | 1,664 | 0.020433 |
#
# Sub-module containing nested samplers
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
import pints
import numpy as np
try:
from scipy.special import logsumexp... | martinjrobins/hobo | pints/_nested/__init__.py | Python | bsd-3-clause | 29,201 | 0 |
# -*- coding: utf-8 -*-
# Copyright 2016 ABF OSIELL <http://osiell.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import api, SUPERUSER_ID
def migrate_res_users_role(env):
"""Migrate user roles database schema.
('res_users_role_user_rel' many2many table to 'res.users.role.li... | rossasa/server-tools | base_user_role/migrations/8.0.1.1.0/post-migration.py | Python | agpl-3.0 | 766 | 0 |
from lcapy import Circuit
cct = Circuit("""
V 1 0 step 10; down
L 1 2 1e-3; right, size=1.2
C 2 3 1e-4; right, size=1.2
R 3 0_1 1; down
W 0 0_1; right
""")
import numpy as np
t = np.linspace(0, 0.01, 1000)
vr = cct.R.v.evaluate(t)
from matplotlib.pyplot import subplots, savefig
fig, ax = subplots(1)
ax.plot(t, vr, li... | mph-/lcapy | doc/examples/netlists/circuit-VRLC2-vr.py | Python | lgpl-2.1 | 442 | 0.004525 |
# -*- coding: utf-8 -*-
from django.db import models
class Person(models.Model):
first_name = models.CharField(max_length=255)
last_name = models.CharField(max_length=255)
age = models.CharField(max_length=10)
def __unicode__(self):
return self.first_name
class PersonFile(models.Model):
... | valdergallo/django-chrono | example/models.py | Python | gpl-3.0 | 963 | 0 |
from multiprocessing import Process, JoinableQueue, Manager, Lock, Value, Event
import wiringpi as wp
import RPi.GPIO as rpio
from slaveprocess import SlaveProcess
import time
rpio.setmode(rpio.BCM)
class PMWProcess(Process):
def __init__(self,**kwargs):
super(PWMProcess, self).__init__(**kwargs)
... | bcare/roverpi | roverserver/enginectrl.py | Python | gpl-3.0 | 14,624 | 0.019147 |
from easyprocess import EasyProcess
from entrypoint2 import entrypoint
from pyvirtualdisplay.display import Display
def extract_version(txt):
"""This function tries to extract the version from the help text"""
words = txt.replace(",", " ").split()
version = None
for x in reversed(words):
if le... | ponty/eagexp | eagexp/version.py | Python | bsd-2-clause | 775 | 0 |
# strategy_best2.py
# Strategy pattern -- function-based implementation
# selecting best promotion from current module globals
"""
>>> joe = Customer('John Doe', 0)
>>> ann = Customer('Ann Smith', 1100)
>>> cart = [LineItem('banana', 4, .5),
... LineItem('apple', 10, 1.5),
... LineI... | pythonprobr/oscon2014 | strategy/strategy_best2.py | Python | mit | 3,172 | 0.001261 |
"""Test model properties."""
import pytest
from gremlin_python.statics import long
from goblin import element, exception, manager, properties
def test_set_change_property(person, lives_in):
# vertex
assert not person.name
person.name = 'leif'
assert person.name == 'leif'
person.name = 'leifur'
... | ZEROFAIL/goblin | tests/test_properties.py | Python | agpl-3.0 | 7,949 | 0 |
#!/usr/bin/env python
from os.path import exists
from setuptools import setup
import eqpy
setup(
name='eqpy',
version=eqpy.__version__,
description='Solve systems of equations and assumptions, linear and '
'non-linear, numerically and symbolically.',
url='http://github.com/eriknw/eqpy/... | eriknw/eqpy | setup.py | Python | bsd-3-clause | 1,281 | 0 |
import re
class HeadingsParser():
"""
The HeadingParser parses the document for headings.
NOT YET: converts headings to raw latex headings in the correct way, so that they can be referrenced to later
see https://www.sharelatex.com/learn/Sections_and_chapters for info about the levels"""
def __ini... | ZelphirKaltstahl/rst-internal-links-to-raw-latex | RSTInternalLinks/HeadingsParser.py | Python | gpl-3.0 | 13,092 | 0.004987 |
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozilla.org/MPL/
#
# Softwa... | yuyuyu101/VirtualBox-NetBSD | src/libs/xpcom18a4/python/tools/tracer_demo.py | Python | gpl-2.0 | 4,360 | 0.003899 |
# -*- coding: utf-8 -*-
# Copyright 2022 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... | googleapis/python-resource-manager | google/cloud/resourcemanager_v3/services/projects/async_client.py | Python | apache-2.0 | 70,063 | 0.001313 |
from mock import patch
from .test_helper import raises
from kiwi.exceptions import KiwiPrivilegesError
from kiwi.privileges import Privileges
class TestPrivileges(object):
@raises(KiwiPrivilegesError)
@patch('os.geteuid')
def test_check_for_root_permiossion_false(self, mock_euid):
mock_euid.retu... | adrianschroeter/kiwi | test/unit/privileges_test.py | Python | gpl-3.0 | 568 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('predict', '0002_auto_20160524_0947'),
]
operations = [
migrations.RemoveField(
model_name='predictdataset',
... | IQSS/gentb-site | apps/predict/migrations/0003_auto_20160525_1521.py | Python | agpl-3.0 | 853 | 0.002345 |
###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free software; you can redistribute it and/or
# mod... | nielsbuwen/ilastik | ilastik/applets/autocontextClassification/opBatchIoSelective.py | Python | gpl-3.0 | 11,464 | 0.012648 |
"""
This file is part of py-sonic.
py-sonic is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
py-sonic is distributed in the hope that it wil... | ties/py-sonic | libsonic/errors.py | Python | gpl-3.0 | 1,413 | 0.012739 |
import time
import numpy as np
import cPickle as pk
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.widgets import Slider
import mpl_toolkits.mplot3d.axes3d as p3
from matplotlib.widgets import Button
class PlotAnimation:
"""
Takes a list of PySnap and launch an intera... | dorvaljulien/StarFiddle | anim_plot.py | Python | mit | 1,736 | 0.009793 |
# -----------------------------------------------------------
# reads the text from the given file, and outputs its
# character statistics
#o
# (C) 2015 Frank Hofmann, Berlin, Germany
# Released under GNU Public License (GPL)
# email frank.hofmann@efho.de
# -----------------------------------------------------------
... | hofmannedv/training-python | text-analysis/character-statistics.py | Python | gpl-2.0 | 2,207 | 0.017218 |
import numpy as np
import scipy
import re
import os
import hashlib
import csb
from csb.bio.io.wwpdb import StructureParser
def chunks(l, n):
""" Yield successive n-sized chunks from l.
"""
for i in xrange(0, len(l), n):
yield l[i:i+n]
class ScatteringFactor(object):
"""
Cacluates the ... | mmechelke/bayesian_xfel | bxfel/core/structure_factor.py | Python | mit | 18,608 | 0.010963 |
# -*- coding: utf-8 -*-
"""
pycclib
library for accessing the cloudControl API using Python
Copyright 2010 cloudControl UG (haftungsbeschraenkt)
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
ht... | cloudControl/pycclib | pycclib/cclib.py | Python | apache-2.0 | 33,766 | 0.000829 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-02 14:22
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rstorch', '0001_initial'),
]
operations = [
migrations.AddField(
... | alevnyaa/restfulstorch | rstorch/migrations/0002_auto_20170302_1722.py | Python | gpl-3.0 | 602 | 0 |
#!/usr/bin/env python
# Copyright (c) 2009 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Tests the msvs specific msvs_target_platform option.
"""
import TestGyp
import TestCommon
def RunX64(exe, stdout):
try:
test.ru... | ibc/MediaSoup | worker/deps/gyp/test/configurations/target_platform/gyptest-target_platform.py | Python | isc | 1,114 | 0.002693 |
# -*- 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... | googleads/google-ads-python | google/ads/googleads/v9/services/types/customer_service.py | Python | apache-2.0 | 7,422 | 0.000404 |
# -*- coding: utf-8 -*-
#
# Copyright (C) Pootle contributors.
#
# This file is a part of the Pootle project. It is distributed under the GPL3
# or later license. See the LICENSE file for a copy of the license and the
# AUTHORS file for copyright and authorship information.
import errno
import logging
import os
import... | pavels/pootle | pootle/apps/pootle_app/project_tree.py | Python | gpl-3.0 | 16,304 | 0.000184 |
# generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "roscpp;rospy;std_msgs".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "-lscarab_quad".split(';') if "-lscarab_quad" != "" else []
PROJEC... | mdkennedy3/Scarab_DCT_Control | catkin_ws/build/Scarabs/scarab/scarab_quad/catkin_generated/pkg.installspace.context.pc.py | Python | gpl-2.0 | 422 | 0.00237 |
from django.conf.urls import include, url
from powerdns.utils import patterns
urlpatterns = patterns(
'',
url(r'', include('dnsaas.api.v1.urls', namespace='default')),
url(r'^v2/', include('dnsaas.api.v2.urls', namespace='v2')),
)
| dominikkowalski/django-powerdns-dnssec | dnsaas/api/urls.py | Python | bsd-2-clause | 246 | 0 |
import sys
import logging
from playback.api import NovaCompute
from cliff.command import Command
def make_target(args):
try:
target = NovaCompute(user=args.user, hosts=args.hosts.split(','), key_filename=args.key_filename,
password=args.password)
except AttributeError:
... | jiasir/playback | playback/cli/nova_compute.py | Python | mit | 4,590 | 0.003922 |
#####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Kyöstilä ... | fretsonfire/fof-python | src/GameEngine.py | Python | mit | 14,664 | 0.018344 |
def square_of_list(some_list, num):
if len(some_list) < num:
result = 0
if len(some_list) >= num:
result = some_list[num]**num
return result
def gap(some_list):
if any([type(x) == type('a') for x in some_list]):
print('문자열이 있습니다')
filtered_list = [ x for x in some_list... | saintdragon2/python-3-lecture-2015 | homework_checker/civil_hw_personal_list/hw_civil_list_15030011.py | Python | mit | 441 | 0.026005 |
import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | batxes/4Cin | SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/SHH_WT_models11702.py | Python | gpl-3.0 | 17,574 | 0.025094 |
# test floating point floor divide and modulus
# it has some tricky corner cases
# pyboard has 32-bit floating point and gives different (but still
# correct) answers for certain combinations of divmod arguments.
def test(x, y):
div, mod = divmod(x, y)
print(div == x // y, mod == x % y, abs(div * y + mod - x)... | martinribelotta/micropython | tests/float/float_divmod_relaxed.py | Python | mit | 705 | 0.001418 |
from p2pool.bitcoin import networks
PARENT = networks.nets['joulecoin']
SHARE_PERIOD = 20 # seconds
CHAIN_LENGTH = 12*60*60//10 # shares
REAL_CHAIN_LENGTH = 12*60*60//10 # shares
TARGET_LOOKBEHIND = 20 # shares
SPREAD = 10 # blocks
IDENTIFIER = 'ac556af4e900ca61'.decode('hex')
PREFIX = '16ac009e4fa655ac'.decode('hex')... | Rav3nPL/p2pool-rav | p2pool/networks/joulecoin.py | Python | gpl-3.0 | 568 | 0.012324 |
# TODO: Setup
| mjkmoynihan/ReleaseRadar | setup.py | Python | apache-2.0 | 15 | 0.066667 |
import json
from datetime import datetime, timedelta
from flask import abort, Blueprint, current_app, jsonify, request
from functools import wraps
from sqlalchemy.exc import IntegrityError
from os import path
from uuid import UUID
from werkzeug.exceptions import default_exceptions # type: ignore
from db import db
fr... | ehartsuyker/securedrop | securedrop/journalist_app/api.py | Python | agpl-3.0 | 13,022 | 0.000077 |
import time
import RPi.GPIO as GPIO
# use Broadcom pin numbers
GPIO.setmode(GPIO.BCM)
SERVO_PIN = 3
GPIO.setup(SERVO_PIN, GPIO.OUT)
# setup PWM
pwm = GPIO.PWM(SERVO_PIN, 100)
pwm.start(5)
for i in range(5, 25):
pwm.ChangeDutyCycle(i)
time.sleep(0.5)
pwm.stop()
GPIO.cleanup()
| lukaszo/rpitips-examples | RPi.GPIO/servo.py | Python | apache-2.0 | 288 | 0.010417 |
"""
Tests for OEShape color utilities.
"""
import numpy as np
import unittest
from openeye.oechem import *
from openeye.oeshape import *
from ..color import ColorForceField
class TestColorForceField(unittest.TestCase):
"""
Tests for ColorForceField.
"""
def setUp(self):
"""
Set up te... | skearnes/color-features | oe_utils/shape/tests/test_color.py | Python | bsd-3-clause | 1,693 | 0 |
from django.test import TestCase
from django.core.urlresolvers import reverse
from working_waterfronts.working_waterfronts_api.models import Video
from django.contrib.auth.models import User
class EditVideoTestCase(TestCase):
"""
Test that the Edit Video page works as expected.
Things tested:
UR... | osu-cass/working-waterfronts-api | working_waterfronts/working_waterfronts_api/tests/views/entry/test_edit_video.py | Python | apache-2.0 | 2,965 | 0 |
class WallsGate(object):
def dfs(self, rooms):
queue = [(i, j, 0) for i, rows in enumerate(rooms) for j, v in enumerate(rows) if not v]
while queue:
i, j, step = queue.pop()
if rooms[i][j] > step:
rooms[i][j] = step
for newi, newj in ((i + 1, j), ... | Tanych/CodeTracking | distance.py | Python | mit | 1,572 | 0.027354 |
# Copyright 2019 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... | GoogleCloudPlatform/professional-services | examples/kubeflow-pipelines-sentiment-analysis/pipeline/build_sentiment_analysis.py | Python | apache-2.0 | 3,173 | 0.003467 |
#!/usr/bin/env python
#
# __COPYRIGHT__
#
# Count statistics about SCons test and source files. This must be run
# against a fully-populated tree (for example, one that's been freshly
# checked out).
#
# A test file is anything under the src/ directory that begins with
# 'test_' or ends in 'Tests.py', or anything unde... | timj/scons | bin/linecount.py | Python | mit | 4,164 | 0.010327 |
from numpy.linalg import cholesky
from scipy.spatial.distance import euclidean
from sklearn.base import BaseEstimator
from sklearn.utils.validation import _is_arraylike
from sklearn.metrics import roc_auc_score
import numpy as np
from abc import ABCMeta, abstractmethod
import six
from ._util import ArrayIndexer, check_... | all-umass/metric-learn | metric_learn/base_metric.py | Python | mit | 15,825 | 0.002528 |
# Tests specific to the dask class
import os
from numpy.core.shape_base import block
import pytest
import numpy as np
from mock import patch
from numpy.testing import assert_allclose
from astropy.tests.helper import assert_quantity_allclose
from astropy import units as u
from astropy.utils import data
try:
from ... | radio-astro-tools/spectral-cube | spectral_cube/tests/test_dask.py | Python | bsd-3-clause | 10,242 | 0.002831 |
from __future__ import division, print_function, absolute_import
import sys
from numpy.testing import *
import numpy.linalg as linalg
def random(size):
return rand(*size)
class TestSolve(TestCase):
def bench_random(self):
basic_solve = linalg.solve
print()
print(' Solving system... | sargas/scipy | scipy/linalg/benchmarks/bench_basic.py | Python | bsd-3-clause | 4,065 | 0.013284 |
# -*- coding:utf-8 -*-
VERSION = (1, 7, 8, 'final', 0)
def get_version(*args, **kwargs):
# Don't litter django/__init__.py with all the get_version stuff.
# Only import if it's actually called.
from django.utils.version import get_version
return get_version(*args, **kwargs)
def setup():
"""
... | wfxiang08/django178 | django/__init__.py | Python | bsd-3-clause | 876 | 0.003425 |
from matplotlib.path import Path
import matplotlib.patches as patches
from math import cos, sin, radians
class RectangleObject:
def __init__(self, centerPosition, sideSize1, sideSize2, label, rotation=0.0, color='black'):
self.sideSize1 = sideSize1
self.sideSize2 = sideSize2
self.label = la... | magnunor/camera_aperture_position | camera_position_tools.py | Python | gpl-3.0 | 4,017 | 0.005726 |
# -*- coding: utf-8 -*-
# Part of the psychopy.iohub library.
# Copyright (C) 2012-2016 iSolver Software Solutions
# Distributed under the terms of the GNU General Public License (GPL).
# /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/
# HIToolbox.framework/Headers/Events.h
QZ_ESCAPE = 0x35
QZ_F1 =... | psychopy/versions | psychopy/iohub/devices/keyboard/darwinkey.py | Python | gpl-3.0 | 1,860 | 0 |
#!/usr/bin/env python3
# forked from spline1986's versions
import os, sys, sqlite3
from ii_functions import *
args=sys.argv[1:]
if len(args)==0:
print("Usage: sqlite-export.py <db_file>")
sys.exit(1)
check_dirs()
conn = sqlite3.connect(args[0])
c = conn.cursor()
c.execute("""CREATE TABLE IF NOT EXISTS msg(
id I... | vit1-irk/ii-db-utils | sqlite-export.py | Python | cc0-1.0 | 1,050 | 0.013333 |
import os
import sys
import logging
import uuid
import traceback
import datetime
import cgi
import MySQLdb
import stripe
import re
import requests
import urllib
import time
import pmsconstants
from flask import Flask, render_template, request, jsonify, redirect, url_for, Markup, session, Response
from werkzeug import ... | scottsappen/PayMySitter | main.py | Python | apache-2.0 | 10,136 | 0.016772 |
#!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
Bitcharts - ORM classes and functions
Copyright(c) 2014 - Lisandro Gallo (lisogallo)
liso@riseup.net
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 Found... | lisogallo/bitcharts-core-legacy | bitcharts.py | Python | agpl-3.0 | 24,568 | 0.00057 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import ijson
import shutil
import logging
import zipfile
import tempfile
import requests
from .. import base
from .record import Record
... | opentrials/collectors | collectors/fdadl/collector.py | Python | mit | 2,443 | 0.000409 |
import search_duplicated_task
| 3dfxsoftware/cbss-addons | duplicated_tasks/wizard/__init__.py | Python | gpl-2.0 | 30 | 0 |
# -*- coding: utf-8 -*-
formatter = "%r %r %r %r"
print formatter % (1,2,3,4)
print formatter % ("one", "two", "three", "four")
print formatter % (True, False, False, True)
print formatter % (formatter, formatter, formatter, formatter)
print formatter % (
"Whose woods these are",
"I think I know",
"His house i... | sdwebster/learn-python-the-hard-way-solutions | 08/ex8.py | Python | mit | 352 | 0.011364 |
import backend # hopefully fixes issues with Celery finding tasks?
| bleedingwolf/Spyglass | spyglass/__init__.py | Python | bsd-3-clause | 68 | 0.014706 |
import threading
from multiprocessing import cpu_count
class Terminator:
def __init__(self):
self._should_stop = False
def stop(self):
self._should_stop = True
def should_stop(self):
return self._should_stop
class Handler(object):
# no parameters are permitted... | pkesist/buildpal | Python/server_svc_handler.py | Python | gpl-3.0 | 1,123 | 0.002671 |
#!/usr/bin/env python
import socket,sys,gateway_cfg,select,socketserver,http.server,urllib
from threading import *
class WebHandler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
parseParams = urllib.parse.urlparse(self.path)
if parseParams.path=="/t" :
self.send_error(404,"You can't pass!!")
... | fucxy/fucxy-node | gateway/modules.py | Python | gpl-3.0 | 1,672 | 0.031699 |
#!python
#-*- encoding=utf-8 -*-
import sys, sqlite3, logging, os, os.path
import wx, time, re, copy, webbrowser
import wx.grid, wx.html
import json, math
from cfg import config
from util import *
from model import *
from view import *
class App(wx.App):
instance = None
def __init__(self, conf, *args):
wx.App._... | dlutxx/cement | main.py | Python | mit | 3,137 | 0.048659 |
# lance simulations pour different nombre d'electeurs
import multiprocessing
import os, sys
import shutil
import time
import numpy as np
from randomSets import *
def worker(((Ncandidats,q, Nwinners, Ntests))):
"""worker function"""
sys.stdout.write('\nSTART -- %i candidats -- \n' % Ncandidats)
sys.stdout.... | plguhur/random-sets | simuFindNMin.py | Python | apache-2.0 | 1,243 | 0.015286 |
import json
from pprint import pprint
from sys import argv
jsonFile = argv[1]
with open(jsonFile) as data_file:
data = json.load(data_file)
for i in range(0, data['resultCount']):
if data['results'][i]['trackCount'] != 1:
print(data['results'][i]['collectionName']), data['results'][i]['releaseDate']
... | mrricearoni/iTunesSearch | printRecentAlbums.py | Python | mit | 357 | 0.002801 |
#! /usr/bin/env python
import sys, os, getopt, struct, unittest
from distutils.spawn import spawn
build = True
verbosity = 2
here = os.path.dirname(os.path.abspath(__file__))
os.chdir(here)
def bits():
"""determine if running on a 32 bit or 64 bit platform
"""
return struct.calcsize("P") * 8
# -- parse... | ioram7/keystone-federado-pgid2013 | build/greenlet/run-tests.py | Python | apache-2.0 | 1,321 | 0.003785 |
# Copyright 2019 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... | tensorflow/tensorboard | tensorboard/plugins/mesh/summary_v2_test.py | Python | apache-2.0 | 5,916 | 0.000676 |
from i18nurls.application import Application as make_app
| jackTheRipper/iotrussia | web_server/lib/werkzeug-master/examples/i18nurls/__init__.py | Python | gpl-2.0 | 57 | 0 |
"""
Tests for efflux.telemetry.endpoint
"""
import unittest
import mock
from efflux.telemetry.endpoint import Telemetry
class Dummy(Telemetry):
def _set_route(self):
self.base_route = None
class TelemetryTests(unittest.TestCase):
'''Tests for EffluxEndpoint'''
MOCKS = [
]
def setUp(... | effluxsystems/pyefflux | tests/unit/test_base.py | Python | mit | 1,403 | 0 |
import pytz
from pendulum import _safe_timezone
from pendulum.tz.timezone import Timezone
def test_safe_timezone_with_tzinfo_objects():
tz = _safe_timezone(pytz.timezone("Europe/Paris"))
assert isinstance(tz, Timezone)
assert "Europe/Paris" == tz.name
| sdispater/pendulum | tests/test_main.py | Python | mit | 268 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.