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 |
|---|---|---|---|---|---|---|---|
d8556707aa3ab0bc89878e0b5daaaeb7b54616ae | Disable images | zephyr/lib/bugdown.py | zephyr/lib/bugdown.py | import re
import markdown
# We need to re-initialize the markdown engine every 30 messages
# due to some sort of performance leak in the markdown library.
MAX_MD_ENGINE_USES = 30
_md_engine = None
_use_count = 0
# A link starts after whitespace, and cannot contain spaces,
# end parentheses, or end brackets (which wo... | Python | 0 | @@ -20,16 +20,191 @@
rkdown%0A%0A
+class Bugdown(markdown.Extension):%0A def extendMarkdown(self, md, md_globals):%0A del md.inlinePatterns%5B'image_link'%5D%0A del md.inlinePatterns%5B'image_reference'%5D%0A%0A
# We nee
@@ -1152,16 +1152,27 @@
'nl2br'
+, Bugdown()
%5D,%0A
|
e4d32def2ef91518198e6a500908ea3839c43257 | Fix typo | cairis/data/DimensionDAO.py | cairis/data/DimensionDAO.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may... | Python | 0.999999 | @@ -1503,17 +1503,17 @@
measure'
-
+,
'counter
|
4c1d0877fabf3f95c488e58d2460a9ca2330b3eb | Support --host for devserver | zeus/cli/devserver.py | zeus/cli/devserver.py | import click
import os
import socket
import sys
from subprocess import list2cmdline
from honcho.manager import Manager
from .base import cli
DEFAULT_HOST_NAME = socket.gethostname().split(".", 1)[0].lower()
@cli.command()
@click.option("--environment", default="development", help="The environment name.")
@click.op... | Python | 0 | @@ -351,32 +351,83 @@
default=False)%0A
+@click.option(%22--host%22, %22-h%22, default=%22127.0.0.1%22)%0A
@click.option(%22-
@@ -693,16 +693,21 @@
vserver(
+%0A
environm
@@ -719,16 +719,22 @@
workers,
+ host,
port, n
@@ -772,16 +772,17 @@
sub_port
+%0A
):%0A o
@@ -1173,33 +1173,26 @@
l = %22http://
-... |
6c69c58761acf2fdd20df656f60f1e94203b5072 | stop useless print | aiy-voice/assistant_library_with_local_commands_demo.py | aiy-voice/assistant_library_with_local_commands_demo.py | #!/usr/bin/env python3
# Copyright 2017 Google 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... | Python | 0.000006 | @@ -16,16 +16,41 @@
python3%0A
+%0A# TODO: button control%0A%0A
# Copyri
@@ -2510,32 +2510,33 @@
getvolume()%0A
+#
print(%22Current v
@@ -2628,10 +2628,10 @@
%5D %3E
-30
+25
els
@@ -2745,24 +2745,25 @@
olume()%0A
+#
print(%22Curre
@@ -2855,17 +2855,17 @@
e%5B0%5D %3C 7
-0
+5
else 10
@@ -2866,24 +28... |
1748d039feb40ddb1ceef0cf2f7b49270d0aae6e | Change to support Python3 | carmen/resolvers/profile.py | carmen/resolvers/profile.py | """Resolvers based on Twitter user profile data."""
import re
import warnings
from ..names import *
from ..resolver import AbstractResolver, register
STATE_RE = re.compile(r'.+,\s*(\w+)')
NORMALIZATION_RE = re.compile(r'\s+|\W')
def normalize(location_name, preserve_commas=False):
"""Normalize *location_name... | Python | 0 | @@ -1684,16 +1684,35 @@
tweet):%0A
+ import sys%0A
@@ -1771,16 +1771,127 @@
n', '')%0A
+ if sys.version_info%5B0%5D %3C 3:%0A location_string = location_string.encode('utf-8')%0A %0A
@@ -1934,24 +1934,25 @@
return None%0A
+%0A
norm
@@ -1987,16 +1987,17... |
d9b7be65aae78a76454cae4f1f75029f1fa5084b | rename mapper to mapfxn to avoid confusion with mrjob.MRJob.mapper() | specializers/ftdock/cloud_dock.py | specializers/ftdock/cloud_dock.py | from mrjob.protocol import PickleProtocol as protocol
from asp.jit import mapreduce_support as mr
import cPickle as pickle
class FtdockMRJob(mr.AspMRJob):
DEFAULT_INPUT_PROTOCOL = 'pickle'
DEFAULT_PROTOCOL = 'pickle'
def configure_options(self):
super(mr.AspMRJob, self).configure_options()
... | Python | 0 | @@ -1479,19 +1479,19 @@
map
-per
+fxn
= self.
@@ -1566,27 +1566,27 @@
return map
-per
+fxn
(self._lists
|
a5f092b81233db019df44c46b25b320cfaca2730 | Add world_chunk_update event, emitted for every single chunk | spockbot/plugins/helpers/world.py | spockbot/plugins/helpers/world.py | """
Provides a very raw (but very fast) world map for use by plugins. Plugins
interested in a more comprehensive world map view can use mcp.mapdata to
interpret blocks and their metadata more comprehensively. Planned to provide
light level interpretation based on sky light and time of day
"""
from spockbot.mcdata impo... | Python | 0.000007 | @@ -2307,32 +2307,168 @@
umn(packet.data)
+%0A location = packet.data%5B'chunk_x'%5D, packet.data%5B'chunk_z'%5D%0A self.event.emit('world_chunk_update', %7B'location': location%7D)
%0A%0A def handle
@@ -3731,32 +3731,207 @@
ulk(packet.data)
+%0A for meta in packet.data%5B'metadata'%5D:%0A ... |
a0ac12676f3b716ad241a28f4e1725c0d3be5eed | update squad5 | dictlearn/extractive_qa_configs.py | dictlearn/extractive_qa_configs.py | from dictlearn.config_registry import ConfigRegistry
qa_config_registry = ConfigRegistry()
qa_config_registry.set_root_config({
# data
'data_path' : "",
'dict_path' : "",
'vocab_path' : "",
'dict_vocab_path' : "",
'embedding_path' : "",
'layout' : 'standard',
'num_input_words' : 10000,
... | Python | 0 | @@ -2565,16 +2565,41 @@
et3.
-1
+2
.json'%0A
+ c%5B'batch_size'%5D = 32%0A
|
c8a280d6466623b8d76fa01c12ebf295151d35d6 | remove primary key constraint | wim-adaptor/vtn-api/database/sqlalchemy_declaritive.py | wim-adaptor/vtn-api/database/sqlalchemy_declaritive.py | import os
import sys
from sqlalchemy import create_engine, Column, ForeignKey, Integer, String
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class Connectivity(Base):
__tablename__ = 'connectivity'
# define the columns for the table
s... | Python | 0.000384 | @@ -441,25 +441,8 @@
250)
-,primary_key=True
)%0A%09l
|
440f42a062e30ce8953c7a1a69aea2e6f62248f8 | Allow 2016 in boilerplate | hack/boilerplate/boilerplate.py | hack/boilerplate/boilerplate.py | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... | Python | 0.00043 | @@ -2239,16 +2239,21 @@
regex %22
+2016%7C
2015%7C201
@@ -4198,16 +4198,21 @@
014%7C2015
+%7C2016
)' )%0A
|
f984db30c4d4cab1377d21a73ec0b802590f8a51 | Update sqlalchemy migrate scripts for postgres | trove/db/sqlalchemy/migrate_repo/versions/014_update_instance_flavor_id.py | trove/db/sqlalchemy/migrate_repo/versions/014_update_instance_flavor_id.py | # Copyright 2012 OpenStack Foundation
#
# 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.000001 | @@ -903,24 +903,489 @@
rate_engine%0A
+ # pgsql %3C= 8.3 was lax about char-%3Eother casting but this was tightened up%0A # in 8.4+. We now have to specify the USING clause for the cast to succeed.%0A # NB: The generated sqlalchemy query doesn't support this, so this override%0A # is needed.%0A if migra... |
dbe1ac7fda9188e59479ff4716141651d627f76c | Fix cheroot.test.test_errors doc spelling | cheroot/test/test_errors.py | cheroot/test/test_errors.py | """Test suite for ``cheroot.errors``."""
import pytest
from cheroot import errors
from .._compat import IS_LINUX, IS_MACOS, IS_WINDOWS
@pytest.mark.parametrize(
'err_names,err_nums',
(
(('', 'some-nonsense-name'), []),
(
(
'EPROTOTYPE', 'EAGAIN', 'EWOULDBLOCK',
... | Python | 0.000442 | @@ -613,16 +613,18 @@
st that
+%60%60
plat_spe
@@ -639,17 +639,14 @@
rors
- retrieve
+%60%60 get
s co
@@ -658,12 +658,18 @@
err
+or
num
+bers
lis
|
423a15d7c8841b40bddbd129b2abfb1135f0b7c0 | fix date parsing in logsearch | scripts/logfetch/search.py | scripts/logfetch/search.py | import os
import re
import sys
import fnmatch
import logfetch_base
from termcolor import colored
def find_cached_logs(args):
matching_logs = []
log_fn_match = get_matcher(args)
for filename in os.listdir(args.dest):
if fnmatch.fnmatch(filename, log_fn_match) and in_date_range(args, filename):
... | Python | 0.000005 | @@ -765,14 +765,16 @@
l(r%22
+-
%5Cd%7B13%7D
+-
%22, f
@@ -876,16 +876,33 @@
mps%5B-1%5D)
+.replace(%22-%22, %22%22)
%5B0:-3%5D))
|
aa0a133748b958317047e84a1b1b484ede7fa7c3 | Fix unicode in json_job.py urls. | scripts/master/json_job.py | scripts/master/json_job.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.
import json
import urllib
from buildbot.changes.base import PollingChangeSource
from buildbot.process.properties import Properties
from buildbot.schedulers.... | Python | 0.999999 | @@ -1032,24 +1032,36 @@
f._url = url
+.rstrip('/')
+ '/pull'%0A
@@ -3065,16 +3065,28 @@
rl = url
+.rstrip('/')
+ '/acc
@@ -4501,24 +4501,93 @@
rlencoded'%7D%0A
+ # We are guaranteed job_key is a str, but json makes it unicode.%0A
return c
@@ -4612,16 +4612,20 @@
._url %25
+str(
job%5B'job
@@ -4630,16... |
fc1d468d6602022405d4959ea8d12c825a1916f0 | Add AuthToken model | passwordless/models.py | passwordless/models.py | from django.db import models
# Create your models here.
class User(models.Model):
"""
User model
This User model eschews passwords, relying instead on emailed OTP tokens.
"""
username = models.CharField(max_length=30, unique=True)
email = models.EmailField(null=True)
is_active = models.B... | Python | 0 | @@ -3,30 +3,109 @@
om d
-jango.db import models
+atetime import timedelta%0Aimport uuid%0A%0A%0Afrom django.db import models%0Afrom django.utils import timezone
%0A%0A#
@@ -1259,8 +1259,752 @@
User%22%0A%0A
+%0Adef make_token():%0A %22%22%22%0A Generate a random token suitable for activation/confirmation via... |
d9e9e4e9cce22c608ed39b0db1d5edc7ae277332 | Correct metaclass implementation | patchboard/resource.py | patchboard/resource.py | # resource.py
#
# Copyright 2014 BitVault.
from __future__ import print_function
import json
from exception import PatchboardError
class ResourceType(type):
"""A metaclass for resource classes."""
# Must override to supply default arguments
def __new__(cls, name, patchboard, definition, schema, mapp... | Python | 0.000002 | @@ -449,73 +449,8 @@
ng):
-%0A super(ResourceType, cls).__init__(name, (Resource,), %7B%7D)
%0A%0A
@@ -1655,16 +1655,112 @@
False)%0A%0A
+ # Must be called last%0A super(ResourceType, cls).__init__(name, (Resource,), %7B%7D)%0A%0A
%0Aclass R
|
5114bf3960b944c193c37ef8ecbcac50ae098d02 | Add InvalidLengthError class | pathvalidate/_error.py | pathvalidate/_error.py | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <gogogo.vm@gmail.com>
"""
from __future__ import absolute_import
from __future__ import unicode_literals
class NullNameError(ValueError):
"""
Raised when a name is empty.
"""
class InvalidCharError(ValueError):
"""
Raised when includes in... | Python | 0 | @@ -349,16 +349,113 @@
string.%0A %22%22%22%0A
+%0A%0Aclass InvalidLengthError(ValueError):%0A %22%22%22%0A Raised when a string too long/short.%0A %22%22%22%0A
|
c37591f23e33383e7b63525db243aba7e0a46fc3 | add run in log file | scripts/parallel_driver.py | scripts/parallel_driver.py | #!/usr/bin/env python
"""
Usage example:
1. First realization per model
./parallel_driver.py -p my_Param_ENSO.py --mip cmip6 --modnames all --realization r1i1p1f1 --metricsCollection ENSO_perf
2. All realizations of individual models
./parallel_driver.py -p my_Param_ENSO.py --mip cmip6 --modnames all --realization all... | Python | 0.000001 | @@ -5324,16 +5324,21 @@
, model,
+ run,
case_id
|
b479491e914c271a41ba92c958c6e3d42ccdb799 | add get_followers to twitter api | polbotcheck/twitter_api.py | polbotcheck/twitter_api.py | import tweepy
import json
from keys import myauth
import pprint
import time
import db
auth = tweepy.OAuthHandler(myauth['consumer_key'], myauth['consumer_secret'])
auth.set_access_token(myauth['access_token'], myauth['access_token_secret'] )
api = tweepy.API(auth,wait_on_rate_limit=True, wait_on_rate_limit_notify=Tru... | Python | 0 | @@ -1783,16 +1783,322 @@
ontent%0A%0A
+def get_followers(screen_name):%0A timestamp = time.strftime(%22%25d.%25m.%25Y %25H:%25M:%25S%22, time.localtime())%0A print(timestamp)%0A followers =%5B%5D%0A for user in limit_handled(tweepy.Cursor(twitter_api.followers, screen_name=screen_name, count=200).items()):... |
b40e79d7f5884e5d4681159c9b6d52edbc5d8549 | Fix another import | hiicart/gateway/amazon/views.py | hiicart/gateway/amazon/views.py | import logging
import pprint
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest
from django.views.decorators.cache import never_cache
from django.views.decorators.csrf import csrf_view_exempt
from hiicart.gateway.amazon.ipn import AmazonIPN
from hiicart.gateway.countries import COUNTRIES... | Python | 0.000206 | @@ -318,48 +318,8 @@
IES%0A
-from hiicart.models import cart_by_uuid%0A
from
@@ -357,16 +357,30 @@
ceptions
+, cart_by_uuid
%0A%0Alog =
|
41df2254187bd895e1884563ac0cc3a4353ced5b | use string types instead of unicode in web.querystring | circuits/web/querystring.py | circuits/web/querystring.py | # -*- coding: utf-8 -*-
try:
from urlparse import parse_qsl
except ImportError:
from urllib.parse import parse_qsl # NOQA
from circuits.six import iteritems, text_type
def parse(data):
obj = QueryStringParser(data)
return obj.result
class QueryStringToken(object):
ARRAY = "ARRAY"
OBJEC... | Python | 0.000005 | @@ -164,25 +164,28 @@
ritems,
-text
+string
_type
+s
%0A%0A%0Adef p
@@ -469,17 +469,20 @@
ta,
-text
+string
_type
+s
):%0A
|
042edce052d5307fff8dfbce8c08b72fb72af7f1 | Remove some noise | ckanext/groupadmin/authz.py | ckanext/groupadmin/authz.py | '''This module monkey patches functions in ckan/authz.py and replaces the
default roles with custom roles and decorates
has_user_permission_for_group_org_org to allow a GroupAdmin to admin groups.
GroupAdmins can manage all organizations/groups, but have no other sysadmin
powers.
'''
from ckan import authz, model
from ... | Python | 0.000199 | @@ -312,44 +312,8 @@
del%0A
-from ckan.common import OrderedDict%0A
from
@@ -394,100 +394,8 @@
in%0A%0A
-import logging%0Alog = logging.getLogger(__name__)%0A%0A%0Aold_auth_roles = authz.ROLE_PERMISSIONS%0A%0A
auth
@@ -468,42 +468,8 @@
%7D)%0A%0A
-log.info(authz.ROLE_PERMISSIONS)%0A%0A
%0Adef
|
afb400e16c1335531f259218a8b9937de48644e9 | Update stream health health api url | polyaxon/checks/streams.py | polyaxon/checks/streams.py | from checks.base import Check
from checks.results import Result
from libs.api import get_settings_ws_api_url
from libs.http import safe_request
class StreamsCheck(Check):
@classmethod
def run(cls):
response = safe_request(get_settings_ws_api_url(), 'GET')
status_code = response.status_code
... | Python | 0.000001 | @@ -234,16 +234,36 @@
request(
+'%7B%7D/_health'.format(
get_sett
@@ -279,16 +279,17 @@
pi_url()
+)
, 'GET')
|
35f9f3b3a1ca9174194975e5281682c2712b653f | add get_absolute_url to article categories too | project/articles/models.py | project/articles/models.py | from django.db import models
from django.utils.translation import ugettext as _
from django.utils.timezone import now
from markitup.fields import MarkupField
from autoslug import AutoSlugField
from sorl.thumbnail import ImageField
class Category(models.Model):
class Meta:
verbose_name = _('Category')
... | Python | 0 | @@ -539,16 +539,131 @@
f.name%0A%0A
+ @models.permalink%0A def get_absolute_url(self):%0A return 'articles:category', (), %7B'slug': self.slug%7D%0A%0A
%0Aclass A
|
f4ad0904dd7411b3e9fad7608f1de385530da155 | Bump version | octave_kernel.py | octave_kernel.py | from __future__ import print_function
from metakernel import MetaKernel, ProcessMetaKernel, REPLWrapper, u
from IPython.display import Image, SVG
import subprocess
import os
import sys
import tempfile
__version__ = '0.12.9'
class OctaveKernel(ProcessMetaKernel):
implementation = 'Octave Kernel'
implementat... | Python | 0 | @@ -221,9 +221,10 @@
.12.
-9
+10
'%0A%0A%0A
|
0623212baaccb938e19891a50cca58b33b339f9c | Improve version handling | oddt/__init__.py | oddt/__init__.py | """Open Drug Discovery Toolkit
==============================
Universal and easy to use resource for various drug discovery tasks,
ie docking, virutal screening, rescoring.
Attributes
----------
toolkit : module,
Toolkits backend module, currenlty OpenBabel [ob] and RDKit [rdk].
This settin... | Python | 0.000002 | @@ -453,16 +453,29 @@
arnings%0A
+%0Aimport six%0A%0A
try:%0A
@@ -1685,12 +1685,8 @@
v =
-str(
subp
@@ -1713,20 +1713,16 @@
%5B'git',%0A
-
@@ -1815,20 +1815,16 @@
-
'--tags'
@@ -1843,16 +1843,97 @@
.strip()
+%0A if git_v and six.PY3:%0A git_v = git_v.deco... |
f4d41f9a75f464dcf2dca2953536ed28c6221b33 | numPages should be an int | server/central_psparser.py | server/central_psparser.py | import logging
import json
import re
class PSParser():
def __init__(self):
self.logger = logging.getLogger("PSParser")
self.logger.info("Loaded PostScript Parser")
def __getPSFromJID(self, jid):
jobFile = open(jid, 'r')
job = json.load(jobFile)
jobFile.close()
... | Python | 0.999947 | @@ -972,16 +972,20 @@
Pages =
+int(
re.searc
@@ -1031,16 +1031,17 @@
(%22 %22)%5B1%5D
+)
%0A
|
94350201979e6c4a313666da05ce8bcaac7bd0f2 | Update docstring | openmc/source.py | openmc/source.py | from numbers import Real
from xml.etree import ElementTree as ET
import openmc.checkvalue as cv
from openmc.stats.multivariate import UnitSphere, Spatial
from openmc.stats.univariate import Univariate
from ._xml import get_text
class Source:
"""Distribution of phase space coordinates for source sites.
Param... | Python | 0 | @@ -777,24 +777,32 @@
ustom source
+ library
%0A%0A ..
@@ -1450,24 +1450,32 @@
ustom source
+ library
%0A strengt
|
edb04d8e0ae03c9244b7d934fd713efbb94d5a58 | Add api url to album and link | opps/api/urls.py | opps/api/urls.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.conf.urls import patterns, url, include
from tastypie.api import Api
from opps.containers.api import Container
from opps.articles.api import Post
from .conf import settings
_api = Api(api_name=settings.OPPS_API_NAME)
_api.register(Container())
_api.register... | Python | 0 | @@ -198,16 +198,29 @@
ort Post
+, Album, Link
%0A%0Afrom .
@@ -335,16 +335,61 @@
Post())%0A
+_api.register(Album())%0A_api.register(Link())%0A
%0A%0Aurlpat
|
94261ea9fd576a1d0b6ec59d754da94f5c32efcc | Allow to `PUT` linked | shanghai/actions/linked.py | shanghai/actions/linked.py | from django.http import HttpResponseNotFound, HttpResponseBadRequest
from django.db import models
from shanghai.http import HttpResponseNoContent
class LinkedMixin(object):
def get_linked_relationship(self):
return self.relationship_for(self.link)
def get_linked_resource(self, relationship=None):
... | Python | 0.000001 | @@ -2360,24 +2360,952 @@
oContent()%0A%0A
+ def put_linked(self):%0A obj = self.get_object_data()%0A relationship = self.get_linked_relationship()%0A linked_resource = self.get_linked_resource()%0A linked_pk = self.get_linked_input_data()%0A%0A if not obj:%0A return Htt... |
3df0f14a9e2625081a1b1f51aef997d18b4a9b50 | Remove Logging | pabiana/brain.py | pabiana/brain.py | import importlib
import logging
import multiprocessing as mp
import os
import signal
from os import path
import pip
from . import _default_clock, load_interfaces, repo
def main(*args):
args = list(args)
stop_pip = False
if '-X' in args:
stop_pip = True
args.remove('-X')
if '-C' in args:
args.append('clock... | Python | 0.000002 | @@ -1236,86 +1236,25 @@
:%0A%09%09
-logging.info('Import Error %25s:%25s', module_name, area_name)%0A%09%09if module_name is
+if module_name ==
'cl
@@ -1272,18 +1272,18 @@
ea_name
-is
+==
'clock'
@@ -1312,42 +1312,8 @@
ock%0A
-%09%09%09logging.info('Module %25s', mod)%0A
%09%09el
|
e82d477194393ff3142f6c25c5db4c7b7f2a98a5 | Call ConsoleViewer init | simpleai/search/viewers.py | simpleai/search/viewers.py | # coding: utf-8
from os import path
from threading import Thread
from time import sleep
class DummyViewer(object):
def start(self):
pass
def new_iteration(self, fringe):
pass
def chosen_node(self, node, is_goal):
pass
def expanded(self, node, successors):
pass
clas... | Python | 0 | @@ -1219,16 +1219,74 @@
=8000):%0A
+ super(WebViewer, self).__init__(interactive=True)%0A
|
e165d16660cb10a7008be2b7566a6db471dafde0 | Fixing a typo that handles generating new mailbox names. | django_mailbox/management/commands/processincomingmessage.py | django_mailbox/management/commands/processincomingmessage.py | import email
import logging
import rfc822
import sys
from django.core.management.base import BaseCommand
from django_mailbox.models import Mailbox
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
class Command(BaseCommand):
def handle(self, *args, **options):
message = email.... | Python | 0.999963 | @@ -729,16 +729,17 @@
%5B'from'%5D
+)
%5B1%5D%5B0:25
@@ -740,17 +740,16 @@
%5D%5B0:255%5D
-)
%0A
|
cb117d449c3e5d611951a5d1a9efbafd34525238 | fix finding files | chandra_suli/make_lightcurve.py | chandra_suli/make_lightcurve.py | #!/usr/bin/env python
"""
Generate lightcurves for each candidate given a list of candidates
"""
import argparse
import os
import sys
import numpy as np
import astropy.io.fits as pyfits
import matplotlib.pyplot as plt
import seaborn as sbs
from chandra_suli import find_files
from chandra_suli import logging_system
f... | Python | 0.000366 | @@ -1612,32 +1612,56 @@
iles.find_files(
+os.path.join(data_path,
str(obsid), %22ccd
@@ -1646,32 +1646,33 @@
path, str(obsid)
+)
, %22ccd_%25s_%25s_fil
@@ -1764,16 +1764,40 @@
d_files(
+os.path.join(data_path,
str(obsi
@@ -1798,16 +1798,17 @@
r(obsid)
+)
, %22ccd_%25
|
cfa8b88e3d86e560415260eb596dd3bbdab52736 | Fix test of auto_backup_download | auto_backup_download/tests/test_auto_backup_download.py | auto_backup_download/tests/test_auto_backup_download.py | # -*- coding: utf-8 -*-
# Copyright 2017 Onestein (<http://www.onestein.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests import common
from odoo.exceptions import Warning
class TestAutoBackupDownload(common.TransactionCase):
def test_01_create_not_existing(self):
... | Python | 0.000003 | @@ -529,440 +529,104 @@
est
-computed field file_ids%0A self.assertEqual(len(backup_dir.file_ids), 0)%0A%0A # test count list of directory%0A self.assertEqual(len(backup_dir.file_ids), backup_dir.file_count)%0A%0A # test reload list of directory%0A with self.assertRaises(Warning):%0... |
79ec3f3ebabd1625830952ecdec1b0761c2b5324 | Rewrite serialization of Attempt submit response | web/attempts/rest.py | web/attempts/rest.py | from django.db import transaction
from rest_framework import validators, decorators, status
from rest_framework.authentication import TokenAuthentication
from rest_framework.response import Response
from rest_framework.serializers import ModelSerializer, Field
from rest_framework.viewsets import ModelViewSet
from .mode... | Python | 0 | @@ -1,12 +1,24 @@
+import json%0A
from django.
@@ -436,16 +436,385 @@
rn data%0A
+ %0A%0Aclass JSONStringField(Field):%0A %22%22%22%0A Store a JSON object in a TextField.%0A When object is received store its json dump.%0A When object is retrieved load JSON object from string representation. %0A ... |
c3996af1f7b201355d1cbcd6ef4c8fe420c8b67e | Fix lint | solutions/uri/1028/1028.py | solutions/uri/1028/1028.py | import sys
def gcd(a, b):
while b > 0:
a, b = b, a % b
return a
n = int(input())
for line in range(n):
a, b = map(int, input().split())
print(gcd(a, b))
| Python | 0.000032 | @@ -1,17 +1,4 @@
-import sys%0A%0A%0A
def
|
f43ffd907302dc87a3682ada1d36d3a195970ec4 | Refactor URLWrapper subclasses to make slugs settable again (#2242) | pelican/urlwrappers.py | pelican/urlwrappers.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import functools
import logging
import os
import six
from pelican.utils import python_2_unicode_compatible, slugify
logger = logging.getLogger(__name__)
@python_2_unicode_compatible
@functools.total_ordering
class URLWrapper(object):
def __init__... | Python | 0 | @@ -907,84 +907,34 @@
ame,
-%0A self.settings.get('SLUG_SUBSTITUTIONS', ()
+ self._slug_substitutions(
))%0A
@@ -1130,24 +1130,120 @@
lug = slug%0A%0A
+ def _slug_substitutions(self):%0A return self.settings.get('SLUG_SUBSTITUTIONS', ()))%0A%0A
def as_d
@@ -3472,38 +34... |
36436f8afa6310802a3161eba9f7b00844bfe9c4 | Add a FOR UPDATE NOWAIT at the beginning of the transaction. | base_location_geonames_import/wizard/geonames_import.py | base_location_geonames_import/wizard/geonames_import.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# Base Location Geonames Import module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: y... | Python | 0 | @@ -3726,16 +3726,155 @@
delete:%0A
+ cr.execute('SELECT id FROM res_better_zip WHERE id in %25s '%0A 'FOR UPDATE NOWAIT', (tuple(bzip_ids_to_delete), ))%0A
|
5fd1f7cbe9534a47c4dc837773f22f6f177fdcf5 | Update affineHacker: fixed imports and typo | books/CrackingCodesWithPython/Chapter15/affineHacker.py | books/CrackingCodesWithPython/Chapter15/affineHacker.py | # Affine Cipher Hacker
# https://www.nostarch.com/crackingcodes/ (BSD Licensed)
import pyperclip, affineCipher, detectEnglish, cryptomath
SILENT_MODE = False
def main():
# You might want to copy & paste this text from the source code at
# https://www.nostarch.com/crackingcodes/.
myMessage = """5QG9ol3La6... | Python | 0 | @@ -78,64 +78,308 @@
d)%0A%0A
-import pyperclip, affineCipher, detectEnglish, cryptomat
+from books.CrackingCodesWithPython.pyperclip import copy%0Afrom books.CrackingCodesWithPython.Chapter14.affineCipher import decryptMessage, SYMBOLS, getKeyParts%0Afrom books.CrackingCodesWithPython.Chapter13.cryptomath import gcd%... |
b6727f6bd9f3d8ffe59b17f157180a8fa5e61467 | Fix typo. | py/vttest/fakezk_config.py | py/vttest/fakezk_config.py | # Copyright 2013 Google Inc. All Rights Reserved.
"""Generate a config file for fakezk topology."""
__author__ = 'enisoc@google.com (Anthony Yeh)'
import base64
import codecs
import json
class FakeZkConfig(object):
"""Create fakezk config for use as static topology for vtgate."""
def __init__(self, mysql_port... | Python | 0.001604 | @@ -1290,17 +1290,17 @@
on of Sr
-k
+v
Keyspace
|
d607de07ae3aaa2a245b8eb90cb42ca3e29f6e33 | add lambda sample | 05.Function.py | 05.Function.py | #-*- encoding: utf-8 -*-
# Error
#def func():
def func():
pass
def func(num, num1=1, num2=2):
print(num, num1, num2)
func(1, 3, 4) # 1 3 4
func(5) # 5 1 2
# Error
#func()
def func(**args):
for k, v in args.items():
print('key: ' + k, 'value: ' + v)
for k in args.keys():
print('key... | Python | 0.000001 | @@ -928,12 +928,192 @@
2, 3)) # 5%0D%0A
+%0D%0Adef func2(func, num1, num2):%0D%0A%09return func(num1, num2)%0D%0A%0D%0Adef func(num1, num2):%0D%0A%09return num1 + num2%0D%0A%0D%0Aprint(func2(func, 3, 4)) # 7%0D%0A%0D%0Aprint(func2(lambda a, b: a - b, 7, 4)) # 3
|
e4c9ca4bb21539fe6677a082c9dbc39245785100 | delete line | chainercv/experimental/links/model/pspnet/transforms.py | chainercv/experimental/links/model/pspnet/transforms.py | from __future__ import division
import math
import numpy as np
def convolution_crop(img, size, stride, return_param=False):
"""Strided cropping.
This extracts cropped images from the input. The cropped images are
extracted from the entire image, while taking a constant steps between
neighboring patc... | Python | 0.000008 | @@ -3379,17 +3379,16 @@
show()%0A%0A
-%0A
%22%22%22%0A
|
41294d03a53685668fc9663a375173bd527a76a3 | Version bump | pyblish_starter/version.py | pyblish_starter/version.py |
VERSION_MAJOR = 0
VERSION_MINOR = 2
VERSION_PATCH = 0
version_info = (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
version = '%i.%i.%i' % version_info
__version__ = version
__all__ = ['version', 'version_info', '__version__']
| Python | 0.000001 | @@ -46,17 +46,17 @@
PATCH =
-0
+1
%0A%0Aversio
|
b439017a21ac01ee7fda275753effaf5d103a120 | Change IP. | pybossa/signer/__init__.py | pybossa/signer/__init__.py | # -*- coding: utf8 -*-
# This file is part of PyBossa.
#
# Copyright (C) 2013 SF Isle of Man Limited
#
# PyBossa is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at... | Python | 0 | @@ -73,32 +73,24 @@
201
-3 SF Isle of Man Limited
+5 SciFabric LTD.
%0A#%0A#
|
026967d81386f31c779ea0b64cd0dea502270a80 | Fix import error if invoicegenerator is not available | pyconde/attendees/tasks.py | pyconde/attendees/tasks.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.core.mail import EmailMessage
from django.template.loader import render_to_string
from django.utils.crypto import get_random_string
from django.utils.translation import ugettext as _
from invoicegenerator import generate_invoice
f... | Python | 0.000001 | @@ -269,55 +269,8 @@
_%0A%0A
-from invoicegenerator import generate_invoice%0A%0A
from
@@ -653,32 +653,86 @@
ata, **kwargs):%0A
+ from invoicegenerator import generate_invoice%0A
return g
|
54d39aaf8c31a5827ae7338fefe7a1d6a19d52cf | Add missing docstring. | pyslvs_ui/info/__init__.py | pyslvs_ui/info/__init__.py | # -*- coding: utf-8 -*-
"""'info' module contains Pyslvs program information."""
__all__ = [
'KERNELS',
'SYS_INFO',
'ARGUMENTS',
'HAS_SLVS',
'Kernel',
'check_update',
'PyslvsAbout',
'html',
'logger',
'XStream',
'size_format',
]
__author__ = "Yuan Chang"
__copyright__ = "Cop... | Python | 0.000005 | @@ -587,16 +587,47 @@
-%3E str:%0A
+ %22%22%22Calculate file size.%22%22%22%0A
if n
|
7b19611d30dfc9091823ae3d960ab2790dfe9cfc | Apply a blur filter automatically for each detected face | python/blur_human_faces.py | python/blur_human_faces.py | import requests
import json
imgUrl = 'https://pixlab.io/images/m3.jpg' # Target picture we want to blur any face on
# Detect all human faces in a given image via /facedetect first and blur all of them later via /mogrify.
# https://pixlab.io/cmd?id=facedetect and https://pixlab.io/cmd?id=mogrify for additional informa... | Python | 0 | @@ -665,16 +665,17 @@
%09exit()%0A
+%0A
# Pass t
@@ -677,30 +677,22 @@
ass the
-detected
fac
-es
+ial
coordin
@@ -696,16 +696,39 @@
dinates
+for each detected face
untouche
|
60b4915569c891675ed5dc86ff40a7a2587841d1 | Use .pos_ instead of .tags_ in displaCy by default (see #1006) | spacy/displacy/__init__.py | spacy/displacy/__init__.py | # coding: utf8
from __future__ import unicode_literals
from .render import DependencyRenderer, EntityRenderer
from ..tokens import Doc
from ..compat import b_to_str
from ..util import prints, is_in_jupyter
_html = {}
IS_JUPYTER = is_in_jupyter()
def render(docs, style='dep', page=False, minify=False, jupyter=IS_JU... | Python | 0 | @@ -3756,19 +3756,19 @@
tag': w.
-tag
+pos
_%7D for w
|
8a950dbfb1281216ed270bf6363c7a71d857133f | Make datetime and time +00:00 handling behavior consistent. Fix #3. | webhooks/encoders.py | webhooks/encoders.py | """
Serialize data to/from JSON
Inspired by https://github.com/django/django/blob/master/django/core/serializers/json.py
"""
# Avoid shadowing the standard library json module
from __future__ import absolute_import
from __future__ import unicode_literals
import datetime
import decimal
import json
class WebHooksJSON... | Python | 0.000001 | @@ -954,16 +954,86 @@
r%5B:12%5D%0A
+ if r.endswith('+00:00'):%0A r = r%5B:-6%5D + 'Z'%0A
|
8120b641ccb66b088fa70c028e5be542bf561dfd | Update lex_attrs.py (#5608) | spacy/lang/hy/lex_attrs.py | spacy/lang/hy/lex_attrs.py | # coding: utf8
from __future__ import unicode_literals
from ...attrs import LIKE_NUM
_num_words = [
"զրօ",
"մէկ",
"երկու",
"երեք",
"չորս",
"հինգ",
"վեց",
"յոթ",
"ութ",
"ինը",
"տասը",
"տասնմեկ",
"տասներկու",
"տասներեք",
"տասնչորս",
"տասնհինգ",
"տա... | Python | 0 | @@ -107,9 +107,9 @@
%22%D5%A6%D6%80
-%D6%85
+%D5%B8
%22,%0A
@@ -117,9 +117,9 @@
%22%D5%B4
-%D5%A7
+%D5%A5
%D5%AF%22,%0A
@@ -430,17 +430,16 @@
%22%D5%BE%D5%A1%D5%A9
-%D6%81
%D5%BD%D5%B8%D6%82%D5%B6%22,%0A
@@ -477,17 +477,17 @@
%0A %22%D5%AB%D5%B6
-%D5%AB
+%D5%B6
%D5%BD%D5%B8%D6%82%D5%B6%22,%0A
|
cd8024c762bf5bae8caf210b9224548bee55ee04 | Bump version to 6.1.5a3 | platformio/__init__.py | platformio/__init__.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Python | 0 | @@ -636,17 +636,17 @@
, 1, %225a
-2
+3
%22)%0A__ver
|
12c22ebdf3c7e84f5f9c6b32329f343c8317f11b | Correct comments | python/dbtools/__init__.py | python/dbtools/__init__.py | '''
This library provides database access routines.
It's based on the re-usable parts of tailoredstats.
Owain Kenway
'''
'''
Generally abstract away DB queries, such that all complexity is replaced with:
dbtools.dbquery(db, query)
'''
def dbquery(db, query, mysqlhost="mysql.external.... | Python | 0.000023 | @@ -1398,13 +1398,8 @@
wner
-/node
lim
|
8d459d86d33992129726ef177ed24fe8a00e9b75 | Bump version to 4.0.0rc1 | platformio/__init__.py | platformio/__init__.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Python | 0 | @@ -627,10 +627,11 @@
, %220
-b3
+rc1
%22)%0A_
|
5f917746e86c733d37c56e15a97f7aecb73fa75f | fix bug comparing string with int. int(games) | python/guess_the_player.py | python/guess_the_player.py | # importing modules
import os
import csv
import time
import random
import tweepy
import player
# secrets
consumer_key = os.getenv('c_key')
consumer_secret = os.getenv('c_secret')
access_token = os.getenv('a_token')
access_token_secret = os.getenv('a_secret')
# authentication
auth = tweepy.OAuthHandler(consumer_key, c... | Python | 0 | @@ -536,16 +536,20 @@
le)) if
+int(
a%5B'Games
@@ -550,16 +550,17 @@
'Games'%5D
+)
%3E 1%5D)%0A
|
a172a17c815e8fcbe0f8473c6bac1ea1d9714817 | Bump version to 4.4.0a4 | platformio/__init__.py | platformio/__init__.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Python | 0 | @@ -624,17 +624,17 @@
, 4, %220a
-3
+4
%22)%0A__ver
|
54921c5dbdc68893fe45649d07d067818c36889b | Bump version to 4.0.0b3 | platformio/__init__.py | platformio/__init__.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Python | 0 | @@ -624,17 +624,17 @@
, 0, %220b
-2
+3
%22)%0A__ver
|
302a102a3c72224d2039df35fe4b292e9dd540d3 | fix typo in docstring | client/libs/logdog/bootstrap.py | client/libs/logdog/bootstrap.py | # Copyright 2016 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import collections
import os
from . import stream, streamname
class NotBootstrappedError(RuntimeError):
"""Raised when the current environmen... | Python | 0.020727 | @@ -1395,16 +1395,17 @@
not boo
+t
strapped
|
a98404a8d7d36fb63d4a402038541264fbd8da07 | fix unicode issues with MDPI | plugins/python/mdpi.py | plugins/python/mdpi.py | #!/usr/bin/env python2.6
import os, sys, re, urllib2, cookielib, string
from urllib import urlencode
from urllib2 import urlopen
from copy import copy
import BeautifulSoup
import htmlentitydefs
import html5lib
from html5lib import treebuilders
import warnings
import codecs
warnings.simplefilter("ignore",DeprecationWar... | Python | 0.000588 | @@ -1128,16 +1128,75 @@
e as is%0A
+ #return re.sub(%22&#?%5Cw+;%22, fixup, text).encode('utf-8')%0A
retu
@@ -1228,32 +1228,16 @@
p, text)
-.encode('utf-8')
%0A%0Adef me
@@ -1641,16 +1641,80 @@
oup(1)%0A%0A
+%09#u = codecs.getreader('utf-8')(urlopen(url))%0A%09#page = u.read()%0A
%09page =
@@ -1734,16 +17... |
07e21bfc0d6273a982ed033e78c964c1474eda96 | make queryset distinct to prevent a too many pages exception | cmsplugin_cascade/link/forms.py | cmsplugin_cascade/link/forms.py | import re
import requests
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.contrib.admin.sites import site as admin_site
from django.db.models.fields.related import ManyToOneRel
from django.forms import fields, Media, ModelChoiceField
from django.forms.widgets import RadioSelect
from d... | Python | 0.000001 | @@ -2347,16 +2347,27 @@
queryset
+.distinct()
)%0A
|
74ecf023ef13fdba6378d6b50b3eaeb06b9e0c97 | Rename env vars & modify query | rebuild_dependant_repos.py | rebuild_dependant_repos.py | import os, sys, re, logging
import requests
from github import Github
logging.basicConfig(level=logging.DEBUG)
CIRCLECI_BASEURL = "https://circleci.com/api/v2"
CIRCLECI_ACCESS_TOKEN = os.environ["TAO_CIRCLECI_TOKEN"]
GITHUB_ACCESS_TOKEN = os.environ["TAO_GITHUB_TOKEN"]
g = Github(GITHUB_ACCESS_TOKEN)
if len(sys.argv... | Python | 0 | @@ -15,17 +15,8 @@
, re
-, logging
%0Aimp
@@ -59,50 +59,8 @@
ub%0A%0A
-logging.basicConfig(level=logging.DEBUG)%0A%0A
CIRC
@@ -136,24 +136,27 @@
os.environ%5B%22
+AVA
TAO_CIRCLECI
@@ -198,16 +198,19 @@
nviron%5B%22
+AVA
TAO_GITH
@@ -487,13 +487,8 @@
ile
-FROM
%22 +
@@ -499,29 +499,21 @@
e_name%0A%0A
-logg... |
b43b34418d244acee363485d42a23694ed9d654f | Add fields to work serializer for GET methods | works/serializers.py | works/serializers.py | from rest_framework import serializers
from . import models
from clients import serializers as client_serializers
from users import serializers as user_serializers
class WorkTypeSerializer(serializers.ModelSerializer):
name = serializers.CharField(read_only=True)
class Meta:
model = models.WorkType... | Python | 0 | @@ -1371,24 +1371,870 @@
'name',)%0A%0A%0A
+class ArtWorkSerializer(serializers.ModelSerializer):%0A%0A class Meta:%0A model = models.ArtWork%0A fields = ('id', 'work', 'art_type', 'quantity',)%0A%0A%0Aclass FileSerializer(serializers.ModelSerializer):%0A%0A class Meta:%0A model = models.Fi... |
a6fbb077eb3067cedc501cc8b0a9e99594cef9ed | Use memoize for compliance cache | recruit_app/hr/managers.py | recruit_app/hr/managers.py | # -*- coding: utf-8 -*-
from recruit_app.user.models import EveCharacter
from recruit_app.extensions import cache_extension
from flask import current_app
import requests
from bs4 import BeautifulSoup
class HrManager:
def __init__(self):
pass
@staticmethod
@cache_extension.cached(timeout=3600, key_... | Python | 0 | @@ -292,14 +292,15 @@
ion.
-cached
+memoize
(tim
@@ -312,37 +312,8 @@
3600
-, key_prefix='get_compliance'
)%0A
|
0ba2b371e08c40e7c4d56efee6f4a828f1e7aeb0 | Update functions.py | ref/functions/functions.py | ref/functions/functions.py | #functions.py
#Written by Jesse Gallarzo
#Add code here
#def function One:
def main():
#Add code here
print('Test')
main()
| Python | 0.000001 | @@ -68,12 +68,57 @@
tion
-
One
+():%0A%0A#def functionTwo():%0A%0A#def functionThree()
:%0A%0Ad
|
2e7b319524ad3d86deeca0be65871d79f4208d19 | remove useless debug print | cmemcached.py | cmemcached.py | import os
import sys
import traceback
from zlib import compress, decompress, error as zlib_error
from cmemcached_imp import *
import cmemcached_imp
import threading
_FLAG_PICKLE = 1 << 0
_FLAG_INTEGER = 1 << 1
_FLAG_LONG = 1 << 2
_FLAG_BOOL = 1 << 3
_FLAG_COMPRESS = 1 << 4
_FLAG_MARSHAL = 1 << 5
VERSION = "0.41-green... | Python | 0.000004 | @@ -2547,47 +2547,8 @@
mp)%0A
- print %3E%3E sys.stderr, val, flag%0A
|
85d65439614a87c8a8884fa36c85d2f9f196c53c | add some tests around is_valid() | armstrong/apps/donations/tests/forms.py | armstrong/apps/donations/tests/forms.py | import fudge
import random
from ._utils import TestCase
from .. import forms
class BaseDonationFormTestCase(TestCase):
def test_applies_promo_code(self):
promo_code = self.random_discount
data = self.get_base_random_data()
data["promo_code"] = promo_code.code
form = forms.BaseDona... | Python | 0.000016 | @@ -50,16 +50,41 @@
stCase%0A%0A
+from .. import constants%0A
from ..
@@ -2306,16 +2306,1248 @@
sForm)%0A%0A
+ def test_is_valid_uses_mailing_address_form_by_default(self):%0A is_valid_true = fudge.Fake().provides(%22is_valid%22).returns(True)%0A is_valid_false = fudge.Fake().provides(%22is_valid%2... |
5de02410d6a1b78b8ac5f2c6fed6d119a76565a5 | Remove print statement | agenda/events/templatetags/calendar.py | agenda/events/templatetags/calendar.py | #
# Copyright (C) 2009 Novopia Solutions Inc.
#
# Author: Pierre-Luc Beaudoin <pierre-luc.beaudoin@nov
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License,... | Python | 0.007015 | @@ -1629,16 +1629,18 @@
()))%0A
+ #
print l
|
7847d22f95f44792e35108af24267161411c5bf1 | Remove settings override with no effect | analytical/tests/test_tag_gosquared.py | analytical/tests/test_tag_gosquared.py | """
Tests for the GoSquared template tags and filters.
"""
from django.contrib.auth.models import User, AnonymousUser
from django.http import HttpRequest
from django.template import Context
from django.test.utils import override_settings
from analytical.templatetags.gosquared import GoSquaredNode
from analytical.test... | Python | 0 | @@ -1840,22 +1840,8 @@
True
-, USER_ID=None
)%0A
|
8713f44fbd35f012ac7e01a64cffcfdf846fee9f | Remove a relative import that escaped test.test_importlib. | Lib/test/test_importlib/__init__.py | Lib/test/test_importlib/__init__.py | import os
import sys
from .. import support
import unittest
def test_suite(package=__package__, directory=os.path.dirname(__file__)):
suite = unittest.TestSuite()
for name in os.listdir(directory):
if name.startswith(('.', '__')):
continue
path = os.path.join(directory, name)
... | Python | 0 | @@ -23,10 +23,12 @@
rom
-..
+test
imp
|
4d597a8e71c0020b0f1d36e1cca64b5a353b0643 | modify version | Abe/version.py | Abe/version.py | __version__ = '0.8pre'
| Python | 0 | @@ -15,9 +15,7 @@
'0.8
-pre
+8
'%0A
|
8c7abe561cd95331fef17b4fd1c7fe67386826a2 | change the input url | AddDataTest.py | AddDataTest.py | __author__ = 'chuqiao'
import EventsPortal
from datetime import datetime
import logging
def logger():
"""
Function that initialises logging system
"""
global logger
# create logger with 'syncsolr'
logger = logging.getLogger('adddata')
logger.setLevel(logging.DEBUG)
# specifies the ... | Python | 0.999997 | @@ -2054,33 +2054,38 @@
rg/events%22,%22
-localhost
+139.162.217.53
:8983/solr/e
@@ -2080,33 +2080,33 @@
:8983/solr/event
-_
+s
portal%22)%0Alogger.
@@ -2332,25 +2332,30 @@
vents%22,%22
-localhost
+139.162.217.53
:8983/so
@@ -2354,26 +2354,26 @@
:8983/solr/event
-_
+s
portal%22)%0A
|
d98cdb7eae40b5bb11b5d1fc0eacc35ef6bf310d | Order filter for report page | wye/reports/views.py | wye/reports/views.py | from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from wye.organisations.models import Organisation
from wye.workshops.models import Workshop
from wye.profiles.models import Profile
import datetime
from wye.base.constants import WorkshopStatus
@login_required
def index(requ... | Python | 0 | @@ -844,16 +844,42 @@
ENDING%5D)
+.order_by('expected_date')
%0A pro
|
0403ba1bcbc1089f42cdb0ed7a37439363f4e963 | Fix bug | reid/utils/data/dataset.py | reid/utils/data/dataset.py | from __future__ import print_function
import os.path as osp
import numpy as np
from ..serialization import read_json
def _pluck(identities, indices, relabel=False):
ret = []
for index, pid in enumerate(indices):
pid_images = identities[pid]
for camid, cam_images in enumerate(pid_images):
... | Python | 0.000001 | @@ -3000,32 +3000,37 @@
l_ids, len(self.
+train
val)))%0A
|
de51591761c8a079ca5f594aa3e302ec9a37d38e | Update REMINDERS.py | Misc/REMINDERS.py | Misc/REMINDERS.py | #Python reminders
# Collapse the list for output
''.join(list)
#Flatten list of lists
flat_list = [item for subitem in lists for item in subitem]
#Exammple for checking list for single digit (string)
def checker(string):
print("Boom!" if "7" in str(string) else "there is no 7 in the list")
checker([2, 55, 60, 97, 8... | Python | 0 | @@ -735,16 +735,161 @@
lst%5D)%0A%0A
+#Count Sublists in list%0Areturn str(lst).count('%5B') - 1%0Areturn sum(1 for i in lst if type(i)==list)%0Areturn sum(isinstance(i, list) for i in lst)%0A%0A
#Count o
|
af669e8ab8a502505389adf63e0d5216765fdba4 | fix exclude events | viradacultural_social_api/views.py | viradacultural_social_api/views.py | from rest_framework import viewsets
from rest_framework import generics
from rest_framework.views import APIView
from rest_framework.response import Response
from .models import FbUser, Event
from .serializer import FbUserSerializer
from rest_framework import permissions
import facebook
class MinhaViradaView(APIView)... | Python | 0.000024 | @@ -728,21 +728,19 @@
sponse('
-%7B%7D
')%0A
+
@@ -778,10 +778,8 @@
se('
-%7B%7D
')%0A%0A
@@ -923,16 +923,55 @@
ser_uid%0A
+ # import ipdb;ipdb.set_trace()%0A
@@ -1243,16 +1243,52 @@
vents')%0A
+ events_objects = %5B%5D%0A
@@ -1336,16 +1336,38 @@
+even... |
10f7938e37180c0cb3b701223cf6d1855e7d8f93 | Drop python_2_unicode_compatible for Settings, fix docs build on rtfd | watchdog_kj_kultura/main/models.py | watchdog_kj_kultura/main/models.py | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.encoding import python_2_unicode_compatible
from model_utils.models import TimeStampedModel
from tinymce.models import HTMLField
from django.contrib.sites.models import Site
class SettingsQuerySet(models.QuerySet):
... | Python | 0 | @@ -82,70 +82,8 @@
s _%0A
-from django.utils.encoding import python_2_unicode_compatible%0A
from
@@ -266,37 +266,8 @@
s%0A%0A%0A
-@python_2_unicode_compatible%0A
clas
|
c36ba274119b2c8596b7ec95bab9763a3842df66 | remove more run_as root | speedydeploy/deployment.py | speedydeploy/deployment.py | # -*- coding: utf-8 -*-
from __future__ import with_statement
import inspect
import os
import sys
import time
from fabric import api as fab
from fabric.contrib import files as fab_files
from fab_deploy.system import ssh_add_key
from fab_deploy.utils import run_as
from taskset import TaskSet, task
from base import _... | Python | 0 | @@ -2660,36 +2660,16 @@
_file)%0A%0A
- @run_as('root')%0A
def
@@ -2895,36 +2895,16 @@
utput)%0A%0A
- @run_as('root')%0A
def
@@ -3870,24 +3870,87 @@
d_key(key)%0A%0A
+ fab.run(_('echo root %3E %25(remote_dir)s/.forward'))%0A%0A
if '
@@ -4143,99 +4143,8 @@
()%0A%0A
- # nee... |
5f8580e9d28d08e13f40692a2247f41ea8c5b4b9 | Remove extra newline. | tests/test_additional_io.py | tests/test_additional_io.py | __author__ = "John Kirkham <kirkhamj@janelia.hhmi.org>"
__date__ = "$Jul 28, 2014 11:50:37 EDT$"
import nanshe.nanshe.additional_io
class TestAdditionalIO(object):
num_files = 10
def setup(self):
import tempfile
self.temp_dir = tempfile.mkdtemp()
self.temp_files = []
for ... | Python | 0 | @@ -1186,9 +1186,8 @@
ir = %22%22%0A
-%0A
|
db06f101a07f0e122c35e8b662ed4fe6a26c4811 | Add SkipTest to test_content_disposition | tests/test_awss3_storage.py | tests/test_awss3_storage.py | import os
import uuid
import mock
import requests
from nose import SkipTest
from depot._compat import PY2
S3Storage = None
FILE_CONTENT = b'HELLO WORLD'
class TestS3FileStorage(object):
def setup(self):
try:
global S3Storage
from depot.io.awss3 import S3Storage
except ... | Python | 0.000001 | @@ -2613,21 +2613,59 @@
r
-eturn
+aise SkipTest('Test is for Python2.X only')
%0A
|
1b11207f40d956267ae046bc51313a3cccc4776a | Fix typo in cdl filename | cdl_parser.py | cdl_parser.py | #!/usr/bin/env python
"""
Class to load and parse Common Data Language (CDL) files and
tokenize the dimensions and variables
Written by Brian Powell on 04/30/13
Copyright (c)2013 University of Hawaii under the BSD-License.
"""
from __future__ import print_function
import datetime
import re
def cdl_parser(fil... | Python | 0.997939 | @@ -1149,16 +1149,20 @@
pen(file
+name
, 'r'):%0A
|
dfea10193f2aebca4b03818db5280106aef75d72 | make copy take a slice of the memory vs the ref to the memory array | mythril/laser/ethereum/state/memory.py | mythril/laser/ethereum/state/memory.py | """This module contains a representation of a smart contract's memory."""
from typing import cast, List, Union, overload
from z3 import Z3Exception
from mythril.laser.ethereum import util
from mythril.laser.smt import (
BitVec,
Bool,
Concat,
Extract,
If,
simplify,
symbol_factory,
)
class... | Python | 0.000002 | @@ -589,16 +589,124 @@
emory)%0A%0A
+ def __copy__(self):%0A copy = Memory()%0A copy._memory = self._memory%5B:%5D%0A return copy%0A%0A
def
|
10e2638b8bafb15f66deb4a9ca442593a0ab52f2 | test fix | tests/test_core/test_ffi.py | tests/test_core/test_ffi.py | from textwrap import dedent
from os.path import dirname, join
try:
from unittest.mock import Mock, patch
except ImportError:
from mock import Mock, patch
from cffi import FFI
from pywincffi.core.ffi import Library
from pywincffi.core.testutil import TestCase
from pywincffi.exceptions import ResourceNotFoundE... | Python | 0.000001 | @@ -2059,50 +2059,8 @@
f):%0A
- self.assertIsNone(Library.CACHE)%0A%0A
|
78c3e6b7b3a12d74416f43995d50b04bdb817f0b | Fix test failure | tests/test_pkg_resources.py | tests/test_pkg_resources.py | import sys
import tempfile
import os
import zipfile
import pkg_resources
try:
unicode
except NameError:
unicode = str
class EggRemover(unicode):
def __call__(self):
if self in sys.path:
sys.path.remove(self)
if os.path.exists(self):
os.remove(self)
class TestZipPr... | Python | 0.000128 | @@ -1773,17 +1773,16 @@
name, 'w
-b
')%0A
|
f356adde3cb4776ad0a34b47be54a6e14972ce17 | Improve Python 3.x compatibility | tests/unit/test_excutils.py | tests/unit/test_excutils.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Red Hat, 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
#
... | Python | 0.000022 | @@ -1028,33 +1028,35 @@
except Exception
-,
+ as
_e:%0A
@@ -1426,17 +1426,19 @@
xception
-,
+ as
_e:%0A
|
0178cb071952e282111a8c01efff4995a15bcdce | add tests for winreg branch | tests/util/test_get_dirs.py | tests/util/test_get_dirs.py | import unittest
import EXOSIMS.util.get_dirs as gd
import os
from unittest.mock import *
import numpy as np
class TestGetDirs(unittest.TestCase):
"""
Tests the get_dir tool.
Sonny Rappaport, Cornell, July 2021
"""
def test_get_home_dir(self):
"""
Tests that get_home_dir works i... | Python | 0 | @@ -101,16 +101,30 @@
py as np
+%0Aimport winreg
%0A%0Aclass
@@ -3233,49 +3233,1012 @@
-exp_asrt.append(%22Identified %22+%22winregHome
+#second, test that home is tried if an exception is raised and attempt %0A #at homedir setting is made %0A%0A with patch.dict(os.environ,%7B'HOME':'winreghome2'... |
e33064debba9a973d26cf18fbfa093d2139fafaa | Remove bees | jacquard/tests/test_layering.py | jacquard/tests/test_layering.py | import re
import dis
import pathlib
import pytest
import jacquard
try:
import networkx
except ImportError:
networkx = None
DEPENDENCIES = (
('__main__', 'cli'),
('buckets', 'commands'),
('buckets', 'odm'),
('buckets', 'storage'),
('buckets', 'constraints'),
('cli', 'commands'),
... | Python | 0.000159 | @@ -4725,38 +4725,4 @@
one%0A
-%0A raise AssertionError(%22Bees%22)%0A
|
514064ce5a0bc7d3ecab10d1b810e5b751ed79af | update supported thumbnail types | contrib/frontends/django/nntpchan/nntpchan/thumbnail.py | contrib/frontends/django/nntpchan/nntpchan/thumbnail.py | from django.conf import settings
import subprocess
import os
img_ext = ['png', 'jpg', 'jpeg', 'gif', 'webp', 'ico', 'pdf', 'ps']
vid_ext = ['mp4', 'webm', 'm4v', 'ogv', 'avi', 'txt']
def generate(fname, tname, placeholder):
"""
generate thumbnail
"""
ext = fname.split('.')[-1]
cmd = None
if ext... | Python | 0 | @@ -111,21 +111,8 @@
ico'
-, 'pdf', 'ps'
%5D%0Avi
|
f95b8ed7845b748b2fb86a4af0793db8fee078b4 | Fix to issue deprecated .as_matrix() to df.values() | pd2ppt/pd2ppt.py | pd2ppt/pd2ppt.py | import six
import pandas as pd
from math import *
from pptx import Presentation
from pptx.util import Cm, Pt
round_to_n = lambda x, n: round(x, -int(floor(log10(abs(x)))) + (n - 1))
def _do_formatting(value, format_str):
"""Format value according to format_str, and deal
sensibly with format_str if it is m... | Python | 0.000001 | @@ -4264,17 +4264,14 @@
df.
-as_matrix
+values
()%0A%0A
|
31c70f509a849de98e0327902c48bdfcb8bd99a9 | fix another off by one with blur | pendulum_demo.py | pendulum_demo.py | #!/usr/bin/env python
import sys
import math
import time
import StringIO
from PIL import Image
import scipy.constants
from mathics.world import World
from mathics.viewport import Viewport
from mathics.machines import Pendulum, Timer, Point, Vector
def serve_gif(frames, duration, nq=0):
from PIL import Image
... | Python | 0.000001 | @@ -3154,20 +3154,24 @@
frames)*
+(
blur
++1)
)/durati
|
14b473fc1b3a084a22c3e1ef37e2589d91650b2f | Add td_includes argument to allow more flexible relative include paths for td files. | third_party/mlir/tblgen.bzl | third_party/mlir/tblgen.bzl | """BUILD extensions for MLIR table generation."""
def gentbl(name, tblgen, td_file, tbl_outs, td_srcs = [], strip_include_prefix = None):
"""gentbl() generates tabular code from a table definition file.
Args:
name: The name of the build rule for use in dependencies.
tblgen: The binary used to prod... | Python | 0 | @@ -101,16 +101,34 @@
cs = %5B%5D,
+ td_includes = %5B%5D,
strip_i
@@ -150,16 +150,16 @@
None):%0A
-
%22%22%22g
@@ -643,16 +643,82 @@
tively.%0A
+ td_includes: A list of include paths for relative includes.%0A
st
@@ -1002,16 +1002,20 @@
includes
+_str
= %22-I e
@@ -1081,27 +1081,115 @@
w %22%... |
9920f7f8bab741146b436c864fb1ff4682a4bda9 | Use a bigger buffer | tile-hash-proxy/__init__.py | tile-hash-proxy/__init__.py | import SimpleHTTPServer
import SocketServer
import requests
import md5
def calc_hash_terrain(s):
# When Ian built the hash for terrain tiles he used the path without
# the leading slash and the first 6 chars of the hex digest instead of 5
m = md5.new()
m.update(s[1:])
md5_hash = m.hexdigest()
... | Python | 0.000051 | @@ -1344,16 +1344,17 @@
size = 1
+6
* kilob
|
45b778c637d263208699a16ba926f0da10d5b0f4 | Fix incorrect behaviour with check.py | tmc/exercise_tests/check.py | tmc/exercise_tests/check.py | import re
import xml.etree.ElementTree as ET
from os import path
from tmc.exercise_tests.basetest import BaseTest, TestResult
class CheckTest(BaseTest):
def __init__(self):
super().__init__("Check")
def applies_to(self, exercise):
return path.isfile(path.join(exercise.path(), "Makefile"))
... | Python | 0.000001 | @@ -1084,35 +1084,8 @@
t):%0A
- success = True%0A
@@ -1129,35 +1129,8 @@
ext%0A
- message = None%0A
@@ -1163,11 +1163,12 @@
t%22)
-==
+in %5B
%22fai
@@ -1172,16 +1172,26 @@
failure%22
+, %22error%22%5D
:%0A
@@ -1324,16 +1324,94 @@
%22, %22&%22)%0A
+ else:%0A ... |
5ffeebd7581dd3168bbcd974625879774ed5df6c | Update instance dict with field generators | tohu/v3/custom_generator.py | tohu/v3/custom_generator.py | import attr
import logging
import re
from .base import TohuBaseGenerator, SeedGenerator
__all__ = ['CustomGenerator']
logger = logging.getLogger('tohu')
def set_item_class_name_on_custom_generator_class(cls):
"""
Set the attribute `cls.__tohu_items_name__` to a string which defines the name
of the named... | Python | 0 | @@ -3709,16 +3709,62 @@
items()%7D
+%0A self.__dict__.update(self.field_gens)
%0A%0A
|
b09484dbdd49319278f46ade165b5543c385614e | fix testing of dynamic models | webapp/apps/dynamic/tests/utils.py | webapp/apps/dynamic/tests/utils.py | from __future__ import print_function
from django.test import TestCase
from django.test import Client
import mock
import os
os.environ["NUM_BUDGET_YEARS"] = '2'
from ...taxbrain.models import TaxSaveInputs
from ...taxbrain.models import convert_to_floats
from ...taxbrain.helpers import (expand_1D, expand_2D, expand_li... | Python | 0.000001 | @@ -1212,32 +1212,71 @@
tus_code == 302%0A
+ idx = response.url%5B:-1%5D.rfind('/')%0A
assert respo
@@ -1276,34 +1276,35 @@
t response.url%5B:
--2
+idx
%5D.endswith(%22taxb
@@ -1307,17 +1307,16 @@
taxbrain
-/
%22)%0A r
@@ -3998,24 +3998,72 @@
anding page%0A
+ idx = microsim_response.url%5B:-1%5D.rfi... |
6fc67196062dcfbf6d14679e3c735bdcd27ca5a2 | add one file type in basic mode | HomeworkCleaner.py | HomeworkCleaner.py | #! D:\Python33\python.exe
# -*- coding: utf-8 -*-
# Module : HomeworkCleaner.py
# Author : bss
# Project : TA
# State :
# Creation Date : 2014-12-26
# Last modified: 2014-12-29 17:44:18
# Description :
#
import os
import zipfile
g_basicList = ['obj','tlog','pdb','ilk','idb','log','las... | Python | 0.000001 | @@ -195,24 +195,24 @@
201
-4-12-29 17:44:18
+5-01-02 11:56:12
%0A# D
@@ -456,16 +456,45 @@
cpp','h'
+,%0A 'unsuccessfulbuild'
%5D%0A%0A# %E6%98%AF%E5%90%A6%E8%A6%81
|
9827fc7b386b0576758092ff785726863dabf797 | Update version numbers for 0.10 dev | IPython/Release.py | IPython/Release.py | # -*- coding: utf-8 -*-
"""Release data for the IPython project."""
#*****************************************************************************
# Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
#
# Copyright (c) 2001 Janko Hauser <jhauser@zscout.de> and Nathaniel Gray
# <n8gray@caltec... | Python | 0 | @@ -1000,20 +1000,19 @@
pment =
-Fals
+Tru
e # c
@@ -1069,11 +1069,10 @@
'0.
-9.
1
+0
'%0Abr
@@ -1106,10 +1106,10 @@
'11
-43
+95
'%0A%0Ai
|
85aa5449a040247a6156801e88857048a7db6dd5 | update revnum | IPython/Release.py | IPython/Release.py | # -*- coding: utf-8 -*-
"""Release data for the IPython project.
$Id: Release.py 2409 2007-05-28 18:45:23Z vivainio $"""
#*****************************************************************************
# Copyright (C) 2001-2006 Fernando Perez <fperez@colorado.edu>
#
# Copyright (c) 2001 Janko Hauser <jhause... | Python | 0.000001 | @@ -81,30 +81,30 @@
y 24
-09
+46
2007-0
-5-28 18:45:23
+6-14 22:30:58
Z vi
@@ -1058,10 +1058,10 @@
'24
-08
+45
'%0A%0Av
|
5e409ec1d8d53cd3005022ff090043a9e5f5cb31 | Update nyan.py | NyanCheck/nyan.py | NyanCheck/nyan.py | #!/usr/bin/python3
from gi.repository import Gtk
from gi.repository import GObject
import webbrowser
import urllib.request
import re
def getNyan():
USER_AGENT = "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.154 Safari/537.36"
r = urllib.request.Request("http://nyanyan.it/", h... | Python | 0.000001 | @@ -1353,124 +1353,8 @@
):%0A
-%09%09%22%22%22Checks for new posts on http://nyanyan.it/%0A%09%09%0A%09%09Takes no arguments and return true if there is new post.%0A%09%09%22%22%22%0A
%09%09te
@@ -1648,12 +1648,13 @@
= nyanIcon()
+%0A
|
992dc795d1f7c7ef670832a5144b7e72a9374af8 | update test_forms | wizard_builder/tests/test_forms.py | wizard_builder/tests/test_forms.py | from django.test import TestCase
from .. import managers
class FormSerializationTest(TestCase):
manager = managers.FormManager
fixtures = [
'wizard_builder_data',
]
expected_data = [{
'descriptive_text': 'answer wisely',
'field_id': 'question_2',
'id': 2,
'page... | Python | 0.000001 | @@ -501,38 +501,8 @@
t',%0A
- 'is_dropdown': False,%0A
|
a9465bcfe387a3eb8ba730eeda5285be079044d3 | test cleanup | wizard_builder/tests/test_views.py | wizard_builder/tests/test_views.py | from unittest import mock
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
from .. import view_helpers
class ViewTest(TestCase):
fixtures = [
'wizard_builder_data',
]
@classmethod
def setUpClass(cls):
settings.SITE_ID = 1... | Python | 0.000001 | @@ -356,127 +356,68 @@
def
-test_storage_receives_post_data(self):%0A step = '1'%0A url = reverse('wizard_update', kwargs=%7B'step': step%7D)
+setUp(self):%0A super().setUp()%0A self.step = '1'
%0A
@@ -421,16 +421,21 @@
+self.
data = %7B
@@ -473,32 +473,37 @@
erbox'%7D%0A ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.