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
xkmato/casepro
casepro/cases/models.py
1
21672
from __future__ import absolute_import, unicode_literals import six from dash.orgs.models import Org from dash.utils import intersection from django.contrib.auth.models import User from django.core.exceptions import PermissionDenied from django.db import models from django.db.models import Q, Count, Prefetch from dja...
bsd-3-clause
8,836,641,943,645,938,000
35.180301
117
0.611757
false
4.043284
false
false
false
lem9/weblate
weblate/trans/migrations/0073_auto_20170209_1359.py
1
1949
# -*- coding: utf-8 -*- # Generated by Django 1.11a1 on 2017-02-09 12:59 from __future__ import unicode_literals from django.db import migrations from django.db.models import Q from weblate.utils.hash import calculate_hash def calculate_id_hash(apps, schema_editor): Unit = apps.get_model('trans', 'Unit') Co...
gpl-3.0
-1,092,089,232,852,542,100
29.936508
76
0.621344
false
3.859406
false
false
false
sakisbl/OpenSesameOnline
webapp/os_online/translator/utils/file_handler.py
1
2225
# -*- coding: ascii -*- """ #============================================================================== #title :file_handler.py #description :This file is now very simple for testing purposes, it should implement its functions a lot stricter once this is migrated to...
gpl-3.0
6,105,963,210,133,149,000
32.712121
79
0.571236
false
4.303675
false
false
false
djangraw/PsychoPyParadigms
BasicExperiments/GetPerceptualThreshold.py
1
4345
#!/usr/bin/env python2 """Measure your perceptual threshold for tones using a staircase method""" # GetPerceptualThreshold.py # Created 12/16/14 by DJ based on JND_staircase_exp.py from psychopy import core, visual, gui, data, event, sound from psychopy.tools.filetools import fromFile, toFile import time, numpy # ===...
mit
384,151,951,727,987,260
34.614754
133
0.641197
false
3.316794
false
false
false
SimonBiggs/pymephisto
pymephisto/main.py
1
2954
# Copyright (C) 2015 Simon Biggs # 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. # This program is distributed in...
agpl-3.0
-473,089,541,584,239,300
40.027778
76
0.681787
false
3.841352
false
false
false
tyc85/nwsdr-3.6.3-dsc
gr-blocks/python/qa_file_metadata.py
1
6824
#!/usr/bin/env python # # Copyright 2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
gpl-3.0
-8,894,709,426,550,406,000
32.782178
79
0.598183
false
3.40689
true
false
false
typesupply/vanilla
Lib/vanilla/vanillaComboBox.py
1
4993
from AppKit import NSObject, NSComboBox from objc import python_method from vanilla.vanillaBase import VanillaBaseControl class VanillaComboBoxDelegate(NSObject): _continuous = True @python_method def _callVanillaCallback(self, notification): obj = notification.object() target = obj.targ...
mit
-7,568,559,294,945,764,000
29.631902
99
0.580012
false
4.282161
false
false
false
usnistgov/corr
corr-cloud/cloud/views/dashboard_cloud.py
1
62783
from corrdb.common import logAccess, logStat, logTraffic, crossdomain, basicAuthSession, get_or_create from corrdb.common.models import UserModel from corrdb.common.models import ProfileModel from corrdb.common.models import ProjectModel from corrdb.common.models import ApplicationModel from corrdb.common.models import...
mit
7,324,014,481,245,865,000
54.02454
346
0.516015
false
4.228381
false
false
false
abdulfaizp/adventofcode
xmas6.py
1
1127
# light_grid=[[0 for x in range(1000)] for x in range(1000)] def call_summation(light_grid): light=sum(map(sum, light_grid)) print "part one=" ,light def grid_operation(array, switch_state, light_grid): for i in range(array[0], array[2]+1): for j in range(array[1], array[3]+1): if switch_state==1...
cc0-1.0
3,651,151,422,980,804,600
24.636364
63
0.613132
false
2.608796
false
false
false
rkokkelk/Gulliver
setup.py
1
3024
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2007 Andrew Resch <andrewresch@gmail.com> # Copyright (C) 2009 Damien Churchill <damoxc@gmail.com> # # This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with # the additional special exception to link portions of t...
gpl-3.0
-5,563,119,407,252,227,000
29.545455
98
0.663029
false
3.557647
true
false
false
chengsoonong/crowdastro
crowdastro/crowd/raykar.py
1
9474
"""Raykar et al. (2010) EM crowd learning algorithm. Matthew Alger The Australian National University 2016 """ import logging import time import numpy import scipy.optimize import sklearn.linear_model from crowdastro.crowd.util import majority_vote, logistic_regression EPS = 1E-8 class RaykarClassifier(object): ...
mit
7,997,096,088,850,296,000
32.556738
80
0.504491
false
3.366418
false
false
false
yalsayyad/obs_decam
decam/makeLinearizer.py
1
3560
#!/usr/bin/env python from __future__ import absolute_import, division, print_function """Convert a DECam official linearity FITS table into LSST linearizers """ import argparse import sys import os.path from itertools import izip import numpy as np import astropy.io.fits as fits from lsst.ip.isr import LinearizeLook...
gpl-3.0
-8,891,539,034,178,568,000
47.121622
109
0.672753
false
3.552894
false
false
false
ciaran2/pyterrain
pyterrain.py
1
4479
#!/usr/bin/python from __future__ import print_function, division, unicode_literals import argparse import itertools import sys import noise import PIL.Image def main(width=800, height=600, scale=3, xoffset=0, yoffset=0, num_octaves=6, outfile='out.png', min_height=-10000, max_height=10000, **kwargs): wo...
mit
5,992,443,874,268,217,000
40.472222
116
0.649475
false
3.219986
false
false
false
googleapis/googleapis-gen
google/cloud/dialogflow/cx/v3/dialogflow-cx-v3-py/google/cloud/dialogflowcx_v3/services/sessions/transports/grpc.py
1
16139
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-6,098,608,217,688,380,000
44.590395
88
0.617572
false
4.734233
false
false
false
Datafable/gbif-dataset-metrics
extraction_module/src/descriptors.py
1
3159
import json class DatasetDescriptor(object): def __init__(self): self.data = {'NUMBER_OF_RECORDS': 0, 'ARCHIVE_GENERATED_AT': None, 'BASISOFRECORDS': {}, 'TAXON_MATCHES': {}, 'TAXONOMY': {}, 'COORDINAT...
mit
305,649,388,083,894,900
38
95
0.579297
false
3.838396
false
false
false
jrper/MeshConversion
exodus_fix.py
1
3907
#!/usr/bin/env python import vtk import sys fname=sys.argv[1] surface_ids = [] region_ids = [] r=vtk.vtkExodusIIReader() r.SetFileName(fname) r.UpdateInformation() r.GenerateGlobalNodeIdArrayOn() r.GenerateGlobalElementIdArrayOn() if vtk.VTK_MAJOR_VERSION<6: r.ExodusModelMetadataOn() r.PackExodusModelOntoOut...
apache-2.0
2,281,057,929,819,538,200
29.286822
94
0.528027
false
3.026336
false
false
false
minlexx/pyevemon
esi_client/models/get_killmails_killmail_id_killmail_hash_internal_server_error.py
1
3191
# coding: utf-8 """ EVE Swagger Interface An OpenAPI for EVE Online OpenAPI spec version: 0.4.6 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class GetKillmailsKillmailIdKillmailHashInternalServerError(obje...
gpl-3.0
3,463,119,225,552,941,000
26.273504
94
0.551865
false
4.526241
false
false
false
ryanl/go-ai
build_common.py
1
7444
import warnings warnings.filterwarnings('ignore',".*The popen2 module is deprecated*") import os import sys import subprocess def object_file_for_cpp(cpp_path, compiler_hash): fn = os.path.relpath(cpp_path).replace("/", "_") fn = fn.replace("\\", "_") return ".build/" + compiler_hash + "-" + fn + ".o" ...
gpl-3.0
8,533,475,391,195,001,000
28.539683
100
0.57684
false
3.388257
false
false
false
general-ai-challenge/Round1
src/docs/source/conf.py
1
8278
# -*- coding: utf-8 -*- # # CommAI-env documentation build configuration file, created by # sphinx-quickstart on Wed Aug 3 14:31:58 2016. # # 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
-5,703,321,606,374,672,000
30.356061
79
0.705122
false
3.712108
true
false
false
mmozeiko/RcloneBrowser
scripts/images2ico.py
1
1056
#!/usr/bin/env python3 # packs multiple images (bmp/png/...) into ico file # width and height of images must be <= 256 # pixel format of images must be 32-bit RGBA import argparse import struct import os from PIL import Image # https://python-pillow.org/ def pack(output, inp): count = len(inp) with open(output,...
unlicense
-4,691,729,051,746,938,000
29.171429
80
0.632576
false
3.115044
false
false
false
hemna/cinder-brick
brick/target/iscsi/iscsi.py
1
22830
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # 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 ...
apache-2.0
-6,240,072,186,324,997,000
36.986689
78
0.502059
false
4.198235
false
false
false
kevinr/750book-web
750book-web-env/lib/python2.7/site-packages/pinax/apps/account/views.py
1
17344
from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse from django.db import models from django.db.models import Q from django.http import HttpResponseRedirect, HttpResponseForbidden, Http404 from django.shortcuts import render_to_response, ge...
mit
-8,982,623,376,457,827,000
34.038384
89
0.605454
false
4.281412
false
false
false
KoreaCloudObjectStorage/swift3
swift3/response.py
1
20648
# Copyright (c) 2014 OpenStack Foundation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
apache-2.0
5,105,128,942,036,341,000
30.717358
79
0.650232
false
4.015558
false
false
false
maas/maas
src/maasserver/rack_controller.py
1
11068
# Copyright 2016 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Rack controller service. A service that controllers the external services on a rack controller. Using the Postgres listening service, it takes messages from the notifier and pe...
agpl-3.0
4,810,605,948,663,010,000
35.770764
79
0.585743
false
4.439631
false
false
false
dset0x/invenio
invenio/modules/deposit/tasks.py
1
17313
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2012, 2013, 2014, 2015 CERN. # # Invenio 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...
gpl-2.0
7,907,772,194,843,798,000
32.947059
86
0.588113
false
4.140875
true
false
false
alicexpp/stock_algorithm_merge
create_saddle_table.py
1
4413
# coding=utf-8 import ibm_db_dbi import random # 连接数据库 dsn = "DRIVER={IBM DB2 ODBC DRIVER};DATABASE=UACSDB0;" \ "HOSTNAME=10.25.101.8;PORT=50000;PROTOCOL=TCPIP;UID=UACSAPP;PWD=UACSAPP;" conn = ibm_db_dbi.connect(dsn, "", "") # 添加数据记录 if conn: conn.set_autocommit(True) cursor = conn.cursor() for i in...
gpl-3.0
-260,619,896,838,820,030
47.263736
131
0.490549
false
2.546984
true
false
false
ebmdatalab/openprescribing
openprescribing/matrixstore/build/generate_filename.py
1
1840
import datetime import hashlib import mmap import os.path import sqlite3 def generate_filename(sqlite_path): """ Generates a name for the supplied MatrixStore file which includes various details about it The name is structured so that sorting lexically gives the file with the latest build of the ...
mit
-7,714,276,732,155,868,000
31.280702
85
0.669022
false
3.732252
false
false
false
WilsonWangTHU/neural_graph_evolution
agent/rollout_master_agent.py
1
7693
# ----------------------------------------------------------------------------- # @brief: # modified from the code of kvfran # @modified: # Tingwu Wang # ----------------------------------------------------------------------------- import multiprocessing import init_path import os from util import log...
mit
-8,453,263,641,627,975,000
34.127854
80
0.540881
false
4.120514
false
false
false
AppVentus/AvTime-client
packages/wakatime/wakatime/projects/base.py
1
1235
# -*- coding: utf-8 -*- """ wakatime.projects.base ~~~~~~~~~~~~~~~~~~~~~~ Base project for use when no other project can be found. :copyright: (c) 2013 Alan Hamlett. :license: BSD, see LICENSE for more details. """ import logging import os log = logging.getLogger(__name__) class BaseProject(o...
bsd-3-clause
35,244,680,507,858,196
21.87037
60
0.565992
false
4.442446
false
false
false
tvarney/txtrpg
rpg/state.py
1
6023
"""Classes used for tracking game state. The game state is defined as all the data which is being used by the game itself. This excludes things like the package listing, the logging class, and various other bits defined in the rpg.app.Game class. """ from enum import IntEnum, unique from rpg.data import actor, resour...
mit
-3,572,736,627,982,435,300
33.815029
79
0.617632
false
4.226667
false
false
false
mdaif/olympia
apps/discovery/tests/test_views.py
1
26765
import json from django import test from django.core.cache import cache from django.test.utils import override_settings import mock import waffle from jingo.helpers import datetime as datetime_filter from nose.tools import eq_ from pyquery import PyQuery as pq from tower import strip_whitespace import amo import amo...
bsd-3-clause
-1,679,456,730,680,537,000
39.067365
79
0.586027
false
3.589726
true
false
false
peterbrook/assetjet
resources/build_ui_and_qrc_files.py
1
1058
import os from subprocess import call # UIs rootDir = '..' targetDir = r'app/src/assetjet/view' outDir = os.path.join(rootDir, targetDir) fileList = [] for root, subFolders, files in os.walk(rootDir): for file_ in files: if file_.endswith(".ui"): outFile = os.path.join(outDir, file_.replace(...
gpl-3.0
-4,773,971,536,668,519,000
25.475
75
0.627599
false
2.914601
false
false
false
kevin-zhaoshuai/zun
zun/db/sqlalchemy/models.py
1
10702
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
425,614,259,598,212,100
32.760252
78
0.655205
false
3.918711
false
false
false
umlfri/umlfri2
umlfri2/ufl/types/basic/number.py
1
1031
from ..base.type import UflType from .string import UflStringType class UflNumberType(UflType): _PYTHON_TYPE = None def __init__(self, default=None): self.__default = default or self._PYTHON_TYPE() @property def default(self): return self.__default @property def ...
gpl-3.0
-1,032,721,678,640,306,700
23.547619
55
0.615907
false
4.10757
false
false
false
mafagafogigante/mafagafogigante.github.io
assets/levenshtein.py
1
1262
# A function to evaluate Levenshtein distance. # # Licensed under the BSD 3-Clause license. def levenshtein(a, b): """ Evaluates the Levenshtein distance between two strings. """ if len(a) < len(b): a, b = b, a if len(b) == 0: # len(a) >= len(b) return len(a) a = ' ' + a b ...
mit
5,005,056,005,599,270,000
30.55
76
0.479398
false
3.123762
false
false
false
HIPS/gpu_numpy
gpu_numpy/gnumpy.py
1
61353
""" Copyright (c) 2010-2012 Tijmen Tieleman Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distr...
mit
472,337,198,254,759,300
55.030137
539
0.602562
false
3.606454
false
false
false
Ryex/i2c-alarmpy
smbio/ioexpander.py
1
1592
import smbus from .smb import IO, IOGroup class MCP23008: ''' call create to return a IOGroup with a IO linked to the 8 gpio pins of a MCP23008 ''' SLOTS = { 0: "A"} IODIR = 0x00 # Pin direction register GPIO = 0x09 # Register for inputs OLAT = 0x0A # Register for outputs ...
bsd-3-clause
-4,769,636,696,591,410,000
25.983051
76
0.566583
false
3.323591
false
false
false
nvlbg/gepify
gepify/providers/songs.py
1
4749
""" gepify.providers.songs ~~~~~~~~~~~~~~~~~~~~~~ Provides information about downloaded songs as well as functionality to download songs. """ import os from werkzeug.contrib.cache import RedisCache from gepify.celery import celery_app from celery.utils.log import get_task_logger from . import youtube...
mit
1,103,549,381,495,803,800
26.450867
79
0.569383
false
4.162138
false
false
false
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/eggs/docutils-0.7-py2.7.egg/EGG-INFO/scripts/rst2odt_prepstyles.py
1
1745
#!/afs/bx.psu.edu/project/pythons/linux-x86_64-ucs4/bin/python2.7 # $Id: rst2odt_prepstyles.py 5839 2009-01-07 19:09:28Z dkuhlman $ # Author: Dave Kuhlman <dkuhlman@rexx.com> # Copyright: This module has been placed in the public domain. """ Fix a word-processor-generated styles.odt for odtwriter use: Drop page size ...
gpl-3.0
-804,383,818,888,886,300
25.044776
75
0.631519
false
2.993139
false
false
false
Egomania/BlackboardIDRS
modules/PrioSimAlertContextOrient.py
1
5163
import logging import select import pyorient import time import random from topology import nodes, edges from multiprocessing import Process, Queue logger = logging.getLogger("idrs") listenTo = ['alertcontext'] name = 'PrioSimAlertContextOrient' class PlugIn (Process): def __init__(self, q, dbs): Proc...
gpl-3.0
-6,328,312,638,452,727,000
32.967105
138
0.524501
false
4.401535
false
false
false
adrianschlatter/sampleproject
src/sample/cli.py
1
1532
# -*- coding: utf-8 -*- """ This module shows how to program a command-line tool using plumbum. It consists of a tool named 'clt' (implemented in the class CommandLineTool) that has a single sub-command 'say'. >>> clt say --hello world dear world Depending on your preferences in ~/.clt_rc, your output may differ. I...
bsd-3-clause
1,760,883,401,162,253,000
21.865672
76
0.636423
false
3.458239
false
false
false
rsignell-usgs/notebook
Lorenz Differential Equations.py
1
3830
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <headingcell level=1> # Exploring the Lorenz System of Differential Equations # <markdowncell> # In this Notebook we explore the Lorenz system of differential equations: # # $$ # \begin{aligned} # \dot{x} & = \sigma(y-x) \\ # \dot{y} & = \rho x - y - xz \\ # \do...
mit
5,944,092,479,624,115,000
24.533333
300
0.670496
false
3.008641
false
false
false
PyConPune/pune.pycon.org
ticket/migrations/0001_initial.py
1
3524
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import uuid from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('contenttypes', '0002_remove_content_type_name'), ('symposion_conference', '0001_initial'...
mit
1,075,337,776,364,250,200
43.607595
115
0.551646
false
4.69241
false
false
false
zstackio/zstack-utility
kvmagent/kvmagent/plugins/localstorage.py
1
34229
__author__ = 'frank' import os import os.path import traceback import zstacklib.utils.uuidhelper as uuidhelper from kvmagent import kvmagent from kvmagent.plugins.imagestore import ImageStoreClient from zstacklib.utils import jsonobject from zstacklib.utils import linux from zstacklib.utils import shell from zstackli...
apache-2.0
-6,843,224,057,722,167,000
39.127784
235
0.640071
false
3.606089
false
false
false
googleapis/googleapis-gen
google/cloud/vision/v1p1beta1/vision-v1p1beta1-py/google/cloud/vision_v1p1beta1/services/image_annotator/client.py
1
17627
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
8,439,610,747,741,755,000
41.992683
106
0.626879
false
4.580821
false
false
false
diogommartins/ryu
ryu/services/protocols/ovsdb/client.py
1
9774
# Copyright (c) 2014 Rackspace Hosting # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
apache-2.0
-924,878,386,009,551,500
28.089286
79
0.570186
false
3.884738
false
false
false
quietcoolwu/python-playground
imooc/python_advanced/8_6_armstrong.py
1
1135
#!/usr/bin/env python # -*- coding: utf-8 -*- import time from multiprocessing import Process from threading import Thread def is_armstrong(n): a, t = [], n while t > 0: a.append(t % 10) t //= 10 k = len(a) return sum(x**k for x in a) == n def find_armstrong(a, b): print(a, b) ...
mit
8,607,423,262,137,746,000
21.254902
69
0.56652
false
3.042895
false
false
false
googleapis/googleapis-gen
google/cloud/dialogflow/v2beta1/dialogflow-v2beta1-py/google/cloud/dialogflow_v2beta1/services/conversations/transports/grpc.py
1
19002
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
1,099,683,923,145,589,500
45.009685
110
0.625724
false
4.756446
false
false
false
Readon/mvpsample
src/mvp.py
1
4459
""" Created on 2013-12-14 @author: readon @copyright: reserved @note: Supervising Controller Model-View-Presenter Pattern """ from functools import partial class Bindable(object): def is_bindable(self, entry): return False def connect(self, entry, func): return self._conversion def disc...
lgpl-3.0
-2,884,765,148,381,958,700
25.229412
94
0.591837
false
3.960036
false
false
false
ATRAN2/fureon
backend/fureon/config.py
1
1188
import os APP_ROOT = os.path.dirname(os.path.abspath(__file__)) PARENT_DIRECTORY = os.path.normpath(APP_ROOT + os.sep + os.pardir) TIME_FORMAT = '%Y-%m-%d %H-%M-%S' # If you want to be able to validate user tokens across server restarts, you # should set SECRET_KEY with a long, randomly generated string SECRET_KEY =...
apache-2.0
-4,815,479,111,863,808,000
21.846154
76
0.641414
false
3.290859
false
false
false
GeosoftInc/gxapi
spec/core/MESHUTIL.py
1
14373
from .. import Availability, Class, Constant, Define, Method, Parameter, Type gx_class = Class('MESHUTIL', doc="Mesh utility methods.") gx_defines = [ Define('SURFACE_CLIP_MODE', doc="Surface Clip Mode", constants=[ Constant('SURFACE_CLIP_ABOVE', value='0', ty...
bsd-2-clause
-7,483,536,919,962,683,000
54.929961
166
0.514715
false
5.135048
false
false
false
rogerthat-platform/rogerthat-backend
src/rogerthat/utils/crypto.py
1
4848
# -*- coding: utf-8 -*- # Copyright 2017 GIG Technology NV # # 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
-4,969,385,289,981,490,000
31.32
113
0.691007
false
3.48777
false
false
false
ragibson/Steganography
stego_lsb/LSBSteg.py
1
6997
# -*- coding: utf-8 -*- """ stego_lsb.LSBSteg ~~~~~~~~~~~~~~~~~ This module contains functions for hiding and recovering data from bitmap (.bmp and .png) files. :copyright: (c) 2015 by Ryan Gibson, see AUTHORS.md for more details. :license: MIT License, see LICENSE.md for more details. """ imp...
mit
5,358,033,740,761,818,000
33.810945
88
0.645991
false
3.320835
false
false
false
widdowquinn/pyani
pyani/scripts/subcommands/subcmd_download.py
1
14206
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # (c) The James Hutton Institute 2016-2019 # (c) University of Strathclyde 2019-2020 # Author: Leighton Pritchard # # Contact: # leighton.pritchard@strath.ac.uk # # Leighton Pritchard, # Strathclyde Institute for Pharmacy and Biomedical Sciences, # 161 Cathedral Street, # ...
mit
4,972,520,597,140,009,000
33.818627
86
0.615655
false
3.842575
false
false
false
Shoeboxam/Neural_Network
RBM/Optimize/ContrastiveDivergence.py
1
2132
from .Optimize import Optimize from ..Function import * class ContrastiveDivergence(Optimize): def __init__(self, network, environment, **kwargs): # Default parameters settings = {**{ 'batch_size': 1, # step size "learn_step": 0.01, "learn_anneal"...
mit
-6,830,207,078,291,233,000
37.071429
116
0.584897
false
4.35102
false
false
false
kevinlee12/oppia
core/domain/state_domain.py
1
127982
# coding: utf-8 # # Copyright 2018 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0
-1,158,107,157,656,910,000
40.742335
80
0.586629
false
4.73639
false
false
false
vickenty/ookoobah
ookoobah/text_float.py
1
1349
import pyglet from pyglet.gl import * class TextFloat (object): def __init__(self, text, x, y, width, font_name=None, font_size=None): self.label = pyglet.text.Label(text, x=x, y=y, font_name=font_name, font_size=font_size, multiline=True, width=width, anchor...
mit
225,176,059,302,987,330
28.326087
145
0.555967
false
3.235012
false
false
false
olduvaihand/ProjectEuler
src/python/problem112.py
1
1075
# -*- coding: utf-8 -*- # ProjectEuler/src/python/problem112.py # # Bouncy numbers # ============== # Published on Friday, 30th December 2005, 06:00 pm # # Working from left-to-right if no digit is exceeded by the digit to its left # it is called an increasing number; for example, 134468. Similarly if no digit # is ex...
mit
-543,744,797,680,380,400
40.269231
79
0.731594
false
3.450161
false
false
false
Geode/Geocoding
geode_geocoding/Google/google.py
1
4126
# -*- coding: utf-8 -*- from geode_geocoding.base import Base from geode_geocoding import IGeocode from geode_geocoding import IGeocodeReverse from geode_geocoding.keys import google_key, google_client, google_client_secret class Google(Base, IGeocode, IGeocodeReverse): def coder(self, location, **kwargs): ...
agpl-3.0
7,066,188,980,363,857,000
31.488189
97
0.58507
false
3.866917
false
false
false
FreshXOpenSource/wallaby-frontend-qt
wallaby/frontends/qt/widgets/prefs/controller.py
1
11888
# Copyright (c) by it's authors. # Some rights reserved. See LICENSE, AUTHORS. import wallaby.FX as FX from wallaby.qt_combat import * from ..baseWidget import * from wallaby.pf.peer.pref import * from twisted.internet import defer from UI_prefController import * from sheet import * from ..logics import * class Pr...
bsd-2-clause
8,065,581,601,461,928,000
29.020202
126
0.52431
false
4.123482
true
false
false
Secheron/compassion-modules
sbc_compassion/models/sponsorship_correspondence.py
1
5455
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (C) 2014-2015 Compassion CH (http://www.compassion.ch) # Releasing children from poverty in Jesus' name # @author: Emmanuel Mathier <emmanuel.mathier@gmail.com> # # The licence is in the fi...
agpl-3.0
1,935,040,518,490,311,000
41.286822
84
0.526856
false
4.04974
false
false
false
vincent99/cattle
tests/integration-v1/cattletest/core/test_private_repos.py
1
8114
from common import * # NOQA from gdapi import ApiError TEST_IMAGE = 'ibuildthecloud/helloworld' TEST_IMAGE_LATEST = TEST_IMAGE + ':latest' TEST_IMAGE_UUID = 'docker:' + TEST_IMAGE if_docker = pytest.mark.skipif("os.environ.get('DOCKER_TEST') == 'false'", reason='DOCKER_TEST is not set'...
apache-2.0
-5,575,313,734,001,153,000
37.273585
79
0.646783
false
4.161026
true
false
false
redhat-openstack/neutron
neutron/plugins/linuxbridge/agent/arp_protect.py
1
5344
# Copyright (c) 2015 Mirantis, 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 requir...
apache-2.0
-7,808,753,588,740,521,000
38.294118
78
0.647268
false
3.790071
false
false
false
gear11/pypelogs
pypeout/http.py
1
2043
import os import requests import logging LOG = logging.getLogger(os.path.basename(__file__)) class HTTP(object): """Fetches Web URLs to a directory, where the URL is pulled from one of the event fields. example: python pypelogs.py flickr:/cygdrive/c/git/GPSPressServer/data/flickr.creds \ 'exec:e["u...
gpl-3.0
-8,343,815,217,059,752,000
36.145455
114
0.534998
false
3.721311
false
false
false
deeplook/notebooks
planecrashinfo/build_geolocations.py
1
2502
#! /usr/bin/env python """ Build a JSON file with geo-locations from plane crash places in the DB. """ import os import time import json import random import geopy from geopy.geocoders import Nominatim import pandas as pd from planecrashinfo_light import clean_database geolocator = Nominatim() def location_to_l...
mit
6,700,017,325,210,706,000
26.8
110
0.577138
false
3.518987
false
false
false
thaihungle/deepexp
rare-mann/mimic_train.py
1
13639
r"""Script for training model. Simple command to get up and running: python train.py --memory_size=8192 \ --batch_size=16 --validation_length=50 \ --episode_width=5 --episode_length=30 """ import logging import os import random from mimic_gen import MimicDataLoader from sklearn.metrics import precision_...
mit
3,178,385,144,286,428,700
38.195402
123
0.619034
false
3.486452
true
false
false
pdxacm/acmapi
tests/test_resources/test_memberships_resource.py
1
10662
""" """ import unittest import json import datetime from freezegun import freeze_time from flask import Flask from flask.ext.restful import fields, marshal from flask.ext.restful.fields import MarshallingException from acmapi.fields import Date from acmapi.fields import root_fields from acmapi.fields import event...
bsd-3-clause
4,782,127,255,784,261,000
30.826866
73
0.43444
false
4.479832
true
false
false
ErinMorelli/em-slack-tableflip
slack_tableflip/app.py
1
2032
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Copyright (c) 2015-2021 Erin Morelli. 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...
mit
-426,496,982,345,106,100
31.253968
78
0.708169
false
4.096774
false
false
false
scollis/iris
lib/iris/fileformats/pp_rules.py
1
24218
# (C) British Crown Copyright 2013 - 2014, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
gpl-3.0
-770,239,596,341,281,500
39.978003
146
0.534974
false
3.307115
false
false
false
achesak/rock-collector
resources/dialogs/add_fossil.py
1
4909
# -*- coding: utf-8 -*- # This file defines the Add Fossil dialog. # Import GTK for the dialog. from gi.repository import Gtk class AddFossilDialog(Gtk.Dialog): """Shows the "Add Fossil" dialog.""" def __init__(self, parent): """Create the dialog.""" # This window should be m...
mit
8,488,670,503,497,310,000
42.061404
210
0.595844
false
3.13074
false
false
false
eblot/miscripts
Python/email/extract.py
1
8132
#!/usr/bin/env python2.7 # Get error kinds from postfix log messages import os import re import sys class Extractor(object): # 2.X.X Success # 4.X.X Persistent Transient Failure # 5.X.X Permanent Failure EXTCODES = { 0: { None: 'Undefined', 0: 'Other undefined...
mit
5,211,755,508,416,146,000
31.923077
83
0.481677
false
4.35099
false
false
false
ksteinfe/decodes
src/decodes/extensions/poisson_sampling.py
1
2746
import decodes.core as dc from decodes.core import * import math as m import random class Poisson_Sampler(): def __init__(self, bds, r): self.r = r self.r_sqr = r*r self.cell_size = r/m.sqrt(2) self.dom_x, self.dom_y = bds.ival_x, bds.ival_y self.len_row = int(...
gpl-3.0
8,593,098,177,492,020,000
31.317647
86
0.495266
false
3.365196
false
false
false
googleapis/googleapis-gen
google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/types/remarketing_action_service.py
1
5325
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
7,446,077,897,593,843,000
31.469512
140
0.665728
false
4.23965
false
false
false
syci/ingadhoc-odoo-addons
product_catalog_aeroo_report_public_categ/product_catalog.py
1
1399
# -*- coding: utf-8 -*- from openerp import fields, models, api class product_catalog_report(models.Model): _inherit = 'product.product_catalog_report' category_type = fields.Selection( [('public_category', 'Public Category'), ('accounting_category', 'Accounting Category')], 'Categor...
agpl-3.0
1,170,179,172,924,399,400
34.871795
72
0.599714
false
4.358255
false
false
false
anhaidgroup/py_entitymatching
py_entitymatching/matcher/linregmatcher.py
1
3321
""" This module contains functions for linear regression classifier. """ import logging from array import array from py_entitymatching.matcher.mlmatcher import MLMatcher from py_entitymatching.matcher.matcherutils import get_ts from sklearn.linear_model import LinearRegression from sklearn.base import BaseEstimator ...
bsd-3-clause
3,808,090,816,347,291,600
31.242718
84
0.605239
false
4.1
false
false
false
martindurant/astrobits
xspecs.py
1
3377
import pyfits from pylab import * from startup import weighted_mean as WM def data_in(file): """read XMM spectra file with columns CHANNEL,FLUX,ERROR""" fred = pyfits.open(file) table = fred[1].data fred.close() wave = table.field("CHANNEL") flux_l = table.field("FLUX") err = table.field("...
mit
-1,056,755,557,853,327,100
30.858491
81
0.569144
false
2.88386
false
false
false
MalloyPower/parsing-python
front-end/testsuite-python-lib/Python-3.0/Lib/lib2to3/refactor.py
1
19294
#!/usr/bin/env python2.5 # Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Refactoring framework. Used as a main program, this can refactor any number of files and/or recursively descend down directories. Imported as a module, this provides infrastructure to write...
mit
7,022,703,301,037,726,000
36.175337
81
0.555406
false
4.188884
true
false
false
CedricVallee/pythonFinancialAnalyst
FinancialAnalystV1/main.py
1
5016
# -*- coding: utf-8 -*- """ Created on Mon Feb 29 2016 Author: Cedric Vallee """ import os import re from bs4 import BeautifulSoup import pandas as pd import numpy as np import nltk from nltk.corpus import stopwords from sklearn.cross_validation import train_test_split from sklearn.feature_extraction.text import Count...
mit
8,115,462,736,294,871,000
48.176471
173
0.663477
false
4.016013
true
false
false
cbuehler/gwyddion
utils/check-coding-style.py
1
17756
#!/usr/bin/python from __future__ import generators import re, sys, types """\ Check for some gwyddion coding style violations. Can be set as makeprg in vim :set makeprg=check-coding-style.py\ % and then simple :make performs the check. """ # Compatibility with Pyhton-2.2 if not __builtins__.__dict__.has_key('...
gpl-2.0
-2,385,844,240,559,351,000
36.381053
88
0.519881
false
3.530722
false
false
false
cuijiaxing/nlp
keysearch.py
1
2866
import api import collections import math #load corenlp if not loaded if not (api.corenlp): api.getcorenlp() corenlp = api.corenlp #ignore these POS IGNORE = {'DT','.',',','\''} #weights given to POS #POS not in this are given default value of 1 POSWGHT = {'RB': 0.7,\ 'RBR':0.7,\ 'RBS':0.7,...
gpl-2.0
-9,006,341,593,867,970,000
22.883333
80
0.465108
false
3.149451
false
false
false
jbalogh/zamboni
apps/compat/models.py
1
1205
from django.db import models import json_field import amo.models class CompatReport(amo.models.ModelBase): guid = models.CharField(max_length=128) version = models.CharField(max_length=128) app_guid = models.CharField(max_length=128) app_version = models.CharField(max_length=128) app_build = mod...
bsd-3-clause
8,179,623,185,207,170,000
27.023256
64
0.628216
false
3.575668
false
false
false
malyshevan/python-kurs
domashka-1.py
1
1149
# Задание 1 a = 10 * 100 b = 15 * 25 c = a / b d = a - b * 2 print (d) # Задание 2 #plates = int(input('Количество тарелок: ')) #detergent1 = plates * 0.5 #print ('Количество требуемового моющего средства:', detergent1) #while (plates <= detergent1): # detergent1 = plates * 0.5 # plates1 = (d...
apache-2.0
5,505,648,916,063,613,000
22.297297
64
0.587319
false
1.614004
false
false
false
guerrerocarlos/fiware-IoTAgent-Cplusplus
tests/e2e_tests/component/iot_mqtt/commands/send/setup.py
1
3115
import time, re, datetime from common.steps import service_created_precond,device_with_commands_created_precond,check_status_info from lettuce import step, world from iotqautils.cbUtils import CBUtils from common.gw_mqtt_commands import mqtt_command from threading import Thread from common.gw_configuration import...
agpl-3.0
-7,150,117,471,971,104,000
34.670588
141
0.615088
false
3.317359
false
false
false
AppsFuel/django-social-auth-appsfuel
django_social_auth_appsfuel/backend.py
1
1775
import json from urllib import urlencode from social_auth.backends import BaseOAuth2, OAuthBackend from social_auth.utils import dsa_urlopen class AppsfuelBackend(OAuthBackend): name = 'appsfuel' def get_user_id(self, details, response): return response['user_id'] def get_user_details(self, resp...
bsd-3-clause
-814,210,071,480,194,800
30.696429
72
0.667606
false
3.40691
false
false
false
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractOniichanyamete.py
1
4232
def extractOniichanyamete(item): """ お兄ちゃん、やめてぇ! / Onii-chan Yamete """ if 'Manga' in item['tags']: return None vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or 'preview' in item['title'].lower(): return None tagmap = [ ('The Bathroom Goddess', ...
bsd-3-clause
4,339,560,175,192,404,000
70.169492
163
0.587661
false
3.144569
false
false
false
Stefan-Korner/SpacePyLibrary
UTIL/TCP.py
1
11946
#****************************************************************************** # (C) 2018, Stefan Korner, Austria * # * # The Space Python Library is free software; you can redistribute it and/or * ...
mit
6,903,421,643,669,972,000
40.051546
101
0.495396
false
5.214317
false
false
false
mira67/TakeoutDataAnalysis
python/cluster_indice.py
1
4668
from __future__ import print_function from sklearn.datasets import make_blobs from sklearn.cluster import KMeans from sklearn.metrics import silhouette_samples, silhouette_score import matplotlib.pyplot as plt import matplotlib.cm as cm import numpy as np from numpy import genfromtxt print(__doc__) # Generating the...
gpl-3.0
5,147,342,164,491,177,000
35.476563
99
0.634961
false
3.164746
false
false
false
skftn/findex-gui
findex_gui/controllers/admin/routes.py
1
2873
import os import json import tempfile import shutil from flask import request, redirect, url_for from werkzeug.utils import secure_filename from findex_gui.web import app, themes, db from findex_gui.bin.misc import version from findex_gui.controllers.admin.status.status import AdminStatusController from findex_gui.co...
mit
5,788,433,839,274,408,000
27.445545
90
0.697181
false
3.461446
false
false
false
samdroid-apps/aslo
hookin/backend.py
1
2432
import re import os import json import requests from contextlib import contextmanager from pykafka import KafkaClient client = KafkaClient(hosts='freedom.sugarlabs.org:9092') topic = client.topics['org.sugarlabs.hook'] producer = topic.get_producer() ACTIVITIES = os.environ.get('ASLO_ACTIVITIES_ROOT') ACTIVITIES_GIT...
agpl-3.0
3,715,719,555,030,571,500
24.6
78
0.594984
false
3.571219
false
false
false
mhils/mitmproxy
test/mitmproxy/addons/test_proxyserver.py
1
2363
import asyncio from contextlib import asynccontextmanager import pytest from mitmproxy.addons.proxyserver import Proxyserver from mitmproxy.proxy.protocol.http import HTTPMode from mitmproxy.proxy2 import layers from mitmproxy.proxy2.context import Address from mitmproxy.test import taddons class HelperAddon: d...
mit
-3,322,577,836,850,086,000
33.246377
92
0.629708
false
3.542729
false
false
false
execat/jenny-cli
cli_client.py
1
12125
#!/usr/bin/env python import cmd import locale import os import shlex import sys import json # Alt: pprint (http://docs.python.org/2/library/pprint.html) import itertools # For compress() from dropbox import client, rest # Set the application specific details here APP_KEY = 'nxc6d8rghbaf0kn' APP_SECRET = ...
gpl-3.0
2,876,836,987,859,144,000
32.402204
86
0.500289
false
4.020225
false
false
false
hgascon/pulsar
pulsar/common/networking.py
1
1501
import socket class Client: def __init__(self, host, port, timeout, bsize): # network client configuration self.connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.connection.connect((host, port)) self.connection.settimeout(timeout) self.bsize = bsize ...
bsd-3-clause
8,950,089,365,702,150,000
25.333333
75
0.606262
false
3.771357
false
false
false
momo9/coolShellPuzzle
tree/tree.py
1
1661
#!/usr/bin/python IN_ORDER = 'T, b, H, V, h, 3, o, g, P, W, F, L, u, A, f, G, r, m, 1, x, J, 7, w, e, 0, i, Q, Y, n, Z, 8, K, v, q, k, 9, y, 5, C, N, B, D, 2, 4, U, l, c, p, I, E, M, a, j, 6, S, R, O, X, s, d, z, t' POST_ORDER = 'T, V, H, o, 3, h, P, g, b, F, f, A, u, m, r, 7, J, x, e, w, 1, Y, Q, i, 0, Z, n, G, L, K,...
gpl-2.0
7,981,765,609,711,647,000
30.942308
199
0.54425
false
2.547546
false
false
false
csira/wallace
tests/cases/models/nosql/key.py
1
2298
import functools from tests.utils import should_throw from tests.utils.registry import register from wallace.db import String, NoSqlModel from wallace.errors import SetupError def _insert(f): @functools.wraps(f) def wraps(): class Driver(NoSqlModel): pass return f(Driver) ret...
bsd-3-clause
8,186,120,909,706,727,000
18.982609
51
0.611401
false
3.607535
false
false
false
bstevant/fog-photosharing
metahub/metahub.py
1
6391
from flask import Flask, jsonify, abort, request, make_response, url_for from tinydb import TinyDB, where, Query import uuid, time import consul from docopt import docopt from consuldb import ConsulDB db = TinyDB('./db.json') photos = db.table('photos') albums = db.table('albums') consulhost = "localhost" consulport ...
apache-2.0
1,124,381,361,634,292,500
29.004695
113
0.509153
false
3.752789
false
false
false
babelsberg/babelsberg-r
topaz/modules/ffi/dynamic_library.py
1
3153
from topaz.module import ClassDef from topaz.objects.objectobject import W_Object from topaz.modules.ffi.pointer import W_PointerObject from topaz.coerce import Coerce from rpython.rlib import clibffi from rpython.rtyper.lltypesystem import rffi class W_DynamicLibraryObject(W_Object): classdef = ClassDef('Dynamic...
bsd-3-clause
6,379,827,330,964,220,000
40.486842
78
0.616556
false
3.404968
false
false
false
dede67/callmon
MessageToDatabase.py
1
8455
#!/usr/bin/env python # -*- coding: utf-8 -*- import threading from Queue import Queue import time import lxml.html from CallMonitorMessage import CallMonitorMessage from Database import Database # 23.04.2015 Änderung bei der 11880-Suche von h3 auf h1 in root.cssselect() # #########################################...
gpl-3.0
5,388,574,177,785,709,000
39.185714
122
0.523166
false
3.107143
false
false
false
Tenzer/WebOS
WebOS.py
1
9602
import functools import json import os import subprocess import sys import threading import sublime import sublime_plugin def main_thread(callback, *args, **kwargs): sublime.set_timeout(functools.partial(callback, *args, **kwargs), 0) class CliThread(threading.Thread): def __init__(self, command, command_d...
mit
-3,887,552,629,875,416,000
33.415771
104
0.574464
false
3.889024
false
false
false
thp44/delphin_6_automation
data_process/validation/download_results.py
1
6278
__author__ = "Christian Kongsgaard" __license__ = 'MIT' # -------------------------------------------------------------------------------------------------------------------- # # IMPORTS # Modules import pandas as pd import os import yaml # RiBuild Modules from delphin_6_automation.database_interactions import mongo...
mit
3,557,392,102,486,883,000
32.393617
120
0.672826
false
3.397186
false
false
false
AlexAkulov/worker
tests/functional/__init__.py
1
4416
import sys import os sys.path.insert(0, os.path.abspath( os.path.join( os.path.abspath( os.path.dirname(__file__)), '../../'))) from fakeredis import FakeStrictRedis, FakePipeline from StringIO import StringI...
gpl-3.0
-5,092,589,630,834,701,000
30.542857
113
0.637002
false
3.98916
true
false
false