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
af410659c8c9664c6e2e86d0c88fe9f1cfd2cceb
Fix karmamod for mongodb
modules/karmamod.py
modules/karmamod.py
"""Keeps track of karma counts. @package ppbot @syntax .karma <item> """ import re from modules import * from models import Model class Karmamod(Module): def __init__(self, *args, **kwargs): """Constructor""" Module.__init__(self, kwargs=kwargs) def _register_events(self): self.add...
Python
0.000001
@@ -1206,32 +1206,20 @@ 'name': -event%5B'args'%5D%5B0%5D +name ,%0A @@ -1418,32 +1418,20 @@ 'name': -event%5B'args'%5D%5B0%5D +name ,%0A @@ -1508,32 +1508,43 @@ )%0A except + TypeError, KeyError:%0A @@ -1606,32 +1606,20 @@ 'name': -event%5B'args'%5D%5B0%5D +name ,%0A
bfb909281d567334e614452656bb4085f071262d
Use argument parser for hades-su
src/hades/bin/su.py
src/hades/bin/su.py
import grp import logging import os import pwd import sys logger = logging.getLogger(__name__) def drop_privileges(passwd, group): if os.geteuid() != 0: logger.error("Can't drop privileges (EUID != 0)") return os.setgid(group.gr_gid) os.initgroups(passwd.pw_name, group.gr_gid) os.setu...
Python
0.000003
@@ -52,16 +52,86 @@ rt sys%0A%0A +from hades.common.cli import ArgumentParser, parser as common_parser%0A%0A logger = @@ -423,139 +423,202 @@ +p ar -gs = sys.argv%0A if len(args) %3C 3:%0A print(%22Usage: %7B%7D USER COMMANDS %5BARGS...%5D%22.forma +ser = ArgumentParser(parents=%5Bcommon_parser%5D)%0...
8fe8717b4e2afe6329d2dd25210371df3eab2b4f
Test that we reject bad TLS versions
test/test_stdlib.py
test/test_stdlib.py
# -*- coding: utf-8 -*- """ Tests for the standard library PEP 543 shim. """ import pep543.stdlib from .backend_tests import SimpleNegotiation class TestSimpleNegotiationStdlib(SimpleNegotiation): BACKEND = pep543.stdlib.STDLIB_BACKEND
Python
0
@@ -83,23 +83,52 @@ t pep543 -.stdlib +%0Aimport pep543.stdlib%0A%0Aimport pytest %0A%0Afrom . @@ -172,101 +172,1532 @@ n%0A%0A%0A -class TestSimpleNegotiationStdlib(SimpleNegotiation):%0A BACKEND = pep543.stdlib.STDLIB_BACKEND +CONTEXTS = (%0A pep543.stdlib.STDLIB_BACKEND.client_context,%0A pep543.stdlib.S...
d415eb84b699a8f31451734599e14c44d97d0c74
fix for imgur album downloads
gallery_plugins/plugin_imgur_album.py
gallery_plugins/plugin_imgur_album.py
# Plugin for gallery_get. # Each definition can be one of the following: # - a string to match # - a regex string to match # - a function that takes source as a parameter and returns an array or a single match. (You may assume that re and urllib are already imported.) # If you comment out a parameter, it will use the...
Python
0
@@ -1306,16 +1306,72 @@ art:end%5D +.replace(%22:false,%22,%22:False,%22).replace(%22:true,%22,%22:True,%22) %0A if @@ -1722,8 +1722,9 @@ title). +%0A
c8d3515af5a603990b1a96d04dcaee8b2699e271
Refactor names w - angular_frequencies
wavelet_analyse/cuda_backend.py
wavelet_analyse/cuda_backend.py
# -*- coding: utf-8 -*- import numpy as np import pycuda.autoinit import pycuda.driver as cuda import pycuda.gpuarray as gpuarray from pycuda.elementwise import ElementwiseKernel from pyfft.cuda import Plan BACKEND = 'cuda' PI2 = 2 * np.pi gpu_morlet = ElementwiseKernel( 'pycuda::complex<float> *dest, ' 'f...
Python
0.000001
@@ -3477,17 +3477,35 @@ scales, -w +angular_frequencies , omega0 @@ -3610,17 +3610,35 @@ * * -w +angular_frequencies * - a @@ -3893,17 +3893,35 @@ ape%5B0%5D, -w +angular_frequencies .shape%5B0 @@ -3934,17 +3934,35 @@ pos = -w +angular_frequencies %3E 0%0A%0A @@ -4099,17 +4099,35 @@ es%5Bi%5D *...
b8cf132bc4cbf4b7c17812c3429cc96a0a07a18e
update accounts admin
apps/accounts/admin.py
apps/accounts/admin.py
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse_lazy as reverse from django import forms from django.forms.util import ErrorList from django.contrib.auth.admin import UserAdmin from django.contrib import admin from apps.accounts.models i...
Python
0.000001
@@ -2498,39 +2498,8 @@ il', - 'is_translator', 'is_manager', )%0Aa
bd7e498c36812a5c549f9f1ec9056672540558da
add new test, it demostrate bug 71
labmanager/tests/test_create_new_user.py
labmanager/tests/test_create_new_user.py
# -*-*- encoding: utf8 -*-*- from flask import session from sqlalchemy import sql from labmanager.tests.util import G4lTestCase, BaseTestLogged from flask.ext.testing import TestCase from ..models import LabManagerUser, LearningTool, LtUser from labmanager.db import db class MethodsCreateNewUser(BaseTestLogged): ...
Python
0
@@ -264,16 +264,31 @@ port db%0A +import unittest %0A%0Aclass @@ -2580,16 +2580,838 @@ pass%0A%0A + @unittest.skip(%22Until #71 fixed%22)%0A def test_create_new_user_admin_password_with_blanks_fail(self):%0A kwargs = %7B%7D%0A self.access_level_value = 'instructor'%0A kwargs%5Bself.name...
774443b9d00f311bb656dec8fbc66378cfe876a9
Make launch_testing.markers.retry_on_failure decorator more robust. (#352)
launch_testing/launch_testing/markers.py
launch_testing/launch_testing/markers.py
# Copyright 2019 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
Python
0
@@ -612,16 +612,47 @@ nctools%0A +import inspect%0Aimport unittest%0A %0A%0Adef ke @@ -1108,16 +1108,86 @@ (func):%0A + assert 'self' == list(inspect.signature(func).parameters)%5B0%5D%0A%0A @@ -1230,16 +1230,22 @@ wrapper( +self, *args, * @@ -1341,33 +1341,38 @@ ret -urn + = func( +s...
82ff7a584c46d7ea310ca0ed5b83fe4f454df990
Fix dataclass dict access
web/blueprints/task/__init__.py
web/blueprints/task/__init__.py
import json from flask import Blueprint, jsonify, url_for, abort, flash, redirect, request, \ render_template from flask_login import current_user from pycroft.model import session from pycroft.lib.task import cancel_task, task_type_to_impl from pycroft.model.facilities import Building from pycroft.model.task im...
Python
0.000002
@@ -4,16 +4,47 @@ ort json +%0Afrom dataclasses import asdict %0A%0Afrom f @@ -1606,16 +1606,23 @@ ameters( +asdict( task.par @@ -1632,13 +1632,9 @@ ters -.data +) ),%0A
574912ab8b95a4e469a1b22ea0153e3755fcd505
Rework admin of licenses app
apps/licenses/admin.py
apps/licenses/admin.py
""" Admin views for the licenses app. """ from django.contrib import admin from django.utils.html import format_html from django.utils.translation import ugettext_lazy as _ from .models import License def view_issue_on_site(obj): """ Simple "view on site" inline callback. :param obj: Current database ob...
Python
0
@@ -202,416 +202,8 @@ e%0A%0A%0A -def view_issue_on_site(obj):%0A %22%22%22%0A Simple %22view on site%22 inline callback.%0A :param obj: Current database object.%0A :return: HTML %3Ca%3E link to the given object.%0A %22%22%22%0A return format_html('%3Ca href=%22%7B0%7D%22 class=%22link%22%3E%7B1%7D%3...
a2a8f9a2bf9352a99b8ee3750851845f754f6c04
Use raw_id_field for voucher sender in admin.
apps/vouchers/admin.py
apps/vouchers/admin.py
from babel.numbers import format_currency from django.contrib import admin from django.core.urlresolvers import reverse from django.utils import translation from .models import CustomVoucherRequest, Voucher class VoucherAdmin(admin.ModelAdmin): list_filter = ('status',) list_display = ('created', 'amount_over...
Python
0
@@ -386,22 +386,20 @@ lds = (' -receiv +send er', 're
f4c9ee7d748c4ef03f85f5a134f27f998ada41b5
Add RefSeq and UniProt IDs to sites export
website/exports/protein_data.py
website/exports/protein_data.py
import os from collections import OrderedDict from sqlalchemy import and_ from tqdm import tqdm from database import fast_count, yield_objects from imports import MutationImportManager from models import ( Gene, InheritedMutation, MC3Mutation, ExomeSequencingMutation, The1000GenomesMutation, Mutation, SiteTyp...
Python
0
@@ -2782,16 +2782,37 @@ , 'pmid' +, 'refseq', 'uniprot' %5D%0A%0A f @@ -3197,16 +3197,100 @@ e.pmid)) +,%0A site.protein.refseq,%0A site.protein.best_uniprot_entry or '' %0A
905c5b877bf42f2366397baa9893cba9aac6bd75
Simplify metadata formatting for creators
website/identifiers/metadata.py
website/identifiers/metadata.py
# -*- coding: utf-8 -*- import lxml.etree import lxml.builder from website import settings NAMESPACE = 'http://datacite.org/schema/kernel-4' XSI = 'http://www.w3.org/2001/XMLSchema-instance' SCHEMA_LOCATION = 'http://datacite.org/schema/kernel-4 http://schema.datacite.org/meta/kernel-4/metadata.xsd' E = lxml.builder....
Python
0.000056
@@ -2659,27 +2659,24 @@ -orcid_value +verified = contr @@ -2713,17 +2713,33 @@ D'%5D. -key +value s()%5B0%5D + == 'VERIFIED' %0A @@ -2754,73 +2754,16 @@ if -contributor.external_identity%5B'ORCID'%5D%5Borcid_value%5D == 'VERIFIED' +verified :%0A @@ -2812,19 +2812,56 @@ ier( -orcid_value +contri...
04608636f6e4fc004458560499338af4b871cddb
Make Message a subclass of bytes
asyncio_irc/message.py
asyncio_irc/message.py
from .utils import to_bytes class Message: """A message recieved from the IRC network.""" def __init__(self, raw_message): self.raw = raw_message self.prefix, self.command, self.params, self.suffix = self._elements() def _elements(self): """ Split the raw message into it'...
Python
0.000186
@@ -32,24 +32,31 @@ lass Message +(bytes) :%0A %22%22%22A m @@ -135,41 +135,51 @@ sage -):%0A self.raw = raw_message +_bytes_ignored):%0A super().__init__() %0A @@ -451,12 +451,8 @@ elf. -raw. stri
0e1fd6ee7e1e496d15f30b7ceef1c0e23d38d583
fix logic
src/islands/base.py
src/islands/base.py
from collections import namedtuple import re from urllib import parse from bs4 import BeautifulSoup __author__ = 'zz' island_netloc_table = {} island_class_table = {} DivInfo = namedtuple('DivInfo', ['content', 'link', 'response_num']) class IslandNotDetectError(Exception): pass class IslandMeta(type): ...
Python
0.000244
@@ -1122,16 +1122,20 @@ if +not self.jso
8778a7b28030a0b185f006b62fe1305982cf8af0
Handle unknown fields
src/kser/schemas.py
src/kser/schemas.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ .. codeauthor:: Cédric Dumay <cedric.dumay@gmail.com> """ from cdumay_error import ValidationError import marshmallow.exceptions from marshmallow import Schema, fields from cdumay_result import ResultSchema, Result class BaseSchema(Schema): uuid = fields.String...
Python
0
@@ -213,16 +213,25 @@ , fields +, EXCLUDE %0Afrom cd @@ -294,24 +294,67 @@ ma(Schema):%0A + class Meta:%0A unknown = EXCLUDE%0A%0A uuid = f
73371de1d1d25c46063b8d3ffb708b98344abdd7
fix accidental removal
api/webview/views.py
api/webview/views.py
import json from django.http import HttpResponse from rest_framework import generics from rest_framework import permissions from rest_framework.response import Response from rest_framework.decorators import api_view from django.views.decorators.clickjacking import xframe_options_exempt from elasticsearch import Elasti...
Python
0.000002
@@ -2191,16 +2191,72 @@ ) or %7B%7D%0A + es.indices.create(index='institutions', ignore=400)%0A res
7eec4c297a04d2bdb3ca5645848790c362e053a8
Remove document ordering for now
api/webview/views.py
api/webview/views.py
import json from django.http import HttpResponse from rest_framework import generics from rest_framework import permissions from rest_framework.response import Response from rest_framework.decorators import api_view from django.views.decorators.clickjacking import xframe_options_exempt from elasticsearch import Elasti...
Python
0
@@ -903,32 +903,34 @@ %22%22%22%0A + # return Document @@ -1005,16 +1005,79 @@ d=None)%0A + return Document.objects.all().exclude(normalized=None)%0A %0A%0Aclass @@ -1468,32 +1468,34 @@ %22%22%22%0A + # return Document @@ -1601,16 +1601,110 @@ d=None)%0A + return Document...
622495f16bd6fab3a5c76d18aaa4a3ec4ff6d590
remove unused import.
test_linked_list.py
test_linked_list.py
import pytest from linked_list import Node from linked_list import LinkedList def test_node_init(): n = Node(3) assert n.val == 3 assert n.next is None def test_linkedlist_init(): l = LinkedList() assert l.head is None def test_linkedlist_repr(): l = LinkedList() assert repr(l) == '()...
Python
0
@@ -1,18 +1,4 @@ -import pytest%0A from @@ -1905,29 +1905,28 @@ == u%22('Things', 32, 'Bob')%22%0A -%0A
b97d65a61ed3c0443ee857ef3d6308e18f962a7a
Fix addparam templatetag to resolve request variable correctly
akvo/rsr/templatetags/addparam.py
akvo/rsr/templatetags/addparam.py
# Akvo RSR is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. # django snippet 840, see http://www.djangosnippets.org/snippet...
Python
0
@@ -366,26 +366,8 @@ ode, - resolve_variable, Tem @@ -382,16 +382,26 @@ taxError +, Variable %0A%0A%0Aregis @@ -550,17 +550,9 @@ q = -resolve_v +V aria @@ -564,18 +564,26 @@ request' -, +).resolve( context)
b6688254d4f9ff50a71b0949b316f8565da1e33a
should be json serializable
whatisit/apps/wordfish/tasks.py
whatisit/apps/wordfish/tasks.py
from celery.decorators import periodic_task from celery import shared_task, Celery from celery.schedules import crontab from django.conf import settings from django.contrib.auth.models import User from django.core.mail import EmailMessage from django.utils import timezone from whatisit.settings import DOMAIN_NAME fro...
Python
0.999997
@@ -2255,9 +2255,12 @@ notation +.id %0A
beda1d89d1bb7719ce15e97e6387aecba0a95ff7
Fix gmaily daemon issue.
wm/daemon/gmail-check-notify.py
wm/daemon/gmail-check-notify.py
#!/usr/bin/env python3 from xml.etree import ElementTree as etree import atexit import os import signal import subprocess import sys import time import traceback import urllib.request PID_FILE = "/run/user/%d/gmail-notify.pid" % os.geteuid() # Constants GMAIL_FEED = "https://mail.google.com/gmail/feed/atom" NS = "{h...
Python
0
@@ -601,16 +601,22 @@ y-send%22, + %22--%22, summary @@ -4525,25 +4525,24 @@ %25s%5C%22%22 %25 -( rawcount ,))%0A @@ -4537,10 +4537,8 @@ ount -,) )%0A @@ -4598,16 +4598,20 @@ if count + %3E 0 :%0A
e884fa6de130efae630f827921345bedc95af276
Update utils.py
azurecloudify/utils.py
azurecloudify/utils.py
from cloudify import ctx from cloudify.exceptions import NonRecoverableError import random import string def get_resource_group_name(): if ctx.node.properties['exsisting_resource_group_name']: return ctx.node.properties['exsisting_resource_group_name'] def get_resource_name(): if ctx.node.prop...
Python
0.000001
@@ -280,114 +280,724 @@ get_ -resource_name():%0A if ctx.node.properties%5B'resource_name'%5D:%0A return ctx.node.properties%5B'resource +storage_account_name():%0A if ctx.node.properties%5B'exsisting_storage_account_name'%5D:%0A return ctx.node.properties%5B'exsisting_storage_account_name'%5D%0A ...
d3ee9b6afc1d90f647335e15a4a48c36b84c3037
add --docker-root option
aminator/plugins/volume/docker.py
aminator/plugins/volume/docker.py
# -*- coding: utf-8 -*- # # # Copyright 2014 Netflix, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
Python
0
@@ -807,16 +807,56 @@ mePlugin +%0Afrom aminator.config import conf_action %0A%0A__all_ @@ -985,16 +985,440 @@ ocker'%0A%0A + def add_plugin_args(self, *args, **kwargs):%0A context = self._config.context%0A docker = self._parser.add_argument_group(title='Docker')%0A docker.add_argument('-b', ...
c84fb1e8f00f7341234965fcf2a1f7aca9a01cde
Add documentation to utils.stripspecialchars()
pompadour_wiki/pompadour_wiki/apps/utils/__init__.py
pompadour_wiki/pompadour_wiki/apps/utils/__init__.py
# -*- coding: utf-8 -*- import os import re def urljoin(*args): """ Like os.path.join but for URLs """ if len(args) == 0: return "" if len(args) == 1: return str(args[0]) else: args = [str(arg).replace("\\", "/") for arg in args] work = [args[0]] for arg in ...
Python
0
@@ -1279,16 +1279,76 @@ dedata%0A%0A + # will decompose UTF-8 entities ('%C3%A9' becomes 'e%5Cu0301')%0A nfkd @@ -1406,16 +1406,161 @@ _str))%0A%0A + # unicodedata.combining() returns 0 if the character is a normal character,%0A # so this loop help us converting the string in ASCII-format%0A retu
2603a3e6f24856ed74163ee6e9f985f90434b9fa
add get_absolute_url to ArticlePage to make comments framework redirects happier
molo/core/models.py
molo/core/models.py
from django.db import models from django.utils.translation import ugettext_lazy as _ from wagtail.wagtailcore.models import Page from wagtail.wagtailcore.fields import StreamField from wagtail.wagtailsearch import index from wagtail.wagtailadmin.edit_handlers import ( FieldPanel, FieldRowPanel, StreamFieldPanel, P...
Python
0
@@ -5643,16 +5643,73 @@ %0A %5D%0A%0A + def get_absolute_url(self):%0A return self.url%0A%0A def
729a5c2e1276f9789733fc46fb7f48d0ac7e3178
Use requests to fetch emoji list
src/slackmoji.py
src/slackmoji.py
# pylint: disable = C0103, C0111 # Standard Library import json import mimetypes from os import makedirs from subprocess import check_output # Third Party import requests def list_emojis(domain, token): script = ['bin/list_emojis.sh {0} {1}'.format(domain, token)] response = check_output(script, shell=True) ...
Python
0.000001
@@ -102,44 +102,8 @@ dirs -%0Afrom subprocess import check_output %0A%0A# @@ -171,116 +171,135 @@ -script = %5B'bin/list_emojis.sh %7B0%7D %7B1%7D'.format(domain, token)%5D%0A response = check_output(script, shell=True +url = r'https://%25s.slack.com/api/emoji.list' %25 domain%0A data = %5B('token', toke...
4d3d5c97b9ff49c553cae1900af70c12c2cee83c
adjust responder to python 3
project-template/chains/programs/sample.responder.py
project-template/chains/programs/sample.responder.py
import sys, json # get request and config from the framework req = json.loads(sys.argv[1]) config = json.loads(sys.argv[2]) params = req['params'] # create response title = 'sample.responder.py' name = 'Kimi no na wa?' if 'name' in params: name = params['name'] response = {'title': title, 'name': name} # show ti...
Python
0.998659
@@ -322,16 +322,17 @@ e%0Aprint +( json.dum @@ -343,10 +343,11 @@ esponse) +) %0A%0A
012133836593915481777d72946b315de8d9c46a
add template renderer in view handler
moneywatch/views.py
moneywatch/views.py
from flask import current_app, Blueprint, render_template from moneywatch import moneywatchengine relay = Blueprint('relay', __name__, url_prefix='', static_folder='static') @relay.route('/', methods=['GET', 'POST']) def index(): return relay.send_static_file('moneywatch.html') @relay.route('/css/<file>', metho...
Python
0
@@ -1610,32 +1610,118 @@ %0A return +render_template('bank_transactions.html',%0A transactions= moneywatchengine @@ -1730,20 +1730,35 @@ _account +_ get -( +_transactions() )%0A el
48b7880fec255c7a021361211e56980be2bd4c6b
Add "since" parameter to this command
project/creditor/management/commands/addrecurring.py
project/creditor/management/commands/addrecurring.py
# -*- coding: utf-8 -*- from creditor.models import RecurringTransaction from django.core.management.base import BaseCommand, CommandError class Command(BaseCommand): help = 'Gets all RecurringTransactions and runs conditional_add_transaction()' def handle(self, *args, **options): for t in RecurringT...
Python
0
@@ -17,16 +17,73 @@ f-8 -*-%0A +import datetime%0Aimport itertools%0A%0Aimport dateutil.parser%0A from cre @@ -189,16 +189,99 @@ ndError%0A +from django.utils import timezone%0A%0Afrom asylum.utils import datetime_proxy, months%0A %0A%0Aclass @@ -398,93 +398,736 @@ def -handle(self, *args, **options):%0A ...
65f0520383dcb9a39fa4409b867574832a9c1b4f
Update version.py
mongoctl/version.py
mongoctl/version.py
__author__ = 'abdul' MONGOCTL_VERSION = '0.6.2'
Python
0.000001
@@ -44,6 +44,7 @@ 0.6. -2' +3'%0A
bb2d31edca374ab132ffa22b2e98985c51492aa6
fix submodules on python2, nan check, usage
mordred/__main__.py
mordred/__main__.py
import argparse import csv import os import sys import math from rdkit import Chem from ._base import Calculator, all_descriptors, get_descriptors_from_module def smiles_parser(f): for line in f: line = line.strip().split() if len(line) == 1: smi = line[0] name = smi ...
Python
0.000011
@@ -20,16 +20,28 @@ ort csv%0A +import math%0A import o @@ -52,28 +52,16 @@ port sys -%0Aimport math %0A%0Afrom r @@ -1280,21 +1280,74 @@ prog'%5D = + '%7B%7D -m %7B%7D'.format(os.path.basename(sys.executable), prog +) %0A%0A pa @@ -2643,16 +2643,41 @@ if +isinstance(a, float) and math.isn @@ -2970,...
d7f3957d2174b7b9b092fa5725e3d20eda95227a
Clarify DummyAttr.
sunpy/net/attr.py
sunpy/net/attr.py
# -*- coding: utf-8 -*- # Author: Florian Mayer <florian.mayer@bitsrc.org> # # This module was developed with funding provided by # the ESA Summer of Code (2011). # # pylint: disable=C0103,R0903 """ Allow representation of queries as logic expressions. This module makes sure that attributes that are combined using the...
Python
0.000003
@@ -1870,16 +1870,108 @@ r ANDed. +%0A %0A attr = DummyAttr()%0A for from_, to in times:%0A attr %7C= Time(from_, to)%0A %22%22%22%0A
7ed15eabe7aadb58d432b7294b920dc58452b4b6
Make sure NewMessageForm doesn't explode
apps/messages/forms.py
apps/messages/forms.py
# Amara, universalsubtitles.org # # Copyright (C) 2012 Participatory Culture Foundation # # 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 op...
Python
0.000001
@@ -2788,18 +2788,26 @@ subject' +, 'team' )%0A - %0A%0A de @@ -3199,17 +3199,16 @@ eams()%0A%0A -%0A def @@ -3269,31 +3269,39 @@ f cd -%5B +.get( 'team' -%5D +) and cd -%5B +.get( 'user' -%5D +) :%0A @@ -3445,24 +3445,28 @@ f not cd -%5B +.get( 'team' -%5D +) and not @@ -3468,24 +3468,28 @@ d...
debc3f9c21af5666e53b84dd99c6d5c99abc2c66
Rename entry class
motobot/database.py
motobot/database.py
from pickle import load, dump, HIGHEST_PROTOCOL from os import replace class Entry: def __init__(self, database, data={}): self.__database = database self.__data = data def get_val(self, name, default=None): return self.__data.get(name, default) def set_val(self, name, value): ...
Python
0.000001
@@ -72,16 +72,24 @@ %0A%0Aclass +Database Entry:%0A @@ -1373,16 +1373,24 @@ name%5D = +Database Entry(se
61454a9e271bf57e54453c9ef50fd8bb7e545b6d
Fix Group.__unicode__.
wrestlers/models.py
wrestlers/models.py
# moore - a wrestling database # Copyright (C) 2011 Daniel Watkins # # 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 vers...
Python
0.000001
@@ -1343,18 +1343,44 @@ not None + and self.group_name != '' :%0A - @@ -1440,17 +1440,18 @@ return %22 -, + & %22.join( @@ -1481,16 +1481,22 @@ restlers +.all() %5D)%0A%0A%0Acla
e9484f9192ac93209dbdf377adff36f4b314167a
update test settings for djanog_jenkins
sample_project/hudson_test_settings.py
sample_project/hudson_test_settings.py
from sample_project.settings import * INSTALLED_APPS += ('test_extensions',) # COVERAGE_EXCLUDE_MODULES = ('django',) # COVERAGE_INCLUDE_MODULES = ('pagelets',)
Python
0
@@ -36,114 +36,803 @@ *%0A%0A -INSTALLED_APP +DATABASE S -+ = -('test_extensions',)%0A%0A# COVERAGE_EXCLUDE_MODULES = ('django',)%0A# COVERAGE_INCLUDE_MODULE +%7B%0A 'default': %7B%0A 'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'or...
8d498afc08d01a801044713ae430d85dfef7d8b6
Fix url mapping
bakery/cookies/urls.py
bakery/cookies/urls.py
# -*- coding: utf-8 -*- from django.conf.urls import patterns, url urlpatterns = patterns('bakery.cookies.views', url(r'^cookie/(?P<owner_name>[^/]+)/(?P<name>[^/]+)$', 'detail', name='detail'), )
Python
0.999826
@@ -164,16 +164,17 @@ e%3E%5B%5E/%5D+) +/ $', 'det
ab97af9e23f5006ae8eaf6273c5c9194fc9d8d5f
Print before running reactor.
basic-twisted/hello.py
basic-twisted/hello.py
def hello(): print 'Hello from the reactor loop!' from twisted.internet import reactor reactor.callWhenRunning(hello) reactor.run()
Python
0
@@ -119,16 +119,46 @@ hello)%0A%0A +print 'Starting the reactor.'%0A reactor.
7fd91de08707f78d44b1bbe7ebcd3f89d2a74022
fix make_bool for int values
munge/import_fns.py
munge/import_fns.py
import datetime from sa_util import run_sql AUTO_FNS = { 'double precision': 'make_float', 'bigint': 'make_int', 'smallint': 'make_int', 'integer': 'make_int', 'boolean': 'make_bool', 'numeric': 'make_numeric', } lookups = {} def make_bool(value): if value == '': return None ...
Python
0.000002
@@ -378,13 +378,8 @@ '1' -, '0' %5D%0A%0A%0A
817e2f8577da125a947905c2321bfb552c4ba0d1
Add GetReportList to next_ops
mws/apis/reports.py
mws/apis/reports.py
""" Amazon MWS Reports API """ from __future__ import absolute_import import mws from .. import utils from ..decorators import next_token_action # TODO Add ReportType enumerations as constants # TODO Add Schedule enumerations as constants class Reports(mws.MWS): """ Amazon MWS Reports API Docs: htt...
Python
0
@@ -479,32 +479,57 @@ rtRequestList',%0A + 'GetReportList',%0A 'GetRepo
b29539ece909707b96fe30a01994b3d02c4fe742
Correct docs
bears/r/FormatRBear.py
bears/r/FormatRBear.py
from coalib.bearlib.abstractions.Linter import linter from coalib.bearlib.spacing.SpacingHelper import SpacingHelper from coalib.parsing.StringProcessing import escape def _map_to_r_bool(py_bool): return 'TRUE' if py_bool else 'FALSE' @linter(executable='Rscript', output_format='corrected', prer...
Python
0.000005
@@ -1827,13 +1827,11 @@ nes -if ei +whe ther @@ -1841,16 +1841,20 @@ e assign +ment operato @@ -1865,54 +1865,64 @@ =%60%60 -or the arrow %60%60%3C-%60%60%0A should be used +should be replaced%0A by an arrow %60%60%3C-%60%60 or not .%0A%0A
f1cfa2d7e03cbab089e856831d8066434f525c6f
fix timedelta add time error
hakureiclub_app/core_model/mongodb.py
hakureiclub_app/core_model/mongodb.py
from pymongo import MongoClient from xpinyin import Pinyin from mu_sanic import config import urllib.request import datetime client = MongoClient(config.mongohost) db = client['Hakurei-Site'] pin = Pinyin() class BlogInfo: def __init__(self): self.blog = db['BlogInfo'] def init(self,title,markdown): ...
Python
0.000002
@@ -1367,51 +1367,12 @@ e = -datetime.datetime.strptime(time,%22%25Y.%25m.%25d%22) +time + d
058b5124daf986bffffbd8a677bfb88cfdc1036d
Make completion test helper behave like real completion scripts re: core flags.
tests/completion.py
tests/completion.py
import sys from _utils import ( _output_eq, IntegrationSpec, _dispatch, trap, expect_exit, assert_contains, assert_not_contains, eq_ ) @trap def _complete(invocation, collection=None): colstr = "" if collection: colstr = "-c {0}".format(collection) with expect_exit(0): _dispatch("...
Python
0
@@ -338,16 +338,20 @@ %7D -- inv + %7B0%7D %7B1%7D%22.fo @@ -355,16 +355,29 @@ .format( +%0A colstr,
6e48e1cca6939b63d9391a435d90d439b46743a8
Check if the url is a playlist
yufonium/youtube.py
yufonium/youtube.py
import json from youtube_dl import YoutubeDL from yufonium.utils import save_test_json ydl_opts = { "noplaylist": True # For now, we will separate playlist and singles later } def get_info(url): print("Getting info for {}".format(url)) with YoutubeDL(ydl_opts) as ydl: info = ydl.extract_info(u...
Python
0.000488
@@ -4,16 +4,26 @@ ort json +%0Aimport re %0A%0Afrom y @@ -49,16 +49,74 @@ utubeDL%0A +from youtube_dl.extractor.youtube import YoutubePlaylistIE %0Afrom yu @@ -151,16 +151,46 @@ t_json%0A%0A +ytplie = YoutubePlaylistIE()%0A%0A ydl_opts @@ -1571,227 +1571,772 @@ o%0A%0A%0A -%0Aif __name__ == %22__main__%22:%0A ...
ffbef0bcd13bb88e5af672a81f1dd250fbe6fae0
Fix KNX issue if 0 kelvin is reported by device (#44392)
homeassistant/components/knx/light.py
homeassistant/components/knx/light.py
"""Support for KNX/IP lights.""" from xknx.devices import Light as XknxLight from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ATTR_HS_COLOR, ATTR_WHITE_VALUE, SUPPORT_BRIGHTNESS, SUPPORT_COLOR, SUPPORT_COLOR_TEMP, SUPPORT_WHITE_VALUE, LightEntity, ) imp...
Python
0.000001
@@ -2673,32 +2673,134 @@ lor_temperature%0A + # Avoid division by zero if actuator reported 0 Kelvin (e.g., uninitialized DALI-Gateway)%0A if k @@ -2808,32 +2808,47 @@ lvin is not None + and kelvin %3E 0 :%0A
7b1ee49c638cafc553183872674f0dbbad92e8cd
fix typo in comment
tests/gabbletest.py
tests/gabbletest.py
""" Infrastructure code for testing Gabble by pretending to be a Jabber server. """ import base64 import sha import servicetest from twisted.words.xish import domish, xpath from twisted.words.protocols.jabber.client import IQ from twisted.words.protocols.jabber import xmlstream from twisted.internet import reactor ...
Python
0.000041
@@ -4794,18 +4794,18 @@ # cal -e l +e d when s
d50d211770a785559e352af96d6180c56acf9506
Fix deprecated call to tf.image_summary to tf.summary.image
im2txt/im2txt/ops/image_processing.py
im2txt/im2txt/ops/image_processing.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0.000497
@@ -3547,29 +3547,29 @@ tf. -image_ summary +.image (name, t
f6f09a24aa142d2a643bb0b5a0ec77766d6eb95b
Insert top directory in sys path for running middlebox properly.
src/nv_middlebox.py
src/nv_middlebox.py
#! /usr/bin/python3 # -*- coding: utf8 -*- # The middlebox software for remote camera management and relay streaming. # __author__ = "Sugesh Chandran" __copyright__ = "Copyright (C) The neoview team." __license__ = "GNU Lesser General Public License" __version__ = "1.0" import platform import sys import os import psut...
Python
0
@@ -385,15 +385,18 @@ ath. -append( +insert(0, os.p
9ca219094458cd2594fcef047090710689919f2c
Fix remaining issues
tests/stdlib/all.py
tests/stdlib/all.py
""" Convenience module for running standard library tests with nose. The standard tests are not especially homogeneous, but they mostly expose a test_main method that does the work of selecting which tests to run based on what is supported by the platform. On its own, Nose would run all possible tests and many would ...
Python
0
@@ -71,25 +71,25 @@ The standard - +%0A tests are no @@ -160,17 +160,17 @@ hod that - +%0A does the @@ -240,17 +240,17 @@ d by the - +%0A platform @@ -328,17 +328,17 @@ herefore - +%0A we colle @@ -408,18 +408,18 @@ run it. - +%0A%0A Hopefull @@ -570,25 +570,25 @@ o skip these - +%0A tests rather
f7c75adb7f371bf347f47d984834c6275614ae37
Remove deprecated random_cmap
photutils/utils/colormaps.py
photutils/utils/colormaps.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This module provides tools for generating matplotlib colormaps. """ from astropy.utils import deprecated import numpy as np from .check_random_state import check_random_state __all__ = ['make_random_cmap'] @deprecated('0.7', alternative='make_rand...
Python
0.000003
@@ -134,45 +134,8 @@ %22%22%0A%0A -from astropy.utils import deprecated%0A impo @@ -239,840 +239,8 @@ %5D%0A%0A%0A -@deprecated('0.7', alternative='make_random_cmap')%0Adef random_cmap(ncolors=256, random_state=None):%0A %22%22%22%0A Make a matplotlib colormap consisting of (random) muted colors.%0A%0A A ra...
09bdc51dacfe72597105c468baf356f0b1e81012
Test modified a second time, to keep Travis happy.
tests/testLabels.py
tests/testLabels.py
import json import sys sys.path.append('..') from skytap.Labels import Labels # noqa labels = Labels() def test_labels(): """Peform tests relating to labels.""" sys.exit() #labels.create("barf", True) for l in labels: print l
Python
0
@@ -171,18 +171,14 @@ -sys.exit() +return %0A%0A
7c028963ba88a4130d1f55218d709b884ef47b61
Add testApostrophe.
tests/test_basic.py
tests/test_basic.py
from unittest import TestCase import itertools from ppp_spell_checker import StringCorrector, Word import aspell class DependenciesTreeTests(TestCase): def testBasicWordMethods(self): a=Word("foo",2) b=Word("foo",2) self.assertEqual(a, b) self.assertEqual(str(a), str(b)) def ...
Python
0.000001
@@ -3473,28 +3473,251 @@ tEqual(corrected, expected)%0A +%0A def testApostrophe(self):%0A corrector = StringCorrector('en')%0A original='I%E2%80%99m a string with a %E2%80%98quotation%E2%80%99.'%0A corrected=corrector.correctString(original)%0A self.assertEqual(corrected, original)%0A
31664fd14ad516a0a46f74ab24e9384961fc2d36
Fix mysql detection plugin
monasca_setup/detection/plugins/mysql.py
monasca_setup/detection/plugins/mysql.py
# (C) Copyright 2015 Hewlett Packard Enterprise Development Company LP import logging import monasca_setup.agent_config import monasca_setup.detection from monasca_setup.detection.utils import find_process_name log = logging.getLogger(__name__) mysql_conf = '/root/.my.cnf' class MySQL(monasca_setup.detection.Plug...
Python
0.000003
@@ -13,16 +13,21 @@ ght 2015 +,2016 Hewlett @@ -1127,16 +1127,49 @@ ess.%22)%0A%0A + configured_mysql = False%0A @@ -1511,96 +1511,8 @@ nf)%0A - except _mysql_exceptions.MySQLError:%0A pass%0A else:%0A @@ -3023,16 +3023,60 @@ pass%7D%5D%7D%0A + ...
0bff51ff4feef3adc1230833a2f6c76fb15b686b
version 1.3.0
newfies/__init__.py
newfies/__init__.py
# -*- coding: utf-8 -*- # # Newfies-Dialer License # http://www.newfies-dialer.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2012 Star2B...
Python
0.000001
@@ -539,13 +539,12 @@ (1, -2, 17 +3, 0 , %22%22
d0df616b1e2bfdca4afc91a30572760894c17039
Set the monitoring commands to master only
app/bot/modules/twitter/module.py
app/bot/modules/twitter/module.py
from ..base import Module, command from . import constants as c from twitter import Twitter as TwitterAPI from twitter import TwitterStream from twitter import OAuth from collections import defaultdict from os import getenv import asyncio class Twitter(Module): def __init__(self, *args, **kwargs): sup...
Python
0
@@ -27,16 +27,29 @@ command +, master_only %0Afrom . @@ -1421,32 +1421,45 @@ onitor %7Bname:w%7D' +, master_only )%0A async def @@ -2285,32 +2285,45 @@ onitor %7Bname:w%7D' +, master_only )%0A async def
526aff8c3635bde6ef5894361fa51d8b091cd4c7
Remove test commands
motobot/core_plugins/privmsg_handlers.py
motobot/core_plugins/privmsg_handlers.py
from motobot import IRCBot, hook, Priority, Modifier, EatModifier, Eat, Notice, match, command from time import strftime, localtime from re import compile @command('test1') def test1(bot, database, nick, channel, message, args): modifier = Notice(nick) return [("message1", modifier), ("message2", modifier)] ...
Python
0.000052
@@ -154,322 +154,8 @@ e%0A%0A%0A -@command('test1')%0Adef test1(bot, database, nick, channel, message, args):%0A modifier = Notice(nick)%0A return %5B(%22message1%22, modifier), (%22message2%22, modifier)%5D%0A%0A%0A@command('test2')%0Adef test2(bot, database, nick, channel, message, args):%0A modifier = Noti...
80e8599274a9e014c4f3294da7e9bc38d05ed5c5
set STATIC_ROOT in settings and disable admin
djangoProject/djangoProject/settings.py
djangoProject/djangoProject/settings.py
""" Django settings for djangoProject project. Generated by 'django-admin startproject' using Django 1.8.2. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Buil...
Python
0
@@ -875,32 +875,33 @@ ED_APPS = (%0A +# 'django.contrib. @@ -2669,8 +2669,95 @@ tatic/'%0A +STATIC_ROOT = os.path.abspath(os.path.join(BASE_DIR, '../../tangoTimeMachine_static'))%0A
ed9c976de15abdf2ce42593ed59206897253c551
Fix to allow non-admin users with access to the admin panel couldn't access it.
zine/utils/admin.py
zine/utils/admin.py
# -*- coding: utf-8 -*- """ zine.utils.admin ~~~~~~~~~~~~~~~~ This module implements various functions used by the admin interface. :copyright: (c) 2009 by the Zine Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import os from time import time from itertools i...
Python
0
@@ -1465,16 +1465,59 @@ & expr%0A + else:%0A expr = ENTER_ADMIN_PANEL%0A retu
b85cbd36ac54f1761cc0fa8cdf57e29a4abaeaac
Clarify expected function behavior in test
tests/test_cache.py
tests/test_cache.py
"""Test the caching functionality""" import os.path import sys import types from typing import Any, cast import pytest import tldextract.cache from tldextract.cache import DiskCache, get_cache_dir, get_pkg_unique_identifier def test_disk_cache(tmpdir): cache = DiskCache(tmpdir) cache.set("testing", "foo", "b...
Python
0.000776
@@ -97,16 +97,47 @@ ny, cast +%0Afrom unittest.mock import Mock %0A%0Aimport @@ -2578,21 +2578,21 @@ est_ -cache_and_run +run_and_cache (tmp @@ -2632,20 +2632,16 @@ r)%0A%0A -def return_v @@ -2648,510 +2648,574 @@ alue -( +1 = %22unique return value -): +%22 %0A - %22%22%22Test function that retur...
c5f3f67a661f0614634163704d7ba61d67e59abc
fix the prod logging issue
scorinator/scorinator/settings/prod.py
scorinator/scorinator/settings/prod.py
from .base import * import dj_database_url DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( ) DATABASES = {'default': dj_database_url.config()} LOGGING['root'] = { 'level': 'WARNING', 'handlers': ['opbeat']} LOGGING['loggers']['opbeat'] = { 'level': 'DEBUG', 'handlers'...
Python
0.000002
@@ -151,119 +151,471 @@ GING -%5B'root'%5D = %7B%0A 'level': 'WARNING',%0A 'handlers': %5B'opbeat'%5D%7D%0ALOGGING%5B'loggers'%5D%5B'opbeat'%5D = + = %7B%0A 'version': 1,%0A 'disable_existing_loggers': True,%0A 'filters': %7B%0A 'require_debug_false': %7B%0A '()': 'django.uti...
dc55b0f98c6104a05a29104e056a71d51ef908de
Add section prefix to a question in survey export
indico/modules/events/surveys/util.py
indico/modules/events/surveys/util.py
# This file is part of Indico. # Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
Python
0
@@ -3012,24 +3012,38 @@ que_col( +_format_title( question .title, @@ -3034,22 +3034,17 @@ question -.title +) , questi @@ -3551,16 +3551,30 @@ que_col( +_format_title( answer.q @@ -3584,14 +3584,9 @@ tion -.title +) , an @@ -3694,16 +3694,16 @@ n_dict)%0A - retu @@ -3721,24 +3721,195 @@ mes, rows%0A%0A...
06a7bfc5475398391293f3ac6e5c93c2019d80d7
Fix default repeat_interval in create_reservation
indico/modules/rb/testing/fixtures.py
indico/modules/rb/testing/fixtures.py
## This file is part of Indico. ## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). ## ## Indico 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...
Python
0.000019
@@ -2041,17 +2041,72 @@ erval', -1 +int(params%5B'repeat_frequency'%5D != RepeatFrequency.NEVER) )%0A
0f6128c3694b08899220a3e2b8d73c27cda7eeee
Format new migration file with black
saleor/product/migrations/0117_auto_20200423_0737.py
saleor/product/migrations/0117_auto_20200423_0737.py
# Generated by Django 3.0.5 on 2020-04-23 12:37 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('product', '0116_auto_20200225_0237'), ] operations = [ migrations.AlterField( model_name='producttranslation', name=...
Python
0
@@ -159,20 +159,20 @@ ( -' +%22 product -', ' +%22, %22 0116 @@ -190,17 +190,17 @@ 225_0237 -' +%22 ),%0A %5D @@ -274,17 +274,17 @@ el_name= -' +%22 productt @@ -293,17 +293,17 @@ nslation -' +%22 ,%0A @@ -317,14 +317,14 @@ ame= -' +%22 name -' +%22 ,%0A
84351e227c0c520ac9ee36f9bd5577907f5dc4bc
Make resilient to propublica api failure
indivisible/datasources/propublica.py
indivisible/datasources/propublica.py
from six.moves.html_parser import HTMLParser import us from base import JSONSource class ProPublica(JSONSource): version = "v1" @classmethod def initialize(cls, key): cls.key = key def __init__(self): super(ProPublica, self).__init__( "https://api.propublica.org/congress...
Python
0.000002
@@ -3850,17 +3850,21 @@ results -%5B +.get( 'results @@ -3864,17 +3864,23 @@ results' -%5D +, None) %0A%0A de
9cc85af40d05babbe9fc16e71d7dc2b475f3b5e9
Remove format option to maintain python 2.6 compatibility
avocado/management/subcommands/cache.py
avocado/management/subcommands/cache.py
import sys import time import logging from optparse import make_option from django.core.management.base import BaseCommand, CommandError from avocado.management.base import DataFieldCommand log = logging.getLogger(__name__) _help = """\ Pre-caches data produced by various DataField methods that are data dependent. ...
Python
0
@@ -1675,10 +1675,8 @@ k %7B1 -:, %7D se
be21b5eda3973e5b6a79cc32eb1b467e667ffff4
Fix edge filtering by hashes on BFS
indra/explanation/pathfinding/util.py
indra/explanation/pathfinding/util.py
__all__ = ['path_sign_to_signed_nodes', 'signed_nodes_to_signed_edge', 'get_sorted_neighbors'] import logging logger = logging.getLogger(__name__) def path_sign_to_signed_nodes(source, target, edge_sign): """Translates a signed edge or path to valid signed nodes Pairs with a negative source node ...
Python
0.000001
@@ -2760,24 +2760,209 @@ ors%0A %22%22%22%0A + def statements_allowed(u, v):%0A for stmt in G.get_edge_data(u, v)%5B'statements'%5D:%0A if stmt%5B'stmt_hash'%5D in hashes:%0A return True%0A return False%0A%0A if rever @@ -2961,24 +2961,24 @@ if reverse:%0A - ...
b0571dcea31dc8eced33e8d3f1049335b630ef41
Fix Markdown headers
src/trello2md.py
src/trello2md.py
#!/usr/bin/python3 """ Terminal program to convert Trello's json-exports to markdown. See: https://github.com/phipsgabler/trello2md """ import sys import argparse import json import re # a url in a line (obligatory starting with the protocol part) find_url = re.compile('(^|.* )([a-zA-Z]{3,4}://[^ ]*)(.*)$') #####...
Python
0.000328
@@ -1058,19 +1058,21 @@ pend('## + %7B0%7D + ##'.form @@ -6502,19 +6502,21 @@ ppend('# + %7B0%7D + #%5Cn%5Cn'.f
0f0ea473ce08e36e75fdb0db5dfd0ca2acb84ac2
Check if type of datetime
infosystem/common/subsystem/entity.py
infosystem/common/subsystem/entity.py
from datetime import datetime from infosystem.database import db DATE_FMT = '%Y-%m-%d' DATETIME_FMT = '%Y-%m-%dT%H:%M:%S.%fZ' class Entity(object): attributes = ['id', 'active', 'created_at', 'created_by', 'updated_at', 'updated_by'] id = db.Column(db.CHAR(32), primary_key=True, autoincr...
Python
0.001255
@@ -1140,14 +1140,16 @@ From -String +AllTypes (sel @@ -1223,32 +1223,80 @@ me is not None:%0A + if type(dateOrDateTime) is str:%0A try: @@ -1312,16 +1312,20 @@ + + if len(d @@ -1366,32 +1366,36 @@ + dateTime = datet @@ -1424,32 +1424,36 @@ ...
3aa668460467683f72955cbfd8064a64e4c50b76
Fix the doc typo
zaqar/common/schemas/flavors.py
zaqar/common/schemas/flavors.py
# Copyright (c) 2013 Rackspace Hosting, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
Python
0.64764
@@ -618,15 +618,13 @@ for -marconi +zaqar -que
42c667ab7e1ed9cdfc711a4d5eb815492d8b1e05
Fix a test with generate_thumbnail
tests/test_image.py
tests/test_image.py
# -*- coding:utf-8 -*- import os from sigal.image import generate_image, generate_thumbnail CURRENT_DIR = os.path.dirname(__file__) TEST_IMAGE = 'exo20101028-b-full.jpg' def test_image(tmpdir): "Test the Image class." srcfile = os.path.join(CURRENT_DIR, 'sample', 'dir2', TEST_IMAGE) dstfile = str(tmpd...
Python
0.999023
@@ -386,16 +386,22 @@ 00, 150) +, None )%0A as
ccfe12391050d598ec32861ed146b66f4e907943
Use big company list for regex entity extraction
noodles/entities.py
noodles/entities.py
""" Find all company names in a piece of text extractor = EntityExtractor() entities = extractor.entities_from_text(text) > ['acme incorporated', 'fubar limited', ...] TODO: - work out a standard form to normalize company names to - import company names into the massive regex """ import re norm_reqs = ( ('lt...
Python
0.000052
@@ -166,133 +166,78 @@ ..%5D%0A -%0ATODO:%0A - work out a standard form to normalize company names to%0A - import company names into the massive regex%0A%22%22%22%0A%0A +%22%22%22%0A%0ACOMPANY_SOURCE_FILE = '/tmp/companies_dev.csv'%0A%0Aimport re %0Aimport re%0A%0A @@ -232,18 +232,19 @@ %0Aimport -re +csv %0A%0A...
91522ad72576713fc6a2776144ccb97f7e17f676
Fix timezone settings
atlas/settings/base.py
atlas/settings/base.py
from os.path import dirname, join import atlas VERSIONS = { 'atlas': atlas.__versionstr__, } # List of finder classes that know how to find static files in # various locations. STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirector...
Python
0.000188
@@ -2993,16 +2993,117 @@ ables2%0A) +%0ALANGUAGE_CODE = 'en-us'%0ALANGUAGE_NAME = 'English'%0ALANGUAGE_NAME_LOCAL = 'English'%0A%0ATIME_ZONE = 'UTC' %0A%0AUSE_TZ
db0b2d603a3e30e2965b942017d957cbc939c755
Fix askMultipleChoice value when None is returned.
src/turtlebot.py
src/turtlebot.py
#!/usr/bin/env python from code_it.srv import AskMultipleChoice, AskMultipleChoiceResponse from code_it.srv import DisplayMessage, DisplayMessageResponse from code_it.srv import GoTo, GoToResponse from code_it.srv import GoToDock, GoToDockResponse from std_msgs.msg import Bool import code_it_turtlebot as turtlebot imp...
Python
0
@@ -967,24 +967,28 @@ f result is +not None else No @@ -1038,23 +1038,16 @@ (choice= -result. choice)%0A
afdfb6f516043a326b271b3d743d2230dfff28c6
test for KmerIndex.scanned_sequences
tests/test_kmers.py
tests/test_kmers.py
# -*- coding: utf-8 -*- import pytest from tempfile import NamedTemporaryFile from itertools import product from scipy.stats import norm, binom from math import log import numpy as np from biseqt.random import rand_seq from biseqt.sequence import Alphabet from biseqt.database import DB from biseqt.kmers import binomia...
Python
0.000001
@@ -2798,24 +2798,94 @@ nsert(S).id%0A + assert next(kmer_index.scanned_sequences()) == (S_id, len(S))%0A asse @@ -2913,17 +2913,36 @@ rs() == -3 +len(S) - wordlen + 1 %0A%0A
ff5d6abbbca112fab663f3a62aaedfc69804cab2
Fix completions not being offered when scope empty
plugins_/color_scheme_dev.py
plugins_/color_scheme_dev.py
import functools import logging import re import sublime import sublime_plugin from .lib.scope_data import completions_from_prefix from .lib import syntax_paths __all__ = ( 'ColorSchemeCompletionsListener', ) l = logging.getLogger(__name__) def _inhibit_word_completions(func): """Decorator that inhibits S...
Python
0
@@ -1846,14 +1846,58 @@ -if not +l.debug(%22Full prefix: %25r%22, real_prefix)%0A if rea @@ -1904,16 +1904,24 @@ l_prefix + is None :%0A
6b0bab695e91dcb2d16aa18308e156c20549ee0f
Update test to work with multiple versions of CSSUtils.
pocketlint/tests/test_css.py
pocketlint/tests/test_css.py
# Copyright (C) 2011-2012 - Curtis Hovey <sinzui.is at verizon.net> # This software is licensed under the MIT license (see the file COPYING). from pocketlint.formatcheck import( CSSChecker, HAS_CSSUTILS, ) from pocketlint.tests import CheckerTestCase from pocketlint.tests.test_text import TestAnyTextMixi...
Python
0
@@ -1759,46 +1759,240 @@ ual( -%5B(2, message)%5D, self.reporter. +1, len(self.reporter.messages))%0A message = self.reporter.messages%5B0%5D%0A self.assertEqual(2, message%5B0%5D)%0A self.assertIn('Invalid value for', message%5B1%5D)%0A self.assertIn('property: speckled: color', message ...
b78ba9e3e84760f7872cd9d8a72f8effa7815525
Add test that makes sure we're not cluttering the graph
tests/test_model.py
tests/test_model.py
import numpy as np import tensorflow as tf from nose.tools import raises from numpy.testing import assert_almost_equal import scipy.stats as st import tensorprob as tp def test_creation(): model = tp.Model() with model: pass @raises(tp.model.ModelError) def test_scalar_creation_outside_with(): ...
Python
0.000001
@@ -633,16 +633,514 @@ after%0A%0A +def test_internal_graph_no_growth():%0A # Calling assign or fit doesn't grow the execution graph%0A with tp.Model() as model:%0A mu = tp.Parameter()%0A sigma = tp.Parameter(lower=0)%0A X = tp.Normal(mu, sigma)%0A%0A model.observed(X)%0A model.initia...
7d26e73a9ce2768478205786b7e2206ebf7bf83e
remove unused VIRTFN_RE and re
nova/pci/devspec.py
nova/pci/devspec.py
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
Python
0
@@ -582,18 +582,8 @@ ast -%0Aimport re %0A%0Afr @@ -786,44 +786,8 @@ '*'%0A -VIRTFN_RE = re.compile(%22virtfn%5Cd+%22)%0A %0A%0Ade
f46f149783694a97919cd1cc372d848bd2a8dc74
set default 300 max_size.
blackgate/component.py
blackgate/component.py
# -*- coding: utf-8 -*- import tornado.ioloop from blackgate.http_proxy import HTTPProxy from blackgate.executor import ExecutorPools class Component(object): def __init__(self): self.urls = [] self.pools = ExecutorPools() self.configurations = {} @property def config(self): ...
Python
0
@@ -647,9 +647,9 @@ or -1 +3 00%0A
19858592a4552a9cdf33f11a134cb4eb43167ecb
Use xfs_db in read-only mode when getting XFS information
blivet/tasks/fsinfo.py
blivet/tasks/fsinfo.py
# fsinfo.py # Filesystem information gathering classes. # # Copyright (C) 2015 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions of # the GNU General Public License v.2, or (at your option) any later version. #...
Python
0
@@ -2968,16 +2968,22 @@ ocksize%22 +, %22-r%22 %5D%0A%0A%0Aclas
a357e0e59385bdd3dc95b75bec9fcc67ed0aefb9
Update test_plugs.py
tests/test_plugs.py
tests/test_plugs.py
from __future__ import print_function import unittest from flowpipe.node import INode from flowpipe.plug import InputPlug, OutputPlug class TestNode(INode): def __init__(self): super(TestNode, self).__init__() def compute(self): pass class TestPlugs(unittest.TestCase): """Test the Pl...
Python
0.000001
@@ -1747,32 +1747,57 @@ ty.%22%22%22%0A n +1 = TestNode()%0A n2 = TestNode()%0A @@ -1823,32 +1823,33 @@ tputPlug('in', n +1 )%0A in_plu @@ -1861,32 +1861,33 @@ nputPlug('in', n +2 )%0A%0A in_pl
351cd20955a88567888f7c4c4876d2758c0ce9d1
fix for posti test
tests/test_posti.py
tests/test_posti.py
# -*- coding: utf-8 -*- # from nose.tools import eq_ import bot_mock from pyfibot.modules.module_posti import command_posti from utils import check_re bot = bot_mock.BotMock() def test_posti(): '''11d 1h 45m ago - Item delivered to the recipient. - TAALINTEHDAS 25900''' regex = '(\d+d\ )?(\d+h\ )?(\d+m)? ag...
Python
0
@@ -284,16 +284,17 @@ regex = +u '(%5Cd+d%5C @@ -313,11 +313,11 @@ %5Cd+m + )? - ago
fc47d6083a85a615a342b6d1596d73808e5c42e2
Fix tests
tests/test_qiniu.py
tests/test_qiniu.py
import os from os.path import dirname, join import uuid import qiniu.conf import qiniu.io import qiniu.rs import qiniu.rsf QINIU_ACCESS_KEY = os.environ.get('QINIU_ACCESS_KEY') QINIU_SECRET_KEY = os.environ.get('QINIU_SECRET_KEY') QINIU_BUCKET_NAME = os.environ.get('QINIU_BUCKET_NAME') QINIU_BUCKET_DOMAIN = os.envir...
Python
0.000003
@@ -702,16 +702,53 @@ %25 text%0A + token = QINIU_PUT_POLICY.token()%0A ret,
9788184b262d1890bb99d6493a5506891619951d
Add tests for process_normalized
tests/test_tasks.py
tests/test_tasks.py
import mock import pytest from scrapi import tasks from scrapi import events BLACKHOLE = lambda *_, **__: None @pytest.fixture def dispatch(monkeypatch): event_mock = mock.MagicMock() monkeypatch.setattr('scrapi.events.dispatch', event_mock) return event_mock def test_run_consumer_calls(monkeypatch, ...
Python
0.000001
@@ -4443,8 +4443,713 @@ (calls)%0A +%0A%0Adef test_process_norm_calls(monkeypatch):%0A pmock = mock.Mock()%0A raw = %7B'docID': 'foo'%7D%0A%0A monkeypatch.setattr('scrapi.tasks.processing.process_normalized', pmock)%0A%0A tasks.process_normalized(raw, raw)%0A%0A pmock.assert_called_once_with(raw, raw, %...
4e31dd618a04dbf77bf85cacf34e3aa08e3238aa
Add assertRegexpMatches and assertIsInstance to tback tests to make them work on python < 2.7.
tests/test_tback.py
tests/test_tback.py
#!/usr/bin/python # -*- coding: utf-8 -*- import re import unittest import run_tests # set sys.path from kobo.tback import * class TestTraceback(unittest.TestCase): def test_empty(self): self.assertEqual('', get_traceback()) self.assertEqual('', Traceback().get_traceback()) self.assertE...
Python
0
@@ -163,16 +163,977 @@ tCase):%0A +%0A # hack for python %3C 2.7%0A if not hasattr(unittest.TestCase, %22assertRegexpMatches%22):%0A def assertRegexpMatches(self, text, expected_regexp, msg=None):%0A %22%22%22Fail the test unless the text matches the regular expression.%22%22%22%0A i...
49cf828d6b562cd34dd0adf69a2410cc74360427
Remove old tests for views.
tests/test_tests.py
tests/test_tests.py
import pytest import json from name.models import Name from django.core.urlresolvers import reverse @pytest.fixture def name_fixtures(db, scope="module"): Name.objects.create(name='test person', name_type=0, begin='2012-01-12') Name.objects.create(name='test organization', ...
Python
0
@@ -568,319 +568,8 @@ )%0A%0A%0A -@pytest.mark.django_db%0Aclass TestViews:%0A def test_response_codes(self, client, name_fixtures):%0A routes_to_test = %5B'about/', 'stats/', 'map/', 'feed/'%5D%0A for test_route in routes_to_test:%0A response = client.get('/name/%25s' %25 test_route)%0A ...
0f17c8d3438b910c2fa6db7c588487b591fc3d77
Test utils
tests/test_utils.py
tests/test_utils.py
from .helpers import MockerTestCase from passpie.utils import genpass, mkdir_open class UtilsTests(MockerTestCase): def test_genpass_generates_a_password_with_length_32(self): password = genpass() self.assertEqual(len(password), 32) def test_mkdir_open_makedirs_on_path_dirname(self): ...
Python
0.000001
@@ -1,25 +1,78 @@ -from .helpers +try:%0A from mock import mock_open%0Aexcept:%0A from unittest.mock import Mock @@ -67,30 +67,39 @@ import -MockerTestCase +mock_open%0A%0Aimport yaml%0A %0Afrom pa @@ -136,16 +136,78 @@ dir_open +, load_config, get_version%0Afrom .helpers import MockerTestCase %0A%0A%0A...
3dc6df3aa399fb403a0acbc494c5338e7be7f76c
clean up tests
tests/test_views.py
tests/test_views.py
import pytest from pyramid import testing from pyramid.response import Response from unittest import TestCase from pyramid_restful.views import APIView class GetView(APIView): def get(self, request, *args, **kwargs): return Response({'method': 'GET'}) class PostView(APIView): def post(self, req...
Python
0.000001
@@ -1,19 +1,4 @@ -import pytest%0A%0A from @@ -141,18 +141,19 @@ %0A%0Aclass -Ge +Tes tView(AP @@ -254,35 +254,8 @@ %7D)%0A%0A -%0Aclass PostView(APIView):%0A%0A @@ -677,116 +677,24 @@ elf. -get_view = GetView.as_view()%0A self.post_view = PostView.as_view()%0A self.init_view = InitKwargs +tes...
bd53fe8df0642fd85d655994619fedaf4347e826
Test create admission (database) with collection date and admission date
tests/test_views.py
tests/test_views.py
import unittest from flask import current_app, url_for, get_flashed_messages from app import create_app, db from app.models import * class TestCreateAdmissionView(unittest.TestCase): def setUp(self): self.app = create_app('testing') self.app_context = self.app.app_context() self.app_contex...
Python
0
@@ -9,16 +9,32 @@ nittest%0A +import datetime%0A from fla @@ -491,17 +491,135 @@ ntern': -1 +'011/2012',%0A 'samples-0-collection_date': '12/12/2012',%0A 'samples-0-admission_date': '13/12/2012' ,%0A @@ -786,123 +786,83 @@ +dat a = -Admission(id_lvrs_intern=1)%0A db.sessi...
a866f37d963c237981af77c7d93dde2de0b3ae9b
Add Callback exception test
tests/unit_tests.py
tests/unit_tests.py
import unittest from itertools import chain from mock import Mock from smarkets.clients import Callback class CallbackTestCase(unittest.TestCase): "Test the `smarkets.Callback` class" def setUp(self): "Set up the tests" self.callback = Callback() def tearDown(self): "Tear down t...
Python
0
@@ -2805,28 +2805,1015 @@ ert_called_once_with('foo')%0A +%0A def test_handle_exception(self):%0A %22Test that an exception is raised by the callback method%22%0A handler = Mock(side_effect=self._always_raise)%0A self.callback += handler%0A self.assertRaises(Exception, self.callback, 'fo...
f05c028f872aa33320d7fccf39eb0c9eb7569787
add binary to write mode if it isn't present
postmark_inbound/__init__.py
postmark_inbound/__init__.py
import json from base64 import b64decode from datetime import datetime from email.utils import mktime_tz, parsedate_tz from email.mime.base import MIMEBase from email.encoders import encode_base64 __version__ = '1.0.0' # Version synonym VERSION = __version__ class PostmarkInbound(object): def __init__(self, *...
Python
0.000001
@@ -3668,32 +3668,92 @@ )%0A%0A try:%0A + if 'b' not in mode:%0A mode += 'b'%0A atta
c161187f5c1ca8412e20336a4cc2e1bfada54359
Add has_controller check to experiments.
enactiveagents/experiment/experiment.py
enactiveagents/experiment/experiment.py
import abc import model.world import model.structure import model.agent import model.perceptionhandler class Experiment(object): controller = None def parse_world(self, world_repr, mapper=None): """ Parse a representation of a world to a world. :param world_repr: A list of strings tha...
Python
0
@@ -2126,19 +2126,19 @@ def -get +has _control @@ -2160,93 +2160,48 @@ -if self.controller:%0A return self.controller%0A else:%0A +return self.controller != None%0A%0A def _con @@ -2196,16 +2196,19 @@ def +get _control @@ -2215,44 +2215,15 @@ ler( -e, coords +self ...
e8039dd715242d6830ff1005085fec5bb89b300c
improve the check on dyn_file_func of TftpServer
tftpy/TftpServer.py
tftpy/TftpServer.py
"""This module implements the TFTP Server functionality. Instantiate an instance of the server, and then run the listen() method to listen for client requests. Logging is performed via a standard logging object set in TftpShared.""" import socket, os, time import select from TftpShared import * from TftpPacketTypes im...
Python
0
@@ -1279,16 +1279,55 @@ if +self.dyn_file_func:%0A if not callable @@ -1364,51 +1364,84 @@ -# don't check the tftproot%0A pass + raise TftpException, %22A dyn_file_func supplied, but it is not callable.%22 %0A
6a4a3388c39115982019a6581a6f0393e33d92e1
patch the daily coupons url to only accept integers
apps/nigeria/urls.py
apps/nigeria/urls.py
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 import os from django.conf.urls.defaults import * import apps.nigeria.views as views urlpatterns = patterns('', url(r'^locgen/?$', views.generate), url(r'^reports/?$', views.index), url(r'^reports/summary/(?P<locid>\d*)/?$', views.index), url(r'^repor...
Python
0
@@ -529,17 +529,18 @@ P%3Clocid%3E -. +%5Cd *)/?$',
7056de93082fbd04220e2a8b0e5719bb3cbfe736
version bump
taxadb/version.py
taxadb/version.py
__version__ = '0.8.0'
Python
0.000001
@@ -14,9 +14,9 @@ '0. -8 +9 .0'%0A
354ee85623b948ec3a439caa35b9646be081762d
Add some maths
01/myfirstprogram.py
01/myfirstprogram.py
''' my first program in python ''' import sys numbers = sys.argv[1:] a,b = int(numbers[0]),int(numbers[1]) print("the number you've passed are:") print(a,b) print("a+b=", a+b)
Python
0.999988
@@ -171,8 +171,89 @@ =%22, a+b) +%0Aprint(%22a**b=%22, a**b)%0Aprint(%22a/b=%22, a/b)%0Aprint(%22a//b=%22, a//b)%0Aprint(%22a%25b=%22, a%25b)%0A
670a496993deb0ed7887b95302da67ce262ece0c
remove debug print statement
examples/basics/gloo/spatial_filters.py
examples/basics/gloo/spatial_filters.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Example demonstrating spatial filtering using spatial-filters fragment shader. Left and Right Arrow Keys toggle through available filters. """ import numpy as np from vispy.io import load_spatial_filters from vispy import gloo from vispy import app # create 5x5 matri...
Python
0.000002
@@ -2413,50 +2413,8 @@ r%5D)%0A - print(self.names%5Bself.filter%5D) %0A
b700e45dba6e6f4341fbe3b2a7ae08d5052c5f1f
Revert "weird json object settings notation"
bongo/settings/prod.py
bongo/settings/prod.py
from os import environ from common import * from logentries import LogentriesHandler import logging # See: https://docs.djangoproject.com/en/dev/ref/settings/#databases DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': SITE_NAME, 'USER': SITE_NAME, ...
Python
0
@@ -40,64 +40,8 @@ rt * -%0Afrom logentries import LogentriesHandler%0Aimport logging %0A%0A# @@ -1458,24 +1458,74 @@ S #####%0A -LOGGING%5B +%0Afrom logentries import LogentriesHandler%0Aimport logging%0A%0A 'handler @@ -1522,26 +1522,32 @@ %0A%0A'handlers' -%5D%5B +: %7B%0A 'logentries_ @@ -1554,22 +1554,2...
eff79814819395272e01c43b2fbac4406a909cb6
Update eLife subtypes and cdc default database.
tdb/upload_all.py
tdb/upload_all.py
import argparse import subprocess import os parser = argparse.ArgumentParser() parser.add_argument('-db', '--database', default='tdb', help="database to upload to") parser.add_argument('--subtypes', nargs='+', type = str, help ="flu subtypes to include, options are: h3n2, h1n1pdm, vic, yam") parser.add_argument('--so...
Python
0
@@ -2200,32 +2200,23 @@ .py -db -%22 + database + %22 +cdc_tdb --path @@ -3829,32 +3829,77 @@ arams.subtypes:%0A + if subtype != 'h1n1pdm':%0A