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
nttks/edx-platform
common/test/acceptance/pages/studio/library.py
1
11569
""" Library edit page in Studio """ from bok_choy.javascript import js_defined, wait_for_js from bok_choy.page_object import PageObject from bok_choy.promise import EmptyPromise from selenium.webdriver.support.select import Select from .component_editor import ComponentEditorView from .container import XBlockWrapper fr...
agpl-3.0
3,979,192,120,614,835,000
33.126844
116
0.622007
false
tmct/adventOfCode2016
problems/21/Solver.py
1
4493
import re swap_positions_regex = r'swap position (\d+) with position (\d+)' swap_letters_regex = r'swap letter (.) with letter (.)' rotate_regex = r'rotate (left|right) (\d+)' rotate_on_letter_position_regex = r'rotate based on position of letter (.)' reverse_slice_regex = r'reverse positions (\d+) through (\d+)' move...
mit
7,164,240,172,985,285,000
38.761062
110
0.605831
false
googleapis/python-automl
google/cloud/automl_v1beta1/types/classification.py
1
13060
# -*- 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
6,754,684,378,545,079,000
46.148014
134
0.633767
false
suutari/shoop
shuup/admin/modules/suppliers/views/edit.py
1
1488
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2016, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from django import forms f...
agpl-3.0
8,299,280,317,891,628,000
32.066667
108
0.684812
false
diging/tethne
tethne/tests/test_models_lda.py
1
4504
import sys sys.path.append('../tethne') import unittest import tempfile import os from xml.etree import ElementTree as ET import networkx as nx import csv from tethne.model.corpus.mallet import LDAModel from tethne.readers.wos import read from tethne import FeatureSet, tokenize from tethne.networks import topics dat...
gpl-3.0
1,083,460,484,099,657,300
33.646154
73
0.672513
false
cemarchi/biosphere
Src/BioAnalyzer/Analysis/GenePrioritization/Steps/NetworkAnalysis/NetworkScoreAnalyzers/GeneNetworkScoreAnalyzer.py
1
2431
import operator import networkx as nx from scipy.stats import gmean from Src.BioAnalyzer.Analysis.GenePrioritization.Steps.NetworkAnalysis.NetworkScoreAnalyzers.NetworkScoreAnalyzerBase \ import NetworkScoreAnalyzerBase class GeneNetworkScoreAnalyzer(NetworkScoreAnalyzerBase): def __init__(self): pas...
bsd-3-clause
-5,332,966,840,455,512,000
35.298507
119
0.654463
false
smartystreets/jquery.liveaddress
resources/publish.py
1
2128
""" This script is used by SmartyStreets when deploying a new version of the jquery.liveaddress plugin. """ import os.path as path import os import sys import boto from boto.s3.bucket import Bucket from boto.s3.connection import S3Connection, OrdinaryCallingFormat from boto.s3.key import Key from utils import get_mim...
gpl-3.0
8,783,965,952,323,402,000
29.84058
122
0.681391
false
adviti/melange
app/soc/views/oauth.py
1
4862
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange authors. # # 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 applic...
apache-2.0
6,183,347,659,760,637,000
27.6
81
0.654463
false
sciunto-org/CiteBib
libcitebib/config.py
1
9239
#!/usr/bin/env python # -*- 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 3 of the License, or #(at your option) any later version. # #This program is distributed...
gpl-3.0
-4,720,389,608,554,132,000
33.602996
97
0.583613
false
DominikDitoIvosevic/Uni
AI/lab2/graphicsUtils.py
1
11867
# graphicsUtils.py # ---------------- # Licensing Information: You are free to use or extend these projects for # educational purposes provided that (1) you do not distribute or publish # solutions, (2) you retain this notice, and (3) you provide clear # attribution to UC Berkeley, including a link to http://ai.berkel...
mit
2,995,610,118,131,092,000
28.593516
104
0.581444
false
NoahBaird/Project-Euler
Problem 3 - Largest prime factor/Python 1.0.py
1
1112
from math import sqrt def checkIfDone(num): if num == 1: return True return False def IsPrime(num): for i in range(2, int(sqrt(num))): if num % i == 0: return False return True def findLargestPrimeFactor(num): done = False largestFactor = 1 ...
mit
4,260,531,782,545,222,700
19.803922
42
0.504496
false
jmarcelogimenez/petroSym
petroSym/run.py
1
11910
# -*- coding: utf-8 -*- """ Created on Tue Aug 25 13:08:19 2015 @author: jgimenez """ from PyQt4 import QtGui, QtCore from run_ui import Ui_runUI from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile import os from reset import * from time import localtime, strftime, struct_time from logTab import ...
gpl-2.0
8,266,735,191,862,843,000
43.610487
222
0.594207
false
palankai/xadrpy
src/xadrpy/core/templates/base.py
1
3454
from django import template from django.utils.encoding import smart_str import re from django.template.base import FilterExpression, NodeList from django.template.loader import get_template kwarg_re = re.compile( r"(?:(\w+)=)?(.+)" ) class WidgetLibrary(template.Library): def widget_tag_compile_function(self, cls...
lgpl-3.0
-5,177,239,194,537,481,000
37.808989
107
0.516503
false
machinebrains/neat-python
examples/xor/xor2.py
1
1861
""" 2-input XOR example """ from __future__ import print_function from neatsociety import nn, population, statistics, visualize # Network inputs and expected outputs. xor_inputs = [[0, 0], [0, 1], [1, 0], [1, 1]] xor_outputs = [0, 1, 1, 0] def eval_fitness(genomes): for g in genomes: net = nn.create_fee...
bsd-3-clause
-3,919,349,984,448,292,400
35.490196
112
0.709833
false
SmileyChris/django-navtag
django_navtag/templatetags/navtag.py
1
5170
from django import template from django.utils.encoding import smart_str from django.utils.safestring import mark_safe register = template.Library() class Nav(object): def __init__(self, tree=None, root=None): self._root = root or self self._tree = tree or {} def __getitem__(self, key): ...
mit
2,733,805,172,510,658,000
28.20904
84
0.544874
false
ponty/pyscreenshot
tests/size.py
1
1350
import os from easyprocess import EasyProcess from pyscreenshot.util import platform_is_linux, platform_is_osx, platform_is_win def display_size_x(): # http://www.cyberciti.biz/faq/how-do-i-find-out-screen-resolution-of-my-linux-desktop/ # xdpyinfo | grep 'dimensions:' screen_width, screen_height = 0, ...
bsd-2-clause
3,261,601,400,750,375,400
27.723404
91
0.684444
false
galaxor/Nodewatcher
nodewatcher/monitor/monitor.py
1
45662
#!/usr/bin/python # # nodewatcher monitoring daemon # # Copyright (C) 2009 by Jernej Kos <kostko@unimatrix-one.org> # # First parse options (this must be done here since they contain import paths # that must be parsed before Django models can be imported) import sys, os from optparse import OptionParser print "======...
agpl-3.0
7,879,637,176,988,811,000
36.925249
224
0.635846
false
tovrstra/sympy
sympy/mpmath/tests/test_linalg.py
1
7410
# TODO: don't use round from __future__ import division from sympy.mpmath import * # XXX: these shouldn't be visible(?) LU_decomp = mp.LU_decomp L_solve = mp.L_solve U_solve = mp.U_solve householder = mp.householder improve_solution = mp.improve_solution A1 = matrix([[3, 1, 6], [2, 1, 3], ...
bsd-3-clause
-955,835,800,016,135,800
29.493827
91
0.497571
false
grongor/school_rfid
lib/nmap-6.40/zenmap/zenmapGUI/ScanRunDetailsPage.py
1
16962
#!/usr/bin/env python # -*- coding: utf-8 -*- # ***********************IMPORTANT NMAP LICENSE TERMS************************ # * * # * The Nmap Security Scanner is (C) 1996-2013 Insecure.Com LLC. Nmap is * # * also a registered trademark of Inse...
gpl-2.0
135,565,421,673,264,290
52.172414
98
0.598161
false
joostvdg/jenkins-job-builder
tests/cmd/test_recurse_path.py
1
4946
import os from tests.base import mock import testtools from jenkins_jobs import utils def fake_os_walk(paths): """Helper function for mocking os.walk() where must test that manipulation of the returned dirs variable works as expected """ paths_dict = dict(paths) def os_walk(top, topdown=True): ...
apache-2.0
-2,137,185,602,599,578,600
35.367647
79
0.531945
false
davidsoncolin/IMS
UI/QCore.py
1
53288
#!/usr/bin/env python import functools import numpy as np from PySide import QtCore, QtGui from GCore import State from UI import createAction import weakref class QListWidget(QtGui.QListView): item_selected = QtCore.Signal(int) focus_changed = QtCore.Signal(bool) item_renamed = QtCore.Signal(str, str) data_chang...
mit
-1,527,965,147,184,060,700
32.641414
135
0.714495
false
samueljackson92/scripts
python/heapsort.py
1
1562
# heapsort.py # Date: 15/06/13 # Author: Samuel Jackson (samueljackson@outlook.com) # Description: Python implementation of a basic heapsort. # Based heavily on the example code from http://en.wikipedia.org/wiki/Heapsort import random def swap(data, i, j): temp = data[i] data[i] = data[j] data[j] = temp #convert ...
mit
-2,002,207,885,747,726,000
21.014085
78
0.677977
false
DemocracyClub/yournextrepresentative
ynr/apps/api/views.py
1
2639
from collections import OrderedDict from django.views.generic import TemplateView from rest_framework.request import Request from drf_yasg import openapi from drf_yasg.generators import OpenAPISchemaGenerator from elections.models import Election class OpenAPISchemaMixin: version = None patterns = None ...
agpl-3.0
-4,075,647,256,769,377,000
29.686047
76
0.63471
false
seprich/py-bson-rpc
bsonrpc/definitions.py
1
4837
# -*- coding: utf-8 -*- ''' Definitions to match messages to JSON RPC 2.0 schema and to produce them. Also RPC error definitions. ''' import six from bsonrpc.exceptions import ( InternalError, InvalidParams, InvalidRequest, MethodNotFound, ParseError, ServerError, UnspecifiedPeerError) from bsonrpc.options imp...
mpl-2.0
1,107,113,176,544,598,700
31.682432
79
0.565226
false
openvswitch/ovn-scale-test
rally_ovs/plugins/ovs/scenarios/ovn.py
1
25304
# Copyright 2016 Ebay 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, soft...
apache-2.0
7,730,396,663,554,991,000
41.743243
101
0.561769
false
andrenarchy/krypy-debian
docs/conf.py
1
7810
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # KryPy documentation build configuration file, created by # sphinx-quickstart on Fri Jun 21 17:54:43 2013. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autoge...
mit
-3,065,985,378,435,863,600
30.991803
83
0.702793
false
krosenfeld/scatterbrane
docs/_code/time_variability.py
1
3849
''' Generate a time series incorporating the motion of the screen across the source. This script may take a long time to run. I suggest you read through it first and adjust the num_samples variable to check out its performance. ''' import numpy as np from scipy.ndimage import imread import time import matplotlib.pyplot...
mit
-1,363,312,966,128,243,000
32.763158
107
0.704858
false
matrixorz/justpic
justpic/etc/pcstool.py
1
1581
{"expires_in":2592000,"refresh_token":"22.ca7aeff542c491ee0c9de8a3010a9de4.315360000.1724417263.3875775130-1056026","access_token":"21.8bdf77c07a392aea779d571a24903d45.2592000.1411649263.3875775130-1056026","session_secret":"8ddef6d7ab2a0b36034c53a46bcbb6c0","session_key":"9mnRfHBbgiKJcCaPaY1v1Qjo2\/VryC6ZM+X+sorRrQ6C8...
mit
5,203,383,678,631,350,000
41.72973
402
0.794434
false
surajsinghbisht054/Information_Gathering_Python_Web_Scraping_Scripts
html_link_extractor/link_re.py
1
1087
#!/usr/bin/python ################################################## ######## Please Don't Remove Author Name ######### ############### Thanks ########################### ################################################## # # __author__=''' Suraj Singh surajsinghbisht054@gmail.com https://bitforestinfo.bl...
apache-2.0
-3,389,522,426,765,960,000
24.880952
91
0.563017
false
amwelch-oss/bamboo-pr-feedback
bin/pr_feedback_server.py
1
5276
#! /usr/bin/env python import tornado.web import tornado.httpserver import tornado.ioloop import getpass import requests import json import os import hashlib import hmac import argparse #Since bamboo does not have api tokens you will need to provide a real user's password # If you don't want to store the password i...
mit
-2,551,280,784,974,783,000
29.321839
94
0.608036
false
open-synergy/opnsynid-l10n-indonesia
l10n_id_taxform_retur_pajak_masukan/models/retur_pajak_masukan.py
1
2380
# -*- coding: utf-8 -*- # Copyright 2017 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import models, fields, api class ReturPajakMasukan(models.Model): _name = "l10n_id.retur_pajak_masukan" _description = "Retur Pajak Masukan" _inherit = [...
agpl-3.0
1,572,841,041,619,940,400
27.382716
69
0.584454
false
numericalalgorithmsgroup/pybobyqa
pybobyqa/tests/test_hessian.py
1
7948
""" 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. This program is distributed in the hope that it will be useful, but WITHOU...
gpl-3.0
-7,834,234,041,995,986,000
42.431694
120
0.632738
false
artopping/nyu-python
course1/assignment_6/rf_random_walk.py
1
2312
#!/usr/bin/env python3 import random import sys import math def get_random_direction(): direction = "" probability = random.random() if probability < 0.25: direction = "west" elif 0.25<=probability<0.5: direction= "north" elif 0.5<= probability<0.75: direction= "south" ...
mit
-265,223,460,572,834,500
26.855422
78
0.609429
false
OpenTreeOfLife/germinator
ws-tests/opentreetesting.py
1
10580
#!/usr/bin/env python # This file was copied from the phylesystem-api repo and is intended # to replace it. from ConfigParser import SafeConfigParser from cStringIO import StringIO import requests import gzip import json import sys import os _CONFIG = None _CONFIG_FN = None if 'VERBOSE_TESTING' in os.environ: tr...
bsd-2-clause
149,666,204,171,669,300
36.51773
135
0.566163
false
Micronaet/micronaet-migration
report_product_pricelist/wizard/create_pricelist.py
1
18271
# -*- coding: utf-8 -*- ############################################################################### # # ODOO (ex OpenERP) # Open Source Management Solution # Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>) # Developer: Nicola Riolini @thebrush (<https://it.linkedin.com/in/thebrush>) # This prog...
agpl-3.0
-7,251,331,763,021,639,000
40.988506
79
0.528552
false
GNOME/orca
src/orca/speechdispatcherfactory.py
1
27427
# Copyright 2006, 2007, 2008, 2009 Brailcom, o.p.s. # # Author: Tomas Cerha <cerha@brailcom.org> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or ...
lgpl-2.1
-4,297,985,001,126,757,000
37.359441
100
0.584096
false
googleinterns/out-of-distribution
src/datasets/load_svhn.py
1
2077
import multiprocessing import os from typing import Union import torchvision from torch.utils.data import DataLoader, ConcatDataset, Subset from torchvision import transforms from root import from_root from src.misc.utils import read_lines DATA_DIRPATH = from_root("data/svhn") SPLIT_DIRPATH = from_root("splits/svhn"...
apache-2.0
-1,984,148,229,769,911,600
41.387755
107
0.672123
false
janinko/pnc-cli
pnc_cli/swagger_client/models/build_set_status_changed_event.py
1
10705
# coding: utf-8 """ No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 1.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from datetime import datetime from pprint import pformat from six import iterit...
apache-2.0
8,449,749,185,241,655,000
30.028986
233
0.598972
false
DxCx/plugin.video.9anime
resources/lib/ui/NineAnimeUrlExtender.py
1
3603
import re from string import ascii_lowercase as lc, ascii_uppercase as uc, maketrans class NineAnimeUrlExtender: # _TS_MAP_TABLE = [i for i in uc if ord(i) % 2 != 0] + [i for i in uc if ord(i) % 2 == 0] _CUSB64_MAP_TABLE = [i for i in lc if ord(i) % 2 != 0] + [i for i in lc if ord(i) % 2 == 0] _ts_value_re...
gpl-3.0
-6,710,349,284,111,533,000
30.605263
95
0.502914
false
martincochran/score-minion
oauth_token_manager_test.py
1
2779
#!/usr/bin/env python # # Copyright 2014 Martin Cochran # # 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 la...
apache-2.0
-7,579,290,179,118,641,000
30.224719
74
0.721123
false
ofayans/freeipa
ipaserver/install/odsexporterinstance.py
1
6389
# # Copyright (C) 2014 FreeIPA Contributors see COPYING for license # import os import pwd import grp import ldap from ipaserver.install import service from ipaserver.install import installutils from ipapython.ipa_log_manager import root_logger from ipapython.dn import DN from ipapython import ipautil from ipaplatf...
gpl-3.0
3,183,045,108,307,513,300
33.535135
85
0.594929
false
k-team/KHome
modules/co_sensor/local_module.py
1
1375
#-*- coding: utf-8 -*- import module from module import use_module import fields class COSensor(module.Base): update_rate = 1000 public_name = 'Capteur CO' alarm = use_module('Alarm') class co(fields.sensor.CO, fields.syntax.Numeric, fields.io.Graphable, fields.pe...
mit
4,025,652,573,530,431,000
26.5
72
0.531636
false
imposeren/django-happenings
happenings/views.py
1
10237
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals # python lib: from datetime import date, timedelta # django: from django.db.models.functions import ExtractHour from django.views.generic import ListView, DetailView from django.conf import settings from django.shor...
bsd-2-clause
1,189,771,832,417,715,700
34.058219
95
0.57722
false
starduliang/haha
tests/test_api.py
1
8798
# -*- coding: utf-8 -*- """Functional tests using WebTest. See: http://webtest.readthedocs.org/ """ from flask import url_for, jsonify from haha.user.models import User, BlacklistToken from .factories import UserFactory import time class TestRegistering: """Register a user.""" def test_auth_registration(s...
bsd-3-clause
-1,567,163,010,545,778,700
50.450292
246
0.627643
false
radez/python-heatclient
heatclient/v1/shell.py
1
7499
# Copyright 2012 OpenStack LLC. # 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 b...
apache-2.0
647,137,651,970,098,300
34.540284
79
0.604881
false
koebbe/homeworks
visit/models.py
1
5342
import datetime from django.db import models from django.contrib.auth.models import User import json import uuid from qa import models as qamodels PROGRAM_MODEL_CHOICES = ( ('school_wide', '2+2'), ('fellowship', 'Fellowship Model'), ('ptlt', 'PTLT'), ) class District(models.Model): name = models.CharF...
mit
2,329,072,173,996,672,500
34.852349
109
0.670348
false
SenorPez/project-cars-replay-enhancer
test/test_DefaultCards.py
1
20152
""" Tests DefaultCards.py """ import unittest from unittest.mock import MagicMock, PropertyMock, patch, sentinel import numpy from PIL import ImageFont from replayenhancer.DefaultCards \ import RaceResults, SeriesStandings, StartingGrid, SeriesChampion class TestRaceResults(unittest.TestCase): ...
mit
-6,962,500,503,765,455,000
36.242884
97
0.581878
false
robbi5/nomenklatura
nomenklatura/views/reconcile.py
1
3887
import json from flask import Blueprint, request, url_for from apikit import jsonify, get_limit, get_offset from werkzeug.exceptions import BadRequest from nomenklatura.model import Dataset, Entity from nomenklatura.model.matching import find_matches section = Blueprint('reconcile', __name__) def reconcile_index(...
mit
-4,379,057,662,769,576,400
28.671756
83
0.545408
false
james-nichols/dtrw
compartment_models/PBPK_test.py
1
5547
#!/usr/local/bin/python3 # Libraries are in parent directory import sys sys.path.append('../') import math import numpy as np import scipy as sp import matplotlib.pyplot as plt import pdb from dtrw import * class DTRW_PBPK(DTRW_compartment): def __init__(self, X_inits, T, dT, V, Q, R, mu, Vmax, Km, g, g_T): ...
gpl-2.0
154,471,276,779,151,000
31.822485
137
0.491437
false
AndreyBalabanov/python_training_mantisBT
conftest.py
1
2344
import pytest import json import os.path from fixture.application import Application import ftputil from fixture.soap import SoapHelper fixture = None target = None def load_config(file): global target if target is None: config_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), file) ...
apache-2.0
-5,682,501,227,056,088,000
31.569444
113
0.676195
false
secopsconsult/websitechecks
securityheaders.py
1
2724
#!/usr/bin/env python ''' Script to check for the presence of Security headers and rate the site More info: https://securityheaders.io/ ''' import optparse import mechanize import tkinter def validateHeaders(header, debug): if (debug): print "[+] Validating headers" print "[~] Headers: " + str(header) if (...
mit
-1,188,025,213,629,344,800
27.673684
100
0.647577
false
lukaszb/monolith
monolith/cli/base.py
1
10479
import os import sys import argparse from collections import namedtuple from monolith.compat import OrderedDict from monolith.compat import unicode from monolith.cli.exceptions import AlreadyRegistered from monolith.cli.exceptions import CommandError from monolith.utils.imports import get_class Argument = namedtuple(...
bsd-2-clause
-1,535,403,399,572,830,500
30.280597
79
0.597958
false
jbazik/cmsplugin-video-youtube
cmsplugin_video_youtube/cms_plugins.py
1
1467
from django.utils.translation import ugettext as _ from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from cmsplugin_video_youtube.models import YouTubeVideo from cmsplugin_video_youtube.forms import YouTubeVideoForm class YouTubeVideoPlugin(CMSPluginBase): model = YouTubeVideo ...
lgpl-3.0
6,135,923,229,854,246,000
26.166667
78
0.537151
false
crossroadchurch/paul
tests/functional/openlp_core_common/test_applocation.py
1
10285
# -*- coding: utf-8 -*- # vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4 ############################################################################### # OpenLP - Open Source Lyrics Projection # # ------------------------------------------------------...
gpl-2.0
8,223,613,109,412,259,000
51.47449
118
0.602333
false
ernfrid/skll
tests/test_classification.py
1
12834
# License: BSD 3 clause """ Tests related to classification experiments. :author: Michael Heilman (mheilman@ets.org) :author: Nitin Madnani (nmadnani@ets.org) :author: Dan Blanchard (dblanchard@ets.org) :author: Aoife Cahill (acahill@ets.org) """ from __future__ import (absolute_import, division, print_function, ...
bsd-3-clause
3,986,852,876,339,038,700
38.489231
91
0.52883
false
mikhtonyuk/rxpython
concurrent/futures/cooperative/ensure_exception_handled.py
1
3261
import traceback class EnsureExceptionHandledGuard: """Helper for ensuring that Future's exceptions were handled. This solves a nasty problem with Futures and Tasks that have an exception set: if nobody asks for the exception, the exception is never logged. This violates the Zen of Python: 'Errors s...
mit
-4,323,449,782,726,556,700
42.48
76
0.682306
false
bhedayat/Neural-Nets
Perceptron.py
1
3593
# coding: utf-8 # In[22]: #Flower Classifier with Perceptron #Read in data data = [] #training data data1 = [] #test data import numpy as np import matplotlib.pyplot as plt from random import randint for line in file: l = (line.split(",")) l[0] = float(l[0]) l[1] = float(l[1]) l[2] = float(l[2]) ...
apache-2.0
-4,896,690,168,427,554,000
26.638462
72
0.623991
false
vishakh/metamkt
metamkt/standalone/price_change_calculator.py
1
2433
import common def calculate_price_change(conn, entity_id, mysql_interval): result = conn.execute(""" select (select price from PriceHistory where entity_id=%s order by timestamp desc limit 1) - (select price from PriceHistory wher...
lgpl-3.0
-6,761,154,637,958,323,000
31.026316
117
0.547061
false
lsbardel/zipline
zipline/gens/utils.py
1
2276
# # Copyright 2013 Quantopian, 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 wr...
apache-2.0
-6,486,776,239,556,615,000
30.178082
79
0.710018
false
emesene/emesene
emesene/gui/common/GNTPNotification.py
1
2006
# -*- coding: utf-8 -*- # This file is part of emesene. # # emesene 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. # #...
gpl-3.0
-8,234,481,197,409,525,000
30.84127
79
0.659023
false
SanPen/GridCal
src/research/power_flow/helm/old/Helm.py
1
19811
# -*- coding: utf-8 -*- # This file is part of GridCal. # # GridCal 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. # # GridCal is dist...
gpl-3.0
-1,298,887,950,109,372,700
27.421808
132
0.570116
false
RetailMeNot/acky
acky/s3.py
1
4051
from acky.api import AwsApiClient try: from urllib import parse except ImportError: import urlparse as parse class InvalidURL(Exception): def __init__(self, url, msg=None): self.url = url if not msg: msg = "Invalid URL: {0}".format(url) super(InvalidURL, self).__init__(...
mit
-417,330,416,866,376,600
29.923664
78
0.555172
false
idjaw/dot-manager
app/core/tokenizer.py
1
2196
from functools import wraps from re import search from subprocess import call from logging import getLogger from core.exceptions import TokenizationError log = getLogger("Tokenizer") def exception_decorator(func): @wraps(func) def func_wrapper(*args, **kw): try: return func(*args, **kw) ...
mit
-1,021,853,459,590,033,300
29.5
80
0.473133
false
nerdvegas/rez
src/rez/utils/filesystem.py
1
20893
""" Filesystem-related utilities. """ from __future__ import print_function from threading import Lock from tempfile import mkdtemp from contextlib import contextmanager from uuid import uuid4 import errno import weakref import atexit import posixpath import ntpath import os.path import shutil import os import re impo...
lgpl-3.0
-2,403,405,377,951,893,000
28.677557
114
0.59441
false
victor-rene/kivy-test
gui/reportcell.py
1
1576
from kivy.graphics import Color, Rectangle from kivy.uix.boxlayout import BoxLayout from kivy.uix.label import Label from kivy.uix.widget import Widget class ReportCell(BoxLayout): def __init__(self, **kw): super(ReportCell, self).__init__(**kw) self.data = kw['data'] with self.canvas...
mit
-8,431,501,857,110,692,000
36.547619
98
0.541244
false
EUPSForge/oorb
python/test_2.py
1
4840
import os import subprocess import numpy as np import matplotlib.pyplot as plt from itertools import repeat import pandas as pd import pyoorb as oo import time def dtime(time_prev): return (time.time() - time_prev, time.time()) def pack_oorbArray(orbits): """Translate orbital element dictionary (easy for hum...
gpl-3.0
2,614,545,079,291,372,500
37.412698
149
0.633884
false
diegomvh/pyqt
widgets/glyph/codepoints/fontawesome.py
1
15278
#!/usr/bin/env python import sys if sys.version_info[0] == 3: unichr = chr #A list of all icon-names with the codepoint (unicode-value) on the right #You can use the names on the page http://fortawesome.github.io/Font-Awesome/design.html _codepoints = [ ("fa-adjust", 0xf042), ("fa-adn", 0xf170), ("fa-...
mit
-1,730,761,943,699,872,300
28.781676
88
0.544508
false
Kkevsterrr/backdoorme
backdoors/shell/php.py
1
1529
from backdoors.backdoor import * class Php(Backdoor): prompt = Fore.RED + "(php) " + Fore.BLUE + ">> " + Fore.RESET def __init__(self, core): cmd.Cmd.__init__(self) self.intro = GOOD + "Using php module..." self.core = core self.options = { "port" : Option("po...
mit
8,837,472,853,760,200,000
45.333333
192
0.568999
false
MeGotsThis/BotGotsThis
pkg/custom_command/tests/test_custom_query.py
1
1560
from lib.data.message import Message from tests.unittest.base_custom import TestCustomField # Needs to be imported last from ..custom import query class TestCustomCommandCustomQuery(TestCustomField): def setUp(self): super().setUp() self.args = self.args._replace(field='query', message=Message('a...
gpl-3.0
4,702,043,906,517,372,000
35.27907
79
0.642308
false
bzero/bitex
libs/autobahn/websocket.py
1
156783
############################################################################### ## ## Copyright 2011-2013 Tavendo GmbH ## ## 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 ## ## ...
gpl-3.0
8,117,406,587,043,622,000
37.000746
214
0.601589
false
Calvinxc1/Data_Analytics
old versions/analysis_classes/Cluster_Control/Cluster_IO/Predict_Cluster/predictor.py
1
1655
#%% Libraries import numpy as np import root_funcs as rf #%% predict_linear class (Module for Process_Node - Predict) class predict_linear(object): __lookup_dict = { 'beta_init': { 'zeros': ('Cluster_Control.Cluster_IO.Predict_Cluster.beta_init', 'beta_zeros') }, 'learn_rate...
gpl-3.0
1,337,883,345,496,032,800
35.8
129
0.598187
false
OSUrobotics/privacy-interfaces
filtering/text_filters/scripts/try_something_new.py
1
1266
#!/usr/bin/env python import rospy from cv_bridge import CvBridge import cv, cv2 import numpy from sensor_msgs.msg import Image bridge = CvBridge() pub = rospy.Publisher("/image_out", Image) def image_callback(image): """ Applies a new filter to the image and displays the result. """ image_cv = bridge.imgms...
mit
-8,800,374,811,631,611,000
29.142857
79
0.621643
false
zfrenchee/pandas
pandas/tests/scalar/test_timedelta.py
1
33010
""" test the scalar Timedelta """ import pytest import numpy as np from datetime import timedelta import pandas as pd import pandas.util.testing as tm from pandas.core.tools.timedeltas import _coerce_scalar_to_timedelta_type as ct from pandas import (Timedelta, TimedeltaIndex, timedelta_range, Series, ...
bsd-3-clause
3,114,407,795,892,254,000
37.608187
79
0.526022
false
szepeviktor/debian-server-tools
security/jwk_convert.py
1
1364
#!/usr/bin/python """Convert certbot private_key.json to manuale's account.json Source: https://gist.github.com/JonLundy/f25c99ee0770e19dc595 ./jwk_convert.py private_key.json > private-key.asn1 openssl asn1parse -genconf private-key.asn1 -noout -out private-key.der openssl rsa -inform DER -in private-key.der -outform...
mit
-5,849,783,586,539,344,000
32.268293
106
0.66349
false
zagl/ccx-user
tutorials/auto/geom.py
1
3805
#!/usr/bin/env python3 import pycgx import re import fileinput import subprocess def heatSinkTemp(length, width, height, n_fins, fin_width, base_width, conductivity, ta, emissivity, flux): fin_spacing = (width- fin_width) /(n_fins -1) - fin_width flux_density = flux / (length*width) c = pycgx.Cg...
gpl-2.0
7,893,655,362,739,145,000
23.548387
73
0.583443
false
stormi/tsunami
src/primaires/pnj/editeurs/pedit/supprimer.py
1
2851
# -*-coding:Utf-8 -* # Copyright (c) 2013 LE GOFF Vincent # 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 copyright notice, this # lis...
bsd-3-clause
1,578,359,433,482,653,200
41.432836
79
0.669012
false
tvtsoft/odoo8
addons/website_portal/controllers/main.py
1
5029
# -*- coding: utf-8 -*- import datetime from openerp import http from openerp.http import request from openerp import tools from openerp.tools.translate import _ class website_account(http.Controller): @http.route(['/my', '/my/home'], type='http', auth="public", website=True) def account(self): partn...
agpl-3.0
-6,674,752,753,006,959,000
37.098485
114
0.552993
false
tks0123456789/XGB_experiments
test_colsample_bylevel.py
1
2864
import xgboost as xgb from sklearn.datasets import make_classification n = 2 ** 15 X, y = make_classification(n_samples=n+1, n_features=10, n_informative=5, n_redundant=5, shuffle=True, random_state=123) param = {'objective':'binary:logistic','tree_method':'approx', 'eval_metric':'...
mit
2,984,193,907,683,911,700
42.393939
180
0.693785
false
Shadowtrance/CakesForeveryWan
patches/bundle.py
1
3840
from __future__ import print_function from sys import argv, exit, stderr from os import mkdir, makedirs, chdir, system, getcwd from os.path import getsize from re import search from json import loads from struct import pack from errno import EEXIST if len(argv) < 5: print("Usage: bundle.py <info json> <assembly f...
gpl-3.0
-1,199,622,376,286,306,800
29.23622
112
0.580729
false
hlange/LogSoCR
.waf/waflib/extras/msvcdeps.py
1
10082
#!/usr/bin/env python # encoding: utf-8 # Copyright Garmin International or its subsidiaries, 2012-2013 ''' Off-load dependency scanning from Python code to MSVC compiler This tool is safe to load in any environment; it will only activate the MSVC exploits when it finds that a particular taskgen uses MSVC to compile....
agpl-3.0
2,727,420,422,639,477,000
37.480916
111
0.573696
false
Ppamo/raspi-noisebox-control
noise-control.py
1
2463
BLINKING_RATE_READY = 1.5 BLINKING_RATE_WAITING = 0.1 BLINKING_RATE_LOADING = 0.3 PIN_BUTTON=3 PIN_BLUE=23 PIN_RED=24 import os,sys,time,signal,subprocess,json import rtmidi_python as rtmidi import RPi.GPIO as GPIO midi_in = [rtmidi.MidiIn()] attached = set() attached.add(midi_in[0].ports[0]) p = None with open('noi...
mit
-6,005,659,446,975,328,000
22.457143
88
0.723508
false
rvictorino/webeye
img_recogn.py
1
3053
from clarifai import rest from clarifai.rest import ClarifaiApp import argparse from urlparse import urlparse import urllib2 import urllib import json import cam_discovery MAPS_API_KEY = "" OUTPUT_FILE_PATH = "/var/www/html/webeye/webeye.js" def get_url_list_from_file(file_path): file_to_read=open(file_path,'r') r...
gpl-3.0
-3,981,476,711,404,548,000
27.53271
104
0.697674
false
twankim/weaksemi
utils.py
1
7546
# -*- coding: utf-8 -*- # @Author: twankim # @Date: 2017-05-05 20:22:13 # @Last Modified by: twankim # @Last Modified time: 2017-10-26 03:25:34 import numpy as np import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import pandas as pd def accuracy(y_true,y_pred): return 100*np.sum(y_true==...
mit
-8,352,230,938,918,783,000
33.456621
103
0.550225
false
sparseMCMC/NIPS2015
experiments/spatial/spatial_demo.py
1
9549
import numpy as np import GPy from mcmcGP import BinnedPoisson, GPMCMC, SGPMCMC, HMC, AHMC from itertools import product from IPython import embed from scipy.cluster.vq import kmeans import pyhmc def load_pines(): X = np.load('pines.np') return X def build_vb(initialZ, binMids, binSize, counts, seed): ...
gpl-2.0
6,435,820,772,835,654,000
41.066079
229
0.640591
false
larsjbro/FYS4150
project_4/source/ising2dim_visual_v3.py
1
19386
# coding=utf-8 # 2-dimensional ising model with visualization # Written by Kyrre Ness Sjoebaek from __future__ import division import matplotlib.pyplot as plt from numba import jit import numpy import numpy as np import sys import math import pygame from timeit import default_timer as timer from scipy import integrate ...
bsd-2-clause
-7,475,104,795,903,891,000
30.419773
150
0.599608
false
robwarm/gpaw-symm
gpaw/test/big/tpss/tpss.py
1
3276
from ase import Atoms from ase.structure import molecule from ase.parallel import paropen from gpaw import GPAW, Mixer, MixerDif from gpaw.utilities.tools import split_formula cell = [14.4, 14.4, 14.4] data = paropen('data.txt', 'a') ##Reference from J. Chem. Phys. Vol 120 No. 15, 15 April 2004, page 6898 tpss_de = [...
gpl-3.0
-2,241,574,817,692,573,400
26.3
122
0.545482
false
tonyxty/quickfix.py
src/quickfix_py/cli.py
1
4853
#!/usr/bin/env python3 """Run a Python script and format the exception traceback as Vim quickfix. quickfix.py Copyright (C) 2015 Tony Beta Lambda <tonybetalambda@gmail.com> This file is licensed under the MIT license. See LICENSE for more details. """ import os import sys import functools import argparse from runpy im...
mit
-1,281,120,865,517,804,500
27.715976
78
0.564187
false
jamessqr/james-squires-dotcom
blog/models.py
1
1065
from django.db import models import datetime class Category(models.Model): title = models.CharField(max_length=250, help_text='Maximum 250 characters') slug = models.SlugField() description = models.TextField() class Meta: ordering = ['title'] verbose_name_plural = "Categories" class Admin: pass #TO...
bsd-3-clause
-5,629,373,321,651,460,000
23.227273
77
0.694836
false
daniel-e/papershelf
dialogs/settings.py
1
2638
import pygtk pygtk.require('2.0') import gtk class DialogSettings(gtk.Dialog): def __init__(self, title, parent, flag, settings): gtk.Dialog.__init__(self, title, parent, flag) s = settings self.s = s t = gtk.Table(rows = 3, columns = 3) t.set_col_spacings(10) t.set_row_spacings(10) l...
gpl-2.0
9,119,678,909,674,186,000
26.768421
89
0.590978
false
PAHB/SIgma-Nu-idea-1
Backend_stuff/sigma_nu/sigma_nu/settings.py
1
3345
""" Django settings for sigma_nu project. Generated by 'django-admin startproject' using Django 1.9.6. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os ...
apache-2.0
-8,023,671,557,027,920,000
25.76
91
0.686398
false
lahosken/pants
src/python/pants/core_tasks/what_changed.py
1
2061
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) from pants.base.depr...
apache-2.0
-6,841,545,234,120,318,000
41.061224
93
0.700631
false
flgiordano/netcash
+/google-cloud-sdk/lib/surface/dns/managed_zones/create.py
1
2431
# Copyright 2014 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 ag...
bsd-3-clause
7,825,775,985,124,091,000
34.231884
80
0.65364
false
cpcloud/ibis
ibis/expr/tests/test_schema.py
1
4977
import ibis from ibis.expr import datatypes as dt def test_whole_schema(): customers = ibis.table( [ ('cid', 'int64'), ('mktsegment', 'string'), ( 'address', ( 'struct<city: string, street: string, ' ...
apache-2.0
-8,713,466,511,553,539,000
31.960265
74
0.277275
false
Lao-liu/mist.io
setup.py
1
1324
import os from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.txt')).read() CHANGES = open(os.path.join(here, 'CHANGES.txt')).read() requires = [] setup(name='mist.io', version='0.9.9', license='AGPLv3', description...
agpl-3.0
4,312,459,541,311,082,000
32.948718
156
0.624622
false
edunham/toys
pd/resolve.py
1
1132
#!/usr/bin/env python3 # based on example from https://github.com/PagerDuty/API_Python_Examples/tree/master/EVENTS_API_v2 import json import requests import os import sys ROUTING_KEY = os.environ['PAGERDUTY_SERVICE_KEY'] INCIDENT_KEY = sys.argv[1] def resolve_incident(): # Triggers a PagerDuty incident without...
mit
1,053,160,661,838,398,100
28.789474
109
0.64576
false
nditech/elections
apollo/locations/__init__.py
1
4175
from apollo.core import Service, cache from apollo.locations.models import Sample, LocationType, Location import unicodecsv try: from cStringIO import StringIO except: from StringIO import StringIO class SamplesService(Service): __model__ = Sample class LocationTypesService(Service): __model__ = Loc...
gpl-3.0
3,217,432,549,554,864,600
39.144231
76
0.535329
false
mehdy/click-pug
tehpug.py
1
2029
# coding: utf-8 # # ========================================== # Developed by Mehdy Khoshnoody = # Contact @ mehdy.khoshnoody@gmail.com = # More info @ http://mehdy.net = # ========================================== # __author__ = 'mehdy' import click def version(ctx, param, value): if not...
gpl-2.0
-5,895,680,206,538,094,000
31.222222
93
0.580089
false
brownnrl/moneyguru
core/tests/gui/tree_test.py
1
3347
# Copyright 2018 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from core.tests.testutil import eq_ from core.gui.tree import Tree, Node d...
gpl-3.0
9,161,680,050,084,443,000
30.280374
97
0.638781
false
duelafn/python-galil-apci
galil_apci/file.py
1
15100
# -*- coding: utf-8 -*- """Simple galil file templating and minification Preforms useful actions on galil encoder files. - Substitution of template variables (using jinja2) - Whitespace trimming and minification by command packing """ # Author: Dean Serenevy <deans@apcisystems.com> # This software is Copyright ...
lgpl-3.0
4,899,683,945,039,046,000
34.6974
145
0.515762
false
kishkaru/python-driver
cassandra/cluster.py
1
149094
# Copyright 2013-2016 DataStax, 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 writi...
apache-2.0
-163,086,977,530,493,200
39.937397
187
0.613633
false