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
0d609e1639ca9bf4a08e6cf765e17ad5d6e36bda
Update path in ProvisioningTest.py
resource/csdk/security/provisioning/sample/provisioningTest.py
resource/csdk/security/provisioning/sample/provisioningTest.py
#!/usr/bin/python -W import subprocess import os import time import sys import shutil import platform import argparse import textwrap # Note: to see the return value of a process # - in Windows type: echo %errorlevel% # - in Linux type: echo $? # Resets the state of sampleserver_justworks and autoprovisi...
Python
0
@@ -1690,32 +1690,39 @@ %5C%5Cout%5C%5Cwindows%5C%5C +win32%5C%5C amd64%5C%5Cdebug%5C%5Cre @@ -1770,16 +1770,23 @@ indows%5C%5C +win32%5C%5C amd64%5C%5Cd @@ -2607,28 +2607,33 @@ ws':%0A os_ -name +directory = 'windows' @@ -2631,16 +2631,22 @@ 'windows +%5Cwin32 '%0Aelif o @@ -2671,20 +2671,25 @@ %0A os_...
e34d437fb9ede1c5a547bbabe99978207e2a389b
Make paths manipulation stuff private
sugar/env.py
sugar/env.py
import os import sys import pwd try: from sugar.__uninstalled__ import * except ImportError: from sugar.__installed__ import * import sugar.setup def add_to_python_path(path): sys.path.insert(0, path) if os.environ.has_key('PYTHONPATH'): old_path = os.environ['PYTHONPATH'] os.environ['PYTHONPATH'] = path + '...
Python
0
@@ -152,34 +152,50 @@ def -add_to_python_path( +setup():%0A%09for path in sugar_python_ path -) :%0A +%09 %09sys @@ -216,16 +216,17 @@ , path)%0A +%09 %09if os.e @@ -247,32 +247,33 @@ ('PYTHONPATH'):%0A +%09 %09%09old_path = os. @@ -288,32 +288,33 @@ 'PYTHONPATH'%5D%0A%09%09 +%09 os.environ%5B'PYTH @@ -347,2...
0e2d9b496ab12d512e56041d9f4ffbadf7fab4ab
Remove unused method
sugar/env.py
sugar/env.py
# Copyright (C) 2006, Red Hat, Inc. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distrib...
Python
0.000006
@@ -1789,319 +1789,4 @@ ' %5D%0A -%0A_dbus_version = None%0Adef get_dbus_version():%0A%09global _dbus_version%0A%09if _dbus_version == None:%0A%09%09f = os.popen('dbus-daemon --version')%0A%09%09version_line = f.readline()%0A%09%09if version_line:%0A%09%09%09splitted_line = version_line.split()%0A%09%09%09_dbus_versio...
40afa5ccedd4181a01a7ffc85c39c11a1561e7b6
Drop memo comment
devito/core/gpu_openacc.py
devito/core/gpu_openacc.py
from functools import partial import cgen as c from devito.core.gpu_openmp import (DeviceOpenMPNoopOperator, DeviceOpenMPIteration, DeviceOmpizer, DeviceOpenMPDataManager) from devito.exceptions import InvalidOperator from devito.logger import warning from devito.passes.iet import ...
Python
0.000001
@@ -1023,124 +1023,8 @@ )),%0A - # 'map-enter-alloc': lambda i, j:%0A # c.Pragma('omp target enter data map(alloc: %25s%25s)' %25 (i, j)),%0A
29b0f18a3b7dcc6e0123889c1c845d7511677c96
fix indentation
squad/run.py
squad/run.py
import os import sys from squad.version import __version__ from squad.manage import main as manage __usage__ = """usage: squad [OPTIONS] Options: -f, --fast Fast startup: skip potentially slow operations, such as running database migrations and compiling static assets -h, --he...
Python
0.000096
@@ -143,16 +143,18 @@ tions:%0A%0A + -f, -- @@ -167,18 +167,16 @@ - Fast sta @@ -303,16 +303,18 @@ assets%0A + -h, -- @@ -323,26 +323,24 @@ lp - show this he @@ -359,16 +359,18 @@ nd exit%0A + -v, -- @@ -379,26 +379,24 @@ rsion - show program @@ -423,16 +423,18 @...
5fe859230c5a07825e27c38c0a16de4ff9e18456
Return the decorated function.
kazoo/recipe/watchers.py
kazoo/recipe/watchers.py
"""Child and Data watching higher level API's """ import logging from kazoo.client import KazooState log = logging.getLogger(__name__) class DataWatch(object): """Watches a node for data updates and calls the specified function each time it changes The function will also be called the very first time ...
Python
0.001501
@@ -2696,32 +2696,52 @@ self._get_data() +%0A return func %0A%0A def _get_d @@ -6411,32 +6411,52 @@ ._get_children() +%0A return func %0A%0A def _get_c
0e0096e664997ffa935273ba66b46a1e943a685a
add json support to dump_lol
python/tools/dump_lol.py
python/tools/dump_lol.py
#!/usr/bin/python import argparse from l20n.format.lol.parser import Parser import pyast def read_file(filename, charset='utf-8', errors='strict'): with open(filename, 'rb') as f: return f.read().decode(charset, errors) def dump_lol(path): source = read_file(path) p = Parser() lol = p.parse(...
Python
0.000001
@@ -83,16 +83,42 @@ rt pyast +.dump.raw, pyast.dump.json %0A%0Adef re @@ -272,16 +272,19 @@ lol(path +, t ):%0A s @@ -358,19 +358,102 @@ -print(pyast +if t == 'raw':%0A print(pyast.dump.raw.dump(lol))%0A else:%0A print(pyast.dump.json .dum @@ -682,16 +682,227 @@ file')%0A + parser.ad...
9e7137c241684d450e8ec62fc365fd21bd20b38d
Fix gunicorn socket path
docker/usr/local/etc/gunicorn/pixel.py
docker/usr/local/etc/gunicorn/pixel.py
# Gunicorn-django settings bind = ['unix:/app/run/gunicorn.sock'] graceful_timeout = 90 loglevel = 'error' name = 'pixel' python_path = '/app/pixel' timeout = 90 workers = 3
Python
0.000001
@@ -39,16 +39,22 @@ ix:/app/ +pixel/ run/guni
2934b9d8de31c65fcc19bceacd16070856ca51b7
Remove unused import of mock.
analog/tests/test_formats.py
analog/tests/test_formats.py
"""Test the analog.formats module.""" from __future__ import (absolute_import, division, print_function, unicode_literals) import datetime try: from unittest import mock except ImportError: import mock import pytest from analog.exceptions import InvalidFormatExpressionError from analog...
Python
0
@@ -159,79 +159,8 @@ time -%0Atry:%0A from unittest import mock%0Aexcept ImportError:%0A import mock %0A%0Aim
d288a9c2433a3771e163700b44c51124da3ec338
Fix date value from last modified to created.
post.py
post.py
# -*- coding: utf-8 -*- import codecs import re import subprocess import markdown from jinja2 import Markup class Post: _pattern = r"\[\[(.*)\|(.*)\]\]|\[\[(.*)\]\]" def __init__(self, post_id, working_dir=None): self.post_id = post_id self.title = post_id.replace('-', ' ') filename ...
Python
0
@@ -811,16 +811,32 @@ git log +--diff-filter=A --date=i
343973ded2d15bbb9a0c2385db1e9fbd9bda2363
Fix return value of send() on Python 2
pexpect/popen_spawn.py
pexpect/popen_spawn.py
"""Spawn interface using subprocess.Popen """ import os import threading import subprocess import sys import time import signal import shlex try: from queue import Queue, Empty # Python 3 except ImportError: from Queue import Queue, Empty # Python 2 from .spawnbase import SpawnBase, PY3 from .exceptions imp...
Python
0.000941
@@ -3556,17 +3556,16 @@ def -_ send(sel @@ -3563,32 +3563,171 @@ send(self, s):%0A + s = self._coerce_send_string(s)%0A self._log(s, 'send')%0A%0A b = self._encoder.encode(s, final=False)%0A if PY3:%0A return s @@ -3751,83 +3751,186 @@ ite( -s)%0A%0A def send(self, ...
8bbead8f6414a41579086a97a6cb4ac52fab2a39
fix a typo in a table config
twirl.py
twirl.py
#!/usr/bin/env python # Tai Sakuma <sakuma@cern.ch> import os, sys import argparse import ROOT import AlphaTwirl import Framework import Scribbler ROOT.gROOT.SetBatch(1) ##__________________________________________________________________|| parser = argparse.ArgumentParser() parser.add_argument("-i", "--input", hel...
Python
0.00129
@@ -2448,17 +2448,19 @@ ces = (' -* +(*) ', '%5C%5C0'
9f45f8e59d08b1276be7bdc3d4c88cf616ad581a
add fix for header without GN or PE in sprot
src/sprot.py
src/sprot.py
#!/usr/bin/env python import sys from src.annotation import Annotation #this functions takes an ipr file and returns a list of annotations. 2 types of annotations are retrieved based on the following keys: "name" and "product" def read_sprot(blast_file, gff_file, fasta_file): #retrieve relevant information from fi...
Python
0
@@ -2323,18 +2323,19 @@ == -1) -or +and (i+1 %3C
b829a4b8e53dc84703e03aba662b21cf1faa0a29
Update annual_emissions.py
cea/plots/optimization/annual_emissions.py
cea/plots/optimization/annual_emissions.py
from __future__ import division from __future__ import print_function import plotly.graph_objs as go import cea.plots.optimization from cea.plots.variable_naming import NAMING, COLOR __author__ = "Daren Thomas" __copyright__ = "Copyright 2019, Architecture and Building Systems - ETH Zurich" __credits__ = ["Jimeno A....
Python
0
@@ -1856,16 +1856,23 @@ formance +_pareto ()%0A
4d1a33462e73111f2507c4fd1e990af2952ad3df
Fix serializer tests
demo/tests/serializers/tests_validations.py
demo/tests/serializers/tests_validations.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase from formidable.models import Formidable from formidable.serializers.validation import ( MinLengthSerializer, RegexpSerializer, ValidationSerializer ) class ValidationSerializerTest(TestCase): def setUp(se...
Python
0.000003
@@ -295,16 +295,34 @@ stCase): +%0A increment = 0 %0A%0A de @@ -340,62 +340,8 @@ f):%0A - super(ValidationSerializerTest, self).setUp()%0A @@ -451,20 +451,54 @@ self. -text +increment += 1%0A self.text_field = self. @@ -544,16 +544,28 @@ ='text', +%0A slug='i @@ -573,18 ...
74a9cfe1206e3314890af165e5c8193c687844a0
Add files via upload
post.py
post.py
# -*- coding: utf-8 -*- """ Created on Mon Sep 4 16:23:07 2017 @author: mojod """ import random import tweepy consumer_key='L3MsyCOoqgSPc4jzZV8wero0d' consumer_secret='ZCOI3x1f8GZ9c2cJ8kPYyyBW4gRX4MJBbyHijGE1UObnAow6ka' access_token='3789452353-dmM75KVaDGqIPz6ZtzP8b5Q6VkvzQQo9Sn34ZOZ' access_token_s...
Python
0
@@ -89,9 +89,8 @@ %0D%0A%0D%0A -%09 %0D%0Aim @@ -116,16 +116,29 @@ tweepy%0D +%0Aimport time%0D %0A%0D%0Aconsu @@ -551,16 +551,33 @@ .txt%22)%0D%0A +while True:%0D%0A sentence @@ -600,16 +600,20 @@ t('.')%0D%0A + status = @@ -648,27 +648,12 @@ .%22%0D%0A -%0D%0Aprint(status)%0D%0A%0D%0A + api. @@...
f922671cf3f29ea55ac9077fd3579da5a7504f25
Add typecheck to SigmodCrossEntropy
chainer/functions/sigmoid_cross_entropy.py
chainer/functions/sigmoid_cross_entropy.py
import numpy from chainer import cuda from chainer import function from chainer.functions import sigmoid class SigmoidCrossEntropy(function.Function): """Sigmoid activation followed by a sigmoid cross entropy loss.""" def __init__(self, use_cudnn=True): self.use_cudnn = use_cudnn def forward_c...
Python
0
@@ -99,16 +99,53 @@ sigmoid%0A +from chainer.utils import type_check%0A %0A%0Aclass @@ -333,16 +333,306 @@ _cudnn%0A%0A + def check_type_forward(self, in_types):%0A type_check.expect(in_types.size() == 2)%0A%0A x_type, t_type = in_types%0A type_check.expect(%0A x_type.dtype == num...
85d2c012bfaeeb04fa8dd31cd05a04a8dc43c14e
Add tests that have and get of nonterms raise exceptions
tests/grammar_term-nonterm_test/NonterminalsInvalidTest.py
tests/grammar_term-nonterm_test/NonterminalsInvalidTest.py
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """ from unittest import TestCase, main from grammpy.RawGrammar import RawGrammar class NonterminalsInvalidTest(TestCase): pass if __name__ == '__main__': main()
Python
0
@@ -195,68 +195,1579 @@ mmar -%0D%0A%0D%0A%0D%0Aclass NonterminalsInvalidTest(TestCase):%0D%0A pass%0D%0A%0D%0A + as Grammar%0D%0Afrom grammpy import Nonterminal%0D%0Afrom grammpy.exceptions import NotNonterminalException%0D%0A%0D%0A%0D%0Aclass TempClass(Nonterminal):%0D%0A pass%0D%0A%0D%0A%0D%0Aclass Nontermina...
25737b0d0389d0ccbd12d01f9076a889891f0a22
Update XENIFACE and XENVIF
manifestspecific.py
manifestspecific.py
# Copyright (c) Citrix Systems 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 c...
Python
0
@@ -1621,17 +1621,17 @@ IF.git/1 -6 +8 /artifac @@ -1835,9 +1835,9 @@ git/ -5 +7 /art
b6a09c80d349adc91e2a05de8864b75bcb4b71dc
Put whqled xenvif #56 into trunk
manifestspecific.py
manifestspecific.py
# Copyright (c) Citrix Systems 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 c...
Python
0
@@ -1675,16 +1675,21 @@ nvif.git +.whql %5C56%5Cxenv @@ -1690,16 +1690,25 @@ 6%5Cxenvif +-7-2-0-56 .tar',%0D%0A @@ -2038,11 +2038,10 @@ d = -Fals +Tru e%0D%0A
5d749f1d3e69ce233bd5ac81b39e535c0d02a954
Move back to last merged tools versions, to overcome buildnumber issue
manifestspecific.py
manifestspecific.py
# Copyright (c) Citrix Systems 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 c...
Python
0
@@ -1521,10 +1521,10 @@ git/ -35 +18 /art @@ -1624,10 +1624,10 @@ git/ -37 +24 /art @@ -1720,25 +1720,25 @@ XENNET.git/1 -4 +2 /artifact/xe @@ -1933,26 +1933,25 @@ /XENVBD.git/ -18 +9 /artifact/xe
bd3d60cdfbc4cb8ed7810eb433b7ccb8f802f235
Move post.py to the new wiki helper.
post.py
post.py
#!/usr/bin/python # Read irc logs from our private channel and post them to our wiki import json import os import re import sys import textwrap from simplemediawiki import MediaWiki with open(os.path.expanduser('~/.mediawiki'), 'r') as f: conf = json.loads(f.read()) wiki = MediaWiki(conf['url']) day_re = re....
Python
0
@@ -143,43 +143,16 @@ rap%0A -%0Afrom simplemediawiki import -MediaW +w iki%0A @@ -247,39 +247,8 @@ ))%0A%0A -wiki = MediaWiki(conf%5B'url'%5D)%0A%0A day_ @@ -333,1084 +333,101 @@ ')%0A%0A -days = %5B%5D%0A%0A%0Adef make_wiki_login_call(packet):%0A packet.update(%7B'lgname': conf%5B'username'%5D,%0A ...
516c18a74f1b606b03ab07091cb0004e75c0a49b
Fix kate plugin
kate_plugin.py
kate_plugin.py
""" isort/kate_plugin.py Provides a simple kate plugin that enables the use of isort to sort Python imports in the currently open kate file. Copyright (C) 2013 Timothy Edmund Crosley This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Pu...
Python
0
@@ -927,16 +927,46 @@ A.%0A%22%22%22%0A%0A +from isort import SortImports%0A from PyK @@ -1017,38 +1017,8 @@ ate%0A -from isort import SortImports%0A %0A%0A@k
ea251f4c40119108f7969af945caf6da7c11c7f7
read binary
kitchensink/rpc/views.py
kitchensink/rpc/views.py
import logging from os.path import exists import traceback from flask import request, current_app, jsonify, send_file from rq.job import Status from .app import rpcblueprint from ..serialization import pack_result, pack_results from .. import settings logger = logging.getLogger(__name__) # we assume that you set rp...
Python
0.999982
@@ -2867,16 +2867,17 @@ path, %22r +b %22) as f:
f2dfbfbee1cd87f2e6f499b78eae1a8ca39dd529
create a category form
qanda/qanda_app/forms.py
qanda/qanda_app/forms.py
from django.forms import ModelForm, Textarea, TextInput, Select from models import Question, Answer, Reply from django import forms from django.conf import settings from django.utils.translation import ugettext as _ class QuestionForm(ModelForm): def __init__(self, *args, **kwargs): super(QuestionForm, self).__ini...
Python
0.000911
@@ -99,16 +99,26 @@ r, Reply +, Category %0Afrom dj @@ -1000,16 +1000,313 @@ nda'))%0A%0A +class CategoryForm(ModelForm):%0A%09class Meta:%0A%09%09model = Category%0A%09%09fields = ('name', 'about', )%0A%09%09widgets = %7B%0A%09%09%09'name' : TextInput(attrs=%7B'size': 180, 'class':'span6', 'id':'addCategoryName',%...
5d69fa2a169274c65bfd047199a2df9c88f188e3
use the taggit widget in question form
qanda/qanda_app/forms.py
qanda/qanda_app/forms.py
from django.forms import ModelForm, Textarea, TextInput, Select from models import Question, Answer, Reply from django import forms class QuestionForm(ModelForm): def __init__(self, *args, **kwargs): super(QuestionForm, self).__init__(*args, **kwargs) self.fields['category'].required = False class Meta: mode...
Python
0.000001
@@ -574,16 +574,18 @@ '%7D),%0A%09%09%09 +# 'tags':
174a374a685829ede49236f820122b442b9ec920
Fix taichi_dynamic example (#4767)
python/taichi/examples/features/sparse/taichi_dynamic.py
python/taichi/examples/features/sparse/taichi_dynamic.py
import taichi as ti x = ti.field(ti.i32) l = ti.field(ti.i32) n = 16 ti.init() ti.root.dense(ti.i, n).dynamic(ti.j, n).place(x) ti.root.dense(ti.i, n).place(l) @ti.kernel def make_lists(): for i in range(n): for j in range(i): ti.append(x.parent(), i, j * j) l[i] = ti.length(x.paren...
Python
0
@@ -14,16 +14,27 @@ as ti%0A%0A +ti.init()%0A%0A x = ti.f @@ -75,27 +75,16 @@ n = 16%0A%0A -ti.init()%0A%0A ti.root.
d57161b9449faa1218e4dab55fe4b2bd6f0c3436
Remove unused code and get rid of flake8 errors
utils.py
utils.py
import json import os import time import uuid from google.appengine.api import urlfetch from models import Profile def getUserId(user, id_type="email"): if id_type == "email": return user.email() if id_type == "oauth": """A workaround implementation for getting userid.""" auth = os.ge...
Python
0
@@ -30,20 +30,8 @@ time -%0Aimport uuid %0A%0Afr @@ -74,34 +74,8 @@ tch%0A -from models import Profile %0A%0Ade @@ -1104,435 +1104,4 @@ '')%0A -%0A if id_type == %22custom%22:%0A # implement your own user_id creation and getting algorythm%0A # this is just a sample that queries datastore for an ex...
a4ff022e9cbacca75febfcb3eaceea462078b721
bump the default timeout..
pssh.py
pssh.py
#!/usr/bin/env kpython # Parallel SSH to a list of nodes, returned from search-ec2-tags.py # (must be in your path). # # Waits for nodes to respond, then outputs their stdout,stderr color coded. # # ./pssh.py --query 'ec2_tag' 'command_to_run' # # Options: # -h, --help show this help message and exit # --qu...
Python
0
@@ -2552,9 +2552,10 @@ ult= -6 +12 0)%0A
f6d7707abcd80524857386d96495cc79795cd5d5
use htmlparser to get a word meaning in yahoo dictionary
ydict.py
ydict.py
import urllib.request from html.parser import HTMLParser class DictParser(HTMLParser): # def __init__(self): # super.__init__() def handle_starttag(self, tag, attrs): print("Encountered a start tag:", tag) def handle_endtag(self, tag): print("Encountered an end tag :", tag) def ...
Python
0.000006
@@ -84,18 +84,16 @@ er):%0A - # def __i @@ -108,18 +108,16 @@ lf):%0A - # sup @@ -118,16 +118,18 @@ super +() .__init_ @@ -140,255 +140,1939 @@ -def handle_starttag(self, tag, attrs):%0A print(%22Encountered a start tag:%22, tag)%0A def handle_endtag(self, tag):%0A print(%22E...
0545539a6d3df83af57f973a82cff2961cbe32ec
Test db login
km3pipe/tests/test_db.py
km3pipe/tests/test_db.py
# coding=utf-8 # Filename: test_core.py # pylint: disable=C0111,E1003,R0904,C0103,R0201,C0102 from __future__ import division, absolute_import, print_function from km3pipe.testing import TestCase from km3pipe.db import DOMContainer __author__ = "Tamas Gal" __copyright__ = "Copyright 2016, Tamas Gal and the KM3NeT co...
Python
0.000001
@@ -189,16 +189,27 @@ TestCase +, MagicMock %0A%0Afrom k @@ -226,27 +226,73 @@ import D -OMContainer +BManager, DOMContainer%0Afrom km3pipe.logger import logging %0A%0A__auth @@ -507,17 +507,16 @@ pment%22%0A%0A -%0A DET_ID = @@ -830,16 +830,47 @@ id2'%7D%5D%0A%0A +log = logging.getLogger('db')%0A%0A %0Aclass T...
2dd94619f75b05746293fa87eaed73fc52a5ba71
return all schedules from worker method and trim the list from the main method. also improve logging as a result
classtime/scheduling/schedule_generator.py
classtime/scheduling/schedule_generator.py
import multiprocessing from angular_flask.logging import logging logging = logging.getLogger(__name__) # pylint: disable=C0103 import classtime import heapq from .schedule import Schedule CANDIDATE_POOL_SIZE = 120 """Number of schedules to keep in consideration at any one time""" WORKERS = 16 """Maximum number of...
Python
0.000002
@@ -1396,31 +1396,8 @@ imes -,%0A num_requested )%0A @@ -1556,16 +1556,19 @@ rning %7B%7D +/%7B%7D schedul @@ -1613,23 +1613,83 @@ -len(schedules), +min(num_requested, len(schedules)),%0A len(schedules),%0A sch @@ -1723,16 +1723,32 @@ chedules +%5B:num_requested%5D %0A%0Ade...
bd23202dca2ac26c324aa036d9b9b95092cc43b8
fix joined options parsing.
wa/framework/entrypoint.py
wa/framework/entrypoint.py
# Copyright 2013-2015 ARM Limited # # 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.000005
@@ -1491,16 +1491,610 @@ mands%0A%0A%0A +# ArgumentParser.parse_known_args() does not correctly deal with concatenated%0A# single character options. See https://bugs.python.org/issue16142 for the%0A# description of the issue (with a fix attached since 2013!). To get around%0A# this problem, this will pre-process sys.a...
685db5867dcb86e462e46a923b154e09e5f64d20
fix aux refresh queue
queue_pub_refresh_aux.py
queue_pub_refresh_aux.py
import argparse import logging import os from time import sleep from time import time from sqlalchemy import orm, text from app import db from app import logger from queue_main import DbQueue from util import elapsed from util import safe_commit from pub import Pub # foul magic import endpoint # magic import pmh_rec...
Python
0
@@ -2250,16 +2250,62 @@ y desc,%0A + finished asc nulls first,%0A
ffbc39b4eeb4a3e4850f83faa13c1ddf616d2328
Add mail to administrators
tools/wcloud/wcloud/utils.py
tools/wcloud/wcloud/utils.py
import sys import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart DEFAULT_EMAIL_HOST = 'mail.deusto.es' EMAILS_SENT = [] def send_email(app, body_text, subject, from_email, to_email, body_html=None): email_host = app.config.get('EMAIL_HOST', DEFAULT_EMAIL_HOST) i...
Python
0.000001
@@ -308,16 +308,90 @@ _HOST)%0A%0A + if isinstance(to_email, basestring):%0A to_email = %5B to_email %5D%0A%0A if a @@ -822,24 +822,34 @@ 'To'%5D = +', '.join( to_email %0A%0A @@ -840,16 +840,17 @@ to_email +) %0A%0A @@ -1035,16 +1035,187 @@ part2)%0A%0A + total_to_email = %5B%...
c42882f0a8d8cec154d0ad247332f961c1585170
Fix `ValueError: The 'file' attribute has no file associated with it.`
wagtail/wagtaildocs/views/documents.py
wagtail/wagtaildocs/views/documents.py
from django.shortcuts import render, redirect, get_object_or_404 from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.contrib.auth.decorators import permission_required from django.core.exceptions import PermissionDenied from django.utils.translation import ugettext as _ from django.view...
Python
0.999991
@@ -4930,24 +4930,123 @@ -# Get file size%0A +filesize = None%0A%0A # Get file size when there is a file associated with the Document object%0A if doc.file:%0A @@ -5042,32 +5042,36 @@ e:%0A try:%0A + filesize @@ -5087,24 +5087,28 @@ le.size%0A + + except OSErr @@ -51...
abf3758d86c1ee37e458d79e62be69e4c23e515c
switch from single quote to double quote
wqflask/tests/wqflask/show_trait/test_export_trait_data.py
wqflask/tests/wqflask/show_trait/test_export_trait_data.py
import unittest from wqflask.show_trait.export_trait_data import dict_to_sorted_list from wqflask.show_trait.export_trait_data import cmp_samples class TestExportTraits(unittest.TestCase): """Test methods related to converting dict to sortedlist""" def test_dict_to_sortedlist(self): '''test for conve...
Python
0
@@ -288,35 +288,35 @@ (self):%0A -''' +%22%22%22 test for convers @@ -341,19 +341,19 @@ ted list -''' +%22%22%22 %0A @@ -1015,27 +1015,27 @@ m))%0A -''' +%22%22%22 test that th @@ -1072,19 +1072,19 @@ the keys -''' +%22%22%22 %0A @@ -1193,19 +1193,19 @@ -''' +%22%22%22 t...
3781478aa4c43165b277f77dfe918bbedfd94116
Add Traditional Chinese Translation (#9669)
warehouse/i18n/__init__.py
warehouse/i18n/__init__.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 the Li...
Python
0
@@ -1131,24 +1131,66 @@ ied Chinese%0A + %22zh_Hant%22, # Traditional Chinese%0A %22ru%22
b512c4340568ac1ac5a9fdba3dfd3c9cda84a9e8
Add path_exists() and assertions
utils.py
utils.py
import os from tqdm import tqdm import requests import numpy as np import lasagne from cv2 import resize import cv2 from scipy.misc import imsave def create_dir_if_not_exists(directory): if not os.path.exists(directory): os.makedirs(directory) def download_if_not_exists(file_path, download_link, message=None, tota...
Python
0.000004
@@ -140,16 +140,69 @@ imsave%0A%0A +def path_exists(path):%0A%09return os.path.exists(path)%0A%0A def crea @@ -242,24 +242,21 @@ %09if not -os. path -. +_ exists(d @@ -381,24 +381,21 @@ e):%0A%09if -os. path -. +_ exists(f @@ -923,32 +923,29 @@ e):%0A%09assert -os. path -. +_ exists(model @@ -1523,24 +152...
955f751965ff0e6f6cf0d5fe9d51b8bcc30281a0
Remove check for Wagtail-0.3-style urlconfs in wagtailimages
wagtail/wagtailimages/wagtail_hooks.py
wagtail/wagtailimages/wagtail_hooks.py
from django.conf import settings from django.conf.urls import include, url from django.core import urlresolvers from django.core.exceptions import ImproperlyConfigured from django.utils.html import format_html, format_html_join from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models impo...
Python
0
@@ -109,64 +109,8 @@ ers%0A -from django.core.exceptions import ImproperlyConfigured%0A from @@ -850,2300 +850,8 @@ %5D%0A%0A%0A -# Check for the presence of a pre-Wagtail-0.3-style urlconf, and fail loudly if one is found.%0A# Prior to Wagtail 0.3, the standard Wagtail urls.py contained an entry for%0A# wagtail.wag...
ae3f9fbcf2bedba6798460569b10260c9acaa1bf
fix url to match filter
watcher/tweakerswatcher.py
watcher/tweakerswatcher.py
import requests import json import os.path from watcher.watcher import Watcher class TweakersWatcher(Watcher): watcher_name = 'Tweakers Pricewatch' filename = 'site_tweakers.txt' def parse_site(self): url = 'https://tweakers.net/xmlhttp/xmlHttp.php?application=tweakbase&type=filter&action=deals&d...
Python
0
@@ -807,17 +807,17 @@ nlJYgSxg -Z +b gGWcS4uK @@ -836,30 +836,54 @@ MKcY -pheLoQZ6ZmCpsMzUcqA6g1 +qATMw2KogZ4JWCosM7W8GKwrvygltcgtMzUnRclKKRHDtl oA'%0A
d3effa1b80c8d56c98451f335b8099b72fa1f61b
Remove orderdict
yelp_kafka_tool/kafka_cluster_manager/cluster_info/util.py
yelp_kafka_tool/kafka_cluster_manager/cluster_info/util.py
from collections import Counter, OrderedDict def get_partitions_per_broker(brokers): """Return partition count for each broker.""" return dict( (broker, len(broker.partitions)) for broker in brokers ) def get_leaders_per_broker(brokers, partitions): """Return count for each broker th...
Python
0.000065
@@ -28,21 +28,8 @@ nter -, OrderedDict %0A%0A%0Ad
b0212d5489b10956976365c862470e338c45509a
Test twisted and cares resolvers in netutil_test.
tornado/test/netutil_test.py
tornado/test/netutil_test.py
from __future__ import absolute_import, division, print_function, with_statement import socket from tornado.netutil import BlockingResolver, ThreadedResolver, is_valid_ip from tornado.testing import AsyncTestCase, gen_test from tornado.test.util import unittest try: from concurrent import futures except ImportEr...
Python
0
@@ -338,16 +338,273 @@ = None%0A%0A +try:%0A import pycares%0Aexcept ImportError:%0A pycares = None%0Aelse:%0A from tornado.platform.caresresolver import CaresResolver%0A%0Atry:%0A import twisted%0Aexcept ImportError:%0A twisted = None%0Aelse:%0A from tornado.platform.twisted import TwistedResolver%0...
b0b40db76e3c602eb0c49cf99b2ab8c6ef533751
suprime le param si la valeurr est None
sara_flexbe_states/src/sara_flexbe_states/SetRosParam.py
sara_flexbe_states/src/sara_flexbe_states/SetRosParam.py
# !/usr/bin/env python import rospy from flexbe_core import EventState, Logger ''' Created on 21.09.2017 @author: Philippe La Madeleine ''' class SetRosParam(EventState): ''' Store a value in the ros parameter server for later use. -- ParamName string The desired value. ># Value ob...
Python
0.999914
@@ -684,25 +684,55 @@ '''%0A -%0A + if userdata.Value:%0A rosp @@ -775,16 +775,129 @@ .Value)%0A + else:%0A if rospy.has_param(self.ParamName):%0A rospy.delete_param(self.ParamName)%0A
738fc28922e0807bd292c8257ac251f5f743c237
Fix pep8 errors.
kotti_dkbase/__init__.py
kotti_dkbase/__init__.py
from pyramid.httpexceptions import HTTPError from pyramid.httpexceptions import HTTPNotFound from kotti_dkbase.views import error_view from kotti_dkbase.views import exception_decorator def includeme(config): config.include('pyramid_zcml') config.load_zcml('configure.zcml') config.add_view( error_v...
Python
0.000004
@@ -180,16 +180,17 @@ orator%0A%0A +%0A def incl @@ -406,34 +406,30 @@ or-404.pt',%0A - )%0A + config.a @@ -537,34 +537,30 @@ /error.pt',%0A - )%0A + config.a @@ -715,18 +715,14 @@ t',%0A - )%0A + @@ -790,16 +790,16 @@ tatic')%0A - conf @@ -857,8 +857,9 @@ rides/')...
7d082f2012c08f4689c9d503d87d0557255c894d
Add option to use Yappi for manage.py profile command.
yet_another_django_profiler/management/commands/profile.py
yet_another_django_profiler/management/commands/profile.py
# encoding: utf-8 # Created by Jeremy Bowman on Fri Feb 21 11:16:36 EST 2014 # Copyright (c) 2014, 2015 Safari Books Online. All rights reserved. # # This software may be modified and distributed under the terms # of the 3-clause BSD license. See the LICENSE file for details. """ Yet Another Django Profiler "profile" ...
Python
0
@@ -2089,16 +2089,182 @@ names'%0A + ),%0A make_option(%0A '-b',%0A '--backend',%0A dest='backend',%0A help='Profiler backend to use (cProfile or yappi)'%0A @@ -3615,24 +3615,205 @@ om_options%0A%0A + if options%5B'backend'%5D == 'yappi':%0A ...
99a86a26170d293d8a11074f62f09024493422c1
Remove global commands in real_command()
utils.py
utils.py
import requests import traceback import six import config import log print_ = six.print_ PY3 = six.PY3 PY34 = six.PY34 PY2 = six.PY2 commands = {} cmd_list = [] alias_list = [] get = requests.get post = requests.post sysver = "".join(__import__("sys").version.split("\n")) gitver = __import__("subprocess").check_outp...
Python
0.000014
@@ -886,35 +886,13 @@ bal -commands%0A global cmd +alias _lis @@ -904,29 +904,27 @@ global -alias +cmd _list%0A%0A
58ba7b4f777b88d81f2a9f717001d9cdac603947
Use copy2 to preserve file attributes
utils.py
utils.py
from __future__ import print_function import os import zipfile import io import platform import tempfile import codecs import shutil import subprocess from appdirs import AppDirs import validators from PySide import QtCore #try: # import zlib # ZIP_MODE = zipfile.ZIP_DEFLATED #except: def url_exists(path): ...
Python
0
@@ -3384,24 +3384,25 @@ shutil.copy +2 (src, dest,
d332ab4c4781483199bde7e985fc5eb079bcd2a1
fix content type
transports/movilgate_http.py
transports/movilgate_http.py
import re, sys, traceback from xml.etree import ElementTree from twisted.internet import defer from twisted.internet.defer import inlineCallbacks from twisted.internet.error import ConnectionRefusedError from twisted.web import http from twisted.web.resource import Resource from twisted.web.server import NOT_DONE_YET ...
Python
0.003446
@@ -2969,19 +2969,12 @@ : %5B' -application +text /xml
4b44947911660ceee3a09da08c7c22509f953872
add TODOs
utils.py
utils.py
from __future__ import absolute_import import csv import logging import json import re from collections import defaultdict from utils.handlers import ColorizingStreamHandler, JSONFileHandler logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) logger.addHandler(ColorizingStreamHandler()) logger.addHand...
Python
0
@@ -2351,32 +2351,185 @@ -continue +# skip empty data%0A continue%0A # TODO only log changed data%0A # TODO make ints ints, decimals strings, floats float %0A
9a861757011e2f8ba17bc30b0e874d087f5afd7b
Bump version to 6.0.1b1
platformio/__init__.py
platformio/__init__.py
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
Python
0
@@ -635,17 +635,17 @@ 6, 0, %221 -a +b 1%22)%0A__ve
225d3f4abe2a9145dba3f3b1e0a72b9db4aea0f7
Fix DOB plot title
plots/gender_by_dob.py
plots/gender_by_dob.py
import dateutil import pandas from bokeh.charts import TimeSeries, Line from bokeh.plotting import gridplot from bokeh.resources import CDN from bokeh.embed import autoload_static import os def plot(newest_changes): ra_len = 1 #rolling average lenght dox = pandas.DataFrame() interesante = ['female','male...
Python
0.000005
@@ -1268,25 +1268,16 @@ ro%5D = ra -%0A %0A%0A ti @@ -1345,20 +1345,16 @@ nge%5B1%5D%5D%0A - %0A ''' @@ -1823,21 +1823,43 @@ le=%22 -Female Ratios +Date of Birth and Death by Gender - %7B%7D%22 @@ -2789,16 +2789,17 @@ e_html%7D%0A +%0A if __nam
491d7eca2137613978a7d88ad74fcdda9dcb5e5c
add find_packages to setup.py
plugins/geoip/setup.py
plugins/geoip/setup.py
#!/usr/bin/env python import setuptools version = '0.1.0' setuptools.setup( name="alerta-geoip", version=version, description='Alerta plugin for GeoIP Lookup', url='https://github.com/alerta/alerta-contrib', license='Apache License 2.0', author='Nick Satterly', author_email='nick.satterly...
Python
0.000001
@@ -20,24 +20,50 @@ on%0A%0A -import setuptool +from setuptools import setup, find_package s%0A%0Av @@ -84,19 +84,8 @@ 0'%0A%0A -setuptools. setu @@ -347,16 +347,46 @@ n.com',%0A + packages=find_packages(),%0A py_m
eecb7d6c8d86912dc4994ec7439e1679282d3347
Add a trivial doctest
pmxbot/saysomething.py
pmxbot/saysomething.py
# vim:ts=4:sw=4:noexpandtab import threading import random import logging import time import datetime from itertools import chain from jaraco import timing import pmxbot.core import pmxbot.logging import pmxbot.quotes log = logging.getLogger(__name__) nlnl = '\n', '\n' def new_key(key, word): if word == '\n': ...
Python
0.998601
@@ -22,16 +22,284 @@ andtab%0A%0A +r%22%22%22%0A%3E%3E%3E import io%0A%3E%3E%3E import itertools%0A%3E%3E%3E f = io.StringIO(%22foo said one thing%5Cn%5Cnfoo said another thing%5Cn%5Cnbar said nothing%5Cn%22)%0A%3E%3E%3E data = markov_data_from_words(words_from_file(f))%0A%3E%3E%3E words = words_from_markov_data(data)...
e3b71c58a409239845588ed9f20970243db45dba
add delay to slow balls movement in pygame1_sample
pong/pygame1_sample.py
pong/pygame1_sample.py
import sys, pygame pygame.init() size = width, height = 640, 480 speed = [2, 2] black = 0, 0, 0 screen = pygame.display.set_mode(size) ball = pygame.image.load("ball.gif") ballrect = ball.get_rect() while 1: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() ballrect = ballre...
Python
0
@@ -12,16 +12,29 @@ pygame%0A +import time%0A%0A pygame.i @@ -85,12 +85,12 @@ = %5B -2, 2 +1, 1 %5D%0Abl @@ -341,16 +341,38 @@ (speed)%0A + time.sleep(0.001)%0A if b
a3a19a7aa8d8b4691ddd569197024961f95f4678
Rename search method to search_html
twitterwebsearch/searcher.py
twitterwebsearch/searcher.py
""" Module for using the web interface of Twitter's search. """ import sys import time import datetime from selenium.common.exceptions import NoSuchElementException from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.by import By from selenium.webdriver.support....
Python
0.000022
@@ -1891,16 +1891,71 @@ query):%0A + return search_html(query)%0A%0Adef search_html(query):%0A driv
126e6be2dd7b61809656ada1adfe3c64cbe24c47
Add couchbase/spock to branch merge set.
engines/ep/scripts/unmerged-commits.py
engines/ep/scripts/unmerged-commits.py
#!/usr/bin/env python2.7 # Script to show which commit(s) are not yet merged between our release branches. from __future__ import print_function import subprocess import sys class bcolors: """Define ANSI color codes, if we're running under a TTY.""" if sys.stdout.isatty(): HEADER = '\033[36m' ...
Python
0.000001
@@ -740,22 +740,21 @@ uchbase/ -master +spock '),%0A @@ -785,16 +785,81 @@ on_mc',%0A + 'couchbase/spock'),%0A ('couchbase/spock',%0A
ba3cb591f0be7b7443504491176e3889ba92be8c
Improve error message when keybinding not found
keybindings.py
keybindings.py
import vx from functools import partial from enum import Enum _keys = { 'langle': '<', 'rangle': '>', 'lparen': '(', 'rparen': ')', 'lbrace': '{', 'rbrace': '}', 'lbracket': '[', 'rbracket': ']', 'grave': '`', 'backtick': '`', 'tilde': '~', ...
Python
0.000004
@@ -5490,17 +5490,24 @@ ot found -' + ' + key )%0A
c94960b8c42ab46331cf1f5b76c2c2f4deb33b9d
fix KeyError on small word set
typetrainer/tutors/common.py
typetrainer/tutors/common.py
import random import collections import itertools from typetrainer.generator import make_char_chain, generate_word class Filler(object): def __init__(self, words, make_lengths_seq): self.dist = {} self.first, self.other, self.word_chars = make_char_chain(words, 3, self.dist) self.lengths =...
Python
0.000004
@@ -652,32 +652,61 @@ __iter__(self):%0A + skip_to_word = False%0A while Tr @@ -766,17 +766,190 @@ if -t == 'w': +skip_to_word:%0A while t != 'w':%0A t, l = self.liter.next()%0A%0A skip_to_word = False%0A%0A if t == 'w':%0A w...
078e409d3c09e9ec0699ea95a2786c2342474bba
Return timestamp as a float in JSON.
views.py
views.py
import json from collections import deque from flask import request, render_template from flask import current_app as app, abort from util import make_status_response, generate_filename, jsonify RECORDS_QUEUE = deque(maxlen=100) def _prime_records_queue(q): with open(generate_filename(app.config), 'r') as trac...
Python
0
@@ -256,34 +256,35 @@ eue(q):%0A -with open( +filename = generate_fil @@ -300,16 +300,52 @@ .config) +%0A try:%0A with open(filename , 'r') a @@ -350,32 +350,36 @@ as trace_file:%0A + for line @@ -406,16 +406,20 @@ + if len(R @@ -477,14 +477,22 @@ + + break%0A...
2693ac98abf8eca4b96991c3d3fbf8e452eeead3
Use lzma instead of zlib
prerender/prerender.py
prerender/prerender.py
import os import time import zlib import asyncio import logging from urllib.parse import urlparse from concurrent.futures import ThreadPoolExecutor from multiprocessing import cpu_count import aiofiles import aiofiles.os from sanic import Sanic from sanic import response from sanic.exceptions import NotFound from asyn...
Python
0.000002
@@ -22,20 +22,20 @@ %0Aimport -zlib +lzma %0Aimport @@ -3084,20 +3084,20 @@ ecutor, -zlib +lzma .decompr @@ -3336,12 +3336,12 @@ d = -zlib +lzma .com
2a7ed7c2d6f37c3b6965ad92b21cecc0a4abd91a
Add first verion to upload via BioBlend
upload_datasets_to_galaxy.py
upload_datasets_to_galaxy.py
#!/usr/bin/python3 import argparse # from bioblend.galaxy import GalaxyInstance import configparser def upload_datasets_to_galaxy(): # Arguments initialization parser = argparse.ArgumentParser(description="Script to upload a folder into" "Galaxy Data Libraries")...
Python
0
@@ -28,18 +28,16 @@ rgparse%0A -# from bio @@ -90,16 +90,26 @@ igparser +%0Aimport os %0A%0Adef up @@ -628,18 +628,16 @@ y'%5D%0A%0A - # gi = Ga @@ -657,67 +657,1333 @@ url= -galaxy_config%5B'url'%5D, key=galaxy_config%5B'api-key'%5D)%0A%0A # +'http://127.0.0.1:8080', key='5e8cc5748922c598c1aa6ec9e60578...
efd38d1f59d73443e47071c1fd7c87b492372915
Fix peername retrieval in user action log
dvhb_hybrid/user_action_log/base_amodels.py
dvhb_hybrid/user_action_log/base_amodels.py
from dvhb_hybrid import utils from dvhb_hybrid.amodels import Model, method_connect_once from django.contrib.contenttypes.models import ContentType from .enums import UserActionLogEntryType, UserActionLogEntrySubType, UserActionLogStatus class BaseUserActionLogEntry(Model): """ Abstract action log entry async...
Python
0.003282
@@ -1529,16 +1529,47 @@ ername') + if request.transport else None %0A
1f4006ba9831f47a7ccc3fa0f8f9fbbb44b0c217
fix plot_matplotlib_hist2d.py covariance matrix
examples/plotting/plot_matplotlib_hist2d.py
examples/plotting/plot_matplotlib_hist2d.py
#!/usr/bin/env python """ ======================================== Plot a 2D ROOT histogram with matplotlib ======================================== This example demonstrates how a 2D ROOT histogram can be displayed with matplotlib. """ print __doc__ import ROOT from matplotlib import pyplot as plt from rootpy.plottin...
Python
0.000153
@@ -508,34 +508,26 @@ cov= -np.arange(4).reshape(2, 2) +%5B%5B1, .5%5D, %5B.5, 1%5D%5D ,%0A
0e7a6f58bc740479a616c973c5973bd255501004
Update feedback_tags.py
feedback_form/templatetags/feedback_tags.py
feedback_form/templatetags/feedback_tags.py
"""Template tags and filters for the ``feedback_form`` app.""" from django import template from ..app_settings import * # NOQA from ..forms import FeedbackForm register = template.Library() @register.inclusion_tag('feedback_form/partials/form.html', takes_context=True) def feedback_form(context): """Template t...
Python
0
@@ -362,16 +362,104 @@ = None%0A + url = None%0A if context.get('request'):%0A url = context%5B'request'%5D.path%0A if c @@ -501,16 +501,20 @@ ated():%0A + @@ -590,39 +590,19 @@ orm(url= -context%5B'request'%5D.path +url , user=u
426dd82e9b2a7c2de2b6ba9091ad67057ffe9f5f
Create db, if there isn't one.
statiki.wsgi
statiki.wsgi
import os from os.path import abspath, dirname import sys #active the python virtualenv for this application HOME = os.environ['HOME'] activate_this = '%s/.virtualenvs/statiki/bin/activate_this.py' % HOME execfile(activate_this, dict(__file__=activate_this)) # Add the source directory to the path HERE = dirname(abspa...
Python
0
@@ -372,16 +372,20 @@ i import + db, app as @@ -384,20 +384,36 @@ app as application%0A +db.create_all()%0A
78bfcf1561597113a91f7449642085a392c20429
use doctype instead of service name to send email
frappe/integrations/offsite_backup_utils.py
frappe/integrations/offsite_backup_utils.py
# -*- coding: utf-8 -*- # Copyright (c) 2019, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe import glob import os from frappe.utils import split_emails, get_backups_path def send_email(success, service_name, doctype, email...
Python
0
@@ -366,35 +366,30 @@ _recipients( -service_nam +doctyp e, email_fie @@ -1280,27 +1280,22 @@ ipients( -service_nam +doctyp e, email @@ -1383,27 +1383,22 @@ t_value( -service_nam +doctyp e, None,
5659ae2668edb934f422e15edb81b1977da9b2c2
clean up
sail.py
sail.py
#!/usr/bin/python # David Kohreidze import csv import os import re with open('keywords.csv', 'rU') as csvf: reader = csv.reader(csvf) links = {rows[0]:rows[1] for rows in reader} # builds dictionary from file for f in os.listdir('.'): # for every file in the current directory if os.path.isfile(f): # must be a f...
Python
0.000001
@@ -180,107 +180,35 @@ der%7D - # builds dictionary from file%0A%0Afor f in os.listdir('.'): # for every file in the current directory +%0A%0Afor f in os.listdir('.'): %0A i @@ -232,24 +232,8 @@ f): -# must be a file %0A @@ -260,29 +260,8 @@ %22): -# must be a text file %0A%09 @@ -282,20 +282,8 @@ ad() -...
838361c976d481dcd8932e2a6caa0008935dc3c1
Move LoopingCall initialization to __init__().
vumi/transports/xmpp/xmpp.py
vumi/transports/xmpp/xmpp.py
# -*- test-case-name: vumi.transports.xmpp.tests.test_xmpp -*- # -*- encoding: utf-8 -*- from twisted.python import log from twisted.words.protocols.jabber.jid import JID from twisted.words.xish import domish from twisted.words.xish.domish import Element as DomishElement from twisted.internet.task import LoopingCall f...
Python
0
@@ -4142,16 +4142,184 @@ Client%0A%0A + def __init__(self, options, config=None):%0A super(XMPPTransport, self).__init__(options, config=config)%0A self.ping_call = LoopingCall(self.send_ping)%0A%0A def @@ -5356,61 +5356,8 @@ nt)%0A - self.ping_call = LoopingCall(self.send_ping)%0A ...
03c221d7ac1ca955b41577d525bd40b6188045ea
Clarify comment.
size.py
size.py
#!/usr/bin/python # calculate the number of pixels for a stimulus # fixed: viewer distance, vertical resolution, visual angle # argv[1] = vertical screen height from math import atan2, degrees import sys if sys.argv[1]: h = float(sys.argv[1]) else: h = 21.5 # Dell laptop h = 20.6 # Macboo...
Python
0.000001
@@ -154,16 +154,21 @@ n height + (cm) %0A%0Afrom m
00058bfd27336454229b061aa038478920787df7
Add ability to apply rules
src/fwgen.py
src/fwgen.py
#!/usr/bin/env python3 import argparse import sys import re import yaml DEFAULT_CHAINS = { 'filter': ['INPUT', 'FORWARD', 'OUTPUT'], 'nat': ['PREROUTING', 'INPUT', 'OUTPUT', 'POSTROUTING'], 'mangle': ['PREROUTING', 'INPUT', 'FORWARD', 'OUTPUT', 'POSTROUTING'], 'raw': ['PREROUTING', 'OUTPUT'], 's...
Python
0
@@ -53,16 +53,34 @@ mport re +%0Aimport subprocess %0A%0Aimport @@ -3842,24 +3842,304 @@ d 'COMMIT'%0A%0A + @staticmethod%0A def apply_rules(rules, inet_family):%0A cmd = %7B%0A 'v4': %5B'iptables-restore'%5D,%0A 'v6': %5B'ip6tables-restore'%5D%0A %7D%0A stdin = ('%25...
3972f861fae155b84bc344810b0e5a1c8cbb418c
Fix SMBC next page XPath
webcomix/supported_comics.py
webcomix/supported_comics.py
supported_comics = { "xkcd": ("http://xkcd.com/1/", "//a[@rel='next']/@href", "//div[@id='comic']//img/@src"), "Nedroid": ("http://nedroid.com/2005/09/2210-whee/", "//div[@class='nav-next']/a/@href", "//div[@id='comic']/img/@src"), "JL8": ("http://limbero.org/jl8/1", "//a[text()='>']/@href", "//img/@src"), ...
Python
0.000221
@@ -382,24 +382,27 @@ //a%5B@class=' +cc- next'%5D/@href
b256c42f393d32d4f060fe04a1349d30c3018146
add option to disable smart output for tasks.
task.py
task.py
from hashlib import md5 import subprocess from cPickle \ import \ dumps from toydist.core.utils \ import \ pprint from errors \ import \ TaskRunFailure # TODO: # - factory for tasks, so that tasks can be created from strings # instead of import (import not extensible) class Ta...
Python
0
@@ -927,16 +927,52 @@ n = None +%0A self.disable_output = False %0A%0A # @@ -2113,16 +2113,56 @@ , cwd):%0A + if not self.disable_output:%0A @@ -2185,16 +2185,20 @@ BOSE%22%5D:%0A + @@ -2232,38 +2232,46 @@ n(cmd))%0A + else:%0A + ppri
4f04de16a75b4ba87936498aeec7eebeb5ba4b56
Add window resizing
temp.py
temp.py
import random import string import sys from stylesheet import set_stylesheet from PyQt5 import QtCore, QtGui, QtWidgets # Create main canvas class Passwordy(QtWidgets.QMainWindow): def __init__(self, parent = None): QtWidgets.QMainWindow.__init__(self,parent) # Call function to create UI ...
Python
0.000001
@@ -5954,16 +5954,18 @@ words)%0A%0A +%0A%0A @@ -6260,16 +6260,91 @@ s(self): +%0A%0A # Increase window size%0A self.resize(500, 500)%0A%0A ''' %0A @@ -8477,16 +8477,27 @@ pend(i)%0A + ''' %0A %0A# Run
c0ebc5d757e71c06a8ca3597bf92d496aa0dd5ee
update test child age
test.py
test.py
import os import unittest import tempfile import json from app import app from app.models import db, Child, User from datetime import datetime class ChildViewTestCase(unittest.TestCase): def test_child_view(self): first_name = "Martha" last_name = "Sosa" birth_date= datetime.strptime(...
Python
0.000002
@@ -490,9 +490,9 @@ ge, -6 +7 )%0A%0Ac
e890ac9ef00193beac77b757c62911553cebf656
Change save path to local path
test.py
test.py
import urllib urllib.urlretrieve('http://192.168.0.13:8080/photoaf.jpg', '/home/pi/img/img.jpg')
Python
0.000001
@@ -71,21 +71,8 @@ ', ' -/home/pi/img/ img.
2595c31143226004c484da1e131e092224f9d238
Rewrite module to use constants
test.py
test.py
import subprocess from random import choice, randint from time import sleep class Test(object): def __init__(self, testfile, args=[]): self.testfile = testfile self.args = args self.output = None self.status = None self.errorMessage = None self.parser = None d...
Python
0
@@ -70,16 +70,37 @@ sleep%0A%0A +from const import *%0A%0A class Te @@ -801,59 +801,39 @@ ile= -%22siteprobe.py%22, target=%22https://www.torproject.org%22 +PROBE_TEST, target=TOR_SITE_URL ):%0A @@ -1000,52 +1000,35 @@ ile= -%22tcpconnect.py%22, target=%22www.torproject.org%22 +TCP_TEST, target=TOR_DOMAIN ):%0A...
89b1bfaad82f1e19df51b189b65ce940983d0da1
comment out cfl in tests since it seems to be broken.
test.py
test.py
### # Copyright (c) 2012-2014, spline # All rights reserved. ### from supybot.test import * class ScoresTestCase(PluginTestCase): plugins = ('Scores',) def testScores(self): # cfb, cfl, d1bb, golf, mlb, nascar, nba, ncb, ncw, nfl, nhl, racing, tennis, and wnba conf.supybot.plugins.Scores...
Python
0
@@ -377,32 +377,34 @@ r('cfb')%0A + # self.assertNotE
ac8d6210b1e48e7ce1131412b45d23846b7c73d2
Fix to minor style issue
test.py
test.py
import time import panoply KEY = "panoply/2g866xw4oaqt1emi" SECRET = "MmM0NWNvc2wwYmJ4ZDJ0OS84MmY3MzQ4NC02MDIzLTQyN2QtODdkMS0yY2I0NTAzNDk0NDQvMDM3MzM1OTk5NTYyL3VzLWVhc3QtMQ==" # noqa sdk = panoply.SDK(KEY, SECRET) sdk.write('roi-test', {'hello': 1}) print sdk.qurl time.sleep(5)
Python
0.000001
@@ -247,18 +247,16 @@ ': 1%7D)%0A%0A -%0A%0A print sd
5e089a1b155071bb9f009657320c9c12418f517d
debug travis
test.py
test.py
#!/usr/bin/env python from numpy import array,nan,uint16,int64 from numpy.testing import assert_allclose from datetime import datetime # try: from .airMass import airmass from .rawDMCreader import goRead from .plotSolarElev import compsolar except: from airMass import airmass from rawDMCreader impor...
Python
0.000001
@@ -252,17 +252,45 @@ r%0Aexcept -: + Exception as e:%0A print(e) %0A fro @@ -1686,24 +1686,25 @@ d()%0A test_plotsolar() +%0A
e859119ba7c898c9c5a1e3c9a719050461abc249
test installed package
test.py
test.py
#!/usr/bin/env python3 import sys from os import path from unittest import TestLoader, TextTestRunner print("Python {}".format(sys.version)) libdir = path.join(path.abspath(path.curdir), 'lib') sys.path.insert(0, libdir) from tsdesktop import version version.println() ldr = TestLoader() suite = ldr.discover('tsdesk...
Python
0
@@ -136,16 +136,59 @@ sion))%0A%0A +if not '--test-installed' in sys.argv:%0A libdir = @@ -232,16 +232,20 @@ 'lib')%0A + sys.path
465046b44d71bfea9879a0e7e6039b8c932c90e8
Fix for fast CPU in testing
test.py
test.py
#!/usr/bin/env python3 from pycah.db.user import User from pycah.db.game import Game from pycah.db.expansion import Expansion from pycah.db import connection import re, json connection.set_session(autocommit=True) cursor = connection.cursor() cursor.execute(open('./pycah/db/create_database.sql').read()) connection.s...
Python
0
@@ -168,16 +168,22 @@ re, json +, time %0A%0Aconnec @@ -3285,16 +3285,36 @@ .value)%0A + time.sleep(0.1)%0A print('R
10a78f1d5cfb38c14c7e5434fdd5258fdf41a351
Fix failing tests (oops)
test.py
test.py
#!/usr/bin/env python import os import subprocess import time import glob import unittest class TestPasses(unittest.TestCase): @classmethod def setUpClass(self): clean() self.output = run_zx_spec("bin/test-passes.tap") def test_zx_spec_header_displayed(self): self.assertRegexpMatc...
Python
0.000002
@@ -330,34 +330,33 @@ output, 'ZX Spec - - +: The TDD Framewo @@ -904,10 +904,9 @@ Spec - - +: The @@ -1020,22 +1020,16 @@ ert_fail - fails ')%0A @@ -1081,30 +1081,24 @@ ert_a_equals - fails ')%0A s @@ -1154,22 +1154,16 @@ t_equals - fails ')%0A @@ -1220,22 +1220,16 @@ _is_zero - fails ')...
8638e02de720954ed33098ec88a044dee38302f6
test ...
test.py
test.py
#!/usr/bin/env python import os import socket import sys def test(): print "hello" pass if __name__=="__main__": test() sys.exit(0)
Python
0
@@ -84,16 +84,154 @@ %22hello%22%0A + sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)%0A server_address = '/var/run/docker.sock'%0A sock.connect(server_address)%0A pass
25e2c02ebc9a19ad7fe193ed5912fcd21bec4065
Test if machine deciphers correctly
test.py
test.py
import unittest from enigma import Enigma, Steckerbrett, Umkehrwalze, Walzen class RotorTestCase(unittest.TestCase): def test_rotor_encoding(self): rotor = Walzen(wiring='EKMFLGDQVZNTOWYHXUSPAIBRCJ', notch='Q') self.assertEqual('E', rotor.encode('A')) def test_rotor_reverse_encoding(self): ...
Python
0.00308
@@ -2828,16 +2828,189 @@ AAA'))%0A%0A + def test_enigma_decipher(self):%0A machine = Enigma(rotors=self.rotors%5B::-1%5D, reflector=self.reflector)%0A self.assertEqual('AAAAA', machine.cipher('BDZGO'))%0A%0A %0Adef run
a93c281e126f41d9ac388ec2dafd829eed2ea6b1
add coverage flags
test.py
test.py
import os import sys import subprocess import shlex import shutil import sys import time import datetime HERE = os.path.abspath(os.path.dirname(__file__)) # ------------------------------------------------------------------------------ def exe(command): """ Executes command and returns string representation...
Python
0
@@ -2354,16 +2354,41 @@ setup.py + --fc=gfortran --coverage ')%0A a
c04d010366009eb49f94960ddbdaedbb5850dd98
Fix typo in test.py
test.py
test.py
import steam, sys valid_modes = ["bp", "schema", "assets-catalog"] try: testmode = sys.argv[2] testkey = sys.argv[1] if testmode not in valid_modes: raise Exception except: sys.stderr.write("Run " + sys.argv[0] + " <apikey> " + "<" + ", ".join(valid_modes) + ">\n") raise SystemExit steam.set_api_...
Python
0.999785
@@ -710,16 +710,17 @@ st(test_ +s chema)%0Ae
4893105835a8acf4ee19a96c6fefce45f08ec08f
fix some
test.py
test.py
from __future__ import print_function import logging from logging import StreamHandler from memory_profiler import profile logger = logging.getLogger() logger.addHandler(StreamHandler()) logger.setLevel(logging.DEBUG) def glow_pyconf_ppt(): import requests for i in range(1, 24): s = requests.get('ht...
Python
0.947237
@@ -467,16 +467,17 @@ ntent)%0A%0A +# @profile @@ -477,16 +477,16 @@ profile%0A - def test @@ -547,19 +547,16 @@ MAX = 10 -000 %0A LIF @@ -564,9 +564,9 @@ = 1 -5 +0 %0A%0A @@ -1202,25 +1202,29 @@ sleep(LIFE)%0A + %0A - #a.b = b @@ -1269,16 +1269,46 @@ a, b')%0A + a.l = None%0A b.l = Non...
e057b586e2dc43ff367cb1ed6fc5bbb7dbfe514c
print flask
test.py
test.py
import flask
Python
0.000006
@@ -6,8 +6,19 @@ t flask%0A +print flask
848751ca2906a5e1e8e5ccf3828bf13994b074fe
Update test script
test.py
test.py
import xorcise try: console = xorcise.turn_on_console() console.erase() line = xorcise.Line() console.print_line(0, line) line = xorcise.Line( xorcise.Character("h", xorcise.ColorAttribute.black), xorcise.Character("e", xorcise.ColorAttribute.blue), xorcise.Character("l", xorcise.ColorAtt...
Python
0.000001
@@ -205,13 +205,33 @@ ute. -black +get_best_match((0, 0, 0)) ),%0A @@ -285,12 +285,35 @@ ute. -blue +get_best_match((0, 0, 255)) ),%0A @@ -367,11 +367,35 @@ ute. -red +get_best_match((255, 0, 0)) ),%0A @@ -450,12 +450,34 @@ te.g -reen +et_best_match((0, 255, 0)) ),%0A @@ -531,14 +531,37 @@ ute. -yellow +ge...
35b2028ed09f64442092bdcb617c80acd1741948
Fix for ticket #18
urls.py
urls.py
from django.conf.urls.defaults import * from django.conf import settings # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() from mailng.extensions import loadextensions, loadmenus loadextensions() urlpatterns = patterns('', # Example: # (r'^mailng/',...
Python
0
@@ -978,16 +978,56 @@ ,),%7D)%0A)%0A +menus = loadmenus()%0Aif menus != ():%0A urlpatte @@ -1046,27 +1046,21 @@ rns('', -load menus -() )%0A%0Aif se
a5357056bda5daf741a5096f88c50dc93bfff1b7
fix typo
urls.py
urls.py
from django.conf.urls.defaults import * from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', (r'^forum/', include('nidarholm.forum.urls.debate')), (r'^news/', include('nidarholm.news.urls.story')) (r'^admin/', include(admin.site.urls)), )
Python
0.999991
@@ -226,16 +226,17 @@ story')) +, %0A%0A (r
b8faad87145b777d5bf1fc807fc06dd940d0816d
Put messaging app's urls under a path
urls.py
urls.py
from django.conf.urls.defaults import patterns, include, url from django.contrib import admin from django.conf import settings #from ajax_select import urls as ajax_select_urls from tastypie.api import Api from storybase.api import CreativeCommonsLicenseGetProxyView from storybase_asset.urls import urlpatterns as ass...
Python
0
@@ -332,82 +332,8 @@ rns%0A -from storybase_messaging.urls import urlpatterns as messaging_urlpatterns%0A from @@ -1643,32 +1643,8 @@ s += - messaging_urlpatterns + use @@ -2037,17 +2037,16 @@ ),%0A%0A -# (r'%5E $', @@ -2041,17 +2041,26 @@ (r'%5E -$ +messaging/ ', inclu
fbba73e772e5055dce81dd2a3f8814011733f882
Add ajax_select lookup url.
urls.py
urls.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ## ## Author: Adriano Monteiro Marques <adriano@umitproject.org> ## Author: Diogo Pinheiro <diogormpinheiro@gmail.com> ## ## Copyright (C) 2011 S2S Network Consultoria e Tecnologia da Informacao LTDA ## ## This program is free software: you can redistribute it and/or modify...
Python
0
@@ -987,16 +987,66 @@ admin%0A%0A +from ajax_select import urls as ajax_select_urls%0A%0A admin.au @@ -1566,47 +1566,8 @@ -(r'%5Eadmin/', include(admin.site.urls)), %0A @@ -1690,10 +1690,106 @@ rls')),%0A + (r'%5Eajax/lookups/', include(ajax_select_urls)),%0A (r'%5Eadmin/', include(admin.site.urls))...
3ac72f0a9f83988584cee89896eaeb5c6f06d6b0
Fix `previous_float` in util.py
util.py
util.py
# util.py # Imports import re # raise_if_not_shape def raise_if_not_shape(name, A, shape): """Raise a `ValueError` if the np.ndarray `A` does not have dimensions `shape`.""" if A.shape != shape: raise ValueError('{}.shape != {}'.format(name, shape)) # previous_float PARSE_FLOAT_RE = ...
Python
0.000554
@@ -342,16 +342,19 @@ x1%5C.(%5B%5Cd +a-f %5D%7B13%7D)p( @@ -490,16 +490,24 @@ x).hex() +.lower() ).groups
804c51951650e22a688abe306d47fba97e11acd6
Add '/' to allowed filename characters
util.py
util.py
import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import os from configparser import ConfigParser import requests import praw from markdown import markdown def to_html(comment): result = markdown(comment.body) + '<footer>' + comment.author.name + '</footer>' c...
Python
0.000394
@@ -2464,16 +2464,21 @@ ',', ' +', '/ '%5D).rstr
7e3f28329d887229345fa0e8085ca7e09fe7686e
Improve wsgi.py
wsgi.py
wsgi.py
import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") application = get_wsgi_application()
Python
0.000005
@@ -1,65 +1,38 @@ -import os%0A%0Afrom django.core.wsgi import get_wsgi_application%0A +# -*- coding: utf-8 -*-%0A%0Aimport os %0Aos. @@ -89,16 +89,66 @@ ings%22)%0A%0A +from django.core.wsgi import get_wsgi_application%0A applicat
8947f6f7733593ec2b701aaa0b6fb98d973b7850
Add pull to wsgi startup process, and /uptime route to the app
wsgi.py
wsgi.py
import os import sys import time import datetime from apscheduler.scheduler import Scheduler from bottle import Bottle, mako_view # sys.path is a global for this python thread, so this enables local imports throughout the app sys.path.insert(0, '.') from fetch import fetch from settings import datadir from sync import...
Python
0
@@ -318,16 +318,25 @@ ort sync +, get_dir %0Afrom lo @@ -355,16 +355,90 @@ logger%0A%0A +%0Alogger.debug('Initializing with datadir from github.')%0Aget_dir(datadir)%0A%0A schedule @@ -558,54 +558,13 @@ =6)%0A -# schedule.add_interval_job(sync, minutes=5)%0A%0A +%0Autc_ now @@ -638,16 +638,20 @@ TC=%25s', +utc...
0f570e5a0f33583dbc419be5d6d71ce9c804e131
Upgrade comments
wsgi.py
wsgi.py
""" WSGI config for {{ project_name }} project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "{{ project_name }}.setting...
Python
0
@@ -201,9 +201,9 @@ n/1. -7 +8 /how
1e362ab8704c76e3606fae9317dd85eeb06259ea
remove superflous block size
zero.py
zero.py
#!/bin/py import os count = 1 def zeroToDrive(): ''' write zeros to drive ''' wipes = 1 for int in range(count): os.system(("dd if=/dev/zero bs=4096 | pv --progress --timer --rate --bytes| dd of=/dev/null bs=4096")) # os.system(os.system(("dd if=/dev/zero bs=4096 | pv -ptrb | dd of=/d...
Python
0
@@ -157,34 +157,25 @@ f=/dev/zero -bs=4096 %7C +%7C pv --progres @@ -278,17 +278,8 @@ zero - bs=4096 %7C pv