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
lnxg33k/webhandler
core/libs/file_handler.py
1
7424
import os from subprocess import Popen, PIPE from core.libs.thirdparty.tqdm import tqdm from core.libs.thirdparty.termcolor import cprint, colored from core.libs.request_handler import make_request class FileHandler(object): # A method for downloading files from the box def download_file(self, rfile_path, l...
gpl-3.0
8,176,128,753,831,627,000
50.555556
138
0.524246
false
3.657143
false
false
false
kingvuplus/PKT-gui2
lib/python/Components/About.py
1
3383
from boxbranding import getImageVersion from sys import modules import socket, fcntl, struct def getVersionString(): return getImageVersion() def getEnigmaVersionString(): return getImageVersion() def getKernelVersionString(): try: f = open('/proc/version', 'r') kernelversion = f.read()...
gpl-2.0
-2,129,406,380,206,264,800
25.224806
84
0.507538
false
3.754717
false
false
false
joetsoi/ckanext-jsondatastore
ckanext/jsondatastore/logic/action.py
1
2036
import sqlalchemy from sqlalchemy.dialects.postgresql import JSONB from ckan.plugins.core import get_plugin def jsondatastore_create(context, data_dict): session = context['session'] jsondatastore_plugin = get_plugin('jsondatastore') session.configure(bind=jsondatastore_plugin.write_engine) metadata...
agpl-3.0
8,677,083,198,023,379,000
29.848485
75
0.697446
false
4
false
false
false
kasmith/cbmm-project-christmas
ContainmentModels/SpatialParsing.py
1
4464
from __future__ import division import os, sys, copy from time import time from physicsTable import * from physicsTable.constants import * import numpy as np import scipy as sp import pygame as pg R = -5 G = -10 W = -1 FL = 1 CL = 0 def pointInRect(pt, ul, br): wl, wu = ul wr, wb = br r = pg.Rect(wl,wu,wr...
mit
7,897,977,789,882,846,000
30.659574
103
0.487231
false
3.0957
false
false
false
llluiop/skia
gm/rebaseline_server/imagediffdb.py
1
17655
#!/usr/bin/python """ Copyright 2013 Google Inc. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. Calulate differences between image pairs, and store them in a database. """ import contextlib import csv import logging import os import re import shutil import sys impo...
bsd-3-clause
5,248,106,289,849,315,000
38.146341
80
0.685585
false
3.881073
false
false
false
vishnu2kmohan/dcos
packages/adminrouter/extra/src/test-harness/tests/test_cache.py
1
40588
# Copyright (C) Mesosphere, Inc. See LICENSE file for details. import copy import logging import time import requests from generic_test_code.common import ping_mesos_agent from mocker.endpoints.marathon import ( SCHEDULER_APP_ALWAYSTHERE, SCHEDULER_APP_ALWAYSTHERE_DIFFERENTPORT, ) from mocker.endpoints.mesos...
apache-2.0
-4,130,123,984,576,144,000
40.122594
91
0.544003
false
4.055556
true
false
false
itucsdb1616/itucsdb1616
forms.py
1
2290
from flask_wtf import FlaskForm from wtforms import PasswordField, StringField, validators, Form, BooleanField, SelectField, RadioField, TextAreaField from wtforms.validators import DataRequired, NumberRange, Optional from wtforms_components import IntegerField class LoginForm(Form): username = StringField('Usern...
gpl-3.0
7,338,305,216,767,020,000
45.734694
122
0.69476
false
4.17122
false
false
false
StratusLab/client
api/code/src/main/python/stratuslab/vm_manager/vm_manager.py
1
6553
#!/usr/bin/env python # # Created as part of the StratusLab project (http://stratuslab.eu), # co-funded by the European Commission under the Grant Agreement # INFSO-RI-261552." # # Copyright (c) 2013, Centre National de la Recherche Scientifique (CNRS) # # Licensed under the Apache License, Version 2.0 (the "License");...
apache-2.0
7,569,453,001,601,995,000
37.098837
106
0.572104
false
4.36285
true
false
false
rpdillon/wikid
wikid/docutils/writers/html4css1/__init__.py
1
59708
# $Id: __init__.py 6269 2010-03-18 22:27:53Z milde $ # Author: David Goodger <goodger@python.org> # Copyright: This module has been placed in the public domain. """ Simple HyperText Markup Language document tree Writer. The output conforms to the XHTML version 1.0 Transitional DTD (*almost* strict). The output conta...
gpl-3.0
-1,612,521,703,089,539,800
37.152077
85
0.548603
false
3.963622
false
false
false
gauribhoite/personfinder
env/google_appengine/google/appengine/datastore/datastore_sqlite_stub.py
1
46079
#!/usr/bin/env python # # Copyright 2007 Google 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 o...
apache-2.0
-99,821,203,397,839,820
30.453242
80
0.621498
false
3.952565
false
false
false
Petr-Kovalev/nupic-win32
examples/opf/experiments/anomaly/temporal/noisy_saw/description.py
1
14373
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have purchased from # Numenta, Inc. a separate commercial license for this software code, the # following terms and conditions apply: # # This pro...
gpl-3.0
-3,661,212,057,717,737,500
37.430481
102
0.606206
false
4.512716
true
false
false
jhuapl-boss/boss-manage
lib/datapipeline.py
1
12074
# Copyright 2018 The Johns Hopkins University Applied Physics Laboratory # # 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 ...
apache-2.0
5,725,100,719,491,234,000
38.32899
232
0.541743
false
4.537392
false
false
false
kipanshi/pyramid-upwork
pyramid_upwork/views.py
1
3849
from pyramid.security import remember, forget, unauthenticated_userid from pyramid.httpexceptions import HTTPMethodNotAllowed, HTTPFound from .utils import get_upwork_client class BaseHandler(object): """Base handler with ACL management. Inherit and define the desired methods, then register views and se...
apache-2.0
-5,074,890,765,178,952,000
30.809917
80
0.619641
false
4.528235
false
false
false
SublimeText/SublimeCMD
sublime_cmd.py
1
5261
import sublime, sublime_plugin import re import os import json import fnmatch import StringIO import contextlib import cmd_parser import sublime_lib.view as vlib from sublime_lib.view import append TOKEN_TARGET_APPLICATION = 0 TOKEN_TARGET_WINDOW = 1 TOKEN_TARGET_VIEW = 2 TOKEN_ACTION_QUERY = 3...
mit
-5,062,855,268,725,927,000
31.100629
87
0.528797
false
3.755175
false
false
false
openego/oeplatform
login/migrations/0001_initial.py
1
1473
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-02-05 16:53 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [] operations = [ migrations.CreateModel( name="myuser", ...
agpl-3.0
3,214,490,124,022,395,400
30.340426
88
0.431772
false
5.27957
false
false
false
nikdoof/test-auth
app/api/migrations/0002_auto__add_field_authapikey_callback.py
1
1737
# encoding: 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): # Adding field 'AuthAPIKey.callback' db.add_column('api_authapikey', 'callback', self.gf('django.db.models...
bsd-3-clause
1,869,282,592,409,507,800
42.425
157
0.568221
false
3.711538
false
false
false
imankulov/sentry
src/sentry/models/organizationaccessrequest.py
1
2934
""" sentry.models.organizationmember ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function from django.core.urlresolvers import reverse from django.db.models i...
bsd-3-clause
1,382,527,191,807,762,200
30.891304
83
0.604635
false
4.289474
false
false
false
ubc/compair
compair/learning_records/xapi/object.py
1
13566
from tincan import Activity, ActivityDefinition, LanguageMap, Extensions import pytz from flask import current_app from compair.learning_records.resource_iri import ResourceIRI from compair.learning_records.learning_record import LearningRecord from compair.learning_records.xapi.actor import XAPIActor from compair.l...
gpl-3.0
5,758,043,970,603,836,000
38.097983
140
0.625756
false
4.503984
false
false
false
muellermartin/nosystemd.org
checklinks.py
1
1307
#!/usr/bin/env python3 import sys from bs4 import BeautifulSoup from colorama import Fore, Style import colorama import requests def main(): with open('htdocs/index.html') as f: html_doc = f.read() soup = BeautifulSoup(html_doc, 'html.parser') for anchor in soup.find_all('a'): url = an...
mit
-7,580,751,820,433,614,000
25.14
74
0.485845
false
4.460751
false
false
false
pkgw/pwkit
pwkit/parallel.py
1
17148
# -*- mode: python; coding: utf-8 -*- # Copyright 2014 Peter Williams <peter@newton.cx> and collaborators. # Licensed under the MIT License. """A framework making it easy to write functions that can perform computations in parallel. Use this framework if you are writing a function that you would like to perform some ...
mit
4,790,511,922,062,010,000
36.770925
86
0.660135
false
4.334681
false
false
false
beeftornado/sentry
src/sentry/migrations/0033_auto_20200210_2137.py
1
1779
# -*- coding: utf-8 -*- # Generated by Django 1.11.27 on 2020-02-10 21:37 from __future__ import unicode_literals from django.db import migrations import django.db.models.deletion import sentry.db.models.fields.foreignkey class Migration(migrations.Migration): # This flag is used to mark that a migration shouldn...
bsd-3-clause
6,728,876,508,008,640,000
40.372093
167
0.688027
false
4.297101
false
false
false
ProfessorX/Config
.PyCharm30/system/python_stubs/-1247972723/PyKDE4/kdeui/KStartupInfoData.py
1
3440
# encoding: utf-8 # module PyKDE4.kdeui # from /usr/lib/python2.7/dist-packages/PyKDE4/kdeui.so # by generator 1.135 # no doc # imports import PyKDE4.kdecore as __PyKDE4_kdecore import PyQt4.QtCore as __PyQt4_QtCore import PyQt4.QtGui as __PyQt4_QtGui import PyQt4.QtSvg as __PyQt4_QtSvg class KStartupInfoData(): # s...
gpl-2.0
5,191,530,204,947,430,000
25.461538
101
0.624709
false
3.958573
false
false
false
sunil07t/e-mission-server
emission/analysis/plotting/gmaps/gmap_display.py
1
8846
""" ######################################################### #Google Map Display Tool for E-Mission Trip/Section Data# ######################################################### Author: En (Ryan) Lei A library of functions that allows the user to plot GPS coordinates data via Google Maps API(pygmap). Plots are stored ...
bsd-3-clause
-5,915,026,854,611,273,000
37.12931
156
0.615985
false
3.532748
false
false
false
irinabov/debian-qpid-python
qpid/tests/messaging/__init__.py
2
7387
# # 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...
apache-2.0
-4,353,091,593,074,184,700
30.300847
103
0.632733
false
3.495977
true
false
false
percyfal/bokeh
bokeh/core/tests/test_properties.py
1
65154
from __future__ import absolute_import import datetime import unittest import numpy as np import pandas as pd from copy import copy import pytest from bokeh.core.properties import (field, value, NumberSpec, ColorSpec, Bool, Int, Float, Complex, String, Regex, Seq, List, Dict, Tuple, Instance, Any, Interval, ...
bsd-3-clause
4,655,730,253,088,709,000
35.317726
107
0.587992
false
3.432229
true
false
false
Jessime/MazeDay2017
src/minesweeper_game/controller.py
1
2076
# -*- coding: utf-8 -*- """ Created on Sat Sep 10 15:25:02 2016 @author: jessime """ import pygame import minesweeper_game.events as events class Controller(): def __init__(self, ev_manager, model): self.ev_manager = ev_manager self.model = model self.ev_manager.register(self) s...
mit
-1,308,055,528,385,845,800
33.032787
65
0.549615
false
4.135458
false
false
false
lunarca/fngrpt
models/TargetModel.py
1
1997
# -*- coding: utf-8 -*- import logging import re from sqlalchemy import Column, ForeignKey from sqlalchemy.orm import synonym, relationship, backref from sqlalchemy.types import Unicode, String, Integer from models import dbsession, Permission from models.BaseModels import DatabaseObject, generate_uuid from libs.Va...
apache-2.0
4,743,899,374,327,547,000
27.528571
92
0.610916
false
3.954455
false
false
false
ellonweb/merlin
Arthur/views/alliance/ialliances.py
1
4766
# This file is part of Merlin/Arthur. # Merlin/Arthur is the Copyright (C)2009,2010 of Elliot Rosemarine. # Individual portions may be copyright by individual contributors, and # are included in this collective work with permission of the copyright # owners. # This program is free software; you can redistribute it an...
gpl-2.0
-3,982,309,797,872,831,500
46.66
117
0.582039
false
3.443642
false
false
false
harikrishnanm/sentry
iochip/ioifaceb.py
1
3441
# Sentry # # This file is part of Sentry # # Sentry 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. # # Sentry is distrib...
gpl-3.0
1,529,057,181,256,209,700
27.438017
90
0.662017
false
2.979221
false
false
false
alfa-addon/addon
plugin.video.alfa/channels/cuevana3video.py
1
15661
# -*- coding: utf-8 -*- import sys, base64 PY3 = False if sys.version_info[0] >= 3: PY3 = True; unicode = str; unichr = chr; long = int import time if PY3: import urllib.parse as urlparse else: import urlparse from channelselector import get_thumb from channels import autoplay from channels impor...
gpl-3.0
-5,604,629,131,848,877,000
42.366477
193
0.552859
false
3.887727
false
false
false
cyberspace-kris/dnd5e
hitpoints.py
1
1324
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """HTML checkboxes for monster hit points.""" import argparse import json import numpy as np import random import sys def roll(n, d): """Roll n d-sided dice.""" r = 0 for i in range(n): r += random.randint(1, d) return r def parse(hitdice): ...
mit
8,627,555,290,308,986,000
24.461538
73
0.533233
false
3.07907
false
false
false
ujdhesa/unisubs
apps/webdriver_testing/check_teams/test_videos.py
1
42783
#!/usr/bin/python # -*- coding: utf-8 -*- import json import time import os import filecmp from webdriver_testing.webdriver_base import WebdriverTestCase from webdriver_testing.pages.site_pages.teams import videos_tab from webdriver_testing.pages.site_pages.teams.tasks_tab import TasksTab from webdriver_testing.pages.s...
agpl-3.0
4,204,651,403,408,187,000
38.024635
88
0.62339
false
3.824303
true
false
false
doclements/pywps-4
pywps/request/execute/literal.py
1
2936
from pywps.request.execute import Input from pywps.inout.literal import Literal from pywps import namespaces import logging class LiteralInput(Input): datatype = "int" uom = None def __init__(self,identifier=None,value=None, title=None, abstract=None): super(LiteralInput,self).__init__(identifie...
mit
5,993,077,269,706,671,000
33.139535
111
0.574932
false
4.375559
false
false
false
alexpilotti/python-keystoneclient
keystoneclient/tests/v2_0/test_auth.py
1
10749
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
1,980,303,872,564,046,300
40.662791
79
0.575681
false
3.998884
true
false
false
great-expectations/great_expectations
great_expectations/rule_based_profiler/domain_builder/simple_semantic_type_domain_builder.py
1
9248
from typing import Any, Dict, List, Optional, Union import great_expectations.exceptions as ge_exceptions from great_expectations import DataContext from great_expectations.core.batch import BatchRequest from great_expectations.execution_engine.execution_engine import MetricDomainTypes from great_expectations.profile....
apache-2.0
-7,726,837,573,845,755,000
37.857143
119
0.604131
false
4.441883
false
false
false
mptei/smarthome
dev/skeleton.py
1
1231
#!/usr/bin/env python # vim: set encoding=utf-8 tabstop=4 softtabstop=4 shiftwidth=4 expandtab ######################################################################### # Copyright 2013 <AUTHOR> <EMAIL> ######################################################################### # ...
gpl-3.0
290,673,680,128,242,560
44.592593
73
0.582453
false
4.525735
false
false
false
hb9kns/PyBitmessage
src/storage/sqlite.py
1
3832
import collections from threading import current_thread, enumerate as threadingEnumerate, RLock import Queue import sqlite3 import time from helper_sql import * from storage import InventoryStorage, InventoryItem class SqliteInventory(InventoryStorage): def __init__(self): super(self.__class__, self).__in...
mit
354,122,321,708,885,400
46.308642
306
0.626305
false
4.379429
false
false
false
anandpdoshi/frappe
frappe/utils/user.py
1
8970
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe, json from frappe import _dict import frappe.share from frappe import _ class UserPermissions: """ A user permission object can be accessed as `frappe.get_user()...
mit
-9,021,470,607,356,092,000
28.123377
111
0.651839
false
2.876844
false
false
false
CptCaptain/legendary-octo-train
haikuscript.py
1
4091
#requires: apiclient, --upgrade google-api-python-client, oauth2client import praw import httplib2 import os import sys import datetime from apiclient.discovery import build from apiclient.errors import HttpError from oauth2client.client import flow_from_clientsecrets from oauth2client.file import Storage ...
gpl-3.0
-7,869,262,561,570,000,000
30.991935
113
0.63383
false
3.490614
false
false
false
knights-lab/SHOGUN
shogun/scripts/old/shogun_utree_db.py
1
4018
#!/usr/bin/env python """ Copyright 2015-2020 Knights Lab, Regents of the University of Minnesota. This software is released under the GNU Affero General Public License (AGPL) v3.0 License. """ import click import os from ninja_utils.utils import verify_make_dir from ninja_utils.parsers import FASTA from dojo.datab...
agpl-3.0
-8,923,119,603,351,739,000
46.270588
132
0.652315
false
3.437126
false
false
false
rymis/mrimpy
src/mrim_plugins.py
1
5873
# -*- coding: utf-8 -*- __licence__ = """ Copyright (C) 2009 Mikhail Ryzhov <rymiser@gmail.com> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License. This program is dist...
gpl-3.0
1,688,018,650,007,963,000
22.873984
112
0.643453
false
2.647881
false
false
false
redhat-cip/hardware
hardware/cmdb.py
2
3145
# Copyright (C) 2014-2015 eNovance SAS <licensing@enovance.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
2,110,432,323,120,596,200
29.833333
78
0.602862
false
3.812121
false
false
false
cpcloud/PyTables
tables/tests/create_backcompat_indexes.py
1
1124
# -*- coding: utf-8 -*- # Script for creating different kind of indexes in a small space as possible. # This is intended for testing purposes. from tables import * class Descr(IsDescription): var1 = StringCol(itemsize=4, shape=(), dflt='', pos=0) var2 = BoolCol(shape=(), dflt=False, pos=1) var3 = Int32Co...
bsd-3-clause
-6,598,065,382,088,714,000
27.1
77
0.673488
false
2.728155
false
false
false
dlutxx/memo
Euler/p340.py
1
1048
def crazy(a, b, c): def fn(n): if n>b: return n-c return fn(a+ fn(a + fn(a + fn(a+n)))) return fn def crazy2(a, b, c): def fn(n): if n>b: return n-c s = 0 while n<=b: n += a s += 3 return n + s*(a-c) -c return fn def...
mit
-6,191,537,139,712,557,000
19.54902
53
0.395992
false
2.448598
false
false
false
failys/CAIRIS
cairis/daemon/__init__.py
1
2649
# 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...
apache-2.0
-4,547,857,041,601,258,500
32.531646
103
0.713099
false
3.422481
true
false
false
funkydelpueblo/pyredund
example3.py
1
1135
class Rectangle: def __init__(self, w, h): self.width = w self.height = h def area(self): return self.width * self.height def perimeter(self): return (2 * self.width) + (2 * self.height) def position(self, x, y): self.x = x self.y = y def __str__(self): return str(self.width) + " x " + str(self....
gpl-2.0
-8,137,526,223,348,225,000
18.912281
53
0.62467
false
2.579545
false
false
false
deKupini/erp
addons/website_event/models/event.py
1
3555
# -*- coding: utf-8 -*- import re from openerp import models, fields, api, _ from openerp import SUPERUSER_ID from openerp.addons.website.models.website import slug class event(models.Model): _name = 'event.event' _inherit = ['event.event', 'website.seo.metadata', 'website.published.mixin'] _track = { ...
agpl-3.0
-7,905,484,877,128,164,000
38.065934
114
0.570745
false
3.598178
false
false
false
evanbiederstedt/RRBSfun
scripts/repeat_finder_scripts/repeat_all.py
1
1347
import glob import pandas as pd import numpy as np df1 = pd.read_csv("repeats_hg19.csv") RRBS_files = glob.glob("RRBS*") df_dict = {group : df for group, df in df1.groupby(by="chr")} # In[11]: from numpy import nan def between_range(row, group_dict): # get sub dataframe from dictionary, if key not found ret...
mit
-5,103,719,046,849,328,000
24.903846
111
0.657016
false
3.453846
false
false
false
pluradj/incubator-tinkerpop
gremlin-python/src/main/jython/gremlin_python/structure/io/graphsonV2d0.py
1
20320
''' 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 use this ...
apache-2.0
6,855,475,961,108,599,000
31.721417
127
0.618012
false
3.895706
false
false
false
soshial/text-normalization
numword/numword_ru.py
1
17000
# coding: utf-8 #This file is part of numword. The COPYRIGHT file at the top level of #this repository contains the full copyright notices and license terms. """numword for Russian language""" # materials used: # * http://www.gramota.ru/class/coach/tbgramota/45_110 # * http://www.gramota.ru/spravka/letters/?rub=rubr...
lgpl-3.0
-212,140,326,162,755,500
49.659236
205
0.557553
false
3.001321
true
false
false
vicnet/weboob
modules/bnpcards/corporate/browser.py
1
4898
# -*- coding: utf-8 -*- # Copyright(C) 2015 Baptiste Delpey # # This file is part of a weboob module. # # This weboob module is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the...
lgpl-3.0
3,227,989,298,347,915,000
40.863248
94
0.635566
false
3.811673
false
false
false
glue-viz/glue-exp
glue_exp/tools/zoom_buttons/zoom_buttons.py
1
1910
import os from glue.config import viewer_tool from glue.viewers.common.tool import Tool __all__ = ['ZoomInTool', 'ZoomOutTool'] ROOT = os.path.dirname(__file__) @viewer_tool class ZoomInTool(Tool): """Button to zoom in.""" icon = os.path.join(ROOT, 'glue_zoomin.png') tool_id = 'Zoom In' action_te...
bsd-3-clause
-7,744,558,503,269,959,000
20.954023
66
0.575916
false
3.085622
false
false
false
agoose77/hivesystem
dragonfly/time/complexscheduler.py
1
2317
""" The complex scheduler has the following extra features - add_event has an additional optional priority argument; high priority events happen sooner - add_event_delay: additional arguments "mode" and "delay" mode "ticks": "delay" indicates the number of ticks that must be waited. 0 means the event will be p...
bsd-2-clause
180,959,513,957,031,000
34.106061
88
0.623651
false
4.057793
false
false
false
tyamamot5/Verilog-netlist-viewer
canvas.py
1
27631
# # $Id: canvas.py,v 1.2 2017/08/11 06:06:48 tyamamot Exp $ # import re, sys, time from Tkinter import * from Module import * from Hinstance import * from settings import * class MyCanvas: def __init__(self, root): self.root = root framemid = Frame(root, relief="flat") #framemid["re...
apache-2.0
-6,398,520,527,624,116,000
40.240299
156
0.547682
false
3.205824
false
false
false
alaskansan/Change_SDE_connections
ServerNameChange.py
1
2829
import arcpy, os, getpass newServer = "NEWSERVERNAME" user = getpass.getuser() #user_dir = os.path.join(u'C:\\Users\\', user) ### used for local machine user_dir = u'Input path to directory here' os.chdir(user_dir) ################create logfile################ logfile = open("logfile_for_server_upgrade.txt", "w...
gpl-3.0
-877,041,141,833,871,100
45.949153
234
0.623542
false
3.531835
false
false
false
madmax983/h2o-3
h2o-py/tests/testdir_algos/gbm/pyunit_milsongs_large_gbm.py
1
2798
import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils import os import random from h2o.estimators.gbm import H2OGradientBoostingEstimator def milsong_checkpoint(): milsong_train = h2o.upload_file(pyunit_utils.locate("bigdata/laptop/milsongs/milsongs-train.csv.gz")) milsong_valid = h2...
apache-2.0
-1,648,460,481,481,618,200
36.810811
111
0.598999
false
3.450062
false
false
false
acsis-project/emissions
emissions/python/periodic_1960/regrid_Monoterp_emissions_n96e_360d_1960.py
1
7021
#!/usr/bin/env python ############################################################################################## # # # regrid_emissions_N96e.py # # # Requirements: # Iris 1.10, cf_units, numpy # # # This Python script has been written by N.L. Abraham as part of the UKCA Tutorials: # http://www.ukca.ac.uk/wiki...
gpl-3.0
-4,840,984,031,786,013,000
41.041916
132
0.714713
false
3.032829
false
false
false
adobe-research/spark-gpu
src/profiling.py
1
1459
########################################################################### # # Copyright (c) 2015 Adobe Systems Incorporated. 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 Licens...
apache-2.0
-8,397,156,006,603,360,000
35.475
75
0.635367
false
3.99726
false
false
false
pulli23/mtg_proxy_builder
UI_Handler/main.py
1
9720
import argparse import os import re import sys from . import export_main import load_file import mylogger import save_file from . import proxybuild_main from proxy import paper from proxybuilder_types import SaveFuncTy, ReadFuncTy logger = mylogger.MAINLOGGER # noinspection PyAttributeOutsideInit class SetupData: ...
gpl-3.0
-4,672,945,518,949,555,000
39.669456
93
0.535288
false
4.178848
false
false
false
leiferikb/bitpop
build/scripts/master/try_mail_notifier.py
1
7757
# Copyright (c) 2012 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. """A class to mail the try bot results. """ try: # Create a block to work around evil sys.modules manipulation in # email/__init__.py that triggers ...
gpl-3.0
3,133,359,675,454,441,500
36.47343
95
0.626402
false
3.483161
false
false
false
simone-campagna/invoice
invoice/ee/snow.py
1
3756
#!/usr/bin/env python ### From: ### https://gist.github.com/sontek/1508912 __all__ = [ 'set_printer', 'set_symbols', 'set_flake_symbols', 'set_currency_symbols', 'set_animation', 'make_it_snow', ] import os import random import time import platform snowflakes = {} _PRINTER = print _SYMBOL...
apache-2.0
-8,127,594,447,857,096,000
22.329193
81
0.536209
false
3.464945
false
false
false
cyprieng/twitter-contest
twitter_contest.py
1
2877
import twitter import re import random import os class TwitterContest(): def __init__(self): """ Init the twitter API. """ consumer_key = 'xxxxx' consumer_secret = 'xxxxxxx' access_token = 'xxxxxxx' access_token_secret = 'xxxxx' self.api = twitter....
mit
4,193,558,917,998,740,500
28.357143
99
0.51512
false
3.946502
true
false
false
3dcauldron/repo-to-rename-2
djangoDocker/settings/local_base.py
1
1411
from .base import * # noqa DEBUG = True HOST = 'http://localhost:8000' SECRET_KEY = 'secret' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': base_dir_join('db.sqlite3'), } } STATIC_ROOT = 'staticfiles' STATIC_URL = '/static/' MEDIA_ROOT = 'mediafiles' MEDIA_URL...
mit
9,164,152,140,112,385,000
20.393939
77
0.566265
false
3.391827
false
true
false
qstokkink/py-ipv8
ipv8/messaging/anonymization/payload.py
1
11107
import socket from struct import pack, unpack_from from cryptography.exceptions import InvalidTag from ...messaging.anonymization.tunnel import (CIRCUIT_TYPE_RP_DOWNLOADER, CIRCUIT_TYPE_RP_SEEDER, EXIT_NODE, EXIT_NODE_SALT, ORIGINATOR, ORIGINATOR_SALT) from ...messaging....
lgpl-3.0
8,229,553,238,648,132,000
34.148734
118
0.580355
false
3.820777
false
false
false
savi-dev/heat
heat/engine/resources/neutron/router.py
1
6784
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # 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 applicab...
apache-2.0
839,819,836,485,617,400
36.274725
78
0.567954
false
4.351507
false
false
false
BoutiqueEngineering/vnavs
python/OpticChiasm.py
1
24763
import os, cv2, numpy as np import math import time #from scipy import weave import sys import re # automatically set threshold using technique from # http://www.pyimagesearch.com/2015/04/06/zero-parameter-automatic-canny-edge-detection-with-python-and-opencv/ # just saw URL, and have seen it before, so that's re-as...
lgpl-3.0
900,379,041,527,025,300
36.125937
174
0.598797
false
2.95149
false
false
false
snejy/live-healthy
website/calculate_calories/migrations/0006_auto_20140627_2158.py
1
1398
# encoding: utf8 from __future__ import unicode_literals from django.db import models, migrations import datetime class Migration(migrations.Migration): dependencies = [ ('calculate_calories', '0005_auto_20140627_1125'), ] operations = [ migrations.CreateModel( name='Temp', ...
gpl-3.0
9,173,595,843,110,840,000
34.846154
137
0.565808
false
4.198198
false
false
false
tiagocoutinho/bliss
bliss/controllers/tango_keithley.py
1
1239
# -*- coding: utf-8 -*- # # This file is part of the bliss project # # Copyright (c) 2016 Beamline Control Unit, ESRF # Distributed under the GNU LGPLv3. See LICENSE for more info. from bliss.common.task_utils import cleanup, error_cleanup, task from bliss.common.measurement import SamplingCounter from bliss.common.ta...
lgpl-3.0
6,571,138,899,198,779,000
29.219512
64
0.640032
false
3.698507
false
false
false
carangorango/sgl
democritus/simulation.py
2
6562
from collections import OrderedDict import matplotlib.pyplot as plt import numpy as np from democritus.factories import SenderStrategyFactory, ReceiverStrategyFactory from democritus.metrics import ExpectedUtilityMetric, SenderNormalizedEntropyMetric, ReceiverNormalizedEntropyMetric class SimulationMetricConverter(...
gpl-2.0
-6,626,278,064,298,212,000
39.506173
120
0.651021
false
3.839672
false
false
false
ansteh/strapping
python/batch-by-split.py
1
1518
import json import numpy as np import pandas as pd def get_json_data(filename): with open(filename) as data_file: return json.load(data_file) class Batch(): def __init__(self, data, batch_size=None): self.data = np.array(data) self.batch_size = batch_size self.shuffle().split(...
mit
-304,590,131,035,898,240
30.625
76
0.576416
false
3.473684
false
false
false
sr-lab/verified-pam-cracklib
evaluation/csv.py
1
1804
import json def import_json(path): """Decodes and returns the JSON object in the file at the specified path. Args: path (str): The path of the file to read. """ with open(path) as data_file: return json.load(data_file) # Import all files. results_v = import_json('resul...
bsd-3-clause
-2,091,008,991,730,974,700
33.692308
146
0.601441
false
3.09434
false
false
false
project-oak/hafnium-verification
experiments/ownership-inference/infer/infer/lib/python/inferlib/analyze.py
1
3009
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_li...
apache-2.0
4,222,320,676,997,132,000
47.532258
79
0.573945
false
4.77619
false
false
false
wpjesus/codematch
ietf/secr/roles/tests.py
1
2135
# -*- coding: utf-8 -*- from django.core.urlresolvers import reverse from ietf.utils.test_utils import TestCase from ietf.group.models import Group from ietf.person.models import Person from ietf.utils.test_data import make_test_data import debug # pyflakes:ignore SECR_USER='secretary' de...
bsd-3-clause
2,909,000,508,456,911,000
38.518519
89
0.62746
false
3.704861
true
false
false
ericholscher/invoke
tests/runner.py
1
7657
import sys import os from spec import eq_, skip, Spec, raises, ok_, trap from invoke.runner import Runner, run from invoke.exceptions import Failure from _utils import support def _run(returns=None, **kwargs): """ Create a Runner w/ retval reflecting ``returns`` & call ``run(**kwargs)``. """ # Set ...
bsd-2-clause
-6,061,667,257,445,124,000
31.308017
90
0.542118
false
3.656638
false
false
false
takeflight/wagtailtestutils
wagtailtestutils/utils.py
1
5705
from __future__ import absolute_import, unicode_literals from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.test import TestCase from django.utils.text import slugify from wagtail.tests.utils import WagtailTestUtils as WagtailTestUtils from wagtail.wagta...
bsd-2-clause
-1,300,365,387,873,400,000
45.008065
121
0.622787
false
4.095477
true
false
false
carlos-jenkins/autoapi
doc/documented.py
1
2523
# -*- coding: utf-8 -*- """ This is my module brief line. This is a more complete paragraph documenting my module. - A list item. - Another list item. This section can use any reST syntax. """ A_CONSTANT = 1000 """This is an important constant.""" YET_ANOTHER = { 'this': 'that', 'jam': 'eggs', 'yet': {...
apache-2.0
-8,342,529,414,495,768,000
21.526786
77
0.617915
false
3.828528
false
false
false
nitmir/nflog-bindings
examples/example.py
1
1180
#!/usr/bin/python # need root privileges import struct import sys import time from socket import AF_INET, AF_INET6, inet_ntoa sys.path.append('python') sys.path.append('build/python') import nflog sys.path.append('dpkt-1.6') from dpkt import ip l = nflog.log() def cb(payload): try: print "python call...
gpl-3.0
-1,068,244,368,557,201,000
17.730159
50
0.617797
false
3.056995
false
false
false
danielgtaylor/arista
arista/discoverer.py
1
16111
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # discoverer.py # (c) 2005 Edward Hervey <edward at fluendo dot com> # Discovers multimedia information on files # 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 ...
lgpl-2.1
-5,865,040,974,509,095,000
35.867277
124
0.565452
false
3.93335
false
false
false
gocardless/gocardless-pro-python
gocardless_pro/services/currency_exchange_rates_service.py
1
1191
# WARNING: Do not edit by hand, this file was generated by Crank: # # https://github.com/gocardless/crank # from . import base_service from .. import resources from ..paginator import Paginator from .. import errors class CurrencyExchangeRatesService(base_service.BaseService): """Service class that provides acc...
mit
-7,724,011,695,332,411,000
26.068182
78
0.628044
false
4.411111
false
false
false
ericholscher/django
django/db/models/fields/related.py
1
75259
from operator import attrgetter from django.db import connection, connections, router, transaction from django.db.backends import utils from django.db.models import signals from django.db.models.fields import (AutoField, Field, IntegerField, PositiveIntegerField, PositiveSmallIntegerField, FieldDoesNotExist) from ...
bsd-3-clause
7,988,949,859,930,259,000
45.484867
228
0.602705
false
4.138066
false
false
false
zhangliyong/pyfuncrun
pyfuncrun.py
1
1600
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A tool to run a python function in a module from command line. This tool import a function from command line arguments and run it. It is helpful to test a function when you developing or just want to run a function in module. If you want to test a function, please use ...
bsd-2-clause
-6,763,409,575,817,147,000
26.586207
74
0.673125
false
3.747073
false
false
false
omni-digital/omni-blocks
tests/test_text_blocks.py
1
2202
from django.test import TestCase from wagtail.core.blocks import CharBlock, BlockQuoteBlock from omni_blocks.blocks.text_blocks import HBlock, JumpHBlock, PullQuoteBlock, QuoteBlock class TestHBlock(TestCase): """Tests for the HBlock.""" def test_parent_class(self): """Test HBlock is a subclass of C...
mit
2,327,580,979,920,737,300
31.865672
91
0.653043
false
3.99637
true
false
false
snim2/python-csp
rst/tutorial/part03/mandelbrot.py
1
5747
#!/usr/bin/env python # Mandelbrot set computed in parallel using python-csp. # Multiple-producer, single consumer architecture. # Copyright (C) Sarah Mount, 2009. # 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 ...
gpl-2.0
5,899,951,967,234,588,000
34.475309
80
0.645728
false
3.466224
false
false
false
zalando/turnstile-codevalidator
turnstile_codevalidator/command.py
1
2698
# -*- coding: utf-8 -*- """ Copyright 2015 Zalando SE 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 ...
apache-2.0
-7,629,829,843,476,506,000
37.542857
120
0.680875
false
4.125382
false
false
false
Code4SA/municipal-data
municipal_finance/settings.py
1
10730
""" Django settings for municipal_finance project. For more information on this file, see https://docs.djangoproject.com/en/1.7/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.7/ref/settings/ """ TESTING = False # Build paths inside the project like this: os....
mit
-6,249,851,808,021,817,000
30.839763
128
0.581827
false
3.408513
false
false
false
KarolBedkowski/mna
mna/gui/dlg_source_info.py
1
3720
# -*- coding: utf-8 -*- """ Dialog - information about source. Copyright (c) Karol Będkowski, 2014-2015 This file is part of mna Licence: GPLv2+ """ __author__ = "Karol Będkowski" __copyright__ = "Copyright (c) Karol Będkowski, 2014-2015" __version__ = "2015-01-30" import logging from PyQt4 import QtGui, QtCore f...
gpl-2.0
-3,940,936,095,692,817,000
41.238636
101
0.640032
false
3.428967
false
false
false
OpenUniversity/ovirt-engine
packaging/setup/plugins/ovirt-engine-common/dockerc/core.py
1
4245
# # ovirt-engine-setup -- ovirt engine setup # Copyright (C) 2015 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
apache-2.0
-5,854,174,562,353,786,000
29.985401
78
0.5649
false
4.257773
true
false
false
wuqize/FluentPython
chapter21/bulkfood/model_v6.py
1
1537
#coding=utf-8 import abc class AutoStorage: __counter = 0 def __init__(self): cls = self.__class__ prefix = cls.__name__ index = cls.__counter self.storage_name = '_{}#{}'.format(prefix, index) cls.__counter += 1 def __get__(self, instance, owner): if ins...
lgpl-3.0
-7,475,415,570,004,770,000
23.790323
63
0.575146
false
4.13172
false
false
false
Diddit/diddit
legacy/diddit-old/gaut.py
1
4390
import webapp2 import base64 from webapp2_extras import auth from webapp2_extras import sessions from webapp2_extras.auth import InvalidAuthIdError from webapp2_extras.auth import InvalidPasswordError #Decorator to easily append routes to an app class route(object): def __init__(self,app=webapp2.get_app(),*args,**kwa...
gpl-2.0
3,758,477,465,174,726,000
31.768657
139
0.712073
false
3.379523
false
false
false
sysadminmatmoz/account-invoicing
account_invoice_supplierinfo_update/wizard/wizard_update_invoice_supplierinfo_line.py
1
2224
# -*- coding: utf-8 -*- # © 2016 Chafique DELLI @ Akretion # Copyright (C) 2016-Today: GRAP (http://www.grap.coop) # @author: Sylvain LE GAL (https://twitter.com/legalsylvain) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import models, api, fields import odoo.addons.decimal_precision ...
agpl-3.0
8,918,413,784,908,544,000
32.681818
74
0.641925
false
3.57971
false
false
false
atados/atados-ovp
api/channels/rrp/migrations/0001_initial.py
1
3030
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-08-03 08:41 from __future__ import unicode_literals from django.db import migrations from ovp.apps.core.helpers import generate_slug def foward_func(apps, schema_editor): Channel = apps.get_model("channels", "Channel") channel = Channel.objects.cr...
agpl-3.0
213,053,124,247,227,740
46.34375
115
0.734983
false
3.535589
false
false
false
ChanKaur/librehattii
src/librehatti/catalog/models.py
1
3564
""" models of catalog are.. """ from django.db import models from django.forms import ModelForm import useraccounts from django.contrib.auth.models import User """ This class defines the name of category and parent category of product """ class Category(models.Model): name = models.CharField(max_length=100) p...
gpl-2.0
-4,833,228,114,791,176,000
31.697248
72
0.690516
false
3.873913
false
false
false
startcode/apollo
modules/tools/navigation/planning/ad_vehicle.py
1
1703
#!/usr/bin/env python ############################################################################### # Copyright 2017 The Apollo 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 ...
apache-2.0
-7,403,713,921,794,925,000
36.844444
79
0.608338
false
4.074163
false
false
false
elin-moco/bedrock
bin/update/deploy-demo1.py
1
3433
""" Deployment for Bedrock in production. Requires commander (https://github.com/oremj/commander) which is installed on the systems that need it. """ import os import sys sys.path.append(os.path.dirname(os.path.abspath(__file__))) from commander.deploy import task, hostgroups import commander_settings as settings ...
mpl-2.0
2,121,519,550,780,368,400
26.910569
155
0.6455
false
3.175763
false
false
false
mhorn71/StarbaseMini
filters/WeightedRunningAverage.py
1
6538
__author__ = 'mark' # StarbaseMini Staribus/Starinet Client for the British Astronomical Association Staribus Protocol # Copyright (C) 2017 Mark Horn # # This file is part of StarbaseMini. # # StarbaseMini is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
gpl-2.0
3,092,171,252,428,179,500
32.533333
134
0.628939
false
4.109365
false
false
false
mir-dataset-loaders/mirdata
scripts/legacy/make_rwc_classical_index.py
1
3883
import argparse import hashlib import json import os import csv RWC_CLASSICAL_INDEX_PATH = "../mirdata/datasets/indexes/rwc_classical_index.json" def md5(file_path): """Get md5 hash of a file. Parameters ---------- file_path: str File path. Returns ------- md5_hash: str ...
bsd-3-clause
1,779,662,288,988,536,000
31.630252
86
0.514293
false
3.442376
false
false
false
madrisan/pyrpi-xbmc
xbmc_player.py
1
6230
import csv, os, shutil, time import datetime as dt import xbmc, xbmcgui import rpi.constants, rpi.hash, rpi.web from rpi.constants import videoPath as videoPath from rpi.constants import videoPathTmp as videoPathTmp from rpi.constants import videocsvfile as videocsvfile from rpi.constants import videocsvfile as video...
gpl-3.0
-1,490,858,009,046,133,500
38.935897
95
0.56549
false
4.139535
false
false
false
yanikou19/pymatgen
pymatgen/core/operations.py
1
14892
# coding: utf-8 from __future__ import division, unicode_literals """ This module provides classes that operate on points or vectors in 3D space. """ __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2011, The Materials Project" __version__ = "1.0" __maintainer__ = "Shyue Ping Ong" __email__ = "shyuep@gmail....
mit
6,180,417,748,327,564,000
33.552204
92
0.505842
false
3.619835
false
false
false
mojodna/debian-mapnik
utils/svg2png/build.py
1
1634
# # This file is part of Mapnik (c++ mapping toolkit) # # Copyright (C) 2006 Artem Pavlenko, Jean-Francois Doyon # # Mapnik 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 Li...
lgpl-2.1
-1,515,836,669,277,801,200
31.68
114
0.720318
false
3.341513
false
false
false
pombredanne/discern
examples/problem_grader/grader/rubric_functions.py
1
1815
from models import Rubric, RubricOption import logging log = logging.getLogger(__name__) def get_rubric_data(problem_id, target_scores = None): """ Retrieve the local rubric that is associated with a given api problem problem_id - the id of the problem object that the rubric is associated with target_...
agpl-3.0
8,456,086,283,830,913,000
39.333333
133
0.680441
false
3.89485
false
false
false