repo_name
stringlengths
5
92
path
stringlengths
4
221
copies
stringclasses
19 values
size
stringlengths
4
6
content
stringlengths
766
896k
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
32
997
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
13.6
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
tholum/PiBunny
system.d/library/tools_installer/tools_to_install/responder/Report.py
1
3980
#!/usr/bin/env python # This file is part of Responder, a network take-over set of tools # created and maintained by Laurent Gaffie. # email: laurent.gaffie@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...
mit
-430,646,472,000,770,940
40.894737
170
0.691457
false
3.35865
false
false
false
thriuin/ckan_client_demo
create_open_data.py
1
1540
__author__ = 'Statistics Canada' __copyright__ = 'Crown Copyright, Canada 2014' import urllib2 import simplejson as json # Add a new data set. For this example, we will use the NAICS 2012 dataset from Statistics Canada # Ensure the data set does not already exist. Exit if it does query_data = urllib2.quote(json.dump...
mit
-5,844,206,824,841,157,000
31.083333
97
0.687013
false
3.276596
false
false
false
android-art-intel/marshmallow
art-extension/tools/perf_analysis/find_hottest.py
1
3556
#!/usr/bin/python import os, sys, csv, operator, heapq def GetMethodName(filename): with open(filename, 'rb') as csvfile: spamreader = csv.reader(csvfile, delimiter=';', quotechar='"') for row in spamreader: for cell in row: return cell def AppendData(filename, data): data[filename] = {} ...
apache-2.0
-1,728,301,882,559,878,000
28.38843
93
0.61108
false
3.235669
false
false
false
gazhay/kodikast
lukecast.py
1
12945
#!/usr/bin/env python3 import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk, GLib, GdkPixbuf try: gi.require_version('AppIndicator3', '0.1') from gi.repository import AppIndicator3 as AppIndicator except: from gi.repository import AppIndicator import re,subprocess,socket import urllib....
gpl-3.0
-4,870,596,901,379,037,000
34.368852
178
0.588335
false
3.573006
false
false
false
angryrancor/kivy
kivy/uix/behaviors.py
1
56965
''' Behaviors ========= .. versionadded:: 1.8.0 This module implements behaviors that can be mixed with existing base widgets. For example, if you want to add a "button" capability to an :class:`~kivy.uix.image.Image`, you could do:: class IconButton(ButtonBehavior, Image): pass This would give you an...
mit
289,419,205,945,449,800
36.926099
79
0.616238
false
4.279543
false
false
false
hpcc-systems/nagios-monitoring
hpcc-nagios-tools/hpcc_centralized_nagios.py
1
24447
#!/usr/bin/env python3 ############################################################################## # HPCC SYSTEMS software Copyright (C) 2015 HPCC Systems. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtai...
apache-2.0
1,601,087,806,931,783,200
37.804762
166
0.553565
false
4.128166
true
false
false
dellysunnymtech/bitbake
lib/bb/server/xmlrpc.py
1
13251
# # BitBake XMLRPC Server # # Copyright (C) 2006 - 2007 Michael 'Mickey' Lauer # Copyright (C) 2006 - 2008 Richard Purdie # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This p...
gpl-2.0
-5,845,057,423,331,369,000
33.871053
117
0.622066
false
4.302273
false
false
false
bplancher/odoo
addons/stock/stock.py
1
300413
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import date, datetime from dateutil import relativedelta import json import time import sets import openerp from openerp.osv import fields, osv from openerp.tools.float_utils import float_compare, float_ro...
agpl-3.0
-7,653,917,894,173,250,000
58.807486
420
0.595567
false
3.864032
false
false
false
TheDSCPL/SSRE_2017-2018_group8
Projeto/Python/cryptopy/crypto/passwords/passwordfactory.py
1
3751
# -*- coding: utf-8 -*- """ crypto.passwords.passwordfactory Python classes to create and recover passwords. Currently contains simple password generation. <need to merge the dictionary based pws> Copyright © (c) 2002 by Paul A. Lambert Read LICENSE.txt for license information. August 14, 2002 ...
mit
-202,067,140,215,519,550
38.484211
94
0.647561
false
3.935992
false
false
false
mitodl/bootcamp-ecommerce
cms/migrations/0025_add_resource_pages_settings.py
1
2756
# Generated by Django 2.2.13 on 2020-06-29 18:27 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("wagtailcore", "0045_assign_unlock_grouppagepermission"), ("cms", "0024_lettertemplatepage"), ] operations ...
bsd-3-clause
-725,346,538,183,442,300
32.204819
69
0.359216
false
5.85138
false
false
false
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
4.039455
false
false
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
3.913763
false
false
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
4.737033
false
false
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
3.620438
false
false
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
4.220486
false
false
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
3.60678
false
false
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
3.871019
false
false
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
3.090365
false
false
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
3.915493
false
false
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
4.007402
false
false
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
4.176542
false
false
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
3.259194
false
false
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
3.904834
false
false
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
3.443878
false
false
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
3.692843
false
false
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
3.841033
false
false
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
3.586657
true
false
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
3.113344
false
false
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
2.897959
false
false
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
3.835756
false
false
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
3.882022
false
false
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
3.651371
false
false
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
2.777056
false
false
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
2.478056
false
true
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
3.159884
false
false
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
2.941904
false
false
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
3.664025
false
false
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
4.181548
false
false
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
4.025095
false
false
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
3.496633
false
false
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
3.441261
false
false
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
3.775815
true
false
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
3.943827
false
false
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
3.951149
false
false
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
3.851392
false
false
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
3.688637
false
false
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
3.535407
false
false
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
3.848515
false
false
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
2.346447
false
false
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
3
false
false
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
4.436494
false
false
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
4.445455
false
false
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
4.3154
true
false
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
4.418699
false
false
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
2.519635
true
false
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
4.048253
false
false
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
3.917384
false
false
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
3.820952
false
false
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
3.184887
false
false
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
3.93301
false
false
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
4.021978
false
false
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
3.891414
false
false
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
3.084149
false
false
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
2.980296
false
false
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
2.376789
false
false
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
3.46712
false
false
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
3.823529
true
false
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
4.298251
false
false
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
3.621444
false
false
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
3.133663
false
false
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
3.768695
true
false
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
2.669276
false
false
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
2.721745
false
false
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
3.894521
false
false
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
4.085297
false
false
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
2.534513
false
false
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
3.56546
false
false
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
4.200833
false
false
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
2.668472
false
false
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
2.885633
false
false
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
3.100247
false
false
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
2.921971
false
false
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
2.545455
false
false
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
4.010744
false
false
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
3.237082
false
false
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
2.779768
false
false
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
3.484375
false
false
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
3.955854
false
false
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
4.242583
false
false
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
5.573348
false
false
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
3.605096
false
false
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
4.832176
false
false
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
3.277868
false
false
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
3.747828
false
false
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
4.512803
false
false
false
Lisaveta-K/lisaveta-k.github.io
_site/tomat/apps/shops/migrations/0006_transport_company_removal.py
1
3193
# -*- 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 'TransportCompany' db.delete_table(u'shops_transportcompany') def backwards(self, orm...
mit
-2,002,103,304,827,569,700
50.516129
128
0.554964
false
3.691329
false
false
false
drhoet/marantz-hue-adapter
analysis/color_space_analysis.py
1
5469
import numpy as np from mayavi import mlab from scipy.interpolate import splprep, splev from traits.api import HasTraits, Instance, Button, on_trait_change, Float from traitsui.api import View, Item, HSplit, Group, VGroup from mayavi.core.ui.api import MlabSceneModel, SceneEditor #############################...
mit
1,464,191,938,755,861,800
43.97479
134
0.449991
false
3.829832
false
false
false
mike-lawrence/actichampy
pycorder/loadlibs.py
1
3137
# -*- coding: utf-8 -*- ''' Load required libraries and check versions PyCorder ActiChamp Recorder ------------------------------------------------------------ Copyright (C) 2010, Brain Products GmbH, Gilching PyCorder is free software: you can redistribute it and/or modify it under the terms of the GN...
gpl-3.0
-9,222,157,332,096,377,000
32.855556
113
0.601211
false
3.362272
false
false
false
ntymtsiv/tempest
tempest/services/compute/v3/json/servers_client.py
1
16454
# Copyright 2012 OpenStack Foundation # Copyright 2013 Hewlett-Packard Development Company, L.P. # Copyright 2013 IBM Corp # 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...
apache-2.0
5,713,543,314,471,721,000
39.034063
79
0.581682
false
3.99272
true
false
false
FlintHill/SUAS-Competition
UpdatedSyntheticDataset/SyntheticDataset2/ElementsCreator/cross.py
1
1798
from PIL import ImageDraw, Image from SyntheticDataset2.ElementsCreator import Shape class Cross(Shape): def __init__(self, height, color, rotation): """ Initialize a Cross shape :param height: height in pixels :type height: int :param color: color of shape - RGB :...
mit
8,255,110,933,483,183,000
29.474576
118
0.560623
false
3.354478
false
false
false