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 |
|---|---|---|---|---|---|---|---|
5a305a9063f20eacdcce255b650b0246286a54bc | add gender filter | gem/admin.py | gem/admin.py | from django.contrib import admin
from django.contrib.auth.models import User
from gem.models import GemUserProfile, GemCommentReport
from molo.commenting.admin import MoloCommentAdmin
from molo.commenting.models import MoloComment
from molo.profiles.admin import ProfileUserAdmin
from django.http import HttpResponse
imp... | Python | 0.000002 | @@ -2054,16 +2054,59 @@
csv_gem%5D
+%0A list_filter = ('gem_profile__gender',)
%0A%0A de
|
edb4bfb06882dfe4c9ec6690ab6825c802514981 | set svn:propset | psutil/error.py | psutil/error.py | # $Id$
# this exception get overriden by the platform specific modules if necessary
class Error(Exception):
pass
class NoSuchProcess(Error):
"""No process was found for the given parameters."""
def __init__(self, pid=None, msg=None):
self.pid = pid
self.msg = msg
def __str__(self):
... | Python | 0.000001 | @@ -1,14 +1,13 @@
# $Id
-$
%0A%0A# this
|
dadc3e711ef7f8cae9fdb7ffc03096f85ea2fe3a | fix counter | bin/md5_to_annotation.py | bin/md5_to_annotation.py | #!/usr/bin/env python
import os
import re
import sys
import time
import json
import bsddb
import logging
from collections import defaultdict
from optparse import OptionParser
TYPES = ['function', 'organism', 'ontology']
TAXA = ['domain', 'phylum', 'class', 'order', 'family', 'genus', 'species']
SKIP_RE = re.compile(... | Python | 0.000003 | @@ -4123,24 +4123,109 @@
t(parts%5B1%5D)%0A
+ if md5 not in m5nr_map:%0A continue%0A has_ann = 0%0A
@@ -4257,16 +4257,16 @@
p%5Bmd5%5D)%0A
-
@@ -4290,35 +4290,8 @@
ta:%0A
- found += 1%0A
@@ -4433,32 +4433,68 @@
put%5Bf%5D += abund%0A
... |
b94108b60bcb383e41137a2325f553092a06cfb0 | create Unread entries for subscriptions | chukchi/feed/parse.py | chukchi/feed/parse.py | # This file is part of Chukchi, the free web-based RSS aggregator
#
# Copyright (C) 2013 Edward Toroshchin <chukchi-project@hades.name>
#
# Chukchi 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, eith... | Python | 0 | @@ -884,16 +884,38 @@
d, Entry
+, Subscription, Unread
%0Afrom ..
@@ -2716,16 +2716,41 @@
y = None
+%0A new_entry = True
%0A%0A
@@ -3117,24 +3117,54 @@
(feed=feed)%0A
+ new_entry = False%0A
entr
@@ -3540,16 +3540,16 @@
umps(e)%0A
-
@@ -3563,16 +3563,258 @@
entry)%0A%0A
... |
211a22072444a9fb6b79e1928149dfcd7dff5e75 | Fix minor bugs | bin/perceptron-tagger.py | bin/perceptron-tagger.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import itertools as it
import operator as op
import pickle
import sys
from mmb_perceptron.dict_impl import CombinatorialPerceptron
from mmb_perceptron.feature_extractor import \
Honnibal, Ratnaparkhi, Char
from mmb_perceptron.helper.pos_tagging import \
... | Python | 0.000007 | @@ -2134,16 +2134,17 @@
print(
+u
%22%7B0%7D%5Ct%7B1
@@ -2159,16 +2159,21 @@
t(word,
+pred_
tag).enc
@@ -2498,16 +2498,22 @@
_count,
+(float
(correct
@@ -2518,16 +2518,17 @@
ct_count
+)
/tag_cou
|
c7183a2583581ab50654debbcf480af9ee739003 | print dates in right timezone | get_users.py | get_users.py | import twitter
import load_passwords
import csv
import os.path
import sys
import pytz
from datetime import datetime, timedelta
config = load_passwords.load()
api = twitter.Api(consumer_key=config["consumer_key"],
consumer_secret=config["consumer_secret"],
access_token_key=config["acces... | Python | 0.000622 | @@ -3273,16 +3273,137 @@
(user)%0A%0A
+def printDate(date):%0A date_in_tz = date.astimezone(timezone)%0A return datetime.strftime(date, %22%25Y-%25m-%25d %25H:%25M:%25S%22)%0A%0A
with ope
@@ -3990,16 +3990,26 @@
eet.id,
+printDate(
tweet.cr
@@ -4025,19 +4025,8 @@
date
-.isoformat(
), t
|
fe14d3cf63216194c4be908e6b90dac45a15eba6 | Validate database checks before running migration | bin/validate_database.py | bin/validate_database.py | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Validate audit relationships in a db.
To manually specify a db just export GGRC_DATABASE_URI
Example:
GGRC_DATABASE_URI="mysql+mysqldb://root:root@localhost/ggrcdev?charset=utf8"
"""
# disable Invalid ... | Python | 0.000001 | @@ -1817,16 +1817,419 @@
return%0A%0A
+ assessment_template_validation = (%0A validation.validate_assessment_templates(db.session))%0A%0A assessment_relationships_validation = (%0A validation.validate_assessment_relationships(db.session))%0A%0A request_relationships_validation = (%0A validation.valid... |
e7c1b294f5c3fb825a301e89365de7f19b3ddf3b | Add config file reading | publish_plot.py | publish_plot.py | #!/usr/bin/env python
import os
import json
def loadDiv(filename):
if not os.path.exists(filename):
raise RuntimeError('\'%s\' does not exist' % filename)
print 'loading \'%s\'' % filename
with file(filename, 'r') as handle:
div = handle.read()
return div
def getURL(instrument, run_nu... | Python | 0.000001 | @@ -26,23 +26,1469 @@
ort
-os%0Aimport json%0A
+json%0Aimport os%0A%0ACONFIG_FILE = '/etc/autoreduce/post_processing.conf'%0A%0Aclass Configuration(object):%0A %22%22%22%0A Read and process configuration file and provide an easy way to create a configured Client object%0A %22%22%22%0A def __init__(self, c... |
0cf98e85951ac8f0b5f2930257546e63bdd39403 | optimize out one SQL command. | bin/workflow/instance.py | bin/workflow/instance.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
#... | Python | 0.000004 | @@ -1115,94 +1115,8 @@
ent%0A
- cr.execute(%22select nextval('wkf_instance_id_seq')%22)%0A id_new = cr.fetchone()%5B0%5D%0A
@@ -1153,19 +1153,16 @@
stance (
-id,
res_type
@@ -1204,23 +1204,26 @@
s,%25s
-,%25s)', (id_new,
+) RETURNING id', (
res_
@@ -1247,16 +1247,46 @@
kf_id))%0A
+ id_new = cr.fetc... |
159427d6b71dc3706c9957e502d134d237d7d1fd | Use assertEqual instead of assertEquals for Python 3.11 compatibility. | py/unittests.py | py/unittests.py | """
Aho-Corasick string search algorithm.
Author : Wojciech Muła, wojciech_mula@poczta.onet.pl
WWW : http://0x80.pl
License : public domain
"""
import unittest
from pyahocorasick import Trie
class TestTrie(unittest.TestCase):
def testEmptyTrieShouldNotContainsAnyWords(self):
t = Trie()
self.asser... | Python | 0 | @@ -2096,33 +2096,32 @@
self.assertEqual
-s
(len(result), 5)
@@ -2113,32 +2113,32 @@
len(result), 5)%0A
+
%09%09self.assertIn(
@@ -2552,33 +2552,32 @@
self.assertEqual
-s
(len(result), 5)
@@ -2984,33 +2984,32 @@
self.assertEqual
-s
(len(result), 5)
@@ -3863,17 +3863,16 @@
ertEqual
-s
(len(res
@@ -4641,16 +464... |
9dae6f19f7dfac190142ca642ea49ea9933635be | debug mode returns existing object for local dupes | address_deduper/views/address.py | address_deduper/views/address.py | from address_deduper.views.base import *
from address_normalizer.deduping.near_duplicates import *
from address_normalizer.models.address import *
class AddressView(BaseView):
blueprint = Blueprint('addresses', __name__, url_prefix='/addresses')
@classmethod
def address_from_params(cls, require_str... | Python | 0 | @@ -3196,16 +3196,66 @@
d=True)%0A
+ obj_dict = %7Ba.guid: a for a in addresses%7D%0A
@@ -3463,16 +3463,68 @@
resses =
+ %7Bguid: a if not a else json.loads(a) for guid, a in
Address
@@ -3555,16 +3555,29 @@
t(guids)
+.iteritems()%7D
%0A
@@ -3634,50 +3634,49 @@
-existing_address = exi... |
963c20215eee3a679e288b9cb28715a33f8d58ae | Add support for interpolation to html parser | angular_gettext_babel/extract.py | angular_gettext_babel/extract.py | # Copyright 2015, Rackspace, US, 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 | @@ -978,16 +978,42 @@
ata = ''
+%0A self.strings = %5B%5D
%0A%0A de
@@ -1061,190 +1061,17 @@
-print(%22Encounterd a start_tag:%22, tag, attrs, self.getpos())%0A self.in_translate = False%0A self.data = ''%0A if attrs:%0A print (%5Battr%5B0%5D for attr in attrs%5D)
+if a... |
311c8db11c984cc9a8ed21ae42b85b1d5a8cdc59 | index views | src/fo2/views/views.py | src/fo2/views/views.py | from pprint import pprint
from django.contrib.auth import logout
from django.contrib.auth.models import User
from django.http import HttpResponse, JsonResponse
from django.shortcuts import redirect, render
from django.utils import timezone
from django.views.generic import TemplateView, View
from base.models import Co... | Python | 0 | @@ -486,16 +486,23 @@
f index_
+tussor_
view(req
@@ -570,24 +570,120 @@
_ao_erp')%0A%0A%0A
+def index_agator_view(request):%0A fo2logger.info('index')%0A return HttpResponse(%22Agator%22)%0A%0A%0A
def test_vie
|
dab70bdcaef0a0ae15cf82d8f8f15698f52b5116 | Revise load_schedule function - avoid loading other data when schedule has no section. | myuw_mobile/views/api/base_schedule.py | myuw_mobile/views/api/base_schedule.py | from django.http import HttpResponse
import logging
from operator import itemgetter
from django.utils import simplejson as json
from myuw_mobile.dao.building import get_buildings_by_schedule
from myuw_mobile.dao.canvas import get_canvas_enrolled_courses
from myuw_mobile.dao.course_color import get_colors_by_schedule
fr... | Python | 0 | @@ -1748,16 +1748,161 @@
rm=%22%22):%0A
+ json_data = schedule.json_data()%0A json_data%5B%22summer_term%22%5D=summer_term%0A %0A if len(schedule.sections) == 0:%0A return json_data%0A%0A
filt
@@ -1960,16 +1960,24 @@
r_term)%0A
+
%0A col
@@ -2309,50 +2309,8 @@
ata%0A
- json_dat... |
e7d93e2d5b43eb486c76a26fbf4a26134f20e1d8 | Fix to-string method for Passage | src/general_classes.py | src/general_classes.py | # LING 573 Question Answering System
# Code last updated 4/22/14 by Andrea Kahn
#
# This code holds classes that need to be accessed by various parts of the system.
from collections import defaultdict
# A Question object has the attributes id (a float corresponding to the TREC question ID),
# type (a string corresp... | Python | 0.999999 | @@ -4401,36 +4401,31 @@
%25s%22 %25 (self.
-search_terms
+passage
, self.weigh
|
3b8fdf4eaaa3262147a61fa1f2e6debb22ed0cf1 | Add missing resource discriminator in update resp | neutron/pecan_wsgi/controllers/root.py | neutron/pecan_wsgi/controllers/root.py | # Copyright (c) 2015 Mirantis, Inc.
# Copyright (c) 2015 Rackspace, 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/lice... | Python | 0.000004 | @@ -5361,16 +5361,61 @@
urn
-updater(
+%7Brequest.resource_type: updater(%0A
requ
@@ -5460,16 +5460,17 @@
ed_data)
+%7D
%0A%0A @w
|
f24b80a7f8804560c8703da4e31321411b609611 | Bump to 0.7.0 and add Python 3 classifiers | python/setup.py | python/setup.py | import io
import os
from setuptools import setup, find_packages
__version__ = "0.6.0"
def read_from(file):
reply = []
with io.open(os.path.join(here, file), encoding='utf8') as f:
for l in f:
l = l.strip()
if not l:
break
if l[0] != '#' or l[:2] !=... | Python | 0.000007 | @@ -80,9 +80,9 @@
%220.
-6
+7
.0%22%0A
@@ -839,17 +839,17 @@
-'
+%22
Programm
@@ -870,17 +870,17 @@
: Python
-'
+%22
,%0A
@@ -927,24 +927,24 @@
thon :: 2%22,%0A
-
@@ -989,16 +989,135 @@
:: 2.7%22
+,%0A %22Programming Language :: Python :: 3%22,%0A ... |
edd74c12aa04e9d28fbcea9d8df21885abeab890 | Add a #! thingy and make executable. This is easier for me to get the right Python (i.e. not Cygwin) to execute the script on Windows. | python/setup.py | python/setup.py | # The contents of this file are subject to the MonetDB Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html
#
# Software distributed under the License is distributed ... | Python | 0 | @@ -1,12 +1,35 @@
+#!/usr/bin/env python%0A%0A
# The conten
|
a624b05f20d2a05bb131698381bd6cc16e186547 | update compcor import | nipype/workflows/rsfmri/fsl/resting.py | nipype/workflows/rsfmri/fsl/resting.py | # -*- coding: utf-8 -*-
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
from __future__ import print_function, division, unicode_literals, absolute_import
from builtins import str
from ....interfaces import fsl as fsl # fsl
from ....interfaces ... | Python | 0 | @@ -485,19 +485,15 @@
t co
-mpcor as cc
+nfounds
%0A%0Ade
@@ -4542,17 +4542,24 @@
e.Node(c
-c
+onfounds
.ACompCo
|
2a6a482dd27c1dd2580648bef5826f46d1758463 | Add ClientDeleteView | app/user_administration/views.py | app/user_administration/views.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.views.generic import TemplateView, CreateView, ListView, DetailView, UpdateView
import logging
from django.contrib.auth.decorators import login_required
from django.utils.decorators import method_decorator
from .models import Clients
from .form... | Python | 0.000001 | @@ -148,16 +148,28 @@
dateView
+, DeleteView
%0Aimport
@@ -469,16 +469,95 @@
edirect%0A
+from django.http.response import HttpResponseNotAllowed, HttpResponseForbidden%0A
%0A%0Alogger
@@ -3181,8 +3181,739 @@
': pk%7D)%0A
+%0A%0Aclass ClientDeleteView(DeleteView):%0A model = Clients%0A success_url = reverse_... |
d1328724ca6da92002bf2d6b1487853bd23d6085 | Add PyPI metadata | python/setup.py | python/setup.py | from __future__ import unicode_literals
import os
import re
import subprocess
import sys
import warnings
import setuptools
import setuptools.command.build_py
import wheel.bdist_wheel
from opencc import _libopenccfile
_clib_dir = os.path.join('opencc', 'clib')
_opencc_rootdir = '..'
_cmake_file = os.path.join(_open... | Python | 0.000001 | @@ -6063,16 +6063,121 @@
earch',%0A
+ 'Natural Language :: Chinese (Simplified)',%0A 'Natural Language :: Chinese (Traditional)',%0A
@@ -6629,24 +6629,74 @@
alization',%0A
+ 'Topic :: Text Processing :: Linguistic',%0A
%5D,%0A l
|
592509d0a4d756f134ed154f976611c7c02bad91 | Change how the file upload works again | cloudmanager/board.py | cloudmanager/board.py | import hashlib
import logging
import os
import sys
import time
from .utility import connect_to_redis, header
LOG = logging.getLogger(__name__)
class MicropythonBoard(object):
name = None
platform = None
def __init__(self, name=None):
self.name = name
self.redis_db = connect_to_redis()
... | Python | 0 | @@ -3868,28 +3868,24 @@
while rc is
-not
None:%0A
|
76f7af7312143bc9003d8bb1294c2910cc7768dc | Remove errant space in test | normandy/recipes/tests/test_filters.py | normandy/recipes/tests/test_filters.py | import pytest
from normandy.recipes.filters import (
BucketSampleFilter,
ChannelFilter,
CountryFilter,
LocaleFilter,
StableSampleFilter,
VersionFilter,
VersionRangeFilter,
DateRangeFilter,
ProfileCreateDateFilter,
)
from normandy.recipes.tests import ChannelFactory, LocaleFactory, C... | Python | 0.000013 | @@ -1958,17 +1958,16 @@
02-01%22)%0A
-%0A
|
10d44db0dddb6a1337b50954565fe01db6b061bc | Fix tests | oauthenticator/tests/test_mediawiki.py | oauthenticator/tests/test_mediawiki.py | import json
import re
import time
from unittest.mock import Mock
from pytest import fixture, mark
from tornado import web
import requests_mock
from ..mediawiki import MWOAuthenticator, AUTH_REQUEST_COOKIE_NAME
from .mocks import mock_handler
import jwt
MW_URL = 'https://meta.wikimedia.org/w/index.php'
@fixture
def... | Python | 0 | @@ -1849,16 +1849,22 @@
(handler
+, None
)%0A as
|
a1dcfe6eb0b6dba61fb45d8bdba3640b4c862951 | include url in httpclient payload dump and add sanity check for http url as well | opennsa/protocols/shared/httpclient.py | opennsa/protocols/shared/httpclient.py | """
A nice handy HTTP client.
Author: Henrik Thostrup Jensen <htj@nordu.net>
Copyright: NORDUnet (2011-2012)
"""
from twisted.python import log
from twisted.internet import reactor, defer
from twisted.web import client as twclient
from twisted.web.error import Error as WebError
from twisted.internet.error import Conn... | Python | 0 | @@ -1333,24 +1333,167 @@
er.fail(e)%0A%0A
+ if not url.startswith('http'):%0A e = HTTPRequestError('URL does not start with http (URL %25s)' %25 (url))%0A return defer.fail(e)%0A%0A
log.msg(
@@ -1513,16 +1513,22 @@
Payload
+to %25s
--%5Cn%25s%5Cn
@@ -1557,24 +1557,30 @@
ad --%22 %25
+ (url,
... |
fbc792c27590830242babb69ba6134854b54f7c6 | call LDIF.__bases__ setUp as well | src/bda/ldap/main.py | src/bda/ldap/main.py | import os
import sys
import tempfile
from bda.ldap import testing
def user_home():
# XXX: unix only ATM
return os.getenv('HOME')
def env_path():
return os.path.join(user_home(), '.bda.ldap.testldap.env')
def ldif_path():
return os.path.join(user_home(), '.bda.ldap.testldap.ldif')
def mk_tmp():
t... | Python | 0.000001 | @@ -984,32 +984,50 @@
yer.defaultBases
+ + layer.__bases__
:%0A for su
|
9d8a299db591fadd729fc4ec78a1de1fe2cca869 | Fix delete_selected KeyError in locations admin | src/locations/admin.py | src/locations/admin.py | from django.contrib import admin
from django.db.models import F, Sum, IntegerField
from django.utils.translation import ugettext_lazy as _
import nested_admin
from .models import District, Location
from campaigns.models import CampaignLocationShift
from coordinators.models import filter_by_district
from campaigns.ad... | Python | 0.000001 | @@ -2179,32 +2179,77 @@
ctions(request)%0A
+ if 'delete_selected' in actions:%0A
del acti
|
c321337ae988c3da959aeca7eea9e4e794b888de | Update SupremeVacancies.py | _includes/SupremeVacancies.py | _includes/SupremeVacancies.py | from random import randint,uniform
num_reps = 1000000
accum = 0
num_vacancies = 0
duration_accum = 0
# A running list of the vacant seats
Vacancies = [0,1,2,3,4,5,6,7,8]
# A list of the times justices in the 9 seats are due to retire
# or die yes I went there. We use num_reps as a dummy value to
# start.
Expiration... | Python | 0 | @@ -2512,16 +2512,32 @@
t(0,1)%0A%0A
+%09if SameParty:%0A%09
%09# Fill
@@ -2548,31 +2548,16 @@
y seats%0A
-%09if SameParty:%0A
%09%09for i
|
3bc097096c97fbf8936bea9c61f55c67cb0dd34e | Update cnn_functions.py | src/cnn_functions.py | src/cnn_functions.py | import numpy as np
import tensorflow as tf
# Weight variable
def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1)
return tf.Variable(initial)
# Bias variable
def bias_variable(shape):
initial = tf.constant(0.1, shape=shape)
return tf.Variable(initial)
# These two for the basis for most... | Python | 0.000002 | @@ -842,28 +842,9 @@
%0A%0A#
-I am lazy so I put e
+E
very
@@ -853,12 +853,12 @@
ing
-I
ne
+ed
ed f
|
85264809758c173280ffd0e2fbc0978b66c59f57 | Fix mod_wsgi queue time stats. | src/encoded/stats.py | src/encoded/stats.py | import pyramid.tweens
import time
from pyramid.settings import asbool
from pyramid.threadlocal import manager as threadlocal_manager
from sqlalchemy import event
from sqlalchemy.engine import Engine
from urllib import urlencode
def includeme(config):
config.add_tween('.stats.stats_tween_factory',
under=py... | Python | 0 | @@ -2293,33 +2293,25 @@
stats
-.append((
+%5B
'queue_begin
@@ -2311,17 +2311,19 @@
e_begin'
-,
+%5D =
queue_b
@@ -2326,18 +2326,16 @@
ue_begin
-))
%0A
@@ -2348,17 +2348,9 @@
tats
-.append((
+%5B
'que
@@ -2357,17 +2357,19 @@
ue_time'
-,
+%5D =
begin -
@@ -2380,18 +2380,16 @@
ue_begin
-))
%0A%... |
99d8f63a01543d094683ce440d82d72b7e448e98 | convert some ab fields to str for Py2 | abstar/tests/test_junction.py | abstar/tests/test_junction.py | #!usr/env/python
# filename: test_junction.py
import sys
from . import REFERENCE_BNAB_HC_ANTIBODIES, REFERENCE_BNAB_LC_ANTIBODIES
from ..utils.junction import get_junction
if sys.version_info[0] > 2:
STR = str
else:
STR = basestring
def test_junction_bnab_hcs():
compare_junction_to_reference(REFERENCE_... | Python | 0.002842 | @@ -722,32 +722,347 @@
t_nt_positions%5D%0A
+ if sys.version_info%5B0%5D == 2:%0A ab.oriented_input = ab.oriented_input.encode('ascii')%0A ab.v.imgt_germline.gapped_nt_sequence = ab.v.imgt_germline.gapped_nt_sequence.encode('ascii')%0A ab.j.imgt_germline.gapped_nt_sequence = ab.... |
ca962b6994314ac3d3a5a5bcbf9044d52cd88ad9 | Remove unnecessary TODO | adhocracy4/actions/signals.py | adhocracy4/actions/signals.py | from itertools import chain
from django.apps import apps
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from django.db.models.signals import post_delete, post_save
from .models import Action
from .verbs import Verbs
# Actions resulting from the create_system_actions manage... | Python | 0.000154 | @@ -1105,43 +1105,8 @@
)%0A%0A
- # TODO: this could be extended%0A
|
fade900a94404774fcae71596bfbb44bfb04eae1 | add some error handling for initial slide | adhocracy4/projects/mixins.py | adhocracy4/projects/mixins.py | from django.http import Http404
from django.http.response import HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.urls import resolve
from django.utils.functional import cached_property
from django.views import generic
from adhocracy4.modules.models import Module
from adhocracy4.projects... | Python | 0 | @@ -4866,16 +4866,127 @@
_slide:%0A
+ initial_slide = ''.join(i for i in initial_slide if i.isdigit())%0A if initial_slide:%0A
|
0ca81fe4c370aa5f3ce953b03a35fe35da562ec8 | copy headers before modify | aioworkers/net/web/request.py | aioworkers/net/web/request.py | from typing import (
TYPE_CHECKING,
Any,
Awaitable,
Callable,
List,
Mapping,
Optional,
Tuple,
)
from urllib.parse import SplitResult
from aioworkers.core.context import Context
from aioworkers.core.formatter import registry
from aioworkers.utils import cached_property
from ..uri import... | Python | 0 | @@ -2195,16 +2195,66 @@
ers = %5B%5D
+%0A else:%0A headers = list(headers)
%0A%0A
|
abd428583d73d7c34025ab28428922473de219d3 | Improve sanitize_html test | aleph/tests/test_view_util.py | aleph/tests/test_view_util.py | from aleph.views.util import get_best_next_url, sanitize_html
from aleph.tests.util import TestCase, UI_URL
class ViewUtilTest(TestCase):
def setUp(self):
super(ViewUtilTest, self).setUp()
def test_get_best_next_url_blank(self):
self.assertEqual(UI_URL, get_best_next_url(''))
def test_g... | Python | 0.000002 | @@ -1,16 +1,59 @@
+from lxml.html import document_fromstring%0A%0A
from aleph.views
@@ -98,16 +98,16 @@
ze_html%0A
-
from ale
@@ -806,16 +806,20 @@
html
+_str
= '%3C!do
@@ -1395,413 +1395,695 @@
-cleaned = '%3Cdiv%3E%3Carticle id=%22story%22%3E%3Ch1%3EWe welcome our new React overlords%3C/h1%3E%3Cp%3EPu... |
b5f840ad02d96714721f0558409f770161f4a8e0 | add test for update notebook | aligot/tests/test_notebook.py | aligot/tests/test_notebook.py | # coding: utf-8
from django.test import TestCase, Client
from django.core.urlresolvers import reverse
from rest_framework.test import APIClient
from rest_framework import status
from ..models import NoteBook, User
import logging
# Get an instance of a logger
logger = logging.getLogger(__name__)
class TestNoteBookAp... | Python | 0 | @@ -1028,28 +1028,572 @@
, NoteBook.objects.count())%0A
+%0A def test_update(self):%0A notebook = NoteBook.objects.create(title='a title', created_by=self.user)%0A self.assertEquals(1, NoteBook.objects.count())%0A response = self.client.put(reverse('notebook-detail', args=%5Bnotebook.id%5D), %7... |
b705b4dae318c7f40603de1658083be134fe3376 | remove old comments | allel/chunked/storage_zarr.py | allel/chunked/storage_zarr.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, division
import operator
import zarr
import zarr.util
from allel.chunked import util as _util
from allel.compat import zip, reduce
def default_chunks(data, expectedlen):
# here we will only ever chunk first dimension
rowsize =... | Python | 0 | @@ -1185,37 +1185,8 @@
gs):
-%0A # ignore expectedlen
%0A%0A
@@ -1533,37 +1533,8 @@
gs):
-%0A # ignore expectedlen
%0A%0A
|
05c509cb2c298425f141e11f9af1d20962f2bb7e | Update __init__.py | src/iris/__init__.py | src/iris/__init__.py | __version__ = "1.0.14"
| Python | 0.000072 | @@ -17,7 +17,7 @@
.0.1
-4
+5
%22%0A
|
f89434911252a18a56a1cfa9504b05a1d63f814f | Support unicode characters in javascript and CSS. Closes #250. | render_utils.py | render_utils.py | #!/usr/bin/env python
from cssmin import cssmin
from flask import Markup, g, render_template, request
from slimit import minify
import app_config
import copytext
CSS_HEADER = '''
/*
* Looking for the full, uncompressed source? Try here:
*
* https://github.com/nprapps/%s
*/
''' % app_config.REPOSITORY_NAME
JS_HE... | Python | 0 | @@ -1365,18 +1365,34 @@
mpress()
+.encode('utf-8')
)%0A
-
%0A
@@ -2413,32 +2413,48 @@
(minify(f.read()
+.encode('utf-8')
))%0A%0A cont
@@ -2564,33 +2564,32 @@
.js', **context)
-
%0A output.
@@ -2605,17 +2605,16 @@
header)
-
%0A%0A
@@ -3500,16 +3500,32 @@
f.read()
+.encode('utf-8'... |
ef84dca1050762a816984fab7323c5cfea683dde | Update learning_schedules.py | research/object_detection/utils/learning_schedules.py | research/object_detection/utils/learning_schedules.py | # Copyright 2017 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.000003 | @@ -7568,16 +7568,21 @@
+list(
range(nu
@@ -7586,32 +7586,33 @@
(num_boundaries)
+)
,%0A
|
7aa75ac280b9f58102927dc148016b4f6f8e8cf5 | change the T | gui/tasks.py | gui/tasks.py | # coding: UTF-8
'''
Created on 2013-04-06
@author: tianwei
Desc: Celery Tasks
'''
import os
import sys
import uuid
import time
import datetime
from celery.decorators import task
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from django.shortcuts import render_to_response
from dj... | Python | 0.001528 | @@ -5249,12 +5249,8 @@
if
-not
argu
@@ -5254,16 +5254,24 @@
rguments
+=='none'
:%0A
|
7d1dc9bcdaf0a533b0b52ae9fb6e2d37940fad3c | Update email check regex to be more thorough | mailchimp3/helpers.py | mailchimp3/helpers.py | # coding=utf-8
"""
Helper functions to perform simple tasks for multiple areas of the API
"""
import hashlib
import re
HTTP_METHOD_ACTION_MATCHING = {
'get': 'GET',
'create': 'POST',
'update': 'PATCH',
'create_or_update': 'PUT',
'delete': 'DELETE'
}
def get_subscriber_hash(member_email):
"""
... | Python | 0 | @@ -972,11 +972,61 @@
rch(
-'@'
+r%22(%5E%5Ba-zA-Z0-9_.+-%5D+@%5Ba-zA-Z0-9-%5D+%5C.%5Ba-zA-Z0-9-.%5D+$)%22
, em
|
b83d94ce2dd94b6efb90ad95b1150079744b4060 | Write helpful error message on unrecognised command | husc/main.py | husc/main.py | #!/bin/env python
# standard library
import os
import sys
import argparse
import itertools as it
# dependencies
import numpy as np
import mahotas as mh
from skimage import io
# local imports
from . import preprocess as pre
parser = argparse.ArgumentParser(description="Run the HUSC functions.")
subpar = parser.add_... | Python | 0.000005 | @@ -4323,16 +4323,206 @@
h(args)%0A
+ else:%0A sys.stderr.write(%22Error: command %25s not found. Run %25s -h for help.%22 %25%0A (cmd, sys.argv%5B0%5D))%0A sys.exit(2) # 2 is commonly a command-line error%0A
%0A%0Adef ru
|
1b89b0e6fe89cff56736ba88edc6422ce6078979 | Bump version to 0.2.0 | dxleposervice/_version.py | dxleposervice/_version.py | __version__ = "0.1.4"
| Python | 0.000001 | @@ -14,9 +14,9 @@
%220.
-1.4
+2.0
%22%0A
|
a7e19b9678dda6a8e5cc7fa36adb753724df5315 | update version number | rt1/__init__.py | rt1/__init__.py | """Import module for RT1 module"""
import logging
import logging.handlers
import sys
from textwrap import indent
import multiprocessing as mp
from .general_functions import groupby_unsorted
__version__ = "1.4"
__author__ = "Raphael Quast"
# add a logging-level "Prog." that is used to report progess (1 above INFO)
_... | Python | 0.000002 | @@ -202,17 +202,19 @@
__ = %221.
-4
+5.1
%22%0A__auth
|
cfeb2f69ba1c057d5c2f1c8f85f44b204bf15935 | read call removed from stdin | run/__init__.py | run/__init__.py | """
>>> from subprocess import run
>>> print run('uname -r')
3.7.0-7-generic
>>> print run('uname -r').stdout
3.7.0-7-generic
>>> run('uname -a').status
0
>>> print run('rm not_existing_directory').stderr
rm: cannot remove `not_existing_directory': No such file or directory
>>> print run('ls -l... | Python | 0 | @@ -1233,15 +1233,8 @@
tdin
-.read()
%0A%0A%0Ac
|
6f14527aaa18ca3f707523535d596acc1c8fb847 | update version to 0.9.6 | salt/version.py | salt/version.py | __version_info__ = (0, 9, 5)
__version__ = '.'.join(map(str, __version_info__))
| Python | 0 | @@ -23,9 +23,9 @@
9,
-5
+6
)%0A__
|
bc8ade144c4148f62908ce1952605c7a67525fd6 | Modify the LOCAL farm so that it can take input options from an environment variable | enrico/submit/__init__.py | enrico/submit/__init__.py | """Helper functions to call command line tools from python
@todo:
- Make it flexible so that a dict(a=42) can be given and
'a=42' or '-a 42' or '--a 42' is generated depending on an option!
- Make it a class, so that options like dryrun or options formattting
don't have to be handed around all the time!!!"""
import s... | Python | 0.000001 | @@ -1795,16 +1795,72 @@
= %22%22 %5D:%0A
+ queueoptions = %22%25s %22 %25(environ.TORQUE_RESOURCES) %0A
qu
@@ -2012,23 +2012,29 @@
V','
--l nice=19 %25s'%25
+%25s %25s'%25(queueoptions,
queu
@@ -2038,16 +2038,17 @@
ueuetext
+)
%5D,%0A
|
8ebeaf075c7933648b4fbb713da2344ee8a5a4c0 | Allow enwiki WP:FIX to auto-determine dump file | enwiki/common_mistakes.py | enwiki/common_mistakes.py | import re
import mwparserfromhell
import pywikibot
from pywikibot import xmlreader
pywikibot.config.family = "wikipedia"
pywikibot.config.mylang = "en"
site = pywikibot.Site()
site.login()
class CommonMistakesLister(object):
"""Updates lists of common mistakes for WikiProject Fix common mistakes"""
def __... | Python | 0 | @@ -306,55 +306,33 @@
%22%22%22%0A
-%0A
-def __init__(self):%0A self.dump_file
+%0A DUMP_PATH_FORMAT
= %22
@@ -407,30 +407,185 @@
bz2%22
-.format(date=%2220170901
+%0A%0A def __init__(self):%0A self.dump_file = self.get_dump_file()%0A if self.dump_file is None:%0A raise R... |
74a312e469182864b29db7a0e4b39d5cfdcca70a | Change the way scroll is handled. Fixes #85 | src/pick/__init__.py | src/pick/__init__.py | import curses
from dataclasses import dataclass, field
from typing import Any, List, Optional, Sequence, Tuple, TypeVar, Union, Generic
__all__ = ["Picker", "pick", "Option"]
@dataclass
class Option:
label: str
value: Any
KEYS_ENTER = (curses.KEY_ENTER, ord("\n"), ord("\r"))
KEYS_UP = (curses.KEY_UP, ord("... | Python | 0 | @@ -889,59 +889,8 @@
t=0)
-%0A scroll_top: int = field(init=False, default=0)
%0A%0A
@@ -3972,61 +3972,8 @@
-if current_line %3C= self.scroll_top:%0A self.
scro
@@ -3987,26 +3987,24 @@
= 0%0A
-el
if current_l
@@ -4011,26 +4011,8 @@
ine
-- self.scroll_top
%3E ma
@@ -4031,21 +4031,1... |
67c2514bf571093be848f4375675dc1406576bfb | Disable testPlayWaitForEnded On Mac | telemetry/telemetry/internal/actions/play_unittest.py | telemetry/telemetry/internal/actions/play_unittest.py | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from telemetry.internal.actions import play
from telemetry.testing import tab_test_case
import py_utils
AUDIO_1_PLAYING_CHECK = 'window.__hasEventComplete... | Python | 0 | @@ -156,16 +156,49 @@
file.%0A%0A
+from telemetry import decorators%0A
from tel
@@ -3185,16 +3185,46 @@
._tab)%0A%0A
+ @decorators.Disabled('mac')%0A
def te
|
1c434432977f0e3e126ec4d22be0bdccd4c44463 | Remove request processor. | sanic_sentry.py | sanic_sentry.py | import logging
import sanic
import raven
import raven_aiohttp
from raven.handlers.logging import SentryHandler
from raven.processors import Processor
class SanicSentry:
def __init__(self, app=None):
self.app = None
self.handler = None
self.client = None
if app is not None:
... | Python | 0 | @@ -110,47 +110,8 @@
ler%0A
-from raven.processors import Processor%0A
%0A%0Acl
@@ -736,539 +736,4 @@
elf%0A
-%0A%0Aclass RequestProcessor(Processor):%0A async def process(self, data, request=None):%0A if request is None:%0A return %7B%7D%0A%0A data = %7B%0A 'request': %7B%0A ... |
733f9e3c98a4e916eba77e18aa25e5980694fc3b | Update test_alert_init.py | tendrl/commons/tests/objects/alert/test_alert_init.py | tendrl/commons/tests/objects/alert/test_alert_init.py | import __builtin__
import maps
from mock import patch
from tendrl.commons import objects
from tendrl.commons.objects.alert import Alert
from tendrl.commons.objects.alert import AlertUtils
def test_equals():
setattr(__builtin__, "NS", maps.NamedDict())
setattr(NS, "_int", maps.NamedDict())
NS.publisher_id ... | Python | 0.000017 | @@ -47,16 +47,17 @@
t patch%0A
+%0A
from ten
|
c754696541f39bbf32d89c35f89d00113d642bd8 | be explicit | matrixscreener/cam.py | matrixscreener/cam.py | from time import sleep
from collections import OrderedDict
import socket, pydebug
# debug with `DEBUG=matrixscreener python script.py`
debug = pydebug.debug('matrixscreener')
class CAM:
"Driver for LASAF Computer Assisted Microscopy."
def __init__(self, host='127.0.0.1', port=8895):
self.host = host... | Python | 0.999999 | @@ -3145,25 +3145,11 @@
dy=1
-, value='true'
):%0A
+
@@ -3433,18 +3433,14 @@
e',
-s
+'
tr
-(val
ue
-)
+'
)%0A
@@ -3505,120 +3505,404 @@
lf,
-**kwargs):%0A %22Shorthand for CAM.enable(value='false').%22%0A return self.enable(
+slide=0, wellx=1, welly=1,%0A fieldx=1, fieldy=1)... |
9e0ceaf065a3fb039aa47ccd3189618225ab11ae | remove failing test | tests/acquisition/covidcast/test_direction_updater.py | tests/acquisition/covidcast/test_direction_updater.py | """Unit tests for direction_updater.py."""
# standard library
import argparse
import unittest
from unittest.mock import MagicMock
# py3tester coverage target
__test_target__ = 'delphi.epidata.acquisition.covidcast.direction_updater'
class UnitTests(unittest.TestCase):
"""Basic unit tests."""
def test_get_argum... | Python | 0.000006 | @@ -467,2367 +467,180 @@
%0A%0A
-def test_update_loop(self):%0A %22%22%22Update direction for out-of-date covidcast rows.%22%22%22%0A%0A batch1 = %5B%0A (%0A 'a',%0A 'b',%0A 'day',%0A 'state',%0A 20200421,%0A 'ca',%0A 100,%0A 200,%0A 300,%0A ... |
3f3557f9c249cdd9f5961d5461c12cb0a587da3b | fix SAMODE | merc/features/mode.py | merc/features/mode.py | import operator
from merc import channel
from merc import errors
from merc import feature
from merc import message
from merc import util
class ModeFeature(feature.Feature):
NAME = __name__
install = ModeFeature
def show_modes(modes):
flags = []
args = []
for k, mode in sorted(modes.items(), key=operator... | Python | 0.999136 | @@ -5188,24 +5188,31 @@
ent, channel
+, modes
):%0A clien
|
18f2b67f00340303f870ec250abc842058fce40d | Use output_to_zero instead of shutdown hook | thruster_interface/scripts/thruster_interface_node.py | thruster_interface/scripts/thruster_interface_node.py | #!/usr/bin/env python
import math
import Adafruit_PCA9685
import numpy
import rospy
from vortex_msgs.msg import Float64ArrayStamped
from thruster_interface.srv import ThrustersEnable, ThrustersEnableResponse
class ThrusterInterface(object):
def __init__(self):
rospy.init_node('thruster_interface', anony... | Python | 0.000062 | @@ -2182,24 +2182,30 @@
wn(self.
-shutdown
+output_to_zero
)%0A%0A
@@ -5732,62 +5732,8 @@
ue%0A%0A
- def shutdown(self):%0A self.output_to_zero()%0A
%0Aif
|
1f543d18d287d462b6ebf3344376b505e0d8ef97 | Add a fullpath guard to the compress function | src/utils/archive.py | src/utils/archive.py | """This is a docstring for this container file"""
"""
This file is part of RAPD
Copyright (C) 2017-2018, Cornell University
All rights reserved.
RAPD 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, versi... | Python | 0.000001 | @@ -1987,32 +1987,70 @@
_file%22, target%0A%0A
+ target = os.path.abspath(target)%0A%0A
# Save where
|
62df776433ccb4b5de1e586f03381bbfe0c56817 | Remove unneccessary iteration | src/webapp/public.py | src/webapp/public.py | import json
from flask import Blueprint, render_template
import database as db
from database.model import Team
bp = Blueprint('public', __name__)
@bp.route("/map")
def map_page():
return render_template("public/map.html")
@bp.route("/map_teams")
def map_teams():
qry = db.session.query(Team).filter_by(conf... | Python | 0 | @@ -827,35 +827,26 @@
-data = %5Bentry for entry in
+return json.dumps(
data
@@ -855,20 +855,16 @@
ict.
-iter
values()
%5D%0A
@@ -863,34 +863,6 @@
es()
-%5D%0A return json.dumps(data
)%0A
|
bd89ee1966a1d93217b9010475d6642e89898b87 | reorder operations in write_geogrid, same result | src/write_geogrid.py | src/write_geogrid.py | # write_geogrid.py
# Jan Mandel, June 2019
import os.path as osp
import numpy as np
import sys, os, logging, json
from utils import inq
def write_divide(file,divide='=',count=25):
"""
Write a dividing line
"""
f=open(file,'a')
f.write(divide * count + '\n')
f.close()
def write_table(file,... | Python | 0.000005 | @@ -3100,24 +3100,25 @@
its+1)%0A a
+a
= np.round(
@@ -3122,30 +3122,8 @@
nd(a
-.transpose().flatten()
/sca
@@ -3146,32 +3146,33 @@
== 32:%0A a
+a
= np.int32(a) %0A
@@ -3168,16 +3168,17 @@
.int32(a
+a
) %0A e
@@ -3202,16 +3202,17 @@
a
+a
= np.in
@@ -3216,16 +3216,17 @@
.int16(a
+a
) %... |
c12876cd0adaa14db248dd45b87ed0be89f7bdff | Make the logging fancy with indentation | src/zazo/resolver.py | src/zazo/resolver.py | """
"""
import logging
from .exceptions import CannotSatisfy
if False:
from typing import List, Dict # NOQA
from packaging.requirements import Requirement # NOQA
from .abc import Provider, Candidate # NOQA
Graph = Dict[str, Candidate]
logger = logging.getLogger()
class BackTrackingResolver(ob... | Python | 0.000002 | @@ -2,16 +2,31 @@
%22%22%0A%22%22%22%0A%0A
+import inspect%0A
import l
@@ -33,17 +33,16 @@
ogging%0A%0A
-%0A
from .ex
@@ -565,32 +565,93 @@
ment%5D) -%3E Graph%0A
+ self._initial_recursion_depth = len(inspect.stack())%0A
graph =
@@ -1170,16 +1170,137 @@
ts%5B1:%5D%0A%0A
+ recursion_depth =... |
91e107e209f2c4ce1341cc0dc3ec45055c2c3d27 | Fix deprecation warning | core/tests/test_template_tags.py | core/tests/test_template_tags.py | from django.template import Context, Template
from bs4 import BeautifulSoup
from core.tests.utils import *
from core.models import *
class TemplateTagsTestCase(WagtailTest):
def setUp(self):
super(TemplateTagsTestCase, self).setUp()
self.home_page = HomePage.objects.all()[0]
def test_set_v... | Python | 0.000099 | @@ -1096,32 +1096,44 @@
fulSoup(rendered
+, 'html5lib'
)%0A%0A self.
@@ -1686,16 +1686,28 @@
rendered
+, 'html5lib'
)%0A%0A
|
0af87b62483414aa9df224d1394d58017e2a9565 | exit if input file is missing (after sending email) | cronjobs/generate_beacon_file.py | cronjobs/generate_beacon_file.py | #!/bin/python3
# -*- coding: utf-8 -*-
#
# A tool for the automatic generation of a Beacon file.
# (https://meta.wikimedia.org/wiki/Dynamic_links_to_external_resources)
import datetime
import os
import re
import sys
import traceback
import util
def GetMostRecentBSZFile(filename_pattern):
try:
filename_reg... | Python | 0 | @@ -1513,24 +1513,45 @@
priority=1)
+%0A sys.exit(-1)
%0A%0A most_r
@@ -1760,32 +1760,53 @@
s!%22, priority=1)
+%0A sys.exit(-1)
%0A%0A # Extract
@@ -2955,25 +2955,24 @@
%5D):%0A
-
util.SendEma
@@ -3045,17 +3045,16 @@
ite %5C%22%22%0A
-
|
81ca88911c049786f4f56cfa76bd027f035d186e | Add argument to change the number of samples | examples/kmeans/kmeans.py | examples/kmeans/kmeans.py | import argparse
import contextlib
import time
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import six
import cupy
@contextlib.contextmanager
def timer(message):
cupy.cuda.Stream.null.synchronize()
start = time.time()
yield
cupy.cuda.Stream.null.synchroni... | Python | 0.00001 | @@ -3190,32 +3190,37 @@
uid, n_clusters,
+ num,
max_iter, use_c
@@ -3276,15 +3276,11 @@
ndn(
-5000000
+num
, 2)
@@ -4255,24 +4255,134 @@
clusters')%0A
+ parser.add_argument('--num', default=5000000, type=int,%0A help='number of samples')%0A
parser.a
@@ -4821,16 +4821,26 @@
lusters... |
63e4127f4615bd6a2ccd93252a42b8ebdf72daff | Assert instead of if-condition | examples/pdanilov-fork.py | examples/pdanilov-fork.py | import sys
import json
import requests
from collections import Counter
api_url = 'https://stepic.org/api/'
def get_api_requests(topic, pages_max_num=None):
result = []
page_num = 1
while True if pages_max_num is None else page_num <= pages_max_num:
request_url = (api_url + topic + '?page={}').f... | Python | 0.998572 | @@ -1584,19 +1584,23 @@
%22:%0A%0A
-if
+assert(
len(sys.
@@ -1609,28 +1609,14 @@
gv)
-!= 3:%0A print(
+== 3,
%22Usa
@@ -1663,23 +1663,8 @@
et%22)
-%0A exit()
%0A%0A
|
9ce82012286702211b72232fb181fdd95a35aaad | combine two exceptions into a single one | vm_network_migration/modules/other_modules/address.py | vm_network_migration/modules/other_modules/address.py | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 0.999999 | @@ -3593,16 +3593,65 @@
except
+ Exception as e:%0A if isinstance(e,
HttpErr
@@ -3652,23 +3652,23 @@
ttpError
- as e:%0A
+):%0A
@@ -3706,16 +3706,20 @@
eason()%0A
+
@@ -3797,16 +3797,20 @@
+
# or the
@@ -3869,24 +3869,28 @@
+
+
if 'alre... |
8e5892e2fd5d3560ed4ffe3e8f11cfdb393865bf | Make it easier to see what the error was on failed module load. | mininet/moduledeps.py | mininet/moduledeps.py | "Module dependency utility functions for Mininet."
from mininet.util import quietRun
from mininet.log import info, error, debug
from os import environ
def lsmod():
"Return output of lsmod."
return quietRun( 'lsmod' )
def rmmod( mod ):
"""Return output of lsmod.
mod: module string"""
return qui... | Python | 0 | @@ -1193,18 +1193,20 @@
od + ':
+%3C
%25s
+%3E
%5Cn' %25 rm
@@ -1654,18 +1654,20 @@
or was:
+%3C
%25s
+%3E
%5Cn' %25 mo
|
98649d486b9e2eb2c83e594e73cf6bbaa29213e5 | Make the server example listen on 0.0.0.0 by default. | examples/simple_server.py | examples/simple_server.py | import argparse
import math
from pythonosc import dispatcher
from pythonosc import osc_server
def print_volume_handler(args, volume):
print("[{0}] ~ {1}".format(args[0], volume))
def print_compute_handler(args, volume):
try:
print("[{0}] ~ {1}".format(args[0], args[1](volume)))
except ValueError: pass
if ... | Python | 0 | @@ -423,17 +423,15 @@
lt=%22
-127
+0
.0.0.
-1
+0
%22, h
|
9abbc8a76c9802cb8c660b5cf5823980e80cfe16 | Make scripts.utils.penman_structure more strict | scripts/util.py | scripts/util.py |
import re
from collections import defaultdict
from delphin import itsdb
from delphin.mrs.components import var_re
def rows(p):
if p.exists('p-result'):
return p.select('p-result', ('i-id', 'p-id', 'mrs'))
elif p.exists('result') and p.exists('parse'):
return itsdb.select_rows(
('p... | Python | 0.000003 | @@ -4309,16 +4309,72 @@
ure(s):%0A
+ s = re.sub(r'(:%5B%5E %5D+ )(%5Beihpux%5D%5Cd+)', r'%5C1(%5C2)', s)%0A
retu
@@ -4412,15 +4412,18 @@
pux%5D
-(?=%5Cd+
+%5Cd+(?=%5B )%5D
)%7C:%5B
@@ -4444,8 +4444,9 @@
)', s))%0A
+%0A
|
fecc8156cf302fc753b53e953e230738b1da400b | remove pycompat py2 helpers/shims | models/sale_coupon.py | models/sale_coupon.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import random
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models, _
from odoo.tools import pycompat
class SaleCoupon(models.Model):
_name = 'sale.coupon'
_description = "Sales... | Python | 0 | @@ -200,40 +200,8 @@
, _%0A
-from odoo.tools import pycompat%0A
%0A%0Acl
@@ -751,26 +751,11 @@
urn
-pycompat.text_type
+str
(ran
|
1988798c80a123572c3fa19873b3b028504575dc | Improve error message when drmaa cannot be loaded. | pulsar/managers/util/drmaa/__init__.py | pulsar/managers/util/drmaa/__init__.py | try:
from drmaa import Session, JobControlAction
except ImportError as e:
# Will not be able to use DRMAA
Session = None
NO_DRMAA_MESSAGE = "Attempt to use DRMAA, but DRMAA Python library cannot be loaded."
class DrmaaSessionFactory(object):
"""
Abstraction used to production DrmaaSession wrapper... | Python | 0 | @@ -57,25 +57,255 @@
ept
-ImportError as e:
+OSError as e:%0A LOAD_ERROR_MESSAGE = %22OSError - problem loading shared library %5B%25s%5D.%22 %25 e%0A Session = None%0Aexcept ImportError as e:%0A LOAD_ERROR_MESSAGE = %22ImportError - problem importing library (%60pip install drmaa%60 may fix this) %5B%25s%5D... |
e56764c6e3393c105fd5acb439323b89f8775161 | Update __openerp__.py | purchase_double_confirm/__openerp__.py | purchase_double_confirm/__openerp__.py | # -*- encoding: utf-8 -*-
# © 2014 Elico corp(www.elico-corp.com)
# Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html)
{
'name': 'Purchase Order Approvement',
'version': '7.0.1.0.0',
'category': 'Purchases',
'description': """
Button on PO will pop a question, give the operator a... | Python | 0.000024 | @@ -318,14 +318,19 @@
r a
-chance
+possibility
to
@@ -395,33 +395,26 @@
': '
-http://www.openerp.net.cn
+www.elico-corp.com
',%0A
|
007c9cbea86344947bee2caa04248596fe16b317 | Fix user profile (from db, not proto.) | pykeg/src/pykeg/contrib/twitter/app.py | pykeg/src/pykeg/contrib/twitter/app.py | # Copyright 2010 Mike Wakerly <opensource@hoho.com>
#
# This file is part of the Pykeg package of the Kegbot project.
# For more information on Pykeg or Kegbot, see http://kegbot.org/
#
# Pykeg is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by... | Python | 0 | @@ -2070,32 +2070,109 @@
ser:%0A try:%0A
+ db_user = core_models.User.objects.get(username=drink.user.username)%0A
profile
@@ -2170,29 +2170,26 @@
profile = d
-rink.
+b_
user.get_pro
@@ -2207,16 +2207,48 @@
except
+ (core_models.User.DoesNotExist,
core_mo
@@ -2268,32 +2268,33 @@
ile.Does... |
148d8ead5fc6c30021063a6e8b1bfb69d50e04b5 | Fix PEP8 error. | armet/attributes/attribute.py | armet/attributes/attribute.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals, division
from armet.utils import compose
from collections import defaultdict
from functools import partial
class Attribute(object):
"""Generic attribute.
Use this to indicate that the type of the data is unmanaged by armet.
... | Python | 0.000001 | @@ -2199,16 +2199,17 @@
= self%0A
+%0A
|
e173868deff0672b2f5540d6409f4c87d1fe1827 | fix couchdb json encoding | pyspider/database/couchdb/projectdb.py | pyspider/database/couchdb/projectdb.py | import time, requests, json
from pyspider.database.base.projectdb import ProjectDB as BaseProjectDB
class ProjectDB(BaseProjectDB):
__collection_name__ = 'projectdb'
def __init__(self, url, database='projectdb'):
self.url = url
self.database = database
self.insert('', {})
def _de... | Python | 0.000064 | @@ -884,192 +884,195 @@
-print(%22%5Bcouchdb insert%5D - insert url: %7B%7D obj: %7B%7D%22.format(url, json.dumps(obj)))%0A return requests.put(url, data = json.dumps(obj), headers = %7B%22Content-Type%22: %22application/json%22%7D)
+res = requests.put(url, data = json.dumps(obj), headers = %7B%22Content-T... |
e55d04760daaefb6dda7f26d1ebcd66d7af45abc | Fix docstring in projection.py | modules/projection.py | modules/projection.py | #!/usr/bin/env python
"""
(C) 2007-2017 1024jp
"""
import numpy as np
import cv2
class Projector:
def __init__(self, image_points, ideal_points):
self.homography = self._estimate_homography(image_points, ideal_points)
@staticmethod
def _estimate_homography(image_points, ideal_points):
... | Python | 0.000037 | @@ -33,17 +33,17 @@
2007-201
-7
+8
1024jp%0A
@@ -607,73 +607,8 @@
ts:%0A
- homography (list%5Blist%5Bfloat%5D%5D) -- 3x3 homography matrix.%0A
|
25c7a6334f0d2528e02811eb976f7da57163655c | Add missing attributes to ApiParcelState | python/src/cm_api/endpoints/parcels.py | python/src/cm_api/endpoints/parcels.py | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | Python | 0.000001 | @@ -2046,24 +2046,92 @@
: ROAttr(),%0A
+ 'warnings' : ROAttr(),%0A 'errors' : ROAttr(),%0A
%7D%0A%0A def
|
ac8db70af36a4c22bebca613f67fc9b67c70f1c5 | Add calls to Resource super class | server/proxy.py | server/proxy.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2015 Kitware 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 cop... | Python | 0 | @@ -1178,16 +1178,54 @@
(self):%0A
+ super(Proxy, self).__init__()%0A
|
1cdf903ef028be519a6d3eee1b30b53234de51f2 | Fix valueerrors on pyquery. | readthedocs/projects/search_indexes.py | readthedocs/projects/search_indexes.py | # -*- coding: utf-8-*-
import codecs
import os
from django.utils.html import strip_tags
from haystack import site
from haystack.indexes import *
from celery_haystack.indexes import CelerySearchIndex
from pyquery import PyQuery
from projects.models import File, ImportedFile, Project
import logging
log = logging.g... | Python | 0 | @@ -1928,16 +1928,33 @@
j.slug)%0A
+ try:%0A
@@ -2034,16 +2034,133 @@
%C2%B6', '')%0A
+ except ValueError:%0A #Pyquery returns ValueError if div.document doesn't exist.%0A return%0A
|
6e06e335257e4a370d815b733ccce184a3541f81 | fix unhandled calls | servy/server.py | servy/server.py | from __future__ import absolute_import
import webob.exc
import webob.dec
import webob.response
import pickle
class Server(object):
def __init__(self, **services):
self.services = services
@webob.dec.wsgify
def __call__(self, request):
if request.method == 'POST':
return self... | Python | 0.00003 | @@ -326,16 +326,61 @@
request)
+%0A raise webob.exc.HTTPMethodNotAllowed
%0A%0A de
|
a1406c93c2cbdc0da73c8bc5412f695a0ab18d53 | add session keys file source code UTF-8 encoding | session_keys.py | session_keys.py |
USER_TOKEN = 'user'
USER_ID_TOKEN = 'id_user' | Python | 0.000001 | @@ -1,8 +1,31 @@
+# -*- coding: utf-8 -*-
%0A%0AUSER_T
@@ -59,12 +59,13 @@
= 'id_user'
+%0A
|
8b77e1e865d72720a602b7b7cc5912cb852d68cf | Revert back to original settings for Celery Broker | settings/dev.py | settings/dev.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
from .common import * # noqa
DEBUG = True
TEMPLATE_DEBUG = DEBUG
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(ROOT_DIR, 'db.sqlite3'),
}
}
ACCOUNT_DEFAULT_H... | Python | 0 | @@ -593,33 +593,29 @@
%22, %22redis://
-127.0.0.1
+redis
:6379/0%22)%0ACE
@@ -689,17 +689,13 @@
s://
-127.0.0.1
+redis
:637
|
f1bf578fcfc5e8c6fc7c169ea794b3fbfc89d854 | remove leading and trailing / in config path | fjcommon/config_parser.py | fjcommon/config_parser.py | """
Simple and Re-usable Configuration File Framework for tracking unique machine experiment setups.
Uses configuration files with the following syntax:
The first line may contain a use statement, specifying a path to another config file, relative to the containing
file. The specified file is parsed first. If a param... | Python | 0 | @@ -1266,17 +1266,16 @@
he relat
-e
ive path
@@ -1292,16 +1292,27 @@
to the
+dir of the
root con
@@ -1514,16 +1514,32 @@
th), '')
+.strip(path.sep)
%0A ret
|
e753038de039fd23f0d59bb0094f59fc73efe22b | Set a custom JSON Encoder to serialize date class. | flask_apscheduler/json.py | flask_apscheduler/json.py | import flask
import json
from datetime import datetime
from apscheduler.job import Job
from .utils import job_to_dict
class JSONEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, datetime):
return obj.isoformat()
if isinstance(obj, Job):
return job_to_d... | Python | 0 | @@ -1,12 +1,28 @@
+import datetime%0A
import flask
@@ -39,38 +39,8 @@
on%0A%0A
-from datetime import datetime%0A
from
@@ -103,270 +103,26 @@
ct%0A%0A
-%0Aclass JSONEncoder(json.JSONEncoder):%0A def default(self, obj):%0A if isinstance(obj, datetime):%0A return obj.isoformat()%0A%0A if is... |
edcfe2b156af23943478bc86592b4c8d5dc07e10 | Support older versions of MongoEngine | flask_mongoengine/json.py | flask_mongoengine/json.py | from flask.json import JSONEncoder
from bson import json_util
from mongoengine.base import BaseDocument
from mongoengine import QuerySet
def _make_encoder(superclass):
class MongoEngineJSONEncoder(superclass):
'''
A JSONEncoder which provides serialization of MongoEngine
documents and quer... | Python | 0 | @@ -97,16 +97,25 @@
ocument%0A
+try:%0A
from mon
@@ -122,24 +122,29 @@
goengine
+.base
import
QuerySet
@@ -135,16 +135,20 @@
import
+Base
QuerySet
@@ -148,16 +148,131 @@
uerySet%0A
+except ImportError as ie: # support mongoengine %3C 0.7%0A from mongoengine.queryset import QuerySet as BaseQuerySet
%... |
8097465dfcf742d388b7726c624505b09c452f2c | Migrate to Django 1.8 | fluent_comments/models.py | fluent_comments/models.py | from django.conf import settings
import django_comments as comments
from django_comments import Comment
from django_comments.managers import CommentManager
from django.contrib.contenttypes.generic import GenericRelation
from django.contrib.sites.models import get_current_site
from django.core.mail import send_mail
from... | Python | 0.000008 | @@ -149,16 +149,41 @@
Manager%0A
+if VERSION %3C (1, 8):%0A
from dja
@@ -238,16 +238,97 @@
elation%0A
+else:%0A from django.contrib.contenttypes.generic.fields import GenericRelation%0A
from dja
|
6fa2838e41ab2f7b6940d6d12e5dba0f840b5567 | Version bump to 0.6.0 | forms_builder/__init__.py | forms_builder/__init__.py | __version__ = "0.5.1"
| Python | 0 | @@ -14,9 +14,9 @@
%220.
-5.1
+6.0
%22%0A
|
94ffad87d2ac5a0029d8924461a789ad9fd4bd9c | Add verification of user credentials | freepacktbook/__init__.py | freepacktbook/__init__.py | from os import environ, mkdir, path
import re
from bs4 import BeautifulSoup
import requests
from tqdm import tqdm
from .slack import SlackNotification
class FreePacktBook(object):
base_url = 'https://www.packtpub.com'
download_url = base_url + '/ebook_download/%(book_id)s/%(format)s'
my_books_url = bas... | Python | 0.000001 | @@ -752,24 +752,35 @@
+ response =
self.sessio
@@ -939,24 +939,196 @@
gin_form'%7D)%0A
+ error_msg = 'invalid email address and password combination'%0A if error_msg in response.text:%0A raise ValueError(error_msg)%0A
|
6f31cb8cad05f1713fbdef861c194385bc875ad9 | Clean up comment | mozcal/events/urls.py | mozcal/events/urls.py | from django.conf.urls.defaults import url, patterns
from . import views
urlpatterns = patterns('',
# Match
url(r'^(?P<slug>[a-z0-9-]+)$', views.one, name='event_one'),
url(r'^', views.all, name='event_all'),
)
| Python | 0 | @@ -98,18 +98,8 @@
'',%0A
- # Match%0A
ur
|
7e5672e6527ad2fce8b1cb97b07228b4db8770e2 | Update to version 0.1.1 | mpd_muspy/__init__.py | mpd_muspy/__init__.py | #!/usr/bin/python
# Author: Anthony Ruhier
import __main__
import os
import sys
# Check that the configuration exists
try:
_current_dir = os.path.dirname(__main__.__file__)
except AttributeError:
_current_dir = os.getcwd()
if not os.path.exists(os.path.join(_current_dir, "config.py")):
print("Configuratio... | Python | 0 | @@ -457,12 +457,10 @@
%220.1
-beta
+.1
%22%0A_r
|
6cd3e3128be2308bf13029b01b7ac6cc0a4cd7be | Fix setupcluster.py script. | setupcluster.py | setupcluster.py | import argparse
import os
import sys
from aioredis.cluster import testcluster
assert sys.version >= '3.3', 'Please use Python 3.3 or higher.'
START_PORT = 7001
REDIS_COUNT = 6
def parse_arguments():
parser = argparse.ArgumentParser(
description="Set up a Redis cluster for the unittests.")
parser.ad... | Python | 0 | @@ -56,16 +56,28 @@
ster
+.testcluster
import
test
@@ -72,21 +72,21 @@
import
-testc
+TestC
luster%0A%0A
@@ -110,17 +110,17 @@
n %3E= '3.
-3
+5
', 'Plea
@@ -135,17 +135,17 @@
ython 3.
-3
+5
or high
@@ -295,24 +295,26 @@
ter
-for the unittest
+to run the example
s.%22)
@@ -647,73 +647,110 @@
-test... |
0f39353563d0b00d1973715b3f5bd0efc03fd8d6 | Check loginstaus before login. Fix bug when get status without login. | seu_weblogin.py | seu_weblogin.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import urllib
import httplib
import json
import sys
import time
gl_username = 'your_username'
gl_password = 'your_password'
headers = {
'Content-Type': "application/json; charset=utf-8",
'dataType': "json",
'cache': False
}
url = "w.seu.edu.cn"
init_u... | Python | 0 | @@ -1248,16 +1248,338 @@
url, url
+, init_url%0D%0A%0D%0A%09conn = httplib.HTTPSConnection(url)%0D%0A%09conn.request(%22GET%22, init_url, headers=headers)%0D%0A%09#get response from web server%09%0D%0A%09content = conn.getresponse().read()%0D%0A%09# make sure if user is login %0D%0A%09if not 'notlogin' in content:%0D%... |
8bd669732a009420641fcaf09dbc128444700d69 | fix spaces in user names in urls bug | muckrock/foia/urls.py | muckrock/foia/urls.py | """
URL mappings for the FOIA application
"""
from django.conf.urls.defaults import patterns, url
from django.views.generic.base import RedirectView
from pingback import register_pingback
# pylint: disable=W0611
import muckrock.foia.signals
# pylint: enable=W0611
from muckrock.foia import views
from muckrock.foia.fe... | Python | 0.000013 | @@ -969,33 +969,33 @@
er_name%3E%5B%5Cw%5Cd_.@
-i
+
%5D+)/$',%0A
@@ -3048,17 +3048,17 @@
%5B%5Cw%5Cd_.@
-i
+
%5D+)/$',%0A
|
d65a20eb837bac93e7cd8c0559bfb741ac424deb | fix LaneManager to use reduce_and | mvmult/LaneManager.py | mvmult/LaneManager.py | #==============================================================================
# LaneManager.py
#==============================================================================
from new_pymtl import *
from new_pmlib import InValRdyBundle
STATE_IDLE = 0
STATE_CFG = 1
STATE_CALC = 2
class LaneManager( Model ):
def... | Python | 0 | @@ -2546,34 +2546,8 @@
---%0A
- s.is_done = Wire( 1 )%0A
@@ -2563,16 +2563,16 @@
ational%0A
+
def
@@ -2695,192 +2695,45 @@
-# TODO: is_done can't be a temporary due to lack of inference for BinOps%0A s.is_done.value = 1%0A for i in range( s.nlanes ):%0A s.is_done.value = s.done_r... |
abfcf0bdee7183ee46d784fb53918e95b477554e | fix pages/admin.py for InterestedForm | mysite/pages/admin.py | mysite/pages/admin.py | from django.contrib import admin
from models import InterestedForm
class InterestedFormAdmin(admin.ModelAdmin):
pass
admin.register(InterestedFormAdmin, InterestedForm)
# Register your models here.
| Python | 0 | @@ -115,20 +115,80 @@
-pass
+list_display = ('first_name', 'last_name', 'email', 'timezone')%0A
%0A%0Aadmin.
regi
@@ -183,16 +183,21 @@
%0A%0Aadmin.
+site.
register
@@ -211,21 +211,16 @@
stedForm
-Admin
, Intere
@@ -231,35 +231,11 @@
Form
-)%0A# Register your models here.
+Admin)
%0A
|
6607258b78002637372f67ee238bdb35aba7ce61 | check both /v0/ and /v0/legacy | gdc_client/query/index.py | gdc_client/query/index.py | import requests
from urlparse import urljoin
from ..log import get_logger
# Logging
log = get_logger('query')
class GDCIndexClient(object):
def __init__(self, uri):
self.uri = uri if uri.endswith('/') else uri + '/'
def get_related_files(self, file_id):
"""Query the GDC api for related fil... | Python | 0 | @@ -1082,16 +1082,19 @@
f.uri, '
+v0/
%7B%7D/%7B%7D'.f
@@ -1233,16 +1233,202 @@
params)%0A
+ if r.status_code != requests.codes.ok:%0A url = urljoin(self.uri, 'v0/legacy/%7B%7D/%7B%7D'.format(path, ID))%0A r = requests.get(url, verify=False, params=params)%0A
|
2be9b819af5669d9d98e0e9d9295baac3c040d9e | fix trailing slash on endpoint delete | genericclient/__init__.py | genericclient/__init__.py | import requests
from . import exceptions
_version = "0.0.2"
__version__ = VERSION = tuple(map(int, _version.split('.')))
class Resource(object):
whitelist = (
'__class__',
'_endpoint',
'payload',
'save',
'delete',
)
def __init__(self, endpoint, **kwargs):
... | Python | 0.000001 | @@ -115,24 +115,222 @@
it('.')))%0A%0A%0A
+MultipleResourcesFound = exceptions.MultipleResourcesFound%0AResourceNotFound = exceptions.ResourceNotFound%0AHTTPError = exceptions.HTTPError%0ANotAuthenticatedError = exceptions.NotAuthenticatedError%0A%0A%0A
class Resour
@@ -4113,17 +4113,18 @@
= %22%7B%7D%7B%7D
-/
+%7B... |
dd249e26cc22ca2c2ad48faaebc35463f31948d6 | Reorder hashes and fix sha512 | simplecrypto.py | simplecrypto.py | import hashlib
import math
from os import path
from base64 import b64encode, b64decode
from Crypto.Cipher import DES, AES
from Crypto.PublicKey import RSA
from Crypto import Random
random_instance = Random.new()
algorithms = {'aes': AES, 'des': DES}
def sha1(message):
return hashlib.sha1(message).hexdigest()
de... | Python | 0.000016 | @@ -250,20 +250,19 @@
S%7D%0A%0Adef
-sha1
+md5
(message
@@ -283,20 +283,19 @@
hashlib.
-sha1
+md5
(message
@@ -309,27 +309,28 @@
gest()%0A%0Adef
-md5
+sha1
(message):%0A
@@ -339,35 +339,36 @@
return hashlib.
-md5
+sha1
(message).hexdig
@@ -490,10 +490,10 @@
.sha
-1
5
+1
2(me
|
9e9c2931dad02f9a391c6286bb8793c632974c89 | Send left-over data to Solr after iterating over a Querys results | sir/indexing.py | sir/indexing.py | # Copyright (c) 2014 Lukas Lalinsky, Wieland Hoffmann
# License: MIT, see LICENSE for details
import futures
from . import config, querying, util
from .schema import SCHEMA
from ConfigParser import Error
from functools import partial
from logging import getLogger
from urllib2 import URLError
logger = getLogger("sir... | Python | 0 | @@ -2804,32 +2804,347 @@
+logger.debug(%22Sending %25i records to %25s%22, len(data),%0A solr_connection.url)%0A solr_connection.add_many(data)%0A data = %5B%5D%0A if len(data) %3E 0:%0A # There's some left-over data that's no... |
8fec68740ab7f8467f952f478a971a8418d48108 | Add run_cmd logging statement | sjkscan/scan.py | sjkscan/scan.py | #!/usr/bin/env python
# encoding: utf-8
import os
from datetime import datetime
from .config import config, load_config
from .utils import run_cmd
def run_scan(output_directory):
"""Run scanimage in batch mode.
:param string output_directory: directory to write scanned images to
"""
command = [
... | Python | 0.000001 | @@ -34,16 +34,31 @@
utf-8%0A%0A
+import logging%0A
import o
@@ -59,16 +59,17 @@
port os%0A
+%0A
from dat
@@ -157,16 +157,50 @@
run_cmd%0A
+from .logging import init_logging%0A
%0A%0Adef ru
@@ -336,23 +336,76 @@
ges to%0A%0A
-
%22%22%22
+%0A logging.info('Scanning to %25s', output_directory)
%0A%0A c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.