repo_name
stringlengths
6
90
path
stringlengths
4
230
copies
stringlengths
1
4
size
stringlengths
4
7
content
stringlengths
734
985k
license
stringclasses
15 values
hash
int64
-9,223,303,126,770,100,000
9,223,233,360B
line_mean
float64
3.79
99.6
line_max
int64
19
999
alpha_frac
float64
0.25
0.96
autogenerated
bool
1 class
ratio
float64
1.5
8.06
config_test
bool
2 classes
has_no_keywords
bool
2 classes
few_assignments
bool
1 class
drajen/freenas-flocker-driver
tests/test.py
1
2228
# # Copyright 2016 Michael Mattsson. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
-7,248,039,622,277,055,000
29.108108
77
0.658887
false
3.503145
false
false
false
shumik/skencil-c
Plugins/Objects/regpoly.py
1
2567
# Sketch - A Python-based interactive drawing program # Copyright (C) 1998, 1999, 2000, 2003 by Bernhard Herzog # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; either # version 2 of th...
gpl-2.0
2,385,726,932,698,491,000
27.842697
78
0.68991
false
3.459569
false
false
false
harisbal/pandas
pandas/tests/indexes/multi/test_astype.py
1
1028
# -*- coding: utf-8 -*- import numpy as np import pytest import pandas.util.testing as tm from pandas.core.dtypes.dtypes import CategoricalDtype from pandas.util.testing import assert_copy def test_astype(idx): expected = idx.copy() actual = idx.astype('O') assert_copy(actual.levels, expected.levels) ...
bsd-3-clause
1,677,058,756,018,366,200
31.125
74
0.701362
false
3.793358
true
false
false
zbeaver4/python-webpage-monitor-slackbot
tester.py
1
1855
###next step: get bot working with whole page### ###Testing Ground### data = {"text": "monitor https://news.ycombinator.com/"} config = yaml.load(file('C:\\Users\\zacharybeaver\\Documents\\GitHub\\python-WebPageMonitorBot\\rtmbot.conf', 'r')) url = 'https://news.ycombinator.com/' ###Function to strip urls def strip_u...
mit
8,389,724,732,564,637,000
27.538462
115
0.701887
false
3.214905
false
false
false
themech/Machine-Learning-Coursera-Tensorflow
ex2-logistic regression/1_logistic_regression.py
1
3015
import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import tensorflow as tf # V1. Print data sample df = pd.read_csv('data/ex2data1.txt', names=['exam1', 'exam2', 'admitted']) print(df.shape) print(df.head()) # 2. Visualize the data sns.set(context='notebook', style='darkgrid'...
mit
-3,359,031,463,361,844,700
29.15
77
0.599005
false
2.753425
false
false
false
maferelo/saleor
saleor/checkout/base_calculations.py
1
1677
"""Contain functions which are base for calculating checkout properties. It's recommended to use functions from calculations.py module to take in account plugin manager. """ from typing import TYPE_CHECKING, List from prices import TaxedMoney from ..core.taxes import quantize_price, zero_taxed_money if TYPE_CHECKI...
bsd-3-clause
1,382,892,540,976,764,400
31.25
87
0.726893
false
3.751678
false
false
false
henryzord/clustering
src/measures/sswc.py
1
1931
import pandas as pd import numpy as np from scipy.spatial.distance import cdist __author__ = 'Henry Cagnini' def get_partition(medoids, dataset): medoid_index = np.flatnonzero(medoids) medoids_sample = dataset.loc[medoid_index] m_dist = cdist(dataset, medoids_sample, metric='euclidean') closest = ma...
gpl-3.0
8,349,862,145,481,715,000
32.877193
132
0.676334
false
3.084665
false
false
false
OrangeChaten/RPIChat
RPIChat/ui/ChatTab.py
1
15914
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'ChatTab.ui' # # Created by: PyQt5 UI code generator 5.8.2 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_ChatTab(object): def setupUi(self, ChatTab): ChatTab.setObje...
mit
-2,958,018,697,932,767,000
51.348684
174
0.696934
false
3.414289
false
false
false
Azure/azure-sdk-for-python
sdk/applicationinsights/azure-applicationinsights/azure/applicationinsights/models/events_custom_metric_info_py3.py
1
2104
# 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
4,045,071,496,017,072,600
39.461538
198
0.590304
false
3.867647
false
false
false
seecr/meresco-distributed
test/servicelogtest.py
1
4669
## begin license ## # # "Meresco Distributed" has components for group management based on "Meresco Components." # # Copyright (C) 2014-2015, 2021 Seecr (Seek You Too B.V.) https://seecr.nl # Copyright (C) 2014 Stichting Bibliotheek.nl (BNL) http://www.bibliotheek.nl # Copyright (C) 2015 Koninklijke Bibliotheek (KB) ht...
gpl-2.0
-6,462,775,220,052,306,000
47.134021
130
0.65967
false
3.304317
true
false
false
jfcabral/SE2015
deprecated/createEnqueueJob.py
1
1629
# from Cloud Computing - A Hands-On Approach import cPickle import boto.sqs from boto.sqs.message import Message import s3upload ''' ACCESS_KEY = "<enter ACCESS_KEY>" SECRET_KEY = "<enter SECRET_KEY>" ''' REGION = "eu-weast-1" def enqueuejob(datafile, mapper, reducer, emailaddress): conn = boto.sqs.connect_to_r...
bsd-3-clause
7,010,241,426,118,899,000
30.326923
89
0.683855
false
3.510776
false
false
false
OpenDevelopmentMekong/odm-automation
ansible/roles/extra-wp/files/generate_stats.py
1
1323
import urllib import json import sys if len(sys.argv) < 1 or len(sys.argv) > 3: print 'USAGE python generate_stats.py OUTPUT_FILE COUNTRY_CODE' url = 'https://raw.githubusercontent.com/OpenDevelopmentMekong/odm-taxonomy/master/taxonomy_en.json' def getNumberOfRecordsByTaxonomy(name): url = 'https://data...
gpl-3.0
-1,558,276,144,655,622,000
23.981132
113
0.625094
false
3.392308
true
false
false
zouyapeng/horizon
openstack_dashboard/dashboards/identity/users/views.py
7
5857
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
6,891,561,085,534,572,000
38.574324
78
0.60321
false
4.550894
false
false
false
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/soyuz/browser/distroseriessourcepackagerelease.py
1
1986
# Copyright 2009 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). __metaclass__ = type __all__ = [ 'DistroSeriesSourcePackageReleaseNavigation', 'DistroSeriesSourcePackageReleaseView', ] from lazr.restful.utils import smartquote fr...
agpl-3.0
3,007,240,958,018,984,000
30.03125
73
0.711984
false
4.289417
false
false
false
goerz/clusterjob
clusterjob/backends/pbs.py
1
6490
""" PBS/TORQUE backend """ from __future__ import absolute_import import re from ..status import PENDING, RUNNING, COMPLETED from .. import ClusterjobBackend class PbsBackend(ClusterjobBackend): """PBS/TORQUE Backend Attributes: name (str): Name of the backend extension (str): Extension for j...
mit
-1,984,541,115,758,210,600
37.402367
79
0.522188
false
4.003701
false
false
false
ucbtrans/sumo-project
utils/getTrajectory.py
1
3914
import os import sys sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), '..')) from sumolib.output import * from sumolib.miscutils import Statistics import pdb import matplotlib.pyplot as plt import numpy as np #functions used in trajectoryData def _prefix_keyword(name, warn=False): result = name # create ...
bsd-2-clause
-6,811,855,457,057,464,000
27.158273
96
0.634645
false
2.742817
false
false
false
lucarebuffi/OASYS1
oasys/widgets/gui.py
1
7315
import os, sys from PyQt5.QtCore import Qt, QCoreApplication from PyQt5.QtWidgets import QWidget, QGridLayout, QFileDialog, QMessageBox, QLabel, QComboBox, QTextEdit from orangewidget import gui as orange_gui current_module = sys.modules[__name__] gui_point_size=12 # ---------------------------------- # Default fon...
gpl-3.0
-7,521,387,602,944,339,000
33.504717
196
0.613807
false
4.116488
false
false
false
tobijk/ecromedos
lib/net/ecromedos/highlight/formatter.py
1
3247
# -*- coding: utf-8 -*- # # Desc: This file is part of the ecromedos Document Preparation System # Author: Tobias Koch <tobias@tobijk.de> # License: MIT # URL: http://www.ecromedos.net # import re from pygments.formatter import Formatter from xml.sax.saxutils import escape as xmlescape class ECMLPygmentsForm...
mit
316,197,775,339,136,600
29.064815
78
0.534339
false
4.094578
false
false
false
MediaKraken/MediaKraken_Deployment
source/common/common_image.py
1
1461
""" Copyright (C) 2016 Quinn D Granfor <spootdev@gmail.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful...
gpl-3.0
-1,967,096,988,235,932,700
31.204545
69
0.68104
false
3.91689
false
false
false
lzehl/elephant
setup.py
3
1274
# -*- coding: utf-8 -*- from setuptools import setup long_description = open("README.rst").read() install_requires = ['neo>0.3.3', 'numpy>=1.6.2', 'quantities>=0.9.0', 'scipy>=0.11.0'] extras_require = {'pandas': ['pandas>=0.14.0'], 'docs':...
bsd-3-clause
-7,626,488,381,928,117,000
33.432432
89
0.572214
false
3.725146
false
false
false
yourlabs/django-documents
documents/widgets.py
1
1258
from django import forms from django.utils.html import escape from django.utils.encoding import force_unicode from django.utils.safestring import mark_safe from django.contrib.admin.widgets import AdminFileWidget class DocumentAdminFileWidget(AdminFileWidget): """ Replacement for Django's AdminFileWidget whic...
mit
-4,721,851,000,442,496,000
36
78
0.605723
false
4.508961
false
false
false
christianurich/DynaMind-ToolBox
DynaMind-Performance-Assessment/3rdparty/CD3Waterbalance/Module/Sewer2.py
2
1810
# -*- coding: utf-8 -*- """ Created on Thu Oct 02 08:41:08 2014 @author: Acer """ import sys import pycd3 #class NodeFactorySewer2(pycd3.INodeFactory): # def __init__(self, node): # pycd3.INodeFactory.__init__(self) # self.node = node # print "NodeFactory.__init__" # # def getNodeN...
gpl-2.0
1,059,517,169,030,618,100
22.506494
63
0.530939
false
3.126079
false
false
false
dougalsutherland/skl-groups
skl_groups/tests/test_summaries.py
1
3325
from __future__ import division import os import sys import numpy as np from sklearn.pipeline import Pipeline from sklearn.cluster import KMeans, MiniBatchKMeans from sklearn.externals.six.moves import xrange from nose.tools import assert_raises if __name__ == '__main__': # make this copy of skl_groups importabl...
bsd-3-clause
3,224,896,974,895,515,600
31.598039
80
0.611729
false
3.107477
false
false
false
simpeg/simpeg
SimPEG/EM/Static/DC/ProblemDC.py
1
15118
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from SimPEG import Utils from SimPEG.EM.Base import BaseEMProblem from .SurveyDC import Survey from .FieldsDC import FieldsDC, Fields_CC, Fields_N import numpy as np impo...
mit
-5,527,570,461,963,778,000
31.936819
88
0.481479
false
3.382103
false
false
false
josephsnyder/VistA
Scripts/DefaultKIDSBuildInstaller.py
1
30883
#--------------------------------------------------------------------------- # Copyright 2012-2019 The Open Source Electronic Health Record Alliance # # 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 Licen...
apache-2.0
-6,796,245,939,135,587,000
40.903664
96
0.667455
false
4.06837
true
false
false
arkadoel/directORM
python/constantes.py
1
1366
from _datetime import datetime #constantes de la aplicacion APP_NAME = 'directORM' APP_VERSION = '0.0.1' DIRECTORIO_DESTINO = './salida' TEMPLATE_INIT = './templates/__init__.py' FOR_IMPORTS = ''' import sqlite3 import directORM class @nombreObjeto: def __init__(self): ''' def get_hora() -> str: ''' ...
gpl-2.0
2,015,070,386,336,469,000
17.972222
52
0.545388
false
3.118721
false
false
false
jilljenn/tryalgo
tryalgo/binary_search.py
1
3931
#!/usr/bin/env pypy3 # -*- coding: utf-8 -*- """\ Binary search jill-jênn vie, christoph dürr et louis abraham - 2014-2020 """ # pylint: disable=redefined-outer-name from tryalgo.our_std import readint, readarray __all__ = ["discrete_binary_search", "continuous_binary_search", "optimized_binary_search_lowe...
mit
242,166,884,960,598,620
25.369128
70
0.55154
false
3.434441
false
false
false
etos/django
django/db/backends/mysql/client.py
65
1834
import subprocess from django.db.backends.base.client import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'mysql' @classmethod def settings_to_cmd_args(cls, settings_dict): args = [cls.executable_name] db = settings_dict['OPTIONS'].get('db', settings_dic...
bsd-3-clause
6,245,214,164,130,891,000
37.208333
82
0.544711
false
3.893843
false
false
false
ymero/PyCrawler
test/test_logger.py
1
1248
__author__ = 'mengpeng' import logging from unittest import TestCase from pycrawler.logger import Logger from pycrawler.logger import LoggingConfig class TestLogger(TestCase): def test_register(self): Logger.register('Test') self.assertIn('Test-logger', LoggingConfig['loggers']) self.asser...
mit
4,994,986,774,725,919,000
28.046512
68
0.621795
false
4.230508
true
false
false
kenshay/ImageScripter
ProgramData/Interface/main.py
2
59760
from __future__ import with_statement from pytank.GUI import CaptureButton import win32con import logging from pytank.GUI.Classes import CustomWidgets logger = logging.getLogger(__name__) from PyQt4.QtGui import QApplication import subprocess from PyQt4 import QtCore, QtGui, Qsci from PyQt4.Qsci import QsciScintilla, ...
gpl-3.0
-1,790,740,732,343,977,500
34.656325
349
0.651339
false
3.988787
false
false
false
Wilduck/settling
settling/test/test_board_geometry.py
1
5577
import unittest from settling import board_geometry class Test_StandardBoard_ordinal_from_hexagon(unittest.TestCase): def setUp(self): """Create an instance of the standard board type. """ self.geometry = board_geometry.StandardBoard() def test_works(self): """A simple test t...
gpl-2.0
157,702,417,989,297,380
35.690789
77
0.614309
false
3.579589
true
false
false
jrversteegh/softsailor
softsailor/sol/sol_weather.py
1
3677
""" Sol weather module Contains sol specific weather loader """ __author__ = "J.R. Versteegh" __copyright__ = "Copyright 2011, J.R. Versteegh" __contact__ = "j.r.versteegh@gmail.com" __version__ = "0.1" __license__ = "GPLv3, No Warranty. See 'LICENSE'" import datetime as dt from datetime import datetime, timedelta f...
gpl-3.0
-5,720,160,828,152,573,000
29.641667
81
0.568398
false
3.38582
false
false
false
codebendercc/compiler
Symfony/app/Resources/autocompletion/request.py
1
3113
import json from complete import Completer, CodeCompletionResults from response import Response from logger import * def _read_json_file(p): try: with open(p, 'r') as f: s = f.read() except IOError as e: log_error(REQ_IO_ERROR) return s def _load_json_string(s): try: ...
bsd-2-clause
-8,581,571,144,242,329,000
27.824074
82
0.574044
false
3.525481
false
false
false
lmazuel/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_06_01/operations/default_security_rules_operations.py
1
8249
# 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
7,014,377,109,762,311,000
45.60452
220
0.644927
false
4.544904
true
false
false
kashefy/nideep
nideep/nets/net_surgery_fcn_cont.py
3
2469
''' Created on Jul 21, 2015 @author: kashefy ''' import os import caffe def make_fully_conv(path_model_src, path_weights_src, path_model_full_conv, param_pairs, path_weights_dst ): # PART A: Load the original netw...
bsd-2-clause
-5,803,180,439,755,472,000
36.984615
144
0.602673
false
3.261559
false
false
false
svalleru/PyText
pyText.py
1
2152
__author__ = 'svalleru' import sys import json import smtplib def get_email_creds(): with open('gmailAccount.cfg', 'r') as efile: creds = [efile.next().strip() for x in xrange(2)] email, passwd = creds[0].split('=')[1], creds[1].split('=')[1] return email, passwd def get_sms_params(**par...
mit
3,721,683,295,828,487,700
33.725806
145
0.571097
false
3.788732
false
false
false
Puriney/MrY
MrY/list_avail.py
1
6491
''' List available installations at root_dir ''' import os import glob from tabulate import tabulate from collections import defaultdict, OrderedDict from operator import itemgetter from MrY import join_path as jpath ''' Example Output: Org=GECODE Species Assembly Release Genome.Fasta Genome.Fasta.gz GTF GFF3 Bowti...
gpl-3.0
-4,336,245,766,147,182,000
38.579268
79
0.42921
false
3.929177
false
false
false
vyan2000/ocml-public
tools/distance.py
1
1886
import matplotlib.pyplot as plt import pandas as pd import numpy as np import seaborn as sns import xarray as xr def add_distance_to_coast(floatsDF, result_interpDF): """ function for adding the 'distance to coast' to the dataframe. ---------- input: floatsDF -- pandas.dataframe of floats data ...
gpl-3.0
-8,882,687,649,953,212,000
33.944444
122
0.676034
false
3.592381
false
false
false
mzaforas/recetario
recetario.py
1
4186
from flask import Flask, redirect, render_template, request, flash, url_for from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy import Column, Integer, String, Text, Float, ForeignKey, Table from sqlalchemy.orm import relationship from wtforms import Form, BooleanField, TextField, PasswordField, validators, I...
gpl-3.0
3,130,332,467,389,966,300
31.449612
117
0.672002
false
3.205207
false
false
false
QQuick/Transcrypt
transcrypt/development/shipment/upload_all.py
1
1279
import os shipDir = os.path.dirname (os.path.abspath (__file__)) .replace ('\\', '/') appRootDir = '/'.join (shipDir.split ('/')[ : -2]) distributionDir = '/'.join (appRootDir.split ('/')[ : -1]) dynWebRootDir, statWebRootDir = eval (open ('upload_all.nogit') .read ()) def getAbsPath (rootDir, relPath): ...
apache-2.0
2,156,286,149,531,634,400
42.103448
219
0.661454
false
3.30491
false
false
false
vanatteveldt/syntaxrules
syntaxrules/syntaxtree.py
1
18926
########################################################################### # (C) Vrije Universiteit, Amsterdam (the Netherlands) # # # # This file is part of AmCAT - The Amsterdam Content Analysis Toolkit # # ...
mit
-1,575,991,986,260,936,700
40.779249
93
0.520448
false
4.187168
false
false
false
gsathya/bridgedb
lib/bridgedb/Tests.py
1
28969
# BridgeDB by Nick Mathewson. # Copyright (c) 2007-2009, The Tor Project, Inc. # See LICENSE for licensing information from __future__ import print_function import doctest import os import random import sqlite3 import tempfile import unittest import warnings import time from datetime import datetime import bridgedb....
bsd-3-clause
7,817,781,566,770,422,000
36.139744
93
0.582174
false
3.646193
true
false
false
Azure/azure-sdk-for-python
sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_diagnostic_settings_category_operations.py
1
7336
# 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
1,552,331,885,032,902,400
45.138365
133
0.664804
false
4.435308
false
false
false
dcolish/Presentations
update-pdx/zmq/pipeline_worker.py
1
1313
from threading import Thread, enumerate as t_enum from time import sleep, time from zmq import Context, Poller, POLLIN, PUSH, PULL class Leatherneck(Thread): def __init__(self): super(Leatherneck, self).__init__(name="Leatherneck") self.context = Context() self.pull = self.context.socket...
bsd-3-clause
2,988,282,148,827,132,400
25.26
61
0.560548
false
3.70904
false
false
false
916253/Kurisu-Reswitched
addons/lockdown.py
1
4515
import asyncio import discord from discord.ext import commands from sys import argv class Lockdown: """ Channel lockdown commands. """ def __init__(self, bot): self.bot = bot print('Addon "{}" loaded'.format(self.__class__.__name__)) @commands.has_permissions(manage_messages=True) ...
apache-2.0
-4,014,429,145,658,501,600
52.963855
180
0.633177
false
3.723192
false
false
false
exa-analytics/exatomic
exatomic/interfaces/cclib.py
2
4813
# -*- coding: utf-8 -*- # Copyright (c) 2015-2020, Exa Analytics Development Team # Distributed under the terms of the Apache License 2.0 """ Interface to `cclib`_ ####################### .. _cclib: https://cclib.github.io/ """ from ast import literal_eval from exa.util.units import Length, Energy from exatomic.algori...
apache-2.0
1,801,411,815,798,022,100
39.108333
77
0.546229
false
3.087235
false
false
false
bbc/kamaelia
Sketches/MH/Layout/UI/__init__.py
3
4064
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1) # # (1) Kamaelia Contributors are listed in the AUTHORS file and at # http://www.kamaelia.org/AUTHORS - please extend this file, # not this notice. # # Licensed under the Apache License, ...
apache-2.0
5,550,785,612,310,904,000
34.034483
106
0.552165
false
4.117528
false
false
false
duguyue100/retina-simulation
setup.py
1
1267
"""Setup script for the simretina package. Author: Yuhuang Hu Email : yuhuang.hu@uzh.ch """ from setuptools import setup classifiers = """ Development Status :: 4 - Beta Intended Audience :: Science/Research Natural Language :: English Operating System :: OS Independent Programming Language :: Python :: 2.7 Programm...
mit
-6,168,806,978,411,872,000
25.395833
60
0.677979
false
3.737463
false
false
false
adviti/melange
app/soc/modules/gci/models/student.py
1
2376
#!/usr/bin/env python2.5 # # Copyright 2009 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
apache-2.0
1,993,171,535,492,981,800
36.125
78
0.729798
false
3.914333
false
false
false
diplomacy/research
diplomacy_research/models/policy/token_based/dataset/base.py
1
20708
# ============================================================================== # Copyright 2019 - Philip Paquette # # NOTICE: 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 rest...
mit
-8,350,033,643,330,836,000
52.509044
120
0.58813
false
4.152396
false
false
false
boscoh/inmembrane
inmembrane/plugins/tatfind_web.py
1
2816
# -*- coding: utf-8 -*- citation = {'ref': u"Rose, R.W., T. Brüser,. J. C. Kissinger, and M. " u"Pohlschröder. 2002. Adaptation of protein secretion " u"to extremely high salt concentrations by extensive use " u"of the twin arginine translocation pathway. Mol. M...
bsd-2-clause
-3,915,085,787,133,951,000
33.317073
83
0.597015
false
3.310588
false
false
false
audiolog/audiolog
src/etc/logger.py
1
4518
# -*- coding: utf-8 -*- # Audiolog Music Organizer # Copyright © 2011 Matt Hubert <matt@cfxnetworks.com> # Robert Nagle <rjn945@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free...
gpl-3.0
5,936,454,393,671,393,000
30.587413
86
0.623644
false
4.043868
false
false
false
langcog/wordbank
instruments/schemas/Mandarin_Beijing_IC.py
1
38296
from django.db import models from instruments.base import BaseTable class Mandarin_Beijing_IC(BaseTable): item_1_choices = [('understands', 'understands'), ('produces', 'produces')] item_1 = models.CharField(max_length=11, choices=item_1_choices, null=True) item_2_choices = [('understands', 'understands')...
gpl-2.0
-5,127,137,477,997,716,000
80.654584
83
0.684484
false
3.428776
false
false
false
phev8/dataset_tools
feature_calculations/window_generator.py
1
1465
def get_windows(start, end, method_name, time_reference="video", source=None): """ Generating windows Parameters ---------- start: float Start of the first window end: float End of the last window method_name: str Unique name of the window generator method time...
mit
-1,048,629,011,204,681,500
27.173077
118
0.633447
false
4.002732
false
false
false
elliottd/GroundedTranslation
models.py
1
20085
from keras.models import Model from keras.layers import Input, Activation, Dropout, Merge, TimeDistributed, Masking, Dense from keras.layers.recurrent import LSTM, GRU from keras.layers.embeddings import Embedding from keras.regularizers import l2 from keras.optimizers import Adam from keras import backend as K impor...
bsd-3-clause
3,798,316,902,697,688,000
45.066514
92
0.526861
false
4.188738
false
false
false
google-research/google-research
m_theory/dim4/so8_supergravity_extrema/code/extrema.py
1
6530
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
2,359,687,570,931,567,600
38.575758
81
0.665391
false
3.328236
false
false
false
taigaio/taiga-ncurses
tests/controllers/test_backlog_controller.py
3
20304
from concurrent.futures import Future from unittest import mock from taiga_ncurses.ui import signals, views from taiga_ncurses import controllers from taiga_ncurses.config import settings from taiga_ncurses.executor import Executor from taiga_ncurses.core import StateMachine from tests import factories def test_bac...
apache-2.0
-1,091,798,656,716,960,000
49.633416
110
0.743893
false
3.744053
true
false
false
jordens/redpid
test/iir_coeffs.py
1
3848
# Copyright 2014-2015 Robert Jordens <jordens@gmail.com> # # This file is part of redpid. # # redpid 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 l...
gpl-3.0
4,767,993,148,019,932,000
31.610169
76
0.428534
false
2.397508
false
false
false
openmotics/gateway-frontend
tools/fix-versions.py
1
2463
#!/usr/bin/env python # Copyright (C) 2016 OpenMotics BV # # This program 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 # License, or (at your option) any later version. # # Th...
agpl-3.0
-4,369,706,537,454,705,000
43.781818
119
0.564352
false
4.111853
false
false
false
dkopecek/amplify
third-party/quex-0.65.2/quex/engine/analyzer/mega_state/template/gain_transition_map.py
1
4059
# vim:set encoding=utf8: # (C) 2010-2012 Frank-Rene Schäfer from quex.engine.analyzer.mega_state.target import TargetByStateKey from quex.engine.analyzer.transition_map import TransitionMap from itertools import chain def do(ATm, AStateN, ASchemeN, BTm, BStateN, BSchemeN): """*Tm -- transitio...
gpl-2.0
321,964,611,892,124,100
37.647619
80
0.647363
false
3.665763
false
false
false
mbrandis/dosage
setup.py
1
2082
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- # Copyright (C) 2004-2005 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam # Copyright (C) 2015 Tobias Gruetzmacher from __future__ import print_function import os import codecs from setuptools import setup, find_packages def get_aut...
mit
-6,697,763,711,621,126,000
29.617647
70
0.588857
false
3.834254
true
false
false
outofthecave/spoarckle
src/spoarckle/sporcle.py
1
1234
# -*- coding: UTF-8 -*- import re """ Sporcle-specific functions """ PATTERN_REMOVE = re.compile("[.!?'\"]+") PATTERN_WHITESPACE = re.compile("[\\s/-]+") PATTERN_SAINT = re.compile("\\bst\\b") PATTERN_SUBD = re.compile("\\bsubd\\s+[a-z0-9]\\b") PATTERN_NUMERO = re.compile("\\bno\\s+[0-9]+\\b") REPLACE_CHAR = { u"á"...
bsd-2-clause
-4,848,840,276,141,749,000
21.090909
66
0.578601
false
2.53125
false
false
false
benhoff/vex
vexbot/adapters/shell/shell.py
2
11701
import re import time from os import path import shlex as _shlex import pprint as _pprint import logging from threading import Thread as _Thread from prompt_toolkit.shortcuts import PromptSession from prompt_toolkit.history import FileHistory from prompt_toolkit.patch_stdout import patch_stdout from zmq.eventloop.iolo...
gpl-3.0
8,859,230,836,180,372,000
39.912587
88
0.559867
false
4.572489
false
false
false
cjqian/incubator-airflow
tests/contrib/operators/test_ssh_operator.py
2
4071
# -*- coding: utf-8 -*- # # 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 ...
apache-2.0
4,161,081,963,431,540,700
30.55814
87
0.602555
false
3.844193
true
false
false
davidh-ssec/polar2grid
polar2grid/remap/ll2cr.py
1
9351
#!/usr/bin/env python3 # encoding: utf-8 # Copyright (C) 2014 Space Science and Engineering Center (SSEC), # University of Wisconsin-Madison. # # 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 F...
gpl-3.0
7,379,953,593,973,635,000
39.480519
137
0.639825
false
3.409041
false
false
false
cstipkovic/spidermonkey-research
python/mozbuild/mozbuild/test/configure/test_moz_configure.py
1
2671
# 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, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import absolute_import, print_function, unicode_literals from mozunit import main from mozpack import p...
mpl-2.0
-7,765,127,656,517,088,000
42.080645
78
0.548109
false
4.605172
true
false
false
xdajog/samsung_sources_i927
external/webkit/Tools/Scripts/webkitpy/layout_tests/port/google_chrome_unittest.py
15
3917
#!/usr/bin/env python # Copyright (C) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list ...
gpl-2.0
-7,916,125,607,063,575,000
46.192771
84
0.688537
false
4.309131
true
false
false
smsaladi/moltemplate
examples/coarse_grained/DNA_models/dsDNA/2strands/dsDNA_2beads=3bp_2019-10-19/measure_persistence_length/raw2blockaverage.py
4
2902
#!/usr/bin/env python err_msg = """ Typical Usage: raw2blockaverage.py N [scale_inv] < coordinate_file Coordinates read from the file coordinate_file are averaged in blocks of size N, and printed to the standard output, followed by a blank line. Excluding blank lines, the number of lines in the output e...
bsd-3-clause
-2,128,316,968,836,493,000
27.174757
78
0.620951
false
3.301479
false
false
false
StingraySoftware/HENDRICS
hendrics/plot.py
1
29872
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Quicklook plots.""" import warnings import os import copy from collections.abc import Iterable import numpy as np from stingray.gti import create_gti_mask from astropy.modeling.models import Const1D from astropy.modeling import Model from astropy.stats...
bsd-3-clause
4,142,337,214,961,044,500
29.859504
79
0.493171
false
3.604682
false
false
false
Virginian/WES-entropy-client
src-python/WesEntropy/Engine/networksource.py
1
15093
# Copyright 2014-2015 Whitewood Encryption Systems, 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 l...
apache-2.0
-7,955,564,911,750,295,000
34.935714
80
0.558935
false
4.298775
false
false
false
jeremiahyan/odoo
addons/stock_account/tests/test_stock_valuation_layer_revaluation.py
5
8263
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.exceptions import UserError from odoo.tests import Form from odoo.addons.stock_account.tests.test_stockvaluation import _create_accounting_data from odoo.addons.stock_account.tests.test_stockvaluationlayer impo...
gpl-3.0
1,304,024,256,433,676,000
46.763006
161
0.669369
false
3.578605
true
false
false
victorvde/django-denorm
test_project/test_app/tests.py
1
12736
from django.test import TestCase from django.contrib.auth.models import User,Permission from django.contrib.contenttypes.models import ContentType from denorm.denorms import install_triggers import denorm from models import Attachment, Post, Forum, Member, Tag class TestDenormalisation(TestCase): """ Tests fo...
bsd-3-clause
-8,517,345,469,108,803,000
36.792285
111
0.635207
false
3.189582
true
false
false
jsa4000/OpenGL-Python
zero/system/input/input.py
1
3083
import numpy as np import threading from ...core import EntityCatalogue, Actions from ...core.base.utils import * from ...components import InputComponent class InputManager(object): """ Input Worker Class This class will manage all the events sent by the user. The class will iterate through all the compo...
apache-2.0
-5,891,719,776,440,808,000
34.848837
81
0.61012
false
4.980614
false
false
false
Chippers255/scheduler
run.py
1
3118
# -*- coding: utf-8 -*- # run.py # # Created by Thomas Nelson <tn90ca@gmail.com> # # Created..........2015-03-12 # Modified.........2015-03-12 # Import required modules import random # Import required user made modules from scheduler import Store, Employee, Individual common_grounds = Store() employee_list = [] ...
mit
5,092,851,580,459,179,000
35.682353
91
0.669981
false
2.587552
false
false
false
rjschwei/azure-sdk-for-python
azure-mgmt-monitor/azure/mgmt/monitor/models/autoscale_notification.py
3
1603
# 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
4,241,712,019,024,682,000
33.847826
76
0.614473
false
4.553977
false
false
false
coenders/skylab
skylab/psLLH.py
2
20904
# -*- coding: utf-8 -*- r"""This file is part of SkyLab Skylab is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed...
gpl-3.0
5,311,931,978,349,368,000
32.233704
79
0.564724
false
3.789703
false
false
false
pgleeson/TestArea
lib/jython/Lib/test/test_threading_local.py
7
1583
import unittest from doctest import DocTestSuite from test import test_support class ThreadingLocalTest(unittest.TestCase): def test_derived(self): # Issue 3088: if there is a threads switch inside the __init__ # of a threading.local derived class, the per-thread dictionary # is created but...
gpl-2.0
-595,741,574,723,818,900
27.781818
71
0.567909
false
4.434174
true
false
false
amezhenin/codechef_problems
easy/pcycle.py
1
1507
#!/usr/bin/python """ http://www.codechef.com/problems/PCYCLE Testing: nosetests --with-doctest <file> Sample input 1: 8 2 4 5 1 7 6 3 8 Sample output 1: 4 1 2 4 1 3 5 7 3 6 6 8 8 Sample input 2: 8 1 2 3 4 5 6 7 8 Sample output 2: 8 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 """ def read_n_array(fn=int): """ ...
mit
1,166,538,483,182,873,000
16.321839
88
0.487724
false
2.806331
false
false
false
luzheqi1987/nova-annotation
nova/vnc/__init__.py
38
1810
#!/usr/bin/env python # Copyright (c) 2010 OpenStack Foundation # 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/LICEN...
apache-2.0
-7,956,805,474,462,706,000
37.510638
77
0.614365
false
3.818565
false
false
false
ltowarek/budget-supervisor
third_party/saltedge/swagger_client/models/report_accounts.py
1
9211
# coding: utf-8 """ Salt Edge Account Information API API Reference for services # noqa: E501 OpenAPI spec version: 5.0.0 Contact: support@saltedge.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six class ReportAccounts(ob...
mit
-24,197,647,767,253,120
30.652921
187
0.583216
false
4.215561
false
false
false
apixandru/intellij-community
python/lib/Lib/site-packages/django/db/backends/sqlite3/base.py
93
12206
""" SQLite3 backend for django. Python 2.4 requires pysqlite2 (http://pysqlite.org/). Python 2.5 and later can use a pysqlite2 module or the sqlite3 module in the standard library. """ import re import sys import datetime from django.db import utils from django.db.backends import * from django.db.backends.signals i...
apache-2.0
3,400,505,049,174,793,000
39.686667
129
0.642143
false
4.08364
false
false
false
Xicnet/burnstation
DriveSelector.py
1
2700
#!/usr/bin/python # -*- coding: utf-8 -*- import dbus import dbus.glib import sys import os import os.path import string class Drive: """ An Removable device abstraction """ def __init__ (self, device, mp, name): self.device = device self.mountpoint = mp self.name = name def umount(self): return...
gpl-3.0
-2,346,701,213,646,393,000
31.53012
154
0.645926
false
3.312883
false
false
false
Com-Mean/learningSpark
chapter4/actions.py
1
3232
#!/usr/bin/env python # -*- coding: utf-8 -*- ######################################################################### # File Name: actions.py # Author: lpqiu # mail: qlp_1018@126.com # Created Time: Fri Nov 14 10:03:50 2014 ######################################################################### from pyspark import ...
gpl-3.0
3,302,171,345,144,022,000
38.414634
88
0.548886
false
2.625508
false
false
false
mykespb/pythoner
mk-klassort.py
1
4040
#!/usr/bin/python2 # myke qp.py 2012-12-19 2 # myke: klass sorting from pprint import pprint as pp from random import choice as rc, randint as ri klen, god, godplus = 20, 2000, 4 exmin, exmax, pointmin, pointmax = 0, 4, 2, 5 nfirst = 'kate john mike pete jack max gleb alex sara tony ann'.split() nlast = 'green doomy ...
apache-2.0
3,446,878,399,451,285,000
45.436782
168
0.435149
false
2.181425
false
false
false
rawrgulmuffins/presentation_notes
pycon2016/tutorials/measure_dont_guess/handout/measuring/profile_speed.py
1
1179
# file: profile_speed.py """Profile the run time of a function with a decorator. """ import functools import timeit #1 import pystone_converter #2 speed = {} #3 def profile_...
mit
-5,758,239,283,289,519,000
38.3
71
0.394402
false
5.171053
false
false
false
sanjaymandadi/mozu-python-sdk
mozurestsdk/content/documentlists/documenttree.py
1
5773
""" This code was generated by Codezu. Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. """ from mozurestsdk.mozuclient import default as default_client from mozurestsdk.mozuurl import MozuUrl; from mozurestsdk.urllocation import UrlLocation from mozure...
apache-2.0
2,100,818,874,015,550,200
36.738562
242
0.737398
false
3.717321
false
false
false
ponty/mangui
docs/conf.py
1
1581
from path import path from setuptools import find_packages import os import sphinx import sys def read_project_version(py=None, where='.', exclude=['bootstrap', 'pavement', 'doc', 'docs', 'test', 'tests', ]): if not py: py = path(where) / find_packages(where=where, exclude=exclude)[0] py = path(py) ...
bsd-2-clause
6,728,626,266,898,976,000
22.25
114
0.644529
false
3.266529
false
false
false
Fenykepy/phiroom
src/api/user/serializers.py
1
3209
from rest_framework import serializers from user.models import User class UserSerializer(serializers.ModelSerializer): password = serializers.CharField(write_only=True, required=False) # set required to false else with browsable api # each put with empty file erase existing one avatar = serializer...
agpl-3.0
2,935,366,612,193,685,000
26.663793
80
0.473045
false
4.438451
false
false
false
istio/distroless
examples/python3/hello.py
4
1045
#!/bin/python # Copyright 2017 Google Inc. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applica...
apache-2.0
-5,241,399,982,914,486,000
32.709677
87
0.704306
false
4.019231
false
false
false
mysociety/binalerts
pylib/djangoproj/binalerts/views.py
1
6478
# views.py: # Views for Bin Alerts. # # Copyright (c) 2010 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ import re from django.http import HttpResponse, HttpResponseRedirect, Http404 from django.shortcuts import render_to_response, get_object_or_404...
agpl-3.0
-1,216,058,519,613,982,700
44.943262
133
0.644026
false
3.686966
false
false
false
eunchong/build
third_party/buildbot_8_4p1/buildbot/scripts/checkconfig.py
4
2058
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
bsd-3-clause
8,678,917,122,220,398,000
36.418182
85
0.675413
false
4.332632
true
false
false
awangga/signapp
signapp.py
1
5970
#!/usr/bin/env python """ signapp.py created by Rolly Maulana Awangga """ import config import urllib.request import random import time from Crypto.Cipher import AES import gspread from oauth2client.service_account import ServiceAccountCredentials class Signapp(object): def __init__(self): self.key = co...
agpl-3.0
-7,562,230,601,119,187,000
32.166667
216
0.563987
false
3.549346
true
false
false
zeroth/mould
mould/actions/new/__init__.py
1
1210
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Author: abhishek # @Email: abhishek@zeroth.me # @Date: 2015-06-01 10:56:26 # @License: Please read LICENSE file in project root. # @Last Modified by: abhishek # @Last Modified time: 2015-06-10 16:48:55 # plugin name is just being use for debug purpose # it has noth...
gpl-2.0
-1,339,702,668,503,752,200
28.512195
115
0.699174
false
2.894737
false
false
false
bandit145/ans-between
app.py
1
2568
#!/usr/bin/env python3 from bottle import route, run, request, response from src import db, dict_mgm, logging import json import subprocess from config import * import pexpect from cel.tasks import run_command import atexit def purge_db(): db.db_exit() def response_build(status, returndata): response.status = status...
mit
-3,903,177,340,049,020,000
35.7
130
0.719237
false
3.396825
false
false
false
qedsoftware/commcare-hq
docs/conf.py
1
8452
# -*- coding: utf-8 -*- # # CommCareHQ documentation build configuration file, created by # sphinx-quickstart on Wed Sep 3 09:42:11 2014. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # ...
bsd-3-clause
-19,893,487,730,889,980
30.774436
107
0.700426
false
3.69083
true
false
false
Sotera/track-communities
tag_relationships.py
1
3923
# # Copyright 2016 Sotera Defense Solutions 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 ag...
apache-2.0
5,912,261,012,870,403,000
34.663636
140
0.642111
false
3.228807
false
false
false
jimktrains/restfulgeo
models/CongressionalDistrict.py
1
2163
def by_point(point, conn): sql = "SELECT statefp, cd113fp \ FROM tl_rd13_42_cd113 \ WHERE ST_Contains(the_geom, ST_GeomFromText('POINT(%(lon)s %(lat)s)'))" # PGis uses lon lat with conn.cursor() as cur: cur.execute(sql, point); row = cur.fetchone() statefp = row[0] ...
gpl-3.0
2,130,246,660,815,763,000
29.464789
101
0.510402
false
3.204444
false
false
false
chrys87/fenrir
src/fenrirscreenreader/commands/commands/toggle_barrier.py
1
1025
#!/bin/python # -*- coding: utf-8 -*- # Fenrir TTY screen reader # By Chrys, Storm Dragon, and contributers. from fenrirscreenreader.core import debug class command(): def __init__(self): pass def initialize(self, environment): self.env = environment def shutdown(self): ...
lgpl-3.0
7,203,168,200,738,258,000
37.423077
167
0.62439
false
4.166667
false
false
false
testbed/testpool
testpool/core/api.py
2
2374
# Copyright (c) 2015-2018 Mark Hamilton, All rights reserved """ Pool API. """ # pylint: disable=R0902 # pylint: disable=R0903 class HostInfo(object): """ Basic host information. """ def __init__(self): self.model = None self.memory_size = None self.cpus = None self.cpu_mhz = N...
gpl-3.0
-3,723,878,899,194,630,000
26.929412
65
0.602359
false
3.822866
false
false
false
campaignmonitor/createsend-python
test/test_journey.py
1
1651
import unittest from createsend.journey import Journey class JourneyTestCase(object): def test_summary(self): self.journey.stub_request( "journeys/%s.json" % self.journey_id, "journey_summary.json") summary = self.journey.summary() self.assertEqual(summary.JourneyI...
mit
8,761,102,987,944,286,000
37.309524
127
0.66808
false
2.974775
true
false
false