repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
license
stringclasses
15 values
hash
int64
-9,223,277,421,539,062,000
9,223,102,107B
line_mean
float64
6.51
99.9
line_max
int64
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
zjuchenyuan/BioWeb
Lib/Bio/Blast/NCBIStandalone.py
1
74989
# Copyright 1999-2000 by Jeffrey Chang. All rights reserved. # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. # Patches by Mike Poidinger to support multiple databases. # Updated by Peter Cock in 2007...
mit
-429,756,769,175,448,800
39.843682
107
0.56711
false
karstenw/nodebox-pyobjc
examples/Extended Application/matplotlib/examples/user_interfaces/mpl_with_glade_316_sgskip.py
1
1165
""" ========================= Matplotlib With Glade 316 ========================= """ from gi.repository import Gtk from matplotlib.figure import Figure from matplotlib.axes import Subplot from numpy import arange, sin, pi from matplotlib.backends.backend_gtk3agg import FigureCanvasGTK3Agg as FigureCanvas class Win...
mit
7,270,442,403,777,310,000
24.326087
83
0.641202
false
asymptopia/stepintochinese
StepIntoChinese/cfgmgr.py
1
1685
""" /********************************************************** Organization :AsymptopiaSoftware | Software@theLimit Website :www.asymptopia.org Author :Charles B. Cosse Email :ccosse@asymptopia.org Copyright :(C) 2006-2011 Asymptopia Software License ...
gpl-2.0
-5,893,147,121,315,494,000
19.802469
84
0.619585
false
broadinstitute/toothpick
toothpick/test/hooks_test.py
1
7294
import toothpick from toothpick import exceptions from toothpick import hooks from toothpick.test import TestResource from nose.tools import * hooks.register_hook('side_effect') hooks.register_hook('too_many_yields') hooks.register_hook('not_enough_yields') hooks.register_hook('mixin') class HookMixin(object): ...
bsd-3-clause
1,105,850,361,673,157,600
25.523636
72
0.557444
false
OpenGeoscience/girder_db_items
server/dbs/sqlalchemydb.py
1
19936
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################## # Copyright Kitware Inc. # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in compliance with the License. # You may obtain a copy of t...
apache-2.0
3,844,353,940,656,065,000
40.620042
93
0.578953
false
0111001101111010/hyde
hyde/tests/test_model.py
1
5339
# -*- coding: utf-8 -*- """ Use nose `$ pip install nose` `$ nosetests` """ from hyde.model import Config, Expando from fswrap import File, Folder def test_expando_one_level(): d = {"a": 123, "b": "abc"} x = Expando(d) assert x.a == d['a'] assert x.b == d['b'] def test_expando_two_levels(): d = {...
mit
-7,763,387,247,039,466,000
32.36875
85
0.561341
false
lingdb/CoBL-public
ielex/lexicon/migrations/306_0127_fix_issue_223.py
1
1524
# -*- coding: utf-8 -*- # Inspired by: # https://github.com/lingdb/CoBL/issues/223#issuecomment-256815113 from __future__ import unicode_literals, print_function from django.db import migrations from ielex.source_scripts.handle_duplicate_sources import handle_sources, \ sourcesExist sources_changes = {'merge': {36...
bsd-2-clause
3,087,492,751,820,296,700
33.636364
75
0.468504
false
MikeHoffert/caladbolg-engine
caladbolg/agents/character.py
1
2442
import json from caladbolg.agents import formulas from caladbolg.agents.stats import Stats, EquipmentStats class Character: """ Represents a player character. Characters have stats, equipment, and leveling information. """ def __init__(self, character_file): self.level = 1 ...
mit
2,006,252,693,176,594,400
44.075472
118
0.613432
false
analyseuc3m/ANALYSE-v1
common/test/acceptance/tests/studio/test_studio_home.py
1
7558
""" Acceptance tests for Home Page (My Courses / My Libraries). """ from bok_choy.web_app_test import WebAppTest from opaque_keys.edx.locator import LibraryLocator from uuid import uuid4 from ...fixtures import PROGRAMS_STUB_URL from ...fixtures.config import ConfigModelFixture from ...fixtures.programs import Program...
agpl-3.0
5,568,737,444,139,585,000
40.527473
118
0.656258
false
Parclytaxel/Kinross
kinback/algebra.py
1
1782
# Numerical algebra and methods # Parcly Taxel / Jeremy Tan, 2018 # https://parclytaxel.tumblr.com import numpy as np cc_abscissas = [(np.cos(np.arange(1, 2 ** k, 2) / 2 ** k * np.pi) + 1) / 2 for k in range(2, 11)] def ccw_generate(n): """Clenshaw-Curtis weights for n+1 samples where n is a power of two. DFT-...
mit
-3,334,467,633,558,380,000
44.615385
150
0.562114
false
StarfruitStack/crabapple
crabapple/admin/controller/deployment.py
1
2202
# Copyright 2014 The crabapple Authors. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. import datetime from flask import render_template, redirect, request from crabapple.objects import Commit, Deployment, DeploymentStatus class ControllerDe...
bsd-3-clause
6,292,805,605,715,429,000
37.631579
101
0.601272
false
nitely/Spirit
spirit/core/utils/ratelimit/ratelimit.py
1
3853
# -*- coding: utf-8 -*- import hashlib import time from django.core.cache import caches from ...conf import settings from ..deprecations import warn __all__ = ['RateLimit'] TIME_DICT = { 's': 1, 'm': 60} def validate_cache_config(): try: cache = settings.CACHES[settings.ST_RATELIMIT_CACHE] ...
mit
-127,130,421,655,364,450
25.944056
76
0.563717
false
joytunes/JTLocalize
localization_flow/jtlocalize/core/handle_duplicates_in_localization.py
1
2004
#!/usr/bin/env python from localization_utils import * import argparse def parse_args(): """ Parses the arguments given in the command line Returns: args: The configured arguments will be attributes of the returned object. """ parser = argparse.ArgumentParser(description='Omits duplications ...
mit
-1,579,286,691,620,859,600
29.363636
106
0.65519
false
berkeley-stat159/project-alpha
code/utils/functions/tgrouping.py
1
3121
from __future__ import absolute_import, division, print_function from mask_phase_2_dimension_change import neighbor_smoothing from mask_phase_2_dimension_change import masking_reshape_start, masking_reshape_end import numpy as np def t_binary_grouping(t, cutoff, prop = False, abs_on = False): """ Evaluated ...
bsd-3-clause
1,689,663,783,410,457,000
31.175258
92
0.65588
false
ksmit799/Toontown-Source
toontown/golf/DistributedGolfHoleAI.py
1
18607
from direct.distributed import DistributedObjectAI from direct.directnotify import DirectNotifyGlobal from toontown.toonbase import ToontownGlobals from pandac.PandaModules import * import DistributedPhysicsWorldAI from direct.fsm.FSM import FSM from toontown.ai.ToonBarrier import * from toontown.golf import GolfGlobal...
mit
5,974,727,302,163,878,000
36.363454
185
0.604342
false
FabriceSalvaire/monitor-server
MonitorServer/Tools/Singleton.py
1
4601
#################################################################################################### # # MonitorServer - A Server Monitoring Application # Copyright (C) 2014 Fabrice Salvaire # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License ...
gpl-3.0
-2,197,945,327,112,230,400
30.513699
110
0.433601
false
RyanChinSang/ECNG3020-ORSS4SCVI
BETA/TestCode/SpchRecg/APP-SpchRecg3.py
1
1382
import os import pocketsphinx as ps modeldir = "C:/Python36-64/Lib/site-packages/pocketsphinx/model/" # datadir = "C:/Python36-64/Lib/site-packages/pocketsphinx/data/" # Create a decoder with certain model config = ps.Decoder.default_config() config.set_string('-hmm', os.path.join(modeldir, 'en-us')) config.set_strin...
gpl-3.0
2,085,290,420,487,328,000
32.707317
99
0.68958
false
Kocal/django-tornado-websockets
tornado_websockets/modules/progressbar.py
1
3746
# coding=utf-8 from tornado_websockets.modules.module import Module class ProgressBar(Module): """ Initialize a new ProgressBar module instance. If ``min`` and ``max`` values are equal, this progress bar has its indeterminate state set to ``True``. :param min: Minimum value ...
gpl-3.0
7,786,795,235,155,894,000
28.234375
117
0.552378
false
zhouzhaoze/dip
project3/Proj04-04/main.py
1
2549
#!/bin/python # *-* encoding=utf-8 *-* ''' Image Priting Program Based on Haftoning ''' import sys import numpy, scipy from scipy import ndimage from scipy import misc import scipy.fftpack as fftpack import matplotlib.pyplot as plt sys.path.append('../Proj04-01') from DFT import DFT_2D, IDFT_2D def en_padding(img):...
apache-2.0
-3,213,598,260,219,212,000
27.322222
114
0.567674
false
solarpermit/solarpermit
website/migrations/0086_auto__del_actiontutorial__del_person__del_userreward__del_applicationh.py
1
68516
# -*- 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): # Deleting model 'ActionTutorial' db.delete_table('website_actiontutorial') # Deleting model 'Perso...
bsd-3-clause
3,161,687,375,410,409,000
87.983117
200
0.573939
false
Upande/MaMaSe
apps/event/migrations/0001_initial.py
1
3706
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import wagtail.wagtailcore.fields from django.conf import settings import modelcluster.fields class Migration(migrations.Migration): dependencies = [ ('taggit', '0001_initial'), migrations.sw...
apache-2.0
5,118,050,073,958,929,000
41.113636
146
0.552887
false
marcoscastro/facebook_profile_photo
gui.py
1
1243
from tkinter import * from face_photo import * from PIL import Image, ImageTk window = Tk() # cria uma janela window.title('Facebook profile photo') # seta o título da janela window.geometry('450x300') # seta o tamanho da janela entry = Entry(window, width=25, justify='center') # cria uma entrada de texto entry.inser...
mit
2,414,084,095,627,359,000
26.422222
77
0.70884
false
oVirt/ovirt-scheduler-proxy
src/ovirtscheduler/oschedproxyd.py
1
3539
# # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
apache-2.0
651,295,214,918,901,600
32.386792
78
0.627578
false
imapp-pl/golem
golem/ethereum/client.py
1
2118
import logging import rlp from eth_rpc_client import Client as EthereumRpcClient from .node import NodeProcess log = logging.getLogger('golem.ethereum') class Client(EthereumRpcClient): """ RPC interface client for Ethereum node.""" STATIC_NODES = ["enode://f1fbbeff7e9777a3a930f1e55a5486476845f799f7d603f7...
gpl-3.0
3,904,709,206,332,040,700
32.09375
186
0.635033
false
vincent-noel/libSigNetSim
libsignetsim/model/tests/TestAnnotation.py
1
5911
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014-2017 Vincent Noel (vincent.noel@butantan.gov.br) # # This file is part of libSigNetSim. # # libSigNetSim 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 Fou...
gpl-3.0
-2,590,696,538,973,808,600
45.912698
109
0.751438
false
rajul/tvb-framework
tvb/interfaces/command/demos/datatypes/search_and_export.py
1
4973
# -*- coding: utf-8 -*- # # # TheVirtualBrain-Framework Package. This package holds all Data Management, and # Web-UI helpful to run brain-simulations. To use it, you also need do download # TheVirtualBrain-Scientific Package (for simulators). See content of the # documentation-folder for more details. See also http://...
gpl-2.0
4,476,070,721,329,385,000
40.45
105
0.626986
false
RedHatQE/rhui-testing-tools
rhui-tests/test_rhui_tcms178464.py
1
2293
#! /usr/bin/python -tt import nose from rhuilib.util import * from rhuilib.rhui_testcase import * from rhuilib.rhuimanager import * from rhuilib.rhuimanager_cds import * from rhuilib.rhuimanager_repo import * from rhuilib.pulp_admin import PulpAdmin from rhuilib.cds import RhuiCds class test_tcms_178464(RHUITestcas...
gpl-3.0
-7,934,214,745,084,829,000
41.462963
144
0.632795
false
andreimaximov/algorithms
leetcode/algorithms/recover-binary-tree/solution.py
1
2334
#!/usr/bin/env python class Solution(object): def inorder(self, root): """ Returns the inorder traversal of nodes in the tree. """ current = root stack = [] inorder = [] while current is not None or len(stack) > 0: # Traverse to the left most (f...
mit
140,343,525,249,919,440
29.311688
78
0.532562
false
Rabuske/HeartRatePython
HeartRatePython/HeartRatePython/Token.py
1
1293
import datetime class Token(object): accessToken = None refreshToken = None generationDate = None expiresIn = None # in seconds type = None userId = None def __init__(self, userId, accessToken, refreshToken, type, expiresIn, generationDate=None): self.userId = userId s...
gpl-3.0
5,066,700,721,045,928,000
37.058824
164
0.649652
false
mpkasp/django-bom
bom/migrations/0031_auto_20200104_1352.py
1
2301
# Generated by Django 2.2.8 on 2020-01-04 13:52 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('bom', '0030_auto_20200101_2253'), ] operations = [ migrations.AlterField( model_name='partrevision', name='height_un...
gpl-3.0
-3,665,462,270,932,256,000
59.157895
442
0.453193
false
fjruizruano/ngs-protocols
mitobim_run.py
1
3707
#!/usr/bin/python import sys import os from subprocess import call from Bio import SeqIO print "Usage: mitobim_run.py NumberOfReads ListOfFiles Reference [miramito/quickmito/seedmito] missmatch" try: nreads = sys.argv[1] except: nreads = raw_input("Introduce number of reads: ") try: lista = sys.argv[2] ...
gpl-3.0
8,431,332,318,362,962,000
37.216495
423
0.647694
false
eboreapps/Scikit-Learn-Playground
ScikitlearnPlayground/CrossValidationKNN.py
1
1171
#Copyright 2016 EBORE APPS (http://www.eboreapps.com) #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...
apache-2.0
-6,109,181,488,564,701,000
27.585366
73
0.760034
false
skosukhin/spack
var/spack/repos/builtin/packages/everytrace/package.py
1
2163
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
4,433,843,952,145,421,000
41.411765
79
0.652797
false
JimBrown/MarlinTarantula
buildroot/share/PlatformIO/scripts/generic_create_variant.py
1
1714
# # generic_create_variant.py # # Copy one of the variants from buildroot/platformio/variants into # the appropriate framework variants folder, so that its contents # will be picked up by PlatformIO just like any other variant. # import os,shutil,marlin from SCons.Script import DefaultEnvironment from platformio import...
gpl-3.0
8,632,913,870,096,174,000
30.740741
108
0.738623
false
platsch/OctoPNP
octoprint_OctoPNP/ImageProcessing.py
1
11846
# -*- coding: utf-8 -*- """ This file is part of OctoPNP OctoPNP 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. Oc...
agpl-3.0
-1,268,269,883,371,438,300
39.006757
139
0.574565
false
neilpanchal/iPython-Notebook-Profile
profile_neil/ipython_config.py
1
20604
# Configuration file for ipython. c = get_config() #------------------------------------------------------------------------------ # InteractiveShellApp configuration #------------------------------------------------------------------------------ # A Mixin for applications that start InteractiveShell instances. # #...
mit
-7,848,528,247,370,249,000
36.530055
565
0.681518
false
pgmillon/ansible
lib/ansible/modules/database/postgresql/postgresql_ping.py
1
3674
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru> # 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 = {...
gpl-3.0
6,587,041,869,324,349,000
23.657718
92
0.633642
false
eharney/cinder
cinder/tests/unit/api/v3/test_attachments.py
1
12523
# Copyright (C) 2017 HuaWei Corporation. # 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 r...
apache-2.0
-1,691,232,541,652,164,600
42.482639
78
0.556656
false
chrisspen/homebot
src/test/google_speech/vad_example.py
1
3455
#!/usr/bin/env python import collections import contextlib import sys import wave import webrtcvad def read_wave(path): with contextlib.closing(wave.open(path, 'rb')) as wf: num_channels = wf.getnchannels() assert num_channels == 1 sample_width = wf.getsampwidth() assert sample_wi...
mit
2,947,711,968,839,872,500
33.207921
86
0.582923
false
staudt/everest-legacy
everest.py
1
2359
#!/usr/bin/env python import sys from lib import test_runner, reports def main(testset_file, params): config_file = 'default.cfg' if 'config' in params.keys(): config_file = params['config'] runner = test_runner.instantiate_runner(config_file) if not runner: return False, 'Couldn\'t load configuration file...
mit
-4,124,931,762,674,862,000
35.444444
83
0.660873
false
dhanababum/dj-wkhtmltopdf
djwkhtmltopdf/url_helper.py
1
2993
import re from django.core.exceptions import ViewDoesNotExist from django.core.urlresolvers import RegexURLPattern, RegexURLResolver from django.conf import settings def extract_views_from_urlpatterns(urlpatterns, base='', namespace=None): """ Return a list of views from a list of urlpatterns. Each obje...
bsd-2-clause
-2,542,504,369,017,222,000
33.802326
79
0.546275
false
abdelhalim/gits3
src/gits3/amazon_s3_transport.py
1
5828
# Copyright (C) 2009 Abdelhalim Ragab <abdelhalim@gmail.com> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 3 # of the License or (at your option) any later version of # the License...
gpl-2.0
1,939,522,590,412,960,500
31.20442
78
0.498284
false
CoderDojoPL/minecraft-python
rzeka.py
1
1568
# -*- coding: utf-8 -*- # Autor: Wojtek Gembalczyk w.gembalczyk@coderdojo.org.pl import mcpi.minecraft as minecraft import mcpi.block as block import time import math def woda3x3(x, z): mc.setBlocks(x, 0, z-6, x, 2, z+6, block.AIR.id) #powietrze nad rzeką mc.setBlocks(x, 0, z-5, x, 0, z+5, block.DIRT.id) ...
gpl-2.0
-6,279,255,793,626,819,000
29.72549
84
0.596682
false
EventTeam/beliefs
src/beliefs/referent.py
1
4770
""" This file defines two classes, TaxonomyCell and Referent, which work in tandem to provide the 'kind' property to all referents, and the generalization structure. The generalization structure (a taxonomy-- a directed acyclic graph of IS-A relationships) is automatically constructed using the object-oriented inher...
gpl-2.0
2,732,122,672,072,562,700
36.857143
117
0.607757
false
dhermes/google-cloud-python
vision/tests/unit/gapic/v1/test_image_annotator_client_v1.py
2
5242
# -*- coding: utf-8 -*- # # Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
apache-2.0
2,487,649,717,542,704,600
32.177215
87
0.6591
false
leonth/private-configs
sublime-text-3/Packages/SublimePythonIDE/server/linter.py
1
6132
# -*- coding: utf-8 -*- import sys import os import os.path sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../lib")) import _ast import pep8 import pyflakes.checker as pyflakes pyflakes.messages.Message.__str__ = ( lambda self: self.message % self.message_args ) class PyflakesLoc: """ Error lo...
mit
9,175,192,041,530,635,000
29.81407
83
0.558056
false
dmilos/nucleotide
src/nucleotide/component/linux/gcc/atom/boost.py
1
1466
#!/usr/bin/env python2 # Copyright 2015 Dejan D. M. Milosavljevic # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
apache-2.0
6,499,534,218,513,792,000
25.178571
101
0.614598
false
m4sterm1nd/android
GcmDemo/appengine/gcm2.py
1
14016
################################################################################ # gae_python_gcm/gcm.py # # In Python, for Google App Engine # Originally ported from https://github.com/Instagram/node2dm # Extended to support new GCM API. # Greg Bayer <greg@gbayer.com> #################################################...
gpl-2.0
-7,267,360,330,235,582,000
39.744186
201
0.573202
false
DayGitH/Python-Challenges
DailyProgrammer/DP20140811A.py
1
1168
""" [8/11/2014] Challenge #175 [Easy] Bogo! https://www.reddit.com/r/dailyprogrammer/comments/2d8yk5/8112014_challenge_175_easy_bogo/ #Description A bogo sort is a purposefully inefficient algorithm for sorting a sequence. Today we will be using this for strings to test for equality. Here is wikipedias entry for a [B...
mit
-7,608,320,504,263,199,000
32.371429
119
0.751712
false
yfede/gimp-plugin-export-layers
export_layers/pylibgimpplugin/tests/test_progress.py
1
3089
#------------------------------------------------------------------------------- # # This file is part of pylibgimpplugin. # # Copyright (C) 2014 khalim19 <khalim19@gmail.com> # # pylibgimpplugin is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published ...
gpl-3.0
-2,251,561,893,102,036,700
34.505747
92
0.617676
false
cedriclaunay/gaffer
python/GafferImageTest/MergeTest.py
1
6664
########################################################################## # # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
bsd-3-clause
524,376,069,707,290,940
36.438202
144
0.656212
false
softcert/vsroom
vsroom/common/historian4.py
1
10451
import os import time import math import errno import marshal import collections import idiokit from idiokit import timer, xmlcore from idiokit.xmpp.jid import JID from abusehelper.core import bot, events, taskfarm, services from vsroom.common import eventdb NS = "vsr#historian" try: import json JSONDecodeEr...
mit
4,675,445,567,437,754,000
31.557632
80
0.48847
false
mesutcang/mongodb-word2vec-doc2vec
main.py
1
1814
# -*- encoding: utf-8 -*- from glob import glob from pymongo import MongoClient from gensim import models from sklearn.metrics.pairwise import cosine_similarity import numpy as np def fillMongo(db): """ gets the mongodb connection and fills the database. """ for index, file in enumerate(glob('./**/*.txt',recurs...
gpl-3.0
2,473,236,960,632,347,600
26.074627
135
0.675854
false
HewlettPackard/python-hpOneView
tests/unit/resources/networking/test_connection_templates.py
2
3312
# -*- coding: utf-8 -*- ### # (C) Copyright (2012-2017) Hewlett Packard Enterprise Development LP # # 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 limi...
mit
-7,821,508,190,935,121,000
39.390244
101
0.694143
false
whyflyru/django-cacheops
cacheops/query.py
1
20852
# -*- coding: utf-8 -*- import sys import json import six from funcy import select_keys, cached_property, once, once_per, monkey, wraps from funcy.py2 import mapcat, map from .cross import pickle, md5 import django from django.utils.encoding import smart_str from django.core.exceptions import ImproperlyConfigured from...
bsd-3-clause
-3,087,637,271,154,831,400
37.543438
100
0.590255
false
timlau/dnf-daemon
daemon/dnfdaemon-session.py
1
13512
#!/usr/bin/python3 # 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 distributed in the hope that it w...
gpl-2.0
1,706,098,923,312,927,200
32.864662
79
0.544627
false
rodynnz/python-tfstate
unit_tests/test_tfstate/test_provider/test_aws/test_aws_key_pair.py
1
2130
# -*- coding: utf-8 -*- # Python stdlib import unittest # py.test import pytest # Python tfstate from tfstate.provider.aws import AwsResource, AwsKeyPairResource from tfstate.exceptions import InvalidResource # Unit tests from unit_tests.base import BaseResourceUnitTest @pytest.mark.provider_aws class AwsKeyPairR...
lgpl-3.0
5,549,204,734,299,582,000
39.188679
112
0.705634
false
westpark/wallball
docs/steps/code/s2d.py
1
1630
WIDTH = 640 HEIGHT = 480 class Ball(ZRect): pass # # The ball is a red square halfway across the game screen # ball = Ball(0, 0, 30, 30) ball.center = WIDTH / 2, HEIGHT / 2 ball.colour = "red" # # The ball moves one step right and one step down each tick # ball.direction = 1, 1 # # The ball moves at a s...
mit
6,844,163,819,388,710,000
20.054054
68
0.590798
false
glottobank/pycldf
src/pycldf/cli_util.py
1
2128
from clldutils.clilib import PathType from pycldf import Dataset, Database # # Copied from distutils.util - because we don't want to deal with deprecation warnings. # def strtobool(val): # pragma: no cover """Convert a string representation of truth to true (1) or false (0). True values are 'y', 'yes', 't'...
apache-2.0
8,012,565,799,063,346,000
28.555556
97
0.610902
false
azumimuo/family-xbmc-addon
plugin.video.salts/scrapers/yifystreaming_scraper.py
1
4784
""" SALTS XBMC Addon Copyright (C) 2014 tknorris This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. T...
gpl-2.0
7,210,410,083,957,632,000
40.241379
175
0.567099
false
ua-snap/downscale
snap_scripts/epscor_sc/compare_downscaling_versions_plots_cmip5_epscor_sc_pr_compare_withNOFIX.py
1
9093
# # # # # compare tasmin, tas, tasmax in a timeseries of GeoTiff files # # # # def transform_from_latlon( lat, lon ): ''' simple way to make an affine transform from lats and lons coords ''' from affine import Affine lat = np.asarray( lat ) lon = np.asarray(lon) trans = Affine.translation(lon[0], lat[0]) scale ...
mit
-2,754,196,695,637,991,000
37.858974
135
0.634114
false
cyli/volatility
volatility/plugins/linux/psaux.py
1
1520
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
gpl-2.0
-7,106,883,151,586,503,000
34.348837
97
0.675658
false
Ape/sc2skills
main.py
1
2472
#!/usr/bin/env python3 import argparse import collections import enum import trueskill from ladder import Ladder DRAW_PROBABILITY = 0.001 OPPONENT_SIGMA = 0.1 Result = enum.Enum("Result", "win loss") Game = collections.namedtuple("Game", "result mmr label") def load_games(games_file): games = [] with open...
mit
-6,900,255,387,101,599,000
25.569892
79
0.604614
false
srkukarni/heron
integration_test/src/python/integration_test/topology/one_bolt_multi_tasks.py
1
1322
# copyright 2016 twitter. 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 agree...
apache-2.0
2,974,093,918,747,431,000
41.645161
81
0.748109
false
Asurada2015/TFAPI_translation
math_ops_linear algebra/tf_eye.py
1
1214
import tensorflow as tf """tf.eye(num_rows, num_columns=None, batch_shape=None, dtype=tf.float32, name=None) 功能:返回单位阵。 输入:num_rows:矩阵的行数;num_columns:矩阵的列数,默认与行数相等 batch_shape:若提供值,则返回batch_shape的单位阵。""" z1 = tf.eye(2, batch_shape=[2]) # 一个三维矩阵其中包含有两个2行2列的矩阵 z2 = tf.eye(2, batch_shape=[3]) # 一个三维矩阵其中包含有三...
apache-2.0
7,731,127,931,833,210,000
12.381579
84
0.464567
false
WayStudios/fora
fora/__init__.py
1
5883
# fora # Xu [xw901103@gmail.com] Copyright 2015 from pyramid.config import Configurator from pyramid.session import SignedCookieSessionFactory from sqlalchemy import engine_from_config from fora.core.dbsession import DBSession from fora.core.model import Model from fora.core.view import View from fora.core.adminview ...
bsd-3-clause
-8,504,085,155,422,548,000
54.5
152
0.734829
false
yaybu/touchdown
touchdown/tests/stubs/aws/rest_api.py
1
1606
# Copyright 2016 Isotoma Limited # # 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...
apache-2.0
-3,704,852,946,402,137,000
31.12
88
0.62142
false
gedaskir/qmeq
qmeq/approach/base/redfield.py
1
6053
"""Module containing python functions, which generate first order Redfield kernel. For docstrings see documentation of module neumann1.""" import numpy as np import itertools from ...wrappers.mytypes import doublenp from ...wrappers.mytypes import complexnp from ..aprclass import Approach from .neumann1 import Ap...
bsd-2-clause
-8,804,896,393,798,070,000
43.507353
101
0.452999
false
invenia/Arbiter
setup.py
1
1178
""" to install: python setup.py install """ from setuptools import setup setup( name="arbiter", description="A task-dependency solver", long_description=open('README.rst').read(), version="0.4.0", author="Brendan Curran-Johnson", author_email="brendan.curran.johnson@invenia.ca", licen...
mit
2,089,709,813,790,238,000
24.06383
70
0.573854
false
ak15199/rop
art/panimage.py
1
2671
from ._baseclass import ArtBaseClass import requests try: from thread import start_new_thread, allocate_lock except: from _thread import start_new_thread, allocate_lock import logging from opc.image import Image def position(matrix, image): x = 0 y = 0 while y < (image.height-matrix.height): ...
gpl-3.0
-6,688,805,793,518,084,000
25.979798
84
0.561587
false
nuagenetworks/vspk-python
vspk/v6/nuallredundancygroup.py
1
24239
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent Inc, 2017 Nokia # 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 copyrigh...
bsd-3-clause
8,053,294,178,348,660,000
31.890095
372
0.601551
false
waisuan/minblog_af
minblog2/helpers/databaseManager.py
1
6726
from pymongo import MongoClient import time from bson import ObjectId class DatabaseManager: # DB set-up def __init__(self): client = MongoClient() db = client.flaskr self.entries_col = db.entries # sort by [default] descending/latest order def get_all_entries(self, sort_by=-1)...
mit
3,785,670,568,057,706,500
56.487179
144
0.381505
false
haku86/happyowlweb
happyowlweb/happyowlweb/urls.py
1
1074
from django.conf.urls import patterns, include, url from django.conf.urls.static import static from django.conf import settings from django.views.generic import TemplateView # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', url(r'^...
mit
1,547,584,701,885,924,400
33.645161
78
0.675978
false
voidfiles/extraction
extraction/tests/tests.py
1
7513
import unittest import extraction from extraction.tests.data import * from extraction.examples.new_return_type import AddressExtractor class TestSequenceFunctions(unittest.TestCase): def setUp(self): self.extractor = extraction.Extractor() def test_rewriting_relative_urls(self): "Test rewritin...
mit
5,654,097,852,145,496,000
57.695313
364
0.710369
false
shanew/electrum
lib/paymentrequest.py
1
14954
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2014 Thomas Voegtlin # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at y...
gpl-3.0
809,697,329,757,662,100
31.438178
145
0.604922
false
bgroff/kala-app
django_kala/api/basecamp_classic/projects/serializers.py
1
1207
from rest_framework import serializers from projects.models import Project, Category class ProjectSerializer(serializers.ModelSerializer): class Meta: model = Project fields = [ 'id', 'name', 'organization' ] def create(self, validated_data): return Project.objects...
mit
-3,842,473,095,268,577,300
29.948718
117
0.641259
false
jsheedy/worldmap-dynamic-zoom
server/db.py
1
1671
import contextlib import logging import time import psycopg2 import psycopg2.extras as extras import psycopg2.pool as pool import config import queries connection_pool = pool.ThreadedConnectionPool(config.MINCONN, config.MAXCONN, database=config.DB['DB'], user=config.DB['USER'], password=config.DB['PASSWORD']) @con...
unlicense
-171,222,791,807,689,100
28.315789
159
0.608019
false
Wolfterro/SVD
src/old/1.0/GlobalVars.py
1
1651
# -*- coding: utf-8 -*- ''' The MIT License (MIT) Copyright (c) 2017 Wolfgang Almeida <wolfgang.almeida@yahoo.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, i...
mit
-2,166,897,040,673,686,500
34.577778
80
0.707421
false
UUDigitalHumanitieslab/timealign
annotations/views.py
1
25800
import os from collections import defaultdict from tempfile import NamedTemporaryFile from lxml import etree from django.contrib import messages from django.contrib.admin.utils import construct_change_message from django.contrib.auth.mixins import LoginRequiredMixin, PermissionRequiredMixin from django.contrib.messag...
mit
3,640,639,079,216,742,400
38.389313
116
0.647868
false
Yelp/paasta
paasta_tools/paastaapi/model/marathon_mesos_nonrunning_task.py
1
7535
# coding: utf-8 """ Paasta API No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 impor...
apache-2.0
6,798,839,742,654,500,000
39.294118
124
0.563769
false
shubhdev/edx-platform
lms/djangoapps/certificates/tests/test_views.py
1
30514
"""Tests for certificates views. """ import json import ddt from uuid import uuid4 from nose.plugins.attrib import attr from mock import patch from django.conf import settings from django.core.cache import cache from django.core.urlresolvers import reverse from django.test import TestCase from django.test.client impo...
agpl-3.0
988,242,617,299,130,100
40.459239
118
0.606967
false
saintleva/limited-apt
tools/obtain-priorities/parsing.py
1
2444
#!/usr/bin/env python3 # # Copyright (C) Anton Liaukevich 2011-2020 <leva.dev@gmail.com> # # 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, or (at your o...
gpl-3.0
8,631,690,937,187,985,000
37.793651
124
0.677169
false
openstack/heat
heat/tests/openstack/neutron/test_sfc/test_port_chain.py
1
6568
# # 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 agreed to ...
apache-2.0
103,200,701,343,941,060
37.409357
79
0.600792
false
matrumz/RPi_Custom_Files
Printing/hplip-3.15.2/ui4/plugindiagnose.py
1
3164
# -*- coding: utf-8 -*- # # (c) Copyright 2001-2011 Hewlett-Packard Development Company, L.P. # # 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 opt...
gpl-2.0
7,540,046,640,401,814,000
28.570093
161
0.677623
false
gradiuscypher/internet_illithid
mirror_shield/endpoints/filestore.py
1
2550
import traceback import requests import time import imghdr from os.path import exists, isfile, join, isdir from os import makedirs, listdir, walk from flask import Blueprint, request, send_from_directory, render_template filestore = Blueprint('callback', __name__) @filestore.route('/clone', methods=["POST"]) def clo...
mit
-8,529,620,719,959,950,000
27.977273
111
0.606667
false
sergeysynergy/graph
django/app/urls.py
1
2642
# -*- coding: utf-8 -*- from django.conf.urls import include, url from django.contrib import admin import app.settings as settings urlpatterns = [ url(r'^admin/', include(admin.site.urls)), ] urlpatterns += [ url(r'^static/(?P<path>.*)$', 'django.views.static.serve',{'document_root': settings.URL_STATIC_ROO...
mit
-8,054,665,147,103,789,000
47.603774
151
0.60559
false
chetan51/nupic.research
sensorimotor/tests/unit/one_d_universe_test.py
1
2335
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2014, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
gpl-3.0
1,721,112,332,134,884,000
39.258621
76
0.668094
false
ucfopen/canvasapi
canvasapi/course.py
1
94642
import warnings from canvasapi.assignment import Assignment, AssignmentGroup from canvasapi.blueprint import BlueprintSubscription from canvasapi.canvas_object import CanvasObject from canvasapi.collaboration import Collaboration from canvasapi.course_epub_export import CourseEpubExport from canvasapi.custom_gradebook...
mit
1,574,006,498,719,888,100
34.499625
132
0.601858
false
remeeting/mrp-score
match_ref_hyp.py
1
7218
#!/usr/bin/env python ###################################################################### # # File: match_ref_hyp.py # Author: Adam Janin # Feb 23, 2017 # # Given a reference file and a hypothesis file, figure out which parts # of the hypotheses match which part of the reference. Output the # hypotheses file...
apache-2.0
9,198,778,341,884,706,000
39.550562
431
0.655583
false
molgor/cyberklt
cyberklt/drivers/models.py
1
1851
# -*- coding: utf-8 -*- import numpy as np from django.db import models import drivers.MPL3115A2 as mpl class Temperature(models.Model): temp = models.FloatField(default=-999.9) #Celcius altitude = models.FloatField(default=np.nan) #meters timestamp = models.DateTimeField(auto_now=True) instrument = m...
gpl-3.0
6,452,715,802,677,283,000
27.476923
70
0.594273
false
nicolashainaux/mathmaker
toolbox/build_db.py
1
89443
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Mathmaker creates automatically maths exercises sheets # with their answers # Copyright 2006-2017 Nicolas Hainaux <nh.techn@gmail.com> # This file is part of Mathmaker. # Mathmaker is free software; you can redistribute it and/or modify # it under the terms of the GNU...
gpl-3.0
5,954,798,789,077,043,000
47.293737
79
0.482178
false
aberon10/training
training/ticketing_system/views.py
1
10444
# -*- coding: utf-8 -*- import time from django.db.models import Q from django.shortcuts import render from django.http import HttpResponseRedirect from django.http import HttpResponseNotFound from django.contrib.auth.hashers import make_password from django.contrib.auth.hashers import check_password from django.views....
mit
-1,894,123,065,612,673,500
32.474359
79
0.486021
false
cadithealth/iniherit
iniherit/parser.py
1
9823
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------ # file: $Id$ # auth: Philip J Grabner <grabner@cadit.com> # date: 2013/08/20 # copy: (C) Copyright 2013 Cadit Health Inc., All Rights Reserved. #-----------------------------------------------------------------------...
mit
6,685,569,589,398,013,000
38.769231
80
0.551461
false
MadsJensen/RP_scripts
extract_ts_epochs_interupt.py
1
1207
import sys import numpy as np import mne from mne.minimum_norm import read_inverse_operator, apply_inverse_epochs from my_settings import (mne_folder, epochs_folder, source_folder) subject = sys.argv[1] method = "dSPM" snr = 1. lambda2 = 1. / snr**2 labels = mne.read_labels_from_annot( subject=subject, parc="PA...
bsd-3-clause
1,019,196,104,266,555,100
29.175
78
0.589064
false
ContinuumIO/chaco
setup.py
1
2424
# Copyright (c) 2008-2012 by Enthought, Inc. # All rights reserved. from os.path import join from numpy import get_include from setuptools import setup, Extension, find_packages info = {} execfile(join('chaco', '__init__.py'), info) numpy_include_dir = get_include() # Register Python extensions contour = Extension...
bsd-3-clause
-1,258,937,183,096,643,600
31.756757
79
0.622937
false
cread/ecks
ecks/plugins/disk.py
1
2091
""" Ecks plugin to collect disk usage information Copyright 2011 Chris Read (chris.read@gmail.com) 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/lice...
apache-2.0
7,506,630,265,331,763,000
30.681818
109
0.642276
false
MaxTyutyunnikov/lino
obsolete/src/sandbox/cherrypy/4/hello4.py
1
1278
#!/usr/bin/python import cherrypy from HyperText.Documents import Document from HyperText import HTML as html from lino.apps.pinboard import demo class Root: def __init__(self,dbsess): self.dbsess = dbsess def default(self,*args,**kw): title=str(self.dbsess) doc=Document(titl...
gpl-3.0
2,859,601,189,977,585,700
22.236364
65
0.564945
false
alpine9000/amiga_examples
tools/external/amitools/amitools/binfmt/hunk/HunkReader.py
1
30698
"""A class for reading Amiga executables and object files in Hunk format""" import os import struct import StringIO from types import * from Hunk import * class HunkReader: """Load Amiga executable Hunk structures""" def __init__(self): self.hunks = [] self.error_string = None self.type = None se...
bsd-2-clause
-663,237,826,273,252,900
30.197154
115
0.555052
false
hankcs/HanLP
hanlp/components/parsers/conll.py
1
2534
# -*- coding:utf-8 -*- # Author: hankcs # Date: 2019-12-26 15:37 from typing import Union from hanlp.utils.io_util import get_resource, TimingFileIterator from hanlp.utils.log_util import logger def collapse_enhanced_empty_nodes(sent: list): collapsed = [] for cells in sent: if isinstance(cells[0], f...
apache-2.0
6,535,195,912,218,275,000
33.712329
119
0.500395
false
gautamMalu/XenInBox
pyanaconda/rescue.py
1
18256
# # rescue.py - anaconda rescue mode setup # # Copyright (C) 2001, 2002, 2003, 2004 Red Hat, Inc. All rights reserved. # # 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...
gpl-2.0
1,907,631,276,107,746,300
36.030426
117
0.526731
false