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
e7ba38cb79be32336321d80394904243f0799c69
Revert to using --output switch for the output file.
tlkie/tlkie.py
tlkie/tlkie.py
#!/usr/bin/env python import argparse, os, sys from pynwn.file.tlk import Tlk from pynwn.file.tls import TLS from pynwn.util.helper import get_encoding parser = argparse.ArgumentParser() parser.add_argument('-v', '--version', action='version', version='0.1') parser.add_argument('output', help='Output TLK or TLS file...
Python
0
@@ -276,16 +276,24 @@ gument(' +-o', '-- output', @@ -1325,24 +1325,8 @@ _%22:%0A - main = None%0A @@ -1411,16 +1411,17 @@ lower()%0A +%0A if o @@ -1430,17 +1430,17 @@ ext -! += = '.tlk' and @@ -1439,20 +1439,47 @@ tlk' - and +:%0A main = Tlk()%0A elif outext != ' @@ -1474,17 +1474...
795b32fc66f243239d05a5434f939a76800c0052
remove duplicated report_state that exists in the base class more pylint fixes
nova/scheduler/service.py
nova/scheduler/service.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010 Openstack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2...
Python
0
@@ -828,39 +828,8 @@ ice%0A -from nova.compute import model%0A from @@ -995,33 +995,33 @@ use')%0A%0A -scheduler_classes +SCHEDULER_CLASSES = %7B'ran @@ -1321,33 +1321,33 @@ not in -scheduler_classes +SCHEDULER_CLASSES ):%0A @@ -1505,25 +1505,25 @@ s = -scheduler_classes +SCHEDULER_CLASSES %5BFLA @@ -...
27bb0a5b992eb91d114f98731141090c5c2e9067
remove from itertoolz import foo from doctests
itertoolz/core.py
itertoolz/core.py
import itertools identity = lambda x: x def remove(predicate, coll): """ Return those items of collection for which predicate(item) is true. >>> from itertoolz import remove >>> def even(x): ... return x % 2 == 0 >>> list(remove(even, [1, 2, 3, 4])) [1, 3] """ return filter(lamb...
Python
0
@@ -147,45 +147,8 @@ e.%0A%0A - %3E%3E%3E from itertoolz import remove%0A @@ -160,24 +160,24 @@ ef even(x):%0A + ... @@ -380,46 +380,8 @@ on%0A%0A - %3E%3E%3E from itertoolz import groupby%0A @@ -845,51 +845,8 @@ ns%0A%0A - %3E%3E%3E from itertoolz import merge_sorted%0A @@ -163...
1679274ef0206dc0c500c30fb8ef4c878e99e450
Fix install-prereq-headers
install-prereq-headers.py
install-prereq-headers.py
import os import sys import tempfile import pathlib import subprocess import copy import logging import argparse import urllib.request import tarfile log = logging.getLogger(__name__) def find_cmake_package(name, version, location_variable=None, ignore_system=False): """ Find a package with cmake Return True...
Python
0
@@ -2353,25 +2353,11 @@ -filename, headers +req = u @@ -2374,51 +2374,172 @@ est. -urlretrieve(url, tmp_path / 'file.tar.gz'); +Request(url, headers=%7B'User-Agent': 'Mozilla/5.0'%7D)%0A with open(tmp_path / 'file.tar.gz', 'wb') as f:%0A f.write(urllib.request.urlopen(req).read())%0A %0A ...
241c97978f4b7c1620ac289b8e46e75c37781cb4
Refactor heights
jason2/dataset.py
jason2/dataset.py
"""Working with netCDF4 data.""" from collections import namedtuple import netCDF4 import numpy Waveforms = namedtuple("Waveforms", ["data", "latitudes"]) class Dataset(object): """Wrapper around a netCDF4 dataset. We wrap because we have some common functions that we need to do on the data, such as ...
Python
0.000002
@@ -1246,24 +1246,221 @@ n height%22%22%22%0A + return self._get_height(%22range_20hz_ku%22)%0A%0A def get_ice_height(self):%0A %22%22%22Ice height%22%22%22%0A return self._get_height(%22ice_range_20hz_ku%22)%0A%0A def get_height(self, range_name):%0A corr @@ -1492,24 +1492,24 @@ o...
76412c0d99dd3bed76cf0cc9d06629c6c72ce972
fix bug on urls.py
jellyblog/urls.py
jellyblog/urls.py
from django.conf.urls import url, include from django.conf import settings from django.http import HttpResponseRedirect from django.contrib.sitemaps.views import sitemap from jellyblog import views from .feeds import LatestFeed, AllPublickFeed from .sitemaps import BlogSitemap from .serializer import router sitemaps...
Python
0.000001
@@ -601,16 +601,17 @@ uments') +, %0A # /
fb384756680bb533aa44d7cd638c15aaf0991d32
Add some more tests
tests/tests.py
tests/tests.py
import os import hrf import unittest import json directory = os.path.dirname(__file__) class HrfTestCase(unittest.TestCase): def setUp(self): self.app = hrf.app.test_client() def test_json1_title(self): json_input = file(os.path.join(directory, '1.json'), 'r').read() post = json.loads...
Python
0
@@ -1915,16 +1915,901 @@ 8.png'%0A%0A + def test_json1_timezone1(self):%0A json_input = file(os.path.join(directory, '1.json'), 'r').read()%0A post1 = json.loads(self.app.post('/timestamp?timezone=US/Eastern', data=json_input).data)%0A post2 = json.loads(self.app.post('/timestamp', data=json_in...
c2a972b06d97379118840ec88e672d75602ebd2d
Revert stderr changes from prior commit. No effect on Jenkins outputs.
jktest/logutil.py
jktest/logutil.py
''' This module contains utilities for post-processing the output log ''' import io import os import shutil import subprocess import sys from jktest.config import SetupConfig class Tee( object ): ''' **Public Class** Instantiations of this class are used to set the sys.stdout. ...
Python
0
@@ -2608,41 +2608,8 @@ __%0D%0A -%0D%0A sys.stderr = sys.stdout%0D%0A%0D%0A @@ -2922,41 +2922,8 @@ __%0D%0A - sys.stderr = sys.__stderr__%0D%0A %0D%0A%0D%0A
4d042a3038e815c045902007a3c5e8378df420f9
Add invite link command.
joku/cogs/core.py
joku/cogs/core.py
""" Core commands. """ import inspect import asyncio from discord.ext import commands from discord.ext.commands import Command, CheckFailure from joku.bot import Jokusoramame from joku.redis import with_redis_cooldown class Core(object): """ Core command class. """ def __init__(self, bot: Jokusoram...
Python
0
@@ -46,16 +46,32 @@ asyncio +%0A%0Aimport discord %0Afrom di @@ -1060,24 +1060,256 @@ wVat8.**%22)%0A%0A + @commands.command(pass_context=True)%0A async def invite(self, ctx):%0A invite = discord.utils.oauth_url(ctx.bot.app_id)%0A await ctx.bot.say(%22**To invite the bot to your server, use this...
7556def7c9d591b9579742545bb2f40777b26ed8
Fix default value for the fake_utils' path argument
tests/utils.py
tests/utils.py
import os import tempfile from contextlib import contextmanager def create_sparse_tempfile(name, size): """ Create a temporary sparse file. :param str name: suffix for filename :param size: the file size (in bytes) :returns: the path to the newly created file """ (fd, path) = tempf...
Python
0.99999
@@ -858,16 +858,17 @@ s(path=%22 +. %22):%0A
e86d35811b032a13df0c448292ee4e08d9b8b7ba
remove required=.. from args since it's not necessary
xbrowse_server/base/management/commands/load_phenotips_from_json.py
xbrowse_server/base/management/commands/load_phenotips_from_json.py
from __future__ import print_function import json import requests from pprint import pformat from django.core.management.base import BaseCommand, CommandError from xbrowse_server.base.models import Project, Individual from settings import PHENOTIPS_SERVICE_HOSTNAME, PHENOTIPS_PORT from django.core.exceptions import O...
Python
0.00003
@@ -839,31 +839,16 @@ ject id%22 -, required=True )%0A @@ -958,23 +958,8 @@ UI%22 -, required=True )%0A @@ -1614,32 +1614,16 @@ t(%22%5Cn%22)%0A - %0A
ccfdec698cfd6d4de3b3d57ab74bfd87a196957c
Rename these methods because we will introduce the json module's versions.
jsonvalue/core.py
jsonvalue/core.py
from pyld import jsonld class JsonValue(object): def __init__(self): self._dumpers = {} self._loaders = {} def type(self, type, dump, load): self._dumpers[type] = dump self._loaders[type] = load def load(self, type, value): load = self._loaders.get(type) if...
Python
0
@@ -18,16 +18,17 @@ jsonld%0A%0A +%0A class Js @@ -244,16 +244,22 @@ def load +_value (self, t @@ -400,16 +400,22 @@ def dump +_value (self, t @@ -1085,16 +1085,22 @@ elf.load +_value )%0A%0A d @@ -1301,16 +1301,22 @@ elf.dump +_value ),%0A
df9c646d21d810b8fd76ef41b7275c1ddb2ec6b1
Revert previous change
jujuxaas/proxy.py
jujuxaas/proxy.py
import os import time import yaml from jujucharmtoolkit.juju import Juju, Relation import jujuxaas.auth.direct import jujuxaas.auth.openstack import jujuxaas.client from jujuxaas import utils import logging logger = logging.getLogger(__name__) logging.basicConfig(level=logging.DEBUG) def ensure_openstack_libs(): ...
Python
0.000001
@@ -286,105 +286,8 @@ G)%0A%0A -def ensure_openstack_libs():%0A utils.run_command(%5B'pip', 'install', 'python-keystoneclient'%5D)%0A%0A def @@ -1396,38 +1396,8 @@ se:%0A - ensure_openstack_libs()%0A
5f2991b870cb960e1c17c8db1d9e7007a1af3a4e
shorten bang to b
julia/__init__.py
julia/__init__.py
import sys import keyword from .core import Julia, JuliaModule # initialize julia interpreter julia = Julia() # add custom import behavior for the julia "module" class JuliaImporter(object): def find_module(self, fullname, path=None): if path is None: pass if fullname.startswith("j...
Python
0.99999
@@ -1823,11 +1823,8 @@ %22_b -ang %22)%0A
f0f89a1b85daecd142736375ba5c0bd2103fe3e8
Add "del" alias
keyboard_event.py
keyboard_event.py
class KeyboardEvent(object): @staticmethod def keycode_to_char(keycode): if 32 <= keycode < 128: return chr(keycode) else: return None @staticmethod def keycode_to_name(keycode): try: return keycode_to_name[keycode] except KeyError: ...
Python
0.008846
@@ -1835,24 +1835,39 @@ elete': 46,%0A + 'del': 46,%0A 'divide'
34e1ea87fe6343feb8dc5c673b308088dbd8a43c
Change username field in RegistrationForm to a RegexField
registration/forms.py
registration/forms.py
""" Forms and validation code for user registration. """ from django import forms from django.core.validators import alnum_re from django.utils.translation import ugettext_lazy as _ from django.contrib.auth.models import User from registration.models import RegistrationProfile # I put this on all required fields,...
Python
0.000001
@@ -1136,26 +1136,75 @@ = forms. -Char +Regex Field( +regex=r'%5E%5Cw+$',%0A max_leng @@ -1210,16 +1210,17 @@ gth=30,%0A + @@ -1276,32 +1276,33 @@ rs=attrs_dict),%0A + @@ -2018,178 +2018,8 @@ %22%22%22%0A - if not alnum_re.search(self.cleaned_da...
50e4cf1ae678ac73d41885647eee7c16a30e392d
Add one more test on registration.
registration/tests.py
registration/tests.py
""" Unit tests for django-registration. """ from django.core import mail from django.test import TestCase from registration.models import RegistrationProfile class DefaultBackendTestCase(TestCase): """ Test the default registration backend. """ def setUp(self): """ Create an in...
Python
0
@@ -547,151 +547,182 @@ -Create a new user, verifying that username, email and password%0A are set correctly and that the new user is inactive and%0A received +Test the registration process: registration creates a new%0A inactive account and a new profile with activation key,%0A popula...
8f9b1d8ae70bd259e2b2953913a03f52e5960a1b
Test email sending.
registration/tests.py
registration/tests.py
""" Unit tests for django-registration. """ from django.test import TestCase class DefaultBackendTestCase(TestCase): """ Test the default registration backend. """ def setUp(self): """ Create an instance of the default backend for use in testing. """ fro...
Python
0.000001
@@ -39,16 +39,45 @@ .%0A%0A%22%22%22%0A%0A +from django.core import mail%0A from dja @@ -612,16 +612,57 @@ inactive + and%0A received an activation email .%0A @@ -967,8 +967,54 @@ active)%0A + self.assertEqual(len(mail.outbox), 1)%0A
fb947fe1749b3ecf13ad95394507dc54a8f6c213
Update JGit to 5.0.0.201806131550-r
lib/jgit/jgit.bzl
lib/jgit/jgit.bzl
load("//tools/bzl:maven_jar.bzl", "GERRIT", "MAVEN_LOCAL", "MAVEN_CENTRAL", "maven_jar") _JGIT_VERS = "4.11.0.201803080745-r.93-gcbb2e65db" _DOC_VERS = "4.11.0.201803080745-r" # Set to _JGIT_VERS unless using a snapshot JGIT_DOC_URL = "http://download.eclipse.org/jgit/site/" + _DOC_VERS + "/apidocs" _JGIT_REPO = G...
Python
0
@@ -93,36 +93,35 @@ GIT_VERS = %22 -4.11 +5.0 .0.20180 3080745-r.93 @@ -112,69 +112,42 @@ 0180 -3080745-r.93-gcbb2e65db%22%0A%0A_DOC_VERS = %224.11.0.201803080745-r%22 +6131550-r%22%0A%0A_DOC_VERS = _JGIT_VERS # @@ -284,22 +284,29 @@ _REPO = -GERRIT +MAVEN_CENTRAL # Leav @@ -782,111 +782,111 @@ = %22 -26...
0145cfad50b72d3f2105fe17f6de11831ce5c1de
Add -c option to specify dataframe columns name in advance.
data_analysis/generate_weekly_data.py
data_analysis/generate_weekly_data.py
#!/usr/bin/env python # Given a complete year files with data in the form (page, week, visits) # this script will generate a convenient csv file which will store for # each page and for each years's week the total number of visits. # # Written by Giovanni De Toni (2017) # Email: giovanni.det at gmail.com """Generate y...
Python
0
@@ -393,18 +393,70 @@ put%3E -%0A%0AOptions: + %5B-c %3Ccolumns%3E%5D%0A%0AOptions:%0A -c specify custom columns name. %0A - @@ -646,16 +646,174 @@ ata=%7B%7D%0A%0A +# If the columns are set, add them to the dataframe%0Acolumns_df = %5B%5D%0Awith open(argumens%5B%22%3Ccolumns%3E%22%5D, %22r%22) as f:%0A for ...
7e604be62f48c5a6cd233df08c7ea9aef5420fc9
Clear expired sessions with every call, update session expiration from 7 days to 30 min
dataactbroker/handlers/aws/session.py
dataactbroker/handlers/aws/session.py
from json import loads, dumps from uuid import uuid4 from datetime import datetime, timedelta from flask.sessions import SessionInterface, SessionMixin from flask_login import _create_identifier from dataactcore.interfaces.db import GlobalDB from dataactcore.models.userModel import SessionMap class LoginSession: ...
Python
0
@@ -1984,64 +1984,8 @@ %22%22%0A%0A - SESSION_CLEAR_COUNT_LIMIT = 10%0A%0A CountLimit = 1%0A%0A @@ -4379,232 +4379,37 @@ -UserSessionInterface.CountLimit += 1%0A if UserSessionInterface.CountLimit %25 UserSessionInterface.SESSION_CLEAR_COUNT_LIMIT == 0:%0A SessionTable.clear_session...
e9d48a31245d896d29c0a0d6edaecaae49661b05
set logging in test 001 to go to stdout as launch-bamboo-test reads from there
test/core/001-black-diamond-vanilla-condor-5.0API/black-diamond-setup.py
test/core/001-black-diamond-vanilla-condor-5.0API/black-diamond-setup.py
import logging from pathlib import Path from datetime import date from Pegasus.api import * logging.basicConfig(level=logging.DEBUG) PEGASUS_LOCATION = "file:///usr/bin/pegasus-keg" # --- Work Dir Setup ----------------------------------------------------------- RUN_ID = "black-diamond-5.0api-" + date.today().strf...
Python
0
@@ -7,16 +7,27 @@ logging +%0Aimport sys %0A%0Afrom p @@ -138,16 +138,35 @@ ng.DEBUG +, stream=sys.stdout )%0A%0APEGAS
423f2a182080a72408f86db8a248d78eee0a6db6
fix generated SConscript
libtbx_refresh.py
libtbx_refresh.py
from __future__ import division try: from glob import glob import libtbx.load_env import os dials_path = libtbx.env.dist_path('dials') filenames = glob(os.path.join(dials_path, "extensions", "*.pyc")) if len(filenames) > 0: print "Cleaning up 'dials/extensions':" for filename in filenames: pr...
Python
0
@@ -1722,16 +1722,29 @@ rite(''' +Import(%22env%22) %0Aimport @@ -1998,28 +1998,8 @@ 2%5D)%0A -env = Environment()%0A env. @@ -2117,16 +2117,21 @@ %5B%25s%5D:%0A + ac = env.Aut @@ -2193,16 +2193,67 @@ (cmd)%5D)%0A + Requires(ac, Dir(libtbx.env.under_build('lib')))%0A ''' %25 (
9bb0586e7384edc3ad232be63a7cc3f360d3899a
enable command line completion for all bash users
libtbx_refresh.py
libtbx_refresh.py
from __future__ import division try: from glob import glob import libtbx.load_env import os dials_path = libtbx.env.dist_path('dials') filenames = glob(os.path.join(dials_path, "extensions", "*.pyc")) if len(filenames) > 0: print "Cleaning up 'dials/extensions':" for filename in filenames: pr...
Python
0
@@ -3563,17 +3563,16 @@ etion()%0A -# _install
1334a91c9200fdefd8938ceacee67a5f0ad6bd84
update regex for sql log parse
lino/utils/sql.py
lino/utils/sql.py
# import lino # lino.startup('lino_book.projects.team.settings.demo') # import django # print django.__file__ # from lino.api.doctest import * # show_sql_queries() # #doctest: +ELLIPSIS +NORMALIZE_WHITESPACE # r = demo_get('robin','api/tickets/AllTickets', fmt='json', limit=1) # print(r) # show_sql_queries() import ...
Python
0.000001
@@ -754,16 +754,17 @@ = r%22%5E.+ +? %5C((?P%3Cti @@ -812,17 +812,21 @@ .*?)%5C%60.* -) +?;).* $%22%0A #
9961feef169977fd5514297719a0a9163df7ae31
PUT method for saving controldata.
livebridge/web.py
livebridge/web.py
# -*- coding: utf-8 -*- # # Copyright 2017 dpa-infocom GmbH # # 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
@@ -1611,36 +1611,36 @@ %22/api/v1/control -file +data %22, self.control_ @@ -1665,34 +1665,33 @@ app.router.add_p -os +u t(%22/api/v1/contr @@ -1692,20 +1692,20 @@ /control -file +data %22, self. @@ -1713,18 +1713,17 @@ ontrol_p -os +u t)%0A @@ -2917,18 +2917,17 @@ ontrol_p -os +u t(self, @@ -2983,10 +...
4f4737bd23381e4fd62e62936a0704fe8c93e82e
remove unused function
kenja/committer2.py
kenja/committer2.py
import shutil import os from subprocess import check_output from git import Blob from git import Repo from itertools import count from itertools import izip import gittools from multiprocessing import ( Pool, cpu_count ) def c...
Python
0.000016
@@ -1819,498 +1819,8 @@ 0%0A%0A - def construct_from_commit(self, repo, commit):%0A added_files = %7B%7D%0A for entry in commit.tree.traverse():%0A if not isinstance(entry, Blob):%0A continue%0A%0A if not entry.name.endswith('.java'):%0A continue%0A...
0bc4535aa5b17cebfdf8243b165c678538a10fe7
remove table truncating, when connecting to database
log-reader/app.py
log-reader/app.py
# basic stuff required for logging / debugging import os, sys, syslog, traceback # varnishapi to interact with varnishlog import varnishapi # log module to manage data flow coming in from varnishlog into ZipKin database from log import LogReader, LogDataManager from log import LogDatabase, LogStorage # called when t...
Python
0.000001
@@ -1209,19 +1209,20 @@ ables': -Tru +Fals e %5C%0A
08f4531fdd20edc93c66cd11db8b504a05382910
Switch test to SavepointCase
event_registration_cancel_reason/tests/test_event_registration_cancel_reason.py
event_registration_cancel_reason/tests/test_event_registration_cancel_reason.py
# Copyright 2016 Antiun Ingeniería S.L. # Copyright 2016 Tecnativa - Pedro M. Baeza # Copyright 2017 Tecnativa - Vicent Cubells # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from odoo import exceptions, fields from odoo.tests import common class TestEventRegistrationCancelReason(common.Transaction...
Python
0.000001
@@ -306,107 +306,92 @@ mon. -TransactionCase):%0A def setUp(self):%0A super(TestEventRegistrationCancelReason, self).setUp +SavepointCase):%0A @classmethod%0A def setUpClass(cls):%0A super().setUpClass ()%0A @@ -393,28 +393,27 @@ s()%0A -self +cls .event1 = se @@ -406,28 +406,27 @@ ...
4223c8e235337fbb2935eb0e6c78eab50b158609
Update version string.
libcloud/__init__.py
libcloud/__init__.py
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use ...
Python
0.000819
@@ -965,17 +965,17 @@ = %220.5. -0 +1 %22%0A%0Adef e
cf4e3e38836f8d1eba2139c3f3dc351395e5642e
Add copyright notice to step.py module
numba/annotations/step.py
numba/annotations/step.py
"""A light and fast template engine.""" import re class Template(object): COMPILED_TEMPLATES = {} # {template string: code object, } # Regex for stripping all leading, trailing and interleaving whitespace. RE_STRIP = re.compile("(^[ \t]+|[ \t]+$|(?<=[ \t])[ \t]+|\A[\r\n]+|[ \t\r\n]+\Z)", re.M) def ...
Python
0
@@ -1,11 +1,12 @@ %22%22%22 +%0A A light @@ -30,16 +30,1526 @@ engine. +%0A%0ACopyright (c) 2012, Daniele Mazzocchio%0AAll rights reserved.%0A%0ARedistribution and use in source and binary forms, with or without modification,%0Aare permitted provided that the following conditions are met:%0A%0A - Redistribution...
0fdfb58056f744805884ec1ac6c1545f0e889788
fix generate output file
topik/utils.py
topik/utils.py
import itertools import logging import re import os import json from textblob import TextBlob from nltk.collocations import TrigramCollocationFinder from nltk.metrics import BigramAssocMeasures, TrigramAssocMeasures import numpy as np import pandas as pd import gensim logging.basicConfig(format='%(asctime)s : %(level...
Python
0.00003
@@ -2110,17 +2110,16 @@ -------%0A -%0A docu @@ -5742,44 +5742,8 @@ %22%22%22%0A - iter = itertools.tee(reader, 1)%0A @@ -5880,18 +5880,20 @@ tent in -it +read er:%0A
ccad97c9479bcf98bfa00f4b637f551d01c94fd6
Change logs to only start aggregating on container start time
logspit/runner.py
logspit/runner.py
__author__ = 'nhumrich' import re import time from docker import Client from datetime import datetime from dateutil import parser from .streamers import syslog from .objects import Container, Log ## Patch for "--since" option in getting logs. ## See https://github.com/docker/docker-py/pull/796/files ## Only includ...
Python
0
@@ -1702,16 +1702,44 @@ dict()%0A +start_time = datetime.now()%0A %0A%0Adef ge @@ -2389,73 +2389,18 @@ -datetime.utcfromtimestamp(1234567890) # Some random time in 2009 +start_time %0A
0cf4f351e282b2550990ba1d45c307be4a0f90a9
clean up logging, better formatting
boxpub/__init__.py
boxpub/__init__.py
import logging import config from datetime import datetime import jinja2 import markdown import dropbox from dropbox import client, session # from dropbox.rest import ErrorResponse from flask import Flask, request from postutils import split_markdown, process_markdown logging.basicConfig(level=logging.DEBUG) log = ...
Python
0.000001
@@ -266,16 +266,17 @@ rkdown%0A%0A +%0A logging. @@ -287,16 +287,21 @@ cConfig( +%0A level=lo @@ -311,16 +311,111 @@ ng.DEBUG +,%0A format='%25(asctime)s %25(module)s.%25(funcName)s (%25(lineno)d) %25(levelname)s: %25(message)s'%0A )%0Alog =
9e066881ffaacc4df1d7d470df0324ea57ee5aff
fix error in namedtuple inference, we should add an astng class node *instance* in .bases
brain/py2stdlib.py
brain/py2stdlib.py
"""Astroid hooks for the Python 2 standard library. Currently help understanding of : * hashlib.md5 and hashlib.sha1 """ from astroid import MANAGER, AsStringRegexpPredicate, UseInferenceDefault, inference_tip from astroid import nodes from astroid.builder import AstroidBuilder MODULE_TRANSFORMS = {} # module spe...
Python
0
@@ -5457,16 +5457,25 @@ es.Tuple +._proxied )%0A #
dea9632034b462c204478b8f8ef9d92053bb5d1d
Add fit() method to pytorch ImageClassifier class
ml/pytorch/image_classification/image_classifier.py
ml/pytorch/image_classification/image_classifier.py
# %load_ext autoreload # %autoreload 2 import torch from torch import nn from torch.autograd import Variable def accuracy(preds, labels): return (preds==labels).mean() def n_correct(preds, labels): return (preds==labels).sum() class ImageClassifier(object): def __init__(self, net, n_classes): ""...
Python
0
@@ -1603,12 +1603,1492 @@ .opt_args)%0A%0A + def fit(self, train_gen, valid_gen, n_epochs, steps_per_epoch, valid_steps=100, print_every=100):%0A for epoch in range(n_epochs):%0A running_loss = 0.0%0A running_correct = 0.0%0A running_samples = 0.0%0A for i in range...
2f784a5eb8002b2fbb4e960685a1f43474309bf4
bump version
octave_kernel/__init__.py
octave_kernel/__init__.py
"""An Octave kernel for Jupyter""" __version__ = '0.24.8'
Python
0
@@ -51,9 +51,9 @@ '0.2 -4.8 +5.0 '%0A
2bcaae49ff21195e931d7be8220311969787cbf7
Fix style
didyoumean/didyoumean_common_tests.py
didyoumean/didyoumean_common_tests.py
# -*- coding: utf-8 """Common logic for unit tests.""" import sys old_errors = (IOError, OSError) try: NoFileIoError = NoFileOsError = FileNotFoundError except NameError: NoFileIoError, NoFileOsError = old_errors try: IsDirIoError = IsDirOsError = IsADirectoryError except NameError: IsDirIoError, IsD...
Python
0.000001
@@ -1430,32 +1430,41 @@ from Python 2.7. +%0A %22%22%22%0A msg @@ -1801,16 +1801,25 @@ hon 2.7. +%0A %22%22%22%0A
e555e5c29100d05361a99b9b1307f773d7b8a444
Use newer field names in query
bugzilla_plugin.py
bugzilla_plugin.py
#!/usr/bin/python # Copyright (c) 2012, Alexander Todorov <atodorov@redhat.com> import os import sys import getpass import bugzilla import ConfigParser def get_config(filename): cp = ConfigParser.SafeConfigParser() cp.read([filename]) conf = dict( [(key, cp.get('main', key)) for key in [ ...
Python
0.00002
@@ -3196,89 +3196,8 @@ ed', -%0A# 'j_top' : 'AND_G', # not sure if we need to use this here, see issue #4 %0A%0A @@ -3208,17 +3208,9 @@ 'f -ield0-0-0 +1 ' : @@ -3244,17 +3244,10 @@ ' -type0-0-0 +o1 ' : @@ -3270,17 +3270,9 @@ 'v -alue0-0-0 +1 ' : @@ -3294,17 +3294,9 @@ 'f -ield0-1-0 +2 ' :...
487b320e07595477c1793327150cc1ff9cebc494
Fix some old broken code!
modules/Antivirus/AVGScan.py
modules/Antivirus/AVGScan.py
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/ from __future__ import division, absolute_import, with_statement, print_function, unicode_literals import os import subpro...
Python
0.000003
@@ -915,11 +915,38 @@ e%22:%5B +'/A', '/H', '/PRIORITY=High' %5D, - %0A @@ -2130,34 +2130,31 @@ l(%22( -%5B%5E%5Cr%5Cn%5D+) Virus identified +?:%5C(%5B%5E%5C)%5D*%5C) )?(%5B%5E%5Cs%5D+) (.+ @@ -2191,276 +2191,387 @@ -#Stupid AVG prepends the UNC for mapped drives%0A uncdetect = %22%5C(%5C%5C%5C%5C.*%...
aaa30aab6c2b46a1ae247d9cdee8033641106172
Bump version
django_react_templatetags/__init__.py
django_react_templatetags/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ django_react_templatetags ---------- This extension allows you to add React components into your django templates. """ __title__ = "django_react_templatetags" __version__ = "5.0.0" __build__ = 500 __author__ = "Martin Sandström" __license__ = "MIT" __copyright__ = "Co...
Python
0
@@ -223,17 +223,17 @@ = %225.0. -0 +1 %22%0A__buil @@ -240,17 +240,17 @@ d__ = 50 -0 +1 %0A__autho
013cbd6f5994666e3733cc4e1174747b0b3961e5
allow adding users when creating a role
invenio_accounts/admin.py
invenio_accounts/admin.py
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015, 2016 CERN. # # Invenio 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 2 of the # License, or (at your option) any...
Python
0
@@ -1156,34 +1156,158 @@ min. -form.fields import DateTim +contrib.sqla.ajax import QueryAjaxModelLoader%0Afrom flask_admin.form.fields import DateTimeField%0Afrom flask_admin.model.fields import AjaxSelectMultipl eFie @@ -4627,33 +4627,8 @@ = %5C%0A - form_columns = %5C%0A @@ -4650,32 +4650,32 @@ chab...
8520778652438cd4113db2b178ec12e100f63fec
fix mymy issues
src/syft/grid/client/client.py
src/syft/grid/client/client.py
# stdlib from typing import Any from typing import Dict from typing import List from typing import Optional from typing import Type from typing import Union # third party from nacl.encoding import HexEncoder from nacl.signing import SigningKey from pandas import DataFrame # syft relative from ...core.common.message i...
Python
0.000012
@@ -2420,16 +2420,32 @@ entials) + # type: ignore %0A @@ -2593,16 +2593,32 @@ tadata() + # type: ignore %0A
8972743bd70cc377224c3f0be6cc4f6021018600
handle useless pages to prevent being redirected to mobile version
modules/cragr/web/browser.py
modules/cragr/web/browser.py
# -*- coding: utf-8 -*- # Copyright(C) 2013 Romain Bignon # # This file is part of weboob. # # weboob 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 opt...
Python
0
@@ -1366,32 +1366,204 @@ .*': LoginPage,%0A + 'https?://%5B%5E/%5D+/stb/entreeBam%5C?.*pagePremVisite.*': UselessPage,%0A 'https?://%5B%5E/%5D+/stb/entreeBam%5C?.*Interstitielle.*': UselessPage,%0A 'ht
63cf23e54b9173b239a98b14172ccbe78b7694c1
generalize welcome method
ircbot/plugin/redditeu.py
ircbot/plugin/redditeu.py
import datetime import random import re import socket import urllib.error import urllib.request from ircbot import log import ircbot.plugin class YouPornComment(): _last_fetch = None @classmethod def get_random(cls, include_url=False): now = datetime.datetime.now() if cls._last_fetch is not None: diff = n...
Python
0.999973
@@ -1294,17 +1294,16 @@ None%0A%0A%0A -%0A class Bi @@ -2111,16 +2111,148 @@ ncy)%09%0A%0A%0A +class Raziel:%0A%09nicks = ('radio', 'brazier', 'easel')%0A%0A%09@classmethod%0A%09def get_random_nick(cls):%0A%09%09return random.choice(self.nicks)%0A%0A%0A class Re @@ -3012,19 +3012,15 @@ def -happynaught +welcome ...
510c111a9ec2672857455a66c3718145185fffdc
Make default type of is_dict_union 'type' and automatically add key to nested is_dict_unions
is_valid/is_dict_union.py
is_valid/is_dict_union.py
from .base import Predicate from .is_dict_where import is_dict_where from .is_in import is_in from .is_superdict_where import is_superdict_where from .is_subdict_where import is_subdict_where from .to_pred import to_pred class is_dict_union(Predicate): def __init__(self, key, *args, **kwargs): self._key ...
Python
0.000294
@@ -271,21 +271,16 @@ __(self, - key, *args, @@ -290,16 +290,131 @@ wargs):%0A + if args and isinstance(args%5B0%5D, str):%0A key, *args = args%0A else:%0A key = 'type'%0A @@ -1291,16 +1291,237 @@ ional)%0A%0A + elif type(pred) is is_dict_union:%0A r...
b8cf5becf6b68d8044ad3a89a9abcea107909597
Add adapters to main pika import
pika/__init__.py
pika/__init__.py
# ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0 # # The contents of this file are subject to the Mozilla Public License # Version 1.1 (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.mozilla.org/MPL/ # # Software distri...
Python
0
@@ -2143,17 +2143,16 @@ *****%0A%0A -%0A from pik @@ -2299,16 +2299,16 @@ trategy%0A - from pik @@ -2338,16 +2338,317 @@ erties%0A%0A +from pika.adapters.base_connection import BaseConnection%0Afrom pika.adapters.asyncore_connection import AsyncoreConnection%0Afrom pika.adapters.blocking_connection import Blockin...
b527f9a87c1b18412db9d98ac5272ddc4aad03f9
Add extraInfo link in `/admin/auth/user`
openedx/stanford/djangoapps/register_cme/admin.py
openedx/stanford/djangoapps/register_cme/admin.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.contrib import admin from .models import ExtraInfo class ExtraInfoAdmin(admin.ModelAdmin): """ Admin interface for ExtraInfo model. """ list_display = ( 'user', 'get_email', 'last_name', 'fir...
Python
0
@@ -90,16 +90,150 @@ rt admin +%0Afrom django.contrib.auth.admin import UserAdmin%0Afrom django.contrib.auth.models import User%0Afrom django.utils.html import format_html %0A%0Afrom . @@ -796,48 +796,901 @@ fo%0A%0A -admin.site.register(ExtraInfo, ExtraInfo +%0Aclass NewUserAdmin(UserAdmin):%0A %22%22%22%0A M...
7bbf00a1e68d2310346c10f416e9bee16e99bb44
Add RegisterForm
bookstore_app/forms.py
bookstore_app/forms.py
from django import forms from models import * class LoginForm(forms.ModelForm): # username = forms.CharField(label='Username', max_length=20) # password = forms.PasswordInput() password = forms.CharField(widget=forms.PasswordInput) class Meta: model = Customer fields = ['login_id', 'pas...
Python
0
@@ -1,12 +1,23 @@ +import pdb%0A from django @@ -89,113 +89,8 @@ m):%0A - # username = forms.CharField(label='Username', max_length=20)%0A # password = forms.PasswordInput()%0A @@ -246,16 +246,16 @@ els = %7B%0A - @@ -290,8 +290,315 @@ %7D +%0A%0Aclass RegisterForm(forms.ModelForm):%0A...
f1cefc3fa4500440af63765784175baf760ae6c7
bump version 0.9.9
island_backup/__init__.py
island_backup/__init__.py
version = '0.9.1'
Python
0.000001
@@ -12,7 +12,7 @@ 0.9. -1 +9 '%0A
3a795c6a614d96012d60216818cd3b6a4f2e7ab0
Remove hard coded input and output files from script
embem/bodyparts/make_body_part_mapping.py
embem/bodyparts/make_body_part_mapping.py
"""Make a mapping from body part words to categories. Make mapping <body part word> -> [historic words] based on Inger Leemans' clustering. Usage: python make_body_part_mapping.py Requires files body_part_clusters_renaissance.csv, body_part_clusters_classisism.csv, and body_part_clusters_enlightenment.csv to be in ...
Python
0.000001
@@ -305,17 +305,16 @@ t.csv to - %0Abe in t @@ -423,16 +423,42 @@ rt json%0A +import argparse%0Aimport os%0A %0A%0Adef cs @@ -1155,16 +1155,342 @@ urn m1%0A%0A +parser = argparse.ArgumentParser()%0Aparser.add_argument('dir', help='directory containing the body part cluster '%0A 'csv files (%3Ce...
3a9f7feed801b9f32a11040dd546db982fc910ff
add a test for the new gaia bands
isochrones/tests/tests.py
isochrones/tests/tests.py
import tempfile import os, shutil, glob import logging import numpy as np from numba import TypingError from isochrones.mist import MIST_Isochrone from isochrones import StarModel, get_ichrone def test_mist_basic(bands='JHK'): ic = MIST_Isochrone(bands) _basic_ic_checks(ic) assert np.isclose(ic.logg(...
Python
0
@@ -944,16 +944,237 @@ bands)%0A%0A +def test_get_ichrone_gaia(models=%5B'mist'%5D, bands=%5B'Gaia_G_MAW', 'Gaia_BP_MAWf',%0A 'Gaia_RP_MAW', 'Gaia_BP_MAWb'%5D):%0A for m in models:%0A get_ichrone(m, bands=bands)%0A%0A %0A#######
2c8ab4f89af932d523d7190687ee7f72b1e69cfa
Set context for HearingSerializer.
kk/views/hearing.py
kk/views/hearing.py
import django_filters from django.shortcuts import get_object_or_404 from rest_framework import filters, permissions, serializers, status, viewsets, response from rest_framework.decorators import detail_route from kk.models import Hearing, HearingComment, HearingImage from kk.views.base import BaseImageSerializer from...
Python
0.000001
@@ -3220,16 +3220,55 @@ object() +, context=self.get_serializer_context() ).data)%0A
1d790729428c8efa6e934338227076a4d9de6724
Fix SaveToDBTestCase.
tests/tests.py
tests/tests.py
from decimal import Decimal from mock import patch, Mock from bs4 import BeautifulSoup from unittest import TestCase from amazon_payments import AmazonPaymentsAPI from api_responses import RESPONSES class APITestCase(TestCase): def setUp(self): self.api = AmazonPaymentsAPI("access_key", "secret_key", ...
Python
0
@@ -513,19 +513,21 @@ ponse%0A%0A%0A -def +class SaveToD
7a7d2a26099c9a6e34371477fd9a969ed8d469c3
fix asynchronize
monk/roles/remote_trainer.py
monk/roles/remote_trainer.py
# -*- coding: utf-8 -*- """ Created on Sat Feb 01 10:45:09 2014 Training models remotely in cloud @author: pacif_000 """ from monk.core.configuration import Configuration import monk.core.api as monkapi import logging from kafka.client import KafkaClient from kafka.consumer import SimpleConsumer from kafka.producer im...
Python
0.004323
@@ -5446,26 +5446,30 @@ 'user': -us +follow er,%0A
5341fbc7f0c27eda363c2c0337931be2a3314b7d
Fix handling of missing extra requirements of entry points in plugin loader.
trac/loader.py
trac/loader.py
# -*- coding: utf-8 -*- # # Copyright (C) 2005-2006 Edgewall Software # Copyright (C) 2005-2006 Christopher Lenz <cmlenz@gmx.de> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://...
Python
0.000009
@@ -3565,25 +3565,278 @@ -entry_point.load( +try:%0A entry_point.load()%0A except pkg_resources.DistributionNotFound, e:%0A env.log.warning('Cannot load plugin %25s because it '%0A 'requires %22...
110131487474abadd6255bd31153592f3fa516c0
Add SDG and validation generator
trainResnet.py
trainResnet.py
from __future__ import print_function import numpy as np np.random.seed(1337) # for reproducibility SEED = 1337 from keras.datasets import mnist from keras.utils import np_utils from keras import backend as K from bird.models.resnet import ResNetBuilder from bird.generators.sound import SoundDataGenerator batch_siz...
Python
0
@@ -203,16 +203,49 @@ end as K +%0Afrom keras.optimizers import SGD %0A%0Afrom b @@ -392,11 +392,12 @@ h = -1 +2 00 +8 %0Anb_ @@ -404,17 +404,18 @@ epoch = -5 +20 %0A%0A# inpu @@ -586,16 +586,77 @@ lasses)%0A +sgd = SGD(lr=0.001, decay=1e-6, momentum=0.9, nesterov=True)%0A model.co @@ -722,18 +722,11 @@ zer...
74ed19257713c301b15d877b21c7631f6d07dc22
Allow limiting multicast discovery to localhost
openhtf/util/multicast.py
openhtf/util/multicast.py
# Copyright 2016 Google Inc. 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 agre...
Python
0.000001
@@ -4624,24 +4624,51 @@ EFAULT_TTL,%0A + local_only=False,%0A tim @@ -5385,16 +5385,399 @@ L, ttl)%0A + if local_only:%0A sock.setsockopt(%0A socket.IPPROTO_IP,%0A socket.IP_MULTICAST_IF,%0A # IP_MULTICAST_IF is the 8-byte group address followed by the IP%0A # assigne...
bb028e814d3f7f5452edb3d15c5f3db982dbba0a
Update utils.py
tests/utils.py
tests/utils.py
from mock import MagicMock from tg.configuration.auth import TGAuthMetadata from webtest import TestApp from tg import AppConfig from tg.configuration import milestones from tg import TGController, request from socketio.virtsocket import Socket class FakeUser(object): """ Fake user that emulates an users wit...
Python
0.000001
@@ -2367,16 +2367,61 @@ adata()%0A + app_cfg.sa_auth.cookie_secret = 'SECRET'%0A app_
04a3a3caa3df188097bf912610755b3f002b2b21
Print at most two Trello labels in stdout output
trello2misc.py
trello2misc.py
#!/usr/bin/python3 """trello2misc.py Pulls your cards from Trello to your console or your local todo.txt-file. Broadly speaking, one card corresponds to one entry. Boards correspond to contexts, lists to priorities, and labels to projects. See the README.md and trello2misc.ini files for more information. Author: Andr...
Python
0.000593
@@ -3148,16 +3148,21 @@ d.labels +%5B0:2%5D :%0A
4d642e380ae5d2809e4deb07803382f2ce71ce18
remove mock-lxc file before test
tests/webif.py
tests/webif.py
import unittest import urllib2 import shutil import json from flask import Flask from flask.ext.testing import LiveServerTestCase from lwp.app import app from lwp.utils import connect_db class TestWebIf(LiveServerTestCase): render_templates = False def create_app(self): return app def test_ser...
Python
0.000001
@@ -929,32 +929,95 @@ eate_app(self):%0A + shutil.rmtree('/tmp/test_vm_sshd', ignore_errors=True)%0A shutil.c
1eb7aefceed2d26a6a005884504dbc0dc28d1ada
Add TODO
dockci/models/job_meta/stages_main.py
dockci/models/job_meta/stages_main.py
""" Main job stages that constitute a job """ import json import docker import docker.errors from dockci.exceptions import AlreadyBuiltError from dockci.models.job_meta.stages import JobStageBase, DockerStage from dockci.util import built_docker_image_id, is_semantic class ExternalStatusStage(JobStageBase): ""...
Python
0.000002
@@ -266,16 +266,56 @@ antic%0A%0A%0A +# TODO should be a post stage, not main%0A class Ex
4f2d7f00440473e9886b484f937c34044c19607b
Change the default log level in the server since 'progress' has been removed recently.
openquake/server/tasks.py
openquake/server/tasks.py
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright (C) 2014-2016 GEM Foundation # # OpenQuake 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 Licen...
Python
0.000013
@@ -1092,24 +1092,20 @@ G else ' -progress +info '%0A%0A%0A# FI
cf0d928cffc86e7ba2a68a7e95c54c7e530d2da8
Disable accelerate_simd test for now.
packages/Python/lldbsuite/test/lang/swift/accelerate_simd/TestAccelerateSIMD.py
packages/Python/lldbsuite/test/lang/swift/accelerate_simd/TestAccelerateSIMD.py
# TestAccelerateSIMD.py # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Library Exception # # See https://swift.org/LICENSE.txt for license information # See https://swift.org/CONTR...
Python
0
@@ -645,11 +645,77 @@ ssDarwin +,%0A skipIf(bugnumber=46330565) %5D)%0A
15dfc6d1da9d8af2ed9a6f519744fab11a68367e
Fix `xml_sax_parser.py` good/bad naming
python/ql/test/experimental/query-tests/Security/CWE-611/xml_sax_make_parser.py
python/ql/test/experimental/query-tests/Security/CWE-611/xml_sax_make_parser.py
from flask import request, Flask from io import StringIO import xml.sax # xml_content = '<?xml version="1.0"?><!DOCTYPE dt [<!ENTITY xxe SYSTEM "file:///etc/passwd">]><test>&xxe;</test>' app = Flask(__name__) class MainHandler(xml.sax.ContentHandler): def __init__(self): self._result = [] def chara...
Python
0.001726
@@ -735,34 +735,35 @@ _content'%5D%0A%0A -Ba +Goo dHandler = MainH @@ -827,34 +827,35 @@ tContentHandler( -Ba +Goo dHandler)%0A pa @@ -891,34 +891,35 @@ nt))%0A return -Ba +Goo dHandler._result @@ -1112,18 +1112,19 @@ '%5D%0A%0A -Ba +Goo dHandler @@ -1204,18 +1204,19 @@ Handler( -Ba +Goo dHandl...
ed748a7013384c6942e2f3f0769b76619f9f91af
Handle uploading skill plans with invalid skillIDs
thing/stuff.py
thing/stuff.py
import gzip from cStringIO import StringIO try: import xml.etree.cElementTree as ET except: import xml.etree.ElementTree as ET from thing.models import * def handle_skillplan_upload(request): name = request.POST['name'].strip() uf = request.FILES['file'] visibility = request.POST['visibility'] ...
Python
0
@@ -2548,16 +2548,33 @@ e skill%0A + try:%0A @@ -2595,32 +2595,36 @@ objects.create(%0A + skil @@ -2665,16 +2665,20 @@ + level=en @@ -2694,24 +2694,28 @@ b%5B'level'%5D,%0A + @@ -2753,25 +2753,79 @@ '%5D,%0A -) + )%0A except:%0...
5a10ff93f2a426f5ece22c3d53299aa302b22edd
Use unix pattern to collect tasks for deployment
utils/configuration_validator/test_configuration.py
utils/configuration_validator/test_configuration.py
# Copyright 2014 Mirantis, Inc. # # 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 ...
Python
0.998053
@@ -612,16 +612,59 @@ mport os +%0Afrom fnmatch import fnmatch%0Aimport logging %0A%0Aimport @@ -724,16 +724,93 @@ t yaml%0A%0A +logging.basicConfig(level=logging.DEBUG)%0A%0Alog = logging.getLogger(__name__)%0A%0A %0ATASK_SC @@ -1378,19 +1378,23 @@ ir, +file_ pattern -s=(' +='* task @@ -1404,10 +1404,8 @@ aml...
582986085b09a2f8734aec870414e1dfc649043c
Copy TLS verification options when writing configs
euca2ools/commands/iam/createaccesskey.py
euca2ools/commands/iam/createaccesskey.py
# Copyright 2009-2015 Eucalyptus Systems, Inc. # # Redistribution and use of this software in source and binary forms, # with or without modification, are permitted provided that the following # conditions are met: # # Redistributions of source code must retain the above copyright notice, # this list of conditions ...
Python
0
@@ -4,16 +4,20 @@ opyright + (c) 2009-20 @@ -21,34 +21,51 @@ -201 -5 Eucalyptus Systems, Inc. +6 Hewlett Packard Enterprise Development LP %0A#%0A# @@ -4723,16 +4723,458 @@ url) +%0A if self.config.get_region_option('verify-tls') is not None:%0A configfile.set(region_section,...
fdd66e3f5859e8cbec0c6bb7d3d337ea5c30845d
remove unused import statements
jekpost/jekpost_create.py
jekpost/jekpost_create.py
#!/usr/bin/env python3 import argparse import shutil import os import datetime def generate_post_file(title, location, disqus_name=None): title_line = "title: {}".format(title) filename = make_filename(title, get_date_formatted(datetime.date.today())) with open(filename, mode='x', encoding='utf-8') as ac...
Python
0.000003
@@ -37,32 +37,8 @@ rse%0A -import shutil%0Aimport os%0A impo
01b7f6efcf6a3b44b02e4bdbc2c5ef17875a9ff4
improve some details from other commiters' adivces
jieba/analyse/textrank.py
jieba/analyse/textrank.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import sys import collections from operator import itemgetter import jieba.posseg as pseg class UndirectWeightedGraph: d = 0.85 def __init__(self): self.graph = collections.defaultdict(list) def addEdge(self, ...
Python
0
@@ -628,116 +628,8 @@ t)%0A%0A - giter = list(self.graph.items()) # these two lines for build stable iteration%0A giter.sort()%0A @@ -689,29 +689,42 @@ r n, out in -giter +self.graph.items() :%0A @@ -790,24 +790,112 @@ out), 0.0)%0A%0A + sorted_keys = sorted(self.graph.keys())...
9e7eae0e2f3ec5e818f70a537ee740cd5375f7c3
make cfitsio explicitly depend on curl (#12016)
var/spack/repos/builtin/packages/cfitsio/package.py
var/spack/repos/builtin/packages/cfitsio/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 * class Cfitsio(AutotoolsPackage): """CFITSIO is a library of C and Fortran subroutines for readin...
Python
0
@@ -919,24 +919,47 @@ ibraries')%0A%0A + depends_on('curl')%0A depends_
a028ee702583deeb07b3bee38e200bd843479320
Load default watermark from the environment
app/settings.py
app/settings.py
import os from pathlib import Path ROOT = Path(__file__).parent.parent.resolve() # Server configuration PORT = int(os.environ.get("PORT", 5000)) WORKERS = int(os.environ.get("WEB_CONCURRENCY", 1)) if "DOMAIN" in os.environ: # staging / production SERVER_NAME = os.environ["DOMAIN"] RELEASE_STAGE = "staging"...
Python
0
@@ -2055,31 +2055,85 @@ K = -%22%22%0AALLOWED_WATERMARKS = +os.getenv(%22WATERMARK_DEFAULT%22, %22%22)%0AALLOWED_WATERMARKS = %5BDEFAULT_WATERMARK%5D + os. @@ -2140,24 +2140,16 @@ getenv(%22 -ALLOWED_ WATERMAR @@ -2149,16 +2149,23 @@ ATERMARK +_OPTION S%22, %22%22).
1283d02beb8f633e2c31ba29fd43c8eef45b7cdb
Bump micro version number.
landlab/__init__.py
landlab/__init__.py
#! /usr/bin/env python """ The Landlab :Package name: TheLandlab :Version: 0.1.0 :Release date: 2013-03-24 :Authors: Greg Tucker, Nicole Gasparini, Erkan Istanbulluoglu, Daniel Hobley, Sai Nudurupati, Jordan Adams, Eric Hutton :URL: http://csdms.colorado.edu/trac/landlab :License: MIT """ from __futur...
Python
0
@@ -365,9 +365,9 @@ .1.1 -8 +9 '%0A%0A%0A
09f37e4b8d0e4cbaf41a258e6e96bf6f0e7670ec
use materials as default collection
mpcontribs/explorer/views.py
mpcontribs/explorer/views.py
"""This module provides the views for the explorer interface.""" import json, nbformat from bson import ObjectId from django.shortcuts import render_to_response from django.template import RequestContext from mpcontribs.rest.rester import MPContribsRester from mpcontribs.rest.views import get_endpoint from mpcontribs....
Python
0
@@ -375,20 +375,27 @@ lection= -None +'materials' ):%0A c
eea8d0364609a53e215e3f056e6315a6dbc3d50d
call the decorator
addons/account_analytic_analysis/migrations/8.0.1.1/pre-migration.py
addons/account_analytic_analysis/migrations/8.0.1.1/pre-migration.py
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module copyright (C) 2015 Therp BV (<http://therp.nl>). # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
Python
0.000003
@@ -1044,16 +1044,18 @@ .migrate +() %0Adef mig
a368bf67522711d8c9ad31f231af95c307612ca2
add a getters to exceptions
mpf/exceptions/base_error.py
mpf/exceptions/base_error.py
"""Error in MPF or MPF-MC.""" from mpf._version import log_url class BaseError(AssertionError): """Error in a config file found.""" # pylint: disable-msg=too-many-arguments def __init__(self, message, error_no, logger_name, context=None, url_name=None): """Initialise exception.""" self._...
Python
0
@@ -578,32 +578,306 @@ nit__(message)%0A%0A + def get_error_no(self):%0A %22%22%22Return error no.%22%22%22%0A return self._error_no%0A%0A def get_context(self):%0A %22%22%22Return error no.%22%22%22%0A return self._context%0A%0A def get_logger_name(self):%0A %22%22%22Return...
a651b979ca869be932a6ad8f9686436ab6a16a6e
Update the py-lxml package (#4090)
var/spack/repos/builtin/packages/py-lxml/package.py
var/spack/repos/builtin/packages/py-lxml/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
@@ -1493,16 +1493,73 @@ ar.gz%22%0A%0A + version('3.7.3', '075692ce442e69bbd604d44e21c02753')%0A vers @@ -1659,8 +1659,154 @@ build')%0A + depends_on('py-cython@0.20:', type='build')%0A depends_on('libxml2', type=('build', 'run'))%0A depends_on('libxslt', type=('build', 'run'))%0A
891028c46ce03259d488d5796033ca88232a5f08
Test mqtt over websockets.
mqtt/tests/test_websocket.py
mqtt/tests/test_websocket.py
import ssl from django.conf import settings from ambulance.models import Ambulance, AmbulanceStatus from hospital.models import Hospital, HospitalEquipment from mqtt.tests.client import MQTTTestCase, MQTTTestClient, TestMQTT class TestMQTTSubscribe(MQTTTestCase): def test(self): self.assertTrue(True) ...
Python
0
@@ -842,34 +842,13 @@ ts': -'/etc/certificates/ca.crt' + None ,%0A
40625f2b38525c738486c25d10223fa1b24ce7ec
Use unicode in to_string
tml/strings.py
tml/strings.py
# encoding: UTF-8 def to_string(text): """ Safe string conversion Args: text (string|unicode): input string Returns: str """ if text is unicode: return text.encode('utf-8') return text
Python
0.003627
@@ -174,20 +174,26 @@ %0A if +type( text +) is unic @@ -220,38 +220,48 @@ text -.encode('utf-8')%0A return text +%0A return unicode(text.decode('utf-8'))%0A %0A%0A
865dc447fd3593b5b8167afdcdf6308af4fc67db
Allow specification of alpha
msmexplorer/plots/cluster.py
msmexplorer/plots/cluster.py
import numpy as np from matplotlib import pyplot as pp from scipy.spatial import Voronoi from ..utils import msme_colors from ..palettes import msme_rgb __all__ = ['plot_voronoi'] @msme_colors def plot_voronoi(kmeans, ax=None, obs=(0, 1), cluster_centers=True, radius=None, color_palette=None, xlabe...
Python
0.000001
@@ -363,16 +363,27 @@ lsize=14 +, alpha=0.4 ):%0A %22 @@ -1112,16 +1112,95 @@ ont size +%0A alpha : float, optional (default: 0.4)%0A The alpha value of the fill %0A%0A Re @@ -1833,17 +1833,19 @@ ().max() -* + * 2%0A%0A # @@ -3740,19 +3740,21 @@ , alpha= -0.4 +alpha )%0A%0A i
c861773123a8eeffa68afb908ffce88740250cbf
Change title
app/vote/app.py
app/vote/app.py
from flask import Flask, render_template, request, make_response, g from redis import Redis import os import socket import random import json import consul option_a = os.getenv('OPTION_A', "vim") option_b = os.getenv('OPTION_B', "emacs") color = os.getenv('COLOR', "white") consul_host = os.getenv('CONSUL_HOST', None) ...
Python
0.000078
@@ -2654,24 +2654,25 @@ re_b))%0A%0A +# title = opti @@ -2696,25 +2696,24 @@ ption_b%0A -# title = %22Hel
9660f44a5d17521109397b14c32db71a2fba18ff
Update Conda Version to match MT build number
tools/setup.py
tools/setup.py
# coding: utf-8 ''' ------------------------------------------------------------------------------ Copyright 2018 Esri 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/lic...
Python
0
@@ -854,11 +854,11 @@ ='3. -3.1 +4.0 ',%0A
b50f72c1aa77e91f4cfcecbcf4dedd7095f1c71e
improve comments for placeholder replacing
mythril/ether/ethcontract.py
mythril/ether/ethcontract.py
from mythril.disassembler.disassembly import Disassembly from ethereum import utils import persistent import re class ETHContract(persistent.Persistent): def __init__(self, code, creation_code="", name="Unknown", enable_online_lookup=True): creation_code = re.sub(r'(_+.*_+)', 'aa' * 20, creation...
Python
0
@@ -254,147 +254,8 @@ %0A - creation_code = re.sub(r'(_+.*_+)', 'aa' * 20, creation_code)%0A self.creation_code = creation_code%0A self.name = name%0A%0A @@ -444,61 +444,245 @@ ess%0A -%0A code = re.sub(r'(_+.*_+)', 'aa' * 20, code)%0A + # Apply this for creation_code & cod...
6609189de19d8cb5a71465f604c7dc4c2c165a85
Remove hard coded latex table
nalaf/learning/evaluators.py
nalaf/learning/evaluators.py
import abc from nalaf.structures.data import Entity from nalaf import print_verbose, print_debug class Evaluator: """ Calculates precision, recall and subsequently F1 measure based on the original and the predicted mention to evaluate the performance of a model. Different implementations are possible...
Python
0.000002
@@ -1789,170 +1789,8 @@ %22%22%22 -%0A self.print_latex_table = print_latex_table%0A %22%22%22%0A temporary used for generating nice latex tables for both exact and overlapping%0A %22%22%22 %0A%0A
09d7f74ad51f468c9e74db0fcce9c5d65ebc919c
Fix import
camera/__init__.py
camera/__init__.py
from .camera import TimeLapseCamera
Python
0.000002
@@ -17,16 +17,19 @@ ort -TimeLaps +Configurabl eCam
c941414c6ff18d6f3ad46b20cfa431549d8fde20
Bump version to 0.8.0.rc2
canopen/version.py
canopen/version.py
__version__ = "0.8.0.rc1"
Python
0
@@ -21,7 +21,7 @@ 0.rc -1 +2 %22%0A
f517ba8326b7d0cdd82a20900a55607af9e145e9
changing y2 to y1
periodicals/management/commands/import_publications.py
periodicals/management/commands/import_publications.py
import os import json import shutil from zipfile import ZipFile from django.core.files import File from django.core.management.base import BaseCommand from django.utils.dateparse import parse_date from lxml import etree from periodicals.models import Article, Issue, Page, Publication class Command(BaseCommand): ...
Python
0.999951
@@ -942,17 +942,17 @@ %22y -2 +1 %22: coord
faa32d81a79d66ce16fc3d6a5552143a4456d54f
allow non-ndarray image sizes in init function
cbamf/test/init.py
cbamf/test/init.py
import numpy as np import scipy as sp from cbamf.comp import psfs, ilms, objs from cbamf.test import poissondisks from cbamf import states def _seed_or_not(seed=None): if seed is None: np.random.seed() else: np.random.seed(seed) def _toarr(i): if not hasattr(i, '__iter__'): i = np...
Python
0.000001
@@ -339,17 +339,27 @@ return -i +np.array(i) %0A%0A#=====
142c26fdd0328956adde5bd840408ab97d62e7ee
Refactor main loop to implement stepping properly
turrisclock.py
turrisclock.py
#!/usr/bin/env python2.7 # vim: expandtab shiftwidth=4 tabstop=8 softtabstop=4 smartindent cinwords=if,elif,else,for,while,try,except,finally,def,class,with from gpio import GPIO from clock import Clock from statestore import StateStore import signal import time import argparse def killhandler(signum, frame): rai...
Python
0
@@ -1834,16 +1834,160 @@ + now%251%0A +%0A if nowstate//args.step == clock.state//args.step:%0A time.sleep(args.step - nowstate%25args.step)%0A else:%0A @@ -2067,16 +2067,20 @@ + + args.s @@ -2116,16 +2116,20 @@ + + if clock @@ -2158,16 +...
c013bf7e01d2ff9c47e95f53aabde68a0e5473d0
increase docker api timeout to 60s from 10s default
neurodocker/docker/docker.py
neurodocker/docker/docker.py
"""Classes to interact with the Docker Engine (using the package docker-py)""" # Author: Jakub Kaczmarzyk <jakubk@mit.edu> from __future__ import (absolute_import, division, print_function, unicode_literals) import functools import threading import docker import requests def docker_is_runnin...
Python
0.000001
@@ -821,16 +821,26 @@ rom_env( +timeout=60 )%0ADOCKER
0c91e9c58b968a54b59f63e391a804ff580808b7
Correct arguments to logging function
neutron/cmd/sanity/checks.py
neutron/cmd/sanity/checks.py
# Copyright (c) 2014 OpenStack Foundation. # 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...
Python
0.000558
@@ -2713,17 +2713,16 @@ n: %25s%22, -( full_arg @@ -2726,17 +2726,16 @@ args, e) -) %0A
22958c9c0dc4e5d421dd1a62979c33e1ea8512fa
implement __repr__ on SklearnClassifier
nltk/classify/scikitlearn.py
nltk/classify/scikitlearn.py
# Natural Language Toolkit: Interface to scikit-learn classifiers # # Author: Lars Buitinck <L.J.Buitinck@uva.nl> # URL: <http://www.nltk.org/> # For license information, see LICENSE.TXT from nltk.classify.api import ClassifierI from nltk.probability import DictionaryProbDist import numpy as np from scipy.sparse impo...
Python
0
@@ -2326,16 +2326,94 @@ sparse%0A%0A + def __repr__(self):%0A return %22%3CSklearnClassifier(%25r)%3E%22 %25 self._clf%0A%0A def
7d22d48e14cdcc24e9f4d1308be4a9bfb443f5df
disable the discussion cache update signal until we get solution for pickling
common/djangoapps/cache_toolbox/discussion_cache.py
common/djangoapps/cache_toolbox/discussion_cache.py
import logging from django.core.cache import cache, get_cache from datetime import datetime def _get_discussion_cache(): return get_cache('mongo_metadata_inheritance') def get_discussion_cache_key(course_id): return 'discussion_items_{0}'.format(course_id) def get_discussion_cache_entry(modulestore, course...
Python
0
@@ -729,24 +729,122 @@ course_id):%0A + # make this a NOP for now. We have to figure out how to pickle the result set%0A return%0A %0A componen @@ -869,16 +869,16 @@ it('/')%0A - all_ @@ -1127,60 +1127,8 @@ ()%7D%0A - logging.debug('**** entry = %7B0%7D'.format(entry))%0A @@ -1400,16 +140...
586989bda43be0a206c7f1d579d8c0f2a9a4580d
Use os.path instead of hardcoding Unix directory paths
concurrent_server/management/commands/runcserver.py
concurrent_server/management/commands/runcserver.py
import django from django.core.management.base import BaseCommand, CommandError from django.conf import settings from optparse import make_option import os import sys class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--noreload', action='store_false', dest='use_reloader', d...
Python
0.000002
@@ -161,16 +161,17 @@ rt sys%0A%0A +%0A class Co @@ -3343,16 +3343,17 @@ rtError: + # This @@ -3427,16 +3427,29 @@ path or +os.path.join( django._ @@ -3462,33 +3462,38 @@ _%5B0%5D - + +, ' -/ contrib -/ +', ' admin -/ +', ' media' +) %0A
aa9f15af76e67a529be345850e7913755cba8b21
Fix typo
python/ql/test/experimental/library-tests/frameworks/django-v1/response_test.py
python/ql/test/experimental/library-tests/frameworks/django-v1/response_test.py
from django.http.response import HttpResponse, HttpResponseRedirect, JsonResponse, HttpResponseNotFound # Not an XSS sink, since the Content-Type is not "text/html" # FP reported in https://github.com/github/codeql-python-team/issues/38 def fp_json_response(request): # implicitly sets Content-Type to "application/...
Python
0.000184
@@ -703,10 +703,10 @@ e(re -u q +u est)
c765cadecc9115dc428f174988d8223233f5e583
correct server name form ODOO
stock_level_from_mrp/cron/mailer/stock_level_report.py
stock_level_from_mrp/cron/mailer/stock_level_report.py
# -*- coding: utf-8 -*- ############################################################################### # # ODOO (ex OpenERP) # Open Source Management Solution # Copyright (C) 2001-2015 Micronaet S.r.l. (<http://www.micronaet.it>) # Developer: Nicola Riolini @thebrush (<https://it.linkedin.com/in/thebrush>) # This prog...
Python
0.000568
@@ -3591,29 +3591,52 @@ MTP( -'smtp.gmail.com', 587 +odoo_mailer.smtp_host, odoo_mailer.smtp_port )%0Ael
8748de555f3cd939ecc39cf3bdae50a8677359d7
Bump to v1.9.0
client/__init__.py
client/__init__.py
__version__ = 'v1.8.2' FILE_NAME = 'ok' import os import sys sys.path.insert(0, '') # Add directory in which the ok.zip is stored to sys.path. sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
Python
0.000001
@@ -15,11 +15,11 @@ 'v1. -8.2 +9.0 '%0A%0AF
8ae4be4fea8af1d560f713338de36cdd651d6e2a
bump to 1.6.6. for auth changes
client/__init__.py
client/__init__.py
__version__ = 'v1.6.5' FILE_NAME = 'ok' import os import sys sys.path.insert(0, '') # Add directory in which the ok.zip is stored to sys.path. sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
Python
0.000006
@@ -17,9 +17,9 @@ 1.6. -5 +6 '%0A%0AF
0bb418c72d858322a8fc7ad515f36a045d9dd0de
update to v1.3.29
client/__init__.py
client/__init__.py
__version__ = 'v1.3.28' import os import sys sys.path.insert(0, '') # Add directory in which the ok.zip is stored to sys.path. sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
Python
0
@@ -18,9 +18,9 @@ .3.2 -8 +9 '%0A%0Ai
af53d05284e89ad7bcf5b832e9c1cb49c2fb6289
Move module-level import to top of file
client/diagnose.py
client/diagnose.py
# -*- coding: utf-8-*- import os import sys import time import socket import subprocess import pkgutil import logging if sys.version_info < (3, 3): from distutils.spawn import find_executable else: from shutil import which as find_executable import pip.req import jasperpath logger = logging.getLogger(__name__...
Python
0
@@ -111,16 +111,49 @@ logging%0A +import pip.req%0Aimport jasperpath%0A if sys.v @@ -281,42 +281,8 @@ le%0A%0A -import pip.req%0Aimport jasperpath%0A%0A logg