repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
egabancho/invenio
invenio/modules/formatter/models.py
1
4792
# -*- coding: utf-8 -*- # ## This file is part of Invenio. ## Copyright (C) 2013 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 option) an...
gpl-2.0
-4,194,392,146,217,412,000
27.023392
78
0.600167
false
dlage/spotifykodiweb
spotifykodiweb/settings/defaults.py
1
2986
""" Django settings for spotifykodiweb project. Generated by 'django-admin startproject' using Django 1.8.5. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Bui...
mit
-7,200,818,063,775,890,000
25.900901
75
0.689216
false
wichert/pyramid_jwt
tests/test_policy.py
1
9249
# vim: fileencoding=utf-8 import warnings from datetime import timedelta from webob import Request from zope.interface.verify import verifyObject from pyramid.security import forget from pyramid.security import remember from pyramid.testing import testConfig from pyramid.testing import DummyRequest from pyramid.testin...
bsd-2-clause
6,635,171,839,500,509,000
31.780142
84
0.700563
false
lukovnikov/teafacto
teafacto/blocks/lang/wordembed.py
1
3771
from teafacto.blocks.seq.rnn import SeqEncoder, MaskMode from teafacto.blocks.seq.rnu import GRU from teafacto.blocks.basic import IdxToOneHot, Embedder, VectorEmbed from teafacto.blocks.lang.wordvec import Glove from teafacto.core.base import * from teafacto.core.base import tensorops as T class WordEmbed(Embedder):...
mit
-9,127,946,652,017,896,000
42.344828
115
0.603023
false
kvaps/vdsm
vdsm/virt/sampling.py
1
27239
# # Copyright 2008-2015 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed ...
gpl-2.0
-3,896,407,745,218,376,000
33.832481
79
0.556408
false
nrz/ylikuutio
external/bullet3/examples/pybullet/gym/pybullet_envs/agents/configs.py
2
4587
# Copyright 2017 The TensorFlow Agents Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
agpl-3.0
6,645,876,306,263,930,000
27.141104
110
0.683453
false
wolcomm/prngmgr
setup.py
1
1795
#!/usr/bin/env python # Copyright 2016-2017 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are 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://...
apache-2.0
-2,536,337,764,862,797,000
32.240741
79
0.698607
false
assaron/pynlc
tests/test_board.py
1
9235
# -*- coding: utf-8 -*- # # Copyrigt 2010 Aleksey Sergushichev <alsergbox@gmail.com> # # This file is part of pynlc. # Pynlc 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, ...
gpl-3.0
-5,950,442,493,698,498,000
35.401606
95
0.566748
false
robocomp/robocomp
tools/robocompdsl/templates/templateCPP/templatecpp.py
1
1432
import datetime import os from ..common.abstracttemplatesmanager import ComponentTemplatesManager from ..common.plugin_collection import PluginCollection from . import plugins FILE_PATH = os.path.dirname(os.path.realpath(__file__)) class TemplatesManagerCpp(ComponentTemplatesManager): def __init__(self, compone...
gpl-3.0
-8,428,258,205,923,799,000
39.914286
119
0.621508
false
auscompgeek/chickenpie
chickenpie/debugger.py
1
2507
#!/usr/bin/env python from __future__ import print_function import sys import traceback from chickenpie import opcodes from chickenpie.vm import Machine def boot(argv=sys.argv): m = Machine() m.load_file(argv[1]) if len(argv) >= 3: m.load_input(argv[2]) return m def input_reader(): EX...
mit
-2,740,945,060,612,117,000
23.578431
81
0.462704
false
fireeye/flare-ida
python/flare/objc2_xrefs_helper.py
1
21650
############################################ ##Author: James T. Bennett ##Objective-C xrefs helper IDApython script ############################################ ######################################################################## # Copyright 2019 FireEye # # FireEye licenses this file to you under the Apac...
apache-2.0
5,568,455,069,248,737,000
35.586806
134
0.618152
false
frastlin/PyAudioGame
pyaudiogame/console.py
1
4516
"""Simple example showing how to get keyboard events. Note that the mouse events don't work very well. Something is wrong with the pipe process that keeps the mouse event process from exiting in the inputs script. The bug has been reported, and as soon as it is fixed, uncommenting the run_mouse() function will work. pr...
mit
-3,174,759,603,819,471,400
26.375758
263
0.658547
false
SuriyaaKudoIsc/olympia
apps/devhub/tests/test_views_versions.py
1
33530
import re from datetime import datetime, timedelta import mock from nose.tools import eq_ from pyquery import PyQuery as pq from django.core.files import temp import amo import amo.tests from amo.urlresolvers import reverse from amo.tests import formset, initial from addons.models import Addon from applications.mode...
bsd-3-clause
3,534,918,667,949,309,000
39.642424
79
0.606174
false
thanm/devel-scripts
build-aosp-toolchain.py
1
8147
#!/usr/bin/python3 """Perform a previously configured AOSP toolchain build. This script kicks off a series of builds of the toolchain gcc compiler for Android. It relies on previously established symbolic links set up by hand or by "setup-aosp-toolchain-build.py". """ import getopt import importlib import multiproce...
apache-2.0
-7,819,423,786,514,250,000
25.028754
71
0.62342
false
madprof/alpha-hub
prototype/config.py
1
1644
# put this into ~/.alphahub/config.py and make sure it's not # readable by anyone else (it contains passwords!) # the host we run on and want to receive packets on; note # that "localhost" is probably the wrong thing here, you # want a host name that refers to an external network so you # can receive packets from the ...
agpl-3.0
1,029,538,902,745,399,200
33.25
60
0.720195
false
ejucovy/django-opendebates
opendebates/tests/test_registration.py
1
4946
import os from django.contrib.auth import get_user_model from django.core.urlresolvers import reverse from django.test import TestCase from django.test.utils import override_settings from .factories import UserFactory class RegisterTest(TestCase): def setUp(self): self.url = reverse('registration_regis...
apache-2.0
2,850,143,701,732,513,300
35.910448
92
0.596846
false
AdamDynamic/TwitterMetrics
TrendingTermsSentiment.py
1
1025
#!/usr/bin/env python # Scans twitter for trending terms, populates a database with the results and # then creates a json file showing trends based on the data import CreateJson as j import TwitterSearch as t import KeywordSearch as k import Log as l import logging ProcessResult = False FN_NAME = "TrendingTermsSenti...
gpl-2.0
6,986,279,648,277,726,000
26.702703
161
0.731707
false
MOOCworkbench/MOOCworkbench
docs_manager/views.py
1
2518
from django.contrib.auth.decorators import login_required from django.http import JsonResponse from django.shortcuts import redirect, render from django.views import View from experiments_manager.consumers import send_message from experiments_manager.helper import MessageStatus from git_manager.helpers.git_helper impo...
mit
-6,071,420,683,983,865,000
38.968254
83
0.72359
false
AlexandrDemin/flask_app
dbProvider.py
1
6554
import json import random from operator import itemgetter # absolutePath = '/home/noidea91/flask_app/' absolutePath = '' def randomize(inArray, randomSeed = None, count = None): tempList = inArray[:] result = [] if count == None: count = len(tempList) + 1 for i in range(1, count): if randomSeed == None: ra...
mit
-3,368,693,775,385,770,500
24.984127
94
0.742364
false
mar10/wsgidav
wsgidav/prop_man/couch_property_manager.py
1
8148
# -*- coding: utf-8 -*- # (c) 2009-2021 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav # Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php """ Implements a property manager based on CouchDB. http://wiki.apache.org/couchdb/Reference http://packages.python.o...
mit
6,544,573,960,360,797,000
30.952941
91
0.4946
false
ah-anssi/SecuML
SecuML/core/Data/Predictions.py
1
1490
# SecuML # Copyright (C) 2018 ANSSI # # SecuML 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. # # SecuML is distributed in the hope t...
gpl-2.0
-3,126,649,620,062,743,600
32.863636
73
0.67651
false
calben/retino
scripts/generate_overview_figure_one.py
1
6562
import pickle import retino from retino.plot import * from retino.utils import * sns.set_style("ticks") def plot_axon_growth_direction_algorithm(origin, end, target, ax): a_origin = origin a_end = end desired_direction_weight = 1.1 momentum_direction_weight = 1 desired_direction = get_unit_dir...
mit
-5,546,933,092,631,977,000
33
120
0.682414
false
xia2/xia2
tests/Modules/Scaler/test_DialsScalerHelper.py
1
14958
import random import pytest from cctbx import sgtbx from dials.algorithms.symmetry.cosym._generate_test_data import generate_intensities from dials.array_family import flex from dxtbx.model import Beam, Crystal, Experiment, Scan from dxtbx.model.experiment_list import ExperimentList from dxtbx.serialize import load fr...
bsd-3-clause
-598,603,767,036,162,700
36.582915
98
0.653563
false
goir/virtualenv-creator
create_virtualenv.py
1
7979
#!/usr/bin/env python # coding=utf-8 from __future__ import print_function from __future__ import unicode_literals from __future__ import absolute_import import argparse import hashlib import inspect import subprocess import sys import os import urllib2 import shutil WHEEL_PIP = 'https://pypi.python.org/packages/py2.p...
gpl-2.0
-580,758,837,980,858,800
39.095477
172
0.652964
false
regebro/svg.path
src/svg/path/tests/test_tokenizer.py
1
2492
import pytest from svg.path import parser PATHS = [ ( "M 100 100 L 300 100 L 200 300 z", [("M", "100 100"), ("L", "300 100"), ("L", "200 300"), ("z", "")], [("M", 100 + 100j), ("L", 300 + 100j), ("L", 200 + 300j), ("z",)], ), ( "M 5 1 v 7.344 A 3.574 3.574 0 003.5 8 3.515 3....
mit
8,679,883,281,088,874,000
33.611111
105
0.400482
false
JarbasAI/jarbas-core
mycroft/jarbas-skills/skill_roll_dice/__init__.py
1
1300
from os.path import dirname from adapt.intent import IntentBuilder from mycroft.skills.core import MycroftSkill from mycroft.util.log import getLogger import random __author__ = 'paul' LOGGER = getLogger(__name__) class RollDiceSkill(MycroftSkill): def __init__(self): super(RollDiceSkill, self).__init...
gpl-3.0
3,298,990,753,935,752,000
29.232558
84
0.662308
false
karimbahgat/PythonGis
pythongis/vector/saver.py
1
6720
# import builtins import itertools import math # import fileformats import shapefile as pyshp import pygeoj # PY3 fix try: str = unicode # in py2, make str synonymous with str zip = itertools.izip except: pass NaN = float("nan") def is_missing(value): return value in (None,"") or (isinstance(val...
mit
-1,759,641,893,836,171,000
37.4
138
0.536756
false
ereOn/azmq
azmq/mechanisms/plain_server.py
1
2073
""" The PLAIN server mechanism. """ from ..log import logger from .base import Mechanism class PlainServer(object): def __call__(self): return PlainServerMechanism() class PlainServerMechanism(Mechanism): name = b'PLAIN' as_server = True @classmethod async def _read_plain_hello(cls, r...
gpl-3.0
2,243,719,306,831,642,600
27.013514
77
0.581283
false
RasaHQ/rasa_nlu
rasa/nlu/featurizers/regex_featurizer.py
1
5392
import io import logging import numpy as np import os import re import typing from typing import Any, Dict, Optional, Text from rasa.nlu import utils from rasa.nlu.config import RasaNLUModelConfig from rasa.nlu.featurizers import Featurizer from rasa.nlu.training_data import Message, TrainingData logger = logging.get...
apache-2.0
6,589,500,145,067,330,000
34.708609
88
0.611091
false
javierder/dogestart.me
core/migrations/0001_initial.py
1
11514
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Tag' db.create_table(u'core_tag', ( (u'id', s...
mit
-3,946,435,351,670,234,000
62.269231
195
0.568873
false
mrooney/wxbanker
wxbanker/tests/currconverttests.py
1
1752
#!/usr/bin/env python # -*- coding: utf-8 -*- # https://launchpad.net/wxbanker # currconverttests.py: Copyright 2007-2010 Mike Rooney <mrooney@ubuntu.com> # # This file is part of wxBanker. # # wxBanker is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public...
gpl-3.0
-1,414,807,178,836,616,400
39.744186
100
0.70605
false
ruijie/quantum
quantum/plugins/rgos/common/config.py
1
2220
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 Ruijie network, 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-...
apache-2.0
6,913,264,159,414,557,000
34.806452
80
0.66036
false
looselycoupled/xbus-501-timing-demonstrations
1-example.py
1
1744
#!/usr/bin/env python # 1-example # A simple demonstration script to find the largest prime number # below a given limit. # # This file is intentionally inefficient in order to demonstrate # various ways to time execution # # Usage: # time python 1-example.py 10000 # # Author: Allen Leis <al1075@georgetown.edu> # C...
mit
4,661,781,988,558,868,000
24.647059
74
0.484518
false
CloudBoltSoftware/cloudbolt-forge
actions/cloudbolt_plugins/skeleton_order_approval_action/order_approval_skeleton.py
1
1792
import sys import time from orders.models import Order """ Plug-in example for an Orchestration Action at the "Order Approval" trigger point. May change CloudBolt's default approval behavior to implement custom logic or integrate with an external change management system. The context passed to the plug-in includes t...
apache-2.0
1,055,587,732,821,589,200
33.461538
91
0.720424
false
medworx/MedUX
medux/plugins/core/icontext.py
1
2440
# # Copyright (C) 2013 Christian A. Reiter # # This file is part of MedUX. # # MedUX 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
-8,318,707,536,714,407,000
26.727273
77
0.605738
false
stefanseefeld/synopsis
Synopsis/Formatters/HTML/Parts/Inheritance.py
1
3851
# # Copyright (C) 2000 Stephen Davies # Copyright (C) 2000 Stefan Seefeld # All rights reserved. # Licensed to the public under the terms of the GNU LGPL (>= 2), # see the file COPYING for details. # from Synopsis.Processor import Parameter from Synopsis import ASG from Synopsis.Formatters.HTML.Part import Part from S...
lgpl-2.1
-537,067,839,087,499,260
33.383929
83
0.608154
false
openmotics/gateway
src/platform_utils.py
1
15704
# Copyright (C) 2018 OpenMotics BV # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribu...
agpl-3.0
-1,422,497,468,438,690,600
37.679803
136
0.58068
false
pferreir/indico-backup
indico/web/http_api/auth.py
1
4009
# -*- coding: utf-8 -*- ## ## ## This file is part of Indico. ## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). ## ## Indico 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; eith...
gpl-3.0
41,385,180,629,257,624
27.034965
90
0.623597
false
ingadhoc/account-invoicing
account_invoice_partial/wizards/account_invoice_partial_wizard.py
1
1689
############################################################################## # For copyright and license notices, see __manifest__.py file in module root # directory ############################################################################## from odoo import models, fields from odoo.tools import float_round clas...
agpl-3.0
-1,892,231,634,111,347,500
35.717391
93
0.557134
false
woodem/woo
scripts/test-OLD/peri3dController_triaxialCompression.py
1
3506
# peri3dController_triaxialCompression.py # script, that explains funcionality and input parameters of Peri3dController on the example of # triaxial compression. # Firstly, a hydrostatic preassure is applied, then a strain along z axis is increasing # while x- and y- stress is constant # The simulation is run on ro...
gpl-2.0
8,124,165,752,349,868,000
43.379747
128
0.615231
false
knyghty/knyg.ht
pages/tests.py
1
1192
from django.core.urlresolvers import reverse from django.test import TestCase from .models import Page class PageTests(TestCase): def test_404(self): response = self.client.get('/') self.assertEqual(response.status_code, 404) def test_home(self): Page.objects.create( url=...
bsd-2-clause
-5,908,421,540,647,864,000
25.488889
67
0.525168
false
TAMU-CPT/galaxy-tools
tools/gff3/gff3.py
1
11156
import copy import logging log = logging.getLogger() log.setLevel(logging.WARN) def feature_lambda( feature_list, test, test_kwargs, subfeatures=True, parent=None, invert=False, recurse=True, ): """Recursively search through features, testing each with a test function, yielding matche...
gpl-3.0
1,892,358,789,450,623,700
31.242775
118
0.587755
false
iphoting/healthchecks
hc/front/tests/test_add_sms.py
1
3660
from django.test.utils import override_settings from hc.api.models import Channel from hc.test import BaseTestCase @override_settings(TWILIO_ACCOUNT="foo", TWILIO_AUTH="foo", TWILIO_FROM="123") class AddSmsTestCase(BaseTestCase): def setUp(self): super().setUp() self.url = "/projects/%s/add_sms/" ...
bsd-3-clause
4,603,454,562,896,313,000
36.731959
80
0.637978
false
yatmingyatming/LogisticRegressionSGDMapReduce
model_encoder.py
1
1040
#!/usr/bin/env python import sys, json, datetime, uuid, os def main(separator='\t'): id = str(uuid.uuid1()) date_created = datetime.datetime.utcnow().isoformat() + 'Z' mu = float(os.environ['MU']) if os.environ.has_key('MU') else 0.002 eta = float(os.environ['ETA']) if os.environ.has_key('ETA') else...
mit
-4,548,504,203,636,204,500
32.580645
96
0.580769
false
shakamunyi/sahara
sahara/conductor/manager.py
1
32113
# Copyright (c) 2013 Mirantis 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 agreed to in writ...
apache-2.0
1,892,088,547,725,039,400
40.27635
79
0.616915
false
gillett-hernandez/project-euler
Python/problem_192.py
1
9573
# -*- coding: utf-8 -*- # @Author: Gillett Hernandez # @Date: 2017-12-11 19:30:19 # @Last Modified by: Gillett Hernandez # @Last Modified time: 2017-12-16 17:49:47 from euler_funcs import ContinuedFraction, solve_pell, analyze_triplets, sconvergents, lag, is_square, timed from euler_funcs import timed, construct, ...
mit
7,420,151,602,678,209,000
31.444068
150
0.491171
false
vokimon/menjobe
menjobe/models.py
1
1180
from django.db import models from mptt.models import MPTTModel, TreeForeignKey class Product(MPTTModel) : name = models.CharField( max_length=200, default=None, unique=True, ) group = TreeForeignKey('self', null=True, blank=True, related_name='subgroups', default=None, ) class MPTTMeta: pare...
agpl-3.0
2,554,657,755,027,349,000
19.344828
75
0.713559
false
alexanderdreyer/polybori-debian
pyroot/polybori/gbcore.py
1
19759
from polybori.nf import * from polybori.PyPolyBoRi import * from polybori.ll import eliminate, ll_encode from time import time from copy import copy from itertools import chain from inspect import getargspec from polybori.statistics import used_vars, used_vars_set from polybori.heuristics import dense_system,gauss_on_...
gpl-2.0
-4,579,446,247,877,077,500
31.551895
147
0.568855
false
amirgeva/coide
qutepart/rectangularselection.py
1
10665
from PyQt4.QtCore import Qt, QMimeData from PyQt4.QtGui import QApplication, QKeyEvent, QKeySequence, QPalette, QTextCursor, QTextEdit, QWidget class RectangularSelection: """This class does not represent any object, but is part of Qutepart It just groups together Qutepart rectangular selection methods and fi...
gpl-2.0
-1,751,007,654,381,181,200
41.831325
104
0.595218
false
spradeepv/dive-into-python
hackerrank/contests/indeed/the_ultimate_question.py
1
1574
""" Problem Statement 42 is the answer to "The Ultimate Question of Life, The Universe, and Everything". But what The Ultimate Question really is? We may never know! Given three integers, a, b, and c, insert two operators between them so that the following equation is true: a (operator1) b (operator2) c=42. You may ...
mit
-3,525,466,171,098,270,000
22.161765
146
0.687421
false
zmlabe/IceVarFigs
Scripts/SeaIce/NSIDCseaice_quartiles.py
1
7079
""" Reads in current year's Arctic sea ice extent from Sea Ice Index 3 (NSIDC) Website : ftp://sidads.colorado.edu/DATASETS/NOAA/G02135/north/daily/data/ Author : Zachary M. Labe Date : 5 September 2016 """ ### Import modules import numpy as np import urllib.request import urllib as UL import datetime impor...
mit
-8,125,626,366,478,504,000
33.705882
85
0.599237
false
C-Codes/jupyterbar
jupyterbar/jupyterbar.py
1
4049
#!/usr/bin/env python from __future__ import print_function import os, sys import time, datetime import rumps import webbrowser from jupyter import Jupyter class JupyterStatusBarApp(rumps.App): #def __init__(self): # super(JupyterStatusBarApp, self).__init__("jupyter") # self.title="jupyter" #...
mit
3,329,891,740,349,573,600
31.134921
110
0.593727
false
regosen/gallery_get
gallery_plugins/plugin_shimmie.py
1
1738
# Plugin for gallery_get. import re from gallery_utils import * # Each definition can be one of the following: # - a string # - a regex string # - a function that takes source as a parameter and returns an array or a string. (You may assume that re and urllib are already imported.) # If you comment out a parameter, i...
mit
6,606,265,935,221,166,000
41.414634
149
0.655926
false
zchee/deoplete-jedi
rplugin/python3/deoplete/sources/deoplete_jedi.py
1
10772
import copy import logging import os import re from importlib.util import find_spec from deoplete.base.source import Base from deoplete.util import bytepos2charpos, getlines, load_external_module load_external_module(__file__, 'sources') from deoplete_jedi import profiler # isort:skip # noqa: E402 # Type mapping....
mit
-6,750,035,902,205,924,000
30.869822
86
0.512811
false
irregulator/ganetimgr
accounts/migrations/0009_auto__del_field_customregistrationprofile_admin_activated__del_field_c.py
1
7670
# -*- coding: utf-8 -*- from south.utils import datetime_utils as 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 'CustomRegistrationProfile.admin_activated' db.delete_co...
gpl-3.0
-5,851,417,538,446,304,000
65.704348
185
0.57927
false
csyhuang/hn2016_falwa
hn2016_falwa/beta_version.py
1
20465
def input_jk_output_index(j,k,kmax): return j*(kmax) + k def extrap1d(interpolator): xs = interpolator.x ys = interpolator.y def pointwise(x): if x < xs[0]: return ys[0]+(x-xs[0])*(ys[1]-ys[0])/(xs[1]-xs[0]) elif x > xs[-1]: return ys[-1]+(x-xs[-1])*(ys[-1]-ys...
mit
-4,612,132,919,616,612,000
43.200864
195
0.574151
false
jimklo/LRSignature
src/LRSignature/sign/Sign.py
1
6882
''' Copyright 2011 SRI International 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, softw...
apache-2.0
-3,173,528,914,175,409,700
35.226316
192
0.574397
false
PeridexisErrant/python-lnp
core/keybinds.py
1
2131
#!/usr/bin/env python # -*- coding: utf-8 -*- """Keybinding management.""" from __future__ import print_function, unicode_literals, absolute_import import os, shutil from . import helpers, paths, log def read_keybinds(): """Returns a list of keybinding files.""" return tuple([ os.path.basename(o) for ...
isc
7,327,233,250,507,444,000
28.191781
72
0.63069
false
spetitjean/XMG-2
contributions/core/pylibs/compgen/brick_parser.py
1
3655
import xmg.compgen.Symbol import xmg.compgen.Grammar # Punctuation semicolon=xmg.compgen.Symbol.T(";") colon=xmg.compgen.Symbol.T(":") pipe=xmg.compgen.Symbol.T("|") quote=xmg.compgen.Symbol.T("'") arrow=xmg.compgen.Symbol.T("->") equal=xmg.compgen.Symbol.T("=") coma=xmg.compgen.Symbol.T(',') openpred=xmg.compgen.Symb...
gpl-3.0
-1,720,021,076,280,352,800
28.715447
194
0.720657
false
isbadawi/maze-generation
io/canvas.py
1
1094
import Tkinter as tk import sys class Canvas(object): def __init__(self, width, height, size): self.width = width self.height = height self.size = size self.root = tk.Tk() self.root.title('Maze Generation Visualizer') self.canvas = tk.Canvas( self.root, ...
mit
-2,285,130,573,094,090,200
27.789474
68
0.538391
false
park-bench/gpgmailer
src/usr/share/gpgmailer/gpgmailerd.py
1
25135
#!/usr/bin/python3 # Copyright 2015-2021 Joel Allen Luellwitz and Emily Frost # # 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 ...
gpl-3.0
-2,618,577,787,207,613,400
40.003263
93
0.677541
false
sajuptpm/neutron-ipam
neutron/plugins/vmware/dbexts/networkgw_db.py
1
24050
# Copyright 2013 VMware, 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 a...
apache-2.0
6,341,488,234,011,928,000
47.196393
79
0.580042
false
hogasa/normalizador-amba
usig_normalizador_amba/Direccion.py
1
3312
# coding: UTF-8 ''' Created on Apr 16, 2014 @author: hernan ''' from __future__ import absolute_import import re from usig_normalizador_amba.settings import CALLE_ALTURA, CALLE_Y_CALLE, INVALIDO from usig_normalizador_amba.Calle import Calle class Direccion: ''' @ivar calle: Calle de la direccion @type ...
mit
1,672,229,273,734,386,700
28.5625
117
0.530353
false
pandada8/mirrord
mirrord/daemon.py
1
1173
import yaml from task import RsyncTask import asyncio import logging import argparse class Application(): def __init__(self): self.tasks = {} def load_config(self, config): with open(config) as fp: data = yaml.safe_load(fp) for i, j in data["task"].items(): ...
mit
6,706,579,774,450,081,000
25.659091
73
0.55584
false
rosudrag/Freemium-winner
VirtualEnvironment/Lib/site-packages/jinja2/loaders.py
1
17346
# -*- coding: utf-8 -*- """ jinja2.loaders ~~~~~~~~~~~~~~ Jinja loader classes. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import os import sys import weakref from types import ModuleType from os import path from hashlib import sha1 from jinja2.excepti...
mit
-6,711,097,313,728,890,000
35.06237
78
0.612418
false
jinankjain/zamboni
mkt/versions/tests/test_serializers.py
1
1791
from django.core.urlresolvers import reverse from nose.tools import eq_, ok_ from test_utils import RequestFactory from amo.tests import app_factory, TestCase from versions.models import Version from mkt.versions.serializers import VersionSerializer class TestVersionSerializer(TestCase): def setUp(self): ...
bsd-3-clause
-7,867,765,686,828,374,000
34.82
78
0.630374
false
omarayad1/cantkeepup
app/core/helpers.py
1
1103
from json import dumps # pragma: no cover from sqlalchemy.orm import class_mapper # pragma: no cover from app.models import User, Group # pragma: no cover def serialize(obj, columns): # then we return their values in a dict return dict((c, getattr(obj, c)) for c in columns) def queryAllToJson(model,conditions): # ...
mit
-3,075,995,795,545,022,500
30.542857
67
0.741614
false
bayesimpact/bob-emploi
frontend/server/mail/jobbing.py
1
2417
"""Focus email module for finding jobbing ideas.""" import typing from typing import Any, Dict from bob_emploi.frontend.api import user_pb2 from bob_emploi.frontend.api import reorient_jobbing_pb2 from bob_emploi.frontend.server import i18n from bob_emploi.frontend.server import mongo from bob_emploi.frontend.server ...
gpl-3.0
2,725,181,951,954,456,000
37.349206
95
0.685017
false
chrislit/abydos
abydos/tokenizer/_c_or_v_cluster.py
1
5291
# Copyright 2019-2020 by Christopher C. Little. # This file is part of Abydos. # # Abydos 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 versio...
gpl-3.0
110,880,648,427,213,950
33.129032
79
0.554253
false
chrislit/abydos
tests/distance/test_distance_fleiss_levin_paik.py
1
4910
# Copyright 2019-2020 by Christopher C. Little. # This file is part of Abydos. # # Abydos 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 versio...
gpl-3.0
9,109,054,514,301,569,000
43.636364
77
0.641752
false
stormtrader/gw_trade
dysms_python/mns_python_sdk/mns/mns_client.py
1
37956
#coding=utf-8 # Copyright (C) 2015, Alibaba Cloud Computing #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, merg...
gpl-3.0
1,831,573,942,415,423,500
45.975248
461
0.621035
false
YeEmrick/learning
stanford-tensorflow/2017/examples/07_convnet_mnist_starter.py
1
6444
""" Using convolutional net on MNIST dataset of handwritten digit (http://yann.lecun.com/exdb/mnist/) Author: Chip Huyen Prepared for the class CS 20SI: "TensorFlow for Deep Learning Research" cs20si.stanford.edu """ from __future__ import print_function from __future__ import division from __future__ import print_func...
apache-2.0
3,841,000,186,712,797,000
33.465241
97
0.652855
false
tiramiseb/abandoned_ospfm
ospfm/core/preference.py
1
2559
# Copyright 2012-2013 Sebastien Maccagnoni-Munch # # This file is part of OSPFM. # # OSPFM 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 you...
agpl-3.0
-5,509,308,294,706,889,000
36.086957
79
0.62837
false
DataKind-SG/healthcare_ASEAN
src/data/download.py
1
1439
# Call download scripts #from download import * import download.SG_disease import download.SG_weather import download.MY_dengue import download.BN_disease import download.TH_disease import download.ID_malaria import download.wunderground import download.apps_who_int import os import sys import logging import logging.c...
mit
2,998,777,852,395,966,000
23.389831
92
0.712995
false
Chris1221/Bandwidth-Daemon
daemon/teksavvy_cron.py
1
2966
#!/opt/local/bin/python #you might have to change the above to point to your local python from __future__ import division import httplib, json, time #replace this with your API key APIKEY = "API_KEY" #pull from api headers = {"TekSavvy-APIKey": APIKEY} conn = httplib.HTTPSConnection("api.teksavvy.com") conn.req...
gpl-2.0
-318,330,581,550,085,900
37.038462
311
0.629467
false
maxwu/cistat
test/test_circleci_request.py
1
4687
#!/usr/bin/env python # -*- coding: utf-8 -*- """Test CircleCI interfaces .. moduleauthor:: Max Wu <http://maxwu.me> """ import unittest import numbers import json from cistat import config from cistat.model import Xunitrpt from cistat.reqs import CircleCiReq class CircleCiReqTest(unittest.TestCase): def setU...
mit
644,672,477,948,567,000
42.803738
144
0.510988
false
robcarver17/pysystemtrade
systems/accounts/pandl_calculators/pandl_generic_costs.py
1
3494
import pandas as pd from systems.accounts.pandl_calculators.pandl_calculation import pandlCalculation, apply_weighting curve_types = ['gross', 'net', 'costs'] GROSS_CURVE = 'gross' NET_CURVE = 'net' COSTS_CURVE = 'costs' class pandlCalculationWithGenericCosts(pandlCalculation): def weight(self, weight: pd.Seri...
gpl-3.0
7,537,832,286,019,710,000
31.351852
106
0.620206
false
denisenkom/django-sqlserver
broken-tests/schema/tests.py
1
101650
import datetime import itertools import unittest from copy import copy import django from django.db import ( DatabaseError, IntegrityError, OperationalError, connection, ) from django.db.models import Model from django.db.models.deletion import CASCADE, PROTECT from django.db.models.fields import ( AutoField, ...
mit
101,262,551,295,524,510
43.061552
114
0.621702
false
dapengchen123/code_v1
reid/models/resnet_btfu.py
1
3793
from __future__ import absolute_import import torch.nn.functional as F import torch.nn.init as init from torch import nn from torchvision.models import resnet18, resnet34, resnet50, resnet101, \ resnet152 class ResNet_btfu(nn.Module): __factory = { 18: resnet18, 34: resnet34, 50: resne...
mit
-1,654,766,878,559,819,300
31.418803
80
0.530187
false
SophieIPP/ipp-macro-series-parser
ipp_macro_series_parser/demographie/parser.py
1
3235
# -*- coding: utf-8 -*- # TAXIPP -- A French microsimulation model # By: IPP <taxipp@ipp.eu> # # Copyright (C) 2012, 2013, 2014, 2015 IPP # https://github.com/taxipp # # This file is part of TAXIPP. # # TAXIPP is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Publi...
gpl-3.0
6,083,599,587,234,240,000
37.404762
109
0.588965
false
waynew/simple-importer
importer/importer.py
1
1305
from __future__ import print_function, division try: import tkinter as tk import configparser as configparser from tkinter.filedialog import askdirectory except ImportError: # I guess we're running Python2 import Tkinter as tk import ConfigParser as configparser from tkFileDialog import ask...
mit
-3,465,383,677,578,508,300
27.369565
92
0.699617
false
lacatus/TFM
__init__.py
1
1514
#!/usr/bin/env python """ Initialization of the project global variables """ import cv2 import os from var import variables def init(): initvariables() def initvariables(): variables.app_path = os.path.dirname(os.path.realpath(__file__)) variables.datasets_path = variables.app_path + '/data' "...
apache-2.0
715,981,144,961,745,200
21.939394
72
0.570674
false
nhhegde/minimalist_item_catalog
Item_Catalog/add_test_user.py
1
1698
from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from database_setup import Base, User, Item engine = create_engine('postgresql://postgres:postgresql@localhost:5432/user_item_catalog') Base.metadata.bind = engine DBSession = sessionmaker(bind=engine) session = DBSession() te...
agpl-3.0
-8,792,218,446,548,541,000
32.653061
91
0.631331
false
cfelton/minnesota
examples/boards/nexys/fpgalink/fpgalink.py
1
2931
from myhdl import * from mn.cores.usbext import fpgalink from mn.cores.usbext import m_fpgalink_fx2 def fpgalink_nexys( # ~~ FX2 interface signals ~~ IFCLK, # 48 MHz clock from FX2 RST, # active low async reset SLWR, # active low write strobe SLRD, # active low read stro...
gpl-3.0
7,793,902,359,878,588,000
25.889908
70
0.564654
false
mitsuhiko/celery
celery/backends/amqp.py
1
7035
"""celery.backends.amqp""" import socket import time from datetime import timedelta from carrot.messaging import Consumer, Publisher from celery import conf from celery import states from celery.backends.base import BaseDictBackend from celery.exceptions import TimeoutError from celery.messaging import establish_con...
bsd-3-clause
-1,894,539,541,368,101,600
33.655172
76
0.589055
false
plish/Trolly
trolly/organisation.py
1
3394
from . import trelloobject class Organisation(trelloobject.TrelloObject): def __init__(self, trello_client, organisation_id, name='', **kwargs): super(Organisation, self).__init__(trello_client, **kwargs) self.id = organisation_id self.name = name self.base_uri = '/organizations...
mit
5,201,938,132,651,041,000
31.018868
79
0.57307
false
hasgeek/outreach
tests/test_kharcha.py
1
1236
import json import unittest from flask import url_for from outreach import app from outreach.models import (db, SaleItem) from fixtures import init_data class TestKharchaAPI(unittest.TestCase): def setUp(self): self.ctx = app.test_request_context() self.ctx.push() db.drop_all() db...
agpl-3.0
-1,900,229,001,393,846,500
35.352941
202
0.644013
false
phenoxim/nova
nova/api/openstack/compute/fping.py
1
4844
# Copyright 2011 Grid Dynamics # Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses...
apache-2.0
-8,144,105,723,976,514,000
33.848921
79
0.58815
false
openstack/heat
heat/engine/resources/template_resource.py
1
14723
# # 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
-2,389,991,223,551,367,000
39.671271
79
0.55865
false
aaronmckinstry706/twitter-crime-prediction
src/jobs/crime_prediction/grid.py
1
4226
import bisect import collections import math """A class which defines a square by its upper and lower lat/lon bounds.""" LatLonSquare = collections.namedtuple('Square', ['lat_min', 'lat_max', 'lon_min', 'lon_max']) class LatLonGrid(object): """ A data structure representing a rectangular grid of lati...
gpl-3.0
-5,509,849,249,049,962,000
47.139535
100
0.635116
false
mcs07/PubChemPy
tests/test_errors.py
1
1060
# -*- coding: utf-8 -*- """ test_errors ~~~~~~~~~~~~~ Test errors. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import pytest from pubchempy import * def test_invalid_identifier(): """BadRequestError s...
mit
-7,337,709,465,256,332,000
24.853659
102
0.698113
false
MobProgramming/MobTimer.Python
Frames/MinimalScreenBlockerFrame.py
1
8157
from datetime import datetime from tkinter import ttk, N, E, W from Infrastructure import MobberManager from Infrastructure.ImageUtility import ImageUtility from Infrastructure.PathUtility import PathUtility from Infrastructure.ScreenUtility import ScreenUtility class MinimalScreenBlockerFrame(ttk.Frame): def __i...
mit
-553,520,416,050,646,300
56.443662
139
0.653181
false
libyal/libmsiecf
tests/pymsiecf_test_file.py
1
7245
#!/usr/bin/env python # # Python-bindings file type test script # # Copyright (C) 2009-2021, Joachim Metz <joachim.metz@gmail.com> # # Refer to AUTHORS for acknowledgements. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as publishe...
lgpl-3.0
-3,855,130,104,679,396,000
28.096386
102
0.683368
false
arkanis/minidyndns
references/minidns.py
1
3101
#!/usr/bin/env python # From https://code.google.com/p/minidns import sys import socket import fcntl import struct # DNSQuery class from http://code.activestate.com/recipes/491264-mini-fake-dns-server/ class DNSQuery: def __init__(self, data): self.data=data self.domain='' tipo = (ord(data[2]) >> 3) & ...
mit
-9,193,250,370,974,597,000
27.712963
136
0.596259
false
ozgurgunes/django-filizver
filizver/utils/views.py
1
1468
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from django.views.generic import View, ListView from django.http import HttpResponse from django.utils import simplejson as json from filizver.forms import TopicForm class ExtraContextMixin(View): """ A mixin that passes ``extra_c...
mit
2,325,083,346,132,843,500
30.234043
88
0.654632
false
alsoicode/django-maintenancemode-2
testproject/testproject/settings.py
1
4846
""" Django settings for testproject project. Generated by 'django-admin startproject' using Django 1.8.7. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build ...
apache-2.0
4,587,498,070,320,832,000
28.730061
83
0.656211
false
yujikato/DIRAC
src/DIRAC/Resources/Computing/test/Test_SSHComputingElement.py
1
2483
#!/bin/env python """ tests for SSHComputingElement module """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import shutil import subprocess32 as subprocess import shlex import pytest import DIRAC from DIRAC.Resources.Computing.SSHComputingElem...
gpl-3.0
-5,751,452,210,755,022,000
32.106667
106
0.72654
false
tempbottle/Nuitka
nuitka/nodes/ExecEvalNodes.py
1
10309
# Copyright 2015, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
apache-2.0
-8,143,572,845,159,348,000
31.520505
88
0.588515
false
peterstace/project-euler
OLD_PY_CODE/project_euler_old_old/102/102.py
1
1554
""" Three distinct points are plotted at random on a Cartesian plane, for which -1000 <= x, y <= 1000, such that a triangle is formed. Consider the following two triangles: A(-340,495), B(-153,-910), C(835,-947) X(-175,41), Y(-421,-714), Z(574,-645) It can be verified that triangle ABC contains the origin, whereas ...
unlicense
7,183,141,705,756,104,000
30.08
216
0.60296
false
CiscoSystems/networking-cisco
networking_cisco/plugins/cisco/l3/schedulers/l3_routertype_aware_agent_scheduler.py
1
4496
# Copyright 2014 Cisco Systems, 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
486,952,411,445,596,800
42.650485
78
0.637011
false