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
dcc3c857345ea1db3a264f7695591ef166c58719
Update __init__.py
pycipher/__init__.py
pycipher/__init__.py
from adfgx import ADFGX from adfgvx import ADFGVX from simplesubstitution import SimpleSubstitution from caesar import Caesar from affine import Affine from enigma import Enigma from autokey import Autokey from beaufort import Beaufort from bifid import Bifid as Bifid from columnartransposition import ColTrans f...
Python
0.000072
@@ -615,16 +615,48 @@ t Porta%0A +from fracmorse import FracMorse%0A import u
437c9ff95e7e69eff0490f6e513fa49337ff386f
Add tests for IntegerProps.
test/test_properties.py
test/test_properties.py
#!/usr/bin/env python # Copyright (C) 2009-2012: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you can redistribute it and/or modify # it under the terms of the GNU Affer...
Python
0
@@ -2494,24 +2494,375 @@ ), False)%0A%0A%0A +class TestIntegerProp(unittest.TestCase, PropertyTests):%0A %22%22%22Test the IntegerProp class%22%22%22%0A%0A prop_class = shinken.property.IntegerProp%0A%0A def test_pythonize(self):%0A p = self.prop_class()%0A self.assertEqual(p.pythonize(%221%22),...
7f0d09a5d8c391dc6b28e6461939796fffc20825
Update to version v0.3.1
pyeasyga/__init__.py
pyeasyga/__init__.py
# -*- coding: utf-8 -*- """pyeasyga A simple and easy-to-use genetic algorithm implementation library in Python. For a bit array solution representation, simply instantiate the GeneticAlgorithm class with input data, define and supply a fitness function, run the Genetic Algorithm, and retrieve the solution! Other so...
Python
0
@@ -478,11 +478,11 @@ = '0.3. -0 +1 '%0A
92f43b50467c2b0acb553ba79d841a034402efbe
fix description of process_raw utility
raspberryturk/core/data/process_raw.py
raspberryturk/core/data/process_raw.py
import numpy as np import cv2 import os import errno import shutil import chess import hashlib import argparse from random import random from raspberryturk import setup_console_logging from raspberryturk.core.vision.chessboard_frame import ChessboardFrame from raspberryturk.core.vision.constants import SQUARE_SIZE, BOA...
Python
0.000002
@@ -2444,21 +2444,19 @@ of -BAS +SOURC E_PATH -/raw , pr @@ -2516,25 +2516,23 @@ res the -processed +interim format @@ -2538,27 +2538,19 @@ in -BASE_PATH/processed +TARGET_PATH . By
263230a4381ab2c13c40a083839aa4bc7a5e88c3
Fix hard coded filename path
pyharbor/pyharbor.py
pyharbor/pyharbor.py
import json filename = '/home/vineet/Dropbox/kodecrm.com404.har' class Har(object): def __init__(self, filename): self.filaname = filename self.har = read_har(filename) def entries(self, include=None, exclude=None, **kwargs): entries = filter_entries(self.har, **kwargs) if ...
Python
0.000769
@@ -11,63 +11,8 @@ n%0A%0A%0A -filename = '/home/vineet/Dropbox/kodecrm.com404.har'%0A%0A%0A clas @@ -1486,16 +1486,80 @@ :%0A #%0A + # import sys%0A #%0A # script, filename = sys.argv%0A #%0A%0A ## h @@ -1588,32 +1588,38 @@ ted abstraction%0A + #%0A # har = Har( @@ -1750,16 +1750,22 @@ ...
183e469b34e352adc02b3efe14a30622adf9bbf4
Update docs for the PlayLists module.
pympris/PlayLists.py
pympris/PlayLists.py
#!/usr/bin/env python # coding=utf-8 # Copyright (c) Mikhail Mamrouski. # See LICENSE for details. """ This module provides a `PlayLists` class wich implemented MPRIS2 PlayLists interface: http://specifications.freedesktop.org/mpris-spec/latest/Playlists_Interface.html class PlaylistOrdering uses as an enum for Orde...
Python
0
@@ -102,14 +102,9 @@ %22%22%22%0A -This m +M odul @@ -133,17 +133,17 @@ s%60 class -%0A + wich imp @@ -261,22 +261,23 @@ e.html%0A%0A -c +C lass +%60 Playlist @@ -284,16 +284,17 @@ Ordering +%60 uses as @@ -395,17 +395,17 @@ print - +( pl.Playl @@ -412,16 +412,17 @@ istCount +) %0A pri @@ -423,17...
2f060c30ccf814cdf74a186124c1427e07ec871c
Fix error in pbc.pp debug message
pyscf/pbc/gto/ecp.py
pyscf/pbc/gto/ecp.py
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. 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 # # U...
Python
0.000002
@@ -1164,16 +1164,18 @@ ao %25d', +*( contr_co @@ -1184,16 +1184,17 @@ f.shape) +) %0A%0A ec
d1d9371a728a5d5f5617568b23b072b89295bb61
Fix typo in Atlys HDMI2USB target.
targets/atlys/hdmi2usb.py
targets/atlys/hdmi2usb.py
from litex.gen.fhdl.decorators import ClockDomainsRenamer from litex.soc.integration.soc_core import mem_decoder from litex.soc.interconnect import stream from gateware.encoder import EncoderDMAReader, EncoderBuffer, Encoder from gateware.streamer import USBStreamer from targets.utils import csr_map_update from targe...
Python
0.000002
@@ -1872,17 +1872,17 @@ encoder -. +_ streamer
6a9af602428542157e4a8b42bac8b04803ecd2eb
Create directory inside test
testing/test_rm_dirs.py
testing/test_rm_dirs.py
from __future__ import absolute_import, print_function import pytest import os from ..launcher import Launcher class TestRunProgram: @pytest.fixture(scope='class') def create_update_dir(self, request): files=['tesfeo','fjfesf','fihghg'] filedir=[os.path.join('downloads',fi) for fi in file...
Python
0
@@ -210,16 +210,46 @@ quest):%0A + os.mkdir('downloads')%0A
dcde1a0c2b676d0ac11856d2797f3402f5ba038e
Remove unused import
wafer/users/models.py
wafer/users/models.py
from django.contrib.auth.models import User from django.db import models from django.db.models.signals import post_save from django.utils.encoding import python_2_unicode_compatible from libravatar import libravatar_url try: from urllib2 import urlparse except ImportError: from urllib import parse as urlparse ...
Python
0.000001
@@ -316,47 +316,8 @@ arse -%0Afrom django.utils.http import urlquote %0A%0Afr
19278f5599b68d87976796c3cf4884493c6f3473
Add module description.
config/__init__.py
config/__init__.py
Python
0
@@ -0,0 +1,59 @@ +%22%22%22This package stores the config variables of the app.%22%22%22%0A
85e21fa4c0c775e6899e2da660e27c748a9242bd
Put the watcher in its own process group so upstart and the like will not kill it
moneta/watcher.py
moneta/watcher.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import logging import gevent from gevent import Greenlet, GreenletExit, sleep from gevent.subprocess import Popen from datetime import datetime, timedelta import dateutil.tz from os import setgid, setuid, setgroups, chdir, environ, getpid, setsid, killpg,...
Python
0
@@ -1472,16 +1472,37 @@ n = PIPE +, preexec_fn = setsid )%0A
c97b760c9ca3213eded060e422ebe65b75f0dd84
fix big with hide=null
src/knesset/mks/admin.py
src/knesset/mks/admin.py
from django import forms from django.contrib import admin from django.forms.models import modelformset_factory from django.forms.models import inlineformset_factory from django.contrib.contenttypes import generic from knesset.mks.models import * from knesset.links.models import Link from knesset.video.models import Vi...
Python
0.000103
@@ -205,16 +205,47 @@ generic +%0Afrom django.db.models import Q %0A%0Afrom k @@ -1106,16 +1106,18 @@ .filter( +Q( hide=Fal @@ -1119,16 +1119,32 @@ e=False) + %7C Q(hide=None)) %0A
99f4488cd7ad2a2c5487f65ba4b94c1b8c9d4212
Add filtering & count to rlite scan.
walrus/tusks/rlite.py
walrus/tusks/rlite.py
import sys import unittest from hirlite.hirlite import Rlite from walrus import * from walrus.tusks.helpers import TestHelper class WalrusLite(Walrus): _invalid_callbacks = ('SET', 'MSET', 'LSET') def __init__(self, filename=':memory:', encoding='utf-8'): self._filename = filename self._enc...
Python
0
@@ -1,12 +1,27 @@ +import fnmatch%0A import sys%0Ai @@ -1214,187 +1214,224 @@ def -hscan_iter(self, key, *args, **kwargs):%0A if args or kwargs:%0A raise ValueError('Rlite does not support scanning with arguments.')%0A return self.hgetall(key) +_filtered_scan(self, results, match=None, count...
b6b15ce13e3633d24e00028d12081a58c6391d05
Update muLAn version
muLAn/_version.py
muLAn/_version.py
version_info = (0, 8, 6) __version__ = '.'.join(map(str, version_info))
Python
0
@@ -19,9 +19,10 @@ 8, -6 +14 )%0A__
7bd996edf7b97579cf6696ce8d7eb5c0955180a2
add verbosity to csv generation
munge/csv_util.py
munge/csv_util.py
import csv import os.path import glob import re import collections import config import import_fns from sa_util import ( swap_tables, run_sql, table_list, get_result_fields, create_table, insert_rows, build_indexes, table_columns, fields_match, truncate_table, ) from common impo...
Python
0.000005
@@ -6247,32 +6247,215 @@ count += 1%0A + if verbose and count %25 config.BATCH_SIZE == 0:%0A print('%7Bfilename%7D: %7Bcount:,%7D'.format(%0A filename=filename, count=count%0A ))%0A if verbo
5120617e851cbcaa611e623401b038445b6fe99b
Print output when module stdout != '' for func that modify env
lmod/__init__.py
lmod/__init__.py
import os # require by lmod output evaluated by exec() import sys from functools import partial, wraps from subprocess import Popen, PIPE LMOD_SYSTEM_NAME = os.environ.get('LMOD_SYSTEM_NAME', '') SITE_POSTFIX = os.path.join('lib', 'python'+sys.version[:3], 'site-packages') def module(command, *args): cmd = (os.e...
Python
0.000065
@@ -2586,38 +2586,40 @@ oad(*args):%0A -return +output = module('load', @@ -2616,32 +2616,69 @@ e('load', *args) +%0A if output:%0A print(output) %0A%0A@update_sys_pa @@ -2761,38 +2761,40 @@ ore(*args):%0A -return +output = module('restore @@ -2802,16 +2802,53 @@ , *args) +%0A if output:%...
54cdc132bd4eae881b233ce8b94a0e532bf30883
add comments.
1_get_Url.py
1_get_Url.py
import requests import BeautifulSoup mobile_site_url = "http://www.aladin.co.kr/m/off/gate.aspx?" response = requests.get(mobile_site_url) content = response.content shop_list = BeautifulSoup.BeautifulSoup(content).findAll('td') for x in shop_list: print "=" * 50 print x.text
Python
0
@@ -1,12 +1,46 @@ +# -*- coding:utf-8 -*-%0A# import%EB%9E%80?%0A import reque @@ -65,16 +65,30 @@ ulSoup%0A%0A +# string%EC%9D%84 %EC%A0%80%EC%9E%A5.%0A mobile_s @@ -141,16 +141,36 @@ aspx?%22%0A%0A +# requests %EB%AA%A8%EB%93%88 %EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0.%0A response @@ -230,16 +230,38 @@ ontent%0A%0...
d5bbebd17f7215fa4dd4f67d40bc078cb28f27f1
insert monitoring data to db
myops2/monitor.py
myops2/monitor.py
#!/usr/bin/env python import sys, os, signal, time, datetime import sqlite3 import Queue import threading from db import db import oml from planetlab.query import Query # from planetlab.test import Service # from planetlab.test import Packages # from planetlab.test import Node def receive_signal(signum, stack): ...
Python
0
@@ -1954,38 +1954,16 @@ = True%0A - threads.append(t)%0A t.st
8901aecc35f939a2b3a62665afff1d50bdab5867
Bump version number
nassl/__init__.py
nassl/__init__.py
__author__ = "Alban Diquet" __version__ = "3.1.0"
Python
0.000002
@@ -40,11 +40,11 @@ = %22 -3.1 +4.0 .0%22%0A
a805d414557a14a8588b6e34a9fbb93cc87651df
Change ttl_skew to 50%, to allow a task to run twice before riemann notices that it never checked in.
lib/scheduler.py
lib/scheduler.py
import time import logging log = logging.getLogger(__name__) class TaskSchedule(): def __init__(self): self.tasks = [] log.debug("TaskSchedule created") def add(self, task, ttl_skew=0.8): offset = ((ttl_skew * task.ttl) - task.skew()) log.info("Scheduling '%s' for %ss from now" % (task.name, offset)) i...
Python
0
@@ -190,9 +190,9 @@ w=0. -8 +5 ):%0A%09 @@ -341,19 +341,24 @@ k.ttl * -0.5 +ttl_skew ):%0A%09%09%09lo @@ -393,10 +393,10 @@ s %3E -50 +%25s %25%25 o @@ -430,16 +430,32 @@ .skew(), + (ttl_skew*100), task.tt
c020f587c57c7d01b0b4b6214a8eba10063cb389
fix KL extimator
ndd/estimators.py
ndd/estimators.py
# -*- coding: utf-8 -*- # Copyright (C) 2016,2017 Simone Marsili # All rights reserved. # License: BSD 3 clause """Base classes module.""" from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import ( # pylint: disable=redefined-builtin, unused-impo...
Python
0.998971
@@ -2019,17 +2019,17 @@ stimate -- ++ = numpy. @@ -2044,16 +2044,73 @@ log_qk) + / float(sum(pk))%0A self.estimate = - self.estimate %0A
c108deb403d49eb2b8fddcc49b2ba585c676e730
Move spec matching logic to base layer
reactive/datanode.py
reactive/datanode.py
from charms.reactive import when, when_not, set_state, remove_state from charms.hadoop import get_hadoop_base from jujubigdata.handlers import HDFS from jujubigdata import utils from charmhelpers.core import hookenv @when('hadoop.installed') @when_not('namenode.related') def blocked(): hookenv.status_set('blocked...
Python
0
@@ -358,405 +358,8 @@ )%0A%0A%0A -@when('hadoop.installed', 'namenode.related')%0Adef set_spec(namenode):%0A hadoop = get_hadoop_base()%0A namenode.set_datanode_spec(hadoop.spec())%0A%0A%0A@when('namenode.spec.mismatch')%0Adef spec_mismatch(namenode):%0A hookenv.status_set('blocked',%0A ...
01a2c81d1abe82b758631c141823536f9da67b01
make bigger section for data models
redisext/__init__.py
redisext/__init__.py
''' Introduction ------------ Redisext is a tool for data modeling. Its primary goal is to provide light interface to well-known data models based on Redis such as queues, hashmaps, counters, pools and stacks. Redisext could be treated as a ORM for Redis. Tutorial -------- Counter Model allows you to build counters ...
Python
0.000005
@@ -1004,27 +1004,27 @@ Models%0A ------------ +=========== %0A%0A.. aut
ce9be60b86535941b855c21671b64e3cfe2fdb61
Fix Resolver404's tried
reek/urlconf/urls.py
reek/urlconf/urls.py
import re from django.core.urlresolvers import ResolverMatch, Resolver404, RegexURLResolver, LocaleRegexProvider, get_resolver, \ RegexURLPattern from django.utils.datastructures import MultiValueDict from django.utils.encoding import force_text from django.utils.regex_helper import normalize from django.utils.tran...
Python
0.000001
@@ -5644,20 +5644,24 @@ re -turn +solver = self.ge @@ -5700,21 +5700,325 @@ ath) -.resolve(path +%0A try:%0A return resolver.resolve(path)%0A except Resolver404 as e:%0A # Add PageResolver as base to the tried patterns%0A sub_tried = e.args%5B...
10d1bb2028761ce4ec7d2a2d9e36ac1658cb9ae1
how bout this
tcamp/brainstorm/views.py
tcamp/brainstorm/views.py
import json import datetime from django.template import RequestContext from django.shortcuts import get_object_or_404, render_to_response, redirect from django.http import HttpResponse from django.views.generic import ListView, DetailView, CreateView from django.views.decorators.http import require_POST from django.vi...
Python
0.688397
@@ -663,16 +663,17 @@ pular': +( '-score' @@ -673,16 +673,39 @@ -score', + '-upvotes', 'title',), %0A @@ -715,16 +715,17 @@ atest': +( '-timest @@ -728,16 +728,18 @@ mestamp' +,) %0A %7D%0A%0A @@ -930,16 +930,17 @@ rder_by( +* self.ord @@ -1023,24 +1023,25 @@ +( self.orderin @@ -104...
73f8a1e2e0006c2a37ae6264afe70a8207ffbb54
Bump version.
netlib/version.py
netlib/version.py
IVERSION = (0, 9) VERSION = ".".join(str(i) for i in IVERSION) NAME = "netlib" NAMEVERSION = NAME + " " + VERSION
Python
0
@@ -9,16 +9,19 @@ = (0, 9 +, 1 )%0AVERSIO
5407330a05ef27a0803c3448e3bd7b11067be690
Update Adam eps.
src/training.py
src/training.py
from tempfile import NamedTemporaryFile import torch from tqdm import tqdm import utils def create_trainer(model, **kwargs): optimizer = torch.optim.Adam(model.parameters(), kwargs.pop("lr", 0.001), betas=(0.9, 0.9)) scheduler = torch.optim.lr_scheduler.LambdaLR(optimizer, lambda step: 0.75 ** (step / 5000)...
Python
0
@@ -155,16 +155,25 @@ im.Adam( +%0A model.pa @@ -183,16 +183,24 @@ eters(), +%0A kwargs. @@ -216,16 +216,24 @@ 0.001), +%0A betas=( @@ -241,16 +241,41 @@ .9, 0.9) +,%0A eps=1e-12,%0A )%0A sc
150c79b70f8ec0992083ef8d2499623f94765097
Add context to render_basic.
restructured_text/restructured_text.py
restructured_text/restructured_text.py
from django.utils.safestring import mark_safe from docutils.core import publish_parts from wagtail.wagtailcore import blocks class RSTBlock(blocks.TextBlock): """ A ReSTructured text block for Wagtail streamfields. """ class Meta: icon = 'code' def render_basic(self, value): retu...
Python
0
@@ -298,16 +298,30 @@ f, value +, context=None ):%0A
d1b78294bde544d2db1c44a96e0986be4419e68d
Add docstring to utils.is_json_string_list
web/utils/__init__.py
web/utils/__init__.py
import json from django.core.exceptions import ValidationError def is_json_string_list(s): try: val = json.loads(s) except: raise ValidationError('Not a JSON value.') if type(val) is not list: raise ValidationError('Not a JSON list.') for x in val: if type(x) is not uni...
Python
0.000008
@@ -86,16 +86,218 @@ ist(s):%0A + '''%0A Checks if the string s represents a list of strings in JSON.%0A%0A The function does nothing if s represents a valid list of strings,%0A or raises a suitable ValidationError if not.%0A '''%0A try:
78e7e7d2aa7c641dd80eb51159fea4be8e3e4c38
make local connections use Popen
remoto/connection.py
remoto/connection.py
import socket from .lib import execnet # # Connection Object # class Connection(object): def __init__(self, hostname, logger=None, sudo=False, threads=1, eager=True): self.hostname = hostname self.sudo = sudo self.logger = logger or FakeRemoteLogger() self.remote_module = None ...
Python
0
@@ -943,16 +943,23 @@ return ' +popen// python=%25
9ca1d1f1ddf2684a99d3730b59b2389e0e3f09cf
Update writeInputs.py
repex/writeInputs.py
repex/writeInputs.py
import os import sys import fileinput import shutil def writeInputs(max_temp, min_temp, replicas, timesteps, basename): max_temp = max_temp min_temp = min_temp replicas = replicas timesteps = timesteps #for i in range(replicas): #shutil.copy2('mdin', 'mdin_{0}'.format(i)) Temps_List = [...
Python
0.000001
@@ -753,86 +753,8 @@ r')%0A -%0A placeholder1 = '@temperature@'%0A placeholder2 = '@timesteps@'%0A%0A
792fcc475799a80465b09752f3bc3fb529e93adf
Add DataSet object as proxy for data IO
nix/data_array.py
nix/data_array.py
# Copyright (c) 2014, German Neuroinformatics Node (G-Node) # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted under the terms of the BSD License. See # LICENSE file in the root of the Project. from __future__ import absolute_import from nix.c...
Python
0.000002
@@ -1047,16 +1047,45 @@ e, data) +%0A return DataSet(self) %0A%0A @p @@ -2854,12 +2854,283 @@ n str(self)%0A +%0A%0Aclass DataSet(object):%0A %22%22%22%0A Data IO object for DataArray.%0A %22%22%22%0A def __init__(self, obj):%0A self.__obj = obj%0A%0A def write_direct(self, data):%0A ...
c82f35d49cd13303d516aa5f47d6334698e33141
Add completion test for properties and floats
tests/test_completer.py
tests/test_completer.py
from __future__ import unicode_literals import pytest from prompt_toolkit.completion import Completion from prompt_toolkit.document import Document @pytest.fixture def completer(): from cycli.completer import CypherCompleter return CypherCompleter( labels=["Movie", "Person"], relationship_types...
Python
0
@@ -1959,32 +1959,301 @@ _position=-1)%5D%0A%0A +def test_no_property_completion_in_float(completer, complete_event):%0A text = %22RETURN 5.%22%0A position = len(text)%0A%0A result = list(completer.get_completions(%0A Document(text=text, cursor_position=position),%0A complete_event))%0A%0A as...
ab2136a9e2db8f18538f10abed2fffad87805d07
Revert "Fix static settings, maybe"
config/settings.py
config/settings.py
from datetime import time from os import getenv from pathlib import Path import dj_database_url from dotenv import load_dotenv import tomlkit load_dotenv() BASE_DIR = Path(__file__).resolve().parent.parent PYPROJECT_PATH = BASE_DIR / "pyproject.toml" PYPROJECT = tomlkit.parse(PYPROJECT_PATH.open().read()) SECRET...
Python
0
@@ -3208,12 +3208,8 @@ T = -str( BASE @@ -3228,17 +3228,16 @@ icfiles%22 -) %0A%0A%0A#####
5950625aa536e6a0e4d2ca89393c323df29e0d3d
Fix build against django 4.0 Django 4.0 dropped `django.conf.urls.url()` for `django.urls.re_path()`
test_app/test_app/urls.py
test_app/test_app/urls.py
"""test_app URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-b...
Python
0.000001
@@ -639,37 +639,32 @@ %22%22%22%0Afrom django. -conf. urls import url%0A @@ -659,19 +659,23 @@ import -url +re_path %0Afrom dj @@ -721,19 +721,23 @@ = %5B%0A -url +re_path (r'%5Eadmi
548e6736c41ca11a2c07f2ce6104ab3eff7f3517
Update CLAW package with version 1.2.1 (#10528)
var/spack/repos/builtin/packages/claw/package.py
var/spack/repos/builtin/packages/claw/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 Claw(CMakePackage): """CLAW Compiler targets performance portability problem in climate an...
Python
0
@@ -623,16 +623,105 @@ tval'%5D%0A%0A + version('1.2.1', commit='939989ab52edb5c292476e729608725654d0a59a', submodules=True)%0A vers
60e8a98fad7be06990cd378c41666506e425dc7a
Add AUTOMATIC_REVERSE_PTR option to cfg
config_template.py
config_template.py
import os basedir = os.path.abspath(os.path.dirname(__file__)) # BASIC APP CONFIG WTF_CSRF_ENABLED = True SECRET_KEY = 'We are the world' BIND_ADDRESS = '127.0.0.1' PORT = 9393 LOGIN_TITLE = "PDNS" # TIMEOUT - for large zones TIMEOUT = 10 # LOG CONFIG LOG_LEVEL = 'DEBUG' LOG_FILE = 'logfile.log' # For Docker, leave ...
Python
0
@@ -2341,16 +2341,133 @@ PV6_PTR = False%0A +%0A# Create reverse lookup domain if not exists and PTR record from%0A# A and AAAA records%0AAUTOMATIC_REVERSE_PTR = False%0A
22f0e0200e560dc3fbbc3c9911ba32bb52c298df
Add a warning when OCIO is set to invalid path, and fallback to the blender config path.
rfb_utils/color_manager_blender.py
rfb_utils/color_manager_blender.py
import os import bpy import sys from ..rfb_utils.envconfig_utils import envconfig try: from rman_utils.color_manager import ColorManager except: ColorManager = None __clrmgr__ = None class ColorManagerBlender(ColorManager): def __init__(self, config_path, **kwargs): super(ColorManagerBlender, self...
Python
0
@@ -184,16 +184,39 @@ _ = None +%0A__has_warned__ = False %0A%0Aclass @@ -936,24 +936,50 @@ ent%0A %22%22%22%0A + global __has_warned__%0A blender_ @@ -1030,28 +1030,34 @@ onfig()%0A -ocio +envconfig_ path = envco @@ -1082,28 +1082,360 @@ O', -blender_config_path) +None)%0A ociopath = blender_...
fd1a8d367496569b7656dd9552e6e32f97849c11
Update flows.py
fabric/flows.py
fabric/flows.py
""" This module containes pure functions to help with creating flow table entries. """ from ryu.ofproto import ofproto_v1_3 as ofp from ryu.ofproto import ofproto_v1_3_parser as parser DEF_TABLE = 0 TRANSIT_TABLE = 1 LOCAL_TABLE = 2 def compose(actions=[], to_table=0): """ Compose instructions set from given...
Python
0.000001
@@ -3872,16 +3872,18 @@ transit( +dp ):%0A ' @@ -3915,28 +3915,273 @@ '''%0A -pass +mod = parser.OFPFlowMod( datapath = dp,%0A priority =1, %0A match = parser.OFPmatch(eth_type==0x88E7), %0A instruction=compose...
a06e23dcd2956fb5b9f6dff48714ff9c9b4bd5b7
Update flows.py
fabric/flows.py
fabric/flows.py
""" This module containes pure functions to help with creating flow table entries. """ from ryu.ofproto import ofproto_v1_3 as ofp from ryu.ofproto import ofproto_v1_3_parser as parser def compose(actions=[], to_table=0): """ Compose instructions set from given entries :param actions: actions to perform ...
Python
0.000001
@@ -896,26 +896,142 @@ def -action_to_local(): +dpid_to_mac(dpid):%0A pass%0Adef flow_to_port(dl_dst,out_port,tableno=DEFAULT_TABLE_SOMETHING):%0A '''%0A =%3Eparser.OFPFlowMod%0A ''' %0A @@ -1041,22 +1041,20 @@ ss%0A%0Adef -action +flow _to_remo @@ -1056,16 +1056,27 @@ _remote( +dl_dst,dpid ):%0A...
ae96678f668bae1682497fa7a54d1819b51d683d
Use callable in lazy imports to avoid type errors
tensorflow_datasets/core/lazy_imports_lib.py
tensorflow_datasets/core/lazy_imports_lib.py
# coding=utf-8 # Copyright 2021 The TensorFlow Datasets Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
Python
0
@@ -701,16 +701,31 @@ g import + Any, Callable, TypeVar @@ -5032,19 +5032,49 @@ fn: -_Fn) -%3E _Fn +Callable%5B..., Any%5D) -%3E Callable%5B..., Any%5D :%0A
6af1ff0a3dd89a06a1fd4b6ee4428405f365da17
Bump the version string to v0.12.0 (#764)
tensorflow_io/core/python/ops/version_ops.py
tensorflow_io/core/python/ops/version_ops.py
# Copyright 2019 The TensorFlow 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 of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0
@@ -726,15 +726,22 @@ flow -= +%3E =2.1.0 +,%3C2.2.0 '%0Ave @@ -752,13 +752,13 @@ n = '0.1 -1 +2 .0'%0A
1ef6cca8e0791c6e5c390fcc9599f4758644a7de
Fix for win platform due to bug when VBoxManage unable to execute 'snapshot {{VM_name}} showvminfo {{snapshot_name}}' command while previous VM lauch is still shutdowning. Intersection of tearDown and setUp steps of the VirtualBoxTest class led to such a behaviour.
fabtest/test.py
fabtest/test.py
import unittest from fabric.api import env from fabric import state from fabric.network import disconnect_all from fabtest.vbox import VirtualBox from fabtest.utils import force_ssh_reconnect class VirtualBoxTest(unittest.TestCase): vm_name = 'Squeeze' # name or uuid of VirtualBox VM vbox_command = 'VBoxMana...
Python
0.000006
@@ -8,16 +8,44 @@ unittest +%0Aimport time%0Aimport platform %0A%0Afrom f @@ -1050,32 +1050,276 @@ ot(self, name):%0A + if platform.system()=='Windows':%0A RETRIES_CNT = 5%0A for i in xrange(RETRIES_CNT):%0A if self.box.snapshot_exists(name):%0A %09 break%...
121c86eb38cd72e85818713dc8164092d3e72439
Test fake email does not throw validation error
tests/test_mailchimp.py
tests/test_mailchimp.py
import mock from website import mailchimp_utils from tests.base import OsfTestCase from nose.tools import * # PEP8 asserts from tests.factories import UserFactory class TestMailChimpHelpers(OsfTestCase): @mock.patch('website.mailchimp_utils.get_mailchimp_api') def test_get_list_id_from_name(self, mock_get_m...
Python
0
@@ -157,16 +157,33 @@ Factory%0A +import mailchimp%0A %0A%0Aclass @@ -2273,16 +2273,623 @@ =True)%0A%0A + @mock.patch('website.mailchimp_utils.get_mailchimp_api')%0A def test_subscribe_fake_email_does_not_throw_validation_error(self, mock_get_mailchimp_api):%0A list_name = 'foo'%0A user = UserFa...
04c710eb9605af16e17a1dded6c40b24fb4cdb05
Make scoring project tests pass
python2/koans/about_scoring_project.py
python2/koans/about_scoring_project.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # A greed roll is scored as follows: # # * A set of three ones is 10...
Python
0.000003
@@ -919,48 +919,445 @@ -# You need to write this method%0A pass +score = 0%0A%0A if dice.count(1) %3E= 3:%0A score += 1000%0A for i in range(3):%0A dice.remove(1)%0A%0A for i in range(2, 7):%0A if dice.count(i) %3E= 3:%0A score += 100*i%0A for j in ra...
7ba52a548693603c73366375408413ead578e671
add test for console output error
tests/test_onixcheck.py
tests/test_onixcheck.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from onixcheck.__main__ import main from onixcheck import data def test_main_o3_ref_valid(capsys): argv = [data.VALID_ONIX2_REF] exit_code = main(argv) out, err = capsys.readouterr() assert 'VALID' in out assert 'INVALID' not in err ...
Python
0.000001
@@ -1133,28 +1133,282 @@ t%0A assert exit_code == 0%0A +%0A%0Adef test_console_ouptup_encoding(capsys):%0A argv = %5Bdata.WIN_CONSOLE_ISSUE%5D%0A exit_code = main(argv)%0A assert exit_code == 1%0A out, err = capsys.readouterr()%0A assert 'UnicodeEncodeError' not in out%0A assert 'UnicodeEncodeErro...
814b153e220e5b3a1feed760e58c8bb17b711b7f
Add --proto option
examples/bench/server.py
examples/bench/server.py
import argparse import asyncio import gc import uvloop import socket as socket_module from socket import * PRINT = 0 async def echo_server(loop, address, unix): if unix: sock = socket(AF_UNIX, SOCK_STREAM) else: sock = socket(AF_INET, SOCK_STREAM) sock.setsockopt(SOL_SOCKET, SO_REUS...
Python
0
@@ -1400,24 +1400,279 @@ r.close()%0A%0A%0A +class EchoProtocol(asyncio.Protocol):%0A def connection_made(self, transport):%0A self.transport = transport%0A%0A def connection_lost(self, exc):%0A self.transport = None%0A%0A def data_received(self, data):%0A self.transport.write(data)%0A%0A...
2911ca6d7ce93ca36cc6f44c8934d80d6cbaf05c
collapsed two lines into one
stenciledsum.py
stenciledsum.py
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ import numpy as np def subarray_multislice(array_ndim, axes, indices): indices = np.array(indices) colon = slice(None, None, None) multislice = () for i in range(array_ndim): if i in axes: multislice =...
Python
0.999889
@@ -5914,67 +5914,8 @@ sa)%0A - indices_iterator = np.ndindex(stencil.shape%5B:-1%5D)%0A%0A @@ -5962,24 +5962,38 @@ in -indices_iterator +np.ndindex(stencil.shape%5B:-1%5D) %5D%0A
7fcd1690bd61ee9781ec1f2adeed19731afa883c
simplify example
examples/meta_example.py
examples/meta_example.py
from v1pysdk.v1meta import * meta = V1Meta() Story = meta.asset_class('Story') s = Story('1005') print s.Name # 'New Story 2' s.Owners # [<v1pysdk.v1meta.Member object at 0x02AD9710>] s.Scope # <v1pysdk.v1meta.Scope object at 0x02AB2550>
Python
0.999996
@@ -1,9 +1,8 @@ -%0A from v1p @@ -9,23 +9,16 @@ ysdk -.v1meta import *%0Ame @@ -17,14 +17,18 @@ ort -*%0Ameta +V1Meta%0A%0Av1 = V @@ -39,51 +39,39 @@ a()%0A -Story = meta.asset_class('Story')%0As = Story +%0Amy_story = v1.Story.find_by_id ('10 @@ -218,8 +218,87 @@ B2550%3E%0A%0A +%0Afor my_story in v1.Stor...
aeb3aaf5a01b3826acc504d2333693ae21bd50e0
fix multiple issues
wechat-anti-revoke.py
wechat-anti-revoke.py
#!/usr/bin/env python # -*-encoding:utf-8-*- import sys reload(sys) sys.setdefaultencoding('UTF8') import os, re, shutil, time, collections, json from HTMLParser import HTMLParser from xml.etree import ElementTree as ETree import itchat from itchat.content import * msg_store = collections.OrderedDict() timeout = 6...
Python
0.000258
@@ -2450,24 +2450,180 @@ Url'%5D) %3E 0:%0A + map_label = ETree.fromstring(msg%5B'OriContent'%5D).find('location')%0A if map_label is not None:%0A c += ' ' + map_label.attrib%5B'label'%5D%0A url @@ -3241,23 +3241,28 @@ '%5D)%0A -revoked +content_tree = ETree @@ -3281,16 +3281,...
b6ea9f411b77cdd6e6013d8b4e329671c5032e62
Add rfftfreq to Helper routines in fft module's docstring
numpy/fft/info.py
numpy/fft/info.py
""" Discrete Fourier Transform (:mod:`numpy.fft`) ============================================= .. currentmodule:: numpy.fft Standard FFTs ------------- .. autosummary:: :toctree: generated/ fft Discrete Fourier transform. ifft Inverse discrete Fourier transform. fft2 Discrete Fourier tr...
Python
0
@@ -1281,16 +1281,82 @@ encies.%0A + rfftfreq DFT sample frequencies (for usage with rfft, irfft).%0A fftsh
e25e26f2cb628b025330a70ef2e2d0b888259d08
Stop app only if it started
flower/app.py
flower/app.py
from __future__ import absolute_import import logging from functools import partial from concurrent.futures import ThreadPoolExecutor import celery import tornado.web from tornado import ioloop from .api import control from .urls import handlers from .events import Events from .options import default_options log...
Python
0.000001
@@ -1225,16 +1225,45 @@ x_tasks) +%0A self.started = False %0A%0A de @@ -1733,16 +1733,44 @@ .start() +%0A self.started = True %0A%0A de @@ -1775,32 +1775,61 @@ def stop(self):%0A + if self.started:%0A self.eve @@ -1839,16 +1839,20 @@ .stop()%0A + @@ -1881,16 ...
159aea1c97b8e8de45802cace031e7206c3c8fec
Add a __str__ for Tile.
thecure/sprites/tile.py
thecure/sprites/tile.py
from thecure.resources import load_spritesheet_frame from thecure.sprites import Sprite class Tile(Sprite): NAME = 'tile' WIDTH = 64 HEIGHT = 64 NEED_TICKS = False def __init__(self, filename, tile_offset): super(Tile, self).__init__() self.filename = filename self.tile_...
Python
0.000045
@@ -398,20 +398,15 @@ def -update_image +__str__ (sel @@ -421,43 +421,36 @@ -self.image = load_spritesheet_frame +return 'Tile %25s:%25s at %25s' %25 (sel @@ -520,49 +520,133 @@ - frame_size=(self.WIDTH,%0A +self.rect.topleft)%0A%0A def update_image(self):%0A self.image = load...
aa20215e00aaa872d391fc774f4696c913274eca
add payment_term field in invoices from sale order
sales_channel/models/sale_order.py
sales_channel/models/sale_order.py
# -*- coding: utf-8 -*- # © <YEAR(S)> <AUTHOR(S)> # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, fields, models class SaleOrder(models.Model): _inherit = "sale.order" @api.multi def action_invoice_create(self, grouped=False, final=False): res = sup...
Python
0
@@ -992,16 +992,17 @@ rn res%0A%0A +%0A class Sa
def66bc381f03970640a61d64b49ad5de9ef3879
Remove OCAMLLIB from build environment
ocaml/build-in.py
ocaml/build-in.py
# Needed because ocamlbuild 3.12.1 doesn't support absolute pathnames (4.00.1 does) import sys import os from os.path import relpath ocaml_build_dir = relpath(sys.argv[1], '.') os.execvp("make", ["make", 'OCAML_BUILDDIR=' + ocaml_build_dir, "ocaml"])
Python
0
@@ -170,16 +170,255 @@ %5D, '.')%0A +%0A# Hack: when we can depend on a full OCaml feed with the build tools, we can remove this.%0A# Until then, we need to avoid trying to compile against the limited runtime environment.%0Aif 'OCAMLLIB' in os.environ:%0A%09del os.environ%5B'OCAMLLIB'%5D%0A%0A os.execv
2476fef95f006b5d85fd655c970ba35b04ed999a
add method imports to __ini__.py
resumepy/__init__.py
resumepy/__init__.py
Python
0.000039
@@ -1 +1,261 @@ +from .process import create_parser%0Afrom .process import process_html%0Afrom .process import process_pdf%0Afrom .process import process_text%0A%0Afrom .utils import check_dir%0Afrom .utils import copy_file%0Afrom .utils import mkdirs%0Afrom .utils import make_temp_directory%0A %0A
60c8e305bef9ace8688aabbf18e2f500e8d9135c
Fix failing openssl check on MacOS
thirdparty/preflight.py
thirdparty/preflight.py
#!/usr/bin/env python # # 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 # "...
Python
0.000005
@@ -3889,24 +3889,407 @@ _openssl():%0A + cflags = %5B%22-E%22%5D%0A try:%0A openssl_include = subprocess.check_output(%5B%22pkg-config%22, %22--cflags%22, %22openssl%22%5D).rstrip()%0A if openssl_include != %22%22:%0A cflags.append(openssl_include)%0A except subprocess.CalledProcessError:%0A homebr...
1bbd484e7599417df4529f246869491f9d96b74b
Add a method as_osmurl() to photo.geo.GeoPosition.
photo/geo.py
photo/geo.py
"""Geo tools, in particular class GeoPosition. """ import sys import re import math from collections import Mapping _geopos_pattern = (r"^\s*(?P<lat>\d+(?:\.\d*))\s*(?P<latref>N|S),\s*" r"(?P<lon>\d+(?:\.\d*))\s*(?P<lonref>E|W)\s*$") _geopos_re = re.compile(_geopos_pattern) class deg(float): ...
Python
0
@@ -3184,16 +3184,250 @@ %7D%0A%0A + def as_osmurl(self, zoom=16):%0A %22%22%22Return an URL to OpenStreetMap displaying this position.%22%22%22%0A template = %22http://www.openstreetmap.org/?mlat=%25f&mlon=%25f&zoom=%25d%22%0A return template %25 (self.lat, self.lon, zoom)%0A%0A def ...
0596d95c16fe30f2b161015f833427c8ca10afce
fix typo
oktan/settings.py
oktan/settings.py
""" Django settings for oktan project. Generated by 'django-admin startproject' using Django 1.11. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os imp...
Python
0.999991
@@ -1254,16 +1254,19 @@ OSTS = %5B +'*' %5D%0A%0A%0A# Ap
9ed54363a19f66b4ec77b73b6524ba38f07620d6
add time limit to steel
examples/python/steel.py
examples/python/steel.py
# Copyright 2010 Pierre Schaus pschaus@gmail.com, lperron@google.com # # 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.000346
@@ -855,16 +855,81 @@ file')%0A +gflags.DEFINE_integer('time_limit', 20000, 'global time limit')%0A%0A %0A#------ @@ -5836,16 +5836,68 @@ ve_var)%0A + global_limit = solver.TimeLimit(FLAGS.time_limit)%0A solver @@ -5933,16 +5933,30 @@ arch_log +, global_limit %5D)%0A whi
7154e62cababcbae9d3fb793d30cdf415ad556eb
Update test_ee_stream_dgemm_mix.py to keep files properly
test_integration/test_ee_stream_dgemm_mix.py
test_integration/test_ee_stream_dgemm_mix.py
#!/usr/bin/env python # # Copyright (c) 2015, 2016, 2017, 2018, 2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above copyright # ...
Python
0
@@ -4383,16 +4383,20 @@ one) and + not %0A
31018aa76beb1b00f3f47a9951f3c1153f9f8dc4
Remove unused import from examples/train_pascal.py
examples/train_pascal.py
examples/train_pascal.py
""" Copyright 2017-2018 Fizyr (https://fizyr.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
Python
0
@@ -681,41 +681,8 @@ ses%0A -import keras_retinanet.callbacks%0A from
1abec20704b4a8dcdc64fbbabdfae360126aac7d
send object instead of ID
warlog/warlog.py
warlog/warlog.py
import discord from discord.ext import commands from cogs.utils import checks from .utils.dataIO import dataIO, fileIO from __main__ import send_cmd_help import os import io import asyncio import PIL from PIL import ImageFont from PIL import Image from PIL import ImageDraw import clashroyale from datetime import dateti...
Python
0.000001
@@ -4312,16 +4312,41 @@ t None:%0A + %0A @@ -4386,16 +4386,34 @@ nd_file( +discord.Object(id= clanChan @@ -4411,24 +4411,25 @@ =clanChannel +) , f, filenam
14fa680e15d80fb9269ffb597cb6ba4c1b4b43d3
Add pylint compliance
wikia-scraper.py
wikia-scraper.py
#!/usr/bin/python # -*- coding: utf-8 -*- ############################################################################### # # Name: wikia-scraper.py # Author: James H. Loving, github.com/jameshloving # License: See LICENSE file. # Description: This script will scrape a Wikia fan-Wiki and create a w...
Python
0.000005
@@ -628,60 +628,8 @@ ##%0A%0A -from bs4 import BeautifulSoup%0Afrom halo import Halo%0A impo @@ -700,16 +700,69 @@ dators%0A%0A +from bs4 import BeautifulSoup%0Afrom halo import Halo%0A%0A def GetS @@ -1040,21 +1040,17 @@ ref'%5D))%0A - %0A + retu @@ -1646,21 +1646,17 @@ exit()%0A - %0A + ret...
d666b96ed7bc3339e162f53accee141fa2f42a16
Update model.py
haas/model.py
haas/model.py
from sqlalchemy.ext.declarative import declarative_base, declared_attr from sqlalchemy.orm import relationship, sessionmaker from sqlalchemy import * from passlib.hash import sha512_crypt from haas.config import cfg Base = declarative_base() Session = sessionmaker() def init_db(create=False): uri = cfg.get('data...
Python
0.000001
@@ -1527,21 +1527,16 @@ oolean)%0A - %0A proj @@ -1608,16 +1608,21 @@ label))%0A + %0A def
7ba828bd266dabf0a44a47c6428a4a4db003ea16
disable csrf protection at testing env.
rio/settings/test.py
rio/settings/test.py
# -*- coding: utf-8 -*- DEBUG = True TESTING = True SECRET_KEY = 'no-secret' SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/rio-test.db' CELERY_BROKER_URL = 'sqla+' + SQLALCHEMY_DATABASE_URI CELERY_RESULT_BACKEND = 'db+' + SQLALCHEMY_DATABASE_URI REDIS_DEFAULT_CLUSTERS = { 0: ...
Python
0
@@ -372,16 +372,40 @@ YS_EAGER = True%0A +%0AWTF_CSRF_ENABLED=False%0A
ffbcadf66ba6379e4f98ec070c0e4203e12e1236
add phenotype group
scout/blueprints/core/constants.py
scout/blueprints/core/constants.py
# -*- coding: utf-8 -*- """Constants.""" PHENOTYPE_GROUPS = { 'HP:0001298':{ 'name': 'Encephalopathy', 'abbr': 'ENC' }, 'HP:0012759':{ 'name': 'Neurodevelopmental abnormality', 'abbr': 'NDEV' }, 'HP:0001250':{ 'name': 'Seizures', 'abbr': 'EP' }, ...
Python
0.999761
@@ -73,18 +73,19 @@ 001298': + %7B%0A - @@ -156,16 +156,17 @@ 012759': + %7B%0A @@ -256,16 +256,17 @@ 001250': + %7B%0A @@ -332,16 +332,17 @@ 100022': + %7B%0A @@ -421,24 +421,25 @@ HP:0000707': + %7B%0A 'n @@ -511,16 +511,17 @@ 003011': + %7B%0A @@ -611,16 +61...
405bccd60660397da0be2c6607017bd8a287a077
use locker
pines/tar.py
pines/tar.py
import os, io, tarfile, hashlib, json from .busy_dir import locked_directory def _sha512_checksum(s): sha512 = hashlib.sha512() sha512.update(s) return sha512.hexdigest() def _save_hashes(hashes, path="."): """ Save configuration to a JSON file. If filename is not an absolute path, it will be prefixed with ~/....
Python
0.000003
@@ -58,27 +58,17 @@ rt locke -d_directory +r %0A%0Adef _s @@ -1314,19 +1314,9 @@ ocke -d_directory +r (pat
6df5c8cf8741d63f4ecd5d77657ba09744bae9eb
Remove timestamp, fix time
scrapi/consumers/upenn/consumer.py
scrapi/consumers/upenn/consumer.py
# Consumer for UPenn Scholarly Commons from __future__ import unicode_literals import requests from datetime import date, timedelta, datetime from dateutil.parser import * import time from lxml import etree from scrapi.linter import lint from scrapi.linter.document import RawDocument, NormalizedDocument from namepars...
Python
0.005017
@@ -355,29 +355,8 @@ nn'%0A -TODAY = date.today()%0A NAME @@ -797,13 +797,20 @@ e = -TODAY +date.today() - t @@ -4932,19 +4932,8 @@ _doc -, timestamp ):%0A @@ -5726,57 +5726,8 @@ )),%0A - 'timestamp': copy_to_unicode(timestamp),%0A
d119d794e6059530166f0c27cc5f8406c2aa2fae
fixup into abc
piper/abc.py
piper/abc.py
import abc import logbook import jsonschema from piper.utils import DotDict class DynamicItem(object): """ Dynamic base class that defines things all Piper classes need. Many parts of the piper infrastructure is about being able to dynamically choose which classes should execute actions. This class ...
Python
0.999998
@@ -599,16 +599,220 @@ ame__)%0A%0A + # Set missing optional keys to None in the config%0A for k in set(self.schema%5B'properties'%5D) - set(self.schema%5B'required'%5D):%0A if k not in config:%0A config%5Bk%5D = None%0A%0A def
23b3396184ff71b591a26a816e56c3cdb09e8a0f
Test with sleep
scrapi/processing/elasticsearch.py
scrapi/processing/elasticsearch.py
from __future__ import absolute_import import logging import six from elasticsearch import Elasticsearch from elasticsearch.exceptions import NotFoundError from elasticsearch.exceptions import ConnectionError from scrapi import settings from scrapi.processing.base import BaseProcessor, BaseDatabaseManager from scra...
Python
0.000004
@@ -1430,32 +1430,82 @@ 1', ignore=400)%0A + import time%0A time.sleep(3)%0A retu
d9abc400a366b64f6852ba4d6ba917440c5547d4
Fix Python 3 problems
pkgconfig.py
pkgconfig.py
# -*- coding: utf-8 -*- # Copyright (c) 2013 Matthias Vogelgesang <matthias.vogelgesang@gmail.com> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limi...
Python
0.999488
@@ -1644,19 +1644,13 @@ -return cmp( +n1 = norm @@ -1658,17 +1658,25 @@ lize(v1) -, +%0A n2 = normali @@ -1681,16 +1681,49 @@ lize(v2) +%0A%0A return (n1 %3E n2) - (n1 %3C n2 )%0A%0A%0Adef @@ -2429,16 +2429,32 @@ rstrip() +.decode('utf-8') %0A%0A%0A@_con
0a8209725e1efbc819f21652cc0413625f998059
Update KC CTS
external/fetch_kc_cts.py
external/fetch_kc_cts.py
# -*- coding: utf-8 -*- #------------------------------------------------------------------------- # Khronos OpenGL CTS # ------------------ # # Copyright (c) 2016 The Khronos Group Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Licens...
Python
0
@@ -1096,48 +1096,48 @@ = %22 -be43972ee52d445cb4baa102dc1508760d739e14 +fbac64a4b2acdd4c41e47efa0b7db9a023ee108e %22%0A%0AP
beabd44cc187cd986c05eb1ac5289866081ebd22
Update mockito-core to 2.24.5
external_plugin_deps.bzl
external_plugin_deps.bzl
load("//tools/bzl:maven_jar.bzl", "maven_jar") def external_plugin_deps(): maven_jar( name = "mockito", artifact = "org.mockito:mockito-core:2.24.0", sha1 = "969a7bcb6f16e076904336ebc7ca171d412cc1f9", deps = [ "@byte-buddy//jar", "@byte-buddy-agent//jar", ...
Python
0
@@ -160,17 +160,17 @@ re:2.24. -0 +5 %22,%0A @@ -184,48 +184,48 @@ = %22 -969a7bcb6f16e076904336ebc7ca171d412cc1f9 +599509fe319bd9e39559b8f987bee5d4b77167e4 %22,%0A
6db088bf9c619bbdfad3b91ede8d81543be29ff0
Remove unreachable code from urinorm.
openid/urinorm.py
openid/urinorm.py
import re import urllib.parse ILLEGAL_CHAR_RE = re.compile("[^-A-Za-z0-9:/?#[\]@!$&'()*+,;=._~%]", re.UNICODE) HOST_PORT_RE = re.compile(r'^[A-Za-z0-9\.]+:\d+(/|$)') AUTHORITY_RE = re.compile(r'^([^@]*@)?([^:]*)(:.*)?') PCT_ENCODED_RE = re.compile(r'%([0-9A-Fa-f]{2})') UNRESERVED = '-._~0123456789ABCDEFGHIJKLMNOPQRST...
Python
0.000001
@@ -432,21 +432,8 @@ o):%0A - try:%0A @@ -462,20 +462,16 @@ ), 16))%0A - if c @@ -490,28 +490,24 @@ ED:%0A - - return c%0A @@ -503,20 +503,16 @@ eturn c%0A - retu @@ -537,57 +537,8 @@ r()%0A - except ValueError:%0A return mo.group()%0A %0A%0Ade @@ -623,137 ...
f9961f7ff5e9abc6ecb730fd3955af57a0ad0643
Version bump
swf/__init__.py
swf/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- version = (0, 1, 5) __title__ = "python-simple-workflow" __author__ = "Oleiade" __license__ = "MIT" __version__ = '.'.join(map(str, version))
Python
0.000001
@@ -61,9 +61,9 @@ 1, -5 +6 )%0A%0A_
6c8fc2db5943a5e6c6c8d56a5561003cb60d23e4
fix so admin and debug toolbar isn't closed
core/middleware.py
core/middleware.py
from django.shortcuts import render from django.utils.translation import ugettext_lazy as _ from core.models import Config from levels.models import Level class ClosedMiddleware(object): def process_request(self, request): if hasattr(request, 'user') and request.user.is_staff: return None ...
Python
0
@@ -84,16 +84,49 @@ azy as _ +%0Afrom django.conf import settings %0A%0Afrom c @@ -183,16 +183,27 @@ Level%0A%0A +import re%0A%0A class Cl @@ -267,16 +267,16 @@ uest):%0A%0A - @@ -351,24 +351,200 @@ eturn None%0A%0A + if re.match('%5E/admin/', request.path_info):%0A return None%0A ...
676562966cc8d9f6731b1cbac3c8a3827c7d62c4
Bump version to 0.1.53
swf/__init__.py
swf/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- version = (0, 1, 52) __title__ = "python-simple-workflow" __author__ = "Oleiade" __license__ = "MIT" __version__ = '.'.join(map(str, version))
Python
0
@@ -62,9 +62,9 @@ 1, 5 -2 +3 )%0A%0A_
57a1c06c0d09f8138bdd1f12363210e27ace38f2
Fix 'clean_bad_history' script to work post-image-creator
scripts/admin_clean_bad_history.py
scripts/admin_clean_bad_history.py
#!/usr/bin/env python import argparse import time from service.driver import get_esh_driver from core.models import Provider, Identity, Instance, InstanceStatusHistory from service.driver import get_admin_driver from service.instance import suspend_instance import django django.setup() def main(): parser = argp...
Python
0.001231
@@ -2541,25 +2541,8 @@ ce__ -providermachine__ prov
5f7e8d4a81b4c2af71b141dc90b8498d5cd54045
Use truly unreachable address in ConnectionManagerTranslateTest (#587)
tests/integration/connection_manager_test.py
tests/integration/connection_manager_test.py
import uuid from mock import patch from hazelcast import HazelcastClient from hazelcast.core import Address, MemberInfo, MemberVersion, EndpointQualifier, ProtocolType from hazelcast.errors import IllegalStateError, TargetDisconnectedError from hazelcast.future import ImmediateFuture, ImmediateExceptionFuture from ha...
Python
0
@@ -448,16 +448,145 @@ string%0A%0A +# 198.51.100.0/24 is assigned as TEST-NET-2 and should be unreachable%0A# See: https://en.wikipedia.org/wiki/Reserved_IP_addresses%0A _UNREACH @@ -615,14 +615,15 @@ (%2219 -2.168. +8.51.10 0.1%22
4da61308f727dc42f0b0030aa54eeff2205c1fee
Change case
core/web/webapp.py
core/web/webapp.py
from __future__ import unicode_literals import os from importlib import import_module from bson.json_util import dumps from flask import Flask, url_for, request from flask_login import LoginManager, current_user from core.user import User from core.web.json import JSONDecoder from core.web.api import api from core.w...
Python
0.00001
@@ -1566,14 +1566,14 @@ %22X-A -PI-KEY +pi-Key hea
6ab4e871c07d123a9b5ab2ee9ca1f01d41aeed94
Fix bug in incar attribute gettingg.
scripts/change_incar_parameters.py
scripts/change_incar_parameters.py
#!/usr/bin/env python ''' Modify recursively parameters in all INCAR file. ''' import argparse import commands import logging from vaspy.incar import InCar SHELL_COMMAND = "find ./ -name 'INCAR'" _logger = logging.getLogger("vaspy.script") if "__main__" == __name__: # Check command validity. status, outp...
Python
0
@@ -1,26 +1,4 @@ -#!/usr/bin/env python%0A '''%0A @@ -100,16 +100,38 @@ gging%0A%0A%0A +from vaspy import PY2%0A from vas @@ -1094,32 +1094,38 @@ lue_pairs = args +_space .__dict__.iterit @@ -1172,16 +1172,22 @@ s = args +_space .__dict_ @@ -1397,18 +1397,16 @@ filename -() ))%0A
1f8142acb36025e4bc950f68f3bff425eeb7d5d5
Changed the location of the missing image
oscar/defaults.py
oscar/defaults.py
OSCAR_SHOP_NAME = 'Oscar' OSCAR_SHOP_TAGLINE = 'Domain-driven e-Commerce for Django' # Basket settings OSCAR_BASKET_COOKIE_LIFETIME = 7*24*60*60 OSCAR_BASKET_COOKIE_OPEN = 'oscar_open_basket' OSCAR_BASKET_COOKIE_SAVED = 'oscar_saved_basket' # Currency OSCAR_DEFAULT_CURRENCY = 'GBP' # Max number of products to keep o...
Python
0.999992
@@ -469,16 +469,130 @@ otions/' +%0A%0A# Copy this image from oscar/static/img to your MEDIA_ROOT folder.%0A# It needs to be there so Sorl can resize it. %0AOSCAR_M @@ -615,26 +615,8 @@ = ' -/static/oscar/img/ imag
469388b1e22496740c264ba4bb37305708ea543e
handle scores < -1 and > 1
synt/guesser.py
synt/guesser.py
from synt.utils.redis_manager import RedisManager from synt.utils.extractors import best_word_feats from synt.utils.text import sanitize_text MANAGER = RedisManager() DEFAULT_CLASSIFIER = MANAGER.load_classifier() def guess(text, classifier=DEFAULT_CLASSIFIER): """Takes a blob of text and returns the sentiment an...
Python
0.000002
@@ -1,24 +1,48 @@ +# -*- coding: utf-8 -*-%0A from synt.utils.redis_ma @@ -500,50 +500,9 @@ -guess = classifier.classify(bag_of_words) %0A + @@ -592,16 +592,16 @@ 1 score%0A - @@ -654,16 +654,221 @@ ative')%0A + %0A #if score doesn't fall within -1 and 1 return 0.0 %0A #exa...
316f9a6a99c7dfe6b9fc1c8ae9066ae21c5757cb
Revert "Don't call update_metrics() at all on packet in."
faucet/valves_manager.py
faucet/valves_manager.py
"""Manage a collection of Valves.""" # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer. # Copyright (C) 2015 Research and Education Advanced Network New Zealand Ltd. # Copyright (C) 2015--2017 The Contributors # # Licensed under the Ap...
Python
0
@@ -6968,16 +6968,39 @@ _start)%0A + if ofmsgs:%0A @@ -7035,24 +7035,59 @@ valve.dp.dp_id, ofmsgs)%0A + valve.update_metrics()%0A
ba80e1e33bd93fd895d1b88853f47fb30cd0b670
Fix Python 3 compat issue in Config.get_namespace
flask/config.py
flask/config.py
# -*- coding: utf-8 -*- """ flask.config ~~~~~~~~~~~~ Implements the configuration related objects. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import imp import os import errno from werkzeug.utils import import_string from ._compat import string_type...
Python
0.00007
@@ -314,16 +314,27 @@ ng_types +, iteritems %0Afrom . @@ -8292,21 +8292,16 @@ k, v in -self. iteritem @@ -8302,16 +8302,20 @@ eritems( +self ):%0A
349033b4ebab5bd71c0177f95fe208212cfb9465
Fix output of nest2pos
cpnest/nest2pos.py
cpnest/nest2pos.py
import numpy as np from numpy import logaddexp, vstack from numpy.random import uniform def logsubexp(x,y): assert np.all(x >= y), 'cannot take log of negative number %s - %s'%(str(x),str(y)) return x + np.log1p(-np.exp(y-x)) def log_integrate_log_trap(log_func,log_support): """ Trapezoidal i...
Python
0.999999
@@ -3411,25 +3411,9 @@ nt ' -Total number of s +S ampl @@ -3430,22 +3430,28 @@ d: %25 -i'%25(len +s'%25(str (result +.shape ))%0A
48d5d03493dbc6d535784a004ed2f1e610c7af22
Support using any principal in keytab
flask_gssapi.py
flask_gssapi.py
# -*- encoding: utf-8; -*- # pylint: disable=R0201, W0212 """GSSAPI authentication plugin for Flask""" import base64 import socket from functools import wraps import gssapi from flask import current_app, make_response, request, Response __version__ = '1.3.1' class GSSAPI(object): """ Negotiate (GSSAPI)...
Python
0.000001
@@ -872,20 +872,16 @@ -host name = a @@ -931,16 +931,49 @@ fqdn())%0A + if name is not None:%0A @@ -1017,18 +1017,18 @@ me, -host name)%0A +
e6e239bdd72f1a430c211979638894f5261833df
version 2.0.4
toughradius/__init__.py
toughradius/__init__.py
#!/usr/bin/env python #coding=utf-8 __version__ = '2.0.3' __license__ = 'AGPL'
Python
0.000001
@@ -53,9 +53,9 @@ 2.0. -3 +4 '%0A__
46c2ebe6a1dd80db918a9f90d444c5db3919e2b4
update endpoints list localproxy and method
flask_anyform/anyform.py
flask_anyform/anyform.py
from functools import partial from collections import OrderedDict from werkzeug.local import LocalProxy from werkzeug.datastructures import MultiDict from flask import request, current_app, get_template_attribute from .utils import get_url _anyform = LocalProxy(lambda: current_app.extensions['anyform']) _endpoints = ...
Python
0
@@ -336,42 +336,16 @@ da: -%5Bstr(x) for x in (request. endpoint .rsp @@ -344,168 +344,23 @@ oint -.rsp +s_ li +s t( -':')%5B-1%5D,%0A request.endpoint.rsplit('.')%5B-1%5D,%0A u'all')%5D +request) )%0Acu @@ -482,16...
9b8bedc00be962284abb0420537d32e2ed7f4947
Tag new release: 3.1.15
floo/version.py
floo/version.py
PLUGIN_VERSION = '3.1.14' # The line above is auto-generated by tag_release.py. Do not change it manually. try: from .common import shared as G assert G except ImportError: from common import shared as G G.__VERSION__ = '0.11' G.__PLUGIN_VERSION__ = PLUGIN_VERSION
Python
0
@@ -20,9 +20,9 @@ .1.1 -4 +5 '%0A#
554942c6ae8dfb71d1a2af895b60cd6b4923cc28
Tag new release: 3.1.9
floo/version.py
floo/version.py
PLUGIN_VERSION = '3.1.8' # The line above is auto-generated by tag_release.py. Do not change it manually. try: from .common import shared as G assert G except ImportError: from common import shared as G G.__VERSION__ = '0.11' G.__PLUGIN_VERSION__ = PLUGIN_VERSION
Python
0
@@ -19,9 +19,9 @@ 3.1. -8 +9 '%0A#
f32861923e0565d11e10989eeebd6122d1ab130b
update blob download script
scripts/download_blob_from_peer.py
scripts/download_blob_from_peer.py
"""A simple script that attempts to directly download a single blob or stream from a given peer""" import argparse import logging import sys import tempfile import time import shutil from pprint import pprint from twisted.internet import defer, reactor, threads from lbrynet import conf from lbrynet.core import log_su...
Python
0
@@ -540,50 +540,44 @@ et.d -ht.hashannouncer import DummyHashAnnouncer +atabase.storage import SQLiteStorage %0A%0Alo @@ -1408,38 +1408,73 @@ -announcer = DummyHashAnnouncer +storage = SQLiteStorage(tmp_dir, reactor)%0A yield storage.setup ()%0A @@ -1515,19 +1515,8 @@ ger( -announcer, tmp_ @@ -1520,23 +...
cc0f463f49ba551a5381948d8ea89cd82ba9b52e
Fix #765.
rts/python/memory.py
rts/python/memory.py
# Start of memory.py. import ctypes as ct def addressOffset(x, offset, bt): return ct.cast(ct.addressof(x.contents)+int(offset), ct.POINTER(bt)) def allocateMem(size): return ct.cast((ct.c_byte * max(0,size))(), ct.POINTER(ct.c_byte)) # Copy an array if its is not-None. This is important for treating # Numpy a...
Python
0
@@ -694,24 +694,38 @@ et(x, offset +*ct.sizeof(bt) , bt)%5B0%5D)%0A%0Ad @@ -804,24 +804,37 @@ +int(offset) +*ct.sizeof(v) , ct.address
aa29ab484e85b03bd9dbc962bf4c77dbfe05f059
Remove uuid since we are now using uuidutils.
taskflow/job.py
taskflow/job.py
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Yahoo! 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 # # ...
Python
0
@@ -709,20 +709,8 @@ abc -%0Aimport uuid %0A%0Afr
8e588e4eb4e0927801b7a14af1ae66f1c741892b
Create a new instance for every invocation.
flowy/config.py
flowy/config.py
import venusian import logging import json import sys from .swf import SWFClient, Client __all__ = ['make_config', 'ClientConfig', 'activity_config', 'workflow_config'] def activity_config(name, version, task_list, heartbeat=60, schedule_to_close=420, sch...
Python
0
@@ -518,44 +518,161 @@ -wrapped_instance = wrapped(**kwargs) +def activity_runner(*ar_args, **ar_kwargs):%0A wrapped_instance = wrapped(**kwargs)%0A wrapped_instance(*ar_args, **ar_kwargs)%0A %0A @@ -755,32 +755,31 @@ _runner= -wrapped_instance +activity_runner ,%0A @@ -1...
c40f7b216d1ebe14332acd2f4aa8df819053258a
Create serializers.py
src/posts/serializers.py
src/posts/serializers.py
from rest_framework import serializers from .models import Post class PostSerializers(serializers.HyperlinkedModelSerializer): class Meta: model = Post fields = ('url', 'title', 'content', 'timestamp', 'updated', 'media_url') '''4703635512 ygnesha ranga 510 771 9301 '''
Python
0.000002
@@ -244,52 +244,4 @@ l')%0A -%0A'''4703635512 %0Aygnesha%0A%0A%0Aranga 510 771 9301 '''
96458da82f497e171744b37990b062b6dff09251
make the logging more useful and verbose
scripts/ingestors/dot_truckcams.py
scripts/ingestors/dot_truckcams.py
''' Iowa DOT Truck dash camera imagery. Save this to the IEM archives /YYYY/mm/dd/camera/idot_trucks/keyhash/keyhash_timestamp.jpg ''' import urllib2 import json import psycopg2 import pytz import datetime import subprocess import tempfile import os URI = ("https://geonexusr.iowadot.gov/arcgis/rest/services/Op...
Python
0.000093
@@ -2108,16 +2108,75 @@ saving!%0A + #print label, utc, feat%5B'attributes'%5D%5B'PHOTO_URL'%5D%0A @@ -2251,16 +2251,16 @@ .read()%0A - @@ -2656,16 +2656,23 @@ %0A + proc = subproc @@ -2679,12 +2679,13 @@ ess. -call +Popen (cmd @@ -2696,17 +2696,408 @@ ell=True -) +, stderr=sub...
69906dfbceb4da6eab95a815d53f7f995ee41d0b
Move `throttle` setting to `ForgeClient`.
forge/client.py
forge/client.py
import json import logging import time import urllib import urlparse import requests from . import __version__ from . import constants logger = logging.getLogger('forge.client') class ForgeClient(object): def __init__(self, api_url=constants.PUPPETLABS_FORGE_API_URL, api_version=3, agent_typ...
Python
0
@@ -320,16 +320,45 @@ pe=None, +%0A throttle=0, verify= @@ -393,72 +393,84 @@ his -is an object -t ha -t acts as client for the Forge according%0A +ndles all HTTP requests to the Forge API specfied%0A according to @@ -925,16 +925,49 @@ ersion)%0A + self.throttle = throt...