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
fcab9d5e65a1b068f3a5c5ed99ff178daa343250
Fix bad import.
src/python/pyqgl2/test/test_basic_mins.py
src/python/pyqgl2/test/test_basic_mins.py
import unittest import numpy as np from pyqgl2.main import compileFunction from pyqgl2.main import qgl2_compile_to_hardware from pyqgl2.main import mapQubitsToSequences from pyqgl2.evenblocks import replaceBarriers from QGL import * def discard_zero_Ids(seqs): from QGL.PulseSequencer import Pulse # assume seq...
Python
0.000001
@@ -260,49 +260,8 @@ s):%0A - from QGL.PulseSequencer import Pulse%0A
eabb9d2d48b4f92afa3b0cf75c1aa599b8580cc8
fix another ordering issues, use array instead of unordered set
sortedm2m/forms.py
sortedm2m/forms.py
# -*- coding: utf-8 -*- from itertools import chain from django import forms from django.conf import settings from django.db.models.query import QuerySet from django.utils.encoding import force_unicode from django.utils.html import conditional_escape from django.utils.safestring import mark_safe from django.template im...
Python
0
@@ -1258,12 +1258,8 @@ s = -set( %5Bfor @@ -1287,17 +1287,16 @@ n value%5D -) %0A%0A
953f99787e3578f4338752ce3099d530d021e725
Add special case to add Side/SideOnly to difflist
fml/generatechangedfilelist.py
fml/generatechangedfilelist.py
import sys import os import subprocess, shlex mcp_root = os.path.abspath(sys.argv[1]) sys.path.append(os.path.join(mcp_root,"runtime")) from filehandling.srgshandler import parse_srg def cmdsplit(args): if os.sep == '\\': args = args.replace('\\', '\\\\') return shlex.split(args) def main(): list...
Python
0
@@ -1610,16 +1610,138 @@ clazz))%0A + fh.write(%22%25s/cpw/mods/fml/common/asm/SideOnly.class%22 %25 name)%0A fh.write(%22%25s/cpw/mods/fml/common/Side.class%22 %25 name)%0A %0Aif
2f195182a9ca57eec69e031352813da9455615b6
check deleted state
corehq/ex-submodules/casexml/apps/case/tests/test_delete.py
corehq/ex-submodules/casexml/apps/case/tests/test_delete.py
from django.test import TestCase from casexml.apps.case.cleanup import safe_hard_delete from casexml.apps.case.exceptions import CommCareCaseError from casexml.apps.case.mock import CaseFactory, CaseStructure, CaseIndex from casexml.apps.case.tests.util import TEST_DOMAIN_NAME from corehq.apps.change_feed import topic...
Python
0.000001
@@ -1735,16 +1735,114 @@ hanges%7D) +%0A for change in change_context.changes:%0A self.assertTrue(change.deleted) %0A%0A
892bca4fbcb084b78b1b902c1bc1e2634f4e3d2f
use self.stdout.write
countries_plus/management/commands/update_countries_plus.py
countries_plus/management/commands/update_countries_plus.py
from django.core.management.base import BaseCommand from countries_plus.utils import update_geonames_data class Command(BaseCommand): help = 'Updates the Countries Plus database from geonames.org' def handle(self, *args, **options): num_updated, num_created = update_geonames_data() print "Co...
Python
0
@@ -2,109 +2,109 @@ rom -django.core.management.base import BaseCommand%0A%0Afrom countries_plus.utils import update_geonames_data +countries_plus.utils import update_geonames_data%0A%0Afrom django.core.management.base import BaseCommand %0A%0A%0Ac @@ -308,13 +308,38 @@ -print +self.stdout.write(%0A ...
496829572ecfbe485a6c086684179927e2787e5c
fix test
custom/icds/tests/serializers/test_hosted_ccz_serializer.py
custom/icds/tests/serializers/test_hosted_ccz_serializer.py
from __future__ import absolute_import from __future__ import unicode_literals import mock from django.test import TestCase from custom.icds.models import ( HostedCCZ, HostedCCZLink, ) from custom.icds.serializers import HostedCCZSerializer BUILD = { 'build_profiles': { '12345': {'name': 'Dummy Bu...
Python
0.000002
@@ -1524,16 +1524,50 @@ ote': '' +,%0A 'status': 'pending' %7D%0A
d71d76bc501ec93ba39b5aa94aeaee444145e123
Fix forms without read only fields.
leonardo/module/media/admin/file/forms.py
leonardo/module/media/admin/file/forms.py
from django.forms.models import modelformset_factory from django.utils.translation import ugettext as _ from leonardo.forms import SelfHandlingModelForm from leonardo.forms.fields.common import UserField from leonardo.module.media.fields.folder import FolderField from leonardo.module.media.models import File class F...
Python
0
@@ -523,16 +523,55 @@ kwargs)%0A +%0A if 'sha1' in self.fields:%0A @@ -622,16 +622,61 @@ = True%0A +%0A if '_file_size' in self.fields:%0A
4a26ed066bb5af254bb5aedce615dd502e1f8a79
Update server.py
server/server.py
server/server.py
import SocketServer import time import config class TCPHandler(SocketServer.BaseRequestHandler): def handle(self): self.data = self.request.recv(1024).strip() print "{} wrote:".format(self.client_address[0]) print "%s %s" % (int(time.time()), self.data) # just send back the same ...
Python
0.000001
@@ -454,16 +454,23 @@ ((config +.config %5B'host'%5D @@ -471,16 +471,23 @@ host'%5D, +config. config%5B' @@ -529,12 +529,13 @@ ve_forever() +%0A
8d1549900c65d622dbb129e9f957de7aa4ff84a5
fix AnsibleError object name in subelements plugin
lib/ansible/plugins/lookup/subelements.py
lib/ansible/plugins/lookup/subelements.py
# (c) 2013, Serge van Ginderachter <serge@vanginderachter.be> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option)...
Python
0
@@ -1137,39 +1137,32 @@ raise -errors. AnsibleError(%0A @@ -2751,39 +2751,32 @@ raise -errors. AnsibleError(%22su @@ -3410,39 +3410,32 @@ raise -errors. AnsibleError(%22co @@ -3733,39 +3733,32 @@ raise -errors. AnsibleError(%22th @@ -4047,15 +4047,8 @@ ise -errors...
a1d16d931772c52c214706da6242e470ee9a29d1
Extend User model
models.py
models.py
from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() class User(db.Model): uuid_ = db.Column(db.String(36), primary_key=True) username = db.Column(db.String(80), unique=True, nullable=False) email = db.Column(db.String(120), unique=True, nullable=False) authenticated = db.Column(db.Boolean, defau...
Python
0.000001
@@ -34,16 +34,29 @@ lchemy%0A%0A +import util%0A%0A db = SQL @@ -92,21 +92,77 @@ l):%0A -uuid_ +%22%22%22 User where email address is account key%0A %22%22%22%0A email = db.Co @@ -180,10 +180,11 @@ ing( -36 +120 ), p @@ -202,22 +202,84 @@ True -)%0A username +, unique=True, nullable=False)%0A pa...
b532b66fd552fd886b4c03633d6dab9f96fb31d8
Remove helper function from models
models.py
models.py
# -*- coding: utf-8 -*- """ models ~~~~~~ Model definitions and class methods :copyright: (c) 2016 by Patrick Spencer. :license: Apache 2.0, see LICENSE for more details. """ from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, Boolean, Date, Time, \ ...
Python
0.000002
@@ -1088,926 +1088,4 @@ st)%0A -%0A def month_bounds(self, year, month):%0A %22%22%22%0A Returns a tuple of datetime objects (month_start,month_end) given a year and month.%0A Both params are strings because we want month to be a two digit month representation%0A and python doesn't handl...
7c0f22999222a6ec1ce1a6780cbb0b19ea07e867
move to new vtkutils API
menpo3d/barycentric.py
menpo3d/barycentric.py
import numpy as np from menpo.shape import PointCloud, TriMesh from .vtkutils import trimesh_to_vtk, VTKClosestPointLocator def barycentric_coordinates(point, a, b, c): T = np.hstack(((a - c)[:, None], (b - c)[:, None])) return np.linalg.lstsq(T, point - c)[0] def barycentric_coordinates_for_indices(mesh, t...
Python
0
@@ -1568,152 +1568,34 @@ s = -%5B%5D, %5B%5D%0A for p in pointcloud.points:%0A snapped, index = locator(p)%0A snapped_points.append(snapped)%0A indices.append(index)%0A +locator(pointcloud.points) %0A @@ -1613,25 +1613,16 @@ ntCloud( -np.array( snapped_ @@ -1627,17 +1627,16 @@ d_points ...
bea577beb96a2b0de4313283698ff41cebaf2e37
Fix pylint warnings
platformio/util.py
platformio/util.py
# Copyright (C) Ivan Kravets <me@ikravets.com> # See LICENSE for details. import json from os import name as os_name from os import getcwd, getenv, listdir, makedirs, utime from os.path import abspath, dirname, expanduser, isdir, isfile, join, realpath from platform import system, uname from subprocess import PIPE, Po...
Python
0.000016
@@ -4088,16 +4088,41 @@ s._cache + # pylint: disable=W0212 %0A exc @@ -4589,16 +4589,41 @@ = boards + # pylint: disable=W0212 %0A%0A if
eba1a2140762502656a514759d925e502de3e026
Remove AccountFilter.
pledger/filters.py
pledger/filters.py
from pledger.entry import Entry class FilterCollection(object): def __init__(self): self.filters = { } def add_filter(self, filter, level = 0): self.filters.setdefault(level, []) self.filters[level].append(filter) def apply(self, transaction, account, amount): entries = [E...
Python
0
@@ -701,40 +701,8 @@ es%0A%0A -class Filter(object):%0A pass%0A%0A clas @@ -714,32 +714,32 @@ dicate(object):%0A + def __init__ @@ -1154,16 +1154,188 @@ result%0A%0A + @classmethod%0A def has_account(cls, account):%0A @cls%0A def result(transaction, entry):%0A return entry.acc...
ebbaebc608d923f437f396957d71615493c13055
Change feature return
extractor.py
extractor.py
from keras.preprocessing import image from keras.applications.inception_v3 import InceptionV3, preprocess_input from keras.models import Model, load_model from keras.layers import Input import numpy as np class Extractor(): def __init__(self, weights=None): """Either load pretrained from imagenet, or load ...
Python
0
@@ -1761,22 +1761,16 @@ tures%5B0%5D -%5B0%5D%5B0%5D %0A
02ec0611a708a293fe4d5056152d7a229e908690
Add option to save at intermediary points.
project_code/bulk_fitting.py
project_code/bulk_fitting.py
''' Bulk spectral line fitting with SDSS galaxy spectra ''' import os from astropy.io import fits from pandas import DataFrame # Bring in the package funcs from specfit import do_specfit from download_spectra import download_spectra def bulk_fit(obs_file, output_file, keep_spectra=False): ''' Downloads fil...
Python
0
@@ -285,19 +285,62 @@ ra=False +, split_save=True,%0A num_save=10 ):%0A - '''%0A @@ -634,16 +634,120 @@ ata.size +%0A save_nums = %5B(num_spectra/num_save)*(i+1) for i in range(num_save)%5D%0A save_nums%5B-1%5D = num_spectra %0A%0A fo @@ -1197,16 +1197,183 @@ pec_df%0A%0A + if spli...
375885deb32bfeb351213e1a9ea28d9aa1bae8c3
remove unused label from loop
plugins/plot/qt.py
plugins/plot/qt.py
from PyQt4.QtGui import * from electrum.plugins import BasePlugin, hook from electrum.i18n import _ import datetime from electrum.util import format_satoshis from electrum.bitcoin import COIN try: import matplotlib matplotlib.use('Qt4Agg') import matplotlib.pyplot as plt import matplotlib.dates as md...
Python
0.000002
@@ -1942,174 +1942,8 @@ IN)%0A - if tx_hash:%0A label = wallet.get_label(tx_hash)%0A label = label.encode('utf-8')%0A else:%0A label = %22%22%0A%0A %0A
554551d65ac78cb7ca57e194c196f4124d46ec77
Fix tabs and spaces mixing.
plugins/teambot.py
plugins/teambot.py
import shelve import re import json import atexit # This directory maps slack channel IDs (not names) to sets of user IDs directory = shelve.open('teams.db') outputs = [] my_user_id = None my_mention = None slack_client = None def setup(bot): global my_user_id global my_mention global slack_client sl...
Python
0
@@ -1282,9 +1282,16 @@ )))%0A -%09 + retu @@ -1377,24 +1377,25 @@ irectory)))%0A +%0A elif tex
0bf34225dc687270c263bfc9f4555c9709eef1ad
use req.GET instead of deprecated req.REQUEST
fas/views.py
fas/views.py
from django.conf import settings from django.contrib import messages from django.contrib.auth import login as auth_login, logout as auth_logout, authenticate, REDIRECT_FIELD_NAME from django.core.urlresolvers import resolve from django.http import HttpResponseRedirect from django.shortcuts import resolve_url, redirect ...
Python
0.000002
@@ -968,22 +968,18 @@ request. -REQUES +GE T%5Bfield_ @@ -1337,22 +1337,18 @@ request. -REQUES +GE T:%0A @@ -1512,14 +1512,10 @@ est. -REQUES +GE T%5Bre
88fa50d94345716efa50fa8c970abd5b513c7c7f
Fix typo in version label
proselint/version.py
proselint/version.py
"""Wallace version number.""" __version__ = "0.3.4"
Python
0.000387
@@ -1,14 +1,16 @@ %22%22%22 -Wallace +Proselint ver
336de16145ac3283331d3f6123d6acc781a398dd
Fix failure when like / dislike counts missing from JSON
plugins/youtube.py
plugins/youtube.py
import re import time from util import hook, http youtube_re = (r'(?:youtube.*?(?:v=|/v/)|youtu\.be/|yooouuutuuube.*?id=)' '([-_a-z0-9]+)', re.I) base_url = 'https://www.googleapis.com/youtube/v3/' info_url = base_url + 'videos?part=snippet,contentDetails,statistics' search_api_url = base_url + 'searc...
Python
0.000223
@@ -851,16 +851,128 @@ %5D, ',')%0A + likes = j%5B'statistics'%5D.get('likeCount', %22NA%22)%0A dislikes = j%5B'statistics'%5D.get('dislikeCount', %22NA%22)%0A %0A out @@ -1052,61 +1052,29 @@ u'%7B -statistics%5BlikeCount%5D%7D%5Cu2191%7Bstatistics%5B +likes%7D%5Cu2191%7B dislike -Count%5D +s %7D%5Cu...
086c8c25ef2e31dc9c55db96d65e30ac0e8b1789
raise exception when invalid `time` parameter passed.
doit/tools.py
doit/tools.py
"""extra goodies to be used in dodo files""" import os import time import datetime import hashlib import operator # action def create_folder(dir_path): """create a folder in the given path if it doesnt exist yet.""" if not os.path.exists(dir_path): os.makedirs(dir_path) return True # title def ...
Python
0.000001
@@ -3617,34 +3617,8 @@ %22%22%22%0A - timeattr = 'st_mtime'%0A @@ -3645,24 +3645,24 @@ 'access'):%0A + time @@ -3713,24 +3713,24 @@ 'create'):%0A - time @@ -3743,24 +3743,239 @@ 'st_ctime'%0A + elif time in ('mtime', 'modify'):%0A timeattr = 'st_mtime'%0A else:%0A r...
b255fd5c78ef3dcce1eca11e9c8113f66100ab1c
Update "discrete categories" language in docstring.
toron/node.py
toron/node.py
"""Node implementation for the Toron project.""" from itertools import chain from itertools import combinations from ._dal import dal_class from ._exceptions import ToronWarning class Node(object): def __init__(self, path, mode='rwc'): self._dal = dal_class(path, mode) @property def path(self):...
Python
0
@@ -4604,44 +4604,29 @@ lues - in the dataset.%0A Our example +. Our example%0A dat @@ -4670,24 +4670,16 @@ or which -%0A the sta @@ -4680,16 +4680,24 @@ he state +%0A value i @@ -4739,24 +4739,16 @@ t unique -%0A despite @@ -4751,16 +4751,24 @@ pite the +%0A cat...
ad758c5f44bffe0b7468b9ccf2c5c4747cdba42c
add ast parse
tpl/render.py
tpl/render.py
# -*- coding:utf-8 -*- import jinja2 from candy_prompt.prompt import prompt env = jinja2.Environment(undefined=jinja2.StrictUndefined) def render(tpl_text, context): try: return env.from_string(tpl_text).render(context) except jinja2.UndefinedError as e: undefined_var = e.message[1:-14] ...
Python
0.000264
@@ -31,16 +31,27 @@ jinja2%0A +import ast%0A from can @@ -373,16 +373,125 @@ d_var))%0A + try:%0A value = ast.literal_eval(value)%0A except Exception:%0A value = value%0A
0548708fa1d3bf4f4b6ad570714f3334bafb14ac
Fix help for project parser
trove/main.py
trove/main.py
import argparse from frontend import FrontEnd def run(): f = FrontEnd() parser = argparse.ArgumentParser( prog='trove', epilog="See '%(prog)s <command> --help' for more help on a specific command." ) sub_parsers = parser.add_subparsers(title='Commands') get_parser = sub_parsers...
Python
0.00013
@@ -1460,35 +1460,39 @@ help='show all -env +project s')%0A project_
0eafefa9546fee3195198c54eb3362cbaa39ea8d
Update constants.py
azurecloudify/constants.py
azurecloudify/constants.py
######## # Copyright (c) 2015 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
@@ -1509,17 +1509,16 @@ source=' -' https://
9222b5ab40aab356b32bea75ca32193bd556f85a
Update constants.py
azurecloudify/constants.py
azurecloudify/constants.py
######## # Copyright (c) 2015 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
@@ -884,20 +884,12 @@ 15-0 -5 +1 -01 --preview '%0Ast
9429765dbcf18ebceeff278b984648e5d5580ff4
Use round's known alphabet for huffman complement
backend/breach/strategy.py
backend/breach/strategy.py
from django.utils import timezone from django.db.models import Max from breach.analyzer import decide_next_world_state from breach.models import SampleSet, Round from breach.sniffer import Sniffer SAMPLES_PER_SAMPLESET = 100 class Strategy(object): def __init__(self, victim): self._victim = victim ...
Python
0.00001
@@ -1824,38 +1824,35 @@ ot in self._ -victim.target. +round.known alphabet)%0A%0A @@ -1885,38 +1885,35 @@ = set(self._ -victim.target. +round.known alphabet) -
6416d04d073310b7195b27fc0b33db6fec6c4a8b
Add URL-safe versions of base64 encode/decode
backend/plugins/base_64.py
backend/plugins/base_64.py
"""Base64 plugin for Babbage. Copyright 2014 Google Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by app...
Python
0.000003
@@ -1682,8 +1682,1267 @@ adding)%0A +%0Aclass UrlSafeBase64Encode(object):%0A%0A def __init__(self):%0A self.name = 'URL-safe Base 64 encode'%0A self.description = 'Returns a URL-safe base 64 encoded string.'%0A self.options = 0%0A%0A def Process(self, incoming_data, unused_options):%0A %22%22%22URL-safe...
72cd4718224b551e45c87de9d4074524e0f84d8b
Add a logger.
backend/realtime_worker.py
backend/realtime_worker.py
import os from retry.api import retry from secret import CONSUMER_KEY, CONSUMER_SECRET import twitter import rethinkdb as r MAX_TRIES = 3 # Number of times we try to get a tweet before giving up def isTransportOffer(tweet): return '#VoyageAvecMoi' in tweet['text'] def get_tweet_data(tweet): return { ...
Python
0.00001
@@ -579,16 +579,157 @@ %0A %7D%0A%0A +class Logger:%0A def warning(self, fmt, error, delay):%0A print('Error: %25r' %25 error)%0A print('Retrying in %25s seconds.' %25 delay)%0A%0A @retry(d @@ -745,16 +745,33 @@ ackoff=2 +, logger=Logger() )%0Adef fe
25abe35424aae1ba93f82f5f4adf3de21478cdea
Rename get image url function
ee_plugin/utils.py
ee_plugin/utils.py
# -*- coding: utf-8 -*- """ Utils functions GEE """ from qgis.core import QgsRasterLayer, QgsProject from qgis.utils import iface import ee def get_image_url(image): map_id = ee.data.getMapId({'image': image}) url = map_id['tile_fetcher'].url_format return url def update_ee_layer_properties(layer, im...
Python
0.000022
@@ -141,24 +141,27 @@ e%0A%0A%0Adef get_ +ee_ image_url(im @@ -650,32 +650,35 @@ xyz&url=%22 + get_ +ee_ image_url(image) @@ -1058,16 +1058,19 @@ %22 + get_ +ee_ image_ur
e1422bb5e4a510b8f1844f50af0c4f1659b5cdfe
handle EOF and ProcessLookupError
dist/tools/testrunner/testrunner.py
dist/tools/testrunner/testrunner.py
# Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de> # 2014 Martine Lenders <mlenders@inf.fu-berlin.de> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import os import signal ...
Python
0
@@ -8,16 +8,83 @@ ight (C) + 2017 Cenk G%C3%BCndo%C4%9Fan %3Ccenk.guendogan@haw-hamburg.de%3E%0A# 2016 Ka @@ -1887,16 +1887,303 @@ eturn 1%0A + except pexpect.EOF:%0A line, filename, lineno = find_exc_origin(sys.exc_info()%5B2%5D)%0A print(%22Unexpected end of file in expect script at...
d7f04e845214f599bb868146bef46e00ac734e6e
Switch back to HTTP, premailer is still fucked
emails/messages.py
emails/messages.py
"""Email utility functions""" from six import string_types from django.template.loader import render_to_string from django.core.mail import EmailMultiAlternatives from django.conf import settings from premailer import transform def send_game_accepted(user, game): """Email an user when their game submission is acc...
Python
0
@@ -1677,24 +1677,200 @@ ), context)%0A + # Premailer does not handle https links, the site can't access itself%0A # with HTTPS inside its container.%0A # Under no circumstances this should be switched to https.%0A html_par @@ -1908,17 +1908,16 @@ rl='http -s ://lutri
7f9ca6993cb835a6941a992a537c6a026d03998e
Update DEVICE_CREDS.py
examples/DEVICE_CREDS.py
examples/DEVICE_CREDS.py
cisco_881 = { 'device_type': 'cisco_ios', 'ip': '10.10.10.227', 'username': 'test1', 'password': 'password', 'secret': 'secret', 'verbose': False, } cisco_asa = { 'device_type': 'cisco_asa', 'ip': '10.10.10.226', 'username': 'admin', 'password': 'password', 'secret': 'se...
Python
0.000001
@@ -1319,16 +1319,211 @@ lse,%0A%7D%0A%0A +f5_ltm = %7B%0A 'device_type': 'hp_procurve',%0A 'ip': '10.10.10.227',%0A 'username': 'admin',%0A 'password': 'password',%0A 'secret': '',%0A 'port': 22,%0A 'verbose': False, %0A%7D %0A %0A all_devi @@ -1660,10 +1660,25 @@ rocurve%0A + f5_lt...
eaec82bb0a4a11f683c34550bdc23b3c6b0c48d2
Update script to export to nml2 of m1
examples/M1/M1_export.py
examples/M1/M1_export.py
import M1 # import parameters file from netpyne import sim # import netpyne sim module sim.createAndExport(netParams = M1.netParams, simConfig = M1.simConfig, reference = 'M1') # create and export network to NeuroML 2
Python
0
@@ -102,16 +102,24 @@ ndExport +NeuroML2 (netPara @@ -226,16 +226,99 @@ e = 'M1' +,%0A connections=True,%0A stimulations=True ) # cre
a5057c27730888513e6854e4c1127b4e13942242
Change to a new natsort module
SEF-parser.py
SEF-parser.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Parse RIR SEF files and output country spesific data files. Spec: ftp.ripe.net/pub/stats/ripencc/RIR-Statistics-Exchange-Format.txt Author: Tor Inge Skaar ''' # Core modules from __future__ import print_function import os import re import sys import math import config...
Python
0
@@ -3382,26 +3382,24 @@ sort.natsort -ed (typedata%5Bip
cc1a01be977967f889a01f81bf40da825585e00e
Add retry for PUG submission
pubchem_utils/pug.py
pubchem_utils/pug.py
""" Utilities for interacting with the PubChem Power User Gateway (PUG). The PUG XML schema is located at https://pubchem.ncbi.nlm.nih.gov/pug/pug.xsd. See also https://pubchem.ncbi.nlm.nih.gov/pug/pughelp.html. """ __author__ = "Steven Kearnes" __copyright__ = "Copyright 2014, Stanford University" __license__ = "3-...
Python
0
@@ -768,24 +768,120 @@ checks.%0A + n_attempts : int, optional (default 3)%0A Number of times to attempt query submission.%0A %22%22%22%0A stat @@ -868,24 +868,24 @@ on.%0A %22%22%22%0A - status_t @@ -1343,16 +1343,30 @@ delay=10 +, n_attempts=3 ):%0A @@ -1413,16 +1413,52 @@ = del...
3f1966ab10edca6df5a8b22df3fc4b7375ea8c4c
Fix for Issue#3
Scratchpad.py
Scratchpad.py
from sublime_plugin import WindowCommand, TextCommand from sublime import packages_path, run_command, ENCODED_POSITION from time import strftime from os.path import isfile headerText = """ _____ _ _ _ / ___| | | | | | | \ `--. ___ ...
Python
0
@@ -1347,16 +1347,18 @@ mp = %22%5Cn +%5Cn %22 + strf
e43b82c4930616b72ba434f45d223c676c75f7e3
remove unnecesary parentheses
buildtimetrend/keenio.py
buildtimetrend/keenio.py
# vim: set expandtab sw=4 ts=4: ''' Interface to Keen IO. Copyright (C) 2014 Dieter Adriaenssens <ruleant@users.sourceforge.net> This file is part of buildtime-trend <https://github.com/ruleant/buildtime-trend/> This program is free software: you can redistribute it and/or modify it under the terms of the GNU Genera...
Python
0.999998
@@ -1153,17 +1153,16 @@ %0A if -( %22KEEN_PR @@ -1207,33 +1207,32 @@ t_id is not None -) :%0A return
e13e602025ffe2374237a0710a8cef3d2f477247
use constant TRAVIS_API_URL
buildtimetrend/travis.py
buildtimetrend/travis.py
''' vim: set expandtab sw=4 ts=4: Interface to Travis CI API. Copyright (C) 2014 Dieter Adriaenssens <ruleant@users.sourceforge.net> This file is part of buildtime-trend <https://github.com/ruleant/buildtime-trend/> This program is free software: you can redistribute it and/or modify it under the terms of the GNU G...
Python
0.000004
@@ -838,16 +838,62 @@ t json%0A%0A +TRAVIS_API_URL = 'https://api.travis-ci.org/'%0A %0Aclass T @@ -1465,35 +1465,26 @@ -'https://api.travis-ci.org/ +TRAVIS_API_URL + ' repo
8885646e4e9d07b8595c6584e2ea3367f84a6c6b
Document supported tags in module docstring
bumblebee/modules/mpd.py
bumblebee/modules/mpd.py
# pylint: disable=C0111,R0903 # -*- coding: utf-8 -*- """Displays information about the current song in mpd. Requires the following executable: * mpc Parameters: * mpd.format: Format string for the song information. Tag values can be put in curly brackets (i.e. {artist}) * mpd.host: MPD host to connect t...
Python
0
@@ -223,64 +223,633 @@ ion. - Tag values can be put in curly brackets (i.e. %7Bartist%7D) +%0A Supported tags (see %60man mpc%60 for additional information)%0A * %7Bname%7D%0A * %7Bartist%7D%0A * %7Balbum%7D%0A * %7Balbumartist%7D%0A * %7Bcomment%7D%0A * %7Bcomposer%7D%0A...
25aca3b7152229b6f0fd7fa9c9f81639f77263dd
update urls: spacing fixes
mezzanine_wiki/urls.py
mezzanine_wiki/urls.py
from django.conf.urls.defaults import patterns, url # Wiki patterns. urlpatterns = patterns("mezzanine_wiki.views", url("^$", "wiki_index", name="wiki_index"), url("^pages:new/$", "wiki_page_new", name="wiki_page_new"), url("^pages:list/$", "wiki_page_list", name="wiki_page_list"), url("^pages:change...
Python
0.000001
@@ -493,32 +493,70 @@ iki_page_list%22,%0A + name=%22wi @@ -628,32 +628,70 @@ iki_page_list%22,%0A + name=%22wi @@ -769,16 +769,54 @@ story%22,%0A + @@ -915,16 +915,54 @@ isi...
70dec6973c087e0c9fe0906e26034c0f0068f074
Allow ':' and '.' in etcd keys.
calico/etcddriver/hwm.py
calico/etcddriver/hwm.py
# -*- coding: utf-8 -*- # Copyright 2015 Metaswitch Networks # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
Python
0.999999
@@ -961,16 +961,18 @@ s + %22/_- +:. %22%0ATRIE_C
ae63c34afe88d0ec0b3e27cb3b922432187e4a7b
Allow gains from MIdway
cax/tasks/corrections.py
cax/tasks/corrections.py
"""Add electron lifetime """ import datetime from collections import defaultdict import numpy as np import os import sympy import time import pytz import requests from hax import slow_control from pax import configuration, units from sympy.parsing.sympy_parser import parse_expr from cax import config from cax.task im...
Python
0
@@ -3966,24 +3966,21 @@ == ' -xe1t-datamanager +midway-login1 ':%0A
7b486ccf269314a3105db17fa0e8d61e42711398
migrate spj
migrate/migrate_spj.py
migrate/migrate_spj.py
from problem.models import Problem, SpecialProgram import traceback def run(): try: for problem in Problem.objects.all(): if problem.judge == '' or problem.judge == 'fcmp': continue if SpecialProgram.objects.filter(filename__contains=problem.judge).exists(): ...
Python
0.000076
@@ -77,16 +77,18 @@ n():%0A + # try:%0A @@ -84,24 +84,26 @@ # try:%0A + # for pro @@ -132,24 +132,26 @@ s.all():%0A + # if @@ -197,24 +197,26 @@ 'fcmp':%0A + # @@ -224,24 +224,26 @@ continue%0A + # if @@ -315,24 +315,26 @@ xists():%0A + # ...
10f7ad1a5cbd6da6cb41a6b5671924b3d7268532
improve error msg for bad date
cgi-bin/request/daily.py
cgi-bin/request/daily.py
"""Download IEM summary data!""" from io import StringIO import datetime import sys import pandas as pd from paste.request import parse_formvars from pyiem.util import get_dbconn from pyiem.network import Table as NetworkTable def overloaded(): """Prevent automation from overwhelming the server""" with get_...
Python
0.000008
@@ -3757,112 +3757,65 @@ def -application(environ, start_response):%0A %22%22%22See how we are called%22%22%22%0A form = parse_formvars(environ) +parse_dates(form):%0A %22%22%22Nicely resolve dates please.%22%22%22 %0A @@ -4021,30 +4021,417 @@ et(%22day2%22))%0A - )%0A + return sts, ets%0A%0A%0A...
3e822a60255832279282392038612ba516290009
fix circular import fail in Python 2.7
chainer/backends/_cpu.py
chainer/backends/_cpu.py
import numpy from chainer import _backend from chainer.backends import cuda from chainer.backends import intel64 import chainerx class CpuDevice(_backend.Device): @property def xp(self): return numpy @staticmethod def from_array(array): if isinstance(array, numpy.ndarray): ...
Python
0.000003
@@ -40,78 +40,31 @@ end%0A -from chainer.backends import cuda%0Afrom chainer.backends import intel64 +import chainer.backends %0Aimp @@ -936,16 +936,33 @@ (array, +chainer.backends. intel64. @@ -1128,16 +1128,33 @@ (array, +chainer.backends. cuda.nda @@ -1173,16 +1173,33 @@ with +chainer.backends. cuda.ge...
6c343916b58cee4112559fb439507295b4b6bfcf
Add drop table statements for postgres backups
backupdb/management/commands/backupdb.py
backupdb/management/commands/backupdb.py
""" Adapted from http://djangosnippets.org/snippets/823/ """ from optparse import make_option from subprocess import Popen, PIPE import os import pipes import time from django.core.management.base import BaseCommand BACKUP_DIR = 'backups' class BackupError(Exception): pass class Command(BaseCommand): hel...
Python
0
@@ -4786,33 +4786,66 @@ dump_args = %5B -%5D +'-c'%5D # Add drop table statements %0A dump_ar
aafbb0a51b7a5e9b6f1353f25392edc6a5bcc989
use new reader interface and resolve import
examples/dataset/main.py
examples/dataset/main.py
import argparse import miapy.data.extraction as miapy_extr import nerve.configuration.config as cfg def train(): pass def test(): pass def main(config_file: str): config = cfg.load(config_file, cfg.Configuration) print(config) reader = miapy_extr.Hdf5Reader(config.database_file, open_file=T...
Python
0
@@ -65,27 +65,24 @@ ort -nerve.configuration +examples.dataset .con @@ -117,16 +117,17 @@ pass%0A%0A +%0A def test @@ -130,17 +130,16 @@ test():%0A -%0A pass @@ -270,13 +270,13 @@ xtr. -Hdf5R +get_r eade @@ -303,17 +303,19 @@ le, -open_file +direct_open =Tru
9b855f8b72e485fd6484037d709fd0ad1c1d39a4
Remove duplicate insert of flags
benchbuild/projects/benchbuild/ccrypt.py
benchbuild/projects/benchbuild/ccrypt.py
from os import path from benchbuild.projects.benchbuild.group import BenchBuildGroup from benchbuild.utils.wrapping import wrap from benchbuild.utils.run import run from benchbuild.utils.downloader import Wget from benchbuild.utils.compiler import lt_clang, lt_clang_cxx from benchbuild.utils.cmd import tar, make from p...
Python
0.000242
@@ -1212,23 +1212,16 @@ - CXX=str( @@ -1234,183 +1234,8 @@ cxx) -,%0A CFLAGS=%22 %22.join(self.cflags),%0A CXXFLAGS=%22 %22.join(self.cflags),%0A LDFLAGS=%22 %22.join(self.ldflags) ):%0A
6903d4e0c42edd62bce99a1440e3c2d9fe6b0fc4
Handle empty value for build.timeout
changes/jobs/sync_job.py
changes/jobs/sync_job.py
from datetime import datetime from flask import current_app from sqlalchemy.orm import subqueryload_all from sqlalchemy.sql import func from changes.backends.base import UnrecoverableException from changes.config import db, queue from changes.constants import Status, Result from changes.db.utils import try_create from...
Python
0.000002
@@ -1492,14 +1492,14 @@ out' -, '0') +) or 0 )%0A
2d56f9417030410ecb606ee6aa5dc8ea58633f83
Fix Tapastic scraper
dosagelib/plugins/tapastic.py
dosagelib/plugins/tapastic.py
# SPDX-License-Identifier: MIT # Copyright (C) 2019-2020 Tobias Gruetzmacher # Copyright (C) 2019-2020 Daniel Ring import json import re from ..scraper import _ParserScraper from ..helpers import indirectStarter class Tapastic(_ParserScraper): baseUrl = 'https://tapas.io/' imageSearch = '//article[contains(@...
Python
0.000001
@@ -112,31 +112,8 @@ ing%0A -import json%0Aimport re%0A%0A from @@ -669,16 +669,26 @@ /' + url + + '/info' %0A @@ -733,16 +733,372 @@ de/%25s'%0A%0A + def getPrevUrl(self, url, data):%0A # Retrieve comic metadata from API%0A data = self.session.get(url + '/info')%0A data.raise_for_st...
18be54e7ca9937b19295b07b3d0cc2f317c65cab
Update app.py
channels/ya_metro/app.py
channels/ya_metro/app.py
#encoding:utf-8 from urllib.parse import urlparse from utils import get_url, weighted_random_subreddit t_channel = '@ya_metro' subreddit = weighted_random_subreddit({'Subways': 0.6, 'LondonUnderground': 0.4 }) def send_post(submission, r2t): what, url, ext = get_url(submission) title = submission.titl...
Python
0.000002
@@ -207,16 +207,34 @@ nd': 0.4 +,%0A 'Trams': 0.3 %0A%7D)%0A%0A%0Ade
849a115ef1e86b7a2b01ccb43d0ea4e713ab070f
Update example_pool.py
examples/example_pool.py
examples/example_pool.py
import asyncio import aioodbc loop = asyncio.get_event_loop() async def test_pool(): dsn = 'Driver=SQLite;Database=sqlite.db' pool = await aioodbc.create_pool(dsn=dsn, loop=loop) async with (await pool) as conn: cur = await conn.cursor() await cur.execute("SELECT 42;") r = await...
Python
0.000002
@@ -204,20 +204,16 @@ ith -(await pool) +pool.get as
9098f24fda02f1bc4eec585e807f14fdf7a8bb1d
Include engine names from the 'pygraphviz' library instead of maintaining a local list.
chatrelater/visualize.py
chatrelater/visualize.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Chat Relater's Visualizer ~~~~~~~~~~~~~~~~~~~~~~~~~ Visualize relations between chat partners. For graphical output, GraphViz_ will be utilized (has to be installed) and various formats can be written. .. _GraphViz: http://www.graphviz.org/ :Copyright: 2007 Joche...
Python
0
@@ -471,16 +471,25 @@ s import + ENGINES, FORMATS @@ -1911,48 +1911,22 @@ ces= -('dot', 'twopi', 'neato', 'circo', 'fdp' +sorted(ENGINES ),%0A
1d1f9c79197946c9e078f0fa96a14e667fd4afb8
Annotate MatterAdmin queryset with value of __str__ to enable sortability in the list display
cityhallmonitor/admin.py
cityhallmonitor/admin.py
from django.contrib import admin from cityhallmonitor.models import \ Action, Person, BodyType, Body, \ MatterAttachment, MatterStatus, MatterType, Matter, \ MatterSponsor, VoteType, Event, EventItem, Subscription class ActionAdmin(admin.ModelAdmin): list_display = ('name', 'active_flag', 'last_mo...
Python
0.000001
@@ -26,16 +26,47 @@ t admin%0A +from django.db.models import F%0A from cit @@ -94,16 +94,16 @@ mport %5C%0A - Acti @@ -937,32 +937,33 @@ dy, BodyAdmin)%0A%0A +%0A class MatterStat @@ -1380,31 +1380,35 @@ display = (' -__str__ +display_val ', 'matter_s @@ -1546,24 +1546,29 @@ ', 'title'%5D%0A + %0A ...
11f178ec6b2e6c62dbf72901022690797b9525fe
Update nn.py
Miniflow/nn.py
Miniflow/nn.py
""" Have fun with the number of epochs! Be warned that if you increase them too much, the VM will time out :) """ import numpy as np from sklearn.datasets import load_boston from sklearn.utils import shuffle, resample from miniflow import * # Load data data = load_boston() X_ = data['data'] y_ = data['target'] # No...
Python
0.000002
@@ -1047,50 +1047,600 @@ p 4%0A -learning_rate=1e-3%0Afor i in range(epochs): +t1 = 1/1000%0At2 = t1 / 1.05%0Alearning_rate = 0.1%0A%0Aloss = 0%0Alossprev = loss%0Aloss_delta_rel = 1%0Aloss_delta_rel_xa1 = 1%0Aloss_delta_rel_xa2 = 1%0Aloss_delta_rel_xa_rel = 1%0Afor i in range(epochs):%0A %0A if (lossprev %3E 0)...
5c61bbc02ff6b4bb875123b438312fa4d513dd6c
add isRunning
modules/job_manager.py
modules/job_manager.py
import Queue import threading class JobManager (threading.Thread): def __init__(self): threading.Thread.__init__(self) def run(self): while True: # Monitor lock and check condition.acquire() if main_queue.empty(): condition.wait() ...
Python
0.000361
@@ -941,16 +941,143 @@ jobId%0A%0A +def isRunning(jobId):%0A if main_dict.has_key(jobId):%0A return main_dict%5BjobId%5D == None%0A else:%0A return False%0A%0A def isDo
df717d5c5d6bb84d0ac9983d24364fdbecc26db0
Update sfp_keybase.py
modules/sfp_keybase.py
modules/sfp_keybase.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------- # Name: sfp_keybase # Purpose: Spiderfoot plugin to query KeyBase API # to gather additional information about username # # Author: Krishnasis Mandal <krishnasis@hotmail.com> # # Cr...
Python
0.000001
@@ -645,17 +645,16 @@ lugin):%0A -%0A %22%22%22K @@ -7295,16 +7295,17 @@ ontinue%0A +%0A @@ -7304,36 +7304,103 @@ - +# Remove unescaped %5Cn literals%0A pgpKey = pgpKey.replace(%22%5C%5C%5Cn%22, %22%22)%0A %0A
f40fdbce2ca16902129395f8eef058e5ecc41934
fix naming of wrapped modules
dune/pymor/core/wrapmodule.py
dune/pymor/core/wrapmodule.py
# This file is part of the dune-pymor project: # https://github.com/pyMor/dune-pymor # Copyright Holders: Felix Albrecht, Stephan Rave # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) from inspect import isclass from types import ModuleType from dune.pymor.core.wrapper import Wrapper fr...
Python
0
@@ -1434,24 +1434,8 @@ (mod -, parent_name='' ):%0A @@ -1492,115 +1492,8 @@ ())%0A - full_name = '.'.join(%5Bparent_name, wrapped_mod.__name__%5D) if parent_name else wrapped_mod.__name__%0A @@ -1561,32 +1561,8 @@ True -, 'full_name': full_name %7D%0A @@ -1683,19 +1683,8 @@ es(v -, full_name )%0A...
b769df32b4b0fc2f7be5f0373cb78c728e863b3e
print out and write to file with nice unicode str
Lib/glyphNameFormatter/test/__init__.py
Lib/glyphNameFormatter/test/__init__.py
# -*- coding: UTF-8 -*- from glyphNameFormatter.unicodeRangeNames import getRangeByName from glyphNameFormatter import GlyphName from glyphNameFormatter.data import unicode2name_AGD def _rangeNameToRange(rangeName): if isinstance(rangeName, tuple): return rangeName return getRangeByName(rangeName) ...
Python
0
@@ -177,16 +177,45 @@ me_AGD%0A%0A +includeScriptPrefix = False%0A%0A %0Adef _ra @@ -471,32 +471,73 @@ Name(uniNumber=u +, includeScriptPrefix=includeScriptPrefix )%0A name = @@ -965,24 +965,54 @@ %22.join(out)%0A + out = out.encode(%22utf-8%22)%0A if toFil @@ -1067,32 +1067,16 @@ rint out -.encode...
8e831fe5b9d3aa281f535182e36466a3d121de03
Remove model from output if disonnected data
Orange/widgets/utils/owlearnerwidget.py
Orange/widgets/utils/owlearnerwidget.py
import numpy as np from PyQt4.QtCore import QTimer, Qt from Orange.classification.base_classification import LearnerClassification from Orange.data import Table from Orange.preprocess.preprocess import Preprocess from Orange.widgets import gui from Orange.widgets.settings import Setting from Orange.widgets.utils.sql i...
Python
0
@@ -5455,16 +5455,59 @@ = True%0A + else:%0A self.model = None %0A
21eeceb718d11bc9eccbdfc1c5fc68a0d2c00ae5
Update TCPReverseShell.py
Shells/Python/Client/TCPReverseShell.py
Shells/Python/Client/TCPReverseShell.py
# Reverse TCP Shell in Python For Offensive Security/Penetration Testing Assignments # Connect on LinkedIn https://www.linkedin.com/in/lismore or Twitter @patricklismore #===================================================================================================================================================...
Python
0.000001
@@ -307,38 +307,8 @@ ==== -============================== %0A%0A#
2e3e19e9fe4ba2c66897c9cd4515893edc973ee9
Add code coverage support in the test suite
palinagent/daemon/tests/testsuite.py
palinagent/daemon/tests/testsuite.py
#! /usr/bin/env python # -*- coding: UTF-8 -*- ################################################################# # # ProActive Parallel Suite(TM): The Java(TM) library for # Parallel, Distributed, Multi-Core Computing for # Enterprise Grids & Clouds # # Copyright (C) 1997-2010 ActiveEon # Contact: proactive@ow2...
Python
0.000001
@@ -2165,18 +2165,16 @@ =%22text%22, - help=%22F @@ -2243,32 +2243,37 @@ e%22,action=%22store +_true %22, dest=%22coverag @@ -2285,19 +2285,20 @@ efault=%22 -Non +Fals e%22, help @@ -2697,31 +2697,27 @@ coverage is -not Non +Tru e:%0A i @@ -2835,15 +2835,11 @@ is -not Non +Tru e:%0A @@ -3123,28 ...
7518fef8d3b0b677a9cac78fb0c85311a0a4ddca
change pleasemailus email to jacco
versioning_service/settings.py
versioning_service/settings.py
import os PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) PROJECT_PATH = os.path.realpath(os.path.join(PROJECT_PATH, '..')) # Django settings for versioning_service project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Jacco Flenter', 'jacco@wercker.com'), ) MANAGERS = ADMINS DATABASES = { 'de...
Python
0
@@ -6594,20 +6594,13 @@ = ' -pleasemailus +jacco @wer
44172d98ac6109cc966d741aa0228c8a0a4db06a
Make this dialog modal again
gaphor/services/helpservice.py
gaphor/services/helpservice.py
"""About and help services. (help browser anyone?)""" import os from builtins import object from logging import getLogger import pkg_resources from gi.repository import GdkPixbuf from gi.repository import Gtk from zope.interface import implementer from gaphor.application import Application from gaphor.core import _,...
Python
0.000002
@@ -1427,16 +1427,46 @@ phor'))%0A + about.set_modal(True)%0A
5acedf6fab1607f8dea0cdc46df66daea870a275
Update fastq.py
poretools/fastq.py
poretools/fastq.py
import Fast5File import sys def run(parser, args): for fast5 in Fast5File.Fast5FileSet(args.files): if args.start_time or args.end_time: read_start_time = fast5.get_start_time() read_end_time = fast5.get_end_time() if args.start_time and args.start_time > read_start_time: fast5.close() continue ...
Python
0.000001
@@ -652,32 +652,33 @@ _length or %5C%0A%09%09%09 +( len(fa.seq) %3E ar @@ -719,16 +719,17 @@ ngth %3E 0 +) :%09%09%09%0A%09%09%09
45b48a660c0854719f77821f0617c096b89c927d
Fix mimetype for project pages
portfolio/views.py
portfolio/views.py
from flask import abort, Blueprint, g, make_response, render_template from portfolio.minify import render_minified from portfolio.projects import Project from portfolio.sitemap import Sitemap site = Blueprint('site', __name__, static_folder='static') projects = Project() # home @site.route('/') def index(): retu...
Python
0.000003
@@ -411,16 +411,17 @@ ('/%3Ckey%3E +/ ')%0Adef p
512cfb2cedd3a3d2ae8b0d7d28bcb97f81492857
Index dicts removed.
mind_monitor/monitor_common.py
mind_monitor/monitor_common.py
# coding=utf-8 """ Common definitions. """ # Copyright (c) 2015 Stefan Braun # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and # associated documentation files (the "Software"), to deal in the Software without restriction, # including without limitation the rights to ...
Python
0
@@ -1592,392 +1592,4 @@ '%5D)%0A -%0A# Indices into record tuple%0Aidx_record = %7B'session': 0, 'timestamp': 1, 'highAlpha': 2, 'highBeta': 3, 'highGamma': 4,%0A 'delta': 5,%0A 'theta': 6,%0A 'lowAlpha': 7, 'lowBeta': 8, 'lowGamma': 9,%0A 'attention': 10, 'meditatio...
cfe44a762552e98cb1cd8abec41af337acdb1a36
Use int16 for spy_colors dtype
spectral/config.py
spectral/config.py
''' Code for package-level customization. ''' from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np class SpySettings: '''Run-time settings for the `spectral` module. After importing `spectral`, the settings object is referenced as `spectral.settings`. ...
Python
0
@@ -5836,7 +5836,8 @@ .int -8 +16 )%0A
2b3b7d2f2cbe15e5807e3bc3697ed36a8ab309a9
Bump to version 1.9.0. This closes #142.
spoppy/__init__.py
spoppy/__init__.py
import logging try: import click from lockfile import LockFile, LockTimeout except ImportError: click = None logger = logging.getLogger('spoppy.main') def get_version(): return '1.8.1' if click: @click.command() @click.argument('username', required=False) @click.argument('password', re...
Python
0
@@ -197,11 +197,11 @@ '1. -8.1 +9.0 '%0A%0A%0A
565c95ce9a8ff96d177196c6dbf8d8f88cdfa029
Add an error class for string data that is ignored by the parser
poyo/exceptions.py
poyo/exceptions.py
# -*- coding: utf-8 -*- class PoyoException(Exception): """Super class for all of Poyo's exceptions.""" class NoMatchException(PoyoException): """Raised when the parser cannot find a pattern that matches the given string. """ class NoParentException(PoyoException): """Raised when there is no p...
Python
0.000002
@@ -479,24 +479,183 @@ given string.%0A %22%22%22%0A +%0A%0Aclass IgnoredMatchException(PoyoException):%0A %22%22%22Raised when a match does result in a Python representation such as a%0A comment or a blank line.%0A %22%22%22%0A
d21046edde2ebb58b2ab329b45a3c0cd3a4c2d25
Add example with Proesmans
examples/plot_optical_flow.py
examples/plot_optical_flow.py
""" Optical flow ============ This tutorial offers a short overview of the optical flow routines available in pysteps and it will cover how to compute and plot the motion field from a sequence of radar images. """ from datetime import datetime from pprint import pprint import matplotlib.pyplot as plt im...
Python
0
@@ -4506,16 +4506,707 @@ ow()%0D%0A%0D%0A +################################################################################%0D%0A# Anisotropic diffusion method (Proesmans et al 1994)%0D%0A# ---------------------------------------------------%0D%0A#%0D%0A# This module implements the anisotropic diffusion method present...
bb714c1fcab581a029246291ae841e7af63ac95c
Fix for #42
spotpy/database.py
spotpy/database.py
# -*- coding: utf-8 -*- ''' Copyright (c) 2015 by Tobias Houska This file is part of Statistical Parameter Optimization Tool (SPOTPY). :author: Tobias Houska This is the parent class of all algorithms, which can handle the database structure during the sample. ''' from __future__ import absolute_import from __future...
Python
0
@@ -5983,17 +5983,17 @@ s=True)%5B -1 +0 :%5D%0A
8a41d9417cd108df2fb31207c301e08326bc20ca
Add write flag and logging command.
newrun.py
newrun.py
''' Script to create and populate new run directory. Created on 25 Jun 2010 @author: Ian Huston ''' import configuration import os import os.path import helpers import logging import sys import time from optparse import OptionParser from setup import setup, setup_args #Version information from sys import version as p...
Python
0
@@ -4208,18 +4208,26 @@ -with open( +provenance_file = os.p @@ -4290,16 +4290,52 @@ ce.log%22) + %0A with open(provenance_file, %22w%22 ) as f:%0A @@ -4389,16 +4389,86 @@ e_dict)%0A + logging.info(%22Created provenance file %25s.%22 %25 provenance_file)%0A %0A
8dc6c31e6c8970e9cda1bb298beb1d3b0620be58
Remove feedparser
pipe2py/modules/pipefetchsitefeed.py
pipe2py/modules/pipefetchsitefeed.py
# -*- coding: utf-8 -*- # vim: sw=4:ts=4:expandtab """ pipe2py.modules.pipefetchsitefeed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://pipes.yahoo.com/pipes/docs?doc=sources#FetchSiteFeed """ try: import speedparser as feedparser except ImportError: import feedparser feedparser.USER_AGENT = ( ...
Python
0.000001
@@ -198,17 +198,8 @@ %22%22%0A%0A -try:%0A impo @@ -216,205 +216,8 @@ rser - as feedparser%0Aexcept ImportError:%0A import feedparser%0A%0A feedparser.USER_AGENT = (%0A %22pipe2py (feedparser/%25s) +https://github.com/ggaughan/pipe2py%22 %25%0A feedparser.__version__%0A ) %0A%0Afr @@ -115...
0090523b4e06513908f5232356c4c8ec48fc5443
Improve argument parser.
examples/restaurantbot/run.py
examples/restaurantbot/run.py
import argparse import asyncio import logging from typing import Text, Optional import rasa.utils.io import rasa.train from examples.restaurantbot.policy import RestaurantPolicy from rasa.core.agent import Agent from rasa.core.interpreter import RasaNLUInterpreter from rasa.core.policies.memoization import Memoization...
Python
0.000002
@@ -599,34 +599,8 @@ path -, config_file=%22config.yml%22 )%0A @@ -2364,30 +2364,247 @@ on=%22 -Start the bot. +Restaurant Bot%22)%0A%0A subparser = parser.add_subparsers(dest=%22subparser_name%22)%0A train_parser = subparser.add_parser(%22train%22, help=%22train a core or nlu model%22)%0A parse_parser = ...
9d8dcc1d97f68fe8f6de25fac9737304e8ec05ff
Save dates in ISO format
events.py
events.py
from flask import request import redis import config import datetime import json redis_client = redis.StrictRedis(host=config.redis_config["host"], port=config.redis_config["port"]) def handle_app_install(request): print "Handling app install", request.json userID = request.json["userId"] token = request....
Python
0.999982
@@ -550,13 +550,15 @@ n %22%7B -0 %7D-%7B -1 +:02d %7D%22.f
70df8bb6250be2e7a6de66b2dea8ce432b6996a8
Fix deprecation warnings
doc/ext/nova_todo.py
doc/ext/nova_todo.py
# -*- coding: utf-8 -*- # This is a hack of the builtin todo extension, to make the todo_list more user friendly from sphinx.ext.todo import * from docutils.parsers.rst import directives import re def _(s): return s def process_todo_nodes(app, doctree, fromdocname): if not app.config['todo_include_todos']: ...
Python
0.9984
@@ -949,26 +949,34 @@ lists%5Bi%5D -.set_class +%5B'classes'%5D.append ('todo_l @@ -2000,26 +2000,34 @@ para -.set_class +%5B'classes'%5D.append ('todo_l @@ -2246,26 +2246,34 @@ entry%5B1%5D -.set_class +%5B'classes'%5D.append ('detail @@ -2575,26 +2575,34 @@ item -.set_class +%5B'classes'%5D.append ('t...
f97b3d7b11f63f0f742a1ed0e89ea569aaa6a6d1
Simplify set usage in wordcount example
examples/wordcount/example.py
examples/wordcount/example.py
""" Winton Kafka Streams Main entrypoints """ import logging import time import collections from winton_kafka_streams.processor import BaseProcessor, TopologyBuilder import winton_kafka_streams.kafka_config as kafka_config import winton_kafka_streams.kafka_stream as kafka_stream log = logging.getLogger(__name__) ...
Python
0.000036
@@ -910,32 +910,14 @@ rds +%7C = se -lf.dirty_words.union +t (wor @@ -1180,14 +1180,14 @@ ords -.clear + = set ()%0A%0A
50f118b3aeeb58dbe518fc9e3c5175ce4e2b6114
Use secure connection for tools/console by default (merged from tmatsuo).
tools/remote_api.py
tools/remote_api.py
#!/usr/bin/python2.5 # Copyright 2009-2010 by Ka-Ping Yee # # 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 ...
Python
0
@@ -1874,16 +1874,29 @@ ord=None +, secure=True ):%0A %22 @@ -2483,16 +2483,39 @@ , server +,%0A secure=secure )%0A%0A d @@ -3916,18 +3916,19 @@ port or -80 +443 )%0A @@ -4651,16 +4651,50 @@ password +,%0A secure=(port == 443) )%0A%0A #
3eba9b8c2c3a1736549cbe6f5dfcb8fd05da62ab
Add GET /tags
nmhive.py
nmhive.py
#!/usr/bin/env python import json import mailbox import tempfile import urllib.request import flask import flask_cors app = flask.Flask(__name__) flask_cors.CORS(app) _TAGS = {} @app.route('/mid/<message_id>', methods=['GET', 'POST']) def message_id_tags(message_id): if flask.request.method == 'POST': ...
Python
0
@@ -171,17 +171,272 @@ %0A%0A%0A_ -TAGS = %7B%7D +AVAILABLE_TAGS = %7B%0A 'bug',%0A 'needs-review',%0A 'obsolete',%0A 'patch',%0A %7D%0A_TAGS = %7B%7D%0A%0A%0A@app.route('/tags', methods=%5B'GET'%5D)%0Adef tags():%0A return flask.Response(%0A response=json.dumps(sorted(_AVAILABLE_TAGS)),%0A ...
a621333a4c4fcc161f076980c9147faa555de5de
Store firmware size as last 4 bytes of padding area.
esp8266/makeimg.py
esp8266/makeimg.py
import sys SEGS_MAX_SIZE = 0x9000 assert len(sys.argv) == 4 with open(sys.argv[3], 'wb') as fout: with open(sys.argv[1], 'rb') as f: data_flash = f.read() fout.write(data_flash) print('flash ', len(data_flash)) pad = b'\xff' * (SEGS_MAX_SIZE - len(data_flash)) fout.write(pad)...
Python
0
@@ -3,16 +3,30 @@ port sys +%0Aimport struct %0A%0ASEGS_M @@ -262,183 +262,274 @@ -pad = b'%5Cxff' * (SEGS_MAX_SIZE - len(data_flash))%0A fout.write(pad)%0A print('padding ', len(pad))%0A%0A with open(sys.argv%5B2%5D, 'rb') as f:%0A data_rom = f.read()%0A +with open(sys.argv%5B2%5D, 'rb') a...
ca572a9bbe22a006537c8d6cebc7854cb65cf6bc
Add latlng point filter to georegion API
froide/georegion/api_views.py
froide/georegion/api_views.py
import json import re from rest_framework import serializers from rest_framework import viewsets from rest_framework.settings import api_settings from rest_framework_jsonp.renderers import JSONPRenderer from django_filters import rest_framework as filters from froide.helper.api_utils import OpenRefineReconciliation...
Python
0
@@ -16,16 +16,59 @@ ort re%0A%0A +from django.contrib.gis.geos import Point%0A%0A from res @@ -2265,24 +2265,80 @@ .all()%0A ) +%0A latlng = filters.CharFilter(method='latlng_filter') %0A%0A class @@ -3037,16 +3037,355 @@ )%0A%0A + def latlng_filter(self, queryset, name, value):%0A try:%0A...
cf095ece24f2b50298afd1d5f5855771e2685cff
Fix media root to work with the new namespace.
gargoyle/web/nexus_modules.py
gargoyle/web/nexus_modules.py
""" gargoyle.nexus_modules ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 DISQUS. :license: Apache License 2.0, see LICENSE for more details. """ import nexus class GargoyleModule(nexus.NexusModule): home_url = 'index' name = 'gargoyle' def get_title(self): return 'Gargoyle' def get_urls(self...
Python
0
@@ -151,16 +151,132 @@ t nexus%0A +import os%0Afrom gargoyle.client.singleton import gargoyle%0Afrom django.http import HttpResponse, HttpResponseNotFound%0A %0A%0Aclass @@ -346,32 +346,116 @@ ame = 'gargoyle' +%0A media_root = os.path.normpath(os.path.join(os.path.dirname(__file__), 'media')) %0A%0A def get...
6fb2746386fe541ea56ba9264e96591da62476e0
fix (pre-existing) bug with wrong filename
genomepy/plugins/blacklist.py
genomepy/plugins/blacklist.py
import os.path import re import sys import zlib from urllib.request import urlopen from genomepy.plugin import Plugin class BlacklistPlugin(Plugin): base_url = "http://mitra.stanford.edu/kundaje/akundaje/release/blacklists/" http_dict = { "ce10": base_url + "ce10-C.elegans/ce10-blacklist.bed.gz", ...
Python
0.000004
@@ -963,24 +963,38 @@ (genome.name +.split('.')%5B0%5D )%0A @@ -1496,24 +1496,8 @@ ) -.decode(%22utf-8%22) %0A
0624ccc9ccd18244622404aaa7ff8717e437d4c5
Fix documentation for inspect_secret referring to removal.
docker/api/secret.py
docker/api/secret.py
import base64 import six from .. import errors from .. import utils class SecretApiMixin(object): @utils.minimum_version('1.25') def create_secret(self, name, data, labels=None, driver=None): """ Create a secret Args: name (string): Name of the secret ...
Python
0
@@ -1560,38 +1560,39 @@ f the secret to -remove +inspect %0A%0A Re
3e769d5bdc19eb65da0972226d9fb4abb5d149db
update example for button type template
example/example.py
example/example.py
from flask import Flask from flask import request import sys import os sys.path.append("..") from fbmsgbot.bot import Bot from fbmsgbot.models.message import Message from fbmsgbot.models.template import Template from fbmsgbot.models.attachment import WebUrlButton, Element import json app = Flask(__name__) bot = Bot...
Python
0
@@ -761,16 +761,24 @@ ext == ' +generic button': @@ -1106,16 +1106,355 @@ ayload)%0A + elif m.text == 'button':%0A buttons = %5B%5D%0A b = WebUrlButton('google', 'https://www.google.ca')%0A buttons.append(b)%0A tmpl = Template('button', buttons=buttons, %0A ...
502167c451b5ebcfa0a18568fd992d942cc34c86
Add missing imports
plugins/invitejoiner/invitejoiner.py
plugins/invitejoiner/invitejoiner.py
import plugin from twisted.python import log class Invitejoiner(plugin.Plugin): def __init__(self): plugin.Plugin.__init__(self, "Invitejoiner") def invited(self, server, channel): log.msg("Invited to: ", channel) self.join(server, channel) if __name__ == "__main__": sys.exit(I...
Python
0.000002
@@ -1,8 +1,103 @@ +from __future__ import division, absolute_import, print_function, unicode_literals%0A%0Aimport sys%0A %0Aimport @@ -136,16 +136,17 @@ rt log%0A%0A +%0A class In
e38b058b98abe18a1cb666e3587253224f161e7d
update mixture classification layer
pnet/mixture_classification_layer.py
pnet/mixture_classification_layer.py
from pnet.layer import SupervisedLayer from pnet.layer import Layer import numpy as np import amitgroup as ag from pnet.bernoullimm import BernoulliMM from sklearn.utils.extmath import logsumexp @Layer.register('mixture-classification-layer') class MixtureClassificationLayer(SupervisedLayer): def __init__(self, n_...
Python
0
@@ -1544,17 +1544,17 @@ ape%5B0%5D, -i +j + block
aa0eca65bf9d07856c5cb03afb41fb11f64b01a6
handle and post images embedded in the tweet
hangupsbot/plugins/twitter.py
hangupsbot/plugins/twitter.py
import aiohttp, asyncio, io, logging, os, re, urllib.request, json, datetime from TwitterAPI import TwitterAPI from bs4 import BeautifulSoup import plugins logger = logging.getLogger(__name__) def prettydate(diff): s = diff.seconds if diff.days > 7 or diff.days < 0: return d.strftime('%d %b %y') el...
Python
0
@@ -642,13 +642,22 @@ mat( +round( s/60) +,1) %0A @@ -751,15 +751,24 @@ mat( +round( s/3600) +,1) %0A%0Ade @@ -3602,24 +3602,577 @@ t, timeago)%0A + try:%0A images = tweet%5B'extended_entities'%5D%5B'media'%5D%0A for image in images:%0A if image%5B'type'%5D == 'photo':%0A imagelin...
dfb64b7df94e1b385ccd0ffaff4d1fd01c3761db
Add notification list property to sample settings
helpdesk/settings_template.py
helpdesk/settings_template.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from helpdesk.conf.base import * import os # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! # $ cat ...
Python
0
@@ -2292,8 +2292,40 @@ pport%5D'%0A +%0ANOTIFICATION_EMAIL_LIST = None%0A
e17a5d6c23eedd44917745cdf4afcba6b85721c4
Fix issue detected by mypy.
example_compute.py
example_compute.py
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
Python
0
@@ -1085,50 +1085,70 @@ = %5B -driver.list_nodes() for driver in drivers%5D +%5D%0Afor driver in drivers:%0A nodes.extend(driver.list_nodes()) %0A%0Apr
0f7f67e382080b2f5ed9c2c58c5ed240416b7342
streamline the Batman example code
examples/batman.py
examples/batman.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, ...
Python
0.999984
@@ -844,16 +844,459 @@ Batman%0A%0A +In this example we create following commands with some lines of code:%0A%0A- command: whoareyou%0A- response: I'm Batman!%0A%0A- command: cave%0A- response: The Batcave is silent...%0A%0A- command: cave give me some echo%0A- response: The Batcave echoes, 'give me some echo'%0A%0A- ...
3e7267ed1a2e31fbb3fc1bd10535c53b1d8dcf85
simplify examples
examples/canvas.py
examples/canvas.py
from __future__ import print_function import time from simpleflow import ( activity, futures, Workflow, ) from simpleflow.canvas import Group, Chain from simpleflow.task import ActivityTask @activity.with_attributes(task_list='example', version='example') def increment_slowly(x): time.sleep(1) re...
Python
0
@@ -1333,36 +1333,24 @@ -ActivityTask (increment_s @@ -1376,36 +1376,24 @@ -ActivityTask (increment_s @@ -1419,36 +1419,24 @@ -ActivityTask (increment_s @@ -1485,29 +1485,16 @@ -ActivityTask( multiply ),%0A @@ -1489,17 +1489,16 @@ multiply -) ,%0A @@ -1578,1...
12f01d84b86c09db731c582a8600f89b3f513fc2
update syntax for server example
examples/server.py
examples/server.py
""" Example of json-rpc usage with Wergzeug and requests. NOTE: there are no Werkzeug and requests in dependencies of json-rpc. NOTE: server handles all url paths the same way (there are no different urls). """ from werkzeug.wrappers import Request, Response from werkzeug.serving import run_simple from jsonrpc.jsonr...
Python
0
@@ -295,16 +295,17 @@ _simple%0A +%0A from jso @@ -312,16 +312,8 @@ nrpc -.jsonrpc imp @@ -338,16 +338,116 @@ eManager +, dispatcher%0A%0A%0A@dispatcher.add_method%0Adef foobar(**kwargs):%0A return kwargs%5B%22foo%22%5D + kwargs%5B%22bar%22%5D %0A%0A%0A@Requ @@ -508,18 +508,16 @@ cher is -a dictiona @@ -5...
55af90dd1c4aa7caa1dc34b8ff1cca2f27e9d748
Add atom features to simple.py example
examples/simple.py
examples/simple.py
from molml.features import CoulombMatrix # Define some base data H2_ELES = ['H', 'H'] H2_NUMS = [1, 1] H2_COORDS = [ [0.0, 0.0, 0.0], [1.0, 0.0, 0.0], ] H2_CONNS = { 0: {1: '1'}, 1: {0: '1'}, } HCN_ELES = ['H', 'C', 'N'] HCN_NUMS = [1, 6, 7] HCN_COORDS = [ [-1.0, 0.0, 0.0], [0.0, 0.0, 0.0], ...
Python
0.000001
@@ -33,16 +33,62 @@ mbMatrix +%0Afrom molml.features import LocalCoulombMatrix %0A%0A# Defi @@ -1386,8 +1386,202 @@ _spec%5D)%0A + print%0A%0A # Example of generating the Local Coulomb matrix (atom-wise%0A # representation)%0A print %22Atom feature%22%0A feat = LocalCoulombMatrix()%0A print feat.fi...
85722c2efeaeb606591012fd19831fc31d199f86
move start_analysis to xpdAn
profile_analysis/startup/999-load.py
profile_analysis/startup/999-load.py
from bluesky.callbacks.zmq import RemoteDispatcher from bluesky.utils import install_qt_kicker # setup glbl # from xpdan.pipelines.callback import MainCallback from xpdan.pipelines.main import raw_source from xpdan.pipelines.main import (mask_kwargs as _mask_kwargs, pdf_kwargs as _pdf...
Python
0.000001
@@ -2,1606 +2,48 @@ rom -bluesky.callbacks.zmq import RemoteDispatcher%0Afrom bluesky.utils import install_qt_kicker%0A%0A# setup glbl%0A# from xpdan.pipelines.callback import MainCallback%0Afrom xpdan.pipelines.main import raw_source%0Afrom xpdan.pipelines.main import (mask_kwargs as _mask_kwargs,%0A ...
9956317741bdef54a15d51197a6165d67c40fb03
Add up-down motion of bird on welcome screen
flappy.py
flappy.py
import random import sys import pygame from pygame.locals import * FPS = 30 SCREENWIDTH = 288 SCREENHEIGHT = 512 # image and sound object's dicts IMAGES, SOUNDS = {}, {} # list of players (tuple of 3 positions of flap) PLAYERS_LIST = ( # red bird ( 'assets/sprites/redbird-upflap.png', 'asset...
Python
0.000001
@@ -3239,16 +3239,245 @@ hInfo)%0A%0A +def getBirdShmValue(birdShmValue, birdShmDir):%0A if abs(birdShmValue) == 8:%0A birdShmDir *= -1%0A%0A if birdShmDir == 1:%0A birdShmValue += 1%0A else:%0A birdShmValue -= 1%0A return birdShmValue, birdShmDir%0A%0A%0A def show @@ -3492,24 +3492,...
241a729208f8e8fa4e914145a1e9288766ad9e9d
revert owlbot main branch templates (#39)
owlbot.py
owlbot.py
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, softwar...
Python
0
@@ -1378,749 +1378,4 @@ e)%0A%0A -# ----------------------------------------------------------------------------%0A# Main Branch migration%0A# ----------------------------------------------------------------------------%0A%0As.replace(%0A %22*.rst%22,%0A %22master%22,%0A %22main%22%0A)%0A%0As.replace(%0A %22CONTRI...