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
b2e000dfd3a05ec07727060bc2fc3f08ad317d7e
Move logging up earlier in execution
acmd/main.py
acmd/main.py
# coding: utf-8 import os import os.path import sys import optparse import acmd import acmd.tools USAGE = """acmd [options] <tool> <args> Run 'acmd help' for list of available tools""" parser = optparse.OptionParser(USAGE) parser.add_option("-s", "--server", dest="server", help="server name", m...
Python
0.000001
@@ -2027,24 +2027,150 @@ file=None):%0A + sysargs, cmdargs = split_argv(argv)%0A%0A (options, args) = parser.parse_args(sysargs)%0A acmd.init_log(options.verbose)%0A%0A if not r @@ -2411,134 +2411,8 @@ s)%0A%0A - sysargs, cmdargs = split_argv(argv)%0A%0A (options, args) = parser.parse_args(sysargs...
5f8f8b72afef2c304234da88a0e79a45449678ba
Limit decimal points
ds/models/task.py
ds/models/task.py
from __future__ import absolute_import, unicode_literals from datetime import datetime from sqlalchemy import Column, DateTime, ForeignKey, Integer, String from sqlalchemy.schema import Index from ds.config import db from ds.db.types.json import JSONEncodedDict class TaskName(object): deploy = 'deploy' @cl...
Python
0.999999
@@ -2408,16 +2408,26 @@ return + '%25.2fs' %25 (self.d
3dc773cd266ab95bfa746293eb24322ee69da2a6
change made
app/institutions/models.py
app/institutions/models.py
#Stdlib Imports import datetime from django.db import models from django.contrib.auth.models import ( BaseUserManager, AbstractBaseUser ) #Third party libraries #from templated_email import send_templated_mail class AppUserManager(BaseUserManager): def create_user(self, email, full_name, password...
Python
0.000014
@@ -988,24 +988,30 @@ e_user(email +=email ,%0A
c00e069991d25c2e24632cf08ee153347c5947d9
change 不支持 to 不推荐
app/models/notification.py
app/models/notification.py
#!/usr/bin/env python3 from flask import Flask from flask_sqlalchemy import SQLAlchemy from sqlalchemy import ForeignKeyConstraint from datetime import datetime from app import db, login_manager as lm from random import randint from flask_login import UserMixin, current_user from werkzeug.security import generate_passw...
Python
0.000009
@@ -3917,10 +3917,10 @@ '%E7%82%B9%E4%BA%86%E4%B8%8D -%E6%94%AF%E6%8C%81 +%E6%8E%A8%E8%8D%90 '%0A
78dd316e9539564528bd36f5f2238e053b576b8e
add more card in lite
app/staff/views.py
app/staff/views.py
from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from django.core.exceptions import PermissionDenied from django.db import transaction, models from app import models as data from app.staff.forms import FastSendForm from app.models import Card, History, user_permis...
Python
0
@@ -1673,16 +1673,26 @@ 28, 256, + -16, -32, -64%5D%0A
946f8ff1c475ebf6f339c4df5eb5f7069c5633e9
Fix did not return HttpResponse when comment
apps/core/views.py
apps/core/views.py
from django.views.generic.detail import ContextMixin from django.utils.decorators import method_decorator from django.contrib.auth.decorators import login_required from apps.categories.models import Category from apps.books.models import Book class BaseView(ContextMixin): """docstring for BaseView""" model = ...
Python
0.000001
@@ -829,16 +829,23 @@ +return super().
feb69e3ddf1152bd8224e13c3c0c9b60c17f882d
add version flag to aws_ir.cli
aws_ir/cli.py
aws_ir/cli.py
#!/usr/bin/env python import sys import argparse from aws_ir.libs import case #Support for multiple incident plans coming soon from aws_ir.plans import key from aws_ir.plans import host """Basic arg parser for AWS_IR cli""" class cli(): def __init__(self): self.config = None self.prog = sys.argv[...
Python
0
@@ -43,16 +43,47 @@ gparse%0A%0A +from aws_ir import __version__%0A from aws @@ -1032,16 +1032,170 @@ roup()%0A%0A + optional_args.add_argument(%0A '--version',%0A action='version',%0A version=%22%25(prog)s %7Bver%7D%22.format(ver=__version__))%0A%0A
b338f43d5ea0efe1d97dd28f6c712d262d7ba926
Bump version to 0.0.4
backquotes.py
backquotes.py
#!/usr/bin/env python # -*- coding:ascii -*- import contextlib import inspect import locale import optparse import os import string import subprocess import sys import tempfile import tokenize import warnings __all__ = ['shell', 'preprocess'] __version__ = '0.0.3' def shell(argstring): r"""Invoke shell command...
Python
0.000001
@@ -258,17 +258,17 @@ = '0.0. -3 +4 '%0A%0A%0Adef
0d4fda58516d8b52f6ecb67e9dc29d38990e778a
Fix regular expression escaping
bai2/utils.py
bai2/utils.py
import datetime import re from .constants import TypeCodes def parse_date(value): """ YYMMDD Format. """ return datetime.datetime.strptime(value, '%y%m%d').date() def write_date(date): return date.strftime('%y%m%d') def parse_time(value): clock_pattern = re.compile('\d\d:\d\d:\d\d') ...
Python
0.999998
@@ -290,16 +290,17 @@ compile( +r '%5Cd%5Cd:%5Cd
428d5809e16e84fc5c121eeffd76118e31a08873
Update api.py
blockr/api.py
blockr/api.py
""" The main API class. This class contains all the API HTTP call methods. This class uses the util class as helper, and gets its bootstrap from the ApiService class. """ import requests as r import utils from service import ApiService class Api(ApiService): """ The main API class. Calls the Block API with HTTP G...
Python
0.000001
@@ -326,24 +326,41 @@ quests. %22%22%22%0A + %22%22%22 Test %22%22%22%0A def __in
214f0e17e0bf6701f5a78c92e1a6583d729da709
Cut 0.16
invocations/_version.py
invocations/_version.py
__version_info__ = (0, 15, 0) __version__ = '.'.join(map(str, __version_info__))
Python
0.000001
@@ -21,9 +21,9 @@ 0, 1 -5 +6 , 0)
302e199694af7f00c48a38060cf29a7a981d4a4e
Test safe generate
lustro/db.py
lustro/db.py
# -*- coding: utf-8 -*- from sqlalchemy import MetaData, Table, Column, Integer, TIMESTAMP, DATETIME, String, create_engine from sqlalchemy.orm import Session from sqlalchemy.ext.automap import automap_base BASIC_TYPES = { String: ['length'], Integer: [], TIMESTAMP: [], DATETIME: [], } class DB(ob...
Python
0.000015
@@ -248,25 +248,8 @@ '%5D,%0A - Integer: %5B%5D,%0A @@ -281,16 +281,33 @@ ME: %5B%5D,%0A + Integer: %5B%5D,%0A %7D%0A%0A%0Aclas @@ -3343,16 +3343,21 @@ .source. +safe_ generate
646a25054b670d1e71199ad8c32b81b9db186404
Fix snapshot search
dbaas/backup/admin/snapshot.py
dbaas/backup/admin/snapshot.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import logging from django.conf.urls import url from django.contrib import admin from django.http import HttpResponseRedirect, Http404 from django.core.urlresolvers import reverse from backup.tasks import make_databases_backup from system....
Python
0.000005
@@ -709,16 +709,28 @@ 'volume +__identifier ')%0A r
1a906ccf91597e49ca5c9561d52e93c8378c45d0
Fix the OpenGL accelerate problem (see Mike Fletcher answer on pyopengl-users mailig list)
glumpy/gl.py
glumpy/gl.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2014, Nicolas P. Rougier # Distributed under the (new) BSD License. See LICENSE.txt for more info. # ----------------------------------------------------------------------------- import ctypes from gl...
Python
0.000001
@@ -376,16 +376,539 @@ = True%0A +%0Afrom OpenGL.plugins import FormatHandler%0AFormatHandler( 'glumpy',%0A 'OpenGL.arrays.numpymodule.NumpyHandler',%5B%0A 'glumpy.gloo.buffer.VertexBuffer',%0A 'glumpy.gloo.buffer.IndexBuffer',%0A 'glumpy.gloo.textur...
0848439552f40ca55bf06e3c01f77d557cb90c9b
make M5_PATH a real search path
configs/common/SysPaths.py
configs/common/SysPaths.py
# Copyright (c) 2006 The Regents of The University of Michigan # 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 ...
Python
0.022102
@@ -1755,16 +1755,203 @@ _path)%0A%0A +def searchpath(path, file):%0A for p in path:%0A f = joinpath(p, file)%0A if os.path.exists(f):%0A return f%0A raise IOError, %22Can't find file '%25s' on path.%22 %25 file%0A%0A def disk @@ -1978,28 +1978,30 @@ %0A return -join +search path(...
9a76b26f6e00a768bc0c441d6b61e909dfa3b163
Fix 'adr-query' so it always uses format: 'table' (making it easier to format results for the terminal)
adr/query.py
adr/query.py
from __future__ import print_function, absolute_import import datetime import json import logging import os import sys from argparse import ArgumentParser import jsone import requests import yaml from six import string_types from .formatter import all_formatters from .main import log here = os.path.abspath(os.path....
Python
0.000128
@@ -1341,16 +1341,97 @@ limit'%5D%0A + if 'format' in context:%0A query%5B'format'%5D = context%5B'format'%5D%0A%0A @@ -2981,16 +2981,43 @@ t': 10,%0A + 'format': 'table',%0A %7D%0A%0A @@ -3339,16 +3339,71 @@ dges'%5D:%0A + if 'partitions' in edge%5B'domain'%5D...
b0e1ae088e8db2c1c97133f3f94f1725e5b72773
Use the samples form.
gpmcc/dim.py
gpmcc/dim.py
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writi...
Python
0
@@ -6939,10 +6939,22 @@ ax=ax +, hist=False )%0A
0c7bd7734cf34e818abb32ca91a251bd55d5d400
Add comment about 1940 and 1944 Olympics to glyphs/sprint
examples/glyphs/sprint.py
examples/glyphs/sprint.py
from __future__ import print_function from bokeh.document import Document from bokeh.embed import file_html from bokeh.browserlib import view from bokeh.resources import INLINE from bokeh.models.glyphs import Circle, Text from bokeh.models import ColumnDataSource, Range1d, DataRange1d, Plot, LinearAxis, SingleInterval...
Python
0
@@ -3144,16 +3144,266 @@ glyph)%0A%0A +no_olympics_glyph = Text(x=7.5, y=1942, text=%5B%22No Olympics in 1940 or 1944%22%5D,%0A text_align=%22center%22, text_baseline=%22middle%22,%0A text_font_size=%2210pt%22, text_font_style=%22italic%22, text_color=%22silver%22)%0Ano_olympics = plot.add_glyph(no_olympics_glyp...
76227c8ffb44837ba1ee71a052948f9ed5d40f0e
Revert "Fuse masking into custom kernels"
examples/kmeans/kmeans.py
examples/kmeans/kmeans.py
import argparse import contextlib import time import matplotlib.pyplot as plt import numpy as np import six import cupy @contextlib.contextmanager def timer(message): cupy.cuda.Stream.null.synchronize() start = time.time() yield cupy.cuda.Stream.null.synchronize() end = time.time() print('%s...
Python
0
@@ -553,22 +553,20 @@ 'T x, S -p, S i +mask ', 'T ou @@ -574,22 +574,20 @@ ',%0A ' -p == i +mask ? x : 0 @@ -685,14 +685,12 @@ 'T -p, S i +mask ', ' @@ -712,14 +712,12 @@ ' -p == i +mask ? 1 @@ -1710,33 +1710,51 @@ clusters -, dtype=np.int32) +)%0A mask = pred == i%5B:, None%5D %0A @@...
004cfe5528749209ff0763d2e5859a83ae4e05fe
fix encoding autodetection
grab/html.py
grab/html.py
# -*- coding: utf-8 -*- import re from htmlentitydefs import name2codepoint import logging def decode_entities(text): """ Convert HTML entities to their unicode analogs. """ re_entity = re.compile(r'(&[a-z]+;)') re_num_entity = re.compile(r'(&#\d+;)') def process_entity(match): entity...
Python
0.000031
@@ -1259,17 +1259,16 @@ codings) -) %0A%0A fo
8c3c8582a97e37e162c76ca76b99de3db0d58822
Add additional in-memory data.
flask/app.py
flask/app.py
#!/usr/bin/env python from flask import Flask, jsonify, request, render_template from flask.ext.sqlalchemy import SQLAlchemy from sqlalchemy import create_engine from random import randint from operator import attrgetter try: import MySQLdb mysql_schema = "mysql:" except ImportError: mysql_schema = "mysql+...
Python
0.000001
@@ -2481,16 +2481,104 @@ .all())%0A + fortunes.append(Fortune(id=0, message=%22Additional fortune added at request time.%22))%0A fort @@ -2874,16 +2874,104 @@ ssage))%0A + fortunes.append(Fortune(id=0, message=%22Additional fortune added at request time.%22))%0A fort
aad92a59970e1f245a10f515e62ab3c26f54a4e2
add get single bucket items by id
app/mod_bucketlists/controller.py
app/mod_bucketlists/controller.py
from flask import Blueprint, request, jsonify from flask_httpauth import HTTPTokenAuth from itsdangerous import BadTimeSignature, BadSignature from app import token_signer from app.mod_bucketlists.models import BucketList mod_bucketlists = Blueprint('bucketlists', __name__, url_prefix='/bucketlists') auth = HTTPToken...
Python
0
@@ -215,16 +215,32 @@ cketList +, BucketListItem %0A%0Amod_bu @@ -2608,24 +2608,1339 @@ etlist(id):%0A + bucket_list = BucketList.query.filter_by(id=id).scalar()%0A%0A if not bucket_list:%0A return jsonify(%7B%0A 'error': %7B%0A 'message': 'bucket list not found',%0A ...
56567351793a433ed7d3ea8853e523289fa64615
Use simple function instead of Module for filtering muons
examples/plot_dom_hits.py
examples/plot_dom_hits.py
""" ================== DOM hits. ================== This example shows how to create DOM hits statistics to estimate track distances. """ from collections import defaultdict, Counter import km3pipe as kp import pandas as pd import matplotlib.pyplot as plt from matplotlib.colors import LogNorm from km3modules impor...
Python
0
@@ -568,34 +568,29 @@ )%0A%0A%0A -class MuonFilter(kp.Module +def filter_muons(blob ):%0A @@ -617,17 +617,17 @@ s from M -C +c Tracks t @@ -642,41 +642,8 @@ %22%22%22%0A - def process(self, blob):%0A @@ -664,36 +664,32 @@ 'McTracks'%5D%0A - - muons = %5Bt for t @@ -725,20 +725,16 @@ e == 5...
87849f6be8b9d962bcd6b58da32e13c52f5273a2
Add SYNC_ON_PAUSE (def. True; requested by john24)
syncplay/constants.py
syncplay/constants.py
#You might want to change these DEFAULT_PORT = 8999 OSD_DURATION = 3 OSD_WARNING_MESSAGE_DURATION = 15 MPC_OSD_POSITION = 2 #Right corner, 1 for left MPLAYER_OSD_LEVEL = 1 UI_TIME_FORMAT = "[%X] " CONFIG_NAMES = [".syncplay", "syncplay.ini"] #Syncplay searches first to last DEFAULT_CONFIG_NAME_WINDOWS = "syncpl...
Python
0
@@ -933,16 +933,119 @@ = False%0D +%0ASYNC_ON_PAUSE = True # Client seek to global position - subtitles may disappear on some media players%0D %0A%0D%0A#Usua
db58c5d80206ff2d07bce29b56d5aa6f9fc3b347
Fix sampling bug (log proba)
deepmusic/modules/loopprocessing.py
deepmusic/modules/loopprocessing.py
# Copyright 2016 Conchylicultor. 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 ...
Python
0
@@ -2221,90 +2221,8 @@ %22%22%22%0A - # Could use the Gumbel-Max trick to sample from a softmax distribution ?%0A%0A @@ -2327,16 +2327,508 @@ t()%5B-1%5D%0A +%0A if False: # TODO: Add option to control argmax%0A #label_draws = tf.argmax(prev_output, 1)%0A label_draws = tf.mu...
25dccd7db4c3c5552dcd21cb8ef611bf8f6585e5
fix strings tests
werkzeug/testsuite/local.py
werkzeug/testsuite/local.py
# -*- coding: utf-8 -*- """ werkzeug.testsuite.local ~~~~~~~~~~~~~~~~~~~~~~~~ Local and local proxy tests. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import time import unittest from threading import Thread from werkzeug.testsuite import WerkzeugTestC...
Python
0.000558
@@ -2159,33 +2159,32 @@ (self):%0A -_ foo = %22foo%22%0A @@ -2187,19 +2187,18 @@ -foo +ls = local @@ -2237,19 +2237,18 @@ assert -foo +ls + %22bar%22 @@ -2283,19 +2283,18 @@ %22bar%22 + -foo +ls == %22bar @@ -2313,19 +2313,18 @@ assert -foo +ls * 2 == @@ -2341,17 +2341,16 @@ ...
07eb518143f72d1b14d8f6c1aef74688e383a229
Remove invalid escaped newline
contrib/deploy.py
contrib/deploy.py
#!/usr/bin/env python import argparse import os import subprocess parser = argparse.ArgumentParser(prog='simplecoin RPC') parser.add_argument('-l', '--log-level', choices=['DEBUG', 'INFO', 'WARN', 'ERROR']) subparsers = parser.add_subparsers(title='main subcommands', dest='action') subparsers.add_...
Python
0.000003
@@ -1414,18 +1414,16 @@ = %5C%22%7B%7D%5C%22 -%5Cn %22 %3E%3E pow
4779a4aa84012d0326a4bfd896d0ad503407f5f9
update initial migration with non-deprecated IP field (#3)
dialogos/migrations/0001_initial.py
dialogos/migrations/0001_initial.py
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 ...
Python
0
@@ -1808,16 +1808,23 @@ models. +Generic IPAddres
64aeb2c576679c4a4628d160e11b4867b2fb6388
Update test_tags.py
jet/tests/test_tags.py
jet/tests/test_tags.py
from django import forms from django.core.urlresolvers import reverse from django.test import TestCase from jet.templatetags.jet_tags import jet_select2_lookups, jet_next_object_url, jet_previous_object_url from jet.tests.models import TestModel, SearchableTestModel class TagsTestCase(TestCase): def setUp(self): ...
Python
0.000002
@@ -260,16 +260,61 @@ stModel%0A +from django.test.client import RequestFactory %0A%0Aclass @@ -2415,174 +2415,8 @@ ld%0A%0A - context = %7B%0A 'original': instance,%0A 'preserved_filters': preserved_filters%0A %7D%0A%0A actual_url = jet_next_object_url(context)%0A @...
4a782f94e8fe5a26e2998408c2cb013f2aebe9ac
Remove reference to old, bad migration that was in my local tree.
contentcuration/contentcuration/migrations/0091_auto_20180724_2243.py
contentcuration/contentcuration/migrations/0091_auto_20180724_2243.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.13 on 2018-07-24 22:43 from __future__ import unicode_literals import django.contrib.postgres.fields.jsonb from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('contentcuration', '0090_auto_20180724_1625'), ] ...
Python
0
@@ -282,10 +282,10 @@ '00 +8 9 -0 _aut @@ -296,15 +296,15 @@ 1807 -24_1625 +06_2242 '),%0A
1e06d42ed92d6aac0ab3311d5cc5845d5860dca2
fix showing user in admin
jmboyourwords/admin.py
jmboyourwords/admin.py
from django.contrib import admin from jmboyourwords.models import YourStoryCompetition, YourStoryEntry from ckeditor.widgets import CKEditorWidget from django.db import models class YourStoryCompetitionAdmin(admin.ModelAdmin): list_filter = ('created', 'publish_on', 'retract_on') list_display = ('title', 'pub...
Python
0
@@ -1399,18 +1399,8 @@ user -__username ', '
736f2e423d4354777473053cbf0f7de2b09fc885
Add a guard to avoid gcc <= 4.8 due its poor and broken regex support
worker/scripts/configure.py
worker/scripts/configure.py
#!/usr/bin/env python # File inspired in https://github.com/indutny/bud import platform import os import subprocess import sys version = sys.version_info[0] if version != 2: raise RuntimeError('gyp requires Python 2, but this is Python ' + str(version) + ', ensure your python2 or python command points to the Pyth...
Python
0.000002
@@ -2979,16 +2979,150 @@ _clang)) +%0A if is_clang == False and major == 4 and minor %3C= 8:%0A raise RuntimeError('gcc %3C= 4.8 not supported, please upgrade your gcc') %0A%0A if n
9a5797b897898b0c4ca38c50508564d0f2ffc1d1
Add selection feature
src/main/translator-xml/XMLTranslator.py
src/main/translator-xml/XMLTranslator.py
#!/usr/bin/env python class XMLTranslator: def __init__(self): self.constructs = { "PrimAct": self.handle_action, "PrimIter": self.handle_iteration, "PrimSeq": self.handle_sequence, "PrimTask": self.handle_sequence # More.. } # Get d...
Python
0
@@ -14,16 +14,62 @@ v python +%0Aimport lxml%0Aimport sys%0Afrom lxml import etree %0A%0Aclass @@ -311,24 +311,71 @@ dle_sequence +,%0A %22PrimSeln%22: self.handle_selection %0A @@ -4684,124 +4684,714 @@ -pass%0A%0A def translate_xml(self, xml_string):%0A import lxml%0A ...
69a8528801ae5c3fdde57b9766917fcf8690c54e
Fix args manipulation in when translating ksdefs
telephus/translate.py
telephus/translate.py
class APIMismatch(Exception): pass def translateArgs(request, api_version): args = request.args if request.method == 'system_add_keyspace' \ or request.method == 'system_update_keyspace': args = adapt_ksdef_rf(args[0]) + args[1:] return args def postProcess(results, method): if method ...
Python
0.000063
@@ -207,19 +207,28 @@ a -rgs +dapted_ksdef = adapt @@ -245,16 +245,48 @@ args%5B0%5D) +%0A args = (adapted_ksdef,) + args%5B
4e72db45afe0fc85c7e306eb056f19fca5e72bd4
Bump to v0.4.0.
version.py
version.py
version = '0.3' release = False if not release: version += '.a2.dev'
Python
0
@@ -10,9 +10,11 @@ '0. -3 +4.0 '%0Are @@ -25,12 +25,11 @@ e = -Fals +Tru e%0A%0Ai @@ -64,11 +64,8 @@ = '. -a2. dev'
4fcd2fdb43ab331be1e15742756a4b142c436ab4
Add docstring for lzip()
funcy/py2.py
funcy/py2.py
import sys from .calc import * from .colls import * from .tree import * from .decorators import * from .funcolls import * from .funcs import * from .seqs import * from .types import * from .strings import * from .flow import * from .objects import * from .debug import * from .primitives import * # Setup __all__ modu...
Python
0
@@ -631,16 +631,50 @@ *seqs):%0A + %22%22%22List zip() version.%22%22%22%0A
97c74e828b23c149bb7a4003f51f893f946d434c
Make requested changes
bqplot/map.py
bqplot/map.py
# Copyright 2015 Bloomberg Finance L.P. # # 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 i...
Python
0.000001
@@ -1469,24 +1469,33 @@ t color for +items of the map when @@ -1519,16 +1519,16 @@ passed%0A - tool @@ -2315,16 +2315,199 @@ red on%0A%0A + Data Attributes%0A ---------------%0A color_data: Dict or None (default: None)%0A dictionary containing the data associated with every country for the%0...
739e1b169af8b1abded51eb0cd225d95d33e40f9
Update runtests.py for compatibility with Django 1.7.
runtests.py
runtests.py
#!/usr/bin/env python import os, sys from django.conf import settings if not settings.configured: settings_dict = dict( INSTALLED_APPS=( 'django.contrib.contenttypes', 'model_utils', 'model_utils.tests', ), DATABASES={ "default": { ...
Python
0
@@ -69,55 +69,40 @@ ngs%0A -%0A%0Aif not settings.configured:%0A settings_dict +import django%0A%0A%0ADEFAULT_SETTINGS = d @@ -106,20 +106,16 @@ = dict(%0A - INST @@ -135,20 +135,16 @@ - - 'django. @@ -166,36 +166,32 @@ types',%0A - 'model_utils',%0A @@ -193,28 +193,24 @@ ...
f2327b13035ca45c1befb15490c73206f8ac31da
disable wrong-import-position pylint warning
joint-gen/joint_gen.py
joint-gen/joint_gen.py
#!/usr/bin/python """ Joint adapters generator """ from __future__ import print_function import argparse import os import joint import joint.generators MYPY = False if MYPY: import typing # pylint: disable=locally-disabled, import-error, unused-import class CmdLineException(Exception): pass def parse...
Python
0
@@ -255,16 +255,39 @@ d-import +, wrong-import-position %0A%0A%0Aclass
d3a0d7e2cf1685ce6c69d182faa309f228aa84c0
use fixture to mock application
xoinvader/tests/conftest.py
xoinvader/tests/conftest.py
"""Pytest configuration.""" import pytest from xoinvader import application from xoinvader import state @pytest.fixture def mock_application(request): def inner(): return MockedApplication() request.addfinalizer(MockedApplication._finalize) return inner @pytest.fixture def mock_state(request...
Python
0
@@ -305,32 +305,50 @@ ck_state(request +, mock_application ):%0A%0A def inne @@ -391,39 +391,38 @@ pp:%0A -MockedA +mock_a pplication()%0A
cca0355da80a2c136b8bf02eb43d55ff9da8e1ff
change youtube video folder and add log out
youtube_video_downloader.py
youtube_video_downloader.py
# Eric 2016/11/09 from __future__ import unicode_literals import youtube_dl import mysql.connector conn = mysql.connector.connect(user='taloscar', password='taloscar', database='taloscar', host='10.161.23.57') cursor = conn.cursor() def get_to_download_video_urls(): urls_with_ids = query_from_mysql() for url...
Python
0
@@ -622,16 +622,22 @@ tmpl': ' +/home/ youtube_ @@ -764,16 +764,63 @@ as ydl:%0A + print 'start to download: ' + video_id%0A
70b6257ae94b7ca951a8b052acff8a75294abbd5
Add unit tests
matriochkas/tests/Wrappers.py
matriochkas/tests/Wrappers.py
# coding: utf8 from matriochkas.core.Wrappers import ReadingWrapper from io import StringIO from threading import Thread from time import sleep class ThreadRoot(Thread): def __init__(self, method, name): super(ThreadRoot, self).__init__() self.arCharacter = dict() self.method = method ...
Python
0.000001
@@ -1339,16 +1339,353 @@ ep(1)%0A%0A%0A +class ThreadD(ThreadRoot):%0A def __init__(self, method, name, wrapper):%0A super(ThreadD, self).__init__(method, name)%0A self.wrapper = wrapper%0A%0A def run(self):%0A self.arCharacter%5B1%5D = self.method(1, self.name)%0A sleep(1)%0A ...
b3d00273e414913357da8e71decf04df59060281
return login result
atomic_reactor/koji_util.py
atomic_reactor/koji_util.py
""" Copyright (c) 2016 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from __future__ import print_function, unicode_literals import koji import logging import os import time logger = logging.getLogger(__nam...
Python
0.002486
@@ -1092,32 +1092,41 @@ cation%22)%0A + result = session.ssl_log @@ -1161,24 +1161,33 @@ r, 'cert'),%0A + @@ -1253,32 +1253,41 @@ + os.path.join(ssl @@ -1307,24 +1307,33 @@ serverca'),%0A + @@ -1590,16 +1590,25 @@ %0A + result...
56efe455c0f7163704302d7732a1da61fcb76136
Update kissfft to fix stdint.h issue on Windows
third_party/kissfft/workspace.bzl
third_party/kissfft/workspace.bzl
"""Loads the kissfft library, used by TF Lite.""" load("//third_party:repo.bzl", "third_party_http_archive") def repo(): third_party_http_archive( name = "kissfft", strip_prefix = "kissfft-cddf3833fdf24fa84b79be37efdcd348cae0e39c", sha256 = "7ba83a3da1636350472e501e3e6c3418df72466990530ea2...
Python
0
@@ -208,133 +208,133 @@ fft- -cddf3833fdf24fa84b79be37efdcd348cae0e39c%22,%0A sha256 = %227ba83a3da1636350472e501e3e6c3418df72466990530ea273c05fa7e3dd8635 +36dbc057604f00aacfc0288ddad57e3b21cfc1b8%22,%0A sha256 = %2242b7ef406d5aa2d57a7b3b56fc44e8ad3011581692458a69958a911071efdcf2 %22,%0A @@ -434,48 +43...
8e89d98a6acf309a52b852c4fd6c70bab5329fc5
Use MultiSourceDict for env.conf
fabdeploy/base.py
fabdeploy/base.py
import os import sys import posixpath import logging from collections import OrderedDict from fabric.api import env from fabric import network from fabric.state import _AttributeDict from fabdeploy.containers import MultiSourceDict from fabdeploy.utils import get_home_path logger = logging.getLogger('fabdeploy') ...
Python
0
@@ -3307,25 +3307,26 @@ conf = -_Attribut +MultiSourc eDict()%0A
1b1534967c6494d89d76d03c7487f5b02808bb4c
Fix mac build for XCode v6.0
tools/gyp/find_mac_gcc_version.py
tools/gyp/find_mac_gcc_version.py
#!/usr/bin/env python # Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file # for details. All rights reserved. Use of this source code is governed by a # BSD-style license that can be found in the LICENSE file. import re import subprocess import sys def main(): job = subprocess.Popen(['xcode...
Python
0.000006
@@ -976,16 +976,30 @@ jor == 5 + or major == 6 :%0A
0bdaa25cdbc66b453061fb5d1497e6b5bb41bde5
use a set rather than list(set())
lice/core.py
lice/core.py
from pkg_resources import (resource_stream, resource_listdir) import argparse import datetime import re import os import subprocess import sys import getpass LICENSES = [] for file in sorted(resource_listdir(__name__, '.')): match = re.match(r'template-([a-z0-9_]+).txt', file) if match: LICENSES.appen...
Python
0.002541
@@ -1843,18 +1843,21 @@ keys = -%5B%5D +set() %0A for @@ -1930,20 +1930,17 @@ keys.a -ppen +d d(match. @@ -1972,18 +1972,13 @@ ist( -set( keys) -) %0A%0A%0Ad
172768dacc224f3c14e85f8e732209efe9ce075a
Set the default prefix for ProjectSurveys to gsoc_program.
app/soc/models/project_survey.py
app/soc/models/project_survey.py
#!/usr/bin/python2.5 # # Copyright 2009 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
Python
0
@@ -985,88 +985,8 @@ gs)%0A - # TODO: prefix has to be set to gsoc_program once data has been transferred%0A @@ -1000,16 +1000,21 @@ efix = ' +gsoc_ program'
06580107368a258c97db2a5f7456e270c414c76d
Make traversal example executable
examples/web_traversal.py
examples/web_traversal.py
#!/usr/bin/env python3 """ Filesytem browser that demponstrates usage of traversal routing and non-string endpoints. """ import asyncio import os import string from aiohttp.abc import AbstractRouter, AbstractMatchInfo from aiohttp.web import (Application, Response, HTTPNotFound, HTTPFound, HTT...
Python
0.998474
f0b8f05da951cc49eb53809e12e6287fd4ab3436
Update urls.py
farnswiki/urls.py
farnswiki/urls.py
from django.conf.urls import url, patterns from django.conf import settings urlpatterns = patterns( "farnswiki.views", ) for binder in settings.WIKI_BINDERS: urlpatterns += patterns( "farnswiki.views", url(binder.root + r"/page/(?P<slug>[^/]+)/$", "page", {"binder": binder}, name=binder.page...
Python
0.000002
@@ -1,24 +1,92 @@ +%22%22%22%0AXXX:%0AThis module is deprecated and marked for replacement.%0A%22%22%22%0A%0A %0Afrom django.conf.urls i
be1d4f0f4f0b98e14ce181a1bedd93a293a93400
Fix test with django2
experiments/tests/urls.py
experiments/tests/urls.py
from experiments.urls import urlpatterns from django.conf.urls import include, url from django.contrib import admin urlpatterns += [ url(r'^admin/', include(admin.site.urls)), ]
Python
0.000006
@@ -66,17 +66,8 @@ port - include, url @@ -143,16 +143,8 @@ /', -include( admi @@ -155,13 +155,12 @@ te.urls) -) ,%0A%5D%0A
d1098b070dff6605047045ef0df64d3c6a8d7481
Fix build of mock tests on ARM/Linux
configure.py
configure.py
#!/usr/bin/env python import confu parser = confu.standard_parser("cpuinfo configuration script") parser.add_argument("--log", dest="log_level", choices=("none", "error", "warning", "info", "debug"), default="error") parser.add_argument("--mock", dest="mock", action="store_true") def main(args): options = p...
Python
0.000001
@@ -2540,16 +2540,37 @@ =%22test%22, + include_dirs=%22test%22, deps=%5Bb
d6eb801df33182d46beee5f3c90676c366afdaf4
version bump
djangocms_text_ckeditor/__init__.py
djangocms_text_ckeditor/__init__.py
__version__ = "2.1"
Python
0.000001
@@ -11,10 +11,12 @@ _ = %222.1 +.1 %22%0A
803d76cf792241bab65eea5379e15b3bd37d40f5
Add `-V` to get detailed info for further parsing.
src/pyshark/capture/live_ring_capture.py
src/pyshark/capture/live_ring_capture.py
from pyshark import LiveCapture class LiveRingCapture(LiveCapture): """Represents a live ringbuffer capture on a network interface.""" def __init__(self, ring_file_size=1024, num_ring_files=1, ring_file_name='/tmp/pyshark.pcap', interface=None, bpf_filter=None, display_filter=None, only_summ...
Python
0
@@ -3842,16 +3842,22 @@ me, '-P' +, '-V' %5D%0A
370aa72ea940e34d0d255e65c4c5f2de1130e0ef
updated tweet fake tweet
turingtweets/turingtweets/scripts/tweet_fake_tweet.py
turingtweets/turingtweets/scripts/tweet_fake_tweet.py
import os import tweepy from turingtweets.models import get_engine from sqlalchemy.orm import sessionmaker from turingtweets.models.mymodel import FakeTweet def get_fake_tweet(): test_dict = {'sqlalchemy.url': os.environ.get('DATABASE_URL')} engine = get_engine(test_dict) SessionFactory = sessionmaker(bin...
Python
0.998896
@@ -435,36 +435,43 @@ weet).filter -_by( +(FakeTweet. tweeted= False).first @@ -450,32 +450,33 @@ keTweet.tweeted= += False).first())%0A
fa5bce04765198071c17fa2ee889c16b5dbe6377
Fix negative offset for UTC
arrow/formatter.py
arrow/formatter.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import calendar import re from dateutil import tz as dateutil_tz from arrow import util, locales class DateTimeFormatter(object): _FORMAT_RE = re.compile('(YYY?Y?|MM?M?M?|Do|DD?D?D?|d?dd?d?|HH?|hh?|mm?|ss?|SS?S?S?S?S?|ZZ?|a|A|X)') def __init__(...
Python
0
@@ -3143,16 +3143,17 @@ inutes %3E += 0 else
c2fd5b8f461f48dc00fb29db538775170d1c7abd
Correct models, allow null dates
articles/models.py
articles/models.py
from django.db import models class Bookmark(models.Model): user_id = models.PositiveIntegerField(default=0) read_percent = models.FloatField(default=0.0) date_updated = models.DateTimeField() favorite = models.BooleanField() bookmark_id = models.PositiveIntegerField(default=0) date_archived = models.DateTimeFiel...
Python
0.000002
@@ -187,18 +187,27 @@ meField( +null=True )%0A - %09favorit @@ -234,22 +234,16 @@ eld()%0A%09b -ookmar k_id = m @@ -310,32 +310,41 @@ s.DateTimeField( +null=True )%0A%09date_opened = @@ -361,24 +361,33 @@ teTimeField( +null=True )%0A%09date_adde @@ -407,24 +407,33 @@ teTimeField( +null=True )%0A%09article_h ...
09d3c9aa557a3d9a144b5a566f75526ceb9bf3b6
Use the new #left stuff (with help link) in browse as well.
cgi/browse.py
cgi/browse.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from os import environ, listdir, stat from sys import exit from common import * from os.path import normpath, exists, join as joinpath, isfile, isdir from hashlib import md5 def forbidden(): global outdata print "Status: 403 Forbidden" outdata = [] prt_head() prt(u'<...
Python
0
@@ -1114,35 +1114,25 @@ %0Aprt -(u'%3Cdiv id=%22left%22%3E%5Cn',%0A +_left_head()%0Aprt( u'%3Cu @@ -1234,31 +1234,30 @@ %3E%5Cn' -,%0A u'%3C/div%3E%5Cn',%0A +)%0Aprt_left_foot()%0Aprt( u'%3Cd
d31cbad208ed3b7ac29a5e4957d008f768462ee0
use correct variable name
fastlane_match.py
fastlane_match.py
# -*- coding: utf-8 -*- #!/usr/bin/python import subprocess import sys import requests def not_in(x): not_in_filters = ['ProfileUUID', 'development', 'sigh_org'] is_in = False for not_in_filter in not_in_filters: is_in = not_in_filter in x if is_in: break return not is_in...
Python
0.671751
@@ -1178,23 +1178,25 @@ dev -UUID +_uuid , store -UUID +_uuid )%0A
da484c074400d2d37fa8357babbf747603b10760
fix for keyError
toolset/setup/linux/setup_util.py
toolset/setup/linux/setup_util.py
import re import os import sys import subprocess import platform from threading import Thread from Queue import Queue, Empty class NonBlockingStreamReader: ''' Enables calling readline in a non-blocking manner with a blocking stream, such as the ones returned from subprocess.Popen Originally written by Eyal...
Python
0.000002
@@ -2024,32 +2024,31 @@ if os. -environ%5B +getenv( 'FWROOT' %5D:%0A @@ -2039,17 +2039,17 @@ 'FWROOT' -%5D +) :%0A
7f2ed7a8f8d8599d945cbf00cd614bdcbda96e6d
Change rpc default to false for dump command in client
eeagent/client.py
eeagent/client.py
import logging import socket from threading import Thread import simplejson as json from dashi.bootstrap import dashi_connect import uuid from eeagent.types import EEAgentLaunchType class EEAgentClient(object): def __init__(self, incoming=None, CFG=None, dashi=None, ee_name=None, pd_name=None, handle...
Python
0
@@ -1399,19 +1399,20 @@ lf, rpc= -Tru +Fals e):%0A @@ -1490,20 +1490,20 @@ e%22, rpc= -True +rpc) %0A
b8934c8854ebac38adaad2487b2b5549ad50fea7
add pop and snp options to eigenstrat2vcf.py
eigenstrat2vcf.py
eigenstrat2vcf.py
#eigenstrat (packed or unpacked) to vcf #Writes to stdout, unlike many of these scripts. #Usage: python eigenstrat2vcf.py -i root #Data files are root.snp, root.ind and root.geno from __future__ import division, print_function import argparse, gdc, pyEigenstrat #Remember, in eigenstrat, 2 means "2 ref copies" GT_DI...
Python
0
@@ -121,15 +121,24 @@ py - -i +r root +%5Boptions%5D %0A#Da @@ -183,16 +183,17 @@ ot.geno%0A + %0Afrom __ @@ -728,16 +728,17 @@ , '--ind +s ', type= @@ -785,16 +785,26 @@ %22 +File with individu @@ -824,16 +824,333 @@ include +, one individual per line%22)%0A parser.add_argument('-p', '--pops',...
48e15b8f99bb0714b7ec465a0131e452c67004e5
Fix index to list when there is no 2nd element
Chapter4_TheGreatestTheoremNeverTold/top_pic_comments.py
Chapter4_TheGreatestTheoremNeverTold/top_pic_comments.py
import sys import numpy as np from IPython.core.display import Image import praw reddit = praw.Reddit("BayesianMethodsForHackers") subreddit = reddit.get_subreddit( "pics" ) top_submissions = subreddit.get_top() n_pic = int( sys.argv[1] ) if sys.argv[1] else 1 i = 0 while i < n_pic: top_submission = top_su...
Python
0.000016
@@ -243,24 +243,28 @@ 1%5D ) if +len( sys.argv %5B1%5D else @@ -255,19 +255,21 @@ sys.argv -%5B1%5D +) %3E 1 else 1%0A @@ -1023,32 +1023,16 @@ ontinue%0A - %0Avotes = @@ -1076,76 +1076,20 @@ %0A%0A%0A%0A - %0A %0A %0A %0A %0A %0A %0A %0A %0A %0A %0A %0A %...
73e8bfdc5a125ea88403c7cbd475cdabdad4725b
make tmpfile utf8 encode conditional
lint/util.py
lint/util.py
import os import shutil import tempfile import subprocess def merge_user_settings(settings): default = settings.get('default') or {} user = settings.get('user') or {} if user: plugins = default.pop('plugins', {}) user_plugins = user.get('plugins', {}) for name, data in user_plugins....
Python
0.000253
@@ -3096,35 +3096,85 @@ -f.write(code.encode('utf8') +if isinstance(code, str):%0A code = code.encode('utf8')%0A f.write(code )%0A
61b363de6ac007f8109e6dd7dc960d9dda4b226e
Bump version to 0.9pbs.47
filer/__init__.py
filer/__init__.py
#-*- coding: utf-8 -*- # version string following pep-0396 and pep-0386 __version__ = '0.9pbs.46' # pragma: nocover
Python
0
@@ -88,17 +88,17 @@ 0.9pbs.4 -6 +7 ' # pra
8b8fa041d293cd092783f4b3f1870859f8f3ac25
Bump develop to 1.1.1.post1
filer/__init__.py
filer/__init__.py
# -*- coding: utf-8 -*- # version string following pep-0396 and pep-0386 __version__ = '1.1.1' # pragma: nocover default_app_config = 'filer.apps.FilerConfig'
Python
0
@@ -87,16 +87,22 @@ = '1.1.1 +.post1 ' # pra
33453445a557b68ea66c640cc3b8e9413a7b6acd
refactor /authentication view
pergenie/apps/authentication/views.py
pergenie/apps/authentication/views.py
import sys, os from smtplib import SMTPException from django.contrib.auth import authenticate, login as auth_login, logout as auth_logout from django.views.decorators.http import require_http_methods from django.shortcuts import render, redirect from django.utils.translation import ugettext as _ from django.utils.tran...
Python
0.000001
@@ -1193,310 +1193,8 @@ ak%0A%0A - email = form.cleaned_data%5B'email'%5D%0A password1 = form.cleaned_data%5B'password1'%5D%0A password2 = form.cleaned_data%5B'password2'%5D%0A terms_ok_0 = form.cleaned_data%5B'terms_ok_0'%5D%0A terms_ok_1 = form.cleaned_data%5B't...
a7abc13bd41e5c0a0aa80370d1f2ffdc28b11f36
Update version.py
entity/version.py
entity/version.py
__version__ = '1.7.5'
Python
0.000001
@@ -14,9 +14,9 @@ '1. -7.5 +8.0 '%0A
f31389fc6dcec7ba9c2d619729d8168ac3919439
update included SMS
corehq/apps/accounting/bootstrap/config/user_buckets_jan_2017.py
corehq/apps/accounting/bootstrap/config/user_buckets_jan_2017.py
from decimal import Decimal from corehq.apps.accounting.models import ( FeatureType, SoftwarePlanEdition, ) BOOTSTRAP_CONFIG = { (SoftwarePlanEdition.COMMUNITY, False): { 'role': 'community_plan_v1', 'product_rate': dict(), 'feature_rates': { FeatureType.USER: dict(mont...
Python
0
@@ -732,18 +732,17 @@ y_limit= -10 +5 0),%0A @@ -1050,17 +1050,16 @@ limit=50 -0 ),%0A @@ -1375,19 +1375,17 @@ y_limit= -100 +5 0),%0A
ddc737501d4ee6fc04728f187be7287db0fe79d8
Lowercase for filename
flask_wtf/file.py
flask_wtf/file.py
from werkzeug import FileStorage from wtforms import FileField as _FileField from wtforms import ValidationError from wtforms.validators import InputRequired, StopValidation class FileField(_FileField): """ Werkzeug-aware subclass of **wtforms.FileField** Provides a `has_file()` method to check if its da...
Python
0.998756
@@ -1930,16 +1930,64 @@ return%0A%0A + filename = field.data.filename.lower()%0A%0A @@ -2051,27 +2051,16 @@ ext = -field.data. filename @@ -2097,24 +2097,16 @@ if ext -.lower() in self @@ -2190,16 +2190,16 @@ ssage)%0A%0A + @@ -2246,27 +2246,16 @@ d.data, -field.data. filename
30fb19ed837e063ac28a0afb0104a93accb511c7
Move location data to line start
flaws/__init__.py
flaws/__init__.py
#!/usr/bin/env python import sys import ast from funcy import all import astor from .asttools import is_write, is_use, is_constant, name_class, node_str, to_source from .scopes import TreeLinker, ScopeBuilder from .infer import Inferer def slurp(filename): with open(filename) as f: return f.read() def...
Python
0.000001
@@ -1068,9 +1068,19 @@ nt ' -U +%25s:%25d:%25d: u ndef @@ -1095,28 +1095,16 @@ iable %25s - at %25s:%25d:%25d ' %5C%0A @@ -1124,22 +1124,16 @@ %25 ( -name, filename @@ -1162,16 +1162,22 @@ l_offset +, name )%0A @@ -1661,16 +1661,26 @@ rint '%25s +:%25d:%25d: %25s %25s is n @@ -1692,20 +1692,8...
d2fb10d2de1931ec7d204dde0b02a62b955df62f
Test for gh-issue #154
distarray/tests/test_client.py
distarray/tests/test_client.py
""" Tests for distarray.client Many of these tests require a 4-engine cluster to be running locally. """ import unittest import numpy as np from numpy.testing import assert_array_equal from six.moves import range from IPython.parallel import Client from distarray.client import Context, DistArray class TestContextCr...
Python
0
@@ -4895,16 +4895,229 @@ ndarr)%0A%0A + def test_global_tolocal_bug(self):%0A # gh-issue #154%0A dap = self.dac.zeros((3, 3), dist=('n', 'b'))%0A ndarr = np.zeros((3, 3))%0A np.testing.assert_array_equal(dap.tondarray(), ndarr)%0A%0A %0Aclass T @@ -6489,17 +6489,16 @@ i, j%5D)%0A%0A -%...
86bff7d5b1d8f25a5160c0ae4705096e391e435f
add a fuzzy option to giant bit
dit/example_dists/giant_bit.py
dit/example_dists/giant_bit.py
""" Giant bit type distributions. """ from ..distconst import uniform def giant_bit(n, k): """ Return a 'giant bit' distribution of size `n` and alphabet size `k`. Parameters ---------- n : int The number of identical bits. k : int The number of states for each bit. Retur...
Python
0.000001
@@ -31,16 +31,107 @@ ns.%0A%22%22%22%0A +from __future__ import division%0A%0Afrom itertools import product%0A%0Afrom .. import Distribution %0Afrom .. @@ -174,16 +174,29 @@ bit(n, k +, fuzzy=False ):%0A %22 @@ -406,16 +406,83 @@ ach bit. +%0A fuzzy : bool%0A If true, add some noise to the giant bit. ...
4f16309ce02c349b9f91833a299428e9bdf49e60
Add TitleDescriptionModel
django_extensions/db/models.py
django_extensions/db/models.py
""" Django Extensions abstract base model classes. """ from django.db import models from django.utils.translation import ugettext_lazy as _ from django_extensions.db.fields import ( AutoSlugField, CreationDateTimeField, ModificationDateTimeField, ) try: from django.utils.timezone import now as datetime_now ...
Python
0.000002
@@ -823,28 +823,24 @@ %0Aclass Title -Slug DescriptionM @@ -872,20 +872,16 @@ %22%22 Title -Slug Descript @@ -968,74 +968,8 @@ elds -%0A and a self-managed %22slug%22 field that populates from the title .%0A @@ -1039,67 +1039,8 @@ -slug = AutoSlugField(_('slug'), populate_from='title')%0A desc @@ ...
a48e82599102c2f079302353b7fa8e2829d32c8e
reword message
contrib/notify_all_users.py
contrib/notify_all_users.py
#!/usr/bin/env python3 # # Send a GUI notification to all logged-in users. # Written by https://github.com/hakavlad . # # Example: # ./notify_all_users.py earlyoom "Low memory! Killing/Terminating process 2233 tail" # # Notification that should pop up: # earlyoom # Low memory! Killing/Terminating process 2233 tai...
Python
0.000131
@@ -2154,20 +2154,24 @@ Running -comm +notify-s end: %25r%22
6ebb601c13b3486d4f787941bf462ea22f3c2993
change to demo charity
foodbank/views.py
foodbank/views.py
import smtplib from django.http.response import HttpResponseRedirect from django.shortcuts import render from django import forms class ContactForm(forms.Form): name = forms.CharField(label='Name *', max_length=50) email = forms.EmailField(label='Email *', max_length=50) message = forms.CharField(label='M...
Python
0
@@ -2325,15 +2325,12 @@ ity/ -1077897 +2050 ?amo
afd27c62049e87eaefbfb5f38c6b61b461656384
Add hash and eq methods to Token
formulae/token.py
formulae/token.py
class Token: """Representation of a single Token""" def __init__(self, _type, lexeme, literal=None): self.type = _type self.lexeme = lexeme self.literal = literal def __repr__(self): string_list = [ "'type': " + str(self.type), "'lexeme': " + str(sel...
Python
0.000001
@@ -190,16 +190,355 @@ iteral%0A%0A + def __hash__(self):%0A return hash((self.type, self.lexeme, self.literal))%0A%0A def __eq__(self, other):%0A if not isinstance(other, type(self)):%0A return False%0A return (%0A self.type == other.type%0A and self.lexeme ...
d5466fc0b1520ccf8a2dcd1f7b5bd8c6471e3343
Fix object as a variable name shadows internal python object, so we don't use object as a variable name
lily/tags/forms.py
lily/tags/forms.py
from django import forms from django.contrib.contenttypes.models import ContentType from django.db.models.query_utils import Q from lily.tags.models import Tag from lily.utils.fields import MultipleInputAndChoiceField from lily.utils.widgets import InputAndSelectMultiple class TagsFormMixin(forms.ModelForm)...
Python
0.000004
@@ -1618,24 +1618,28 @@ +tag_ object, crea @@ -1674,17 +1674,8 @@ ate( -name=tag, %0D%0A @@ -1680,36 +1680,43 @@ - +name=tag,%0D%0A @@ -1797,36 +1797,16 @@ - - content_ @@ -1870,32 +1870,8 @@ ),%0D%0A - ...
f9bffd8c5a12bc038719abf48c2ee8fc00c2e26e
fix tests
src/eduid_webapp/letter_proofing/tests/test_pdf.py
src/eduid_webapp/letter_proofing/tests/test_pdf.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import unittest from collections import OrderedDict from datetime import datetime from six import StringIO, BytesIO from eduid_common.api.testing import EduidAPITestCase from eduid_webapp.letter_proofing.app import init_letter_proofing_app from eduid_weba...
Python
0.000001
@@ -342,16 +342,94 @@ port pdf +%0Afrom eduid_webapp.letter_proofing.settings.common import LetterProofingConfig %0A%0A# We n @@ -4170,16 +4170,193 @@ +# XXX remove this lower casing once the default config in%0A # common.api.testing is lower case%0A app_config = %7Bk.lower(): v for k,v in c...
6514e7ab874fe18f7587aecea8ad35c1767eb7db
Add pep8 fixes
listener/listen.py
listener/listen.py
import argparse import json import time from pygerrit import client from pygerrit import events if __name__ == '__main__': parser = argparse.ArgumentParser( description='Process event stream from Gerrit.') parser.add_argument('-u', '--username', dest='username', help='username...
Python
0
@@ -667,17 +667,16 @@ event()%0A -%0A @@ -1104,27 +1104,24 @@ - event.patchs @@ -1131,16 +1131,17 @@ number + + '.json') @@ -1370,19 +1370,4 @@ m()%0A - exit()%0A
949eca8726c5c221f8e83e2c31ed1156d920915e
fix tables with indices starting with 1
ljd/ast/helpers.py
ljd/ast/helpers.py
import ljd.ast.nodes as nodes def insert_table_record(constructor, key, value): array = constructor.array.contents records = constructor.records.contents if isinstance(key, nodes.MULTRES): assert len(records) == 0 \ or isinstance(records[-1], nodes.TableRecord) records.append(value) return while isins...
Python
0
@@ -403,25 +403,30 @@ ue %3E= 0:%0A%09%09i -f +ndex = key.value %3E @@ -423,16 +423,212 @@ ey.value +%0A%09%09%0A%09%09if index == 1 and len(array) == 0:%0A%09%09%09record = nodes.ArrayRecord()%0A%09%09%09record.value = nodes.Primitive()%0A%09%09%09record.value.type = nodes.Primitive.T_NIL%0A%09%09%09%0A%09%09%09ar...
1f6811843b4e5b7d4afb2af84805f2d8dbeac639
fix pool
everyclass/server/db/postgres.py
everyclass/server/db/postgres.py
from contextlib import contextmanager import psycopg2 from DBUtils.PooledDB import PooledDB from flask import current_app, has_app_context from psycopg2.extras import register_hstore, register_uuid from everyclass.server.config import get_config _config = get_config() _options = f'-c search_path={_config.POSTGRES_SC...
Python
0.000001
@@ -1025,16 +1025,22 @@ ostgres%22 +, None ):%0A
1c1acbf252406d366089e9296643ae674342e43a
bump version
evojax/version.py
evojax/version.py
__version__ = "0.2.13"
Python
0
@@ -17,7 +17,7 @@ .2.1 -3 +4 %22%0A
dc162d6d99b645af5d2b9aca7eae7f3b4080bfde
Update mergeSort.py
mergeSort/python/mergeSort.py
mergeSort/python/mergeSort.py
###################################################### # # # Sort algorithms - MergeSort # # # ###################################################### import operator def merge_sort(lst, compare = operator.lt): if len(lst) < 2: return lst[:] middle = len(lst)/2 lef...
Python
0.000001
@@ -51,31 +51,28 @@ ####%0A#%09%09%09%09%09%09 -%09%09%09%09%09%09%09 + #%0A# @@ -124,23 +124,20 @@ %0A#%09%09%09%09%09%09 -%09%09%09%09%09%09%09 + #%0A##### @@ -1527,8 +1527,9 @@ 17,20%5D) +%0A
76878dbbeeb6fcff9b8d8c9b2798ee9df21923c9
add version 0.8-81 to r-foreign (#20975)
var/spack/repos/builtin/packages/r-foreign/package.py
var/spack/repos/builtin/packages/r-foreign/package.py
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class RForeign(RPackage): """Functions for reading and writing data stored by some versions of E...
Python
0.000001
@@ -250,23 +250,109 @@ %22%22%22 -Functions for r +Read Data Stored by 'Minitab', 'S', 'SAS', 'SPSS', 'Stata', 'Systat',%0A 'Weka', 'dBase', ...%0A%0A R eadi @@ -402,67 +402,81 @@ of +' Epi -%0A Info +' , +' Minitab -, S +',%0A 'S' , +' SAS +' , +' SPSS +' , +' Stata +' , +' Systat -...
6c0ea77d1d5e349329ad36aecaadff13c0ccf6c4
Add list_url for older versions.
var/spack/repos/builtin/packages/r-packrat/package.py
var/spack/repos/builtin/packages/r-packrat/package.py
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
Python
0
@@ -1432,16 +1432,21 @@ url + = %22https @@ -1502,16 +1502,88 @@ .tar.gz%22 +%0A list_url = 'https://cran.r-project.org/src/contrib/Archive/packrat' %0A%0A ve
c110bb5c531819210bc42db31b8bffbc5d7a51cb
refactor template/templates.py
template/templates.py
template/templates.py
"""Module for dealing with project templates.""" from google.appengine.api import memcache from google.appengine.api import taskqueue from google.appengine.ext import ndb import model import settings import shared from mimic.__mimic import common from . import codesite from . import filesystem from . import github ...
Python
0.000005
@@ -348,17 +348,17 @@ ates (ur -i +l , descri @@ -2091,205 +2091,49 @@ s%0A%0A%0A -@ndb.transactional(xg=True)%0Adef _GetRepoCollections():%0A repo_collections = %5B%5D%0A for uri, description in REPO_COLLECTIONS:%0A repo_collection = model.GetOrInsertRepoCollection(uri, description)%0A +def _AddTaskPopulateR...
28929956116f226eecac80630d761142a86b894c
allow keys in show_player
mpf/config_players/show_player.py
mpf/config_players/show_player.py
"""Show config player.""" from copy import deepcopy from mpf.core.config_player import ConfigPlayer class ShowPlayer(ConfigPlayer): """Plays, starts, stops, pauses, resumes or advances shows based on config.""" config_file_section = 'show_player' show_section = 'shows' device_collection = None ...
Python
0.000001
@@ -1184,16 +1184,117 @@ ontext)%0A + if 'key' in s and s%5B'key'%5D:%0A key = s%5B'key'%5D%0A else:%0A key = show%0A%0A @@ -1334,36 +1334,35 @@ %0A if -show +key in instance_dic @@ -1386,36 +1386,35 @@ instance_dict%5B -show +key %5D.stop()%0A @@...
44aa2bb7924c3d18e576f165c79c6422ffedfc9a
allow listing of images not assigned to content
api/views.py
api/views.py
from . import serializers from content import models as content_models from rest_framework import viewsets, mixins from django.db.models import Q class ImageSet(mixins.CreateModelMixin, mixins.UpdateModelMixin, viewsets.ReadOnlyModelViewSet): serializer_class = serializers.Image filter_fields = ('content', 'c...
Python
0
@@ -902,20 +902,19 @@ return -Fals +Tru e%0A
810e12d701e515abd1a03ad4ef11be06fb321523
Fix edge label creation bug
mythril/disassembler/callgraph.py
mythril/disassembler/callgraph.py
from laser.ethereum import svm from z3 import Z3Exception, simplify import re graph_html = '''<html> <head> <style type="text/css"> #mynetwork { background-color: #000000; } body { background-color: #000000; color: #ffffff; } </style> <link href="https://cdnjs.cloudflare.com/ajax/libs/...
Python
0
@@ -2752,18 +2752,16 @@ %22%22)%0A - %0A l @@ -2779,14 +2779,15 @@ ub(%22 +( %5B%5E_%5D +) ( -%5B %5B%5Cd%5D @@ -2806,16 +2806,29 @@ ambda m: + m.group(1) + hex(int @@ -2836,17 +2836,17 @@ m.group( -1 +2 ))), lab
27d5b0d836b0b1b6cec83fbda43d8987f2cdfe88
Fix date ranges.
oneaday_formatter.py
oneaday_formatter.py
from __future__ import print_function from __future__ import unicode_literals import io import logging import geolocation from collections import Counter def filter_events(results): """ Filters out duplicate events, leaving only one unique (DATE, SOURCE, TARGET, EVENT) tuple per day. Parameters ...
Python
0.000048
@@ -5550,17 +5550,17 @@ ent%5B0%5D%5B: -5 +4 %5D%0A mo @@ -5578,11 +5578,11 @@ %5B0%5D%5B -5:7 +4:6 %5D%0A @@ -5598,17 +5598,17 @@ vent%5B0%5D%5B -7 +6 :%5D%0A f
bdc45e56babfd7bbb315e11f43c25e7c77222677
print number of unprimed BDD vars for env, sys
openpromela/slugs.py
openpromela/slugs.py
"""Interface to `slugs` synthesizer.""" from __future__ import absolute_import from __future__ import print_function import datetime import json import logging import os import pprint import subprocess32 import sys import time import tempfile import textwrap import humanize from omega import machines from omega.symboli...
Python
0.000004
@@ -4156,16 +4156,105 @@ owner%5D%0A + print('number of unprimed %7Bowner%7D vars: %7Bn%7D'.format(%0A owner=owner, n=len(a)))%0A a =
75a28cc836c7eed2017ff0b2fab0392def3e0ce2
fix InvalidCryptoBackendError trigering a TypeError thanks dz fixes #13
beaker/exceptions.py
beaker/exceptions.py
"""Beaker exception classes""" class BeakerException(Exception): pass class CreationAbortedError(Exception): """deprecated.""" class InvalidCacheBackendError(BeakerException, ImportError): pass class MissingCacheParameter(BeakerException): pass class LockError(BeakerException): pass class I...
Python
0
@@ -116,17 +116,17 @@ %0A %22%22%22 -d +D eprecate @@ -128,24 +128,25 @@ ecated.%22%22%22%0A%0A +%0A class Invali @@ -307,16 +307,17 @@ pass%0A%0A +%0A class In @@ -367,24 +367,25 @@ portError):%0A +%0A def __in @@ -423,16 +423,49 @@ _init__( +self,%0A 'No supp @@ -503,8 +5...
034bbf1f3a3f3155583cc44d55be282ac6612746
Index http transport
napalm_logs/transport/__init__.py
napalm_logs/transport/__init__.py
# -*- coding: utf-8 -*- ''' napalm-logs pluggable publisher. ''' from __future__ import absolute_import from __future__ import unicode_literals # Import python std lib import logging # Import napalm-logs pkgs # Exceptions from napalm_logs.exceptions import InvalidTransportException # Transport classes from napalm_log...
Python
0
@@ -302,62 +302,8 @@ ses%0A -from napalm_logs.transport.zeromq import ZMQTransport%0A from @@ -400,16 +400,70 @@ ansport%0A +from napalm_logs.transport.zeromq import ZMQTransport%0A # extras @@ -504,16 +504,32 @@ braries%0A +# ~~~ Kafka ~~~%0A from nap @@ -619,32 +619,45 @@ afkaTransport%0A# +~~~ HTTP ~~~%0A f...
d012763c57450555d45385ed9b254f500388618e
Use the same normlization for whole gif
automata/render.py
automata/render.py
import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import matplotlib.animation as animation class AnimatedGif: """ Setup various rendering things """ def __init__(self, dpi=100, colors="Purples"): self.frames = [] self.fig = plt.figure(dpi=dpi) plt.axis("off")...
Python
0.000001
@@ -34,16 +34,41 @@ 'Agg')%0A%0A +import matplotlib.colors%0A import m @@ -368,16 +368,71 @@ colors%0A + self.normalize = matplotlib.colors.Normalize()%0A @@ -968,16 +968,37 @@ niverse, + norm=self.normalize, cmap=se
a4156b72bd31dbedda29c30ac1963eaad1e2c98f
Use `is` rather than `==` for what is now an instance check
nestedtransactions/transaction.py
nestedtransactions/transaction.py
import logging from collections import defaultdict from psycopg2.extensions import TRANSACTION_STATUS_INTRANS _log = logging.getLogger(__name__) _log.setLevel(logging.WARN) class Transaction(object): __transaction_stack = defaultdict(list) # cxn -> [active_transaction_contexts] def __init__(self, cxn, for...
Python
0.000001
@@ -1649,18 +1649,18 @@ k.pop() -== +is self, (
02fd9bf809b3d94f91e1526d69fd1099312436b2
embed into destination file, not source file
beetsplug/convert.py
beetsplug/convert.py
# This file is part of beets. # Copyright 2012, Jakob Schnitzer. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy,...
Python
0
@@ -3231,61 +3231,8 @@ st)%0A - dest_item = library.Item.from_path(dest)%0A @@ -3445,20 +3445,44 @@ tpath, %5B -item +library.Item.from_path(dest) %5D)%0A%0A%0Adef
7b7f386b393947a542b87707499f4458136f4f61
use env for token (#550)
autosynth/multi.py
autosynth/multi.py
#!/usr/bin/env python3.6 """Synthesizes multiple libraries and reports status.""" import argparse import functools import importlib import os import subprocess import sys import jinja2 import yaml from autosynth import executor, github from autosynth.log import logger def run(args, *, cwd=None, check=True): t...
Python
0
@@ -305,16 +305,32 @@ eck=True +, env=os.environ ):%0A t @@ -530,16 +530,37 @@ utf-8%22,%0A + env=env,%0A @@ -1005,54 +1005,68 @@ -library_args = %5B%0A %22-- +env = os.environ%0A env%5B%22GITHUB_TOKEN%22%5D = github -- +_ token -%22, +%0A %0A @@ -1074,25 +1074,...
5fdb39f158fea385c25cae93e47fc91683222724
Fix person_by_id call.
fedora/django/__init__.py
fedora/django/__init__.py
# -*- coding: utf-8 -*- # # Copyright © 2009 Ignacio Vazquez-Abrams All rights reserved. # # This copyrighted material is made available to anyone wishing to use, modify, # copy, or redistribute it subject to the terms and conditions of the GNU # General Public License v.2. This program is distributed in the hope tha...
Python
0.000001
@@ -1445,16 +1445,23 @@ arams=%7B' +person_ id': use
174d037435f8f2f86778099472eb77c9899308e8
add author to image admin
filer/admin/imageadmin.py
filer/admin/imageadmin.py
#-*- coding: utf-8 -*- from django import forms from django.utils.translation import ugettext as _ from filer import settings as filer_settings from filer.admin.fileadmin import FileAdmin from filer.models import Image class ImageAdminForm(forms.ModelForm): subject_location = forms.CharField( max_length=6...
Python
0
@@ -1441,16 +1441,26 @@ fields=( +'author', 'default