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
dpm76/eaglebone
drone/flight/stabilization/imu6050.py
1
7844
# -*- coding: utf-8 -*- ''' Created on 23/10/2015 @author: david ''' import logging import math import time import imu6050_defs as reg from sensors.I2CSensor import I2CSensor from sensors.vector import Vector from copy import deepcopy from flight.stabilization.state import SensorState try: import smbus ex...
isc
3,956,320,715,344,091,600
23.974522
128
0.55394
false
3.459197
false
false
false
slibby/machine
openaddr/ci/__init__.py
1
28361
import logging; _L = logging.getLogger('openaddr.ci') from ..compat import standard_library, expand_uri from .. import jobs, render from .objects import ( add_job, write_job, read_job, complete_set, update_set_renders, add_run, set_run, copy_run, read_completed_set_runs, get_completed_file_run, get_comple...
isc
-8,725,184,806,641,569,000
36.464993
106
0.618138
false
3.714604
false
false
false
GoogleCloudPlatform/healthcare
imaging/ml/toolkit/hcls_imaging_ml_toolkit/test_pubsub_util.py
1
1730
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
4,498,637,888,027,374,600
30.454545
76
0.731792
false
3.931818
false
false
false
Qwaz/solved-hacking-problem
DEFCON/2019 Finals/babi/solver.py
1
1302
from base64 import b64encode from pwn import * def s_array(*args): assert len(args) % 2 == 0 return 'a:%d:{' % (len(args) // 2) + ''.join(args) + '}' def s_bool(val): return 'b:%d;' % val def s_str(s): return 's:%d:"%s";' % (len(s), s) def s_ref(val): return 'r:%d;' % val...
gpl-2.0
-9,006,028,544,528,207,000
15.835616
65
0.506144
false
2.752643
false
false
false
jhanley634/testing-tools
problem/covid/sd_cases_deaths.py
1
2150
#! /usr/bin/env streamlit run # Copyright 2020 John Hanley. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, mod...
mit
-4,698,819,997,443,697,000
35.440678
80
0.695349
false
3.536184
false
false
false
spreeker/democracygame
democracy/issue/migrations/0002_auto__add_field_issue_slug.py
1
4992
# 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 'Issue.slug' db.add_column('issue_issue', 'slug', self.gf('django.db.models.fields.SlugFiel...
bsd-3-clause
-6,876,075,056,248,061,000
64.684211
182
0.553085
false
3.692308
false
false
false
TheImagingSource/tiscamera
examples/python/00-list-devices.py
1
2576
#!/usr/bin/env python3 # Copyright 2017 The Imaging Source Europe 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
apache-2.0
-4,272,001,744,929,887,700
31.607595
94
0.660326
false
4.043956
false
false
false
cfelton/minnesota
test/test_system/test_regfile.py
1
7464
# # Copyright (c) 2006-2013 Christopher L. Felton # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This prog...
gpl-3.0
6,406,166,799,250,013,000
28.975904
93
0.561763
false
3.507519
true
false
false
BlackhatEspeed/electrum
gui/qt/seed_dialog.py
1
3072
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2013 ecdsa@github # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
gpl-3.0
2,860,938,589,312,174,000
35.141176
160
0.66569
false
3.455568
false
false
false
tleonhardt/CodingPlayground
python/cffi/fibonacci/test_cffi.py
1
1755
#!/usr/bin/env python """ Python wrapper to time the CFFI wrapper for computing the nth fibonacci number in a non-recursive fashion and compare it to the pure Python implementation. """ import cffi import fib_python if __name__ == '__main__': import sys import timeit n = 20 try: n = int(sys.ar...
mit
-701,642,183,918,904,800
34.1
154
0.612536
false
3.25
false
false
false
openstack/octavia
octavia/tests/functional/api/v2/test_availability_zone_profiles.py
1
29649
# Copyright 2019 Verizon Media # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
1,955,087,208,449,069,000
49.337861
79
0.58835
false
3.637914
true
false
false
jinhong666/Python
AvailabilityMonitor/DbAccess/dbaccesser.py
1
1073
#!/usr/bin/python from Tools.datetimetool import DateTimeTool import logging from DbAccess import DBHelper SOCKET_TIMEOUT = 1 class DbAccesser: def __init__(self,host,user,pwd,db): self._dbHelper = DBHelper(host,user,pwd,db) self._logger = logging.getLogger("root") def RecordMonitor(self,do...
apache-2.0
5,166,579,525,175,662,000
33.633333
116
0.6564
false
3.12012
false
false
false
googleapis/python-aiplatform
samples/snippets/create_hyperparameter_tuning_job_python_package_sample.py
1
3771
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
1,663,557,871,573,529,000
35.970588
95
0.638823
false
3.601719
false
false
false
dNG-git/pas_upnp
src/dNG/data/upnp/identifier_mixin.py
1
5198
# -*- coding: utf-8 -*- """ direct PAS Python Application Services ---------------------------------------------------------------------------- (C) direct Netware Group - All rights reserved https://www.direct-netware.de/redirect?pas;upnp The following license agreement remains valid unless any additions or changes a...
gpl-2.0
28,591,505,664,425,940
24.111111
104
0.563678
false
3.697013
true
false
false
JackyChou/SGRS
SGRS/common_settings.py
1
3285
""" Django settings for SGRS project. Generated by 'django-admin startproject' using Django 1.8. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build paths ins...
gpl-2.0
4,849,460,929,883,837,000
24.269231
71
0.666971
false
3.355465
false
false
false
miguelgrinberg/microblog
migrations/versions/780739b227a7_posts_table.py
1
1057
"""posts table Revision ID: 780739b227a7 Revises: e517276bb1c2 Create Date: 2017-09-11 12:23:25.496587 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '780739b227a7' down_revision = 'e517276bb1c2' branch_labels = None depends_on = None def upgrade(): # ##...
mit
-2,497,830,188,465,469,400
27.567568
83
0.663198
false
3.272446
false
false
false
googleapis/googleapis-gen
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/enums/types/merchant_center_link_status.py
1
1291
# -*- 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
245,458,820,869,564,640
29.738095
74
0.693261
false
4.085443
false
false
false
ActiDoo/gamification-engine
setup.py
1
2935
import os import re from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, 'README.txt')) as f: README = f.read() with open(os.path.join(here, 'CHANGES.txt')) as f: CHANGES = f.read() requires = [ 'pyramid', 'pyramid_chameleon', ...
mit
-1,113,054,953,801,862,000
28.646465
122
0.600341
false
3.618989
false
false
false
keseldude/brobot
brobot/core/bot.py
1
10481
#=============================================================================== # brobot # Copyright (C) 2010 Michael Keselman # # 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...
gpl-3.0
7,017,456,056,481,446,000
34.771331
80
0.539929
false
4.664441
false
false
false
Southpaw-TACTIC/TACTIC
src/pyasm/prod/web/render_wdg.py
1
6716
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
7,091,345,297,028,031,000
31.444444
156
0.609738
false
4.053108
false
false
false
Miserlou/Zappa
tests/test_app.py
1
1055
from zappa.asynchronous import task try: from urllib.parse import parse_qs except ImportError: from cgi import parse_qs try: from html import escape except ImportError: from cgi import escape def hello_world(environ, start_response): parameters = parse_qs(environ.get('QUERY_STRING', '')) if '...
mit
-5,456,621,769,303,471,000
22.444444
84
0.651185
false
3.370607
false
false
false
awacha/cct
attic/gui/core/builderwidget.py
1
2464
import logging from gi.repository import Gtk, Gdk, GdkPixbuf from ...core.utils.callback import Callbacks, SignalFlags logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) class BuilderWidget(Callbacks): __signals__ = {'destroy': (SignalFlags.RUN_FIRST, None, ())} def __init__(self, gladefil...
bsd-3-clause
-4,639,427,528,054,207,000
36.907692
99
0.640016
false
3.874214
false
false
false
google-code/acromania
amprotocol.py
1
3608
# Copyright 2009 Lee Harr # # This file is part of Acromania. # # Acromania 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. # # Acroman...
gpl-3.0
1,931,519,000,349,934,800
28.818182
100
0.613359
false
4.026786
false
false
false
matthewbauer/Reggie
windows_build.py
1
2846
from distutils.core import setup from py2exe.build_exe import py2exe import os, os.path, shutil, sys upxFlag = False if '-upx' in sys.argv: sys.argv.remove('-upx') upxFlag = True dir = 'distrib/windows' print '[[ Freezing Reggie! ]]' print '>> Destination directory: %s' % dir sys.argv.append('py...
gpl-2.0
7,492,280,498,728,124,000
32.707317
84
0.603654
false
3.317016
false
false
false
henrykironde/deletedret
docs/conf.py
3
7970
import sys import sphinx_rtd_theme from retriever.lib.defaults import ENCODING encoding = ENCODING.lower() from retriever.lib.defaults import VERSION, COPYRIGHT from retriever.lib.scripts import SCRIPT_LIST, reload_scripts from retriever.lib.tools import open_fw from retriever.lib.repository import check_for_updates...
mit
-5,806,422,816,114,753,000
30.88
90
0.692346
false
3.740028
false
false
false
Pikecillo/genna
external/4Suite-XML-1.0.2/test/Xml/Xslt/Borrowed/mb_20030223.py
1
2150
# a pretty straightforward Muenchian grouping test from Xml.Xslt import test_harness sheet_1 = """<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes"/> <xsl:key name="skills-by-mark" match="skill" use="@m...
gpl-2.0
4,578,644,373,810,415,600
28.452055
80
0.583256
false
3.199405
true
false
false
AstroHuntsman/POCS
pocs/tests/test_focuser.py
1
4299
import pytest from pocs.focuser.simulator import Focuser as SimFocuser from pocs.focuser.birger import Focuser as BirgerFocuser from pocs.camera.simulator import Camera from pocs.utils.config import load_config params = [SimFocuser, BirgerFocuser] ids = ['simulator', 'birger'] # Ugly hack to access id inside fixtur...
mit
-8,882,572,169,062,581,000
33.392
94
0.676902
false
3.66184
true
false
false
windmill/windmill
windmill/management/commands/test_windmill.py
1
4314
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
apache-2.0
8,694,265,997,949,678,000
36.513043
100
0.572323
false
4.046904
true
false
false
datapythonista/pandas
pandas/tests/io/pytables/test_timezones.py
2
11495
from datetime import ( date, timedelta, ) import numpy as np import pytest from pandas._libs.tslibs.timezones import maybe_get_tz import pandas.util._test_decorators as td import pandas as pd from pandas import ( DataFrame, DatetimeIndex, Series, Timestamp, date_range, ) import pandas._te...
bsd-3-clause
-4,588,879,910,586,167,000
29.817694
85
0.582427
false
3.333817
true
false
false
WarrenWeckesser/scikits-image
skimage/morphology/convex_hull.py
2
3703
__all__ = ['convex_hull_image', 'convex_hull_object'] import numpy as np from ..measure._pnpoly import grid_points_in_poly from ._convex_hull import possible_hull from ..measure._label import label from ..util import unique_rows try: from scipy.spatial import Delaunay except ImportError: Delaunay = None def...
bsd-3-clause
7,252,472,451,150,757,000
30.117647
96
0.644883
false
3.623288
false
false
false
evancasey/startup-finder
lib/github_dump.py
1
1658
import urllib import urllib2 import json import pdb import sys import time import csv import tokens from models import * class GithubListener: def get_all_repos(self,org): url = "https://api.github.com/orgs/" + org + "/repos?client_id=" + tokens.GITHUB_ID + "&client_secret=" + tokens.GITHUB_SECRET ...
mit
-1,315,194,730,258,532,000
20.269231
142
0.431242
false
4.657303
false
false
false
reed-college/lemur
lemur/utility_modify.py
1
23527
# Libraries # Local from lemur import models as m from lemur import (app, db) from lemur.utility_generate_and_convert import (check_existence, generate_lab_id, generate_experiment_id, ...
mit
-2,824,706,532,023,522,000
42.649351
130
0.538403
false
4.196753
false
false
false
Egor-Krivov/pdp
tests/test_base.py
1
3421
import unittest import time from contextlib import suppress from queue import Queue as ThreadQueue from threading import Thread from threading import Event as ThreadEvent import numpy as np from pdp.base import InterruptableQueue, StopEvent, start_one2one_transformer DEFAULT_LOOP_TIMEOUT = 0.02 def set_event_after...
mit
-184,339,067,233,399,360
29.81982
119
0.609763
false
3.582199
true
false
false
modoboa/modoboa-stats
modoboa_stats/forms.py
1
1691
"""Modoboa stats forms.""" import rrdtool from pkg_resources import parse_version from django.conf import settings from django.utils.translation import ugettext_lazy from django import forms from modoboa.lib import form_utils from modoboa.parameters import forms as param_forms class ParametersForm(param_forms.Adm...
mit
6,087,176,765,779,094,000
32.156863
79
0.66233
false
3.87844
false
false
false
bigzhao/flask-projects-manage
app/auth/views.py
1
2830
# -*- coding: utf-8 -*- from flask import render_template, redirect, request, url_for, flash from flask.ext.login import login_user, logout_user, login_required, current_user from . import auth from ..models import User from .forms import RegisterForm, EditForm, ChangePasswdForm from .. import db @auth.route('/lo...
mit
6,027,085,668,962,736,000
29.43956
83
0.625632
false
3.542199
false
false
false
Tamriel/wagtail_room_booking
account/models.py
1
13705
from __future__ import unicode_literals import datetime import operator try: from urllib.parse import urlencode except ImportError: # python 2 from urllib import urlencode from django.core.urlresolvers import reverse from django.db import models, transaction from django.db.models import Q from django.db.mod...
gpl-3.0
7,228,095,418,603,898,000
34.505181
110
0.624954
false
4.1305
false
false
false
appleseedhq/gaffer
python/GafferUI/CompoundDataPlugValueWidget.py
1
9030
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that ...
bsd-3-clause
551,014,885,235,974,460
50.306818
192
0.670764
false
3.356877
false
false
false
bobismijnnaam/bobe-euler
48/Utils.py
1
12422
#!/usr/bin/env python3 import collections # skim seems to be intensive and doing a lot of work even though in some # cases it could do less. For example, in add, you can stop skimming if after # skimming the first two cells the carrier is 0. # we need more kinds of skimming, at least two (i.e. the skim as we ...
mit
5,004,734,104,982,722,000
24.096639
80
0.495089
false
3.957311
false
false
false
projectgus/yamdwe
mediawiki.py
1
7964
""" Methods for importing mediawiki pages, images via the simplemediawki wrapper to the MediaWiki API. Copyright (C) 2014 Angus Gratton Licensed under New BSD License as described in the file LICENSE. """ from __future__ import print_function, unicode_literals, absolute_import, division import simplemediawiki, simplej...
bsd-3-clause
6,800,407,379,736,151,000
48.465839
345
0.596936
false
4.200422
false
false
false
alerta/python-alerta-client
alertaclient/top.py
1
5079
import curses import sys import time from curses import wrapper from datetime import datetime from alertaclient.models.alert import Alert from alertaclient.utils import DateTime class Screen: ALIGN_RIGHT = 'R' ALIGN_CENTRE = 'C' def __init__(self, client, timezone): self.client = client ...
apache-2.0
1,558,769,885,894,008,600
33.087248
118
0.525103
false
3.476386
false
false
false
ikinsella/squall
flaskapp/squall/models.py
1
32913
import os import shutil import json import yaml import zipfile import re from flask import (render_template, current_app) from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.login import (UserMixin, AnonymousUserMixin) from werkzeug.security import (generate_password_hash, check_password_hash) from sqlalchemy.e...
bsd-3-clause
-587,099,930,290,131,300
28.360393
80
0.599824
false
3.965422
false
false
false
digwanderlust/pants
src/python/pants/base/target_addressable.py
1
2168
# 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 six import stri...
apache-2.0
9,125,159,257,805,332,000
37.035088
95
0.690959
false
3.89228
false
false
false
cryptapus/electrum-myr
plugins/ledger/qt.py
1
2181
import threading from PyQt4.Qt import (QDialog, QInputDialog, QLineEdit, QVBoxLayout, QLabel, SIGNAL) import PyQt4.QtCore as QtCore from electrum.i18n import _ from .ledger import LedgerPlugin from ..hw_wallet.qt import QtHandlerBase, QtPluginBase from electrum_gui.qt.util import * from btchip....
mit
870,677,349,423,049,600
27.324675
121
0.607519
false
3.740995
false
false
false
beni55/sentry
src/sentry/interfaces.py
1
35445
""" sentry.interfaces ~~~~~~~~~~~~~~~~~ Interfaces provide an abstraction for how structured data should be validated and rendered. :copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import itertools import urlparse import warnings from pygme...
bsd-3-clause
8,498,770,027,748,643,000
29.424893
119
0.551136
false
4.132082
false
false
false
xcgspring/XSTAF
XSTAF/ui/ui_confirmDialog.py
1
2148
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'confirmDialog.ui' # # Created: Fri Jun 05 09:54:07 2015 # by: PyQt4 UI code generator 4.11.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except ...
apache-2.0
-5,367,792,330,494,818,000
40.307692
102
0.705773
false
3.905455
false
false
false
deannariddlespur/django-baker
django_baker/management/commands/bake.py
1
2636
from __future__ import print_function from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import ImproperlyConfigured from django.db.models import get_app, get_models from django.db.models.loading import get_model from ...bakery import Baker class Command(BaseCommand): ar...
bsd-3-clause
8,704,876,466,907,126,000
42.933333
120
0.616844
false
3.975867
false
false
false
noironetworks/neutron
neutron/agent/common/resource_processing_queue.py
1
6194
# Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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 requir...
apache-2.0
4,223,049,414,664,777,700
36.539394
79
0.652406
false
4.584752
false
false
false
open-synergy/opnsynid-partner-contact
partner_app/models/res_partner.py
1
1107
# -*- coding: utf-8 -*- # Copyright 2017 OpenSynergy Indonesia # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import models, api class ResPartner(models.Model): _inherit = "res.partner" @api.multi def button_toggle_customer(self): for partner in self: pa...
agpl-3.0
-3,164,423,185,243,750,400
24.744186
63
0.528455
false
3.817241
false
false
false
GroestlCoin/electrum-grs
electrum_grs/plugins/trustedcoin/trustedcoin.py
1
31657
#!/usr/bin/env python # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without...
gpl-3.0
-3,658,117,888,799,464,400
41.041169
139
0.603468
false
3.674637
false
false
false
jkibele/benthic_photo_survey
bps_package/photo_tagging.py
1
24681
import pyexiv2 as exiv # see note about pyexiv2 in notes.txt import json from ast import literal_eval from depth_temp_log_io import * from configuration import * from gps_log_io import * from common import * # That namespace url doesn't really exist. The custom tags seem to work # without it. Perhaps I should figure ou...
bsd-3-clause
3,740,261,318,711,634,000
37.146832
165
0.565658
false
3.673861
false
false
false
rpavlik/jhbuild-vrjuggler
jhbuild/frontends/buildscript.py
1
11073
# jhbuild - a build script for GNOME 1.x and 2.x # Copyright (C) 2001-2006 James Henstridge # Copyright (C) 2003-2004 Seth Nickell # # buildscript.py: base class of the various interface types # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public Lic...
gpl-2.0
3,736,484,522,379,380,700
40.943182
101
0.530118
false
4.748285
true
false
false
Bioto/Huuey-python
huuey/hue/scenes/scene.py
1
1071
from huuey.paths import Paths class Scene: name = None lights = [] owner = None recycle = None locked = None appdata = None picture = None lastupdated = None version = None _id = None _parent = None def __init__(self, obj, parent, _id): self._parent = parent ...
mit
6,638,197,520,970,899,000
20
62
0.535948
false
3.894545
false
false
false
openstack/vitrage
tools/datasource-scaffold/sample/__init__.py
1
1820
# Copyright 2018 - Vitrage team # # 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
5,598,332,246,566,623,000
36.916667
75
0.636813
false
4.482759
false
false
false
angloc/savutil
csv2json.py
1
3749
# Convert a CSV file into a JSON object with distribution import classifiedunicodevalue from classifiedunicodevalue import ClassifiedUnicodeValue from datautil import compressedValueSequence, compressedValues import unicodecsv from version import savutilName, savutilVersion def blankNone (x): if x is None: return...
gpl-2.0
4,556,128,825,799,290,000
23.503268
82
0.660443
false
2.987251
false
false
false
ideascube/ideascube
ideascube/management/commands/tags.py
1
7027
import sys from itertools import groupby from operator import itemgetter from django.utils.termcolors import colorize from taggit.models import Tag, TaggedItem from ideascube.management.base import BaseCommandWithSubcommands from ideascube.utils import sanitize_tag_name def log(text, **kwargs): sys.stdout.writ...
agpl-3.0
-4,190,601,327,684,026,000
38.477528
79
0.552156
false
4.22042
false
false
false
hanteng/country-groups
scripts/_construct_data_EU-Asia.py
1
4189
# -*- coding: utf-8 -*- #歧視無邊,回頭是岸。鍵起鍵落,情真情幻。 # Correction import os.path, glob import requests from lxml.html import fromstring, tostring, parse from io import StringIO, BytesIO import codecs import pandas as pd import json XML_encoding="utf-8" # Data source URL_ = "https://ec.europa.eu/europeaid/regions/asia-0_en"...
gpl-3.0
8,520,566,600,957,169,000
29.962687
140
0.633888
false
3.091654
false
false
false
eckardm/archivematica
src/dashboard/src/components/archival_storage/forms.py
1
1245
# This file is part of Archivematica. # # Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the ...
agpl-3.0
-1,230,661,360,885,088,800
37.90625
105
0.746185
false
3.705357
false
false
false
petropavel13/2photo-api
utils.py
1
3700
# -*- coding: utf-8 -*- from __future__ import unicode_literals # py2 from datetime import datetime from django.utils import timezone as tz from django.utils.timezone import is_naive, make_aware msk_tz = tz.pytz.timezone('Europe/Moscow') date_mapping = { 'января': '1', 'февраля': '2', 'марта': '3', ...
mit
-4,624,639,881,835,006,000
24.549296
95
0.617971
false
2.829953
false
false
false
shibanis1/spark-tk
python/sparktk/frame/ops/dot_product.py
1
3552
def dot_product(self, left_column_names,right_column_names,dot_product_column_name,default_left_values=None,default_right_values=None): """ Calculate dot product for each row in current frame. Parameters ---------- :param left_column_names: (List[str]) Names of columns used to create the left vect...
apache-2.0
-7,716,103,984,630,105,000
46.36
146
0.561937
false
3.62449
false
false
false
bjoernmainz/simple-contact-form
images/bin/rename_speech.py
1
1168
#!/usr/bin/python import os import glob import shutil def rename(files): new_files = [] for f in files: dirname = os.path.dirname(f) basename = os.path.basename(f) filetype = "" number = "" print("------------") print("Basename: %s") % basename if not basename.find("ogg") == -1: file_type = "og...
gpl-2.0
4,740,280,325,139,808,000
20.236364
69
0.605308
false
2.648526
false
false
false
openstack/designate
designate/rpc.py
1
8026
# Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
apache-2.0
-4,182,365,424,016,584,000
31.626016
79
0.661974
false
4.246561
false
false
false
Azure/azure-sdk-for-python
sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2020_06_01/aio/operations/_dedicated_host_groups_operations.py
1
21434
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
-3,765,282,343,104,155,000
48.273563
180
0.646776
false
4.315281
true
false
false
dazhaoniel/1kg-more
js1kg/urls.py
1
3537
from django.conf.urls import url, include from django.views.generic import TemplateView from django.contrib.auth.decorators import login_required from django.core.urlresolvers import reverse_lazy from rest_framework import routers from js1kg.corporate import views as corporate_views from js1kg.message import views as ...
apache-2.0
2,167,665,762,157,306,400
46.797297
125
0.704552
false
3.491609
false
false
false
jtaghiyar/single_cell_lims
elastidjango/celery.py
1
1033
""" Created on Oct 27, 2016 @author: Jafar Taghiyar (jtaghiyar@bccrc.ca) """ from __future__ import absolute_import import os #============================ # Celery imports #---------------------------- from celery import Celery #============================ # Django imports #---------------------------- # set the...
mit
4,008,024,806,926,323,000
25.512821
74
0.621491
false
3.742754
false
false
false
alecthomas/voluptuous
voluptuous/util.py
3
3150
import sys from voluptuous.error import LiteralInvalid, TypeInvalid, Invalid from voluptuous.schema_builder import Schema, default_factory, raises from voluptuous import validators __author__ = 'tusharmakkar08' def _fix_str(v): if sys.version_info[0] == 2 and isinstance(v, unicode): s = v else: ...
bsd-3-clause
5,798,480,879,912,180,000
18.444444
72
0.51619
false
3.469163
false
false
false
google/sample-sql-translator
sql_parser/func.py
1
3624
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
apache-2.0
3,897,709,106,737,068,000
27.992
78
0.586093
false
4.049162
false
false
false
FrodeSolheim/fs-uae
docs/scripts/update.py
1
17476
#!/usr/bin/env python3 import os import shutil import sys try: import markdown except ImportError: markdown = None if not os.path.exists("docs/scripts"): print("Run this script from the project root directory") sys.exit(1) last_main_option = "" last_main_option_added = False option_data = {} option...
gpl-2.0
-654,725,747,254,878,300
30.545126
90
0.463493
false
4.050997
true
false
false
openstack/python-senlinclient
doc/source/conf.py
1
2408
# 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 # distributed under ...
apache-2.0
1,665,903,313,054,131,200
33.4
79
0.69892
false
4.13036
false
false
false
gregplaysguitar/django-trolley
cart/views.py
1
17305
# -*- coding: utf-8 -*- import simplejson from django.http import HttpResponse, HttpResponseNotAllowed, HttpResponseRedirect from django.template import RequestContext from django.shortcuts import get_object_or_404 from django.conf import settings from django.template.loader import get_template from django.template.l...
bsd-3-clause
-3,236,693,349,976,724,500
35.976496
129
0.535452
false
4.767218
false
false
false
dhermes/project-euler
python/complete/no335.py
1
1809
#!/usr/bin/env python # Since M(2**n + 1) = 4**n + 3**n - 2**(n + 1) (empirically), # we find sum_{n=0}^{P} M(2**n + 1) is equal to # (4**(P + 1) - 1)/3 + (3**(P + 1) - 1)/2 + 2*(2**(P + 1) - 1) # = (4*(4**P) - 1)*(3**(-1)) + (3*(3**P) - 1)*(2**(-1)) + 4*(2**P) - 2 # (This is because (r - 1)*(r**P + ... + r + 1) = r**...
apache-2.0
-1,711,806,754,531,232,000
29.15
74
0.512438
false
2.614162
false
false
false
dionhaefner/veros
veros/core/streamfunction/island.py
1
1983
import numpy import scipy.ndimage from ... import veros_method, runtime_settings as rs from .. import utilities @veros_method def isleperim(vs, kmt, verbose=False): utilities.enforce_boundaries(vs, kmt) if rs.backend == 'bohrium': kmt = kmt.copy2numpy() structure = numpy.ones((3, 3)) # merge d...
mit
4,557,765,566,113,674,000
32.610169
81
0.646495
false
3.547406
false
false
false
AlessandroMinali/pyIRCbot
pyIRCbot.py
1
2803
#Alessandro Minali 2014 # www.alessandrom.me #questions/suggestions/feedback to: alessandro.minali@gmail.com ##ONLY CHANGE VALUES THAT HAVE COMMENTS BESIDE THEM import socket import commands import moderation import time class PyIRCBot(): def __init__(self): HOST = "irc.twitch.tv" P...
mit
-26,257,662,847,638,284
30.593023
95
0.475919
false
3.499376
false
false
false
yuikns/pattern-counter
data/dataset/ER_middle/generate_graph.py
1
1801
import random as ran import networkx as nx import Queue import matplotlib.pyplot as plt n=150 # number of nodes p=0.1 # edge selection probability G=nx.erdos_renyi_graph(n,p) print "#nodes = ", G.number_of_nodes() print "#edges = ", G.number_of_edges() L=1000 # number of logs influence_probability = 0.35 # act...
mit
-1,865,508,281,380,050,700
25.101449
82
0.609661
false
2.391766
false
false
false
astropy/photutils
photutils/detection/peakfinder.py
1
7745
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module provides tools for finding local peaks in an astronomical image. """ import warnings from astropy.table import Table import numpy as np from ..utils.exceptions import NoDetectionsWarning __all__ = ['find_peaks'] def find_peaks(data, t...
bsd-3-clause
3,252,517,488,236,389,400
38.116162
77
0.634732
false
3.973833
false
false
false
ericpre/hyperspy
hyperspy/io_plugins/hspy.py
1
31796
# -*- coding: utf-8 -*- # Copyright 2007-2021 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
-2,065,360,871,214,329,600
38.645885
82
0.541169
false
4.211391
false
false
false
StartTheShift/thunderdome-logging
setup.py
1
1329
import sys from setuptools import setup, find_packages #next time: #python setup.py register #python setup.py sdist upload version = open('thunderdome_logging/VERSION', 'r').readline().strip() long_desc = """ Extension for thunderdome which allows error logging in the graph. """ setup( name='thunderdome-logging...
mit
7,834,285,208,966,804,000
33.076923
141
0.669676
false
3.797143
false
false
false
cubicdaiya/python-q4m
python_q4m/__init__.py
1
1380
# -*- coding: utf-8 -*- import python_q4m __author__ = "Tatsuhiko Kubo (cubicdaiya@gmail.com)" __version__ = "0.0.6" __license__ = "GPL2" __doc__ = """ This module is simple Q4M operation wrapper developed by pixiv Inc. for asynchronous upload system Simple example of usage is followings >>> from python_q4m....
gpl-2.0
372,192,313,206,318,800
30.363636
98
0.465942
false
3.424318
false
false
false
semeniuta/FlexVi
flexvi/daq/aravisgrabber.py
1
1399
from enum import Enum from gi.repository import Aravis as ar import aravis as pyar class AravisEnv: def __init__(self): ''' Get device IDs and initialize Camera objects ''' ar.update_device_list() self.device_ids = pyar.get_device_ids() self.cameras = {i: pyar.Camera(i) for i in sel...
gpl-2.0
-4,096,126,815,948,293,000
35.815789
89
0.643317
false
3.770889
false
false
false
eliostvs/tomate-exec-plugin
setup.py
1
1335
#!/bin/env python import os from setuptools import setup def find_xdg_data_files(syspath, relativepath, pkgname, data_files=[]): for (dirname, _, filenames) in os.walk(relativepath): if filenames: syspath = syspath.format(pkgname=pkgname) subpath = dirname.split(relativepath)[1] ...
gpl-3.0
-5,612,258,948,244,956,000
26.244898
94
0.64794
false
3.379747
false
false
false
larsbutler/swift
test/unit/obj/test_expirer.py
1
28044
# Copyright (c) 2011 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
apache-2.0
5,540,752,920,553,979,000
34.861893
78
0.54525
false
4.07202
true
false
false
TheLady/Lexos
processors/prepare/cutter.py
1
14378
import re from Queue import Queue from math import ceil from types import * WHITESPACE = ['\n', '\t', ' ', '', u'\u3000'] # from helpers.constants import WHITESPACE def splitKeepWhitespace(string): """ Splits the string on whitespace, while keeping the tokens on which the string was split. Args: ...
mit
5,435,624,853,086,091,000
31.90389
146
0.648839
false
4.185735
false
false
false
drabastomek/practicalDataAnalysisCookbook
Codes/Chapter06/regression_randomForest.py
1
2303
# this is needed to load helper from the parent folder import sys sys.path.append('..') # the rest of the imports import helper as hlp import pandas as pd import numpy as np import sklearn.ensemble as en import sklearn.cross_validation as cv @hlp.timeit def regression_rf(x,y): ''' Estimate a random forest...
gpl-2.0
5,688,512,074,880,824,000
24.318681
62
0.671298
false
3.194175
false
false
false
airekans/Snippet
python/numpy_scipy_learning/spline.py
1
1310
import numpy as np import scipy as sp from scipy.interpolate import UnivariateSpline import matplotlib.pyplot as plt x = [1, 2, 3, 4, 5, 6, 7] y = [1, 4, 9, 16, 26, 30, 51] # Test Spline trajectory = np.array([x, y], dtype=float) print trajectory plt.plot(trajectory[0], trajectory[1]) plt.show() s = sp.interpolate.U...
unlicense
-259,108,058,511,957,630
21.20339
70
0.726718
false
2.723493
false
true
false
kenshinx/rps
test/http_client.py
1
4579
#! /usr/bin/env python import re import socket import optparse HTTP_PROXY_HOST = "dev1" HTTP_PROXY_PORT = 8889 HTTP_PROXY_HOST = "localhost" HTTP_PROXY_PORT = 9891 HTTP_PROXY_UNAME = "rps" HTTP_PROXY_PASSWD = "secret" class HTTPTunnelPorxy(object): pattern = re.compile("^HTTP\/1\.\d ([0-9]{3}) .*") def __...
mit
-7,370,360,084,969,663,000
24.581006
74
0.505569
false
3.831799
false
false
false
calee0219/Course
SDN/Lab1/FatTreeTopoHardCode.py
1
4467
#!/usr/bin/env python from mininet.topo import Topo from mininet import net from mininet.net import Mininet POD_NUM = 4 class FatTreeTopoHardCode(Topo): """ A Simple FatTree Topo """ def __init__(self): # Initialize topology Topo.__init__(self) # Create pod and core #...
mit
-4,874,537,547,002,850,000
30.457746
52
0.544437
false
2.418517
false
false
false
living180/vex
vex/make.py
1
2367
import os import sys import distutils.spawn from vex.run import run from vex import exceptions PYDOC_SCRIPT = """#!/usr/bin/env python from pydoc import cli cli() """.encode('ascii') PYDOC_BATCH = """ @python -m pydoc %* """.encode('ascii') def handle_make(environ, options, make_path): if os.path.exists(make_...
mit
-1,349,267,931,707,901,400
32.814286
72
0.600338
false
3.710031
false
false
false
census-instrumentation/opencensus-python
context/opencensus-context/opencensus/common/runtime_context/__init__.py
1
5207
# Copyright 2019, OpenCensus 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 applicable law or agreed to in w...
apache-2.0
6,168,054,212,656,618,000
28.418079
78
0.580757
false
4.484927
false
false
false
google-research/tensor2robot
preprocessors/distortion.py
1
4670
# coding=utf-8 # Copyright 2021 The Tensor2Robot 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 applicable ...
apache-2.0
1,685,826,182,705,913,300
36.96748
80
0.66788
false
3.988044
false
false
false
huangminghuang/ansible-docker-connection
connection_plugins/docker.py
1
3787
# Connection plugin for configuring docker containers # Author: Lorin Hochstein # # Based on the chroot connection plugin by Maykel Moya import os import subprocess import time from ansible import errors from ansible.callbacks import vvv class Connection(object): def __init__(self, runner, host, port, *args, **k...
gpl-3.0
7,907,822,090,526,358,000
37.642857
79
0.567468
false
4.098485
false
false
false
JeroenBosmans/nabu
nabu/processing/text_reader.py
1
3606
'''@file textreader.py contains the Textreader class''' import os import numpy as np class TextReader(object): '''reads text from disk''' def __init__(self, textfile, max_length, coder, base_pos=0, end_pos=None): '''TextReader constructor Args: textfile: the path...
mit
-8,119,472,119,550,117,000
27.619048
79
0.567388
false
4.222482
false
false
false
zenieldanaku/pygpj
main.py
1
1847
import func.core.config as c import func.core.intro as intro from func.core.lang import t from func.core.viz import subselector from func.core.prsnj import Pj from func.core.export import imprimir_clases import os def cargar_archivo(prompt, carpeta): from func.data.setup import data as s ars, nom = [...
mit
-6,750,891,117,660,819,000
32.166667
95
0.532249
false
3.300537
false
false
false
fzimmermann89/pyload
module/plugins/hoster/LoadTo.py
1
2129
# -*- coding: utf-8 -*- # # Test links: # http://www.load.to/JWydcofUY6/random.bin # http://www.load.to/oeSmrfkXE/random100.bin import re from module.plugins.captcha.SolveMedia import SolveMedia from module.plugins.internal.SimpleHoster import SimpleHoster, create_getInfo class LoadTo(SimpleHoster): __name__ ...
gpl-3.0
2,512,844,144,708,544,500
29.855072
85
0.542508
false
3.379365
false
false
false
SUNET/eduid-webapp
src/eduid_webapp/idp/tou_action.py
1
2992
# # Copyright (c) 2015 NORDUnet A/S # All rights reserved. # # Redistribution and use in source and binary forms, with or # without modification, are permitted provided that the following # conditions are met: # # 1. Redistributions of source code must retain the above copyright # notice, this list of ...
bsd-3-clause
7,871,357,113,988,800,000
41.742857
119
0.739973
false
4.087432
false
false
false
robin-lai/DensityPeakCluster
plot.py
1
1965
#!/usr/bin/env python # -*- coding: UTF-8 -*- import logging import numpy as np from cluster import * from sklearn import manifold from plot_utils import * def plot_rho_delta(rho, delta): ''' Plot scatter diagram for rho-delta points Args: rho : rho list delta : delta list ''' logger.info("PLOT: rho-delta...
mit
-2,970,879,158,770,166,000
34.107143
110
0.679389
false
2.779349
false
false
false
samantp/gensimPy3
gensim/models/lsi_worker.py
1
3221
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ USAGE: %(program)s Worker ("slave") process used in computing distributed LSI. Run this script \ on every node in your cluster....
gpl-3.0
-6,709,509,564,474,837,000
29.971154
123
0.656007
false
3.710829
false
false
false
gilliM/MFQ
ModisFromQgis/mypymodis/convertmodis.py
1
9852
#!/usr/bin/env python # class to convert/process modis data # # (c) Copyright Luca Delucchi 2010 # Authors: Luca Delucchi # Email: luca dot delucchi at iasma dot it # ################################################################## # # This MODIS Python class is licensed under the terms of GNU GPL 2. # This pro...
gpl-2.0
3,430,796,322,326,660,000
41.649351
103
0.593991
false
3.830482
false
false
false
MetricsGrimoire/sortinghat
tests/test_matcher.py
1
11000
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2014-2017 Bitergia # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any la...
gpl-3.0
5,165,033,627,049,388,000
38.282143
95
0.582508
false
4.366415
true
false
false
lexman/tuttle
tuttle/process.py
1
4297
# -*- coding: utf8 -*- from time import time class Process: """ Class wrapping a process. A process has some input resources, some output resources, some code that produces outputs from inputs, a processor that handle the language specificities """ def __init__(self, processor, filename, line_num):...
mit
1,463,314,768,997,302,000
27.091503
118
0.593903
false
4.344793
false
false
false
mennanov/django-blueprint
project_name/dashboard.py
1
3076
""" This file was generated with the customdashboard management command and contains the class for the main dashboard. To activate your index dashboard add the following to your settings.py:: GRAPPELLI_INDEX_DASHBOARD = '{{ project_name }}.dashboard.CustomIndexDashboard' """ from django.utils.translation import u...
gpl-2.0
3,621,246,021,172,486,700
30.71134
83
0.479844
false
5.009772
false
false
false
hivebio/ministat-1
scripts/avg.py
1
1025
#!/usr/bin/env python # license removed for brevity import rospy from std_msgs.msg import Float32, Int32 sumdata = 0.0 count = 0 def callback(data): global count, sumdata sumdata += data.data count += 1 def listener(): global count, sumdata pub = rospy.Publisher('avg', Float32, queue_size=10)...
bsd-2-clause
-5,575,920,084,302,954,000
25.973684
72
0.642927
false
3.768382
false
false
false