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
14b2d5f1e72ca4fe3e52ec34f774c2ad0a8218a7
fix a minor bug
newsman/watchdog/cron/clean_memory.py
newsman/watchdog/cron/clean_memory.py
#!/usr/bin/env python #-*- coding: utf-8 -*- """ daily work, clean expired items and its place in queues in memory """ # @author chengdujin # @contact chengdujin@gmail.com # @created Aug. 22, 2013 import sys reload(sys) sys.setdefaultencoding('UTF-8') sys.path.append("../..") from bson.objectid import ObjectId from...
Python
0.000004
@@ -3137,36 +3137,8 @@ id)%0A - return True%0A @@ -3203,32 +3203,49 @@ list')%0A + continue%0A return F @@ -3235,36 +3235,35 @@ %0A return -Fals +Tru e%0A except Exc
da36599891e43062f557147ea2e8c5c4ada739a0
Add task to celerybeat (nc-290)
nodeconductor/server/base_settings.py
nodeconductor/server/base_settings.py
""" Django base settings for nodeconductor project. """ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) from datetime import timedelta import os BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.dirname(__file__)), '..')) DEBUG = False TEMPLATE_DEBUG = False ALLOWED_HOSTS = [...
Python
0.999999
@@ -3895,11 +3895,189 @@ ,%0A %7D, +%0A%0A 'sync-instances-with-zabbix': %7B%0A 'task': 'nodeconductor.iaas.tasks.sync_instances_with_zabbix',%0A 'schedule': timedelta(minutes=10),%0A 'args': (),%0A %7D, %0A%7D%0A
4dad981887a260baca5339a2d0563f43bcb13067
Add full name command line
taskq/command.py
taskq/command.py
import os import sys import time import ConfigParser import signal from optparse import OptionParser import logging.config import logging import transaction from sqlalchemy import text from sqlalchemy.exc import OperationalError import datetime import sys log = logging.getLogger(__name__) # Can be overwrite by a conf...
Python
0.000187
@@ -3984,16 +3984,33 @@ %22-c%22, + %22--config-file%22, dest=%22c
36cc8833c9554bd607d6c1ad337ae3cf488f04d7
check rates and do ping only for connected peers
bndl/net/watchdog.py
bndl/net/watchdog.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 # distributed under th...
Python
0
@@ -2064,16 +2064,55 @@ x rates%0A + if self.peer.is_connected:%0A @@ -2191,32 +2191,36 @@ nterval%0A + self.bytes_sent @@ -2247,16 +2247,20 @@ es_sent%0A + @@ -2343,32 +2343,36 @@ ved) / interval%0A + self.byt @@ -6519,22 +6519,53 @@ elif -stats. +...
8d71c615f2ee84bb53d93f6114ad6a17ecf81285
Improve test coverage of nova.privsep.utils.
nova/tests/unit/privsep/test_utils.py
nova/tests/unit/privsep/test_utils.py
# Copyright 2011 Justin Santa Barbara # # 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.000005
@@ -690,16 +690,48 @@ rt test%0A +from nova.tests import fixtures%0A %0A%0Aclass @@ -5429,28 +5429,334 @@ d_once_with(self.test_path)%0A +%0A%0Aclass UtilsTestCase(test.NoDBTestCase):%0A def setUp(self):%0A super(UtilsTestCase, self).setUp()%0A self.useFixture(fixtures.PrivsepFixture())%0A%0A @m...
bfd516db001ef5a208be2d1c60764587d2609d1a
Add status column to order payment administration
plata/shop/admin.py
plata/shop/admin.py
from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from . import models class OrderItemInline(admin.TabularInline): model = models.OrderItem raw_id_fields = ('variation',) class AppliedDiscountInline(admin.TabularInline): model = models.AppliedDiscount class OrderS...
Python
0
@@ -1855,16 +1855,26 @@ amount', + 'status', 'author @@ -1999,26 +1999,22 @@ ter = (' -authorized +status ',)%0A
786e53666dac3533dfd0d3fd903e9202717a35ee
assert the user is not in the group
corehq/apps/groups/tests/test_groups.py
corehq/apps/groups/tests/test_groups.py
from couchdbkit import BadValueError from django.test import TestCase, SimpleTestCase from corehq.apps.groups.dbaccessors import group_by_domain from corehq.apps.groups.models import Group from corehq.apps.groups.tests.test_utils import delete_all_groups from corehq.apps.users.models import CommCareUser DOMAIN = 'test...
Python
0.999919
@@ -3523,16 +3523,77 @@ _users)%0A + self.assertNotIn(self.active_user._id, group1.users)%0A %0A%0Aclass
0f4cdfac4f245954341d7c9f9899bcf847fd3082
Update event_handler.py
bot/event_handler.py
bot/event_handler.py
import json import logging import re logger = logging.getLogger(__name__) class RtmEventHandler(object): def __init__(self, slack_clients, msg_writer): self.clients = slack_clients self.msg_writer = msg_writer def handle(self, event): if 'type' in event: self._handle_by_...
Python
0.000004
@@ -1252,17 +1252,16 @@ %0A - if (not
b91a571cd23adfb302a06f4ae05a1002e432d394
Update event_handler.py
bot/event_handler.py
bot/event_handler.py
import json import logging import re logger = logging.getLogger(__name__) def Split_CMD(SrcMessage): if (not SrcMessage.startswith('mcc')): return False if (SrcMessage.startswith('mcc?')): return {"cmd":"lst"} if (SrcMessage.startswith('mcc+')): return {"cmd":"add"} if (SrcMes...
Python
0.000004
@@ -2217,32 +2217,58 @@ son.dumps(event) ++'%5Cn'+json.dumps(self.log) )%0A
2a98ceb2a1a7e5819ed2e9c45fff87505215074a
add a 0 at the start to simplify case where there's a gene starting at bp 1.
subject_genes_from_query/subject_genes_from_query.py
subject_genes_from_query/subject_genes_from_query.py
""" no annotations for the subject, so the blast(z) is just query features against subject genomic sequence. we use the subject hits as the new features by: + overlapping subject hits are merged into single hsps + nearby subject hits to the same query are merge into single HSPs + no introns are recorded. b...
Python
0.000031
@@ -920,16 +920,20 @@ %5Bseqid%5D) + + 1 ,), dtyp @@ -944,16 +944,16 @@ .uint8)%0A - seqi @@ -1216,19 +1216,19 @@ tart - - 1 : sstop + + 1 %5D %7C= @@ -1820,20 +1820,16 @@ alocs%5B1%5D - - 1 : blocs%5B @@ -1830,16 +1830,20 @@ blocs%5B0%5D + + 1 %5D %7C= 1%0A%0A @@ -2175,16 +2175,52 @@ ends):%0A + ...
f683291c406d9ad9e1a331f4e01ade335d78193e
Set the DJANGO_HOSTNAME in the wsgi file based on the servername options
deployment/templates/deployment/wsgi.py
deployment/templates/deployment/wsgi.py
import os, sys sys.path = [ {% for part in sys.path %} "{{ part }}", {% endfor %} ] from django.core.handlers.wsgi import WSGIHandler #import pinax.env #setup the environment for Django and Pinax #pinax.env.setup_environ(__file__, settings_path=os.path.abspath(os.path.join() os.environ["DJANGO_SETTINGS_MODULE"] ...
Python
0
@@ -276,16 +276,127 @@ join()%0A%0A +%7B%25 if options.servername %25%7D%0Aos.environ%5B%22DJANGO_HOSTNAME%22%5D = %7B%7B options.servername %7D%7D.split('.')%5B0%5D%0A%7B%25 endif %25%7D%0A os.envir
3b215d10ea1697fd5d109170d832b415ec97e7ea
Handle missing `__version__` attr in tensorflow module
guild/commands/tensorflow_check_main.py
guild/commands/tensorflow_check_main.py
# Copyright 2017-2018 TensorHub, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
Python
0.000019
@@ -752,16 +752,82 @@ False%0A%0A +def _warn(msg):%0A return click.style(msg, fg=%22red%22, bold=True)%0A%0A def prin @@ -832,24 +832,24 @@ int_info():%0A - state = @@ -1182,16 +1182,23 @@ rsion(tf +, state ))%0A @@ -1469,36 +1469,155 @@ n(tf -):%0A return tf.__version__ +, state):%0A try:%0A...
010fa0987b5a94a916b642d84c5258a79ad5c5d7
Fix initialize_weights
openfisca_survey_manager/scenarios.py
openfisca_survey_manager/scenarios.py
# -*- coding: utf-8 -*- # OpenFisca -- A versatile microsimulation software # By: OpenFisca Team <contact@openfisca.fr> # # Copyright (C) 2011, 2012, 2013, 2014, 2015 OpenFisca Team # https://github.com/openfisca # # This file is part of OpenFisca. # # OpenFisca is free software; you can redistribute it and/or modify...
Python
0.000932
@@ -6120,32 +6120,116 @@ on = simulation%0A + if 'initialize_weights' in dir(self):%0A self.initialize_weights()%0A return s
77d4651231e6980ccc0b96109fc8033d277f5752
Update Place Model
Management/models.py
Management/models.py
from django.db import models class Place(models.Model): name = models.CharField(max_length=64) photo = models.CharField(max_length=512) latitude = models.FloatField(max_length=32) longitude = models.FloatField(max_length=32) phone = models.CharField(max_length=32) news = models.CharField(max_le...
Python
0
@@ -287,62 +287,160 @@ -news = models.CharField(max_length=512)%0A open_hours +open_hour = models.CharField(max_length=128)%0A category = models.CharField(max_length=512)%0A news = models.TextField(max_length=512)%0A description = m @@ -437,36 +437,36 @@ iption = models. -Char +Text Field(max_leng...
b641f6863cfc0779d598c903cda5479822cd5e82
Fix arwn platform to update hass state when events are received (#7202)
homeassistant/components/sensor/arwn.py
homeassistant/components/sensor/arwn.py
""" Support for collecting data from the ARWN project. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.arwn/ """ import asyncio import json import logging import homeassistant.components.mqtt as mqtt from homeassistant.core import callback from ho...
Python
0
@@ -3695,24 +3695,86 @@ pdate(event) +%0A self.hass.async_add_job(self.async_update_ha_state()) %0A%0A @prope
0c38ddef147d0600d73a351d59ec0f6c4194b7bd
Fix 500 Error in listing a421134621643366
openprocurement/planning/api/utils.py
openprocurement/planning/api/utils.py
# -*- coding: utf-8 -*- from functools import partial from json import dumps from logging import getLogger from time import sleep from urllib import quote from rfc6266 import build_header from urlparse import urlparse, parse_qs from base64 import b64encode from cornice.resource import resource from cornice.util import ...
Python
0
@@ -2282,16 +2282,54 @@ =False)%0A + plan.__parent__ = request.context%0A retu @@ -2336,16 +2336,25 @@ rn dict( +%0A %5B(i, j) @@ -2411,16 +2411,21 @@ fields%5D +%0A )%0A%0A%0Adef
f37b5d98bdf6b9f9507fe85f2dfb9c49a656729c
handle bad edrpou codes in OrgsDecoder
openprocurement/search/source/orgs.py
openprocurement/search/source/orgs.py
# -*- coding: utf-8 -*- import sqlite3 import os.path from munch import munchify from openprocurement.search.source import BaseSource from logging import getLogger logger = getLogger(__name__) class OrgsDecoder(object): def __init__(self, config={}): self.db_conn = None self.db_curs = None ...
Python
0.000002
@@ -766,32 +766,49 @@ return%0A + try:%0A if type( @@ -825,32 +825,36 @@ tr:%0A + code = str(code) @@ -846,32 +846,99 @@ ode = str(code)%0A + except (TypeError, UnicodeEncodeError):%0A return%0A while le
c1f5b9e3bfa96762fdbe9f4ca54b3851b38294da
Add versioned path for dynamic library lookup
test/__init__.py
test/__init__.py
import glob, os.path, sys # Add path to hiredis.so load path path = glob.glob("build/lib*/hiredis/*.so")[0] sys.path.insert(0, os.path.dirname(path)) from unittest import * from . import reader def tests(): suite = TestSuite() suite.addTest(makeSuite(reader.ReaderTest)) return suite
Python
0
@@ -20,16 +20,79 @@ h, sys%0A%0A +version = sys.version.split(%22 %22)%5B0%5D%0Amajorminor = version%5B0:3%5D%0A%0A # Add pa @@ -146,16 +146,19 @@ ild/lib* +-%25s /hiredis @@ -163,16 +163,29 @@ is/*.so%22 + %25 majorminor )%5B0%5D%0Asys
36c91b6f2f8c8c36cd1fed9c780b1f14ec7bc61b
Update MonitorCommand to get_config_option
Monitors/compound.py
Monitors/compound.py
# coding=utf-8 """compound checks (logical and of failure of multiple probes) for SimpleMonitor.""" from .monitor import Monitor class CompoundMonitor(Monitor): """Combine (logical-and) multiple failures for emergency escalation. Check most recent proble of provided monitors, if all are fail, then report fa...
Python
0.000001
@@ -448,32 +448,37 @@ ptions)%0A +self. monitors = %5B%5D%0A @@ -476,206 +476,156 @@ s = -%5B%5D%0A try:%0A monitors = %5Bele.strip() for ele in config_options%5B%22monitors%22%5D.split(%22,%22)%5D%0A except Exception:%0A raise RuntimeError(%22Required configuration fie...
9e80b368b01cb11a7ac0d97143ea69aa6dd2eef0
fix skipping tests on OSX
test/__init__.py
test/__init__.py
import errno import functools import socket from nose.plugins.skip import SkipTest from urllib3.exceptions import MaxRetryError from urllib3.packages import six def onlyPY3(test): """Skips this test unless you are on Python3.x""" @functools.wraps(test) def wrapper(*args, **kwargs): msg = "{name}...
Python
0.000002
@@ -600,11 +600,11 @@ urn -has +get attr @@ -620,34 +620,93 @@ rno' -) and err.errno == +, None) in (errno.ENETUNREACH,%0A errno.E NETU @@ -701,26 +701,27 @@ errno.E -NE +HOS TUNREACH %0A%0A @f @@ -712,16 +712,27 @@ TUNREACH +) # For OSX %0A%0A @f
599e30b90a9ede6b7201cf424c6fe02472c4908c
add flaky to another flaky test
tests/cli/test_show_chain_sync_progress_helper_fn.py
tests/cli/test_show_chain_sync_progress_helper_fn.py
import os import click import shutil from click.testing import CliRunner from populus.utils.networking import ( get_open_port, ) from populus.utils.transactions import ( wait_for_peers, wait_for_block_number, wait_for_syncing, ) from populus.utils.cli import ( show_chain_sync_progress, ) from popul...
Python
0.000003
@@ -65,16 +65,40 @@ liRunner +%0Afrom flaky import flaky %0A%0Afrom p @@ -365,16 +365,23 @@ oject%0A%0A%0A +@flaky%0A def test
4a854b68588cbc943fdf0145daa3552587894202
fix import for CentOS
cdr_stats/cdr/admin.py
cdr_stats/cdr/admin.py
from cdr.models import * from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django.db.models import Q from .models import Customer, Staff class UserProfileInline(admin.StackedInline): model = UserProfile class StaffAdmin(UserAdmin): ...
Python
0
@@ -179,16 +179,19 @@ Q%0Afrom +cdr .models
5eca767d63a726fc58b7ab0cd65ebcff472a1278
optimize Switch class
NooLite_F/Modules.py
NooLite_F/Modules.py
from NooLite_F import NooLiteFController, ModuleType, ModuleInfo, BrightnessDirection class Switch(object): _port: str _channel: int _module_type: ModuleType _broadcast_mode: bool _controller: NooLiteFController _module_id: int def __init__(self, controller: NooLiteFController, module_id...
Python
0
@@ -108,153 +108,8 @@ ):%0A%0A - _port: str%0A _channel: int%0A _module_type: ModuleType%0A _broadcast_mode: bool%0A _controller: NooLiteFController%0A _module_id: int%0A%0A
e8e14e04903b8e81782b0818a80fecb14bbd202c
update a test for HTCondorJobSubmitter
tests/unit/concurrently/test_HTCondorJobSubmitter.py
tests/unit/concurrently/test_HTCondorJobSubmitter.py
# Tai Sakuma <tai.sakuma@gmail.com> import os import sys import logging import textwrap import pytest try: import unittest.mock as mock except ImportError: import mock from alphatwirl.concurrently import HTCondorJobSubmitter ##__________________________________________________________________|| job_desc_tem...
Python
0
@@ -2144,31 +2144,8 @@ NING -, logger = 'alphatwirl' ):%0A
7ff95411cf999d074b7ae8496ea33f083ac78de6
Add test for push --ship command
test/app_test.py
test/app_test.py
import unittest from mock import patch, call, Mock from cctrl.error import InputErrorException from cctrl.app import AppController from cctrl.settings import Settings class AppControllerTestCase(unittest.TestCase): def test_get_size_from_memory_1gb(self): self.assertEqual(8, AppController(None, Settings(...
Python
0
@@ -1318,24 +1318,563 @@ xception))%0A%0A + @patch('cctrl.app.check_call')%0A def test_push_with_ship(self, check_call):%0A app = AppController(None, Settings())%0A app.redeploy = Mock()%0A app.log_from_now = Mock()%0A app._get_or_create_deployment = Mock(return_value=(%7B'branch': 'd...
ec94b6b15cabc3a190ec59ab822330d9410af56f
Update tag search
instagram_private_api/endpoints/tags.py
instagram_private_api/endpoints/tags.py
import json class TagsEndpointsMixin(object): """For endpoints in ``/tags/``.""" def tag_info(self, tag): """ Get tag info :param tag: :return: """ endpoint = 'tags/{tag!s}/info/'.format(**{'tag': tag}) res = self._call_api(endpoint) return res...
Python
0.000001
@@ -963,93 +963,94 @@ ' -is_typeahead': True,%0A 'q': text,%0A 'rank_token': self.rank_token +q': text,%0A 'timezone_offset': self.timezone_offset,%0A 'count': 30 ,%0A
f0b4d514e416f59cc4a8e91722d850c6c823d7d7
Modify import path.
django_fixmystreet/webhooks/outbound.py
django_fixmystreet/webhooks/outbound.py
# -*- coding: utf-8 -*- """ Outbound webhook handlers. """ import json import requests from datetime import datetime from .models import WebhookConfig from ..api.utils import dict_walk_python_to_json, dict_walk_json_to_python from ..fixmystreet.utils import sign_message class AbstractBaseOutWebhook(object): """ ...
Python
0
@@ -157,24 +157,35 @@ ..api.utils +.conversion import dict
cfe75f6a4dbbbc0ea80cf8a2b64aff646ceb8e55
Fix alaises overriding format detection.
django_imgix/templatetags/imgix_tags.py
django_imgix/templatetags/imgix_tags.py
__author__ = 'daniel.kirov' import re try: from urlparse import urlparse except ImportError: # Python 3 location from urllib.parse import urlparse from django.utils import six from django.template import TemplateSyntaxError from django.conf import settings from django.core.exceptions import ImproperlyConf...
Python
0.000001
@@ -4408,24 +4408,77 @@ age format.%0A +%0A arguments = get_kwargs(alias, aliases, kwargs)%0A%0A if forma @@ -4502,21 +4502,24 @@ not in -kw arg +ument s:%0A @@ -4571,21 +4571,24 @@ -kw arg +ument s%5B'fm'%5D @@ -4597,60 +4597,8 @@ fm%0A%0A - arguments = get_kwargs(alias, aliases, kw...
c536eb448051c78e3576814b8a7609a004712ed1
handle input of "geoids" where there are adjacent commas (blanks)
censusweb/api/views.py
censusweb/api/views.py
import simplejson from django.core.urlresolvers import reverse from django.http import HttpResponse, HttpResponsePermanentRedirect from django.shortcuts import render_to_response from django.template import RequestContext import csv import constants import help_text import mongoutils DATA_ALTERNATIVES = ['2000','201...
Python
0.000015
@@ -1090,38 +1090,95 @@ -for geoid - in geoids.split(',') +s_list = filter(lambda g: bool(g), geoids.split(','))%0A for geoid in geoids_list :%0A @@ -2891,38 +2891,95 @@ -for geoid - in geoids.split(',') +s_list = filter(lambda g: bool(g), geoids.split(','))%0A for geoid in geoids_list :%0A ...
ae9ba3c6bfdb5f9e47a16e8d8f8585d73fd2edce
format code
chapter5/blog/tests.py
chapter5/blog/tests.py
from datetime import datetime from django.core.urlresolvers import resolve from django.test import TestCase from blog.models import Blog from blog.views import blog_detail class BlogpostTest(TestCase): def test_blogpost_url_resolves_to_blog_post_view(self): found = resolve('/blog/this_is_a_test.html') ...
Python
0.000004
@@ -167,16 +167,17 @@ detail%0A%0A +%0A class Bl @@ -513,20 +513,16 @@ blog',%0A -
b03e993c8d9ecf344b3f05432b0c07ecaba6fe89
Fix pip example for latest CentOS 8 Docker image.
examples/pip.py
examples/pip.py
from pyinfra import host from pyinfra.operations import apk, apt, files, pip, python, yum SUDO = True if host.fact.linux_name in ['Alpine']: apk.packages( name='Install packages for python virtual environments', packages=[ 'gcc', 'libffi-dev', 'make', ...
Python
0
@@ -580,32 +580,33 @@ packages= +%5B 'python3-pip',%0A @@ -599,24 +599,61 @@ ython3-pip', + 'python3-devel', 'gcc-c++', 'make'%5D, %0A )%0A%0Aif h
361279fb6222ac15b9e0fef4ef82dfe46d93e1a9
Fix for integer division in py2
pocean/dsg/utils.py
pocean/dsg/utils.py
#!python # coding=utf-8 from datetime import datetime import pandas as pd from pocean.utils import ( get_default_axes, unique_justseen, ) from pocean import logger as L # noqa def get_geographic_attributes(df, axes=None): axes = get_default_axes(axes) miny = round(df[axes.y].min(), 5) maxy = r...
Python
0.000455
@@ -17,16 +17,48 @@ g=utf-8%0A +from __future__ import division%0A from dat
6a22a5c7429b66010eb023643d838c7f0beb31b8
use argparse for robust parsing
checkthat/checkthat.py
checkthat/checkthat.py
import datetime import os import sys import smtplib from .models import BuildFailure from .builders import PackageBuilder from .views import EmailView def gather_pkgbuild_paths(root_pkgs_dir): pkgbuild_paths = [] for root, dirs, files in os.walk(root_pkgs_dir): if 'PKGBUILD' in files: pk...
Python
0.000003
@@ -44,16 +44,32 @@ smtplib +%0Aimport argparse %0A%0Afrom . @@ -936,167 +936,205 @@ -if len(sys.argv) %3C 2:%0A print('Error: Missing path to directory containing AUR packages.')%0A print('Usage: python checkthat.py %3Cdir%3E')%0A quit +parser = argparse.ArgumentParser(description='An aut...
37e1397fd5c5a2bcd667f6d69011a889ea6cf974
set percent_complete to 0 in the initializer
builder/basebuilder.py
builder/basebuilder.py
# # Copyright (C) 2010 Red Hat, Inc. # # 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; version 2 of the License. # # This program is distributed in the hope that it will be useful, # but WITHOUT...
Python
0.00018
@@ -5209,28 +5209,25 @@ _complete = -None +0 %0A%09%09self.temp
8472bf91d802068bbcfb0beb566dd4d04c9f7ded
Make the handler docs more descriptive
cactusbot/handler.py
cactusbot/handler.py
"""Handle handlers.""" import logging from .packets import MessagePacket, Packet class Handlers(object): """Handles all the events For a function to have the ability to be used as an event handler, it must be prefixed with `on_`, and then followed by the event name. Parameters ---------- h...
Python
0.000258
@@ -113,30 +113,51 @@ %22%22%22 -Handles all the events +Evented controller for individual handlers. %0A%0A @@ -164,24 +164,22 @@ For a -function +method to have @@ -295,16 +295,386 @@ nt name. +%0A This method gets a single argument of packet.%0A%0A Packet can be the following types:%0A%0A =======...
fec2f62104a37f703341e4732e0a4f094f0d6750
Bump version
calliope/_version.py
calliope/_version.py
__version__ = '0.3.8-dev'
Python
0
@@ -14,11 +14,11 @@ '0. -3.8 +4.0 -dev
b5f796bcbdde1612eec45d16a2d0dd6a96c3e274
Remove Python 3 code
caniusepython3/pypi.py
caniusepython3/pypi.py
# Copyright 2014 Google Inc. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agre...
Python
0.999691
@@ -1989,791 +1989,8 @@ )%0A%0A%0A -def py3_classifiers():%0A %22%22%22Fetch the Python 3-related trove classifiers.%22%22%22%0A url = 'https://pypi.python.org/pypi?%253Aaction=list_classifiers'%0A response = urllib_request.urlopen(url)%0A try:%0A try:%0A status = response.status%0A ...
28c22e288d59ccc0e84b89f18ca4a46e5bf7f0af
update is_valid_player method, valid list check
powerball/player.py
powerball/player.py
#!/usr/bin/env python """ The Player class of the application represents the player of the game. """ class Player: def __init__(self, first_name = None, last_name = None, numbers = None): """ Initiate the player instance. The first name, last name and numbers can be provided as arguments...
Python
0.000018
@@ -6251,24 +6251,842 @@ turn False%0A%0A + else:%0A # check if all numbers are numeric.%0A for num in self.numbers:%0A if not isinstance(num, int):%0A return False%0A%0A white_balls = self.numbers%5B:5%5D%0A power_ball = self.numbers...
dafbfdfe29d0f872d9026162718406a05284de41
Version 26.0.0.
cantools/__init__.py
cantools/__init__.py
from __future__ import print_function import sys import argparse import re import binascii import struct from . import database from . import tester # Remove once less users are using the old package structure. from . import database as db __author__ = 'Erik Moqvist' __version__ = '25.3.0' # Matches 'candump' outp...
Python
0
@@ -284,11 +284,11 @@ = '2 -5.3 +6.0 .0'%0A
cc37b58a45bc634196f86acb62cbf5cecb68ab31
Allow a custom host, port and secure option to be passed to the connect event handler of circuits.web.client.Client
circuits/web/client.py
circuits/web/client.py
try: from urllib.parse import urlparse except ImportError: from urlparse import urlparse # NOQA from circuits.web.headers import Headers from circuits.core import handler, BaseComponent, Event from circuits.net.sockets import TCPClient, Connect, Write, Close from circuits.net.protocols.http import HTTP de...
Python
0
@@ -2047,123 +2047,140 @@ self -):%0A if not self._transport.connected:%0A self.fire(%0A Connect(self._host, self._port, +, host=None, port=None, secure=None):%0A host = host or self._host%0A port = port or self._port%0A secure = secure or sel @@ -2188,18 +2188,1...
34c71dc8914fe753010e94b0cb0779418846c99f
Use apt-get instead of aptitude
fabtools/deb.py
fabtools/deb.py
""" Fabric tools for managing Debian/Ubuntu packages """ from fabric.api import * def update_index(): """ Quietly update package index """ sudo("aptitude -q -q update") def upgrade(): """ Upgrade all packages """ sudo("aptitude --assume-yes safe-upgrade") def is_installed(pkg_name)...
Python
0
@@ -77,16 +77,38 @@ ort *%0A%0A%0A +MANAGER = 'apt-get'%0A%0A%0A def upda @@ -178,24 +178,18 @@ sudo(%22 -aptitude +%25s -q -q u @@ -194,16 +194,26 @@ update%22 + %25 MANAGER )%0A%0A%0Adef @@ -220,16 +220,25 @@ upgrade( +safe=True ):%0A %22 @@ -281,49 +281,246 @@ -sudo(%22aptitude --assume-yes saf...
b2e471813a27150b28071dc3caa4e4f3e41401c3
Remove dory reference
cdn/transport/app.py
cdn/transport/app.py
# Copyright (c) 2014 Rackspace, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wr...
Python
0
@@ -702,12 +702,11 @@ orn -dory +cdn .tra
3e30737c98a4a9e890d362ba4cbbb2315163bc29
Remove unused Python 2 support
cfgov/v1/__init__.py
cfgov/v1/__init__.py
from __future__ import absolute_import # Python 2 only from django.contrib.staticfiles.storage import staticfiles_storage from django.core.urlresolvers import reverse from django.template.defaultfilters import slugify from wagtail.wagtailcore.templatetags import wagtailcore_tags from wagtail.wagtailadmin.templatetags...
Python
0.000001
@@ -1,61 +1,4 @@ -from __future__ import absolute_import # Python 2 only%0A%0A from
4c3c6f6ab5de3520b407eaadb65b45558057f423
Use SystemRandom to generate 32-bit seed
Bedau/Evolution.py
Bedau/Evolution.py
from Bedau.World import World from Bedau.Agent import Agent from matplotlib import pyplot as plt from matplotlib import cm from matplotlib import animation from datetime import datetime as dt import numpy as np import math class Evolution(): def __init__(self, world_size, pop_size, mutation_rate, meta_mutation, m...
Python
0.000002
@@ -216,16 +216,30 @@ rt math%0A +import random%0A %0A%0Aclass @@ -1403,29 +1403,45 @@ d = -self.time.microsecond +random.SystemRandom().getrandbits(32) %0A
276360557024632c21dbadf369701d8ec44086fa
Change the HTTP to using aiohttp, so that we don't get that problem of the HTTP request using up too much time.
feed2discord.py
feed2discord.py
#!/usr/bin/python3 # We do the config stuff very first, so that we can pull debug from there import configparser import os config = configparser.ConfigParser() for inifile in [os.path.expanduser('~')+'/.feed2discord.ini','feed2discord.ini']: if os.path.isfile(inifile): config.read(inifile) break # First co...
Python
0
@@ -532,16 +532,31 @@ asyncio%0A +import aiohttp%0A import s @@ -1560,16 +1560,118 @@ _ready() +%0A # make sure debug output has this check run in the right order...%0A yield from asyncio.sleep(1) %0A%0A fe @@ -2117,32 +2117,152 @@ ng feed:'+feed)%0A + http_response = yield from aiohttp.request('GE...
edd72ea861bfc3b964f89fa7dd36493885709e67
Use split/join to work out selectof for ".." in directory listings.
cgod/plugins/core.py
cgod/plugins/core.py
# Plugin: core # Date: 20th December 2014 # Author: James Mills, prologic at shortcircuit dot net dot au """Core Plugin""" __version__ = "0.0.1" __author__ = "James Mills, prologic at shortcircuit dot net dot au" from uuid import uuid4 as uuid from pathlib import Path from circuits.io import File from ...
Python
0
@@ -2295,58 +2295,57 @@ r = -Path().joinpath(*path.parts%5B:-1%5D).relative_to(root +%22/%22.join(req.selector.rstrip(%22/%22).split(%22/%22)%5B:-1%5D )%0A
5050512db0d92ef16a60a2470e77681a732b355a
use the correct path
changelogs/parser.py
changelogs/parser.py
# -*- coding: utf-8 -*- import re from packaging.version import Version, InvalidVersion from gitchangelog.gitchangelog import changelog, GitRepos import subprocess import shutil INVALID_LINE_START = frozenset(["-", "*", " ", "\t", "<!--"]) INVALID_LINE_ENDS = frozenset(["."]) COMMON_RELEASE_INTRODUCTION = frozenset(["...
Python
0.000544
@@ -5417,19 +5417,20 @@ , %22-C%22, -dir +path , %22--no-
28e7f68022f17657f91ba30feffae49ddefe5227
Update version to 0.8.6
chatterbot/__init__.py
chatterbot/__init__.py
""" ChatterBot is a machine learning, conversational dialog engine. """ from .chatterbot import ChatBot __version__ = '0.8.5' __author__ = 'Gunther Cox' __email__ = 'gunthercx@gmail.com' __url__ = 'https://github.com/gunthercox/ChatterBot' __all__ = ( 'ChatBot', )
Python
0
@@ -121,9 +121,9 @@ 0.8. -5 +6 '%0A__
d1913910b669a6711e4a442b148904e38ea693c4
Version 0.4.4
chartflo/__init__.py
chartflo/__init__.py
__version__ = '0.4.3' default_app_config = 'chartflo.apps.ChartfloConfig'
Python
0.000001
@@ -16,9 +16,9 @@ 0.4. -3 +4 '%0Ade
cc4e644312cdf27b48dcff3ca8941e77638d508b
Add some test for '0050'. #9
test_unittest.py
test_unittest.py
# -*- coding: utf-8 -*- ''' Unittest ''' from datetime import datetime from types import BooleanType from types import NoneType import grs import unittest class TestGrs(unittest.TestCase): def get_data(self): self.stock_no = '2618' self.data = grs.Stock(self.stock_no) def test_stock(self): ...
Python
0.999996
@@ -2494,16 +2494,232 @@ , int)%0A%0A + @staticmethod%0A def test_taiwan_50():%0A stock = grs.Stock('0050')%0A assert u'%E5%8F%B0%E7%81%A350' == stock.info%5B1%5D%0A try:%0A stock = grs.Stock(0050)%0A except AssertionError:%0A pass%0A%0A if __nam
1e85a55402408a64cf196869b20bf4c40f875dbf
enable DEBUG, try to address a travis build error
tests/browser.py
tests/browser.py
import subprocess import mechanize import unittest import shutil import os from flask import Flask from flask.ext.testing import LiveServerTestCase from lwp.app import app from lwp.utils import connect_db class TestWebBrowser(LiveServerTestCase): """ These tests are made using a stateful programmatic we...
Python
0
@@ -659,16 +659,51 @@ db.sql'%0A + app.config%5B'DEBUG'%5D = True%0A
c8cedcbb8c4e0cb3f3c22dbece6176f11fc71952
Rename fname -> old_fname / fix retree error
FileTruck/FileTruck/projparse/retree.py
FileTruck/FileTruck/projparse/retree.py
#!/usr/bin/python import fileinput import sys import os import re import projparser class Unimplemented(Exception): pass def read_file(fname): return [line for line in fileinput.input([fname])] def write_file(fname, lines): with open(fname, 'w') as f: for line in lines: if len(line): f.write(line) def...
Python
0
@@ -2587,16 +2587,20 @@ %09%09quote( +old_ fname) + @@ -2713,16 +2713,20 @@ + %5C%0A%09%09%09%09 +old_ fname +
60841a854ded3de3fca3f4d345651eeee66dcdfa
Add large rasters support using rasterio decimating reads
projections/scripts/rview.py
projections/scripts/rview.py
#!/usr/bin/env python import click from copy import copy import rasterio from rasterio.plot import show import gdal import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import make_axes_locatable import pdb import projections.tiff_utils as tu def get_min_max(fname): ds = gdal.Open(fname) min, max = tu.g...
Python
0
@@ -51,16 +51,57 @@ rt copy%0A +import numpy as np%0Aimport numpy.ma as ma%0A import r @@ -138,16 +138,33 @@ ort show +, plotting_extent %0Aimport @@ -261,20 +261,8 @@ le%0A%0A -import pdb%0A%0A impo @@ -442,16 +442,436 @@ n, max%0A%0A +def too_big(src):%0A if src.height * src.width %3E 64%3C%3C20:%0A retur...
a2d3e7113dcda7c5f4ebaff96bdb9ac39ed434f9
fix import error
nipy/algorithms/registration/__init__.py
nipy/algorithms/registration/__init__.py
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from .resample import resample from .histogram_registration import (HistogramRegistration, clamp, ideal_spacing, interp_methods) from .affine import (threshold, rotation_...
Python
0.000001
@@ -832,16 +832,71 @@ lign4d,%0A + SpaceTimeRealign,%0A
e0d35cc18f2d19c92248fd29935d14d6b39facc3
Add blank line before for GAMESS-US
basis_set_exchange/writers/gamess_us.py
basis_set_exchange/writers/gamess_us.py
''' Conversion of basis sets to GAMESS-US ''' from .. import lut, manip, sort, printing def write_gamess_us_electron_basis(basis, electron_elements): # electronic part starts with $DATA s = '$DATA\n' for z in electron_elements: data = basis['elements'][z] el_name = lut.element_name_from...
Python
0.000757
@@ -1025,24 +1025,83 @@ nt_places)%0A%0A + # There must be a blank line before $END%0A s += %22%5Cn%22%0A s += %22$E
39e30520ce6c1cf01fc35f18f8b01f8668af55ed
add v2.4.1 (#22172)
var/spack/repos/builtin/packages/bpp-core/package.py
var/spack/repos/builtin/packages/bpp-core/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class BppCore(CMakePackage): """Bio++ core library.""" homepage = "http://biopp.univ-montp2...
Python
0
@@ -428,16 +428,112 @@ ar.gz%22%0A%0A + version('2.4.1', sha256='1150b8ced22cff23dd4770d7c23fad11239070b44007740e77407f0d746c0af6')%0A vers
8d052a48b2fc8dfe2110c006aec886b163ba9a55
fix python3 comp., metric ordering
loadimpactcli/metric_commands.py
loadimpactcli/metric_commands.py
# coding=utf-8 """ Copyright 2016 Load Impact 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 writi...
Python
0.000045
@@ -567,16 +567,48 @@ nse.%0A%22%22%22 +%0Afrom operator import attrgetter %0A%0Aimport @@ -1545,24 +1545,31 @@ esult_id in +sorted( result_ids:%0A @@ -1566,16 +1566,41 @@ sult_ids +, key=attrgetter('type')) :%0A @@ -1619,16 +1619,23 @@ y, _ in +sorted( result_i @@ -1644,19 +1644,16 @@ ids. -iter item...
153911fe79da7c008a2a5fa291e937d1fe14cff8
Fix visualization (analysis folder path)
circleseq/circleseq.py
circleseq/circleseq.py
""" circleseq.py as the wrapper for CIRCLE-seq analysis """ from alignReads import alignReads from visualization import visualizeOfftargets import argparse import os import sys import traceback import log import yaml import validation import findCleavageSites logger = log.createCustomLogger('root') class CircleSeq: ...
Python
0
@@ -2909,38 +2909,40 @@ .path.join(self. -output +analysis _folder, 'identi @@ -3037,14 +3037,16 @@ elf. -output +analysis _fol
ed050be8138c14428184cb99d19a3422ff2956fc
set version to 1.0.0
clair_cicd/__init__.py
clair_cicd/__init__.py
# # this is the package version number # __version__ = '0.6.0' # # a few different components in this project need to make # sure they use the same version of Clair and hence the # motivation for having __clair_version__ # # see https://quay.io/repository/coreos/clair?tab=tags # __clair_version__ = 'v2.1.2'
Python
0.000042
@@ -53,11 +53,11 @@ = ' -0.6 +1.0 .0'%0A
f2d1d08ac3c0437c1649af90d699dd5e283b0948
Add SK_IGNORE_UNDERLINE_POSITION_FIX to stage underline position fix.
public/blink_skia_config.gyp
public/blink_skia_config.gyp
# # Copyright (C) 2012 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions an...
Python
0.00029
@@ -2273,16 +2273,62 @@ IES=1',%0A + 'SK_IGNORE_UNDERLINE_POSITION_FIX',%0A
534d63dba727826ca8aab60fbacd545be1e53274
fix for win_rad different than 1
closed_form_matting.py
closed_form_matting.py
from __future__ import division import numpy as np import scipy.sparse from numpy.lib.stride_tricks import as_strided def rolling_block(A, block=(3, 3)): shape = (A.shape[0] - block[0] + 1, A.shape[1] - block[1] + 1) + block strides = (A.strides[0], A.strides[1]) + A.strides return as_strided(A, shape=sh...
Python
0.000001
@@ -554,36 +554,32 @@ h - +2* win_rad - - 1 , w - +2* win_rad - - 1 %0A
2d512994ff094d79f0b38f8f99a79dfa61875af3
use better arrow
ffmpeg/_view.py
ffmpeg/_view.py
from __future__ import unicode_literals from .dag import get_outgoing_edges from ._run import topo_sort import os import tempfile from ffmpeg.nodes import ( FilterNode, InputNode, OutputNode, Stream, stream_operator, ) def _get_node_color(node): if isinstance(node, InputNode): color ...
Python
0.00003
@@ -236,16 +236,42 @@ or,%0A)%0A%0A%0A +_RIGHT_ARROW = '%5Cu2192'%0A%0A%0A def _get @@ -2236,12 +2236,33 @@ = ' --%3E ' +%7B%7D '.format(_RIGHT_ARROW) %0A
f7cd2a6a70ac0eda24f57d328273b9ff146b4f4a
make this a bit more useable and interesting
Code/Demos/RDKit/MPI/rdkpympi.py
Code/Demos/RDKit/MPI/rdkpympi.py
# $Id$ # # Copyright (C) 2009 Greg Landrum # All rights reserved # # Demo for using boost.mpi with the RDKit # # run this with : mpirun -n 4 python rdkpympi.py # from boost import mpi from rdkit import Chem import sys if mpi.world.rank==0: data = [Chem.MolFromSmiles('C'*x) for x in range(1,100)] else: data=No...
Python
0.000625
@@ -205,123 +205,135 @@ hem%0A -import sys%0A%0Aif mpi.world.rank==0:%0A data = %5BChem.MolFromSmiles('C'*x) for x in range(1,100)%5D%0Aelse:%0A data=None%0A +from rdkit.Chem import AllChem%0Afrom rdkit.RDLogger import logger%0Alogger = logger()%0A%0Adef dividetask(data,task,silent=True):%0A data @@ -370,26...
49742e3e6e82a7bca8a1cfc4c8140e4b6025d44a
fix for non-bool masks
zplib/image/mask.py
zplib/image/mask.py
import numpy from scipy import ndimage def hysteresis_threshold(array, low_threshold, high_threshold, structure=None): """Create a mask that is True for regions in the input array which are entirely larger than low_threshold and which contain at least one element larger than high_threshold.""" high_mas...
Python
0.000002
@@ -1300,24 +1300,118 @@ ill them).%0A%0A + See also ndimage.binary_fill_holes if you want to fill all holes regardless%0A of size.%0A%0A Returns @@ -1445,32 +1445,61 @@ oles filled.%22%22%22%0A + mask = mask.astype(bool)%0A outside = nd @@ -4032,17 +4032,21 @@ enate((%5B -0 +False %5D, keep_ @@...
6ee172ec6a68e2562b89f5fa479a1c6b0726364d
use ChainMap API a bit more natuarally
filestore/fs.py
filestore/fs.py
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from pkg_resources import resource_filename from contextlib import contextmanager import json import logging from pymongo import MongoClient from bson import ObjectId import boltons.cacheutils fro...
Python
0
@@ -751,18 +751,86 @@ fallback -): +=None):%0A if fallback is None:%0A fallback = %7B%7D %0A @@ -1646,23 +1646,23 @@ hainMap( +m, self -, m )%0A%0A%0Aclas @@ -2393,16 +2393,26 @@ r_reg = +_ChainMap( handler_ @@ -2414,16 +2414,17 @@ dler_reg +) %0A%0A @@ -4161,49 +4161,4...
94a4d09c1a484602070b06760581ad02ee01639e
update link
octoprint_freemobilenotifier/__init__.py
octoprint_freemobilenotifier/__init__.py
# coding=utf-8 from __future__ import absolute_import import os import octoprint.plugin import urllib2 class FreemobilenotifierPlugin(octoprint.plugin.EventHandlerPlugin, octoprint.plugin.SettingsPlugin, octoprint.plugin.AssetPlugin, ...
Python
0
@@ -2033,33 +2033,33 @@ %09repo=%22OctoPrint -- +_ FreeMobile-Notif @@ -2169,17 +2169,17 @@ ctoPrint -- +_ FreeMobi
cb4b7ce7cbb9e7e951dacc5e4f38a31c045038cd
Fix ResourcePath ctor (to restore Python 2.7 compatibility) #473
office365/runtime/paths/resource_path.py
office365/runtime/paths/resource_path.py
from office365.runtime.client_path import ClientPath class ResourcePath(ClientPath): """OData resource path""" def __init__(self, name, parent=None): """ :param str name: entity or property name :type parent: office365.runtime.client_path.ClientPath or None """ super(...
Python
0
@@ -313,16 +313,34 @@ super( +ResourcePath, self ).__init
0cbbc0eac7ea87e6a7c2c92599ed9d37fd22a477
move some globals
oncogenesis_dynamics/python/constants.py
oncogenesis_dynamics/python/constants.py
Python
0.000025
@@ -0,0 +1,1035 @@ +%22%22%22%0AComments%0A- current implementation for bifurcation along VALID_BIFURCATION_PARAMS only%0A- no stability calculation implemented (see matlab code for that)%0A%0AConventions%0A- params is 7-vector of the form: params%5B0%5D -%3E alpha_plus%0A params%5B1%5D...
f20c0b650da2354f3008c7a0933eb32a1409fbf0
Add domain or and ilike
openacademy/model/openacademy_session.py
openacademy/model/openacademy_session.py
# -*- coding: utf-8 -*- from openerp import fields, models class Session(models.Model): _name = 'openacademy.session' name = fields.Char(required=True) start_date = fields.Date() duration = fields.Float(digits=(6, 2), help="Duration in days") seats = fields.Integer(string="Number of seats") in...
Python
0
@@ -377,16 +377,250 @@ tructor%22 +,%0A domain=%5B'%7C',%0A (%22instructor%22,%22=%22,True),%0A (%22category_id.name%22, %22ilike%22, %22Teacher%22)%0A %5D )%0A co
b9c83db0757dbb264c203bf8bd9299d83e984678
Fix bz2 tset.
tests/test_io.py
tests/test_io.py
__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2014, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/24/14' import unittest import os from io import open import bz2 from monty.io import reverse_readline, zopen, FileLock, FileLockE...
Python
0
@@ -2219,16 +2219,17 @@ lloWorld +. %22, lines
42ef885c1da9f181608bc5d1715d09837a06db62
Tag new release: 2.7.1
floo/version.py
floo/version.py
PLUGIN_VERSION = '2.7.0' # The line above is auto-generated by tag_release.py. Do not change it manually. try: from .common import shared as G assert G except ImportError: from common import shared as G G.__VERSION__ = '0.11' G.__PLUGIN_VERSION__ = PLUGIN_VERSION
Python
0
@@ -15,17 +15,17 @@ = '2.7. -0 +1 '%0A# The
2873f256de47ba860b6e89f21b719c691b5ad82b
Version update
flows/Global.py
flows/Global.py
#!/usr/bin/env python3 """Global.py - singleton and utility for Flows""" VERSION = '1.1' CONFIG_MANAGER = None LOGGER_INSTANCE = None LOGGER = None MESSAGE_DISPATCHER = None
Python
0
@@ -82,16 +82,18 @@ N = '1.1 +.1 '%0ACONFIG
da4a497e8cd73df40830388faedc589deff756c5
Refactor to use the validation API.
src/livestreamer/plugins/chaturbate.py
src/livestreamer/plugins/chaturbate.py
from livestreamer.exceptions import NoStreamsError from livestreamer.plugin import Plugin from livestreamer.stream import HLSStream from livestreamer.plugin.api import http import re class Chaturbate(Plugin): _reSrc = re.compile(r'html \+= \"src=\'([^\']+)\'\";') @classmethod def can_handle_url(self,...
Python
0
@@ -1,24 +1,35 @@ +import re%0A%0A from livestreamer.except @@ -26,40 +26,28 @@ mer. -exceptions import NoStreamsError +plugin import Plugin %0Afro @@ -63,32 +63,36 @@ eamer.plugin +.api import Plugin%0Afrom @@ -71,38 +71,46 @@ ugin.api import -Plugin +http, validate %0Afrom livestream @@ -140,97 +140,79 @@...
6288dac2fd91d41b27006ea7d546ed90a88e3b39
Fix inheritance error
pyconde/sponsorship/views.py
pyconde/sponsorship/views.py
# -*- encoding: utf-8 -*- from django.contrib import messages from django.http import HttpResponseRedirect from django.template.response import TemplateResponse from django.utils.translation import ugettext_lazy as _ from django.views import generic as generic_views from .forms import JobOfferForm from .models import...
Python
0.000519
@@ -764,24 +764,28 @@ eturn super( +Send JobOffer, se
410207e4c0a091e7b4eca9cedd08f381095f50a9
Revert "change from string to int"
pypeerassets/card_parsers.py
pypeerassets/card_parsers.py
'''parse cards according to deck issue mode''' from .pautils import exponent_to_amount def none_parser(cards): '''parser for NONE [0] issue mode''' return None def custom_parser(cards, parser=None): '''parser for CUSTOM [1] issue mode, please provide your custom parser as argument''' if not p...
Python
0
@@ -951,17 +951,22 @@ = %7B%0A -0 +'NONE' : none_p @@ -980,17 +980,22 @@ -1: custom +'CUSTOM': none _par @@ -1003,17 +1003,22 @@ er,%0A -2 +'ONCE' : once_p @@ -1028,17 +1028,23 @@ er,%0A -4 +'MULTI' : multi_ @@ -1055,17 +1055,22 @@ er,%0A -8 +'MONO' : mono_p @@ -1080,18 +1080,29 @@ er,%0...
a8f60a8aa1c8cbbf0d1384131854a422705e7c78
fix some small issues in catalog show
openstackclient/identity/v2_0/catalog.py
openstackclient/identity/v2_0/catalog.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 # distrib...
Python
0.001852
@@ -2677,80 +2677,29 @@ if ( -%0A 'name' in service and%0A service%5B +service.get( 'name' -%5D ! +) = = pa @@ -2720,50 +2720,15 @@ ice -and%0A +or%0A - 'type' in service and%0A @@ -2750,18 +2750,22 @@ vice -%5B +.get( 'type' -%5D ! +) = = pa @@ -2785,54 +278...
ad0608847e8eef659f57d580c3816af653275339
Fix paddle.init bug
python/paddle/v2/__init__.py
python/paddle/v2/__init__.py
# Copyright (c) 2016 PaddlePaddle 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 applic...
Python
0.000001
@@ -1628,22 +1628,25 @@ ey, str( -kw args +_dict %5Bkey%5D)))
e6c41bb3da85f02ddd791270ac20a0c2a7af00ee
Add code and xml filetypes for python
python/pysearch/filetypes.py
python/pysearch/filetypes.py
# -*- coding: utf-8 -*- ################################################################################ # # fileutil.py # # class FileUtil: provides utility functions for getting file extension and # determining file type # ###############################################################################...
Python
0
@@ -106,20 +106,21 @@ #%0A# file -util +types .py%0A#%0A# @@ -133,111 +133,13 @@ File -Util: provides utility functions for getting file extension and%0A# determining file type +Types %0A#%0A# @@ -459,19 +459,51 @@ -Text = 3 +Code = 3%0A Text = 4%0A Xml = 5 %0A%0A @@ -54...
d308e773cf01ce84b7c91e97fd905de2434e3516
fix typo
localized_fields/fields/field.py
localized_fields/fields/field.py
import json from typing import Union, List, Optional from django.conf import settings from django.db.utils import IntegrityError from psqlextra.fields import HStoreField from ..forms import LocalizedFieldForm from ..value import LocalizedValue from ..descriptor import LocalizedValueDescriptor class LocalizedField...
Python
0.999991
@@ -5679,17 +5679,18 @@ is allow -s +ed to be n
cf54719f3a383f836bb9e4671d8e36ca8ebc0baa
fix the error
cms/phpcms/__init__.py
cms/phpcms/__init__.py
KEYWORDS = ['huaficms', ] def rules(head='',context='',ip='',port='',productname={},keywords='',hackinfo=''): if 'huaficms' in context or 'huaficms' in head: return True else: return False
Python
0.000626
@@ -6,21 +6,19 @@ RDS = %5B' -huafi +php cms', %5D%0A @@ -108,21 +108,19 @@ %0A%0A%0A%09if ' -huafi +php cms' in @@ -135,13 +135,11 @@ or ' -huafi +php cms'
ea0a31ce5f273c193b23548064efb04a85af9ce6
Update hook-visvis.py
build_settings/win/hooks/hook-visvis.py
build_settings/win/hooks/hook-visvis.py
from PyInstaller.utils.hooks import collect_submodules, collect_data_files import visvis import visvis.core import visvis.processing hiddenimports = (collect_submodules('visvis.core') + collect_submodules('visvis.processing')) datas = collect_data_files('visvis', include_py_files=True)
Python
0
@@ -67,16 +67,58 @@ ta_files +%0Afrom visvis.freezeHelp import getIncludes %0A%0Aimport @@ -174,25 +174,111 @@ ng%0A%0A -hiddenimports = ( +modules = getIncludes('qt4')%0Ahiddenimports = tuple(%5Bcollect_submodules(module) for module in modules%5D+%5B coll @@ -310,28 +310,9 @@ re') - +%0A ++ coll...
23df013e1c20b10e6a90ff35cf47922181ab92ca
Update event_registration.py
campos_fee/models/event_registration.py
campos_fee/models/event_registration.py
# -*- coding: utf-8 -*- # Copyright 2017 Stein & Gabelgaard ApS # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from openerp import api, fields, models, SUPERUSER_ID, _ from openerp.addons.connector.queue.job import job, related_action from openerp.addons.connector.session import ConnectorSession fro...
Python
0.000014
@@ -2259,17 +2259,16 @@ curity() -: %0A
d765c5ad0c01d04382753a7bce532031b3fbe2d6
Fix 80 character limit in scheduler.
qonos/scheduler/scheduler.py
qonos/scheduler/scheduler.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Rackspace # # 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 # # ...
Python
0
@@ -2899,17 +2899,14 @@ -LOG.warn( +msg = _('S @@ -2951,16 +2951,49 @@ ected.') +%0A LOG.warn(msg )%0A%0A
032df1fe8649a622611e80e5e1efacdba4d7cafe
reorganize imports
cltk/tests/test_ner.py
cltk/tests/test_ner.py
"""Test cltk.ner.""" __author__ = 'Kyle P. Johnson <kyle@kyle-p-johnson.com>' __license__ = 'MIT License. See LICENSE.' from cltk.ner import ner from cltk.stem.latin.j_v import JVReplacer import os import unittest class TestSequenceFunctions(unittest.TestCase): # pylint: disable=R0904 """Class for unittest""" ...
Python
0.000519
@@ -15,16 +15,111 @@ er.%22%22%22%0A%0A +from cltk.ner import ner%0Afrom cltk.stem.latin.j_v import JVReplacer%0Aimport os%0Aimport unittest%0A%0A __author @@ -214,103 +214,8 @@ .'%0A%0A -from cltk.ner import ner%0Afrom cltk.stem.latin.j_v import JVReplacer%0Aimport os%0Aimport unittest%0A%0A %0Acla
f3786875336a72e124763b3fe1e07eff7f63cf99
Add new method to generate headers for csv report
edx_data_research/reporting/edx_base.py
edx_data_research/reporting/edx_base.py
import csv import os from pymongo import MongoClient class EdX(object): def __init__(self, args): self.uri = args.uri client = MongoClient(self.uri) self.db = client[args.db_name] self._collections = None self.output_directory = args.output_directory self.row_limi...
Python
0.000001
@@ -2464,8 +2464,132 @@ urn row%0A +%0A def anonymize_headers(self, headers):%0A return self.anonymize_row(%5B'Hash ID'%5D, %5B'User ID', 'Username'%5D, headers)%0A
91eeee8abbf516f00ce891076433c9222247bf67
Add display names to historical calendars.
qual/calendars/historical.py
qual/calendars/historical.py
from datetime import date from base import Calendar from date import InvalidDate from main import JulianCalendar class JulianToGregorianCalendar(Calendar): def date(self, year, month, day): gregorian_date = date(year, month, day) if gregorian_date < self.first_gregorian_day: julian_dat...
Python
0
@@ -738,32 +738,81 @@ orianCalendar):%0A + display_name = %22English Historical Calendar%22%0A first_gregor @@ -892,32 +892,81 @@ orianCalendar):%0A + display_name = %22Spanish Historical Calendar%22%0A first_gregor @@ -1050,24 +1050,72 @@ nCalendar):%0A + display_name = %22French Historical Calen...
8ca30840b5477239625c93f4799f266f0a971e3d
Add query to json output in json generation test
raco/datalog/datalog_test.py
raco/datalog/datalog_test.py
import unittest import json import raco.fakedb from raco import RACompiler from raco.language import MyriaAlgebra from myrialang import compile_to_json class DatalogTestCase(unittest.TestCase): def setUp(self): self.db = raco.fakedb.FakeDatabase() def execute_query(self, query): '''Run a te...
Python
0.000057
@@ -732,10 +732,13 @@ -%22%22 +query , dl
d35f997e3b11d943c006801d9446d1461c1393e5
Replace xrange -> range for py3 compatibility.
marvin/tests/test_movie_views.py
marvin/tests/test_movie_views.py
from marvin.models import Movie, Stream from marvin.tests import TestCaseWithTempDB from mock import Mock, patch import ujson as json import unittest class AllMovieViewTest(TestCaseWithTempDB): def setUp(self): avatar = Movie( title='Avatar', external_id='imdb:tt0499549', ...
Python
0
@@ -4734,17 +4734,16 @@ or i in -x range(16
1c8d3234a7fe8ab49729344d33df991f8cd382d6
Update docstrings.
pydov/util/query.py
pydov/util/query.py
# -*- coding: utf-8 -*- """Module containing extra query classes to build attribute search queries.""" from owslib.fes import ( Or, PropertyIsEqualTo, ) class PropertyInList(object): """Filter expression to test whether a given property has one of the values from a list. Internally translates to...
Python
0
@@ -930,26 +930,21 @@ ast -two distinct +a single item -s .%0A%0A @@ -1172,17 +1172,16 @@ contain -s at leas @@ -2816,28 +2816,31 @@ ast -two different +a single non-null value -s %0A @@ -2874,85 +2874,8 @@ umn. - A Join is probably overkill here,%0A use PropertyIsEqualTo instead. %0A%0A ...
84adbc29ec97491b881f6636f6d74b94032cdeb7
modify version code
pyelong/__init__.py
pyelong/__init__.py
# -*- coding: utf-8 -*- from client import Client from request import Request from response import Response __version__ = '0.3.5' __all__ = ('Client', 'Request', 'Response')
Python
0.000001
@@ -126,9 +126,9 @@ 0.3. -5 +6 '%0A%0A_
5ee6af80ce0906eb8a9cd5eb4e923931aae4d251
reset to commented out
TestingUserScript.py
TestingUserScript.py
""" Unit testing, of a sort, all the created methods/classes. """ import fmcapi import logging import unit_tests # ### Set these variables to match your environment. ### # host = '10.0.0.10' username = 'apiadmin' password = 'Admin123' autodeploy = False logname = 'TestingUserScript.log' pagelimit = 500 def main()...
Python
0
@@ -672,32 +672,68 @@ sion(fmc=fmc1)%0A%0A + '''%0A # Working Tests%0A unit_tes @@ -775,44 +775,8 @@ c1)%0A - '''%0A # Working Tests%0A
f443a8d254f58b0640d68a52185f83967a7ae7e5
add trigram
tools/prepare.py
tools/prepare.py
import numpy as np import hashing import conf embedding_dict = conf.senna_dict emb_vocab = conf.senna_vocab auto_encoder_dict = conf.auto_encoder_dict auto_vocab = conf.auto_vocab step_length = conf.step_length feature_length = conf.feature_length ALL_IOB = conf.ALL_IOB_encode NP_IOB = conf.NP_IOB_encode POS = co...
Python
0.999889
@@ -883,16 +883,38 @@ nce%5B1%5D)%0A + # for trigram%0A
1ad82b1f704ba88753cf750498cd7626f76d18e1
Make run-dev.py watch for template changes.
tools/run-dev.py
tools/run-dev.py
#!/usr/bin/env python import optparse import subprocess import signal import traceback import sys import os from twisted.internet import reactor from twisted.web import proxy, server, resource # Monkey-patch twisted.web.http to avoid request.finish exceptions # https://trac.zulip.net/ticket/1728 from twisted.web...
Python
0
@@ -1816,16 +1816,126 @@ repo')%0A%0A +# Watch for handlebars changes.%0Asubprocess.Popen('./tools/compile-handlebars-templates forever', shell=True)%0A%0A # Set up
6364217b2f88195fadc02b5a4de4a84be6a94fbc
add filter defaults
meinberlin/apps/budgeting/api.py
meinberlin/apps/budgeting/api.py
from django.utils.translation import gettext_lazy as _ from django_filters.rest_framework import DjangoFilterBackend from rest_framework import mixins from rest_framework import viewsets from rest_framework.filters import OrderingFilter from rest_framework.pagination import PageNumberPagination from adhocracy4.api.mix...
Python
0.000001
@@ -1668,16 +1668,52 @@ _choices +,%0A 'default': '-created', %0A @@ -1929,16 +1929,49 @@ %5D +,%0A 'default': 'false', %0A
5be30e21bc0c480e1fe8d209f39ee8e1f88eb343
version bump
pygmsh/__about__.py
pygmsh/__about__.py
# -*- coding: utf-8 -*- # __version__ = '3.0.6' __author__ = u'Nico Schlömer' __author_email__ = 'nico.schloemer@gmail.com' __website__ = 'https://github.com/nschloe/pygmsh' __license__='License :: OSI Approved :: MIT License' __status__='Development Status :: 4 - Beta'
Python
0.000001
@@ -43,9 +43,9 @@ 3.0. -6 +7 '%0A__
d3954a56d7e60c5cb180dc9127cfcda7fff98ba8
Update topgeo.py
topgeo/topgeo.py
topgeo/topgeo.py
# Calculo de Coordenadas (x,y,z) ## Profesor Revisor: ### Dr Ramon Solano Barajas ## Elaborado por: ### Jairo Avalos Velazquez ### Alan Mauricio Cruz Otero def calcoor(csv): """ Esta es una funcion para realizar el calculo de coordenadas en la biblioteca topgeo. """ # Agregar los modulos n...
Python
0
@@ -717,42 +717,15 @@ put( -%22Ingresar archivo CSV dist y ang:%22 +llamada ))%0A
99feb65afd3ab18791932b50aa11f76c8f45d5d8
use text() in XPath query
pygrabbit/parser.py
pygrabbit/parser.py
import requests from lxml import html from ._compat import urljoin from ._helpers import cached_attribute class PyGrabbit: headers = {'User-agent': 'PyGrabbit 0.1'} def __init__(self, url): self.url = url self._tree = None self._content = requests.get(url, headers=self.headers).text ...
Python
0.000083
@@ -825,98 +825,38 @@ -)%0A if text:%0A return text%5B0%5D.strip()%0A%0A res = self.select('//title' +'//title/text()',%0A )%0A @@ -864,19 +864,20 @@ if -res +text :%0A @@ -888,31 +888,28 @@ re -s = res%5B0%5D. +turn text +%5B0%5D .strip() %0A @@ -90...
b8f33283014854bfa2d92896e2061bf17de00836
Revert "Try not importing basal_area_increment to init"
pygypsy/__init__.py
pygypsy/__init__.py
"""pygypsy Based on Hueng et all (2009) Huang, S., Meng, S. X., & Yang, Y. (2009). A growth and yield projection system (GYPSY) for natural and post-harvest stands in Alberta. Forestry Division, Alberta Sustainable Resource Development, 25. Important Acronyms: aw = white aspen sb = black spruce sw = white spruce pl...
Python
0
@@ -544,16 +544,53 @@ rsions%0A%0A +import pygypsy.basal_area_increment%0A%0A __versio @@ -742,8 +742,45 @@ ('Agg')%0A +%0A__all__ = %5B'basal_area_increment'%5D%0A%0A
954e4882a496433162313110ac7f6bbe2b2eaaba
update version number
pyhard2/__init__.py
pyhard2/__init__.py
__version__ = u"0.9.8c alpha"
Python
0.000002
@@ -13,18 +13,16 @@ = u%22 -0.9.8c alph +1.0.0 bet a%22%0A
3d795fab1b11aee3778c6dfb19c530f6af8778b6
Remove logging configuration.
pyicloud/cmdline.py
pyicloud/cmdline.py
#! /usr/bin/env python # -*- coding: utf-8 -*- """ A Command Line Wrapper to allow easy use of pyicloud for command line scripts, and related. """ from __future__ import print_function import argparse import logging import pickle import sys import pyicloud DEVICE_ERROR = ( "Please use the --device switch to indi...
Python
0
@@ -198,23 +198,8 @@ rse%0A -import logging%0A impo @@ -3838,147 +3838,8 @@ ) -%0A parser.add_argument(%0A '--loglevel',%0A default='INFO',%0A help='Increase logging verbosity by specifying DEBUG'%0A ) %0A%0A @@ -4004,98 +4004,8 @@ ')%0A%0A - logging.basicConfig(%0A level=...