commit
stringlengths
40
40
subject
stringlengths
1
3.25k
old_file
stringlengths
4
311
new_file
stringlengths
4
311
old_contents
stringlengths
0
26.3k
lang
stringclasses
3 values
proba
float64
0
1
diff
stringlengths
0
7.82k
066ba7f846f9cf32e29e82f6ba90db4f4f27029f
Create superBall.py
CodeWars/8kyu/superBall.py
CodeWars/8kyu/superBall.py
Python
0.000003
@@ -0,0 +1,92 @@ +class Ball(object):%0A def __init__(self, type = %22regular%22):%0A self.ball_type = type%0A
8579e10ad13f2a9b5680edfbe185d3e1b597f9c6
add hello.py
hello.py
hello.py
Python
0.999964
@@ -0,0 +1,230 @@ +# -*- coding: utf-8 -*-%0A%22%22%22%0ACreated on Fri Oct 16 20:11:07 2015%0A%0A@author: jessime%0A%22%22%22%0A%0Afrom flask import Flask%0Aapp = Flask(__name__)%0A%0A@app.route(%22/%22)%0Adef hello():%0A return %22Hello World!%22%0A%0Aif __name__ == %22__main__%22:%0A app.run()
c2d48bec0d025d1aedf2c1f8d8f042eb14cabc52
Add error message if no .go files are specified.
base_workspace/tools/build_rules/go_rules.bzl
base_workspace/tools/build_rules/go_rules.bzl
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """These are bare-bones Go rules. Several issues: - For "a/b/c.go", the go tool creates library "a/b.a" with import path "a/b". We can probably simulate this with symlink trees. - Dependencies are not enforced; a symlink tree might help here too. - Hardcoded to 6g from the GC suite. We should be able to support GCC and derive 6g from the CPU (from which configuration?) - It would be nice to be able to create a full-fledged Go configuration in Skylark. - It would be nice to support zero-configuration go_library()/go_binary()/go_test() rules: * name defaults to basename of directory * srcs defaults to *.go - does not support checked in compilers. - No C++ interop. - deps must be populated by hand or using Glaze. - go_test must have both test and non-test files in srcs. """ go_filetype = FileType([".go"]) go_lib_filetype = FileType([".a"]) def go_compile_command(ctx, sources, out_lib): args = [ ctx.files.go_root[0].path + "/bin/go", "tool", "6g", "-o", out_lib.path, "-pack", # Import path. "-I", ctx.configuration.bin_dir.path] # Set -p to the import path of the library, ie. # (ctx.label.package + "/" ctx.label.name) for now. return ' '.join(args + cmd_helper.template(sources, "%{path}")) def go_library_impl(ctx): sources = ctx.files.srcs out_lib = ctx.outputs.lib ctx.action( inputs = sources + ctx.files.deps, outputs = [out_lib], mnemonic = "GoCompile", env = { "GOROOT": ctx.files.go_root[0].path, }, command = go_compile_command(ctx, set(sources), out_lib)) out_nset = set([out_lib]) return struct( files = out_nset, go_library_object = out_nset) def go_link_action(ctx, lib, executable): cmd = ' '.join([ ctx.files.go_root[0].path + "/bin/go", "tool", "6l", # Link search path. "-L", ctx.configuration.bin_dir.path, "-o", executable.path, lib.path]) ctx.action( inputs = [lib], outputs = [executable], command = cmd, env = { "GOROOT": ctx.files.go_root[0].path, }, mnemonic = "GoLink") def go_binary_impl(ctx): lib_result = go_library_impl(ctx) executable = ctx.outputs.executable lib_out = ctx.outputs.lib go_link_action(ctx, lib_out, executable) return struct(files = set([executable]) + lib_result.files) def go_test_impl(ctx): lib_result = go_library_impl(ctx) main_go = ctx.outputs.main_go go_import = ctx.label.package + "/" + ctx.label.name # Would be nice to use transitive info provider to get at sources of # a dependent library. sources = ctx.files.srcs args = (["--package", go_import, "--output", ctx.outputs.main_go.path] + cmd_helper.template(set(sources), "%{path}")) ctx.action( inputs = sources, executable = ctx.executable.test_generator, outputs = [main_go], mnemonic = "GoTestGenTest", arguments = args) ctx.action( inputs = [main_go, ctx.outputs.lib], outputs = [ctx.outputs.main_lib], command = go_compile_command(ctx, set([main_go]), ctx.outputs.main_lib), env = { "GOROOT": ctx.files.go_root[0].path, }, mnemonic = "GoCompileTest") go_link_action(ctx, ctx.outputs.main_lib, ctx.outputs.executable) runfiles = ctx.runfiles(collect_data = True, files = [ctx.outputs.executable]) return struct(runfiles=runfiles) go_library_attrs = { "data": attr.label_list(allow_files=True, cfg=DATA_CFG), "srcs": attr.label_list(allow_files=go_filetype), "deps": attr.label_list( providers=["go_library_object"]), "go_root": attr.label( default=Label("//tools/go:go_root"), allow_files=True, cfg=HOST_CFG), } go_library_outputs = { "lib": "%{name}.a", } go_library = rule( go_library_impl, attrs = go_library_attrs, outputs =go_library_outputs) go_binary = rule( go_binary_impl, executable = True, attrs = go_library_attrs, outputs = go_library_outputs) go_test = rule( go_test_impl, executable = True, test = True, attrs = go_library_attrs + { "test_generator": attr.label( default=Label("//tools/go:generate_test_main"), cfg=HOST_CFG, flags=["EXECUTABLE"]) }, outputs = { "lib" : "%{name}.a", "main_lib": "%{name}_main_test.a", "main_go": "%{name}_main_test.go", })
Python
0.000001
@@ -1315,23 +1315,8 @@ hand - or using Glaze .%0A%0A- @@ -1896,16 +1896,72 @@ es.srcs%0A + if not sources:%0A fail(%22may not be empty%22, %22srcs%22)%0A%0A out_li
852ecb67e11f4ad9662c832d8be5f5bf1b8327b1
Add tests for action groups.
pyface/action/tests/test_group.py
pyface/action/tests/test_group.py
Python
0
@@ -0,0 +1,1245 @@ +from __future__ import absolute_import%0A%0Afrom traits.testing.unittest_tools import UnittestTools, unittest%0A%0Afrom ...image_cache import ImageCache%0Afrom ...window import Window%0Afrom ..action import Action%0Afrom ..action_item import ActionItem%0Afrom ..group import Group%0A%0A%0Aclass TestActionItem(unittest.TestCase, UnittestTools):%0A%0A def setUp(self):%0A # test whether function is called by updating list%0A # XXX should really use mock%0A self.memo = %5B%5D%0A%0A def perform():%0A self.memo.append('called')%0A%0A self.perform = perform%0A%0A self.action = Action(name='Test', on_perform=perform)%0A self.action_item = ActionItem(action=self.action)%0A%0A def test_init_action_item(self):%0A group = Group(self.action_item)%0A self.assertEqual(group.items, %5Bself.action_item%5D)%0A%0A def test_init_action(self):%0A group = Group(self.action)%0A self.assertEqual(len(group.items), 1)%0A self.assertEqual(group.items%5B0%5D.action, self.action)%0A%0A def test_init_callable(self):%0A group = Group(self.perform)%0A self.assertEqual(len(group.items), 1)%0A self.assertEqual(group.items%5B0%5D.action.on_perform, self.perform)%0A self.assertEqual(group.items%5B0%5D.action.name, %22Perform%22)%0A
76f636d38d6f3947efe6d58eacbd655027fc1a0e
Add post-hook to handle the difference between project name and role name.
hooks/post_gen_project.py
hooks/post_gen_project.py
Python
0
@@ -0,0 +1,228 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport os%0A%0A# Use symlink to handle the difference between project name and role name.%0Aos.symlink('../../%7B%7B cookiecutter.role_project_name %7D%7D', 'roles/%7B%7B cookiecutter.role_name %7D%7D')%0A
fd7949d9fba182b19fc0de3cb32bca142cf8c801
Add missing file.
tests/test_triple_parser.py
tests/test_triple_parser.py
Python
0.000001
@@ -0,0 +1,716 @@ +from unittest import TestCase%0A%0Afrom ppp_datamodel import Triple, Resource, Missing%0Afrom ppp_datamodel.triple_parser import parse_triples%0A%0Aclass TripleParserTestCase(TestCase):%0A def testBasics(self):%0A self.assertEqual(parse_triples('(foo, (bar, ?, (?, qux, quux)), ?)'), %5B%0A Triple(%0A Resource('foo'),%0A Triple(%0A Resource('bar'),%0A Missing(),%0A Triple(%0A Missing(),%0A Resource('qux'),%0A Resource('quux')%0A ),%0A ),%0A Missing()%0A )%5D)%0A
882b016d7cc084b2b6071bd128c060083d0aecd6
Create __init__.py
rdflib/plugins/parsers/__init__.py
rdflib/plugins/parsers/__init__.py
Python
0.000429
@@ -0,0 +1,9 @@ +%22%22%22%0A%0A%22%22%22%0A
7022b47ed984d11474b1aa5721099620cc20956c
Fix updating issue with Qtile widget
powerline/bindings/qtile/widget.py
powerline/bindings/qtile/widget.py
# -*- coding: utf-8 -*- from libqtile import bar from libqtile.widget import base from powerline.core import Powerline as PowerlineCore class Powerline(base._TextBox): def __init__(self, timeout=2, text=" ", width=bar.CALCULATED, **config): base._TextBox.__init__(self, text, width, **config) self.timeout_add(timeout, self.update) self.powerline = PowerlineCore(ext='wm', renderer_module='pango_markup') def update(self): self.text = self.powerline.renderer.render(side='right') self.bar.draw() def cmd_update(self, text): self.update(text) def cmd_get(self): return self.text def _configure(self, qtile, bar): base._TextBox._configure(self, qtile, bar) self.layout = self.drawer.textlayout( self.text, self.foreground, self.font, self.fontsize, self.fontshadow, markup=True)
Python
0
@@ -429,16 +429,57 @@ (self):%0A +%09%09if not self.configured:%0A%09%09%09return True%0A %09%09self.t @@ -546,16 +546,30 @@ r.draw() +%0A%09%09return True %0A%0A%09def c
e3793a076606e8200a38cb9504f04730470bd741
Create Source.py
Source.py
Source.py
Python
0
@@ -0,0 +1,652 @@ +import numpy as np%0Aimport cv2%0A%0Avid=cv2.VideoCapture(0)%0A_, instant=vid.read()%0Aavg=np.float32(instant)%0Afile=cv2.CascadeClassifier(%22C:%5Copencv2.4.6%5Cdata%5Chaarcascades%5Chaarcascade_mcs_upperbody.xml%22)%0Aobj=0%0Awhile(1):%0A _,frame=vid.read()%0A cv2.accumulateWeighted(frame, avg, 0.1)%0A background=cv2.convertScaleAbs(avg)%0A diff=cv2.absdiff(frame, background)%0A cv2.imshow(%22input%22, frame)%0A bodies=file.detectMultiScale(frame)%0A for body in bodies:%0A cv2.rectangle(frame, (body%5B0%5D, body%5B1%5D), (body%5B0%5D+body%5B2%5D, body%5B0%5D+body%5B3%5D), (255,0,0), 3)%0A cv2.imshow(%22Upper Body%22, frame)%0A if cv2.waitKey(5)==27:%0A break%0Acv2.destroyAllWindows()%0A
1ace5845055050c0ac3d9e14a5f76ad78f6778bf
Add python script for calculating fuel pitch fraction.
python/calc_fuel_pitch_fraction.py
python/calc_fuel_pitch_fraction.py
Python
0
@@ -0,0 +1,538 @@ +import sympy as sp%0Aimport sys%0A%0A%0Adef calc_spacing(R, n):%0A x = sp.symbols('x')%0A Af = 0%0A Am = 0%0A for m in range(2*n - 1):%0A if m %25 2 == 0:%0A Af += sp.pi * (R/n * (m/2 + x))**2%0A if m %25 2 == 1:%0A Af -= sp.pi * (R/n * (m+1)/2)**2%0A for m in range(2*n):%0A if m %25 2 == 0:%0A Am -= sp.pi * (R/n * (m/2 + x))**2%0A if m %25 2 == 1:%0A Am += sp.pi * (R/n * (m+1)/2)**2%0A return sp.solve(Af / (Af + Am) - .225, x)%0A%0A%0Aprint(calc_spacing(float(sys.argv%5B1%5D), int(sys.argv%5B2%5D)))%0A
975493d0376dd565242718c588ce0d24eca8b923
add initial script for copying local solutions to the baseline directory
newBaselineSolutions.py
newBaselineSolutions.py
Python
0
@@ -0,0 +1,976 @@ +%22%22%22%0A%0A%22%22%22%0A%0Aimport sys%0Aimport os%0Aimport shutil%0A%0A##### Helper functions%0Adef exitWithError(error):%0A print(error)%0A sys.exit(1)%0A%0Adef exitWithDirNotFound(dir):%0A exitWithError(%22Directory does not exist: %7B%7D%5Cn%22.format(dir))%0A%0A##### Main%0AsourceDir = sys.argv%5B1%5D%0AtargetDir = sys.argv%5B2%5D%0Amachine = sys.argv%5B3%5D%0Acompiler = sys.argv%5B4%5D%0A%0AdestinationDir = os.path.join(targetDir, %22%7B%7D-%7B%7D%22.format(machine, compiler))%0A%0A# verify source directory exists. if not, bail%0Aif not os.path.isdir(sourceDir):%0A exitWithDirNotFound(sourceDir)%0A%0A# verify destination directory exists. if not, make it%0Aif not os.path.isdir(destinationDir):%0A os.makedirs(destinationDir)%0A%0AsourceFiles = os.listdir(sourceDir)%0AtargetExtensions = %5B%22.out%22, %22.outb%22, %22.sum%22%5D%0AtargetFiles = %5Bs for s in sourceFiles for t in targetExtensions if t in s%5D%0Afor f in targetFiles:%0A print f, os.path.join(sourceDir,f), os.path.join(destinationDir,f)%0A shutil.copyfile(os.path.join(sourceDir,f), os.path.join(destinationDir,f))%0A
3646ca1fc66a174d787ffd4a7569f48bc8f23cf5
Update downladable clang to r335091.
third_party/clang_toolchain/download_clang.bzl
third_party/clang_toolchain/download_clang.bzl
""" Helpers to download a recent clang release.""" def _get_platform_folder(os_name): os_name = os_name.lower() if os_name.startswith('windows'): return 'Win' if os_name.startswith('mac os'): return 'Mac' if not os_name.startswith('linux'): fail('Unknown platform') return 'Linux_x64' def _download_chromium_clang(repo_ctx, platform_folder, package_version, sha256, out_folder): cds_url = 'https://commondatastorage.googleapis.com/chromium-browser-clang' cds_file = 'clang-%s.tgz' % package_version cds_full_url = '{0}/{1}/{2}'.format(cds_url, platform_folder, cds_file) repo_ctx.download_and_extract(cds_full_url, output=out_folder, sha256=sha256) def download_clang(repo_ctx, out_folder): """ Download a fresh clang release and put it into out_folder. Clang itself will be located in 'out_folder/bin/clang'. We currently download one of the latest releases of clang by the Chromium project (see https://chromium.googlesource.com/chromium/src/+/master/docs/clang.md). Args: repo_ctx: An instance of repository_context object. out_folder: A folder to extract the compiler into. """ # TODO(ibiryukov): we currently download and extract some extra tools in the # clang release (e.g., sanitizers). We should probably remove the ones # we don't need and document the ones we want provide in addition to clang. # Latest CLANG_REVISION and CLANG_SUB_REVISION of the Chromiums's release # can be found in https://chromium.googlesource.com/chromium/src/tools/clang/+/master/scripts/update.py CLANG_REVISION = '334100' CLANG_SUB_REVISION = 1 package_version = '%s-%s' % (CLANG_REVISION, CLANG_SUB_REVISION) checksums = { 'Linux_x64': '3c57420b591601cd14b5babd74b58fcaefa877112938d70cca6f0a1b0b293ab4', 'Mac': '97d313996fb97a6138635f963d7ef4efa9f028a8168bb7917cc428b9eab05ebb', 'Win': '52c1d6d20a0733276597f4ced59d18b545769dbf8beb8c6bdc26a7a862da7fc9', } platform_folder = _get_platform_folder(repo_ctx.os.name) _download_chromium_clang(repo_ctx, platform_folder, package_version, checksums[platform_folder], out_folder)
Python
0.000001
@@ -1600,12 +1600,12 @@ '33 -4100 +5091 '%0A @@ -1746,254 +1746,254 @@ ' -3c57420b591601cd14b5babd74b58fcaefa877112938d70cca6f0a1b0b293ab4',%0A 'Mac':%0A '97d313996fb97a6138635f963d7ef4efa9f028a8168bb7917cc428b9eab05ebb',%0A 'Win':%0A '52c1d6d20a0733276597f4ced59d18b545769dbf8beb8c6bdc26a7a862da7fc9 +17002b75293fccfdd175eacdc9ee47d97b58d7e98fef343384fbbef1b68ce99f',%0A 'Mac':%0A '9351e46d28315daaa06a1eb55bd0370ed4aaeb693a2a3e82e48d2737d7723468',%0A 'Win':%0A 'e78a1e469224d6f6751b4df4374bf58893ac03900ec924e4c8264888ba4aeb1e ',%0A
bfd85c18e788c4e89569f7a35fa85d80d3bcd031
Add the IPython version helper
reducer/ipython_version_helper.py
reducer/ipython_version_helper.py
Python
0.000004
@@ -0,0 +1,354 @@ +from __future__ import (division, print_function, absolute_import,%0A unicode_literals)%0A%0Afrom IPython import version_info%0A%0A%0Adef ipython_version_as_string():%0A %22%22%22%0A The IPython version is a tuple (major, minor, patch, vendor). We only%0A need major, minor, patch.%0A %22%22%22%0A return ''.join(%5Bstr(s) for s in version_info%5B0:3%5D%5D)%0A
cd7822eb0017a59e71fb98e395228f891282082f
Revert r10641
pywikibot/families/commons_family.py
pywikibot/families/commons_family.py
# -*- coding: utf-8 -*- __version__ = '$Id$' from pywikibot import family # The Wikimedia Commons family class Family(family.Family): def __init__(self): family.Family.__init__(self) self.name = 'commons' self.langs = { 'commons': 'commons.wikimedia.org', } self.interwiki_forward = 'wikipedia' self.category_redirect_templates = { 'commons': (u'Category redirect', u'Categoryredirect', u'Synonym taxon category redirect', u'Invalid taxon category redirect', u'Monotypic taxon category redirect', u'See cat', u'Seecat', u'See category', u'Catredirect', u'Cat redirect', u'Cat-red', u'Catredir', u'Redirect category'), } self.disambcatname = { 'commons': u'Disambiguation' } self.cross_projects = [ 'wikipedia', 'wiktionary', 'wikibooks', 'wikiquote', 'wikisource', 'wikinews', 'wikiversity', 'meta', 'mediawiki', 'test', 'incubator', 'species', ] def dbName(self, code): return 'commonswiki_p' def ssl_pathprefix(self, code): return "/wikipedia/commons"
Python
0
@@ -1350,16 +1350,100 @@ iki_p'%0A%0A + def shared_image_repository(self, code):%0A return ('commons', 'commons')%0A%0A def
f110fdd778b450a0bed2b8bfb68f12648c4fd3e7
add base_tester.py
tests/base_tester.py
tests/base_tester.py
Python
0
@@ -0,0 +1,1394 @@ +# -*- coding: utf-8 -*-%0A%22%22%22%0AThis is a utility script designed to allow you to run either py2 or py3 via:%0A /some/path/to/python base_tester.py%0Ain order to verify TLS 1.2 support and the version of openssl that python is%0Alinked against.%0A%0AThank you to Hanno B%C3%B6ck for providing https://fancyssl.hboeck.de/ for free.%0A%22%22%22%0A%0A# standard libs%0Afrom __future__ import print_function%0Aimport sys%0A%0A# patched ssl using tlsssl%0Atry:%0A import tlsssl as ssl%0Aexcept(ImportError):%0A import ssl%0A%0APY_VER = sys.version_info%0A%0Aprint(%22Our python is located: %7B%7D%22.format(sys.executable))%0Aprint(%22Our python version: %7B%7D.%7B%7D.%7B%7D%22.format(PY_VER%5B0%5D, PY_VER%5B1%5D, PY_VER%5B2%5D))%0Aprint(%22Our openssl is: %7B%7D%22.format(ssl.OPENSSL_VERSION))%0Aprint(%22------------------------------------------------------------------%22)%0A%0Actx = ssl.create_default_context()%0A%0Aif PY_VER%5B0%5D == 2:%0A import urllib2%0A try:%0A a = urllib2.urlopen('https://fancyssl.hboeck.de/', context=ctx)%0A print(a)%0A print(%22SUCCESS: Connection was made using TLS1.2%22)%0A except(urllib2.URLError) as e:%0A print(%22ERROR: %7B%7D%22.format(e.reason))%0A%0Aif PY_VER%5B0%5D == 3:%0A import urllib.request%0A try:%0A a = urllib.request.urlopen('https://fancyssl.hboeck.de/', context=ctx)%0A print(a)%0A print(%22SUCCESS: Connection was made using TLS1.2%22)%0A except(ssl.SSLError, urllib.error.URLError) as e:%0A print(%22ERROR: %7B%7D%22.format(e.reason))%0A
f2044b0771f278c2a0de5cb69783b264a2d2363d
Add clustering metrics calculator file.
cluster_metrics.py
cluster_metrics.py
Python
0
@@ -0,0 +1,1531 @@ +%22Calculates Silhouette coefficient and Calinski-Harabaz index for a kmeans model.%22%0Aimport os, sys%0Aimport argparse, joblib%0Afrom sklearn import metrics%0A%0Adef cluster_metrics(data_file_path):%0A if not os.path.exists(data_file_path + '/kmodel.txt'):%0A print('No k-means model file found.')%0A sys.exit(0)%0A kmodel = joblib.load(data_file_path + '/kmodel.txt')%0A%0A # If no topic_space.txt file exists, the clustering was performed on the%0A # Tf-Idf matrix so load that instead.%0A if os.path.exists(data_file_path + '/topic_space.txt'):%0A vector_space = joblib.load(data_file_path + '/topic_space.txt')%0A print('Calculating metrics for topic vector space.')%0A else:%0A vector_space = joblib.load(data_file_path + '/tfidf_sparse.txt')%0A print('Calculating metrics for Tf-Idf vector space.')%0A%0A silhouette = metrics.silhouette_score(vector_space, kmodel.labels_,%0A metric='euclidean')%0A calhar = metrics.calinski_harabaz_score(vector_space.toarray(), kmodel.labels_)%0A%0A with open(data_file_path + '/metric_results.txt', 'w+') as output:%0A output.write('Silhouette coefficient: ' + str(silhouette))%0A output.write('%5CnCaliski-Harabaz index: ' + str(calhar))%0A%0A%0A%0Aif __name__ == '__main__':%0A parser = argparse.ArgumentParser('Parses data file path.')%0A parser.add_argument('data_file_path', type=str,%0A help='The file to the data directory.')%0A args = parser.parse_args()%0A cluster_metrics(args.data_file_path)%0A
3b182032ae092560b2423e77f657ec0794ce38e6
Add new users to all deployments
planetstack/model_policies/model_policy_User.py
planetstack/model_policies/model_policy_User.py
Python
0
@@ -0,0 +1,1108 @@ +from core.models import *%0A%0Adef handle(user):%0A%09deployments = Deployment.objects.all()%0A%09site_deployments = SiteDeployments.objects.all()%0A%09site_deploy_lookup = defaultdict(list)%0A%09for site_deployment in site_deployments:%0A%09%09site_deploy_lookup%5Bsite_deployment.site%5D.append(site_deployment.deployment)%0A%0A%09user_deploy_lookup = defaultdict(list)%0A%09for user_deployment in UserDeployments.objects.all():%0A%09%09user_deploy_lookup%5Buser_deployment.user%5D.append(user_deployment.deployment)%0A %0A%09all_deployments = Deployment.objects.filter() %0A%09if user.is_admin:%0A%09%09# admins should have an account at all deployments%0A%09%09expected_deployments = deployments%0A%09else:%0A%09%09# normal users should have an account at their site's deployments%0A%09%09#expected_deployments = site_deploy_lookup%5Buser.site%5D%0A%09%09# users are added to all deployments for now%0A%09%09expected_deployments = deployments %0A%0A%09for expected_deployment in expected_deployments:%0A%09%09if not user in user_deploy_lookup or %5C%0A%09%09 expected_deployment not in user_deploy_lookup%5Buser%5D: %0A%09%09%09# add new record%0A%09%09%09ud = UserDeployments(user=user, deployment=expected_deployment)%0A%09%09%09ud.save() %0A%0A
7e7bd440a1e3f585464df3458070528d0100d456
Add helper to run requested Python script
pyseidon/handlers/__init__.py
pyseidon/handlers/__init__.py
Python
0
@@ -0,0 +1,569 @@ +import pyseidon%0Aimport sys%0A%0Adef handle_script():%0A import runpy%0A %22%22%22%0AAllow the client to run an arbitrary Python script.%0A%0AHere's sample usage:%0A%0A%60%60%60%0Adef expensive_setup():%0A ...%0A%0Aif __name__ == '__main__':%0A expensive_setup()%0A%0A import pyseidon.handlers%0A pyseidon.handlers.handle_script()%0A%60%60%60%0A%22%22%22%0A def handler():%0A if len(sys.argv) %3C 1:%0A print %3E%3Esys.stderr, 'Must provide path to Python script to execute'%0A sys.exit(1)%0A runpy.run_path(sys.argv%5B0%5D, run_name='__main__')%0A master = pyseidon.Pyseidon()%0A master.run(handler)%0A
9a27b5c9a18c889c42b4de32cb4b596c7e331e6a
Refactor using Flask-Testing in client tests.
tests/test_client.py
tests/test_client.py
# -*- coding: utf-8 -*- import unittest from flask import url_for from app import create_app, db from app.models import User, Todo class TodolistClientTestCase(unittest.TestCase): def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_context() self.app_context.push() db.create_all() self.client = self.app.test_client(use_cookies=True) def tearDown(self): db.session.remove() db.drop_all() self.app_context.pop() def register_user(self, name): response = self.client.post(url_for('auth.register'), data={ 'username': name, 'email': name +'@example.com', 'password': 'correcthorsebatterystaple', 'password_confirmation': 'correcthorsebatterystaple' }) return response def login_user(self, name): response = self.client.post(url_for('auth.login'), data={ 'email_or_username': name + '@example.com', 'password': 'correcthorsebatterystaple' }) return response def register_and_login(self, name): response = self.register_user(name) self.assertEqual(response.status_code, 302) response = self.login_user(name) self.assertEqual(response.status_code, 302) def test_home_page(self): response = self.client.get(url_for('main.index')) self.assertEqual(response.status_code, 200) self.assertTrue(b'Todolists' in response.data) def test_register_page(self): response = self.client.get(url_for('auth.register')) self.assertEqual(response.status_code, 200) self.assertTrue(b'Already registerd?' in response.data) def test_login_page(self): response = self.client.get(url_for('auth.login')) self.assertEqual(response.status_code, 200) self.assertTrue(b'New user?' in response.data) def test_overview_no_redirect_if_user_logged_in(self): self.register_and_login('adam') response = self.client.get(url_for('main.todolist_overview')) # expect not redirect as user is logged in self.assertEqual(response.status_code, 200) def test_last_seen_update_after_login(self): response = self.register_user('adam') before = User.query.filter_by(username='adam').first().last_seen response = self.login_user('adam') after = User.query.filter_by(username='adam').first().last_seen self.assertNotEqual(before, after) def test_register_and_login_and_logout(self): # register a new account response = self.register_user('adam') # expect redirect to login self.assertEqual(response.status_code, 302) # login with the new account response = self.login_user('adam') # expect redirect to index self.assertEqual(response.status_code, 302) # logout response = self.client.get(url_for('auth.logout'), follow_redirects=True) # follow redirect to index self.assertEqual(response.status_code, 200)
Python
0
@@ -22,23 +22,46 @@ *-%0A%0A -import unittest +from flask.ext.testing import TestCase %0A%0Afr @@ -186,17 +186,8 @@ ase( -unittest. Test @@ -206,12 +206,17 @@ def -setU +create_ap p(se @@ -232,18 +232,14 @@ -self.app = +return cre @@ -261,173 +261,52 @@ g')%0A - +%0A - self.app_context = self.app.app_context()%0A self.app_context.push()%0A db.create_all()%0A self.client = self.app.test_client(use_cookies=True +def setUp(self):%0A db.create_all( )%0A%0A @@ -381,39 +381,8 @@ ll() -%0A self.app_context.pop() %0A%0A @@ -1059,39 +1059,43 @@ sert -Equal(response.status_code, 302 +_redirects (response, '/auth/login' )%0A @@ -1156,39 +1156,33 @@ sert -Equal(response.status_code, 302 +_redirects (response, '/' )%0A%0A @@ -1279,37 +1279,36 @@ self.assert -Equal +_200 (response.status @@ -1300,33 +1300,16 @@ response -.status_code, 200 )%0A @@ -1325,42 +1325,35 @@ sert -True(b'Todolists' in response.data +_template_used('index.html' )%0A%0A @@ -1457,37 +1457,36 @@ self.assert -Equal +_200 (response.status @@ -1478,33 +1478,16 @@ response -.status_code, 200 )%0A @@ -1503,51 +1503,38 @@ sert -True(b'Already registerd?' in response.data +_template_used('register.html' )%0A%0A @@ -1632,37 +1632,36 @@ self.assert -Equal +_200 (response.status @@ -1653,33 +1653,16 @@ response -.status_code, 200 )%0A @@ -1678,96 +1678,64 @@ sert -True(b'New user?' in response.data)%0A%0A def test_overview_no_redirect_if_user_logged_in +_template_used('login.html')%0A%0A def test_overview_page (sel @@ -1910,37 +1910,36 @@ self.assert -Equal +_200 (response.status @@ -1931,33 +1931,67 @@ response -.status_code, 200 +)%0A self.assert_template_used('overview.html' )%0A%0A d @@ -2499,39 +2499,43 @@ sert -Equal(response.status_code, 302 +_redirects (response, '/auth/login' )%0A%0A @@ -2671,39 +2671,33 @@ sert -Equal(response.status_code, 302 +_redirects (response, '/' )%0A%0A @@ -2883,21 +2883,20 @@ f.assert -Equal +_200 (respons @@ -2900,23 +2900,54 @@ onse -.status_code, 200 +)%0A self.assert_template_used('index.html' )%0A
87172e2b9e0143cf164dc34c26c69fc4eda7dd1e
Add initial block list for ad_block functionality
seleniumbase/config/ad_block_list.py
seleniumbase/config/ad_block_list.py
Python
0.000001
@@ -0,0 +1,1474 @@ +%22%22%22%0AFor use with SeleniumBase ad_block functionality.%0A%0AUsage:%0A On the command line:%0A %22pytest SOME_TEST.py --ad_block%22%0A%0A From inside a test:%0A self.ad_block()%0A%0AIf using the command line version, the ad_block functionality gets%0Aactivated after %22self.wait_for_ready_state_complete()%22 is called,%0Awhich is always run after page loads, unless changed in %22settings.py%22.%0AUsing ad_block will slow down test runs a little. (Use only if necessary.)%0A%0AFormat: A CSS Selector that's ready for JavaScript's querySelectorAll()%0A%22%22%22%0A%0AAD_BLOCK_LIST = %5B%0A '%5Baria-label=%22Ad%22%5D',%0A '%5Bclass%5E=%22sponsored-content%22%5D',%0A '%5Bdata-ad-details*=%22Advertisement%22%5D',%0A '%5Bdata-native_ad*=%22placement%22%5D',%0A '%5Bdata-provider=%22dianomi%22%5D',%0A '%5Bdata-type=%22ad%22%5D',%0A '%5Bdata-track-event-label*=%22-taboola-%22%5D',%0A '%5Bhref*=%22doubleclick.net/%22%5D',%0A '%5Bid*=%22-ad-%22%5D',%0A '%5Bid*=%22_ads_%22%5D',%0A '%5Bid*=%22AdFrame%22%5D',%0A '%5Bid%5E=%22ad-%22%5D',%0A '%5Bid%5E=%22outbrain_widget%22%5D',%0A '%5Bid%5E=%22taboola-%22%5D',%0A '%5Bid=%22dianomiRightRail%22%5D',%0A '%5Bsrc*=%22smartads.%22%5D',%0A '%5Bsrc*=%22ad_nexus%22%5D',%0A '%5Bsrc*=%22/ads/%22%5D',%0A '%5Bdata-dcm-click-tracker*=%22/adclick.%22%5D',%0A '%5Bdata-google-query-id%5E=%22C%22%5D',%0A 'div.ad-container',%0A 'div.ad_module',%0A 'div.ad-subnav-container',%0A 'div.ad-wrapper',%0A 'div.data-ad-container',%0A 'div.l-ad',%0A 'div.right-ad',%0A 'div.wx-adWrapper',%0A 'img.img_ad',%0A 'link%5Bhref*=%22/adservice.%22%5D',%0A 'script%5Bsrc*=%22/adservice.%22%5D',%0A 'script%5Bsrc*=%22/pagead/%22%5D',%0A 'section.dianomi-ad',%0A%5D%0A
c7cdb6750ac3a927fe773f7d86be94d24df937b1
Add Choice module
commands/Choice.py
commands/Choice.py
Python
0
@@ -0,0 +1,1311 @@ +import random%0A%0Afrom CommandTemplate import CommandTemplate%0A%0A%0Aclass Command(CommandTemplate):%0A%09triggers = %5B'choice', 'choose'%5D%0A%09helptext = %22Helps you make a choice between options in a comma-separated list%22%0A%0A%09def execute(self, message):%0A%09%09%22%22%22%0A%09%09:type message: IrcMessage.IrcMessage%0A%09%09%22%22%22%0A%09%09replytext = None%0A%09%09if message.messagePartsLength == 0:%0A%09%09%09replytext = %22My choice would be to provide me with some choices, preferably separated by commas%22%0A%09%09else:%0A%09%09%09choices = %5B%5D%0A%09%09%09if ',' in message.message:%0A%09%09%09%09choices = message.message.split(',')%0A%09%09%09else:%0A%09%09%09%09choices = message.messageParts%0A%09%09%09if len(choices) == 1:%0A%09%09%09%09replytext = %22Ooh, that's a tough one. I'd go with the first option, seeing as there is only one%22%0A%09%09%09else:%0A%09%09%09%09possibleReplies = %5B%22%7B%7D%22, %22Hmm, I'd go with %7B%7D%22, %22Out of those, %7B%7D sounds the least bad%22, %22%7B%7D, obviously%22,%0A%09%09%09%09%09%09%09%09 %22Let's go with... %7B%7D. No wait! No, yeah, that one%22, %22I don't know! *rolls dice* Seems you should go for %7B%7D%22,%0A%09%09%09%09%09%09%09%09 %22Pick %7B0%7D, pick %7B0%7D!%22, %22Eh, %7B%7D will do%22, %22Why not %7B%7D?%22, %22The first one! The last one! %7B%7D!%22%5D%0A%09%09%09%09#Pick a random reply sentence, and then add in a random choice from the provided list, enclosed in quotes%0A%09%09%09%09replytext = random.choice(possibleReplies).format(%22'%22 + random.choice(choices).strip() + %22'%22)%0A%09%09message.bot.sendMessage(message.source, replytext)
0a4bc484b465b2cfa0d763026a161ab7a92a3abb
Create squreRootBi.py
python_scripts/squreRootBi.py
python_scripts/squreRootBi.py
Python
0.000001
@@ -0,0 +1,736 @@ +def squreRootBi(x, epsilon):%0A '''assume x%3E=0 and epsilon %3E 0%0A Return y s.t y*y is within epsilon of x'''%0A assert x%3E= 0, 'x must be non-negative, not' + str(x) %0A assert epsilon %3E 0 , 'epsilon must be positive, not' + str(epsilon)%0A low = 0%0A high= max (x, 1.0) # incase x is smaller than 1, 0.5**2=0.25%0A guess=(low+high)/2.0%0A count=1%0A while abs(guess **2 -x ) %3E epsilon and count %3C= 100:%0A print 'low:', low, 'high:',high, 'guess:', guess%0A if guess **2 %3C x:%0A low=guess%0A else:%0A high=guess%0A guess=(low+high)/2.0%0A count+=1%0A assert count %3C= 100, 'iteration count exceeded'%0A print 'Bi method, num.interations:', count, 'Estimate:', guess%0A return guess%0A
645316b5583a69c834c3f6800007eadf2c6d8fed
test ra package
tests/test_ra.py
tests/test_ra.py
Python
0.000001
@@ -0,0 +1,176 @@ +%0A%0Adef test_api(mocker, test_raml):%0A import ra%0A raml = test_raml('simple')%0A app = mocker.Mock()%0A api = ra.api(raml, app)%0A assert isinstance(api, ra.dsl.APISuite)%0A
2d4f09fe8c31aa2b996e71565292d5ef249986c7
Add a small tool to answer questions like "Why does target A depend on target B".
tools/gyp-explain.py
tools/gyp-explain.py
Python
0.999999
@@ -0,0 +1,2255 @@ +#!/usr/bin/env python%0A# Copyright (c) 2011 The Chromium Authors. All rights reserved.%0A# Use of this source code is governed by a BSD-style license that can be%0A# found in the LICENSE file.%0A%0A%22%22%22Prints paths between gyp targets.%0A%22%22%22%0A%0Aimport json%0Aimport os%0Aimport sys%0Aimport time%0A%0Afrom collections import deque%0A%0Adef usage():%0A print %22%22%22%5C%0AUsage:%0A tools/gyp-explain.py chrome_dll gtest#%0A%22%22%22%0A%0A%0Adef GetPath(graph, fro, to):%0A %22%22%22Given a graph in (node -%3E list of successor nodes) dictionary format,%0A yields all paths from %7Cfro%7C to %7Cto%7C, starting with the shortest.%22%22%22%0A # Storing full paths in the queue is a bit wasteful, but good enough for this.%0A q = deque(%5B(fro, %5B%5D)%5D)%0A while q:%0A t, path = q.popleft()%0A if t == to:%0A yield path + %5Bt%5D%0A for d in graph%5Bt%5D:%0A q.append((d, path + %5Bt%5D))%0A%0A%0Adef MatchNode(graph, substring):%0A %22%22%22Given a dictionary, returns the key that matches %7Csubstring%7C best. Exits%0A if there's not one single best match.%22%22%22%0A candidates = %5B%5D%0A for target in graph:%0A if substring in target:%0A candidates.append(target)%0A%0A if not candidates:%0A print 'No targets match %22%25s%22' %25 substring%0A sys.exit(1)%0A if len(candidates) %3E 1:%0A print 'More than one target matches %22%25s%22: %25s' %25 (%0A substring, ' '.join(candidates))%0A sys.exit(1)%0A return candidates%5B0%5D%0A%0A%0Adef Main(argv):%0A # Check that dump.json exists and that it's not too old.%0A dump_json_dirty = False%0A try:%0A st = os.stat('dump.json')%0A file_age_s = time.time() - st.st_mtime%0A if file_age_s %3E 2 * 60 * 60:%0A print 'dump.json is more than 2 hours old.'%0A dump_json_dirty = True%0A except IOError:%0A print 'dump.json not found.'%0A dump_json_dirty = True%0A%0A if dump_json_dirty:%0A print 'Run'%0A print ' GYP_GENERATORS=dump_dependency_json build/gyp_chromium'%0A print 'first, then try again.'%0A sys.exit(1)%0A%0A g = json.load(open('dump.json'))%0A%0A if len(argv) != 3:%0A usage()%0A sys.exit(1)%0A%0A fro = MatchNode(g, argv%5B1%5D)%0A to = MatchNode(g, argv%5B2%5D)%0A%0A paths = list(GetPath(g, fro, to))%0A if len(paths) %3E 0:%0A print 'These paths lead from %25s to %25s:' %25 (fro, to)%0A for path in paths:%0A print ' -%3E '.join(path)%0A else:%0A print 'No paths found from %25s to %25s.' %25 (fro, to)%0A%0A%0Aif __name__ == '__main__':%0A Main(sys.argv)%0A
5e32d890fe0762163f1edab6672df91e7d461d8f
Check if a given sequence of moves for a robot is circular or not (py)
check-if-a-given-sequence-of-moves-for-a-robot-is-circular-or-not.py
check-if-a-given-sequence-of-moves-for-a-robot-is-circular-or-not.py
Python
0.000202
@@ -0,0 +1,775 @@ +from operator import add%0Aimport math%0A%0Amoves = raw_input(%22Enter the moves: %22)%0A%0Astart_position = %5B0,0%5D%0Acurrent_position = %5B0,0%5D%0A%0A'''%0Aheading = %5B1,90%5D - 1 step North%0A%09%09 %5B1, -90%5D - 1 step South%0A%09%09 %5B1,0%5D - East%0A%09%09 %5B1,360%5D - West%0A'''%0A%0Aheading = %5B1,0%5D%0A%0Afor move in moves:%0A%09if move.upper() == %22G%22:%0A%0A%09%09angle = heading%5B1%5D%0A%09%09step = heading%5B0%5D%0A%09%09move_coord = %5B round(step*math.cos(math.radians(angle))), round(step*math.sin(math.radians(angle))) %5D%0A%09%09current_position = map(add, current_position, move_coord)%0A%09%0A%09elif move.upper() == %22L%22:%0A%09%09heading = map(add, heading, %5B0, 90%5D)%0A%0A%09elif move.upper() == %22R%22:%0A%09%09heading = map(add, heading, %5B0, -90%5D)%0A%0A%0Aif start_position == current_position:%0A%09print %22Given sequence of moves is circular%22%0Aelse:%0A%09print %22Given sequence of moves is NOT circular%22
7e1113801b04c7cc7300ee0cdebea25d0ea190a6
Create scrap.py
scrap.py
scrap.py
Python
0
@@ -0,0 +1,1174 @@ +import urllib2%0Aimport json%0Afrom bs4 import BeautifulSoup%0A%0Abase_url = %22%22%0Astarting_page = %22%22%0Ajson_export = '%7B %22pages%22: %5B %5Cn'%0A%0Aindex = 0%0Aurl_list = %5B%5D%0Aurl_list.append(base_url+starting_page)%0Aurls_tested = %5B%5D%0A%0A%0Afor url in url_list:%0A page_json = '%7B %22page%22 : %5Cn %7B %22url%22: %22' + url + '%22, '%0A urls_tested.append(url) #add this url as 'tested'%0A%0A req = urllib2.Request(url)%0A site_html = urllib2.urlopen(req).read()%0A soup = BeautifulSoup(site_html)%0A # create a list of %3Ca href%3E links%0A all_links = soup.findAll(%22a%22, href=True)%0A page_json += '%22links%22: %5B'%0A%0A #filter all the links %0A filtered_links = %5B%5D%0A for link in all_links:%0A %09if %22.action%22 in link%5B%22href%22%5D: # all the .action links%0A %09 filtered_links.append(link%5B'href'%5D)%0A %09 if link%5B%22href%22%5D not in url_list and base_url+link%5B%22href%22%5D not in urls_tested and index %3C 10: # add to url_list%0A %09 %09url_list.append(base_url+link%5B%22href%22%5D)%0A %09 index = index + 1%0A %09elif %22http%22 in link%5B%22href%22%5D: # all the outside links%0A %09 filtered_links.append(link%5B'href'%5D)%0A%0A for link in filtered_links:%0A %09page_json += '%7B %22link%22: %22' + link + '%22%7D,%5Cn '%0A page_json += %22%5D%7D%5Cn%7D,%22%0A json_export += page_json%0A%0Ajson_export += '%5D%7D'%0Aprint json_export%0A %0A
4c7536d6f2c5c8b6f1c76a8fb6af062f3cfebf6c
add setup.py
setup.py
setup.py
Python
0
@@ -0,0 +1,324 @@ +from setuptools import setup%0A%0Asetup(name='dummy_data',%0A version='0.0.0',%0A description='Generate dummy data ',%0A url='http://github.com/blcook223/dummy_data',%0A author='Benjamin Cook',%0A author_email='benjamin.l.cook@gmail.com',%0A license='MIT',%0A packages=%5B'dummy_data'%5D,%0A zip_safe=False)%0A
3a185f5475f9270c5c0ff75528a26860bdac1aa3
Fix development status classifier
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup import re with open('evesrp/__init__.py', 'r') as f: init_contents = '' for line in f: init_contents += line + '\n' version = re.search(r'^__version__ *= *u?[\'"]([^\'"]*)[\'"]', init_contents, re.MULTILINE) if version: version = version.group(1) else: raise Exception(u"Unable to find __version__ in evesrp/__init__.py") setup( name=u'EVE-SRP', version=version, description=u'EVE Ship Replacement Program Helper', author=u'Will Ross', author_email=u'paxswill@paxswill.com', url=u'https://github.com/paxswill/evesrp', packages=[ 'evesrp', 'evesrp.auth', 'evesrp.views', 'evesrp.util', 'evesrp.migrate', 'evesrp.migrate.versions', ], package_data={ 'evesrp': [ 'static/css/*.css', 'static/css/*.css.map', 'static/js/evesrp.min.js', 'static/js/evesrp.min.js.map', 'static/fonts/fontawesome-webfont.*', 'static/ZeroClipboard.swf', 'templates/*.html', 'templates/*.xml', 'migrate/alembic.ini', 'migrate/script.py.mako', ], }, classifiers=[ u'Development Status :: 3 - Beta', u'Framework :: Flask', u'License :: OSI Approved :: BSD License', u'Programming Language :: Python :: 3', u'Programming Language :: Python :: 2', u'Topic :: Games/Entertainment', ], dependency_links=[ u'https://github.com/bravecollective/api/tarball/develop#egg=brave.api' ], install_requires=[ 'Flask>=0.10.1', 'Flask-Login==0.2.10', 'Flask-Migrate>=1.2.0', 'Flask-OAuthlib>=0.6.0', 'Flask-Script==2.0.5', 'Flask-SQLAlchemy==1.0', 'Flask-WTF==0.9.4', 'SQLAlchemy>=0.9.4', 'Werkzeug>=0.9.4', 'WTForms==1.0.5', 'alembic>=0.6.5', 'requests==2.2.1', 'ecdsa==0.11', 'six==1.7.3', 'brave.api', ], entry_points={ 'console_scripts': [ 'evesrp = evesrp.util.manage:main', ], }, zip_safe=False, )
Python
0.000156
@@ -1276,17 +1276,17 @@ atus :: -3 +4 - Beta'
b253d58d9feb614e00bdff3b41e087eafd0bfc5d
Bump version.
setup.py
setup.py
import os from setuptools import setup f = open(os.path.join(os.path.dirname(__file__), 'README.md')) readme = f.read() f.close() setup( name='django-ajaximage', version='0.1.16-rohanza', description='Add ajax image upload functionality with a progress bar to file input fields within Django admin. Images are optionally resized.', long_description=readme, author="Bradley Griffiths", author_email='bradley.griffiths@gmail.com', url='https://github.com/bradleyg/django-ajaximage', packages=['ajaximage'], include_package_data=True, install_requires=[ 'Django', 'Pillow', ], zip_safe=False, classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Web Environment', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', ], )
Python
0
@@ -183,17 +183,9 @@ .1.1 -6-rohanza +7 ',%0A
4f4a30e9d0be7b282be6a5378d67b9d5cad047bc
Add classdata for bayes
bayes/classdata.py
bayes/classdata.py
Python
0.000001
@@ -0,0 +1,554 @@ +# Name: Kevin Wilde (kjw731)%0A# Date: May 23, 2016%0A# Description: Sentiment Analysis with Naive Bayes Classifiers%0A#%0A# All group members were present and contributing during all work on this%0A# project. (I worked alone.)%0A#%0A# Class to hold class data. Necessary to define in separate module because%0A# I will be pickling instances of this class%0A%0Aclass ClassData:%0A def __init__(self):%0A %22%22%22Used to keep track of data for each class in training%22%22%22%0A %0A self.num_files = 0%0A self.feature_dict = %7B%7D%0A self.sum_of_all_features = 0%0A
4e396326c2c053713bc6699ff572cd96669fa041
Add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,207 @@ +#!/usr/bin/env python3%0A%0Afrom distutils.core import setup%0A%0Asetup(%0A%09name=%22tagmyrebase%22,%0A%09version=%222.0.0%22,%0A%09description=%22Utility to tag HEAD and the upstream commit after a rebase%22,%0A%09scripts=%5B%22tagmyrebase%22%5D,%0A)%0A
f6666dd338fc5bb2832044759c526528f4e1f57d
Version bump
setup.py
setup.py
#!/usr/bin/env python # Copyright 2011 The greplin-twisted-utils Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Setup script for greplin-twisted-utils.""" try: from setuptools import setup except ImportError: from distutils.core import setup setup(name='scales', version='1.0.3', description='Stats for Python processes', license='Apache', author='Greplin, Inc.', author_email='opensource@greplin.com', url='https://www.github.com/Cue/scales', install_requires=[ 'nose', 'simplejson==3.3.3', 'six', ], package_dir = {'':'src'}, packages = [ 'greplin', 'greplin.scales', ], namespace_packages = [ 'greplin', ], test_suite = 'nose.collector', zip_safe = True )
Python
0.000001
@@ -793,17 +793,17 @@ on='1.0. -3 +4 ',%0A
af07e75b3f13970b16b8e8c8509e4e83a2dbfd18
Add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,1486 @@ +# Always prefer setuptools over distutils%0Afrom setuptools import setup, find_packages%0A# To use a consistent encoding%0Afrom codecs import open%0Afrom os import path%0A%0Afrom playlist_kreator import VERSION%0A%0Ahere = path.abspath(path.dirname(__file__))%0A%0A# Get the long description from the README file%0Awith open(path.join(here, 'README.rst'), encoding='utf-8') as f:%0A long_description = f.read()%0A%0Awith open('requirements.txt') as requirements_file:%0A requirements = requirements_file.read().split('%5Cn')%0A%0Asetup(%0A name='playlist-kreator',%0A version=VERSION,%0A description='Create playlists easily from a list of artists, using their top songs.',%0A long_description=long_description,%0A url='https://github.com/epayet/playlist_kreator',%0A author='Emmanuel payet',%0A author_email='contact@emmanuel-payet.me',%0A license='MIT',%0A # See https://pypi.python.org/pypi?%253Aaction=list_classifiers%0A classifiers=%5B%0A 'Development Status :: 3 - Alpha',%0A 'Intended Audience :: End Users/Desktop',%0A 'Topic :: Internet',%0A 'License :: OSI Approved :: MIT License',%0A 'Programming Language :: Python :: 3',%0A 'Programming Language :: Python :: 3.3',%0A 'Programming Language :: Python :: 3.4',%0A 'Programming Language :: Python :: 3.5',%0A 'Programming Language :: Python :: 3.6',%0A %5D,%0A keywords='music googlemusic playlist',%0A packages=find_packages(exclude=%5B'contrib', 'docs', 'tests'%5D),%0A install_requires=requirements,%0A)%0A
247c57b08f9f7baf8d0fb71ca323ac60005f280f
Initialize setup file for microservice
setup.py
setup.py
Python
0
@@ -0,0 +1,277 @@ +from setuptools import find_packages, setup%0A%0A%0Asetup(name='pig_latin_microservice',%0A version='1.0',%0A description='Vicarious Pig Latin Microservice Project',%0A author='Christopher Tham',%0A platforms=%5B'any'%5D,%0A license='MIT',%0A packages=find_packages())%0A
e742b075d19a00a5eb5eb9990c90b874b7ed3085
Fix with statement for Python2.5 in setup.py. Closes #9.
setup.py
setup.py
import os exclude = ["mezzanine/project_template/mezzanine.db", "mezzanine/project_template/local_settings.py"] exclude = dict([(e, None) for e in exclude]) for e in exclude: if e.endswith(".py"): try: os.remove("%sc" % e) except: pass try: with open(e, "r") as f: exclude[e] = (f.read(), os.stat(e)) os.remove(e) except: pass from setuptools import setup, find_packages from mezzanine import __version__ as version from mezzanine.project_template import settings try: setup( name="Mezzanine", version=version, author="Stephen McDonald", author_email="stephen.mc@gmail.com", description="An open source content management platform built using " "the Django framework.", long_description=open("README.rst").read(), license="BSD", url="http://mezzanine.jupo.org/", zip_safe=False, include_package_data=True, packages=find_packages(), install_requires=[ "setuptools", settings.PACKAGE_NAME_FILEBROWSER, settings.PACKAGE_NAME_GRAPPELLI, ], entry_points=""" [console_scripts] mezzanine-project=mezzanine.bin.mezzanine_project:create_project """, classifiers=[ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Software Development :: Libraries :: " "Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules", ]) finally: for e in exclude: if exclude[e] is not None: data, stat = exclude[e] try: with open(e, "w") as f: f.write(data) os.chown(e, stat.st_uid, stat.st_gid) os.chmod(e, stat.st_mode) except: pass
Python
0
@@ -1,8 +1,46 @@ +%0Afrom __future__ import with_statement %0Aimport
dd3d5fe460a1f44dbd173350ab9b0014905b51ea
Make pillow an optional dependency, only used when PIL isn't installed.
setup.py
setup.py
from __future__ import with_statement import os exclude = ["mezzanine/project_template/dev.db", "mezzanine/project_template/local_settings.py"] exclude = dict([(e, None) for e in exclude]) for e in exclude: if e.endswith(".py"): try: os.remove("%sc" % e) except: pass try: with open(e, "r") as f: exclude[e] = (f.read(), os.stat(e)) os.remove(e) except: pass from setuptools import setup, find_packages from mezzanine import __version__ as version try: setup( name="Mezzanine", version=version, author="Stephen McDonald", author_email="stephen.mc@gmail.com", description="An open source content management platform built using " "the Django framework.", long_description=open("README.rst").read(), license="BSD", url="http://mezzanine.jupo.org/", zip_safe=False, include_package_data=True, packages=find_packages(), install_requires=[ "django >= 1.3", "filebrowser_safe >= 0.2.0", "grappelli_safe >= 0.2.0", "pillow", ], entry_points=""" [console_scripts] mezzanine-project=mezzanine.bin.mezzanine_project:create_project """, classifiers=[ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Software Development :: Libraries :: " "Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules", ]) finally: for e in exclude: if exclude[e] is not None: data, stat = exclude[e] try: with open(e, "w") as f: f.write(data) os.chown(e, stat.st_uid, stat.st_gid) os.chmod(e, stat.st_mode) except: pass
Python
0
@@ -546,16 +546,223 @@ ersion%0A%0A +install_requires = %5B%0A %22django %3E= 1.3%22,%0A %22filebrowser_safe %3E= 0.2.0%22,%0A %22grappelli_safe %3E= 0.2.1%22,%0A%5D%0A%0Atry:%0A from PIL import Image, ImageOps%0Aexcept ImportError:%0A install_requires += %5B%22pillow%22%5D%0A%0A%0A try:%0A @@ -1234,17 +1234,16 @@ ages(),%0A -%0A @@ -1263,153 +1263,26 @@ res= -%5B%0A %22django %3E= 1.3%22,%0A %22filebrowser_safe %3E= 0.2.0%22,%0A %22grappelli_safe %3E= 0.2.0%22,%0A %22pillow%22,%0A %5D +install_requires ,%0A -%0A @@ -1409,16 +1409,16 @@ project%0A + @@ -1422,17 +1422,16 @@ %22%22%22,%0A -%0A
5c09bc5cd1611c81c70db7248a45fcbb10c61d71
add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,474 @@ +from setuptools import find_packages%0Afrom distutils.core import setup%0A%0Asetup(%0A name='spindrift',%0A version='1.0.0',%0A packages=find_packages(exclude=%5B'tests'%5D),%0A description='A rest framework',%0A long_description=%22%22%22%0ADocumentation%0A-------------%0A You can see the project and documentation at the %60GitHub repo %3Chttps://github.com/robertchase/spindrift%3E%60_%0A %22%22%22,%0A author='Bob Chase',%0A url='https://github.com/robertchase/spindrift',%0A license='MIT',%0A)%0A
d976725de01d2691c42b796d30c69c42d2934c07
Update setup.py
setup.py
setup.py
try: from setuptools import setup except ImportError: from distutils.core import setup setup(name='owasp-skf', version='1.3.12', description='The OWASP Security Knowledge Framework', url='https://github.com/blabla1337/skf-flask', author='Glenn ten Cate, Riccardo ten Cate', author_email='gtencate@schubergphilis.com, r.tencate77@gmail.com', license='AGPLV3', packages=['skf'], # trying to add files... include_package_data = True, long_description="""\ The Security Knowledge Framework is an fully open-source Python-Flask web-application. It is an expert system application that uses OWASP Application Security Verification Standard """, install_requires=['markdown','BeautifulSoup', 'python-docx','lxml==3.4.2', 'cryptography==0.8.2', 'pyOpenSSL', 'requests', 'importlib','flask-bcrypt'], dependency_links= [ 'https://github.com/mitsuhiko/flask/tarball/master#egg=Flask-owasp' ], classifiers=[ "Development Status :: 5 - Production/Stable", "Framework :: Flask", "Environment :: Web Environment", "Intended Audience :: Developers", "Intended Audience :: Education", "Topic :: Software Development", "Topic :: Security", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: Unix", "Programming Language :: Python :: 2.7", "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)", ])
Python
0
@@ -131,17 +131,17 @@ n='1.3.1 -2 +4 ',%0A d
6135a7a0f6594782d6412d9ef767e4a251f39c84
Update dev status classifier in setup.py
setup.py
setup.py
from __future__ import with_statement import os import sys exclude = ["mezzanine/project_template/dev.db", "mezzanine/project_template/local_settings.py"] if sys.argv == ["setup.py", "test"]: exclude = [] exclude = dict([(e, None) for e in exclude]) for e in exclude: if e.endswith(".py"): try: os.remove("%sc" % e) except: pass try: with open(e, "r") as f: exclude[e] = (f.read(), os.stat(e)) os.remove(e) except: pass from setuptools import setup, find_packages from mezzanine import __version__ as version install_requires = [ "django >= 1.4, < 1.6", "filebrowser_safe >= 0.2.27", "grappelli_safe >= 0.2.22", "html5lib == 0.95", "bleach", "pytz >= 2013b", "requests==1.2.3", "requests-oauthlib==0.3.2", ] try: from PIL import Image, ImageOps except ImportError: try: import Image, ImageFile, ImageOps except ImportError: # no way to install pillow/PIL with jython, so exclude this in any case if not sys.platform.startswith('java'): install_requires += ["pillow"] try: setup( name="Mezzanine", version=version, author="Stephen McDonald", author_email="stephen.mc@gmail.com", description="An open source content management platform built using " "the Django framework.", long_description=open("README.rst").read(), license="BSD", url="http://mezzanine.jupo.org/", zip_safe=False, include_package_data=True, packages=find_packages(), install_requires=install_requires, entry_points=""" [console_scripts] mezzanine-project=mezzanine.bin.mezzanine_project:create_project """, test_suite="runtests.runtests", tests_require=["pyflakes==0.6.1", "pep8==1.4.1"], classifiers=[ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Internet :: WWW/HTTP :: WSGI", "Topic :: Software Development :: Libraries :: " "Application Frameworks", "Topic :: Software Development :: Libraries :: Python Modules", ]) finally: for e in exclude: if exclude[e] is not None: data, stat = exclude[e] try: with open(e, "w") as f: f.write(data) os.chown(e, stat.st_uid, stat.st_gid) os.chmod(e, stat.st_mode) except: pass
Python
0
@@ -1980,16 +1980,29 @@ :: -4 - Beta +5 - Production/Stable %22,%0A
85a7279c08b1997b5d2483106a10a0c428d44458
Add setup.py.
setup.py
setup.py
Python
0
@@ -0,0 +1,1124 @@ +from setuptools import setup, Command%0Aimport subprocess%0A%0A%0Aclass PyTest(Command):%0A user_options = %5B%5D%0A%0A def initialize_options(self):%0A pass%0A%0A def finalize_options(self):%0A pass%0A%0A def run(self):%0A errno = subprocess.call(%5B'py.test'%5D)%0A raise SystemExit(errno)%0A%0Asetup(%0A name='python-sharer',%0A version='0.1.0',%0A url='http://github.com/FelixLoether/python-sharer',%0A author='Oskari Hiltunen',%0A author_email='python-sharer@loethr.net',%0A description=(%0A 'Python-Sharer is a utility to help share a message to different '%0A 'social medias.'%0A ),%0A long_description=open('README.rst').read(),%0A packages=%5B'sharers'%5D,%0A platforms='any',%0A cmdclass=%7B'test': PyTest%7D,%0A classifiers=%5B%0A 'Programming Language :: Python',%0A 'Programming Language :: Python :: 2',%0A 'Programming Language :: Python :: 2.6',%0A 'Programming Language :: Python :: 2.7',%0A 'Operating System :: OS Independent',%0A 'Intended Audience :: Developers',%0A 'License :: OSI Approved :: MIT License',%0A 'Topic :: Internet :: WWW/HTTP',%0A %5D%0A)%0A
a45885947fa10c9143beec5294870e801fff8bc6
Create apg_de.py
apg_de.py
apg_de.py
Python
0.00006
@@ -0,0 +1,2514 @@ +#!/usr/bin/env python2%0A#%0A#%0A#%0A# by t3sl4/tesl23%0A#%0A%0Aimport base64%0Aimport random%0Aimport string%0Afrom Crypto.Cipher import AES%0A%0Adecoded = ''%0A%0Adef makepasswd(bsize, key, spass, username, passfor, saveto, pad, dec, low, upp, pun):%0A if bsize == '32':%0A bsize = 32%0A elif bsize == '16':%0A bsize = 16%0A elif bsize == '24':%0A bsize = 24%0A else:%0A #TODO handle error%0A print 'Error 1'%0A%0A passwd = ''%0A if int(dec) %3E 0:%0A i = 0%0A while i %3C int(dec):%0A passwd += ''.join(random.choice(string.digits))%0A i += 1%0A if int(low) %3E 0:%0A i = 0%0A while i %3C int(low):%0A passwd += ''.join(random.choice(string.ascii_lowercase))%0A i += 1%0A if int(upp) %3E 0:%0A i = 0%0A while i %3C int(upp):%0A passwd += ''.join(random.choice(string.ascii_uppercase))%0A i += 1%0A if int(pun) %3E 0:%0A i = 0%0A while i %3C int(pun):%0A passwd += ''.join(random.choice(string.punctuation))%0A i += 1%0A%0A shuffle = list(passwd)%0A random.shuffle(shuffle)%0A passwd = ''.join(shuffle)%0A %0A schar = spass%0A if schar == 'r':%0A passwd = passwd%0A elif schar is 'd':%0A cnt = 0%0A passwd = list(passwd)%0A for d in passwd:%0A if d in string.digits:%0A position = cnt%0A break%0A cnt += 1%0A passwd.insert(0, passwd.pop(cnt))%0A passwd = ''.join(passwd)%0A elif schar is 'l':%0A cnt = 0%0A passwd = list(passwd)%0A for l in passwd:%0A if l in string.ascii_lowercase:%0A position = cnt%0A break%0A cnt += 1%0A passwd.insert(0, passwd.pop(cnt))%0A passwd = ''.join(passwd)%0A elif schar is 'u':%0A cnt = 0%0A passwd = list(passwd)%0A for u in passwd:%0A if u in string.ascii_uppercase:%0A position = cnt%0A break%0A cnt += 1%0A passwd.insert(0, passwd.pop(cnt))%0A passwd = ''.join(passwd)%0A elif schar is 'p':%0A cnt = 0%0A passwd = list(passwd)%0A for p in passwd:%0A if p in string.punctuation:%0A position = cnt%0A break%0A cnt += 1%0A passwd.insert(0, passwd.pop(cnt))%0A passwd = ''.join(passwd)%0A else:%0A #TODO handle error%0A print ''%0A print 'Wrong choice!'%0A%0A padd = lambda s: s + (bsize - len(s) %25 bsize) * pad%0A encAES = lambda c, s: base64.b64encode(c.encrypt(padd(s)))%0A cipher = AES.new(key)%0A encoded = encAES(cipher, passwd)%0A ofile = open(saveto, 'a')%0A ofile.write(passfor + '::'+ username + '::' + encoded + '%5Cn')%0A ofile.close()%0A%0Adef decryptpasswd(dkey, dpad, dpass):%0A global decoded%0A %0A decAES = lambda c, e: c.decrypt(base64.b64decode(e)).rstrip(dpad)%0A cipher = AES.new(dkey)%0A decoded = decAES(cipher, dpass)%0A
77f6f387d2eda3accc2969a02daf5c8315016d6b
Fix #5: add setup.py for PyPI package
setup.py
setup.py
Python
0
@@ -0,0 +1,608 @@ +#!/usr/bin/env python%0A%0Aimport sys%0Aimport os%0Atry:%0A from setuptools import setup, find_packages%0Aexcept ImportError:%0A from disutils.core import setup%0A%0A%0Ahere = os.path.abspath(os.path.dirname(__file__))%0Awith open(os.path.join(here, %22README.md%22)) as f:%0A README = f.read()%0A%0A%0Asetup(name=%22smatch%22,%0A version=%221.0%22,%0A description=%22Smatch (semantic match) tool%22,%0A long_description=README,%0A author=%22Shu Cai%22,%0A author_email=%22shucai@isi.edu%22,%0A url=%22https://github.com/snowblink14/smatch%22,%0A license=%22MIT%22,%0A py_modules=%5B%22smatch%22, %22amr%22%5D,%0A scripts=%5B%22smatch.py%22%5D,%0A )%0A%0A
c09aae8181fd7ab706b6fca84e64830e76007687
add setup.py file
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,1636 @@ +import os%0Atry:%0A from setuptools import setup%0Aexcept ImportError:%0A from distutils.core import setup%0A%0ADESCRIPTION = %22Galaxy Cluster Properties and Weak Lensing Profiles%22%0ALONG_DESCRIPTION = %22%22%22%0Acluster-lensing: galaxy cluster halo calculations%0A======================================================%0AThis package includes tools for calculating a variety of galaxy cluster properties, as well as mass-richness and mass-concentration scaling relations, and weak lensing profiles. These include surface mass density (Sigma) and differential surface mass density (DeltaSigma) for NFW halos, both with and without the effects of cluster miscentering.%0AFor more information, visit http://github.com/jesford/cluster-lensing%0A%22%22%22%0ANAME = %22cluster-lensing%22%0AAUTHOR = %22Jes Ford%22%0AAUTHOR_EMAIL = %22jesford@uw.edu%22%0AMAINTAINER = %22Jes Ford%22%0AMAINTAINER_EMAIL = %22jesford@uw.edu%22%0AURL = 'http://github.com/jesford/cluster-lensing'%0ADOWNLOAD_URL = 'http://github.com/jesford/cluster-lensing'%0ALICENSE = 'MIT'%0AVERSION = '0.0.1'%0A%0Asetup(name=NAME,%0A version=VERSION,%0A description=DESCRIPTION,%0A long_description=LONG_DESCRIPTION,%0A author=AUTHOR,%0A author_email=AUTHOR_EMAIL,%0A maintainer=MAINTAINER,%0A maintainer_email=MAINTAINER_EMAIL,%0A url=URL,%0A download_url=DOWNLOAD_URL,%0A license=LICENSE,%0A packages=%5B'cluster-lensing'%5D,%0A classifiers=%5B%0A 'Development Status :: 4 - Beta',%0A 'Environment :: Console',%0A 'Intended Audience :: Science/Research',%0A 'License :: OSI Approved :: MIT License',%0A 'Natural Language :: English',%0A 'Programming Language :: Python :: 2.7',%0A )%0A
4d9bbd9d1cea89c656cec9faeca24e3353bd5dbf
Bump mock requirement to >= 1.0
setup.py
setup.py
from __future__ import unicode_literals import re from setuptools import setup, find_packages def get_version(filename): init_py = open(filename).read() metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", init_py)) return metadata['version'] setup( name='Mopidy', version=get_version('mopidy/__init__.py'), url='http://www.mopidy.com/', license='Apache License, Version 2.0', author='Stein Magnus Jodal', author_email='stein.magnus@jodal.no', description='Music server with MPD and Spotify support', long_description=open('README.rst').read(), packages=find_packages(exclude=['tests', 'tests.*']), zip_safe=False, include_package_data=True, install_requires=[ 'setuptools', 'Pykka >= 1.1', ], extras_require={ 'spotify': ['pyspotify >= 1.9, < 1.11'], 'scrobbler': ['pylast >= 0.5.7'], 'http': ['cherrypy >= 3.2.2', 'ws4py >= 0.2.3'], }, test_suite='nose.collector', tests_require=[ 'nose', 'mock >= 0.7', 'unittest2', ], entry_points={ 'console_scripts': [ 'mopidy = mopidy.__main__:main', 'mopidy-scan = mopidy.scanner:main', 'mopidy-convert-config = mopidy.config.convert:main', ], 'mopidy.ext': [ 'http = mopidy.frontends.http:Extension [http]', 'scrobbler = mopidy.frontends.scrobbler:Extension [scrobbler]', 'local = mopidy.backends.local:Extension', 'mpd = mopidy.frontends.mpd:Extension', 'mpris = mopidy.frontends.mpris:Extension', 'spotify = mopidy.backends.spotify:Extension [spotify]', 'stream = mopidy.backends.stream:Extension', ], }, classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: No Input/Output (Daemon)', 'Intended Audience :: End Users/Desktop', 'License :: OSI Approved :: Apache Software License', 'Operating System :: MacOS :: MacOS X', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Multimedia :: Sound/Audio :: Players', ], )
Python
0
@@ -1041,11 +1041,11 @@ %3E= -0.7 +1.0 ',%0A
b89347a6aaec2f5d74f788b966ead5cc8a2ae37e
add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,270 @@ +from distutils.core import setup%0Asetup(name='python-libusb1',%0A description='a Python wrapper around libusb-1.0',%0A version='0.0.1',%0A author='vpelletier',%0A url='http://github.com/vpelletier/python-libusb1',%0A py_modules=%5B'libusb1','usb1'%5D,%0A )%0A
e0550aa39f76eb186be41914afb484d135d0257c
Add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,700 @@ +#!/usr/bin/env python%0D%0A%0D%0Afrom distutils.core import setup%0D%0A%0D%0Asetup(name='LinkHeader',%0D%0A version='0.1',%0D%0A description='The parsing and formatting of Link Headers',%0D%0A author='Michael Burrows',%0D%0A author_email='mjb@asplake.co.uk ',%0D%0A url='http://bitbucket.org/asplake/link_header',%0D%0A py_modules=%5B'link_header'%5D%0D%0A classifiers=%5B%22Development Status :: TBC%22,%0D%0A %22Intended Audience :: Developers%22,%0D%0A %22License :: OSI Approved :: BSD License%22,%0D%0A %22Programming Language :: Python%22,%0D%0A %22Topic :: Internet :: WWW/HTTP%22,%0D%0A %22Topic :: Software Development :: Libraries :: Python Modules%22%5D)%0D%0A%0D%0A
62facc7d99797330fbd03b55a88ba12c60c23ea2
add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,685 @@ +#!/usr/bin/env python%0A%0Afrom setuptools import setup, find_packages%0A%0Asetup(%0A name='home',%0A version=%220.1%22,%0A author='encorehu',%0A author_email='huyoo353@126.com',%0A description='a django project specific app.',%0A url='https://github.com/encorehu/django-home',%0A packages=find_packages(),%0A package_dir=%7B'home':'home'%7D,%0A package_data=%7B'home':%5B'*.*','templates/home/*.*'%5D%7D,%0A zip_safe = False,%0A include_package_data=True,%0A classifiers=%5B%0A %22Framework :: Django%22,%0A %22Intended Audience :: Developers%22,%0A %22Intended Audience :: System Administrators%22,%0A %22Operating System :: OS Independent%22,%0A %22Topic :: Software Development%22%0A %5D,%0A)%0A
56f1a366c8a482c63782933514222376bb827a8a
add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,560 @@ +#+%0A# Distutils script to install DBussy. Invoke from the command line%0A# in this directory as follows:%0A#%0A# python3 setup.py build%0A# sudo python3 setup.py install%0A#%0A# Written by Lawrence D'Oliveiro %3Cldo@geek-central.gen.nz%3E.%0A#-%0A%0Aimport distutils.core%0A%0Adistutils.core.setup %5C%0A (%0A name = %22DBussy%22,%0A version = %220.5%22,%0A description = %22language bindings for libdbus, for Python 3.5 or later%22,%0A author = %22Lawrence D'Oliveiro%22,%0A author_email = %22ldo@geek-central.gen.nz%22,%0A url = %22http://github.com/ldo/dbussy%22,%0A py_modules = %5B%22dbussy%22%5D,%0A )%0A
475458a322525f429b31fe54f1295685b2195c39
Add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,2367 @@ +%22%22%22Setup module for the address_extractor package%22%22%22%0A%0Aimport setuptools%0Aimport codecs # To use a consistent encoding%0Aimport os%0Aimport re%0A%0A#################################################################%0A%0APACKAGES = setuptools.find_packages(where='src')%0AMETA_PATH = os.path.join('src', 'address_extractor', '__init__.py')%0AKEYWORDS = %5B''%5D%0ACLASSIFIERS = %5B%0A 'Development Status :: 4 - Beta',%0A 'Environment :: Console',%0A 'Intended Audience :: End Users/Desktop',%0A 'License :: Other/Proprietary License',%0A 'Programming Language :: Python :: 3.5',%0A 'Topic :: Office/Business'%0A%5D%0AINSTALL_REQUIRES = %5B'usaddress'%5D%0AEXTRAS_REQUIRE = %7B%7D%0ACONSOLE_ENTRY_POINTS = %5B'address_extractor=address_extractor.__main__:main'%5D%0A%0A#################################################################%0A%0AHERE = os.path.abspath(os.path.dirname(__file__))%0A%0Adef read(*parts):%0A %22%22%22Build an absolute path from *parts* and return the contents of the resulting file. Assume UTF-8 encoding.%22%22%22%0A with codecs.open(os.path.join(HERE, *parts), 'rb', 'utf-8') as f:%0A return f.read()%0A%0AMETA_FILE = read(META_PATH)%0A%0Adef find_meta(meta):%0A %22%22%22Extract __*meta*__ from META_FILE%22%22%22%0A meta_match = re.search(%0A r'%5E__%7Bmeta%7D__ = %5B%22%5C'%5D(%5B%5E%22%5C'%5D*)%5B%22%5C'%5D'.format(meta=meta),%0A META_FILE, re.M%0A )%0A if meta_match:%0A return meta_match.group(1)%0A raise RuntimeError('Unable to find __%7Bmeta%7D__ string'.format(meta=meta))%0A%0Adef get_long_description():%0A %22%22%22Get the long_description from the README.md file. Assume UTF-8 encoding.%22%22%22%0A with codecs.open(os.path.join(HERE, 'README.md'), encoding='utf-8') as f:%0A long_description = f.read()%0A%0Aif __name__ == '__main__':%0A setuptools.setup(%0A name = find_meta('title'),%0A version = find_meta('version'),%0A description = find_meta('description'),%0A long_description = get_long_description(),%0A url = find_meta('url'),%0A author = find_meta('author'),%0A author_email = find_meta('email'),%0A maintainer = find_meta('author'),%0A license = find_meta('license'),%0A classifiers = CLASSIFIERS,%0A keywords = KEYWORDS,%0A packages = PACKAGES,%0A package_dir = %7B'': 'src'%7D,%0A install_requires = INSTALL_REQUIRES,%0A extras_require = EXTRAS_REQUIRE,%0A entry_points = %7B%0A 'console_scripts': CONSOLE_ENTRY_POINTS%0A %7D%0A )%0A
72af391ec00facfbabc8ac89ff3bea1b54799d97
Add plot of days per year with precip
htdocs/plotting/auto/scripts/p50.py
htdocs/plotting/auto/scripts/p50.py
Python
0.000219
@@ -0,0 +1,2095 @@ +import matplotlib%0Amatplotlib.use('agg')%0Aimport matplotlib.pyplot as plt%0Aimport psycopg2.extras%0Aimport pyiem.nws.vtec as vtec%0Afrom pyiem.network import Table as NetworkTable%0Aimport numpy as np%0Aimport pytz%0A%0APDICT = %7B%0A %22hadgem=a1b%22: %22HADGEM A1B%22,%0A %22cnrm=a1b%22 : %22CNRM A1B%22,%0A %22echam5=a1b%22 : %22ECHAM5 A1B%22,%0A %22echo=a1b%22 : %22ECHO A1B%22,%0A %22pcm=a1b%22 : %22PCM A1B%22,%0A %22miroc_hi=a1b%22: %22MIROC_HI A1B%22,%0A %22cgcm3_t47=a1b%22: %22CGCM3_T47 A1B%22,%0A %22giss_aom=a1b%22: %22GISS_AOM A1B%22,%0A %22hadcm3=a1b%22: %22HADCM3 A1B%22,%0A %22cgcm3_t63=a1b%22: %22CGCM3_T63 A1B%22,%0A %7D%0A%0Adef get_description():%0A %22%22%22 Return a dict describing how to call this plotter %22%22%22%0A d = dict()%0A d%5B'cache'%5D = 86400%0A d%5B'description'%5D = %22%22%22 %22%22%22%0A d%5B'arguments'%5D = %5B%0A dict(type='networkselect', name='station', network='CSCAP',%0A default='ISUAG', label='Select CSCAP Site:'),%0A dict(type='select', name='model', default='echo=a1b',%0A label='Select Model:', options=PDICT)%0A %5D%0A return d%0A%0A%0Adef plotter( fdict ):%0A %22%22%22 Go %22%22%22%0A pgconn = psycopg2.connect(database='coop', host='iemdb', user='nobody')%0A cursor = pgconn.cursor(cursor_factory=psycopg2.extras.DictCursor)%0A%0A station = fdict.get('station', 'ISUAG')%0A nt = NetworkTable(%22CSCAP%22)%0A clstation = nt.sts%5Bstation%5D%5B'climate_site'%5D%0A (model, scenario) = fdict.get('model', 'hadgem=a1b').split(%22=%22)%0A%0A (fig, ax) = plt.subplots(1, 1)%0A%0A cursor.execute(%22%22%22%0A SELECT extract(year from day) as yr, sum(case when precip %3E 0%0A THEN 1 else 0 end) from hayhoe_daily WHERE precip is not null and%0A station = %25s and model = %25s and scenario = %25s%0A GROUP by yr ORDER by yr ASC %0A %22%22%22, (clstation, model, scenario))%0A years = %5B%5D%0A precip = %5B%5D%0A for row in cursor:%0A years.append(row%5B0%5D)%0A precip.append(row%5B1%5D)%0A%0A%0A ax.bar(years, precip, ec='b', fc='b')%0A ax.grid(True)%0A ax.set_ylabel(%22Days Per Year%22)%0A ax.set_title(%22%25s %25s%5Cn%25s %25s :: Days per Year with Measureable Precip%22 %25 (%0A station, nt.sts%5Bstation%5D%5B'name'%5D, model,%0A scenario))%0A return fig%0A
a950eb82f62f98900db8dcc4f30fd444f760b6e0
Bump for 1.9.9-04
setup.py
setup.py
#!/usr/bin/env python import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup # Our version ALWAYS matches the version of Django we support # If Django has a new release, we branch, tag, then update this setting after the tag. version = '1.9.9-03' if sys.argv[-1] == 'tag': os.system('git tag -a %s -m "version %s"' % (version, version)) os.system('git push --tags') sys.exit() with open('README.rst') as readme_file: long_description = readme_file.read() setup( name='cookiecutter-django', version=version, description='A Cookiecutter template for creating production-ready Django projects quickly.', long_description=long_description, author='Daniel Roy Greenfeld', author_email='pydanny@gmail.com', url='https://github.com/pydanny/cookiecutter-django', packages=[], license='BSD', zip_safe=False, classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Console', 'Framework :: Django :: 1.9', 'Intended Audience :: Developers', 'Natural Language :: English', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: Implementation :: CPython', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Software Development', ], keywords=( 'cookiecutter, Python, projects, project templates, django, ' 'skeleton, scaffolding, project directory, setup.py' ), )
Python
0
@@ -301,17 +301,17 @@ '1.9.9-0 -3 +4 '%0A%0Aif sy
1d693c0e32cb3247e861c819d389f51fc2fc6be0
add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,545 @@ +#!/usr/bin/env python%0A#-*- coding:utf-8 -*-%0A%0Afrom setuptools import setup, find_packages%0A%0Asetup(%0A name = %22webqq%22,%0A version=%220.1.0%22,%0A packages = find_packages(),%0A zip_safe = False,%0A%0A description = %22python 2.7.x webqq lib, for fun.%22,%0A long_description = %22python 2.7.x webqq lib, for fun.%22,%0A author = %22encorehu%22,%0A author_email = %22huyoo353@126.com%22,%0A%0A license = %22MIT%22,%0A keywords = (%22webqq%22, %22egg%22),%0A platforms = %22all%22,%0A url = %22https://github.com/encorehu/webqq%22,%0A)%0A
14f5ad3da26a7fbfab7b902e778eac1702accfc9
Version bump
setup.py
setup.py
#!/usr/bin/env python from distribute_setup import use_setuptools use_setuptools() PROJECT = 'virtualenvwrapper-win' AUTHOR = 'David Marble' EMAIL = 'davidmarble@gmail.com' DESCRIPTION = ('Port of Doug Hellmann\'s virtualenvwrapper ' 'to Windows batch scripts') VERSION = '1.1.4' PROJECT_URL = 'https://github.com/davidmarble/%s/' % (PROJECT) scripts_loc = 'scripts/' scripts = [ 'add2virtualenv.bat', 'cd-.bat', 'cdproject.bat', 'cdsitepackages.bat', 'cdvirtualenv.bat', 'folder_delete.bat', 'lssitepackages.bat', 'lsvirtualenv.bat', 'mkvirtualenv.bat', 'rmvirtualenv.bat', 'setprojectdir.bat', 'toggleglobalsitepackages.bat', 'whereis.bat', 'workon.bat', ] import os import sys import shutil import codecs from setuptools import setup from setuptools.command.install import install as _setuptools_install long_description = '' try: long_description = open('README.rst', 'rt').read() except IOError: pass PYTHONHOME = sys.exec_prefix class install(_setuptools_install): def run(self): # pre-install _setuptools_install.run(self) # post-install # Re-write install-record to take into account new file locations if self.record: newlist = [] with codecs.open(self.record, 'r', 'utf-8') as f: files = f.readlines() for f in files: fname = f.strip() for script in scripts: if fname.endswith(script): newname = fname.replace('Scripts\\','') # try: # os.remove(dst) # except: # pass shutil.move(fname, newname) fname = newname newlist.append(fname) with codecs.open(self.record, 'w', 'utf-8') as f: f.write('\n'.join(newlist)) setup( cmdclass={'install': install}, name=PROJECT, version=VERSION, description=DESCRIPTION, long_description=long_description, author=AUTHOR, author_email=EMAIL, url=PROJECT_URL, license="BSD 3-clause", keywords="setuptools deployment installation distutils virtualenv virtualenvwrapper", platforms=['WIN32', 'WIN64',], classifiers=[ 'Development Status :: 4 - Beta', 'Environment :: Win32 (MS Windows)', 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.4', 'Programming Language :: Python :: 2.5', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.0', 'Programming Language :: Python :: 3.1', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Intended Audience :: Developers', 'Environment :: Console', ], scripts=[scripts_loc + script for script in scripts], install_requires=['virtualenv==1.9.1',], # extras # pywin==0.2 zip_safe=False, )
Python
0.000001
@@ -287,17 +287,17 @@ = '1.1. -4 +5 '%0APROJEC
e3c32fb0775a17d47906c5fdd48a9809a00430b3
include kismon.windows in the setup.py
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup setup(name='kismon', version='0.2', description='PyGTK based kismet client', author='Patrick Salecker', author_email='mail@salecker.org', url='http://www.salecker.org/software/kismon/en', license='BSD', packages=['kismon'], scripts=['bin/kismon'], platforms='UNIX', data_files = [('/usr/share/applications', ['files/kismon.desktop']), ('/usr/share/kismon', ['files/position.png', 'files/minimal-rules.xml', 'files/night-rules.xml']), ], )
Python
0
@@ -274,24 +274,42 @@ es=%5B'kismon' +, 'kismon.windows' %5D,%0A%09scripts=
392458f6d5cea3d723d86d6238d1f1b46cfc95a5
Add a setup.py
setup.py
setup.py
Python
0.000006
@@ -0,0 +1,315 @@ +#!/usr/bin/env python%0A%0Afrom distutils.core import setup%0A%0Asetup(name='jogging',%0A version='0.1',%0A description='Jogging makes logging in django easier',%0A author='Zain',%0A author_email='zain@inzain.net',%0A url='',%0A packages = %5B'jogging',%5D,%0A package_dir = %7B'jogging':'jogging'%7D,%0A )%0A%0A
e67e2ca56310c35a0a8bb30ecb9fceeb55dcc9f5
Add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,888 @@ +# -*- coding: utf8 -*-%0A%0Atry:%0A from setuptools import setup%0Aexcept ImportError:%0A from distutils.core import setup%0A%0Asetup(%0A version='0.3',%0A name='sverigesradio',%0A description='Python bindings for Sveriges Radio API',%0A author='William Tis%C3%A4ter',%0A author_email='william@defunct.cc',%0A packages=%5B'sverigesradio'%5D,%0A install_requires=%5B'requests %3E= 2.1.0'%5D,%0A url='https://github.com/tiwilliam/sverigesradio',%0A classifiers=%5B'Programming Language :: Python',%0A 'Programming Language :: Python :: 2.5',%0A 'Programming Language :: Python :: 2.6',%0A 'Programming Language :: Python :: 2.7',%0A 'Programming Language :: Python :: 3',%0A 'Programming Language :: Python :: 3.2',%0A 'Programming Language :: Python :: 3.3'%5D,%0A license='MIT License',%0A keywords='sr sverigesradio'%0A)%0A
ec087b033b8e9b4172a4d5e77a26a10ea16ffb64
Add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,457 @@ +#!/usr/bin/env python%0A%0Afrom setuptools import setup%0Afrom setuptools import find_packages%0A%0A__author__ = 'Daniel Luque %3Cdanielluque14@gmail.com%3E'%0A__version__ = '1.0.0'%0A%0Asetup(%0A name='pybooru',%0A version=__version__,%0A author=__author__ %0A author_email=%22danielluque14@gmail.com%22, %0A url=%22http://mundogeek.net/tutorial-python/%22, %0A license=%22GPL%22,%0A packages=find_packages(),%0A include_package_data=True,%0A install_requires=%5B'simplejson'%5D,%0A)
072d6a2ad1ab293427aadd074c5485483f701eb1
Add a setuptools wrapper
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,672 @@ +#!/usr/bin/env python%0A%0Aimport os%0Afrom setuptools import find_packages, setup%0A%0Adef read(fname):%0A return open(os.path.join(os.path.dirname(__file__), fname)).read()%0A%0Asetup(%0A name = %22statprof%22,%0A version = %220.1%22,%0A author = %22Jeff Muizelaar%22,%0A author_email = %22jmuizelaar@mozilla.com%22,%0A description = (%22Statistical profiling for Python%22),%0A license = %22LGPL%22,%0A keywords = %22profiling%22,%0A url = %22http://packages.python.org/statprof%22,%0A py_modules = %5B'statprof'%5D,%0A long_description = read('README'),%0A classifiers = %5B%0A %22Development Status :: 3 - Alpha%22,%0A %22Topic :: Utilities%22,%0A %22License :: OSI Approved :: LGPL License%22,%0A %5D,%0A)%0A
8500effa4ade8ecb3eff0501a749a869467a8768
Add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,331 @@ +#!/usr/bin/env python%0A%0Afrom distutils.core import setup%0A%0Asetup(%0A name='OMFTools',%0A version='0.1',%0A description='Tools for modifying OMF2097 files',%0A author='Tuomas Virtanen',%0A author_email='katajakasa@gmail.com',%0A url='https://github.com/omf2097/pyomftools',%0A packages=%5B'omftools', 'omftools.pyshadowdive'%5D,%0A)%0A
7b8f76d53fb820e4fd429f880557bf52ec5dc4be
Add setup
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,700 @@ +from setuptools import setup%0A%0Asetup(%0A name='fixture-generator',%0A version='0.0.1',%0A packages=%5B'fixture-generator'%5D,%0A url='https://github.com/Rhathe/Fixture-Generator',%0A license='MIT',%0A author='Ramon Sandoval',%0A description='SqlAlchemy Fixture Generator',%0A long_description='SqlAlchemy Fixture Generator',%0A%0A classifiers=%5B%0A 'Development Status :: 3 - Alpha',%0A 'Intended Audience :: Developers',%0A 'License :: OSI Approved :: MIT License',%0A 'Programming Language :: Python :: 2.7',%0A 'Programming Language :: Python :: 3.4',%0A 'Programming Language :: Python :: 3.5',%0A 'Topic :: Utilities',%0A %5D,%0A%0A install_requires=%5B%0A %5D,%0A)%0A
12dce1474946d1a9bc41681af6dc2723ecfcc7f1
Add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,1033 @@ +from setuptools import setup%0Afrom setuptools import find_packages%0A%0Awith open('requirements.txt') as f:%0A required = f.read().splitlines()%0A%0Asetup(%0A name='downflickr',%0A description='Download photoset of flickr using gevent',%0A long_description=open('README.rst').read(),%0A version='0.0.1',%0A author='carlcarl',%0A author_email='carlcarlking@gmail.com',%0A url='https://github.com/carlcarl/downflickr',%0A packages=find_packages(),%0A install_requires=required,%0A license='MIT',%0A entry_points=%7B%0A 'console_scripts': %5B%0A 'downflickr = downflickr.downflickr:main',%0A %5D%0A %7D,%0A%0A classifiers=%5B%0A 'Development Status :: 3 - Alpha',%0A 'Intended Audience :: End Users/Desktop',%0A 'License :: OSI Approved :: MIT License',%0A 'Programming Language :: Python',%0A 'Operating System :: MacOS :: MacOS X',%0A 'Operating System :: POSIX',%0A 'Operating System :: Unix',%0A 'Topic :: Utilities',%0A 'Topic :: Software Development :: Libraries',%0A %5D%0A)%0A
54b8c721834921542940d43f53e25ebaac5477db
version bump
setup.py
setup.py
import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name = "cmsplugin-filer", version = "0.0.5a7", url = 'http://github.com/stefanfoulis/django-filer-cmsplugins', license = 'BSD', description = "django-cms plugins for django-filer", long_description = read('README'), author = 'Stefan Foulis', author_email = 'stefan.foulis@gmail.com', packages = find_packages('src'), package_dir = {'':'src'}, install_requires = ['setuptools','django','django-cms',], classifiers = [ 'Development Status :: 4 - Beta', 'Framework :: Django', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Topic :: Internet :: WWW/HTTP', ], include_package_data=True, zip_safe = False )
Python
0.000001
@@ -199,9 +199,9 @@ 0.5a -7 +8 %22,%0A
f704bc7f14e6505a9f898e7c2a225a2044f49eec
Update required pyhull version to 1.3.5
setup.py
setup.py
import glob import os from distribute_setup import use_setuptools use_setuptools(version='0.6.10') from setuptools import setup, find_packages, Extension from numpy.distutils.misc_util import get_numpy_include_dirs from pymatgen import __version__ long_description = """ Pymatgen (Python Materials Genomics) is a robust, open-source Python library for materials analysis. It currently powers the public Materials Project (http://www.materialsproject.org), an initiative to make calculated properties on a large number of materials available to materials researchers and designers. These are some of the main features: 1. Highly flexible classes for the representation of Element, Site, Molecule, Structure objects. 2. Extensive io capabilities to manipulate many VASP input and output files (http://cms.mpi.univie.ac.at/vasp/) and the crystallographic information file format. This includes generating Structure objects from vasp input and output. There is also support for Gaussian input files and XYZ file for molecules. 3. Comprehensive tool to generate and view compositional and grand canonical phase diagrams. 4. Electronic structure analyses (DOS and Bandstructure). 5. Integration with the Materials Project REST API. The pymatgen library is free (as in free beer) to download and to use. However, we would also like you to help us improve this library by making your own contributions as well. These contributions can be in the form of additional tools or modules you develop, or even simple things such as bug reports. Please contact the maintainer of this library (shyue@mit.edu) to find out how to include your contributions via github or for bug reports. Note that pymatgen, like all scientific research, will always be a work in progress. While the development team will always strive to avoid backward incompatible changes, they are sometimes unavoidable, and tough decisions have to be made for the long term health of the code. For documentation and usage guide, please refer to the latest documentation at our github page (http://materialsproject.github.com/pymatgen/). If you wish to be notified via email of pymatgen releases, you may become a member of pymatgen's Google Groups page (https://groups.google.com/forum/?fromgroups#!forum/pymatgen/). """ # Get spglib spglibs = glob.glob(os.path.join("dependencies", "spglib*")) if len(spglibs) == 0: raise ValueError("No spglib found in dependencies/") spglibdir = spglibs[0] # set rest of spglib spgsrcdir = os.path.join(spglibdir, "src") include_dirs = [spgsrcdir] sources = ["cell.c", "debug.c", "hall_symbol.c", "kpoint.c", "lattice.c", "mathfunc.c", "pointgroup.c", "primitive.c", "refinement.c", "sitesym_database.c", "site_symmetry.c", "spacegroup.c", "spin.c", "spg_database.c", "spglib.c", "symmetry.c"] sources = [os.path.join(spgsrcdir, srcfile) for srcfile in sources] extension = Extension("pymatgen._spglib", include_dirs=include_dirs + get_numpy_include_dirs(), sources=[os.path.join(spglibdir, "_spglib.c")] + sources ) scripts = [os.path.join("scripts", f) for f in os.listdir("scripts")] setup( name="pymatgen", packages=find_packages(), version=__version__, install_requires=["numpy>=1.5", "pyhull>=1.3.3"], dependency_links = [ "https://bitbucket.org/jamesrhester/pycifrw/downloads/PyCifRW-3.5.tar.gz" ], extras_require={"electronic_structure": ["scipy>=0.10"], "plotting": ["matplotlib>=1.1"], "ase_adaptor": ["ase>=3.3"], "cif": ["PyCifRW>=3.3"]}, package_data={"pymatgen.core": ["bond_lengths.json", "periodic_table.json"], "pymatgen.analysis": ["bvparam_1991.json", "icsd_bv.json"], "pymatgen.io": ["*.cfg"], "pymatgen.entries": ["*.cfg"], "pymatgen.vis": ["ElementColorSchemes.cfg"]}, author="Shyue Ping Ong, Anubhav Jain, Michael Kocher, Geoffroy Hautier," "Will Richards, Dan Gunter, Shreyas Cholia, Vincent L Chevrier, " "Rickard Armiento", author_email="shyue@mit.edu, anubhavj@mit.edu, mpkocher@lbnl.gov, " "geoffroy.hautier@uclouvain.be, wrichard@mit.edu, dkgunter@lbl.gov, " "vincentchevrier@gmail.com, armiento@mit.edu", maintainer="Shyue Ping Ong", url="https://github.com/materialsproject/pymatgen/", license="MIT", description="pymatgen is the Python library powering the " "Materials Project (www.materialsproject.org).", long_description=long_description, keywords=["vasp", "gaussian", "materials", "project", "electronic", "structure"], classifiers=[ "Programming Language :: Python :: 2.7", "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Scientific/Engineering :: Physics", "Topic :: Scientific/Engineering :: Chemistry", "Topic :: Software Development :: Libraries :: Python Modules" ], download_url="https://github.com/materialsproject/pymatgen/tarball/master", ext_modules=[extension], scripts=scripts )
Python
0
@@ -3328,17 +3328,17 @@ ll%3E=1.3. -3 +5 %22%5D,%0A
3cd157c12224ba8cee54be36f7da92f30c38964f
Update issue 120 Moving parsers and serializer implementations into rdflib.plugins package
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup # Install rdflib from rdflib import __version__ setup( name = 'rdflib', version = __version__, description = "RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information.", author = "Daniel 'eikeon' Krech", author_email = "eikeon@eikeon.com", maintainer = "Daniel 'eikeon' Krech", maintainer_email = "eikeon@eikeon.com", url = "http://rdflib.net/", license = "http://rdflib.net/latest/LICENSE", platforms = ["any"], classifiers = ["Programming Language :: Python", "License :: OSI Approved :: BSD License", "Topic :: Software Development :: Libraries :: Python Modules", "Operating System :: OS Independent", "Natural Language :: English", ], long_description = \ """RDFLib is a Python library for working with RDF, a simple yet powerful language for representing information. The library contains parsers and serializers for RDF/XML, N3, NTriples, Turtle, TriX and RDFa . The library presents a Graph interface which can be backed by any one of a number of Store implementations, including, Memory, MySQL, Redland, SQLite, Sleepycat and SQLObject. If you have recently reported a bug marked as fixed, or have a craving for the very latest, you may want the development version instead: http://rdflib.googlecode.com/svn/trunk#egg=rdflib-dev """, download_url = "http://rdflib.net/rdflib-%s.tar.gz" % __version__, packages = ['rdflib', 'rdflib/plugins', 'rdflib/syntax', 'rdflib/syntax/parsers', 'rdflib/syntax/parsers/rdfa', 'rdflib/syntax/parsers/rdfa/transform', 'rdflib/syntax/serializers', ], )
Python
0
@@ -1692,22 +1692,23 @@ 'rdflib/ -syntax +plugins ',%0A @@ -1718,38 +1718,39 @@ 'rdflib/ -syntax +plugins /parsers',%0A @@ -1760,38 +1760,39 @@ 'rdflib/ -syntax +plugins /parsers/rdfa',%0A @@ -1815,22 +1815,23 @@ 'rdflib/ -syntax +plugins /parsers @@ -1876,14 +1876,15 @@ lib/ -syntax +plugins /ser
43947b54e8774306ead2fa86ef587526f058e572
Add manage.py for quick access to management commands
manage.py
manage.py
Python
0
@@ -0,0 +1,807 @@ +#!/usr/bin/env python%0Aimport os%0Aimport sys%0A%0Aif __name__ == %22__main__%22:%0A os.environ.setdefault(%22DJANGO_SETTINGS_MODULE%22, %22tests.app.settings%22)%0A try:%0A from django.core.management import execute_from_command_line%0A except ImportError:%0A # The above import may fail for some other reason. Ensure that the%0A # issue is really that Django is missing to avoid masking other%0A # exceptions on Python 2.%0A try:%0A import django%0A except ImportError:%0A raise ImportError(%0A %22Couldn't import Django. Are you sure it's installed and %22%0A %22available on your PYTHONPATH environment variable? Did you %22%0A %22forget to activate a virtual environment?%22%0A )%0A raise%0A execute_from_command_line(sys.argv)%0A
23f797bcf30bb7de26d1558e5eafc7818141f640
Create __init__.py
attribution/__init__.py
attribution/__init__.py
Python
0.000429
@@ -0,0 +1 @@ +%0A
34530a8b60bc1ebfe9bdd56250ecf23e05b8c935
add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,822 @@ +#!/usr/bin/env python2.7%0A%0Afrom setuptools import setup%0A%0Along_description = %22%22%22%5C%0AvSphere Client for Python is pure-Python implementation of%0Acollection tools to access to VMware's vSphere API.%0AIt provides both a Python API and a CLI to manage vSphere.%0A%22%22%22%0A%0Apkgdir = %7B'': 'src'%7D%0A%0Asetup(%0A name = 'vsphere',%0A version = '1.0.0',%0A description = 'vsphere-cli: VMware vSphere API and CLI management tool',%0A keywords = 'vmware api vsphere cli admin tool',%0A long_description = long_description,%0A author = 'Alcatel-Lucent Enterprise Personal Cloud R&D',%0A author_email = 'dev@opentouch.net',%0A url = 'https://github.com/OpenTouch/vsphere-client',%0A package_dir=pkgdir,%0A packages=%5B'vsphere'%5D,%0A include_package_data=True,%0A scripts=%5B'bin/vsphere'%5D,%0A platforms = %5B'All'%5D,%0A license = 'Apache 2.0',%0A)%0A
6b3c3a2e0dd4f47fc014f86fa0e85d38e11366b7
Create run_test.py
recipes/pytest-django/run_test.py
recipes/pytest-django/run_test.py
Python
0.000004
@@ -0,0 +1,201 @@ +import django%0Afrom django.conf import settings%0Asettings.configure(INSTALLED_APPS=%5B'pytest_django', 'django.contrib.contenttypes', 'django.contrib.auth'%5D) %0Adjango.setup() %0A %0Aimport pytest_django%0A
4a7a103204989af7e2b6bc97a4109d81beebd34c
Add python_requires to setup.py (#2465)
setup.py
setup.py
#!/usr/bin/env python import sys from setuptools import find_packages, setup import versioneer DISTNAME = 'xarray' LICENSE = 'Apache' AUTHOR = 'xarray Developers' AUTHOR_EMAIL = 'xarray@googlegroups.com' URL = 'https://github.com/pydata/xarray' CLASSIFIERS = [ 'Development Status :: 4 - Beta', 'License :: OSI Approved :: Apache Software License', 'Operating System :: OS Independent', 'Intended Audience :: Science/Research', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Scientific/Engineering', ] INSTALL_REQUIRES = ['numpy >= 1.12', 'pandas >= 0.19.2'] TESTS_REQUIRE = ['pytest >= 2.7.1'] if sys.version_info[0] < 3: TESTS_REQUIRE.append('mock') DESCRIPTION = "N-D labeled arrays and datasets in Python" LONG_DESCRIPTION = """ **xarray** (formerly **xray**) is an open source project and Python package that aims to bring the labeled data power of pandas_ to the physical sciences, by providing N-dimensional variants of the core pandas data structures. Our goal is to provide a pandas-like and pandas-compatible toolkit for analytics on multi-dimensional arrays, rather than the tabular data for which pandas excels. Our approach adopts the `Common Data Model`_ for self- describing scientific data in widespread use in the Earth sciences: ``xarray.Dataset`` is an in-memory representation of a netCDF file. .. _pandas: http://pandas.pydata.org .. _Common Data Model: http://www.unidata.ucar.edu/software/thredds/current/netcdf-java/CDM .. _netCDF: http://www.unidata.ucar.edu/software/netcdf .. _OPeNDAP: http://www.opendap.org/ Important links --------------- - HTML documentation: http://xarray.pydata.org - Issue tracker: http://github.com/pydata/xarray/issues - Source code: http://github.com/pydata/xarray - SciPy2015 talk: https://www.youtube.com/watch?v=X0pAhJgySxk """ # noqa setup(name=DISTNAME, version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), license=LICENSE, author=AUTHOR, author_email=AUTHOR_EMAIL, classifiers=CLASSIFIERS, description=DESCRIPTION, long_description=LONG_DESCRIPTION, install_requires=INSTALL_REQUIRES, tests_require=TESTS_REQUIRE, url=URL, packages=find_packages(), package_data={'xarray': ['tests/data/*']})
Python
0
@@ -2418,16 +2418,87 @@ rl=URL,%0A + python_requires='%3E=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',%0A pa
09d2d84c73bd3c232bdc78d1c46be43c676ef7ac
remove email
setup.py
setup.py
Python
0.000011
@@ -0,0 +1,1435 @@ +#!/usr/bin/env python%0A%0A%22%22%22The setup script.%22%22%22%0A%0Afrom setuptools import setup, find_packages%0A%0Awith open(%22README.md%22) as readme_file:%0A readme = readme_file.read()%0A%0Awith open(%22HISTORY.md%22) as history_file:%0A history = history_file.read()%0A%0Awith open(%22requirements.txt%22) as f:%0A requirements = f.read().splitlines()%0A%0Asetup_requirements = %5B%0A %22pytest-runner%22,%0A%5D%0A%0Atest_requirements = %5B%0A %22pytest%3E=3%22,%0A%5D%0A%0Asetup(%0A author=%22Adrian Garcia Badaracco%22,%0A python_requires=%22%3E=3.6%22,%0A classifiers=%5B%0A %22Development Status :: 2 - Pre-Alpha%22,%0A %22Intended Audience :: Developers%22,%0A %22License :: OSI Approved :: MIT License%22,%0A %22Natural Language :: English%22,%0A %22Programming Language :: Python :: 3%22,%0A %22Programming Language :: Python :: 3.6%22,%0A %22Programming Language :: Python :: 3.7%22,%0A %22Programming Language :: Python :: 3.8%22,%0A %5D,%0A description=%22Scikit-Learn API implementation for Keras.%22,%0A install_requires=requirements,%0A license=%22MIT license%22,%0A long_description=readme + %22%5Cn%5Cn%22 + history,%0A long_description_content_type=%22text/markdown%22,%0A include_package_data=True,%0A keywords=%22scikeras%22,%0A name=%22scikeras%22,%0A packages=find_packages(include=%5B%22scikeras%22, %22scikeras.*%22%5D),%0A setup_requires=setup_requirements,%0A test_suite=%22tests%22,%0A tests_require=test_requirements,%0A url=%22https://github.com/adriangb/scikeras%22,%0A version=%220.1.7%22,%0A zip_safe=False,%0A)%0A
423d16e4bc7edbc583a21155d6f3b2bc8e153cb6
Version bump
setup.py
setup.py
from setuptools import setup setup( name="funsize", version="0.52", description="Funsize Scheduler", author="Mozilla Release Engineering", packages=["funsize"], include_package_data=True, # Not zip safe because we have data files in the package zip_safe=False, entry_points={ "console_scripts": [ "funsize-scheduler = funsize.scheduler:main", ], }, install_requires=[ "amqp", "anyjson", "argparse", "cffi", # PGPy depends on this _specific_ version of cryptography "cryptography==0.6", "enum34", "kombu", "more_itertools", "PGPy", "pycparser", "PyHawk-with-a-single-extra-commit", "Jinja2", "python-jose<=0.5.6", "PyYAML", "redo", # Because taskcluster hard pins this version... "requests==2.4.3", "singledispatch", "six", "taskcluster>=0.0.26", "wsgiref", ], tests_require=[ 'hypothesis', 'pytest', 'mock', ], )
Python
0.000001
@@ -66,17 +66,17 @@ ion=%220.5 -2 +3 %22,%0A d
f0ad13539a040fe019cc299979caa5764b581faf
Add simple setuptools based build script
setup.py
setup.py
Python
0
@@ -0,0 +1,569 @@ +#!/usr/bin/env python%0Afrom setuptools import setup, find_packages%0Aimport sys%0A%0Asetup(%0A name = %22svtplay-dl%22,%0A version = %220.9.2013.03.06%22, # FIXME - extract from svtplay-dl%0A packages = find_packages(%0A 'lib',%0A exclude=%5B%22tests%22, %22*.tests%22, %22*.tests.*%22%5D),%0A package_dir = %7B'': 'lib'%7D,%0A scripts = %5B'svtplay-dl'%5D,%0A%0A author = %22Johan Andersson%22,%0A author_email = %22j@i19.se%22,%0A description = %22Command-line program to download videos from various video on demand sites%22,%0A license = %22MIT%22,%0A url = %22https://github.com/spaam/svtplay-dl%22,%0A)%0A
7fb257178f032feaa13a7761cf242f8be202b07d
Add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,1051 @@ +import sys%0Afrom setuptools import setup, find_packages%0A%0Asetup(%0A name=%22bikeshares%22,%0A version=%220.0.0%22,%0A description=%22Standardized access to the data published by bicycle sharing programs.%22,%0A long_description=%22%22,%0A classifiers=%5B%0A %22Development Status :: 3 - Alpha%22,%0A %22Intended Audience :: Developers%22,%0A %22License :: OSI Approved :: MIT License%22,%0A %22Operating System :: OS Independent%22,%0A %22Programming Language :: Python :: 2.6%22,%0A %22Programming Language :: Python :: 2.7%22,%0A %22Programming Language :: Python :: 3.3%22%0A %5D,%0A keywords=%22bikeshare citibike hubway divvy%22,%0A author=%22Jeremy Singer-Vine%22,%0A author_email=%22jsvine@gmail.com%22,%0A url=%22http://github.com/buzzfeednews/bikeshares/%22,%0A license=%22MIT%22,%0A packages=find_packages(exclude=%5B%22test%22,%5D),%0A namespace_packages=%5B%5D,%0A include_package_data=False,%0A zip_safe=False,%0A install_requires=%5B%0A %22pandas%22,%0A %5D,%0A tests_require=%5B%5D,%0A test_suite=%22test%22,%0A entry_points=%7B%0A %22console_scripts%22: %5B%0A %5D%0A %7D%0A)%0A
1f16c8d71ef550c92f3f1851a8b1a94285675eb2
add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,326 @@ +%0Afrom distutils.core import setup%0A%0Asetup(name='zencoder',%0A version='0.1',%0A description='Integration library for Zencoder',%0A author='Alex Schworer',%0A author_email='alex.schworer@gmail.com',%0A url='http://github.com/schworer/zencoder-py',%0A license=%22MIT License%22,%0A packages=%5B'zencoder'%5D%0A )%0A%0A
e5023ed11a8aff0b84b330bad2796bb28f93483b
add basic setuptools setup.py
setup.py
setup.py
Python
0
@@ -0,0 +1,1250 @@ +import os.path%0Aimport re%0Aimport subprocess%0Afrom setuptools import setup%0Afrom pip.req import parse_requirements%0A%0Aproject_root = os.path.dirname(os.path.abspath(__file__))%0Agit_version = subprocess.check_output(%5B'git', 'describe', 'HEAD', '--tags'%5D).strip().decode('utf8')%0Agit_url = 'https://raw.github.com/opmuse/opmuse/%25s/%25%25s' %25 git_version%0A%0Ainstall_requires = %5B%5D%0Adependency_links = %5B%5D%0A%0Afor install_require in parse_requirements('requirements.txt'):%0A if install_require.req is not None:%0A install_requires.append(str(install_require.req))%0A elif install_require.url is not None:%0A dependency_links.append(git_url %25 re.sub(r'%5Efile://%25s/' %25 project_root, '', install_require.url))%0A else:%0A raise Exception(%22Couldn't parse requirement from requirements.txt%22)%0A%0Asetup(%0A name=%22opmuse%22,%0A version=git_version,%0A packages=%5B'opmuse'%5D,%0A description=%22A web application to play, organize and share your music library.%22,%0A author=%22Mattias Fliesberg%22,%0A author_email=%22mattias.fliesberg@gmail.com%22,%0A url=%22http://opmu.se/%22,%0A license=%22GPLv3%22,%0A install_requires=install_requires,%0A dependency_links=dependency_links,%0A entry_points=%7B%0A 'console_scripts': %5B%0A 'opmuse = opmuse.boot'%0A %5D%0A %7D%0A)%0A
4364b952701b6ce3883094676ea9d8d93757cbde
Add bare setup.py
setup.py
setup.py
Python
0
@@ -0,0 +1,319 @@ +import os%0A%0Afrom setuptools import setup, find_packages%0A%0A%0Asetup(%0A name='django-sneak-peek',%0A version='0.0.1',%0A description='',%0A long_description='',%0A url='',%0A license='MIT',%0A author='Teddy Wing',%0A author_email='',%0A include_package_data=True,%0A packages=find_packages(),%0A classifiers=%5B%5D,%0A)
14aa0c03673abea5cbd954aafb909b581c8ce849
Add setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,749 @@ +#!/usr/bin/env python%0A%0Afrom setuptools import setup%0A%0Asetup(%0A name = %22blynk-library-python%22,%0A version = %220.1.0%22, #blynk.lib.__version__%0A description = %22Blynk library%22,%0A platforms = %22any%22,%0A url = %22http://www.blynk.cc%22,%0A license = %22MIT%22,%0A author = %22Volodymyr Shymanskyy%22,%0A author_email = %22vshymanskyi@gmail.com%22,%0A%0A py_modules = %5B'BlynkLib'%5D,%0A%0A classifiers = %5B%0A %22Topic :: Software Development :: Libraries :: Python Modules%22,%0A %22Development Status :: 2 - Pre-Alpha%22,%0A %22License :: OSI Approved :: MIT License%22,%0A %22Operating System :: POSIX :: Linux%22,%0A %22Operating System :: Microsoft :: Windows%22,%0A %22Operating System :: MacOS :: MacOS X%22%0A %5D%0A)%0A
1b96dbf3882301dbfa8d8d102f1cead2e2b0447d
bump version
setup.py
setup.py
# Copyright 2014-2015 ARM Limited # # Licensed under the Apache License, Version 2.0 # See LICENSE file for details. import os from setuptools import setup, find_packages # Utility function to cat in a file (used for the README) def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() # we need 'ntfsutils' in Windows if os.name == 'nt': platform_deps = ['ntfsutils>=0.1.3,<0.2'] entry_points={ "console_scripts": [ "yotta=yotta:main", "yt=yotta:main", ], } scripts = [] else: platform_deps = [] # entry points are nice, but add ~100ms to startup time with all the # pkg_resources infrastructure, so we use scripts= instead on unix-y # platforms: scripts = ['bin/yotta', 'bin/yt'] entry_points = {} setup( name = "yotta", version = "0.6.2", author = "James Crosby", author_email = "James.Crosby@arm.com", description = ("Re-usable components for embedded software."), license = "Apache-2.0", keywords = "embedded package module dependency management", url = "about:blank", packages=find_packages(), package_data={ 'yotta': ['lib/schema/*.json', 'lib/templates/*.txt', 'lib/templates/*.cmake'] }, long_description=read('readme.md'), classifiers=[ "Development Status :: 3 - Alpha", "Topic :: Utilities", "License :: OSI Approved :: Apache Software License", "Environment :: Console", ], entry_points=entry_points, scripts=scripts, test_suite = 'yotta.test', install_requires=[ 'semantic_version>=2.3.1,<3', 'requests>=2.4.3,<3', 'PyGithub>=1.25,<2', 'colorama>=0.3,<0.4', 'hgapi>=1.7,<2', 'Jinja2>=2.7.0,<3', 'cryptography>=0.8', 'PyJWT>=1.0,<2.0', 'pathlib>=1.0.1,<1.1', 'jsonschema>=2.4.0,<3.0', 'argcomplete>=0.8.0,<1.0', 'mbed_test_wrapper>=0.0.2,<0.1.0', 'valinor>=0.0.0,<1.0', 'intelhex>=2.0,<3.0' ] + platform_deps )
Python
0
@@ -859,11 +859,11 @@ %220. -6.2 +7.0 %22,%0A
6e601d9720139bbb04c1fd30dc6552730270ba0a
Fix the versioned Django, we're grabbing 1.4.1 off the requirements.txt
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages from billy import __version__ long_description = open('README.rst').read() setup(name='billy', version=__version__, packages=find_packages(), package_data={'billy': ['schemas/*.json', 'schemas/api/*.json', 'schemas/relax/api.rnc'], 'billy.web.admin': ['templates/billy/*.html'], }, author="James Turk", author_email="jturk@sunlightfoundation.com", license="GPL v3", url="http://github.com/sunlightlabs/billy/", description='scraping, storing, and sharing legislative information', long_description=long_description, platforms=['any'], entry_points=""" [console_scripts] billy-scrape = billy.bin.update:scrape_compat_main billy-update = billy.bin.update:main billy-util = billy.bin.util:main """, install_requires=[ "Django==1.4", "argparse==1.1", "boto", "django-piston", "icalendar", "lxml>=2.2", "name_tools>=0.1.2", "nose", "pymongo>=2.2", "scrapelib>=0.7.0", "unicodecsv", "validictory>=0.7.1", "pyes", ] )
Python
0.000002
@@ -960,17 +960,17 @@ %22Django -= +%3E =1.4%22,%0A
1eb31a433da1c684e7cace4d01705778b3a34b67
Update setup.py
setup.py
setup.py
#!/usr/bin/env python from __future__ import (absolute_import, division, print_function) import sys import warnings import numpy as np try: from setuptools import setup except ImportError: try: from setuptools.core import setup except ImportError: from distutils.core import setup from distutils.core import setup, Extension MAJOR = 0 MINOR = 0 MICRO = 1 ISRELEASED = False SNAPSHOT = False VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO) QUALIFIER = '' FULLVERSION = VERSION print(FULLVERSION) if not ISRELEASED: import subprocess FULLVERSION += '.dev' if SNAPSHOT: pipe = None for cmd in ['git', 'git.cmd']: try: pipe = subprocess.Popen([cmd, "describe", "--always", "--match", "v[0-9\/]*"], stdout=subprocess.PIPE) (so, serr) = pipe.communicate() print(so, serr) if pipe.returncode == 0: pass print('here') except: pass if pipe is None or pipe.returncode != 0: warnings.warn("WARNING: Couldn't get git revision, " "using generic version string") else: rev = so.strip() # makes distutils blow up on Python 2.7 if sys.version_info[0] >= 3: rev = rev.decode('ascii') # use result of git describe as version string FULLVERSION = VERSION + '-' + rev.lstrip('v') break else: FULLVERSION += QUALIFIER setup( name='dataportal', version=FULLVERSION, author='Brookhaven National Laboratory', packages=['dataportal', 'dataportal.api', 'dataportal.testing', 'dataportal.examples', 'dataportal.examples.sample_data', 'dataportal.broker', 'dataportal.muxer', 'dataportal.sources', 'dataportal.sources.dummy_sources', 'dataportal.replay', 'dataportal.replay.muxer', 'dataportal.replay.scalar', 'dataportal.replay.search' ], include_dirs=[np.get_include()], entry_points={ 'console_scripts': [ 'replay = dataportal.replay.replay:main']}, package_data={'dataportal.replay': ['*.enaml']}, requires=['skxray', 'pandas', 'matplotlib', 'enaml', 'bubblegum', 'pims', 'six'], )
Python
0
@@ -2371,16 +2371,192 @@ replay': + %5B'*.enaml'%5D,%0A 'dataportal.replay.muxer': %5B'*.enaml'%5D,%0A 'dataportal.replay.scalar': %5B'*.enaml'%5D,%0A 'dataportal.replay.search': %5B'*.ena
e38e0789f65e174770aeca44abec9e3e47503cbb
include user-extensions.js containing flex methods into installation
setup.py
setup.py
#!/usr/bin/env python from distutils.core import setup from os.path import abspath, dirname, join execfile(join(dirname(abspath(__file__)), 'src', 'SeleniumLibrary', 'version.py')) setup(name = 'robotframework-seleniumlibrary', version = VERSION, description = 'Web testing library for Robot Framework', author = 'Robot Framework Developers', author_email = 'robotframework-users@googlegroups.com', url = 'http://code.google.com/p/robotframework-seleniumlibrary', package_dir = {'' : 'src'}, packages = ['SeleniumLibrary'], package_data = {'SeleniumLibrary': ['lib/*.jar', 'firefoxprofile/*.*']}, )
Python
0
@@ -650,16 +650,126 @@ /*.jar', +%0A 'lib/user-extensions.js',%0A 'firefo
cd9aea1addd55be7c9d8adfb91137d9581af9317
Add minimum setup.py
setup.py
setup.py
Python
0.000001
@@ -0,0 +1,582 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0A%0Atry:%0A from setuptools import setup%0Aexcept ImportError:%0A from distutils.core import setup%0A%0A%0Asetup(%0A name='expertsender',%0A version='0.1.0',%0A description='Python API library for the ExpertSender email platform',%0A author='Gilang Chandrasa',%0A author_email='gilang@launchpotato.com',%0A url='https://github.com/gchandrasa/expertsender',%0A packages=%5B%0A 'expertsender',%0A %5D,%0A package_dir=%7B'expertsender':%0A 'expertsender'%7D,%0A install_requires=%5B%0A %22requests%22,%0A %22lxml%22,%0A %5D,%0A)%0A
dd37a333a84fb6c636a26a3d96d56925c0ec06a8
Create cleaner.py
Meteo/meteociel/cleaner.py
Meteo/meteociel/cleaner.py
Python
0.000001
@@ -0,0 +1,2070 @@ +#!/usr/bin/python%0A%0A# -*- coding: UTF-8 -*-%0A%0Adef cleaner(source):%0A %22Clean all source code to make something sweet or at least, trying to%22%0A # Brute encode to utf-8 because source code looks like a mix between iso-8859-1 and something else (kind of a joke isn't it ?)%0A # It seems to be ok but at html.fromString(trueCode) it's going crazy, it changes string's charset %0A # which is making me crazy. Doesn't matter, I have another solution ;)%0A #source = source.encode(%22utf-8%22)%0A #source = UnicodeDammit(source)%0A #source = source.unicode_markup%0A%0A # Getting the one and only useful code in all of this garbage%0A startIndex = source.index(%22%3Ctable width=100%25 border=1 cellpadding=1 cellspacing=0 bordercolor=#C0C8FE bgcolor=#EBFAF7%3E%22)%0A startingCode = source%5BstartIndex:%5D%0A endIndex = startingCode.index(%22%3C/table%3E%22)%0A trueCode = startingCode%5B:endIndex+8%5D%0A%0A # It would have been easier if it worked on this shitty website source code...%0A #print(clean_html(trueCode))%0A%0A # but instead, I have to clean this mess manually... %0A trueCode = trueCode.replace(%22%3Cbr%3E%22, %22%22)%0A trueCode = trueCode.replace(%22%3Ci%3E%22, %22%22)%0A trueCode = trueCode.replace(%22%3C/i%3E%22, %22%22)%0A trueCode = trueCode.replace(%22%3Cb%3E%22, %22%22)%0A trueCode = trueCode.replace(%22%3C/b%3E%22, %22%22)%0A trueCode = trueCode.replace(%22&nbsp;%22, %22 %22)%0A trueCode = trueCode.replace(%22&nbsp%22, %22%22)%0A trueCode = trueCode.replace(%22 align=center%22, %22%22)%0A trueCode = trueCode.replace(%22 align=%5C%22center%5C%22%22, %22%22)%0A trueCode = trueCode.replace(%22 colspan=2%22, %22%22)%0A trueCode = trueCode.replace(%22%3Cdiv%3E%22, %22%22)%0A trueCode = trueCode.replace(%22%3C/div%3E%22, %22%22)%0A%0A # Delete all units%0A trueCode = trueCode.replace(%22 hPa%22, %22%22)%0A trueCode = trueCode.replace(%22 h%22, %22%22)%0A trueCode = trueCode.replace(%22 km/h%22, %22%22)%0A trueCode = trueCode.replace(%22%25%22, %22%22)%0A trueCode = trueCode.replace(%22 km%22, %22%22)%0A trueCode = trueCode.replace(%22 aucune%22, %220%22)%0A%0A #... and apply my encoding charset solution !%0A trueCode = trueCode.replace(u%22%5Cxe9%22, %22e%22)%0A trueCode = trueCode.replace(u%22 %5Cxb0C%22, %22%22)%0A %0A return trueCode%0A
3dc5b026433795946eba623aa04d2c3c88a99281
Move the credit card test mode checking so that credit card type can be assigned
billing/gateway.py
billing/gateway.py
from django.utils.importlib import import_module from django.conf import settings class GatewayModuleNotFound(Exception): pass class GatewayNotConfigured(Exception): pass class CardNotSupported(Exception): pass class Gateway(object): """Sub-classes to inherit from this and implement the below methods""" # To indicate if the gateway is in test mode or not test_mode = getattr(settings, "MERCHANT_TEST_MODE", True) # The below are optional attributes to be implemented and used by subclases. # # Set to indicate the default currency for the gateway. default_currency = "" # Sequence of countries supported by the gateway in ISO 3166 alpha-2 format. # http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 supported_countries = [] # Sequence of supported card types by the gateway. Members should be valid # subclasses of the Credit Card object. supported_cardtypes = [] # Home page URL for the gateway. Used for information purposes only. homepage_url = "" # Name of the gateway. display_name = "" # Application name or some unique identifier for the gateway. application_id = "" def validate_card(self, credit_card): """Checks if the credit card is supported by the gateway and calls the `is_valid` method on it. Responsibility of the gateway author to use this method before every card transaction.""" # Gateways might provide some random number which # might not pass Luhn's test. if self.test_mode: return True card_supported = None for card in self.supported_cardtypes: card_supported = card.regexp.match(credit_card.number) if card_supported: credit_card.card_type = card break if not card_supported: raise CardNotSupported("This credit card is not " "supported by the gateway.") return credit_card.is_valid() def purchase(self, money, credit_card, options = {}): """One go authorize and capture transaction""" raise NotImplementedError def authorize(self, money, credit_card, options = {}): """Authorization for a future capture transaction""" raise NotImplementedError def capture(self, money, authorization, options = {}): """Capture funds from a previously authorized transaction""" raise NotImplementedError def void(self, identification, options = {}): """Null/Blank/Delete a previous transaction""" raise NotImplementedError def credit(self, money, identification, options = {}): """Refund a previously 'settled' transaction""" raise NotImplementedError def recurring(self, money, creditcard, options = {}): """Setup a recurring transaction""" raise NotImplementedError def store(self, creditcard, options = {}): """Store the credit card and user profile information on the gateway for future use""" raise NotImplementedError def unstore(self, identification, options = {}): """Delete the previously stored credit card and user profile information on the gateway""" raise NotImplementedError def get_gateway(gateway, *args, **kwargs): """Return a gateway instance specified by `gateway` name""" gateway_filename = "%s_gateway" %gateway gateway_module = None for app in settings.INSTALLED_APPS: try: gateway_module = import_module(".gateways.%s" %gateway_filename, package=app) except ImportError: pass if not gateway_module: raise GatewayModuleNotFound("Missing gateway") gateway_class_name = "".join(gateway_filename.title().split("_")) try: return getattr(gateway_module, gateway_class_name)(*args, **kwargs) except AttributeError: raise GatewayNotConfigured("Missing %s class in the gateway module." %gateway_class_name)
Python
0.000001
@@ -1427,155 +1427,8 @@ %22%22%22%0A - # Gateways might provide some random number which%0A # might not pass Luhn's test.%0A if self.test_mode:%0A return True %0A @@ -1821,16 +1821,163 @@ eway.%22)%0A + # Gateways might provide some random number which%0A # might not pass Luhn's test.%0A if self.test_mode:%0A return True %0A
7736c11b005f9baefc7ba9c35884deddc56bc191
Test file to check if twistd is working
test.tac
test.tac
Python
0
@@ -0,0 +1,223 @@ +from twisted.application import internet, service%0Afrom hubbebot import *%0A%0Aapplication = service.Application(%22AllTheHubbeBots%22)%0A%0Ainternet.TCPClient(%22irc.desertbus.org%22, 6667, HubbeBotFactory()).setServiceParent(application)%0A
24e914da9e0e38728d862ecc82f8443a3b88e68f
add expression to improve the domain
bin/tools/expression.py
bin/tools/expression.py
Python
0.00123
@@ -0,0 +1,2114 @@ +#!/usr/bin/env python%0A%0Adef _is_operator( element ):%0A return isinstance( element, str ) and element in %5B'&','%7C'%5D%0A%0Adef _is_leaf( element ):%0A return isinstance( element, tuple ) and len( element ) == 3 and element%5B1%5D in %5B'=', '%3C%3E', '!=', '%3C=', '%3C', '%3E', '%3E=', 'like', 'not like', 'ilike', 'not ilike'%5D %0A%0Adef _is_expression( element ):%0A return isinstance( element, tuple ) and len( element ) %3E 2 and _is_operator( element%5B0%5D )%0A%0Aclass expression_leaf( object ):%0A def __init__(self, operator, left, right ):%0A self.operator = operator%0A self.left = left%0A self.right = right%0A%0A def parse( self ):%0A return self%0A%0A def to_sql( self ):%0A return %22%25s %25s %25s%22 %25 ( self.left, self.operator, self.right )%0A%0Aclass expression( object ):%0A def __init__( self, exp ):%0A if isinstance( exp, tuple ):%0A if not _is_leaf( exp ) and not _is_operator( exp%5B0%5D ):%0A exp = list( exp )%0A if isinstance( exp, list ):%0A if len( exp ) == 1 and _is_leaf( exp%5B0%5D ):%0A exp = exp%5B0%5D%0A else:%0A if not _is_operator( exp%5B0%5D%5B0%5D ):%0A exp.insert( 0, '&' )%0A exp = tuple( exp )%0A else:%0A exp = exp%5B0%5D%0A%0A self.exp = exp%0A self.operator = '&'%0A self.children = %5B%5D%0A%0A def parse( self ):%0A if _is_leaf( self.exp ):%0A self.children.append( expression_leaf( self.exp%5B1%5D, self.exp%5B0%5D, self.exp%5B2%5D ).parse() )%0A elif _is_expression( self.exp ):%0A self.operator = self.exp%5B0%5D%0A%0A for element in self.exp%5B1:%5D:%0A if not _is_operator( element ) and not _is_leaf(element):%0A self.children.append( expression(element).parse() )%0A else:%0A if _is_leaf(element):%0A self.children.append( expression_leaf( element%5B1%5D, element%5B0%5D, element%5B2%5D ).parse() )%0A return self%0A%0A def to_sql( self ):%0A return %22( %25s )%22 %25 ((%22 %25s %22 %25 %7B'&' : 'AND', '%7C' : 'OR' %7D%5Bself.operator%5D).join(%5Bchild.to_sql() for child in self.children%5D))%0A
9ad2ca99f9902f8d6ebd7f794251434692006081
Add commented-out page change list replacement settings to example project
example/settings.py
example/settings.py
# Django settings for example project. import os DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'sqlite3' DATABASE_NAME = 'example.db' TIME_ZONE = 'America/Chicago' LANGUAGE_CODE = 'en-us' SITE_ID = 1 USE_I18N = True MEDIA_ROOT = os.path.join(os.path.dirname(__file__), 'media/') MEDIA_URL = '/media/' ADMIN_MEDIA_PREFIX = '/admin_media/' FEINCMS_ADMIN_MEDIA = '/feincms_media/' SECRET_KEY = '_wn95s-apfd-442cby5m^_^ak6+5(fyn3lvnvtn7!si&o)1x^w' TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.auth', 'django.core.context_processors.debug', 'django.core.context_processors.i18n', 'django.core.context_processors.media', 'django.core.context_processors.request', ) TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.load_template_source', 'django.template.loaders.app_directories.load_template_source', ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', ) ROOT_URLCONF = 'example.urls' TEMPLATE_DIRS = ( ) INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'feincms', 'feincms.module.blog', 'feincms.module.page', 'feincms.module.medialibrary', 'example', 'mptt', ) COVERAGE_MODULES = ['feincms.admin.editor', 'feincms.admin.item_editor', #'feincms.admin.splitpane_editor', # cannot be tested at the same time as the # tree editor currently 'feincms.admin.tree_editor', 'feincms.content.application.models', 'feincms.content.contactform.models', 'feincms.content.file.models', 'feincms.content.image.models', 'feincms.content.medialibrary.models', 'feincms.content.raw.models', 'feincms.content.richtext.cleanse', 'feincms.content.richtext.models', 'feincms.content.rss.models', 'feincms.content.video.models', 'feincms.models', 'feincms.module.blog.admin', 'feincms.module.blog.extensions.seo', #'feincms.module.blog.extensions.tags', # I don't have tagging installed here... 'feincms.module.blog.extensions.translations', 'feincms.module.blog.models', 'feincms.module.medialibrary.admin', 'feincms.module.medialibrary.models', 'feincms.module.page.admin', 'feincms.module.page.extensions.changedate', 'feincms.module.page.extensions.datepublisher', 'feincms.module.page.extensions.navigation', 'feincms.module.page.extensions.seo', 'feincms.module.page.extensions.symlinks', 'feincms.module.page.extensions.titles', 'feincms.module.page.extensions.translations', 'feincms.module.page.models', 'feincms.module.page.templatetags.feincms_page_tags', 'feincms.settings', 'feincms.templatetags.applicationcontent_tags', 'feincms.templatetags.feincms_tags', 'feincms.translations', 'feincms.utils', 'feincms.views.applicationcontent', 'feincms.views.base', 'feincms.views.decorators', ] try: # see http://nedbatchelder.com/code/coverage/ import coverage TEST_RUNNER = 'example.test_utils.test_runner_with_coverage' except ImportError: # run without coverage support pass LANGUAGES = ( ('en', 'English'), ('de', 'German'), )
Python
0
@@ -4143,8 +4143,215 @@ ,%0A )%0A +%0A# Activate either of these (but not both) to check out another%0A# possibility to select pages in the administration interface:%0A#FEINCMS_PAGE_USE_SPLIT_PANE_EDITOR = True%0A#FEINCMS_PAGE_USE_CHANGE_LIST = True%0A
8a86c1c9bec625b58c2dc4914837b2e3a0ef175c
Add FDIC
inspectors/fdic.py
inspectors/fdic.py
Python
0.000149
@@ -0,0 +1,2161 @@ +#!/usr/bin/env python%0A%0Aimport datetime%0Aimport logging%0Aimport os%0Afrom urllib.parse import urljoin%0A%0Afrom bs4 import BeautifulSoup%0Afrom utils import utils, inspector%0A%0A# http://www.fdicoig.gov%0A# Oldest report: 1998%0A%0A# options:%0A# standard since/year options for a year range to fetch from.%0A#%0A# Notes for IG's web team:%0A#%0A%0AREPORTS_URL = %22http://www.fdicoig.gov/Search-Engine.asp%22%0A%0Adef run(options):%0A year_range = inspector.year_range(options)%0A%0A # Pull the reports%0A doc = BeautifulSoup(utils.download(REPORTS_URL))%0A results = doc.find(%22table%22, %7B%22cellpadding%22: %225%22%7D).select(%22tr%22)%0A for index, result in enumerate(results):%0A if index %3C 3 or not result.text.strip():%0A # The first three rows are headers%0A continue%0A report = report_from(result, year_range)%0A if report:%0A inspector.save_report(report)%0A%0Adef report_from(result, year_range):%0A title = result.find(%22em%22).text.strip()%0A%0A unreleased = False%0A try:%0A report_url = urljoin(REPORTS_URL, result.select(%22a%22)%5B-1%5D.get(%22href%22))%0A except IndexError:%0A unreleased = True%0A report_url = None%0A landing_url = REPORTS_URL%0A%0A if report_url:%0A report_filename = report_url.split(%22/%22)%5B-1%5D%0A report_id, extension = os.path.splitext(report_filename)%0A else:%0A report_id = %22-%22.join(title.split())%5B:50%5D%0A%0A published_on_text = result.select(%22td%22)%5B2%5D.text%0A try:%0A published_on = datetime.datetime.strptime(published_on_text, '%25m/%25d/%25Y')%0A except ValueError:%0A logging.debug(%22%5B%25s%5D Skipping since all real reports have published dates and this does not%22 %25 report_url)%0A return%0A%0A if published_on.year not in year_range:%0A logging.debug(%22%5B%25s%5D Skipping, not in requested range.%22 %25 report_url)%0A return%0A%0A report = %7B%0A 'inspector': %22fdic%22,%0A 'inspector_url': %22http://www.fdicoig.gov%22,%0A 'agency': %22fdic%22,%0A 'agency_name': %22Federal Deposit Insurance Corporation%22,%0A 'report_id': report_id,%0A 'url': report_url,%0A 'title': title,%0A 'published_on': datetime.datetime.strftime(published_on, %22%25Y-%25m-%25d%22),%0A %7D%0A if unreleased:%0A report%5B'unreleased'%5D = unreleased%0A report%5B'landing_url'%5D = landing_url%0A return report%0A%0Autils.run(run) if (__name__ == %22__main__%22) else None%0A
cec3eebace1ad5f236761bdd98bef0d5ac52d3ba
Replace list-to-set cast with normal set literal
cura/Settings/MaterialSettingsVisibilityHandler.py
cura/Settings/MaterialSettingsVisibilityHandler.py
# Copyright (c) 2016 Ultimaker B.V. # Uranium is released under the terms of the AGPLv3 or higher. from UM.Settings.Models.SettingVisibilityHandler import SettingVisibilityHandler class MaterialSettingsVisibilityHandler(SettingVisibilityHandler): def __init__(self, parent = None, *args, **kwargs): super().__init__(parent = parent, *args, **kwargs) material_settings = set([ "default_material_print_temperature", "material_bed_temperature", "material_standby_temperature", "cool_fan_speed", "retraction_amount", "retraction_speed", ]) self.setVisible(material_settings)
Python
0
@@ -16,9 +16,9 @@ 201 -6 +7 Ult @@ -390,13 +390,9 @@ s = -set(%5B +%7B %0A @@ -629,10 +629,9 @@ -%5D) +%7D %0A%0A
8094267faf7a9cdbd1520383f51e537e159cdca2
Add unit column unit tests.
tests.py
tests.py
Python
0
@@ -0,0 +1,3498 @@ +# -*- coding: utf-8 -*-%0A%22%22%22 Test relation columns.%0A%22%22%22%0A%0Aimport math%0Aimport uuid%0Afrom unittest import TestCase%0A%0Aimport arrow%0Afrom cqlengine import columns%0Afrom cqlengine.models import Model%0A%0A%0Adef truncate_to_milliseconds(date_time):%0A %22%22%22 Truncate datetime to milliseconds and return an arrow object.%0A%0A Used to emulate cqlengine's datetime conversion from Python to Cassandra.%0A %22%22%22%0A date_time = arrow.get(date_time)%0A milliseconds = math.trunc(date_time.microsecond / 1000.0) * 1000%0A return date_time.replace(microsecond=milliseconds)%0A%0A%0Aclass TestCompositeRelationColumn(TestCase):%0A%0A def test_column_io(self):%0A%0A class ForeignModel(Model):%0A organization = columns.Text(partition_key=True)%0A start_date = columns.DateTime(primary_key=True)%0A key = columns.UUID(primary_key=True, default=uuid.uuid4)%0A info = columns.Text()%0A%0A class TestCompositeRelationColumn(Model):%0A key = columns.UUID(primary_key=True, default=uuid.uuid4)%0A foreign_key = columns.CompositeRelation(model='ForeignModel')%0A%0A self.assertEquals(ForeignModel.objects.count(), 0)%0A self.assertEquals(TestCompositeRelationColumn.objects.count(), 0)%0A%0A now = arrow.utcnow()%0A%0A # Check initial value%0A test_instance = TestCompositeRelationColumn.create()%0A self.assertEquals(test_instance.foreign_key, %7B%7D)%0A%0A # Check proper transformation of instance's primary key component's%0A # values into a dict.%0A foreign_instance = ForeignModel.create(%0A organization='Dummy organization',%0A start_date=now,%0A )%0A test_instance.update(foreign_key=foreign_instance)%0A self.assertIsInstance(test_instance.foreign_key, dict)%0A # Test serialization to raw strings.%0A self.assertEquals(test_instance.foreign_key, %7B%0A 'organization': foreign_instance.organization,%0A 'start_date': str(long(truncate_to_milliseconds(%0A foreign_instance.start_date).float_timestamp * 1000)),%0A 'key': str(foreign_instance.key),%0A %7D)%0A # CompositeRelation column doesn't cast primary keys components on the%0A # fly. It needs reload.%0A test_instance = TestCompositeRelationColumn.get(test_instance.key)%0A self.assertIsInstance(test_instance.foreign_key, dict)%0A self.assertEquals(test_instance.foreign_key, %7B%0A 'organization': foreign_instance.organization,%0A 'start_date': truncate_to_milliseconds(%0A foreign_instance.start_date),%0A 'key': foreign_instance.key,%0A %7D)%0A%0A # Check that CompositeRelation deserialize primary key components into%0A # their original types.%0A self.assertIsInstance(test_instance.foreign_key%5B'organization'%5D,%0A basestring)%0A self.assertIsInstance(test_instance.foreign_key%5B'start_date'%5D,%0A arrow.arrow.Arrow)%0A self.assertIsInstance(test_instance.foreign_key%5B'key'%5D,%0A uuid.UUID)%0A%0A # Check that a related object can be fetched from the raw dict%0A fetched_model = ForeignModel.filter(**test_instance.foreign_key).get()%0A self.assertDictContainsSubset(%7B%0A 'organization': foreign_instance.organization,%0A 'start_date': truncate_to_milliseconds(%0A foreign_instance.start_date),%0A 'key': foreign_instance.key,%0A %7D, dict(fetched_model.items()))%0A
71f073ca40459c56ce666650af982a9f08d613f1
Add support for PodDisruptionBudget
k8s/models/pod_disruption_budget.py
k8s/models/pod_disruption_budget.py
Python
0
@@ -0,0 +1,881 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8%0Afrom __future__ import absolute_import%0A%0Aimport six%0A%0Afrom .common import ObjectMeta%0Afrom ..base import Model%0Afrom ..fields import Field, ListField%0A%0A%0Aclass PodDisruptionBudgetMatchExpressions(Model):%0A key = Field(six.text_type)%0A operator = Field(six.text_type)%0A values = ListField(six.text_type)%0A%0A%0Aclass PodDisruptionBudgetSelector(Model):%0A matchExpressions = Field(PodDisruptionBudgetMatchExpressions)%0A matchLabels = Field(dict)%0A%0A%0Aclass PodDisruptionBudgetSpec(Model):%0A minAvailable = Field(six.text_type)%0A maxUnavailable = Field(six.text_type)%0A selector = Field(PodDisruptionBudgetSelector)%0A%0A%0Aclass PodDisruptionBudget(Model):%0A class Meta:%0A url_template = %22/apis/autoscaling/v1/namespaces/%7Bnamespace%7D/poddisruptionbudget/%7Bname%7D%22%0A%0A metadata = Field(ObjectMeta)%0A spec = Field(PodDisruptionBudgetSpec)%0A
4c46b7b86171b89f0c85f6d48eaf6d24e702c6f9
Add a Tasks sample that demonstrates Service accounts.
samples/service_account/tasks.py
samples/service_account/tasks.py
Python
0.011664
@@ -0,0 +1,2084 @@ +#!/usr/bin/python2.4%0A# -*- coding: utf-8 -*-%0A#%0A# Copyright (C) 2012 Google Inc.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS,%0A# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A# See the License for the specific language governing permissions and%0A# limitations under the License.%0A%0A%22%22%22Simple command-line sample that demonstrates service accounts.%0A%0ALists all the Google Task Lists associated with the given service account.%0AService accounts are created in the Google API Console. See the documentation%0Afor more information:%0A%0A https://developers.google.com/console/help/#WhatIsKey%0A%0AUsage:%0A $ python tasks.py%0A%22%22%22%0A%0A__author__ = 'jcgregorio@google.com (Joe Gregorio)'%0A%0Aimport httplib2%0Aimport pprint%0Aimport sys%0A%0Afrom apiclient.discovery import build%0Afrom oauth2client.client import SignedJwtAssertionCredentials%0A%0Adef main(argv):%0A # Load the key in PKCS 12 format that you downloaded from the Google API%0A # Console when you created your Service account.%0A f = file('key.p12', 'rb')%0A key = f.read()%0A f.close()%0A%0A # Create an httplib2.Http object to handle our HTTP requests and authorize it%0A # with the Credentials. Note that the first parameter, service_account_name,%0A # is the Email address created for the Service account. It must be the email%0A # address associated with the key that was created.%0A credentials = SignedJwtAssertionCredentials(%0A '141491975384@developer.gserviceaccount.com',%0A key,%0A scope='https://www.googleapis.com/auth/tasks')%0A http = httplib2.Http()%0A http = credentials.authorize(http)%0A%0A service = build(%22tasks%22, %22v1%22, http=http)%0A%0A # List all the tasklists for the account.%0A lists = service.tasklists().list().execute(http)%0A pprint.pprint(lists)%0A%0A%0Aif __name__ == '__main__':%0A main(sys.argv)%0A
b541d4c9ab1d7f199cc551179f454c5c3a53625f
add tests for "patch" command
rhcephpkg/tests/test_patch.py
rhcephpkg/tests/test_patch.py
Python
0.000007
@@ -0,0 +1,1082 @@ +import os%0Aimport pytest%0Afrom rhcephpkg import Patch%0A%0ATESTS_DIR = os.path.dirname(os.path.abspath(__file__))%0AFIXTURES_DIR = os.path.join(TESTS_DIR, 'fixtures')%0A%0A%0Aclass FakePatch(object):%0A pass%0A%0A%0Aclass TestPatch(object):%0A%0A def test_wrong_branch(self, monkeypatch):%0A monkeypatch.setenv('HOME', FIXTURES_DIR)%0A monkeypatch.setattr('rhcephpkg.util.current_branch',%0A lambda: 'ceph-2-ubuntu')%0A patch = Patch(())%0A with pytest.raises(SystemExit) as e:%0A patch._run()%0A assert str(e.value) == 'ceph-2-ubuntu is not a patch-queue branch'%0A%0A def test_get_rhbzs(self, monkeypatch):%0A p = Patch(())%0A fakepatch = FakePatch()%0A fakepatch.subject = 'my git change'%0A fakepatch.long_desc = 'my long description about this change'%0A bzs = p.get_rhbzs(fakepatch)%0A assert len(bzs) == 0%0A # TODO: more tests here, for commits that really contain RHBZs.%0A%0A # TODO: more tests, faking check_call and check_output, to verify that%0A # we're running the proper gbp and git commands.%0A
ed27c75a2d3400955d8e3e85d08d480db3fd3657
Add generate_vocab script
seq2seq/scripts/generate_vocab.py
seq2seq/scripts/generate_vocab.py
Python
0.000001
@@ -0,0 +1,2023 @@ +#! /usr/bin/env python%0A#pylint: disable=invalid-name%0A%0A%22%22%22%0AGenerate vocabulary for a tokenized text file.%0A%22%22%22%0A%0Aimport argparse%0Aimport collections%0A%0Aparser = argparse.ArgumentParser(description=%22Generate vocabulary for a tokenized text file.%22)%0Aparser.add_argument(%22--input_file%22, type=str, help=%22path to the input file%22, required=True)%0Aparser.add_argument(%22--output_file%22, type=str, help=%22path to the vocabulary file%22, required=True)%0Aparser.add_argument(%22--min_frequency%22, dest=%22min_frequency%22, type=int, default=0,%0A help=%22Minimum frequency of a word to be included in the vocabulary.%22)%0Aparser.add_argument(%22--max_vocab_size%22, dest=%22max_vocab_size%22, type=int,%0A help=%22Maximum number of words in the vocabulary%22)%0Aparser.add_argument(%22--downcase%22, dest=%22downcase%22, type=bool,%0A help=%22If set to true, downcase all text before processing.%22, default=False)%0A%0Aargs = parser.parse_args()%0A%0A# Counter for all words in the vocabulary%0Acnt = collections.Counter()%0A%0Awith open(args.input_file) as f:%0A for line in f:%0A if args.downcase:%0A line = line.lower()%0A tokens = line.strip().split(%22 %22)%0A cnt.update(tokens)%0A%0Aprint(%22Found %7B%7D unique words in the vocabulary.%22.format(len(cnt)))%0A%0A# Filter words below the frequency threshold%0Aif args.min_frequency %3E 0:%0A filtered_words = %5B(w, c) for w, c in cnt.most_common() if c %3E args.min_frequency%5D%0A cnt = collections.Counter(dict(filtered_words))%0A%0Aprint(%22Found %7B%7D unique words with frequency %3E %7B%7D.%22.format(len(cnt), args.min_frequency))%0A%0A# Sort words by 1. frequency 2. lexically to break ties%0Aword_with_counts = cnt.most_common()%0Aword_with_counts = sorted(word_with_counts, key=lambda x: (x%5B1%5D, x%5B0%5D), reverse=True)%0A%0A# Take only max-vocab%0Aif args.max_vocab_size is not None:%0A word_with_counts = word_with_counts%5B:args.max_vocab_size%5D%0A%0Awith open(args.output_file, %22w%22) as f:%0A for word, count in word_with_counts:%0A f.write(%22%7B%7D%5Cn%22.format(word))%0A%0Aprint(%22Wrote vocab of size %7B%7D: %7B%7D%22.format(len(word_with_counts), args.output_file))%0A
21eac65d8a252e9d3cc83d97a9f270ef0078be9c
add indexer
indexer.py
indexer.py
Python
0.000002
@@ -0,0 +1,2300 @@ +# -*- coding: utf-8 -*-%0Aimport json%0Aimport os%0Aimport argparse%0Aimport sys%0Aimport re%0A%0Aclass Indexer:%0A def __init__(self):%0A self.forward_index = dict()%0A%0A def create_index(self, raw_data, keyword):%0A keyword_utf8 = keyword.decode('utf-8')%0A if not self.forward_index.has_key(keyword_utf8):%0A self.forward_index%5Bkeyword_utf8%5D = dict()%0A self.forward_index%5Bkeyword_utf8%5D%5B'positive'%5D = list()%0A self.forward_index%5Bkeyword_utf8%5D%5B'negative'%5D = list()%0A self.forward_index%5Bkeyword_utf8%5D%5B'others'%5D = list()%0A%0A for data in raw_data:%0A if keyword_utf8 in data%5B1%5D:%0A if '%E5%A5%BD%E9%9B%B7'.decode('utf-8') in data%5B1%5D:%0A self.forward_index%5Bkeyword_utf8%5D%5B'positive'%5D.append((data%5B0%5D, data%5B1%5D))%0A elif '%E8%B2%A0%E9%9B%B7'.decode('utf-8') in data%5B1%5D:%0A self.forward_index%5Bkeyword_utf8%5D%5B'negative'%5D.append((data%5B0%5D, data%5B1%5D))%0A else:%0A self.forward_index%5Bkeyword_utf8%5D%5B'others'%5D.append((data%5B0%5D, data%5B1%5D))%0A%0A def load_data_from_file(self, dirname, filename):%0A if os.path.exists(os.path.join(dirname, filename)):%0A with open(os.path.join(dirname, filename), 'r') as readfile:%0A self.raw_data = json.load(readfile)%0A%0A def get_index(self, keyword, search_type):%0A keyword_utf8 = keyword.decode('utf-8')%0A if self.forward_index.has_key(keyword_utf8):%0A if search_type in ('positive', 'negative', 'others'):%0A for result in self.forward_index%5Bkeyword_utf8%5D%5Bsearch_type%5D:%0A print %22Title %7B%7D, Link %7B%7D%22.format(result%5B1%5D.encode('utf-8'), result%5B0%5D.encode('utf-8'))%0A else:%0A return None%0A%0Aif __name__ == '__main__':%0A arguments = argparse.ArgumentParser()%0A arguments.add_argument('--dirname', help='directory name')%0A arguments.add_argument('--filename', help='filename')%0A arguments.add_argument('--keyword', help='keyword to create index')%0A args = arguments.parse_args()%0A%0A indexer = Indexer()%0A if os.path.exists(os.path.join(args.dirname, args.filename)):%0A with open(os.path.join(args.dirname, args.filename), 'r') as readfile:%0A data = json.load(readfile)%0A indexer.create_index(data, args.keyword)%0A else:%0A sys.exit()%0A
37e87ad6eed85e83a2199f851e8b07135d779909
Add wsgi script
DiscourseSSO.wsgi
DiscourseSSO.wsgi
Python
0.000001
@@ -0,0 +1,1273 @@ +# Copyright 2015 INFN%0A# All Rights Reserved.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22); you may%0A# not use this file except in compliance with the License. You may obtain%0A# a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by applicable law or agreed to in writing, software%0A# distributed under the License is distributed on an %22AS IS%22 BASIS, WITHOUT%0A# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the%0A# License for the specific language governing permissions and limitations%0A# under the License.%0A%0A%22%22%22%0AWSGI script to run the application.%0AConfigure the environment variable DISCOURSE_SSO_CONFIG in order to read the%0Aconfiguration file with the variables:%0A - DISCOURSE_URL: Discourse URL to send the user back%0A - DISCOURSE_SECRET_KEY: Secret key shared with the Discourse server%0A - DISCOURSE_USER_MAP: Attribute to read from the environment after user%0A validation%0A - All Flask configuration values%0A%0ATo run in a virtual environment add the activation code. Es.:%0A activate_this = '/path/to/env/bin/activate_this.py'%0A execfile(activate_this, dict(__file__=activate_this))%0A%22%22%22%0A%0A%0Afrom sso import app as application%0A
261b2879c830aeaa21351c34a78dc0b5262436c2
Create 7kyu_simple_fun138_similarity.py
Solutions/7kyu/7kyu_simple_fun138_similarity.py
Solutions/7kyu/7kyu_simple_fun138_similarity.py
Python
0.998424
@@ -0,0 +1,85 @@ +def similarity(a, b):%0A return len(set(a).intersection(set(b)))/len(set(a)%7Cset(b))%0A
c5427bc00678e9f9122b8201b79af2ab454288f3
Create popServer.py
popServer.py
popServer.py
Python
0.000001
@@ -0,0 +1,1016 @@ +__author__ = 'JontyHome'%0Aimport poplib%0A%0A%0Aclass popServer():%0A # host = ''%0A # username = ''%0A # password = ''%0A # port = 0%0A%0A%0A def __init__(self, username, password, host, port):%0A self.host = host%0A self.username = username%0A self.password = password%0A self.port = port%0A self.mailbox = poplib.POP3_SSL(self.host,self.port)%0A self.mailbox.user(self.username)%0A self.mailbox.pass_(self.password)%0A self.mailbox.set_debuglevel(1)%0A%0A def close_server(self):%0A self.mailbox.quit()%0A%0A def get_status(self):%0A serverstatus = self.mailbox.stat()%0A return serverstatus%0A%0A def get_messages(self):%0A return self.mailbox.list()%0A%0A def display_message(self,index):%0A (server_msg, body, octets) = self.mailbox.retr(index)%0A self.debug(200, %22Server Message: %22 , server_msg)%0A self.debug(200, %22Number of Octets: %22 , octets)%0A self.debug(200, %22Message body:%22)%0A for line in body:%0A print line%0A
eaf59371ea4ec9d5ceb98331c1a4b58a54558d3b
Solve Ch3_Q5 - Implement queue using two stacks
fourth_edition/ch3_stacks_and_queues/python/3.5.py
fourth_edition/ch3_stacks_and_queues/python/3.5.py
Python
0.000039
@@ -0,0 +1,1255 @@ +'''%0AImplement a MyQueue class which implements a queue using two stacks.%0A'''%0A%0A%0Astack1 = list()%0Astack2 = list()%0Amax_ = 10%0A%0A%0Adef push(val):%0A global stack1, stack2%0A if len(stack1) == max_:%0A if len(stack2) == 0:%0A for x in stack1%5B::-1%5D:%0A stack2.append(x)%0A stack1 = %5B%5D%0A else:%0A return %22Queue Full!%22%0A stack1.append(val)%0A%0A%0Adef pop():%0A global stack1, stack2%0A if len(stack2) == 0:%0A if len(stack1) %3E 0:%0A stack2 = stack1%0A stack1 = %5B%5D%0A else:%0A return %22Queue Empty%22%0A return stack2.pop(-1)%0A%0A%0Adef queue(val):%0A # Call the push%0A global stack1, stack2%0A push(val)%0A # print(stack1, stack2)%0A%0A%0Adef dequeue():%0A # Call the pop%0A global stack1, stack2%0A pop_out = pop()%0A # print(stack1, stack2)%0A return pop_out%0A%0A%0Aqueue(10)%0Aqueue(20)%0Aqueue(30)%0Aqueue(40)%0Aqueue(50)%0Aqueue(60)%0Aqueue(70)%0Aqueue(80)%0Aqueue(90)%0Aqueue(100)%0Aqueue(110)%0Aqueue(120)%0Aqueue(130)%0A%0Aprint(dequeue())%0Aprint(dequeue())%0Aprint(dequeue())%0Aprint(dequeue())%0Aprint(dequeue())%0Aprint(dequeue())%0Aprint(dequeue())%0Aprint(dequeue())%0Aprint(dequeue())%0Aprint(dequeue())%0Aprint(dequeue())%0A%0Aqueue(140)%0A%0Aprint(dequeue())%0Aprint(dequeue())%0Aprint(dequeue())%0Aprint(dequeue())%0A%0Aqueue(150)%0A%0A%0A%0A
73b6be31b8ddbdb8e266f63c4e9df0fc1d8403e2
Set CpuAcctCgroupCollector disabled by default
src/collectors/cpuacct_cgroup/cpuacct_cgroup.py
src/collectors/cpuacct_cgroup/cpuacct_cgroup.py
# coding=utf-8 """ The CpuAcctCGroupCollector collects CPU Acct metric for cgroups #### Dependencies /sys/fs/cgroup/cpuacct/cpuacct.stat """ import diamond.collector import os class CpuAcctCgroupCollector(diamond.collector.Collector): CPUACCT_PATH = '/sys/fs/cgroup/cpuacct/' def get_default_config_help(self): config_help = super( CpuAcctCgroupCollector, self).get_default_config_help() config_help.update({ }) return config_help def get_default_config(self): """ Returns the default collector settings """ config = super(CpuAcctCgroupCollector, self).get_default_config() config.update({ 'enabled': 'True', 'path': 'cpuacct', 'xenfix': None, }) return config def collect(self): # find all cpuacct.stat files matches = [] for root, dirnames, filenames in os.walk(self.CPUACCT_PATH): for filename in filenames: if filename == 'cpuacct.stat': # matches will contain a tuple contain path to cpuacct.stat # and the parent of the stat parent = root.replace(self.CPUACCT_PATH, "").replace("/", ".") if parent == '': parent = 'system' matches.append((parent, os.path.join(root, filename))) # Read utime and stime from cpuacct files results = {} for match in matches: results[match[0]] = {} stat_file = open(match[1]) elements = [line.split() for line in stat_file] for el in elements: results[match[0]][el[0]] = el[1] stat_file.close() # create metrics from collected utimes and stimes for cgroups for parent, cpuacct in results.iteritems(): for key, value in cpuacct.iteritems(): metric_name = '.'.join([parent, key]) self.publish(metric_name, value, metric_type='GAUGE') return True
Python
0
@@ -712,19 +712,20 @@ led': ' -Tru +Fals e',%0A