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 |
|---|---|---|---|---|---|---|---|
9afb9954f5d58fe051f60bd336a39d794699d405 | add a demo that plots a comparison of threshold types | demo/plot_thresholds.py | demo/plot_thresholds.py | Python | 0 | @@ -0,0 +1,994 @@
+import numpy as np%0Aimport matplotlib.pyplot as plt%0Aimport pywt%0A%0As = np.linspace(-4, 4, 1000)%0A%0As_soft = pywt.threshold(s, value=0.5, mode='soft')%0As_hard = pywt.threshold(s, value=0.5, mode='hard')%0As_garotte = pywt.threshold(s, value=0.5, mode='garotte')%0As_firm1 = pywt.threshold_firm(... | |
e1b32cdd95c8a11cb492d27d9ac11a46c4037f2e | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,1028 @@
+# -*- coding: utf-8 -*-%0A%0Afrom setuptools import setup, find_packages%0Aimport rdd%0A%0Asetup(name='rdd',%0A version=rdd.__version__,%0A author='Mathias Lafeldt',%0A author_email='mathias.lafeldt@gmail.com',%0A url='https://github.com/mlafeldt/rdd.py',%0A license='MIT',%0... | |
d78e3ba37cb2c88300d1e96010e79c6e4329f720 | bump version to 0.3 | setup.py | setup.py | from setuptools import setup, find_packages
setup(name='hubstorage',
version='0.2',
license='BSD',
description='Client interface for Scrapinghub HubStorage',
author='Scrapinghub',
author_email='info@scrapinghub.com',
url='http://scrapinghub.com',
platforms = ['Any'],
pac... | Python | 0 | @@ -84,9 +84,9 @@
='0.
-2
+3
',%0A
|
9238e229c63b32e35b46508959450e97901b46ab | Add package setup. | setup.py | setup.py | Python | 0 | @@ -0,0 +1,854 @@
+import glob%0Afrom distutils.core import setup%0A%0A%0Arequires = %5B'pydicom'%5D%0A%0Asetup(%0A name = 'qipipe',%0A version = '1.1.1',%0A author = 'Fred Loney',%0A author_email = 'loneyf@ohsu.edu',%0A packages = find_packages('lib'),%0A package_dir = %7B'':'lib'%7D%0A scripts = ... | |
cd596bd419352d95fb31aab7116a1dddb061828c | add a setup.py for the trait_documenter package | setup.py | setup.py | Python | 0 | @@ -0,0 +1,927 @@
+#----------------------------------------------------------------------------%0A#%0A# Copyright (c) 2014, Enthought, Inc.%0A# All rights reserved.%0A#%0A# This software is provided without warranty under the terms of the BSD%0A# license included in /LICENSE.txt and may be redistributed only%0A# ... | |
d611af5a613e444c0c31c269aa382f0996c375d9 | Add setup.py from h3's fork | setup.py | setup.py | Python | 0 | @@ -0,0 +1,538 @@
+%22%22%22%0Adjango-jquery-file-upload%0A%22%22%22%0A%0Afrom setuptools import setup, find_packages%0A%0Asetup(%0A name = %22django-jquery-file-upload%22,%0A version = %220.0.1%22,%0A url = %22%22,%0A license = %22The MIT License (MIT)%22,%0A description = %22A minimal django project co... | |
5ce21100b42dad13815d21cd3fae9a2710756314 | add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,589 @@
+#!/usr/bin/env python%0A%0A%22%22%22%0ACreated by: Lee Bergstrand (2018)%0A%0ADescription: Setup for installing pygenprop.%0A%22%22%22%0A%0Afrom setuptools import setup%0A%0Asetup(name='pygenprop',%0A version='0.1',%0A description='A python library for programmatic usage of EBI InterPro Gen... | |
b9a23638d4cf6cc692a2dce3d42268ca73343493 | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,692 @@
+#!/usr/bin/env python%0A# coding=utf-8%0A%0Afrom setuptools import setup%0A%0Asetup(%0A name='alfred-workflow-packager',%0A version='0.8b',%0A description='A CLI utility for packaging and exporting Alfred workflows',%0A url='https://github.com/caleb531/alfred-workflow-packager',%0A aut... | |
8124ad701f11aad4e127e26fb34e850b80e03bdf | Add compare_to_sim | compare_to_sim.py | compare_to_sim.py | Python | 0.000007 | @@ -0,0 +1,732 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0ACreated on Thu May 21 17:55:00 2015%0A%0A@author: weber%0A%22%22%22%0Aimport numpy as np%0Aimport matplotlib.pyplot as plt%0Afrom glob import glob%0Afrom pressure_traces import copy%0A%0Asimdata = np.genfromtxt('export.csv', delimiter=',', skip_header=1)%0Asimtim... | |
d952b1b42ad82d40b0eb741f189d2525b73e2d19 | add basic configuration | setup.py | setup.py | Python | 0.000006 | @@ -0,0 +1,283 @@
+from distutils.core import setup%0Asetup(name='distance_matrix',%0A author='Harrison Shoebridge',%0A author_email='harrison@theshoebridges.com',%0A description='A small wrapper around the google distance matrix api',%0A version='0.1',%0A py_modules=%5B'distance_matrix'%5D)%0A... | |
39b27532e79f27612bbae0b748ef91d89a429b84 | Exclude buggy setuptools-scm version | setup.py | setup.py | # -*- coding: utf-8 -*-
'''
Vdirsyncer synchronizes calendars and contacts.
Please refer to https://vdirsyncer.pimutils.org/en/stable/packaging.html for
how to package vdirsyncer.
'''
from setuptools import Command, find_packages, setup
requirements = [
# https://github.com/mitsuhiko/click/issues/200
'clic... | Python | 0.000157 | @@ -2098,16 +2098,26 @@
ools_scm
+ != 1.12.0
'%5D,%0A%0A
|
1805e9cc2e2aeb3770b03ebcb05ac189566fa165 | add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,456 @@
+from setuptools import setup, find_packages%0A%0Asetup(%0A name='memozo',%0A version=%220.1.0%22,%0A description='Memotize objects to desk easily',%0A author='sotetsuk',%0A url='https://github.com/sotetsuk/memozo',%0A author_email='sotetsu.koyamada@gmail.com',%0A license='MIT',%0... | |
37dcd46678ca8f22640aa314b174fda78be5392d | Bump version number | setup.py | setup.py | """
Flask-MongoEngine
--------------
Flask support for MongoDB using MongoEngine.
Includes `WTForms`_ support.
Links
`````
* `development version
<https://github.com/sbook/flask-mongoengine/raw/master#egg=Flask-MongoEngine-dev>`_
"""
from setuptools import setup
setup(
name='Flask-MongoEngine',
version=... | Python | 0.000002 | @@ -322,9 +322,9 @@
0.1.
-2
+3
-dev
|
dbe16470f596ee53ec18975afca4aa0605b9b1bc | Add setup.py. | setup.py | setup.py | Python | 0 | @@ -0,0 +1,1424 @@
+#!/usr/bin/env python3%0A%0Atry:%0A from setuptools.core import setup%0Aexcept ImportError:%0A from distutils.core import setup%0Afrom pip.req import parse_requirements%0Afrom pip.download import PipSession%0Aimport os%0A%0Adef get_file_path(name):%0A return os.path.abspath(os.path.join(%0A... | |
d8dd594c2ce0defa430f5a7e873c87491c7aab47 | Allow hyperframe 5 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import codecs
import os
import re
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
# Get the version
version_regex = r'__version__ = ["\']([^"\']*)["\']'
with open('h2/__init__.py', 'r') as f:
text = f.read()
... | Python | 0.000022 | @@ -1960,17 +1960,17 @@
%3E=3.1, %3C
-5
+6
, !=4.0.
|
5e98fe8b6ac368e29d739a2dfa690fdea01382ca | Bring back setup.py | setup.py | setup.py | Python | 0 | @@ -0,0 +1,1414 @@
+from codecs import open%0Aimport os%0Aimport os.path%0A%0Afrom setuptools import find_packages, setup%0A%0Ahere = os.path.relpath(os.path.abspath(os.path.dirname(__file__)))%0A%0Awith open(os.path.join(here, 'README.rst'), encoding='utf-8') as fd:%0A long_description = fd.read()%0A%0A__version__ ... | |
95c8e291fe1f89e1d880deff34c6e0aa98f6fdf2 | Package description for setuptools. | setup.py | setup.py | Python | 0 | @@ -0,0 +1,1549 @@
+# Copyright (c) 2009 Shrubbery Software%0A# %0A# Permission is hereby granted, free of charge, to any person obtaining a copy%0A# of this software and associated documentation files (the %22Software%22), to deal%0A# in the Software without restriction, including without limitation the rights%0A# to ... | |
62439e5c8f174752cd5774c3f240b7cc8fa158ad | add packaging boilerplate | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,320 @@
+from setuptools import setup, find_packages%0A%0AINFO = %7B'name': 'mecode',%0A 'version': '0.0.1',%0A %7D%0A%0Asetup(%0A name=INFO%5B'name'%5D,%0A version=INFO%5B'version'%5D,%0A author='Jack Minardi',%0A packages=find_packages(),%0A zip_safe=False,%0A maintainer='Jac... | |
f6b9a0c75a3b5b37b74856226c8210717def606f | Implement astroid trajectory | src/trajectory/astroid_trajectory.py | src/trajectory/astroid_trajectory.py | Python | 0.000037 | @@ -0,0 +1,540 @@
+#!/usr/bin/env python%0Afrom math import cos, pi, sin%0A%0Afrom .trajectory import Trajectory%0A%0A%0Aclass AstroidTrajectory(object, Trajectory):%0A def __init__(self, radius, period):%0A Trajectory.__init__(self)%0A self.radius = radius%0A self.period = period%0A%0A def g... | |
a9091a140ff158b79b05da5c20e18a0f1368d3d9 | add missing package init file | backend/src/gosa/backend/plugins/two_factor/filter/__init__.py | backend/src/gosa/backend/plugins/two_factor/filter/__init__.py | Python | 0.000001 | @@ -0,0 +1,274 @@
+# This file is part of the GOsa project.%0A#%0A# http://gosa-project.org%0A#%0A# Copyright:%0A# (C) 2016 GONICUS GmbH, Germany, http://www.gonicus.de%0A#%0A# See the LICENSE file in the project's top-level directory for details.%0A%0A__import__('pkg_resources').declare_namespace(__name__)%0A
| |
9758ca18557b686825d6afe8714c2f4816411878 | lowercase the locale in LANGUAGES (#10440) | src/olympia/conf/prod/settings.py | src/olympia/conf/prod/settings.py | import logging
from olympia.lib.settings_base import * # noqa
ENGAGE_ROBOTS = True
EMAIL_URL = env.email_url('EMAIL_URL')
EMAIL_HOST = EMAIL_URL['EMAIL_HOST']
EMAIL_PORT = EMAIL_URL['EMAIL_PORT']
EMAIL_BACKEND = EMAIL_URL['EMAIL_BACKEND']
EMAIL_HOST_USER = EMAIL_URL['EMAIL_HOST_USER']
EMAIL_HOST_PASSWORD = EMAIL_U... | Python | 0.999901 | @@ -1977,16 +1977,24 @@
locale
+.lower()
: value%5B
|
846ec085ff7bc1f5be250ac1ac2df87534bbc5c9 | add gunicorn.conf.py | deploy/gunicorn.conf.py | deploy/gunicorn.conf.py | Python | 0.000003 | @@ -0,0 +1,360 @@
+import os%0A%0Adef numCPUs():%0A if not hasattr(os, %22sysconf%22):%0A raise RuntimeError(%22No sysconf detected.%22)%0A return os.sysconf(%22SC_NPROCESSORS_ONLN%22)%0A%0Aworkers = numCPUs() * 2 + 1%0Abind = %22127.0.0.1:8000%22%0Apidfile = %22/tmp/gunicorn-demo.pid%22%0Abacklog = 2048%0... | |
5574ddd6aaf6ab041bdb186b1455792bff803731 | Add range to ConditionFactory | src/oscar/test/factories/offer.py | src/oscar/test/factories/offer.py | import factory
from oscar.core.loading import get_model
__all__ = [
'RangeFactory', 'ConditionFactory', 'BenefitFactory',
'ConditionalOfferFactory',
]
class RangeFactory(factory.DjangoModelFactory):
name = factory.Sequence(lambda n: 'Range %d' % n)
slug = factory.Sequence(lambda n: 'range-%d' % n)
... | Python | 0 | @@ -1052,16 +1052,61 @@
lue = 10
+%0A range = factory.SubFactory(RangeFactory)
%0A%0A cl
|
710150538efcb56f2b8e968c58707ce2bbe8431b | add script to fill in ltr termini | bin/fillTermini.py | bin/fillTermini.py | Python | 0 | @@ -0,0 +1,2055 @@
+#!/usr/bin/env python%0A%0A#Copyright (C) 2014 by Glenn Hickey%0A#%0A#Released under the MIT license, see LICENSE.txt%0Aimport sys%0Aimport os%0Aimport argparse%0Aimport copy%0A%0Afrom pybedtools import BedTool, Interval%0A%0A%22%22%22%0AStick a bed interval between pairs of lastz termini. Script w... | |
418a2104ec20a0b8f651320c1cbea10a533dc44d | Add tools/sys-tools/gdb/cmd_example.py | tools/sys-tools/gdb/cmd_example.py | tools/sys-tools/gdb/cmd_example.py | Python | 0.000001 | @@ -0,0 +1,1422 @@
+import gdb%0A%0Aclass SavePrefixCommand (gdb.Command):%0A '''%0A Save the current breakpoints to a file.%0A This command takes a single argument, a file name.%0A The breakpoints can be restored using the 'source' command.%0A '''%0A%0A def __init__(self):%0A super(SavePrefixC... | |
61677566ce685379456e7853c69a78ea32353422 | Add auto fixture to make sure that output dir does not exists when tests are run | static_precompiler/tests/conftest.py | static_precompiler/tests/conftest.py | Python | 0 | @@ -0,0 +1,424 @@
+from static_precompiler.settings import ROOT, OUTPUT_DIR%0Aimport shutil%0Aimport os%0Aimport pytest%0A%0A%0A@pytest.fixture(autouse=True)%0Adef _no_output_dir(request):%0A %22%22%22 Make sure that output dir does not exists. %22%22%22%0A%0A path = os.path.join(ROOT, OUTPUT_DIR)%0A%0A if os.... | |
6a6a76ff5274b01ae8570ae7b1a4153b8705100f | move worker func | streammorphology/freqmap/mpi_util.py | streammorphology/freqmap/mpi_util.py | Python | 0.00002 | @@ -0,0 +1,330 @@
+# coding: utf-8%0A%0A%22%22%22 Utilities for running frequency mapping with MPI (map) %22%22%22%0A%0Afrom __future__ import division, print_function%0A%0A__author__ = %22adrn %3Cadrn@astro.columbia.edu%3E%22%0A%0A# Standard library%0Aimport os%0Afrom collections import OrderedDict%0A%0A# Third-party%... | |
cb06e45100607e3375a25e2d19bcc94088f0c061 | Fix an error in how 'gridrank' keys are set. | distarray/local/base.py | distarray/local/base.py | # encoding: utf-8
__docformat__ = "restructuredtext en"
#----------------------------------------------------------------------------
# Copyright (C) 2008 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of this softwa... | Python | 0.999998 | @@ -5941,39 +5941,185 @@
-for dim in self.dimdata
+cart_coords = self.comm.Get_coords(self.comm_rank)%0A dist_data = (self.dimdata%5Bi%5D for i in self.distdims)%0A for dim, cart_rank in zip(dist_data, cart_coords)
:%0A
@@ -6146,33 +6146,17 @@
%5D =
-self.base_comm.Ge
+car
t_rank
-()
... |
422b9458d26866b9f6692ddb0ccf2305c3ac6ea7 | Add an extra file to the surrogates experiments. | dev/surrogates/plots.py | dev/surrogates/plots.py | Python | 0 | @@ -0,0 +1,705 @@
+import darch.search_logging as sl%0Aimport darch.visualization as vi%0Aimport numpy as np%0Aimport seaborn as sns; sns.set()%0A%0A# checking these across time.%0Alog_lst = sl.read_search_folder('./logs/cifar10_medium/run-0')%0Axkey = 'epoch_number'%0Aykey = 'validation_accuracy'%0Anum_lines = 8%0Atim... | |
0e2c7c255043d7ccc5042a8e4905557f2d43e2ca | Add Mandrill backend | templated_email/backends/mandrill.py | templated_email/backends/mandrill.py | Python | 0 | @@ -0,0 +1,1110 @@
+import vanilla_django%0Afrom django.core.mail import EmailMessage%0Afrom django.conf import settings%0Afrom django.utils.translation import ugettext as _%0A%0A# Make sure you have Mandrill as your email backend%0A%0Aclass TemplateBackend(vanilla_django.TemplateBackend):%0A def __init__(self, *arg... | |
8da12f8f269746b086f5d208afb390e304f12e9b | Add stub for submit_glue.py | metal/mmtl/submit_glue.py | metal/mmtl/submit_glue.py | Python | 0 | @@ -0,0 +1,253 @@
+import argparse%0A%0Aif __name__ == %22__main__%22:%0A parser = argparse.ArgumentParser(%0A description=%22Evaluate a model and make glue submission bundle%22, add_help=False%0A )%0A parser.add_argument(%22-mf%22, %22--model-file%22)%0A args = parser.parse_args()%0A
| |
e1f8358e09cd3299effc112544206361d5a6c7dd | Add migration for latest-ing | refugee_manager/migrations/0003_auto_20141108_1609.py | refugee_manager/migrations/0003_auto_20141108_1609.py | Python | 0 | @@ -0,0 +1,391 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('refugee_manager', '0002_volunteer_mailing_address'),%0A %5D%0A%0A operations = %5B%0A mig... | |
7bcc6b343d53830e52b466558e27137dc55b0472 | Allow field types in mezzanine.forms to be used in mezzanine.core without the forms app actually being installed. Closes #791. | mezzanine/forms/fields.py | mezzanine/forms/fields.py |
from django.core.exceptions import ImproperlyConfigured
from django import forms
from django.forms.extras import SelectDateWidget
from django.utils.translation import ugettext_lazy as _
from mezzanine.conf import settings
from mezzanine.core.forms import SplitSelectDateTimeWidget
from mezzanine.utils.importing import... | Python | 0 | @@ -2169,24 +2169,32 @@
gets%0Aif
+getattr(
settings
.FORMS_U
@@ -2181,25 +2181,27 @@
ttr(settings
-.
+, %22
FORMS_USE_HT
@@ -2203,16 +2203,25 @@
SE_HTML5
+%22, False)
:%0A ht
@@ -2896,16 +2896,75 @@
d type.%0A
+extra_fields = getattr(settings, %22FORMS_EXTRA_FIELDS%22, %5B%5D)%0A
for fiel
@@ -2999,35 +299... |
660e0955979b7d11b7442a00747673700413bf1d | Add a test of spline filtering vs. matrix solving. | scipy/ndimage/tests/test_splines.py | scipy/ndimage/tests/test_splines.py | Python | 0 | @@ -0,0 +1,2058 @@
+%22%22%22Tests for spline filtering.%22%22%22%0Afrom __future__ import division, print_function, absolute_import%0A%0Aimport numpy as np%0Aimport pytest%0A%0Afrom numpy.testing import assert_almost_equal%0A%0Afrom scipy import ndimage%0A%0A%0Adef get_spline_knot_values(order):%0A %22%22%22Knot va... | |
b00338413e954e91c79c625dbaf5140d0a57f6e6 | before_perform() & after_perform() should be called on class, not pass it in | pyres/job.py | pyres/job.py | import time
from datetime import timedelta
from pyres import ResQ, safe_str_to_class
from pyres import failure
from pyres.failure.redis import RedisBackend
class Job(object):
"""Every job on the ResQ is an instance of the *Job* class.
The ``__init__`` takes these keyword arguments:
``queue`` -- A st... | Python | 0.999996 | @@ -2866,32 +2866,46 @@
+payload_class.
before_perform(p
@@ -2899,39 +2899,24 @@
ore_perform(
-payload_class,
metadata)%0A
@@ -3371,32 +3371,46 @@
+payload_class.
after_perform(pa
@@ -3407,31 +3407,16 @@
perform(
-payload_class,
metadata
|
da0794fd63960fa8a836e27ab540cd9f8b8713d7 | Test program for issue #81 | unresolved_bugs/bug_81.py | unresolved_bugs/bug_81.py | Python | 0 | @@ -0,0 +1,1118 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0A Aho-Corasick string search algorithm.%0A%0A Author : Wojciech Mu%C5%82a, wojciech_mula@poczta.onet.pl%0A WWW : http://0x80.pl%0A License : public domain%0A%22%22%22%0A%0Aimport os%0Aimport sys%0A%0Aimport ahocorasick%0A%0A%0Atry:%0A ra... | |
1d4137d43f1b91400d1347d131f56b1698163337 | Create rockpaper.py | rockpaper.py | rockpaper.py | Python | 0.000159 | @@ -0,0 +1,2429 @@
+import players%0A%0Adef showdown(human_choice, computer_guess, h_obj, c_obj):%0A if (human_choice, computer_guess) == (1, 3):%0A print('Rock crushes scissors. Human Wins!')%0A print('-------------------------------------')%0A h_obj.add_to_score()%0A elif (human_choice, com... | |
48fc7cad7eb4cec0b928aba3daca7e934d46d87c | Add unit tests for sdnvpn | functest/tests/unit/features/test_sdnvpn.py | functest/tests/unit/features/test_sdnvpn.py | Python | 0 | @@ -0,0 +1,1100 @@
+#!/usr/bin/env python%0A%0A# Copyright (c) 2017 Orange and others.%0A#%0A# All rights reserved. This program and the accompanying materials%0A# are made available under the terms of the Apache License, Version 2.0%0A# which accompanies this distribution, and is available at%0A# http://www.apache.org... | |
35f19e61df4c14a2766709f6ab88f08e7fab9756 | add run_test | run_tests.py | run_tests.py | Python | 0.000001 | @@ -0,0 +1,492 @@
+#!/usr/bin/env python%0Aimport sys%0Aimport pytest%0A%0Aif __name__ == '__main__':%0A # show output results from every test function%0A args = %5B'-v'%5D%0A # show the message output for skipped and expected failure tests%0A args.append('-vrxs')%0A if len(sys.argv) %3E 1:%0A arg... | |
a91b633ba88a01b12305fdfafd570c0b3776b42d | Add a tool script to print errors statistics in output JSON files. | utils/print_num_errors.py | utils/print_num_errors.py | Python | 0 | @@ -0,0 +1,1798 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A%22%22%22%0AMake statistics on score files (stored in JSON files).%0A%22%22%22%0A%0Aimport argparse%0Aimport json%0Aimport numpy as np%0A%0A%0Adef parse_json_file(json_file_path):%0A with open(json_file_path, %22r%22) as fd:%0A json_dat... | |
4a06723a475fb6312196ea4e0a5ee47414a2c157 | add power_line, power_minor_line | integration-test/232-power-lines.py | integration-test/232-power-lines.py | Python | 0.00001 | @@ -0,0 +1,599 @@
+from . import FixtureTest%0A%0A%0Aclass PowerLines(FixtureTest):%0A%0A def test_power_line(self):%0A self.load_fixtures(%5B'http://www.openstreetmap.org/way/29399873'%5D)%0A%0A self.assert_has_feature(%0A 14, 2621, 6338, 'landuse',%0A %7B'id': 29399873, 'kind': ... | |
e2d72a20b241fe2dca1dad1eb391350460c06060 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/4efe74c2473de1220989199258b7a4924dd2a679. | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "ab36dc9c9829c8574b7760e98de18cc4d2b2eaf3"
TFRT_SHA256 = "afe45af9014fdf72e5a58cbfcea2c17522c7ce1a082c1a... | Python | 0.000003 | @@ -210,133 +210,133 @@
= %22
-ab36dc9c9829c8574b7760e98de18cc4d2b2eaf3%22%0A TFRT_SHA256 = %22afe45af9014fdf72e5a58cbfcea2c17522c7ce1a082c1a33b8bcf3db3fac5fd1
+4efe74c2473de1220989199258b7a4924dd2a679%22%0A TFRT_SHA256 = %2276e8b79220d0d68362782b1877b279dacdaa0a9c4b3a80004cf70cca8131414f
%22%0A%0A
|
0b47397b91fec94910f18ea1711184ecfd0f6bf0 | Add tests for file storage engine | jacquard/storage/tests/test_file.py | jacquard/storage/tests/test_file.py | Python | 0 | @@ -0,0 +1,1550 @@
+from jacquard.storage.file import FileStore%0A%0A%0Adef test_get_nonexistent_key():%0A # Just test this works without errors%0A store = FileStore(':memory:')%0A assert store.get('test') is None%0A%0A%0Adef test_simple_write():%0A storage = FileStore(':memory:')%0A with storage.transac... | |
d56387ee3edb05aee87bb732fb60b9d3a5e8a94b | Add a simple setup.py script | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,582 @@
+#!/usr/bin/env python%0A%0AUSE_SETUPTOOLS = False%0Atry:%0A from setuptools import setup, Extension%0A USE_SETUPTOOLS = True%0Aexcept ImportError:%0A from distutils.core import setup, Extension%0A%0A%0Asetup_kwargs = dict(%0A name='greendns',%0A description='''A module for providing gr... | |
daf53c1d5564942651e5efac0d1daa9dbd7248f2 | Create setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,70 @@
+%22%22%22Setup script for lechat.%22%22%22%0A%0Afrom setuptools import setup%0A%0Asetup()%0A
| |
f02d51237443ce239ab44ef7bb38fb625cd0fac1 | Add generic main function setup to test env | setup.py | setup.py | Python | 0 | @@ -0,0 +1,122 @@
+#!/Applications/anaconda/envs/Python3/bin%0A%0Adef main():%0A print(%22Hello, World!%22)%0A%0A%0Aif __name__ == '__main__':%0A main()%0A
| |
7938b647951bb83604c34ebf0932200e13913e35 | Bump version. | setup.py | setup.py | #!/usr/bin/env python
import sys
assert sys.version >= '2.5', "Requires Python v2.5 or above."
from distutils.core import setup
from setuptools import find_packages
setup(
name="django-loginas",
version="0.1.2",
author="Stochastic Technologies",
author_email="info@stochastictechnologies.com",
url=... | Python | 0 | @@ -211,17 +211,17 @@
on=%220.1.
-2
+3
%22,%0A a
|
162c3cd9b12e559242215d395ae85fc75d8ba37d | Create pl_list.py | pl_list.py | pl_list.py | Python | 0.000002 | @@ -0,0 +1,2391 @@
+__author__ = %22Dan C Williams%22%0A__version__ = %220.2%22%0A__date__ = %22Jul-24-2016%22%0A__email__ = %22dan.c.williams@gmail.com%22%0A__status__ = %22Development%22%0A__version__ = %22Python 3.5%22%0A%0Aimport netaddr%0Aimport collections%0A%0Araw_lines = %5Bline.rstrip('%5Cn') for line in open(... | |
dc1d43acb5730bd9b555b63aa589b0eeceb14e52 | Add a test case to exercise the 'target stop-hook add' command without relying on pexpect to spawn an lldb child command. The test is not "correct" in that the '** Stop Hooks **' message emitted by the Target implementation is invoked asynchronously and is using a separate: | test/stop-hook/TestStopHookCmd.py | test/stop-hook/TestStopHookCmd.py | Python | 0.000194 | @@ -0,0 +1,2716 @@
+%22%22%22%0ATest lldb target stop-hook command.%0A%22%22%22%0A%0Aimport os%0Aimport unittest2%0Aimport lldb%0Aimport pexpect%0Afrom lldbtest import *%0A%0Aclass StopHookCmdTestCase(TestBase):%0A%0A mydir = %22stop-hook%22%0A%0A @unittest2.skipUnless(sys.platform.startswith(%22darwin%22), %22re... | |
250e0d2d0e2264b83a82548df3b30dbc784a4fe5 | Add some example client code | docker-registry-show.py | docker-registry-show.py | Python | 0.000001 | @@ -0,0 +1,3157 @@
+%22%22%22%0ACopyright 2015 Red Hat, Inc%0A%0ALicensed under the Apache License, Version 2.0 (the %22License%22);%0Ayou may not use this file except in compliance with the License.%0AYou may obtain a copy of the License at%0A%0A http://www.apache.org/licenses/LICENSE-2.0%0A%0AUnless required by ap... | |
94ca75328c7aeeb80815ef5e4af6bcbbeaeb53be | Update the example emane 802.11 python script. | daemon/examples/netns/emane80211.py | daemon/examples/netns/emane80211.py | #!/usr/bin/python -i
# Copyright (c)2010-2014 the Boeing Company.
# See the LICENSE file included in this distribution.
# Example CORE Python script that attaches N nodes to an EMANE 802.11abg
# network. One of the parameters is changed, the pathloss mode.
import sys, datetime, optparse
from core import pycore
from... | Python | 0 | @@ -1327,16 +1327,47 @@
ization%0A
+ cfg = %7B'verbose': 'false'%7D%0A
sess
@@ -1387,16 +1387,27 @@
Session(
+cfg = cfg,
persiste
@@ -1412,12 +1412,15 @@
tent
-=Tru
+ = Fals
e)%0A
@@ -2093,24 +2093,20 @@
') %5D = '
-pathloss
+2ray
'%0A ex
@@ -2179,19 +2179,12 @@
= '
-precomputed
+2ray
'%0A%0A
|
e7cbd3e2d5a21b003c6ee392da5b8ebe70d279a8 | add lockfile dependency | setup.py | setup.py | #########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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... | Python | 0.000001 | @@ -987,16 +987,43 @@
=0.12.7'
+,%0A 'lockfile==0.9.1'
%0A %5D,%0A
|
83bcb62c98c406e2aa6ce6a9a98750d0b565f750 | Add tests for generic hash | tests/unit/test_raw_generichash.py | tests/unit/test_raw_generichash.py | Python | 0 | @@ -0,0 +1,532 @@
+# Import nacl libs%0Aimport libnacl%0A%0A# Import python libs%0Aimport unittest%0A%0A%0Aclass TestGenericHash(unittest.TestCase):%0A '''%0A Test sign functions%0A '''%0A def test_keyless_generichash(self):%0A msg1 = b'Are you suggesting coconuts migrate?'%0A msg2 = b'Not at ... | |
ff814e3dff10ffa54a0569868f32056d37babff6 | Create test1.py | test1.py | test1.py | Python | 0.000018 | @@ -0,0 +1,12 @@
+import this%0A
| |
064124d09973dc58a444d22aa7c47acf94f8fa81 | Add a script to generate JSON bigram frequencies for English | data/bigramfreq.py | data/bigramfreq.py | Python | 0.000003 | @@ -0,0 +1,611 @@
+import json%0Aimport lxml.html%0Afrom lxml.cssselect import CSSSelector%0Aimport requests%0Aimport sys%0A%0A%0Adef main():%0A raw = requests.get(%22http://norvig.com/mayzner.html%22)%0A if not raw:%0A print %3E%3Esys.stderr, %22Request failed with code %25d%22 %25 (raw.status_code)%0A ... | |
b9b6b8a9337888fdcfcf15af1dedc758d0662dd0 | add nexted evalute=False test | sympy/core/tests/test_evaluate.py | sympy/core/tests/test_evaluate.py | Python | 0.000049 | @@ -0,0 +1,440 @@
+from sympy.abc import x, y%0Afrom sympy.core.evaluate import evaluate%0Afrom sympy.core import Mul, Add%0A%0Adef test_add():%0A with evaluate(False):%0A expr = x + x%0A assert isinstance(expr, Add)%0A assert expr.args == (x, x)%0A assert isinstance(x + x, Mul)%0A%0A%0Adef t... | |
28dc9e241b60be9b961a9f63398d2d8b3229693a | Test that creation fails on an unknown RAID value. | tests/dbus/manager/test_create.py | tests/dbus/manager/test_create.py | # Copyright 2016 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | Python | 0 | @@ -1007,16 +1007,48 @@
hodNames
+%0A_MP = ManagerSpec.PropertyNames
%0A%0A_DEVIC
@@ -2823,24 +2823,616 @@
pools), 0)%0A%0A
+ def testCreateBadRAID(self):%0A %22%22%22%0A Creation should always fail if RAID value is wrong.%0A %22%22%22%0A redundancy_values = Manager.Properties.Redundan... |
9f551b236a5d4052f2371cc11613e84808f43dee | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,501 @@
+#!/usr/bin/env python%0Afrom distutils.core import setup%0A%0Asetup(%0A name='pyvk',%0A version='2016.08',%0A packages=%5B'pyvk'%5D,%0A url='https://github.com/sgaynetdinov/pyvk',%0A license='MIT License',%0A author='Sergey Gaynetdinov',%0A author_email='s.gaynetdinov@gmail.com',... | |
fcd027a115fd3c690f042468c303eeedc74774fa | Use setuptools instead of distribute. | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(
name='facebook-sdk',
version='0.4.0',
description='This client library is designed to support the Facebook '
'Graph API and the official Facebook JavaScript SDK, which '
'is the canonical way to implement Facebook... | Python | 0 | @@ -24,22 +24,18 @@
rom
-distutils.core
+setuptools
imp
|
923c6b5a4181dfd9ae3f3c26ba411a63e27a79fe | add test for custom argument parser | tests/test_custom_argument_parser.py | tests/test_custom_argument_parser.py | Python | 0 | @@ -0,0 +1,241 @@
+import pytest%0A%0Afrom python_utility.custom_argument_parser import CustomArgumentParser%0A%0A%0Adef test_custom_argument_parser() -%3E None:%0A parser = CustomArgumentParser()%0A%0A with pytest.raises(SystemExit):%0A parser.error(message='test')%0A
| |
220671d4bc2300983cf200cc6f7834efef458ff1 | add a new factors module | modules/factors.py | modules/factors.py | Python | 0 | @@ -0,0 +1,536 @@
+# finding all factors for a given number%0Adef find_factors(x): # define a function%0A print (%22The factors of %22, x, %22 are: %22)%0A for i in range(1, x + 1):%0A if x %25 i == 0:%0A print(i)%0A%0Adef print_factors():%0A # ask the user to input a number%0A num = input(%22Enter a number... | |
291117e0c56fb00fd27c93a95b883784cf69c9bc | add dataset parser | apps/paper/dataset.py | apps/paper/dataset.py | Python | 0.000083 | @@ -0,0 +1,1075 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A'''%0ACreated on March 7, 2014%0A%0A@author: Chunwei Yan @ PKU%0A@mail: yanchunwei@outlook.com%0A'''%0Afrom __future__ import division%0A%0A%0Aclass DUC(object):%0A def __init__(self, path):%0A self.path = path%0A%0A def get_text(self):... | |
070d3f780ffab6e866fb3d1d7fc21bd77fb31ae6 | Add momento pattern | momento-pattern.py | momento-pattern.py | Python | 0.000052 | @@ -0,0 +1,991 @@
+#!/usr/bin/python%0Aimport copy%0A%0A%0Aclass Originator(object):%0A%0A class Memento(object):%0A def __init__(self, mstate):%0A self.mstate = mstate%0A%0A def rollback_state(self):%0A return self.mstate%0A%0A def set_state(self, state):%0A print ('Ori... | |
8e3e1883b9aa25091b6a9a1b4684128bd56659f7 | Add new test | setup.py | setup.py | Python | 0.000004 | @@ -0,0 +1,1534 @@
+%22%22%22%0AFinix Python client library.%0ASee %60%60README.md%60%60 for usage advice.%0A%22%22%22%0A%0Aimport os%0Aimport re%0A%0Atry:%0A import setuptools%0Aexcept ImportError:%0A import distutils.core%0A%0A setup = distutils.core.setup%0Aelse:%0A setup = setuptools.setup%0A%0APACKAGE ... | |
0fe1d3eb78ef3d2c5dbbd5a662829309ab808a6f | Add setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,151 @@
+from setuptools import setup%0A%0Atreeano_version = '0.0.1'%0A%0Asetup(%0A name=%22treeano%22,%0A version=treeano_version,%0A packages=%5B%22treeano%22, %22canopy%22%5D%0A)%0A%0A
| |
529d9328570febd037077cfe865feedb841a1162 | Create setup.py | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,1599 @@
+from distutils.core import setup%0Asetup(%0A name = 'autoD', # How you named your package folder (MyLib)%0A packages = %5B'autoD'%5D, # Chose the same as %22name%22%0A version = '3.7.0', # Start with a small number and increase it with every change you make%0A license='MIT', ... | |
20b31aa5faa155639df8c206de2864af80924254 | add setup.py script | setup.py | setup.py | Python | 0.000001 | @@ -0,0 +1,275 @@
+from distutils.core import setup%0A%0Asetup(%0A name='attention',%0A version='0.1.0',%0A author='tllake',%0A author_email='thom.l.lake@gmail.com',%0A packages=%5B'attention'%5D,%0A description='An attention function for PyTorch.',%0A long_description=open('README.md').read())
| |
5df5a19cba3bd543bcadd92d57fdd07d84b38339 | update project page link in setup script | setup.py | setup.py | import os, sys
from distutils.core import setup
setup(
# metadata
name='pycparser',
description='C parser in Python',
long_description="""
pycparser is a complete parser of the C language, written in
pure Python using the PLY parsing library.
It parses C code into a... | Python | 0 | @@ -561,28 +561,32 @@
http
+s
://
-code.google.com/p
+bitbucket.org/eliben
/pyc
@@ -591,17 +591,16 @@
ycparser
-/
',%0D%0A
|
229c54fa4122f9c08aae9b31dc6720e78daaf90d | add setup | setup.py | setup.py | Python | 0 | @@ -0,0 +1,569 @@
+#!/user/bin/env python%0A%0Afrom setuptools import setup%0A%0Asetup(%0A name='py-readability',%0A version='0.0.1',%0A description='Calculate readability scores. e.g. Gunning Fog',%0A author='Carmine DiMAscio',%0A url='https://github.com/cdimascio/py-readability',%0A packages=%5B'py-... | |
9066250b4ccdd98cd6b7cc644e829c0cfacc0a02 | serpent for CI | setup.py | setup.py |
from setuptools import setup, find_packages
console_scripts = ['eth=pyethereum.eth:main',
'pyethtool=tools.pyethtool_cli:main']
setup(name="pyethereum",
version='0.0.1',
packages=find_packages("."),
install_requires=[
'six', 'leveldb', 'bitcoin', 'pysha3',
'mi... | Python | 0.999999 | @@ -300,16 +300,46 @@
ysha3',%0A
+ 'ethereum-serpent',%0A
|
e3cd2d3880dbc00e254ac503d5f5c84ab77edc4f | Add Invoke tasks for cleaning and building docs. | tasks.py | tasks.py | Python | 0 | @@ -0,0 +1,149 @@
+from invoke import task, run%0A%0A@task%0Adef clean():%0A run(%22rm -rf docs/_build%22)%0A%0A@task('clean')%0Adef build():%0A run(%22sphinx-build docs docs/_build%22)%0A
| |
75131bdf806c56970f3160de3e6d476d9ecbc3a7 | Add problem delete note in a linked list | python/deleteNodeInALinkedList.py | python/deleteNodeInALinkedList.py | Python | 0 | @@ -0,0 +1,583 @@
+# https://leetcode.com/problems/delete-node-in-a-linked-list/%0A%0A# Definition for singly-linked list.%0A# class ListNode(object):%0A# def __init__(self, x):%0A# self.val = x%0A# self.next = None%0A%0Aclass Solution(object):%0A def deleteNode(self, node):%0A %22%22%22%0... | |
1a8c361d90243c44a877ebdc4ae92fbfb3226b40 | add test file for words | day1/words_test.py | day1/words_test.py | Python | 0.000001 | @@ -0,0 +1,649 @@
+import unittest%0Aimport words%0A%0Aclass TestWordsCode(unittest.TestCase):%0A%0A def test_has_no_e(self):%0A self.assertEqual(words.has_no_e(%22bet%22), False)%0A self.assertEqual(words.has_no_e(%22bit%22), True)%0A%0A def test_uses_only(self):%0A self.assertEqual(words.uses_only(%22ababa... | |
6b92d9fe24fe682c357e3f5a5e6c19f1569bd29e | Add riak backend | nydus/db/backends/riak.py | nydus/db/backends/riak.py | Python | 0 | @@ -0,0 +1,1178 @@
+%22%22%22%0Anydus.db.backends.riak%0A~~~~~~~~~~~~~~~~~~~~~~%0A%0A:copyright: (c) 2011 DISQUS.%0A:license: Apache License 2.0, see LICENSE for more details.%0A%22%22%22%0A%0Afrom __future__ import absolute_import%0A%0Aimport socket%0Aimport httplib%0A%0Afrom riak import RiakClient, RiakError%0A%0Afro... | |
7e7d85c7e7bbd79f7bc04d2660e1e1fd30422765 | add section property to proposalbase | symposion/proposals/models.py | symposion/proposals/models.py | import datetime
import os
import uuid
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Q
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
import reversion
from markitup.fields import MarkupField
from model_util... | Python | 0 | @@ -3473,32 +3473,107 @@
%0A @property%0A
+ def section(self):%0A return self.kind.section%0A %0A @property%0A
def speaker_
|
6b630687336de18bb0c9179b7002d310772b6871 | Add corpwiki/iptool | tools/check_nameserver_popularity.py | tools/check_nameserver_popularity.py | #!/usr/bin/env python
import os
import sys
import pickle
import time
import traceback
import yahoo.search
from yahoo.search.web import WebSearch
APP_ID = 'P5ihFKzV34G69QolFfb3nN7p0rSsYfC9tPGq.IUS.NLWEeJ14SG9Lei0rwFtgwL8cDBrA6Egdw--'
QUERY_MODIFIERS = '-site:txdns.net -site:sitedossier.com -mx -site:dataopedia.com -sit... | Python | 0 | @@ -1129,16 +1129,58 @@
hois.com
+ -site:corporationwiki.com -site:iptool.us
'%0ACACHE_
|
dc15986b0ff890250d21a36350b689809d535f44 | Create KMP.py | KMP.py | KMP.py | Python | 0 | @@ -0,0 +1,2428 @@
+# Github username : yatingupta10%0A# Website : http://www.yatingupta.me/%0A%0A# Find occurrences of pattern as a contiguous subsequence of the text.%0A# For the KMP versions the pattern must be a list or string, because we%0A# perform array indexing into it, but the text can be anything that can%0A#... | |
51642c95ce9d7c7d95648952340d90f4ef2254f3 | Add test for record_panel | opal/tests/test_panels.py | opal/tests/test_panels.py | Python | 0 | @@ -0,0 +1,669 @@
+%22%22%22%0ATests create_singletons command%0A%22%22%22%0Afrom opal.core.test import OpalTestCase%0A%0Afrom opal.templatetags import panels%0A%0Afrom opal.tests.models import Demographics%0A%0Aclass RecordPanelTestCase(OpalTestCase):%0A def test_record_panel(self):%0A expected = dict(%0A ... | |
d9959b9a8e38fc5c6b23618fdbd8a67423302e4e | include forgotten exceptions.py file | ddsc/exceptions.py | ddsc/exceptions.py | Python | 0 | @@ -0,0 +1,145 @@
+class DDSUserException(Exception):%0A %22%22%22%0A Exception with an error message to be displayed to the user on the command line.%0A %22%22%22%0A pass%0A
| |
45215b36e544f8d7a9ac21a825807d6e49d2ade9 | Add binarySearch function | DataStructuresAndAlgorithmsInPython/BinarySearch.py | DataStructuresAndAlgorithmsInPython/BinarySearch.py | Python | 0.000002 | @@ -0,0 +1,1072 @@
+##-*- coding: utf-8 -*- %0A#!/usr/bin/python%0A%22%22%22 Returns either the index of the location in the array,%0A or -1 if the array did not contain the targetValue%0A%22%22%22%0Aimport math%0A%0A%0Adef binarySearch (array, targetValue):%0A minimum = 0;%0A maximum = len(array) - 1;%0A g... | |
1d2fea42ae0e749aa2f262d8397c978c84b5d7c5 | Version can be printed by executing python module dictorm.version | dictorm/version.py | dictorm/version.py | Python | 0.000003 | @@ -0,0 +1,53 @@
+from .dictorm import __version__%0A%0Aprint(__version__)%0A
| |
0e43fce67c2c53fe2a7dbf233df86c042501e477 | Move explain_sam_flags.py to public repository | src/scripts/explain_sam_flags.py | src/scripts/explain_sam_flags.py | Python | 0.000001 | @@ -0,0 +1,1341 @@
+#!/usr/bin/env python%0A# The Broad Institute%0A# SOFTWARE COPYRIGHT NOTICE AGREEMENT%0A# This software and its documentation are copyright 2008 by the%0A# Broad Institute/Massachusetts Institute of Technology. All rights are%0A# reserved.%0A%0A# This software is supplied without any warranty or gua... | |
5352740a1cc508a6b902f447a80960fa237414aa | Add ProgressPathView | ui2/view_classes/ProgressPathView.py | ui2/view_classes/ProgressPathView.py | Python | 0 | @@ -0,0 +1,2018 @@
+from objc_util import *%0Aimport ui%0A%0A%0Adef _get_CGColor(color):%0A %22%22%22Get a CGColor from a wide range of formats.%22%22%22%0A return UIColor.colorWithRed_green_blue_alpha_(%0A *ui.parse_color(color)%0A ).CGColor()%0A%0A%0Aclass ProgressPathView(ui.View):%0A %22%22%22A v... | |
0611c6f471c730d9f013c776389ae129a11e16e3 | Rewrite brackets logic to not use while loop | editorconfig/fnmatch.py | editorconfig/fnmatch.py | """Filename matching with shell patterns.
fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.
The functions operate by translating the pattern into a regular
expression. They cache the compiled regular expressions for speed.
The function... | Python | 0.000006 | @@ -2097,16 +2097,40 @@
vel = 0%0A
+ in_brackets = False%0A
res
@@ -2541,52 +2541,22 @@
-j = i%0A if j %3C n and pat%5Bj%5D == '!'
+if in_brackets
:%0A
@@ -2565,33 +2565,41 @@
-j = j + 1
+res = res + '%5C%5C%5B'
%0A
@@ -2591,36 +2591,38 @@
%5C%5B'%0A
... |
8738accb2a612a3c1e41cc00aa337d0be890f4a0 | add problem 052 | problem_052.py | problem_052.py | Python | 0.001304 | @@ -0,0 +1,419 @@
+#!/usr/bin/env python%0A#-*-coding:utf-8-*-%0A%0A'''%0A%0A'''%0A%0Aimport timeit%0A%0A%0Adef loop(n):%0A for i in range(10, 10000000):%0A if str(i)%5B0%5D != '1':%0A continue%0A f = %5B1 for j in range(2, n+1) if sorted(list(str(i))) != sorted(str(i*j))%5D%0A if len... | |
88f0e5ba8a404f0fcdaaaacc69109775182b7213 | Add squashed migrations | dj_experiment/migrations/0002_auto_20170802_1206_squashed_0004_auto_20170802_1230.py | dj_experiment/migrations/0002_auto_20170802_1206_squashed_0004_auto_20170802_1230.py | Python | 0.000001 | @@ -0,0 +1,1612 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.11.3 on 2017-08-02 17:31%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0Aimport django.db.models.deletion%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A replaces = %5B('dj_experiment', '0002_auto_201... | |
26eba1f16c44ed6693b2a575a6a2c5ebef9401b5 | Create Movie object city_lights | entertainment_center.py | entertainment_center.py | Python | 0.999489 | @@ -0,0 +1,1279 @@
+# entertainment_center.py%0Aimport media%0A%0A__author__ = 'vishal lama'%0A%0Acity_lights = media.Movie(%0A %22City Lights%22,%0A %22A tramp falls in love with a beautiful blind girl. Her family is in %22%0A %22financial trouble. The tramp's on-and-off friendship with a wealthy %22%0A %2... | |
714537e1cff4009a5e8ba93da94954b84536127a | Add Teli API | api.py | api.py | Python | 0 | @@ -0,0 +1,825 @@
+import requests%0A%0Aclass Teli:%0A TOKEN = %22%22%0A API = %22%22%0A%0A def __init__(self, TOKEN):%0A self.TOKEN = TOKEN%0A self.API = %22https://sms.teleapi.net/%7B%7D/send%22%0A%0A def send_sms(self, src, dest, message):%0A args = %7B%0A 'token': self.TO... | |
c4b2f86f5ae49b75dc47c8ced799d647d3bc70e1 | fix transport location | src/collectors/elasticsearch/elasticsearch.py | src/collectors/elasticsearch/elasticsearch.py | # coding=utf-8
"""
Collect the elasticsearch stats for the local node
#### Dependencies
* urlib2
"""
import urllib2
try:
import json
json # workaround for pyflakes issue #13
except ImportError:
import simplejson as json
import diamond.collector
class ElasticSearchCollector(diamond.collector.Colle... | Python | 0.000006 | @@ -2087,23 +2087,20 @@
sport =
-indices
+data
%5B'transp
|
8bdf94c29418a3826e5c6fd3a76f96051326bfe6 | Add management command extract votes #126 | datasets/management/commands/extract_votes.py | datasets/management/commands/extract_votes.py | Python | 0 | @@ -0,0 +1,2051 @@
+from django.core.management.base import BaseCommand%0Aimport json%0Afrom datasets.models import CandidateAnnotation, Vote, TaxonomyNode, Dataset%0A%0A%0Aclass Command(BaseCommand):%0A help = 'Extract user votes' %5C%0A 'Usage: python manage.py extract_votes %3Cdataset_shor_name%3E %3Cou... | |
21e80314c0b1a2b9f3e139520854ce913038dbfb | change docstring format | src/collectors/processmemory/processmemory.py | src/collectors/processmemory/processmemory.py | # coding=utf-8
"""
A Diamond collector that collects memory usage of each process defined in it's
config file by matching them with their executable filepath or the process name.
Example config file ProcessMemoryCollector.conf
```
enabled=True
unit=kB
[process]
[[postgres]]
exe=^\/usr\/lib\/postgresql\/+d.+d\/bin\/p... | Python | 0.000001 | @@ -2260,32 +2260,175 @@
rocesses(self):%0A
+ %22%22%22%0A Populates self.processes%5Bprocessname%5D%5B'procs'%5D with the corresponding%0A list of psutil.Process instances%0A %22%22%22%0A
def proc
@@ -2553,25 +2553,25 @@
-@
+:
param proc:
@@ -2608,17 +2608,17 @@
... |
80935a126beabf05a4c8d54e9306d2b67995c81a | 373. Find K Pairs with Smallest Sums. Brute force | p373_bruteforce.py | p373_bruteforce.py | Python | 0.999931 | @@ -0,0 +1,928 @@
+import unittest%0A%0A%0Aclass Solution(object):%0A def kSmallestPairs(self, nums1, nums2, k):%0A %22%22%22%0A :type nums1: List%5Bint%5D%0A :type nums2: List%5Bint%5D%0A :type k: int%0A :rtype: List%5BList%5Bint%5D%5D%0A %22%22%22%0A tuples = %5B%5D... | |
1ede9bd211cd8ea6aac4db6f8818804cb778a022 | Add a view that serves a single static file | dinosaurs/views.py | dinosaurs/views.py | Python | 0.000001 | @@ -0,0 +1,371 @@
+import os%0A%0Aimport tornado.web%0Aimport tornado.ioloop%0A%0A%0Aclass SingleStatic(tornado.web.StaticFileHandler):%0A def initialize(self, path):%0A self.dirname, self.filename = os.path.split(path)%0A super(SingleStatic, self).initialize(self.dirname)%0A%0A def get(self, path=N... | |
3f7a03baad15da817e81a8524b87f32c9ca79c1b | Add image service tests | memegen/test/test_services_image.py | memegen/test/test_services_image.py | Python | 0.000001 | @@ -0,0 +1,597 @@
+from unittest.mock import Mock%0A%0Aimport pytest%0A%0A%0Aclass TestImageService:%0A%0A def test_find_template(self, image_service):%0A mock_template = Mock()%0A image_service.template_store.read.return_value = mock_template%0A%0A template = image_service.find_template('my_key... | |
33a439d5b52036bb272c8866017b973bef18237d | Create tests.py | tests.py | tests.py | Python | 0.000001 | @@ -0,0 +1,5 @@
+#...%0A
| |
234897a36cdf5a5cf5b7550f6d176f4168d7a6c7 | add basic test suite | tests.py | tests.py | Python | 0.000001 | @@ -0,0 +1,340 @@
+import os%0Aimport app%0Aimport unittest%0A%0A%0Aclass TestCase(unittest.TestCase):%0A%0A def setUp(self):%0A self.%0A self.app = app.app.test_client()%0A%0A def tearDown(self):%0A pass%0A%0A def test_index(self):%0A resp = self.app.get('/')%0A assert 'Hell... | |
4d3ed1ff13cde88abe695c724d7c8946578cde21 | Add py-docopt package (#8236) | var/spack/repos/builtin/packages/py-docopt/package.py | var/spack/repos/builtin/packages/py-docopt/package.py | Python | 0 | @@ -0,0 +1,1596 @@
+##############################################################################%0A# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.%0A# Produced at the Lawrence Livermore National Laboratory.%0A#%0A# This file is part of Spack.%0A# Created by Todd Gamblin, tgamblin@llnl.gov, All r... | |
889b6254526b5b49cd27d2f7bf7603a60f4f64fe | Add py-geeadd package (#12366) | var/spack/repos/builtin/packages/py-geeadd/package.py | var/spack/repos/builtin/packages/py-geeadd/package.py | Python | 0 | @@ -0,0 +1,1305 @@
+# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other%0A# Spack Project Developers. See the top-level COPYRIGHT file for details.%0A#%0A# SPDX-License-Identifier: (Apache-2.0 OR MIT)%0A%0Afrom spack import *%0A%0A%0Aclass PyGeeadd(PythonPackage):%0A %22%22%22Google Earth Engin... | |
f9b334b4fab221a7452f682a2748fe8b8a00daef | Fix decimal generation. | mixer/generators.py | mixer/generators.py | import datetime
import sys
import random
import decimal
from functools import wraps
DEFAULT_STRING_LENGTH = 8
DEFAULT_CHARS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' # nolint
def loop(get_func):
""" Make generator from function.
"""
@wraps(get_func)
def wrapper(*args, **kwarg... | Python | 0.001161 | @@ -184,16 +184,17 @@
3456789'
+
# nolin
@@ -3107,18 +3107,24 @@
lse
+(
-i
+ + 1)
, high=i
-1),
@@ -3119,17 +3119,19 @@
, high=i
--
+ -
1),%0A
@@ -3165,17 +3165,19 @@
r(high=d
--
+ -
1)%0A
|
06e7dd815a77739089b2ad0aed5cb9f01a194967 | Add script to normalize image using Ops | Normalize_Image.py | Normalize_Image.py | Python | 0 | @@ -0,0 +1,601 @@
+# @Dataset data%0A# @OpService ops%0A# @OUTPUT Img normalized%0A%0A# Create normalized image to the %5B0, 1%5D range.%0A#%0A# Stefan Helfrich (University of Konstanz), 03/10/2016%0A%0Afrom net.imglib2.type.numeric.real import FloatType%0Afrom net.imglib2.type.numeric.integer import ByteType%0Afrom ne... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.