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
2bf0c9e0d8bbce50f06ca08c79f97ecf5b76e21b
Fix logging
simplesqlite/_logger.py
simplesqlite/_logger.py
# encoding: utf-8 """ .. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com> """ from __future__ import absolute_import, unicode_literals import logbook import tabledata logger = logbook.Logger("SimpleSQLie") logger.disable() def set_logger(is_enable): if is_enable != logger.disabled: return...
Python
0.000007
@@ -158,16 +158,36 @@ logbook%0A +import sqliteschema%0A import t @@ -445,24 +445,63 @@ (is_enable)%0A + sqliteschema.set_logger(is_enable)%0A try:%0A @@ -1340,24 +1340,66 @@ (log_level)%0A + sqliteschema.set_log_level(log_level)%0A try:%0A
930508e5ec00d9f174409097ba54e70c7c6b2b3c
Fix #421: RPN_DEFNS needs to passed to Pelegant via env
sirepo/pkcli/elegant.py
sirepo/pkcli/elegant.py
# -*- coding: utf-8 -*- """Wrapper to run elegant from the command line. :copyright: Copyright (c) 2015 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function from pykern import pkio from pykern import pkresour...
Python
0
@@ -1601,16 +1601,108 @@ binary%0A + env = copy.deepcopy(os.environ)%0A env%5B'RPN_DEFNS'%5D = pkresource.filename('defns.rpn')%0A if w @@ -1809,100 +1809,17 @@ FILE -)%0A env = copy.deepcopy(os.environ)%0A env%5B'RPN_DEFNS'%5D = pkresource.filename('defns.rpn' +, env=env )%0A
5c8a6072309989ac97eefc2a6f63a6082a2c5ff0
Update matching_specific_string.py
hacker_rank/contests/regular_expresso/matching_specific_string.py
hacker_rank/contests/regular_expresso/matching_specific_string.py
Python
0.000002
@@ -0,0 +1,52 @@ +Regex_Pattern = r'hackerrank'%09# Do not delete 'r'.%0D%0A
05b15f2db049e8b722f17867f5163c0b6e3a3108
Allow POST to /git-update url.
pthemes.py
pthemes.py
import os import logging from flask import Flask, render_template, redirect, url_for, flash from pq import PQ from api import APIGrabber from db import PonyDB logging.basicConfig() # Config # --------------- # App config app = Flask(__name__) app.config.from_object(os.environ.get('APP_SETTINGS', None)) db = PonyDB(a...
Python
0
@@ -1256,16 +1256,24 @@ s=%5B'GET' +, 'POST' %5D)%0Adef r
865053d4a401bda2b6435d4449111f8997656863
active is an integer field
mint/django_rest/rbuilder/users/models.py
mint/django_rest/rbuilder/users/models.py
# # Copyright (c) 2011 rPath, Inc. # # All Rights Reserved # from django.db import models from mint.django_rest.rbuilder import modellib from xobj import xobj import sys from mint.django_rest.rbuilder.users import manager_model from django.db import connection class UserGroups(modellib.Collection): class Meta: ...
Python
0.000014
@@ -4164,32 +4164,116 @@ def save(self):%0A + # Make active an integer field%0A self.active = int(bool(self.active))%0A # Omit t
8a45ba91e64bebb345d2550d0442d2993be4b15c
make sure we build
publish.py
publish.py
#!/usr/bin/env python3 import asyncio import logging import re import requests #import sh import sys import time import yaml from datetime import datetime from os import makedirs from pathlib import Path from aiohttp import ClientSession TEMPLATE = """\ --- {front_matter} --- {content} """ ROOT_DIR = Path.cwd() logg...
Python
0
@@ -4394,17 +4394,16 @@ m)%0A%0A -# hugo_bui
66370cecd7bdf9d0b5ecd358aa58b4f567d45c95
add a new keyword to the pypy lexer
pygments/lexers/pypylog.py
pygments/lexers/pypylog.py
# -*- coding: utf-8 -*- """ pygments.lexers.pypylog ~~~~~~~~~~~~~~~~~~~~~~~ Lexer for pypy log files. :copyright: Copyright 2006-2011 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, bygroups, include from pygments.token import ...
Python
0
@@ -2401,24 +2401,44 @@ getfield_gc%7C +getinteriorfield_gc%7C %22%0A
ebd152ca9b4126776e0f035477791be587907a8b
Fix coding style and add a file header.
pygments/lexers/pypylog.py
pygments/lexers/pypylog.py
from pygments.lexer import RegexLexer, bygroups, include from pygments.token import (Text, Keyword, Number, Comment, Punctuation, Name, String, Literal) __all__ = [ "PyPyLogLexer", ] class PyPyLogLexer(RegexLexer): """ Lexer for PyPy log files. *New in Pygments 1.5.* """ name = "PyPy Log...
Python
0
@@ -1,20 +1,256 @@ +# -*- coding: utf-8 -*-%0A%22%22%22%0A pygments.lexers.pypylog%0A ~~~~~~~~~~~~~~~~~~~~~~~%0A%0A Lexer for pypy log files.%0A%0A :copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.%0A :license: BSD, see LICENSE for details.%0A%22%22%22%0A%0A from pygments.lexer @@ -313...
757e95e297f27f46200b832e532f3cba95b68df8
move __all__ directly after imports
pylons/i18n/translation.py
pylons/i18n/translation.py
"""Translation/Localization functions. Provides ``gettext`` translation functions via an app's ``pylons.translator`` and get/set_lang for changing the language translated to. """ import os from gettext import NullTranslations, translation import pylons class LanguageError(Exception): """Exception raised when a p...
Python
0.000002
@@ -249,16 +249,234 @@ pylons%0A%0A +__all__ = %5B'gettext_noop', 'N_', 'gettext', 'ugettext', '_', 'ngettext',%0A 'ungettext', 'lazy_gettext', 'lazy_ugettext', 'lazy_ngettext',%0A 'lazy_ungettext', 'set_lang', 'get_lang', 'LanguageError'%5D%0A%0A class La @@ -5463,222 +5463,4 @@ g))%0A -%0A__all...
38a4b41d942f40dd16e1a1c88ab68c0b9169ff0c
update tts
slackbot/plugins/tts.py
slackbot/plugins/tts.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # # tts.py --- # # Filename: tts.py # Description: # Author: Werther Zhang # Maintainer: # Created: Sun Sep 10 16:24:08 2017 (+0800) # # Change Log: # # import os import sys import baidutts import hashlib import commands from slackbot.bot import plugin_init from slackbot...
Python
0.000001
@@ -337,16 +337,133 @@ ond_to%0A%0A +try:%0A from pydub import AudioSegment%0Aexcept Exception as e:%0A print 'Missing module pydub, please install it'%0A%0A class TT @@ -1024,16 +1024,357 @@ , 3))%0A%0A%0A + def __insert_silent(self, media_file, ftype):%0A try:%0A silent = AudioSegment.s...
8f4f902042b848a6a212ae966aaf6435ae8d5c77
set background as a widget
sheldonchess/interface/web/sheldonchess.py
sheldonchess/interface/web/sheldonchess.py
from rajesh import Application, run, expr from rajesh.element import Img, Div from screens import MainMenu, NormalGameLobby class Player(object): def __init__(self, app): self.app = app self.name = "" class SheldonChess(Application): def begin(self): self.player = Player(self) ...
Python
0.000001
@@ -354,16 +354,21 @@ +self. backgrou @@ -376,33 +376,8 @@ d = -Img(id=%22background%22, src= %22ima @@ -412,75 +412,8 @@ png%22 -, width=%22100%25%22, height=%22100%25%22)%0A self.put(background, (0, 0)) %0A
86d3a58f46599d9afe07e4d8c0a9d4171d5219bd
Fix for when the user is a PyPI admin
pypi_show_urls/__main__.py
pypi_show_urls/__main__.py
# Copyright 2013 Donald Stufft # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
Python
0
@@ -2880,16 +2880,92 @@ es(user) +%0A if x%5B1%5D is not None %5D)%0A%0A
87b659ad0fe4932161939ffc437f9e09549b302a
Update shash test after adding BCRYPT_SALT
modules/deaddrop/files/deaddrop/crypto.py
modules/deaddrop/files/deaddrop/crypto.py
# -*- coding: utf-8 -*- import bcrypt, subprocess, random, threading myrandom = random.SystemRandom() import gnupg import config import store WORDS_IN_RANDOM_ID = 4 GPG_KEY_TYPE = "RSA" GPG_KEY_LENGTH = "4096" class CryptoException(Exception): pass def clean(s, also=''): """ >>> clean("Hello, world!") Tr...
Python
0
@@ -1006,61 +1006,61 @@ $12$ -EW1aG/sVSDObG7QZu.xhHudPAJYajRpDaweePfwWK.iYn1C/tPnj6 +gLZnkcyhZBrWbCZKHKYgKee8g/Yb9O7.24/H.09Yu9Jt9hzW6n0Ky '%0A
fac2c5752c23d2fd415caafd2654f696c4842806
Bump version.
pyramid_addons/__init__.py
pyramid_addons/__init__.py
__version__ = '0.20'
Python
0
@@ -11,11 +11,11 @@ _ = '0.2 -0 +1 '%0A
1159cda1437085218b79345244897f2be8990ca9
fix tell delivery and possibly db lock
pyscp_bot/modules/notes.py
pyscp_bot/modules/notes.py
#!/usr/bin/env python3 ############################################################################### # Module Imports ############################################################################### import arrow import peewee import sopel import re import pyscp_bot.jarvis as vocab #################################...
Python
0
@@ -1435,16 +1435,74 @@ ule. -rule('.* +thread(False)%0A@sopel.module.rule('.*')%0A@sopel.module.priority('low ')%0Ad @@ -1740,16 +1740,20 @@ %0A if +not re.match
e913bbffde84403018e741a62318df029a641950
Delete more not needed stuff
archive/archive_api/src/conftest.py
archive/archive_api/src/conftest.py
# -*- encoding: utf-8 import os import random import uuid import betamax import pytest import requests import json @pytest.fixture(scope="session") def recorded_sess(pytestconfig): with betamax.Betamax.configure() as config: config.cassette_library_dir = str( pytestconfig.rootdir.join("src",...
Python
0
@@ -30,22 +30,8 @@ os%0A -import random%0A impo @@ -88,20 +88,8 @@ sts%0A -import json%0A %0A%0A@p @@ -501,107 +501,33 @@ -dynamodb_resource,%0A s3_client,%0A sns_client,%0A topic_arn,%0A table_name_bag,%0A bucket_bag +sns_client,%0A topic_arn ,%0A @@ -972,64 +972,8 @@ pp%0A%0A - app...
3fa970e9fb94319df587cf45f90dd0fdb396df1d
update usage
rdhinet.py
rdhinet.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Author: Dongdong Tian @ USTC # # Revision History: # 2014-09-03 Dongdong Tian Initial Coding # """Extract SAC data files from Hi-net WIN32 files Usage: rdhinet.py DIRNAME [-C <comps>] [-D <outdir>] [-S <suffix>] [-P <procs>] rdhinet.py -h Options: ...
Python
0.000001
@@ -361,22 +361,9 @@ s%3E -Selection of c +C ompo @@ -378,16 +378,40 @@ extract +, delimited using commas .%0A
8e4a5ef25c87879fb01aa79f88c6c6a833820f8b
bump version
python/baseline/version.py
python/baseline/version.py
__version__ = "1.1.2"
Python
0
@@ -16,8 +16,8 @@ 1.1. -2 +3 %22%0A%0A
76ffb1b8891e2ad349140044d78e766e02ebf87a
Remove import taichi from expr.py (#3871)
python/taichi/lang/expr.py
python/taichi/lang/expr.py
import numpy as np from taichi._lib import core as _ti_core from taichi.lang import impl from taichi.lang.common_ops import TaichiOperations from taichi.lang.util import is_taichi_class import taichi as ti # Scalar, basic data type class Expr(TaichiOperations): """A Python-side Expr wrapper, whose member variabl...
Python
0
@@ -155,20 +155,22 @@ ang. -util +matrix import is_t @@ -169,44 +169,59 @@ ort -is_taichi_class%0A%0A +Matrix%0Afrom taichi.lang.util import +is_ taichi - as ti +_class %0A%0A%0A# @@ -1900,19 +1900,16 @@ prs%5B0%5D, -ti. Matrix): @@ -2081,19 +2081,16 @@ ance(i, -ti. Matrix):
1d4776adb0d9926efaf38d8db9691e7339c0174e
Add improve email a bit
python/update_fsurf_job.py
python/update_fsurf_job.py
#!/usr/bin/env python import argparse import os import subprocess import sys from email.mime.text import MIMEText import psycopg2 import shutil import fsurfer VERSION = fsurfer.__version__ PARAM_FILE_LOCATION = "/etc/freesurfer/db_info" FREESURFER_BASE = '/stash2/user/fsurf/' def get_db_parameters(): """ R...
Python
0.000038
@@ -274,16 +274,403 @@ surf/'%0A%0A +EMAIL_TEMPLATE = '''%0AThis email is being sent to inform you that your freesurfer workflow %7B0%7D submitted on %7B1%7D%0Ahas completed %7B2%7D. You can download the output by running%0A%60fsurf --output %7B0%7D --user %7B3%7D --password %3Cpass%3E%60%0Aor download the Freesurfer...
93e0e92ca1b49aa200895a316a5411c8afff96b5
Reset notification errors to return 400
monasca_api/v2/reference/notifications.py
monasca_api/v2/reference/notifications.py
# Copyright 2014 Hewlett-Packard # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
0.000131
@@ -760,82 +760,8 @@ ons%0A -from monasca_api.v2.common.exceptions import HTTPUnprocessableEntityError%0A from @@ -1809,58 +1809,42 @@ ise -HTTPUnprocessableEntityError('Unprocessable Entity +falcon.HTTPBadRequest('Bad Request ', e
49f365ecfc18e32e5664ffc53c163320ed0af6ac
Add the missing rows() function
pywind/bmreports/prices.py
pywind/bmreports/prices.py
# coding=utf-8 # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either in source code form or as a compiled # binary, for any purpose, commercial or non-commercial, and by any # means. # In jurisdi...
Python
0.999729
@@ -2579,16 +2579,303 @@ s) %3E 0%0A%0A + def rows(self):%0A %22%22%22Generator to return rows for export.%0A%0A :returns: Dict containing information for a single price period.%0A :rtype: dict%0A %22%22%22%0A for per in self.prices:%0A yield %7B'PricePeriod': %7B'@%7B%...
86768d83067745def16761db24ce496e3125399e
test script works
mtgreatest/process_results/test_script.py
mtgreatest/process_results/test_script.py
#!/usr/bin/env python import scrape_results from mtgreatest.rdb import Cursor cursor = Cursor() event_info = cursor.execute('select event_id, event_link from event_table where results_loaded = 1') event_info = [dict(zip(('event_id','event_link'), item)) for item in event_info] #this should be a method (or default re...
Python
0.000001
@@ -341,17 +341,55 @@ db%0A%0A +failed = %5B%5D%0A%0Afor row in event_info:%0A soup -s = -%5B scra @@ -432,73 +432,76 @@ k'%5D) - for row in event_info%5D%0A%0Afailed = %5B%5D%0A%0Afor i in range(len(soups)): +%0A print 'scraping standings for event %7B%7D'.format(row%5B'event_id'%5D) %0A @@ -554,27 +...
722a3735f9b14f84a5e2e5dd04e38b3446504ed8
Fix example for random_bipartite
networkx/algorithms/bipartite/__init__.py
networkx/algorithms/bipartite/__init__.py
r""" This module provides functions and operations for bipartite graphs. Bipartite graphs `B = (U, V, E)` have two node sets `U,V` and edges in `E` that only connect nodes from opposite sets. It is common in the literature to use an spatial analogy referring to the two node sets as top and bottom nodes. The bipartite...
Python
0
@@ -2570,38 +2570,8 @@ .2)%0A -%3E%3E%3E nx.is_connected(RB)%0AFalse%0A %3E%3E%3E
e164a3ccb7625d4f36c83628aa6f7f030f38d6cf
remove normalized test
networkx/algorithms/tests/test_smetric.py
networkx/algorithms/tests/test_smetric.py
from nose.tools import assert_equal import networkx as nx def test_smetric(): g = nx.Graph() g.add_edge(1,2) g.add_edge(2,3) g.add_edge(2,4) g.add_edge(1,4) sm = nx.s_metric(g,normalized=False) assert_equal(sm, 19.0) smNorm = nx.s_metric(g,normalized=True) # assert_equal(smNorm, 0....
Python
0.000051
@@ -241,16 +241,17 @@ , 19.0)%0A +# smNo
9b19de89c7492e24a9ba71e8289ee186648667ad
Remove unneeded nesting
lib/ansible/modules/extras/cloud/amazon/ec2_search.py
lib/ansible/modules/extras/cloud/amazon/ec2_search.py
#!/usr/bin/python # # This is a free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This Ansible library is distributed in the hope that i...
Python
0.000001
@@ -4784,50 +4784,8 @@ e)%0A%0A - ansible_facts = %7B'info': server_info%7D%0A @@ -4830,21 +4830,19 @@ ec2= -ansible_facts +server_info )%0A%0A
d616d93a2a37ed7d5133376ffdc763eb2c52b6e1
Set save_best_so_far_agent=False
examples/ale/train_ppo_ale.py
examples/ale/train_ppo_ale.py
from __future__ import print_function from __future__ import division from __future__ import unicode_literals from __future__ import absolute_import from builtins import * # NOQA from future import standard_library standard_library.install_aliases() import argparse import gym gym.undo_logger_setup() import chainer im...
Python
0.999484
@@ -6195,16 +6195,58 @@ de_len,%0A + save_best_so_far_agent=False,%0A
a15bda8b4a4d32d25f1e47f69b20f7df0ff45691
Remove debugging code
ether/ethcontract.py
ether/ethcontract.py
from ether import asm, util import re import persistent from ethereum import utils class ETHContract(persistent.Persistent): def __init__(self, code = ""): self.code = code def get_xrefs(self): disassembly = asm.disassemble(util.safe_decode(self.code)) xrefs = [] for ins...
Python
0.000739
@@ -1794,41 +1794,8 @@ %0A%0A - print(str_eval)%0A%0A
531797bc4252e12a3a6b4cea1c0b4744d26a766a
missing comma
example_capacities.py
example_capacities.py
#!/usr/bin/python import argparse import pyvmax ################################# ### Define and Parse CLI arguments PARSER = argparse.ArgumentParser( description='Example implementation of a Python REST client for EMC Unisphere for VMAX.') RFLAGS = PARSER.add_argument_group('Required arguments') RFLA...
Python
0.999885
@@ -2674,16 +2674,17 @@ _gb' : 0 +, %0D%0A
4aa81b72e6476fae9717bbcf5791483b581cd0f6
add return type annotations to aggregate.py
examples/aggregate.py
examples/aggregate.py
import sqlite3 import string import time from operator import attrgetter from typing import Callable, Dict, List, NamedTuple, Optional, Tuple from numba import float64, int64, optional from numba.experimental import jitclass from numba.types import ClassType from slumba import create_aggregate, sqlite_udaf @sqlite_...
Python
0.000001
@@ -491,34 +491,42 @@ f __init__(self) + -%3E None :%0A - self.mea @@ -1104,32 +1104,40 @@ f __init__(self) + -%3E None :%0A self.m @@ -1888,32 +1888,40 @@ f __init__(self) + -%3E None :%0A self.t @@ -2335,16 +2335,16 @@ ss Sum:%0A - def @@ -2357,16 +2357,24 @@ __(self) + -%3E None ...
d1490510cd5f66a5da699ffea39b6a8b37c88f01
add test for composite potential
gary/potential/tests/test_io.py
gary/potential/tests/test_io.py
# coding: utf-8 """ test reading/writing potentials to files """ from __future__ import division, print_function __author__ = "adrn <adrn@astro.columbia.edu>" # Standard library import os # Third-party import numpy as np # Project from ..io import read, write from ..builtin import IsochronePotential from ...units...
Python
0
@@ -300,16 +300,51 @@ tential%0A +from ..custom import PW14Potential%0A from ... @@ -365,16 +365,16 @@ alactic%0A - %0A# TODO: @@ -860,16 +860,107 @@ ad(f2)%0A%0A + f3 = os.path.join(test_data_path, 'potential', 'pw14_2.yml')%0A potential = read(f3)%0A%0A def test @@ -1175,16 +1175,16 @@ al, f)%0A%0A - ...
11499596e27e8f4c792cf5e36ea5a1c8f6d6053f
Improve logging (learning)
evilminions/hydra.py
evilminions/hydra.py
'''Replicates the behavior of a minion many times''' import logging import tornado.gen import zmq import salt.config import salt.loader import salt.payload from evilminions.hydrahead import HydraHead from evilminions.utils import fun_call_id # HACK: turn the trace function into a no-op # this almost doubles evil-m...
Python
0
@@ -3539,33 +3539,142 @@ ion -#%7B%7D for call: %7B%7D%22.format( +list #%7B%7D (%7B%7D reactions) for call: %7B%7D%22.format(%0A self @@ -3898,17 +3898,443 @@ -call_id)) +len(self.current_reactions),%0A ...
42b0c14d1e34dd88a92f22eda9d87dd104ea61f0
tweak demo
examples/meanfield.py
examples/meanfield.py
from __future__ import division import numpy as np import matplotlib.pyplot as plt from pyhsmm.basic.distributions import Regression, Gaussian, PoissonDuration from autoregressive.distributions import AutoRegression from pyhsmm.util.text import progprint_xrange from pyslds.models import HMMSLDS np.random.seed(0) #...
Python
0.000001
@@ -753,17 +753,17 @@ alpha_0= -5 +3 *50,beta @@ -765,17 +765,17 @@ ,beta_0= -5 +3 ) for _ @@ -1911,15 +1911,17 @@ )%0A# -vlbs = +plt.plot( %5Bmod @@ -1993,24 +1993,8 @@ 50)%5D -%0A# plt.plot(vlbs )%0A%0Af
5c2db731c85e358df6af67767ec483a375a9b661
return a list instead, to allow for needing multiple types
fedimg/util.py
fedimg/util.py
# This file is part of fedimg. # Copyright (C) 2014 Red Hat, Inc. # # fedimg is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # #...
Python
0.000056
@@ -2051,20 +2051,16 @@ )%0A%0A%0Adef -get_ virt_typ @@ -2060,16 +2060,31 @@ irt_type +s_from_filename (file_na @@ -2388,13 +2388,15 @@ urn +%5B 'hvm' +%5D %0A @@ -2427,334 +2427,53 @@ se, -use the default (paravirtual)%0A # Note: We want all images to be available in HVM, since%0A # HVM is ...
db69d08b61f83703fc40ef7273cba1b2e0b825a3
stop checking if an entry already exists when polling
feeds/tasks.py
feeds/tasks.py
import time import feedparser from celery import task from feeds.models import Feed, Entry from django.core.exceptions import ObjectDoesNotExist from profiles.models import UserProfile, UserEntryDetail def poll_feed(feed): parser = feedparser.parse(feed.link) # Add entries from feed entries = parser.entr...
Python
0
@@ -347,156 +347,8 @@ es:%0A - try:%0A Entry.objects.get(link=entry.link)%0A except ObjectDoesNotExist:%0A pass%0A else:%0A continue%0A%0A
81806fe89b9c4a364d373020bd56ee1a396a5858
Add automatic escaping of the settings docstring for Windows' sake in py3k
evennia/game_template/server/conf/settings.py
evennia/game_template/server/conf/settings.py
""" Evennia settings file. The available options are found in the default settings file found here: {settings_default} Remember: Don't copy more from the default file than you actually intend to change; this will make sure that you don't overload upstream updates unnecessarily. When changing a setting requiring a ...
Python
0
@@ -1,12 +1,13 @@ +r %22%22%22%0AEvennia
a85f6f86522dbb984818defc0d5c3cee049f1341
add simple async post support
eventbus/eventbus.py
eventbus/eventbus.py
__author__ = 'Xsank' import inspect from listener import Listener from exception import RegisterError from exception import UnregisterError class EventBus(object): def __init__(self): self.listeners=dict() def register(self,listener): if not isinstance(listener,Listener): raise R...
Python
0
@@ -28,16 +28,60 @@ inspect +%0Afrom multiprocessing.pool import ThreadPool %0A%0Afrom l @@ -221,24 +221,36 @@ _init__(self +,pool_size=4 ):%0A s @@ -269,16 +269,56 @@ s=dict() +%0A self.pool=ThreadPool(pool_size) %0A%0A de @@ -843,16 +843,91 @@ event)%0A%0A + def async_post(self,event):%0A ...
30e00089247b314e82bc7792ac6f9641cd632bbd
Bump to dev.
eventlet/__init__.py
eventlet/__init__.py
version_info = (0, 9, 15) __version__ = ".".join(map(str, version_info)) try: from eventlet import greenthread from eventlet import greenpool from eventlet import queue from eventlet import timeout from eventlet import patcher from eventlet import convenience import greenlet sleep = gr...
Python
0
@@ -20,9 +20,16 @@ 9, 1 -5 +6, %22dev%22 )%0A__
673b00f81baa9f124920ec471f91d50279e8b007
return the response
roushagent/plugins/lib/bashscriptrunner.py
roushagent/plugins/lib/bashscriptrunner.py
import os import string import subprocess from threading import Thread from Queue import Queue, Empty def name_mangle(s, prefix=""): # we only support upper case variables and as a convenience convert # - to _, as - is not valid in bash variables. prefix = prefix.upper() r = s.upper().replace("-", "_"...
Python
1
@@ -4636,16 +4636,39 @@ rncode)%0A + return response %0A%0Adef en
eac52d28584ef62daaad5a92f70fe93cb3ee1476
change Target
rf_model/chembl_rf.py
rf_model/chembl_rf.py
# Author: xiaotaw@qq.com (Any bug report is welcome) # Time Created: Nov 2016 # Time Last Updated: Dec 2016 # Addr: Shenzhen, China # Description: import os import sys import math import time import getpass import numpy as np import pandas as pd from scipy import sparse from collections import defaultdict from matplot...
Python
0.998505
@@ -2672,16 +2672,22 @@ how()%0A%0A%0A +%0A%0A%22%22%22%0A target_l @@ -2950,16 +2950,158 @@ t1-t0))%0A +%22%22%22%0A%0At0 = time.time()%0Atrain_pred(%22CHEMBL4805%22, train_pos_multiply=0)%0At1 = time.time()%0Aprint(%22%25s duration: %25.3f%22 %25 (target, t1-t0))%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A%0A %0A%0A%22%22%2...
f6c7cda72aab179fa9cae0210c482c8753e1e46b
Fix number badge has not been rendered
src/blockdiag/noderenderer/__init__.py
src/blockdiag/noderenderer/__init__.py
# -*- coding: utf-8 -*- # Copyright 2011 Takeshi KOMIYA # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0
@@ -4070,36 +4070,35 @@ et('shadow') is -Fals +Non e:%0A b
d742fffd753ed85d164ceafcf2a0cceeb8576e22
Add jobstore alias for redis backend.
robo/handlers/cron.py
robo/handlers/cron.py
# -*- coding: utf-8 -*- """ robo.handlers.cron ~~~~~~~~~~~~~~~~~~ cron handler for robo. :copyright: (c) 2015 Shinya Ohyanagi, All rights reserved. :license: BSD, see LICENSE for more details. """ import logging from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.jo...
Python
0
@@ -662,24 +662,51 @@ er.start()%0A%0A + self.alias = None%0A%0A @classme @@ -2031,16 +2031,78 @@ 'cron',%0A + jobstore=self.alias,%0A @@ -5364,16 +5364,124 @@ ions'%5D%0A%0A + if 'alias' in job_options:%0A self.scheduler...
22f373c0e6ef3a2c7bfb128ad014af245f113ea9
Add default serial baudrate.
robus/io/serial_io.py
robus/io/serial_io.py
import serial as _serial from serial.tools.list_ports import comports from . import IOHandler class Serial(IOHandler): @classmethod def is_host_compatible(cls, host): available_host = (p.device for p in comports()) return host in available_host def __init__(self, host, baudrate): ...
Python
0
@@ -304,16 +304,22 @@ baudrate +=57600 ):%0A
e0024790be3a85e529c93397500e4f736c82a5ef
Fix the runner for Python 2.
src/calmjs/parse/tests/test_testing.py
src/calmjs/parse/tests/test_testing.py
# -*- coding: utf-8 -*- import unittest from calmjs.parse.testing.util import build_equality_testcase from calmjs.parse.testing.util import build_exception_testcase class BuilderEqualityTestCase(unittest.TestCase): def test_build_equality_testcase(self): DummyTestCase = build_equality_testcase('DummyTes...
Python
0.001551
@@ -161,16 +161,73 @@ tcase%0A%0A%0A +def run(self):%0A %22%22%22%0A A dummy run method.%0A %22%22%22%0A%0A%0A class Bu @@ -524,16 +524,52 @@ %5D)%0A + DummyTestCase.runTest = run%0A @@ -1464,16 +1464,51 @@ )%0A + FailTestCase.runTest = run%0A
d926c984e895b68ad0cc0383926451c0d7249512
Fix use of deprecated find_module
astropy/tests/tests/test_imports.py
astropy/tests/tests/test_imports.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst import pkgutil def test_imports(): """ This just imports all modules in astropy, making sure they don't have any dependencies that sneak through """ def onerror(name): # We should raise any legitimate error that occurred, but...
Python
0.000002
@@ -671,22 +671,20 @@ er.find_ -module +spec (nm)%0A%0A%0Ad
d7d733f12b346c43a8b2751be6b32c0359c728e5
Add comment marking tfx.orchestration.interactive.* as experimental.
tfx/orchestration/interactive/interactive_context.py
tfx/orchestration/interactive/interactive_context.py
# Copyright 2019 Google LLC. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
Python
0
@@ -794,16 +794,108 @@ lopment. +%0A%0ANote: these APIs are experimental and changes to interface and functionality%0Aare expected. %0A%22%22%22%0A%0Afr
c479c360d979d22182e787f74f5a74473fc41002
Save sales ranges only when the forms data is changed
shoop/campaigns/admin_module/form_parts.py
shoop/campaigns/admin_module/form_parts.py
# This file is part of Shoop. # # Copyright (c) 2012-2016, Shoop Ltd. All rights reserved. # # This source code is licensed under the AGPLv3 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from django import forms from django.utils.translation impo...
Python
0
@@ -2015,32 +2015,72 @@ , form):%0A + form_names = %5Bself._get_form_name(shop) for shop in sel @@ -2078,33 +2078,33 @@ op in self.shops -: +%5D %0A nam @@ -2100,78 +2100,139 @@ - name = self._get_form_name(shop)%0A if name in form.forms +forms = %5Bform.forms%5Bname%5D for na...
8b17411d16c22c7a28017f67c827c81e28535f41
Fix rate_watcher locking error
sacad/rate_watcher.py
sacad/rate_watcher.py
""" This module provides a class with a context manager to help avoid overloading web servers. """ import asyncio import logging import os import random import sqlite3 import time import urllib.parse class AccessRateWatcher: """ Access rate limiter, supporting concurrent access by threads and/or processes. """ ...
Python
0.000001
@@ -1000,22 +1000,12 @@ k = -asyncio.Lock() +None %0A%0A @@ -1112,24 +1112,84 @@ limit. %22%22%22%0A + if self.lock is None:%0A self.lock = asyncio.Lock()%0A%0A async wi
029e39edfb733a524d7ea4fc7f64fa93e81b9f53
Add SACREBLEU_DIR and smart_open to imports (#73)
sacrebleu/__init__.py
sacrebleu/__init__.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2017--2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License # is located at # # http://aws....
Python
0
@@ -757,16 +757,28 @@ u import + smart_open, corpus_ @@ -894,16 +894,31 @@ KENIZERS +, SACREBLEU_DIR %0A%0A# more
09faf99eb775a36a70d03958a58bf1df8bbb1b93
update for structure changes
salt/auth/__init__.py
salt/auth/__init__.py
''' Salt's pluggable authentication system This sysetm allows for authentication to be managed in a module pluggable way so that any external authentication system can be used inside of Salt ''' # 1. Create auth loader instance # 2. Accept arguments as a dict # 3. Verify with function introspection # 4. Execute auth ...
Python
0
@@ -1074,35 +1074,37 @@ if not ' -fun +eauth ' in load:%0A @@ -1151,35 +1151,37 @@ h'.format(load%5B' -fun +eauth '%5D)%0A if n
dd47871f0a82610186aefa21ed7a736885ca44c0
Fix unused args in modules/cloud.py
salt/modules/cloud.py
salt/modules/cloud.py
# -*- coding: utf-8 -*- ''' Salt-specific interface for calling Salt Cloud directly ''' # Import python libs import os import logging import copy # Import salt libs try: import salt.cloud HAS_SALTCLOUD = True except ImportError: HAS_SALTCLOUD = False import salt.utils log = logging.getLogger(__name__) ...
Python
0
@@ -2180,33 +2180,26 @@ ry_type= -'list_nodes_full' +query_type )%0A%0A%0Adef @@ -2393,35 +2393,26 @@ ry_type= -'list_nodes_select' +query_type )%0A%0A%0Adef
c50189679dd61bd2cada7c1e10656ecdade43095
Fix `ThumbnailField` tests
user_management/api/avatar/tests/test_serializers.py
user_management/api/avatar/tests/test_serializers.py
from unittest import expectedFailure from django.test import TestCase from mock import MagicMock, patch from user_management.models.tests.factories import UserFactory from .. import serializers class AvatarSerializerTest(TestCase): @expectedFailure def test_deserialize(self): user = UserFactory.buil...
Python
0
@@ -2553,32 +2553,162 @@ e)%0A%0A -@expectedFailure +def mock_parent(self, context):%0A parent = MagicMock()%0A parent._context = context%0A parent.parent = None%0A return parent%0A %0A def @@ -2849,32 +2849,33 @@ humbnailField()%0A +%0A field.co @@ -2868,34 +2868,50 @@ ...
cad9160baa6d3841910ad68b48a212c4475a62e1
Fix contact list type filter
shuup/admin/modules/contacts/views/list.py
shuup/admin/modules/contacts/views/list.py
# -*- coding: utf-8 -*- # This file is part of Shuup. # # Copyright (c) 2012-2017, Shoop Commerce Ltd. All rights reserved. # # This source code is licensed under the OSL-3.0 license found in the # LICENSE file in the root directory of this source tree. from __future__ import unicode_literals from django.core.urlresol...
Python
0
@@ -1022,16 +1022,25 @@ n, value +, context ):%0A
9d9737f765416305dd2adbd816b447de5c5eae7c
add version 8.0.6.0 (#14003)
var/spack/repos/builtin/packages/ibm-java/package.py
var/spack/repos/builtin/packages/ibm-java/package.py
# Copyright 2013-2019 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 * import platform import os class IbmJava(Package): """Binary distribution of the IBM Java Softwar...
Python
0
@@ -455,309 +455,532 @@ # -There are separate tar files for big and little-endian machine%0A # types. When we add more versions, then turn this into a mapping%0A # from version and machine type to sha256sum.%0A mach = platform.machine() if platform.machine() == 'ppc64' else 'ppc64le'%0A if mach == 'ppc...
9fdcc147a754e3b4f85decb858066610652bd713
update version. (#5439)
var/spack/repos/builtin/packages/r-tibble/package.py
var/spack/repos/builtin/packages/r-tibble/package.py
############################################################################## # Copyright (c) 2013-2017, 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
@@ -1438,14 +1438,17 @@ com/ -hadley +tidyverse /tib @@ -1486,20 +1486,18 @@ an.r --project.org +studio.com /src @@ -1514,17 +1514,19 @@ ibble_1. -2 +3.4 .tar.gz%22 @@ -1526,16 +1526,96 @@ tar.gz%22%0A + list_url = homepage%0A version('1.3.4', '298e81546f999fb0968625698511b8d3') %0A ver
802926f151d9a1337c2a07adbc485b6193e91733
Add template string calling to the state module
salt/modules/state.py
salt/modules/state.py
''' Control the state system on the minion ''' # Import Python modules import os # Import salt modules import salt.state def low(data): ''' Execute a single low data call ''' st_ = salt.state.State(__opts__) err = st_.verify_data(data) if err: return err return st_.call(data) def ...
Python
0.000001
@@ -656,8 +656,195 @@ m)%0A %0A +def template_str(tem):%0A '''%0A Execute the information stored in a template file on the minion%0A '''%0A st_ = salt.state.State(__opts__)%0A return st_.call_template_str(tem)%0A %0A
83fea631f1765d4641cde8af2c5c931b22e4ee33
extend trilinos
var/spack/repos/builtin/packages/trilinos/package.py
var/spack/repos/builtin/packages/trilinos/package.py
from spack import * class Trilinos(Package): """ The Trilinos Project is an effort to develop algorithms and enabling technologies within an object-oriented software framework for the solution of large-scale, complex multi-physics engineering and scientific problems. A unique design feature of Trilino...
Python
0.000001
@@ -13,17 +13,26 @@ mport *%0A +import os %0A - %0Aclass T @@ -482,16 +482,106 @@ ar.gz%22%0A%0A + version('12.6.1', 'adcf2d3aab74cdda98f88fee19cd1442604199b0515ee3da4d80cbe8f37d00e4')%0A vers @@ -1591,24 +1591,99 @@ S:BOOL=ON',%0A + '-DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=ON',...
ac8d29c5855ea05bd42766cd142808704aded867
Add space to trigger travis
web/impact/impact/permissions/graphql_permissions.py
web/impact/impact/permissions/graphql_permissions.py
from accelerator.models import ( UserRole, ) from accelerator_abstract.models.base_user_utils import is_employee from accelerator.models import ACTIVE_PROGRAM_STATUS BASIC_ALLOWED_USER_ROLES = [ UserRole.FINALIST, UserRole.AIR, UserRole.MENTOR, UserRole.PARTNER, UserRole.ALUM ] BASIC_VISIBLE_U...
Python
0
@@ -1436,16 +1436,17 @@ in=roles + %0A ).e
7ad6da17a72010967ccd82d3393a86762cf2a786
Mark import-std-module/empty-module as libc++ test
packages/Python/lldbsuite/test/commands/expression/import-std-module/empty-module/TestEmptyStdModule.py
packages/Python/lldbsuite/test/commands/expression/import-std-module/empty-module/TestEmptyStdModule.py
""" Test that LLDB doesn't crash if the std module we load is empty. """ from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil import os class ImportStdModule(TestBase): mydir = TestBase.compute_mydir(__file__) @skipIf(compiler=no_match("clang")) ...
Python
0.000037
@@ -272,16 +272,283 @@ ile__)%0A%0A + # We only emulate a fake libc++ in this test and don't use the real libc++,%0A # but we still add the libc++ category so that this test is only run in%0A # test configurations where libc++ is actually supposed to be tested.%0A @add_test_categories(%5B%22libc++%22%5D)%0...
95829615b19bd2729606f7492b3f3b2b174ae7b8
Fix typos.
src/epiweb/apps/survey/data/example.py
src/epiweb/apps/survey/data/example.py
# -*- coding: utf-8 -*- from epiweb.apps.survey.data.conditions import * from epiweb.apps.survey.data import Survey, Section, Question _ = lambda x: x data = Survey() section = Section() q = Question('q10001', _('Did you have one or more of the following symptoms since your last visit?')) q.type = 'option-multiple' ...
Python
0.998899
@@ -339,16 +339,17 @@ _('Runny + nose'),%0A @@ -444,16 +444,17 @@ _('Sore + throat') @@ -468,16 +468,17 @@ ('Muscle + pain'),%0A @@ -508,16 +508,17 @@ _('Chest + pain'),%0A @@ -580,18 +580,20 @@ _('Loss + of + appetite @@ -702,19 +702,21 @@ ills + and + feverish feel @@ -711,16 +711,17 @@ feve...
973a7754623c330f0352979bf9e0f2a6020acf62
reformat >80 char import line
tendrl/commons/tests/objects/cluster/atoms/check_cluster_available/test_check_cluster_available_init.py
tendrl/commons/tests/objects/cluster/atoms/check_cluster_available/test_check_cluster_available_init.py
import etcd import maps import pytest from tendrl.commons.objects.cluster.atoms.check_cluster_available import CheckClusterAvailable # noqa from tendrl.commons.objects import AtomExecutionFailedError class MockCluster(object): def __init__(self, integration_id = 0): self.is_managed = True def load(se...
Python
0
@@ -104,16 +104,22 @@ import +%5C%0A CheckClu @@ -135,16 +135,8 @@ able - # noqa %0Afro
eea0c4fd610882ee748410063a62c30ce95da0ee
Fix the snapshot creation script for the new command line syntax. Review URL: http://codereview.chromium.org//8414015
runtime/tools/create_snapshot_file.py
runtime/tools/create_snapshot_file.py
#!/usr/bin/env python # # Copyright (c) 2011, 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. # Script to create snapshot files. import getopt import optparse import string im...
Python
0.999999
@@ -2631,14 +2631,8 @@ ment -, %22--%22 %5D + @@ -2643,19 +2643,8 @@ ipts - + %5B %22--%22 %5D %0A i
7136ebd77980f63944f3afc4d9577507df956dde
Update fake licensing generator to use correct bucket
generate_fake_licensing_data.py
generate_fake_licensing_data.py
import datetime import json from random import choice, randint from pymongo import MongoClient import sys HOST = 'localhost' PORT = 27017 DB_NAME = 'backdrop' BUCKET = 'licensify' # IMPORTANT: # # Dates are required to be stored as ISODate so you need to run these # postprocessing scripts after loading data into db: ...
Python
0
@@ -174,10 +174,10 @@ ensi -fy +ng '%0A%0A#
377d35873aed0993e1dbaf147d7b24abccd960c2
add raise SystemExit
cliche/cli.py
cliche/cli.py
""":mod:`cliche.cli` --- Command-line interfaces ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ import code import functools import logging.config import os import pathlib import sys from alembic.util import CommandError from click import Path, argument, echo, group, option from flask import _request_ctx_stack ...
Python
0.000001
@@ -3288,32 +3288,72 @@ ile=sys.stderr)%0A + raise SystemExit(1)%0A else @@ -3387,32 +3387,68 @@ ile=sys.stderr)%0A + raise SystemExit(1)%0A %0A%0A@cli.command()
788073cdf2a5e2ee142cbcf1263accad7baac153
Move chmod
genes/gnu_coreutils/commands.py
genes/gnu_coreutils/commands.py
#!/usr/bin/env python from genes.posix.traits import only_posix from genes.process.commands import run @only_posix() def chgrp(path, group): run(['chgrp', group, path]) @only_posix() def chown(path, user): run(['chown', user, path]) @only_posix() def groupadd(*args): run(['groupadd'] + list(args)) ...
Python
0.000001
@@ -233,32 +233,145 @@ user, path%5D)%0A%0A%0A +@only_posix()%09%09%0Adef chmod(*args):%09%09%0A # FIXME: this is ugly, name the args%09%09%0A run(%5B'chmod'%5D + list(args))%0A%0A%0A @only_posix()%0Ade
14ba4d581428ff38190153955315dc13483623e1
simplify (at least for me)
find_groups.py
find_groups.py
import random from collections import namedtuple, defaultdict, deque Point = namedtuple('Point', ['x', 'y']) Size = namedtuple('Size', ['w', 'h']) EMPTY = 0 BLACK = 1 WHITE = 2 BOARD_LETTERS = 'ABCDEFGHJKLMNOPQRST' class Group: def __init__(self, color): self.color = color self.points = set() ...
Python
0.000002
@@ -1875,70 +1875,19 @@ -color = self.stones.get(point, EMPTY)%0A%0A if poin +t no t in @@ -1925,22 +1925,51 @@ co -ntinue +lor = self.stones.get(point, EMPTY) %0A @@ -1969,34 +1969,36 @@ -el + if color == EMPT @@ -1992,32 +1992,36 @@ color == EMPTY:%0A + ...
0ab67a50c711e3a15974f3bb4fe9df84fac6608a
use new template
gimmemotifs/commands/cluster.py
gimmemotifs/commands/cluster.py
#!/usr/bin/env python # Copyright (c) 2009-2016 Simon van Heeringen <s.vanheeringen@science.ru.nl> # # This module is free software. You can redistribute it and/or modify it under # the terms of the MIT License, see the file COPYING included with this # distribution. from distutils import sysconfig from gimmemotifs...
Python
0
@@ -441,16 +441,59 @@ _motifs%0A +from gimmemotifs.config import MotifConfig%0A import s @@ -513,19 +513,22 @@ %0Aimport -kid +jinja2 %0A%0Adef cl @@ -2261,144 +2261,152 @@ -kid.enable_import()%0A prefix = sysconfig.get_config_var(%22prefix%22)%0A template_file = os.path.join(prefix, %22share/gimmemoti...
394954fc80230e01112166db4fe133c107febead
Allow more than one GitHub repo from the same user
gitautodeploy/parsers/common.py
gitautodeploy/parsers/common.py
class WebhookRequestParser(object): """Abstract parent class for git service parsers. Contains helper methods.""" def __init__(self, config): self._config = config def get_matching_repo_configs(self, urls): """Iterates over the various repo URLs provided as argument (git://, s...
Python
0.998892
@@ -628,15 +628,44 @@ nfig -%5B +.get('repo', repo_config.get( 'url' -%5D +)) == @@ -885,16 +885,17 @@ return configs +%0A
eec0415702c728b83ddba6c7ccef5db7f5f332e5
fix hovering bug introduced by template rewrite
extstats/templates.py
extstats/templates.py
### template engine import html, types def render(node): assert node is not None # TODO: None => '' ? if type(node) in (tuple, list, types.GeneratorType): return ''.join(render(child) for child in node) if type(node) == str: return html.escape(node) children_rendered = '' if nod...
Python
0
@@ -2607,35 +2607,45 @@ ext):%0A return + H.div() / (%0A - H.small( @@ -3569,828 +3569,8 @@ nk%0A%0A - def _ext(ext):%0A return (%0A H.small(class_='extlink') / (%0A H.a(href='/ext/%25s.html' %25 ext%5B'ext_id'%5D) / ('#' + ext%5B'ext_id'%5D)),%0A H.h2(id=e...
d4fed426153105a9f8cab595848d5303003449b8
revert last commit, import properly
cogs/games.py
cogs/games.py
import discord from discord.ext import commands from datetime import datetime from utils import aiohttp_wrap as aw class Game: """ Cog which allows fetching of video game information """ IG_URL = 'https://api-2445582011268.apicast.io/{}/' with open('data/apikeys.json') as f: KEY = json.load(f)...
Python
0
@@ -9,16 +9,28 @@ iscord %0A +import json%0A from dis @@ -817,20 +817,19 @@ aw. -a +sess io +n _get -_json (sel @@ -875,16 +875,23 @@ =params) +.json() %0A%0A
ecddf1c61df3b803b4b00560600db9ac2f17b567
Add profile
forum/admin.py
forum/admin.py
import json import os import csv from flask import Response, flash, stream_with_context, redirect from flask_admin.babel import gettext from flask_admin.base import expose from flask_admin.contrib.pymongo import ModelView from flask_admin.contrib.pymongo.filters import BasePyMongoFilter, FilterEqual from flask_admin.h...
Python
0.000001
@@ -5264,16 +5264,27 @@ ered_on' +, 'profile' %5D%0A co @@ -5429,24 +5429,61 @@ = UserForm%0A + column_searchable_list = ('id',)%0A column_e
086ea392e0c61a35f799cd99e8972021bdb7959c
Add verbosity level
forum/views.py
forum/views.py
# coding=utf-8 import json import os import requests import datetime from deepdiff import DeepDiff from flask import abort, redirect, render_template, request, send_from_directory, url_for, make_response, send_file, session from flask_login import current_user, login_required, login_user, logout_user from login impor...
Python
0.99989
@@ -2877,24 +2877,41 @@ %7B'_id': 0%7D)%0A + try:%0A diff @@ -2961,22 +2961,160 @@ der=True -).json +, verbose_level=2).json%0A except:%0A diff = %7B'error': True, 'message': 'an error has occured. see company directly for changes.'%7D %0A
688e0426b80f64152b22a3a859020b46d8abc8c2
Update radio.py
cogs/radio.py
cogs/radio.py
from .utils import config, checks, formats import discord from discord.ext import commands import discord.utils import random, json, asyncio from urllib.parse import unquote class Radio: """The radio-bot related commands.""" def __init__(self, bot): self.bot = bot if not discord.op...
Python
0.000001
@@ -1441,24 +1441,25 @@ + 'playlists +/ ' + pl)%0D%0A
d37b4677f12514521a9aed9755007758a8b77c1f
Made it so that case functions can take *args, **kwargs
fp/__init__.py
fp/__init__.py
""" functools2 Provides a number of operator and higher-order functions for FP fun """ #### # atoms #### undefined = object() #### ## Operators #### import sys from operator import ( # arithmatic add, sub, mul, truediv as div, pow, mod, neg, # bitwise ops and_, xor, or_, invert, not_, concat, c...
Python
0.99962
@@ -398,19 +398,20 @@ f case(* -arg +rule s):%0A @@ -479,19 +479,20 @@ if len( -arg +rule s) == 1: @@ -500,26 +500,28 @@ -args = arg +rules = rule s%5B0%5D%0A @@ -612,19 +612,20 @@ ven(len( -arg +rule s)), %22un @@ -661,21 +661,31 @@ f inner( -value +*args, **kwargs ):%0A @@ -712,19 +712...
7adeb5e668a132ab540fa45c8e6c62cb8481930d
fix infinite recursion
fluff/sync_couchdb.py
fluff/sync_couchdb.py
from django.db.models import signals import os from couchdbkit.ext.django.loading import get_db from pillowtop.utils import import_pillows from dimagi.utils.couch.sync_docs import sync_design_docs as sync_docs FLUFF = 'fluff' def sync_design_docs(temp=None): dir = os.path.abspath(os.path.dirname(__file__)) ...
Python
0.00056
@@ -159,45 +159,15 @@ ouch -.sync_docs import sync_design_docs as + import syn @@ -446,55 +446,8 @@ bel%0A - print 'fluff sync: %25s' %25 app_label%0A @@ -498,16 +498,33 @@ ync_docs +.sync_design_docs (db, os. @@ -1039,16 +1039,26 @@ +sync_docs. copy_des
9cc7218f2eef7135e5402a47c2783def31add9f3
save screenshot in 800x480 too
screenshots.py
screenshots.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, with_statement from PIL import Image, ImageFile from shovel import task from meta.utils import path_meta, path_generated, depends ImageFile.MAXBLOCK = 2**20 def save(image, filename): image.save(filename, "JPEG", quality=98, optimize=Tru...
Python
0
@@ -1275,16 +1275,28 @@ 4, 768), + (800, 480), (960, 6
eba4f4afe1eac7284518b073f43078b4cb7d7f6c
Update search.py (#5409)
frappe/desk/search.py
frappe/desk/search.py
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt # Search from __future__ import unicode_literals import frappe, json from frappe.utils import cstr, unique from frappe import _ from six import string_types # this is called by the Link Field @frappe.whitelist() def se...
Python
0.000001
@@ -3495,15 +3495,20 @@ 99), + %7B0%7D, %60tab%7B -0 +1 %7D%60.i @@ -3518,13 +3518,8 @@ desc -, %7B1%7D %22.fo @@ -3523,25 +3523,16 @@ .format( -doctype, order_by @@ -3545,16 +3545,25 @@ _on_meta +, doctype )%0A%0A%09%09%09va
bcb1c8d48532159f76708bdfd0e6868dbda92343
make sure command processes run in test database when needed
freppledb/__init__.py
freppledb/__init__.py
r''' A Django project implementing a web-based user interface for frePPLe. ''' VERSION = '4.5.0' def runCommand(taskname, *args, **kwargs): ''' Auxilary method to run a django command. It is intended to be used as a target for the multiprocessing module. The code is put here, such that a child process load...
Python
0
@@ -538,16 +538,8 @@ ect -default data @@ -583,16 +583,29 @@ DB_ALIAS +, connections %0A from @@ -708,16 +708,16 @@ _ALIAS)%0A - setatt @@ -755,16 +755,210 @@ atabase) +%0A if 'FREPPLE_TEST' in os.environ:%0A from django.conf import settings%0A connections%5Bdatabase%5D.close()%0A settings.DATABA...
0ec9feb9daf45af6c8ed8aa48afe68f698892748
version bump for 0.7.3.
ftr/version.py
ftr/version.py
version = '0.7.2'
Python
0
@@ -12,8 +12,8 @@ 0.7. -2 +3 '%0A%0A
b56145ad1aebd931ca0e741ea7d4315520e6ed40
Tweak version incrementer
release.py
release.py
from os import fdopen, remove from shutil import move import subprocess import sys from tempfile import mkstemp from geomeppy import __version__ def replace(file_path, pattern, subst): # Create temp file fh, abs_path = mkstemp() with fdopen(fh, 'w') as new_file: with open(file_path) as old_file: ...
Python
0
@@ -949,53 +949,12 @@ -major, minor, patch = version.split('.')%0A +new_ vers @@ -1000,36 +1000,8 @@ ')%5D%0A - version%5Bincrement%5D += 1%0A @@ -1019,16 +1019,20 @@ nge(len( +new_ version) @@ -1065,32 +1065,36 @@ nt:%0A +new_ version%5Bi%5D += 1%0A @@ -1127,24 +1127,28 @@ ...
720c841d0930f73d1efe90518b0a2d9dcbd6425d
Document context
funktional/context.py
funktional/context.py
import sys from contextlib import contextmanager training = False @contextmanager def context(**kwargs): current = dict((k, getattr(sys.modules[__name__], k)) for k in kwargs) for k,v in kwargs.items(): setattr(sys.modules[__name__], k, v) yield for k,v in current.items(): setattr(sys...
Python
0.000004
@@ -43,16 +43,47 @@ anager%0A%0A +# Are we training (or testing)%0A training @@ -132,16 +132,170 @@ wargs):%0A + %22%22%22Temporarily change the values of context variables passed.%0A%0A Enables the %60with%60 syntax:%0A%0A %3E%3E%3E with context(training=True):%0A ... %0A %22%22%22%0A curr
55987e48997f7f5a94adc3c53fcb8ae58e672c3c
increase version number
gdc_client/version.py
gdc_client/version.py
__version__ = 'v1.3.0'
Python
0.00036
@@ -15,9 +15,9 @@ 'v1. -3 +4 .0'%0A
ed7f0e555b438b611f4a9b0fdf6de1fca6ec2914
fix incorrect use of str replace
genSongbook.py
genSongbook.py
#!/usr/bin/python import sys, os def query(question, default): sys.stdout.write(question + " [" + default + "] ? ") choice = raw_input() if choice == '': return default return choice if __name__ == '__main__': print("----------------------") print("Welcome to genSongbook") print(...
Python
0.000014
@@ -1456,20 +1456,85 @@ += %22%5Cn%22%0A -%0A + #sys.stdout.write(rep) #-- Screen output for debugging.%0A%0A s = s.repla
c7067fce8723f810ed48de6513c6f756d499d807
add whitelist tags.
dp_tornado/helper/html.py
dp_tornado/helper/html.py
# -*- coding: utf-8 -*- from dp_tornado.engine.helper import Helper as dpHelper try: # py 2.x import HTMLParser html_parser = HTMLParser.HTMLParser() except: # py 3.4- try: import html.parser html_parser = html.parser.HTMLParser() except: # py 3.4+ import html...
Python
0
@@ -1228,16 +1228,38 @@ br', 'b' +, 'br', 'site', 'font' )%0A%0A
ab6d09c93a9d43ffbf442880633170f5fc678edd
add verbose mode to print processing module
get_modules.py
get_modules.py
#!/usr/bin/env python3 import os import sys import requests import yaml import git import svn.remote import zipfile import argparse def get_modules(yml_file, dest): f = open(yml_file) for data in yaml.load(f): if (not dest.endswith('/')): dest = dest + '/' if not 'version' in data:...
Python
0.000001
@@ -157,16 +157,25 @@ le, dest +, verbose ):%0A f @@ -476,24 +476,33 @@ e'%5D, version +, verbose )%0A f.clos @@ -548,32 +548,41 @@ e, type, version +, verbose ):%0A if os.pat @@ -612,22 +612,257 @@ -return +if verbose: print(name + ' already exist')%0A return%0A%0A if verbose and ver...
ad70f37b4a02ba117a91dcbdf5387ade2cbdfcf5
Change petset to stateful set
e2e/tests/test_volumes.py
e2e/tests/test_volumes.py
from clickclick import fatal_error from .helpers import PETSET_PATH, SECRET_PATH, create_resource, wait_for_pod def test_volumes(run_id, url, token): secret_manifest = ''' apiVersion: v1 kind: Secret metadata: name: &cluster_name spilodemo labels: application: spilo spilo-cluster: *cluster_name type...
Python
0.000002
@@ -534,20 +534,19 @@ apps/v1 -alph +bet a1%0Akind: @@ -550,11 +550,16 @@ nd: -Pet +Stateful Set%0A @@ -823,79 +823,8 @@ ame%0A - annotations:%0A pod.alpha.kubernetes.io/initialized: %22true%22%0A
3c008b66e71a287b29dca6e753094fbba6228660
fix silly name thing
app/mim/routes.py
app/mim/routes.py
import os from flask import Flask, redirect, render_template, request, session, flash, url_for from flask_bcrypt import Bcrypt # from flask.ext.csrf import csrf from pymongo.errors import DuplicateKeyError from models import * import core import mendeley_api import util from . import RegistrationForm # from mim impo...
Python
0.998391
@@ -6146,25 +6146,20 @@ ession%5B' -this_user +name '%5D = nam
740cf4e1a25533b4d3279a17e23b1ff9f6c13006
Update Watchers.py
examples/Watchers.py
examples/Watchers.py
Import openpyxl from seleniumbase import BaseCase los = [] url = 'https://stocktwits.com/symbol/' workbook = openpyxl.load_workbook('Test.xlsx') worksheet = workbook.get_sheet_by_name(name = 'Sheet1') for col in worksheet['A']: los.append(col.value) los2 = [] print(los) class MyTestClass(BaseCase): #for i in ...
Python
0.000001
@@ -1,20 +1,4 @@ -Import openpyxl%0A from @@ -32,329 +32,114 @@ se%0A%0A -los = %5B%5D%0Aurl = 'https://stocktwits.com/symbol/'%0Aworkbook = openpyxl.load_workbook('Test.xlsx')%0Aworksheet = workbook.get_sheet_by_name(name = 'Sheet1') %0Afor col in worksheet%5B'A'%5D +%0Aclass MyTestClass(BaseCase) :%0A +%0A -...
3462a4755eac0ea74b9c90f867e769c47504c5bd
add license to top of __init__ in examples
examples/__init__.py
examples/__init__.py
Python
0.000007
@@ -0,0 +1,768 @@ +# Licensed to the Cloudkick, Inc under one or more%0A# contributor license agreements. See the NOTICE file distributed with%0A# this work for additional information regarding copyright ownership.%0A# libcloud.org licenses this file to You under the Apache License, Version 2.0%0A# (the %22License%22)...
5f9e04c77c2bf1a77dd078438869882432c411a4
添加参数 +1
app/remote_rpc.py
app/remote_rpc.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Created by follow on 2016/10/28 from flask import Flask from flaskext.xmlrpc import XMLRPCHandler, Fault import jenkins import time import base64 import commands # from jinja2.nodes import Output import os # import MySQLdb import re app = Flask(__name__) handler = XMLR...
Python
0.000116
@@ -4254,16 +4254,22 @@ er/wars/ +%7B%7D-%7B%7D/ *.war %7C @@ -4321,16 +4321,36 @@ d . -f1' +.format(system, ver) )%0A st
87da5bcf5b11762605c60f57b3cb2019d458fcd3
Set version to v2.1.0a3
spacy/about.py
spacy/about.py
# inspired from: # https://python-packaging-user-guide.readthedocs.org/en/latest/single_source_version/ # https://github.com/pypa/warehouse/blob/master/warehouse/__about__.py __title__ = 'spacy-nightly' __version__ = '2.1.0a3.dev0' __summary__ = 'Industrial-strength Natural Language Processing (NLP) with Python and Cy...
Python
0.000041
@@ -223,13 +223,8 @@ .0a3 -.dev0 '%0A__
6ee6fbb0106d0688ce2f292b59569faa430e4904
change comment for N test
qutip/tests/test_random.py
qutip/tests/test_random.py
# This file is part of QuTiP: Quantum Toolbox in Python. # # Copyright (c) 2011 and later, Paul D. Nation and Robert J. Johansson. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: ...
Python
0
@@ -3611,34 +3611,25 @@ %7D; expected -dimensions +N of %7B%7D, got
09f55d300bcf4aba1bf4b2855df3b35172d29cd4
Fix issue #32138 - fix examples typo (#32140)
lib/ansible/modules/storage/purestorage/purefa_snap.py
lib/ansible/modules/storage/purestorage/purefa_snap.py
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2017, Simon Dodsley (simon@purestorage.com) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1',...
Python
0
@@ -1499,35 +1499,32 @@ 10.10.10.2%0A -fa_ api_token: e3106 @@ -1547,32 +1547,32 @@ 40-25983c6c4592%0A + state: prese @@ -1720,35 +1720,32 @@ 10.10.10.2%0A -fa_ api_token: e3106 @@ -1967,35 +1967,32 @@ 10.10.10.2%0A -fa_ api_token: e3106 @@ -2182,23 +2182,20 @@ 10.10.2%0A + -fa_ api_t...
939f7a9e91022c8dab5da13e9e3f738f6c25c524
Update perception_obstacle_sender.py
modules/tools/record_analyzer/tools/perception_obstacle_sender.py
modules/tools/record_analyzer/tools/perception_obstacle_sender.py
#!/usr/bin/env python ############################################################################### # Copyright 2018 The Apollo Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy ...
Python
0.000001
@@ -1799,37 +1799,8 @@ ()%0A%0A - record_file = args.file%0A%0A @@ -1812,17 +1812,16 @@ .init()%0A -%0A node
8fa528696393c18f74ceb5d6bbcf87231e072b21
update gentle/transcriber.py __main__
gentle/transcriber.py
gentle/transcriber.py
import math import logging import wave from gentle import transcription from multiprocessing.pool import ThreadPool as Pool class MultiThreadedTranscriber: def __init__(self, kaldi_queue, chunk_len=20, overlap_t=2, nthreads=4): self.chunk_len = chunk_len self.overlap_t = overlap_t self.nt...
Python
0
@@ -3236,70 +3236,19 @@ -from util import ffmpeg%0A from gentle import standard_kaldi%0A +import json %0A @@ -3320,16 +3320,110 @@ 'INFO')%0A +%0A import gentle%0A from gentle import standard_kaldi%0A%0A resources = gentle.Resources()%0A%0A %0A @@ -3505,16 +3505,90 @@ i.Kaldi( +resources...
ee2c6e18d9a59ba6781957a6ad153a657f1e7816
Fix datetime conversion when editing the issues in TUI.
fuzzinator/ui/tui/dialogs.py
fuzzinator/ui/tui/dialogs.py
# Copyright (c) 2016-2018 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>. # This file may not be copied, modified, or distributed except # according to those terms. from urwid import * from ...config import config_get_callable fro...
Python
0
@@ -247,16 +247,46 @@ terms.%0A%0A +from datetime import datetime%0A from urw @@ -7119,32 +7119,113 @@ rrors='ignore')%0A + if t == datetime:%0A return value.strftime('%25Y-%25m-%25d %25H:%25M:%25S')%0A if value @@ -7565,32 +7565,123 @@ rrors='ignore')%0A + if t == datetime:%0A ...
203cba83527ed39cc478c4f0530e513c71f2a6ad
format date in title
examples/daynight.py
examples/daynight.py
import numpy as np from mpl_toolkits.basemap import Basemap import matplotlib.pyplot as plt from datetime import datetime # example showing how to compute the day/night terminator and shade nightime # areas on a map. # miller projection map = Basemap(projection='mill',lon_0=180) # plot coastlines, draw label meridia...
Python
0.000172
@@ -834,24 +834,54 @@ UTC)' %25 date +.strftime(%22%25d %25b %25Y %25H:%25M:%25S%22) )%0Aplt.show()
9c5c8792c3f350614095b9203967fce83b09ee4c
Remove unused constant
lib/python2.6/aquilon/aqdb/model/address_assignment.py
lib/python2.6/aquilon/aqdb/model/address_assignment.py
# ex: set expandtab softtabstop=4 shiftwidth=4: -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2010,2011,2012 Contributor # # This program is free software; you can redistribute it and/or modify # it under the terms of the EU DataGrid Software License. You should # have received a copy of the li...
Python
0
@@ -2223,147 +2223,8 @@ n'%0A%0A -# Valid values:%0A# - system: used/configured by the operating system%0A# - zebra: used/configured by Zebra%0AADDR_USAGES = %5B'system', 'zebra'%5D%0A%0A %0Acla
ddb0a5d3b684c96b8fe8c4678cdb5e018f1b3d7b
Revert last change. Just in case...
rbm2m/action/downloader.py
rbm2m/action/downloader.py
# -*- coding: utf-8 -*- import urllib import sys import requests from .debug import dump_exception HOST = 'http://www.recordsbymail.com/' GENRE_LIST_URL = '{host}browse.php'.format(host=HOST) SEARCH_URL = '{host}search.php?genre={genre_slug}&instock=1' IMAGE_LIST_URL = '{host}php/getImageArray.php?item={rec_id}' TI...
Python
0
@@ -239,16 +239,26 @@ e_slug%7D& +format=LP& instock=
6ce67ab2e0c47459bc51fb94b0bbfaa6a8e57689
Split Milestone out into _Entry and Milestone
github-push-issues.py
github-push-issues.py
#!/usr/bin/env python # # Copyright (C) 2015 W. Trevor King <wking@tremily.us> # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyrig...
Python
0
@@ -3429,25 +3429,22 @@ %0A%0Aclass -Milestone +_Entry (object) @@ -3484,192 +3484,71 @@ ne, -state='open', description=None,%0A due_on=None):%0A self.title = title%0A self.state = state%0A self.description = description%0A self.due_on = due_on +body=None):%0A sel...