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
Anushi/inhousemenu
search_recipes/views.py
1
14147
import operator from django.shortcuts import render from django.http import HttpResponse from .models import RecipeList, RecipeIngredient, RecipeContent2, IngredientList from django.db.models import Q import itertools # Create your views here. def search_recipes_form(request): ingredients_name_list = Ingredien...
mit
-8,943,540,473,010,711,000
35.37018
180
0.581466
false
3.417975
false
false
false
kallimachos/archive
games/sonar.py
1
6342
# Sonar import random import sys def drawBoard(board): # Draw the board data structure. hline = ' ' # initial space for the numbers down the left side of the board for i in range(1, 6): hline += (' ' * 9) + str(i) # print the numbers across the top print(hline) print(' ' + ('0123456789' * 6)) print() # p...
gpl-3.0
-1,569,769,953,806,892,800
35.034091
133
0.694734
false
3.1226
false
false
false
fernandog/Medusa
ext/sqlalchemy/orm/descriptor_props.py
1
27751
# orm/descriptor_props.py # Copyright (C) 2005-2018 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Descriptor properties are more "auxiliary" properties that exist as confi...
gpl-3.0
7,448,052,880,767,229,000
34.993515
79
0.569097
false
4.754326
false
false
false
fy/compare_dp_mechanisms
notebooks/utility_functions.py
1
3409
# -*- coding: utf-8 -*- # <nbformat>3.0</nbformat> # <markdowncell> # Utility functions. # <codecell> import numpy as np # <codecell> def get_chisq_sensitivity(NN_case, NN_control): """sensitivity for the chi-square statistic based on 2x3 genotype tables""" NN = NN_case + NN_control # total number of sub...
mit
3,960,275,843,723,750,000
32.097087
111
0.576709
false
3.032918
false
false
false
Flavsditz/projects
eyeTracking/pupil/pupil_src/shared_modules/uvc_capture/mac_video/cf_string.py
1
2685
''' (*)~---------------------------------------------------------------------------------- Pupil - eye tracking platform Copyright (C) 2012-2013 Moritz Kassner & William Patera Distributed under the terms of the CC BY-NC-SA License. License details are in the file license.txt, distributed as part of this softwar...
gpl-2.0
-7,743,753,104,019,920,000
35.283784
100
0.731844
false
3.451157
false
false
false
1Strategy/security-fairy
aws_iam_policy.py
1
5068
import logging import json import re class IAMPolicy: def __init__(self, logging_level = logging.DEBUG): logging.basicConfig(level=logging_level) self.statements = [] self.service_actions = {} self.max_policy_size = { 'user' : 2048, # User policy size c...
apache-2.0
-6,934,768,332,968,634,000
37.105263
139
0.572612
false
4.553459
false
false
false
khalido/nd101
tf_save_check.py
1
1112
import tensorflow as tf # The file path to save the data save_file = './model.ckpt' # Two Tensor Variables: weights and bias weights = tf.Variable(tf.truncated_normal([2, 3])) bias = tf.Variable(tf.truncated_normal([3])) # Class used to save and/or restore Tensor Variables saver = tf.train.Saver() with tf.Session() ...
gpl-3.0
3,808,513,290,078,029,300
24.883721
52
0.690647
false
3.507886
false
false
false
hakuya/higu
lib/hdbfs/query.py
1
12573
import calendar import datetime import hdbfs import model class TagConstraint: def __init__( self, tag ): self.__tag = tag def to_db_constraint( self, db ): if( isinstance( self.__tag, hdbfs.Obj ) ): tag = self.__tag elif( isinstance( self.__tag, int ) ): t...
bsd-2-clause
-7,394,012,294,911,807,000
30.198511
83
0.459318
false
3.879358
false
false
false
eloquence/unisubs
docs/conf.py
1
6953
# -*- coding: utf-8 -*- # # Amara documentation build configuration file, created by # sphinx-quickstart on Mon Jul 25 14:58:38 2011. # # 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. # # All c...
agpl-3.0
-4,141,644,483,052,377,000
30.894495
80
0.709766
false
3.712226
true
false
false
brguez/TEIBA
src/python/mergeVCF.py
1
2384
#!/usr/bin/env python #coding: utf-8 #### FUNCTIONS #### def header(string): """ Display header """ timeInfo = time.strftime("%Y-%m-%d %H:%M") print '\n', timeInfo, "****", string, "****" def subHeader(string): """ Display subheader """ timeInfo = time.strftime("%Y-%m-%...
gpl-3.0
-8,237,825,818,623,232,000
22.544554
136
0.666526
false
3.289073
false
false
false
jdavidrcamacho/Tests_GP
08 - Thesis results/speed_test6.py
1
5414
import Gedi as gedi import george import numpy as np; import matplotlib.pylab as pl; pl.close('all') from time import time,sleep import scipy.optimize as op import sys ##### INITIAL DATA ########################################################### nrep = 1 pontos=[] temposQP=[] temposmulti=[] georgeQP=[] sleept...
mit
-2,779,067,002,796,960,300
32.84375
92
0.598079
false
3.373209
false
false
false
ArtBIT/Droptopus
droptopus/forms.py
1
3409
import os import logging from droptopus import config, settings from PyQt5.QtCore import Qt from PyQt5.QtWidgets import ( QDialog, QDialogButtonBox, QFileDialog, QFormLayout, QHBoxLayout, QLabel, QLineEdit, QMessageBox, QPushButton, ) from PyQt5.QtGui import QPixmap class EditIte...
mit
-2,698,943,702,042,871,000
27.889831
87
0.563802
false
3.896
false
false
false
nwokeo/supysonic
supysonic/frontend/folder.py
1
3211
# coding: utf-8 # This file is part of Supysonic. # # Supysonic is a Python implementation of the Subsonic server API. # Copyright (C) 2013 Alban 'spl0k' Féron # # 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 F...
agpl-3.0
8,356,012,142,312,733,000
29.571429
90
0.718069
false
3.27551
false
false
false
janusnic/dj-21v
unit_06/mysite/blog/models.py
1
1855
from django.db import models import datetime from django.utils import timezone from django.utils.encoding import python_2_unicode_compatible class Category(models.Model): name = models.CharField(max_length=100) slug = models.SlugField(max_length=100, unique=True, verbose_name='slug') description = models.T...
mit
8,088,167,505,696,857,000
39.326087
137
0.687871
false
3.608949
false
false
false
tischlda/mopidy-oe1
mopidy_oe1/library.py
1
5362
from __future__ import unicode_literals import logging import re from client import OE1Client from mopidy import backend from mopidy.models import Ref, Track logger = logging.getLogger(__name__) class OE1Uris(object): ROOT = 'oe1:directory' LIVE = 'oe1:live' CAMPUS = 'oe1:campus' ARCHIVE = 'oe1:ar...
apache-2.0
2,123,299,529,363,965,000
32.304348
77
0.567326
false
3.406607
false
false
false
antoniorohit/xbob.spkrec
xbob/spkrec/script/external_vad_conversion.py
1
2026
#!bin/python # vim: set fileencoding=utf-8 : # Elie Khoury <Elie.Khoury@idiap.ch> # Fri Aug 30 11:44:33 CEST 2013 # # Copyright (C) 2012-2013 Idiap Research Institute, Martigny, Switzerland # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as...
gpl-3.0
-514,649,792,676,167,900
32.213115
94
0.698421
false
3.463248
false
false
false
psiwczak/openstack
nova/virt/baremetal/tilera.py
1
12639
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 University of Southern California # # 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/...
apache-2.0
6,158,067,869,919,608,000
33.627397
78
0.544505
false
3.778475
false
false
false
pgdr/ert
python/python/ert_gui/simulation/models/single_test_run.py
1
1111
from ecl.util import BoolVector from res.enkf.enums import HookRuntime from res.enkf import ErtRunContext from ert_gui.simulation.models import BaseRunModel, ErtRunError, EnsembleExperiment class SingleTestRun(EnsembleExperiment): def __init__(self, queue_config): super(EnsembleExperiment, self).__ini...
gpl-3.0
2,944,036,167,774,455,000
32.666667
112
0.666067
false
3.804795
false
false
false
schmidtj/PyGNA
PyGNA/graphMLRead.py
1
1143
''' This is a wrapper for the networkx graphml read/writer so that the GNA can read a graphml file with multiple graphs. The current networkx read_graphml only returns the first element in the graph list that is returned by the graphMLReader class. ''' import networkx.readwrite.graphml as ml def read_graphml(path,no...
bsd-3-clause
4,107,397,642,745,463,300
33.666667
76
0.67804
false
4.053191
false
false
false
FescueFungiShare/hydroshare
hs_tools_resource/page_processors.py
1
7367
from mezzanine.pages.page_processors import processor_for from crispy_forms.layout import Layout, HTML from hs_core import page_processors from hs_core.views import add_generic_context from forms import UrlBaseForm, VersionForm, SupportedResTypesForm, ToolIconForm, \ SupportedSharingStatusForm, AppH...
bsd-3-clause
1,497,654,030,710,353,200
51.248227
95
0.532917
false
4.467556
false
false
false
VirgilSecurity/virgil-sdk-python
virgil_sdk/signers/model_signer.py
1
4288
# Copyright (C) 2016-2019 Virgil Security Inc. # # Lead Maintainer: Virgil Security Inc. <support@virgilsecurity.com> # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # (1) Redistribution...
bsd-3-clause
8,491,931,940,891,143,000
42.755102
132
0.698228
false
4.411523
false
false
false
zobe123/Plex-CS
plexcs/graphs.py
1
50414
# This file is part of Plex:CS. # # Plex:CS 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. # # Plex:CS is distributed in the hop...
gpl-3.0
1,632,475,451,479,142,700
55.013333
149
0.522911
false
4.089891
false
false
false
cbertinato/pandas
pandas/tests/indexes/timedeltas/test_scalar_compat.py
1
2391
""" Tests for TimedeltaIndex methods behaving like their Timedelta counterparts """ import numpy as np import pytest import pandas as pd from pandas import Index, Series, Timedelta, TimedeltaIndex, timedelta_range import pandas.util.testing as tm class TestVectorizedTimedelta: def test_tdi_total_seconds(self): ...
bsd-3-clause
-2,343,195,333,733,465,600
36.952381
76
0.546633
false
3.644817
true
false
false
CrowdEmotion/crowdemotion-api-clients-examples
python/crowdemotion_api_client_python/models/face_video.py
1
13837
# coding: utf-8 """ CloudEmotion API v1 CrowdEmotion API OpenAPI spec version: 1.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You ...
mit
-7,702,536,492,178,499,000
23.40388
328
0.532847
false
4.313279
false
false
false
vicgc/pyAndriller
Andriller.py
1
33884
#!/usr/bin/env python3 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Andriller.py - Forensic acquisition tool for Android devices. # Website, Usage and Disclaimer: http://android.saz.lt # Copyright (C) 2013 Denis Sazonov # # This program is free software: you can redistribute it and/or mo...
gpl-3.0
2,126,477,740,589,460,500
43.998672
621
0.616427
false
2.547286
false
false
false
adaptive-learning/robomission
backend/learn/tests/test_recommendation.py
1
3737
import pytest from learn.models import Task, ProblemSet, Domain from learn.models import Student, TaskSession, Skill from learn.recommendation import get_recommendation, select_task def create_domain(): # TODO: Allow to set domain briefly, sth. like: # create_domain('m1(p1(t1, t2, t3), p2(t4, t5))'). ...
gpl-3.0
-1,803,799,994,616,128,500
33.284404
69
0.704308
false
3.275197
true
false
false
depet/scikit-learn
sklearn/decomposition/pca.py
1
20538
""" Principal Component Analysis """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis A. Engemann <d.engemann@fz-juelich.de> # # License: BSD 3 clause from math import log, sqrt import warnin...
bsd-3-clause
-5,295,474,510,407,824,000
32.23301
80
0.583991
false
4.072576
false
false
false
graik/biskit
biskit/core/trajparserFactory.py
1
3036
## ## Biskit, a toolkit for the manipulation of macromolecular structures ## Copyright (C) 2004-2018 Raik Gruenberg & Johan Leckner ## ## This program is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either v...
gpl-3.0
-8,348,231,987,865,714,000
36.02439
78
0.638011
false
4.147541
false
false
false
takluyver/xray
xray/backends/netCDF4_.py
1
4885
from collections import OrderedDict import warnings import numpy as np from common import AbstractWritableDataStore import xray from xray.conventions import encode_cf_variable from xray.utils import FrozenOrderedDict, NDArrayMixin, as_array_or_item from xray import indexing class NetCDF4ArrayWrapper(NDArrayMixin): ...
apache-2.0
2,144,527,192,232,187,000
35.729323
76
0.596725
false
4.136325
false
false
false
MagnusS/mirage-bench
test-jitsu/plot.py
1
1208
#!/usr/bin/env python import sys print "# Creating graphs from stdin (requires matplotlib)" results = {} for filename in sys.argv[1:]: results[filename] = [] with open(filename) as f: for l in f: line = l.strip() if len(line) == 0 or line[0] == '#': continue if l[0] == "!": print "Warning: Some ...
isc
409,130,284,544,493,900
20.571429
79
0.673841
false
2.862559
false
false
false
SunDwarf/curious
curious/dataclasses/role.py
1
6768
# This file is part of curious. # # curious is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # curious is distributed in the ho...
mit
-870,904,555,056,619,100
30.626168
99
0.593085
false
4.131868
false
false
false
horejsek/python-webdriverwrapper
docs/conf.py
1
10146
# -*- coding: utf-8 -*- import sys import os sys.path.insert(0, '.') sys.path.insert(0, '..') # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as str...
mit
-5,967,862,005,639,540,000
29.838906
80
0.699685
false
3.668113
false
false
false
mithrandi/eliottree
eliottree/tree.py
1
5439
from collections import OrderedDict, defaultdict def task_name(task): """ Compute the task name for an Eliot task. If we can't find a ``message_type`` or an ``action_type`` field to use to derive the name, then return ``None``. """ if task is None: raise ValueError('Cannot compute the...
mit
-8,383,232,947,113,377,000
30.994118
78
0.541644
false
4.164625
false
false
false
claashk/python-config
schema/default_reader.py
1
11785
# -*- coding: utf-8 -*- import re from .content_buffer import ContentBuffer from .error_handler import ErrorHandler class Locator(object): """Simple locator used by :class:`~schema.DefaultReader` """ def __init__(self): self.row= 0 self.col= 0 def __str__(self): """Con...
gpl-3.0
6,490,968,191,307,207,000
30.179894
90
0.51031
false
4.771255
false
false
false
ram8647/gcb-mobilecsp
tests/functional/whitelist.py
1
6236
# Copyright 2014 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 applicable law or ...
apache-2.0
-4,620,004,720,217,033,000
34.634286
79
0.652181
false
3.837538
true
false
false
mwytock/cvxpy
examples/communications/Channel_capacity_BV4.57.py
1
2632
#!/usr/bin/env python3 # @author: R. Gowers, S. Al-Izzi, T. Pollington, R. Hill & K. Briggs # Boyd and Vandenberghe, Convex Optimization, exercise 4.57 page 207 import cvxpy as cvx import numpy as np ''' Input parameters P: channel transition matrix P_ij(t) = P(output|input) at time t n: size of input m: size o...
gpl-3.0
396,468,914,431,187,900
34.712329
103
0.675365
false
2.823402
false
false
false
PavanGupta01/aerospike-admin
asadm.py
1
11499
#!/usr/bin/env python # Copyright 2013-2014 Aerospike, 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 la...
apache-2.0
7,454,791,825,567,895,000
33.325373
93
0.418906
false
4.079106
false
false
false
scemama/ninja_ocaml
ninja_ocaml.py
1
8281
#!/usr/bin/env python # # Copyright 2015 Anthony Scemama # # 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,102,097,753,415,023,000
27.555172
94
0.602705
false
3.444676
false
false
false
Comunitea/l10n-spain
l10n_es_aeat_sii/models/account_invoice.py
1
68394
# -*- coding: utf-8 -*- # Copyright 2017 Ignacio Ibeas <ignacio@acysos.com> # Copyright 2017 Studio73 - Pablo Fuentes <pablo@studio73> # Copyright 2017 Studio73 - Jordi Tolsà <jordi@studio73.es> # Copyright 2017 Otherway - Pedro Rodríguez Gil # Copyright 2017 Tecnativa - Pedro M. Baeza # Copyright 2017 Comunitea - Omar...
agpl-3.0
-6,420,739,032,322,082,000
42.225032
79
0.513249
false
3.984268
false
false
false
jcarreiro/jmc-python
essential_algorithms/chapter_2.py
1
1820
from __future__ import absolute_import import random from jmc.algorithms.searching import binary_search def coin_flip(seed=None): """Generates coin flips using a fair six-sided die.""" if seed: random.seed(seed) return random.randint(1, 6) > 3 def test_coin_flip(count): heads = 0 tails = 0 for x i...
mit
-2,899,852,987,777,092,600
28.836066
79
0.601099
false
3.238434
false
false
false
cuhk-cse/CoMonitor
benchmarks/CS_PCA_twc12/run_orangelab_temperature.py
1
1732
######################################################### # run_orangelab_temperature.py # Author: Jamie Zhu <jimzhu@GitHub> # Created: 2015/8/24 # Last updated: 2015/8/24 ######################################################### import numpy as np import os, sys, time sys.path.append('../') from commons.utils impor...
mit
5,718,934,930,505,162,000
36.652174
104
0.598152
false
3.900901
false
false
false
cpcloud/ibis
ibis/pandas/execution/tests/test_join.py
1
13150
import pandas as pd import pandas.util.testing as tm import pytest from pytest import param import ibis import ibis.common.exceptions as com pytestmark = pytest.mark.pandas join_type = pytest.mark.parametrize( 'how', [ 'inner', 'left', 'right', 'outer', param( ...
apache-2.0
-4,809,177,219,277,779,000
30.534772
79
0.615817
false
3.051752
true
false
false
ihartung/460-Lab1
lab4/Lab4.py
1
16224
from __future__ import print_function import sys sys.path.append('..') from src.sim import Sim from src.packet import Packet from dvrouting import DvroutingApp from networks.network import Network class BroadcastApp(object): def __init__(self, node): self.node = node def receive_packet(self, pack...
gpl-2.0
3,474,339,910,995,493,000
46.717647
96
0.685343
false
2.92852
false
false
false
peterhogan/python
operations_test.py
1
1700
from random import randint from random import shuffle import operator ops = { "+": operator.add, "-": operator.sub, "/": operator.truediv, "*": operator.mul} all_ops = ["+","-","/","*"]*6 shuffle(all_ops) bigs = [25,50,75,100,250,500,750,1000]*6 shuffle(bigs) smalls = [1,2,3,4,5,6,7,8,9]*6 shuffle(smalls) ...
mit
4,423,803,057,749,753,300
33
120
0.514706
false
3.505155
false
false
false
osrsbox/osrsbox-db
scripts/cache/generate_summary_models.py
1
5551
""" Author: PH01L Email: phoil@osrsbox.com Website: https://www.osrsbox.com Description: Parse OSRS cache data and extract model ID numbers for items, npcs, and objects. Known keys for models: - items: inventoryModel - npcs: models, models_2 (version 2 does not seem to be used) - objects: objectModels Copyright (c...
gpl-3.0
7,765,241,992,713,787,000
33.69375
110
0.619168
false
3.884535
false
false
false
patta42/pySICM
pySICMgui/actionhandler.py
1
2074
# Copyright (C) 2015 Patrick Happel <patrick.happel@rub.de> # # This file is part of pySICM. # # pySICM is free software: you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation, either version 2 of the License, or (at your option) any ...
gpl-3.0
4,511,619,947,610,642,000
34.758621
90
0.679364
false
4.106931
false
false
false
Valka7a/python-playground
python-course-softuni/data-structures/ex4.py
1
1336
prices = [] while True: # User input user_input = input("Enter price or stop: ") # Show warning if there isn't enough prices if user_input == 'stop': if len(prices) < 4: print("You must enter 4 or more prices.") continue else: break try: p...
mit
-4,293,241,250,670,452,700
24.207547
78
0.613024
false
3.562667
false
false
false
anubhav929/eden
modules/s3/s3fields.py
1
34578
# -*- coding: utf-8 -*- """ S3 Extensions for gluon.dal.Field, reusable fields @requires: U{B{I{gluon}} <http://web2py.com>} @copyright: 2009-2012 (c) Sahana Software Foundation @license: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associ...
mit
-5,980,965,802,391,904,000
36.914474
153
0.438834
false
4.961687
false
false
false
pz325/hornbook-django
apps/hornbook_api/hanzi_base.py
1
3751
# -*- coding: utf-8 -*- TONES = ( (0, u'轻声'), (1, u'一声'), (2, u'二声'), (3, u'三声'), (4, u'四声') ) INITIALS = ( ('b', 'b'), ('p', 'p'), ('m', 'm'), ('f', 'f'), ('d', 'd'), ('t', 't'), ('n', 'n'), ('l', 'l'), ('g', 'g'), ('k', 'k'), ('h', 'h'), ('j', 'j')...
bsd-3-clause
-8,652,714,250,542,228,000
17.408163
121
0.34867
false
2.176116
false
false
false
dkulikovsky/graphite-ch-web
webapp/graphite/render/views.py
1
20253
"""Copyright 2008 Orbitz WorldWide 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
8,425,600,202,721,885,000
35.958029
125
0.666914
false
3.913623
false
false
false
dbarbier/privot
python/test/t_AnalyticalResult_std.py
1
2108
#! /usr/bin/env python from openturns import * from math import * TESTPREAMBLE() def printNumericalPoint(point, digits) : oss = "[" eps = pow(0.1, digits) for i in range(point.getDimension()) : if i == 0 : sep = "" else : sep = "," if fabs(point[i]) < eps ...
lgpl-3.0
6,099,109,483,741,794,000
31.9375
107
0.659393
false
3.61578
false
false
false
fwilson42/irc2
irc2/ircd/channel.py
1
1684
import collections import time from . import utils from .numerics import * from ..utils import join_max_length class Channel: def __init__(self, name): self.name = name self.ts = time.time() self.topic = "haha yes look a topic" self.topic_set_at = time.time() self.topic_bel...
bsd-3-clause
-2,169,495,262,614,063,600
29.618182
102
0.576603
false
3.62931
false
false
false
USGSDenverPychron/pychron
pychron/image/toupcam/viewer.py
1
4772
# =============================================================================== # Copyright 2015 Jake Ross # # 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...
apache-2.0
1,978,467,678,381,373,400
33.832117
82
0.551551
false
3.943802
false
false
false
LuisMiranda132/FightSimulator
proy3/gabil.py
1
6524
from pyevolve import G1DList from pyevolve import GSimpleGA from pyevolve import G1DBinaryString from pyevolve import Util from pyevolve import Selectors from random import randint as rand_randint, uniform as rand_uniform, choice as rand_choice, randrange as randrange import sys MAX_SET_SIZE = 3 RULE_SIZE = 36 INITIA...
mit
-6,613,592,181,887,477,000
24.584314
114
0.578786
false
2.962761
false
false
false
gemrb/gemrb
gemrb/GUIScripts/bg2/GUICG15.py
1
3499
# GemRB - Infinity Engine Emulator # Copyright (C) 2003 The GemRB Project # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later versi...
gpl-2.0
-2,945,485,312,536,015,400
27.680328
81
0.766505
false
2.891736
false
false
false
biodec/biodec.recipe.riak
src/biodec/recipe/riak/instance.py
1
5723
# -*- coding: utf-8 -*- # Copyright (C)2012 'Biodec' # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is...
lgpl-3.0
3,816,028,748,366,181,400
32.467836
77
0.580465
false
3.231508
false
false
false
SushiTee/teerace
teerace/race/south_migrations/0016_auto__add_field_bestrun_ghost_file.py
1
9389
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'BestRun.ghost_file' db.add_column('race_bestrun', 'ghost_file', self.gf('django.db.models....
bsd-3-clause
-35,702,658,502,015,064
75.333333
182
0.545958
false
3.594564
false
false
false
bitmazk/django-people
people/models.py
1
7856
"""Models for the ``people`` app.""" from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from cms.models.pluginmodel import CMSPlugin from filer.fields.file import FilerFileField from hvad.models import TranslatedFields, Tra...
mit
-6,344,347,272,851,630,000
23.939683
77
0.594323
false
4.039075
false
false
false
Azure/azure-sdk-for-python
sdk/resources/azure-mgmt-resource/azure/mgmt/resource/policy/v2019_09_01/operations/_policy_set_definitions_operations.py
1
32458
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
mit
-3,030,877,944,952,733,700
46.522694
228
0.645727
false
4.33062
true
false
false
mworks/mworks
examples/Examples/FindTheCircle/analysis/Python/selection_counts.py
1
1241
import sys from matplotlib import pyplot import numpy sys.path.insert(0, '/Library/Application Support/MWorks/Scripting/Python') from mworks.data import MWKFile def selection_counts(filename): with MWKFile(filename) as f: r_codec = f.reverse_codec red_code = r_codec['red_selected'] green...
mit
-3,228,629,496,021,222,000
27.860465
78
0.51249
false
3.830247
false
false
false
t-/gromacs_ligand_param
tools/top2itp/RUNME2.py
1
21522
import numpy as np class merge_dihedrals: def __init__(self,filepath,filelist,dihetype='9',fmerged='merged_dihedrals.itp'): clist=[] for fi in filelist: flist1 = self.read_dihedrals(filepath+fi,t=dihetype) clist=clist+flist1 #print 'processing',fi print '...
gpl-3.0
7,514,140,246,321,269,000
42.216867
240
0.452003
false
3.362287
false
false
false
andreas-p/admin4
modPg/Function.py
1
3307
# The Admin4 Project # (c) 2013-2014 Andreas Pflug # # Licensed under the Apache License, # see LICENSE.TXT for conditions of usage from _objects import SchemaObject from _pgsql import pgQuery from wh import xlt, YesNo import logger class Function(SchemaObject): typename=xlt("Function") shortname=xlt("Function...
apache-2.0
7,796,791,559,803,237,000
31.742574
149
0.617478
false
3.350557
false
false
false
Wintermute0110/advanced-emulator-launcher
resources/rom_audit.py
1
46115
# -*- coding: utf-8 -*- # # Advanced Emulator Launcher # # Copyright (c) 2016-2017 Wintermute0110 <wintermute0110@gmail.com> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the L...
gpl-2.0
6,399,298,034,993,082,000
47.286911
122
0.563777
false
3.043427
false
false
false
glaubitz/fs-uae-debian
launcher/amitools/fs/Repacker.py
1
2618
from __future__ import absolute_import from __future__ import print_function from .ADFSVolume import ADFSVolume from amitools.fs.blkdev.BlkDevFactory import BlkDevFactory class Repacker: def __init__(self, in_image_file, in_options=None): self.in_image_file = in_image_file self.in_options = in_options s...
gpl-2.0
4,303,926,271,777,007,600
30.166667
93
0.643621
false
3.04065
false
false
false
axeltidemann/self_dot
communication.py
1
1564
#!/usr/bin/python # -*- coding: latin-1 -*- # Copyright 2014 Oeyvind Brandtsegg and Axel Tidemann # # This file is part of [self.] # # [self.] is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 # as published by the Free Software Fou...
gpl-3.0
-1,690,744,494,526,749,700
34.545455
130
0.695652
false
3.522523
false
false
false
Royal-Society-of-New-Zealand/NZ-ORCID-Hub
orcid_api_v3/models/research_resources_v30.py
1
4928
# coding: utf-8 """ ORCID Member No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: Latest Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import si...
mit
6,569,534,095,213,337,000
28.866667
119
0.581981
false
4.022857
false
false
false
oldhawaii/oldhawaii-metadata
www/oldhawaii_metadata/apps/users/forms.py
1
6532
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask import redirect from flask import request from flask import url_for from flask.ext.wtf import Form as BaseForm from sqlalchemy.orm.exc import MultipleResultsFound from sqlalchemy.orm.exc import NoResultFound from wtforms import fields from wtforms import validat...
mit
-5,542,365,095,312,385,000
28.160714
78
0.641457
false
4.067248
false
false
false
metamarcdw/metamarket
qtui/send_chanmsg_dialog.py
1
3520
#!/usr/bin/env python # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'send_chanmsg_dialog.ui' # # Created: Wed May 11 01:26:04 2016 # by: PyQt4 UI code generator 4.11.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui try: _fromUtf8 = QtC...
mit
-8,277,862,675,880,958,000
45.315789
114
0.716761
false
3.740701
false
false
false
emanlove/robotframework-selenium2library
src/SeleniumLibrary/keywords/screenshot.py
1
10147
# Copyright 2008-2011 Nokia Networks # Copyright 2011-2016 Ryan Tomac, Ed Manlove and contributors # Copyright 2016- Robot Framework 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 Licens...
apache-2.0
-5,964,730,719,708,307,000
42.549356
104
0.625505
false
4.277825
false
false
false
voltnor/gp438
src/ned/proc2.py
1
5877
""" Processing. Author: Dave Hale, Colorado School of Mines Version: 2012.05.20 --- Receiver stations: 954 - 1295 ( 954 <=> 0.000) Source stations: 1003 - ???? (1003 <=> 7.350) """ from imports import * s1 = Sampling(4001,0.002,0.000) # time sampling s2 = Sampling(342,0.015,0.000) # receiver sampling (first group at ...
epl-1.0
-1,206,655,710,301,369,000
24.663755
77
0.614259
false
2.32109
false
false
false
nacx/kahuna
kahuna/session.py
1
2458
#!/usr/bin/env jython import atexit import logging from config import Config from java.util import Properties from org.jclouds import ContextBuilder from org.jclouds.abiquo import AbiquoApiMetadata, AbiquoContext from org.jclouds.logging.slf4j.config import SLF4JLoggingModule from org.jclouds.sshj.config import SshjS...
mit
7,743,021,286,421,032,000
37.40625
77
0.616355
false
4.312281
true
false
false
JohnVinyard/zounds
zounds/spectral/weighting.py
1
2857
import numpy as np from .frequencyadaptive import FrequencyAdaptive class FrequencyWeighting(object): def __init__(self): super(FrequencyWeighting, self).__init__() def __numpy_ufunc__(self, *args, **kwargs): raise NotImplementedError() def _wdata(self, scale): return np.ones(len...
mit
-8,583,206,622,282,662,000
34.271605
79
0.563878
false
3.804261
false
false
false
jirivrany/riskflow123d-post
flowIni/transport.py
1
15980
#!/opt/python/bin/python ''' @author: Jiri Vrany A module for handling flow123d transport output Parses transport_out pos file, takes only non-zero values of concetrations and saves them to json file, also saves list of times (even if all conc at such time was zero). ''' from multiprocessing import Process, Queue, ...
gpl-2.0
-4,437,923,285,083,970,600
29.382129
125
0.545432
false
3.823881
false
false
false
Eveler/libs
__Python__/ufms_blanks/templates/editor.py
1
21334
# -*- coding: utf-8 -*- import json from json.decoder import WHITESPACE import logging from traceback import print_exc try: # from PyQt5.Qt import (QMainWindow, QApplication, QFileDialog, QToolBar, QWidget, QVBoxLayout, QTextEdit, QTimer, # QLabel, QColor, QByteArray, QBuffer, QPixmap, QBoxLayout, QPainter, QP...
gpl-3.0
5,254,551,033,503,943,000
37.737615
122
0.506158
false
3.837848
true
false
false
CrowdEmotion/crowdemotion-api-clients-examples
python/crowdemotion_api_client_python/apis/research_api.py
1
24008
# coding: utf-8 """ CloudEmotion API v1 CrowdEmotion API OpenAPI spec version: 1.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You ...
mit
6,895,661,252,991,409,000
39.727891
150
0.552447
false
4.750645
true
false
false
tymofij/adofex
transifex/resources/tests/lib/base.py
1
5917
# -*- coding: utf-8 -*- from __future__ import with_statement from mock import patch import os import logging from django.conf import settings from django.utils.hashcompat import md5_constructor from transifex.txcommon.tests import base from transifex.resources.formats.compilation import \ NormalDecoratorBuilde...
gpl-3.0
-7,842,665,203,933,623,000
38.446667
85
0.641372
false
4.555042
false
false
false
lizardsystem/lizard-htmlreport
lizard_htmlreport/migrations/0003_auto__del_field_generatedreport_dataset__add_field_generatedreport_dat.py
1
8524
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'GeneratedReport.dataset' db.delete_column('lizard_htmlreport_generatedreport', 'dataset_...
gpl-3.0
7,115,927,551,136,286,000
68.868852
203
0.564641
false
3.677308
false
false
false
sckott/pytaxize
pytaxize/gn/gni.py
1
1679
import sys import requests import json from pytaxize.refactor import Refactor class NoResultException(Exception): pass def parse(names): """ Uses the Global Names Index to parse scientific names :param names: List of scientific names. Usage:: from pytaxize import gn gn.gni...
mit
-9,037,382,266,054,791,000
23.333333
77
0.62299
false
3.47619
false
false
false
neudesk/neucloud
openstack_dashboard/dashboards/admin/flavors/tables.py
1
3841
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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 # no...
apache-2.0
-8,237,139,014,634,401,000
31.82906
78
0.631606
false
4.009395
false
false
false
olix0r/pub
lib/client/register_key.py
1
1804
import os, sys from twisted.internet.defer import inlineCallbacks, returnValue from twisted.plugin import IPlugin from twisted.python.filepath import FilePath from twisted.python.usage import UsageError from zope.interface import implements from jersey import log from pub.client import cli from pub.crypto import Ke...
bsd-3-clause
432,916,004,201,920,600
21.835443
69
0.587583
false
3.964835
false
false
false
emccode/HeliosBurn
heliosburn/django/hbproject/api/views/auth.py
1
1878
import json import hashlib import logging import os from django.http import HttpResponse, HttpResponseBadRequest from django.views.decorators.csrf import csrf_exempt from django.conf import settings from api.models import db_model logger = logging.getLogger(__name__) @csrf_exempt def login(request): """ Auth...
mit
5,699,081,220,727,780,000
33.145455
105
0.625666
false
4.220225
false
false
false
ferriman/SSandSP
raspberrypi/egocentricPanel.py
1
1082
import time from twython import TwythonStreamer import subprocess def say(words): devnull = open("/dev/null","w") subprocess.call(["espeak","-v", "en-rp",words],stderr=devnull) def showinpanel(): devnull = open("/dev/null","w") subprocess.call(["sudo","./rpi-rgb-led-matrix-master/led-matrix","-p","2","-D","1","-t...
gpl-3.0
366,088,186,372,964,700
26.74359
125
0.655268
false
3.229851
false
false
false
HexaMonkey/hexamonkey
test/resources/parser/test_msgpack.py
1
1831
import msgpack, math with open("test_msgpack.msgpack", 'w') as f: def write(str): f.write(str) def dump(item, **kwargs): msgpack.dump(item, f, **kwargs) def dumpList(list): for item in list: dump(item) write(b"\xdc\x00\x24"); dumpList([None,...
gpl-2.0
-3,161,185,039,400,671,000
18.902174
98
0.506827
false
2.778452
false
false
false
optimamodel/Optima
server/webapp/dbmodels.py
1
7577
import os #from flask_restful_swagger import swagger from sqlalchemy import text from sqlalchemy.dialects.postgresql import UUID from sqlalchemy.dialects.postgresql import JSON import optima as op from .dbconn import db, redis #@swagger.model class UserDb(db.Model): __tablename__ = 'users' id = db.Column(UU...
lgpl-3.0
8,831,208,499,364,056,000
34.577465
102
0.634024
false
3.516009
false
false
false
fredmorcos/attic
projects/plantmaker/archive/20100520/src/utils.py
1
1766
import math from schedule import Schedule def parseSolutions(solutions, plant, orderList): parsedSolutions = [] for solution in solutions: solutionItems = solution.items() schedule = Schedule() for item in solutionItems: if "enter" in item[0]: parsedItem = item[0].split("-") order = orderList.orderF...
isc
1,680,595,651,206,730,000
26.169231
65
0.686297
false
2.978078
false
false
false
TresysTechnology/setools
tests/policyrep/mls.py
1
30650
# Copyright 2015, Tresys Technology, LLC # # This file is part of SETools. # # SETools is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. ...
lgpl-2.1
-5,423,022,946,715,485,000
38.244558
100
0.592365
false
3.164034
true
false
false
olivierverdier/sfepy
sfepy/physics/potentials.py
1
3446
""" Classes for constructing potentials of atoms and molecules. """ from sfepy.base.base import * from sfepy.linalg import norm_l2_along_axis class CompoundPotential(Container): """ Sum of several potentials. """ def __init__(self, objs=None): Container.__init__(self, objs=objs) self....
bsd-3-clause
-7,074,944,824,542,105,000
21.522876
78
0.54585
false
4.025701
false
false
false
surgebiswas/poker
PokerBots_2017/Johnny/keras/applications/xception.py
2
10377
# -*- coding: utf-8 -*- """Xception V1 model for Keras. On ImageNet, this model gets to a top-1 validation accuracy of 0.790 and a top-5 validation accuracy of 0.945. Do note that the input image format for this model is different than for the VGG16 and ResNet models (299x299 instead of 224x224), and that the input p...
mit
1,069,713,095,376,036,900
43.536481
151
0.620989
false
3.53681
false
false
false
c3nav/c3nav
src/c3nav/mapdata/utils/index.py
1
1897
import operator from functools import reduce from django.core import checks from shapely import speedups if speedups.available: speedups.enable() try: import rtree except OSError: rtree_index = False class Index: def __init__(self): self.objects = {} def insert(self, va...
apache-2.0
5,152,785,575,294,487,000
26.1
106
0.555087
false
4.453052
false
false
false
atugushev/django-simple-settings
setup.py
1
1443
import os import re from setuptools import setup VERSION = re.search( r"VERSION\s*=\s*['\"](.*)['\"]", open(os.path.join(os.path.dirname(__file__), 'simple_settings', '__init__.py')).read() ).group(1) README = open(os.path.join(os.path.dirname(__file__), 'README.rst')).read() # allow setup.py to be run from ...
mit
4,488,668,001,902,991,000
33.357143
90
0.619543
false
3.797368
false
true
false
haoyutan/MSA-Framework
modules/msa/msa/contrib/master/authentication.py
1
1199
from rest_framework import exceptions from rest_framework.authentication import ( get_authorization_header, BaseAuthentication, ) from .models import MicroService class MicroServiceSecretAuthentication(BaseAuthentication): def authenticate(self, request): auth = get_authorization_header(request).spl...
mit
-5,470,964,627,476,039,000
32.305556
84
0.673895
false
4.815261
false
false
false
ornotermes/WebLights
effects/Christmas.py
1
1135
# #+ Copyright (c) 2014, 2015 Rikard Lindstrom <ornotermes@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
7,070,983,920,460,769,000
28.102564
71
0.62467
false
2.971204
false
false
false
docileninja/CTF-Tools
scheduler/scheduler.py
1
1263
import requests as r import threading from functools import wraps import os import json _tasks = [] ips = [] omitted = [] #list of names of skipped exploits def info(s): print('[*] {}'.format(s)) def warn(s): print('[-] {}'.format(s)) def schedule(func): @wraps(func) def task_func(ip): flag = func(ip) if fl...
gpl-2.0
-6,046,373,756,138,118,000
25.3125
96
0.656374
false
2.985816
false
false
false
Universal-Model-Converter/UMC3.0a
data/Python/x86/Lib/site-packages/OpenGL/GLU/glunurbs.py
1
10429
"""Implementation of GLU Nurbs structure and callback methods Same basic pattern as seen with the gluTess* functions, just need to add some bookkeeping to the structure class so that we can keep the Python function references alive during the calling process. """ from OpenGL.raw import GLU as simple from OpenGL import...
mit
-4,510,473,603,208,233,000
35.337979
106
0.636111
false
3.512631
false
false
false
odty101/MediaCollector
MediaCollector/MediaCollector/settings.py
1
3199
""" Django settings for MediaCollector project. Generated by 'django-admin startproject' using Django 1.10.3. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ im...
mit
8,056,945,365,130,964,000
24.798387
91
0.687402
false
3.515385
false
false
false
ErickMurillo/aprocacaho
aprocacaho/settings.py
1
3231
""" Django settings for aprocacaho project. Generated by 'django-admin startproject' using Django 1.9.4. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ from loca...
mit
-6,922,736,693,737,744,000
28.642202
91
0.692355
false
3.511957
false
false
false
asterisk/asterisk_rest_libraries
lib/javascript.py
1
5168
#!/usr/bin/env python """ Copyright (C) 2013 Digium, Inc. Erin Spiceland <espiceland@digium.com> See http://www.asterisk.org for more information about the Asterisk project. Please do not directly contact any of the maintainers of this project for assistance; the project provides a web site, mailing lists and IRC cha...
bsd-3-clause
2,504,914,704,043,261,400
30.512195
78
0.623839
false
3.79442
false
false
false
kxz/interstat
interstat/formatters.py
1
6274
"""Interstat's core single-line and whole-file formatters.""" from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import * from datetime import datetime from itertools import tee import re from jinja2 import Environment, ChoiceLoader, FileSystem...
mit
7,675,466,667,183,133,000
37.024242
77
0.591967
false
3.95836
false
false
false
sklam/llvmlite
llvmlite/binding/executionengine.py
1
5466
from __future__ import print_function, absolute_import from ctypes import byref, POINTER, c_char_p, c_bool, c_uint, c_void_p from . import ffi, targets # Just check these weren't optimized out of the DLL. ffi.lib.LLVMPY_LinkInJIT ffi.lib.LLVMPY_LinkInMCJIT def create_jit_compiler(module, opt=2): """Create an Ex...
bsd-2-clause
5,138,272,336,224,354,000
29.536313
78
0.637578
false
3.619868
false
false
false
Zavteq/fixofx
lib/ofx/document.py
1
3703
#coding: utf-8 # Copyright 2005-2010 Wesabe, 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 a...
apache-2.0
-1,877,798,710,501,073,700
38.393617
77
0.591142
false
3.703
false
false
false