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
Aegeaner/spark
python/pyspark/testing/utils.py
1
3566
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
-146,794,885,754,362,100
27.07874
97
0.668256
false
rahulraj/web_projects
assignment2/src/photogallery/generator/galleryitemfactory.py
1
6059
import os import re import os.path from iptcinfo import IPTCInfo from galleryitem import JpegPicture, JpegDirectory, directory_name_to_html_file_name from ..utils.inject import assign_injectables def is_jpeg_file(file_name): """ Determine if a file is labeled as a JPEG. Args: file_name the name of the file....
mit
-6,736,790,274,765,474,000
31.575269
84
0.674039
false
rwl/muntjac
muntjac/addon/invient/demo/invient_demo_win.py
1
154853
# @INVIENT_COPYRIGHT@ # @MUNTJAC_LICENSE@ """Window for Invient charts demo.""" from StringIO \ import StringIO from random \ import random from threading \ import Thread from time \ import sleep from muntjac.addon.invient.invient_charts_util \ import getDate from datetime \ import dateti...
apache-2.0
8,711,462,497,910,326,000
39.505624
144
0.567964
false
mjtamlyn/archery-scoring
scores/migrations/0001_initial.py
1
2398
# -*- coding: utf-8 -*- from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('entries', '0001_initial'), ] operations = [ migrations.CreateModel( name='Arrow', fields=[ ('id', models.AutoField(verbose_n...
bsd-3-clause
7,393,244,661,349,838,000
35.892308
114
0.525855
false
gemrb/gemrb
gemrb/GUIScripts/bg1/ImportFile.py
1
2330
# GemRB - Infinity Engine Emulator # Copyright (C) 2003 The GemRB Project # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later versi...
gpl-2.0
-4,098,847,976,789,444,000
29.657895
81
0.777682
false
datafolklabs/cement
cement/core/extension.py
1
3997
"""Cement core extensions module.""" import sys from abc import abstractmethod from ..core import exc from ..core.interface import Interface from ..core.handler import Handler from ..utils.misc import minimal_logger LOG = minimal_logger(__name__) class ExtensionInterface(Interface): """ This class defines ...
bsd-3-clause
2,490,373,445,105,531,400
26.565517
79
0.589192
false
nkiraly/koadstation
tiledraweru14/provisioning/roles/maptile-import-tools/files/populate.py
1
16836
#!/usr/bin/env python from os import chdir, remove from sys import stderr, stdout from optparse import OptionParser from subprocess import Popen, PIPE from xml.etree.ElementTree import parse, SubElement from os.path import dirname, basename, splitext, join from urlparse import urlparse, urljoin from tempfile import mk...
bsd-2-clause
8,744,793,812,280,144,000
32.60479
126
0.616892
false
CroatianMeteorNetwork/RMS
RMS/Astrometry/CheckFit.py
1
25717
""" Automatic refining of astrometry calibration. The initial astrometric calibration is needed, which will be refined by using all stars from a given night. """ from __future__ import print_function, division, absolute_import import os import sys import copy import shutil import random import argparse import n...
gpl-3.0
8,900,784,430,323,704,000
33.848238
158
0.631722
false
akshaybabloo/gollahalli-com
gollahalli_cms/editor/tests/test_models.py
1
26159
import datetime import os import shutil import unittest.mock as mock from io import BytesIO import pytz from PIL import Image from django.conf import settings from django.core.files.uploadedfile import InMemoryUploadedFile from django.core.files.uploadedfile import SimpleUploadedFile from django.test import TestCase ...
mit
7,561,253,899,140,527,000
38.218891
133
0.512176
false
xjw1001001/IGCexpansion
test/Ancestral_reconstruction/PAML/parse reconstructed fasta.py
1
7314
# -*- coding: utf-8 -*- """ Created on Thu Aug 10 08:23:33 2017 @author: xjw1001001 """ #only when PAML in desktop is available,the yeast version only from Bio import Seq, SeqIO, AlignIO from Bio.Phylo.PAML import codeml, baseml import numpy as np paralog_list = [['YLR406C', 'YDL075W'], ['YER131W', 'YGL189C'], ['YML...
gpl-3.0
-1,790,204,341,473,735,700
45.592357
179
0.537462
false
qinjian623/dlnotes
tutorials/tensorflow/mnist_softmax.py
1
2619
# 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...
gpl-3.0
-4,167,562,545,988,799,000
33.012987
80
0.66323
false
Eigenstate/dabble
dabble/test/dor_abssel/test_dor_absolute_sel.py
1
1915
""" Tests absolute box size with ignored selection """ import os import pytest dir = os.path.dirname(__file__) + "/" #============================================================================== @pytest.mark.skip(reason="Missing input file") def test_absolute_box(tmpdir): """ Tests the absolute box size for...
gpl-2.0
6,778,799,397,482,887,000
33.196429
79
0.526371
false
rinigus/osmscout-server
scripts/import/prepare_distribution.py
1
5119
#!/usr/bin/env python # This script prepares files before uploading them for distribution # This has to be run after all imports are finished import json, pickle, os, stat, shutil from mapbox_country_pack import world_pack as mapboxgl_world_pack root_dir = "distribution" bucket = open("bucket_name", "r").read().stri...
gpl-3.0
1,752,026,904,201,722,600
33.126667
158
0.621606
false
jose-caballero/cvmfsreplica
cvmfsreplica/cvmfsreplicaex.py
1
1122
#! /usr/bin/env python # # exception classes for cvmfsreplica project class ServiceConfigurationFailure(Exception): """ Exception to be raised when basic service configuration cannot be read """ def __init__(self, value): self.value = value def __str__(self): return repr(self.v...
gpl-3.0
-3,819,787,098,476,026,400
22.87234
64
0.635472
false
lohner/Praktomat
src/tasks/views.py
1
5082
# -*- coding: utf-8 -*- import tempfile import zipfile from django.contrib.auth.decorators import login_required from django.contrib.admin.views.decorators import staff_member_required from django.shortcuts import render, get_object_or_404 from django.http import Http404 from django.http import HttpResponseRedirect, ...
gpl-2.0
-790,482,774,938,512,000
36.925373
110
0.684967
false
SchulzLab/SOS
install_script.py
1
11581
#!/usr/bin/env python import os from optparse import OptionParser import subprocess import sys #import commands class install_script(): def __init__(self): self.prog_installed = [] def obtaining_tar(self, prog, path): if (prog == 6): os.chdir(path) #Before obtaining tha tar file of the corresponding tool,...
mit
928,657,617,958,597,400
36.723127
186
0.656075
false
spirali/elphie
elphie/textparser.py
1
1946
def normalize_tokens(tokens): # Remove empty texts tokens = [kv for kv in tokens if kv[0] != "text" or kv[1]] # Merge lines i = 1 while i < len(tokens): token_name, value = tokens[i] if token_name == "newline" and tokens[i - 1][0] == "newline": value2 = tokens[i - 1][1]...
bsd-2-clause
5,328,669,194,339,669,000
28.044776
78
0.482014
false
abacuspix/NFV_project
Build_Web_With_Flask/Building web applications with Flask_Code/chapter08/ex05.py
1
1529
# coding:utf-8 from flask import Flask, render_template, session, flash from flask.ext.sqlalchemy import SQLAlchemy app = Flask(__name__) # strong secret key!! app.config['SECRET_KEY'] = '\xa6\xb5\x0e\x7f\xd3}\x0b-\xaa\x03\x03\x82\x10\xbe\x1e0u\x93,{\xd4Z\xa3\x8f' app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///e...
mit
-965,825,808,537,951,900
24.5
104
0.59843
false
DeepThoughtTeam/tensorflow
tensorflow/python/kernel_tests/tensor_array_ops_test.py
1
16965
# 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...
apache-2.0
7,498,672,109,148,403,000
35.327623
80
0.641379
false
mozilla/bztools
auto_nag/history.py
1
16781
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. from pprint import pprint from libmozdata.bugzilla import Bugzilla from auto_nag import logger class History(object)...
bsd-3-clause
1,119,390,109,281,556,700
38.859857
118
0.311722
false
econ-ark/HARK
HARK/ConsumptionSaving/tests/test_SmallOpenEconomy.py
1
1397
import copy from HARK import distribute_params from HARK.ConsumptionSaving.ConsAggShockModel import ( AggShockConsumerType, SmallOpenEconomy, init_cobb_douglas, ) from HARK.distribution import Uniform import numpy as np import unittest class testSmallOpenEconomy(unittest.TestCase): def test_small_open...
apache-2.0
-2,018,076,852,372,516,600
32.261905
81
0.652112
false
power12317/weblate
weblate/trans/tests/__init__.py
1
1330
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # 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, eithe...
gpl-3.0
5,367,127,302,535,231,000
41.806452
71
0.767898
false
janekg89/flutype_webapp
flutype/urls.py
1
4288
from django.conf.urls import url from django.contrib import admin from django.conf.urls import url, include from . import views urlpatterns = [ url(r'^$', views.studies_view, name='index'), url(r'^admin/', include(admin.site.urls), name='admin'), url(r'^mystudies/$', views.my_studies_view, name='my_studi...
lgpl-3.0
-968,179,063,116,697,900
55.434211
119
0.652052
false
reeshupatel/demo
keystone/openstack/common/lockutils.py
1
12121
# Copyright 2011 OpenStack Foundation. # 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 req...
apache-2.0
1,740,347,212,759,408,400
30.98153
78
0.613646
false
vpelletier/neoppod
neo/tests/testHandler.py
1
2979
# # Copyright (C) 2009-2016 Nexedi SA # # 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...
gpl-2.0
-6,620,514,194,886,175,000
31.736264
75
0.653911
false
morgenst/PyAnalysisTools
tests/unit/TestUtilities.py
1
2542
import os import unittest from PyAnalysisTools.base import Utilities, InvalidInputError # from pyfakefs.fake_filesystem_unittest import TestCase cwd = os.path.dirname(__file__) class TestUtilities(unittest.TestCase): def setUp(self): pass # self.setUpPyfakefs() def tearDown(self): pa...
mit
-6,940,602,139,215,756,000
35.84058
115
0.646735
false
Namax0r/resistor-calculator
resistor_calculator.py
1
9566
#!/usr/bin/env python # Basic version handling try: # Python2 import Tkinter as tk except ImportError: # Python3 import tkinter as tk from tkinter.ttk import Combobox from tkinter import messagebox # Small utility that adds dot notation access to dictionary attributes class dotdict(dict): __getat...
mit
-1,463,508,674,641,083,400
43.259259
135
0.601255
false
mjasher/gac
GAC/flopy/modflow/mfdrn.py
1
7133
""" mfdrn module. Contains the ModflowDrn class. Note that the user can access the ModflowDrn class as `flopy.modflow.ModflowDrn`. Additional information for this MODFLOW package can be found at the `Online MODFLOW Guide <http://water.usgs.gov/ogw/modflow/MODFLOW-2005-Guide/index.html?drn.htm>`_. """ import...
gpl-2.0
-3,510,670,181,342,770,700
33.311881
112
0.549418
false
mosen/salt-osx
_modules/deprecated/mac_shadow.py
1
10388
# -*- coding: utf-8 -*- ''' Manage Mac OSX local directory passwords and policies. Note that it is usually better to apply password policies through the creation of a configuration profile. Tech Notes: Usually when a password is changed by the system, there's a responsibility to check the hash list and generate hashe...
mit
-2,658,986,317,874,695,000
30.383686
185
0.663939
false
rodrigosurita/GDAd
sdaps/model/questionnaire.py
1
9008
# -*- coding: utf8 -*- # SDAPS - Scripts for data acquisition with paper based surveys # Copyright(C) 2008, Christoph Simon <post@christoph-simon.eu> # Copyright(C) 2008, Benjamin Berg <benjamin@sipsolutions.net> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Ge...
gpl-3.0
2,867,286,513,674,983,400
24.232493
83
0.559614
false
mornsun/javascratch
src/topcoder.py/LC_330_Patching_Array.py
1
1807
#!/usr/bin/env python #coding=utf8 ''' Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n] inclusive can be formed by the sum of some elements in the array. Return the minimum number of patches required. Example 1: nums = [1, 3], n = 6 Retu...
gpl-2.0
8,682,041,023,751,641,000
24.111111
242
0.570559
false
SaltusVita/ReoGrab
Spiders.py
1
6942
''' Created on 2 сент. 2016 г. @author: garet ''' import urllib.request import queue import sqlite3 import re import json from urllib.parse import urlparse from Parser import HtmlPage import lxml class BaseSpider: def __init__(self): self.urls = QueueUrls() self.cache = Sqlite...
bsd-3-clause
2,515,193,081,959,107,000
26.430328
124
0.486666
false
rven/odoo
addons/l10n_ch/models/res_bank.py
1
16379
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import re from odoo import api, fields, models, _ from odoo.exceptions import ValidationError from odoo.tools.misc import mod10r from odoo.exceptions import UserError import werkzeug.urls ISR_SUBSCRIPTION_CODE = {'CHF...
agpl-3.0
1,126,025,373,065,044,900
51.16242
216
0.567251
false
googleapis/googleapis-gen
google/cloud/talent/v4beta1/talent-v4beta1-py/google/cloud/talent_v4beta1/services/completion/transports/grpc.py
1
11561
# -*- 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...
apache-2.0
3,560,645,474,204,908,500
44.515748
91
0.607992
false
rldleblanc/ceph-tools
osd_hunter.py
1
6255
#!/usr/bin/python # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 import argparse import re import datetime import operator import pprint import glob import gzip slow_threshold = 10 #seconds # Nothing to change past here verbose = None re_slow = re.compile(r'^(\d+-\d+-\d+\s+\d+:\d+:\d+\.\d+)\s+\w+\s+0.*slow....
lgpl-3.0
-2,655,373,338,628,918,300
37.850932
127
0.561311
false
santisiri/popego
envs/ALPHA-POPEGO/lib/python2.5/site-packages/numpy-1.0.4-py2.5-linux-x86_64.egg/numpy/distutils/cpuinfo.py
1
22466
#!/usr/bin/env python """ cpuinfo Copyright 2002 Pearu Peterson all rights reserved, Pearu Peterson <pearu@cens.ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy (BSD style) license. See LICENSE.txt that came with this distribution for specifics. NO WARRANTY IS EXP...
bsd-3-clause
-3,900,664,180,430,769,700
31.989721
85
0.54509
false
skim1420/spinnaker
spinbot/event/release_branch_pull_request_handler.py
1
2049
from .handler import Handler from .pull_request_event import GetBaseBranch, GetPullRequest, GetTitle, GetRepo from gh import ReleaseBranchFor, ParseCommitMessage format_message = ('Features cannot be merged into release branches. The following commits ' + 'are not tagged as one of "{}":\n\n{}\n\n' + 'Read more...
apache-2.0
-3,984,927,411,745,407,000
40.816327
133
0.627135
false
wjwwood/open-robotics-platform
template.py
1
1949
#!/usr/bin/env python -OO # encoding: utf-8 ########### # ORP - Open Robotics Platform # # Copyright (c) 2010 John Harrison, William Woodall # # 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 Softwa...
mit
97,687,108,796,476,430
29.453125
79
0.709595
false
Ebag333/Pyfa
eos/effects/subsystembonusgallentedefensivearmoredwarfare.py
1
1528
# subSystemBonusGallenteDefensiveArmoredWarfare # # Used by: # Subsystem: Proteus Defensive - Warfare Processor type = "passive" def handler(fit, src, context): fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Armored Command"), "buffDuration", src.getModifiedIte...
gpl-3.0
-8,301,749,523,908,657,000
65.434783
109
0.632199
false
seanbell/opensurfaces
server/normals/views.py
1
9087
import json from django.shortcuts import render, get_object_or_404 from django.db.models import F from django.http import HttpResponse from django.views.decorators.http import require_POST from django.core.urlresolvers import reverse from django.contrib.admin.views.decorators import staff_member_required from django.v...
mit
-7,393,847,818,757,390,000
33.683206
86
0.646748
false
ericpp/hippyvm
testing/test_var_funcs.py
1
1346
import py.test from hippy.objects.floatobject import W_FloatObject from testing.test_interpreter import BaseTestInterpreter class TestVarFuncs(BaseTestInterpreter): def test_print_r(self): output = self.run(''' class A { private $y = 5; } $a = new A; $a->x = arra...
mit
8,298,484,580,307,833,000
27.041667
78
0.506686
false
a25kk/bfa
src/bfa.sitecontent/bfa/sitecontent/widgets/content/video.py
1
4222
# -*- coding: utf-8 -*- """Module providing event filter widget""" import uuid as uuid_tool from Acquisition import aq_inner from Products.Five import BrowserView from plone import api from plone.i18n.normalizer import IIDNormalizer from wildcard.media.behavior import IVideo from zope.component import queryUtility cl...
mit
7,906,045,721,442,587,000
29.594203
78
0.578399
false
lgarren/spack
var/spack/repos/builtin/packages/r-affycomp/package.py
1
1773
############################################################################## # 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
-6,339,694,925,005,970,000
45.657895
126
0.681331
false
redshiftzero/pgpbuddy
tests/test_crypto.py
1
10432
from unittest.mock import patch from unittest import TestCase from nose.tools import assert_list_equal from pgpbuddy.crypto import * from tests.mock_gpg import * class TestCheckEncryptionAndSignature(TestCase): @patch('gnupg.GPG', decrypt=mock_decrypt(Encryption.missing, Signature.missing)) def test_plain...
gpl-2.0
-8,515,414,340,223,326,000
40.233202
120
0.681557
false
CoderDuan/mantaflow
scenes/simpleplume.py
2
1414
# # Simple example scene (hello world) # Simulation of a buoyant smoke density plume (with noise texture as smoke source) # #import pdb; pdb.set_trace() from manta import * # solver params res = 64 gs = vec3(res, int(1.5*res), res) s = FluidSolver(name='main', gridSize = gs) # prepare grids flags = s.create(F...
gpl-3.0
-5,257,533,783,658,418,000
24.25
96
0.701556
false
BaseBot/Triangula
src/python/setup.py
1
1035
__author__ = 'tom' from setuptools import setup # Makes use of the sphinx and sphinx-pypi-upload packages. To build for local development # use 'python setup.py develop'. To upload a version to pypi use 'python setup.py clean sdist upload'. # To build docs use 'python setup.py build_sphinx' and to upload docs to pytho...
apache-2.0
2,400,253,366,044,438,500
40.4
102
0.689855
false
libAtoms/matscipy
scripts/fracture_mechanics/run_crack_thin_strip.py
1
4618
#! /usr/bin/env python # ====================================================================== # matscipy - Python materials science tools # https://github.com/libAtoms/matscipy # # Copyright (2014) James Kermode, King's College London # Lars Pastewka, Karlsruhe Institute of Technology # # This progr...
gpl-2.0
7,947,069,792,221,883,000
33.721805
90
0.638372
false
mvaled/sentry
src/sentry/api/endpoints/group_integration_details.py
1
11884
from __future__ import absolute_import from django.db import IntegrityError, transaction from rest_framework.response import Response from sentry import features from sentry.api.bases import GroupEndpoint from sentry.api.serializers import serialize from sentry.api.serializers.models.integration import IntegrationIs...
bsd-3-clause
-9,031,003,722,667,048,000
39.838488
100
0.61688
false
madmatah/lapurge
lapurge/types.py
1
3448
# Copyright (c) 2013 Matthieu Huguet # 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, modify, merge, publish, dist...
mit
2,537,618,906,637,552,000
33.48
93
0.640371
false
ftkghost/SuperSaver
supersaver/core/decorator.py
1
1206
from functools import wraps from .exception import UnauthorizedUser, UnsupportedHttpMethod ß def login_required(func): @wraps(func) def check_user_login(request, *args, **kwargs): if not request.user.is_authenticated(): raise UnauthorizedUser() return func(request, *args, **kwargs)...
bsd-2-clause
6,125,387,155,594,682,000
29.125
84
0.648963
false
silvau/Addons_Odoo
hr_bulk_period/__openerp__.py
1
1643
# -*- encoding: utf-8 -*- ############################################################################ # Module for OpenERP, Open Source Management Solution # # Copyright (c) 2013 Zenpar - http://www.zeval.com.mx/ # All Rights Reserved. ##########################################################################...
gpl-2.0
7,758,319,804,437,166,000
37.209302
78
0.52465
false
NMGRL/pychron
pychron/ml/tasks/actions.py
1
1114
# =============================================================================== # Copyright 2019 Jake Ross # # 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...
apache-2.0
6,036,008,776,714,166,000
45.416667
81
0.531418
false
rlutz/xorn
src/backend/gnet_bae.py
1
1626
# gaf.netlist - gEDA Netlist Extraction and Generation # Copyright (C) 1998-2010 Ales Hvezda # Copyright (C) 1998-2010 gEDA Contributors (see ChangeLog for details) # Copyright (C) 2013-2019 Roland Lutz # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Publ...
gpl-2.0
-7,487,250,061,490,648,000
39.65
77
0.674662
false
EvilCult/Video-Downloader
Library/toolClass.py
1
3025
#!/usr/bin/env python # -*- coding: utf-8 -*- import pycurl import StringIO import random class Tools : def __init__ (self) : pass def getPage (self, url, requestHeader = []) : resultFormate = StringIO.StringIO() fakeIp = self.fakeIp() requestHeader.append('CLIENT-IP:' + fakeIp) requestHeader.append('X...
gpl-2.0
-4,087,712,925,453,522,000
19.585034
66
0.495207
false
bpetering/python-pattern-recognition
pattern_recognition.py
1
2300
def constant(diffs): val = diffs.pop() for d in diffs: if d != val: return False return val def pat1(seq): # consider two elements at a time diffs = [] for i in xrange(1, len(seq)): diffs.append( seq[i] - seq[i-1] ) # implicit directionality - factor...
mit
4,782,913,297,461,526,000
28.263158
118
0.553478
false
cogstat/cogstat
cogstat/test/test_stat.py
1
22429
# -*- coding: utf-8 -*- import unittest import os import sys sys.path.insert(0, os.path.abspath('../..')) print(sys.path) from pathlib import Path import numpy as np import pandas as pd from cogstat import cogstat as cs print(cs.__file__) print(cs.__version__) print(os.path.abspath(cs.__file__)) """ - All statistica...
gpl-3.0
2,875,072,844,080,069,600
55.772152
171
0.550056
false
hnakamur/saklient.python
saklient/cloud/models/model_iface.py
1
3605
# -*- coding:utf-8 -*- from ..client import Client from .model import Model from ..resources.resource import Resource from ..resources.iface import Iface from ...util import Util import saklient # module saklient.cloud.models.model_iface class Model_Iface(Model): ## インタフェースを検索・作成するための機能を備えたクラス。 ## @priv...
mit
5,133,975,804,251,336,000
27.417476
99
0.622822
false
okuraoy/mywork
mtlearn/datasets.py
1
2037
#!/usr/bin/python # -*- coding: utf-8 -*- import numpy as np import pandas as pd from sklearn.datasets.base import Bunch from os.path import join PATH = "d:\\data" # class Bunch(dict): # """Container object for datasets # Dictionary-like object that exposes its keys as attributes. # # See...
apache-2.0
4,101,028,020,952,745,000
27.1
114
0.569956
false
Azure/azure-sdk-for-python
sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2020_09_01/operations/_domain_registration_provider_operations.py
1
5142
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
2,799,316,774,956,120,600
44.504425
133
0.652859
false
lum4chi/mygensim
models/qlmodel.py
1
1822
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2016 Francesco Lumachi <francesco.lumachi@gmail.com> from __future__ import division from gensim import models, utils import math class QLModel(models.TfidfModel): """ Use of models.TfidfModel as base to build Query Likelihood Model (12.9) appeared i...
gpl-3.0
2,304,769,948,544,169,700
43.341463
94
0.614199
false
lightbase/LBConverter
lbconverter/config.py
1
4423
def set_config(): import ConfigParser config = ConfigParser.ConfigParser() config.read('development.ini') global REST_URL global OUTPATH global DEFAULT_OPENOFFICE_PORT global PIDFILE_PATH global LOGFILE_PATH global SUPPORTED_FILES #---------------------# # Configuration...
gpl-2.0
-7,174,447,507,429,265,000
28.098684
97
0.496496
false
ftrain/django-ftrain
kcal/migrations/0002_to_energy_model.py
1
3214
from south.db import db from django.db import models from ftrain.ohlih.models import * class Migration: def forwards(self, orm): # Adding model 'Energy' db.create_table('ohlih_energy', ( ('kcal_is_est', orm['ohlih.energy:kcal_is_est']), ('kcal', orm['ohlih.ene...
bsd-3-clause
1,700,160,144,269,069,800
43.638889
111
0.520846
false
jlengrand/Ivolution
ivolution/util/Notifier.py
1
2002
""" .. module:: Notifier :platform: Unix, Windows :synopsis: Implements a simple Observer/Observable pattern for communication between between Facemovie thread and Ivolution GUI .. moduleauthor:: Julien Lengrand-Lambert <jlengrand@gmail.com> """ class Observer(): """ Implements a simple Observer from t...
bsd-3-clause
-6,127,289,947,069,954,000
24.341772
130
0.51998
false
IronLanguages/ironpython3
Tests/test_bool.py
1
4185
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. import unittest from iptest import is_cli, long, run_test class BoolTest(unittest.TestCase): def test_type...
apache-2.0
-3,756,831,943,541,605,000
38.11215
99
0.493429
false
zcoinofficial/zcoin
src/tor/scripts/codegen/makedesc.py
1
10850
#!/usr/bin/python # Copyright 2014-2019, The Tor Project, Inc. # See LICENSE for license information # This is a kludgey python script that uses ctypes and openssl to sign # router descriptors and extrainfo documents and put all the keys in # the right places. There are examples at the end of the file. # I've used t...
mit
6,792,913,120,685,563,000
29.911681
149
0.614194
false
zackdever/kafka-python
test/test_consumer_group.py
1
4801
import collections import logging import threading import time import pytest import six from kafka import SimpleClient from kafka.conn import ConnectionStates from kafka.consumer.group import KafkaConsumer from kafka.structs import TopicPartition from test.conftest import version from test.testutil import random_str...
apache-2.0
-7,511,210,647,016,828,000
31.883562
86
0.614664
false
cheral/orange3
Orange/widgets/utils/plot/owplot.py
4
69148
''' ################# Plot (``owplot``) ################# .. autoclass:: OrangeWidgets.plot.OWPlot ''' from AnyQt.QtWidgets import \ QGraphicsView, QGraphicsScene, QGraphicsRectItem, QGraphicsTextItem,\ QToolTip, QApplication from AnyQt.QtGui import QPen, QBrush, QColor, QPainter, QTransform, QPolygonF fro...
bsd-2-clause
-1,525,150,586,387,520,000
35.820021
172
0.580668
false
lamondlab/sipify
CppHeaderParser-2.7/CppHeaderParser/CppHeaderParser.py
1
114661
#!/usr/bin/python # # Author: Jashua R. Cloutier (contact via https://bitbucket.org/senex) # Project: http://senexcanis.com/open-source/cppheaderparser/ # # Copyright (C) 2011, Jashua R. Cloutier # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted ...
apache-2.0
-2,464,328,562,798,681,000
42.713687
210
0.502629
false
nschaetti/EchoTorch
echotorch/nn/ICACell.py
1
2909
# -*- coding: utf-8 -*- # # File : echotorch/nn/ESN.py # Description : An Echo State Network module. # Date : 26th of January, 2018 # # This file is part of EchoTorch. EchoTorch 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 Sof...
gpl-3.0
4,296,446,302,283,977,700
24.973214
104
0.546236
false
hehaichi/django-imagemanagement
imageserver/settings.py
1
3326
""" Django settings for imageserver project. Generated by 'django-admin startproject' using Django 1.10.5. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ impor...
mit
2,671,746,408,004,011,500
25.396825
91
0.693025
false
openwisp/netjsonconfig
netjsonconfig/backends/openvpn/openvpn.py
1
5835
from ...schema import X509_FILE_MODE from ..base.backend import BaseBackend from . import converters from .parser import OpenVpnParser, config_suffix, vpn_pattern from .renderer import OpenVpnRenderer from .schema import schema class OpenVpn(BaseBackend): """ OpenVPN 2.x Configuration Backend """ sch...
gpl-3.0
-5,404,192,686,488,379,000
32.153409
97
0.533676
false
beagles/neutron_hacking
neutron/plugins/vmware/plugins/service.py
1
81209
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 VMware, 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/lic...
apache-2.0
6,044,891,143,040,677,000
43.279716
79
0.572732
false
pkariz/nnsearch
nnsearch/approx/Annoy.py
1
6165
from ..baseindex import Index import numpy as np import math from annoy import AnnoyIndex class Annoy(Index): """ AnnoyIndex from annoy package. """ def __init__(self): self.algorithm = "AnnoyIndex" self.idx_to_vector = {} self.valid_types = [np.uint8, np.uint16, np.uint32, np...
gpl-3.0
-3,607,731,220,281,790,000
39.827815
132
0.579238
false
HERA-Team/pyuvdata
pyuvdata/uvbeam/cst_beam.py
1
13336
# -*- mode: python; coding: utf-8 -*- # Copyright (c) 2018 Radio Astronomy Software Group # Licensed under the 2-clause BSD License """Class for reading beam CST files.""" import re import warnings import numpy as np from .uvbeam import UVBeam from .. import utils as uvutils __all__ = ["CSTBeam"] class CSTBeam(UVB...
bsd-2-clause
7,236,658,128,043,490,000
36.886364
88
0.540492
false
joaquinlpereyra/ludema
ludema/abstract/actions.py
1
11361
import random from functools import wraps from ludema.abstract.utils import Direction from ludema.exceptions import (PieceIsNotOnATileError, PieceIsNotOnThisBoardError, TileIsEmptyError, NotGrabbableError) class Action: de...
gpl-3.0
6,046,794,451,876,565,000
35.066667
93
0.602588
false
twilio/twilio-python
tests/integration/preview/sync/service/sync_list/test_sync_list_item.py
1
10556
# coding=utf-8 r""" This code was generated by \ / _ _ _| _ _ | (_)\/(_)(_|\/| |(/_ v1.0.0 / / """ from tests import IntegrationTestCase from tests.holodeck import Request from twilio.base import serialize from twilio.base.exceptions import TwilioException from twilio.http.response import Response...
mit
-3,002,607,029,883,144,000
42.085714
219
0.551156
false
lycantropos/cetus
cetus/queries/filters.py
1
2007
from typing import Optional, Tuple, Any from cetus.types import (FiltersType, FilterType) from cetus.utils import join_str from .utils import normalize_value LOGICAL_OPERATORS = {'AND', 'OR'} INCLUSION_OPERATORS = {'IN', 'NOT IN'} RANGE_OPERATORS = {'BETWEEN'} COMPARISON_OPERATORS = {'=', '!...
mit
-6,637,450,050,062,195,000
30.857143
59
0.539113
false
RandallDW/Aruba_plugin
plugins/org.python.pydev/pysrc/_pydevd_bundle/pydevd_referrers.py
1
8832
from _pydevd_bundle.pydevd_constants import dict_contains import sys from _pydevd_bundle import pydevd_xml from os.path import basename import traceback try: from urllib import quote, quote_plus, unquote, unquote_plus except: from urllib.parse import quote, quote_plus, unquote, unquote_plus #@Reimport @Unresol...
epl-1.0
8,083,347,202,527,346,000
35.8
109
0.434783
false
adamcaudill/yawast
yawast/external/spinner.py
1
1596
# From: https://stackoverflow.com/a/39504463 # License: Creative Commons Attribution-Share Alike # Copyright: Victor Moyseenko import sys import threading import time class Spinner: running = False busy = False delay = 0.1 @staticmethod def spinning_cursor(): while 1: for cur...
mit
-1,195,580,193,516,973,800
23.553846
66
0.537594
false
BackupTheBerlios/pyhttpd-svn
core/baseHTTPRequestHandler.py
1
11117
# -*- coding: utf-8 -*- ################################################################## # pyHTTPd # $Id$ # (c) 2006 by Tim Taubert ################################################################## import os, sys, socket, time, mimetools from mimetypes import MimeTypes from baseConfig import pConfig import baseRo...
gpl-2.0
305,883,743,289,710,850
33.206154
209
0.652784
false
szaydel/psutil
psutil/_pslinux.py
1
40630
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Linux platform implementation.""" from __future__ import division import os import errno import socket import struct import sys...
bsd-3-clause
5,321,260,057,435,817,000
35.53777
84
0.510066
false
Rdbaker/Mealbound
ceraon/utils.py
1
4801
# -*- coding: utf-8 -*- """Helper utilities and decorators.""" from datetime import timedelta as td from datetime import tzinfo from threading import Thread import requests from flask import Blueprint, current_app, flash, request def get_fb_access_token(): """Get an access token from facebook for graph API calls...
bsd-3-clause
-1,679,549,717,610,896,600
32.573427
78
0.586961
false
ActiveState/code
recipes/Python/577336_Fast_reentrant_optimistic_lock_implemented/recipe-577336.py
1
4351
from cpython cimport pythread from cpython.exc cimport PyErr_NoMemory cdef class FastRLock: """Fast, re-entrant locking. Under uncongested conditions, the lock is never acquired but only counted. Only when a second thread comes in and notices that the lock is needed, it acquires the lock and notifies...
mit
3,017,226,937,884,119,000
36.188034
85
0.638934
false
Melecio/face-detection
neural_network.py
1
4860
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys import argparse from os import listdir from os.path import isfile, join from random import shuffle from pybrain.datasets import ClassificationDataSet from pybrain.tools.shortcuts import buildNetwork from pybrain.supervised.trainers i...
bsd-3-clause
-3,102,720,422,650,508,300
31.18543
115
0.641152
false
rodrigofaccioli/drugdesign
virtualscreening/vina/spark/hydrogen_bond_crud.py
1
4480
from pyspark.sql import SQLContext, Row from vina_utils import get_ligand_from_receptor_ligand_model """ Creates data frame of residue list sqlCtx - spark SQL context residue_listRDD - RDD for creating data frame. It had been created by load_file_select_hydrogen_bond function """ def create_df_residue_list(sqlCtx,...
apache-2.0
4,840,884,905,067,512,000
36.647059
157
0.75692
false
maxamillion/anaconda
pyanaconda/bootloader.py
1
89455
# bootloader.py # Anaconda's bootloader configuration module. # # Copyright (C) 2011 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later versi...
gpl-2.0
3,438,288,245,029,872,000
35.304789
165
0.563378
false
benediktkr/lokun-record
record/sec.py
1
2077
from random import randint def compare1toN(str1, strl): return any([compare(str1, a) for a in strl]) def compare(str1, str2): return compare_const2(str1, str2) def compare_const2(str1, str2): if len(str1) != len(str2): return False result = 0 for x, y in zip(str1, str2): result |...
agpl-3.0
-8,581,726,397,058,848,000
24.329268
77
0.601348
false
dcrosta/mongo-disco
app/job.py
1
2372
#!/usr/bin/env python # encoding: utf-8 ''' File: DiscoJob.py Author: NYU ITP team Description: Disco Job Wrapper ''' from disco.core import Job, result_iterator from disco.worker.classic.worker import Params from disco.worker.classic.modutil import locate_modules,find_modules from mongodb_io import mongodb_output_str...
apache-2.0
1,969,891,187,076,187,000
32.885714
78
0.49747
false
ropable/resource_tracking
tracking/migrations/0004_auto_20200102_0914.py
1
1126
# Generated by Django 2.1.11 on 2020-01-02 01:14 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tracking', '0003_auto_20190308_1114'), ] operations = [ migrations.AlterField( model_name='device', name='symbol', ...
bsd-3-clause
-3,249,550,416,547,287,600
61.555556
788
0.60746
false
NathanW2/QGIS
tests/src/python/test_qgsfieldformatters.py
1
13493
# -*- coding: utf-8 -*- """QGIS Unit tests for field formatters. .. note:: 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. """ ...
gpl-2.0
9,146,336,332,509,080,000
49.347015
162
0.646261
false
flacjacket/sympy
sympy/core/tests/test_expr.py
1
48018
from __future__ import division from sympy import (Add, Basic, S, Symbol, Wild, Float, Integer, Rational, I, sin, cos, tan, exp, log, nan, oo, sqrt, symbols, Integral, sympify, WildFunction, Poly, Function, Derivative, Number, pi, NumberSymbol, zoo, Piecewise, Mul, Pow, nsimplify, ratsimp, trigsimp, rads...
bsd-3-clause
625,356,421,304,624,600
33.645022
114
0.54313
false
praekelt/vumi-go
go/apps/tests/view_helpers.py
1
2691
from django.core.urlresolvers import reverse from zope.interface import implements from vumi.tests.helpers import generate_proxies, IHelper from go.base import utils as base_utils from go.base.tests.helpers import DjangoVumiApiHelper from go.vumitools.tests.helpers import GoMessageHelper from .helpers import Applica...
bsd-3-clause
-5,930,899,879,608,765,000
33.5
70
0.687105
false
beaker-project/beaker
Client/src/bkr/client/command.py
1
13879
# -*- coding: utf-8 -*- # 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. import optparse import os import sys from optp...
gpl-2.0
2,149,729,074,512,585,200
29.106291
106
0.572303
false
palominodb/tableizer
tableizer/ttt_gui/rrd.py
1
5968
# rrd.py # Copyright (C) 2009-2013 PalominoDB, Inc. # # You may contact the maintainers at eng@palominodb.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; either version 2 of the License...
gpl-2.0
-9,085,685,221,464,438,000
42.562044
127
0.525637
false
florian-wagner/gimli
python/pygimli/gui/vtk/wxVTKRenderWindowInteractor.py
1
24830
# -*- coding: utf-8 -*- """ A VTK RenderWindowInteractor widget for wxPython. Find wxPython info at http://wxPython.org Created by Prabhu Ramachandran, April 2002 Based on wxVTKRenderWindow.py Fixes and updates by Charl P. Botha 2003-2008 Updated to new wx namespace and some cleaning up by Andrea Gavana, December 2...
gpl-3.0
-454,796,966,052,879,700
34.573066
102
0.57499
false
spencerlyon2/pygments
pygments/lexers/_clbuiltins.py
2
14050
# -*- coding: utf-8 -*- """ pygments.lexers._clbuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ANSI Common Lisp builtins. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ BUILTIN_FUNCTIONS = set(( # 638 functions '<', '<=', '=', '>', '>=', '-...
bsd-2-clause
8,959,820,288,131,650,000
59.560345
80
0.629751
false
endlessm/chromium-browser
tools/style_variable_generator/css_generator.py
1
2204
# Copyright 2019 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. from base_generator import Color, Modes, BaseGenerator class CSSStyleGenerator(BaseGenerator): '''Generator for CSS Variables''' def Render(self):...
bsd-3-clause
4,978,558,994,880,524,000
30.942029
79
0.534483
false
mmerce/python
bigml/tests/create_forecast_steps.py
1
1792
# -*- coding: utf-8 -*- # # Copyright 2017-2020 BigML # # 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...
apache-2.0
7,671,300,440,271,742,000
34.137255
75
0.704241
false
terrycojones/dark-matter
dark/mutations.py
1
16454
import os from collections import defaultdict import numpy as np try: import matplotlib if not os.environ.get('DISPLAY'): # Use non-interactive Agg backend matplotlib.use('Agg') import matplotlib.pyplot as plt except ImportError: import platform if platform.python_implementation() =...
mit
-974,948,910,823,843,200
35.64588
79
0.544427
false
nati/fun
cube.py
1
4119
import copy import math import re import subprocess import sys import time ret = subprocess.check_output(["resize"]) m = re.match("COLUMNS=(\d+);\nLINES=(\d+);", ret) WIDTH = int(m.group(1)) HEIGHT = int(m.group(2)) SCALE = 7 X = 0 Y = 1 Z = 2 POINTS = [ [-1, -1, 1], [-1, 1, 1], [1, 1, 1], [1, -1, 1...
apache-2.0
-4,906,687,155,164,076,000
20.793651
73
0.453265
false