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
e0280150917934e9ba051966e8aa966d4cd43a6d
fix flake warning try 2
verisure/devices/smartplug.py
verisure/devices/smartplug.py
""" Smartplug device """ import time from .overview import Overview OVERVIEW_URL = '/overview/smartplug' COMMAND_URL = '/smartplugs/onoffplug.cmd' DETAILS_URL = '/smarthome/{}/details' class Smartplug(object): """ Smartplug device Args: session (verisure.session): Current session """ def _...
Python
0
@@ -2086,17 +2086,16 @@ if -( overview @@ -2110,36 +2110,16 @@ evice_id -%0A and ove @@ -2139,17 +2139,16 @@ == value -) %5D:%0A
7e48ea5fe20eb63de782ec8d110da4f848155f79
Remove unnecessary struct from colour tables parse
gifprime/parser.py
gifprime/parser.py
"""Construct-based parser for the GIF file format. Based on specifications: http://www.w3.org/Graphics/GIF/spec-gif89a.txt http://www.w3.org/Graphics/GIF/spec-gif87.txt """ import construct import gifprime.lzw def BlockStart(name, label): """Return header for a block.""" return construct.Embedded( ...
Python
0.000004
@@ -2299,57 +2299,8 @@ ag,%0A - construct.Struct(%0A 'gct',%0A @@ -2312,36 +2312,32 @@ onstruct.Array(%0A - lamb @@ -2354,47 +2354,13 @@ w(2, -%0A ctx. -_. logi @@ -2392,28 +2392,24 @@ _size + 1),%0A - @@ -2449,41 +2449...
902b7233088be73a9eeaab6721f26b108ea2668c
Add link to GIF87a spec
gifprime/parser.py
gifprime/parser.py
"""Construct-based parser for the GIF89a file format. Based on specification: http://www.w3.org/Graphics/GIF/spec-gif89a.txt """ import construct # common representation of blocks of data (includes terminator) _data_subblocks = construct.Struct( '_data_subblocks', construct.OptionalGreedyRange( con...
Python
0
@@ -30,19 +30,16 @@ the GIF -89a file fo @@ -67,16 +67,17 @@ fication +s :%0Ahttp:/ @@ -117,16 +117,62 @@ 89a.txt%0A +http://www.w3.org/Graphics/GIF/spec-gif87.txt%0A %22%22%22%0A%0A%0Aim
4c54dc3d7c82bdbba9054e3835dd679e65461015
Remove unnecessary sys.exit() call on main()
backquotes.py
backquotes.py
#!/usr/bin/env python # -*- coding:ascii -*- import contextlib import inspect import locale import optparse import os import string import subprocess import sys import tempfile import tokenize import warnings __all__ = ['shell', 'preprocess'] __version__ = '0.0.4' def shell(argstring): r"""Invoke shell command...
Python
0.00001
@@ -4747,15 +4747,8 @@ turn -_code = sub @@ -4797,38 +4797,8 @@ gs)%0A - sys.exit(return_code)%0A @@ -4857,26 +4857,24 @@ -sys.exit() +return 0 %0A%0A%0Aif __
6bef219564614d7f54cc662368e5a1f7bf37ca24
Add public port 80 for nginx
bag8/tools.py
bag8/tools.py
from __future__ import absolute_import, print_function, unicode_literals import click import os import shutil from compose.cli.docker_client import docker_client from bag8.common import PREFIX from bag8.common import TMPFOLDER from bag8.common import call from bag8.common import simple_name from bag8.common import ...
Python
0.000001
@@ -4023,16 +4023,51 @@ rom cli%0A + '-p', '0.0.0.0:80:80',%0A
401c4bf8a421d4de3161662fba51d9e72ba5af1b
Handle nullable object attributes on base.tests reverse_pattern
base/tests.py
base/tests.py
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ # standard library # django from django.conf import settings from django.contrib import admin from django.urls import NoReverseMatch fr...
Python
0.000002
@@ -1233,34 +1233,8 @@ name -, args=args, kwargs=kwargs )%0A @@ -4783,24 +4783,48 @@ hasattr(obj, + param) and getattr(obj, param):%0A
2cfa733900ca385dbc835124895771f04dc21969
add v4l2 codecs
voctocore/lib/localplayout.py
voctocore/lib/localplayout.py
#!/usr/bin/env python3 import logging import gi from gi.repository import Gst from vocto.video_codecs import construct_video_encoder_pipeline from lib.args import Args from lib.config import Config class LocalPlayout(): def __init__(self, source, port, use_audio_mix=False, audio_blinded=False): # create...
Python
0.00002
@@ -2660,32 +2660,78 @@ layout-%7Bsource%7D%0A + wait-for-connection=false%0A
55431e184aaca8c443794569d1b37d1163e5ad0d
removed redundant ? in regexp
volta/common/eventshandler.py
volta/common/eventshandler.py
""" Event parser """ import queue as q import logging import re import threading # data sample: lightning: [volta] 12345678 fragment TagFragment start # following regexp grabs 'app name', 'nanotime', 'type', 'tag' and 'message' from sample above re_ = re.compile(r""" ^(?P<app>\S+) \s+ \[volta\] \s+ ...
Python
0.999921
@@ -76,16 +76,55 @@ ading%0A%0A%0A +logger = logging.getLogger(__name__)%0A%0A%0A # data s @@ -449,17 +449,16 @@ ssage%3E.* -? )%0A $%0A @@ -501,47 +501,8 @@ )%0A%0A%0A -logger = logging.getLogger(__name__)%0A%0A%0A clas @@ -4145,17 +4145,22 @@ 678 sync -1 +broken TagSync
d301cfc0e8f76c94f8f3bcd1b0263f9bd6e1604c
Add call_decorator to RedisManager.
vumi/persist/redis_manager.py
vumi/persist/redis_manager.py
# -*- test-case-name: vumi.persist.tests.test_redis_manager -*- import redis from vumi.persist.redis_base import Manager from vumi.persist.fake_redis import FakeRedis class RedisManager(Manager): @classmethod def _fake_manager(cls, key_prefix, client=None): if client is None: client = Fa...
Python
0
@@ -166,38 +166,149 @@ dis%0A -%0A%0Aclass RedisManager(Manager): +from vumi.persist.riak_manager import flatten_generator%0A%0A%0Aclass RedisManager(Manager):%0A%0A call_decorator = staticmethod(flatten_generator)%0A %0A
8320b81b7355c0158231b4a3c7ac40c49872f7b1
handle partial pbuttons in ss tab
scripts/ss_tab.py
scripts/ss_tab.py
# pandas and numpy for data manipulation import pandas as pd import numpy as np import sqlite3 import holoviews as hv hv.extension('bokeh') from bokeh.plotting import Figure from bokeh.models import (CategoricalColorMapper, HoverTool, ColumnDataSource, Panel, FuncTickFormatter, SingleIntervalTicker, L...
Python
0
@@ -796,22 +796,8 @@ )%0A%09t -abs = Tabs(tab s = @@ -835,16 +835,70 @@ 4_tab%5D)%0A + tabs = Tabs(tabs = list(filter(None.__ne__, ts)))%0A %09tab = P
aa71eb4e8e1e61f449c4e7dce60f74e9a7d80ae0
Fix url and timeout
src/kuas_api/kuas/ap.py
src/kuas_api/kuas/ap.py
#-*- encoding=utf-8 -*- """This module `ap` provide manipulate of kuas AP system. """ __version__ = 2.0 import requests from lxml import etree # AP URL Setting #: AP sytem base url AP_BASE_URL = "http://140.127.113.224" #: AP system login url AP_LOGIN_URL = AP_BASE_URL + "/kuas/perchk.jsp" #: AP system general que...
Python
0.000346
@@ -216,10 +216,10 @@ 13.2 -24 +31 %22%0A%0A# @@ -573,17 +573,17 @@ MEOUT = -1 +5 .0%0A%0A#: Q
64526ca4dc81ceaae2fe139502a0d98d0f3558a7
write to STDOUT, update name of fn, doc
scripts/fisher_compare.py
scripts/fisher_compare.py
from fisher import pvalue import sys import os.path as op sys.path.insert(0, op.join(op.dirname(__file__), "../code")) from methyl import MethylGroup import numpy as np from flatfeature import Flat def bin_setup(chr, adir, bdir, context): am = MethylGroup(adir)[chr] bm = MethylGroup(bdir)[chr] return am.as...
Python
0.000001
@@ -1,12 +1,139 @@ +%22%22%22%0Acompare 2 sets of data that have been run through the methylcode pipeline.%0Ausage:%0A%0A %25 prog %5Boptions%5D dir_a/ dir_b/%0A%0A%22%22%22%0A from fisher @@ -274,27 +274,8 @@ oup%0A -import numpy as np%0A from @@ -472,24 +472,23 @@ def run_ -50bp_gff +compare (flat, a @@ -556...
53dd23af60f18c165c3359c3ab5da03d40ebb62e
version 2.1
upload.py
upload.py
#!/usr/bin/env python # Upload CAN messages and Tags detected to Industrial PC via WiFi # This script will be called every 5 second by the main script import httplib import datetime import time import os logFilePath = None def write_log(text): logfile = open(logFilePath, 'a', 1) now = datetime.datetime.now().strf...
Python
0.000001
@@ -505,17 +505,16 @@ ogFolder -_ ):%0A%09# UR
64967f3d262a1823a5d0cd22fb096f9529e6aa98
resolve flake8 linting errors
watson/validators/__init__.py
watson/validators/__init__.py
# -*- coding: utf-8 -*- __version__ = '1.0.6' try: # Fix for setup.py version import from watson.validators.numeric import Range from watson.validators.string import Length, Required, RegEx, Csrf __all__ = ['Range', 'Length', 'Required', 'RegEx', 'Csrf'] except: # pragma: no cover pass # pragma:...
Python
0.000001
@@ -276,16 +276,22 @@ cept: # + noqa, pragma:
5aa594d02bfcdfe5eefe90fad1e464070b6ae9b5
Update common.py
bin/common.py
bin/common.py
#!/usr/bin/python import os import multiprocessing as mp import subprocessing as sub import shlex def fixDirName(dirpath): if dirpath[-1] != '/': dirpath += '/' return dirpath def makeDir(dirpath): if not os.path.exists(dirpath): os.mkdir(dirpath) return 0 def importSampleList(infile): ...
Python
0.000001
@@ -1905,17 +1905,17 @@ p = sub. -p +P open(cmd
5e5de38dcdfd3e6884b70a917b14ae6329e2e458
Update vbbReq.py
vbbReq.py
vbbReq.py
#! /usr/bin/python # _*_ coding: latin-1 _*_ #TODO brauch ich das??? import requests import xml.dom.minidom as dom import codecs import os # It's possible that a train won't stop at the station, therefor vbb uses the # 'getIn' Attribute at the <Dep> Element. This attribute is ignored in this # version. So the train m...
Python
0
@@ -6536,15 +6536,16 @@ st this%0A +# test()%0A
eda6ccfdce2166c6ba5442b95a80d6723533c59b
Add comma
app/main/forms/direct_award_forms.py
app/main/forms/direct_award_forms.py
from flask_wtf import FlaskForm from wtforms.validators import DataRequired, Length, NumberRange, InputRequired, ValidationError from dmutils.forms.fields import ( DMBooleanField, DMDateField, DMPoundsField, DMStripWhitespaceStringField, DMRadioField, ) from dmutils.forms.validators import Greater...
Python
0.999968
@@ -2844,16 +2844,17 @@ nd pence +, using n
ec42cc0941687c43926e31701578eeee9144d6d7
Move CFP to main menu
gopher/protocol.py
gopher/protocol.py
import re from blog.models import Post from config.utils import get_active_event from django.contrib.sites.models import Site from django.template.loader import render_to_string from django.utils.html import strip_tags from django.utils.text import wrap from gopher.ascii_art import header from pages.models import Page...
Python
0
@@ -1337,44 +1337,25 @@ def -list_pages(self):%0A pages = %5B%5D +pages_menu(self): %0A @@ -1410,68 +1410,27 @@ rue) -:%0A pages.append((page.title, f%22page:%7Bpage.pk%7D%22))%0A +.order_by('title'): %0A @@ -1438,227 +1438,56 @@ -cfp = + self. -get_cfp()%0A if cfp:%0A ...
534d66ff92e6fd00ea92a08c76f39614b9977967
make it compatible to python3
uuhash.py
uuhash.py
#!/usr/bin/env python import os import hashlib import binascii import struct __all__ = ["UUHash"] # https://en.wikipedia.org/wiki/UUHash # MLDonkey source code, file src/utils/lib/fst_hash.c, retrieved 2014-08-20 # http://sourceforge.net/projects/mldonkey/files/mldonkey/3.1.5/mldonkey-3.1.5.tar.bz2 # http://www.op...
Python
0.000283
@@ -14,16 +14,17 @@ v python +3 %0A%0Aimport @@ -1427,20 +1427,20 @@ UUHash( -file +open (fname, @@ -1511,52 +1511,53 @@ rint - %22%25-28s%22 %25 encoded, hash.encode('hex').upper +(%22%7B%7D %7B%7D %7B%7D%22.format(encoded.decode(), hash.hex (), @@ -1561,9 +1561,11 @@ ), fname +)) %0A
088d729d0f8713227a7dd68e6e8a317b0e6e80fe
Version bump to 0.1.3
graphs/_version.py
graphs/_version.py
__version__ = '0.1.2'
Python
0
@@ -16,7 +16,7 @@ 0.1. -2 +3 '%0A
ae179cf964939a97184402039574d7ee9b2e62da
Add BlogPost update test
blog/tests.py
blog/tests.py
from django.test import TestCase from .models import BlogPost from django.contrib.auth.models import User class BlogTest(TestCase): def setUp(self): self.user = User.objects.create_user(username = "user001", email = "email@domain.com", password = "password123456") def test_post_creation(self): ...
Python
0
@@ -560,8 +560,560 @@ ectly%22)%0A +%0A def test_post_update(self):%0A blogpost = BlogPost()%0A blogpost.user = self.user%0A blogpost.title = %22Title Test%22%0A blogpost.text = %22Lorem ipsum tarapia tapioco...%22%0A blogpost.save()%0A self.assertTrue(blogpost.id %3E 0, %2...
c2600e3b831c5c55c7e2d23a98b73a4c07ea694c
add cleaning comment
custom/enikshay/nikshay_datamigration/models.py
custom/enikshay/nikshay_datamigration/models.py
from django.db import models class PatientDetail(models.Model): PregId = models.CharField(max_length=255, primary_key=True) # need to remove trailing whitespace in Excel Stocode = models.CharField(max_length=255, null=True) Dtocode = models.CharField(max_length=255, null=True) Tbunitcode = models.Inte...
Python
0
@@ -4269,24 +4269,65 @@ , null=True) + # requires trimming whitespace in excel %0A Interva
59851b283b8cb6f92895090ba23e71be48f1a990
remove distinction between sfa aggregate and geni_aggregate
sfa/methods/GetVersion.py
sfa/methods/GetVersion.py
from sfa.util.faults import * from sfa.util.namespace import * from sfa.util.method import Method from sfa.util.parameter import Parameter class GetVersion(Method): """ Returns this GENI Aggregate Manager's Version Information @return version """ interfaces = ['geni_am','registry'] accepts = [...
Python
0.999021
@@ -281,26 +281,53 @@ = %5B' -geni_am','registry +registry','aggregate', 'slicemgr', 'component '%5D%0A @@ -513,17 +513,16 @@ .name))%0A -%0A @@ -532,288 +532,39 @@ ager -_base = 'sfa.managers'%0A%0A if self.api.interface in %5B'geni_am'%5D:%0A mgr_type = self.api.config.SFA_GENI_AGGREG...
e99dbdcec1dd80cb2243d65ebf958620a7671ceb
Change the importer call back treatment
share/plugins/delivery.py
share/plugins/delivery.py
""" Builds the check list with the waiting status """ from baseplugin import BasePlugin from basejob import BaseJob, BaseJobRuntimeError from importer import Importer import psycopg2 PLUGIN_NAME = "delivery" class DeliveryRuntimeError(BaseJobRuntimeError): """ BaseJob Exceptions. """ def __init__(self, erro...
Python
0
@@ -1801,74 +1801,63 @@ if -isinstance (entry%5B%22success%22%5D, Exception) or not (entry%5B%22success%22%5D) +entry%5B%22status%22%5D == %22KO%22 or entry%5B%22status%22%5D == %22Warning%22 :%0A
1a36b71299f95213f23ee62bed8295ec61a65b18
Comment update to reflect name change of component location params.
sifra/modelling/hazard.py
sifra/modelling/hazard.py
import numpy as np import os import csv from collections import OrderedDict class Hazard(object): def __init__(self, hazard_scenario_name, scenario_hazard_data, hazard_input_method): self.hazard_scenario_name = hazard_scenario_name self.scenario_hazard_data = scenario_hazard_data ...
Python
0
@@ -1003,9 +1003,9 @@ lid -V +v alue @@ -1014,29 +1014,27 @@ for -Longitude or Latitude +component location. %22)%0A%0A @@ -1970,16 +1970,30 @@ _param = + %5C%0A configu @@ -2067,16 +2067,30 @@ e_unit = + %5C%0A configu
1fde3398d5fe132d628acce03392d459e718e2ad
Fix 400 error response for proxied resources
slyd/slyd/splash/proxy.py
slyd/slyd/splash/proxy.py
from __future__ import absolute_import import functools import requests from twisted.internet.threads import deferToThread from twisted.internet.defer import CancelledError from twisted.web.resource import Resource from twisted.web.server import NOT_DONE_YET from PyQt4.QtNetwork import QNetworkRequest from .ferry im...
Python
0
@@ -912,36 +912,130 @@ -user = User.findById(tabid)%0A +return self._load_resource(request, url, referer, tabid)%0A%0A def _load_resource(self, request, url, referer, tabid=None): %0A @@ -1103,16 +1103,26 @@ splash, +%0A # because @@ -1131,26 +1131,16 @@ t does't -%0A # return @@ -118...
7dd344129e2ae30a857f72fdf61dca6e40768983
fix city field duplication (#17919)
addons/base_address_city/models/res_partner.py
addons/base_address_city/models/res_partner.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from lxml import etree from odoo import api, models, fields class Partner(models.Model): _inherit = 'res.partner' country_enforce_cities = fields.Boolean(related='country_id.enforce_cities') city_id = fiel...
Python
0.000004
@@ -667,24 +667,103 @@ dress(arch)%0A + if not self._context.get('no_address_format'):%0A return arch%0A # re
e9d6dcf16f1696cfb3d934c0196ace38af5fae4c
get_invoice_line_account in valuation = 'periodic'
addons/stock_account/models/account_invoice.py
addons/stock_account/models/account_invoice.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, models import logging _logger = logging.getLogger(__name__) class AccountInvoice(models.Model): _inherit = "account.invoice" @api.model def invoice_line_move_line_get(self): ...
Python
0.999997
@@ -4529,16 +4529,77 @@ if +product.categ_id.property_valuation != 'manual_periodic' and accounts
7a105fe9201882749a7415bff580b9588b7f9a46
update version number
account_invoice_line_description/__openerp__.py
account_invoice_line_description/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 Agile Business Group sagl # (<http://www.agilebg.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public ...
Python
0.000088
@@ -1022,17 +1022,17 @@ 8.0.1.0. -0 +1 ',%0A '
2a53e8e94f2a81e7b5d01b25004d6a94e1041f33
fix test
account_reversal/tests/test_account_reversal.py
account_reversal/tests/test_account_reversal.py
# -*- encoding: utf-8 -*- # ############################################################################# # # Account partner required module for OpenERP # Copyright (C) 2014 Acsone (http://acsone.eu). # @author Stéphane Bidoul <stephane.bidoul@acsone.eu> # # This program is free software: you can redistribute...
Python
0.000036
@@ -3841,16 +3841,20 @@ sed_move +_ids = move. @@ -3881,16 +3881,92 @@ terday)%0A + reversed_moves = self.env%5B'account.move'%5D.browse(reversed_move_ids)%0A @@ -4148,24 +4148,25 @@ eversed_move +s .line_id%5D)%0A
b20d07aa14d3c11d5509e96fd4911de5886afe28
fix order for AttributeViewSet
apps/domain/views.py
apps/domain/views.py
from django.shortcuts import render from django.contrib.auth.decorators import login_required from rest_framework import viewsets, mixins, filters from rest_framework.permissions import DjangoModelPermissions, IsAuthenticated from .models import * from .serializers import * @login_required() def domain(request): ...
Python
0.000001
@@ -753,32 +753,53 @@ bjects.order_by( +'attributeset__tag', 'tag')%0A seria
34035c4b272e9271834c531990c404940eee8633
Add a link between vote and subproposal
apps/votes/models.py
apps/votes/models.py
from django.db import models from meps.models import MEP class Proposal(models.Model): id = models.CharField(max_length=63, primary_key=True) title = models.CharField(max_length=255, unique=True) class SubProposal(models.Model): datetime = models.DateTimeField() subject = models.CharField(max_length=2...
Python
0
@@ -815,16 +815,66 @@ th=127)%0A + sub_proposal = models.ForeignKey(SubProposal)%0A mep
757c0c9bc14118bd0b95548270a6a3d6a2e54e75
return len of step pile contents
conjure/ui/widgets/step.py
conjure/ui/widgets/step.py
from ubuntui.utils import Padding, Color from ubuntui.widgets.hr import HR from ubuntui.widgets.buttons import submit_btn from urwid import (WidgetWrap, Pile, Columns, Text) class StepWidget(WidgetWrap): def __init__(self, app, step_model, step_model_widget, cb): """ Arguments: step_model:...
Python
0.000001
@@ -1915,75 +1915,8 @@ urn -self.step_pile.contents.index(%0A self.step_pile.contents%5B len( @@ -1941,18 +1941,16 @@ tents)-2 -%5D) %0A%0A @p
a21dc1a4bcf89fe34bffcd3b297eb8c3848b53cf
random.choice is fast enough, simplify away numpy
streamkov/markov.py
streamkov/markov.py
# -*- coding: utf-8 -*- """ markov ~~~~~~ Class for streamable markov chain """ from collections import Counter, defaultdict import numpy as np def has_sentence_boundary(bigram): return bigram[0].endswith('.') class MarkovGenerator(object): def __init__(self): self.word_list = [] ...
Python
0.999999
@@ -113,17 +113,8 @@ port - Counter, def @@ -133,91 +133,14 @@ ort -numpy as np%0A%0A%0Adef has_sentence_boundary(bigram):%0A return bigram%5B0%5D.endswith('.') +random %0A%0A%0Ac @@ -386,32 +386,36 @@ %5B%5D%0A word +_idx = self.initial_ @@ -419,32 +419,72 @@ al_state.draw()%0A + word = sel...
a2082e319854f88842e3acf8244d38a81f7046ae
Add secure/insecure reverse helpers.
subdomains/utils.py
subdomains/utils.py
from urlparse import urlunparse from django.conf import settings from django.contrib.sites.models import Site from django.core.urlresolvers import reverse as simple_reverse def urljoin(domain, path=None, scheme=None): if path is None: path = '' if scheme is None: scheme = getattr(settings, '...
Python
0.000001
@@ -1,12 +1,29 @@ +import functools%0A from urlpars @@ -1109,8 +1109,188 @@ scheme)%0A +%0A%0Ainsecure_reverse = functools.partial(reverse, scheme='http')%0Asecure_reverse = functools.partial(reverse, scheme='https')%0Arelative_reverse = functools.partial(reverse, scheme='')%0A
8315fb3fb1b7ef65b9c1ced4feaeb473863495f5
Remove current_site_domain
subdomains/utils.py
subdomains/utils.py
import functools try: from urlparse import urlunparse except ImportError: from urllib.parse import urlunparse from django.conf import settings from django.core.urlresolvers import reverse as simple_reverse def current_site_domain(): domain = getattr(settings, 'BASE_DOMAIN', False) prefix = 'www.' ...
Python
0.000157
@@ -214,28 +214,19 @@ e%0A%0A%0Adef -current_site +get _domain( @@ -476,42 +476,8 @@ in%0A%0A -get_domain = current_site_domain%0A%0A %0Adef @@ -1087,16 +1087,28 @@ me=None, +%0A args=No @@ -1831,32 +1831,41 @@ simple_reverse( +%0A viewname, urlcon @@ -1857,16 +1857,24 @@ iewname, +%0A ...
496481e3bd6392a44788fadc7cf517fc36143e96
Change to cb_story, clean up TZ handling some more
contrib/plugins/w3cdate.py
contrib/plugins/w3cdate.py
""" Add a 'w3cdate' key to every entry -- this contains the date in ISO8601 format WARNING: you must have PyXML installed as part of your python installation in order for this plugin to work Place this plugin early in your load_plugins list, so that the w3cdate will be available to subsequent plugins """ __author__ ...
Python
0
@@ -472,16 +472,44 @@ ort time +%0Afrom Pyblosxom import tools %0A%0Adef cb @@ -513,15 +513,13 @@ cb_ -prepare +story (arg @@ -540,100 +540,39 @@ t = -args%5B%22request%22%5D%0A form = request.getHttp()%5B'form'%5D%0A config = request.getConfiguration() +tools.get_registry()%5B%22request%22%5D %0A @@ -...
f40a8e5b475ba2f82836166f70ae75aab0c269c8
Change permissions on tagging
core/web/api/observable.py
core/web/api/observable.py
from __future__ import unicode_literals from flask_classy import route from flask import request from core.web.api.crud import CrudApi, CrudSearchApi from core import observables from core.web.api.api import render from core.web.helpers import get_object_or_404 from core.helpers import refang from core.web.helpers im...
Python
0
@@ -90,16 +90,60 @@ request +, abort%0Afrom flask_login import current_user %0A%0Afrom c @@ -3806,24 +3806,153 @@ .get(id=id)%0A + j = request.json%0A if not current_user.has_permission('observable', 'tag') and 'tags' in j:%0A abort(401)%0A retu
e5e83b75e250ee3c6d8084e23ee777d519293cb6
Fix for keystone / swift 1.8.0
swprobe/__init__.py
swprobe/__init__.py
# Copyright (c) 2012 Spil Games # # 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
@@ -599,17 +599,17 @@ (0 , 3, -0 +1 )%0Aversio
7e9072e97acdc2c5c873f3abf850dccbfd8d6bac
Add a method to shutdown global event loop
tartpy/eventloop.py
tartpy/eventloop.py
""" Very basic implementation of an event loop ========================================== Exports ------- - ``ThreadedEventLoop``: global event loop running in a thread - ``ManualEventLoop``: global event loop to be run synchronously - ``individual_loop_step``: process one event - ``individual_loop``: process eve...
Python
0.000002
@@ -377,16 +377,28 @@ reading%0A +import time%0A import t @@ -406,16 +406,16 @@ aceback%0A - %0A%0Adef _f @@ -1573,32 +1573,84 @@ et(block=block)%0A + if actor is None:%0A raise StopIteration()%0A try:%0A @@ -1811,36 +1811,121 @@ ts indefinitely. -%22%22%22%0A +%0A%0A To stop the loop put...
8872f069b8aebc6c12fc95070181917136a08ac0
Add device name validation
tcconfig/_common.py
tcconfig/_common.py
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import absolute_import from __future__ import unicode_literals import contextlib import errno import sys import logbook import six import typepy import subprocrunner as spr from ._const import ( KILO_SIZE...
Python
0.000001
@@ -3593,16 +3593,126 @@ mand))%0A%0A + if typepy.is_null_string(device):%0A raise ValueError(%22device must be a string: %7B%7D%22.format(device))%0A%0A runn
53d37567d592ba47d1918e943a63271be02cfe9c
Refactor patching of query
test/spambl_test.py
test/spambl_test.py
#!/usr/bin/python # -*- coding: utf-8 -*- import unittest from spambl import DNSBL, UnknownCodeError, NXDOMAIN, HpHosts, DNSBLService from mock import Mock, patch from ipaddress import ip_address as IP from itertools import cycle from __builtin__ import classmethod hostnames = 't1.pl', 't2.com', 't3.com.pl' ips = IP...
Python
0.000001
@@ -5232,32 +5232,132 @@ True)%0A %0A + cls.patcher = patch('spambl.query')%0A cls.mocked_query = cls.patcher.start()%0A %0A def testGetC @@ -5727,35 +5727,8 @@ %0A - @patch('spambl.query')%0A @@ -5749,22 +5749,8 @@ self -, mocked_query ):%0A @@ -6418,32 +6418,37 @@ ...
9f8b3afec4f3002eaca53437ca0e4915d6da01a6
Fix DNSBLServiceTest
test/spambl_test.py
test/spambl_test.py
#!/usr/bin/python # -*- coding: utf-8 -*- import unittest from spambl import DNSBL, UnknownCodeError, NXDOMAIN, HpHosts, DNSBLService from mock import Mock, patch from ipaddress import ip_address as IP from itertools import cycle from __builtin__ import classmethod hostnames = 't1.pl', 't2.com', 't3.com.pl' ips = IP...
Python
0
@@ -5155,24 +5155,31 @@ vice = DNSBL +Service ('test_servi
dde25723c845ad4f6df72729e76174210b16e71c
remove redundant code
test/test_client.py
test/test_client.py
import pytest from pyrelatics.client import * def test_relaticsapi_raise_exception_with_dummy_url(): with pytest.raises(URLError): relaticsapi = RelaticsAPI('dummy_company', 'dummy_env_id', 'dummy_wid') def test_relaticsapi_initializes_properties(): relaticsapi = RelaticsAPI('kb', 'dummy_env_id', '...
Python
0.999999
@@ -138,30 +138,16 @@ %0A - relaticsapi = Relatic
9fa55bc43a3f83a57318799ba8b9f2769676bd44
Include the tags module tests in the full library testsuite.
test/test_flvlib.py
test/test_flvlib.py
import unittest import test_primitives, test_astypes, test_helpers def get_suite(): modules = (test_primitives, test_astypes, test_helpers) suites = [unittest.TestLoader().loadTestsFromModule(module) for module in modules] return unittest.TestSuite(suites) def main(): unittest.TextTestRu...
Python
0
@@ -59,16 +59,27 @@ _helpers +, test_tags %0A%0Adef ge @@ -147,16 +147,27 @@ _helpers +, test_tags )%0A su
1598a865094591cbfd1e4e37eddb905fffd1d9b0
improve and extend unit tests for Logfile
test/test_parser.py
test/test_parser.py
# This file is part of cclib (http://cclib.github.io), a library for parsing # and interpreting the results of computational chemistry packages. # # Copyright (C) 2015, the cclib development team # # The library is free software, distributed under the terms of # the GNU Lesser General Public version 2.1 or later. You s...
Python
0
@@ -760,79 +760,256 @@ -self.assertTrue(self.logfile.float(%221.0%22), 1.0)%0A self.assertTrue +%22%22%22Are floats converted from strings correctly?%22%22%22%0A self.assertEqual(self.logfile.float(%220.0%22), 0.0)%0A self.assertEqual(self.logfile.float(%221.0%22), 1.0)%0A self.assertE...
5fa101cfa8f311079742552f451e1194d975bb62
test ttlser drop the versioninfo from the last line to make comparison to good.ttl simpler
test/test_ttlser.py
test/test_ttlser.py
import inspect import os import random import rdflib import re import subprocess import sys import unittest rdflib.plugin.register('nifttl', rdflib.serializer.Serializer, 'pyontutils.ttlser', 'CustomTurtleSerializer') class TestTtlser(unittest.TestCase): def setUp(self): goodpath = 'test/good.ttl' ...
Python
0
@@ -1264,16 +1264,79 @@ ifttl')%0A + actual = actual.rsplit(b'%5Cn',2)%5B0%5D # drop versioninfo%0A
2250fcaefc1b69116684c72c559a44ee1d6721b6
change component count back to 4 in dp 2-cluster test
test_dp_2cluster.py
test_dp_2cluster.py
from dpconverge.data_set import DataSet from sklearn.datasets.samples_generator import make_blobs n_features = 2 points_per_feature = 100 centers = [[2, 2], [4, 4]] ds = DataSet(parameter_count=2) for i, center in enumerate(centers): X, y = make_blobs( n_samples=points_per_feature, n_features=n_...
Python
0.000001
@@ -513,17 +513,17 @@ t_count= -2 +4 ,%0A bu
3ded2f462c859542b871c1311ce3b801f41370e7
use get_model from apps
adhocracy4/api/mixins.py
adhocracy4/api/mixins.py
from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.db.models.loading import get_model from django.http import Http404 from django.shortcuts import get_object_or_404 from adhocracy4.modules import models as module_models class ContentTypeMixin: """ Should b...
Python
0.000001
@@ -1,20 +1,49 @@ +from django.apps import apps%0A from django.conf imp @@ -118,54 +118,8 @@ ype%0A -from django.db.models.loading import get_model %0Afro @@ -2288,16 +2288,21 @@ +apps. get_mode
97f07316471f28d9f56987837accae01f121c180
raise Exception if vBNG service fails to return a routeable_subnet
xos/observers/vbng/steps/sync_vbngtenant.py
xos/observers/vbng/steps/sync_vbngtenant.py
import os import requests import socket import sys import base64 from django.db.models import F, Q from xos.config import Config from observer.syncstep import SyncStep from observer.ansible import run_template_ssh from core.models import Service from cord.models import VCPEService, VCPETenant, VBNGTenant, VBNGService f...
Python
0.000001
@@ -1722,17 +1722,20 @@ rvice = -o +self .get_vbn @@ -1744,16 +1744,17 @@ service( +o )%0A @@ -3536,16 +3536,151 @@ te_ip))%0A +%0A if r.text == %220%22:%0A raise Exception(%22VBNG service failed to return a routeable_subnet (probably ran out)%22)%0A%0A
59b9e41ebe70df35902a7d328ad879bd988aa7c0
remove getServerList -- it belongs to VLDbDAO
afs/dao/FileServerDAO.py
afs/dao/FileServerDAO.py
import re,string,os,sys import afs.dao.bin from afs.model.FileServer import FileServer from afs.model.Partition import Partition from afs.util import afsutil class FileServerDAO() : """ Provides Information about a FileServer """ def __init__(self) : pass ...
Python
0.000002
@@ -153,17 +153,16 @@ fsutil%0A%0A -%0A class Fi @@ -201,36 +201,30 @@ -Provides Information about a +low level access to a Fil @@ -302,782 +302,8 @@ %0A - def getServer(self,servername,cellname):%0A %22%22%22%0A List of Servers%0A %22%22%22%0A %0A ...
22800afbb6186c45dc806c933fcb502108a92251
Update airbrake client for Django 2.0
airbrake/utils/client.py
airbrake/utils/client.py
from django.conf import settings from django.core.urlresolvers import resolve import sys from six.moves import urllib import traceback from lxml import etree class Client(object): API_URL = '%s://airbrake.io/notifier_api/v2/notices' ERRORS = { 403: "Cannot use SSL", 422: "Invalid XML sent to A...
Python
0
@@ -30,53 +30,8 @@ ngs%0A -from django.core.urlresolvers import resolve%0A impo @@ -83,16 +83,16 @@ aceback%0A - from lxm @@ -106,16 +106,153 @@ t etree%0A +try:%0A%C2%A0%C2%A0%C2%A0 # Django 2.0%0A%C2%A0%C2%A0%C2%A0 from django.urls.base import resolve%0Aexcept:%0A%C2%A0%C2%A0%C2%A0 # Django 1.0%0A%C2%A0%C2%A0%C2...
2ee45754c73a344d2cdbc0007a5a7877ba45288e
improve output, calculate frequencies at non-singletons
scripts/calculate_methylation_frequency.py
scripts/calculate_methylation_frequency.py
#! /usr/bin/env python import math import sys import csv import argparse from collections import namedtuple class SiteStats: def __init__(self): self.num_reads = 0 self.posterior_methylated = 0 self.called_sites = 0 self.called_sites_methylated = 0 parser = argparse.ArgumentParser...
Python
0.999204
@@ -141,16 +141,31 @@ t__(self +, g_size, g_seq ):%0A @@ -294,16 +294,79 @@ ated = 0 +%0A self.group_size = g_size%0A self.sequence = g_seq %0A%0Aparser @@ -543,17 +543,19 @@ default= -0 +2.5 )%0Aparser @@ -890,81 +890,8 @@ %5D) %0A - # skip non-singletons for now%0A if num_sites %3E 1:%...
6fe0ec420008bca5c5a04f51f0c1896b65d73ead
remove crpdate model traces
tnp/consent/views.py
tnp/consent/views.py
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from company.models import Company, Job, JobLocation, CRPDate...
Python
0
@@ -309,17 +309,8 @@ ion, - CRPDate, Att @@ -2477,395 +2477,8 @@ %0A - crp = job.crpdate%0A %0A if (crp.datatype == 'DAT'):%0A crpdate_str = str(crp.date)%0A elif (crp.datatype == 'MON'):%0A crpdate_str = month_list%5Bcrp.month%5D%0A elif (crp.datatype == ...
6a0c3d0dc5f0106fdc1f7682fa65eabfb5c9d250
Set version as 0.6.12
alignak_webui/version.py
alignak_webui/version.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015-2017: # Frederic Mohier, frederic.mohier@alignak.net # """ Alignak - Web User Interface """ # Package name __pkg_name__ = u"alignak_webui" # Checks types for PyPI keywords # Used for: # - PyPI keywords # - directory where to store files in the ...
Python
0.000247
@@ -471,17 +471,17 @@ (0, 6, 1 -1 +2 )%0A__vers
2ce3d1677ccc40a33ae49c80d1f131ffa1320a25
Set static root
almostfunded/settings.py
almostfunded/settings.py
""" Django settings for untitled1 project. Generated by 'django-admin startproject' using Django 1.8.3. For more information on this file, see https://docs.djangoproject.com/en/1.8/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.8/ref/settings/ """ # Build pa...
Python
0.000001
@@ -3395,16 +3395,66 @@ tatic/'%0A +STATIC_ROOT = os.path.join(PROJECT_ROOT, 'static') %0A# Celer
74744534c332186fa8165c90e91d71b7f77f2ad6
fix iobs calculation
vivado.py
vivado.py
import os import subprocess import time import collections import json import re import shutil import sys import glob import datetime import asciitable import edalize from toolchain import Toolchain from utils import Timed class Vivado(Toolchain): '''Vivado toolchain (synth and PnR)''' carries = (False, Fals...
Python
0
@@ -5273,24 +5273,105 @@ 2%5D == 'IO':%0A + if prim%5B0%5D.startswith('OBUF') or prim%5B0%5D.startswith('IBUF'):%0A
b4013acd97851b041a47afa87e0da137e556ca3f
sort the output
tools/gen_gallery.py
tools/gen_gallery.py
#!/usr/bin/python import os,sys,re # this sucks patches = [ x for x in os.listdir('.') if re.match(r'.*\.gif$', x) ] print '''<style type="text/css"> div { float: left; width: 20%; } </style> ''' print ''.join(['<div><img src="%s" /><br />%s</div>' % (x,x) for x in patches])
Python
1
@@ -111,16 +111,31 @@ $', x) %5D +%0Apatches.sort() %0A%0Aprint
5c89a1dd3917a2d54a79dc702e4c53f63e6bd0f2
Add option to check compute count
webapp/apps/test_assets/utils.py
webapp/apps/test_assets/utils.py
import json import os import sys from ..taxbrain.compute import MockCompute from django.core.files.uploadedfile import SimpleUploadedFile NUM_BUDGET_YEARS = int(os.environ.get("NUM_BUDGET_YEARS", "10")) def get_dropq_compute_from_module(module_import_path, num_times_to_wait=None): module_views = sys.modules[modu...
Python
0.000001
@@ -536,24 +536,61 @@ compute=None +,%0A compute_count=None ):%0A '''do @@ -1053,77 +1053,8 @@ ) -%0A # dynamic_views.dropq_compute = MockCompute(num_times_to_wait=1) %0A%0A @@ -1261,16 +1261,171 @@ brain%22)%0A + print('compute_count', tb_dropq_compute.count, compute_count)%0A if ...
35f8ac20ec5ef830f264ba51bcb5df5af72b24d6
mask out HC3N features
analysis/masked_cubes.py
analysis/masked_cubes.py
import numpy as np from spectral_cube import SpectralCube,BooleanArrayMask from astropy import units as u from paths import hpath from astropy.io import fits import time from astropy import log t0 = time.time() cube303 = SpectralCube.read(hpath('APEX_H2CO_303_202_bl.fits')).with_spectral_unit(u.km/u.s, velocity_conve...
Python
0
@@ -206,16 +206,567 @@ time()%0A%0A +hc3n_regions = %5B%7B'v':(-101,55),%0A 'x':(500,533),%0A 'y':(108,133),%7D,%0A %7B'v':(-133,-70),%0A 'x':(787,884),%0A 'y':(87,120),%7D%5D%0A%0Adef mask_out_region(mask_array, cube, regions=hc3n_regions)...
c73033031e6167c13af6014d49a733ac713aabd2
Remove comment I had pasted all the names into
services/migrations/0021_populate_areas.py
services/migrations/0021_populate_areas.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, connection from django.db.models import Max MOUNT_LEBANON = 'Mount Lebanon' TRIPOLI = 'Tripoli and surroundings' INITIAL_AREAS = [ # Numbers are arbitrary, just so we can know which ones we created and remove # ...
Python
0
@@ -2579,258 +2579,4 @@ %5D%0A -%0A%0A%22%22%22%0A%0ANumber%0AMount Lebanon%0ATripoli and surroundings%0A1%0ABaabda %D8%A8%D8%B9%D8%A8%D8%AF%D8%A7%0AMineih-Dinniyi%D8%A7%D9%84%D9%85%D9%86%D9%8A%D9%87-%D8%A7%D9%84%D8%B6%D9%86%D9%8A%D8%A9%0A2%0ABeirut%D8%A8%D9%8A%D8%B1%D9%88%D8%AA%0AZgharta%D8%B2%D8%BA%D8%B1%D8%AA%D8%...
79f8f6c922e6f0be3f6bf62c13cbe6dc9c50366a
Remove project_config dependency
budget_proj/budget_proj/settings/production.py
budget_proj/budget_proj/settings/production.py
import requests from .base import * from .. import project_config SECRET_KEY = project_config.DJANGO_SECRET_KEY ALLOWED_HOSTS = project_config.ALLOWED_HOSTS # Get the IPV4 address we're working with on AWS # The Loadbalancer uses this ip address for healthchecks EC2_PRIVATE_IP = None try: EC2_PRIVATE_IP = requ...
Python
0.000001
@@ -30,16 +30,28 @@ mport *%0A +import os%0A# from .. @@ -87,31 +87,32 @@ T_KEY = -project_config. +os.environ.get(' DJANGO_S @@ -120,18 +120,22 @@ CRET_KEY -%0A%0A +')%0A%0A# ALLOWED_ @@ -170,16 +170,38 @@ ED_HOSTS +%0AALLOWED_HOSTS = %5B'*'%5D %0A%0A# Get @@ -300,16 +300,18 @@ hchecks%0A +# EC2_PRIV @...
3fb2986bc4f344e7c0ec751c38d257ce99681ebe
add tests for -L/--list-engines option
anytemplate/tests/cli.py
anytemplate/tests/cli.py
# # Copyright (C) 2015 Satoru SATOH <ssato at redhat.com> # License: MIT # """Tests of anytempalte.cli """ import os.path import os import subprocess import unittest import anytemplate.cli as TT import anytemplate.tests.common from anytemplate.engine import find_by_name CLI_SCRIPT = os.path.join(anytemplate.tests.c...
Python
0.000001
@@ -1937,16 +1937,165 @@ pass%0A%0A + def test_26_main__list_engines(self):%0A try:%0A TT.main(%5B%22dummy%22, %22--list-engines%22%5D)%0A except SystemExit:%0A pass%0A%0A %0Aclass T
02360f5251ac308f45cb210a305fa225a056e1be
add travis config for keen public read key
website/settings/local-travis.py
website/settings/local-travis.py
# -*- coding: utf-8 -*- '''Example settings/local.py file. These settings override what's in website/settings/defaults.py NOTE: local.py will not be added to source control. ''' import inspect from . import defaults import os DB_PORT = 27017 DEV_MODE = True DEBUG_MODE = True # Sets app to debug mode, turns off tem...
Python
0
@@ -1604,24 +1604,112 @@ 242526272',%0A + 'read_key': '123456789abcdef101112131415161718191a1b1c1d1e1f20212223242526272',%0A %7D,%0A '
84234fd72c70eac5228d835de79a12cf4515204e
Add material to be an attribute for all styles
simlammps/common/atom_style_description.py
simlammps/common/atom_style_description.py
import itertools from simphony.core.cuba import CUBA from simlammps.common.atom_style import AtomStyle class AtomStyleDescription(object): """ Class describes atom style Each atom style has a particular set of attributes that it supports (or provides). This class contains a list of what attributes it...
Python
0
@@ -2764,16 +2764,122 @@ lse)%0A%7D%0A%0A +# all particles will have a material type%0A_default_attributes = %5BValueInfo(cuba_key=CUBA.MATERIAL_TYPE)%5D%0A%0A %0Adef get @@ -3216,11 +3216,48 @@ tributes +,%0A _default_attributes )%5D%0A
47c2936e65d00a08896b4e60060ff737b7a2f675
Check that the permission migrations work
app/tests/workstations_tests/test_migrations.py
app/tests/workstations_tests/test_migrations.py
import pytest from django.db import connection from django.db.migrations.executor import MigrationExecutor @pytest.mark.django_db(transaction=True) def test_workstation_group_migration(): executor = MigrationExecutor(connection) app = "workstations" migrate_from = [(app, "0001_initial")] migrate_to = ...
Python
0
@@ -100,16 +100,157 @@ xecutor%0A +from guardian.shortcuts import get_perms%0A%0Afrom grandchallenge.workstations.models import Workstation%0Afrom tests.factories import UserFactory%0A %0A%0A@pytes @@ -586,32 +586,60 @@ from).apps%0A%0A +user = UserFactory()%0A Old Workstation = ol @@ -684,24 +684,27 @@ ...
f92b27c1ea241f381e41ef9b20bc6e75fc03c159
Add OCA as author
account_invoice_merge_payment/__openerp__.py
account_invoice_merge_payment/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # This file is part of account_invoice_merge_payment, # an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # account_invoice_merge_payment is free software: # you can redi...
Python
0
@@ -1245,16 +1245,49 @@ NE SA/NV +,Odoo Community Association (OCA) %22,%0A '
34205bc818742374a531fe2126fd91dd355cb2c2
Update storage.py
db_file_storage/storage.py
db_file_storage/storage.py
# python import base64 import sys # django from django import VERSION as DJ_VERSION from django.core.files.base import ContentFile from django.core.files.storage import Storage from django.core.urlresolvers import reverse from django.utils.crypto import get_random_string if sys.version_info.major == 2: # python2 ...
Python
0.000001
@@ -27,16 +27,26 @@ ort sys%0A +import os%0A # django @@ -1883,19 +1883,22 @@ .rsplit( -'/' +os.sep , 1)%5B-1%5D @@ -2540,11 +2540,14 @@ lit( -'/' +os.sep )%0A
ca27ff5efa987ce413d7e7f43c49fad189930aed
Fix missing migration dependency
entities/migrations/0045_auto_20160922_1330.py
entities/migrations/0045_auto_20160922_1330.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-09-22 11:30 from __future__ import unicode_literals from django.db import migrations def set_groupcontent_group(apps, schema_editor): Group1 = apps.get_model('entities.Group') Group2 = apps.get_model('groups.Group') GroupContent = apps.get_mode...
Python
0.000351
@@ -629,24 +629,71 @@ dencies = %5B%0A + ('groups', '0002_auto_20160922_1108'),%0A ('en
7de8c75cc5a90ecd87f1bb5ccf72c0ec79c9f531
With empty string
examples/parse_context_free_grammar_example.py
examples/parse_context_free_grammar_example.py
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import unicode_literals, division import codecs from nltk import parse_cfg from nltk import word_tokenize from nltk import RecursiveDescentParser def encode(string, char_type='utf8', errors=''): return codecs.encode(string, char_type, errors) cfg = encode...
Python
0.9999
@@ -331,16 +331,24 @@ NP VP NP + %7C NP VP %0ANP -%3E ' @@ -363,16 +363,20 @@ 'Marit' + %7C e %0AVP -%3E ' @@ -383,16 +383,20 @@ szereti' + %7C e %0A%22%22%22)%0A%0Ap
72ba3a0401ad08d4df2fdc03b326eab16af47832
Bump version to 0.4.2.dev1
django_backend/__init__.py
django_backend/__init__.py
from .backend.renderable import Renderable # noqa from .group import Group # noqa from .sitebackend import SiteBackend __version__ = '0.4.1' default_app_config = 'django_backend.apps.DjangoBackendConfig' site = SiteBackend(id='backend')
Python
0
@@ -135,16 +135,21 @@ = '0.4. +2.dev 1'%0A%0A%0Adef
de39d46fcbe51e29e008ebc24c3fbec347a75edd
Make BasicEmailTest work with any DEFAULT_FROM_EMAIL setting
django_send_email/tests.py
django_send_email/tests.py
from contextlib import contextmanager from django.test import TestCase from django.conf import settings from django.core.management import CommandError, call_command from django.core import mail class SettingDoesNotExist: pass @contextmanager def patch_settings(**kwargs): old_settings = [] for key, new...
Python
0.000001
@@ -1971,29 +1971,35 @@ l': -'webmaster@localhost' +settings.DEFAULT_FROM_EMAIL ,%0A
afdb387cd8f9f54ee666cf1f64416d877f4eba19
Add support for subtitles
youtube_dl/extractor/streamcz.py
youtube_dl/extractor/streamcz.py
# coding: utf-8 from __future__ import unicode_literals import hashlib import time from .common import InfoExtractor from ..utils import ( int_or_none, sanitized_Request, ) def _get_api_key(api_path): if api_path.endswith('?'): api_path = api_path[:-1] api_key = 'fb5f58a820353bd7095de526253...
Python
0
@@ -716,40 +716,40 @@ ': ' -6d3ca61a8d0633c9c542b92fcb936b0c +934bb6a6d220d99c010783c9719960d5 ',%0A @@ -1190,40 +1190,40 @@ ': ' -e54a254fb8b871968fd8403255f28589 +849a88c1e1ca47d41403c2ba5e59e261 ',%0A @@ -2929,16 +2929,214 @@ name'%5D%0A%0A + subtitles = %7B%7D%0A srt_url = data.get('subtitles_s...
6dd3b2f7844e670b8774aa0afd25b83f60753703
make sure django is setup before importing
dblistener.py
dblistener.py
import os import time import logging import django from rethinkdb.errors import RqlDriverError from leaderboardapp.models import Board, Player from leaderboardapp.views import publish_board os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'leaderboard.settings') django.setup() logger = logging.getLogger('dblistener') ...
Python
0
@@ -6,28 +6,112 @@ t os -%0Aimport time +, django%0Aos.environ.setdefault('DJANGO_SETTINGS_MODULE', 'leaderboard.settings')%0Adjango.setup()%0A %0Aimport logg @@ -110,23 +110,20 @@ ort -logging +time %0Aimport djan @@ -118,22 +118,23 @@ %0Aimport -dja +loggi ng -o %0Afrom re @@ -270,96 +270,8 @@ rd%0A%0A ...
b57e79fadf54bd0a34eaf81ec57059fe964e3be8
rewrite semalock
decorators.py
decorators.py
import os from functools import wraps from requests import Timeout, ConnectionError from socket import timeout as socket_timeout import logging from .models import ArbitraryAccessObject from shutil import get_terminal_size timeouts = (Timeout, socket_timeout, ConnectionError) __author__ = 'zz' def threading_lock(l...
Python
0.999991
@@ -3,17 +3,16 @@ port os%0A -%0A from fun @@ -604,17 +604,19 @@ error -= + = Arbitrar @@ -1383,18 +1383,30 @@ lock -_for_class +(s):%0A def decorator (fun @@ -1405,32 +1405,36 @@ ator(func):%0A + + @wraps(func)%0A @@ -1426,32 +1426,36 @@ wraps(func)%0A + + def wrapper(self @@ -1454,...
0eb08689906556951bacf82166d13cda7a8d720b
Update pylsy_test.py
tests/pylsy_test.py
tests/pylsy_test.py
# -*- coding: utf-8 -*- from __future__ import absolute_import __author__ = 'choleraehyq' import unittest from pylsy.pylsy import PylsyTable class PylsyTableTests(unittest.TestCase): def setUp(self): attributes=["name","age"] self.table = PylsyTable(attributes) def tearDown(self): sel...
Python
0
@@ -60,35 +60,8 @@ ort%0A -__author__ = 'choleraehyq'%0A impo
c4d784f1b478ca80697e9bbe843ebf84fe124f2b
update legacy scripted test to use new syntax
lib/rapidsms/tests/scripted.py
lib/rapidsms/tests/scripted.py
import warnings from django.test import TestCase from rapidsms.tests.harness import TestScript as TestScriptMixin class TestScript(TestScriptMixin, TestCase): def startRouter(self): warnings.warn("startRouter is deprecated and will be removed in a future " "release. Please, see th...
Python
0
@@ -14,41 +14,8 @@ gs%0A%0A -from django.test import TestCase%0A from @@ -113,18 +113,8 @@ ixin -, TestCase ):%0A%0A
5f8a3a5b02fdc7c1bbadc5a3c739bac2aee75176
Add extra check for invalid boxes in random_transform.
keras_retinanet/utils/image.py
keras_retinanet/utils/image.py
""" Copyright 2017-2018 Fizyr (https://fizyr.com) 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 w...
Python
0
@@ -2109,16 +2109,154 @@ ormat(b) +%0A assert(b%5B2%5D %3C image.shape%5B1%5D and b%5B3%5D %3C image.shape%5B0%5D), 'Annotation (%7B%7D) is outside of image shape (%7B%7D).'.format(b, image.shape) %0A%0A
11134b6c71ce8285797ad659e218873b4a061d8e
Fix tests on Python 3
tests/sync_tests.py
tests/sync_tests.py
# -*- coding: utf-8 -*- # Scheduling interface library # (C) 2016 VRT Systems # # vim: set ts=4 sts=4 et tw=78 sw=4 si: import pyat.sync import time import random from .util import a_task, a_failing_task, make_args, make_kwargs, \ FailedTaskException MIN_TIME = 1.0 MAX_TIME = 2.0 DELTA_TIME = MAX_TIME - MIN_...
Python
0.000991
@@ -2285,17 +2285,19 @@ xception -, + as e:%0A
e7dd2d6680bc01776a7a8fc0be1b8bd1985cdfe3
add docstrings. fix small bugs
lib/neuroimaging/core/image/image.py
lib/neuroimaging/core/image/image.py
""" The core Image class. """ import types import numpy as N from neuroimaging import flatten from neuroimaging.data_io import DataSource, splitzipext from neuroimaging.data_io.formats import getformats, Format from neuroimaging.core.image.base_image import ArrayImage class Image(object): """ The Image cla...
Python
0.000761
@@ -614,31 +614,16 @@ - clobber=False, **keywo @@ -704,25 +704,16 @@ %22%22%22%0A - %0A @@ -1042,33 +1042,16 @@ de=mode, - clobber=clobber, %0A @@ -1141,16 +1141,20 @@ + # pri @@ -3108,32 +3108,97 @@ def next(self):%0A + %22%22%22%0A Return the...
0c8e92d78983635778043095740cc508259101ba
Fix typos in tests
tests/test_async.py
tests/test_async.py
# -*- coding: utf-8 -*- from asyncio import Future, gather, new_event_loop, sleep from mock import Mock from twisted.internet.defer import ensureDeferred from pyee import EventEmitter class PyeeTestException(Exception): pass def test_asyncio_emit(): """Test that event_emitters can handle wrapping coroutines...
Python
0.034948
@@ -195,24 +195,20 @@ yeeTestE -xception +rror (Excepti @@ -1276,32 +1276,28 @@ se PyeeTestE -xception +rror ()%0A%0A @ee. @@ -2481,24 +2481,20 @@ yeeTestE -xception +rror ()%0A%0A
cf7b7e015dd8e428317cdfd8000bb49073a5758f
Update tih.py
tih.py
tih.py
__author__ = '@abhinavbom a.k.a Darkl0rd' #local imports from lib.parse import * from api.vt import * from api.urlvoid import * from lib.updatefeed import gather #stdlib imports import argparse banner = ''' Threat Intelligence Hunter framework Begins now ''' print banner def main(): print "Intel test" pars...
Python
0
@@ -1021,36 +1021,32 @@ r public key to -bin/ vt.py%22)%0A%0A par @@ -1442,33 +1442,33 @@ ype=str, nargs=' -? ++ ', help=%22Search @@ -1589,29 +1589,23 @@ pts -a txt file containing +comma separated lis @@ -1617,16 +1617,23 @@ domains +or IPs and sear
8067af0c58ad3815fb15b530708bcb96a1874f3c
Add unit test for removing an element from an Ordering
tests/test_basic.py
tests/test_basic.py
from unittest import TestCase from ordering import Ordering class TestOrderingBasic(TestCase): def test_empty_insert_start(self) -> None: ordering = Ordering[int]() ordering.insert_start(0) self.assertIn(0, ordering) self.assertNotIn(1, ordering) def test_empty_insert_end(se...
Python
0
@@ -459,32 +459,275 @@ n(1, ordering)%0A%0A + def test_remove(self) -%3E None:%0A ordering = Ordering%5Bint%5D()%0A%0A self.assertNotIn(0, ordering)%0A ordering.insert_start(0)%0A self.assertIn(0, ordering)%0A ordering.remove(0)%0A self.assertNotIn(0, ordering)%0A%0A d...
44429e709c9ac047d7a311dac44dde57d9d2d403
Add test case to ensure filtering is applied on `Calls.iter` method.
tests/test_calls.py
tests/test_calls.py
from datetime import date from mock import patch, Mock from nose.tools import assert_true from twilio.rest.resources import Calls, Call from tools import create_mock_json BASE_URI = "https://api.twilio.com/2010-04-01/Accounts/AC123" ACCOUNT_SID = "AC123" AUTH = (ACCOUNT_SID, "token") CALL_SID = "CA47e13748ed59a5733d2c...
Python
0
@@ -1300,32 +1300,427 @@ s, auth=AUTH)%0A%0A%0A +@patch(%22twilio.rest.resources.base.make_twilio_request%22)%0Adef test_paging_iter(mock):%0A resp = create_mock_json(%22tests/resources/calls_list.json%22)%0A mock.return_value = resp%0A%0A uri = %22%25s/Calls%22 %25 (BASE_URI)%0A list_resource.iter(started...
fc2bd8f2434f841f69b992614e2d34071eee71f7
Rename class name in test to make it clear what it is.
tests/test_cases.py
tests/test_cases.py
from mock import sentinel, MagicMock from unittest2 import TestCase import itertools from exam.decorators import fixture, before, after, around, patcher from exam.cases import Exam from describe import expect from dummy import get_thing, get_it class FakeTest(object): def __init__(self): self.cleanups...
Python
0
@@ -249,24 +249,30 @@ %0A%0Aclass -Fak +Simpl eTest +Case (object) @@ -656,16 +656,22 @@ am, -Fak +Simpl eTest +Case ):%0A%0A
95f2eaa662fc5650608447cb18f8b1df4be5f7c3
ImportError take 2
landlab/components/__init__.py
landlab/components/__init__.py
from .craters import CratersComponent from .chi_index import ChiFinder from .diffusion import LinearDiffuser from .fire_generator import FireGenerator from .flexure import Flexure from .flow_accum import AccumFlow from .flow_routing import FlowRouter, DepressionFinderAndRouter from .glacier_thin_ice_model import Glacie...
Python
0.999076
@@ -1355,26 +1355,8 @@ - PowerLawIncision, Veg
c6afad83c3269995bd5914e2835dc10dba33ad3e
Fix tests after class rename
tests/test_clone.py
tests/test_clone.py
import os from os.path import dirname, join, isfile from shutil import rmtree import unittest from cvsgit.command.init import init from cvsgit.command.clone import clone from cvsgit.command.pull import pull from cvsgit.command.verify import verify from cvsgit.git import Git from cvsgit.utils import Tempdir class Test...
Python
0.000001
@@ -158,17 +158,17 @@ import -c +C lone%0Afro @@ -235,17 +235,17 @@ import -v +V erify%0Afr @@ -555,33 +555,33 @@ lf.assertEquals( -c +C lone().eval('--q @@ -653,33 +653,33 @@ assertEquals(0, -v +V erify().eval())%0A @@ -921,17 +921,17 @@ tEquals( -c +C lone().e @@ -1372,33 +1372,33 @@ assertEquals(0, ...
c5c2d462731e79d9b7d8836e47bae10116c1ee81
test cancelled callback
tests/test_defer.py
tests/test_defer.py
import sys sys.path.insert(0, '..') import unittest import pyev loop = pyev.default_loop() from whizzer.defer import Deferred, CancelledError, AlreadyCalledError, TimeoutError def throw_always(result): raise Exception("success") def one_always(result): return 1 def add(a, b): return a+b class FakeLog...
Python
0.000001
@@ -3125,16 +3125,207 @@ None)%0A%0A + def test_cancel_callback(self):%0A self.deferred = Deferred(loop, cancelled_cb=self.set_result)%0A self.deferred.cancel()%0A self.assertTrue(self.result == self.deferred)%0A%0A %0Aif __na
3b1d82170e0e29f1096e95393b4e0cea55a2dce8
fix broken test
tests/test_hnapi.py
tests/test_hnapi.py
""" Tests """ from __future__ import unicode_literals import unittest from hnapi.connectors.api_connector import ApiConnector from hnapi.connectors.api_connector import NetworkError #pylint: disable=too-many-public-methods class HnapiTest(unittest.TestCase): """ Test hnapi """ def test_get_item_by(se...
Python
0.000005
@@ -1967,12 +1967,11 @@ op) -== 5 +%3E 1 00)%0A
014184197b6eeede4a8681a446aa1a8e7bdce9fa
Update views.py
demo/views.py
demo/views.py
import flask import sys from flask import request app = flask.Flask(__name__) @app.route('/') def hello_world(): return flask.jsonify({ 'message': 'Hello Worlb!', 'python': sys.version, 'headers': str(request.headers) })
Python
0
@@ -170,9 +170,9 @@ Worl -b +d !',%0A
08d8018f613bad8e07c510fdecc7392c798de8b8
Make deploy search in config dir first.
deployment.py
deployment.py
from __future__ import with_statement import shutil import os import sys import logging logging.basicConfig(stream=sys.stderr, format="%(levelname)s:: %(message)s", level=logging.INFO) from string import Template class DeploySite(object): def __init__(self, **env): self.env = env for arg in ('...
Python
0
@@ -2216,24 +2216,94 @@ elf, path):%0A + for dir in (self.env%5B'CONFIG_DIR'%5D, self.env%5B'APP_DIR'%5D):%0A full @@ -2327,35 +2327,19 @@ oin( -self.env%5B'APP_DIR'%5D +dir , path)%0A @@ -2334,16 +2334,20 @@ , path)%0A + @@ -2384,24 +2384,28 @@ + return fu...
b8c497ab8b4be7e637a3b5c61fa65e0cf5c21598
Fix to snp table
src/scripts/snpTable.py
src/scripts/snpTable.py
import sys from tex import * import xml.etree.ElementTree as ET def fn(file): l = {} for line in [ line.split() for line in open(file, "r").readlines()[1:] ]: l[line[0]] = line[1:] referenceLine = l.pop("reference") aggregateLine = l.pop("aggregate") chimpLine = l.pop("panTro3") k = l.k...
Python
0.999908
@@ -154,17 +154,17 @@ lines()%5B -1 +2 :%5D %5D:%0A
308428ac6d3fc588e75dae9d2875cf8b5ddd2d98
remove redundant import
examples/example_bubble.py
examples/example_bubble.py
import matplotlib.pyplot as plt from bubblekicker.bubblekicker import (BubbleKicker, batchbubblekicker, bubble_properties_calculate, _bubble_properties_filter, bubble_properties_plot) from bubbl...
Python
0.998781
@@ -174,75 +174,8 @@ e,%0D%0A - _bubble_properties_filter,%0D%0A
2e18e05659e9ba88f2fcce77259792f84b25e5fa
Add ability to disable frame evaluation
_pydevd_frame_eval/pydevd_frame_eval_main.py
_pydevd_frame_eval/pydevd_frame_eval_main.py
import os import sys IS_PY36_OR_OLDER = False if (sys.version_info[0] == 3 and sys.version_info[1] >= 6) or sys.version_info[0] > 3: IS_PY36_OR_OLDER = True set_frame_eval = None stop_frame_eval = None if IS_PY36_OR_OLDER: try: from _pydevd_frame_eval.pydevd_frame_evaluator import frame_eval_func, s...
Python
0
@@ -202,17 +202,168 @@ = None%0A%0A -%0A +use_frame_eval = os.environ.get('PYDEVD_USE_FRAME_EVAL', None)%0A%0Aif use_frame_eval == 'NO':%0A frame_eval_func, stop_frame_eval = None, None%0A%0Aelse:%0A if IS_PY @@ -375,16 +375,20 @@ _OLDER:%0A + try: @@ -388,32 +388,36 @@ try:%0A + + f...
882c7f4ec9ead975175aabae17c11c9750b5095b
add basic support for solidsport
lib/svtplay_dl/service/solidtango.py
lib/svtplay_dl/service/solidtango.py
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- import re import xml.etree.ElementTree as ET from urllib.parse import urlparse from svtplay_dl.error import ServiceError from svtplay_dl.fetcher.hls import hlsparse from svtplay_dl.service import Service class Solidtango(Service...
Python
0
@@ -451,16 +451,35 @@ ango.com +%22, %22solidsport.com %22%5D%0A%0A
b80fee7687b848f198036eeefbe086796a22078e
update url
examples/flask-echo/app.py
examples/flask-echo/app.py
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
Python
0.000001
@@ -2930,16 +2930,139 @@ advanced +?/2.2/search/advanced?order=desc&sort=relevance&q=AttributeError&answers=1&body=AttributeError&views=200&site=stackoverflow '%0A he @@ -3278,24 +3278,8 @@ =url -, params=headers )%0A
1908a3f4551a0b9fef1b38d8cd4593b8c7e105d2
remove debug nonsense
src/server/instagram.py
src/server/instagram.py
# Copyright 2017 Alex K (wtwf.com) __author__ = 'wtwf.com (Alex K)' import cgi import datetime import json import logging import re import PyRSS2Gen as rss from google.appengine.api import memcache from google.appengine.api import urlfetch from google.appengine.ext import webapp import gae_memcache_decorator def ...
Python
0.99893
@@ -1765,99 +1765,8 @@ r):%0A - %22%22%22hello%22%22%22%0A self.response.out.write(%22%3Cplaintext%3E%25s%5Cn%22 %25 str(self.get))%0A return%0A%0A
7d37c2200d58faa167c9793229d7eabbc7e51494
fix tests for autopep8
tests/test_style.py
tests/test_style.py
# -*- coding: utf-8 -*- import click import distutils.spawn import pytest import zazu.cli import zazu.style import zazu.util def write_c_file_with_bad_style(file): with open(file, 'w') as f: f.write('void main(){\n\n}\n ') def write_py_file_with_bad_style(file): with open(file, 'w') as f: f....
Python
0
@@ -1263,17 +1263,46 @@ -print ret +assert ret == 'def foo():%5Cn pass%5Cn' %0A
56675ad39c734993561b47373fa9db39e7f36323
Remove spec_set from mock.patch('os.chdir').
tests/test_utils.py
tests/test_utils.py
# # Unit tests for the viewer.utils module. # # Copyright: (c) 2014 by Petr Zemek <s3rvac@gmail.com> and contributors # License: BSD, see LICENSE for more details # import os import unittest from unittest import mock from viewer.utils import chdir @mock.patch('os.chdir', spec_set=os.chdir) class ChdirTests(unittest...
Python
0
@@ -271,27 +271,8 @@ dir' -, spec_set=os.chdir )%0Acl
a72ea881dac6807fd81860029586e33452d42fd1
fix test case
tests/test_utils.py
tests/test_utils.py
"""Tests for the ``utils`` module.""" from datetime import datetime from facepy import ( get_application_access_token, get_extended_access_token, GraphAPI ) from mock import patch from nose.tools import ( assert_equal, assert_raises, with_setup ) mock_request = None patch = patch('requests.se...
Python
0.000022
@@ -1546,32 +1546,54 @@ n_type%22:%22bearer%22 +, %22expires_in%22:5170982 %7D'%0A )%0A%0A ac @@ -2245,24 +2245,116 @@ oken%3E')%0A +# there is data for expiration check on key 'expires_in', %0A # so i comment this one%0A # assert not e @@ -2362,16 +2362,17 @@ pires_at + %0A%0A%0A@with