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
676164caf2e498bef0294a7fe2ad0daf94da33bf
Put import statements into __init__
stingray/modeling/__init__.py
stingray/modeling/__init__.py
Python
0.000131
@@ -0,0 +1,720 @@ +# Licensed under MIT license - see LICENSE.rst%0A%0A%22%22%22%0ALibrary of Time Series Methods For Astronomical X-ray Data.%0A%22%22%22%0A%0A# Affiliated packages may add whatever they like to this file, but%0A# should keep this content at the top.%0A# ------------------------------------------------...
0875ddf7966ed0ca4ac336ac4f52c282c8ceb021
create lookup function to assist with player specific queries
pybaseball/playerid_lookup.py
pybaseball/playerid_lookup.py
Python
0
@@ -0,0 +1,1959 @@ +import pandas as pd%0Aimport requests%0Aimport io%0A%0A# dropped key_uuid. looks like a has we wouldn't need for anything. %0A# TODO: allow for typos. String similarity? %0A# TODO: allow user to submit list of multiple names%0A%0Adef get_lookup_table():%0A%09print('Gathering player lookup table. Thi...
a42f97104d2332f367041592b9ac05291c3b0240
Add scorekeeper plugin
pyhole/plugins/scorekeeper.py
pyhole/plugins/scorekeeper.py
Python
0
@@ -0,0 +1,3036 @@ +# Copyright 2015 Rick Harris%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 ...
73a9fb37479f3b4009f8f69f1c83c739479bee6f
Add index route (git hash)
zou/app/resources/index.py
zou/app/resources/index.py
Python
0
@@ -0,0 +1,289 @@ +from flask_restful import Resource%0Afrom zou.app.utils import git%0A%0A%0Aclass IndexResource(Resource):%0A def get(self):%0A git_hash = git.get_git_revision_hash()%0A return %7B%0A 'api': 'Unit Image Pipeline Server',%0A 'git_hash': git_hash.decode(%22utf-8%22...
1f636d352350259eea59b6a553254a9fa2509427
Enable adb root on devices.
build/android/provision_devices.py
build/android/provision_devices.py
#!/usr/bin/env python # # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Provisions Android devices with settings required for bots. Usage: ./provision_devices.py [-d <device serial number>] """ ...
Python
0.000022
@@ -4350,24 +4350,65 @@ ice_serial)%0A + device.old_interface.EnableAdbRoot()%0A install_
a6bf8321ddd5fee96037776bda7b9e79c1d5459f
Version bump to 0.13.0
mkdocs/__init__.py
mkdocs/__init__.py
__version__ = '0.13.0.dev'
Python
0
@@ -18,10 +18,6 @@ 13.0 -.dev '%0A
81d7588a3a79c5962d99dea6764a2c1675ce9665
test token method
tests/test_do_token.py
tests/test_do_token.py
Python
0.000002
@@ -0,0 +1,941 @@ +import os%0Aimport pytest%0A%0Afrom carto.do_token import DoTokenManager%0A%0A%0A@pytest.fixture(scope=%22module%22)%0Adef do_token_manager(api_key_auth_client):%0A %22%22%22%0A Returns a do token manager that can be reused in tests%0A :param api_key_auth_client: Fixture that provides a vali...
1523066235f47450dd88d334061ec31d0c78551a
add migration to update field choices and migrate data
cla_backend/apps/legalaid/migrations/0013_auto_20160414_1429.py
cla_backend/apps/legalaid/migrations/0013_auto_20160414_1429.py
Python
0
@@ -0,0 +1,2137 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Adef update_eod_categories(apps, schema_editor):%0A EODDetailsCategory = apps.get_model(%22legalaid%22, %22EODDetailsCategory%22)%0A for eod in EODDetailsCategory.objects.filt...
8091fc062541a0fb97ae556ea52927303b5bc73d
Add debug mode support to dokx-build-search index
dokx-search/dokx-build-search-index.py
dokx-search/dokx-build-search-index.py
""" Create and populate a minimal PostgreSQL schema for full text search """ import sqlite3 import glob import os import re import argparse parser = argparse.ArgumentParser() parser.add_argument("--output", type=str, help="Path to write SQLite3 search index") parser.add_argument('input', type=str, help="Path to inpu...
Python
0
@@ -256,16 +256,77 @@ index%22)%0A +parser.add_argument(%22--debug%22, type=bool, help=%22Debug mode%22)%0A parser.a @@ -406,16 +406,16 @@ files%22)%0A - args = p @@ -581,16 +581,71 @@ .input%0A%0A +def debug(msg):%0A if args.debug:%0A print(msg)%0A%0A def load @@ -953,21 +953,21 @@ -print +de...
a2dfa00b8a3b5ef9b969b0848ff3c933365a2eed
add transitional submodule
mriqc/interfaces/transitional.py
mriqc/interfaces/transitional.py
Python
0.000001
@@ -0,0 +1,2176 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-%0A# vi: set ft=python sts=4 ts=4 sw=4 et:%0A%0Afrom __future__ import print_function, division, absolute_import, unicode_literals%0A%0Afrom nipype.interfaces.base import File, ...
242f7d6ea3d733b08f60ad1f43fc490984989d30
add import script for Swale
polling_stations/apps/data_collection/management/commands/import_swale.py
polling_stations/apps/data_collection/management/commands/import_swale.py
Python
0
@@ -0,0 +1,776 @@ +from data_collection.management.commands import BaseShpStationsShpDistrictsImporter%0A%0Aclass Command(BaseShpStationsShpDistrictsImporter):%0A srid = 27700%0A council_id = 'E07000113'%0A districts_name = 'shp/Swale Polling Districts'%0A stations_name = 'shp/Swale Polling Stations.shp'%0A...
eceaf20ec82eebec70d1314f74c54eea8f51158c
Add TestShell class
test/functional/test_framework/test_shell.py
test/functional/test_framework/test_shell.py
Python
0
@@ -0,0 +1,2447 @@ +#!/usr/bin/env python3%0A# Copyright (c) 2019 The Bitcoin Core developers%0A# Distributed under the MIT software license, see the accompanying%0A# file COPYING or http://www.opensource.org/licenses/mit-license.php.%0A%0Afrom test_framework.test_framework import BitcoinTestFramework%0A%0Aclass TestSh...
3a2349cf86ed4562a911f3609f9b8c039d228989
test for phones and address done
test/test_addresses.py
test/test_addresses.py
Python
0
@@ -0,0 +1,627 @@ +from model.contact import Contact%0Afrom random import randrange%0A%0A__author__ = %22Grzegorz Holak%22%0A%0A%0Adef test_phones_on_home_page(app):%0A # when there is no contact - make one for test%0A if app.contact.count() == 0:%0A app.contact.create(Contact(first_name=%22jakies losowe%2...
a8bded67a92632fd6d2d8791dd245dc82c773c8d
Add an integration folder for tests that are beyond the unittest scope
integration/basic_server.py
integration/basic_server.py
Python
0
@@ -0,0 +1,2446 @@ +%22%22%22%0AThis is a basic test which allows you to setup a server and listen to it.%0A%0AFor example, running:%0A%0Apython integration/basic_server.py localhost 8040%0A%0ASets up a server.%0A%0ARunning curl against it generates the following reponse:%0A%0Acurl 'http://localhost:8040/'%0A%3Chtml%3E...
c34eb62d19c4216aa54199a083a06c2c45318cea
Add missing migration for IMEI db validation.
feedthefox/devices/migrations/0006_auto_20151110_1355.py
feedthefox/devices/migrations/0006_auto_20151110_1355.py
Python
0
@@ -0,0 +1,515 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0Aimport feedthefox.devices.models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('devices', '0005_auto_20151105_1048'),%0A %5D%0A%0A operations...
be02a2267564902398dc05c0aed43a297c98e619
Include traceback in returned output
proto/remote/python/robotremoteserver.py
proto/remote/python/robotremoteserver.py
import sys import inspect from StringIO import StringIO from SimpleXMLRPCServer import SimpleXMLRPCServer try: import signal except ImportError: signal = None class RobotRemoteServer(SimpleXMLRPCServer): def __init__(self, library, port=8270): SimpleXMLRPCServer.__init__(self, ('localhost', int...
Python
0.000001
@@ -19,16 +19,33 @@ inspect%0A +import traceback%0A from Str @@ -1459,17 +1459,16 @@ age':'', - 'output @@ -1660,16 +1660,23 @@ essage'%5D +, trace = self. @@ -1686,23 +1686,23 @@ t_error_ -message +details ()%0A @@ -1793,24 +1793,39 @@ -result%5B' + trace = None%0A output -'%5D = s ...
3d30708839236e65e7e83ce2baf8dd0364451fb5
add test_lastgenre.py
test/test_lastgenre.py
test/test_lastgenre.py
Python
0.000002
@@ -0,0 +1,1583 @@ +# This file is part of beets.%0A# Copyright 2014, Fabrice Laporte.%0A#%0A# Permission is hereby granted, free of charge, to any person obtaining%0A# a copy of this software and associated documentation files (the%0A# %22Software%22), to deal in the Software without restriction, including%0A# without...
5f01a1e6c8fe7230eaf9f72f27911537cda28647
add tender document views for stage2 UA, EU
openprocurement/tender/competitivedialogue/views/stage2/tender_document.py
openprocurement/tender/competitivedialogue/views/stage2/tender_document.py
Python
0
@@ -0,0 +1,1188 @@ +# -*- coding: utf-8 -*-%0Afrom openprocurement.api.utils import opresource%0Afrom openprocurement.tender.openeu.views.tender_document import TenderEUDocumentResource%0Afrom openprocurement.tender.openua.views.tender_document import TenderUaDocumentResource%0Afrom openprocurement.tender.competitivedi...
93b16422d29243280c8553236afaf77516f3466f
test parseLayoutFeatures function
tests/featureCompiler_test.py
tests/featureCompiler_test.py
Python
0.000002
@@ -0,0 +1,1997 @@ +from __future__ import (%0A print_function,%0A division,%0A absolute_import,%0A unicode_literals,%0A)%0Afrom textwrap import dedent%0Aimport logging%0Afrom fontTools.feaLib.error import IncludedFeaNotFound%0Afrom ufo2ft.featureCompiler import (%0A FeatureCompiler,%0A MtiFeatureComp...
b3b7e2fcbff5cd0ec2d2b4457b7a46d1846d55a8
Implement a generic Vispy widget
glue_vispy_viewers/common/vispy_viewer.py
glue_vispy_viewers/common/vispy_viewer.py
Python
0.000292
@@ -0,0 +1,1793 @@ +from __future__ import absolute_import, division, print_function%0A%0Aimport sys%0A%0Afrom vispy import scene%0Afrom glue.external.qt import QtGui, get_qapp%0A%0A%0Aclass VispyWidget(QtGui.QWidget):%0A%0A def __init__(self, parent=None):%0A%0A super(VispyWidget, self).__init__(parent=paren...
5883232eed25cf96ca275af6904d284201306c0a
Add an __init__.py that exposes all the modules from the package.
__init__.py
__init__.py
Python
0
@@ -0,0 +1,161 @@ +# Expose the modules of the package.%0A%0Aimport flags%0Aimport generator%0Aimport jsdoc%0Aimport linkify%0Aimport namespace%0Aimport scanner%0Aimport source%0Aimport symboltypes%0A
10e4c82f0d3440ffd4737589870b85c61a83d1b8
add init for import
__init__.py
__init__.py
Python
0
@@ -0,0 +1,30 @@ +from no_csrf import nicer_get%0A
5beae4a29f973ab3980f00cf180c0d571e84a79e
Create __init__.py
__init__.py
__init__.py
Python
0.000429
@@ -0,0 +1,1359 @@ +#!/usr/bin/python%0A# -*- coding: utf-8 -*-%0A%0A%22%22%22%0ATileMap loader for python for Tiled, a generic tile map editor%0Afrom http://mapeditor.org/ .%0AIt loads the %5C*.tmx files produced by Tiled.%0A%0A%0A%22%22%22%0A__all__ = %5B%22tmxreader%22%5D%0A%0Afrom . import tmxreader%0Atry:%0A fr...
1c12cd1811afb21e44a295d42be24169d042bfcb
Create __init__.py
__init__.py
__init__.py
Python
0.000429
@@ -0,0 +1 @@ +%0A
5e370df87e4846e6673d4566cef0291a43cde883
Create __init__.py
__init__.py
__init__.py
Python
0.000429
@@ -0,0 +1 @@ +%0A
3c9a6b871011dfed53c8c5c820aee62c90d04344
add new parser class to computer's cortex
OnStage/parser_abilities.py
OnStage/parser_abilities.py
Python
0
@@ -0,0 +1,1135 @@ +class Parser(object):%0A%0A def get_empty_square(self, options, code):%0A row_1 = %5B0, %5B0,1,2%5D%5D%0A row_2 = %5B1, %5B3,4,5%5D%5D%0A row_3 = %5B2, %5B6,7,8%5D%5D%0A col_1 = %5B3, %5B0,3,6%5D%5D%0A col_2 = %5B4, %5B1,4,7%5D%5D%0A col_3 = %5B5, %5B2,5,8%5D%5D...
e7879fa6a123013501e6cddabc073d17d643e42b
Create EPICLocSearch_size.py
EPICLocSearch_size.py
EPICLocSearch_size.py
Python
0
@@ -0,0 +1,717 @@ +%22 %22 %22 this file was created in november 2014%0Aas part of a de novo search for EPIC loci in %0Athe chaetognath species Pterosagitta draco%0Aproperty of dr. Ferdinand Marl%C3%A9taz%0A%22 %22 %22%0A%0A#!/usr/bin/env python%0Aimport sys%0Afrom collections import defaultdict%0Aflanks=defaultdict(li...
44b21e3742ae1545d635026601841ecca37392dd
Add lambda to the list of things safer_eval can't do.
flexget/plugins/filter/if_condition.py
flexget/plugins/filter/if_condition.py
import logging import re import datetime from copy import copy from collections import defaultdict from flexget.feed import Feed from flexget.plugin import register_plugin, plugins as all_plugins, get_plugin_by_name, phase_methods log = logging.getLogger('if') def safer_eval(statement, locals): """A safer eval f...
Python
0.999999
@@ -629,16 +629,23 @@ %7Ctry%5Cs*: +%7Clambda ', state @@ -677,22 +677,28 @@ eError(' -%5C'__%5C' +%60__%60, lambda or try @@ -1306,25 +1306,32 @@ ain -%5C'__%5C' or %5C'try%5C' +%60__%60, %60try%60 or %60lambda%60 sta @@ -1385,16 +1385,23 @@ %7Ctry%5Cs*: +%7Clambda )')%0A
8994f69f23271aa93d83e81032542f17b38423fd
Add custom IPython configuration ✨
.ipython/profile_default/ipython_config.py
.ipython/profile_default/ipython_config.py
Python
0
@@ -0,0 +1,2409 @@ +%22%22%22%0AIPython configuration with custom prompt using gruvbox colors.%0A- https://github.com/reillysiemens/ipython-style-gruvbox%0A%0AThanks to @petobens for their excellent dotfiles.%0A- https://github.com/petobens/dotfiles%0A%22%22%22%0Afrom typing import List, Optional, Tuple%0A%0Aimport IPy...
12428f3aebc8ef54b8308f676b3d7b7d7e3077e7
add ingestion of tar files form SNEX
trunk/bin/ingesttar.py
trunk/bin/ingesttar.py
Python
0
@@ -0,0 +1,1041 @@ +#/usr/bin/env python%0A%0Aimport lsc%0Aimport sys%0Aimport os%0Aimport re%0Aimport string%0Aimport tarfile%0Afrom optparse import OptionParser%0A_dir = os.environ%5B'LCOSNDIR'%5D%0A%0Adef ingesttar(_tarfile,force=False):%0A _targetid = re.sub('.tar.gz','',string.split(_tarfile,'_')%5B-1%5D)%0A ...
c42f891b8d11efba950876b9c4eb7a77cc08c743
move to correct directory
tweepy/urbanTwitBot.py
tweepy/urbanTwitBot.py
Python
0
@@ -0,0 +1,911 @@ +#!/usr/bin/env python%0Afrom bs4 import BeautifulSoup%0Aimport requests%0Aimport tweepy%0Afrom config import *%0A%0Aurl = 'http://www.urbandictionary.com/'%0Apage = requests.get(url)%0Asoup = BeautifulSoup(page.text, %22lxml%22)%0Adata = dict()%0Adata%5B'def'%5D = soup(class_ = 'meaning')%5B0%5D.text...
b3b5337ddcc5984602eab46a085e976028ff2a77
Add initial implementation of the LayerNormalizationLayer
LayerNormalization.py
LayerNormalization.py
Python
0
@@ -0,0 +1,2702 @@ +import numpy as np%0Aimport theano%0Aimport theano.tensor as T%0Aimport lasagne%0A%0A__all__ = %5B%0A %22LayerNormalizationLayer%22%0A%5D%0A%0Aclass LayerNormalizationLayer(Layer):%0A %22%22%22%0A LayerNormalizationLayer(incoming, feat_dims,%0A alpha=lasagne.init.Constant(1.0), beta=lasa...
dfeca2aea76f226cfcf3ed06bbcfdcdf7f7d2f44
Add member event
captain_hook/services/github/events/member.py
captain_hook/services/github/events/member.py
Python
0
@@ -0,0 +1,1559 @@ +# -*- coding: utf-8 -*-%0Afrom __future__ import absolute_import%0Afrom . import GithubEvent%0A%0A%0Aclass MemberEvent(GithubEvent):%0A%0A def process(self, request, body):%0A sender_link = body%5B'sender'%5D%5B'html_url'%5D.replace('https://github.com/', '')%0A user_link = body%5B'...
1c7f6a6c44af9c2de372fb2c07469da29bc11764
Add tests for encoding subsystem
tests/test_encoding.py
tests/test_encoding.py
Python
0
@@ -0,0 +1,1680 @@ +from diana.encoding import encode, decode%0Afrom nose.tools import eq_%0A%0ADECODE_TESTS = %5B ('', (), ()),%0A ('b', (0x00,), (0,)),%0A ('BB', (0x12, 0xfe), (0x12, 0xfe)),%0A ('bb', (0x12, 0xfe), (0x12, -2)),%0A ('s', (0x12, 0x34), (0x...
93a1ff67e62d0508744420cab8263a8cc893b119
Add example listing backup counts
test/list_backup_counts.py
test/list_backup_counts.py
Python
0
@@ -0,0 +1,1227 @@ +import urbackup_api%0D%0A%0D%0Aserver = urbackup_api.urbackup_server(%22http://127.0.0.1:55414/x%22, %22admin%22, %22foo%22)%0D%0A%0D%0Aclients = server.get_status()%0D%0A%0D%0Afor client in clients:%0D%0A %0D%0A file_backups = server.get_clientbackups(client%5B%22id%22%5D)%0D%0A %0D%0A ...
eafd611428c4206ba15bada0996b362ee74e0d3a
Create app.py
server/app.py
server/app.py
Python
0.000003
@@ -0,0 +1,1958 @@ +#server%0Afrom flask import Flask, render_template, request%0Aimport requests%0Aimport pickle%0Afrom mapper import Mapper%0Afrom multiprocessing import Process%0Aimport json%0Aimport time%0Afrom subprocess import call%0A%0Aapp = Flask(__name__)%0A%0A@app.route(%22/remove/%3Cwebsite%3E%22,methods=%5B...
16f0ec2d0e5c33126ddb01604213c6a14115e605
Add basic test of pocket_parser.
test/test_pocket_parser.py
test/test_pocket_parser.py
Python
0
@@ -0,0 +1,613 @@ +import unittest%0Aimport utils%0Aimport os%0Aimport sys%0Aimport re%0Aimport subprocess%0A%0ATOPDIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))%0Asys.path.append(TOPDIR)%0Aimport pocket_parser%0A%0Aclass Tests(unittest.TestCase):%0A%0A def test_get_cnc(self):%0A %22%22%...
4f722f576f2e14da5373b0a2da3e6ba5d94e37d9
add simple dumb script to find XOR keys that are revealed by padding
src/scripts/findxor.py
src/scripts/findxor.py
Python
0
@@ -0,0 +1,1552 @@ +#!/usr/bin/python%0A%0A## Binary Analysis Tool%0A## Copyright 2015 Armijn Hemel for Tjaldur Software Governance Solutions%0A## Licensed under Apache 2.0, see LICENSE file for details%0A%0A'''%0AFind XOR key using some very superdumb methods.%0A%0AThe idea is to exploit the idea that padding is used ...
7021806e9e510286424dae696c2f4eee0a70b630
Define default crispy form helper
src/forms.py
src/forms.py
Python
0.000001
@@ -0,0 +1,361 @@ +#-*- coding: utf-8 -*-%0A%0Afrom __future__ import unicode_literals%0A%0Aimport crispy_forms.helper%0A%0A%0Aclass DefaultFormHelper(crispy_forms.helper.FormHelper):%0A def __init__(self, form=None):%0A super(DefaultFormHelper, self).__init__(form=form)%0A self.form_class = %22form-ho...
a7820c3a317c9d6ff2f3585eecd3e05c47364afe
Create A_Okubo_weiss_results.py
Cas_6/Okubo_Weiss/A_Okubo_weiss_results.py
Cas_6/Okubo_Weiss/A_Okubo_weiss_results.py
Python
0.000001
@@ -0,0 +1,88 @@ +# First iteration%0A%0A!%5Balt tab%5D()%0A%0A%0A# Last iteration%0A%0A!%5Balt tab%5D()%0A%0A# Movie%0A%0A!%5Balt tab%5D()%0A
0ff6a460c2d6871c95c30f9a84b48b8835d208cc
Update rfxtrx.py
homeassistant/components/sensor/rfxtrx.py
homeassistant/components/sensor/rfxtrx.py
""" homeassistant.components.sensor.rfxtrx ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Shows sensor values from RFXtrx sensors. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.rfxtrx.html """ import logging from collections import OrderedDict from home...
Python
0.000002
@@ -989,23 +989,16 @@ ce(event -.device , Sensor
49db30bdb872d88c343a2ab480c294d1802b301b
Create trash.py
gui/trash.py
gui/trash.py
Python
0.000262
@@ -0,0 +1 @@ +%0A
a8848ccb72c2513b7c42809d43359023ff158db6
Add sync file, not using it yet though
modules/sync.py
modules/sync.py
Python
0
@@ -0,0 +1,933 @@ +# -*- coding: utf-8 -*-%0A%0Aimport operator%0A%0Aclass Sync(object):%0A %0A def __init__(self):%0A pass%0A%0A def run(self, from_storage, to_storage):%0A self._from_storage = from_storage%0A self._to_storage = to_storage%0A self._from_folders = sorted(from_storag...
08ee789d0dc6b4b29e25dc23683d6874c886a69d
Include generate-credentials.py from ga-collector
tools/generate-credentials.py
tools/generate-credentials.py
Python
0
@@ -0,0 +1,1810 @@ +%22%22%22%0AGenerate required credentials files from a downloaded client_secret.json.%0A%0AWhen setting up a Google API account you are provided with a%0Aclient_secret.json. You need to generate refresh and access tokens to use the%0AAPI.%0AFor more information see:%0A%0Ahttp://bit.ly/py-oauth-docs%...
8919cf7171d7a659c0b90c41f2520029bab1423e
Add tool to extract build process from .travis.yml
scripts/run_travis.py
scripts/run_travis.py
Python
0
@@ -0,0 +1,1332 @@ +#!/usr/bin/env python3%0A%0Aimport argparse%0Aimport sys%0Aimport pprint%0Aimport shlex%0Aimport yaml%0A%0Afrom pathlib import Path%0A%0A%0Adef gen_test_script(ty, job, output):%0A output.write('#!/usr/bin/env bash%5Cn%5Cn')%0A output.write('set -ex%5Cn')%0A%0A # extract environment variabl...
015291b5d894d0d7a74725bf0846ad88e5c85522
Add a setup file
PythonClient/setup.py
PythonClient/setup.py
Python
0.000002
@@ -0,0 +1,334 @@ +from distutils.core import setup%0A%0Asetup(name='PythonClient',%0A version='1.0',%0A description='Python Distribution Utilities',%0A author='Denis Yakovenko',%0A author_email='yakovenko.denis.a@gmail.com',%0A url='https://www.github.com/yakovenkodenis/websockets_secure_chat'...
d186c80feb7dee875a1a7debfd115e100dc3fca1
Add a cronjob script for sending studentvoice notifications.
send_studentvoices.py
send_studentvoices.py
Python
0
@@ -0,0 +1,1853 @@ +import os%0A%0Aif __name__ == %22__main__%22:%0A os.environ.setdefault(%22DJANGO_SETTINGS_MODULE%22, %22studentportal.settings%22)%0A%0Afrom django.core.urlresolvers import reverse%0Afrom django.conf import settings%0A%0Afrom post_office import mail%0Afrom studentvoice.models import Voice%0A%0Afo...
f43b9e44d30c9ac2800ca7559bdff84d06d64bc5
Add LDAP code
flask_cas/osc_ldap.py
flask_cas/osc_ldap.py
Python
0.000001
@@ -0,0 +1,1909 @@ +import json%0Aimport ldap%0Aimport sys%0Aimport hashlib%0Afrom flask import current_app, session%0A%0Aldap.set_option(ldap.OPT_DEBUG_LEVEL, 0)%0A# turn off referrals%0Aldap.set_option(ldap.OPT_REFERRALS, 0)%0A# version 3%0Aldap.set_option (ldap.OPT_PROTOCOL_VERSION, ldap.VERSION3)%0A# allow self-sig...
102f10b680335c970a8322cda35cccd347a76baf
define template for performing mashup
flickipedia/mashup.py
flickipedia/mashup.py
Python
0
@@ -0,0 +1,2087 @@ +%22%22%22%0A Author: Ryan Faulkner%0A Date: October 19th, 2014%0A%0A Container for mashup logic.%0A%22%22%22%0A%0A%0Adef get_article_count():%0A %22%22%22%0A Fetch total article count%0A :return: int; total count of articles%0A %22%22%22%0A pass%0A%0A%0Adef get_max_artic...
b3161dce27574146ccb2df509a4846b51e67dfb4
check a request for a still-not-closed MUC channel fails
tests/twisted/muc/presence-before-closing.py
tests/twisted/muc/presence-before-closing.py
""" Test for fd.o#19930. """ import dbus from twisted.words.xish import domish from gabbletest import exec_test, make_result_iq from servicetest import (EventPattern, assertEquals, assertLength, assertContains, sync_dbus, call_async) import constants as cs import ns from mucutil import join_muc, echo_muc_pr...
Python
0
@@ -949,19 +949,17 @@ the MUC. -.. %0A + even @@ -1090,44 +1090,559 @@ # -...which the conference server echos +while we wait for the conference server to echo our unavailable%0A # presence, we try and create the same channel again...%0A call_async(q, conn.Requests, 'CreateChannel', %7B%0A c...
d30e019459d1ef026b95739716d2d3a7d791575e
Add bytearray basic tests.
tests/basics/bytearray1.py
tests/basics/bytearray1.py
Python
0
@@ -0,0 +1,148 @@ +a = bytearray(%5B1, 2, 200%5D)%0Aprint(a%5B0%5D, a%5B2%5D)%0Aprint(a%5B-1%5D)%0Aa%5B2%5D = 255%0Aprint(a%5B-1%5D)%0Aa.append(10)%0Aprint(len(a))%0A%0As = 0%0Afor i in a:%0A s += i%0Aprint(s)%0A
d8df1ca5d4c0c346496e2a190be8a63a7249e578
Add sort code.
sort/sort.py
sort/sort.py
Python
0.000001
@@ -0,0 +1,1096 @@ +#!/path/to/python%0A%0Adef merge_sort(items):%0A if items is None:%0A return%0A%0A helper = %5B%5D%0A merge_sort_impl(items, helper, 0, len(items))%0A%0Adef merge_sort_impl(items, helper, start, end):%0A if (end - start) %3C= 1:%0A return%0A mid = (end - start) / 2 + sta...
a9f1ccaeae554ccc3515e1fc28e1bc4b3822b856
Add base code for all examples
examples/base.py
examples/base.py
Python
0
@@ -0,0 +1,165 @@ +from __future__ import print_function%0A%0Afrom openload import OpenLoad%0A%0Ausername = 'FTP Username/API Login'%0Akey = 'FTP Password/API Key'%0A%0Aol = OpenLoad(username, key)%0A
c5e83b84f490544c99bf119cc1fca0efee83e665
Add test for manager.py
dcclient/tests/test_manager.py
dcclient/tests/test_manager.py
Python
0.000001
@@ -0,0 +1,935 @@ +import testtools%0Aimport dcclient.xml_manager.manager as mg%0Aimport dcclient.xml_manager.data_structures as ds%0A%0A%0Aclass main_test(testtools.TestCase):%0A def test_findVlan(self):%0A # tests if none type is return when vlan is not found%0A xml = mg.ManagedXml()%0A%0A ans...
eb9ba88177ce23ef259b1731f02c38d0ccaa8318
Add new script to build Dogecoin
run_build.py
run_build.py
Python
0.000001
@@ -0,0 +1,930 @@ +#!/usr/bin/python3%0A%0Aimport re%0Aimport os%0Aimport string%0Aimport sys%0Aimport subprocess%0Aimport auto_merge%0A%0Adef compile_dogecoin():%0A path = os.getcwd()%0A subprocess.check_output(%5Bpath + os.path.sep + 'autogen.sh'%5D)%0A subprocess.check_output(%5Bpath + os.path.sep + 'configure'%5...
07e1dfcc4c76490a888eb1e93b649962d60a78fb
add unittest
test/test_poyonga.py
test/test_poyonga.py
Python
0.000001
@@ -0,0 +1,1355 @@ +import struct%0Aimport unittest%0Afrom mock import patch, Mock%0Afrom poyonga import Groonga, GroongaResult%0A%0A%0Aclass PoyongaHTTPTestCase(unittest.TestCase):%0A%0A def setUp(self):%0A self.g = Groonga()%0A%0A @patch('poyonga.client.urlopen')%0A def test_json_result_with_http(self...
9bb3e11a4a983d9e9215bcd8805360968e9afa7f
Add improved decorator
webhooks/decorators.py
webhooks/decorators.py
Python
0.000002
@@ -0,0 +1,1043 @@ +from django.conf import settings%0Afrom django.http import HttpResponseForbidden%0Afrom functools import wraps%0Afrom twilio.util import RequestValidator%0A%0Aimport os%0A%0A%0Adef validate_twilio_request(f):%0A %22%22%22Validates that incoming requests genuinely originated from Twilio%22%22%22%0...
2d2dabc82f2787b6c0a1bc6a5373daa891db4ce7
Create command line file
greengraph/command.py
greengraph/command.py
Python
0.000006
@@ -0,0 +1,854 @@ +__author__ = 'third'%0Afrom argparse import ArgumentParser%0Afrom greengraph.PlotGraph import PlotGraph%0A%0A%0Adef process():%0A parser = ArgumentParser(%0A description=%22Produce a graph of number of green pixels in satellite images between two locations%22)%0A parser.add_argument(%22-...
7691c9a886d76d6051b2ae3cb6e5750b2ba9c617
add simple/dubiously effective tests for leg profile view
billy/web/public/tests/legislator_detail.py
billy/web/public/tests/legislator_detail.py
Python
0
@@ -0,0 +1,272 @@ +%0A%0Aimport requests%0A%0Afrom billy.models import db%0A%0A%0Adef test_gets(states):%0A for leg in db.legislators.find(%7B%7D, %5B'_id'%5D):%0A requests.get('http://127.0.0.1:8000/ca/legislator/%25s/' %25 leg%5B'_id'%5D)%0A%0A%0Aif __name__ == '__main__':%0A%0A import sys%0A%0A test_...
3f95fd7174f740600c8c11dd2693a7775d06b945
add missing file
source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_service.py
source/jormungandr/jormungandr/scenarios/ridesharing/ridesharing_service.py
Python
0.000003
@@ -0,0 +1,2665 @@ +# Copyright (c) 2001-2018, Canal TP and/or its affiliates. All rights reserved.%0A#%0A# This file is part of Navitia,%0A# the software to build cool stuff with public transport.%0A#%0A# Hope you'll enjoy and contribute to this project,%0A# powered by Canal TP (www.canaltp.fr).%0A# Help us si...
aff107497d202da3d41541cf0cd24e2c29c6ddbf
Add TCL executor; #58
executors/TCL.py
executors/TCL.py
Python
0
@@ -0,0 +1,2240 @@ +from .resource_proxy import ResourceProxy%0Afrom .utils import test_executor%0Afrom cptbox import SecurePopen, CHROOTSecurity, PIPE%0Afrom judgeenv import env%0Afrom subprocess import Popen, PIPE as sPIPE%0Afrom cptbox.syscalls import *%0Aimport errno%0A%0ATCL_FS = %5B'.*%5C.(so%7Ctcl)', '/etc/nsswi...
12e42bbe06bea5a0f86e95630b184e86b41c95c7
switch SgmlLinkExtractor to .getall
scrapy/linkextractors/sgml.py
scrapy/linkextractors/sgml.py
""" SGMLParser-based Link extractors """ import six from six.moves.urllib.parse import urljoin import warnings from sgmllib import SGMLParser from w3lib.url import safe_url_string, canonicalize_url from w3lib.html import strip_html5_whitespace from scrapy.link import Link from scrapy.linkextractors import FilteringLi...
Python
0
@@ -5628,23 +5628,22 @@ path(x). -extract +getall ()%0A
46eaacef6240a72089bda049214640c50ec353ec
Add tests for robots APIs
backend/globaleaks/tests/handlers/test_robots.py
backend/globaleaks/tests/handlers/test_robots.py
Python
0.000001
@@ -0,0 +1,2144 @@ +# -*- coding: utf-8 -*-%0Aimport json%0A%0Afrom twisted.internet.defer import inlineCallbacks%0Afrom globaleaks.handlers import robots%0Afrom globaleaks.models import config%0Afrom globaleaks.rest import requests%0Afrom globaleaks.settings import GLSettings%0Afrom globaleaks.tests import helpers%0A%...
4fc115d4297f645177854347e32c36128140caf6
Create blastx_filter.py
scripts/blastx_filter.py
scripts/blastx_filter.py
Python
0.000003
@@ -0,0 +1,1548 @@ +# -*- coding: utf-8 -*-%0A%0A##############################################################################################%0A# Prints the best hit of the blastx along with the alignment lenght and e value. %0A#########################################################################################...
ae14f171ea6538bef026f1d1e3441194132eef28
Add challenge 5
5.py
5.py
Python
0.000001
@@ -0,0 +1,275 @@ +#!/usr/bin/env python2%0A# -*- coding: utf-8 -*-%0A%0Aimport urllib2, pickle, re%0A%0Asource = pickle.loads(urllib2.urlopen('http://www.pythonchallenge.com/pc/def/banner.p').read())%0Atext = ''.join(x*y for i in source for x,y in i)%0A%0Aprint re.sub(%22(.%7B95%7D)%22, %22%5C%5C1%5Cn%22, text, 0, re....
3e3e5bb92b1d9e0e1981a6deba41152826c3fce0
Add script to plot population vs distinct hashtags.
scripts/popvsdistinct.py
scripts/popvsdistinct.py
Python
0
@@ -0,0 +1,1153 @@ +%22%22%22%0APlot and calculate county population size to number of distinct hashtags.%0A%0A%22%22%22%0Aimport matplotlib.pyplot as plt%0Aimport seaborn%0Aimport pandas%0Aimport twitterproj%0Aimport scipy.stats%0Aimport numpy as np%0A%0Adef populations():%0A # Grab demographic info%0A data = %7...
483076d12e8eb7adec46a59c7ea65ad772de3fe5
Create __init__.py
anemoi/analysis/__init__.py
anemoi/analysis/__init__.py
Python
0.000429
@@ -0,0 +1 @@ +%0A
0188904980379ee53827cad85a558ec074db357d
Update default filename for alexa-top-10000
namebench.py
namebench.py
#!/usr/bin/env python # Copyright 2009 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...
Python
0
@@ -3131,16 +3131,22 @@ t='data/ +alexa- top-1000 @@ -3146,16 +3146,23 @@ op-10000 +-global .txt',%0A
d67a74508da9d2cdd384b823a863799655e1f087
Add users_helper.py
app/helpers/users_helper.py
app/helpers/users_helper.py
Python
0.00001
@@ -0,0 +1,741 @@ +from config import site%0Afrom random import random%0Afrom app.models.user import User%0Afrom werkzeug.security import generate_password_hash%0A%0Aclass UsersHelper(object):%0A def __init__(self, app):%0A self.app = app%0A%0A def get_user(self, github_id):%0A return User.query.fil...
80677816e390737e9efdd8e81f1e6c02326f3d04
Outputs incremented alphabet
increment_alphabet.py
increment_alphabet.py
Python
0.999999
@@ -0,0 +1,455 @@ +# Procedure shift_n_letters takes as its input a lowercase%0A# letter, a-z, and an integer n, and returns the letter n steps in the%0A# alphabet after it. Note that 'a' follows 'z', and that n can be positive,%0A#negative or zero.%0A%0Adef shift_n_letters(letter, n):%0A return chr(((ord(letter)-97...
695ad7229c5ff1355549ac0e22a498b6fac25947
add reuse port test
syslog-forwarder/reuseport_forwarder.py
syslog-forwarder/reuseport_forwarder.py
Python
0
@@ -0,0 +1,866 @@ +#!/usr/bin/env python%0A%0Aimport sys, socket, time%0Afrom multiprocessing import Process%0A%0APORT = 514%0ANR_LISTENERS = 2%0A%0ASO_REUSEPORT = 15%0A%0ABUFSIZE = 1025%0A#DST_HOST = %2210.206.116.22%22%0ADST_HOST = %22192.168.11.13%22%0A%0Adef listener_work(num):%0A s = socket.socket(socket.AF_INE...
465a604547e1438e650c8b4142816e2330363767
Add a test for storing iterable to a list slice.
tests/cpydiff/types_list_store_noniter.py
tests/cpydiff/types_list_store_noniter.py
Python
0
@@ -0,0 +1,266 @@ +%22%22%22%0Acategories: Types,list%0Adescription: List slice-store with non-iterable on RHS is not implemented%0Acause: RHS is restricted to be a tuple or list%0Aworkaround: Use %60%60list(%3Citer%3E)%60%60 on RHS to convert the iterable to a list%0A%22%22%22%0Al = %5B10, 20%5D%0Al%5B0:1%5D = range(4...
d6d4f175330638f35d4eb0512ef14f82eab74f50
Add a debug tool to show advertising broadcasts
show-adverts.py
show-adverts.py
Python
0
@@ -0,0 +1,997 @@ +# -*- coding: utf-8 -*-%0Aimport os, sys%0Aprint(sys.version_info)%0Aimport marshal%0Aimport select%0Aimport socket%0Aimport time%0A%0Adef _unpack(message):%0A return marshal.loads(message)%0A%0Adef _pack(message):%0A return marshal.dumps(message)%0A %0APORT = 9999%0AMESSAGE_SIZE = 256%0A ...
b5c156fc8023e2752a659ea661c66973f612d753
add tiny logger
logger.py
logger.py
Python
0.000015
@@ -0,0 +1,746 @@ +#!/usr/bin/python%0A%0Aclass Logger(object):%0A %22%22%22%0A tiny logger%0A %22%22%22%0A%0A SUCCESS = '%5C033%5B92m'%0A ERROR = '%5C033%5B91m'%0A WARN = '%5C033%5B93m'%0A ENDC = '%5C033%5B0m'%0A%0A def info(self, message):%0A %22%22%22%0A print info messa...
663f7b2fd3db928c33674a32112ed6741e699ded
Add some missing migrations
blog/migrations/0006_auto_20170307_1943.py
blog/migrations/0006_auto_20170307_1943.py
Python
0.000012
@@ -0,0 +1,1413 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.9.4 on 2017-03-07 19:43%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0Aimport django.utils.timezone%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('blog', '0005_auto_20...
11f878977e6e6db9bf8f248e00cc2742835fc75e
add nextproginstr tests
tests/test_commands_next.py
tests/test_commands_next.py
Python
0
@@ -0,0 +1,1352 @@ +import gdb%0A%0Aimport pwndbg.gdblib.regs%0Aimport tests%0A%0AREFERENCE_BINARY = tests.binaries.get(%22reference-binary.out%22)%0A%0A%0Adef test_command_nextproginstr_binary_not_running():%0A out = gdb.execute(%22nextproginstr%22, to_string=True)%0A assert out == %22nextproginstr: The program ...
4ff639b397d157aba25f83d4f497260d5ffe9e86
fix optional reports (also needs to run install_views command)
boris/reporting/migrations/0001_initial.py
boris/reporting/migrations/0001_initial.py
Python
0
@@ -0,0 +1,2731 @@ +# -*- 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 %5D%0A%0A operations = %5B%0A migrations.CreateModel(%0A name='SearchEncounter',%0A ...
bf259361d38a61b4f3248602356dfc4f85b7c3dd
add glim commands
glim/commands.py
glim/commands.py
Python
0.999967
@@ -0,0 +1,932 @@ +from command import GlimCommand%0Afrom termcolor import colored%0Afrom utils import copytree%0Aimport os%0Aimport traceback%0A%0Aclass NewCommand(GlimCommand):%0A%0A%09name = 'new'%0A%09description = 'generates a new glim app'%0A%0A%09def run(self, app):%0A%09%09proto_path = 'glim/proto/project'%0A%0...
ac28cf005e8f4e800b5dee2f0ede36fa56890b64
Add top-level issues.
pyglab/issues.py
pyglab/issues.py
Python
0
@@ -0,0 +1,349 @@ +from .apirequest import RequestType%0A%0Aclass Issues(objects):%0A def __init__(self, pyglab):%0A self._pyglab = pyglab%0A%0A def get(self, sudo=None, page=None, per_page=None):%0A url = '/issues'%0A r = self._pyglab.request(RequestType.GET, url,%0A ...
cb5c500af5ca25f4cd96a35114dde59578d15170
Create tests_diff_between_times.py
tests_diff_between_times.py
tests_diff_between_times.py
Python
0.000003
@@ -0,0 +1,454 @@ +import pytest%0Aimport diff_between_times%0A%0Adef test_validate_date():%0A val = ('2021-09-15 00:00:00')%0A assert diff_between_times.validate_date(None, None, val) == val%0A %0A with pytest.raises(Exception):%0A val = ('2021-09-15 00:')%0A assert diff_between_times.validat...
c3b7a84cbc7b557909a00990c976b4abdeefea35
Use olpc matchbox theme
shell/session/Session.py
shell/session/Session.py
import os import gtk import gobject import time import re import dbus import dbus.dbus_bindings from sugar.presence import PresenceService from Shell import Shell from ConsoleWindow import ConsoleWindow from session.Process import Process import sugar.env class DbusProcess(Process): def __init__(self): config = s...
Python
0
@@ -721,40 +721,8 @@ f):%0A -%09%09options = '-use_titlebar no'%0A%0A %09%09kb @@ -798,13 +798,11 @@ ons -+ = ' - -kbd @@ -810,16 +810,17 @@ onfig %25s + ' %25 kbd_ @@ -827,16 +827,45 @@ config%0A%0A +%09%09options += '-theme olpc '%0A%0A %09%09comman @@ -895,16 +895,17 @@ nager %25s + ' %25 opti @@ -912...
984381d614f181f1d48104fe6043191b626e636b
Create soundtest.py
soundtest.py
soundtest.py
Python
0.000003
@@ -0,0 +1 @@ +%0A
c7138bd5ae465d072f86b89bff166cca34c82cdd
添加 escape 的测试
tests/test_escape.py
tests/test_escape.py
Python
0
@@ -0,0 +1,869 @@ +# coding=utf-8%0A# author@alingse%0A# 2016.11.21%0A%0Aimport unittest%0A%0Afrom jsoncsv.utils import encode_safe_key, decode_safe_key%0A%0A%0Aclass Testescape(unittest.TestCase):%0A%0A def test_all(self):%0A path = %5B'A', 'B', '..', '%5C.%5C%5Cww'%5D%0A%0A for sep in 'AB.w':%0A ...
4a70f9ed2f19cba08208fa9f2a3cafe38ee283b6
Add simple test for column expansion
corehq/apps/userreports/tests/test_columns.py
corehq/apps/userreports/tests/test_columns.py
from django.test import SimpleTestCase from jsonobject.exceptions import BadValueError from corehq.apps.userreports.reports.specs import ReportColumn class TestReportColumn(SimpleTestCase): def testBadAggregation(self): with self.assertRaises(BadValueError): ReportColumn.wrap({ ...
Python
0
@@ -79,16 +79,98 @@ lueError +%0Afrom sqlagg import SumWhen%0Afrom corehq.apps.userreports.sql import _expand_column %0A%0Afrom c @@ -1157,28 +1157,553 @@ e%22: %22field%22,%0A %7D)%0A +%0A%0Aclass TestExpandReportColumn(SimpleTestCase):%0A%0A def test_expansion(self):%0A column = ReportColumn(%...
643456f6f1bb9f264dbe6d3ad48a84af4e4dd91c
Add data migrations for rulesets
temba/flows/migrations/0087_fix_open_ended_ruleset_with_timeout.py
temba/flows/migrations/0087_fix_open_ended_ruleset_with_timeout.py
Python
0.000001
@@ -0,0 +1,1394 @@ +# -*- coding: utf-8 -*-%0A# Generated by Django 1.10.5 on 2017-01-26 08:42%0Afrom __future__ import unicode_literals%0A%0Aimport json%0A%0Afrom django.db import migrations%0A%0A%0Adef fix_ruleset_categories_open_ended(RuleSet):%0A rulesets = list(RuleSet.objects.all())%0A if not rulesets:%0A ...
d2b6abe7535635d2bf8f0c13b87e3ca382f1559d
Add an echo server program for local testing
setup/tcp-echo-server/echo.py
setup/tcp-echo-server/echo.py
Python
0
@@ -0,0 +1,467 @@ +# Echo server program%0Aimport socket%0A%0AHOST = '' # Symbolic name meaning all available interfaces%0APORT = 4444 # Arbitrary non-privileged port%0Awith socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:%0A s.bind((HOST, PORT))%0A s.listen(1)%0A conn, addr...
e4bec0203c19f5e9204a41de530f93fa46de565f
update - possible test for wednesday
highestnumber.py
highestnumber.py
Python
0.000009
@@ -0,0 +1,1011 @@ +number1=int(input(%22Please enter the first number: %22))%0Anumber2=int(input(%22Please enter the second number: %22))%0Anumber3=int(input(%22Please enter the third number: %22))%0A%0Aif (number1%3Enumber2) and (number1%3Enumber3):%0A print(%22The highest number is%22,number1)%0A%0Aelif (number2%...
ce912bfb028633a32c8dbb882000182e7b6ccb80
Initialize P01_boxPrint
books/AutomateTheBoringStuffWithPython/Chapter10/P01_boxPrint.py
books/AutomateTheBoringStuffWithPython/Chapter10/P01_boxPrint.py
Python
0.000005
@@ -0,0 +1,670 @@ +# This program prints out a box based on input sizes%0A%0A%0Adef boxPrint(symbol, width, height):%0A if len(symbol) != 1:%0A raise Exception(%22Symbol must be a single character string.%22)%0A if width %3C= 2:%0A raise Exception(%22Width must be greater than 2.%22)%0A if height...
8e20c0f4844b366c43bb39e14ab6af5299ab03f0
Make java_util.create_single_jar function visible also for Bazel
src/main/starlark/builtins_bzl/common/java/java_util.bzl
src/main/starlark/builtins_bzl/common/java/java_util.bzl
Python
0.000005
@@ -0,0 +1,1873 @@ +# Copyright 2021 The Bazel Authors. All rights reserved.%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%...
3aac0952d5c13e67c812f00f7a35d508dd1c1f5c
Test OEmbed XML parsing.
tests/test_oembed.py
tests/test_oembed.py
Python
0
@@ -0,0 +1,614 @@ +import io%0Aimport unittest%0A%0Afrom adjunct.oembed import parse_xml_oembed_response%0A%0A%0Aclass OEmbedXMLParserTest(unittest.TestCase):%0A%0A def test_parse(self):%0A fh = io.StringIO(%0A %22%22%22%3C?xml version=%221.0%22 encoding=%22utf-8%22?%3E%0A%3Coembed%3E%0A %3Cvers...
4a3faad1bd26054742f871729b25b5a4a37ba127
Create projective coordinates.
examples/conversions/rgb_to_v1v2.py
examples/conversions/rgb_to_v1v2.py
Python
0
@@ -0,0 +1,1305 @@ +%22%22%22Create isometric logratio transformed coordinates for MRI data.%22%22%22%0A%0Aimport os%0Aimport numpy as np%0Aimport tetrahydra.core as tet%0Afrom tetrahydra.utils import truncate_and_scale%0Afrom nibabel import load, save, Nifti1Image%0A%0A%22%22%22Load Data%22%22%22%0A#%0Anii1 = load('/h...
339655b82c7a1d307ca69b0666a3a150a5b04aa6
Create basic_tweepy.py
tweepy/basic_tweepy.py
tweepy/basic_tweepy.py
Python
0.000012
@@ -0,0 +1,722 @@ +%22%22%22%0ASee tutorial: %0A- https://python.web.id/blog/cara-menggunakan-tweepy/%0A- https://python.web.id/blog/filter-timeline-twitter-menggunakan-tweepy/%0A%22%22%22%0A%0Aimport tweepy%0A%0A# Consumer keys and access tokens, used for OAuth%0Aconsumer_key = 'JNT2qhC2noSTSya'%0Aconsumer_secret = 'Y...
5b9941d67f9975ced1a628d315165f03d22d8b0d
Create 4sqr2instconverter.py
4sqr2instconverter.py
4sqr2instconverter.py
Python
0.001598
@@ -0,0 +1,756 @@ +#!/usr/bin/python%0A%0Aimport httplib2%0Aimport os%0Aimport sys%0Aimport urllib2%0Aimport re%0Aimport time%0Aimport subprocess%0Afrom time import sleep%0A%0A%0AdataFile = open('4sq_USA_food_location_ids.txt', 'r')%0Aoutputfile = open ('4sq2inst_mapped_with_4sq_id_at_end.txt', 'w')%0A%0Afor line in da...
523fac76d0de41b09aab7b42ec0a975ccc99a532
add AE1
AE1_IdealPlaneWave.py
AE1_IdealPlaneWave.py
Python
0.998446
@@ -0,0 +1,828 @@ +# SOFiA example 1: Ideal unity plane wave simulation%0A# Additionally requires vispy, see http://vispy.org%0A%0Aimport numpy as np%0Afrom sofia import gen, plot%0A%0Api = np.pi%0AN = 9 # Order%0ANrf = N # Radial filter order%0ANviz = N # Visualization order%0AkrViz = 30 # Select kr ...
fda3c12070404a6f209f8b0ae18c6712d71a88ad
update to query and print GeoJSON results
ch04/code/ch04-06_postgis_complex_query.py
ch04/code/ch04-06_postgis_complex_query.py
Python
0
@@ -0,0 +1,2222 @@ +#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport psycopg2%0Aimport pprint%0Afrom geojson import loads, Feature, FeatureCollection%0A%0A# Database Connection Info%0Adb_host = %22localhost%22%0Adb_user = %22postgres%22%0Adb_passwd = %22air%22%0Adb_database = %22py_geoan_cb%22%0Adb_port = %2...
40c0e9dc8faf3a54ed82dcc01407afade18258ac
Update keras to not use private TF API for get_json_type.
tensorflow/python/keras/saving/saved_model/json_utils.py
tensorflow/python/keras/saving/saved_model/json_utils.py
# Copyright 2020 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0.000004
@@ -1407,57 +1407,8 @@ ape%0A -from tensorflow.python.util import serialization%0A %0A%0Acl @@ -1722,22 +1722,8 @@ urn -serialization. get_
df7d2393ebb10ddbfb44d6cacb9c4ec3d07eb381
Add initial Gunicorn configuration.
vinotes/config/gunicorn.py
vinotes/config/gunicorn.py
Python
0
@@ -0,0 +1,174 @@ +command = '/home/rc/projects/vinotes-api/env/bin/gunicorn'%0Apythonpath = '/home/rc/projects/vinotes-api/vinotes'%0Abind = '127.0.0.1:8001'%0Aworkers = 1%0Auser = 'vinotes-gunicorn'%0A
9669a45df9f37477bee1a154a9fe4f375e719151
add default models.py
models.py
models.py
Python
0.000001
@@ -0,0 +1,36 @@ +import config%0APAYMENT_PROCESSOR=True
36fb0255a4037a9fe7b6d61868f8666325fea944
Test recipient address formatting in user message e-mails
tests/blueprints/user_message/test_address_formatting.py
tests/blueprints/user_message/test_address_formatting.py
Python
0.000001
@@ -0,0 +1,1718 @@ +%22%22%22%0A:Copyright: 2006-2018 Jochen Kupperschmidt%0A:License: Modified BSD, see LICENSE for details.%0A%22%22%22%0A%0Afrom unittest.mock import patch%0A%0Aimport pytest%0A%0Afrom byceps.database import db%0Afrom byceps.services.email.models import EmailConfig%0Afrom byceps.services.user_message...
a0b4e074d5ca13634a1671ea074ffa7a6ad9fea1
Add missing change
ppapi/PRESUBMIT.py
ppapi/PRESUBMIT.py
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import sys import subprocess def CheckChange(input_api, output_api): results = [] # Verify all modified *.idl have a matching *.h files...
Python
0.000029
@@ -1673,9 +1673,9 @@ 3,M1 -4 +6 '%5D%0A%0A