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
480330a116a03ca79172a8646f9001f7f9ee5cad
Allow ACL sections to use .*-release group names
tools/normalize_acl.py
tools/normalize_acl.py
#!/usr/bin/env python # Usage: normalize_acl.py acl.config [transformation [transformation [...]]] # # Transformations: # all Apply all transformations. # 0 - dry run (default, print to stdout rather than modifying file in place) # 1 - strip/condense whitespace and sort (implied by any other transformation) # 2 - get ...
Python
0.000004
@@ -3626,32 +3626,51 @@ 'packagers',%0A + 'release',%0A 'Users',
edd9800b807482097edba03d433bb097fd07dae1
Add aliases
ckanext/archiver/model.py
ckanext/archiver/model.py
from builtins import str from builtins import object import uuid from datetime import datetime from sqlalchemy import Column, MetaData from sqlalchemy import types from sqlalchemy.ext.declarative import declarative_base import ckan.model as model import ckan.plugins as p from ckan.lib import dictization log = __imp...
Python
0.000033
@@ -1,28 +1,108 @@ +from future import standard_library%0Astandard_library.install_aliases() # noqa%0A%0A from builtins import str%0Afro
a5a25c180f2df13c387c56be938b3ecad2a50aaa
use action='version' in --version parser (#891)
cli/cook/cli.py
cli/cook/cli.py
import argparse import logging from urllib.parse import urlparse from cook import util, http, metrics, version, configuration from cook.subcommands import submit, show, wait, jobs, ssh, ls, tail, kill, config, cat, usage from cook.util import deep_merge parser = argparse.ArgumentParser(description='cs is the Cook Sch...
Python
0
@@ -910,22 +910,73 @@ it', - dest='version +%0A version=f'%25(prog)s version %7Bversion.VERSION%7D ', a @@ -982,26 +982,23 @@ action=' -store_true +version ')%0A%0Asubp @@ -2957,135 +2957,8 @@ ))%0A%0A - print_version = args.pop('version')%0A if print_version:%0A print(f'cs version ...
94aed149fd39ba9a6dd6fcf5dcc44c6e4f2a09b9
fix imports
website_sale_search_clear/controllers.py
website_sale_search_clear/controllers.py
# -*- coding: utf-8 -*- from openerp import http from openerp.addons.website_sale.controllers.main import website_sale as controller class WebsiteSale(controller): @http.route() def shop(self, page=0, category=None, search='', **post): if category and search: category = None retur...
Python
0.000004
@@ -23,22 +23,19 @@ -%0Afrom o -penerp +doo import @@ -49,14 +49,11 @@ om o -penerp +doo .add @@ -93,25 +93,24 @@ import -w +W ebsite -_s +S ale as c
24a1bb4fed640a61caa1613cfe4da29a530a8efc
Fix enconding issue on Harvest Config validation
udata/harvest/forms.py
udata/harvest/forms.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from udata.forms import Form, fields, validators from udata.i18n import lazy_gettext as _ from .actions import list_backends from .models import VALIDATION_STATES, VALIDATION_REFUSED __all__ = 'HarvestSourceForm', 'HarvestSourceValidationForm' class ...
Python
0
@@ -1502,32 +1502,110 @@ ationError(msg)%0A +%0A f%5B'value'%5D = f%5B'value'%5D.encode('utf-8') #Fix encoding error%0A%0A
683ccc69c51a64146dda838ad01674ca3b95fccd
Remove useless hearing comments router
democracy/urls_v1.py
democracy/urls_v1.py
from django.conf.urls import include, url from rest_framework_nested import routers from democracy.views import ( CommentViewSet, ContactPersonViewSet, HearingViewSet, ImageViewSet, LabelViewSet, ProjectViewSet, RootSectionViewSet, SectionCommentViewSet, SectionViewSet, UserDataViewSet, FileViewSet, ServeFileV...
Python
0
@@ -943,107 +943,8 @@ ')%0A%0A -hearing_comments_router = routers.NestedSimpleRouter(router, r'hearing', lookup='comment_parent')%0A%0A hear @@ -1387,78 +1387,8 @@ )),%0A - url(r'%5E', include(hearing_comments_router.urls, namespace='v1')),%0A
1c789f0cfbc9384c256a55343f3172b628e55a12
Add test case for parser consume
pysmt/test/smtlib/test_parser_examples.py
pysmt/test/smtlib/test_parser_examples.py
# # This file is part of pySMT. # # Copyright 2014 Andrea Micheli and Marco Gario # # 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.000001
@@ -905,16 +905,27 @@ ibParser +, Tokenizer %0Afrom py @@ -5716,16 +5716,442 @@ (txt))%0A%0A + def test_parse_consume(self):%0A smt_script = %22%22%22%0A (model%0A (define-fun STRING_cmd_line_arg_1_1000 () String %22AAAAAAAAAAAA%22)%0A )%0A %22%22%22%0A tokens = Tokenizer...
ad153499a3982182533033acfa17971a35d7a587
implement __eq__
capa/features/address.py
capa/features/address.py
import abc from dncil.clr.token import Token class Address(abc.ABC): @abc.abstractmethod def __lt__(self, other): # implement < so that addresses can be sorted from low to high ... @abc.abstractmethod def __hash__(self): # implement hash so that addresses can be used in sets ...
Python
0.00008
@@ -65,16 +65,82 @@ c.ABC):%0A + @abc.abstractmethod%0A def __eq__(self, other):%0A ...%0A%0A @abc @@ -1266,16 +1266,99 @@ token%0A%0A + def __eq__(self, other):%0A return self.token.value == other.token.value%0A%0A def @@ -1370,32 +1370,32 @@ _(self, other):%0A - return s...
e660953c1df2dc9de6b3038e4ddb1d77768b2b51
Correct pyhande dependencies (broken for some time)
tools/pyhande/setup.py
tools/pyhande/setup.py
from distutils.core import setup setup( name='pyhande', version='0.1', author='HANDE developers', packages=('pyhande',), license='Modified BSD license', description='Analysis framework for HANDE calculations', long_description=open('README.rst').read(), requires=['numpy', 'pandas (>= 0....
Python
0
@@ -280,16 +280,24 @@ (),%0A +install_ requires @@ -312,37 +312,49 @@ ', ' -pandas (%3E= 0.13)', 'pyblock', +scipy', 'pandas', 'pyblock', 'matplotlib' %5D,%0A)
5aa16a2ebc8f13980534b5f530cd68a0c04c4c55
Fix failing test
nefertari_mongodb/tests/test_documents.py
nefertari_mongodb/tests/test_documents.py
import pytest from mock import patch, Mock import mongoengine as mongo from nefertari.utils.dictset import dictset from nefertari.json_httpexceptions import ( JHTTPBadRequest, JHTTPNotFound, JHTTPConflict) from .. import documents as docs from .. import fields class TestDocumentHelpers(object): @patch.obje...
Python
0.000209
@@ -1782,32 +1782,48 @@ lds.StringField( +primary_key=True )%0A%0A asser @@ -1847,21 +1847,20 @@ d() == ' -my_id +name '%0A%0A d
776c8fd802385ef4294112e76365df6bdf93476a
Update Bee.py
Templates/Bee.py
Templates/Bee.py
import pythoncom import pyHook from os import path from sys import exit from sys import argv from shutil import copy import threading import urllib,urllib2 import smtplib import datetime,time import win32com.client import win32event, win32api, winerror from _winreg import * mutex = win32event.CreateMutex(None, 1, 'N0t...
Python
0.000009
@@ -9,23 +9,17 @@ ythoncom -%0Aimport +, pyHook%0A @@ -63,53 +63,8 @@ xit%0A -from sys import argv%0Afrom shutil import copy%0A impo @@ -216,16 +216,41 @@ import * +%0Aimport shutil%0Aimport sys %0A%0Amutex @@ -293,17 +293,16 @@ 0tAs519n -s ')%0Aif wi @@ -507,13 +507,24 @@ +shutil. copy( +sys. argv
c129fc28da31fc8fa1ebd3ac75792b8ccad245c8
fix better warning
pystruct/models/edge_feature_graph_crf.py
pystruct/models/edge_feature_graph_crf.py
import numpy as np from .graph_crf import GraphCRF class EdgeFeatureGraphCRF(GraphCRF): """Pairwise CRF with features/strength associated to each edge. Pairwise potentials are asymmetric and shared over all edges. They are weighted by an edge-specific features, though. This allows for contrast sensi...
Python
0.001163
@@ -2692,16 +2692,291 @@ res = %5B%5D +%0A if np.any(np.hstack(%5Bsymmetric_edge_features,%0A antisymmetric_edge_features%5D) %3E= n_edge_features):%0A raise ValueError(%22Got (anti) symmetric edge feature index that is %22%0A %22larger than n_e...
d07d87ea7f9d62e8274ba1b958d08756d071653a
add format detection by magic number
thumbor/engines/__init__.py
thumbor/engines/__init__.py
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/globocom/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com class BaseEngine(object): def __init__(self, context): ...
Python
0.000001
@@ -532,16 +532,271 @@ nsion):%0A + #magic number detection%0A if ( buffer%5B:4%5D == 'GIF8'):%0A extension = '.gif'%0A elif ( buffer%5B:8%5D == '%5Cx89PNG%5Cr%5Cn%5Cx1a%5Cn'):%0A extension = '.png'%0A elif ( buffer%5B:2%5D == '%5Cxff%5Cxd8'):%0A extension =...
b277ca357728010c9d763c95cc459540821802c0
Update dice loss
dataset/models/tf/losses/__init__.py
dataset/models/tf/losses/__init__.py
""" Contains custom losses """ import tensorflow as tf from ..layers import flatten def dice(targets, predictions): """ Dice coefficient Parameters ---------- targets : tf.Tensor tensor with target values predictions : tf.Tensor tensor with predicted values Returns ----...
Python
0
@@ -109,16 +109,160 @@ dictions +, weights=1.0, label_smoothing=0, scope=None,%0A loss_collection=tf.GraphKeys.LOSSES, reduction=tf.losses.Reduction.SUM_BY_NONZERO_WEIGHTS ):%0A %22 @@ -429,21 +429,21 @@ edicted -value +logit s%0A%0A R @@ -469,138 +469,475 @@ -average loss : tf.Tensor with a si...
4c9b47052c2c66671230f33ea84459e02b3b2f06
Update Unit_Testing2.py
Unit_Testing2.py
Unit_Testing2.py
from unit_testing import * import unittest class UnitTests(unittest.TestCase): def setUp(self): print('setUp()...') self.hash1 = Hash('1234') self.hash2 = Hash('1234') self.hash3 = Hash('123') self.email1 = Email('P@V') def test(self): print('testing...
Python
0
@@ -167,77 +167,8 @@ ')%0D%0A - self.hash2 = Hash('1234')%0D%0A self.hash3 = Hash('123')%0D%0A @@ -192,19 +192,31 @@ Email(' -P@V +zmg@verizon.net ')%0D%0A%0D%0A @@ -314,17 +314,17 @@ elf.hash -2 +1 ) #faile @@ -366,26 +366,27 @@ .hash1, -self.hash3 +Hash('123') )%0D%0A @@ -431,18 +4...
09a10d7f0b49ec746f2e93d0eb0377bddc92f25f
Update builder.py
uplink/builder.py
uplink/builder.py
# Standard library imports import collections import functools import warnings # Local imports from uplink import ( auth as auth_, clients, converters, exceptions, helpers, hooks, interfaces, utils, types ) from uplink.converters import keys __all__ = ["build", "Consumer"] class ...
Python
0.000001
@@ -1430,20 +1430,24 @@ er.add_e -rror +xception _handler
4089730950d6005e257c20e6926000073fd41b33
Enable Tensor equality for 2.0
tensorflow/python/compat/v2_compat.py
tensorflow/python/compat/v2_compat.py
# Copyright 2018 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
@@ -2030,24 +2030,55 @@ variables()%0A + ops.enable_tensor_equality()%0A # Enables @@ -2809,16 +2809,48 @@ ables()%0A + ops.disable_tensor_equality()%0A # Disa
e39c2e0c3dae39ee380a98a1aa662d14d1a1191e
Add new keyfile
dexter/config/celeryconfig.py
dexter/config/celeryconfig.py
from celery.schedules import crontab # uses AWS creds from the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env variables BROKER_URL = 'sqs://' BROKER_TRANSPORT_OPTIONS = { 'region': 'eu-west-1', 'polling_interval': 15 * 1, 'queue_name_prefix': 'mma-dexter-', 'visibility_timeout': 3600*12, } # all ou...
Python
0.000002
@@ -634,17 +634,17 @@ ab(hour= -1 +2 , minute @@ -916,17 +916,17 @@ b(hour=1 -2 +5 , minute
9a3d81d38e8b5885f54198f41b27d1d813c83e74
Add django_extensions
director/director/settings.py
director/director/settings.py
""" Django settings for director project. Uses ``django-configurations``. For more on this package, see https://github.com/jazzband/django-configurations For more information on this file, see https://docs.djangoproject.com/en/2.0/topics/settings/ For the full list of settings and their values, see https://docs.djan...
Python
0.000005
@@ -3695,16 +3695,145 @@ t-key'%0A%0A + # Additional apps only used in development%0A INSTALLED_APPS = Common.INSTALLED_APPS + %5B%0A 'django_extensions'%0A %5D%0A%0A %0Aclass P
c4f7f2025a6089ec0ddcb190eaf4c020804b384b
make the call to core commands more explicit
toggleselection/__init__.py
toggleselection/__init__.py
# Override commands that toggle item selection to automatically compute and instantly display # combined filesize for selected files and the number of selected folders/files from fman import DirectoryPaneListener, load_json import json from statusbarextended import StatusBarExtended class CommandEmpty(): # to avoid d...
Python
0
@@ -202,398 +202,1371 @@ Pane -Listener, load_json%0Aimport json%0Afrom statusbarextended import StatusBarExtended%0A%0Aclass CommandEmpty(): # to avoid duplicate command execution (and %22return '', args%22 hangs)%0A def __call__(self):%0A pass%0A%0Aclass SelectionOverride(DirectoryPaneListener):%0A def ...
88a4c124fc1e1ee0b77771ebb63055e51396d779
Add unittest for perturb on many pmfs.
dit/math/tests/test_pmfops.py
dit/math/tests/test_pmfops.py
# coding: utf-8 from __future__ import division from __future__ import print_function import dit import numpy as np from nose.tools import * module = dit.math.pmfops def test_perturb(): # Smoke test d = np.array([0, .5, .5]) d2 = module.perturb(d, .00001) d3 = d2.round(2) np.testing.assert_allc...
Python
0
@@ -180,16 +180,20 @@ _perturb +_one ():%0A @@ -330,16 +330,213 @@ d, d3)%0A%0A +def test_perturb_many():%0A # Smoke test%0A d = np.array(%5B%5B0, .5, .5%5D, %5B.5, .5, .0%5D%5D)%0A d2 = module.perturb(d, .00001)%0A print(d2)%0A d3 = d2.round(2)%0A np.testing.assert_allclose(d, d3)%0A%0A def t...
50eedeaaa401d192c2681d58c83981961a1c4ff1
fix update profile
lxxl/services/graph/users/profile.py
lxxl/services/graph/users/profile.py
from lxxl.lib import router, output from lxxl.lib.app import Controller, Error from lxxl.lib.storage import Db, ASCENDING from lxxl.lib.flush import FlushRequest from lxxl.model.users import User, Factory as UserFactory, Duplicate import datetime class Profile(router.Root): def get(self, environ, params): ...
Python
0.000001
@@ -2292,18 +2292,22 @@ .get -PostJ +Request().j son -() %0A%0A
9a4e2f88eba716ef607b8c476509cac5e58475f7
Update mapper_lowercase.py
mapreduce/filter/mapper_lowercase.py
mapreduce/filter/mapper_lowercase.py
#!/usr/bin/env python import sys # Open just for read dbpediadb = set(open('dbpedia_labels.txt').read().splitlines()) dbpediadb_lower = set(x.lower() for x in open('dbpedia_labels.txt').read().splitlines()) for line in sys.stdin: # remove leading and trailing whitespace line = line.strip() # split the li...
Python
0.000067
@@ -470,32 +470,40 @@ um)%0A if ngram +.lower() in dbpediadb_lo
84ce27775b7e04955a15a0eb1e277db3e447b81f
fix SlidingCloth
mayaLib/rigLib/utils/slidingCloth.py
mayaLib/rigLib/utils/slidingCloth.py
__author__ = 'Lorenzo Argentieri' import pymel.core as pm from mayaLib.rigLib.utils import skin from mayaLib.rigLib.utils import deform class SlidingCloth(): def __init__(self, mainSkinGeo, proxySkinGeo, mainClothGeo, proxyClothGeo): """ Setup Sliding Cloth deformation :param mainSkinGeo:...
Python
0.000001
@@ -231,16 +231,34 @@ ClothGeo +, rigModelGrp=None ):%0A @@ -1626,28 +1626,290 @@ lothGeo, self.proxyClothGeo) +%0A baseObj = pm.listConnections(wrapDeformer.basePoints, source=True)%5B0%5D%0A if rigModelGrp:%0A pm.parent(baseObj, rigModelGrp)%0A%0A # save attribute%0A sel...
b99c839eac306ccd4e73a53bc45bef3be46f99a8
clean up amend data
meerkat_nest/resources/amend_data.py
meerkat_nest/resources/amend_data.py
""" Data resource for upload data """ from flask_restful import Resource from flask import request from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker import json import os import uuid import datetime from pprint import pprint from meerkat_nest import model from meerkat_nest import config from...
Python
0.000019
@@ -91,16 +91,26 @@ request +, Response %0Afrom sq @@ -233,33 +233,22 @@ ime%0A -from pprint import -pprint +logging %0A%0Afr @@ -2818,36 +2818,68 @@ -status=502,%0A + status=502,%0A @@ -3008,16 +3008,17 @@ _entry%0A%0A +%0A def amen @@ -3264,23 +3264...
990330ce9bf3cb9cc63d1287f49f04f1a7fe2cf0
fix mocked_app parameter not being optional
docker/environment/appmock.py
docker/environment/appmock.py
# coding=utf-8 """Authors: Łukasz Opioła, Konrad Zemek Copyright (C) 2015 ACK CYFRONET AGH This software is released under the MIT license cited in 'LICENSE.txt' Brings up a set of appmock instances. """ import copy import json import os import random import string from . import common, docker, dns, provider_ccm, pr...
Python
0.000002
@@ -5266,24 +5266,81 @@ appmock_id)%0A + if 'mocked_app' in cfg%5B'nodes'%5D%5B'node'%5D:%0A @@ -5387,16 +5387,20 @@ d_app'%5D%0A + @@ -5475,32 +5475,36 @@ + include_domain = @@ -5509,16 +5509,20 @@ = True%0A +
7102a79cae2fc60c9747b5ee1285544fc290d3a3
Add URL to 404 error message
twitterscraper/TwitterScraper.py
twitterscraper/TwitterScraper.py
from bs4 import BeautifulSoup import json import csv import logging import urllib import random import time from fake_useragent import UserAgent ua = UserAgent() headers_list = [ua.chrome, ua.google, ua['google chrome'], ua.firefox, ua.ff] class Scraper: def __init__(self, topics, ...
Python
0.000001
@@ -4915,24 +4915,69 @@ ror -= ' + str( +%7B%7D while requesting %22%7B%7D%22'.format(%0A e.code +, url ))%0A
f7060b65464b24bb16a8cf4704c68fa1348d655c
bump version
crossbar/crossbar/__init__.py
crossbar/crossbar/__init__.py
############################################################################### ## ## Copyright (C) 2011-2014 Tavendo GmbH ## ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU Affero General Public License, version 3, ## as published by the Free Software Founda...
Python
0
@@ -1226,11 +1226,11 @@ %220.9.4- -2 +3 %22%0A
1eb8bfbe2f35393b23d621e2ccc1337f13a27730
fix filter first
mturk/viewsets.py
mturk/viewsets.py
from rest_framework.viewsets import GenericViewSet from rest_framework import mixins from rest_framework.decorators import detail_route, list_route from django.contrib.auth.models import User from django.shortcuts import get_object_or_404 from rest_framework.response import Response from rest_framework import status fr...
Python
0
@@ -3708,32 +3708,171 @@ nt.task_worker)%0A + mturk_assignment.task_worker.task_status = TaskWorker.STATUS_SUBMITTED%0A mturk_assignment.task_worker.save()%0A @@ -4459,32 +4459,40 @@ d=assignment_id) +.first() %0A if even
d6348555f6abd88d0e2cd4ceb0993f89032659ee
move to new format of response:Dict, rather than list of tuples
TestAPI.py
TestAPI.py
import requests import nose _HOST_UNDER_TEST = "" def setup_module(): f = open('test_url.cfg', 'r') global _HOST_UNDER_TEST _HOST_UNDER_TEST = f.readline().strip() f.close() class TestPremium: def test_region1_age40(self): payload = {'lat': '39.68', 'long': '-122.48', 'age': 40} ...
Python
0.000011
@@ -1,12 +1,126 @@ +# imports for managing json parsing%0Afrom collections import OrderedDict%0Afrom decimal import Decimal%0Aimport json%0A%0A%0A import reque @@ -535,32 +535,170 @@ result = -r.json() +json.loads(r.content, object_pairs_hook=OrderedDict, parse_float=Decimal)%0A assert result.keys()%5B1%5D...
2beb62dbd754def3c58f2aa6b3a3431457c88944
fix for #9
db_demo.py
db_demo.py
import os import sys import cmd import sqlalchemy from sqlalchemy import func from sqlalchemy.orm import sessionmaker from test import get_sqlite_engine from kuj_orm import Base, Mtab, MtabIntensity, Exp, etl, mtab_search, mtab_random, match_all_from, match_one DEBUG=False def get_session_factory(): if DEBUG: ...
Python
0
@@ -5926,16 +5926,101 @@ fetch')%0A + session.query(Exp).filter(Exp.name==exp).delete(synchronize_session='fetch')%0A
c0e09993facdd76e7b1dfbab97285464f83980bb
Update version
cast_convert/__init__.py
cast_convert/__init__.py
#!/usr/bin/env python3 __version__ = '0.1.7.11' from .cmd import cmd as command from .watch import * from . import * from .convert import * from .media_info import * import click @click.command(help="Print version") def version(): debug_print(__version__) command.add_command(version)
Python
0
@@ -39,17 +39,17 @@ '0.1.7.1 -1 +7 '%0A%0A%0Afrom @@ -238,14 +238,8 @@ -debug_ prin
b5cd4ff2b02151bca966c53b80dbea8911a7a6b2
Upgrade celery.utils.encoding from kombu
celery/utils/encoding.py
celery/utils/encoding.py
""" celery.utils.encoding ===================== Utilties to encode text, and to safely emit text from running applications without crashing with the infamous :exc:`UnicodeDecodeError` exception. """ from __future__ import absolute_import import sys import traceback __all__ = ["str_to_bytes", "bytes_to_str", "from_...
Python
0
@@ -1,13 +1,12 @@ %22%22%22%0A -%0A celery.u @@ -43,15 +43,15 @@ ==== -= %0A%0AUtil +i ties @@ -421,34 +421,15 @@ %0Aif -sys.version_info %3E= (3, 0) +is_py3k :%0A%0A @@ -696,24 +696,25 @@ rn s%0A%0Aelse:%0A +%0A def str_ @@ -740,32 +740,97 @@ # noqa%0A + if isinstance(s, unicode):%0A ...
a0ff8cc15df5cd9668e11eba3b5e7406b33dcfc5
fix RemovedInDjango19Warning on django.utils.importlib
celery_haystack/utils.py
celery_haystack/utils.py
from django.core.exceptions import ImproperlyConfigured from django.utils.importlib import import_module from django.db import connection from haystack.utils import get_identifier from .conf import settings def get_update_task(task_path=None): import_path = task_path or settings.CELERY_HAYSTACK_DEFAULT_TASK ...
Python
0
@@ -49,16 +49,85 @@ figured%0A +try:%0A from importlib import import_module%0Aexcept ImportError:%0A from dja
11cb3297a368b40a6b1002a2394b56ac4fe29f98
make sure that the AFOS PIL is uppercase
cgi-bin/afos/retrieve.py
cgi-bin/afos/retrieve.py
#!/usr/bin/env python import psycopg2 import cgi import sys def main(): """Process the request""" # Attempt to keep the file from downloading and just displaying in chrome sys.stdout.write("X-Content-Type-Options: nosniff\n") sys.stdout.write("Content-type: text/plain\n\n") form = cgi.FieldStorag...
Python
0.999999
@@ -356,16 +356,24 @@ '')%5B:6%5D +.upper() %0A lim
eab44e76010055040242d06ba39218e4c42a6fe1
correct failure logic in daily download
cgi-bin/request/daily.py
cgi-bin/request/daily.py
"""Download IEM summary data!""" from io import StringIO import datetime from paste.request import parse_formvars from pyiem.util import get_dbconn from pyiem.network import Table as NetworkTable def get_climate(network, stations): """Fetch the climatology for these stations""" nt = NetworkTable(network) ...
Python
0.000001
@@ -308,16 +308,35 @@ (network +, only_online=False )%0A if @@ -1932,18 +1932,23 @@ return -%22%22 +climate %0A sio
7d89c9c3229ebd7d8b56edf211e7020c3fad29a0
add support for msgpack
utils/encoders.py
utils/encoders.py
# Copyright (C) 2015 SlimRoms Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
Python
0
@@ -1679,28 +1679,428 @@ aml_encode%0A %7D%0A %7D)%0A +%0A%0Atry:%0A try:%0A import msgpack%0A except ImportError:%0A import umsgpack as msgpack%0Aexcept ImportError:%0A pass%0Aelse:%0A def msgpack_encode(obj, pretty=False):%0A return msgpack.dumps(obj)%0A SUPPORTED_ENCODE...
745d3fae6b6055c731a47c13ef77e1faf1a4b7e5
upgrade elasticsearch mining backends
mining/db/backends/melasticsearch.py
mining/db/backends/melasticsearch.py
# -*- coding: utf-8 -*- import json from elasticsearch import Elasticsearch as ES class Elasticsearch(object): def conn(self): """Open connection on Elasticsearch DataBase""" conn = ES([ {"host": self.conf.get('host'), "port": self.conf.get('port'), "url_prefi...
Python
0
@@ -29,16 +29,32 @@ rt json%0A +import requests%0A from ela @@ -92,16 +92,59 @@ as ES%0A%0A +from mining.utils.listc import listc_dict%0A%0A %0Aclass E @@ -351,56 +351,8 @@ rt') -,%0A %22url_prefix%22: self.conf.get('db') %7D%0A @@ -430,12 +430,14 @@ ype= -None +'dict' ):%0A @@ -493,91 +493,162 ...
00b96577e1c9e7e49319b50a4b9bd055231b0f57
Validate os version is supported
ContentScripts/systemprep-linuxyumrepoinstall.py
ContentScripts/systemprep-linuxyumrepoinstall.py
#!/usr/bin/env python import boto import re import shutil import sys import urllib2 from boto.exception import BotoClientError def download_file(url, filename, sourceiss3bucket=None): """ Download the file from `url` and save it locally under `filename`. :rtype : bool :param url: :param filename: ...
Python
0
@@ -5617,16 +5617,175 @@ .')%5B0%5D%0A%0A + if epel_version is None:%0A raise SystemError('Unsupported OS version! dist = %7B0%7D, version = %7B1%7D.'%0A .format(dist, version))%0A%0A for
13152ede55f480533aead0bf6f573081edf2612f
update module path for CouchDBEmailBackend
mygpo/settings.py
mygpo/settings.py
# Django settings for mygpo project. # # This file is part of my.gpodder.org. # # my.gpodder.org is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or (at your # option) an...
Python
0
@@ -4575,16 +4575,25 @@ s.email. +backends. CouchDBE
bc1e350dd19d91932bbfff73f863129ac94273c9
bump version to 2.0.1
torment/information.py
torment/information.py
# Copyright 2015 Alex Brandt # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0
@@ -809,11 +809,11 @@ = '2.0. -0 +1 '%0A
085d6cd31e8dce17a4d5c98085a03d8adf896bda
Fix transaction.execute args to kwargs
tornado_mysql/pools.py
tornado_mysql/pools.py
"""Connection pool""" from __future__ import absolute_import, division, print_function from collections import deque import warnings from tornado.ioloop import IOLoop from tornado.gen import coroutine, Return from tornado.concurrent import Future from tornado_mysql import connect from tornado_mysql.connections impor...
Python
0
@@ -5136,16 +5136,21 @@ ry, args +=None ):%0A
ef98508d878a724cccda3a9c81666759966bb879
fix mkdir
publish.py
publish.py
# #!/usr/bin/env python3 import json import os import functools import concurrent.futures from datetime import datetime import re from pathlib import Path import time import yaml import asyncio import logging import aiohttp import aiofiles import subprocess logging.basicConfig(level=logging.INFO) logger = logging.getL...
Python
0.000014
@@ -4535,32 +4535,46 @@ n/post/').mkdir( +parents=True, exist_ok=True)%0A @@ -4603,16 +4603,30 @@ ).mkdir( +parents=True, exist_ok
90ad8e104c339b923d9291916647391572fbced1
Bump version number
nassl/__init__.py
nassl/__init__.py
# -*- coding: utf-8 -*- __author__ = 'Alban Diquet' __version__ = '0.15.1'
Python
0.000002
@@ -69,10 +69,10 @@ '0.1 -5.1 +6.0 '%0A%0A
d60c61753d2d8d2384e678c7ad2050c32562c3cf
Fix potential problem with cli
pygreen.py
pygreen.py
#! /usr/bin/python # PyGreen # Copyright (c) 2013, Nicolas Vanhoren # # Released under the MIT license # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Software"), to deal in # the Software without restriction, including with...
Python
0.011905
@@ -6263,23 +6263,20 @@ -pygreen +self .templat @@ -6304,23 +6304,20 @@ -pygreen +self .run(por @@ -6681,23 +6681,20 @@ -pygreen +self .gen_sta @@ -6804,23 +6804,20 @@ -pygreen +self .set_fol
53b156f83a792de1ebe42e93bb14f8dec005eada
Remove unused erroneous `import enum`.
chatexchange/wrapper.py
chatexchange/wrapper.py
import re import time import Queue import threading import logging import logging.handlers import BeautifulSoup import enum from . import browser, events TOO_FAST_RE = r"You can perform this action again in (\d+) seconds" logger = logging.getLogger(__name__) class SEChatWrapper(object): def __init__(self, s...
Python
0
@@ -109,20 +109,8 @@ Soup -%0Aimport enum %0A%0Afr
e51786c46ad4eb7310b1eaa0153253116f2c01bc
Update test bids
openprocurement/tender/esco/tests/base.py
openprocurement/tender/esco/tests/base.py
# -*- coding: utf-8 -*- import os from copy import deepcopy from openprocurement.tender.openeu.tests.base import ( BaseTenderWebTest, test_features_tender_data as base_eu_test_features_data, test_tender_data as base_eu_test_data, test_lots as base_eu_lots, test_bids as base_eu_bids, ) test_tender...
Python
0
@@ -981,20 +981,37 @@ ds)%0A -test_bids%5B0%5D +for bid in test_bids:%0A bid %5B'va @@ -1065,18 +1065,16 @@ - 'annualC @@ -1096,18 +1096,16 @@ 751.5,%0A -
7a8e5d15d7d9681b8d5ddae4d72e64b5ca6cba13
remove disabled code
dyndnsc/updater/base.py
dyndnsc/updater/base.py
# -*- coding: utf-8 -*- import logging import requests from ..common.subject import Subject from ..common.events import IP_UPDATE_SUCCESS, IP_UPDATE_ERROR log = logging.getLogger(__name__) class UpdateProtocol(Subject): """the base class for all update protocols""" _updateurl = None theip = None ...
Python
0
@@ -538,594 +538,8 @@ ()%0A%0A - observers = %5B%5D%0A%0A # TODO: auto detect all notifiers%0A # TODO: make this configurable?%0A if False:%0A from ..notifications import osxnotificationcenter%0A if osxnotificationcenter.is_available():%0A observers.appe...
6c15caa37c3635fc1ca65a0d2989a271bc5723fe
Update amalgamation.py
nnvm/amalgamation/amalgamation.py
nnvm/amalgamation/amalgamation.py
import sys import os.path, re, StringIO blacklist = [ 'Windows.h', 'mach/clock.h', 'mach/mach.h', 'malloc.h', 'glog/logging.h', 'io/azure_filesys.h', 'io/hdfs_filesys.h', 'io/s3_filesys.h', 'sys/stat.h', 'sys/types.h', 'omp.h' ] def get_sources(def_file): sources = [] files = [] ...
Python
0.000001
@@ -244,16 +244,50 @@ 'omp.h' +, 'execinfo.h', 'packet/sse-inl.h' %0A %5D%0A%0A
7fabbbb6562f068690b7971c6ea1299172400d73
fix `make run_importer_jobs`
labonneboite/importer/conf/development.py
labonneboite/importer/conf/development.py
# --- job 1/8 & 2/8 : check_etablissements & extract_etablissements DISTINCT_DEPARTEMENTS_HAVING_OFFICES = 15 # --- job 5/8 : compute_scores MINIMUM_OFFICES_REQUIRED_TO_TRAIN_MODEL = 0 RMSE_MAX = 5000 MAXIMUM_COMPUTE_SCORE_JOB_FAILURES = 94 # 96 departements == 2 successes + 94 failures # --- job 6/8 : validate_scor...
Python
0
@@ -190,17 +190,18 @@ E_MAX = -5 +20 000%0AMAXI
51129edea0a10a5799f329443b196e930a591fb9
Move down timezone module.
laundryapp/templatetags/laundryapptags.py
laundryapp/templatetags/laundryapptags.py
from schedule.conf.settings import CHECK_EVENT_PERM_FUNC, CHECK_CALENDAR_PERM_FUNC from schedule.templatetags.scheduletags import querystring_for_date from django.conf import settings from django import template from django.core.urlresolvers import reverse from django.utils import timezone from django.utils.safestrin...
Python
0
@@ -256,42 +256,8 @@ rse%0A -from django.utils import timezone%0A from @@ -399,16 +399,50 @@ rary()%0A%0A +from django.utils import timezone%0A from pyt
d7bfeae6b8346efa49c00dd19395e20a3e28404c
fix position of stream terminator blob
lbrynet/cryptstream/CryptStreamCreator.py
lbrynet/cryptstream/CryptStreamCreator.py
""" Utility for creating Crypt Streams, which are encrypted blobs and associated metadata. """ import logging from twisted.internet import interfaces, defer from zope.interface import implements from Crypto import Random from Crypto.Cipher import AES from lbrynet.cryptstream.CryptBlob import CryptStreamBlobMaker log...
Python
0.000003
@@ -2979,24 +2979,28 @@ ob()%0A + d = self._final @@ -3018,66 +3018,8 @@ d -l = defer.DeferredList(self.finished_deferreds)%0A dl .add @@ -3071,17 +3071,16 @@ return d -l %0A%0A # @@ -3736,24 +3736,51 @@ ceed(True)%0A%0A + @defer.inlineCallbacks%0A def _fin @@ -3994,32 +3994,33 @@ ...
827c11e1ac31bdbf0c853350464a2a4d55a82124
Add comments
lc0121_best_time_to_buy_and_sell_stock.py
lc0121_best_time_to_buy_and_sell_stock.py
"""Leetcode 121. Best Time to Buy and Sell Stock Easy URL: https://leetcode.com/problems/best-time-to-buy-and-sell-stock/ Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (i.e., buy one and sell one share of the sto...
Python
0
@@ -2845,32 +2845,90 @@ return 0%0A + %0A # Continue tracking minimum price and profit. %0A minimun
3a80367a61ddf958dc62d8082bc4e463709cbdef
Test bad value colors
vaex/test/plot.py
vaex/test/plot.py
__author__ = 'maartenbreddels' import unittest import os import tempfile import logging import shutil import numpy as np import PIL.Image import PIL.ImageChops import pylab as plt import vaex as vx import vaex.utils try: raw_input = input except: pass # py2/3 fix base_path = os.path.dirname(__file__) def get_comp...
Python
0.000001
@@ -1886,16 +1886,262 @@ e on%22)%0A%0A +%09def test_single_nan(self):%0A%09%09with check_output(%22single_xy_no_nan%22):%0A%09%09%09self.dataset.plot(%22x%22, %22y%22, f=%22log%22)%0A%09%09cm = plt.cm.inferno%0A%09%09cm.set_bad(%22orange%22)%0A%09%09with check_output(%22single_xy_nan%22):%0A%09%09%09self.dataset.plot...
3cefa75b8e9012d828453a764c0b169ab169fae6
fix google login names; associate with any user with same name
chip_friends/security.py
chip_friends/security.py
import random import string from flask import render_template from flask_security import Security, PeeweeUserDatastore from flask_social import Social from flask_social.datastore import PeeweeConnectionDatastore from flask_social.utils import get_connection_values_from_oauth_response from flask_social.views import con...
Python
0
@@ -1,16 +1,56 @@ +from __future__ import unicode_literals%0A import random%0Aim @@ -848,35 +848,218 @@ -ds = app.security.datastore +name = connection_values%5B'full_name'%5D%0A if isinstance(name, dict):%0A try:%0A name = '%7B%7D %7B%7D'.format(name%5B'givenName'%5D, name%5B'familyName'%5D...
5836b48bbfa87ba706e6ddcb267dc375678695a8
use str
test/functional/feature_asset_burn.py
test/functional/feature_asset_burn.py
#!/usr/bin/env python3 # Copyright (c) 2019-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import SyscoinTestFramework from test_framework.util import assert_equ...
Python
0.000001
@@ -940,19 +940,21 @@ ddress, +' 0.5 +' )%0A @@ -1267,11 +1267,13 @@ ss, +' 0.6 +' , '0 @@ -1383,19 +1383,21 @@ ddress, +' 0.5 +' , '0x931
9d2766a7b6aae9e3ad3c94925bdde100a70f6150
fix debug_view function
src/psd_tools/debug.py
src/psd_tools/debug.py
# -*- coding: utf-8 -*- """ Assorted debug utilities """ from __future__ import absolute_import import sys from collections import namedtuple try: from IPython.lib.pretty import pprint _PRETTY_ENABLED = True except ImportError: from pprint import pprint _PRETTY_ENABLED = False def debug_view(fp, txt="...
Python
0.000021
@@ -88,16 +88,32 @@ e_import +, print_function %0Aimport
3baf96f6aaab793467b07aa664aa4bbd6ee7eaac
Update pos.py
cltk/tag/pos.py
cltk/tag/pos.py
"""Tag part of speech (POS) using CLTK taggers.""" import os from nltk.tag import CRFTagger from nltk.tokenize import wordpunct_tokenize from cltk.utils.file_operations import open_pickle __author__ = ['Kyle P. Johnson <kyle@kyle-p-johnson.com>'] __license__ = 'MIT License. See LICENSE.' TAGGERS = {'greek': ...
Python
0.000001
@@ -965,16 +965,124 @@ ickle'%0A + %7D,%0A 'middle_low_german':%0A %7B'ngram_12_backoff': 'backoff_tagger.pickle'%0A @@ -4189,32 +4189,530 @@ urn tagged_text%0A + %0A def tag_ngram_12_backoff(self, untagged_string: str):%0A %22%22%22Tag POS with 1-, 2-gram t...
2bc1cd6ab4be134758edcc8739b89ce4984131b4
Fix overly large try/except block.
zerver/management/commands/create_user.py
zerver/management/commands/create_user.py
import argparse import logging from typing import Any, Optional from django.conf import settings from django.core import validators from django.core.exceptions import ValidationError from django.core.management.base import CommandError from django.db.utils import IntegrityError from zerver.lib.actions import do_creat...
Python
0
@@ -1511,33 +1511,16 @@ name%22%5D%0A%0A - try:%0A @@ -1572,20 +1572,16 @@ - - with ope @@ -1630,20 +1630,16 @@ - pw: Opti @@ -1667,20 +1667,16 @@ strip()%0A - @@ -1717,36 +1717,32 @@ ne:%0A - logging.warning( @@ -1742,20 +1742,16 @@ ...
45f3f41fa37192bdd246c390ed577056f5b844d2
add test for stitch_coordinates
test/test_experiment.py
test/test_experiment.py
import pytest from py import path @pytest.fixture def experiment(tmpdir): "'experiment--test' in tmpdir. Returns Experiment object." from leicaexperiment import Experiment e = path.local(__file__).dirpath().join('experiment--test') e.copy(tmpdir.mkdir('experiment')) return Experiment(tmpdir.join('...
Python
0.000001
@@ -26,16 +26,65 @@ ort path +%0Afrom leicaexperiment.experiment import attribute %0A%0A@pytes @@ -942,32 +942,231 @@ en(files) == 2%0A%0A + # stitch_coordinates%0A # images channel 0%0A imgs = %5Bi for i in experiment.images if attribute(i, 'c') == 0%5D%0A attrs = experiment.stitch_coordinates()%5B2%5D%...
71ff3df25e91bbce77d68b154947e9d8f08b7d18
call socket.recv multiple times to get all stats
src/collectors/memcached/memcached.py
src/collectors/memcached/memcached.py
# coding=utf-8 """ Collect memcached stats #### Dependencies * subprocess #### Example Configuration MemcachedCollector.conf ``` enabled = True hosts = localhost:11211, app-1@localhost:11212, app-2@localhost:11213, etc ``` TO use a unix socket, set a host string like this ``` hosts = /path/to/bla...
Python
0
@@ -2286,16 +2286,105 @@ port)))%0A +%0A # give up after a reasonable amount of time%0A sock.settimeout(3)%0A%0A @@ -2436,16 +2436,17 @@ ats%5Cn')%0A +%0A @@ -2456,91 +2456,341 @@ # s -omething big enough to get whatever is sent back%0A data = sock.recv(4096) +ta...
b2b19d5bd608db9286448000e1c998784139a614
update join
classmate_party/views.py
classmate_party/views.py
# -*- coding: utf-8 -*- import os import uuid from PIL import Image from django.shortcuts import render_to_response from models import * def index(request): return render_to_response('index.html', locals()) def join(request): msg = '' category_choice = Person.CATEGORY_CHOICE if request.method == ...
Python
0
@@ -1289,16 +1289,52 @@ lename%0A%0A + modify_persons = %5B%5D%0A @@ -1464,16 +1464,66 @@ me=name) +%0A modify_persons.append(person) %0A%0A @@ -1532,16 +1532,30 @@ +for person in Person.o @@ -1582,16 +1582,275 @@ ame) -.update( +:%0A ...
5e991fd00d980884f9210cfd5f25d5e7d91aabfc
Fix race condition in #144
test/replication/init_storage.test.py
test/replication/init_storage.test.py
import os import glob from lib.tarantool_server import TarantoolServer # master server master = server master.admin('space = box.schema.create_space(\'test\', {id = 42})') master.admin('space:create_index(\'primary\', \'hash\', {parts = { 0, \'num\' } })') master.admin('for k = 1, 9 do space:insert(k, k*k) end') f...
Python
0
@@ -371,17 +371,20 @@ log')):%0A -%09 + os.unlin @@ -807,25 +807,28 @@ nge(1, 10):%0A -%09 + replica.admi @@ -1008,17 +1008,46 @@ ) end')%0A +lsn = master.get_param('lsn') %0A - print '- @@ -1474,17 +1474,38 @@ test');%0A +replica.wait_lsn(lsn) %0A - for i in @@ -1523,9 +1523,12 @@ 0):%0A -%09 + ...
69364c598f380a15cc5b03cb935bed0f2085bac1
fix abroken test
test/test_api/test_call_signatures.py
test/test_api/test_call_signatures.py
from textwrap import dedent import inspect from ..helpers import TestCase from jedi import Script from jedi._compatibility import is_py33 class TestCallSignatures(TestCase): def _run(self, source, expected_name, expected_index=0, line=None, column=None): signatures = Script(source, line, column).call_sig...
Python
0.000508
@@ -5416,21 +5416,52 @@ tation', - 'doc +%0A 'doc', 'parent '%5D%0A
0ea32a2b51438b55130082e54f30fc9c97bd9d85
Fix compatibility with oslo.db 12.1.0
cloudkitty/db/__init__.py
cloudkitty/db/__init__.py
# -*- coding: utf-8 -*- # Copyright 2014 Objectif Libre # # 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 ...
Python
0.000019
@@ -794,70 +794,299 @@ -_FACADE = session.EngineFacade.from_config(cfg.CONF, sqlite_fk +# FIXME(priteau): Remove autocommit=True (and ideally use of%0A # LegacyEngineFacade) asap since it's not compatible with SQLAlchemy%0A # 2.0.%0A _FACADE = session.EngineFacade.from_config(cfg.CONF, sqlite...
cfe7de10ef9c6c1d8d5be71993e5f96ace58953d
Update Ansible release version to 2.6.0dev0.
lib/ansible/release.py
lib/ansible/release.py
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
Python
0
@@ -851,10 +851,12 @@ .6.0 -a1 +dev0 '%0A__
359f337d7cfd0dac2eec8ecce643af10588e3e6a
Fix i18n __radd__ bug
uliweb/i18n/lazystr.py
uliweb/i18n/lazystr.py
def lazy(func): def f(message): return LazyString(func, message) return f class LazyString(object): """ >>> from uliweb.i18n import gettext_lazy as _ >>> x = _('Hello') >>> print repr(x) """ def __init__(self, func, message): self._func = func se...
Python
0.263457
@@ -1356,32 +1356,38 @@ %0D%0A return + obj + self.getvalue() @@ -1378,38 +1378,32 @@ self.getvalue() - + obj %0D%0A %0D%0A
ac985005f925c0d37ae337ada0bf88b50becaee6
change scheduler
coalics/schedule.py
coalics/schedule.py
import os.path import sys sys.path.append(os.path.join(os.path.dirname(__file__), "..")) import logging from coalics import tasks, q, redis, app from datetime import datetime from datetime import datetime, timedelta import time # stream_handler = logging.StreamHandler() # stream_handler.setLevel(logging.INFO) # app...
Python
0.000001
@@ -805,123 +805,8 @@ - if prev_job: print(prev_job.result)%0A if prev_job == None or prev_job.result != None:%0A prev_job = q.e
bcf244e19c20fafcc89658d4aac8859097deb18c
Add ValidationDecoratorTest class
test/test_validation.py
test/test_validation.py
# -*- coding: utf-8 -*- import unittest from mock import Mock, patch from cachetools.func import lru_cache from nose_parameterized import parameterized from spam_lists.validation import accepts_valid_urls, is_valid_url from spam_lists.exceptions import InvalidURLError class AcceptValidUrlsTest(unittest.TestCase): ...
Python
0
@@ -4010,16 +4010,920 @@ rl(url)) +%0A %0Aclass ValidationDecoratorTest(object):%0A %0A def setUp(self):%0A self.validity_tester_patcher = patch(self.validity_tester)%0A self.validity_tester_mock = self.validity_tester_patcher.start()%0A %0A function = Mock()%0A function...
9b354f4dc00e3aef4cfceae71be60b1dc60a1927
Add test for ticket #1559.
numpy/ma/tests/test_regression.py
numpy/ma/tests/test_regression.py
from numpy.testing import * import numpy as np rlevel = 1 class TestRegression(TestCase): def test_masked_array_create(self,level=rlevel): """Ticket #17""" x = np.ma.masked_array([0,1,2,3,0,4,5,6],mask=[0,0,0,1,1,1,0,0]) assert_array_equal(np.ma.nonzero(x),[[1,2,6,7]]) def test_masked...
Python
0
@@ -1075,8 +1075,290 @@ ode%22))%0A%0A + def test_atleast_2d(self):%0A %22%22%22Ticket #1559%22%22%22%0A a = np.ma.masked_array(%5B0.0, 1.2, 3.5%5D, mask=%5BFalse, True, False%5D)%0A b = np.atleast_2d(a)%0A assert_(a.mask.ndim == 1)%0A assert_(b.mask.ndim == 2)%0A%0A%0Aif __name__...
813c478f06c175e36dc8334fd37195e403a42166
update test_symbol_accuracy
test_symbol_accuracy.py
test_symbol_accuracy.py
from dataset import create_testing_data_for_symbol, get_symbol_list from keras.models import load_model import sys INITIAL_CAPITAL = 10000.0 PERCENT_OF_CAPITAL_PER_TRANSACTION = 10.0 TRANSACTION_FEE = 0 def compare(x, y): if x[1] < y[1]: return 1 return -1 def main(): model = load_model(sys.argv[1]) symbols = ...
Python
0.000025
@@ -227,16 +227,16 @@ f x%5B -1 +3 %5D %3C y%5B -1 +3 %5D:%0A%09 @@ -364,16 +364,31 @@ ymbols:%0A +%09%09print %22----%22%0A %09%09X, Y = @@ -423,31 +423,16 @@ bol(sym) -%0A%09%09print %22----%22 %0A%0A%09%09mone @@ -451,16 +451,47 @@ CAPITAL%0A +%09%09true_pos = 0%0A%09%09false_pos = 0%0A %09%09for i @@ -645...
43d30fd28bd09708c1ad0dd64b702a61d9a25636
add test for XSS attack
tests/app/soc/logic/test_filtering.py
tests/app/soc/logic/test_filtering.py
#!/usr/bin/env python2.5 # -*- coding: UTF-8 -*- # # Copyright 2010 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
Python
0
@@ -3514,8 +3514,557 @@ string)%0A +%0A def test_xss_gets_filtered(self):%0A %22%22%22Test that the XSS as described in %5B0%5D gets filtered.%0A%0A %5B0%5D http://stackoverflow.com/questions/699468/python-html-sanitizer-scrubber-filter/812785#812785%0A %22%22%22%0A from HTMLParser import HTMLParseError%0...
cf4fc126b49c425d7f441abc91f4114b5f1303ea
Move publication field above tite//subtitle/description in admin
cms_lab_carousel/admin.py
cms_lab_carousel/admin.py
from django.contrib import admin from cms_lab_carousel.models import Carousel, Slide class CarouselAdmin(admin.ModelAdmin): fieldset_frame = ('Carousel Frame', { 'fields': [ 'title', 'header_image', 'footer_image', ], }) fieldset_visibility = ('Visibilit...
Python
0
@@ -1472,24 +1472,51 @@ 'carousel',%0A + 'publication',%0A @@ -1729,35 +1729,8 @@ : %5B%0A - 'publication',%0A
46c490df9a3e60119de5485fb508e527e6dbb057
Add testcase for hr tag
tests/app/soc/logic/test_filtering.py
tests/app/soc/logic/test_filtering.py
#!/usr/bin/env python2.5 # -*- coding: UTF-8 -*- # # Copyright 2010 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
Python
0
@@ -4761,28 +4761,271 @@ l(cleaner.string, expected)%0A +%0A def test_hr_tags_are_preserved(self):%0A %22%22%22Test that hr tags are preserved%22%22%22%0A dirty = u'''%3Cp%3E%3Chr%3E%3C/p%3E'''%0A cleaner = HtmlSanitizer.Cleaner()%0A cleaner.string = dirty%0A cleaner.clean()%0A self.assertEqual(dirt...
aef9672ac63800c1f63cf721da9b89bfaa1e87b8
Change default sort order
colourlens/views.py
colourlens/views.py
from django.db.models import Avg, Sum, Count from django import forms from django.forms.widgets import Input from django.http import HttpResponse from django.template import RequestContext, loader from django.views.decorators.cache import cache_page from colourlens.models import Artwork, Colour PROM_ATTRS = {'min': '0...
Python
0.000001
@@ -3084,24 +3084,26 @@ ate(%0A + # ave_distanc @@ -3144,16 +3144,74 @@ %0A + # tot_distance=Avg(%22colourdistance__distance%22),%0A # ave_pre @@ -3256,16 +3256,18 @@ %0A + # tot_pre @@ -3303,16 +3303,132 @@ esence%22) +,%0A tot_prominence=Sum(%22colourdistance__prominence%2...
f61a4766ad3006bb2001df33d06feeb15352aa5a
Change Box user list request from raw API call to Box SDK make_request method
okta-integration/python/server.py
okta-integration/python/server.py
from flask import Flask, redirect, g, url_for from flask_oidc import OpenIDConnect from okta import UsersClient from boxsdk import Client from boxsdk import JWTAuth import requests import config import json app = Flask(__name__) app.config.update({ 'SECRET_KEY': config.okta_client_secret, 'OIDC_CLIENT_SECRETS': '....
Python
0
@@ -983,16 +983,52 @@ ser.id%0A%0A + # Instantiate Box Client instance%0A auth = @@ -1077,54 +1077,8 @@ n')%0A - access_token = auth.authenticate_instance()%0A bo @@ -1204,108 +1204,53 @@ '%0A -headers = %7B'Authorization': 'Bearer ' + access_token%7D%0A response = requests.get(url, headers=headers +respo...
332cbbd8b1be773593037d293c5dabbf6c100199
Migrate freedns tests from coroutine to async/await (#30390)
tests/components/freedns/test_init.py
tests/components/freedns/test_init.py
"""Test the FreeDNS component.""" import asyncio import pytest from homeassistant.components import freedns from homeassistant.setup import async_setup_component from homeassistant.util.dt import utcnow from tests.common import async_fire_time_changed ACCESS_TOKEN = "test_token" UPDATE_INTERVAL = freedns.DEFAULT_IN...
Python
0
@@ -31,24 +31,8 @@ %22%22%22%0A -import asyncio%0A%0A impo @@ -900,35 +900,22 @@ )%0A%0A%0A -@ async -io.coroutine%0A + def test @@ -1149,34 +1149,29 @@ result = -yield from +await async_setup @@ -1514,26 +1514,21 @@ AL)%0A -yield from +await hass.as @@ -1597,27 +1597,14 @@ 2%0A%0A%0A -@ async...
0c5ab1d1b09dd77cd2052f9f4cbad3c7bbf5b8ef
Fix failing von mises tests on CUDA (#1747)
tests/distributions/test_von_mises.py
tests/distributions/test_von_mises.py
from __future__ import absolute_import, division, print_function import math import pytest import torch from torch import optim from pyro.distributions import VonMises, VonMises3D from pyro.distributions.von_mises import _log_modified_bessel_fn def _fit_params_from_samples(samples, n_iter): assert samples.dim(...
Python
0
@@ -70,16 +70,26 @@ ort math +%0Aimport os %0A%0Aimport @@ -251,16 +251,54 @@ ssel_fn%0A +from tests.common import skipif_param%0A %0A%0Adef _f @@ -1599,37 +1599,212 @@ oncentration', %5B -0.01, +skipif_param(0.01, condition='CUDA_TEST' in os.environ,%0A reaso...
70f198f6148f5edbef0af77d6959171265abc248
remove uvindex
commands/weather.py
commands/weather.py
#import forecastiopy import geocoder import json import discord import datetime from forecastiopy import * from darksky import forecast from discord.ext import commands from utils.sharding import darkskyapi api_key = darkskyapi class Weather(): def __init__(self, bot): self.bot = bot @commands.comma...
Python
0.997691
@@ -2194,816 +2194,8 @@ oc)%0A - if current.uvIndex == 0:%0A uvresult = %22There probably isn't any sun right now.%22%0A uvint = %220%22%0A elif current.uvIndex == range(1, 5):%0A uvresult = %22Few sun rays are hitting.%22%0A ...
72941398fd2e78cbf5d994b4bf8683c4bdefaab9
Comment out semipar notebook in travis runner until pip build us updated.
utils/travis_runner.py
utils/travis_runner.py
#!/usr/bin/env python """This script manages all tasks for the TRAVIS build server.""" import os import subprocess if __name__ == "__main__": os.chdir("promotion/grmpy_tutorial_notebook") cmd = [ "jupyter", "nbconvert", "--execute", "grmpy_tutorial_notebook.ipynb", "--Ex...
Python
0
@@ -405,16 +405,18 @@ /..%22)%0A%0A%0A +# if __nam @@ -426,32 +426,34 @@ == %22__main__%22:%0A +# os.chdir(%22pr @@ -482,36 +482,38 @@ _notebook%22)%0A +# + cmd = %5B%0A %22jup @@ -492,32 +492,34 @@ )%0A# cmd = %5B%0A +# %22jupyter @@ -513,32 +513,34 @@ %22jupyter%22,%0...
1f2c175d00729902a953513436879b08a0e3baa3
test must have broken with upgrade (change in random seed?) so this fixes it
tests/mep/genetics/test_chromosome.py
tests/mep/genetics/test_chromosome.py
import unittest import random from mep.genetics.gene import VariableGene, OperatorGene, Gene from mep.genetics.chromosome import Chromosome import numpy as np class MockedGene(Gene): def __init__(self, error_to_return): """ Initialize. :param error_to_return: what to return in the evaluate...
Python
0
@@ -1502,25 +1502,24 @@ .assertEqual -s (num_genes, @@ -1565,17 +1565,16 @@ ertEqual -s (num_con @@ -1714,17 +1714,16 @@ ertEqual -s (Variabl @@ -1882,17 +1882,16 @@ ertEqual -s (Operato @@ -1924,17 +1924,17 @@ _family%5B -2 +4 %5D(), 0, @@ -2015,17 +2015,16 @@ ostEqual -s (8.59979
17dfc3faa45584200c8f67686b86b541a2ce01fe
Test for informal word
revscoring/languages/tests/test_hebrew.py
revscoring/languages/tests/test_hebrew.py
from nose.tools import eq_ from .. import language, hebrew def test_language(): is_misspelled = hebrew.solve(language.is_misspelled) assert is_misspelled("חטול") assert not is_misspelled("חתול") is_badword = hebrew.solve(language.is_badword) assert is_badword("שרמוטה") assert not is_badwo...
Python
0.000037
@@ -323,12 +323,154 @@ (%22%D7%A9%D7%99%D7%9E%D7%A8%D7%95%D7%AA%D7%94%22)%0A +%0A is_informal_word = hebrew.solve(language.is_informal_word)%0A%0A assert is_informal_word(%22%D7%91%D7%92%D7%9C%D7%9C%D7%9A%22)%0A assert not is_informal_word(%22%D7%91%D7%92%D7%9C%D7%9C%22)%0A
1b75a0e5ee01387c434922b9d0fd23705cbafe9b
Allow empty enums for `OneOf`
marshmallow_jsonschema/validation.py
marshmallow_jsonschema/validation.py
from marshmallow import fields from .exceptions import UnsupportedValueError def handle_length(schema, field, validator, parent_schema): """Adds validation logic for ``marshmallow.validate.Length``, setting the values appropriately for ``fields.List``, ``fields.Nested``, and ``fields.String``. Args:...
Python
0.000011
@@ -2392,38 +2392,25 @@ dict: -A, possibly, n +N ew JSON Sche @@ -2478,38 +2478,8 @@ %22%22%22%0A - if validator.choices:%0A @@ -2519,20 +2519,16 @@ hoices)%0A - sche
eb71d45097e509273518b83113489911bf985e4a
clean up
mcpipy/test/builders/test_protein.py
mcpipy/test/builders/test_protein.py
import pandas as pd from cellcraft.builders.protein import define_items_color_texture_protein, store_location_biological_prot_data def test_define_items_color_texture_protein(): dict_chains = {"a": 1, "b": 2} d_appearance = define_items_color_texture_protein(dict_chains) assert len(d_appearance) == 2 ...
Python
0.000001
@@ -377,205 +377,4 @@ r'%5D%0A -%0Adef test_store_location_biological_prot_data():%0A complex_coordinates = pd.Series(%5B0.03, 0.45, 0.23%5D)%0A name = '1jsu'%0A data_dict = store_location_biological_prot_data(complex_coordinates, name)
34c901455f539ec9860c7704cc5f8cc8a09a8bca
Remove excessive logging from indexing script
scripts/process-g6-into-elastic-search.py
scripts/process-g6-into-elastic-search.py
#!/usr/bin/python '''Process G6 JSON files into elasticsearch This version reads JSON from disk or DM API and transforms this into the format expected by the DM search. Usage: process-g6-into-elastic-search.py <es_endpoint> <dir_or_endpoint> [<token>] Arguments: es_endpoint Full ES index URL dir_or_...
Python
0
@@ -2834,431 +2834,98 @@ -print request.get_full_url()%0A print request.get_data()%0A%0A try:%0A connection = opener.open(request)%0A except urllib2.HTTPError, e:%0A connection = e%0A print connection%0A%0A # check. Substitute with appropriate HTTP code.%0A if connection.code =...
237f85009e2d8669e75c1e7e9ae3940efe7a151d
update vetn version and pull recursively
vcontrol/rest/machines/create.py
vcontrol/rest/machines/create.py
from ..helpers import get_allowed import ast import json import os import subprocess import web class CreateMachineR: """ This endpoint is for creating a new machine of Vent on a provider. """ allow_origin, rest_url = get_allowed.get_allowed() def OPTIONS(self): return self.POST() def...
Python
0
@@ -2458,17 +2458,17 @@ ad/v0.1. -0 +1 /vent.is @@ -3190,16 +3190,28 @@ t clone +--recursive https://
be929d518ff320ed8e16f57da55f0855800f7408
Use mutli_reduce instead of reduce in enum file loading
src/engine/file_loader.py
src/engine/file_loader.py
import os import json from lib import contract data_dir = os.path.join(os.environ['PORTER'], 'data') @contract.accepts(str) @contract.returns(list) def read_and_parse_json(data_type): sub_dir = os.path.join(data_dir, data_type) def full_path(file_name): return os.path.join(sub_dir, file_name) ...
Python
0
@@ -40,16 +40,28 @@ contract +, functional %0A%0Adata_d @@ -715,23 +715,8 @@ map, - args):%0A enu @@ -738,15 +738,10 @@ type - = args +): %0A @@ -816,31 +816,57 @@ %0A return -reduce( +functional.multi_reduce(%0A create_enum_
a429ce49dc5ed823a33c5a4fa64bd92b422b9b10
change imports
BEGAN/train.py
BEGAN/train.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division import tensorflow as tf import numpy as np import time import began import sys sys.path.insert(0, '../') import datasets import image_utils as iu dirs = { 'sample_output': './BEGAN/', 'checkpoint':...
Python
0.000001
@@ -215,23 +215,50 @@ ')%0A%0A -import datas +from datasets import DataIterator, DataS et -s %0Aimp @@ -1564,25 +1564,16 @@ ds = -datasets. DataSet( @@ -1606,33 +1606,24 @@ - input_width= @@ -1643,33 +1643,24 @@ - - input_channe @@ -1661,29 +1661,19 @@ channel= ...
ecc21e3fccc41413686389735da93e0488779cc4
Add a test command
pypush.py
pypush.py
# Simple Push Python Module import znc import re import http.client, urllib import traceback class pypush(znc.Module): module_types = [znc.CModInfo.UserModule] description = "Push python3 module for ZNC" def OnLoad(self, sArgs, sMessage): self.nick = '' self.debug = False return z...
Python
0.000797
@@ -3004,9 +3004,137 @@ bug));%0A%0A + def DoCommand_test(self, argv):%0A self.PushMsg(%22Test%22, %22%7B0%7D%22.format(' '.join(argv%5B0:%5D)))%0A return znc.CONTINUE%0A%0A %0A
9d74f2ebfc0a635026544a977380593e90b4150d
upgrade (goflow.workflow indepency)
leavedemo/urls.py
leavedemo/urls.py
from django.conf.urls.defaults import * from django.conf import settings from leave.forms import StartRequestForm, RequesterForm, CheckRequestForm from os.path import join, dirname _dir = join(dirname(__file__)) from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # FOR D...
Python
0
@@ -2808,24 +2808,33 @@ ude('goflow. +apptools. urls_admin')
1df66cc442e93d85fd8a8bbab2815574387a8952
Remove print
doc/examples/brain_extraction_dwi.py
doc/examples/brain_extraction_dwi.py
""" ================================================= Brain segmentation with dipy.segment.mask. ================================================= We show how to extract brain information and mask from a b0 image using dipy's segment.mask module. First import the necessary modules: """ import os.path import numpy as...
Python
0.000016
@@ -1114,63 +1114,8 @@ %22%22%0A%0A -print('Segmenting brain data from GE 3T b0 volume...')%0A from
51b716cc00efd0d0c93ffc11f4cd7242446bad88
Remove unused pyrax import
nodes/management/commands/create_images.py
nodes/management/commands/create_images.py
from gevent import monkey monkey.patch_all() import gevent import os from django.core.management import BaseCommand from django.conf import settings from ...utils import connect_to_node, logger, pyrax class Command(BaseCommand): help = 'create nodes images' def handle(self, *args, **kwargs): self._r...
Python
0
@@ -191,15 +191,8 @@ gger -, pyrax %0A%0A%0Ac
9ca88c5cd7f52c6f064a1d5edb003471f6223a74
Change lable on click
Winston.py
Winston.py
import sys from PyQt4.QtGui import * #from PyQt4.QtWidgets import * from PyQt4.QtCore import * from core.Messenger import * from core.Events import * from alexa import AlexaService class QTApp(QWidget): def __init__(self): super(QWidget, self).__init__() self.title = 'Winston' self.setWin...
Python
0
@@ -197,18 +197,17 @@ idget):%0A - %0A + def @@ -521,18 +521,17 @@ nitUI()%0A - %0A + def @@ -552,17 +552,26 @@ -b +self.label = QLabe @@ -586,17 +586,26 @@ -b +self.label .setText @@ -654,17 +654,26 @@ -b +self.label .move(50 @@ -1035,16 +1035,40 @@ click)%0A + ...
3ced845c7735cbeb67077d8934768370545b2535
Set nodata value for output tiff.
code/readDTM.py
code/readDTM.py
# The MIT License (MIT) # Copyright (c) 2014 Hishiv Shah # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, mo...
Python
0
@@ -3153,16 +3153,69 @@ utTiff,%0A + %22-a_nodata%22, %22-9999%22,%0A
2f31a1f0745214c2b06dadc1258926f7440d429f
Set datetime output format to ISO8601
abe/app.py
abe/app.py
#!/usr/bin/env python3 """Main flask app""" from flask import Flask, render_template, jsonify from flask_restful import Api from flask_cors import CORS from flask_sslify import SSLify # redirect to https import os import logging FORMAT = "%(levelname)s:ABE: _||_ %(message)s" logging.basicConfig(level=logging.DEBUG, ...
Python
0.999999
@@ -197,16 +197,82 @@ to https +%0Afrom flask.json import JSONEncoder%0A%0Afrom datetime import datetime %0A%0Aimport @@ -614,16 +614,261 @@ i(app)%0A%0A +%0Aclass CustomJSONEncoder(JSONEncoder):%0A%0A def default(self, obj):%0A if isinstance(obj, datetime):%0A return obj.isoformat()%0A e...
ba1494afb962fb8fba84e306cfb4c26a83602b6d
update license
drink.py
drink.py
# -*- coding: utf-8 -*- """ Copyright (C) 2014 Chuck Housley This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the COPYING file for more details. """ import os from server import app, db import ser...
Python
0
@@ -21,257 +21,8 @@ -*-%0A -%22%22%22%0ACopyright (C) 2014 Chuck Housley%0AThis work is free. You can redistribute it and/or modify it under the%0Aterms of the Do What The Fuck You Want To Public License, Version 2,%0Aas published by Sam Hocevar. See the COPYING file for more details.%0A%22%22%22%0A%0A impo
6b56ab963f46ac45caf0a2f3391fdedf9dfabb39
Fix python2 compatibility
create_dataset.py
create_dataset.py
import os import shutil import spotipy import pickle import pandas as pd import numpy as np from collections import Counter if not os.path.exists("genres.p"): # Login to Spotify and get your OAuth token: # https://developer.spotify.com/web-api/search-item/ AUTH = "BQBHlFpkjjlfDwbyQ7v0F1p_cejpmYARG6KDclVlP...
Python
0.000303
@@ -1,12 +1,51 @@ +from __future__ import print_function%0A%0A import os%0Aim @@ -125,16 +125,17 @@ as np%0A%0A +%0A from col @@ -1675,16 +1675,28 @@ %22, %22wb%22) +, protocol=2 )%0Aelse:%0A
1b726978e1604269c8c4d2728a6f7ce774e5d16d
Fix edit control assessment modal
src/ggrc/models/control_assessment.py
src/ggrc/models/control_assessment.py
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: anze@reciprocitylabs.com # Maintained By: anze@reciprocitylabs.com from ggrc import db from .mixins import ( deferred, BusinessObject, Timeboxe...
Python
0
@@ -1133,16 +1133,88 @@ l_id%5D)%0A%0A + audit = %7B%7D # we add this for the sake of client side error checking%0A%0A # REST @@ -1300,16 +1300,44 @@ control' +,%0A PublishOnly('audit') %0A %5D%0A%0Atr
e7d9a67611b2dc443c1f2bc23506323837d79bda
fix test_mcp
numerics/swig/tests/test_mcp.py
numerics/swig/tests/test_mcp.py
# Copyright (C) 2005, 2012 by INRIA #!/usr/bin/env python import numpy as np import siconos.numerics as N def mcp_function (z) : M = np.array([[2., 1.], [1., 2.]]) q = np.array([-5., -6.]) return dot(M,z) + q def mcp_Nablafunction (z) : M = np.array([[2., 1.], [1., 2.]]...
Python
0.00002
@@ -109,37 +109,35 @@ def mcp_function - (z) - :%0A M = np.arr @@ -157,32 +157,35 @@ %0A + %5B1., 2.%5D%5D)%0A%0A @@ -220,16 +220,19 @@ return +np. dot(M,z) @@ -262,13 +262,11 @@ tion - (z) - :%0A @@ -283,32 +283,35 @@ rray(%5B%5B2., 1.%5D,%0A + %5B @@ -501...
2fbdd9903fc9bf6e1fe797e92c0157abd67850ce
add robust tests for exec_command()
numpy/distutils/tests/test_exec_command.py
numpy/distutils/tests/test_exec_command.py
import sys import StringIO from numpy.distutils import exec_command class redirect_stdout(object): """Context manager to redirect stdout for exec_command test.""" def __init__(self, stdout=None): self._stdout = stdout or sys.stdout def __enter__(self): self.old_stdout = sys.stdout ...
Python
0.000001
@@ -1,12 +1,22 @@ +import os%0A import sys%0Ai @@ -475,16 +475,765 @@ stdout%0A%0A +class redirect_stderr(object):%0A %22%22%22Context manager to redirect stderr for exec_command test.%22%22%22%0A def __init__(self, stderr=None):%0A self._stderr = stderr or sys.stderr%0A%0A def __enter__(self):%0A ...