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
deeplook/svglib
tests/test_samples.py
1
16463
#!/usr/bin/env python """Testsuite for svglib. This tests conversion of sample SVG files into PDF files. Some tests try using a tool called uniconv (if installed) to convert SVG files into PDF for comparision with svglib. Read ``tests/README.rst`` for more information on testing! """ import os import glob import re...
lgpl-3.0
-2,501,537,814,356,397,600
36.162528
91
0.568183
false
3.666592
true
false
false
bigswitch/snac-nox
src/nox/apps/directory/dm_ws_groups.py
1
18122
# Copyright 2008 (C) Nicira, Inc. # # This file is part of NOX. # # NOX 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. # # NOX is dist...
gpl-3.0
8,808,889,502,028,325,000
45.706186
96
0.539676
false
4.006633
false
false
false
laurentgo/pants
src/python/pants/backend/jvm/tasks/classpath_products.py
1
3952
# coding=utf-8 # Copyright 2015 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 pant...
apache-2.0
-8,199,300,134,605,323,000
44.425287
99
0.672824
false
4.186441
false
false
false
MartinThoma/PyMySQL
pymysql/connections.py
1
53902
# Python implementation of the MySQL client-server protocol # http://dev.mysql.com/doc/internals/en/client-server-protocol.html # Error codes: # http://dev.mysql.com/doc/refman/5.5/en/error-messages-client.html from __future__ import print_function from ._compat import PY2, range_type, text_type, str_type, JYTHON, IRON...
mit
-927,726,751,287,593,100
35.793174
134
0.575841
false
4.05065
false
false
false
mihaip/readerisdead
reader_archive/reader_archive.py
1
21719
import argparse import itertools import json import logging import os.path import urllib import urllib2 import sys import xml.etree.cElementTree as ET import base.api import base.atom import base.log import base.tag_helper import base.url_fetcher import base.worker def main(): base.log.init() base.atom.init() ...
apache-2.0
8,641,984,040,435,914,000
39.672285
81
0.648833
false
3.543645
false
false
false
luzheqi1987/nova-annotation
nova/tests/unit/api/openstack/compute/contrib/test_cloudpipe.py
1
8260
# 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/LICENSE-2.0 # # Unless requ...
apache-2.0
-8,797,628,048,734,600,000
38.333333
78
0.602663
false
3.829393
true
false
false
krieghan/kobold_python
kobold/tests/test_swap.py
1
3135
import asyncio import unittest from kobold import ( assertions, compare, doubles, swap) class Host(object): def subject(self, arg, kwarg=None): return "original subject" async def subject_cr(self, arg, kwarg=None): return "original subject" class TestInstallP...
mit
5,797,207,600,288,745,000
26.5
74
0.540032
false
4.130435
true
false
false
carlini/cleverhans
examples/multigpu_advtrain/utils_cifar.py
1
5805
""" https://github.com/renmengye/revnet-public/blob/master/resnet/data/cifar_input.py MIT License Copyright (c) 2017 Mengye Ren 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 restrictio...
mit
5,248,748,673,369,022,000
31.982955
81
0.681137
false
3.112601
true
false
false
tensorflow/tfx
tfx/benchmarks/benchmark_utils.py
1
1823
# Copyright 2019 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
-6,241,290,098,297,118,000
30.982456
78
0.721338
false
3.945887
false
false
false
felexx90/service.subtitles.subdivx
service.py
1
21861
# -*- coding: utf-8 -*- # Subdivx.com subtitles, based on a mod of Undertext subtitles # Adaptation: enric_godes@hotmail.com | Please use email address for your # comments # Port to XBMC 13 Gotham subtitles infrastructure: cramm, Mar 2014 from __future__ import print_function from json import loads import os from os.p...
gpl-2.0
526,871,402,262,129,540
35.551839
562
0.57965
false
3.626078
false
false
false
anandpdoshi/erpnext
erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py
1
17777
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, cint, nowdate, add_days, comma_and from frappe import msgprint, _ from frappe.model.document import ...
agpl-3.0
-849,179,727,550,764,800
35.805383
120
0.660179
false
2.971749
false
false
false
joshmoore/openmicroscopy
components/tools/OmeroWeb/omeroweb/webgateway/webgateway_cache.py
1
30403
# # webgateway/webgateway_cache - web cache handler for webgateway # # Copyright (c) 2008, 2009 Glencoe Software, Inc. All rights reserved. # # This software is distributed under the terms described by the LICENCE file # you can find at the root of the distribution bundle, which states you are # free to use it only f...
gpl-2.0
1,907,028,645,191,416,800
34.476079
119
0.516791
false
4.143792
false
false
false
consultit/Ely
ely/direct/data_structures_and_algorithms/ch12/decorated_merge_sort.py
1
1681
# Copyright 2013, Michael H. Goldwasser # # Developed for use with the book: # # Data Structures and Algorithms in Python # Michael T. Goodrich, Roberto Tamassia, and Michael H. Goldwasser # John Wiley & Sons, 2013 # # This program is free software: you can redistribute it and/or modify # it under the terms of...
lgpl-3.0
-2,266,771,482,216,979,700
38.093023
86
0.654967
false
3.864368
false
false
false
kalhartt/dnestpy
examples/example_uistring.py
1
1067
#!/usr/bin/python2.7 import sqlalchemy as sqla import codecs, re uistring = '/mnt/500G/Games/dragonnest/extract/resource/uistring/uistring.xml' message_re = re.compile(r'<message mid="(\d+)"><!\[CDATA\[(.+)\]\]></message>', re.UNICODE|re.DOTALL) def readlines(f, bufsize): buf = u'' data = True while data:...
gpl-2.0
7,095,719,596,313,183,000
31.333333
101
0.621368
false
3.185075
false
false
false
joosthoeks/jhBacktest
jhbacktest/strategy/strategy.py
1
22478
from jhbacktest.data import * import jhbacktest.stats as jhstats from tabulate import tabulate import termcolor as tc class Strategy(object): def __init__(self, df, slippage=0): self.__df = df __data = Data() self.__df_np = __data.df2numpy(self.__df) self.__df_index = -1 ...
gpl-3.0
-576,245,011,368,361,200
37.423932
282
0.533989
false
3.643112
false
false
false
tosaka2/tacotron
models/tacotron.py
1
4014
from util import textinput from util.infolog import log import chainer from chainer import Variable import chainer.functions as F import chainer.links as L import numpy as np from .modules import get_encoder_cbhg, get_decoder_cbhg, PreNet, Attention from hparams import hparams as hp def sequence_embed(embed, xs): ...
mit
2,407,114,685,599,975,400
33.756522
94
0.616366
false
3.013575
false
false
false
huntxu/neutron
neutron/tests/unit/common/test_rpc.py
1
19542
# Copyright 2015 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 req...
apache-2.0
6,218,864,329,141,855,000
38.162325
78
0.631
false
3.859005
true
false
false
MaxIV-KitsControls/tango-facadedevice
facadedevice/device.py
1
12477
"""Provide the facade device class and metaclass.""" # Imports import time import collections # Graph imports from facadedevice.graph import triplet, Graph, INVALID # Exception imports from facadedevice.exception import to_dev_failed, context # Utils imports from facadedevice.utils import EnhancedDevice, aggregate_...
gpl-3.0
1,596,889,208,874,801,400
31.662304
76
0.59213
false
4.326283
false
false
false
palrogg/foundations-homework
Data_and_databases/Homework6_api.py
1
1394
from flask import Flask, request, jsonify import pg8000, decimal import json app = Flask(__name__) def get_data(_type, _sort): conn = pg8000.connect(user="paul", database="mondial") cursor = conn.cursor() sort_result = '' if _sort == 'name': sort_result = 'ORDER BY name' elif _sort in ('a...
mit
-3,189,071,382,793,536,000
23.892857
91
0.558824
false
3.502513
false
false
false
shawnchin/checkfort
checkfort/files.py
1
2041
import os import re import sys from checkfort.exceptions import * from checkfort.logging import p_warn, p_verbose default_extensions = ("h", "f", "F", "f90", "F90", "f95", "F95", "f03", "F03", "f08", "F08", "h",) class InputFileReader(object): def __init__(self, input_...
bsd-3-clause
2,146,750,796,814,318,800
31.919355
79
0.55757
false
3.843691
false
false
false
phgupta/Building-Analytics
building-analytics/TS_Util_Clean_Data.py
1
15125
# -*- coding: utf-8 -*- """ @author : Armando Casillas <armcasillas@ucdavis.edu> @author : Marco Pritoni <marco.pritoni@gmail.com> Created on Wed Jul 26 2017 Update Aug 08 2017 """ from __future__ import division import pandas as pd import os import sys import requests as req import json import numpy as np import dat...
mit
3,792,750,501,190,625,300
23.756137
141
0.484959
false
4.457707
false
false
false
samnjugu/python-gmail
Tools.py
1
3354
#!/usr/bin/python import smtplib, imaplib, email, email.header # Utility class to handle IMAP and SMTP # IMAP is used to fetch emails while SMTP is used to send emails class Gmail(object): def __init__(self, email, password): self.server = 'smtp.gmail.com' self.port = 587 session = smtpli...
gpl-2.0
5,599,144,041,551,790,000
34.305263
91
0.59511
false
3.653595
false
false
false
osroom/osroom
apps/core/logger/logger_server.py
1
4431
#!/usr/bin/env python # -*-coding:utf-8-*- # @Time : 2017/11/1 ~ 2019/9/1 # @Author : Allen Woo import json import os import socket import time import logging from logging.handlers import TimedRotatingFileHandler from apps.configs.sys_config import LOG_PATH, SOCKET_PORT from apps.utils.osr_async.osr_async import async...
bsd-2-clause
-8,607,789,152,920,088,000
30.877698
92
0.541864
false
3.576271
false
false
false
baoboa/pyqt5
examples/itemviews/frozencolumn/frozencolumn.py
1
7103
#!/usr/bin/env python ############################################################################# ## ## Copyright (C) 2017 Hans-Peter Jansen <hpj@urpla.net> ## Copyright (C) 2016 The Qt Company Ltd. ## ## This file is part of the examples of the Qt Toolkit. ## ## $QT_BEGIN_LICENSE:BSD$ ## Commercial License Usage ##...
gpl-3.0
1,153,572,706,326,094,600
42.576687
84
0.669435
false
4.263505
false
false
false
olhoneles/olhoneles
montanha/forms.py
1
1722
# -*- coding: utf-8 -*- # # Copyright (©) 2013 Marcelo Jorge Vieira <metal@alucinados.com> # # 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 ...
agpl-3.0
3,365,229,986,152,435,700
32.745098
75
0.624637
false
4.011655
false
false
false
jiteshjha/remote-screen-control
pyxhook.py
1
15967
#!/usr/bin/python # # pyxhook -- an extension to emulate some of the PyHook library on linux. # # Copyright (C) 2008 Tim Alexander <dragonfyre13@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 Fr...
mit
6,552,510,022,520,829,000
43.352778
346
0.591032
false
3.836377
false
false
false
f4exb/zfs-mania
zfile.py
1
4902
#!/usr/bin/env python """ Find details about a directory or plain file in a ZFS dataset using zdb utility """ import sys, os, traceback import re from optparse import OptionParser # ====================================================================== class Error(Exception): """Base class for exceptions in this...
mit
-4,963,215,025,282,937,000
34.781022
165
0.509384
false
4.436199
false
false
false
fortnight/Grammar_Game
Grammar_Game.py
1
13707
#!/usr/bin/python import sys import pygame from Buttons import Buttons from GameButton import GameButton from MenuButton import MenuButton from gi.repository import Gtk class Grammar_Game: def __init__(self): # Set up a clock for managing the frame rate. self.clock = pygame.time.Clock() s...
gpl-3.0
-7,798,434,488,820,568,000
40.286145
113
0.571898
false
3.255046
true
false
false
tensorflow/moonlight
moonlight/score/reader_test.py
1
19072
# 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, ...
apache-2.0
5,633,878,991,176,298,000
40.641921
80
0.566328
false
3.090084
true
false
false
psiwczak/openstack
nova/utils.py
1
53103
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # Copyright 2011 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may #...
apache-2.0
-3,467,027,477,747,099,000
31.439218
79
0.58718
false
4.178049
false
false
false
telminov/django-park-keeper
parkkeeper/forms.py
1
2880
# coding: utf-8 import json from django import forms from parkkeeper import models from croniter import croniter class BaseSchedule(forms.ModelForm): def clean_options_json(self): options_json = self.cleaned_data.get('options_json') if options_json: try: options = json...
mit
5,198,988,995,579,362,000
33.285714
113
0.601736
false
4.292101
false
false
false
WillisXChen/django-oscar
oscar/lib/python2.7/site-packages/behave/runner.py
1
24139
# -*- coding: utf-8 -*- from __future__ import with_statement import contextlib import os.path import StringIO import sys import traceback import warnings import weakref from behave import matchers from behave.step_registry import setup_step_decorators from behave.formatter import formatters from behave.configuration...
bsd-3-clause
2,834,012,232,175,173,600
34.290936
80
0.577944
false
4.350153
true
false
false
eyolfson/site-eyl
django_blog/hooks.py
1
1907
# Copyright 2014 Jon Eyolfson # # This file is distributed under the GPLv3 license import datetime import logging import markdown import os import pygit2 from django_blog.models import Post from django_gitolite.utils import home_dir logger = logging.getLogger('django_blog') def update_blog(push): repo_path = pu...
gpl-3.0
-1,440,978,568,700,513,800
33.672727
78
0.571054
false
3.899796
false
false
false
AngelValera/bares-y-tapas-DAI
proyecto_DAI/urls.py
1
1515
"""proyecto_DAI URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Clas...
mit
-4,793,245,582,486,517,000
35.95122
105
0.691089
false
3.668281
false
false
false
gschizas/praw
praw/models/reddit/wikipage.py
1
10000
"""Provide the WikiPage class.""" from typing import Any, Dict, Generator, Optional, TypeVar, Union from ...const import API_PATH from ...util.cache import cachedproperty from ..listing.generator import ListingGenerator from .base import RedditBase from .redditor import Redditor _WikiPage = TypeVar("_WikiPage") Reddi...
bsd-2-clause
416,485,246,232,412,200
33.482759
79
0.5675
false
4.156276
true
false
false
tokenly/bitsplit-server
util/entity.py
1
1359
""" ENTITY """ class Entity(object): """ ENTITY A wrapped for a data dictionary. Allows interface with data, but also allows extending to allow methods to manipulate data. """ def __init__(self, collection, data=None): if not data: data = {} super(Entity, self).__...
gpl-2.0
-3,386,305,237,740,637,000
27.3125
76
0.555556
false
4.260188
false
false
false
futurepr0n/Books-solutions
Python-For-Everyone-Horstmann/Chapter6-Lists/P6.30.py
1
1303
# Write a function # def mergeSorted(a, b) # that merges two sorted lists, producing a new sorted list. Keep an index into each list, # indicating how much of it has been processed already. Each time, append the small- # est unprocessed element from either list, then advance the index. For example, if a is # 1 ...
mit
-8,833,145,592,245,625,000
23.603774
90
0.558711
false
3.290404
false
false
false
Melnick/Cnake
core/functions.py
1
1074
import os import shutil from unicurses import * from appdirs import * SEPARATOR = (os.name in ['ce', 'nt', 'dos']) and '\\' or '/'; def add_vector(a, b): return (a[0] + b[0], a[1] + b[1]); def w_log( path, attr = "a+", string = '' ): dir_path = user_log_dir("cnake"); path = "{}{}{}".format(dir_path, SEPARATOR...
mit
7,789,643,010,407,323,000
18.545455
67
0.557728
false
2.365639
false
false
false
jgerigmeyer/jquery-django-superformset
demo/demo/settings.py
1
2111
""" Django settings for demo 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, ...) impor...
bsd-3-clause
-306,492,205,986,182,200
23.264368
71
0.717196
false
3.16967
false
false
false
xupingmao/xnote
handlers/fs/fs_tools.py
1
1725
# -*- coding:utf-8 -*- # @author xupingmao <578749341@qq.com> # @since 2020/12/08 01:46:35 # @modified 2021/07/04 17:09:54 # -*- coding:utf-8 -*- # @since 2018-11-22 00:46:26 import os import re import math import time import web import xconfig import xutils import xauth import xmanager import xtables import random fro...
gpl-3.0
5,460,477,757,280,500,000
21.905405
77
0.578171
false
3.054054
false
false
false
google-research/google-research
rl_repr/tests/train_eval_offline_test.py
1
1293
# 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
-7,335,390,548,113,482,000
31.325
74
0.738592
false
3.673295
false
false
false
eugeneai/DME
src/icc/dme/fd/Exploration2.py
1
1877
from Numeric import * from mutils import * from biomass import * from free import * from spelper import * from logging import * def open1(name, mode): f=open(name, mode) f.write("from mutils import *\nfrom Numeric import *\n") return f next_data={ "low":(0,"middle"), "middle":(0,"high"), "high":(1,"low"), } de...
gpl-3.0
-9,175,346,103,418,292,000
16.707547
89
0.664891
false
2.506008
false
false
false
xiangke/pycopia
aid/pycopia/words.py
1
1795
#!/usr/bin/python2.4 # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # # $Id$ # # Copyright (C) 1999-2006 Keith Dart <keith@kdart.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...
lgpl-2.1
6,614,251,274,612,924,000
25.791045
71
0.627855
false
3.61167
false
false
false
aleksandar-mitrevski/robot_simulation
localisation/scripts/motion_model.py
1
2619
from math import cos, sin, atan2, exp, sqrt, pi from random import uniform from copy import copy from pose import Pose from velocity import Velocity from filter_parameters import MotionModelNoiseParameters class MotionModel(object): '''Defines a utility for sampling a motion model. Author -- Aleksandar Mitre...
mit
7,306,093,108,900,116,000
45.767857
226
0.654066
false
3.286073
false
false
false
TexasLAN/texaslan.org
texaslan/users/migrations/0007_auto_20170115_1721.py
1
1682
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2017-01-15 23:21 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0006_auto_20160822_0840'), ] operations = [ migrations.AddField( ...
mit
3,448,541,350,329,890,300
34.787234
119
0.483353
false
4.414698
false
false
false
starkdee/courseware
userprofile/views.py
1
1274
from django.shortcuts import render, redirect from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.forms.models import model_to_dict from userprofile.models import UserProfile from userprofile.forms import EditUserForm, EditUserProfileForm @login_required ...
mit
7,111,900,879,933,584,000
37.636364
124
0.704082
false
4.031646
false
false
false
orlenko/bccf
src/bccf/migrations/0020_auto__add_field_userprofile_membership_order_free.py
1
45167
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'UserProfile.membership_order_free' db.add_column(u'bccf_userprofile', 'membership_order_free...
unlicense
-3,563,531,983,299,049,000
92.709544
195
0.549251
false
3.494005
false
false
false
aurelieladier/openturns
python/test/t_KrigingAlgorithm_std.py
1
2901
#! /usr/bin/env python from __future__ import print_function from openturns import * from openturns.testing import * TESTPREAMBLE() # Test 1 sampleSize = 6 dimension = 1 f = NumericalMathFunction(['x0'], ['y'], ['x0 * sin(x0)']) X = NumericalSample(sampleSize, dimension) X2 = NumericalSample(sampleSize, dimension...
lgpl-3.0
-6,366,065,284,722,497,000
25.372727
74
0.736987
false
3.063358
false
false
false
bicephale/OctoPrint
src/octoprint/plugins/softwareupdate/version_checks/github_commit.py
1
1955
# coding=utf-8 from __future__ import absolute_import, division, print_function __author__ = "Gina Häußge <osd@foosel.net>" __license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html' __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" im...
agpl-3.0
-7,031,101,314,761,969,000
32.101695
133
0.725038
false
3.344178
false
false
false
kreatorkodi/repository.torrentbr
plugin.video.youtube/resources/lib/youtube_plugin/youtube/client/__config__.py
1
10980
# -*- coding: utf-8 -*- from base64 import b64decode from hashlib import md5 from ...kodion.json_store import APIKeyStore, LoginTokenStore from ...kodion import Context as __Context from ... import key_sets DEFAULT_SWITCH = 1 __context = __Context(plugin_id='plugin.video.youtube') __settings = __context.get_settings...
gpl-2.0
1,809,156,470,379,663,000
47.157895
127
0.576321
false
3.66122
false
false
false
awsdocs/aws-doc-sdk-examples
python/example_code/iotthingsgraph/ms.py
1
6258
# # Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # This file is licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # This file is...
apache-2.0
7,958,414,060,473,398,000
35.389535
137
0.721477
false
3.615251
true
false
false
BU-PyCon/Meeting-2
Programs/PyPlot.py
1
18763
import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.patches import * import pdb print(""" MatPlotLib Advanced Tutorial ---------------------------- This is a tutorial covering the features and usage of the matplotlib package in more detail. In truth, no...
mit
6,750,708,883,860,443,000
37.752119
102
0.65933
false
3.516963
false
false
false
fake-name/ReadableWebProxy
WebMirror/management/rss_parser_funcs/feed_parse_extractJingletranslationsWordpressCom.py
1
1391
def extractJingletranslationsWordpressCom(item): ''' Parser for 'jingletranslations.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('Breaking Off the Engagement… Bring it on!', ...
bsd-3-clause
-4,616,527,478,748,570,000
52.230769
134
0.506869
false
3.789041
false
false
false
oliora/couched
setup.py
1
1040
from setuptools import setup import sys if sys.version < "2.7": raise Exception("Couched needs Python 2.7 or above") LONG_DESCRIPTION = open('README.txt').read() CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Opera...
mit
2,050,784,413,894,405,000
23.209302
56
0.6
false
3.661972
false
true
false
tmrowco/electricitymap
parsers/lib/validation.py
1
5884
#!/usr/bin/env python3 """Centralised validation function for all parsers.""" from logging import getLogger def has_value_for_key(datapoint, key, logger): """checks that the key exists in datapoint and that the corresponding value is not None""" if datapoint['production'].get(key, None) is None: ...
gpl-3.0
7,181,092,218,174,970,000
33.611765
79
0.533651
false
4.043986
false
false
false
gurpinars/hash-generator
hashGenerator.py
1
3997
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'hashGenerator.ui' # # Created: Tue Dec 18 00:25:17 2012 # by: PyQt4 UI code generator 4.9.3 # # WARNING! All changes made in this file will be lost! # # Author:M. Sami GÜRPINAR # Email :sami.gurpinar@gmail.com # from PyQt4 import ...
gpl-3.0
-2,423,430,719,406,215,700
43.898876
122
0.676677
false
3.769811
false
false
false
RylanGotto/web-dash
websterton/settings.py
1
1382
# -*- coding: utf-8 -*- import os os_env = os.environ class Config(object): SECRET_KEY = os_env.get('WEBSTERTON_SECRET', 'secret-key') # TODO: Change me APP_DIR = os.path.abspath(os.path.dirname(__file__)) # This directory PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir)) BCRYPT_LOG_R...
bsd-3-clause
-2,148,368,910,370,387,200
31.139535
81
0.652677
false
3.244131
true
false
false
Villoid/PynamoDB
pynamodb/tests/test_model.py
1
80527
""" Test model API """ import random import json import copy from datetime import datetime import six from botocore.client import ClientError from pynamodb.compat import CompatTestCase as TestCase from pynamodb.tests.deep_eq import deep_eq from pynamodb.throttle import Throttle from pynamodb.connection.util import py...
mit
284,875,441,389,348,600
35.013864
114
0.442237
false
4.494447
true
false
false
jaalto/httping
plot-json.py
2
1581
#! /usr/bin/python import sys import json import os import math fin = sys.argv[1] print "Loading from %s" % (fin) fh = open(fin) json_data = json.load(fh) print "Number of rows: %d" % (len(json_data)) fdata = fin + ".dat" print "Writing data to %s" % (fdata) data_fh = open(fdata, "w") host='?' total=0 total_sd...
gpl-2.0
7,975,171,851,592,360,000
19.269231
87
0.611006
false
2.421133
false
false
false
mediafactory/yats
modules/yats/__init__.py
1
1499
# -*- coding: utf-8 -*- from django.conf import settings from sys import version_info from yats.api import * def update_permissions_after_migration(app,**kwargs): """ Update app permission just after every migration. This is based on app django_extensions update_permissions management command. """ ...
mit
-2,771,371,696,905,066,500
29.591837
81
0.607071
false
3.477958
false
false
false
L33tCh/afj-flask
manage.py
1
1644
# manage.py import os import unittest import coverage from flask_script import Manager from flask_migrate import Migrate, MigrateCommand from project.server import app, db, models COV = coverage.coverage( branch=True, include='project/*', omit=[ 'project/tests/*', 'project/server/config...
mit
2,866,174,267,722,228,700
20.363636
79
0.628954
false
3.66147
true
false
false
dek-odoo/python-samples
python exercises/dek_program017.py
1
1356
#!/user/bin/python # -*- coding: utf-8 -*- # Author : (DEK) Devendra Kavthekar # program# : Name # => # Write a program that computes the net amount of a bank account # based a transaction log from console input. The transaction log # format is shown as following: # D 100 # W 200 # �� # D means deposit while W means ...
apache-2.0
-1,340,673,859,671,175,200
24.509434
76
0.54068
false
3.548556
false
false
false
srlobo/slutils
slutils/sqlalchemy/group_concat.py
1
1779
# -*- coding: utf-8 -*- # Añade la funcionalidad group_concat de mysql al sqlalchemy from sqlalchemy.ext import compiler from sqlalchemy.sql import ColumnElement from sqlalchemy.orm.attributes import InstrumentedAttribute class group_concat(ColumnElement): def __init__(self, col1, col2=None, separator=None): ...
gpl-2.0
-7,678,533,400,014,553,000
29.655172
68
0.610236
false
3.799145
false
false
false
mosquito/lumper
lumper/modes/worker.py
1
1481
#!/usr/bin/env python # encoding: utf-8 from crew.worker import Listener, Context, NODE_UUID, UUID from pika import PlainCredentials from crew.worker import context import logging import docker import docker.tls import lumper.worker def run(args): log = logging.getLogger("main") if args.docker_tls: t...
lgpl-3.0
2,745,685,323,294,813,000
30.510638
123
0.607022
false
3.826873
false
false
false
stormandco/aiohttp_debugtoolbar
aiohttp_debugtoolbar/main.py
1
3654
import os import jinja2 import aiohttp_jinja2 from . import views from . import panels from .middlewares import middleware from .utils import APP_KEY, TEMPLATE_KEY, STATIC_ROUTE_NAME, hexlify, \ ToolbarStorage, ExceptionHistory from .views import ExceptionDebugView default_panel_names = [ panels.HeaderDebugPa...
apache-2.0
-954,536,894,783,035,800
33.8
79
0.6341
false
3.668675
false
false
false
jbd/treewatcher
setup.py
1
1411
#!/usr/bin/env python # check Python's version import sys if sys.version < '2.4': sys.stderr.write('This module requires at least Python 2.5\n') sys.exit(1) # import statements import platform from setuptools import setup, Command # debug DISTUTILS_DEBUG = False # check linux platform if not platform.system...
gpl-3.0
1,692,870,964,562,512,400
22.131148
70
0.628632
false
3.458333
false
false
false
borg-project/cargo
src/python/cargo/random.py
1
1157
""" @author: Bryan Silverthorn <bcs@cargo-cult.org> """ from __future__ import absolute_import import numpy def get_random_random(random = numpy.random): """ Get a randomly-initialized PRNG. """ from numpy.random import RandomState return RandomState(random.randint(numpy.iinfo(int).max)) def r...
mit
-8,786,405,354,850,565,000
19.660714
70
0.633535
false
3.793443
false
false
false
mandli/multilayer-examples
2d/plane_wave/setrun.py
1
15949
""" Module to set up run time parameters for Clawpack. The values set in the function setrun are then written out to data files that will be read in by the Fortran code. """ import numpy as numpy import clawpack.geoclaw.multilayer.data as multilayer import clawpack.geoclaw.surge.data as surge import clawpack.geocla...
mit
5,311,222,775,262,506,000
30.459566
92
0.589818
false
3.381891
false
false
false
ovpn-to/oVPN.to-Client-Software
else/python/hooks.py
1
17289
# -*- coding: utf-8 -*- # # Hooks module for py2exe. # Inspired by cx_freeze's hooks.py, which is: # # Copyright © 2007-2013, Anthony Tuininga. # Copyright © 2001-2006, Computronix (Canada) Ltd., Edmonton, Alberta, Canada. # All rights reserved. # import os, sys # Exclude modules that the standard library imp...
gpl-2.0
4,706,690,525,302,096,000
34.79089
81
0.64939
false
3.915515
false
false
false
mekkablue/ShowCrosshair
ShowCrosshair.glyphsReporter/Contents/Resources/plugin.py
1
11905
# encoding: utf-8 from __future__ import division, print_function, unicode_literals ####################################################################################### # # Reporter Plugin # # Read the docs: # https://github.com/schriftgestalt/GlyphsSDK/tree/master/Python%20Templates/Reporter # ####################...
apache-2.0
-7,762,868,965,284,269,000
32.369318
165
0.698876
false
2.925529
false
false
false
coderum/crony
crony/crony.py
1
3147
import click from . import utils, views from . import parsers as p from .crontab import Crontab try: from StringIO import StringIO except ImportError: from io import StringIO @click.group() def crony(): pass @crony.command() @click.option('--limit', default=0, help="Number of crons to di...
gpl-3.0
-5,281,866,693,860,838,000
29.553398
78
0.593581
false
3.450658
false
false
false
denismakogon/trove-guestagent
trove_guestagent/common/context.py
1
1865
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # 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.apach...
apache-2.0
-7,662,403,318,449,441,000
33.537037
78
0.680965
false
4.327146
false
false
false
yishayv/lyacorr
extinction_correlation.py
1
10396
""" Computes the Lyman-alpha forest auto-correlation estimator. The work is split between MPI nodes based on the first QSO in each possible pair. Partial data is gathered and the correlation estimator file is saved after processing each sub-chunk. """ import cProfile import itertools import numpy as np fro...
mit
99,461,778,343,690,620
47.807512
118
0.649288
false
3.407407
false
false
false
cb1234/pynet-test
learnpy/class7/ex1a_cdp_parsing.py
1
1528
#!/usr/bin/env python ''' Create a program that opens the 'r1_cdp.txt' file and using regular expressions extracts the remote hostname, remote IP address, model, vendor, and device_type. ''' import re from pprint import pprint def generic_cdp_parser(pattern, cdp): ''' Search for pattern in the cdp data ...
apache-2.0
-6,601,483,307,684,706,000
25.807018
93
0.604712
false
3.433708
false
false
false
kaushik94/sympy
sympy/parsing/tests/test_maxima.py
2
1711
from sympy.parsing.maxima import parse_maxima from sympy import Rational, Abs, Symbol, sin, cos, E, oo, log, factorial from sympy.abc import x n = Symbol('n', integer=True) def test_parser(): assert Abs(parse_maxima('float(1/3)') - 0.333333333) < 10**(-5) assert parse_maxima('13^26') == 917333301932686166583...
bsd-3-clause
-5,753,884,372,647,215,000
37.022222
75
0.576856
false
2.703002
false
false
false
epeli/subssh
tests/test_assert_function_args.py
1
6487
''' Created on Mar 26, 2010 @author: epeli ''' import unittest from subssh.tools import assert_args from subssh import InvalidArguments class TestRequireArgumensWithFunctions(unittest.TestCase): def test_require_zero(self): def f(): pass assert_args(f, []) args = [...
agpl-3.0
-7,018,316,184,167,904,000
21.681818
93
0.546323
false
3.611915
true
false
false
colemanja91/PyEloqua-Examples
venv/lib/python3.4/site-packages/simple_salesforce/api.py
1
27063
"""Core classes and exceptions for Simple-Salesforce""" # has to be defined prior to login import DEFAULT_API_VERSION = '29.0' import requests import json try: from urlparse import urlparse except ImportError: # Python 3+ from urllib.parse import urlparse from simple_salesforce.login import SalesforceL...
gpl-2.0
-4,290,808,311,357,684,000
37.661429
106
0.595389
false
4.455548
false
false
false
elfxwt/SpiderOfPython
main_simple.py
1
3003
# -*- coding: utf-8 -*- import requests import bs4 import time import codecs class Tool: def __init__(self,cityName): self.rootUrl = 'http://www.anjuke.com/' self.baseUrl = self.rootUrl + cityName + '/cm/' self.checkHref = self.rootUrl + cityName + '/' self.blUrlModle = 'http://'+cityName+'.anjuke.com/commu...
apache-2.0
3,719,469,298,661,651,000
22.023077
108
0.659539
false
2.566895
false
false
false
clubcapra/Ibex
src/seagoatvision_ros/scripts/CapraVision/client/gtk/filters/implementation/WinMorphology.py
1
3720
#! /usr/bin/env python # Copyright (C) 2012 Club Capra - capra.etsmtl.ca # # This file is part of CapraVision. # # CapraVision 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 versio...
gpl-3.0
7,680,349,863,580,811,000
39.445652
90
0.676075
false
3.360434
true
false
false
musteryu/Data-Mining
assignment-黄煜-3120100937/question_4.py
1
1258
from mylib import * import os,sys import numpy as np import matplotlib.pyplot as plt import math import random from time import time if __name__ == '__main__': DIR_PATH = sys.path[0] + '\\' # normal distribution vector file nvctr_file1 = DIR_PATH + 'normal_500_1.txt' nvctr_file2 = DIR_PATH + 'normal_500_2.txt' #...
gpl-2.0
-7,111,678,879,534,298,000
26.977778
97
0.705087
false
2.740741
false
false
false
sibskull/synaptiks
scripts/try_keyboard_monitor.py
1
3711
#!/usr/bin/python2 # Copyright (c) 2010, 2011, Sebastian Wiesner <lunaryorn@googlemail.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 abov...
bsd-2-clause
7,346,558,691,500,575,000
39.336957
79
0.737807
false
4.132517
false
false
false
riddlezyc/geolab
src/structure/Z.py
1
1474
# -*- coding: utf-8 -*- # from framesplit import trajectory # too slow using this module import matplotlib.pyplot as plt dirName = r"F:\simulations\asphaltenes\na-mont\TMBO-oil\water\373-continue/" xyzName = 'all.xyz' hetero = 'O' # 'oh' 'N' 'sp' 'O' 'Np' 'sp' with open(dirName + xyzName, 'r') as f...
gpl-3.0
1,018,782,703,266,797,700
24.8
76
0.580054
false
2.613475
false
false
false
alephdata/aleph
aleph/views/xref_api.py
1
3909
import logging from flask import Blueprint, request from pantomime.types import XLSX from aleph.search import XrefQuery from aleph.logic.profiles import pairwise_judgements from aleph.logic.export import create_export from aleph.views.serializers import XrefSerializer from aleph.queues import queue_task, OP_XREF, OP_E...
mit
-5,093,979,607,631,259,000
27.532847
88
0.589153
false
4.154091
false
false
false
rbose85/bounce-cars
backend/bounce/settings/base.py
1
2389
import os from django.core.exceptions import ImproperlyConfigured def get_env_setting(setting): """Return the value of an environment variable, or raise an exception.""" try: return os.environ[setting] except KeyError: error_msg = "Set the {} env variable".format(setting) raise Im...
mit
-924,595,611,643,535,000
22.194175
77
0.686898
false
3.549777
false
false
false
andela-ooshodi/codango-debug
codango/account/migrations/0001_initial.py
1
1359
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import cloudinary.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ ...
mit
-6,548,849,997,940,557,000
41.46875
162
0.608536
false
4.081081
false
false
false
bnbowman/HlaTools
src/pbhla/io/utils.py
1
4688
#! /usr/bin/env python from pbhla.filenames import get_file_type __author__ = 'bbowman@pacificbiosciences.com' import logging from tempfile import NamedTemporaryFile from pbcore.io.FastaIO import FastaRecord, FastaWriter from pbcore.io.FastqIO import FastqRecord, FastqWriter from pbhla.io.AmpAnalysisIO import Amplic...
bsd-3-clause
7,961,908,533,006,520,000
32.726619
84
0.636092
false
3.88401
false
false
false
jashort/clexp
tests/test_expenseList.py
1
2297
from unittest import TestCase import datetime from ExpenseList import ExpenseList class TestExpenseList(TestCase): def setUp(self): self.el = ExpenseList() # passing amount as a float is valid self.el.add_expense([2.11, "Food", "Candy Bar", "12/01/2013"]) # so is a string ...
mit
7,159,833,294,169,194,000
37.949153
88
0.62168
false
3.17704
true
false
false
apache/airflow
airflow/timetables/interval.py
2
3585
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
-9,126,267,543,298,766,000
37.967391
85
0.697071
false
4.350728
false
false
false
andreasjansson/head-in-the-clouds
headintheclouds/firewall.py
1
3928
from fabric.api import * # pylint: disable=W0614,W0401 CHAIN = 'HEAD_IN_THE_CLOUDS' def set_rules(open_list, from_chains=('INPUT',)): rules = make_rules(open_list, from_chains) rules = ['iptables ' + r for r in rules] cmd = ' && '.join(rules) sudo(cmd) def make_rules(open_list, from_chains=('INPUT',)...
gpl-3.0
6,920,921,952,457,535,000
29.6875
118
0.598778
false
3.124901
false
false
false
lukasmartinelli/opencodereview
opencodereview/apps/reviews/views.py
1
2271
from django.shortcuts import render_to_response, redirect, render from django.contrib.auth import logout as auth_logout from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.conf import settings from github3 import login from .forms import ReviewRequestForm ...
mit
-2,511,120,545,363,810,000
28.493506
79
0.667547
false
3.97028
false
false
false
JohnOmernik/pimeup
animatronics/oldPWM/JO_Servo.py
1
1554
#!/usr/bin/python from Adafruit_PWM_Servo_Driver import PWM import time import sys # =========================================================================== # Example Code # =========================================================================== # Initialise the PWM device using the default address pwm = PWM(...
apache-2.0
-5,419,668,898,720,730,000
22.19403
77
0.545045
false
3.120482
false
false
false
leejw51/BumblebeeNet
Test/AddLayer.py
1
1320
import numpy as np import matplotlib.pylab as plt from MulLayer import MulLayer class AddLayer: def __init__ (self): pass def forward(self, x, y): out = x + y return out def backward(self, dout): dx = dout * 1 ...
mit
-5,489,069,071,422,700,000
27.085106
81
0.568182
false
3.59673
false
false
false
davidfstr/iTunes-Connect-Autodownload
autodownload.py
1
2639
import os import re import datetime import subprocess vendorid = 85838187 # David Foster # Find all reports in the current directory reports = [] # list of (vendorid, YYYYMMDD), both strings for filename in os.listdir('.'): # NOTE: Download filename format changed on...
mit
4,098,500,137,916,123,000
40.888889
165
0.648731
false
3.780802
false
false
false
workforce-data-initiative/tpot-warehouse
migrations/transactional/versions/42026ba5bc27_createdb.py
1
3890
"""createdb Revision ID: 42026ba5bc27 Revises: Create Date: 2017-06-22 20:07:58.548427 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '42026ba5bc27' down_revision = None branch_labels = None depends_on = None def upgrade(): op.create_table('entity_type'...
apache-2.0
-7,156,879,574,634,049,000
39.520833
90
0.674807
false
3.482543
false
false
false
dparlevliet/elastic-firewall
api/digital_ocean.py
1
1323
""" @fileoverview Digital Ocean API @author David Parlevliet @version 20130315 @preserve Copyright 2013 David Parlevliet. Digital Ocean API ================= Class to get the server details via the Digital Ocean API. """ import requests import json import re class Api(): group_name = "Digital Ocean" client_key ...
mit
-8,083,045,312,272,190,000
24.442308
90
0.605442
false
3.604905
false
false
false
joergsimon/gesture-analysis
analysis/feature_selection.py
1
6744
from analysis.preparation import labelMatrixToArray from analysis.preparation import normalizeZeroClassArray from visualise.trace_features import trace_feature_origin from visualise.confusion_matrix import plot_confusion_matrix import numpy as np import sklearn import sklearn.linear_model import sklearn.preprocessing ...
apache-2.0
9,204,650,859,059,847,000
47.178571
120
0.696323
false
3.39577
false
false
false
Stanford-Online/notifier
notifier/tests/test_user.py
1
10684
""" """ from django.test import TestCase from django.test.utils import override_settings from mock import patch from notifier.user import get_digest_subscribers, DIGEST_NOTIFICATION_PREFERENCE_KEY from notifier.user import get_moderators from .utils import make_mock_json_response TEST_API_KEY = 'ZXY123!@#$%' # som...
agpl-3.0
-2,097,093,915,212,685,600
33.801303
136
0.544833
false
3.873822
true
false
false
Rignak/Scripts-Python
DeepLearning/TagPrediction/TagPrediction.py
1
10291
import numpy as np import matplotlib.pyplot as plt import os from os.path import join import cv2 from skimage.transform import resize from tqdm import tqdm from datetime import datetime import functools os.environ['TF_CPP_MIN_VLOG_LEVEL'] = '3' os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' from keras import optimizers fro...
gpl-3.0
7,879,356,906,679,736,000
34.982517
113
0.598095
false
3.309003
false
false
false
yajunyang/ShakeCamera
MicroAgent/local/proxylib.py
1
105526
#!/usr/bin/env python # coding:utf-8 __version__ = '1.1' import sys import os import glob import errno import time import struct import collections import binascii import zlib import itertools import re import fnmatch import io import random import base64 import string import hashlib import threading import thread im...
mit
-8,006,201,042,803,955,000
44.801215
252
0.569537
false
3.890073
false
false
false
botswana-harvard/bcvp
bcvp/bcvp_dashboard/classes/subject_dashboard.py
1
2829
from edc_dashboard.subject import RegisteredSubjectDashboard from bcvp.bcvp_lab.models import SubjectRequisition from bcvp.bcvp_subject.models import SubjectVisit, SubjectConsent, SubjectLocator from bcvp.bcvp_subject.models.subject_eligibility import SubjectEligibility class SubjectDashboard(RegisteredSubjectDashbo...
gpl-2.0
-9,080,255,707,335,773,000
38.291667
114
0.683634
false
4.216095
false
false
false