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
vinhqdang/algorithms_for_interviews
chapter1/problem1_3.py
1
1291
# given a sorted array and a key # find the first occurrence that larger than k # return -1 if there is no such element from problem0 import binary_search def test_find_first_larger_1 (): assert (find_first_larger([1,2,3,4,5,5,6],7) == -1) def test_find_first_larger_2 (): assert (find_first_larger([1,2,3,4,...
gpl-3.0
55,772,695,387,996,910
24.333333
83
0.492641
false
iynaix/manga-downloader-flask
manga/spiders/animea.py
1
1663
import datetime from scrapy.selector import Selector from .base import BaseSpider as Spider from manga.items import MangaItem, MangaChapterItem from utils import extract_link class AnimeA(Spider): name = "animea" allowed_domains = ["animea.net"] start_urls = [ "http://manga.animea.net/series_old...
mit
-8,047,761,475,780,702,000
26.716667
76
0.549008
false
jessrenteria/flowbot
src/data/preprocessor.py
1
4786
"""Module for preprocessing Cornell dialog data. """ import os import pickle import nltk from tqdm import tqdm class Preprocessor: """Class for parsing and preprocessing dialogs. """ def __init__(self, config): self._config = config self._lines, self._token2id, self._id2token = self._prep...
apache-2.0
-3,789,931,468,041,623,600
32.943262
88
0.497075
false
libravatar/libravatar
libravatar/account/urls.py
1
5296
# Copyright (C) 2011, 2013, 2015, 2016 Francois Marier <francois@libravatar.org> # Copyright (C) 2010 Francois Marier <francois@libravatar.org> # Jonathan Harker <jon@jon.geek.nz> # Brett Wilkins <bushido.katana@gmail.com> # # This file is part of Libravatar # # Libravatar is f...
agpl-3.0
-5,768,908,466,926,725,000
55.946237
87
0.498301
false
natsheh/semantic_query
api.py
1
4747
# -*- coding: utf-8 -*- # # This file is part of semantic_query. # Copyright (C) 2016 CIAPPLE. # # This is a free software; you can redistribute it and/or modify it # under the terms of the Revised BSD License; see LICENSE file for # more details. # Semantic Query API # Author: Hussein AL-NATSHEH <h.natsheh@ciapple.c...
bsd-3-clause
6,488,388,960,674,293,000
30.230263
127
0.688224
false
SitiBanc/1061_NCTU_IOMDS
1108/HW7/HW7.py
1
3177
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Nov 8 20:25:18 2017 @author: sitibanc """ import numpy as np from scipy import signal from PIL import Image def gen2DGaussian(stdv, mean, h, w): x, y = np.meshgrid(np.linspace(-1, 1, w), np.linspace(-1, 1, h)) d = np.sqrt(x ** 2 + y ** 2) ...
apache-2.0
7,698,695,683,274,534,000
30.2
79
0.460083
false
wufangjie/leetcode
015. 3Sum.py
1
1747
''' Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not contain duplicate triplets. For example, given array S = [-1, 0, 1, 2, -1, -4], A solution set is: [ [-1, 0, 1], [-1, -1,...
gpl-3.0
6,233,434,110,019,889,000
25.876923
155
0.502003
false
satterly/alerta5
alerta/app/database/backends/mongodb/base.py
1
40457
import json import pytz import re from datetime import datetime, timedelta from flask import current_app, g from pymongo import MongoClient, ASCENDING, TEXT, ReturnDocument from pymongo.errors import ConnectionFailure from alerta.app.models import status_code from alerta.app.utils.format import DateTime from alerta....
apache-2.0
-2,205,730,669,139,260,000
33.756873
133
0.470994
false
ckan/ckanext-archiver
ckanext/archiver/lib.py
1
1725
import os import logging import ckan.plugins as p from ckanext.archiver.tasks import update_package, update_resource log = logging.getLogger(__name__) def compat_enqueue(name, fn, queue, args=None): u''' Enqueue a background job using Celery or RQ. ''' try: # Try to use RQ from ckan....
mit
7,860,166,736,346,997,000
30.944444
104
0.663188
false
jhermann/rituals
src/rituals/util/shell.py
1
2127
# -*- coding: utf-8 -*- # pylint: disable=bad-continuation """ Shell command calls. """ # Copyright ⓒ 2015 Jürgen Hermann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # This pr...
gpl-2.0
1,718,451,169,136,169,700
31.676923
96
0.669021
false
google-research/google-research
task_set/tasks/conv_fc_test.py
1
1058
# coding=utf-8 # Copyright 2021 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
apache-2.0
-8,215,526,058,761,472,000
33.129032
74
0.710775
false
Nth-iteration-labs/streamingbandit
app/handlers/evalhandlers.py
1
3985
# -* coding: utf-8 -*- import json import numpy as np from handlers.basehandler import BaseHandler, ExceptionHandler from core.experiment import Experiment global numpy global random class Simulate(BaseHandler): def get(self, exp_id): """ Simulate your experiment based on four scripts, which create a cl...
mit
-3,311,606,737,012,722,000
42.791209
143
0.473275
false
RobertKolner/hastebin-client
tests/test_haste_utils.py
1
1819
import pytest import requests from hastebin_client.utils import create_url, read_data, upload from unittest import mock def test_create_url(): assert create_url('key') == 'https://hastebin.com/key' with pytest.raises(ValueError): create_url(None) def test_read_data_stdin(): with mock.patch('sys....
mit
7,434,796,016,962,102,000
29.830508
102
0.6663
false
brettcs/diffoscope
diffoscope/comparators/utils/archive.py
1
3833
# -*- coding: utf-8 -*- # # diffoscope: in-depth comparison of files, archives, and directories # # Copyright © 2016 Chris Lamb <lamby@debian.org> # # diffoscope 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,...
gpl-3.0
5,791,410,520,121,028,000
25.611111
84
0.63857
false
edx/pyrasite
pyrasite/inspector.py
1
1168
# This file is part of pyrasite. # # pyrasite 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. # # pyrasite is distributed in the hope t...
gpl-3.0
1,011,668,733,586,748,900
39.275862
79
0.694349
false
googleapis/python-asset
google/cloud/asset_v1/types/asset_service.py
1
63408
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
apache-2.0
-8,524,429,891,240,930,000
44.617266
169
0.636623
false
Comunitea/CMNT_00098_2017_JIM_addons
partner_consolidate/models/res_partner.py
1
1064
# -*- coding: utf-8 -*- # Copyright 2017 Omar Castiñeira, Comunitea Servicios Tecnológicos S.L. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, fields class ResPartner(models.Model): _inherit = "res.partner" consolidate = fields.Boolean("Consolidate", company_depend...
agpl-3.0
1,795,314,826,486,858,200
35.62069
81
0.613936
false
huiyiqun/check_mk
tests/pylint/test_pylint_check_plugins.py
1
1148
#!/usr/bin/python # encoding: utf-8 import os import sys from testlib import repo_path, cmc_path import testlib.pylint_cmk as pylint_cmk def test_pylint_checks(pylint_test_dir): f = file(pylint_test_dir + "/cmk-checks.py", "w") # Fake data structures where checks register (See cmk_base/checks.py) f.writ...
gpl-2.0
-3,343,809,612,867,096,000
29.210526
74
0.543554
false
thinkle/gourmet
gourmet/plugins/import_export/mealmaster_plugin/mealmaster_importer.py
1
22802
from gourmet.importers import importer, plaintext_importer import re, os.path, string, array from gourmet import convert, check_encodings from gourmet.gdebug import debug,TimeAction #from gourmet.gglobals import gt from gettext import gettext as _ class mmf_constants: def __init__ (self): self.committed = ...
gpl-2.0
-7,832,865,645,741,468,000
38.724739
129
0.549776
false
analysiscenter/dataset
batchflow/models/tf/vgg.py
1
4561
""" Simonyan K., Zisserman A. "`Very Deep Convolutional Networks for Large-Scale Image Recognition <https://arxiv.org/abs/1409.1556>`_" """ import tensorflow as tf from . import TFModel from .layers import conv_block _VGG16_ARCH = [ (2, 0, 64, 1), (2, 0, 128, 1), (3, 0, 256, 1), (3, 0, 512, 1), (...
apache-2.0
4,739,125,673,084,060,000
27.867089
98
0.560842
false
ojii/django-shop
tests/testapp/settings.py
1
4005
# Django settings for example project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Christopher Glass', 'tribaal@gmail.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. ...
bsd-3-clause
-8,624,996,170,369,027,000
34.758929
122
0.698127
false
cgqyh/pyalgotrade-mod
pyalgotrade/tools/quandl.py
1
5711
# PyAlgoTrade # # Copyright 2011-2015 Gabriel Martin Becedillas Ruiz # # 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 ap...
apache-2.0
-7,145,280,726,221,592,000
38.386207
162
0.66941
false
evancasey/demeter
demeter/unsup/common/image_pool.py
1
1090
import tensorflow as tf import copy class ImagePool: def __init__(self, pool_size): self.pool_size = pool_size if self.pool_size > 0: self.num_imgs = 0 self.images = [] def query(self, images): if self.pool_size == 0: return images ret_imgs ...
mit
6,230,843,943,123,238,000
33.0625
101
0.480734
false
mvaled/sentry
src/sentry/south_migrations/0277_auto__add_commitfilechange__add_unique_commitfilechange_commit_filenam.py
1
92625
# -*- 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 'CommitFileChange' db.create_table( 'sentry_com...
bsd-3-clause
-4,519,465,274,450,707,000
35.799762
97
0.40068
false
paeschli/scons-builder
modules/axtor_check.py
1
2706
from builder.btools import RegisterCustomTest from builder.btools import AddConfigKey from builder.bconfig import getAutoconfPrefix from builder.bconfig import filterOut from builder.bconfig import Version def CheckAxtor(ctx, write_config_h=False, add_to_compiler_env=False, min_version=None, max_version...
gpl-2.0
-8,409,912,608,106,378,000
30.103448
72
0.553954
false
sassoftware/mint
mint/buildtypes.py
1
14373
# # Copyright (c) SAS Institute 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 w...
apache-2.0
-8,518,906,341,440,424,000
33.970803
88
0.598066
false
KIOS-Research/effinet-smart-water-game
test.py
1
6635
# -*- coding: cp1253 -*- from tkinter import * from time import sleep def create(w, x1, y1): w.place(x=x1, y=y1) def erase(w): w.destroy() def reset(w): w.destroy() start() def exit(w): w.destroy() def e_q1(root, counter, step): TL = Toplevel() w, h = TL.winfo_screenwidth(), TL.winf...
bsd-2-clause
6,492,672,037,668,850,000
30.009346
111
0.547099
false
bbengfort/inigo
inigo/image.py
1
7931
# inigo.image # Handles data dealing with images, particularly EXIF for JPEG # # Author: Benjamin Bengfort <benjamin@bengfort.com> # Created: Sun Jun 14 22:32:17 2015 -0400 # # Copyright (C) 2015 Bengfort.com # For license information, see LICENSE.txt # # ID: image.py [] benjamin@bengfort.com $ """ Handles data dea...
mit
2,563,230,144,697,206,000
30.724
86
0.536628
false
macarthur-lab/xbrowse
seqr/views/apis/locus_list_api_tests.py
1
8486
import json import mock from django.test import TransactionTestCase from django.urls.base import reverse from seqr.models import LocusList, Project from seqr.views.apis.locus_list_api import locus_lists, locus_list_info, create_locus_list_handler, \ update_locus_list_handler, delete_locus_list_handler, add_projec...
agpl-3.0
3,673,026,669,628,493,000
49.511905
180
0.665213
false
bjtox/ec2ssh-manager
ec2ssh/ec2ssh.py
1
11122
import subprocess import boto3 import sys import configparser from codecs import open from os.path import expanduser import os import glob import inquirer import argparse import libtmux import time class Connector: def __init__(self, connection_name, profile): self.hosts_folder = expanduser("~") print(self....
mit
-2,762,748,396,079,273,000
39.155235
139
0.605107
false
mmahut/openshift-ansible
roles/openshift_health_checker/action_plugins/openshift_health_check.py
1
5501
""" Ansible action plugin to execute health checks in OpenShift clusters. """ # pylint: disable=wrong-import-position,missing-docstring,invalid-name import sys import os from collections import defaultdict try: from __main__ import display except ImportError: from ansible.utils.display import Display displ...
apache-2.0
1,259,086,927,939,239,200
36.168919
109
0.612979
false
jakub-m/phantomcurl
phantomcurl/test/test_post_data.py
1
1059
from nose.tools import * from phantomcurl.utils import split_post_items def test_post_data_good(): expected_given = [ ([('foo', 'bar')], ['foo=bar']), ([('foo', '')], ['foo=']), ([('foo', '=')], ['foo==']), ([('', '')], ['=']), ([('', '=')], ['==']), ([('', 'bar')]...
gpl-2.0
-7,154,057,688,203,821,000
24.214286
60
0.525024
false
richardkiss/pycoinnet
pycoinnet/peer/Fetcher.py
1
4318
import asyncio import logging import weakref from pycoin.serialize import b2h_rev from pycoinnet.InvItem import InvItem, ITEM_TYPE_TX, ITEM_TYPE_BLOCK, ITEM_TYPE_MERKLEBLOCK class Fetcher: """ Fetching a merkleblock also fetches the transactions that follow, and includes them in the message as the "tx" ...
mit
-5,082,640,224,147,455,000
40.12381
107
0.46943
false
GNOME/orca
src/orca/scripts/apps/Instantbird/chat.py
1
6860
# Orca # # Copyright 2010 Joanmarie Diggs. # # 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 Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library i...
lgpl-2.1
-3,200,580,494,293,113,300
37.757062
79
0.530029
false
wfhio/tramcar
job_board/models/site_config.py
1
2504
from __future__ import unicode_literals from django.db import models from django.contrib.sites.models import Site class SiteConfig(models.Model): expire_after = models.SmallIntegerField(default=30) # NOTE: We set a default here, but we will override this with a more # suitable default when we creat...
mit
-7,891,469,627,665,054,000
42.929825
78
0.580272
false
furthz/colegio
src/discounts/forms.py
1
4824
from django import forms from enrollment.models import Servicio from enrollment.models import TipoServicio from enrollment.models import Matricula from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit from django.forms import ModelForm, Form from utils.models import TiposNivel from django.ut...
mit
4,555,708,221,566,041,000
35.793893
126
0.578423
false
daviddeng/azrael
demos/ctrl_swarm.py
1
4132
# Copyright 2014, Oliver Nagy <olitheolix@gmail.com> # # This file is part of Azrael (https://github.com/olitheolix/azrael) # # Azrael 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...
agpl-3.0
8,619,977,157,674,257,000
32.056
79
0.616167
false
fmfn/UnbalancedDataset
examples/applications/plot_outlier_rejections.py
2
4354
""" =============================================================== Customized sampler to implement an outlier rejections estimator =============================================================== This example illustrates the use of a custom sampler to implement an outlier rejections estimator. It can be used easily wi...
mit
2,748,291,866,553,691,000
34.688525
85
0.562701
false
scott-maddox/simplepl
src/simplepl/dialogs/lockin_config_dialog.py
1
4145
# # Copyright (c) 2013-2014, Scott J Maddox # # This file is part of SimplePL. # # SimplePL 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 opt...
agpl-3.0
-6,380,274,891,226,863,000
42.177083
83
0.666104
false
eawag-rdm/xlsxtocsv
xlsxtocsv/xlsxtocsv.py
1
3605
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals import datetime as dt from Tkinter import Tk import tkFileDialog import openpyxl as op import argparse import os.path import sys import re import csv __metaclass__ = type class RFC4180(csv.Dialect): def __i...
agpl-3.0
8,526,891,086,674,498,000
30.347826
82
0.561165
false
dtnaylor/web-profiler
webloader/docs/source/conf.py
1
9104
# -*- coding: utf-8 -*- # # Web Profiler documentation build configuration file, created by # sphinx-quickstart on Tue Jul 8 17:09:00 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. ...
mit
-4,861,983,116,973,850,000
30.178082
79
0.692443
false
nedbat/unittest-mixins
setup.py
1
1288
#!/usr/bin/env python # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/unittest-mixins/blob/master/NOTICE.txt from setuptools import setup classifiers = """\ Environment :: Console Intended Audience :: Developers License :: OSI Approved :: Apache...
apache-2.0
8,195,750,661,228,339,000
32.025641
79
0.714286
false
rboman/progs
bin/powergrep.py
1
3561
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # try to replace "old_div(a,b)"" by "a/b" # with a and b being complex expressions involving brackets, etc. # processes all the python files recursively from the current folder # # you must use the script several times # (it processes 1 "old_div" per line at a time...
apache-2.0
5,097,906,595,243,001,000
30.236842
99
0.495366
false
soupmonkey/pushcoin
PoS/payment-processor/settings.py
1
1339
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2012 Slawomir Lisznianski <sl@minta.com> # # GNU General Public Licence (GPL) # # 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; eithe...
gpl-3.0
-4,831,188,054,566,369,000
33.333333
79
0.765497
false
PuzzleboxIO/brainstorms-python
setup.py2app.py
1
3818
""" This is a setup.py script generated by py2applet Usage: python2.7 setup.py py2app """ from setuptools import setup APP = ['brainstorms-local.py'] data_files=[ \ (".", \ #("Content/Resources", \ ["puzzlebox_brainstorms_configuration.ini"]), ("images", \ ["images/puzzlebox.ico", \ "images/puzzlebox....
agpl-3.0
-7,486,098,163,901,852,000
30.04065
109
0.680723
false
nmih/ssbio
ssbio/databases/pdb.py
1
34959
""" PDBProp ======= """ import gzip import json import logging import os.path as op import mmtf import os from cobra.core import DictList import pandas as pd import requests import deprecation from Bio.PDB import PDBList from lxml import etree from six.moves.urllib_error import URLError from six.moves.urllib.request i...
mit
1,119,046,539,905,341,600
40.225236
268
0.615778
false
tensorflow/probability
tensorflow_probability/python/optimizer/linesearch/hager_zhang.py
1
30378
# Copyright 2018 The TensorFlow Probability 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,853,210,817,681,248,000
46.539906
94
0.697511
false
tonyduckles/svn2svn
svn2svn/run/parse.py
1
2731
""" optparser helper functions """ import optparse import textwrap class HelpFormatter(optparse.IndentedHelpFormatter): """ Modified version of certain optparse.IndentedHelpFormatter methods: * Respect line-breaks in parser.desription and option.help_text * Vertically-align long_opts Inspired by: ...
gpl-3.0
-6,258,201,666,401,967,000
40.378788
125
0.556573
false
tensorflow/tpu
models/official/detection/utils/config_utils.py
1
2218
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
-6,733,611,204,582,500,000
30.239437
80
0.670875
false
WillsB3/glue
glue/formats/jsonformat.py
1
2704
import os import json import codecs from base import BaseJSONFormat class JSONFormat(BaseJSONFormat): extension = 'json' build_per_ratio = True @classmethod def populate_argument_parser(cls, parser): group = parser.add_argument_group("JSON format options") group.add_argument("--jso...
bsd-3-clause
3,899,344,654,583,642,000
41.920635
112
0.366864
false
LennonChin/Django-Practices
MxShop/apps/utils/alipay.py
1
6122
# _*_ coding: utf-8 _*_ __author__ = 'LennonChin' __date__ = '2017/10/23 21:37' # pip install pycryptodome __author__ = 'bobby' from datetime import datetime from Crypto.PublicKey import RSA from Crypto.Signature import PKCS1_v1_5 from Crypto.Hash import SHA256 from base64 import b64encode, b64decode from...
apache-2.0
472,593,492,612,720,300
36.454545
699
0.607264
false
marcoconstancio/yanta
libs/python/NoteViewer.py
1
8163
#!/usr/bin/env python # -*- coding: utf-8 -*- import os.path from PyQt5.QtWidgets import QWidget, QLabel, QVBoxLayout from libs.python.NoteFunctions import NoteFunctions class NoteViewer(QWidget): def __init__(self, param): QWidget.__init__(self) # Function for several oprations if 'NoteF...
gpl-2.0
7,265,503,332,393,626,000
38.631068
127
0.635918
false
trevor/calendarserver
txdav/who/opendirectory.py
1
1226
# -*- test-case-name: txdav.who.test.test_xml -*- ## # Copyright (c) 2014 Apple 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/LI...
apache-2.0
-4,844,171,048,777,520,000
31.263158
76
0.764274
false
tonysyu/scrappyr-app
config/settings/production.py
1
7727
# -*- coding: utf-8 -*- """ Production Configurations - Use Amazon's S3 for storing static files and uploaded media - Use mailgun to send emails - Use Redis for cache - Use sentry for error logging """ from __future__ import absolute_import, unicode_literals import logging from boto.s3.connection import OrdinaryC...
mit
-3,475,508,035,025,968,000
33.495536
125
0.599845
false
edermartioli/ExoplanetLight
src/spectrum.py
1
2235
# -*- coding: utf-8 -*- """ Created on Nov 25 2016 @author: Eder Martioli Laboratorio Nacional de Astrofisica, Brazil spectrum.py is a library of classes and functions to handle spectral data. """ import numpy as np from scipy import constants ########## SPECTRUM CLASS ############ class ...
mit
5,748,290,067,744,352,000
26.256098
120
0.499329
false
dpgaspar/Flask-AppBuilder
examples/quickactions/config.py
1
1945
import os from flask_appbuilder.security.manager import ( AUTH_OID, AUTH_REMOTE_USER, AUTH_DB, AUTH_LDAP, AUTH_OAUTH, ) basedir = os.path.abspath(os.path.dirname(__file__)) CSRF_ENABLED = True SECRET_KEY = "\2\1thisismyscretkey\1\2\e\y\y\h" OPENID_PROVIDERS = [ {"name": "Yahoo", "url": "https...
bsd-3-clause
-8,113,568,028,232,835,000
28.923077
82
0.594859
false
belokop/indico_bare
indico/web/handlers/tracker.py
1
1352
# 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
-6,417,300,197,965,362,000
35.540541
78
0.707101
false
chipaca/snapcraft
snapcraft/project/_project_options.py
1
12984
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016-2019 Canonical Ltd # # This program 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 Foundation. # # This program is distributed in ...
gpl-3.0
-6,421,764,754,426,104,000
32.900783
88
0.59658
false
eroicaleo/LearningPython
interview/leet/146_LRU_Cache.py
1
2568
#!/usr/bin/env python class LRUCache: class Node: def __init__(self, key, val): self.val, self.key = val, key self.prev = None self.next = None def __init__(self, capacity): """ :type capacity: int """ self.capacity = capacity ...
mit
2,415,132,396,107,739,600
27.21978
92
0.503505
false
jmalonzo/pywebkitgtk
tests/test_webbackforwardlist.py
1
2703
from webkit import WebHistoryItem, WebBackForwardList, WebView import gobject import unittest class TestWebBackForwardList (unittest.TestCase): """Test WebBackForwardList functions""" def setUp(self): gobject.threads_init() self.view = WebView() self.bf_list = self.view.get_back_forw...
lgpl-2.1
-4,415,265,464,655,258,600
41.234375
88
0.650388
false
martinsch/vigra
vigranumpy/lib/pyqt/imagewindow.py
1
23939
####################################################################### # # Copyright 2009-2010 by Ullrich Koethe # # This file is part of the VIGRA computer vision library. # The VIGRA Website is # http://hci.iwr.uni-heidelberg.de/vigra/ # Please direct questions, bug reports, and contributions...
mit
4,147,204,187,256,811,500
37.799028
97
0.588329
false
eagleamon/home-assistant
homeassistant/components/fan/__init__.py
1
8794
""" Provides functionality to interact with fans. For more details about this component, please refer to the documentation at https://home-assistant.io/components/fan/ """ from datetime import timedelta import logging import os import voluptuous as vol from homeassistant.components import group from homeassistant.co...
apache-2.0
-1,414,916,165,946,151,400
28.911565
78
0.617921
false
mathiasertl/django-ca
ca/django_ca/apps.py
1
1049
# This file is part of django-ca (https://github.com/mathiasertl/django-ca). # # django-ca 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
-834,903,598,605,759,000
40.96
98
0.756911
false
wereallfeds/webshag
webshag/gui/gui_images.py
1
223034
## ################################################################# ## ## (C) SCRT - Information Security, 2007 - 2008 // author: ~SaD~ ## ## ################################################################# ## ## This program is free software: you can redistribute it and/or ## ## modify it under the terms of ...
gpl-3.0
8,281,288,084,170,631,000
76.25459
79
0.815934
false
GSA/PricesPaidAPI
SolrLodr.py
1
4723
#!/usr/local/bin/python import solr import sys, traceback # This file is for (for example) Apache with mod_wsgi. import sys, os # import sys # sys.path.insert(0, '../configuration/') # The purpose of this file is to take the standard # datafiles and load them into SOLR in such a way that they # will be searchable....
unlicense
4,258,783,536,388,830,700
34.246269
119
0.712683
false
ntoll/code-dojo
adventure/week3/team3/adventure.py
1
6088
from cmd import Cmd import re DIRECTIONS = 'N', 'E', 'S', 'W' NORTH, EAST, SOUTH, WEST = DIRECTIONS class Player(object): def __init__(self, location, name='Player'): assert isinstance(location, Location) self.location = location self.name = name class Location(object): ...
mit
1,014,150,448,326,991,400
29.813472
113
0.508377
false
amanzi/ats-dev
tools/meshing_ats/meshing_ats/meshing_ats.py
1
34933
"""Extrudes a 2D mesh to generate an ExodusII 3D mesh. Works with and assumes all polyhedra cells (and polygon faces). To see usage, run: ------------------------------------------------------------ python meshing_ats.py -h Example distributed with this source, to run: --------------------------------------------...
bsd-3-clause
6,506,556,784,610,115,000
36.724622
166
0.507972
false
pecryptfs/pecryptfs
pecryptfs/cmd_genfile.py
1
2753
#!/usr/bin/env python3 # pecryptfs - Portable Userspace eCryptfs # Copyright (C) 2015 Ingo Ruhnke <grumbel@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 L...
gpl-3.0
4,288,613,616,355,062,000
36.712329
98
0.656375
false
ptphp/PyLib
src/fangte/fetch/fetch58_bak.py
1
29601
# -*- coding: utf-8 -*- import time import datetime import random import cookielib import urllib import urllib2 from urlparse import urlparse from config import * from common import * from BeautifulSoup import BeautifulSoup class BaseCrawl(object): #房源类型 1 出售 2 出租 3 求购 4 求租 flag = None isStoped = False ...
apache-2.0
-6,180,525,446,337,366,000
38.575967
172
0.475727
false
AntaresConsulting/odoo-marble
product_marble/models/stock.py
1
25218
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU...
gpl-2.0
-4,009,658,643,104,912,400
41.884354
164
0.560398
false
CiscoSystems/dashboard-quantum-beta
django-openstack/django_openstack/api.py
1
19242
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2011 Fourth Paradigm Development, Inc. # # Licensed under the Apache License, Version 2.0 (the "Licen...
apache-2.0
248,219,022,108,928,350
31.94863
79
0.653934
false
leotrs/decu
test/notsosimple_project/src/script.py
1
1196
""" testscript.py ------------- This is a test script for decu. """ from decu import Script, experiment, figure, run_parallel import numpy as np import matplotlib.pyplot as plt class TestScript(Script): @experiment(data_param='data') def exp(self, data, param, param2): """Compute x**param for each...
mit
5,614,853,097,660,750,000
26.813953
73
0.594482
false
abramhindle/UnnaturalCodeFork
python/testdata/launchpad/lib/lp/buildmaster/tests/test_buildfarmjobbehavior.py
1
11277
# Copyright 2010-2013 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Unit tests for BuildFarmJobBehaviorBase.""" __metaclass__ = type from datetime import datetime import os import shutil import tempfile from twisted.internet import defer...
agpl-3.0
1,663,565,479,296,469,000
37.752577
78
0.667376
false
rackerlabs/qonos
qonos/openstack/common/eventlet_backdoor.py
1
4764
# Copyright (c) 2012 OpenStack Foundation. # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License a...
apache-2.0
620,482,699,583,324,400
31.855172
78
0.645466
false
MJuddBooth/pandas
pandas/tests/reshape/test_reshape.py
1
25248
# -*- coding: utf-8 -*- # pylint: disable-msg=W0612,E1101 from collections import OrderedDict import numpy as np from numpy import nan import pytest from pandas.compat import u from pandas.core.dtypes.common import is_integer_dtype import pandas as pd from pandas import Categorical, DataFrame, Index, Series, get_d...
bsd-3-clause
-5,854,816,796,630,431,000
39.319489
79
0.486846
false
BinMatrix/camshift_ros
scripts/camshift_node.py
1
9812
#!/usr/bin/env python ''' Camshift node ================ This is a ros node that shows mean-shift based tracking You select a color objects such as your face and it tracks it. This subscrib from "/image" topic for reading image, and publish the information of target to "/TargetPositionSize" or "/roi" topic. The posit...
gpl-3.0
-7,288,317,239,279,681,000
35.073529
110
0.528027
false
rafallo/p2c
torrent/torrent.py
1
10334
# -*- coding: utf-8 -*- import hashlib import libtorrent as lt import logging from threading import Timer, Event import os import time from p2c.exceptions import SessionNotBindedException, TorrentHasNotMetadataYet import settings from torrent.movie import Movie SOURCE_TYPES = ("MAGNET", "TORRENT") logger = logging.ge...
mit
2,340,498,763,809,516,500
35.259649
111
0.561641
false
dhaitz/CalibFW
plotting/modules/plot_sandbox.py
1
75936
# -*- coding: utf-8 -*- """ plotting sanbox module for merlin. This module is to be used for testing or development work. """ import plotbase import copy import plot1d import getroot import math import plotresponse import plotfractions import plot2d import plot_tagging import fit import os def recogen_a...
gpl-2.0
1,261,465,762,515,416,000
40.024311
257
0.540758
false
baccenfutter/cpassdb
cpassdb/protocols/client.py
1
19784
"""cpassdb - Client Protocol Classes""" __author__ = "Brian Wiborg <baccenfutter@c-base.org>" __license__ = "GNU/GPLv2" import os import sys import json import base64 import commands from twisted.internet import reactor from twisted.protocols.basic import LineReceiver class ClientProtocol(LineReceiver): """Abstr...
gpl-2.0
-7,313,434,773,447,821,000
31.863787
102
0.591336
false
nonapod/gzinflatekiller
gzinflatekiller.py
1
3114
#!/bin/env python #:############################################ #: GZINFLATEKILLER #: by Les Cordell #: #: Hunt through files containing a base64 #: GZInflate Command #: #: Written on 07/08/2013 #: last modified @ 07/08/2013 #:############################################ import sys, os, re #: Extensions constant, th...
mit
-5,594,238,935,680,430,000
28.942308
118
0.659923
false
L1NT/django-training-log
log/models.py
1
5458
from django.db import models # Create your models here. class Sport(models.Model): """ don't use models.choices because we want the list to be transactional data example list: [ 'bike', 'run', 'swim', 'measurements', 'yoga', 'weights', # for multi-sp...
gpl-2.0
1,526,296,373,929,901,000
35.878378
109
0.662147
false
steven-murray/pydftools
setup.py
1
2408
#!/usr/bin/env python # -*- coding: utf-8 -*- """The setup script.""" from setuptools import setup, find_packages import io import os import re with open("README.rst") as readme_file: readme = readme_file.read() with open("HISTORY.rst") as history_file: history = history_file.read() requirements = [ "s...
mit
207,462,107,332,436,930
27
88
0.622924
false
chaosk/trinitee
trinitee/forums/migrations/0001_initial.py
1
14851
# 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 model 'Category' db.create_table('forums_category', ( ('id', self.gf('django.db.model...
bsd-3-clause
-7,617,905,021,076,581,000
64.422907
182
0.570265
false
pgroudas/pants
src/python/pants/backend/jvm/tasks/jvm_compile/jvm_compile_strategy.py
1
8647
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os from abc i...
apache-2.0
-8,624,641,274,634,726,000
36.925439
99
0.686481
false
ruhan/django-silk-mongoengine
silk/profiling/profiler.py
1
6695
import inspect import logging import time import traceback from django.conf import settings from django.utils import timezone import six from silk.collector import DataCollector from silk.config import SilkyConfig from silk.models import _time_taken Logger = logging.getLogger('silk') # noinspection PyPep8Naming c...
mit
-1,680,985,588,628,297,200
35.391304
124
0.542644
false
sandz-in/twilio_trello
twilio_sms_handler/views.py
1
1174
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.http import HttpResponse from django.views.decorators.http import require_POST from twilio.twiml.messaging_response import MessagingResponse # Create your views here. from twilio_sms_handler.TrelloQuery import TrelloQuery from twilio_trello.tw...
mit
3,368,238,826,495,782,000
29.102564
71
0.683986
false
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractKeztranslationsWordpressCom.py
1
1210
def extractKeztranslationsWordpressCom(item): ''' Parser for 'keztranslations.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('FOD', 'Quickly Wear the Face of the Devil', ...
bsd-3-clause
-7,868,676,419,566,919,000
36.78125
104
0.620861
false
dvida/UWO-PA-Python-Course
Lecture 3/L3_lecture.py
1
5075
from __future__ import print_function ### READING FILES file_name = 'data.txt' # Reading in and parsing file contents data_list = [] with open(file_name) as f: # SKip the header (the first line) next(f) for line in f: # Remove newline char line = line.replace('\n', ...
mit
-3,814,201,120,210,156,500
17.909804
91
0.575369
false
terna/SLAPP3
6 objectSwarmObserverAgents_AESOP_turtleLib_NetworkX/$$slapp$$/txtxFunctions.py
1
1888
import os def executeFormula(fIn, fOu, nrow, n, s): # v=0 #init. not required; it can interfere with the try/except structure pos = s.find("v") if pos == -1: print("missing 'v' in formula, row", nrow, "\nexecution stopped in error") fIn.close() fOu.close() os...
cc0-1.0
2,214,278,890,246,831,600
21.211765
77
0.417373
false
xyos/horarios
horarios/migrations/0004_auto__chg_field_subject_name.py
1
2406
# -*- 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): # Changing field 'Subject.name' db.alter_column(u'horarios_subject', 'na...
mit
-5,984,127,859,106,971,000
47.14
146
0.566916
false
attdona/NAIS
pynais/msg.py
1
2142
import struct import pynais as ns class Profile: def __init__(self, uid=None, pwd=None): self.uid = uid self.pwd = pwd def __str__(self): return "Profile uid: [%s], pwd: [%s]" % (self.uid, self.pwd) def set_protobuf(self, obj): obj.uid = self.uid obj.pwd = self...
gpl-3.0
-5,864,915,119,413,480,000
25.775
78
0.548086
false
liuslevis/handwrite_dataset_generator
3_gen_digit_data_label.py
1
2918
import os import shutil DEBUG = False img_suffix = ['.jpeg','.jpg','.png','.tiff'] def gen_img_unique_file_name(count,total): assert(count<=total) name = '' for i in range(len(str(total)) - len(str(count))): name+='0' offset = str(count) name+=offset return name def copy_img_file(s...
mit
667,820,483,972,718,700
29.726316
102
0.536326
false
nrz/ylikuutio
external/bullet3/examples/pybullet/gym/pybullet_envs/minitaur/envs/env_randomizers/minitaur_alternating_legs_env_randomizer.py
2
2810
"""Randomize the minitaur_gym_alternating_leg_env when reset() is called. The randomization include swing_offset, extension_offset of all legs that mimics bent legs, desired_pitch from user input, battery voltage and motor damping. """ import os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(in...
agpl-3.0
-7,600,583,277,604,451,000
45.065574
86
0.666904
false
dreaming-dog/kaldi-long-audio-alignment
scripts/classes/entry_manager.py
1
2096
# Copyright 2017 Speech Lab, EE Dept., IITM (Author: Srinivas Venkattaramanujam) from entry import Entry class EntryManager: __statuses__ = ['PENDING','DONE'] def __init__(self): self.entries=[] def add_entry(self,entry): # Problem: # add new entries to the existing list such that: # 1) the start and end ...
apache-2.0
-5,431,410,990,582,398,000
42.666667
169
0.694179
false
hirochachacha/apython
bpython/completion/completers/import_completer.py
1
9006
# The MIT License # # Copyright (c) 2009-2011 Andreas Stuehrk # # 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, mo...
mit
6,365,923,528,338,857,000
31.989011
89
0.563957
false
julzhk/codekata
instant_runoff_voting.py
1
1947
from collections import defaultdict, Counter def runoff(voters): """ a function that calculates an election winner from a list of voter selections using an Instant Runoff Voting algorithm. https://en.wikipedia.org/wiki/Instant-runoff_voting Each voter selects several candidates in order of preference. ...
mit
-6,354,312,978,943,293,000
42.266667
113
0.659476
false
openstack/tempest
tempest/api/compute/certificates/test_certificates.py
1
1501
# 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
-5,259,292,156,591,591,000
36.525
78
0.724184
false
factorlibre/carrier-delivery
delivery_carrier_ups/model/ups_config.py
1
2330
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2015 FactorLibre (http://www.factorlibre.com) # Hugo Santos <hugo.santos@factorlibre.com> # # This program is free software: you can redistribute it and/o...
agpl-3.0
545,612,102,985,848,500
34.30303
78
0.566953
false
forio/julia-studio
tests/system/suite_SCOM/tst_SCOM04/test.py
1
1991
source("../../shared/qtcreator.py") source("../../shared/suites_qtta.py") # entry of test def main(): # expected error texts - for different compilers expectedErrorAlternatives = ["'SyntaxError' was not declared in this scope", "'SyntaxError' : undeclared identifier"] start...
gpl-3.0
-5,123,714,353,026,638,000
52.810811
132
0.684581
false
wenhuchen/ETHZ-Bootstrapped-Captioning
visual-concepts/coco/PythonAPI/pycocotools/coco.py
1
16953
__author__ = 'tylin' __version__ = '2.0' # Interface for accessing the Microsoft COCO dataset. # Microsoft COCO is a large image dataset designed for object detection, # segmentation, and caption generation. pycocotools is a Python API that # assists in loading, parsing and visualizing the annotations in COCO. # Pleas...
bsd-3-clause
-9,197,075,660,975,878,000
42.358056
128
0.54775
false