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
73f19f7108a41677b3ecab8a71c31d07a01894d4
exclude reverse related fields is not required anymore
public_api/rest.py
public_api/rest.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals # py2 from public_api.models import Tag, Category, User, Artist, Post, Comment, Entry from rest_framework.viewsets import ReadOnlyModelViewSet from rest_framework.serializers import ModelSerializer, SerializerMethodField from rest_framework.filters impo...
Python
0
@@ -5788,49 +5788,8 @@ ta:%0A - exclude = ('posts', 'comments',)%0A
deedcff26e18e6edfff6680697ccbe213565e5c7
add to join_session_command
remote.py
remote.py
import sublime, sublime_plugin import Session import socket import sys class DiffListener(sublime_plugin.EventListener): """Listens for modifications to the view and gets the diffs using Operational Transformation""" def __init___(self): # watched_views is a sessions of which currently open views...
Python
0.000001
@@ -793,64 +793,8 @@ ew:%0A - # get the body text of the whole buffer%0A @@ -1349,20 +1349,16 @@ ze()))%0A%0A - def @@ -1369,28 +1369,24 @@ self): %0A - # th @@ -1459,20 +1459,16 @@ - # from t @@ -1531,20 +1531,16 @@ ession,%0A - @@ -1615,...
6eae9369cc122b23577715951d6b0f59991b0f65
Update choices descriptions in FileTypes
saleor/csv/__init__.py
saleor/csv/__init__.py
class ExportEvents: """The different csv events types.""" EXPORT_PENDING = "export_pending" EXPORT_SUCCESS = "export_success" EXPORT_FAILED = "export_failed" EXPORT_DELETED = "export_deleted" EXPORTED_FILE_SENT = "exported_file_sent" CHOICES = [ (EXPORT_PENDING, "Data export was st...
Python
0
@@ -722,19 +722,19 @@ %22Plain -csv +CSV file.%22) @@ -761,13 +761,12 @@ cel -.xlsx +XLSX fil
0654288328c08c1eca1bf184163fb92c0d465dc3
Remove unused import
cla_public/apps/contact/views.py
cla_public/apps/contact/views.py
# -*- coding: utf-8 -*- "Contact views" from flask import abort, redirect, render_template, session, url_for, views, \ current_app from flask.ext.babel import lazy_gettext as _, gettext from flask.ext.mail import Message from cla_public.apps.contact import contact from cla_public.apps.contact.forms import Contact...
Python
0
@@ -426,58 +426,8 @@ ror%0A -from cla_public.apps.checker.constants import YES%0A from
8f24cc13d90679c04a7275206d56519a3a783ffb
fix bug where bot couldn't find user credentials
cogs/utils/helpers.py
cogs/utils/helpers.py
from cogs.utils import constants async def get_membership_details(bot, ctx, username, platform): """Get the platform_id, membership_id, and display name for a user Note that platform and username can be None, in which case the credentials for the user in the database are used""" # User wants c...
Python
0.000001
@@ -518,33 +518,32 @@ f info.get(' -bungie_id +platform '):%0A%0A @@ -3165,24 +3165,25 @@ .author.id)%0A +%0A if i @@ -3195,17 +3195,16 @@ et(' -bungie_id +platform '):%0A
21537b7b0a045993b692c62d695cb32ac9feb639
Simplify rename script arguments.
rename.py
rename.py
import sys import pandas as pd from path_helpers import path def main(root, old_name, new_name): names = pd.Series([old_name, new_name], index=['old', 'new']) underscore_names = names.map(lambda v: v.replace('-', '_')) camel_names = names.str.split('-').map(lambda x: ''.join([y.title() ...
Python
0
@@ -2156,40 +2156,34 @@ ='Re +name tem pla -ce occurrences of %3Cold name%3E +te project with '%0A @@ -2209,20 +2209,32 @@ ' -with +hyphen-separated %3Cnew na @@ -2260,91 +2260,14 @@ in -files).')%0A parser.add_argument('old_name', help='Original project name (e.g., '%0A +'%0A @@ -2291,2...
81269d44b12527fc9059498ef1e9443756aee48c
add email test
cornertests.py
cornertests.py
#!/usr/bin/env python3 import chatparse import unittest class CornerTests(unittest.TestCase): def test_userurl(self): '''test for @user in url''' msg = "http://user@example.com" expect = { "links": [ { "url": msg, "title": None, ...
Python
0.000009
@@ -89,16 +89,233 @@ tCase):%0A + def test_email(self):%0A '''test email to make sure it is not a mention'''%0A msg = %22user@example.com%22%0A expect = %7B%7D%0A result = chatparse.parse(msg)%0A self.assertEqual(expect, result)%0A%0A def @@ -358,13 +358,13 @@ for -@ user...
bd1cea280a87818753ec1511207b4561fa01356a
Make help command suggest you can also use it to get more info on commands; minor other improvements
commands/help.py
commands/help.py
from CommandTemplate import CommandTemplate import GlobalStore class Command(CommandTemplate): triggers = ['help', 'helpfull'] helptext = "Shows the explanation of a command, or the list of commands if there aren't any arguments. {commandPrefix}helpfull shows all command aliases as well" def execute(self, bot, ...
Python
0
@@ -162,17 +162,28 @@ tion of -a +the provided command @@ -924,24 +924,8 @@ u%22%22%0A -%09%09command = u%22%22%0A %09%09#C @@ -976,55 +976,37 @@ t%0A%09%09 -if msgPartsLength %3E 1:%0A%09%09%09command = msgParts%5B1%5D +command = msgWithoutFirstWord .low @@ -1944,16 +1944,17 @@ mand != +u %22%22:%0A%09%09%0...
59a7c4d059bbd86bdf2dc1572c601aa973698496
use << and >> in the tests
test/parsy_test.py
test/parsy_test.py
from parsy import string, regex, chain import re import pdb import readline whitespace = regex(r'\s+', re.MULTILINE) comment = regex(r';.*') ignore = (whitespace | comment).many() lexeme = lambda p: p.skip(ignore) lparen = lexeme(string('(')) rparen = lexeme(string(')')) number = lexeme(regex(r'\d+')).map(int) symbo...
Python
0
@@ -199,21 +199,18 @@ p: p -.skip( + %3C%3C ignore -) %0A%0Alp @@ -700,14 +700,12 @@ nore -.then( + %3E%3E expr @@ -711,17 +711,16 @@ r.many() -) %0A%0Adef te
f5957d60f4903e775d69062e68950b2c7cd382c4
add map link to admin menu
modules/templates/STL/menus.py
modules/templates/STL/menus.py
# -*- coding: utf-8 -*- from gluon import * from s3 import * from s3layouts import * try: from .layouts import * except ImportError: pass import s3menus as default # ============================================================================= class S3MainMenu(default.S3MainMenu): """ Custom Application M...
Python
0
@@ -772,32 +772,33 @@ homepage(%22org%22), +%0A @@ -789,32 +789,61 @@ +homepage(%22gis%22), %0A %5D%0A
c6200a3b8e188aaa5e0075adf9b83533a681859f
Implement wrap_write_message.
server/guiserver/utils.py
server/guiserver/utils.py
# This file is part of the Juju GUI, which lets users view and manage Juju # environments within a graphical interface (https://launchpad.net/juju-gui). # Copyright (C) 2013 Canonical Ltd. # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public Lice...
Python
0.000003
@@ -945,16 +945,31 @@ urlparse +%0Aimport weakref %0A%0Afrom t @@ -3113,36 +3113,768 @@ -return handler.write_message +%22%22%22Wrap the write_message() method of the given handler.%0A%0A The resulting function uses a weak reference to the handler, in order to%0A avoid calling the wrapped method if the ha...
b3dd0161541bc96d01f404a6bd48604dd48e06eb
Refactor dict handling
report.py
report.py
import markdown import dominate import bunch from github import Github from clint import arguments from dominate.tags import table, thead, tbody, tr, td, th, h1, a from dominate.util import raw def print_header(): h = thead() with h: r = tr() r.add(th('NUMBER')) r.add(th('TITLE')) ...
Python
0.000001
@@ -1508,25 +1508,66 @@ return -assignee, +%7B'issue': issue, 'assignee': assignee, 'priority': priorit @@ -1561,32 +1561,33 @@ ity': priority, +' last_comment%0A%0A%0Ad @@ -1586,273 +1586,147 @@ ment -%0A%0A%0Adef assign(issue, assignee, priority, last_comment):%0A decorated_issue = bunch.Bunch()%0A dec...
d1cdd45417c3b880d03a3db680ad5bbb3d2e6e04
update for report
report.py
report.py
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = "Alexander Loew" __version__ = "0.1" __date__ = "2012/10/29" __email__ = "alexander.loew@zmaw.de" ''' # Copyright (C) 2012 Alexander Loew, alexander.loew@zmaw.de # See COPYING file for copying and redistribution conditions. # # This program is free software; ...
Python
0
@@ -1011,19 +1011,27 @@ dir='./' +,dpi=300 ):%0A - @@ -1399,24 +1399,117 @@ outdir: str%0A + %0A @param dpi: specify dots per inch for graphic output%0A @type dpi: int%0A '''%0A @@ -1756,16 +1756,16 @@ .open()%0A - @@ -1787,16 +1787,39 @@ nter = 0 +%0A self....
a252d477291e1ac0c9f35a4c822b1affb6fd266d
Ensure response status is 200
core/client.py
core/client.py
import httplib2 import simplejson as json import re default_client = None def get_client(): return default_client def setup_client(*args, **kwargs): global default_client default_client = Client(*args, **kwargs) class Client(object): def __init__(self, host, ssl=True, user=None, password=None, ...
Python
0.999998
@@ -46,16 +46,64 @@ ort re%0A%0A +class CoreClientException(Exception):%0A pass%0A%0A default_ @@ -1175,16 +1175,148 @@ l_url)%0A%0A + if response.status != 200:%0A raise CoreClientException(%22Request to %25s did not return 200 OK%22 %25 full_url)%0A%0A
b518fee4884c44cfda22175f8e4bdf52c1183623
Allow archive.extracted to be used during highstate run
salt/states/archive.py
salt/states/archive.py
# -*- coding: utf-8 -*- ''' Archive states. .. versionadded:: 2014.1.0 ''' import logging import os import tarfile from contextlib import closing log = logging.getLogger(__name__) def extracted(name, source, archive_format, tar_options=None, source_hash=None,...
Python
0
@@ -3550,16 +3550,90 @@ edir'%5D,%0A + 'files',%0A __env__,%0A @@ -4471,19 +4471,348 @@ ate. -high'%5D(data +single'%5D('file.managed',%0A filename,%0A source=sou...
f106175ed3eb8ec32202b9197cd68f33f57361b3
Define 'updated' property setter and getters
app/models.py
app/models.py
from app import slack, redis, app from app.redis import RedisModel class Channel(RedisModel): __prefix__ = '#' @staticmethod def load_from_slack(): """Update channel list from slack""" slack_response = slack.channels.list() if not slack_response.successful: app.logger...
Python
0.000441
@@ -729,16 +729,311 @@ = '@'%0A%0A + @property%0A def updated(self):%0A if 'updated' in self:%0A return datetime.strptime(self%5B'updated'%5D, %22%25Y-%25m-%25dT%25H:%25M:%25S.%25fZ%22)%0A%0A return None%0A%0A @updated.setter%0A def updated(self, value):%0A self%5B'updated'...
06493206e99b8e63027898fe9bcf73d18264154e
Add initial solution
space-age/space_age.py
space-age/space_age.py
class SpaceAge(object): def __init__(self): pass
Python
0.000001
@@ -38,16 +38,25 @@ t__(self +, seconds ):%0A @@ -62,9 +62,665 @@ -pass +self.seconds = seconds%0A%0A @property%0A def years(self):%0A return self.seconds/31557600%0A%0A def on_earth(self):%0A return round(self.years, 2)%0A%0A def on_mercury(self):%0A return round(self.year...
478fe7eb069987a34cb23293284d9876117ca1a7
make pretty-lines
soccer/gameplay/plays/offense/clear.py
soccer/gameplay/plays/offense/clear.py
import main import robocup import behavior import constants import enum import standard_play import evaluation import tactics.coordinated_pass import skills.move import skills.capture import random #Based on clear sitation # Have ball in defense # Want to Kick ball up field and get other robots in position # c...
Python
0.000079
@@ -2994,16 +2994,17 @@ =False)%0A +%0A
ac075b7f353dd18c6129911dd740e24e5224f21c
Fix the exception message in tempest plugin
ironic_tempest_plugin/common/waiters.py
ironic_tempest_plugin/common/waiters.py
# All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
Python
0.000001
@@ -4533,16 +4533,18 @@ nstance +UU ID '%0A @@ -4567,16 +4567,18 @@ nstance_ +uu id)s wit @@ -4645,16 +4645,18 @@ nstance_ +uu id': ins
58160d03e9536d8a91c5d3abede7a1947607fcb6
Fix order for converting mach absolute time
monotonic.py
monotonic.py
# -*- coding: utf-8 -*- """ monotonic ~~~~~~~~~ This module provides a ``monotonic()`` function which returns the value (in fractional seconds) of a clock which never goes backwards. On Python 3.3 or newer, ``monotonic`` will be an alias of ``time.monotonic`` from the standard library. On older versions, ...
Python
0.999999
@@ -2519,60 +2519,31 @@ -ticks_per_second = timebase.numer / timebase.denom * +nanoseconds_in_second = 1.0 @@ -2650,22 +2650,29 @@ -return +nanoseconds = mach_ab @@ -2689,19 +2689,93 @@ e() -/ ticks_per +* timebase.numer / timebase.denom%0A return nanoseconds / nanoseconds_in _sec
4e5a7c2ffd32b0402e269d20cfe611468c9f79aa
Remove directory from exdir_object, already in abstract
exdir/core/exdir_object.py
exdir/core/exdir_object.py
from enum import Enum import os import yaml from . import abstract_object from . import exdir_object from . import raw from .attribute import Attribute # metadata EXDIR_METANAME = "exdir" TYPE_METANAME = "type" VERSION_METANAME = "version" # filenames META_FILENAME = "exdir.yaml" ATTRIBUTES_FILENAME = "attributes.ya...
Python
0
@@ -5024,117 +5024,8 @@ e)%0A%0A - @property%0A def directory(self):%0A return os.path.join(self.root_directory, self.relative_path)%0A%0A
328dc97dcecfbbd9baee4aed788fc4f74a24cc5b
Fix system tests: fix import syntax in subworkflow
o2a/mappers/subworkflow_mapper.py
o2a/mappers/subworkflow_mapper.py
# -*- coding: utf-8 -*- # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
Python
0.000009
@@ -4343,15 +4343,8 @@ f%22 -from . impo
0382cc8c14b77e3dcbb459147b93a630b9661d4b
Refactor to use math.isfinite
sparkline/sparkline.py
sparkline/sparkline.py
# vim: set fileencoding=utf-8 : import math, os, re, string, sys spark_chars = u"▁▂▃▄▅▆▇█" """Eight unicode characters of (nearly) steadily increasing height.""" def _convert_to_float(n): try: return float(n) except: return None def _isan(n): return not math.isnan(n) and not math.isinf(n)...
Python
0
@@ -161,166 +161,8 @@ %22%22%0A%0A -def _convert_to_float(n):%0A try:%0A return float(n)%0A except:%0A return None%0A%0Adef _isan(n):%0A return not math.isnan(n) and not math.isinf(n)%0A%0A def @@ -647,21 +647,29 @@ all(not -_isan +math.isfinite (n) for @@ -734,37 +734,45 @@ um = min(filt...
d146fd029c8beb026a401b17b4f93296025d55b0
Update win_pki.py
salt/states/win_pki.py
salt/states/win_pki.py
# -*- coding: utf-8 -*- ''' Microsoft certificate management via the Pki PowerShell module. :platform: Windows .. versionadded:: 2016.11.0 ''' # Import python libs from __future__ import absolute_import _DEFAULT_CONTEXT = 'LocalMachine' _DEFAULT_FORMAT = 'cer' _DEFAULT_STORE = 'My' def __virtual__(): '''...
Python
0.000033
@@ -2442,24 +2442,16 @@ format)%0A - %0A if
e3b8227b4bb2e09d592e0f1fdb75243baa658152
Update DB Model to Account for Tags
app/models.py
app/models.py
from . import db, login_manager from werkzeug.security import generate_password_hash, check_password_hash from flask import current_app, request, url_for from flask.ext.login import UserMixin from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from flask import current_app from datetime import datet...
Python
0
@@ -440,16 +440,291 @@ r_id))%0A%0A +# Association Tables%0Anote_tag = db.Table(%0A 'note_tag',%0A db.Column(%0A 'note_id',%0A db.Integer,%0A db.ForeignKey('note.id', ondelete=%22CASCADE%22)),%0A db.Column(%0A 'tag_id',%0A db.Integer,%0A db.ForeignKey('tag.id', ondele...
a749c1e161533f439fd8c3ad8e77f18b7656e622
fix minor bugs on datatype and bracket
motifwalk.py
motifwalk.py
import os import argparse import numpy as np from motifwalk.utils import find_meta, set_dataloc, get_metadata, timer from motifwalk.utils.Graph import GraphContainer from motifwalk.walks import undirected_randomwalk from motifwalk.models.skipgram import Skipgram, ADAM from motifwalk.motifs import all_u3, all_3, all_u...
Python
0
@@ -4062,32 +4062,33 @@ im=args.emb_dim/ +/ 2,%0A @@ -4219,17 +4219,16 @@ .device) -) %0A @@ -4293,16 +4293,17 @@ emb_dim/ +/ 2,%0A
24d4c31064d8d0cff43be1d97731e12cfd692b0e
Fix typo in core Location model
core/models.py
core/models.py
# -*- coding: utf-8 -*- from lxml import etree from django.db import models from django.db.models import Max, Count class Subdomain(models.Model): '''Описание субдоменов для работы со страничками атласа''' SUBDOMAIN_STATUS = ((0, u'Неактивен'), (1, u'Активен'), ) class Meta()...
Python
0.000026
@@ -2077,16 +2077,17 @@ f.name%0A%0A +%0A class In @@ -3472,25 +3472,24 @@ e, self.long -t itude)%0A%0A%0Acla
00d924b23662bbf44ab99e192f2b54a7b666a345
version bump
djaloha/__init__.py
djaloha/__init__.py
# -*- coding: utf-8 -*- VERSION = (0, 4, 1) def get_version(): version = '%s.%s.%s' % (VERSION[0], VERSION[1], VERSION[2]) return version __version__ = get_version()
Python
0.000001
@@ -35,17 +35,17 @@ (0, 4, -1 +2 )%0A%0Adef g
d492e32ba807a7eeabee5111a246fc06f40a219d
Fix typo
api/pending.py
api/pending.py
from decode import * from sqltools import * import decimal def insertpending(txhex): try: rawtx = decode(txhex) except Exception,e: print "Error: ", e, "\n Could not decode PendingTx: ", txhex return if 'BTC' in rawtx: #handle btc pending amounts insertbtc(rawtx) if 'MP' in rawtx: #('amo...
Python
0.999999
@@ -3090,16 +3090,17 @@ else +: %0A a
3bc508799cff4da89b592b7c97d162ee19d38a3a
Fix __init__ formatting
pyeapi/__init__.py
pyeapi/__init__.py
# # Copyright (c) 2014, Arista Networks, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # Redistributions of source code must retain the above copyright notice, # this list of condit...
Python
0.999995
@@ -1523,17 +1523,16 @@ MAGE.%0A#%0A -%0A __versio
1c795df23bd9d554eabcc419dfe830270e26fede
Add some info to the printouts
solidity/python/FormulaTestPurchase.py
solidity/python/FormulaTestPurchase.py
from sys import argv from decimal import Decimal from random import randrange from Formula import calculatePurchaseReturn def formulaTest(_supply, _reserveBalance, _reserveRatio, _amount): fixed = calculatePurchaseReturn(_supply, _reserveBalance, _reserveRatio, _amount) real = Decimal(_supply)*((1+Decim...
Python
0
@@ -1073,16 +1073,34 @@ acy = 1%0A +numOfFailures = 0%0A while n @@ -1411,19 +1411,16 @@ -if worstAcc @@ -1429,18 +1429,36 @@ acy -%3E += min(worstAccuracy, accuracy :%0A @@ -1457,28 +1457,47 @@ racy -: +) %0A - +except Exception,error:%0A -worstA + a ccur @@ -1506,32 +1506,124 @@...
ce6bd9dd8570adc6c3a146cf13f80940a195a285
Refactor test helpers to basestring
test/selenium/src/lib/test_helpers.py
test/selenium/src/lib/test_helpers.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: jernej@reciprocitylabs.com # Maintained By: jernej@reciprocitylabs.com """ Utility classes for page objects used in tests. Details: Most of the te...
Python
0
@@ -963,22 +963,18 @@ xt ( -str or unicode +basestring )%0A
c6da29f07c30beefef53bfca4b67c4c27f85d69a
fix record category filtering
moneyforecast/records/admin.py
moneyforecast/records/admin.py
from django.contrib import admin from records.models import Category, Record, Budget, SYSTEM_CATEGORIES class CurrentUserAdmin(admin.ModelAdmin): readonly_fields = ('user',) def get_queryset(self, request): qs = super(CurrentUserAdmin, self).get_queryset(request) # make sure all users, even s...
Python
0
@@ -1,12 +1,27 @@ +import logging%0A from django. @@ -113,16 +113,54 @@ GORIES%0A%0A +logger = logging.getLogger(__name__)%0A%0A %0Aclass C @@ -396,32 +396,263 @@ eir own objects%0A + # to see all categories a superuser need to add a hidden option%0A # ?all=True to the querystring eg.: /admin/categori...
260c36727cc5c24c68d975150646cc8d469144ee
fix pio access urn format
platformio/commands/access.py
platformio/commands/access.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
Python
0.000004
@@ -1197,16 +1197,20 @@ atch(r%22%5E +prn: reg:pkg: @@ -3672,17 +3672,17 @@ hoice(%5B%22 -u +p rn:reg:p
5021b1053599a53a9b50d02236fa701230065a71
Fix crash on Python 3.x and Django >= 1.5
mongoengine/django/sessions.py
mongoengine/django/sessions.py
from django.conf import settings from django.contrib.sessions.backends.base import SessionBase, CreateError from django.core.exceptions import SuspiciousOperation from django.utils.encoding import force_unicode from mongoengine.document import Document from mongoengine import fields from mongoengine.queryset import Op...
Python
0.000036
@@ -156,16 +156,25 @@ eration%0A +try:%0A from dja @@ -212,16 +212,102 @@ _unicode +%0Aexcept ImportError:%0A from django.utils.encoding import force_text as force_unicode %0A%0Afrom m
4d900c0b26c3c2810fe23ff4f8f663a50793fb32
Update SCOTS
SCOTS/clean_scots.py
SCOTS/clean_scots.py
#!/usr/bin/env python # Cleans up SCOTS textgrids to be used with the MFA # [CENSORED: forename] # <vocallex desc=""eh"" /> # <gap reason=""inaudible"" /> # <unclear></unclear> # <falsestart>wor-</falsestart> # <trunc>wor-</trunc> # [non lexical items, non linguistic events] import os import sys import re import su...
Python
0.000001
@@ -2222,32 +2222,92 @@ tput_dir, file)%0A + if os.path.exists(outputPath):%0A continue%0A if file. @@ -2912,43 +2912,8 @@ av') - and not os.path.exists(outputPath) :%0A%0A
73725a62eb1d31ed08ecb3a1df152aa1c6fc96b2
Handle series with no problemset assigned
competitions/views.py
competitions/views.py
from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.shortcuts import get_object_or_404 from django.views.generic.edit import FormView from django.views.generic.detail import DetailView from django.views.generic import ListView from problems.models ...
Python
0
@@ -4744,32 +4744,151 @@ s.pk%5D = dict()%0A%0A + # If there is no problemset assigned, skip%0A if not series.problemset:%0A continue%0A%0A for @@ -5433,32 +5433,151 @@ s.pk%5D = dict()%0A%0A + # If there is no problemset assigned, skip%0A if no...
eb4591234d8fccab48984c3160849e6213786212
fix strings
device/read.py
device/read.py
from metadata import * import logging # Returns the relevant portion of the pad def read_decrypt_pad(sid, uid, decrypt_index, clen): """ Read the specified bytes from the pad for decryption. Args: sid: User ID of the sender. uid: User ID of the recipient. decrypt_index: The index to st...
Python
0.999999
@@ -4623,32 +4623,33 @@ :%0A msg = +( %22Decryption inde @@ -4673,32 +4673,37 @@ message from %22%0A + + %22%7B%7D to @@ -4724,32 +4724,37 @@ d, uid)%0A + + %22; intended in @@ -4774,32 +4774,33 @@ t(decrypt_index) +) %0A if d == @@ -5458,16 +5458,17 @@ msg = +( %2...
3e708149534926f976b73ec4e0a8a6ec3123ef40
update tests
corehq/util/tests/test_sentry.py
corehq/util/tests/test_sentry.py
# coding=utf-8 import uuid from django.test import SimpleTestCase, override_settings from corehq.util.sentry import HQSanitzeSystemPasswordsProcessor class HQSentryTest(SimpleTestCase): def test_couch_password(self): couch_pw = uuid.uuid4().hex couch_pw2 = uuid.uuid4().hex overridden_dbs ...
Python
0.000001
@@ -113,32 +113,33 @@ ort -HQS +s anit +i ze -S +_s ystem -P +_p asswords Proc @@ -134,25 +134,16 @@ asswords -Processor %0A%0A%0Aclass @@ -897,79 +897,8 @@ s):%0A - processor = HQSanitzeSystemPasswordsProcessor(client=None)%0A @@ -1283,25 +1283,41 @@ result, -processor +sanitize_system_pas...
dcff103f954c9315011e0c8602cfcbd4b2cc076f
fix typo
src/source_weather/source_weather.py
src/source_weather/source_weather.py
""" Definition of a source than add dumb data """ from src.source import Source from src import default from . import weather class SourceWeather(Source): """ Throught Open Weather Map generates today weather and expected weather for next days, if possible """ def enrichment(self, data_dict): ...
Python
0.999991
@@ -507,16 +507,20 @@ _WEATHER +_NOW %5D = weat
4966b67250ad95875534a754b4c92f01723ec76f
Check for absent ingored jobs
crawler/iso.py
crawler/iso.py
# Contents of this file are intended for the the old format of ISO jobs # which existed before 6.1 # NOTE: this format is a subject of deprecation and should be eventually # removed from flask import current_app as app import lxml.etree as et import crawler as current_path from crawler import iso2 from crawler import...
Python
0
@@ -1132,16 +1132,51 @@ d_jobs:%0A + if to_remove in names:%0A
33e65176172da48b3b75e77aa20b68bbd4d95069
Check pywin32 is installed before running
sphinxcontrib/visio.py
sphinxcontrib/visio.py
# -*- coding: utf-8 -*- # Copyright 2014 Yassu # # 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 o...
Python
0
@@ -719,16 +719,22 @@ import +(%0A VisioFil @@ -748,16 +748,40 @@ er_pages +, is_pywin32_available%0A) %0Afrom sp @@ -1315,16 +1315,212 @@ e, to):%0A + if not is_pywin32_available():%0A self.app.env.warn_node('Fail to convert visio image: win32com not installed',%0A ...
85195a683ed4553d73e2bb463dbe2a9ca23d8de6
using headline
phoenix/processes/views/overview.py
phoenix/processes/views/overview.py
from pyramid.view import view_config, view_defaults from owslib.wps import WebProcessingService from phoenix.catalog import WPS_TYPE from phoenix.views import MyView import logging LOGGER = logging.getLogger(__name__) @view_defaults(permission='view', layout="default") class Overview(MyView): def __init__(self...
Python
0.999988
@@ -160,16 +160,51 @@ t MyView +%0Afrom phoenix.utils import headline %0A%0Aimport @@ -1760,184 +1760,48 @@ -if process.abstract:%0A description = %22%7B%7D %5B..%5D%22.format(process.abstract%5B:100%5D)%0A else:%0A description = %22No summary%22 ...
7b187212fb6bb5382d5a4c544b25306fb9b0c0c2
split column test cases
couchexport/tests/test_schema.py
couchexport/tests/test_schema.py
from django.test import TestCase from couchexport.models import ExportSchema from datetime import datetime, timedelta from dimagi.utils.couch.database import get_safe_write_kwargs class ExportSchemaTest(TestCase): def testSaveAndLoad(self): index = ["foo", 2] schema = ExportSchema(index=index, ti...
Python
0.000001
@@ -1,12 +1,61 @@ +from couchdbkit.ext.django.loading import get_db%0A from django. @@ -118,16 +118,35 @@ rtSchema +, SavedExportSchema %0Afrom da @@ -179,16 +179,66 @@ medelta%0A +from couchexport.util import SerializableFunction%0A from dim @@ -291,16 +291,66 @@ _kwargs%0A +import json%0Afrom couchexport.models...
3d411072d768aea5298ba9fa340d0e458ca820ad
Update docstring & add standard future imports
src/gryaml/pyyaml.py
src/gryaml/pyyaml.py
"""Incomplete support for dump/load w/PyYAML.""" from typing import Dict, List, Optional, Union import yaml from py2neo_compat import Node, Relationship, to_dict # from py2neo.cypher.core import Record from . import node, rel node_tag = u'!gryaml.node' rel_tag = u'!gryaml.rel' def render_node(graph_node): # ...
Python
0
@@ -1,19 +1,8 @@ %22%22%22 -Incomplete s +S uppo @@ -30,16 +30,71 @@ YAML.%22%22%22 +%0Afrom __future__ import absolute_import, print_function %0A%0Afrom t
8f5bb671e914d7958498ab0e43ed4c2aafb51a91
bump to pyipmi v0.11.0
pyipmi/__init__.py
pyipmi/__init__.py
# Copyright (c) 2012, Calxeda Inc. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and th...
Python
0
@@ -1629,11 +1629,12 @@ %220. -9.2 +11.0 %22%0A%0A_
808d727de4360311fe4bb134b567b96628a1f7f9
bump version number
indieweb/__init__.py
indieweb/__init__.py
__version__ = '0.0.3'
Python
0.000004
@@ -16,7 +16,7 @@ 0.0. -3 +4 '%0A
1a965d1f0c1042c32ecd72b76a8586b6b8ef5ca8
Update Parameters
notebooks/gradient_boosting.py
notebooks/gradient_boosting.py
#!/usr/bin/env python import pandas as pd import numpy as np import datetime from sklearn.preprocessing import LabelEncoder from sklearn.cross_validation import cross_val_score from xgboost.sklearn import XGBClassifier from utils.metrics import ndcg_scorer def generate_submission(y_pred, test_users_ids, label_encod...
Python
0.000001
@@ -1449,10 +1449,9 @@ pth= -15 +8 ,%0A @@ -1472,17 +1472,17 @@ _rate=0. -2 +3 ,%0A
d0f43e157f5e51fdb2b4a22eff046c7edb75d2c6
bump version
sphinxleash/version.py
sphinxleash/version.py
__version__ = "0.1"
Python
0
@@ -14,7 +14,7 @@ %220. -1 +2 %22%0A
70700672ba277d462403cc48ae7210b8a3215003
Remove gcc xfail for TestTargetWatchAddress.
test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
""" Use lldb Python SBtarget.WatchAddress() API to create a watchpoint for write of '*g_char_ptr'. """ import os, time import re import unittest2 import lldb, lldbutil from lldbtest import * class TargetWatchAddressAPITestCase(TestBase): mydir = TestBase.compute_mydir(__file__) def setUp(self): # Ca...
Python
0.000347
@@ -1528,88 +1528,8 @@ est%0A - @expectedFailureGcc #xfail to get buildbot green, test failed with gcc4.8.2%0A
f4a8d30d9b883c705ebd75874f2e513139e785db
Fix functionally benign typo
test/test_Datac.py
test/test_Datac.py
# -*- coding: utf-8 -*- import unittest import datac params = {"slope": 2., "y_intercept": 1.} abscissae = [1, 2] abscissa_name = "abscissa" class Test_Class(object): """ Dummy class to test Datac functionality Implements a line. """ def __init__(self, params): self.slope = par...
Python
0.999996
@@ -1312,25 +1312,24 @@ est_abscissa -e _name_non_st @@ -1403,17 +1403,16 @@ abscissa -e _name is
b6f04f32556fc8251566212c56159dcfff7bf596
Add unexpected character bug fix
pi_approach/Distance_Pi/distance.py
pi_approach/Distance_Pi/distance.py
# Lidar Project Distance Subsystem import serial import socket import time import sys sys.path.insert(0, "/home/pi/lidar/pi_approach/Libraries") import serverxclient as cli arduino_dist = serial.Serial('/dev/ttyUSB0',9600) client = cli.Client() class distance_controller(object): """An all-powerful distance-finding ...
Python
0
@@ -1058,16 +1058,43 @@ racter%22%0A +%09%09%09%09client.send_data(%220%22)%0A%0A %0A%09def ma
c62d7fe750ad435f48efac05e154b56826bfa882
Add articles to search as well
app/search.py
app/search.py
# -*- coding: utf-8 -*- import re from flask import render_template, request, redirect, url_for from app import app, db @app.route('/search/') def search(): # hoo boy. compile reviews into full-text 'documents' and search on them tmp = db.session.execute("SELECT r_id, r_title, r_subtitle FROM ( \ ...
Python
0
@@ -121,51 +121,8 @@ db%0A%0A -%0A@app.route('/search/')%0Adef search():%0A%0A # ho @@ -144,16 +144,29 @@ reviews +and articles into ful @@ -203,20 +203,16 @@ on them%0A - tmp = db @@ -240,23 +240,23 @@ ECT -r +p _id, -r +p _title, r_su @@ -251,17 +251,17 @@ _title, -r +p _subtitl @@ -301,20 +...
602bae0ed72bafcfc7b6160efb6004e147034289
Add FIXME
dialogs/dcc.py
dialogs/dcc.py
# coding: UTF-8 """ Copyright (c) 2009 Marian Tietz All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions a...
Python
0.000001
@@ -2192,16 +2192,65 @@ running%0A +%09# FIXME: only poll if there's a send/get active%0A %09sends =
d2bfe61dd886311287f3ab35c5f1675c5e9d55d0
Check time_dimension type
devito/grid.py
devito/grid.py
from devito.tools import as_tuple from devito.dimension import SpaceDimension, TimeDimension, SteppingDimension from devito.base import Constant import numpy as np __all__ = ['Grid'] class Grid(object): """ A cartesian grid that encapsulates a physical domain over which to discretize :class:`Function`s...
Python
0.000001
@@ -3631,34 +3631,76 @@ _dim)%0A el -se +if isinstance(time_dimension, TimeDimension) :%0A se @@ -3884,16 +3884,117 @@ ime_dim) +%0A else:%0A raise ValueError(%22%60time_dimension%60 must be None or of type TimeDimension%22) %0A%0A de
940e5d5446a04d6228ea5fad2ac1f9ed4cf109a7
fix doxygen-link.py by skipping invalid entries in libnl.dict
doc/doxygen-link.py
doc/doxygen-link.py
#!/usr/bin/env python import fileinput import re import sys links = {} for line in open(sys.argv[1], 'r'): m = re.match('^([^=]+)=([^\n]+)$', line); if m: link = "<a href=\"" + m.group(2) + "\" class=\"dg\">" + m.group(1) + "</a>" links[m.group(1)] = link def translate(match): return links[match.group(0)] r...
Python
0.000063
@@ -16,16 +16,54 @@ python%0A%0A +from __future__ import print_function%0A import f @@ -93,16 +93,86 @@ rt sys%0A%0A +%0Arc_script = re.compile(r'%5Cs*(.*%5CS)?%5Cs*')%0A%0Adef parse_dict(filename):%0A%09 links = @@ -174,17 +174,17 @@ ks = %7B%7D%0A -%0A +%09 for line @@ -196,27 +196,24 @@ pen( -sys.argv%5B1%5D...
aeb4592f6cde29c237e10452c518006913ab9ecb
Mark the revoke kvs backend deprecated, for removal in Kilo
keystone/contrib/revoke/backends/kvs.py
keystone/contrib/revoke/backends/kvs.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
Python
0.000009
@@ -717,16 +717,67 @@ ception%0A +from keystone.openstack.common import versionutils%0A %0A%0ACONF = @@ -890,16 +890,220 @@ Driver): +%0A%0A @versionutils.deprecated(%0A versionutils.deprecated.JUNO,%0A in_favor_of='keystone.contrib.revoke.backends.sql',%0A remove_in=+1,%0A what='keyst...
40151dd39dc6aa51f50bb311dc81381eeb4cf282
fix precision on lmsensors
src/collectors/lmsensors/lmsensors.py
src/collectors/lmsensors/lmsensors.py
# coding=utf-8 """ This class collects data from libsensors. It should work against libsensors 2.x and 3.x, pending support within the PySensors Ctypes binding: [http://pypi.python.org/pypi/PySensors/](http://pypi.python.org/pypi/PySensors/) Requires: 'sensors' to be installed, configured, and the relevant kernel mod...
Python
0.000001
@@ -2070,22 +2070,109 @@ label%5D), - value +%0A value,%0A precision=2 )%0A
bfe96653c1de4d2090a2bb24ed6f0ee85251e232
Add methods to retrieve model settings
pints/toy/_hes1_michaelis_menten.py
pints/toy/_hes1_michaelis_menten.py
# # HES1 Michaelis-Menten model of regulatory dynamics. # # This file is part of PINTS. # Copyright (c) 2017-2018, University of Oxford. # For licensing information, see the LICENSE file distributed with the PINTS # software package. # from __future__ import print_function import pints import numpy as np import scip...
Python
0.000001
@@ -2908,32 +2908,33 @@ es the i -nitial condition +mplicit parameter s for th @@ -3109,16 +3109,16 @@ %5Ba, b%5D%0A - @@ -3133,16 +3133,322 @@ eg = c%0A%0A + def initial_conditions(self):%0A %22%22%22%0A Returns the initial conditions of this model.%0A %22%22%22%0A return ...
4f7f4b53d00bf13360526c7b51b72ab862469e3d
Update `test_dcos_command` to work with new CoreOS
tests/acceptance/test_dcos_command.py
tests/acceptance/test_dcos_command.py
import json from shakedown import * def test_run_command(): exit_status, output = run_command(master_ip(), 'cat /etc/motd') assert exit_status assert output.startswith('Core') def test_run_command_on_master(): exit_status, output = run_command_on_master('uname -a') assert exit_status assert ...
Python
0
@@ -162,33 +162,26 @@ ert -output.startswith('Core') +'CoreOS' in output %0A%0Ade
6c8e0a41adf7d9edc075c60281d7273c09b98b65
write out json
Chess/build.py
Chess/build.py
#!/usr/bin/python import json import shutil import os base_dir = os.path.join(*os.path.split(__file__)[:-1]) images = base_dir + "/images" for image in os.listdir(images): # Strip off the .png name = image.split(".")[0] # The source picture source = os.path.join(images, image) # Check if the destination ...
Python
0.999998
@@ -1031,24 +1031,9 @@ # -TODO: actually c +C reat @@ -1054,27 +1054,63 @@ n%0A -print %22contents:%22, +f = open(target_dir + %22/Contents.json%22, %22w%22)%0A f.write( json @@ -1125,9 +1125,22 @@ ontents) +)%0A f.close() %0A
df50ddbb4a2c23ab1b9289e0cf9841a76b8c4298
Fix tests
test/test_coros.py
test/test_coros.py
import asyncio from unittest import mock from websockets import InvalidHandshake, InvalidURI, ConnectionClosed from wsstat.clients import WebsocketTestingClient class TestCoros(object): def setup(self): self.identifier = "00000000" self.client = self._wrap_client( WebsocketTestingCli...
Python
0.000003
@@ -534,36 +534,24 @@ ndshake(self -, event_loop ):%0A e @@ -1209,20 +1209,8 @@ self -, event_loop ):%0A
3e4f15e99f6503c0aac796e69ad7de28828d4ca1
Use more optimal compiler flags with icc.
specializers/stencil/stencil_kernel.py
specializers/stencil/stencil_kernel.py
"""The main driver, intercepts the kernel() call and invokes the other components. Stencil kernel classes are subclassed from the StencilKernel class defined here. At initialization time, the text of the kernel() method is parsed into a Python AST, then converted into a StencilModel by stencil_python_front_end. The ke...
Python
0
@@ -5682,16 +5682,112 @@ %22-fast%22 +, %22-restrict%22%5D%0A mod.backends%5B%22c++%22%5D.toolchain.cflags += %5B%22-fno-fnalias%22, %22-fno-alias%22 %5D%0A @@ -5935,16 +5935,204 @@ wrapv')%0A + mod.backends%5B%22c++%22%5D.toolchain.cflags.remove('-O2')%0A mod.backends%5B%22c+...
cddaa0a097ace8eaf671800727ca291112a64bce
Update test.py
cython/test.py
cython/test.py
#!/usr/bin/env python #-*- coding: utf-8 -*- __author__ = 'jc' from RedZone import * from RedZone import * context = Context({ "items": [ {"text": "Hello World!", "active": True}, {"text": "Foo", "active": True}, {"text": "Bar", "active": False} ], "numbers": { "first": 5,...
Python
0.000001
@@ -80,39 +80,16 @@ port *%0A%0A -from RedZone import *%0A%0A context
f6a044e95c1a1bdf69bb57730876c37b37f0cbe3
Add KeplerLIghtCurveFile class
pyke/lightcurve.py
pyke/lightcurve.py
import numpy as np __all__ = ['LightCurve'] class LightCurve(object): """ Implements a basic time-series class for a generic lightcurve. Parameters ---------- time : numpy array-like Time-line. flux : numpy array-like Data flux for every time point. """ def __init__(s...
Python
0
@@ -16,33 +16,86 @@ np%0A -%0A__all__ = %5B'LightCurve'%5D +from astropy.io import fits%0A%0A__all__ = %5B'LightCurve', 'KeplerLightCurveFile'%5D%0A %0A%0Acl @@ -373,32 +373,42 @@ self, time, flux +, flux_err ):%0A self. @@ -443,16 +443,49 @@ x = flux +%0A self.flux_err = flux_err %0A%0A de @@ -...
f0a20866fa6d85459b9e09a00d62f0e193edb497
Remove rogue print statement
insights/settings.py
insights/settings.py
import sys import os import yaml import pkgutil INSTALL_DIR = os.path.dirname(os.path.abspath(__file__)) print INSTALL_DIR NAME = "insights.yaml" DEFAULTS_NAME = "defaults.yaml" def load_and_read(path): if os.path.exists(path): with open(path) as fp: return fp.read() CONFIGS = [ pkgutil...
Python
0.031844
@@ -103,26 +103,8 @@ _))%0A -print INSTALL_DIR%0A NAME
71dc1590515473ff436aed020edf6291943e47cd
fix for Python 2.7
_unittests/ut_filehelper/test_compress_helper.py
_unittests/ut_filehelper/test_compress_helper.py
""" @brief test log(time=4s) """ import sys import os import unittest if "temp_" in os.path.abspath(__file__): raise ImportError( "this file should not be imported in that location: " + os.path.abspath(__file__)) try: import src except ImportError: path = os.path.normpath( os...
Python
0.000277
@@ -3332,32 +3332,90 @@ old, fLOG=fLOG)%0A +%0A if sys.version_info%5B0%5D == 2:%0A return%0A%0A self.ass
146ac65aeda9c07adfbb88fea896445dd5206110
Change the way the URL is formed in ttvplaylist_plugin taking the "Host" header into account.
plugins/ttvplaylist_plugin.py
plugins/ttvplaylist_plugin.py
''' Torrent-tv.ru Playlist Downloader Plugin http://ip:port/ttvplaylist ''' import re import logging import urllib2 import time from PluginInterface import AceProxyPlugin import ttvplaylist_config class Ttvplaylist(AceProxyPlugin): handlers = ('ttvplaylist', ) logger = logging.getLogger('plugin_ttvplaylist')...
Python
0
@@ -1934,25 +1934,24 @@ return%0A -%0A if Ttvpl @@ -1946,33 +1946,13 @@ -if Ttvplaylist.host:%0A + %0A @@ -1970,195 +1970,34 @@ t = -Ttvplaylist.host + ':' + str(connection.request.getsockname()%5B1%5D)%0A else:%0A hostport = connection.request.getsockname()%5B0%5D + ...
49fa606664f7fb28799678574b34328d2f16567e
use the queue config for message passing not cache
dino/server.py
dino/server.py
#!/usr/bin/env python # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
Python
0.000003
@@ -1499,20 +1499,12 @@ eys. -CACHE_SERVIC +QUEU E, d
04f6a7945fad765814086e167d44e2e67f81304c
Add kilo and liberty as ceilometer supported openstack skus Closes-Bug: #1539225
fabfile/utils/analytics.py
fabfile/utils/analytics.py
from fabfile.config import testbed from fabfile.utils.fabos import detect_ostype, get_openstack_sku from fabfile.utils.cluster import get_orchestrator def get_collector_syslog_port(): env_obj = getattr(testbed, 'env') rsyslog_dict = getattr(env_obj, 'rsyslog_params', None) if ((rsyslog_dict is not None) a...
Python
0
@@ -2255,306 +2255,70 @@ -# Currently supported only on ubuntu icehouse%0A os_type = detect_ostype()%0A openstack_sku = get_openstack_sku(use_install_repo)%0A if os_type in %5B'redhat'%5D and %5C%0A openstack_sku in %5B'juno'%5D:%0A return True%0A elif os_type in %5B'ubuntu'%5D and %...
6b8f6a2f5a2b7b10b31832ddad85e27c81e51eb9
Add 'section' to IRC colour stylesheet
DebianDevelChangesBot/utils/irc_colours.py
DebianDevelChangesBot/utils/irc_colours.py
# -*- coding: utf-8 -*- # # Debian Changes Bot # Copyright (C) 2008 Chris Lamb <chris@chris-lamb.co.uk> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the...
Python
0
@@ -1835,24 +1835,58 @@ ightred'%5D,%0A%0A + 'section': tags%5B'grey'%5D,%0A%0A 'url
81446dc8a98f2cac03de314c453e331f8c3fcd2e
update /prometheus/collectdexporter/start
kvmagent/kvmagent/plugins/prometheus.py
kvmagent/kvmagent/plugins/prometheus.py
from kvmagent import kvmagent from zstacklib.utils import jsonobject from zstacklib.utils import http from zstacklib.utils import log from zstacklib.utils.bash import * from zstacklib.utils import linux from zstacklib.utils import thread from jinja2 import Template import os.path import re import time import traceback ...
Python
0
@@ -3182,27 +3182,22 @@ ne(%5B -'collectd_exporter' +cmd.binaryPath %5D)%0A @@ -3330,33 +3330,140 @@ H), -'collectd_exporter +cmd.binaryPath + ' .log')%0A + ARGUMENTS = cmd.startupArguments%0A if not ARGUMENTS:%0A ARGUMENTS = %22%22%0A @@ -3569,39 +3569,21 @@ H%7D%7D ...
1fc357a5e9b793cb00696f4a3ea852012159fe4e
add STATIC_ROOT variable
score/settings/base.py
score/settings/base.py
import os import json from django.core.exceptions import ImproperlyConfigured BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # load settings file with secrets with open(os.path.join(BASE_DIR, "score", "settings", "local_settings.json")) as f: local_settings = json.loads...
Python
0.000002
@@ -2967,16 +2967,63 @@ files/%0A%0A +STATIC_ROOT = os.path.join(BASE_DIR, %22static%22)%0A STATIC_U
a75906c95892670edf4995ca6278e3a8c63de414
FIX multicompany usability on prod prod
account_multicompany_usability/models/product.py
account_multicompany_usability/models/product.py
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import api, fields, models # from ope...
Python
0
@@ -1204,34 +1204,1587 @@ del= -self._name, active_id=self +'product.template', active_id=self.id)%0A self.property_account_income_ids = company_props.with_context(%0A property_field='property_account_income')._get_companies()%0A self.property_account_expense_ids = company_props.with_context(%...
9cd99824b5e9bd7be0c5cc61974c49865c785dce
Update test_osx-gui_wallet.py
ci_scripts/test_osx-gui_wallet.py
ci_scripts/test_osx-gui_wallet.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import argparse import multiprocessing as mp import neblio_ci_libs as nci nci.setup_travis_or_gh_actions_env_vars() working_dir = os.getcwd() build_dir = "build" deploy_dir = os.path.join(os.environ['BUILD_DIR'],'deploy', '') parser = argparse.ArgumentParser()...
Python
0.000002
@@ -1853,99 +1853,8 @@ ce') -%0Anci.call_with_err_code('brew fetch --retry xquartz && brew install xquartz --force') %0A%0Anc @@ -2631,61 +2631,20 @@ rew -unlink xquartz && brew link --force --overwrite +cask install xqu
5ef8c450dcfb063b25de74d1ea49b9d880f8e58f
debug checkup
modules/logger_daemon.py
modules/logger_daemon.py
##Logger daemon version 1 from time import gmtime, strftime import os def logger_daemon ( self ): if os.path.exists(self.config["log-path"]) == True: if len(self.msg) >= 4: if "353" in self.msg or "366" in self.msg or "412" in self.msg: return else: brackets = self.config["TimestampBrackets"].spli...
Python
0.000001
@@ -719,16 +719,90 @@ %0A%09else:%0A +%09%09os.mkdir(self.config%5B%22log-path%22%5D)%0A%09%09if self.config%5B%22debug%22%5D == %22true%22:%0A%09 %09%09print( @@ -883,41 +883,8 @@ )%0A%09%09 -os.mkdir(self.config%5B%22log-path%22%5D) %0A%09%0A%09
63907e4411b4e0827c4f9d5b2153d663dbf83cdf
Fix typo in touch router
lg_mirror/src/lg_mirror/touch_router.py
lg_mirror/src/lg_mirror/touch_router.py
import evdev import re import rospy import threading from .constants import MIRROR_ACTIVITY_TYPE from .constants import MIRROR_TOUCH_CONFIG_KEY from lg_common.helpers import route_touch_to_viewports from lg_common.managed_window import ManagedWindow from lg_msg_defs.msg import RoutedEvdevEvents from lg_msg_defs.srv im...
Python
0.000013
@@ -5990,16 +5990,17 @@ elf.spac +e nav_mode
7836fe9f7d5e0f2d3188378e6cce23902fc92b10
Fix Rosenbrock tutorial
spotpy/examples/tutorial_rosenbrock.py
spotpy/examples/tutorial_rosenbrock.py
# -*- coding: utf-8 -*- ''' Copyright (c) 2018 by Tobias Houska This file is part of Statistical Parameter Optimization Tool for Python(SPOTPY). :author: Tobias Houska This file holds the example code from the Rosenbrock tutorial web-documention. ''' from __future__ import absolute_import from __future__ import divis...
Python
0.000001
@@ -2765,36 +2765,36 @@ , dbname='RosenD -REAM +EMCZ ', dbformat=dbfo @@ -3256,17 +3256,16 @@ he data%0A -# algorith @@ -3337,16 +3337,26 @@ fscabc', + 'demcz', 'dream'%5D @@ -3356,17 +3356,16 @@ dream'%5D%0A -# spotpy.a
c0e6327c8bc5b984969728c64f41648e355a14f2
add deploy step
ci_scripts/test_osx-gui_wallet.py
ci_scripts/test_osx-gui_wallet.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import multiprocessing as mp import neblio_ci_libs as nci working_dir = os.getcwd() build_dir = "build" nci.mkdir_p(build_dir) os.chdir(build_dir) nci.call_with_err_code('brew update') nci.call_with_err_code('brew outdated qt || brew upgrade qt') n...
Python
0
@@ -2310,16 +2310,191 @@ nt()))%0A%0A +nci.call_with_err_code('../contrib/macdeploy/macdeployqtplus neblio-Qt.app -add-qt-tr da,de,es,hu,ru,uk,zh_CN,zh_TW -dmg -fancy ../contrib/macdeploy/fancy.plist -verbose 3')%0A%0A print(%22%22
e348285392aac994c9c631a6c0664f287c1ee740
Fix move_in_date not sent to pycroft
sipa/model/pycroft/api.py
sipa/model/pycroft/api.py
import logging from datetime import date from functools import partial from typing import Callable, Tuple, Any import requests from requests import ConnectionError, HTTPError from sipa.backends.exceptions import InvalidConfiguration from .exc import PycroftBackendError logger = logging.getLogger(__name__) class P...
Python
0
@@ -3701,32 +3701,61 @@ word': password, + 'move_in_date': move_in_date %0A %7D%0A%0A
1f3a404b1e1fbd53d52d93ca83e8339147327f74
bump version to 0.5.0
cub/version.py
cub/version.py
version = '0.4.1'
Python
0.000001
@@ -10,9 +10,9 @@ '0. -4.1 +5.0 '%0A
20d28be2ca57687b6072f9cee043f5dcbe16b1e2
Add ability to parse package extras, like this: 'raven[flask]'
rparse.py
rparse.py
#!/usr/bin/env python # Copyright 2015, Dmitry Veselov from re import sub from plyplus import Grammar, STransformer, \ ParseError, TokenizeError try: # Python 2.x and pypy from itertools import imap as map from itertools import ifilter as filter except ImportError: # Python 3.x alrea...
Python
0.000018
@@ -368,17 +368,16 @@ rse%22%0A%5D%0A%0A -%0A grammar @@ -431,17 +431,23 @@ ame -vspec? ;%0A +extras? specs?; %0Anam @@ -459,21 +459,22 @@ tring ;%0A -v +%0A spec +s : compa @@ -603,16 +603,77 @@ ring ;%0A%0A +extras : '%5C%5B' (extra (',' extra)*)? '%5C%5D' ;%0Aextra : string ;%0A%0A @string @@ -755,191 +...
dc43f25c72f1f6779c8e9cc52605d6f99ba8a77a
Set Flask's debug=True.
server.py
server.py
import urllib from bson import json_util from flask import Flask, redirect, url_for, Response from flask import render_template from flask import request from pymongo import MongoClient from werkzeug.routing import NumberConverter db = MongoClient().test app = Flask(__name__, static_path='/zero-to-app/static') # A...
Python
0
@@ -2351,11 +2351,23 @@ 0.0.0.0' +, debug=True )%0A%0A
44e560a7167c2442577ebf834e61b52344b50294
fix broken enumerate_revisions call
tests/e2e/test_experiment_sampling.py
tests/e2e/test_experiment_sampling.py
import typing as tp import mock import plumbum as pb import pytest import benchbuild as bb from benchbuild import source, engine from benchbuild.environments.domain.declarative import ContainerImage from benchbuild.extensions.base import Extension from benchbuild.settings import CFG from benchbuild.source import Git,...
Python
0.00003
@@ -1088,23 +1088,15 @@ ons( -* prj_cls -.SOURCE )%5B:E
069e98f036c77f635a955ea2c48580709089e702
Set default values for `tags` and `availability`
src/conference_scheduler/resources.py
src/conference_scheduler/resources.py
from typing import NamedTuple, Sequence, Dict, Iterable, List from datetime import datetime class Slot(NamedTuple): venue: str starts_at: datetime duration: int capacity: int session: str class Event(NamedTuple): name: str duration: int demand: int tags: List[str] = [] unavai...
Python
0
@@ -211,16 +211,20 @@ %0A%0Aclass +Base Event(Na @@ -230,24 +230,24 @@ amedTuple):%0A - name: st @@ -301,16 +301,208 @@ ist%5Bstr%5D +%0A unavailability: List%0A%0A%0Aclass Event(BaseEvent):%0A%0A __slots__ = ()%0A%0A def __new__(cls, name, duration, demand, tags=None, unavailability=None):%0A ...
fb50512d74ac0c9af084adfb9cb8d9a72a13d614
Fix to jobtree status
src/jobTreeStatus.py
src/jobTreeStatus.py
#!/usr/bin/env python #Copyright (C) 2011 by Benedict Paten (benedictpaten@gmail.com) # #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 rig...
Python
0.002928
@@ -4732,32 +4732,131 @@ e, in jobFiles:%0A + if not colours.has_key(job.getColour()):%0A colours%5Bjob.getColour()%5D == 0%0A colo
cb51150abd54823b35b494e1cab033ab4faf7f83
work around for ADS lying about having PDFs
bibtools/fetchpdf.py
bibtools/fetchpdf.py
# -*- mode: python; coding: utf-8 -*- # Copyright 2014 Peter Williams <peter@newton.cx> # Licensed under the GNU General Public License, version 3 or higher. """ Downloading PDFs automagically. """ __all__ = ('try_fetch_pdf').split () from hashlib import sha1 from .util import * from . import webutil as wu def tr...
Python
0
@@ -1761,20 +1761,8 @@ -return None # AD @@ -1805,16 +1805,175 @@ e a lie. + Try again,%0A # ignoring it.%0A return try_fetch_pdf (proxy, destpath, arxiv=arxiv, bibcode=None,%0A doi=doi) %0A
4fc56d687ab3a40cf36043cce8f987bf48a9df0f
Add hooks for pre-process and cleanup to recognizer base class
ocradmin/plugins/nodes/base.py
ocradmin/plugins/nodes/base.py
""" Generic base classes for other nodes. """ from __future__ import absolute_import import os import codecs import json import subprocess as sp from nodetree import node, writable_node, exceptions import ocrolib from PIL import Image from .. import stages, types, utils class ExternalToolError(StandardError): ...
Python
0
@@ -2270,32 +2270,106 @@ plementedError%0A%0A + def cleanup(self):%0A pass%0A%0A def prepare(self):%0A pass%0A%0A def process( @@ -2506,32 +2506,55 @@ ata%0A %22%22%22%0A + self.prepare()%0A pageheig @@ -3456,32 +3456,55 @@ ines, numlines)%0A + self.cleanup()%0A...
647132c505cd13050d9f7b6c1953700702fc702d
Add php to the default COMPILERS
nikola/plugins/command/init.py
nikola/plugins/command/init.py
# -*- coding: utf-8 -*- # Copyright © 2012-2014 Roberto Alsina and others. # 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 t...
Python
0
@@ -2684,24 +2684,259 @@ ', '.htm'),%0A + # PHP files are rendered the usual way (i.e. with the full templates).%0A # The resulting files have .php extensions, making it possible to run%0A # them without reconfiguring your server to recognize them.%0A %22php%22: ('.php',),%0A # Pandoc
11e620f587bdbc81024e053125c8c00fd4aa9f0e
Update sfp_numverify.py
modules/sfp_numverify.py
modules/sfp_numverify.py
#------------------------------------------------------------------------------- # Name: sfp_numverify # Purpose: SpiderFoot plug-in to search numverify.com API for a phone number # and retrieve location and carrier information. # # Author: <bcoles@gmail.com> # # Created: 2019-05-25 # C...
Python
0.000002
@@ -2330,16 +2330,17 @@ ata.%5Cn%22, +%0A
6937797c8ff3cfddab82124a32b69874052fd993
handle ldap.SERVER_DOWN
server.py
server.py
#!/usr/bin/python2.7 import os import sys import ldap from subprocess import check_call, CalledProcessError from flask import Flask, send_from_directory, redirect, request from flask.ext.restful import Resource, Api from flask.ext.restful.reqparse import RequestParser from tornado.wsgi import WSGIContainer from tornad...
Python
0.000009
@@ -1611,32 +1611,138 @@ '%0A )%0A + except ldap.SERVER_DOWN:%0A return %7B 'message': 'Unable to connect to LDAP server'%7D, 400%0A except l
ac1bd603ad066eade7dc89ed2f40528e5c9139ca
make sure /proc isn't a symlink to itself
platform/debian/clean_fakechroot.py
platform/debian/clean_fakechroot.py
#!/usr/bin/env python3 """cleans up any symbolic links pointing with absolute paths to the build directory itself""" import os import sys if len(sys.argv) != 2: print("usage:", sys.argv[0], "<ROOTFS>", file=sys.stderr) sys.exit(1) rootfs = os.path.abspath(sys.argv[1]) for root, dirs, files in os.walk(rootfs)...
Python
0.000003
@@ -780,12 +780,350 @@ rel), path)%0A +%0A# We have a Jenkins-only bug where /proc is a symlink to itself in the flannel%0A# container, which breaks a lot of things. We don't know why, exactly, this is%0A# happening -- but we need to mitigate it.%0Aif os.path.islink(os.path.join(rootfs, %22proc%22)):%0A os.unlink(o...
5d8902f3e34f3f869c25acda5b527f32cdf4e37e
Append the initially selected extension to the file name
plugins/LocalFileOutputDevice/LocalFileOutputDevicePlugin.py
plugins/LocalFileOutputDevice/LocalFileOutputDevicePlugin.py
# Copyright (c) 2015 Ultimaker B.V. # Uranium is released under the terms of the AGPLv3 or higher. import os.path import sys from PyQt5.QtCore import QUrl from PyQt5.QtGui import QDesktopServices from PyQt5.QtWidgets import QFileDialog, QMessageBox from UM.Application import Application from UM.Preferences import Pr...
Python
0
@@ -2840,16 +2840,69 @@ e_filter +%0A file_name += %22.%22 + item%5B%22extension%22%5D %0A%0A
f918ad734d6ac9edf176f3c4b596da8e551db7cb
support different scaling for each axis
script/convert_mesh.py
script/convert_mesh.py
#!/usr/bin/env python import sys sys.path.append('.') from optparse import OptionParser import numpy as nm from sfepy.fem import Mesh usage = """%prog [options] filename_in filename_out Convert a mesh file from one SfePy-supported format to another. """ help = { 'scale' : 'scale factor [default: %default]', } ...
Python
0.000001
@@ -246,16 +246,203 @@ another. +%0A%0AExamples:%0A%0A$script/convert_mesh.py database/simple.mesh new.vtk%0A$script/convert_mesh.py database/simple.mesh new.vtk -s2.5%0A$script/convert_mesh.py database/simple.mesh new.vtk -s0.5,2,1 %0A%22%22%22%0A%0Ahe @@ -594,18 +594,8 @@ le%22, - type=int, met @@ -831,16 +831,2...
c42b3f733c43f06050d59fc85ba6c9756ba2488d
bump version 0 0.3.0
Starfish/__init__.py
Starfish/__init__.py
# We first need to detect if we're being called as part of the setup # procedure itself in a reliable manner. try: __STARFISH_SETUP__ except NameError: __STARFISH_SETUP__ = False __version__ = "0.3.0-dev" if not __STARFISH_SETUP__: from .spectrum import Spectrum __all__ = [ "constants", ...
Python
0.000002
@@ -205,12 +205,8 @@ .3.0 --dev %22%0A%0Ai
49a18f4d9136d8c0376930f12048fc0f2a9c06f3
support length limit in hexdump
pyroute2/common.py
pyroute2/common.py
""" Common utilities """ import struct ## # General purpose # def map_namespace(prefix, ns): """ Take the namespace prefix, list all constants and build two dictionaries -- straight and reverse mappings. E.g.: ## neighbor attributes NDA_UNSPEC = 0 NDA_DST = 1 NDA_LLADDR = 2 NDA_CACHE...
Python
0.000001
@@ -818,16 +818,26 @@ (payload +, length=0 ):%0A %22 @@ -950,17 +950,57 @@ (c)) - for c in +%0A for c in payload%5B:length%5D or pay
0c9bd63b1726deb067a721b7a6be1872538d273c
Add pydoc for BaseSensor
st2reactor/st2reactor/sensor/base.py
st2reactor/st2reactor/sensor/base.py
import abc import six import eventlet __all__ = [ 'Sensor', 'PollingSensor' ] @six.add_metaclass(abc.ABCMeta) class BaseSensor(object): """ Base Sensor class - not to be instantiated directly. """ def __init__(self, sensor_service, config=None): self._sensor_service = sensor_service...
Python
0
@@ -268,16 +268,267 @@ =None):%0A + %22%22%22%0A :param sensor_service: Sensor Service instance.%0A :type sensor_service: :class:%60%60st2reactor.container.sensor_wrapper.SensorService%60%60%0A%0A :keyword config: Sensor config.%0A :type config: %60%60dict%60%60 or None%0A %22...
eee8cdc8d5602fd111552c433d04e261c9781384
fix searchpath
ngage/cli.py
ngage/cli.py
from __future__ import absolute_import from __future__ import print_function import click import getpass import logging import os import sys import ngage from ngage.config import Config from ngage.exceptions import AuthenticationError import munge.click def connect(kwargs): try: # get connect specific o...
Python
0.000003
@@ -127,19 +127,8 @@ t os -%0Aimport sys %0A%0Aim @@ -142,40 +142,8 @@ age%0A -from ngage.config import Config%0A from @@ -1792,29 +1792,16 @@ ins%0A -ngage.plugin. searchpa @@ -1843,21 +1843,127 @@ th'%5D - + %5Bctx.home%5D +%0A if ctx.home:%0A searchpath.append(os.path.join(ctx.home, 'plugins'))%...
bd59fa8b3446e3c84fcf068df86580f14aedcbbd
Update PR description on event
server.py
server.py
import simplejson import logging import sys import re import os import tornado.httpserver import tornado.ioloop import tornado.web import tornado.template from jenkinsapi.jenkins import Jenkins from corgi import Corgi from logging import StreamHandler from logging.handlers import WatchedFileHandler log = logging.g...
Python
0
@@ -213,16 +213,57 @@ rt Corgi +%0Afrom corgit import update_pr_description %0A%0Afrom l @@ -1392,24 +1392,174 @@ failed%22)%0A%0A%0A +def update_pull_request(data):%0A update_pr_description(data%5B'repository'%5D%5B'full_name'%5D,%0A data%5B'pull_request'%5D%5B'number'%5D)%0A%0A%0A def...
bfaacc5750127fcc41137bcefc1fe715d0315064
Update to mongo_import_geonames.py
mongo_import_geonames.py
mongo_import_geonames.py
""" Imports all the geonames in the CSV at file_path into the given Mongo collection. I'm using Mongo to import geonames because it is too big to fit in memory (even on a machine with over 4GB of available ram), and the $in operator provides a fast way to search for all the ngrams in a document. Geonames data is...
Python
0
@@ -419,22 +419,39 @@ sv%0D%0A +from pymongo import -pym +M ongo +Client %0D%0Aim @@ -2313,47 +2313,61 @@ -db = pymongo.Connection(args.mongo_url) +client = MongoClient(args.mongo_url)%0D%0A db = client %5Barg