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
digitalocean/netbox
netbox/extras/migrations/0051_migrate_customfields.py
1
3951
from django.db import migrations from extras.choices import CustomFieldTypeChoices def deserialize_value(field, value): """ Convert serialized values to JSON equivalents. """ if field.type in (CustomFieldTypeChoices.TYPE_INTEGER): return int(value) if field.type == CustomFieldTypeChoices....
apache-2.0
1,010,862,674,792,506,200
34.918182
109
0.644394
false
3.986882
false
false
false
ZTH1970/alcide
alcide/utils.py
1
2580
from django.contrib.auth.models import Group from django.conf import settings from datetime import timedelta, datetime from .middleware.request import get_request __EPOCH = datetime(day=5,month=1,year=1970) def __date_to_datetime(date): return datetime(date.year, date.month, date.day) def weeks_since_epoch(dat...
agpl-3.0
1,086,971,403,495,948,300
27.043478
88
0.597287
false
3.543956
false
false
false
mlperf/training_results_v0.7
Google/benchmarks/dlrm/implementations/dlrm-research-TF-tpu-v4-512/dataloader.py
1
9756
# Lint as: python3 # Copyright 2020 Google. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
apache-2.0
6,009,022,825,742,480,000
36.961089
80
0.614494
false
3.647103
true
false
false
raulperula/python_tutorials
tutorial-pyqt/src/example06.py
1
2390
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'example6.ui' # # Created: Sun Jan 11 17:51:02 2015 # by: PyQt4 UI code generator 4.9.1 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtCore.QString.fromUtf8 except Attrib...
gpl-3.0
8,810,021,368,014,348,000
47.77551
128
0.7159
false
3.898858
false
false
false
ywangd/stash
system/shui/pythonista_ui.py
1
36021
# coding: utf-8 from time import time import six import ui from objc_util import on_main_thread, ObjCInstanceMethod, UIColor, create_objc_class, ObjCClass, ObjCInstance, ns from ..shcommon import ON_IPAD, ON_IOS_8, sh_delay from ..shcommon import K_CC, K_CD, K_HUP, K_HDN, K_CU, K_TAB, K_HIST, K_CZ, K_KB, CTRL_KEY_FL...
mit
1,184,869,620,436,011,500
36.718325
118
0.558313
false
3.693704
false
false
false
Giswater/giswater_qgis_plugin
map_tools/draw_profiles.py
1
77823
""" /*************************************************************************** * * * 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...
gpl-3.0
-8,684,525,205,711,037,000
40.17672
156
0.5526
false
3.595592
false
false
false
sandwich-share/sandwich
sandwich/indexer.py
1
3005
import urllib import socket import sys import os import config import sqlite3 import json db = "index.db" table = "local" # crawl a directory and find all files and folders def find_files(): index = [] for path, dirs, files in os.walk(config.shared_directory): for f in files: if not f.star...
bsd-2-clause
436,386,678,555,522,600
30.631579
178
0.518802
false
3.803797
false
false
false
telminov/arduino-battle-server
control_server/project/urls.py
1
1240
"""project URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
mit
-9,025,708,686,951,118,000
40.366667
105
0.716129
false
3.604651
false
false
false
mohamedhagag/community-addons
hr_attendance_analysis/report/calendar_report.py
1
3652
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2011-15 Agile Business Group sagl (<http://www.agilebg.com>) # Copyright (C) 2011 Domsense srl (<http://www.domsense.com>) # # This program is free software: you can redistribute it and/or m...
agpl-3.0
2,224,134,006,936,586,200
35.888889
79
0.547371
false
3.952381
false
false
false
messense/wechatpy
wechatpy/pay/api/coupon.py
1
2788
# -*- coding: utf-8 -*- import random from datetime import datetime from wechatpy.pay.base import BaseWeChatPayAPI class WeChatCoupon(BaseWeChatPayAPI): def send(self, user_id, stock_id, op_user_id=None, device_info=None, out_trade_no=None): """ 发放代金券 :param user_id: 用户在公众...
mit
3,161,162,863,871,766,000
28.585366
76
0.504946
false
2.695556
false
false
false
wirefish/amber
amber/script.py
1
2128
import marshal import builtins import random from tornado.ioloop import IOLoop from . import events def deny(): """ A function to be called from within a can_* event handler if the receiver denies the proposed action. """ raise events.ActionDenied() def stop(): """ A function that can be...
bsd-3-clause
-3,450,994,995,555,589,600
22.910112
78
0.607143
false
3.890311
false
false
false
caktus/django-sticky-uploads
example/example/settings.py
1
5351
# Django settings for example project. import os PROJECT_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) DEBUG = True ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postg...
bsd-3-clause
6,936,067,417,082,235,000
31.23494
109
0.675388
false
3.657553
false
false
false
AutorestCI/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2016_12_01/models/security_rule.py
1
5308
# 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 ...
mit
-8,997,662,295,681,792,000
49.075472
245
0.654295
false
4.189424
false
false
false
pvizeli/hassio
hassio/__main__.py
1
1158
"""Main file for HassIO.""" import asyncio from concurrent.futures import ThreadPoolExecutor import logging import sys import hassio.bootstrap as bootstrap import hassio.core as core _LOGGER = logging.getLogger(__name__) # pylint: disable=invalid-name if __name__ == "__main__": bootstrap.initialize_logging() ...
bsd-3-clause
461,431,713,023,787,140
24.733333
66
0.702073
false
3.530488
false
false
false
GregJohnStewart/NumberGuesser
numberGuesser.py
1
7208
#!/usr/bin/python """ NumberGuesser Guesses your number! Author: Greg Stewart Copyright 2014 Greg Stewart Start: 7/15/14 Tries to guess your number, interacts with you via the Raspberry pi's 16x2 CharLCDPlate It uses a relatively simple algorithm to guess numbers: Step 1: Find a number that is larger tha...
mit
-2,430,133,786,668,103,000
22.946844
126
0.691593
false
3.002082
false
false
false
meawoppl/GA144Tools
FA18A_util.py
1
4881
from bitUtils import * from bitarray import bitarray import FA18A_functions # Semantic Sugar def opNeedsAddress(op): return isinstance(op, (jumpOp, nextOp, ifOp, minusIfOp)) def loadNewWordAfterOp(op): return isinstance(op, (returnOp, executeOp, jumpOp, callOp, nextOp, ifOp, minusIfOp)) # Add the 5 bit of a...
mit
8,766,188,418,203,417,000
32.895833
126
0.654784
false
3.526734
false
false
false
google/tink
testing/cross_language/aead_test.py
1
7668
# 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 agreed to in writing, ...
apache-2.0
-8,532,096,486,310,047,000
41.131868
79
0.71205
false
3.433945
true
false
false
GitExl/WhackEd4
src/whacked4/dehacked/table.py
1
6880
#!/usr/bin/env python #coding=utf8 import copy import math import re from dataclasses import dataclass from typing import Dict, Optional, Set @dataclass class ThingFlag: key: str field: str name: Optional[str] index: Optional[int] alias: Optional[str] description: Optional[str] @staticme...
bsd-2-clause
5,604,756,344,893,877,000
28.401709
117
0.542006
false
4.169697
false
false
false
1337/yesterday-i-learned
leetcode/681m.py
1
1570
def nextClosestTime(input_time): def get_digits(time): return ( int(time[0]), int(time[1]), int(time[3]), int(time[4])) def is_valid_time(time): hour = time[0] * 10 + time[1] if hour > 23: return False minute = time[2] ...
gpl-3.0
3,323,717,155,073,554,400
33.888889
80
0.498726
false
3.544018
false
false
false
openSUSE/vdsm
vdsm/hooks.py
1
5326
# # Copyright 2010-2011 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed ...
gpl-2.0
-4,334,075,190,277,434,400
31.084337
84
0.63988
false
3.247561
false
false
false
afrendeiro/pipelines
lib/peaks_analysis.py
1
9185
#!/usr/env python ############################################################################################# # # This code produces plots of average signal and heatmaps around motifs under peaks. # Also produces clusters of peaks, and outputs heatmap # ###############################################################...
gpl-2.0
-7,948,042,608,009,070,000
37.755274
210
0.589439
false
3.724655
false
false
false
KodiColdkeys/coldkeys-addons
repository/plugin.video.mosthaunted/default.py
1
5874
# -*- coding: utf-8 -*- #------------------------------------------------------------ # Most Haunted Addon by coldkeys #------------------------------------------------------------ # License: GPL (http://www.gnu.org/licenses/gpl-3.0.html) # Based on code from youtube addon # # Author: coldkeys #------------------------...
gpl-2.0
2,938,105,776,240,216,000
33.757396
94
0.621893
false
3.209836
false
false
false
matejc/searx
searx/engines/swisscows.py
1
3750
""" Swisscows (Web, Images) @website https://swisscows.ch @provide-api no @using-api no @results HTML (using search portal) @stable no (HTML can change) @parse url, title, content """ from json import loads from urllib import urlencode, unquote import re from lxml.html import fromstring ...
agpl-3.0
-4,480,584,742,850,424,000
29
97
0.5656
false
3.914405
false
false
false
joaander/hoomd-blue
hoomd/data/local_access_cpu.py
1
2996
from hoomd.data.local_access import ( ParticleLocalAccessBase, BondLocalAccessBase, AngleLocalAccessBase, DihedralLocalAccessBase, ImproperLocalAccessBase, ConstraintLocalAccessBase, PairLocalAccessBase, _LocalSnapshot) from hoomd.data.array import HOOMDArray from hoomd import _hoomd class Par...
bsd-3-clause
-2,310,734,870,337,004,000
36.924051
80
0.741322
false
3.806861
false
false
false
everlof/RestKit-n-Django-Sample
Project_Django/cite/storage.py
1
6739
# This file has been shamelessly copied (MIT licence) from # https://bitbucket.org/akoha/django-randomfilenamestorage # Conversion to Python 3 by Alexander Nilsson from errno import EEXIST import ntpath import os import posixpath import random import string from warnings import warn from django.conf import settings f...
mit
-733,618,468,414,824,200
42.477419
79
0.520255
false
4.962445
false
false
false
rschwiebert/RingApp
ringapp/migrations/0032_suggestion.py
1
1328
# -*- coding: utf-8 -*- # Generated by Django 1.9.4 on 2016-04-07 19:52 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependen...
mit
-3,963,655,787,127,243,000
43.266667
162
0.606175
false
3.794286
false
false
false
damomeen/nsi_connections
src/attribute_utils.py
1
1210
from time_utils import time_constrains def prepare_nsi_attributes(connAttributes): params = {} params['gid'] = "NSI-REST service" params['desc'] = connAttributes['description'] params['src'] = "%(src_domain)s:%(src_port)s" % connAttributes params['dst'] = "%(dst_domain)s:%(dst_port)s" % connAttr...
apache-2.0
-1,491,417,555,680,052,000
34.617647
82
0.664463
false
3.890675
false
false
false
Islandman93/reinforcepy
reinforcepy/networks/dqn/theanolasagne/dqn_inits.py
1
4658
import lasagne def create_NIPS(network_parms): validate_parms(network_parms) conv = get_lasagne_conv_layer() # setup network layout l_in = lasagne.layers.InputLayer([None] + network_parms.get('input_shape')) l_hid1 = conv(l_in, 16, (8, 8), stride=network_parms.get('stride')[0]) l_hid2 = con...
gpl-3.0
1,424,664,429,930,978,600
39.155172
126
0.604766
false
3.034528
false
false
false
iamaris/CDFCodes
pythia/SimulationMods/python/analyze.py
1
2324
# # This is a primitive script to parse the output of cdfIntegrate, and # to generate a set of files (one for each track) that contains some of # the integration results. # # It is intended as an example from which more useful scripts can be # generated. # import sys import re import Point from IntegrationLeg import In...
apache-2.0
-1,385,004,450,452,219,100
30.405405
84
0.609725
false
3.625585
false
false
false
sellberg/SACLA2016B8055
scripts/07_angular_avg_std.py
1
5748
#!/home/software/SACLA_tool/bin/python2.7 import numpy as np import h5py import matplotlib import matplotlib.pyplot as plt import argparse import time import sys from argparse import ArgumentParser # -- parse parser = ArgumentParser() parser.add_argument("-r", "--run", type=int, dest="run", required=True, help="fir...
bsd-2-clause
-8,606,726,048,632,943,000
29.252632
173
0.6738
false
2.411074
false
false
false
emsrc/pycornetto
lib/cornetto/cornet.py
1
36978
# -*- coding: utf-8 -*- # Copyright (C) 2008-2013 by # Erwin Marsi and Tilburg University # This file is part of the Pycornetto package. # Pycornetto 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...
gpl-3.0
4,756,977,569,728,525,000
34.93586
101
0.521526
false
3.986846
false
false
false
bwghughes/bankloader
bankloader/bankloader.py
1
1182
# -*- coding: utf-8 -*- import hashlib from decimal import Decimal, InvalidOperation from dateutil.parser import parse class InvalidTransaction(Exception): pass class RawTransaction(object): date = None description = None amount = None checksum = None """docstring for Transaction""" def...
bsd-3-clause
-8,712,272,389,028,872,000
29.307692
78
0.567682
false
4.546154
false
false
false
arkanister/minitickets
lib/utils/views/email/base.py
1
3014
# -*- coding: utf-8 -*- from django.core.exceptions import ImproperlyConfigured from django.http.response import HttpResponseRedirect from django.template import loader from django.utils.translation import ugettext as _ from .utils import HtmlEmailSender from ..base import SmartView as View class EmailTemplateRender...
apache-2.0
3,648,041,289,803,767,300
35.313253
90
0.627405
false
4.227209
false
false
false
ingresso-group/pyticketswitch
pyticketswitch/utils.py
1
6757
import functools import warnings from datetime import date, datetime from dateutil import parser from decimal import Decimal from pyticketswitch.exceptions import InvalidParametersError def date_range_str(start_date, end_date): """Convert a set of dates to string readable by the API Args: start_date...
mit
-1,653,030,869,344,057,600
25.291829
84
0.613142
false
3.974706
false
false
false
vandersonmota/t_dict
t_dict/t_dict.py
1
1194
# -*- coding: utf-8 -*- from copy import deepcopy from jsonpointer import resolve_pointer, set_pointer #py2-py3 try: from collections import MutableMapping except ImportError: from collections.abc import MutableMapping class TDict(MutableMapping): def __init__(self, d=None): if d is None: ...
bsd-3-clause
6,149,249,169,215,890,000
22.411765
59
0.554439
false
4.006711
false
false
false
davesque/django-rest-framework-simplejwt
rest_framework_simplejwt/serializers.py
1
4306
from django.contrib.auth import authenticate from django.utils.translation import gettext_lazy as _ from rest_framework import exceptions, serializers from .settings import api_settings from .state import User from .tokens import RefreshToken, SlidingToken, UntypedToken class PasswordField(serializers.CharField): ...
mit
2,090,570,235,381,383,000
28.902778
109
0.634231
false
4.476091
false
false
false
drvinceknight/Nashpy
tests/unit/test_is_best_response.py
1
1600
""" Tests for the best response check """ import numpy as np from nashpy.utils.is_best_response import ( is_best_response, ) def test_is_best_response_example_1(): """ This tests an example from the discussion documentation. The second assert checks that the column player strategy is as expected. ...
mit
7,907,187,553,740,622,000
33.042553
78
0.6125
false
2.862254
true
false
false
fpiotrow/caldav-tester-packaging
cdtdiagnose.py
1
4722
#!/usr/bin/env python # ## # Copyright (c) 2013-2015 Apple Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
-979,777,726,195,420,800
32.971223
96
0.642524
false
3.596344
false
false
false
ikarus23/MifareClassicTool
tools/dump-file-converter/mfd2eml.py
1
1516
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # ######################################################################## # # Copyright 2015 Gerhard Klostermeier # # 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 Sof...
gpl-3.0
8,973,126,354,513,189,000
28.72549
81
0.604881
false
3.74321
false
false
false
OrangeTux/python-snake
snake/field.py
1
1314
class Field: """ A field keeps track of all positions on a field and the content of these posisions. :param length: Length of the field. :param height: The height of the field. """ def __init__(self, width=10, height=10): self.width = 10 self.height = 10 self.field =...
mit
5,609,683,131,536,032,000
25.816327
74
0.560122
false
4.030675
false
false
false
hastexo/edx-platform
common/lib/xmodule/xmodule/seq_module.py
1
23976
""" xModule implementation of a learning sequence """ # pylint: disable=abstract-method import collections import json import logging from datetime import datetime from lxml import etree from pkg_resources import resource_string from pytz import UTC from six import text_type from web_fragments.fragment import Fragmen...
agpl-3.0
7,013,811,450,100,319,000
36.75748
117
0.611778
false
4.286787
false
false
false
h2oai/h2o-dev
h2o-py/tests/testdir_algos/deeplearning/pyunit_cv_cars_deeplearning_medium.py
1
4554
from __future__ import print_function from builtins import range import sys, os sys.path.insert(1, os.path.join("..","..","..")) import h2o from tests import pyunit_utils import random from h2o.estimators.deeplearning import H2ODeepLearningEstimator def cv_cars_dl(): # read in the dataset and construct training set...
apache-2.0
-6,992,844,085,351,824,000
38.947368
113
0.713878
false
3.232079
false
false
false
SaintAttila/attila
attila/plugins.py
1
8427
""" Infrastructure for dealing with plugins. """ import pkg_resources import warnings from collections.abc import Mapping from .exceptions import PluginExistsError, PluginNotFoundError, InvalidPluginError, verify_type __author__ = 'Aaron Hosford' __all__ = [ 'PluginGroup', 'CONFIG_LOADERS', 'URL_SCHE...
mit
-5,618,134,764,142,204,000
32.3083
105
0.647324
false
4.359545
true
false
false
tkemmer/ball
data/Amber/converter/parmConverter.py
2
1757
#!/usr/bin/python import sys from amberparser import * def printUsage(): print "\nUsage: ./parmConvert.py -i filename [-m file1 .. fileN] [-o output_file]\n" print "paramConvert accepts the following parameters:" print "\t--help Show this help and exit." print "\t-p,--parm filename ...
lgpl-2.1
4,100,769,552,055,874,000
20.168675
85
0.611838
false
2.732504
false
false
false
sam81/pysoundanalyser
pysoundanalyser/win_waveform_plot.py
1
6198
# -*- coding: utf-8 -*- # Copyright (C) 2010-2017 Samuele Carcagno <sam.carcagno@gmail.com> # This file is part of pysoundanalyser # pysoundanalyser 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 Foundatio...
gpl-3.0
5,850,011,686,210,301,000
51.084034
125
0.729106
false
3.793146
false
false
false
claudemuller/masfir
dirmuncher.py
1
1217
#!/usr/bin/env python # -*- Coding: utf-8 -*- import os import enchant class Dirmuncher: delimeters = ['.', ' '] def __init__(self, directory): self.directory = directory self.dictionary = enchant.Dict("en_US") def getFiles(self): result = {} for dirname, dirnames, filen...
mit
1,979,910,930,079,346,200
22.862745
68
0.564503
false
4.211073
false
false
false
whtsky/WeRoBot
werobot/logger.py
1
2894
# -*- coding:utf-8 -*- import six import sys import time import logging try: import curses assert curses except ImportError: curses = None logger = logging.getLogger("WeRoBot") def enable_pretty_logging(logger, level='info'): """ 按照配置开启 log 的格式化优化。 :param logger: 配置的 logger 对象 :param ...
mit
-362,991,311,726,822,200
30.955056
75
0.512307
false
3.802139
false
false
false
3dfxsoftware/cbss-addons
account_invoice_global_discount/wizard/discount_wizard.py
1
1981
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
gpl-2.0
-8,941,316,200,682,872,000
39.428571
145
0.610298
false
4.042857
false
false
false
bollu/polymage
sandbox/apps/python/img_proc/campipe/polymage_campipe.py
1
11582
from __init__ import * import sys import subprocess import numpy as np from fractions import Fraction sys.path.insert(0, ROOT) from compiler import * from constructs import * def camera_pipe(pipe_data): # Pipeline Variables x = Variable(Int, "x") y = Variable(Int, "y") c = Variable(Int, "c") v ...
apache-2.0
-480,251,529,535,593,900
37.098684
83
0.518218
false
2.586423
false
false
false
Morphux/installer
pkgs/iproute_p2/iproute_p2.py
1
2697
################################### LICENSE #################################### # Copyright 2016 Morphux # # # # Licensed under the Apache License, Version 2.0 (the "License"); ...
apache-2.0
-2,530,462,135,269,676,000
43.213115
90
0.448276
false
4.11128
false
false
false
poojavade/Genomics_Docker
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/khmer-1.1-py2.7-linux-x86_64.egg/EGG-INFO/scripts/extract-paired-reads.py
1
4428
#!/usr/bin/python2.7 # # This script is part of khmer, http://github.com/ged-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2014. It is licensed under # the three-clause BSD license; see doc/LICENSE.txt. # Contact: khmer-project@idyll.org # # pylint: disable=invalid-name,missing-docstring """ Take a...
apache-2.0
-8,108,609,103,664,629,000
28.918919
79
0.608853
false
3.517077
false
false
false
mic4ael/indico
indico/modules/events/views.py
1
12820
# This file is part of Indico. # Copyright (C) 2002 - 2020 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from __future__ import print_function, unicode_literals import posixpath from flask import current_app, ...
mit
-9,060,796,817,758,610,000
41.171053
119
0.61092
false
3.756226
false
false
false
Alexey-T/CudaText
app/cudatext.app/Contents/Resources/py/cuda_options_editor/cd_opts_dlg.py
1
113409
''' Plugin for CudaText editor Authors: Andrey Kvichansky (kvichans on github.com) Version: '2.3.15 2021-04-02' ToDo: (see end of file) ''' import re, os, sys, json, collections, itertools, webbrowser, tempfile, html, pickle, time, datetime from itertools import * from pathlib import PurePath as ...
mpl-2.0
6,833,770,248,211,527,000
47.691151
141
0.420363
false
3.207198
false
false
false
retr0h/ansible
test/TestPlayBook.py
1
13823
# tests are fairly 'live' (but safe to run) # setup authorized_keys for logged in user such # that the user can log in as themselves before running tests import unittest import getpass import ansible.playbook import ansible.utils as utils import ansible.callbacks as ans_callbacks import os import shutil import ansibl...
gpl-3.0
-3,527,965,832,506,031,000
32.879902
90
0.59987
false
3.874159
true
false
false
HazyResearch/snorkel
snorkel/contrib/parser/spacy.py
1
3108
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from builtins import * from collections import defaultdict from snorkel.models import construct_stable_id from snorkel.parser.parser import Parser, ParserConnection cla...
apache-2.0
-7,778,223,192,332,906,000
32.782609
80
0.563707
false
4.177419
false
false
false
webgeodatavore/pyqgis-samples
core/qgis-sample-QgsVectorLayer.py
1
1183
# coding: utf-8 import urlparse from qgis.core import QgsVectorLayer from qgis.utils import iface layer = iface.activeLayer() if layer.providerType() == 'virtual': url_params = layer.source()[1:] # To remove the ? at the beginning params_dict = urlparse.parse_qsl(url_params) params = dict(params_dict) ...
gpl-2.0
-3,936,529,623,969,429,500
41.285714
96
0.688081
false
2.588621
false
true
false
TimothyZhang/structer
structerui/hotkey.py
1
3301
# Copyright 2014 Timothy Zhang(zt@live.cn). # # This file is part of Structer. # # Structer 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 vers...
gpl-3.0
-6,358,792,627,314,684,000
24.789063
74
0.574977
false
2.921239
false
false
false
TightSquad/HABIP
gui/axlisten_logger.py
1
5466
#!/usr/bin/env python import axreader import common import groundComms import time import logging if __name__ == "__main__": LOG_IN_PATH = "/home/spex/axlisten.log" LOG_DATA_PATH = "/home/spex/habip_data.log" LOG_CMDACK_PATH = "/home/spex/habip_ack.log" AX_INTERFACES = ["sm0"] AX_SOURCES = ["W2RI...
gpl-3.0
447,616,459,182,597,100
31.343195
128
0.502561
false
3.574886
false
false
false
huggingface/transformers
tests/test_modeling_ibert.py
1
30207
# coding=utf-8 # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
apache-2.0
4,290,449,463,490,228,700
42.400862
117
0.612639
false
3.486496
true
false
false
pypingou/pagure
pagure/api/issue.py
1
47403
# -*- coding: utf-8 -*- """ (c) 2015-2017 - Copyright Red Hat Inc Authors: Pierre-Yves Chibon <pingou@pingoured.fr> """ from __future__ import print_function, unicode_literals, absolute_import import flask import datetime import logging import arrow from sqlalchemy.exc import SQLAlchemyError import pagure.e...
gpl-2.0
-7,478,782,353,708,977,000
32.358902
91
0.477354
false
4.079783
false
false
false
mpasternak/django-multiseek
test_project/test_app/tests.py
1
25528
# -*- encoding: utf-8 -*- from __future__ import print_function import json import time from builtins import str as text import pytest from django.contrib.auth.models import User from django.utils.translation import gettext_lazy as _ from model_bakery import baker from multiseek import logic from multiseek.logic impo...
mit
-2,225,583,535,854,035,700
30.267485
87
0.655339
false
3.291952
true
false
false
Xarrow/PyCharmWorkSpace
everything_sdk/pyeverything.py
1
9309
# -*- coding:utf-8 -*- """ Verion: 1.0 Author: zhangjian Site: https://iliangqunru.bitcron.com/ File: pyeverything.py Time: 2018/3/9 Add New Functional pyeverything.py """ import logging import sys from ctypes import windll, create_unicode_buffer, byref, WinDLL level = logging.DEBUG format = '%(asctime)s - %(...
apache-2.0
8,502,296,471,336,731,000
34.593023
175
0.636938
false
3.821473
false
false
false
sthyme/ZFSchizophrenia
ClusterBrainImages/sum_intensity_review_allRegion_thres.py
1
6111
import numpy as np import tifffile import os import scipy import dill import pandas as pd def load_object(filename): f = open(filename, "rb") obj = dill.load(f) f.close() return obj ## Directory of the folder containing activity images file_dir="/n/schier_lab2/everyone/avereallyfullfusio...
mit
1,075,696,351,922,056,700
63.709677
199
0.723777
false
2.661585
false
false
false
teamshadi/mf-dataentry
project/settings.py
1
3197
""" Django settings for project project. Generated by 'django-admin startproject' using Django 1.11.4. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os...
mit
-2,286,854,437,003,504,000
24.576
91
0.686581
false
3.486369
false
false
false
QLaboratory/QlabChallengerRepo
ai_challenger_scene/scale_layer.py
1
3385
from keras.layers.core import Layer from keras.engine import InputSpec from keras import backend as K try: from keras import initializations except ImportError: from keras import initializers as initializations class Scale(Layer): '''Learns a set of weights and biases used for scaling the input da...
mit
-5,671,898,261,230,597,000
45.676056
108
0.639586
false
4.158477
true
false
false
andrew-szymanski/gae_django
jsonpickle/__init__.py
1
10743
# -*- coding: utf-8 -*- # # Copyright (C) 2008 John Paulett (john -at- paulett.org) # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. """Python library for serializing any arbitrary object graph into JSON. It can take a...
bsd-3-clause
-7,820,685,076,702,264,000
32.055385
79
0.613237
false
4.404674
false
false
false
boh1996/LectioAPI
sync.py
1
4414
import database from datetime import * import error from bson.objectid import ObjectId db = database.db def flatten ( l ): out = [] if isinstance(l, (list, tuple)): for item in l: out.extend(flatten(item)) elif isinstance(l, (dict)): for dictkey in l.keys(): out.extend(flatten(l[dictkey])) elif isinstan...
mit
-2,249,145,133,268,138,000
20.536585
112
0.645446
false
3.104079
false
false
false
IRC-SPHERE/HyperStream
hyperstream/tools/splitter_from_stream/2016-10-06_v0.0.1.py
1
2970
# The MIT License (MIT) # Copyright (c) 2014-2017 University of Bristol # # 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 us...
mit
-5,980,094,370,727,878,000
46.142857
104
0.69899
false
4.472892
false
false
false
youhusky/Facebook_Prepare
653. Two Sum IV - Input is a BST.py
1
1134
# Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target. # Example 1: # Input: # 5 # / \ # 3 6 # / \ \ # 2 4 7 # Target = 9 # Output: True # Example 2: # Input: # 5 # / \ # 3 6 # / \ \ # 2 ...
mit
-3,556,029,239,713,989,000
19.636364
150
0.485891
false
3.415663
false
false
false
FedoraScientific/salome-smesh
doc/salome/examples/modifying_meshes_ex16.py
1
1273
# Diagonal Inversion import salome salome.salome_init() import GEOM from salome.geom import geomBuilder geompy = geomBuilder.New(salome.myStudy) import SMESH, SALOMEDS from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) import salome_notebook # create an empty mesh structure mesh = smes...
lgpl-2.1
6,688,399,887,949,552,000
22.574074
43
0.563236
false
2.210069
false
true
false
iamahuman/angr
angr/state_plugins/filesystem.py
1
23698
import os import logging from .plugin import SimStatePlugin from ..storage.file import SimFile from ..errors import SimMergeError from ..misc.ux import once l = logging.getLogger(name=__name__) class SimFilesystem(SimStatePlugin): # pretends links don't exist """ angr's emulated filesystem. Available as stat...
bsd-2-clause
-3,923,235,753,469,859,000
37.408428
131
0.565027
false
3.984866
false
false
false
grow/pygrow
grow/commands/subcommands/build.py
1
4362
"""Command for building pods into static deployments.""" import os import click from grow.commands import shared from grow.common import bulk_errors from grow.common import rc_config from grow.common import utils from grow.deployments import stats from grow.deployments.destinations import local as local_destination fr...
mit
-689,199,156,016,179,200
39.388889
80
0.65039
false
3.965455
true
false
false
praekelt/go-contacts-api
go_contacts/backends/utils.py
1
1634
from vumi.persist.model import VumiRiakError from go_api.collections.errors import CollectionUsageError from go_api.queue import PausingQueueCloseMarker from twisted.internet.defer import inlineCallbacks, returnValue @inlineCallbacks def _get_page_of_keys( model_proxy, user_account_key, max_results, cursor, ...
bsd-3-clause
-5,106,374,650,340,650,000
29.259259
69
0.654223
false
3.791183
false
false
false
phr4nz/dproxify
setup.py
1
1331
# setup.py : dproxify setup # Written by Francesco Palumbo aka phranz # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
-6,153,610,981,818,929,000
33.128205
86
0.652893
false
3.903226
false
false
false
arnaudbore/declarativeTask
src/ld_extractInfo_v2.py
1
1839
import sys import ast from config import dataFolder from expyriment.misc import data_preprocessing import numpy as np agg = data_preprocessing.Aggregator(data_folder=dataFolder, file_name=sys.argv[1]) print 'Variable computed: ' data = {} for variable in agg.variables: data[v...
mit
-8,856,084,287,288,248,000
31.839286
110
0.653072
false
3.237676
false
false
false
foobarbazblarg/stayclean
stayclean-2018-october/display-final-after-month-is-over.py
1
3056
#!/usr/bin/python # TODO: issues with new oauth2 stuff. Keep using older version of Python for now. # #!/usr/bin/env python from participantCollection import ParticipantCollection import re import datetime import pyperclip # Edit Me! # This script gets run on the first day of the following month, and that month's UR...
mit
-5,068,722,511,293,555,000
43.289855
199
0.682264
false
3.391787
false
false
false
willettk/decals
python/decals_analysis.py
1
23642
# Do some preliminary analysis on the results of the DECaLS-Galaxy Zoo data. from astropy.io import fits from astropy.cosmology import WMAP9 from matplotlib import pyplot as plt from matplotlib import cm from matplotlib.colors import LogNorm from collections import Counter import numpy as np import re import pandas...
mit
-1,780,753,696,382,251,300
43.691871
184
0.550207
false
2.940182
false
false
false
jaumemarti/l10n-spain-txerpa
l10n_es_aeat/wizard/export_to_boe.py
1
7887
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2004-2011 # Pexego Sistemas Informáticos. (http://pexego.es) # Luis Manuel Angueira Blanco (Pexego) # # Copyright (C) 2013 # Ignacio Ibeas - Acysos S.L. (http://acysos.com)...
agpl-3.0
-6,541,515,499,416,233,000
40.829787
79
0.544888
false
3.937907
false
false
false
akissa/repoze.who.plugins.saml2
repoze/who/plugins/utils.py
1
2114
# -*- coding: utf-8 -*- # vim: ai ts=4 sts=4 et sw=4 # repoze.who.plugins.saml2: A SAML2 plugin for repoze.who # Copyright (C) 2015 Andrew Colin Kissa <andrew@topdog.za.net> # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file...
mpl-2.0
5,629,052,774,001,114,000
38.886792
78
0.542573
false
4.605664
false
false
false
Haynie-Research-and-Development/jarvis
deps/lib/python3.4/site-packages/pubnub/endpoints/presence/here_now.py
2
2298
from pubnub import utils from pubnub.endpoints.endpoint import Endpoint from pubnub.enums import HttpMethod, PNOperationType from pubnub.models.consumer.presence import PNHereNowResult class HereNow(Endpoint): HERE_NOW_PATH = "/v2/presence/sub-key/%s/channel/%s" HERE_NOW_GLOBAL_PATH = "/v2/presence/sub-key/%s...
gpl-2.0
5,272,564,497,552,531,000
28.844156
87
0.632724
false
3.83
false
false
false
oliverlee/bicycle
python/pitch_constraint.py
1
3051
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Calculate the pitch needed to maintain contact between the front wheel and ground. """ from sympy import simplify, symbols from sympy.physics.mechanics import ReferenceFrame, Point from sympy.physics.mechanics import msprint from mpmath import findroot from sympy.utilit...
bsd-2-clause
3,405,988,545,000,898,000
26.205357
77
0.68231
false
2.701241
false
false
false
patricksanders/muse
muse/muse.py
1
5263
import jinja2 import webapp2 import os import json import random from settings import * from google.appengine.api import memcache from apis.pyechonest import config as enconfig from apis.pyechonest import * #from apis.rdio import Rdio JINJA_ENVIRONMENT = jinja2.Environment( loader=jinja2.FileSystemLoader(os.path.dirn...
bsd-3-clause
830,532,179,626,433,300
28.082873
69
0.693711
false
3.047481
false
false
false
HelloLily/hellolily
lily/messaging/email/migrations/0025_migrate_public_setting.py
1
1027
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from ..models.models import EmailAccount PUBLIC = 0 def migrate_public_setting(apps, schema_editor): EmailAccount = apps.get_model('email', 'EmailAccount') email_accounts = EmailAccount.objects.all() ...
agpl-3.0
-7,111,744,024,382,527,000
24.675
86
0.673807
false
4.075397
false
false
false
T2DREAM/t2dream-portal
src/encoded/get_file_uuid.py
1
1886
#!/usr/bin/env python2 import argparse import os import sys from collections import OrderedDict from pyramid.compat import bytes_ from pyramid.httpexceptions import HTTPBadRequest from pyramid.view import view_config from pyramid.response import Response from snovault import TYPES from collections import OrderedDict fr...
mit
1,046,697,810,688,850,400
27.575758
94
0.711559
false
3.640927
false
false
false
gannetson/sportschooldeopenlucht
apps/contentplugins/migrations/0001_initial.py
1
3815
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'PictureItem' db.create_table('contentitem_contentplugins_pictureitem', ( ('conte...
bsd-3-clause
5,727,575,383,363,468,000
63.677966
208
0.588729
false
3.732877
false
false
false
jasonacox/SentryPi
sentrypi-freezer.py
1
2996
#!/usr/bin/python # -*- coding: utf-8 -*- # # Freezer Status - JSON Output # # Description: # This script reads the 1-wire freezer temperature and prints JSON # Additionally, this script will send SNS messages if temperature # rises above ALERTTEMP or above freezing. # # Jason A. Cox, @jasonacox # https:/...
mit
-3,744,901,409,135,362,600
25.486726
81
0.533244
false
3.267467
false
false
false
nicolasfauchereau/windspharm
lib/windspharm/tools.py
1
9009
""" Tools for managing data for use with `~windspharm.standard.VectorWind` (or indeed `spharm.Spharmt`). """ # Copyright (c) 2012-2013 Andrew Dawson # # 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 ...
mit
9,096,566,046,557,755,000
27.782748
79
0.651793
false
3.894942
false
false
false
shaddyx/simpleDecorators
tests/CacheTest.py
1
1515
import unittest from simpledecorators.Cache import Cache, TimeCacheStorage called = 0 class SafeTest(unittest.TestCase): def test_AddToCache(self): global called called = 0 @Cache(cacheStorage=TimeCacheStorage(time_seconds=1, maxCount=1000)) def func1(a,b,c): global cal...
mit
941,584,951,735,983,100
23.047619
76
0.512871
false
3.404494
true
false
false
proffalken/edison
cmdb/reports.py
1
2103
# This file is part of the Edison Project. # Please refer to the LICENSE document that was supplied with this software for information on how it can be used. try: from geraldo import Report, landscape, ReportBand, ObjectValue, SystemField,BAND_WIDTH, Label,ReportGroup from reportlab.lib.pagesizes import A5 from repo...
bsd-3-clause
4,797,318,441,502,722,000
32.919355
114
0.642891
false
3.021552
false
false
false
Petraea/jsonbot
jsb/lib/container.py
1
1727
# jsb/container.py # # """ container for bot to bot communication. """ __version__ = "1" ## jsb imports from jsb.lib.persist import Persist from jsb.utils.name import stripname from jsb.lib.gozerevent import GozerEvent from jsb.imports import getjson ## basic imports import hmac import uuid import time import has...
mit
-2,278,081,894,544,858,400
24.028986
120
0.623046
false
3.52449
false
false
false
kmichalak/rosie
rosie/cli/test_actions_InitConfigAction.py
1
2740
import os from unittest import TestCase from rosie.cli.actions import InitConfigAction class TestInitConfigAction(TestCase): config_file_path = 'test_file.py' def tearDown(self): if os.path.exists(self.config_file_path): os.remove(self.config_file_path) def test_action_gets_file_nam...
apache-2.0
-4,067,880,509,539,386,400
32.414634
76
0.54708
false
4.053254
true
false
false
sveetch/boussole
tests/010_inspector/007_parents.py
1
4810
# -*- coding: utf-8 -*- import os def test_001_basic(settings, inspector): """Looking for parents of basic sample""" sources = [ os.path.join(settings.sample_path, 'main_basic.scss'), os.path.join(settings.sample_path, 'main_depth_import-3.scss'), os.path.join(settings.sample_path, 'ma...
mit
-5,602,037,356,110,481,000
49.631579
79
0.668815
false
3.105229
false
false
false
asarraf/KuduPyspark
spark1_6_0_kudu.py
1
1709
# Dated : Aug 25, 2017 # About : Sample Pyspark (1.6.0) code to count number of Rows in a Kudu Table # Pyspark Version : 1.6.0 # Kudu Version : 1.2.0 # Coder : Ankit Sarraf import ConfigParser from pyspark import SparkContext from pyspark import SparkConf from pyspark.sql import SQLCon...
apache-2.0
6,504,802,878,220,540,000
30.648148
87
0.67876
false
3.331384
true
true
false
shellphish/rex
rex/exploit/techniques/call_shellcode.py
1
10390
import logging from ... import Vulnerability from .. import Exploit, CannotExploit from ..technique import Technique from ..nopsleds import NopSleds l = logging.getLogger("rex.exploit.techniques.call_shellcode") class CallShellcode(Technique): name = "call_shellcode" applicable_to = ['unix'] def check(...
bsd-2-clause
-7,863,996,589,730,166,000
47.101852
132
0.570452
false
4.165998
false
false
false
iafan/zing
pootle/apps/pootle_project/views.py
1
6882
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # Copyright (C) Zing contributors. # # This file is a part of the Zing project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from django...
gpl-3.0
-8,620,018,919,134,642,000
29.451327
79
0.622929
false
4.089127
false
false
false
jpzk/evopy
evopy/external/playdoh/asyncjobhandler.py
2
15068
""" Asynchronous Job Manager """ from cache import * from gputools import * from pool import * from rpc import * from resources import * from numpy import sum import cPickle import os import os.path import time import hashlib import random import traceback __all__ = ['Job', 'JobRun', 'AsyncJobHandle...
gpl-3.0
8,393,490,049,809,186,000
28.138
79
0.522564
false
4.144114
false
false
false
namcap/Digital-Image-Processing-in-Python
1.DFT_and_DCT/Swap Phase.py
1
1819
#! /usr/bin/python3 if __name__=="__main__": from PIL import Image import numpy as np from matplotlib import pyplot as plt from scipy.fftpack import dct from scipy.fftpack import idct # default_paths=["img1.jpg","img2.jpg"] paths=[None]*2 images=[None]*2 DFT=[None]*2 iDFT=...
mit
4,967,214,744,849,835,000
34.666667
83
0.582738
false
3.30127
false
false
false
OpenMined/PySyft
packages/syft/src/syft/lib/python/__init__.py
1
31373
# stdlib from typing import Optional # syft relative from . import collections from ...ast import add_classes from ...ast import add_dynamic_objects from ...ast import add_methods from ...ast import add_modules from ...ast.globals import Globals from ...core.node.abstract.node import AbstractNodeClient from ..misc.uni...
apache-2.0
-4,590,487,544,868,598,000
53.091379
86
0.581041
false
3.049772
false
false
false
ContributeToScience/participant-booking-app
booking/staff/views.py
1
11256
import collections import httplib import urllib import urlparse from django.conf import settings from django.contrib.messages import error, success, warning from django.core.urlresolvers import reverse_lazy from django.db.models import F from django.http import HttpResponseRedirect from django.shortcuts import render_t...
gpl-2.0
-5,788,404,606,282,582,000
38.222997
120
0.627488
false
3.949474
false
false
false
xupingmao/xnote
core/xmanager.py
1
25975
# encoding=utf-8 # @author xupingmao # @since # @modified 2021/06/12 16:51:12 """Xnote 模块管理器 * HandlerManager HTTP请求处理器加载和注册 * CronTaskManager 定时任务注册和执行 * EventManager 事件管理器 """ from __future__ import print_function import os import sys import gc import re import traceback import time import copy import json import...
gpl-3.0
-8,350,629,747,782,482,000
29.256188
108
0.54203
false
3.32567
false
false
false