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
7f77f822dcf05152634cda771cce934320d23ca1
use image data
experiments/01-single-dimer/plot_velocity.py
experiments/01-single-dimer/plot_velocity.py
#!/usr/bin/env python3 import argparse parser = argparse.ArgumentParser() parser.add_argument('file', type=str, help='H5MD datafile') parser.add_argument('--directed', action='store_true') args = parser.parse_args() import numpy as np import h5py import matplotlib.pyplot as plt with h5py.File(args.file, 'r') as f: ...
Python
0.000019
@@ -412,16 +412,63 @@ e'%5D%5B()%5D%0A + im = f%5B'particles/dimer/image/value'%5D%5B...%5D%0A v = @@ -557,16 +557,93 @@ me'%5D%5B()%5D +%0A edges = f%5B'particles/dimer/box/edges'%5D%5B:%5D.reshape((1,-1))%0A%0Ar += edges*im %0A%0Aassert
8fcca42b02653085ae955482d96d68aaac3aa5a6
Handle fp.o addresses.
fedmsg_meta_fedora_infrastructure/fasshim.py
fedmsg_meta_fedora_infrastructure/fasshim.py
import collections import threading import socket from hashlib import sha256, md5 _fas_cache = {} _fas_cache_lock = threading.Lock() import logging log = logging.getLogger("moksha.hub") try: from six.moves.urllib import parse except ImportError: # Really really old 'six' doesn't have this move.. so we fall b...
Python
0
@@ -4328,32 +4328,117 @@ ail, **config):%0A + if email.endswith('@fedoraproject.org'):%0A return email.rsplit('@', 1)%5B0%5D%0A%0A log.debug(%22A
26802dad0bafe8ac67d96b3c30e414af66cf0997
Order by the balance column
l10n_br_financial/report/financial_cashflow.py
l10n_br_financial/report/financial_cashflow.py
# -*- coding: utf-8 -*- # Copyright 2017 KMEE # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import api, fields, models, _, tools from ..models.financial_move_model import ( FINANCIAL_MOVE, FINANCIAL_STATE, FINANCIAL_TYPE ) class FinancialCashflow(models.Model): _name = 'fi...
Python
0
@@ -348,16 +348,96 @@ = False +%0A # _order = 'amount_cumulative_balance'%0A _order = 'business_due_date, id' %0A%0A am @@ -6527,16 +6527,25 @@ er by b. +business_ due_date
8ac7a7924277ef660df92f5f221dc678e4a14d9c
allow non-cell regions in ConstantFunctionByRegion.get_constants()
sfepy/discrete/functions.py
sfepy/discrete/functions.py
import numpy as nm from sfepy.base.base import assert_, OneTypeList, Container, Struct class Functions(Container): """Container to hold all user-defined functions.""" def from_conf(conf): objs = OneTypeList(Function) for key, fc in conf.iteritems(): fun = Function(name = fc.name, ...
Python
0.000004
@@ -3889,54 +3889,200 @@ -ii = term.region.get_cell_indices(region.cel +cells = region.get_cells(true_cells_only=False)%0A ii = term.region.get_cell_indices(cells,%0A true_cells_only=Fa ls +e )%0A
5a3a92c67e63ce7196e51555d2e683d746dd81b7
Add settings get_defaults() utility
virtool/settings.py
virtool/settings.py
import logging logger = logging.getLogger(__name__) SCHEMA = { # Samples "sample_group": { "type": "string", "default": "none" }, "sample_group_read": { "type": "boolean", "default": True }, "sample_group_write": { "type": "boolean", "default": F...
Python
0.000001
@@ -4764,28 +4764,109 @@ %22strain%22%0A %5D%0A %7D%0A%7D%0A +%0A%0Adef get_defaults():%0A return %7Bkey: SCHEMA%5Bkey%5D%5B%22default%22%5D for key in SCHEMA%7D%0A
02ae6cadac686c9c601bcad42c6b95b8811c3cfb
Add --ip and --port flag to example.
examples/commandline.py
examples/commandline.py
"""commandline. Usage: commandline.py lookup --lang=<lang> --word=<preword> commandline.py -h | --help Options: -h --help Show this screen. --lang=<lang> Language of suggested word. --word=<preword> Pre-word of suggested word. """ import redis import py_word_suggest # from config import REDIS_IP fro...
Python
0
@@ -71,16 +71,56 @@ preword%3E + %5B--ip=%3Credis-ip%3E%5D %5B--port=%3Credis-port%3E%5D %0A comma @@ -167,16 +167,24 @@ elp + Show thi @@ -208,16 +208,24 @@ g=%3Clang%3E + Languag @@ -267,16 +267,18 @@ ord%3E + Pre-word @@ -301,232 +301,470 @@ rd.%0A -%0A%22%22%22%0Aimport redis%0...
e9905f9929819ea6bb206a969747435a9c6737d7
Return used text and Image object as tuple
claptcha/claptcha.py
claptcha/claptcha.py
# -*- coding: utf-8 -*- import sys import os import random from functools import wraps from io import BytesIO from PIL import Image, ImageDraw, ImageFont class ClaptchaError(Exception): """Exception class for Claptcha errors""" pass class Claptcha(object): def __init__(self, source, font, size=(200,80)...
Python
0.999863
@@ -1047,22 +1047,30 @@ return + (text, image +) %0A%0A @p
ca1fa126611f958ccd893f034df74e8821f41771
update prototype
hardware/prototype/read_serial.py
hardware/prototype/read_serial.py
__author__ = 'sachinpatney' import serial import time import binascii ser = serial.Serial('/dev/ttyUSB0', baudrate=9600, timeout=1.0) s = b'' def do(cmd): if cmd == 'play': print('Playing music ...') while True: bytesToRead = ser.inWaiting() if bytesToRead > 0: s += ser.rea...
Python
0
@@ -716,16 +716,53 @@ t(data)%0A + print(len(data))%0A
8f01b5901034cbfa5ff5170a64e6d19e1f49512e
fix AutoLSTM test after merge (#3988)
pyzoo/test/zoo/zouwu/autots/model/test_auto_lstm.py
pyzoo/test/zoo/zouwu/autots/model/test_auto_lstm.py
# # Copyright 2018 Analytics Zoo Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
Python
0
@@ -798,32 +798,8 @@ hp%0A%0A -%0Adef get_x_y(size):%0A inpu @@ -817,20 +817,16 @@ im = 10%0A - output_f @@ -840,20 +840,16 @@ dim = 2%0A - past_seq @@ -857,20 +857,16 @@ len = 5%0A - future_s @@ -876,16 +876,37 @@ len = 1%0A +%0A%0Adef get_x_y(size):%0A x = @@ -2055,34 +2055,49 @@ put_f...
2846b996783b896f69ec0870569c7e442ddcc652
fix imports, arguments
sfepy/terms/terms_fibres.py
sfepy/terms/terms_fibres.py
from sfepy.terms.terms import * from sfepy.terms.terms_hyperelastic_tl import HyperElasticTLBase from sfepy.homogenization.utils import iter_sym class FibresActiveTLTerm(HyperElasticTLBase): r""":description: Hyperelastic active fibres term. Effective stress $S_{ij} = A f_{\rm max} \exp{-(\frac{\epsilon - \var...
Python
0.000001
@@ -25,16 +25,64 @@ mport *%0A +from sfepy.terms.terms_base import VectorVector%0A from sfe @@ -212,16 +212,30 @@ eTLTerm( +VectorVector, HyperEla @@ -872,16 +872,8 @@ ata, - ap, vg, mod
75dd4dece168fbe38609fc0ec4843f7563075a80
Bump release
doc/source/conf.py
doc/source/conf.py
# -*- coding: utf-8 -*- # # ipcalc documentation build configuration file, created by # sphinx-quickstart on Sat Apr 11 00:06:38 2009. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
Python
0
@@ -1698,17 +1698,17 @@ se = '0. -4 +5 '%0A%0A# The
37e549e34a20eb6dd14be305a7efff5d2a7832f5
Create SetupDSRCMigrate Step
dbaas/workflow/steps/util/foreman.py
dbaas/workflow/steps/util/foreman.py
from dbaas_credentials.models import CredentialType from dbaas_foreman import get_foreman_provider from physical.models import Vip from workflow.steps.util.base import VipProviderClient from util import exec_remote_command_host, get_or_none_credentials_for from base import BaseInstanceStep class Foreman(BaseInstance...
Python
0
@@ -1599,290 +1599,258 @@ -vip_identifier = Vip.objects.get(infra=self.infra).identifier%0A client = VipProviderClient(self.infra.environment)%0A vip = client.get_vip(vip_identifier)%0A%0A self.provider.setup_database_dscp(%0A self.fqdn, vip.vip_ip, vip.dscp, self.instance.port%0A ...
59d4ed667259607a9e6e8bdfe66388a511422379
update iuwandbox test
tools/wandbox/tests/test_iuwandbox.py
tools/wandbox/tests/test_iuwandbox.py
#!/usr/bin/env python # # test_iuwandbox.py # from __future__ import print_function import sys import os sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../fused') sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/../../wandbox') try: import unittest2 as unittest except: import...
Python
0
@@ -1609,33 +1609,65 @@ path.exists( -fused_src +os.path.join(fused_src, 'iutest.min.hpp') ):%0A @@ -2499,33 +2499,65 @@ path.exists( -fused_src +os.path.join(fused_src, 'iutest.min.hpp') ):%0A
a901ebf403566bdb1ef468b2d528d80f6533ead1
Update dragging example for new plugin architecture
examples/drag_points.py
examples/drag_points.py
""" Draggable Points Example ======================== This example shows how a D3 plugin can be created to make plot elements draggable. A stopPropagation command is used to allow the drag behavior and pan/zoom behavior to work in tandem. """ import numpy as np import matplotlib.pyplot as plt import matplotlib as mpl ...
Python
0
@@ -430,132 +430,344 @@ -var DragPlugin = function(fig, prop)%7B%0A this.fig = fig;%0A this.p +mpld3.register_plugin(%22drag%22, DragPlugin);%0A DragPlugin.prototype = Object.create(mpld3.Plugin.prototype);%0A DragPlugin.prototype.constructor = DragPlugin;%0A DragPlugin.prototype.requiredP rop...
207dd3b5f59ecc66c896cc0f3ad90e283fca5145
refactor the registration process
src/app.py
src/app.py
"""The netify application object.""" # Copyright 2015 Curtis Sand # # 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
@@ -790,16 +790,35 @@ is None: + # First time init %0A @@ -877,37 +877,98 @@ -if config and self.flask_app: + self.registered_views = %5B%5D%0A if config:%0A self.config = config %0A @@ -976,16 +976,25 @@ + self. config.u @@ -1122,79 +1122,793 @@ app. -%22...
67f56e977b3f94e8b1c22ea2070b417a359cd5bf
remove misleading comments about not existing features of C*
feedly/storage/cassandra/timeline_storage.py
feedly/storage/cassandra/timeline_storage.py
from cqlengine import BatchQuery from feedly.storage.base import BaseTimelineStorage from feedly.storage.cassandra import models from feedly.serializers.cassandra.activity_serializer import CassandraActivitySerializer import logging logger = logging.getLogger(__name__) class CassandraTimelineStorage(BaseTimelineSto...
Python
0
@@ -4048,440 +4048,8 @@ s):%0A - '''%0A Deletes multiple activities from storage%0A Unfortunately CQL 3.0 does not support the IN operator inside DELETE query's where-clause%0A for that reason we are going to create 1 query per activity%0A%0A With cassandra %3E= 2.0 is possible to do...
12720a225210afe73f301c2112f0a7ddcdc41bcb
Fix CSR loading in ACME example client script.
examples/acme_client.py
examples/acme_client.py
"""Example script showing how to use acme client API.""" import logging import os import pkg_resources from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.asymmetric import rsa import OpenSSL from acme import client from acme import messages from acme import jose logging.bas...
Python
0
@@ -1276,13 +1276,8 @@ acme -.jose ', o
763ca6b8c359b28f562dcddfd39904d1e59c3a7d
update unit test
_unittests/ut_files/test_files.py
_unittests/ut_files/test_files.py
""" @brief test log(time=12s) You should indicate a time in seconds. The program ``run_unittests.py`` will sort all test files by increasing time and run them. """ import sys import os import unittest import shlex try: import src import pyquickhelper as skip_ except ImportError: path = os.path.nor...
Python
0
@@ -5768,22 +5768,18 @@ -assert +if %22:param @@ -5778,32 +5778,50 @@ aram - threshold:%22 in +%22 in res:%0A raise Exception( res +) %0A
8b67820a60d89304710d568e19191f3ca32e0fb8
Add tests for BibsAndAttachedToSolr exporter
django/sierra/export/tests/test_exporters.py
django/sierra/export/tests/test_exporters.py
""" Tests classes derived from `export.exporter.Exporter`. """ import pytest # FIXTURES AND TEST DATA # Fixtures used in the below tests can be found in # django/sierra/base/tests/conftest.py: # sierra_records_by_recnum_range, sierra_full_object_set, # new_exporter, get_records, export_records, delete_records,...
Python
0
@@ -992,36 +992,51 @@ 'try_delete': -True +%5B'bibdata', 'marc'%5D %0A %7D,%0A @@ -1150,36 +1150,44 @@ 'try_delete': -True +%5B'haystack'%5D %0A %7D,%0A @@ -1308,12 +1308,20 @@ e': -True +%5B'haystack'%5D %0A @@ -1452,37 +1452,34 @@ 'try_delete': -False +%5B%5D %0A %7D,...
643c8bf95bd5ac0df32eed39beb7124badd723ed
allow extra args in subprocess dispatcher
lib/amqp_service/dispatcher/subprocess_dispatcher.py
lib/amqp_service/dispatcher/subprocess_dispatcher.py
import logging import subprocess from amqp_service.dispatcher import util LOG = logging.getLogger(__name__) class SubprocessDispatcher(object): def launch_job(self, command, arguments=[], wrapper=None, wrapper_arguments=[], environment={}, stdout=None, stderr=None): command_list ...
Python
0
@@ -288,16 +288,26 @@ err=None +, **kwargs ):%0A%0A
2dd00f27e0134b04db66a31ef83d34417ce39c46
fix bug where attempted to pickle a placeholder
cleverhans/serial.py
cleverhans/serial.py
"""Serialization functionality. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import joblib import tensorflow as tf from cleverhans.model import Model from cleverhans.utils import safe_zip class PicklableVariable(object): """ A wrapper aro...
Python
0
@@ -2707,16 +2707,263 @@ .copy()%0A +%0A # The base Model class adds this tf reference to self%0A # We mustn't pickle anything tf, this will need to be%0A # regenerated after the model is reloaded.%0A if %22_dummy_input%22 in out:%0A del out%5B%22_dummy_input%22%5D%0A%0A ...
054dc32d30ca9175a6c8b40af52491b8e3a98978
Debug the URL that's being requested
heufybot/modules/util/webutils.py
heufybot/modules/util/webutils.py
from twisted.plugin import IPlugin from heufybot.moduleinterface import BotModule, IBotModule from heufybot.utils.logutils import logExceptionTrace from zope.interface import implements import re, requests class WebUtils(BotModule): implements(IPlugin, IBotModule) name = "WebUtils" canDisable = False ...
Python
0.000001
@@ -28,16 +28,47 @@ IPlugin%0A +from twisted.python import log%0A from heu @@ -216,16 +216,25 @@ s%0Aimport + logging, re, req @@ -1015,16 +1015,70 @@ rn None%0A + log.msg(request.url, level=logging.DEBUG)%0A
87f7d677cfd0a9947f661d88eb482a253c416f27
Remove mentions of has_appcontent from ct_tracker
feincms/module/page/extensions/ct_tracker.py
feincms/module/page/extensions/ct_tracker.py
# ------------------------------------------------------------------------ # coding=utf-8 # ------------------------------------------------------------------------ # # ct_tracker.py # Fein # # Created by Martin J. Laubach on 02.10.09. # Copyright (c) 2009 Martin J. Laubach. All rights reserved. # # ---------------...
Python
0.000001
@@ -838,47 +838,8 @@ ---- -%0AHAS_APPCONTENT_KEY = '_has_appcontent' %0A%0Ade @@ -1834,39 +1834,8 @@ es.%0A - has_appcontent = False%0A @@ -2351,173 +2351,8 @@ d)%0A%0A - if issubclass(feincms_ct, ApplicationContent):%0A has_appcontent = True%0A%0A ct_inventory%...
ab51dd3c6c649e582deeb2309a88738b45bccba8
clean up formatting of logger
src/logger.py
src/logger.py
""" create simple logger class to output results both to text file and display """ import os.path,csv,time class Logger(object): def __init__(self,OUTPUT_LOCATION): self.filename = '__ogp-mdt-log-' + str(time.time()).replace('.','') + '.csv' self.csvfile = open(os.path.join(OUTPUT_LOCATION, self.fi...
Python
0.99835
@@ -94,19 +94,34 @@ path -,csv, +%0Aimport csv%0Aimport time%0A%0A +%0A clas @@ -138,16 +138,17 @@ bject):%0A +%0A def @@ -161,31 +161,32 @@ __(self, -OUTPUT_LOCATION + output_location ):%0A @@ -252,16 +252,17 @@ ace('.', + '') + '. @@ -311,23 +311,23 @@ oin( -OUTPUT_LOCATION +output_location , s...
ebdb3a510718288f5db14539d7261f10abb59c96
Fix a small typo error in clusterdemo.py (#945)
examples/clusterdemo.py
examples/clusterdemo.py
#!/usr/bin/python "clusterdemo.py: demo of Mininet Cluster Edition prototype" from mininet.examples.cluster import ( MininetCluster, SwitchBinPlacer, RemoteLink ) # ^ Could also use: RemoteSSHLink, RemoteGRELink from mininet.topolib import TreeTopo from mininet.log import setLog...
Python
0.000027
@@ -571,17 +571,17 @@ ervers, -L +l ink=Remo
1e873bcbbadd45f950521e7ff4f1057187aaa3d7
Fix SQL selected / SQL explain for gis queries
debug_toolbar/panels/sql/tracking.py
debug_toolbar/panels/sql/tracking.py
import datetime import json from threading import local from time import time from django.utils.encoding import force_str from debug_toolbar import settings as dt_settings from debug_toolbar.utils import get_stack, get_template_info, tidy_stacktrace try: from psycopg2._json import Json as PostgresJson except Imp...
Python
0.998978
@@ -4207,32 +4207,363 @@ ()%0A try:%0A + if isinstance(params, list):%0A%0A def strip_GeomFromEWKB(param):%0A if isinstance(param, str):%0A return param.lstrip(%22ST_GeomFromEWKB('%5C%5Cx%22).rstrip(%22'::bytea)%22)%0A return...
028d4643f728c2618a4660b986694f807a955024
Add some necessary decodes() to neovim_mod
vroom/neovim_mod.py
vroom/neovim_mod.py
from vroom.vim import CONFIGFILE, VimscriptString from vroom.vim import Communicator as VimCommunicator import subprocess import time import neovim import os try: from StringIO import StringIO except ImportError: from io import StringIO class Communicator(VimCommunicator): """Object to communicate with a Neovim ...
Python
0
@@ -1910,16 +1910,32 @@ ression) +.decode('utf-8') %0A%0A def @@ -2639,16 +2639,32 @@ _line(i) +.decode('utf-8') )%0A
509cedcddd409af001ce98c61513a5321f9dc00a
call update cart on cancel (google)
hiicart/gateway/google/gateway.py
hiicart/gateway/google/gateway.py
import base64 import httplib2 import xml.etree.cElementTree as ET from decimal import Decimal from django.template import Context, loader from hiicart.gateway.base import PaymentGatewayBase, SubmitResult from hiicart.gateway.google.settings import SETTINGS as default_settings from hiicart.lib.unicodeconverter import ...
Python
0
@@ -2373,24 +2373,57 @@ cancel_xml)%0A + self.cart.update_state()%0A retu
5dbaf2f519c573dbeb239be0d21282ad432339e8
Fix order in base
project_euler/library/base.py
project_euler/library/base.py
from typing import List def number_to_list(number: int, base: int = 10) -> List[int]: if number < 0: raise ValueError(f'Cannot convert {number} to list, must be positive.') if base <= 0: raise ValueError(f'Cannot convert to base {base}.') digits = [] while number > 0: digits....
Python
0.000079
@@ -372,22 +372,38 @@ return +list(reversed( digits +)) %0A%0A%0Adef l
24b868f99d40e5309fc4a8f8e1ca9d9ca00524ea
move init code into its own function
src/app.py
src/app.py
# Copyright 2015 Curtis Sand # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0.000006
@@ -702,16 +702,83 @@ 12bits%0A%0A +%0AAPP = None # Singleton Flask App%0A%0Adef init():%0A global APP%0A APP = Fl @@ -783,32 +783,36 @@ Flask(__name__)%0A + APP.config.from_ @@ -828,16 +828,20 @@ name__)%0A + APP.conf @@ -904,8 +904,98 @@ SIZE)))%0A + return APP%0A%0Adef run(host=None, port=N...
ddaa70187eb36678b366560f20d53dd75443921c
fix test code
test/test_case/service.py
test/test_case/service.py
import unittest import sys sys.path.append("../../") import time import re from service_test_utils import ServiceTestUtils from dockerEE.remote import RemoteInterfaceImpl from docker_container_test_utils import DockerContainerTestUtils ## TestEnvironmentEmulationServer # # The test case for EnvironmentEmulationService...
Python
0.000024
@@ -3232,32 +3232,46 @@ via %22 + n%5B%22gw%22%5D +.split(%22/%22)%5B0%5D + %22 dev %22 + n%5B%22 @@ -5522,24 +5522,38 @@ %22 + n%5B%22gw%22%5D +.split(%22/%22)%5B0%5D + %22 dev %22 +
fd6a590a715e857c3e258b60daa4906a35a6cd37
update lava-job-runner
lava-job-runner.py
lava-job-runner.py
#!/usr/bin/python import xmlrpclib import sys import subprocess import fnmatch import os import json import time server = None online_device_types = [] offline_device_types = [] online_devices = [] offline_devices = [] job_map = {} def poll_jobs(): run = True submitted_jobs = {} for job in job_map: ...
Python
0
@@ -592,32 +592,61 @@ print + 'job-id-' + str(job) + '-' + os.path.basenam @@ -671,16 +671,17 @@ ob%5D) + ' + : pass'%0A @@ -814,16 +814,45 @@ print + 'job-id-' + str(job) + '-' + os.path @@ -885,16 +885,17 @@ ob%5D) + ' + : fail'%0A @@ -1888,35 +1888,53 @@ print +os.path.basename(...
27175c2cf50022af5c4683ba0283506c5f9a5fc6
Update migration
rest_framework/authtoken/migrations/0001_initial.py
rest_framework/authtoken/migrations/0001_initial.py
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from rest_framework.settings import api_settings try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User...
Python
0.000001
@@ -2252,1411 +2252,80 @@ ' -date_joined': ('django.db.models.fields.DateTimeField', %5B%5D, %7B'default': 'datetime.datetime.now'%7D),%0A 'email': ('django.db.models.fields.EmailField', %5B%5D, %7B'max_length': '75', 'blank': 'True'%7D),%0A 'first_name': ('django.db.models.fields.CharField', ...
680d324c084a165a8dbc8dc967ffa9048f56cf6b
Fix queries - Attempt #7
src/app.py
src/app.py
from flask import Flask, render_template, request, redirect, url_for, session, flash import psycopg2, sys, os, datetime from config import * # Instantiate App app = Flask(__name__) app.secret_key = APP_SECRET_KEY # Database Query Function def db_query(sql_string, for_selection): conn = psycopg2.connect(DB_LOCATIO...
Python
0
@@ -2684,21 +2684,22 @@ sset_on. -asset +convoy _fk = co @@ -2704,23 +2704,24 @@ convoys. -asset_f +convoy_p k%22 %5C%0A%09%09%09 @@ -3654,25 +3654,25 @@ t.depart_dt -%3C +%3E = '%25s';%22 %25 (
dd5ba84c27947f43c8c437d70e81c935aeadcbdd
Fix wrong string escape.
kirppu/management/commands/import_old_item_data.py
kirppu/management/commands/import_old_item_data.py
from collections import defaultdict from decimal import Decimal import sys import re from django.core.exceptions import ObjectDoesNotExist from django.db import transaction from django.utils.dateparse import parse_datetime from django.core.management.base import BaseCommand try: from typing import Dict, List exce...
Python
0.000302
@@ -398,16 +398,28 @@ , item): +%0A pass%0A @@ -1601,16 +1601,17 @@ e.match( +r %22COPY (? @@ -2727,16 +2727,17 @@ e None%0A%0A +%0A ItemColu
e1cb37a061f1522e027004d5ed2aca572223a4a2
Update cooler test utility
test/utils.py
test/utils.py
import h5py import logging logger = logging.getLogger(__name__) def get_cooler_info(file_path): """Get information of a cooler file. Args: file_path (str): Path to a cooler file. Returns: dict: Dictionary containing basic information about the cooler file. """ with h5py.File(fi...
Python
0
@@ -291,16 +291,57 @@ %22%22%22%0A + TILE_SIZE = 256%0A CHROM_CUM_LEN = 0 %0A wit @@ -611,20 +611,16 @@ ength = -int( CHROM_CU @@ -628,13 +628,8 @@ _LEN -%5B-1%5D) %0A
173960e50bf4c2b7306b7107aa8f99d60ad385d2
update docstatus of documents if docstatus value is changed in workflow
frappe/workflow/doctype/workflow/workflow.py
frappe/workflow/doctype/workflow/workflow.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document from frappe.model import no_value_fields class Workflow(Document): def validate(self): self.set_...
Python
0
@@ -453,32 +453,59 @@ n_update(self):%0A +%09%09self.update_doc_status()%0A %09%09frappe.clear_c @@ -1785,16 +1785,427 @@ .state%0A%0A +%09def update_doc_status(self):%0A%09%09doc_before_save = self.get_doc_before_save()%0A%09%09for current_doc_state, doc_before_save_state in zip(self.states, doc_before_save.states)...
ccbae90caafe39a174729bf9b95581c7a05a5554
Fix wrong logic in data insertion to Neo4j
src/app.py
src/app.py
from src.common.yaml import Yaml from src.common.postgres import Postgres from src.common.path import Path from src.association_rules.transaction import Transaction from src.association_rules.fpgrowth import FPGrowth from src.common.neo4j_driver import Neo4jDriver if __name__ == "__main__": path = Path(__file__) ...
Python
0.001203
@@ -2286,16 +2286,30 @@ rint()%0A%0A + i = 0%0A @@ -2798,28 +2798,8 @@ ame%7D -, support: %7Bsupport%7D %7D)%22, @@ -2862,33 +2862,8 @@ _str -, %22support%22: rule.support %7D)%0A @@ -3847,33 +3847,32 @@ s.name = %7Bsname%7D - %22%0A @@ -3908,68 +3908,201 @@ i)%3C- -%5Br:OCCURS_...
2cb9496168766b3985826312298732944df4f018
fix similarity_query_interface documentation
lexos/interfaces/similarity_query_interface.py
lexos/interfaces/similarity_query_interface.py
from flask import request, session, render_template, send_file, Blueprint from lexos.helpers import constants as constants from lexos.managers import utility, session_manager as session_manager from lexos.interfaces.base_interface import detect_active_docs # this is a flask blue print # it helps us to manage groups o...
Python
0.000001
@@ -691,16 +691,21 @@ onality. +%0A%0A Returns @@ -719,20 +719,16 @@ list of -%0A files a @@ -771,16 +771,20 @@ mparison +%0A documen @@ -786,17 +786,16 @@ cument.%0A -%0A :ret
1d7f51cd3366598d238c4c545233d74e7e2fb4d9
Remove forgotten debug print
atomicapp_builder/cli.py
atomicapp_builder/cli.py
import argparse import logging import tempfile import shutil import sys import atomicapp_builder from atomicapp_builder.builder import Builder from atomicapp_builder import constants from atomicapp_builder import exceptions from atomicapp_builder import resolver logger = logging.getLogger(__name__) def create_parse...
Python
0.000001
@@ -3147,30 +3147,8 @@ ir:%0A - print(tmpdir)%0A
b149d3e2be52a9876815b4599164210f086cf0c0
update TODO objectives
testCaesar.py
testCaesar.py
import unittest import Caesar class TestCryptMethods(unittest.TestCase): """Tests for Caesar.py""" cryptInput = ['encrypt', 'Encrypt', 'decrypt', 'Decrypt', 'blah', 'WHOCARES'] encryptInput = ['foo', 'bar', 'Hello World', '342', '101010111'] decryptInput = ['ktt', 'gfw', 'Mjqqt%\twqi', '897', '65656566...
Python
0
@@ -233,11 +233,11 @@ ', ' -342 +xyz ', ' @@ -292,18 +292,18 @@ jqqt -%25%5C + B twqi', ' 897' @@ -302,24 +302,24 @@ ', ' -897 +cde ', ' -656565666 +101010111 '%5D%0A @@ -818,27 +818,39 @@ sult -%5Bi%5D = +.append( Caesar. +en crypt -( +ion(self. encr @@ -861,16 +861,68 @@ nput%5Bi%5D) +)%0A %0A #T...
cf4debe97d48d42ac28fb8e2d328a8583e81a007
Fix version_info comparison
dev/ci.py
dev/ci.py
# coding: utf-8 from __future__ import unicode_literals, division, absolute_import, print_function import sys from .tests import run as run_tests if sys.version_info > (2, 6): from .lint import run as run_lint def run(): """ Runs the linter and tests :return: A bool - if the linter and test...
Python
0
@@ -158,30 +158,31 @@ rsion_info %3E += (2, -6 +7 ):%0A from @@ -424,14 +424,15 @@ fo %3E += (2, -6 +7 ):%0A
18dd46c5008c55f959d1cacbdebe83974c88672e
improve fetch_followed_users()
app/management/commands/collect_data.py
app/management/commands/collect_data.py
# coding: utf-8 from concurrent.futures import ThreadPoolExecutor import logging import re import time from django.contrib.auth.models import User from django.core.management.base import BaseCommand from django.db import IntegrityError from retrying import retry import requests from app.models import UserRelation f...
Python
0.000002
@@ -3023,32 +3023,33 @@ def fetch_follow +e d_users(self, us @@ -3046,32 +3046,44 @@ s(self, username +, fetch_more ):%0A from_ @@ -3593,24 +3593,128 @@ continue +%0A if fetch_more:%0A self.fetch_followed_users(to_user, fetch_more=False) %0A%0A @timin @@ -5476,16 +5...
22ae21ab43c1f94807e282b7d50987af13a6a9d6
Exclude ps1 modules from the TestModules unittest
test/units/TestModules.py
test/units/TestModules.py
# -*- coding: utf-8 -*- import os import ast import unittest from ansible import utils class TestModules(unittest.TestCase): def list_all_modules(self): paths = utils.plugins.module_finder._get_paths() paths = [x for x in paths if os.path.isdir(x)] module_list = [] for path in pa...
Python
0
@@ -426,16 +426,119 @@ enames:%0A + (path, ext) = os.path.splitext(filename)%0A if ext != %22.ps1%22:%0A
b9a318b06ec1c863d599a97dd5bb56ea571f30d5
Revise choice of CSS compressor
parliament/default_settings.py
parliament/default_settings.py
import os DEBUG = True ADMINS = [ ('Michael Mulley', 'michael@michaelmulley.com'), ] MANAGERS = ADMINS PROJ_ROOT = os.path.dirname(os.path.realpath(__file__)) CACHE_MIDDLEWARE_KEY_PREFIX = 'parl' CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True # Set to True to disable functionality where user-provided data is saved PA...
Python
0.000003
@@ -1757,21 +1757,15 @@ min. +r CSS -Compressor +Min Filt
a63746951ee802c5082c34c5c16afe3cbcd8ede4
fix last flake8 error
doc/source/conf.py
doc/source/conf.py
# -*- coding: utf-8 -*- # # SimPhoNy-Mayavi documentation build configuration file # import sys def mock_modules(): MOCK_MODULES = [] MOCK_TYPES = [] try: import paraview # noqa except ImportError: MOCK_MODULES.extend(( 'paraview', 'paraview.simple', ...
Python
0.000001
@@ -1329,16 +1329,19 @@ d_name, +Doc Mock(moc
7f00ff930b70b9c0ca00874d00704cdf540e3939
correct errors
serial_test.py
serial_test.py
import datetime import sys import pigpio import time import math time_record = int(time.time() * 1000) time_limit = 50 pi = pigpio.pi() sensor_message_size = 7 sensor_signal_pin = 4 dead_pin = 17 pi.set_mode(sensor_signal_pin, pigpio.OUTPUT) h1 = pi.serial_open("/dev/ttyAMA0", 9600) pi.serial_write_byte(h1, 10 * 2) pi...
Python
0.999897
@@ -1088,12 +1088,8 @@ if -not (abs @@ -1112,16 +1112,34 @@ 1%5D) -%3E +%3C 7 and +sets%5B2%5D %3C 40) or ( abs( @@ -1161,11 +1161,27 @@ 5%5D) -%3E +%3C 7 + and set%5B4%5D %3C 40 ):%0A @@ -1202,46 +1202,15 @@ nt(%22 -SMALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLER +%E4%BF%AE%E6%AD%A3FIXED %22)%0A
de039312bc8b356eb1a75f797c2be4d02643f3f2
Append "/" to get_step_path_prefix
simpleflow/step/workflow.py
simpleflow/step/workflow.py
import os import copy from collections import defaultdict from .constants import STEP_ACTIVITY_PARAMS_DEFAULT from .submittable import Step from .tasks import GetStepsDoneTask from simpleflow import activity, settings, task class WorkflowStepMixin(object): def get_step_bucket(self): """ Return t...
Python
0.000001
@@ -675,16 +675,17 @@ , 'steps +/ ')%0A%0A
86188c5415e82e9a31bae20e672fe3eebbde8767
Update print message in gen_jv_xml.py
gen_jv_xml.py
gen_jv_xml.py
#!/usr/bin/python from sys import argv import codecs print "Start." if len(argv) < 5: print "Usage : " + argv[0] + " CoordinatesFilename LocationNamePrefix countryName CityName" print "Example : ./gen_jv_xml.py raw.txt FakePrefix Taiwan Taipei" exit(0) currentScript, inputFilename, inputLocationNamePrefix, in...
Python
0.000001
@@ -1172,35 +1172,27 @@ nt %22 -!!! Ignore - this +d line -!!! %5B%25d%5D -: + : %25s%22
4de07bc77efd617acd7629d8c636bb6515d2527e
Allow skipping in retrieval
mangaki/mangaki/management/commands/retrieve.py
mangaki/mangaki/management/commands/retrieve.py
from django.core.management.base import BaseCommand, CommandError from mangaki.utils.anidb import AniDB from mangaki.models import Anime, Artist def get_or_create_artist(name): last, first = name.split() try: if Artist.objects.filter(first_name=first, last_name=last).count(): contestants = ...
Python
0.000002
@@ -133,24 +133,35 @@ nime, Artist +%0Aimport sys %0A%0Adef get_or @@ -178,24 +178,48 @@ tist(name):%0A + if ' ' in name:%0A last, fi @@ -237,16 +237,57 @@ split()%0A + else:%0A last, first = name, ''%0A try: @@ -2195,16 +2195,103 @@ tp', 1)%0A + start = int(sys.argv%5B2%5D) if le...
8c1a5a04056fe5333f01c0208e1ba98e298838ef
Add check option and Fix pattern
update-high-use/edit.py
update-high-use/edit.py
# -*- coding: utf-8 -*- import argparse import json import os import re import pymysql os.environ['PYWIKIBOT_DIR'] = os.path.dirname(os.path.realpath(__file__)) import pywikibot from config import config_page_name, database # pylint: disable=E0611,W0614 os.environ['TZ'] = 'UTC' site = pywikibot.Site() site.login()...
Python
0
@@ -1163,16 +1163,22 @@ dry_run +=False , add_te @@ -1189,16 +1189,29 @@ te=False +, check=False ):%0A t @@ -2658,32 +2658,136 @@ if not dry_run:%0A + if check and input('Save?').lower() not in %5B'', 'y', 'yes'%5D:%0A return%0A @@ -3071,24 +3071,36 @@ %7C%7...
5b53a149c2c41448b8a06fed994223d43c87180c
Fix breaking script.
lenrmc/terminal.py
lenrmc/terminal.py
import re import math from collections import defaultdict from .studies import Studies _studies = Studies.db() class TerminalView(object): def __init__(self, system): self._system = system _desirable = { 'n-transfer': 2, 'stable': 3, '4He': 1, 'ɣ': ...
Python
0
@@ -4165,14 +4165,13 @@ , g. -factor +value ())%0A
6b5971f1d2d73dc2273a0fc7e167613417156547
Allow for highlighting account id's when responding to messages.
src/bot.py
src/bot.py
"""bot.py - implements the FlowBot class, a boilerplate for other bots.""" from .channel_db import ChannelDb from .server import Server from .config import Config import logging from datetime import datetime LOG = logging.getLogger(__name__) class FlowBot(object): """A boilerplate for bot development.""" de...
Python
0
@@ -1156,16 +1156,32 @@ onse_msg +, highlight=None ):%0A @@ -1356,16 +1356,49 @@ onse_msg +,%0A highlight=highlight %0A @@ -1442,24 +1442,40 @@ nnel_id, msg +, highlight=None ):%0A %22 @@ -1497,32 +1497,66 @@ e to the channel +, optionally highlight account ids .%22%22%22%0A ...
b42b25ccceeb22ada21ed4be59ee1e7c7d535027
Add cmd func for RunnerClient
salt/runner.py
salt/runner.py
# -*- coding: utf-8 -*- ''' Execute salt convenience routines ''' # Import python libs from __future__ import absolute_import, print_function import logging # Import salt libs import salt.exceptions import salt.loader import salt.minion import salt.utils.args import salt.utils.event from salt.client import mixins fro...
Python
0.000003
@@ -4061,16 +4061,412 @@ meout)%0A%0A + def cmd(self, fun, arg=None, pub_data=None, kwarg=None, print_event=True):%0A '''%0A Execute a function%0A '''%0A return super(RunnerClient, self).cmd(fun,%0A arg,%0A ...
dba06078985716bda0a0d3a6ab26d0fad73b4c73
add a flags parameter to test() to allow passing in during interactive sessions
lib/neuroimaging/algorithms/statistics/__init__.py
lib/neuroimaging/algorithms/statistics/__init__.py
""" TODO """ __docformat__ = 'restructuredtext' def test(level=1, verbosity=1): from numpy.testing import NumpyTest return NumpyTest().test(level, verbosity)
Python
0
@@ -42,16 +42,17 @@ dtext'%0A%0A +%0A def test @@ -76,10 +76,102 @@ ty=1 +, flags=%5B%5D):%0A from neuroimaging.utils.test_decorators import set_flags%0A set_flags(flags ) -: %0A
2eb72d3b83268f31d0165d8f763c190e007a405f
edit submit.py to support testsuite_v1
examples/test/submit.py
examples/test/submit.py
# # Copyright 2019 The FATE 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 appli...
Python
0
@@ -3366,18 +3366,19 @@ me, %22../ -.. +bin /init_en
1c9f12f808ffa0f1d4f16ea9f35021a83126243f
Update test Solr download script to work with default Python 3
get-solr-download-url.py
get-solr-download-url.py
#!/usr/bin/env python # encoding: utf-8 from __future__ import absolute_import, print_function, unicode_literals import sys import requests # Try to import urljoin from the Python 3 reorganized stdlib first: try: from urlparse.parse import urljoin except ImportError: from urlparse import urljoin if len(sy...
Python
0
@@ -222,21 +222,19 @@ from url -parse +lib .parse i
f9b7fa7fd7a75c5fb85fae545ed05080a162e967
Add sphinx markup to test_input.py
test_input.py
test_input.py
import pandas as pd import numpy as np from read_file import input_dataframe # requires test .csv file containing 2 columns w/ 1 row string header and all below rows float/int def test_ecg_dataframe_size(): ecg_dataframe = input_dataframe("testfile1.csv") assert ecg_dataframe.shape[1] == 2 def test_ecg_dat...
Python
0.000004
@@ -199,24 +199,109 @@ ame_size():%0A + %22%22%22.. function:: test_ecg_dataframe_size()%0A%0A Test size of dataframe.%0A%0A %22%22%22%0A ecg_data @@ -409,24 +409,109 @@ ame_type():%0A + %22%22%22.. function:: test_ecg_dataframe_type()%0A%0A Test type of dataframe.%0A%0A %22%22%22%0A ecg_d...
39c86c69e55b89f2e4023c1fe9566f2efb8d33b0
Tidy up flag in ISS commit routine
hw/ip/otbn/dv/otbnsim/sim/loop.py
hw/ip/otbn/dv/otbnsim/sim/loop.py
# Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 from typing import Dict, List, Optional from .constants import ErrBits from .trace import Trace class TraceLoopStart(Trace): def __init__(self, depth: int, iteration...
Python
0
@@ -4868,16 +4868,62 @@ ck.pop() +%0A self._pop_stack_on_commit = False %0A%0A
0d2a8123b064204a5316ec1797faca3a5c30d454
use ip address for less characters
provisioner/models/machine.py
provisioner/models/machine.py
import os import base64 import boto.ec2 # EU-WEST-1: RHEL7 HVM AMI_ID = 'ami-25158352' region = 'eu-west-1' def generate_userdata(): '''Read environment vars and various other things to get SSH keys, usernames and deploy scripts and inject them into an instance as a userdata script ''' ssh_key = os.environ["...
Python
0.000001
@@ -2748,23 +2748,18 @@ nce. -public_dns_name +ip_address ,%0A#
7de37e0ea41054ac86dd6fd5226ff0dd846a5eb1
fix inputs
detect_tokens.py
detect_tokens.py
#!/usr/bin/env python """ Authentication tokens detection script. """ # -*- coding: utf-8 -*- import signal import argparse import sqlite3 import os import logging from argparse import RawTextHelpFormatter from termcolor import colored from selenium.common.exceptions import TimeoutException from httplib import BadSta...
Python
0.000124
@@ -2618,32 +2618,71 @@ your nickname',%0A + required=True,%0A @@ -2809,32 +2809,71 @@ your password',%0A + required=True,%0A
f0acf7fe8255e376ec602117709789cba4df5ea9
add sample data to pconf
examples/simple_test.py
examples/simple_test.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # pylint: disable=line-too-long # # Georges Toth (c) 2013-2014 <georges@trypill.org> # GOVCERT.LU (c) 2013-2017 <info@govcert.etat.lu> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as...
Python
0
@@ -2568,16 +2568,141 @@ f = %7B%7D%0A%0A + pconf%5B'whiteip'%5D = %5B'192.168.1.1'%5D%0A pconf%5B'whitefor'%5D = %5B'a@example.com'%5D%0A pconf%5B'byhostentry'%5D = %5B'example.com'%5D%0A%0A if o
0be94fb1491179cbb8f9e1bf6682ff6c2db4ea0e
Update add method of the visualization modules
geomdl/vis.py
geomdl/vis.py
""" .. module:: vis :platform: Unix, Windows :synopsis: Provides abstract base classes for visualization modules .. moduleauthor:: Onur Rauf Bingol <orbingol@gmail.com> """ import abc import six class VisConfigAbstract(six.with_metaclass(abc.ABCMeta, object)): """ Abstract base class for storing config...
Python
0
@@ -1121,16 +1121,17 @@ , 'other +s ': None%7D @@ -1269,11 +1269,19 @@ sarr -=() +, plot_type , na @@ -1303,21 +1303,8 @@ None -, plot_type=0 ):%0A @@ -1410,26 +1410,21 @@ trol -, curve or surface + or evaluated poi @@ -1480,45 +1480,70 @@ ram -name: name of the point on the legend +plot_type: type of the p...
5b626f65e3926ac34b579978303eb061fa33a09c
Change features widget to be a multiple checkbox.
us_ignite/apps/forms.py
us_ignite/apps/forms.py
from django import forms from django.contrib.auth.models import User from django.core.validators import validate_email from django.forms.models import inlineformset_factory from us_ignite.apps.models import (Application, ApplicationURL, ApplicationImage) def _get_status_choices(): ...
Python
0
@@ -1266,16 +1266,102 @@ atus',)%0A + widgets = %7B%0A 'features': forms.CheckboxSelectMultiple(),%0A %7D%0A %0A%0AApplic
6143888a2fa396b868ed44c3ceab765a95abea45
Check function must always use all parameters.
tests/constraint_tests.py
tests/constraint_tests.py
from unittest import TestCase from skypyblue.core import ConstraintSystem from skypyblue.models import Method, Constraint, Strength try: from unittest.mock import MagicMock as Mock except ImportError as e: from mock import Mock class ConstraintTests(TestCase): def setUp(self): self.cs = ConstraintSystem() ...
Python
0
@@ -380,10 +380,12 @@ %5B4, + 5, + 3%5D)%0A @@ -566,16 +566,27 @@ t(lambda + v1, v2, v3 : True,
d3c10b103bd6c13fe27e999ae6145bce76e63ff4
add etree convenience function
server/util.py
server/util.py
# -*- coding: ISO-8859-15 -*- # ================================================================= # # $Id$ # # Authors: Tom Kralidis <tomkralidis@hotmail.com> # # Copyright (c) 2010 Tom Kralidis # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentat...
Python
0
@@ -1966,16 +1966,318 @@ urn -1%0A%0A +def find_exml(val, attrib=False):%0A ''' Test that the XML value exists, return value, else return None '''%0A if val is not None:%0A if attrib == True: # it's an XML attribute%0A return val%0A else: # it's an XML value%0A return val.te...
f52a19fe28fa84b3d83ab20998fd678c795490dc
Remove generated code
lexgen/__init__.py
lexgen/__init__.py
__author__ = 'David'
Python
0.000001
@@ -1,21 +1 @@ -__author__ = 'David' %0A
1aec0b6e6e8ada20d49e09b679406c9ad4e0f8c0
Fix /users/me API test (no redirect)
users/tests/test_api.py
users/tests/test_api.py
from django.core.urlresolvers import reverse from rest_framework import status from rest_framework.test import APITestCase from ..models import User class UserTest(APITestCase): """Tests for /users/ API endpoints.""" def test_view_user_logged_out(self): user = User.objects.create(name="Trey", email...
Python
0
@@ -2000,114 +2000,8 @@ '%5D)%0A - full_user_url = %22http://testserver%7B%7D%22.format(%0A reverse('user-detail', args=%5Buser.pk%5D))%0A @@ -2164,17 +2164,14 @@ TTP_ -302_FOUND +200_OK )%0A @@ -2205,33 +2205,115 @@ onse -%5B'location'%5D, full_user_url +.data, %7B%0A 'id': use...
5ffebc701faa0230b3bda31ad356f2261e711c21
correct shipping address
lfs/order/utils.py
lfs/order/utils.py
# lfs imports import lfs.voucher.utils from lfs.cart import utils as cart_utils from lfs.core.signals import order_submitted from lfs.customer import utils as customer_utils from lfs.order.models import Order from lfs.order.models import OrderItem from lfs.payment import utils as payment_utils from lfs.shipping import ...
Python
0.000002
@@ -4473,34 +4473,16 @@ phone = -customer.selected_ shipping
57dee4545b3c34d1e66943def8d5e45ee95d66bd
Make sure cmd is UTF8 encoded before splitting. Fixes regression introduced by 80df2135e903bc167b70cd1a45e8d4eb803e87ed.
lib/ansible/runner/shell_plugins/powershell.py
lib/ansible/runner/shell_plugins/powershell.py
# (c) 2014, Chris Church <chris@ninemoreminutes.com> # # 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) any lat...
Python
0
@@ -3974,32 +3974,66 @@ , rm_tmp=None):%0A + cmd = cmd.encode('utf-8')%0A cmd_part
6ff357974998810a7701c42471fc8806b0de66fc
fix tap() which need to delete old code
src/AppiumLibrary/keywords/_touch.py
src/AppiumLibrary/keywords/_touch.py
# -*- coding: utf-8 -*- from appium.webdriver.common.touch_action import TouchAction from AppiumLibrary.locators import ElementFinder from .keywordgroup import KeywordGroup class _TouchKeywords(KeywordGroup): def __init__(self): self._element_finder = ElementFinder() # Public, element l...
Python
0.000005
@@ -3699,182 +3699,8 @@ %0D%0A%0D%0A - driver = self._current_application()%0D%0A el = self._element_find(locator, True, True)%0D%0A action = TouchAction(driver)%0D%0A action.tap(el).perform()%0D%0A%0D%0A
e21056572381b92926b4fa8c7d347a0e129a6471
Fix OSError in functional test due to incomplete teardown condition
tests/functional_tests.py
tests/functional_tests.py
#!/usr/bin/env python from __future__ import absolute_import, print_function import os import subprocess from os.path import dirname, abspath from time import time, sleep from re import match from unittest import TestCase, main, skip try: from StringIO import StringIO except ImportError: from io import String...
Python
0
@@ -2258,32 +2258,110 @@ tearDown(self):%0A + self.app_proc.poll()%0A if self.app_proc.returncode is None:%0A self.app @@ -2388,17 +2388,17 @@ kip( -%22 +' test is inco @@ -2397,18 +2397,20 @@ is -i n +ot complete %22)%0A @@ -2405,17 +2405,17 @@ complete -%22 +' )%0A de @@ -...
c39be26dbcafe411741d7098974162280377b61c
Fix Python 2.x bytes/str bug
test_walls.py
test_walls.py
# -*- coding: utf-8 -*- """Test walls.""" from walls import Walls, load_config, stderr_and_exit, main import py import pytest @pytest.fixture def config(tmpdir): f = tmpdir.join('config.ini') f.write(''' [walls] api_key = myapikey api_secret = myapisecret tags = sanfrancisco image_dir = {0} width = 1920 heig...
Python
0.000813
@@ -5735,14 +5735,13 @@ for -b +c in -b 'thi @@ -5782,17 +5782,17 @@ eld -bytes(%5Bb%5D +c.encode( )%0A%0A
aff805625f465421277447e5bd2a53a552dd175f
Fix assertion and error
exp/util/MCEvaluator.py
exp/util/MCEvaluator.py
import numpy import numpy.testing as nptst class MCEvaluator(object): """ A class to evaluate machine learning performance for the matrix completion problem. """ def __init__(self): pass @staticmethod def meanSqError(testX, predX): """ Find the mean squared ...
Python
0.000012
@@ -468,46 +468,81 @@ -%0A nptst.assert_array_equal(test +#Note that some predictions might be zero %0A assert numpy.in1d(pred X.no @@ -553,20 +553,20 @@ o()%5B0%5D, -pred +test X.nonzer @@ -572,16 +572,23 @@ ro()%5B0%5D) +.all() %0A @@ -592,37 +592,30 @@ -nptst.assert_array_equa...
b7256a0696331b5b0889708449ebb93ef90fab4a
add language and save function.
git-ignore.py
git-ignore.py
#! /usr/bin/env python2 # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2014 Ciel <imwithye@gmail.com> # # Distributed under terms of the MIT license. import sys # print version def version(): print "git ignore, version 0.1." print print "http://github.com/imwithye/git-ignore" print "git ignore, copyrigh...
Python
0
@@ -170,183 +170,86 @@ ys%0A%0A -# print version%0Adef version():%0A%09print %22git ignore, version 0.1.%22%0A%09print%0A%09print %22http://github.com/imwithye/git-ignore%22%0A%09print %22git ignore, copyright Ciel %3Cimwithye@gmail.com%3E%22 +def language(languages):%0A%09print languages%0A%0Adef save(filename):%0A%0...
9ac48a3eb3c39d0cad0f6a095a53abde6f88c388
Fix socket timeout parameter
experiments/counters.py
experiments/counters.py
from django.conf import settings from django.utils.functional import cached_property import redis from redis.sentinel import Sentinel from redis.exceptions import ConnectionError, ResponseError COUNTER_CACHE_KEY = 'experiments:participants:%s' COUNTER_FREQ_CACHE_KEY = 'experiments:freq:%s' class Counters(object): ...
Python
0.000001
@@ -492,16 +492,77 @@ ENTINELS +, socket_timeout=settings.EXPERIMENTS_REDIS_SENTINELS_TIMEOUT )%0A @@ -647,69 +647,8 @@ NAME -, socket_timeout=settings.EXPERIMENTS_REDIS_SENTINELS_TIMEOUT )%0A
b6ab29eed44fa0b63043d1481d835a1b25418a22
Remove unused code
tests/http/test_router.py
tests/http/test_router.py
from __future__ import unicode_literals import os import unittest import mock from mopidy import http class TestRouter(http.Router): name = 'test' static_file_path = os.path.join(os.path.dirname(__file__), 'static') class TestRouterMissingName(http.Router): pass class HttpRouterTest(unittest.TestCa...
Python
0
@@ -38,18 +38,8 @@ ls%0A%0A -import os%0A impo @@ -143,81 +143,8 @@ st'%0A - static_file_path = os.path.join(os.path.dirname(__file__), 'static')%0A %0A%0Acl
29b8b8b7415431547e85564aa7b426e244542b85
Insert comment about rigs for future reference
ext/killmails/poster.py
ext/killmails/poster.py
import typing import tinydb from discord.ext import commands from utils.esicog import EsiCog from utils.log import get_logger ESI_SWAGGER_JSON = 'https://esi.evetech.net/latest/swagger.json' def setup(bot: commands.Bot): bot.add_cog(KillmailPoster(bot)) class KillmailPoster(EsiCog): def __init__(self, bo...
Python
0
@@ -762,16 +762,66 @@ return%0A + # Rig group_ids are 781-786 inclusive%0A
094ff00f180926d44e2102f119beb33354fc7122
Remove unused import
tests/base.py
tests/base.py
import logging import os import shutil from tvrenamr.config import Config from tvrenamr.main import File, TvRenamr from . import mock_requests # noqa logging.disable(logging.CRITICAL) class BaseTest(object): def setup(self): # absolute path to the file is pretty useful self.path = os.path.abs...
Python
0.000001
@@ -114,45 +114,8 @@ mr%0A%0A -from . import mock_requests # noqa%0A%0A %0Alog
1638c588ee2fe3aa27e82691fbd600345dd659d2
Fix date widget error in Django 1.3
ain7/widgets.py
ain7/widgets.py
# -*- coding: utf-8 -*- # # widgets.py # # Copyright © 2007-2011 AIn7 Devel Team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at yo...
Python
0.000064
@@ -1664,16 +1664,50 @@ ttings%0D%0A +from django.utils import formats%0D%0A %0D%0A%0D%0A# DA @@ -3164,25 +3164,24 @@ form -s.fields.DEFAULT_ +ats.get_format(' DATE @@ -3198,16 +3198,18 @@ _FORMATS +') %0D%0A
0c0a1d0ec480c7df9dd8821d40af7791e46db453
Fix for wrong test: create_semester_accounts
tests/lib/test_finance.py
tests/lib/test_finance.py
# Copyright (c) 2013 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. from tests import OldPythonTestCase __author__ = 'felix_kluge' from pycroft.lib.finance import create_semester...
Python
0.000161
@@ -313,16 +313,28 @@ semester +, import_csv %0Afrom py @@ -361,16 +361,17 @@ ort get, + config%0Af @@ -417,16 +417,39 @@ eAccount +, Journal, JournalEntry %0Afrom sq @@ -547,16 +547,26 @@ ort date +, datetime %0A%0A%0Aclass @@ -842,38 +842,155 @@ me%22, - 2500, 1500, date(2013, 9, 1), +%0A ...
38de328a3899b96542f702a51eb180efb47a5556
Fix town regroup bugs
geodjangofla/management/commands/fixtowns.py
geodjangofla/management/commands/fixtowns.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # This code is free software; you can redistribute it and/or modify it # under the terms of the BSD License (see the file COPYING included with # the distribution). import os from optparse import make_option from django.contrib.gis.geos import GEOSGeometry from django.co...
Python
0.000003
@@ -647,16 +647,36 @@ tions):%0A + limits = %7B%7D%0A @@ -954,16 +954,355 @@ ems%5B-2%5D%0A + nom_comm = %22-%22.join(items%5B0:-2%5D)%0A if nom_comm.endswith('-'):%0A nom_comm = nom_comm%5B:-1%5D%0A key = (nom_comm, commune.insee_com%5B0:2%5D)%0A ...
9a6ceeecd91b783b95783a07952e5f2f6328b1fd
Fix G1 bug
news.py
news.py
import feedparser import nltk import requests from bs4 import BeautifulSoup as bs from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.decomposition import TruncatedSVD import networkx as nx import numpy as np from nltk.corpus import stopwords from nltk.stem.snowball import SnowballStemmer from nltk...
Python
0.000001
@@ -399,24 +399,54 @@ ect_language +%0Afrom newspaper import Article %0A%0Adef rss_to @@ -1981,24 +1981,186 @@ join(news)%0A%0A + if not plain_text or not title:%0A g1 = Article(url=url)%0A g1.download()%0A g1.parse()%0A title = g1.title%0A plain_text = g1.text%0A%0A return...
76ebb0c53db5a466e7d8d0ae5a5039b854dededb
Add crunchbang.
dev/tabumemex.py
dev/tabumemex.py
# Data: # DataStructure = {'size', 'pos'} # MemoryBank = {'capacity', 'pos'} # Conflict = {'cost', 'state', 'a', 'b'} # X = [[]] import random import sys import memproblem from greedyMemex import greedymemex from randommemex import randommemex def initialmemex(p ,A ): """Decides on an initial solution for the ta...
Python
0.000002
@@ -1,8 +1,31 @@ +#!/usr/bin/env python2%0A # Data:%0A
bd8de499bbc8ec4b987c241f6b0fbd12ebf16818
Adapt the import
app/tests/euid/test_kvm_player.py
app/tests/euid/test_kvm_player.py
import unittest import os import kvm_player @unittest.skipIf(os.geteuid() != 0 or kvm_player.virt_install != 0, "TestKVMDiscovery need privilege and virt-install") class TestKernelVirtualMachinePlayer(kvm_player.KernelVirtualMachinePlayer): @classmethod def setUpClass(cls): cls.check...
Python
0.998929
@@ -19,17 +19,143 @@ port os%0A -%0A +import sys%0A%0Atry:%0A import kvm_player%0Aexcept ImportError:%0A sys.path.append(os.path.dirname(os.path.abspath(__file__)))%0A import k
5f1a708b04e67aec5f943530a702a20fe6529a6c
Implement filtering by query arguments
s3pac/wsgi.py
s3pac/wsgi.py
import os, io, json from datetime import datetime from dateutil import parser as dateparser from flask import Flask, Response, request, redirect, url_for, abort, send_file from werkzeug import secure_filename from s3pac.model import DateTimeProperty from s3pac.package import Package, write_database_file, write_signatu...
Python
0.000019
@@ -226,16 +226,30 @@ l import + LongProperty, DateTim @@ -526,71 +526,305 @@ %7D%0A%0A -def _json_from_pkg(pkg):%0A return Package.store(_TO_JSON, pkg +_FROM_QUERY = %7B%0A LongProperty: int,%0A DateTimeProperty: dateparser.parse,%0A %7D%0A%0Adef _json_from_pkg(pkg):%0A return Package.store(_TO_JSO...
b09f37d603da598d553d6b18ff231b25cde19d34
Create perms_required decorator, add some permissions stuff
iatidataquality/usermanagement.py
iatidataquality/usermanagement.py
# IATI Data Quality, tools for Data QA on IATI-formatted publications # by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith # # Copyright (C) 2013 Publish What You Fund # # This programme is free software; you may redistribute and/or modify # it under the terms of the GNU Affero General Public License v3...
Python
0
@@ -2190,16 +2190,90 @@ er(id)%0A%0A +def role_permission(rolename):%0A return Permission(RoleNeed(rolename))%0A%0A TestNeed @@ -2356,23 +2356,32 @@ 'edit')%0A -admin_p +%0Aclass EditTestP ermissio @@ -2381,19 +2381,17 @@ rmission - = +( Permissi @@ -2396,26 +2396,143 @@ sion -(RoleNeed('admin') +):%0A de...
211aff9fd57775a87409e1eab50f8803a9efe9f7
add imports for chart and effects
gimp_be/draw/__init__.py
gimp_be/draw/__init__.py
from gimp_be.draw.draw import * from gimp_be.draw.tree import * from gimp_be.draw.polygon import *
Python
0
@@ -84,16 +84,83 @@ olygon import *%0A +from gimp_be.draw.effects import *%0Afrom gimp_be.draw.chart import *
d362d3770b999293db854a08e9627cfb96557544
disable pagination
api/__init__.py
api/__init__.py
import os, bcrypt from eve import Eve from flask.ext.bootstrap import Bootstrap from eve_docs import eve_docs from eve.auth import BasicAuth class BCryptAuth(BasicAuth): def check_auth(self, username, password, allowed_roles, resource, method): accounts = app.data.driver.db['accounts'] account = accounts.fin...
Python
0.000002
@@ -1932,16 +1932,39 @@ ES': 0,%0A + 'PAGINATION': False,%0A 'DOMAI
248ad807e98aa379f24cb41b6fcf0af753c4f169
Test _assert_eq_nan with scalars and 0-D arrays
tests/test__test_utils.py
tests/test__test_utils.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import pytest import numpy as np import dask.array as da import dask_ndmeasure._test_utils nan = np.nan @pytest.mark.parametrize("match, a, b", [ [True] + 2 * [np.random.randint(10, size=(15, 16))], [True] + 2 * [da.random.randint(10, size=(15, 16), chunks=...
Python
0
@@ -194,16 +194,220 @@ , b%22, %5B%0A + %5BTrue%5D + 2 * %5Bnp.array(2)%5B()%5D%5D,%0A %5BTrue%5D + 2 * %5Bnp.array(nan)%5B()%5D%5D,%0A %5BTrue%5D + 2 * %5Bnp.array(2)%5D,%0A %5BTrue%5D + 2 * %5Bnp.array(nan)%5D,%0A %5BTrue%5D + %5Bnp.array(1.0), da.ones(tuple(), chunks=tuple())%5D,%0A %5BTru
6b481426ac7c33a755fa5de2f0dddc3f45210e60
use FixedEnergyRangeBuilder in test
tests/test_arsenic_fit.py
tests/test_arsenic_fit.py
""" pytest-catchlog is required by this test """ from glob import glob import logging import os import sys import tempfile from sklearn.linear_model import LinearRegression from mrfitty.base import AdaptiveEnergyRangeBuilder, ReferenceSpectrum, Spectrum from mrfitty.combination_fit import AllCombinationFitTask loggi...
Python
0
@@ -93,19 +93,8 @@ os%0A -import sys%0A impo @@ -209,16 +209,41 @@ Builder, + FixedEnergyRangeBuilder, Referen @@ -3941,32 +3941,29 @@ nge_builder= -Adaptive +Fixed EnergyRangeB @@ -3961,32 +3961,73 @@ rgyRangeBuilder( +energy_start=11834.5, energy_stop=12096.0 ),%0A refer
8533400ecf69aac64c6210cb9fca1dfe90d0e6b7
work around hanging issue on Windows (#27)
tests/test_code_format.py
tests/test_code_format.py
import os import sys import subprocess def test_flake8(): """Test source code for pyFlakes and PEP8 conformance""" this_dir = os.path.dirname(os.path.abspath(__file__)) source_dir = os.path.join(this_dir, '..', 'osrf_pycommon') cmd = ['flake8', source_dir, '--count'] if sys.version_info < (3,4): ...
Python
0
@@ -279,16 +279,113 @@ count'%5D%0A + # work around for https://gitlab.com/pycqa/flake8/issues/179%0A cmd.extend(%5B'--jobs', '1'%5D)%0A if s
63483418d2169cde88649a29754846d30c6cb5c4
Improve fuel.downloaders.basic unit tests
tests/test_downloaders.py
tests/test_downloaders.py
import os from fuel.downloaders.base import download, default_manager iris_url = ('https://archive.ics.uci.edu/ml/machine-learning-databases/' + 'iris/iris.data') iris_first_line = '5.1,3.5,1.4,0.2,Iris-setosa\n' def test_download_no_path(): download(iris_url) with open('iris.data') as f: ...
Python
0
@@ -1,12 +1,27 @@ +import hashlib%0A import os%0A%0Af @@ -194,52 +194,81 @@ ris_ -first_line = '5.1,3.5,1.4,0.2,Iris-setosa%5Cn' +hash = %226f608b71a7317216319b4d27b4d9bc84e6abd734eda7872b71a458569e2656c0%22 %0A%0A%0Ad @@ -335,32 +335,37 @@ open('iris.data' +, 'r' ) as f:%0A @@ -368,74 +368,64 @@ -fi...
169a8612eb06410a5ae7e110227f7bea010d2ba9
Make stdout and stderr into strings.
tests/test_ghostscript.py
tests/test_ghostscript.py
import subprocess import unittest class GhostscriptTest(unittest.TestCase): def test_installed(self): process = subprocess.Popen( ['gs', '--version'], stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) stdout, stderr = process.com...
Python
0.000493
@@ -398,22 +398,27 @@ rtEqual( +str( stderr +) , %22%22)%0A @@ -448,22 +448,27 @@ Matches( +str( stdout +) , r'9%5C.%5C
62f5019c7603212e138a8f14c4968673aedbf8b3
Move prometheus metrics to /management/metrics
alerta/app/management/views.py
alerta/app/management/views.py
import time import datetime import logging from flask import request, Response, url_for, jsonify, render_template from flask.ext.cors import cross_origin from alerta.app import app, db from alerta.app.auth import auth_required from alerta.app.switch import Switch, SwitchState from alerta.app.metrics import Gauge, Co...
Python
0.000001
@@ -888,16 +888,17 @@ * 1000%0A%0A +%0A @app.rou @@ -1142,24 +1142,63 @@ or('status') +,%0A url_for('prometheus_metrics') %0A %5D%0A r @@ -4303,16 +4303,27 @@ route('/ +management/ metrics' @@ -4364,24 +4364,118 @@ ss_origin()%0A +# @auth_required # FIXME - prometheus only supports Authorization he...
ba37080645153d66a8ae1c8df10312806999f8ec
Add use of fmisid to tests.
tests/test_observation.py
tests/test_observation.py
import unittest from datetime import datetime from dateutil.tz import tzutc from fmi import FMI class TestObservations(unittest.TestCase): def test_lappeenranta(self): now = datetime.now(tz=tzutc()) f = FMI(place='Lappeenranta') for point in f.observations(): assert point.time...
Python
0
@@ -376,8 +376,153 @@ float)%0A +%0A for point in f.observations(fmisid=101237):%0A assert point.time %3C now%0A assert isinstance(point.temperature, float)%0A
94f6fcc00ed8f6b1f920bfc8242b9efd34f42fa9
test get_regional_indicator_emoji on april fools
tests/test_reactor_bot.py
tests/test_reactor_bot.py
#!/usr/bin/env python3 import reactor_bot import datetime from freezegun import freeze_time class TestReactorBot: def test_extract_emoji(self): lines_and_emojis = { ' M)-ystery meat': 'M', '🐕 dog sandwiches': '🐕', '3 blind mice': '3', '🇺🇸 flags': '🇺🇸', '<:python3:232720527448342530> python3!...
Python
0.000002
@@ -1162,24 +1162,179 @@ ': '%F0%9F%87%BF'%0A%09%09%7D%0A%0A +%09%09# one of these tests will fail on april fools%0A%09%09# (hint: it's %22B%22)%0A%09%09# unless we force the date to not be april fools%0A%09%09with freeze_time(%222018-01-01%22):%0A%09 %09%09for input, @@ -1352,32 +1352,33 @@ io_map.items():%0A +%09 ...
9369f72c4fe9a544e24f10a1db976589dc013424
Add dependency on apache module
plinth/modules/sso/__init__.py
plinth/modules/sso/__init__.py
# # This file is part of Plinth. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribute...
Python
0
@@ -885,16 +885,26 @@ ecurity' +, 'apache' %5D%0A%0Aname
3de616fa0bfc8e075e4c7aa4a5e8e9108e168f7c
fix bugs
plstackapi/planetstack/urls.py
plstackapi/planetstack/urls.py
from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: from django.contrib import admin from plstackapi.planetstack.views.roles import RoleListCreate, RoleRetrieveUpdateDestroy from plstackapi.planetstack.views.roles import SiteListCreate, SiteRetrieveUpdateDestroy from...
Python
0.000001
@@ -246,35 +246,35 @@ anetstack.views. -rol +sit es import SiteLi
99cbe9fc333525608842be098c87f842ac9e8906
Remove extra import
api/database.py
api/database.py
from pymongo import MongoClient from gridfs import GridFS from bson.objectid import ObjectId from datetime import datetime from os import environ from const import RequestType from flask import current_app class MongoConnection(object): def __init__(self, db=None): if db: self.db = db ...
Python
0.000001
@@ -173,39 +173,8 @@ ype%0A -from flask import current_app%0A%0A %0Acla