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
ESOedX/edx-platform
openedx/core/djangoapps/user_api/accounts/__init__.py
1
3942
""" Account constants """ from __future__ import absolute_import from django.utils.text import format_lazy from django.utils.translation import ugettext_lazy as _ # The maximum length for the bio ("about me") account field BIO_MAX_LENGTH = 300 # The minimum and maximum length for the name ("full name") account fiel...
agpl-3.0
4,209,388,237,006,732,000
39.639175
108
0.748858
false
3.725898
false
false
false
ThomasYeoLab/CBIG
stable_projects/predict_phenotypes/Nguyen2020_RNNAD/cbig/Nguyen2020/misc.py
1
8220
#!/usr/bin/env python # encoding: utf-8 # Written by Minh Nguyen and CBIG under MIT license: # https://github.com/ThomasYeoLab/CBIG/blob/master/LICENSE.md from __future__ import print_function, division import time from datetime import datetime from dateutil.relativedelta import relativedelta import numpy as np import...
mit
-5,610,195,718,566,183,000
29.332103
78
0.628102
false
3.47275
false
false
false
gfyoung/scipy
scipy/special/_precompute/gammainc_asy.py
3
2600
""" Precompute coefficients of Temme's asymptotic expansion for gammainc. This takes about 8 hours to run on a 2.3 GHz Macbook Pro with 4GB ram. Sources: [1] NIST, "Digital Library of Mathematical Functions", https://dlmf.nist.gov/ """ from __future__ import division, print_function, absolute_import import os f...
bsd-3-clause
9,172,762,547,767,775,000
20.848739
78
0.513462
false
2.711157
false
false
false
Eric89GXL/vispy
vispy/visuals/filters/mesh.py
1
3621
# -*- coding: utf-8 -*- # Copyright (c) Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. import numpy as np from vispy.gloo import Texture2D, VertexBuffer from vispy.visuals.shaders import Function, Varying from vispy.visuals.filters import Filter ...
bsd-3-clause
-8,374,585,109,607,602,000
32.841121
77
0.605081
false
4.091525
false
false
false
nion-software/nionswift
nion/swift/ToolbarPanel.py
1
10788
# standard libraries import gettext import typing # third party libraries # None # local libraries import numpy from nion.swift import DocumentController from nion.swift import Panel from nion.ui import CanvasItem from nion.ui import Declarative from nion.ui import DrawingContext from nion.ui import UserInterface fro...
gpl-3.0
291,978,751,075,515,700
44.138075
175
0.630979
false
3.955996
false
false
false
sobhe/hazm
hazm/Lemmatizer.py
1
6547
# coding: utf-8 from __future__ import unicode_literals from .utils import default_words, default_verbs from .Stemmer import Stemmer from .WordTokenizer import WordTokenizer class Lemmatizer(object): """ >>> lemmatizer = Lemmatizer() >>> lemmatizer.lemmatize('کتاب‌ها') 'کتاب' >>> lemmatizer.lemmatize('آتشفشان')...
mit
-724,135,198,645,884,900
48.086538
952
0.628599
false
1.720013
false
false
false
lino-framework/xl
lino_xl/lib/addresses/models.py
1
10002
# Copyright 2014-2020 Rumma & Ko Ltd # License: GNU Affero General Public License v3 (see file COPYING for details) from django.db import models from django.db.models import Q from lino.api import dd, rt, _ from lino.modlib.checkdata.choicelists import Checker from lino_xl.lib.countries.mixins import AddressLocation ...
bsd-2-clause
-7,199,747,600,571,778,000
33.020408
103
0.539392
false
4.114356
false
false
false
haylesr/angr
angr/analyses/datagraph_meta.py
1
3342
import logging import simuvex l = logging.getLogger(name="angr.analyses.vsa_ddg") class DataGraphMeta(object): def __init__(self): self._p = None def _irsb(self, in_state): """ We expect a VSA state here. """ return self._p.factory.sim_run(in_state) def _vfg_nod...
bsd-2-clause
7,425,170,151,523,326,000
32.089109
109
0.536505
false
3.492163
false
false
false
bd-j/scombine
demo/example_scombine.py
1
3655
import os, glob, sys import numpy as np import matplotlib.pyplot as pl """ A quick test and demonstration of the algorithms. """ import fsps from scombine.sfhutils import load_angst_sfh from scombine.dust import sexAmodel import scombine.bursty_sfh as bsp from sedpy import attenuation, observate # Instantiate the SP...
gpl-2.0
-8,302,501,506,454,148,000
38.728261
105
0.626813
false
2.584866
false
false
false
closers-2015/Closers-2015_BOTS-_Final_Byte_Project
frontend/bots/views.py
1
1708
import json import requests from django.http import JsonResponse, HttpResponse from django.shortcuts import render from django.views.generic import View from .forms import ToneForm # Create your views here. class IndexView(View): form = ToneForm template = 'bots/index.html' def get(self, request): context = { ...
mit
2,613,037,680,283,438,000
24.492537
64
0.654567
false
2.885135
false
false
false
gogoair/foremast
src/foremast/utils/templates.py
1
2860
# Foremast - Pipeline Tooling # # Copyright 2018 Gogo, 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...
apache-2.0
-2,290,338,504,374,448,600
30.777778
117
0.697902
false
4.03385
false
false
false
zachpodbielniak/PodNet
Linux/Python/CHandle.py
1
2487
''' ____ _ _ _ _ _ ____ ___ | _ \ ___ __| | \ | | ___| |_ / \ | _ \_ _| | |_) / _ \ / _` | \| |/ _ \ __| / _ \ | |_) | | | __/ (_) | (_| | |\ | __/ |_ / ___ \| __/| | |_| \___/ \__,_|_| \_|\___|\__| /_/ \_\_| |___| File: ChObject.py Author: Zach Podbie...
gpl-3.0
3,323,601,362,111,400,000
25.468085
73
0.711701
false
3.246736
false
false
false
HewlettPackard/python-proliant-sdk
examples/Rest/ex41_dump_eskm_event_log.py
1
1873
# Copyright 2016 Hewlett Packard Enterprise Development, LP. # # 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...
apache-2.0
-7,875,636,880,490,960,000
38.041667
78
0.668446
false
3.601923
false
false
false
web-push-libs/vapid
python/py_vapid/main.py
1
4427
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import argparse import os import json from cryptography.hazmat.primitives import serialization from py_vapid import Va...
mpl-2.0
7,368,063,028,745,099,000
38.176991
78
0.604247
false
3.970404
false
false
false
kiriappeee/reply-later
src/core/reply/ReplyCRUD.py
1
2704
from datetime import datetime, timezone, timedelta from ..scheduler import Scheduler def saveReply(replyToSave, replyDataStrategy): validationResult = validateReply(replyToSave) if validationResult is not None: return {"result": "error", "value": validationResult} saveResult = rep...
mit
-22,195,048,338,986,544
37.628571
85
0.734467
false
4.109422
false
false
false
knaperek/djangosaml2
setup.py
1
2324
# Copyright (C) 2011-2012 Yaco Sistemas <lgs@yaco.es> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
-6,859,252,648,342,526,000
34.212121
97
0.645869
false
3.860465
false
false
false
orbweb/ParsePy
setup.py
1
1396
import os from setuptools import setup, Command from unittest import TextTestRunner, TestLoader class TestCommand(Command): '''Run test suite using `python setup.py test `''' user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): ...
gpl-3.0
-4,434,754,492,332,491,300
30.022222
75
0.617479
false
4.011494
true
false
false
gilir/awn-extras-debian
applets/maintained/media-control/media_control.py
1
27433
#!/usr/bin/python # Copyright (c) 2007 Randal Barlow <im.tehk at gmail.com> # 2008-2009 Michal Hruby <michal.mhr at gmail.com> # # This library 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 Foundat...
gpl-3.0
5,804,854,946,431,033,000
39.944776
703
0.590238
false
3.708164
false
false
false
tectronics/nyctos
src/data.res/scripts/potions/clumsiness.py
1
1279
import parole from parole.colornames import colors from parole.display import interpolateRGB import pygame, random import sim, main, sim_items from util import * class Potion(sim_items.Potion): def __init__(self): sim_items.Potion.__init__(self, "clumsiness", "!", ('go', 'have', 'less'), ...
gpl-2.0
-577,875,974,577,499,000
34.527778
79
0.58405
false
3.795252
false
false
false
mennis/oTTo
src/otto/lib/py9p/marshal9p.py
1
11971
import py9p def _checkLen(x, l): if len(x) != l: raise py9p.Error("Wrong length %d, expected %d: %r" % (len(x), l, x)) def _checkSize(v, mask): if v != v & mask: raise py9p.Error("Invalid value %d" % v) def _splitFmt(fmt): """Split up a format string.""" idx = 0 r = [] whil...
bsd-3-clause
-7,794,172,577,276,303,000
30.585752
102
0.500125
false
3.115825
false
false
false
aESeguridad/GERE
venv/lib/python2.7/site-packages/weasyprint/layout/tables.py
1
31567
# coding: utf-8 """ weasyprint.layout.tables ------------------------ Layout for tables and internal table boxes. :copyright: Copyright 2011-2016 Simon Sapin and contributors, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import division, unicode_literals from ..compa...
gpl-3.0
-1,798,878,131,651,434,000
39.781654
79
0.56135
false
4.236913
false
false
false
hargup/bioinformatics
rosalind/grph.py
1
1185
# Author: Harsh Gupta # Date: 18th August 2014 # Overlap Graphs http://rosalind.info/problems/grph/ def read_input(in_file): """ Reads the input and returns a dictionary of DNA inputs """ tags = [] strings = [] for line in in_file.readlines(): if line[0] == '>': tags.append(line[1:-...
bsd-3-clause
1,900,127,754,315,923,000
26.55814
79
0.583966
false
3.038462
false
false
false
ocelot-collab/ocelot
ocelot/optics/elements.py
1
8588
''' optics elements ''' # from numpy import sin, cos, pi, sqrt, log, array, random, sign #from numpy.linalg import norm import numpy as np def debug(*args): print(' '.join( map(str, args) )) def warn(*args): print(' '.join( map(str, args) )) def info(*args): print(' '.join( map(str, args) )) class Op...
gpl-3.0
1,166,035,060,561,657,000
27.343234
112
0.46204
false
3.030346
false
false
false
choard1895/NaNoGenMo2016
Source/DEPRECATED_base.py
1
1888
class PolymorphicNoun(object): # TODO: Doc def __init__(self, singular, plural): self.singular = singular self.plural = plural def decline(self, quantity=1): # TODO: Doc if quantity == 1: return self.singular elif (quantity > 1) or (quantity == 0): ...
mit
-3,788,478,308,745,574,400
30.466667
82
0.534958
false
3.603053
false
false
false
francois2metz/trac-forge
tracforge/tests/config.py
1
2258
#!/usr/bin/env python # -*- coding: utf-8 -*- # # This file is part of TracForge Project # # Copyright (C) 2008 TracForge Project # # See AUTHORS for more informations # # 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 b...
agpl-3.0
-4,048,895,084,811,349,000
36.633333
74
0.690434
false
3.820643
true
false
false
metisto/leaderboard
leaderboard/model.py
1
2743
from collections import namedtuple, defaultdict import itertools import math Player = namedtuple('Player', 'pseudo rating') PlayerRank = namedtuple('PlayerRank', 'pseudo rank') Rank = namedtuple('Rank', 'value') Rating = namedtuple('Rating', 'value') def sort_player_by_rating(players): return sorted( pl...
mit
-4,645,198,106,545,529,000
28.815217
108
0.642362
false
3.742156
false
false
false
carlini/cleverhans
cleverhans/experimental/certification/neural_net_params.py
1
3454
"""Code for forward pass through layers of the network.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf class NeuralNetParams(object): """NeuralNetParams is a class that interfaces the verification code with ...
mit
-900,410,277,109,864,200
39.162791
80
0.671395
false
3.725998
false
false
false
afbarnard/esal
esal/general.py
1
5263
# Generally useful functions # Copyright (c) 2018 Aubrey Barnard. This is free software. See # LICENSE for details. import itertools as itools def firsts(items, key=None): """Generates the first occurrence of each unique item. * items: Iterable of items. * key: Function computing the key for each ite...
mit
8,571,786,510,832,852,000
29.598837
76
0.633669
false
4.057826
false
false
false
wgerald90/static_html_buildscript
build_files/install.py
1
1350
import os from shutil import copyfile, copytree if __name__ == '__main__': BASE_PATH = '/home/{}/'.format(os.getlogin()) CORE_PATH = "{}.buildscripts/".format(BASE_PATH) SUB_PATH = "{}/config/".format(CORE_PATH) install_path = 'config/' base_files = ('head.html', 'foot.html', 'buildscript.py', '...
mit
5,621,781,280,365,404,000
29
105
0.657778
false
2.947598
false
false
false
Adamssss/projectEuler
pb151.py
1
1181
import math import time import random t1 = time.time() # A1:16 # A2:8 # A3:4 # A4:2 # A5:1 ''' def getRandom(n): return random.randint(1,n) def getbatch(env,l): i = getRandom(l)-1 t = env[i] env.pop(i) if t == 1: return env if t == 2: return env+[1] if t == 4: retu...
mit
5,822,398,804,579,090,000
13.7625
37
0.445385
false
2.601322
false
false
false
subosito/cssjanus
gae_sessions.py
1
3134
#!/usr/bin/python2 # # Copyright 2007 Google 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 ...
apache-2.0
7,274,390,950,113,090,000
33.065217
79
0.712189
false
3.992357
false
false
false
erikriver/eduIntelligent-cynin
src/ubify.cyninv2theme/ubify/cyninv2theme/portlets/activityportlet.py
1
5261
############################################################################### #cyn.in is an open source Collaborative Knowledge Management Appliance that #enables teams to seamlessly work together on files, documents and content in #a secure central environment. # #cyn.in v2 an open source appliance is distribut...
gpl-3.0
7,629,362,641,381,610,000
37.856061
150
0.686752
false
3.891272
false
false
false
kyle8998/Practice-Coding-Questions
CTCI/Chapter8/8.7-Permutations_Without_Dups.py
1
1153
# CTCI 8.7 # Permutations Without Dups #------------------------------------------------------------------------------- # My Solution #------------------------------------------------------------------------------- def perm(str): if str == None: return None result = [] if len(str) == 0: ...
unlicense
-3,251,829,749,401,137,000
27.825
93
0.428448
false
5.337963
false
false
false
tokibito/django-edamame
example/note/views.py
1
1407
from django.shortcuts import render from django.conf.urls import patterns, url from django.core.urlresolvers import reverse_lazy from django.views.generic import TemplateView from django.contrib.auth.decorators import login_required from edamame import base, utils, generic from . import models class SiteViews(base....
mit
-5,484,185,522,434,427,000
25.54717
79
0.636816
false
3.833787
false
false
false
acannistra/doorman
server/server/settings.py
1
2156
""" Django settings for server project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) imp...
mit
5,368,834,742,544,756,000
22.434783
71
0.71846
false
3.179941
false
false
false
gstarnberger/paasta
paasta_itests/steps/paasta_metastatus_steps.py
1
4323
# Copyright 2015-2016 Yelp 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 writin...
apache-2.0
-5,936,680,489,781,187,000
39.401869
113
0.684478
false
3.45012
false
false
false
zlsun/XX-Net
code/default/smart_router/local/gfwlist.py
1
1845
#!/usr/bin/env python # coding:utf-8 import os current_path = os.path.dirname(os.path.abspath(__file__)) root_path = os.path.abspath(os.path.join(current_path, os.pardir, os.pardir)) data_path = os.path.abspath(os.path.join(root_path, os.pardir, os.pardir, 'data', "smart_router")) from xlog import getLogger xlog = ...
bsd-2-clause
6,128,830,351,701,917,000
26.132353
98
0.568022
false
3.468045
false
false
false
jskmr/kIRC
kIRC/kIRCcat.py
1
6019
#Kivy from kivy.app import App from kivy.lang import Builder from kivy.uix.screenmanager import Screen, ScreenManager from kivy.properties import ObjectProperty from kivy.uix.gridlayout import GridLayout from kivy.uix.tabbedpanel import TabbedPanel, TabbedPanelItem from kivy.uix.label import Label #IRC import irc.cl...
isc
-9,049,419,720,107,335,000
31.89071
123
0.539292
false
3.771303
false
false
false
technige/py2neo
perf.py
1
3905
#!/usr/bin/env python # coding: utf-8 # Copyright 2011-2021, Nigel Small # # 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 require...
apache-2.0
-6,992,227,680,987,757,000
28.80916
93
0.618182
false
3.715509
false
false
false
i3thuan5/gi2_liau7_khoo3
語料庫/管理/檢查.py
1
2117
from 語料庫.models import 語料狀況表 from 語料庫.models import 語料表 from 語料庫.管理.校對 import 校對表管理 from django.utils.timezone import now from 語料庫.widgets.目標音檔欄 import 目標音檔欄 class 檢查表(語料表): class Meta: proxy = True verbose_name = "檢查表" verbose_name_plural = verbose_name def save(self, *args, **kwarg...
mit
8,897,182,640,023,639,000
24.712121
78
0.517384
false
1.943872
false
false
false
minghuascode/pyj
library/pyjamas/ui/CheckBox.py
1
4162
# Copyright 2006 James Tauber and contributors # Copyright (C) 2009 Luke Kenneth Casson Leighton <lkcl@lkcl.net> # # 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,117,257,966,098,928,000
30.530303
74
0.65185
false
3.807868
false
false
false
stbd/zyn
tests/zyn_util/client.py
1
14683
import json import logging import os.path import time import zyn_util.errors import zyn_util.exception import zyn_util.util import zyn_util.connection from zyn_util.client_data import ( Element, OpenLocalFile, LocalFilesystemManager, ZynClientException, ) class ServerInfo: def __init__( ...
gpl-2.0
-2,059,258,977,786,135,800
32.522831
99
0.533815
false
4.246096
false
false
false
EichlerLab/pacbio_variant_caller
scripts/PrintGapSupport.py
1
2677
#!/usr/bin/env python import argparse import numpy as np import math import sys import pdb import bisect ap = argparse.ArgumentParser(description="Print gap support from output of PrintGaps.py.") ap.add_argument("table", help="Input tabular file") ap.add_argument("out", help="Output file, stdout implies stdout") ap.a...
mit
3,413,048,729,034,082,000
26.597938
235
0.562944
false
2.941758
false
false
false
adaptive-learning/flocs-web
practice/migrations/0011_programsnapshot.py
1
1056
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import flocsweb.mixins import datetime import uuid class Migration(migrations.Migration): dependencies = [ ('practice', '0010_remove_tasksession_creation_timestamp'), ] operations = [ ...
gpl-3.0
-3,683,538,642,854,860,000
34.2
129
0.610795
false
4.551724
false
false
false
biolink/ontobio
ontobio/sparql/skos.py
1
4073
import logging import requests import rdflib from rdflib import Namespace from rdflib.namespace import RDF from rdflib.namespace import SKOS from prefixcommons.curie_util import contract_uri from ontobio.ontol import Ontology, Synonym # TODO: make configurable GEMET = Namespace('http://www.eionet.europa.eu/gemet/200...
bsd-3-clause
8,387,766,309,252,020,000
32.113821
86
0.544071
false
3.860664
false
false
false
akshayka/video-games
src/Giant_Bomb_Scraper.py
1
6329
# Pulls video game metadata from Giantbomb's developer API. # # Written by Akshay Agrawal # August 22, 2013 import argparse import json import sys import urllib2 # For URL opening def get_game_name(result): try: name = result["game"]["name"].encode("utf-8") if name.find("\"") != -1: name = name.replace("\"",...
gpl-2.0
-6,023,377,428,745,319,000
26.637555
78
0.659188
false
2.928737
false
false
false
zero1hac/humanityadm
register/views.py
1
18608
from reportlab.pdfgen import canvas from cStringIO import StringIO from django.http import HttpResponse,Http404,HttpResponseRedirect # from django.shortcuts import render,get_object_or_404 # from django.core.urlresolvers import reverse from django.template import loader, RequestContext #from django.contrib.auth.models ...
mit
5,838,900,763,827,418,000
50.545706
503
0.603181
false
3.790589
false
false
false
swprojects/Advanced-Action-Scheduler
advancedactionscheduler/dialogs/browser.py
1
10505
# -*- coding: utf-8 -* """ @author Simon Wu <swprojects@runbox.com> Copyright (c) 2018 by Simon Wu <Advanced Action Scheduler> 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...
gpl-2.0
5,614,517,909,156,951,000
36.78777
97
0.585055
false
3.543002
false
false
false
austinbruch/MinesweePy
Game.py
1
2106
from Square import Square import random class Game(object): """docstring for Game""" def __init__(self, x_dim, y_dim, num_mines): super(Game, self).__init__() self.x = x_dim self.y = y_dim self.mines = num_mines # TODO: Validation self.populate() def populate(self):...
mit
-4,017,742,553,650,831,000
29.985294
108
0.460114
false
3.649913
false
false
false
xzjkya/macafin
cash_basis.py
1
4276
# -*- coding: utf-8 -*- """ ---------- Macafin basic report module ---------- This module implements basic financial report generation. :copyright: (c) 2017 by Aguiar, Vitoriano. :license: GNU GPL 3, see LICENSE for more details. """ import numpy as np import pandas as pd import locale from os...
gpl-3.0
818,155,602,074,089,900
28.853147
119
0.56537
false
3.336982
false
false
false
cliburn/flow
src/net_wrapper.py
1
1713
import xmlrpclib import pickle ''' network layer wrapper for xmlrpc code ''' class BadLogin(Exception): def __init__(self, msg): self.msg = msg class NoDataFile(Exception): def __init__(self, msg): self.msg = msg class Session_manager(object): def __init__(self, url, user, pw): url...
gpl-3.0
2,783,967,014,042,519,000
29.589286
78
0.594279
false
3.56875
false
false
false
edublancas/sklearn-evaluation
src/sklearn_evaluation/util.py
1
4779
from copy import copy from inspect import signature, _empty import re from collections.abc import Iterable from collections import defaultdict from itertools import product from six import string_types def isiter(obj): try: iter(obj) except TypeError: return False else: return True...
mit
-8,202,648,872,049,543,000
24.832432
115
0.611216
false
3.625948
false
false
false
collegboi/Raspi-Media
scrap.py
1
1292
from bs4 import BeautifulSoup import requests import sys, json #url = raw_input("Enter a website to extract the URL's from: ") argList = sys.argv try: data = argList[1] except: print "ERROR" sys.exit(1) #print data #data = "05DL11803" headers = { 'User-Agent':'Mozilla/5.0 (Macintosh; Intel ...
mit
-6,766,969,084,485,903,000
22.490909
144
0.638545
false
2.896861
false
false
false
bmya/odoo-support
database_tools/models/database_backup_preserve_rule.py
1
1244
# -*- encoding: utf-8 -*- from openerp import fields, models, api, _ from openerp.exceptions import Warning import logging _logger = logging.getLogger(__name__) class db_database_backup_preserve_rule(models.Model): _name = 'db.database.backup.preserve_rule' name = fields.Char( 'Name', requir...
lgpl-3.0
-8,937,684,315,849,209,000
23.392157
53
0.513666
false
3.746988
false
false
false
nuance1979/srilm-python
setup.py
1
2503
from setuptools import setup, Extension from Cython.Build import cythonize import subprocess import sys srilm_option = "" copy_args = sys.argv[1:] if "--srilm-option" in copy_args: ind = copy_args.index("--srilm-option") copy_args.pop(ind) val = copy_args.pop(ind) srilm_option = "" if val == "null" els...
mit
-76,860,229,371,797,330
28.447059
89
0.568917
false
3.078721
false
false
false
TamiaLab/carnetdumaker
apps/antispam/forms.py
1
3280
""" Forms mixin for the anti-spam app. """ import time from django import forms from django.utils import baseconv from django.core.signing import Signer, BadSignature from django.utils.translation import ugettext_lazy as _ from .settings import (MIN_TIME_FORM_GENERATION_SUBMIT, MAX_TIME_FORM_G...
agpl-3.0
2,567,083,465,563,797,000
38.518072
120
0.596341
false
4.474761
false
false
false
qaenablers/python-qautils
qautils/remote/remote_tail_utils.py
1
4924
# -*- coding: utf-8 -*- """ remote_tail_utils module contains utilities for reading remote logs using 'tail'. - start_tailer: Starts a new thread reading the remote file. - stop_tailer: Stop the capturing. """ __author__ = "@jframos" __project__ = "python-qautils [https://github.com/qaenablers/pyt...
apache-2.0
-4,006,360,384,457,490,000
36.022556
114
0.631803
false
3.936051
false
false
false
fxstein/ISYlib-python
ISY/_isynet_resources.py
1
5712
""" This is a subfile for IsyClass.py These funtions are accessable via the Isy class opj """ # author: Peter Shipley <peter.shipley@gmail.com> # copyrigh: Copyright (C) 2013 Peter Shipley # license: BSD from ISY.IsyUtilClass import et2d from ISY.IsyExceptionClass import IsyResponseError, IsyValueError ## ## netw...
bsd-2-clause
5,679,728,493,666,864,000
22.409836
86
0.593662
false
3.299827
false
false
false
tizonia/skema
skema/tags/OMX_ComponentOfRoleEnum.py
1
2330
# Copyright (C) 2011-2017 Aratelia Limited - Juan A. Rubio # # 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. # # This pr...
gpl-3.0
3,128,314,397,038,053,400
31.361111
76
0.649356
false
3.53566
false
false
false
nxt4hll/roccc-2.0
roccc-compiler/bin/add_module.py
1
5470
#!/usr/bin/env python # This script compiles the chosen file(s) or directory import os import re import sys import getopt ### Define constants ########################################################## # Executables GCC2SUIF = 'gcc2suif' SUIFDRIVER = 'suifdriver' # Environment variables CONST_ENV_VAR_ROCCCHOME='R...
epl-1.0
-7,028,796,366,140,988,000
27.941799
111
0.651737
false
3.646667
false
false
false
Cue/greplin-tornado-stripe
src/greplin/tornado/stripe.py
1
7520
# Copyright 2011 The greplin-tornado-stripe 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 o...
apache-2.0
6,767,657,597,250,813,000
27.812261
144
0.652128
false
3.995749
false
false
false
torrentails/Auto-MLP-CCG-for-OCTGN
scripts/network.py
1
3059
import time def _rcall_recieve(payload): payload = eval(payload) function = globals()[payload['function']] callback = payload['callback'] args = payload['payload'][0] kwargs = payload['payload'][1] response = function(*args, **kwargs) if callback: if type(response) == tuple: ...
gpl-3.0
7,844,023,861,400,081,000
31.210526
73
0.59235
false
3.872152
false
false
false
akrherz/iem
htdocs/json/spcmcd.py
1
1918
"""SPC MCD service.""" import os import json import memcache from paste.request import parse_formvars from pyiem.util import get_dbconn, html_escape ISO9660 = "%Y-%m-%dT%H:%MZ" def dowork(lon, lat): """ Actually do stuff""" pgconn = get_dbconn("postgis") cursor = pgconn.cursor() res = dict(mcds=[])...
mit
-1,181,197,747,141,357,600
24.918919
73
0.536496
false
3.284247
false
false
false
rfverbruggen/rachiopy
rachiopy/rachioobject.py
1
3741
"""RachioObject module containing a helper class for all API calls.""" import json from requests import Session _API_URL = "https://api.rach.io/1/public" class RachioObject: """The Rachio base object.""" def __init__(self, authtoken: str, http_session=None, timeout=25): """Rachioobject class initia...
mit
2,999,253,549,357,770,000
35.676471
79
0.612403
false
4.40636
false
false
false
TraMZzz/django-hitcount
hitcount/utils.py
1
1439
from django.conf import settings import re # this is not intended to be an all-knowing IP address regex IP_RE = re.compile('\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}') def get_ip(request): """ Retrieves the remote IP address from the request data. If the user is behind a proxy, they may have a comma-separated l...
mit
8,536,528,875,811,278,000
35.897436
79
0.607366
false
3.847594
false
false
false
timohtey/mediadrop_copy
mediacore_env/Lib/site-packages/flup-1.0/flup/server/scgi.py
1
7900
# Copyright (c) 2005, 2006 Allan Saddi <allan@saddi.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. Redistributions of source code must retain the above copyright # notice, this lis...
gpl-3.0
2,521,347,754,121,493,000
39.721649
78
0.64481
false
4.208844
false
false
false
transcode-de/correos
correos_project/correos/managers.py
1
1280
from email import message_from_string, utils import json from django.db import models from dateutil.parser import parse class EmailManager(models.Manager): def create_from_message(self, mailfrom, rcpttos, data): from .models import Recipient message = message_from_string(data) realnames =...
bsd-3-clause
1,121,345,500,567,364,600
37.787879
78
0.592969
false
4.142395
false
false
false
dynamsoft-dbr/python-barcode-windows
camera_thread.py
1
2286
import cv2 import dbr import time import threading import Queue import os q = Queue.Queue(1) class BarcodeReaderThread (threading.Thread): def __init__(self, name, isRunning): threading.Thread.__init__(self) self.name = name self.isRunning = isRunning def run(self): global q ...
mit
1,070,533,876,306,662,700
26.878049
124
0.57699
false
3.588697
false
false
false
w-ku/sqss
bucket.py
1
1790
""" Copyright (C) 2016 Wojciech Kuprianowicz This file is a part of Simple Queueing System Simulator (SQSS). SQSS 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 Licen...
gpl-3.0
-1,273,255,332,663,382,300
37.085106
167
0.701117
false
4.153132
false
false
false
dgfitch/dittohead
src/client/copy.py
1
4255
import wx import paramiko import os import posixpath import platform import logging import datetime # We mirror the paramiko exception up to the UI so it doesn't have to know anything about paramiko class AuthenticationException(Exception): pass def mkdir(ftp, path, mode=511, ignore_existing=F...
unlicense
-4,971,151,475,058,747,000
34.059322
192
0.577438
false
4.192118
true
false
false
OmeGak/indico-plugins
piwik/setup.py
1
1608
# This file is part of Indico. # Copyright (C) 2002 - 2016 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; either version 3 of the # License, or (a...
gpl-3.0
-9,206,738,403,660,133,000
35.545455
93
0.688433
false
3.730858
false
false
false
elsantodel90/RAAGo
aago_ranking/ratings/tasks.py
1
4138
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import, division import io import logging import math import subprocess from . import plotter import os from django.conf import settings from django.db.models import Q logger = logging.getLogger(__name__) # pylint: disable=invalid-name ...
gpl-3.0
1,713,499,451,129,734,100
34.672414
134
0.59304
false
3.655477
false
false
false
ThinkmanWang/NotesServer
api/alarm.py
1
6073
import sys import os sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'models')) sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'utils')) from imp import reload import MySQLdb import json import hashlib import time import uuid from flask import Flask, render_template, reque...
apache-2.0
-2,660,609,203,998,025,000
37.435065
156
0.596575
false
3.265054
false
false
false
peterbe/peekaboo
peekaboo/main/models.py
1
3317
import os import datetime import hashlib import unicodedata from django.db import models from django.utils.timezone import utc from django.dispatch import receiver from sorl.thumbnail import ImageField def _now(): return datetime.datetime.utcnow().replace(tzinfo=utc) class Location(models.Model): name = m...
mpl-2.0
7,353,714,012,441,880,000
28.353982
70
0.584263
false
4.079951
false
false
false
samsungsds-rnd/deepspeech.mxnet
stt_io_bucketingiter.py
1
5834
from __future__ import print_function import mxnet as mx import sys sys.path.insert(0, "../../python") import bisect import random import numpy as np BATCH_SIZE = 1 SEQ_LENGTH = 0 NUM_GPU = 1 def get_label(buf, num_lable): ret = np.zeros(num_lable) for i in range(len(buf)): ret[i] = int(buf[i]) ...
apache-2.0
-2,544,537,985,640,269,000
38.418919
187
0.532568
false
3.979536
false
false
false
mabuchilab/QNET
src/qnet/printing/base.py
1
8115
"""Provides the base class for Printers""" from sympy.core.basic import Basic as SympyBasic from sympy.printing.printer import Printer as SympyPrinter from ..algebra.core.scalar_algebra import Scalar from ..utils.indices import StrLabel from .sympy import SympyStrPrinter from ._render_head_repr import render_head_rep...
mit
-4,813,796,836,548,439,000
39.173267
79
0.586445
false
4.483425
false
false
false
timpalpant/KaggleTSTextClassification
scripts/predictors/logistic_regression.meta.tuned.py
1
1966
#!/usr/bin/env python ''' Make predictions for the test data ''' import argparse, logging, multiprocessing import cPickle as pickle import numpy as np from common import load_npz, save_npz, load_encoded_features from sklearn.linear_model import LogisticRegression logging.basicConfig(level=logging.DEBUG) CFG = {22: ...
gpl-3.0
-3,273,026,168,016,369,700
28.343284
66
0.572737
false
3.293132
true
false
false
yokose-ks/edx-platform
lms/djangoapps/pdfgen/management/commands/create_certs.py
1
2858
"""Django management command to force certificate generation""" from optparse import make_option from django.core.management.base import BaseCommand, CommandError from pdfgen.certificate import CertificatePDF from xmodule.modulestore import Location #from resource import setrlimit, RLIMIT_NOFILE def check_course_id(c...
agpl-3.0
-3,988,112,825,132,117,000
32.623529
93
0.561582
false
4.493711
false
false
false
google-research/dice_rl
scripts/run_neural_bayes_dice.py
1
10864
# Copyright 2020 Google LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
4,609,602,854,873,753,600
37.119298
83
0.684739
false
3.489881
false
false
false
ebmdatalab/openprescribing
openprescribing/dmd/build_search_query.py
1
3506
from django.db.models import fields, ForeignKey, ManyToOneRel, OneToOneRel, Q from .obj_types import clss from functools import reduce def build_query_obj(cls, search): """Return Q object to filter dm+d objects based on search. Parameters: cls: class of dm+d object to search search: a tree desc...
mit
832,798,126,835,511,300
28.965812
82
0.587849
false
3.713983
false
false
false
kwoodson/openshift-ansible
roles/openshift_node/callback_plugins/aa_version_requirement.py
1
1396
#!/usr/bin/python """ This callback plugin verifies the required minimum version of Ansible is installed for proper operation of the OpenShift Ansible Installer. The plugin is named with leading `aa_` to ensure this plugin is loaded first (alphanumerically) by Ansible. """ import sys from pkg_resources import parse_ve...
apache-2.0
-2,274,283,091,082,304,800
28.702128
77
0.676934
false
4.417722
false
false
false
mrachinskiy/blender-addon-jewelcraft
op_prongs/prongs_presets.py
1
3241
# ##### BEGIN GPL LICENSE BLOCK ##### # # JewelCraft jewelry design toolkit for Blender. # Copyright (C) 2015-2019 Mikhail Rachinskiy # # 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, eith...
mit
8,285,883,180,626,533,000
25.565574
73
0.556618
false
3.362033
false
false
false
detrout/telepathy-python
examples/tubeconn.py
1
3862
# This should eventually land in telepathy-python, so has the same license: # Copyright (C) 2007 Collabora Ltd. <http://www.collabora.co.uk/> # # This program 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 Founda...
lgpl-2.1
-3,611,072,931,924,286,000
35.780952
88
0.642413
false
3.885312
false
false
false
chessbr/rest-jwt-permission
rest_jwt_permission_tests/factories.py
1
1448
# -*- coding: utf-8 -*- from django.contrib.auth import get_user_model from rest_framework import response, serializers, views, viewsets from rest_framework.decorators import api_view, detail_route, list_route class SimpleSerializer(serializers.Serializer): pk = serializers.ReadOnlyField() class BasicView(views...
mit
-6,767,585,648,117,205,000
31.909091
74
0.694061
false
3.913514
false
false
false
rogeriofalcone/PyTrustNFe
pytrustnfe/HttpClient.py
1
1078
#coding=utf-8 ''' Created on Jun 16, 2015 @author: danimar ''' from httplib import HTTPSConnection class HttpClient(object): def __init__(self, url, chave_pem, certificado_pem): self.url = url self.chave_pem = chave_pem self.certificado_pem = certificado_pem def _headers(self...
lgpl-2.1
-3,779,384,756,775,477,000
26.666667
76
0.51577
false
3.891697
false
false
false
CityofPittsburgh/pittsburgh-purchasing-suite
purchasing/jobs/beacon_nightly.py
1
4936
# -*- coding: utf-8 -*- import datetime from flask import current_app from purchasing.extensions import db from purchasing.notifications import Notification from purchasing.jobs.job_base import JobBase, EmailJobBase from purchasing.opportunities.models import Opportunity, Vendor, Category from purchasing.public.mode...
bsd-3-clause
6,964,542,628,002,117,000
39.793388
111
0.62966
false
4.383659
false
false
false
Threde/open-team-status
checkins/tasks.py
1
2849
from celery import shared_task from django.conf import settings from django.core.mail import send_mail from django.core.urlresolvers import reverse from django.contrib.auth import get_user_model from django.contrib.sites.models import Site import requests from magiclink.models import MagicToken from .models import Ch...
gpl-3.0
-7,894,339,519,768,999,000
32.916667
75
0.624079
false
3.60177
false
false
false
SebDieBln/QGIS
python/plugins/processing/algs/gdal/information.py
1
3259
# -*- coding: utf-8 -*- """ *************************************************************************** information.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ***************************...
gpl-2.0
-2,423,840,527,073,261,600
38.26506
88
0.550782
false
4.545328
false
false
false
stormi/tsunami
src/secondaires/navigation/commandes/voile/hisser.py
1
2700
# -*-coding:Utf-8 -* # Copyright (c) 2010 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # rai...
bsd-3-clause
-6,172,192,764,313,994,000
39.742424
79
0.699888
false
3.863506
false
false
false
317070/kaggle-heart
configurations/je_ss_normscale_patchcontrast.py
1
7112
"""Single slice vgg with normalised scale. """ from default import * import theano import theano.tensor as T import lasagne as nn import deep_learning_layers import preprocess import postprocess import objectives import theano_printer import updates from preprocess import preprocess, preprocess_with_augmentation, s...
mit
-7,852,689,353,043,736,000
42.631902
155
0.695585
false
2.834595
true
false
false
jaxcs/DeSNP
desnp.py
1
34732
#!/usr/bin/env python """ desnp.py January 9, 2012 Dave Walton - dave.walton@jax.org This program is part of a CGD toolkit for manipulating expression data. This specific piece of code will take a file of probes, a set of strains, and a file of SNPS and filter out all the probes that have a SNP in one or more of the ...
gpl-3.0
5,599,707,917,562,774,000
39.717468
106
0.537343
false
3.965293
true
false
false
moranmo29/ShareLink
api/delete_member_from_the_group.py
1
1072
from google.appengine.ext.webapp import template import webapp2 import json from models.user import User from models.link import Link from models.group import Group import time class deleteMemberFromGroup(webapp2.RequestHandler): def get(self): user = None if self.request.cookies.get('our_token'): #the cookie ...
mit
-6,859,906,833,477,587,000
30.558824
96
0.738806
false
3.181009
false
false
false
raimue/avarice
scripts/io_gen.py
1
2514
#! /usr/bin/env python ############################################################################### # # avarice - The "avarice" program. # Copyright (C) 2004 Theodore A. Roth # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published ...
gpl-2.0
4,030,553,942,951,982,000
30.037037
79
0.631663
false
3.154329
false
false
false
homey1337/efnpractice
hello.py
1
10413
# standard library imports import datetime import mimetypes import os import re import time import urllib # nonstandard libraries import magic import pytz import web # my imports import config import forms import model #TODO: transactions? urls = ( '/', 'index', # some form targets '/searchpt', 'searc...
bsd-2-clause
-8,851,518,415,041,695,000
31.745283
93
0.558917
false
3.726915
false
false
false
google/python-laurel
laurel/__init__.py
1
7213
# Copyright 2018 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
-6,939,489,208,819,149,000
34.885572
128
0.569943
false
3.784365
false
false
false
queria/my-tempest
tempest/api/identity/base.py
1
9168
# Copyright 2012 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/LICENSE-2.0 # # Unless requ...
apache-2.0
2,032,438,752,347,835,100
38.347639
78
0.577989
false
4.015769
true
false
false
selfVSmind/selfVSmind.github.io
ibrokers/IBJts/source/pythonclient/ibapi/wrapper.py
1
30922
""" Copyright (C) 2019 Interactive Brokers LLC. All rights reserved. This code is subject to the terms and conditions of the IB API Non-Commercial License or the IB API Commercial License, as applicable. """ """ This is the interface that will need to be overloaded by the customer so that his/her code can receive in...
mit
9,108,331,426,416,868,000
42.247552
412
0.670235
false
4.288766
false
false
false
dannyperry571/theapprentice
script.module.urlresolver-master/lib/urlresolver/plugins/videobee.py
1
1427
''' videobee urlresolver plugin Copyright (C) 2016 Gujal 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. This program is distr...
gpl-2.0
-650,337,136,788,261,400
32.97619
68
0.697968
false
3.745407
false
false
false
Swordf1sh/Moderat
modules/mexplorer/main.py
1
14612
from PyQt4.QtGui import * from PyQt4.QtCore import * from main_ui import Ui_Form import ast import os import string import random from libs.dialogs import message, text class mainPopup(QMainWindow, Ui_Form): def __init__(self, args): QMainWindow.__init__(self) self.setupUi(self) self.anim ...
gpl-2.0
-3,945,296,132,766,904,300
43.822086
158
0.607446
false
3.522662
false
false
false
MattWycklendt/BikeLivingTheAmericas
scripts/generate_picture_locations.py
1
1105
import json with open("../gallery/" + 'albums.json', 'r') as fd: albums = json.loads(json.load(fd)) pics = {} for album in albums: album_dir = "../img/" + album['name'].replace(' ', '_') with open(album_dir + '/album_data.json', 'r') as fd: album_data = json.loads(json.load(fd)) for img ...
apache-2.0
4,527,960,355,078,567,400
34.645161
98
0.450679
false
3.98917
false
false
false