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
5c43a95bf676fa2c03521d3d966396389639a91a
Add fixes for wsgi test script
wsgi/freesurfer_test.py
wsgi/freesurfer_test.py
#!/usr/bin/env python import json import urlparse import argparse from wsgiref.simple_server import make_server import socket import sys import random TIMEZONE = "US/Central" def validate_parameters(query_dict, parameters): """ Check parameters in query_dict using the parameters specified :param query_d...
Python
0
@@ -612,18 +612,30 @@ rameters +.iteritems() :%0A - @@ -750,32 +750,35 @@ (query_dict%5Bkey%5D +%5B0%5D )%0A exc @@ -855,32 +855,32 @@ try:%0A - b @@ -898,16 +898,19 @@ ict%5Bkey%5D +%5B0%5D )%0A
06e291fa8d9c2ca4b8ba136e4e724fa6ed9e25b2
fix version back to 2.9 so we can use bump/minor
src/edge/__init__.py
src/edge/__init__.py
from django.db.backends.signals import connection_created __version__ = '2.9.1' def import_gff(name, fn): """ Creates a new genome using the specified GFF file. name: Name of genome fn: path to GFF file """ from edge.models import Genome if Genome.objects.filter(name=name).count() > 0: ...
Python
0
@@ -75,9 +75,9 @@ 2.9. -1 +0 '%0A%0A%0A
66d94ada3def2bb1708333a3d9856663e59a9585
add pattern field to campaign
referral/models.py
referral/models.py
from django.contrib.auth.models import User from django.db import models from django.utils.translation import ugettext_lazy as _ import settings class Campaign(models.Model): name = models.CharField(_("Name"), max_length=255, unique=True) description = models.TextField(_("Description"), blank=True, null=True...
Python
0
@@ -306,32 +306,228 @@ True, null=True) +%0A pattern = models.CharField(_(%22Referrer pattern%22), blank=True, max_length=255,%0A help_text=%22All auto created referrers containing this pattern will be associated with this campaign%22) %0A%0A class Meta
3b9578739d081f9b779a2d366d76c69a635a99b8
Make sure integrate_sens uses the correct parameter values.
Example/runExample.py
Example/runExample.py
import scipy from SloppyCell.ReactionNetworks import * # This ensures that all our plots will have smooth curves between the data # points. It's a little faster to use Network.full_speed(), which only # calculates the points whether there is actually data. Network.pretty_plotting() # We access the Networks we defi...
Python
0
@@ -1661,16 +1661,147 @@ oo far.%0A +# A prior of width log(10) corresponds to constraining the parameter to lie,%0A# with 95%25 probility, between val/100 and val * 100.%0A # (These @@ -3345,16 +3345,17 @@ speed()%0A +%0A # Buildi @@ -5117,16 +5117,74 @@ raj=True +,%0A p...
7f34a59f632cc4a46a53b31cb0ec28d4dfa03691
fix upper limit
problem_034.py
problem_034.py
#!/usr/bin/env python #-*-coding:utf-8-*- ''' 145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145. Find the sum of all numbers which are equal to the sum of the factorial of their digits. Note: as 1! = 1 and 2! = 2 are not sums they are not included. ''' import math import timeit def calc(): eqs = []...
Python
0.999873
@@ -341,13 +341,13 @@ 3, 2 -17728 +54016 0):%0A
af93302a24ab87e039b66f1f04c3f8802b8610e4
add problem sentence
problem_051.py
problem_051.py
#!/usr/bin/env python #-*-coding:utf-8-*- ''' ''' import math import timeit primes = [2, 3, 5, 7] def is_prime(n): for p in primes: if n % p == 0: return False for i in range(max(primes), int(math.sqrt(n))+1): if n % i == 0: return False return True def replace...
Python
1
@@ -40,16 +40,658 @@ *-%0A%0A'''%0A +By replacing the 1st digit of the 2-digit number *3,%0Ait turns out that six of the nine possible values:%0A13, 23, 43, 53, 73, and 83, are all prime.%0A%0ABy replacing the 3rd and 4th digits of 56**3 with the same digit,%0Athis 5-digit number is the first example having seven prim...
30cea770a0c6379a7817144a6e092f30d5857bf0
Fix KillFilter matching
nova/rootwrap/filters.py
nova/rootwrap/filters.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 Openstack, LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache...
Python
0.000285
@@ -3436,35 +3436,61 @@ s):%0A +args = list(userargs)%0A if len( -user args) == 3:%0A @@ -3510,20 +3510,16 @@ ignal = -user args.pop @@ -3679,28 +3679,24 @@ if len( -user args) != 2:%0A @@ -3921,27 +3921,28 @@ pid = -user +int( args%5B1%5D +) %0A
555fade53e02e4d89845f029ee97bc9a1713e784
Update version aliases for rpc version control
nova/scheduler/rpcapi.py
nova/scheduler/rpcapi.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012, Red Hat, 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 # ...
Python
0.000015
@@ -2668,32 +2668,235 @@ run_instance()%0A +%0A ... Havana supports message version 2.9. So, any changes to existing%0A methods in 2.x after that point should be done such that they can%0A handle the version_cap being set to 2.9.%0A%0A ... - De @@ -3454,16 +3454,41 @@ '2.6',%0A + ...
efb32929d39ea0657a2abff4930d4e0454f5cc91
increase max-age on CDN
nprapps_tools/fabfile.py
nprapps_tools/fabfile.py
#!/usr/bin/env python # _*_ coding:utf-8 _*_ import os import shutil import glob import gzip import logging from distutils.util import strtobool from fabric.api import task, local LOG_FORMAT = '%(levelname)s:%(name)s:%(asctime)s: %(message)s' LOG_LEVEL = logging.INFO # GLOBAL SETTINGS cwd = os.path.dirname(__file__) ...
Python
0.000006
@@ -495,10 +495,12 @@ E = -3 6 +048 00%0A%0A
88d7f61666528b18d88c23d53849c21014f942d3
Fix handling of boolean typed settings
src/mcedit2/util/settings.py
src/mcedit2/util/settings.py
""" settings """ from __future__ import absolute_import, division, print_function, unicode_literals import json import os from PySide import QtCore import logging from mcedit2.util import directories log = logging.getLogger(__name__) _settings = None def Settings(): global _settings if _settings is None...
Python
0.000002
@@ -448,27 +448,37 @@ tings, key, -typ +valueType=Non e, default=N @@ -638,16 +638,26 @@ elf. -type = t +valueType = valueT ype%0A @@ -795,33 +795,38 @@ if self. -t +valueT ype == %22json%22:%0A @@ -980,17 +980,165 @@ if self. -t +valueType is bool:%0A if isinstance(value, basestring):%0...
65877ea1b40d19209f02b474f7b516f1650d9d2e
version bump for pypi
nyc_geoclient/version.py
nyc_geoclient/version.py
# -*- coding: utf-8 -*- __version__ = '0.0.1' __build__ = 0x000001
Python
0
@@ -37,17 +37,17 @@ = '0.0. -1 +2 '%0A__buil @@ -63,6 +63,6 @@ 0000 -1 +2 %0A
ce0488b4b421f774759124e84416367aa21e4a1d
fix the reporters admin. it had a duplicate "identity" and no "backend" in the list of displayed columns.
reporters/admin.py
reporters/admin.py
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 from django.contrib import admin from reporters.models import * from django.core.urlresolvers import reverse class ReporterAdmin(admin.ModelAdmin): list_display = ('id','alias','first_name', 'last_name') list_filter = [] class PersistantConnectionAdmin...
Python
0
@@ -359,24 +359,23 @@ ('id',' -identity +backend ','ident
397031628b0a204436e9d777aa81f2f4792edc06
Add test for children, parents
refcycle/test/test_annotated_graph.py
refcycle/test/test_annotated_graph.py
import unittest from refcycle.annotated_graph import ( AnnotatedEdge, AnnotatedGraph, AnnotatedVertex, ) class TestAnnotatedGraph(unittest.TestCase): def test_simple_graph_construction(self): # Direct construction of a simple annotated graph. v1 = AnnotatedVertex(id=0, annotation="ver...
Python
0.000074
@@ -410,54 +410,132 @@ dge( -id=3, annotation=%22from 1 to 2%22, head=0, tail=1 +%0A id=3,%0A annotation=%22edge from vertex 1 to vertex 2%22,%0A tail=0,%0A head=1,%0A )%0A @@ -673,24 +673,135 @@ ertices), 2) +%0A self.assertItemsEqual(graph.children(v1), ...
c0e3462b78779c79bc0c683ac9537aeb61959beb
add .software
ExtractLevelDomain.py
ExtractLevelDomain.py
#coding=utf-8 import re from urlparse import urlparse class ExtractLevelDomain(): def __init__(self): self.topHostPostfix = [ '.com','.la','.io', '.co', '.cn','.info', '.net', '.org','.me', '.mobi', '.us', '.biz', '.xxx', '.ca', '.co.jp', ...
Python
0.000003
@@ -1178,16 +1178,41 @@ .wiki',%0A + '.software',%0A
676e834cc34d23b43238f6ed9b1d5d62926e6e32
replace __del__ with an ffi.gc hook.
FAUSTPy/python_dsp.py
FAUSTPy/python_dsp.py
from numpy import atleast_2d, ndarray, float32, float64, float128 class PythonDSP(object): """A FAUST DSP wrapper. This class is more low-level than the FAUST class. It can be viewed as an abstraction that sits directly on top of the FAUST DSP struct. """ def __init__(self, C, ffi, fs): "...
Python
0
@@ -1190,16 +1190,23 @@ = +ffi.gc( C.newmyd @@ -1205,24 +1205,40 @@ C.newmydsp() +, C.deletemydsp) %0A sel @@ -2822,239 +2822,8 @@ %22)%0A%0A - def __del__(self):%0A %22%22%22Deallocate the FAUST DSP object.%0A%0A This method makes sure to properly deallocate the internal C data%0A ...
0dcf099bf6be80f8b75b43dd47d553341cca35d1
add header and jump empty maked line
inventory_status_mrp/mrp_unload.py
inventory_status_mrp/mrp_unload.py
# -*- coding: utf-8 -*- ############################################################################### # # Copyright (C) 2001-2014 Micronaet SRL (<http://www.micronaet.it>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License a...
Python
0
@@ -2708,17 +2708,17 @@ unter = -1 +0 # Row c @@ -2726,16 +2726,258 @@ unters:%0A + # Write header%0A write_xls_log(%5B%0A 'MRP', %0A 'Date',%0A 'Order',%0A 'Product',%0A 'Maked',%0A 'Component',%0A 'Maked',%0A 'S...
d71869398944b03486575732584c3349684a8eb3
fix default cache provider
inyourface/DefaultCacheProvider.py
inyourface/DefaultCacheProvider.py
import os, sqlite3 class CacheProvider(object): def __init__(self, cache_dir): if not os.path.exists(cache_dir): os.makedirs(cache_dir) conn = sqlite3.connect(cache_dir + 'faces.db') self.cache_connection = conn c = conn.cursor() # Create table c.execute...
Python
0.000001
@@ -641,16 +641,19 @@ turn res +%5B1%5D %0A%0A de
8336e18e8a954e691acb4fead463bdf9e5c432a1
add gpd support to pacbio renaming
iron/utilities/rename_to_pacbio.py
iron/utilities/rename_to_pacbio.py
#!/usr/bin/python import sys,argparse from SequenceBasics import FastaHandleReader, FastqHandleReader def main(): parser = argparse.ArgumentParser() parser.add_argument('input',help="Use - for STDIN") group = parser.add_mutually_exclusive_group(required=True) group.add_argument('--fasta',action='store_true') ...
Python
0
@@ -360,24 +360,74 @@ tore_true')%0A + group.add_argument('--gpd',action='store_true')%0A parser.add @@ -696,38 +696,547 @@ )%0A -else: args.output = sys.stdout +if args.output_table: args.output_table= open(args.output_table,'w')%0A else: args.output = sys.stdout%0A if args.gpd:%0A z = 0%0A for line i...
a70e76d043a452bcd3962896fa7281e4499fc2af
Package Bonniepp adding sbin to PATH (#16124)
var/spack/repos/builtin/packages/bonniepp/package.py
var/spack/repos/builtin/packages/bonniepp/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 Bonniepp(AutotoolsPackage): """Bonnie++ is a benchmark suite that is aimed at performing a...
Python
0
@@ -751,8 +751,152 @@ re_args%0A +%0A def setup_run_environment(self, env):%0A %22%22%22Prepend the sbin directory to PATH.%22%22%22%0A env.prepend_path('PATH', self.prefix.sbin)%0A
27a339eeb28007bf0844e4c331bdd7d9da13da2e
Add version 0.177 of elfutils (#13129)
var/spack/repos/builtin/packages/elfutils/package.py
var/spack/repos/builtin/packages/elfutils/package.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * import glob import os.path class Elfutils(AutotoolsPackage): """elfutils is a collection of vari...
Python
0
@@ -745,17 +745,17 @@ ftp/0.17 -6 +7 /elfutil @@ -760,17 +760,17 @@ ils-0.17 -6 +7 .tar.bz2 @@ -844,16 +844,112 @@ th = 1%0A%0A + version('0.177', sha256='fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc05042e')%0A vers
cc12f27217f65747cd121dc0a8746ecc27c9b1a1
Fix error caused by improper encoding of outgoing messages.
mcchat2.py
mcchat2.py
#!/usr/bin/env python2.7 from __future__ import print_function import sys import time import re import argparse import getpass from threading import Thread, Condition, Lock import thread import minecraft.authentication as authentication import minecraft.networking.connection as connection import minecraft.networking...
Python
0
@@ -2972,16 +2972,31 @@ on_data) +.encode('utf8') )%0A%0Adef h
906ec28fc540e91eb42c88f20e14eb3df231458f
fix for creating void segmentations for VOC07
voc_loader.py
voc_loader.py
import logging import os import cv2 import numpy as np import xml.etree.ElementTree as ET from PIL import Image from paths import DATASETS_ROOT log = logging.getLogger() VOC_CATS = ['__background__', 'aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', 'cat', 'chair', 'cow', 'diningtable', '...
Python
0
@@ -3794,32 +3794,38 @@ dtype=np.uint8) + + 255 %0A return
fc6a9dfebc8bc016155c791c3325cdbb257dc192
Move redis import
src/cache.py
src/cache.py
# The MIT License (MIT) # # Copyright (c) 2017 Stefan Graupner # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, m...
Python
0
@@ -1118,22 +1118,8 @@ E.%0A%0A -import redis%0A%0A clas @@ -1629,16 +1629,38 @@ =6379):%0A + import redis%0A%0A
84888f75de0502aece3c1306802b26848e84c5b1
Bump version to 1.5.2
py/__init__.py
py/__init__.py
""" pylib: rapid testing and development utils this module uses apipkg.py for lazy-loading sub modules and classes. The initpkg-dictionary below specifies name->value mappings where value can be another namespace dictionary or an import path. (c) Holger Krekel and others, 2004-2014 """ __version__ = '1.5.1' try: ...
Python
0
@@ -303,17 +303,17 @@ = '1.5. -1 +2 '%0A%0Atry:%0A
575a437c5f087d457a37d0bf1b2d883d977c4b94
Fix python3 incompatibility
pyeda/vexpr.py
pyeda/vexpr.py
""" Boolean Vector Logic Expressions Interface Functions: bitvec sbitvec uint2vec int2vec Interface Classes: VectorExpression BitVector """ __copyright__ = "Copyright (c) 2012, Chris Drake" from pyeda.common import clog2, bit_on from pyeda.boolfunc import VectorFunction as VF from pyeda....
Python
0.998945
@@ -383,23 +383,16 @@ gs, -bnr=VF.UNSIGNED +**kwargs ):%0A @@ -426,24 +426,65 @@ riables.%22%22%22%0A + bnr = kwargs.get(%22bnr%22, VF.UNSIGNED)%0A if len(a
489fc379c406debe427fcf5025e41359b083e609
Add refresh_interval to Config
pyhn/config.py
pyhn/config.py
# -*- coding: utf-8 -*- import os try: from configparser import SafeConfigParser except ImportError: from ConfigParser import SafeConfigParser class Config(object): def __init__(self, config_dir=None, config_file=None): self.config_dir = config_dir self.config_file = config_file ...
Python
0.000001
@@ -4512,24 +4512,161 @@ efault__')%0A%0A + if not self.parser.has_option('settings', 'refresh_interval'):%0A self.parser.set('settings', 'refresh_interval', '5')%0A%0A # Co
bc6c54acbf2205ec98d35ee816e4c926af59ff72
default opt. not fixed
pyGPGO/GPGO.py
pyGPGO/GPGO.py
from collections import OrderedDict import numpy as np from scipy.optimize import minimize from joblib import Parallel, delayed from pyGPGO.logger import EventLogger class GPGO: def __init__(self, surrogate, acquisition, f, parameter_dict, n_jobs=1): """ Bayesian Optimization class. Par...
Python
0.999927
@@ -53,44 +53,8 @@ np%0A -from scipy.optimize import minimize%0A from @@ -86,17 +86,16 @@ delayed%0A -%0A from pyG @@ -124,16 +124,52 @@ tLogger%0A +from scipy.optimize import minimize%0A %0A%0Aclass @@ -2003,16 +2003,37 @@ randint( +%0A self.par @@ -2188,16 +2188,37 @@ uniform( +%0A ...
4f5419fdec8dd1face4e3185d7146c1705b4de0f
add _t_r_a_k to list of available tables
Lib/fontTools/ttLib/tables/__init__.py
Lib/fontTools/ttLib/tables/__init__.py
from __future__ import print_function, division, absolute_import from fontTools.misc.py23 import * # DON'T EDIT! This file is generated by MetaTools/buildTableList.py. def _moduleFinderHint(): """Dummy function to let modulefinder know what tables may be dynamically imported. Generated by MetaTools/buildTableList.p...
Python
0
@@ -1710,16 +1710,40 @@ s_b_i_x%0A +%09from . import _t_r_a_k%0A %09from .
07decc9a2fd26b19d74016b5a26ceab33f60367b
Split up the Middleware line.
pyrotorrent.py
pyrotorrent.py
#!/usr/bin/env python """ pyroTorrent module. """ from flup.server.fcgi import WSGIServer from jinja2 import Environment, PackageLoader from webtool import WebTool, read_post_data import datetime import time # For unescaping import urllib # For torrent downloading import urllib2 # Binary object encoding import xm...
Python
0.000002
@@ -84,16 +84,17 @@ IServer%0A +%0A from jin @@ -6462,61 +6462,52 @@ -WSGIServer(SessionMiddleware(SessionHack(pyroTorrentA +app = pyroTorrentApp%0A app = SessionHack(a pp, @@ -6521,40 +6521,78 @@ age) -, %5C %0A - session_options) +app = SessionMiddleware(app, session_options)%0A%0A WSGISe...
b5068d644ffde56f302e9aee5b77e837a1d3e181
Add some logging to generic error handler.
pyshelf/app.py
pyshelf/app.py
import flask from pyshelf.routes.artifact import artifact import pyshelf.response_map as response_map app = flask.Flask(__name__) app.register_blueprint(artifact) @app.errorhandler(Exception) def generic_exception_handler(error): if not error.message: error.message = "Internal Server Error" return res...
Python
0
@@ -94,16 +94,31 @@ onse_map +%0Aimport logging %0A%0Aapp = @@ -173,16 +173,17 @@ ifact)%0A%0A +%0A @app.err @@ -241,16 +241,242 @@ error):%0A + %22%22%22%0A Prevents Exceptions flying all around the place.%0A %22%22%22%0A logger = logging.getLogger(__name__)%0A logger.debug(%22Exception was ca...
1faea905f923e46222d83a3ae62ee5361e63ee1a
Add list and table methods
pynuts/view.py
pynuts/view.py
import flask import jinja2 from sqlalchemy.orm import class_mapper from sqlalchemy.util import classproperty JINJA2_ENVIRONMENT = jinja2.Environment( loader=jinja2.PackageLoader('pynuts', 'templates')) JINJA2_ENVIRONMENT.globals.update({'url_for': flask.url_for}) class MetaView(type): def __init__(cls, name,...
Python
0.000001
@@ -1047,17 +1047,16 @@ ne%0A%0A - # Templa @@ -2536,29 +2536,16 @@ emplate( -%0A cls.list @@ -3697,32 +3697,317 @@ rgs, **kwargs)%0A%0A + @classmethod%0A def list(cls, template=None, *args, **kwargs):%0A return flask.render_template(template, cls=cls, *args, **kwargs)%0A%0A @class...
11b491670a786843888782b90d1ba1ef5f893fd5
Remove our mention
python/plot.py
python/plot.py
#!/usr/bin/env python3 # coding: utf8 # encoding=utf8 from vapory import * from moviepy.editor import VideoClip import json import tweepy import numpy as np import math, os, time, sys from math import pi from credentials import * from convertBytes import convert_bytes reload(sys) sys.setdefaultencoding('utf8') def ba...
Python
0
@@ -267,20 +267,8 @@ es%0A%0A -reload(sys)%0A sys.
e07de9f19a62187933754435fb2c614ff70d4f20
Fix bug where images that only had differing suffixes used the same scheme.
pywal/magic.py
pywal/magic.py
""" Generate a colorscheme using imagemagick. """ import re import shutil import subprocess from pywal.settings import CACHE_DIR, COLOR_COUNT from pywal import util def imagemagick(color_count, img): """Call Imagemagick to generate a scheme.""" colors = subprocess.Popen(["convert", img, "+dither", "-colors",...
Python
0
@@ -1807,16 +1807,47 @@ s file.%0A + # _home_dylan_img_jpg.json%0A cach @@ -1878,16 +1878,26 @@ hemes%22 / + %5C%0A img.rep @@ -1905,16 +1905,34 @@ ace(%22/%22, + %22_%22).replace(%22.%22, %22_%22)%0A
cc3bd0f2b09e9aa7b1e12a84a6502e4cb7dd3457
Output always writeable ndarrays
pysndfx/dsp.py
pysndfx/dsp.py
# coding=utf-8 """A lightweight Python wrapper of SoX's effects.""" import shlex from subprocess import PIPE, Popen from warnings import warn import numpy as np import audioread as ar class AudioEffectsChain: def __init__(self): self.command = [] def equalizer(self, frequency, q=1.0, db=-3.0): ...
Python
0.999856
@@ -7247,14 +7247,14 @@ from -buffer +string (std
7f0853522424ceefc44d57f7c597dee2df6f2fe7
include the revisions in the generated diffs
pyvcs/utils.py
pyvcs/utils.py
from difflib import unified_diff from pyvcs.exceptions import FileDoesNotExist def generate_unified_diff(repository, changed_files, commit1, commit2): diffs = [] for file_name in changed_files: try: file1 = repository.file_contents(file_name, commit1) except FileDoesNotExist: ...
Python
0
@@ -600,16 +600,58 @@ ile_name +, fromfiledate=commit1, tofiledate=commit2 %0A
e503ef58e801cfbc3ba72ba84bc2150c79a401d3
Save creatorId as well for geometries
girder/molecules/molecules/models/geometry.py
girder/molecules/molecules/models/geometry.py
from bson.objectid import ObjectId from girder.models.model_base import AccessControlledModel from girder.constants import AccessType from .molecule import Molecule as MoleculeModel class Geometry(AccessControlledModel): def __init__(self): super(Geometry, self).__init__() def initialize(self): ...
Python
0
@@ -968,16 +968,54 @@ ': cjson +,%0A 'creatorId': user%5B'_id'%5D %0A
7b534ef6adddaf190a3505c3025550cb0f34b5ca
use a stricter regex for death message matching
properties.py
properties.py
import os import re import shlex import zipfile def load(cls, *files): o = None for f in files: if os.path.isfile(f): with open(f) as f: o = cls(f, o) return o def load_jar(jar, path): z = zipfile.ZipFile(jar, 'r') o = Lang(z.open(path, 'r')) z.close() ...
Python
0.000002
@@ -6182,18 +6182,33 @@ %22(?P%3C%25s%3E -.* +%5BA-Za-z0-9%5D%7B1,32%7D )%22 %25 x)
92fdf39607a86f04a49d494bd9e712df0cb27644
Make smbus importing more lenient
www/drivers/VCNL4010.py
www/drivers/VCNL4010.py
""" Helper modole for the VCNL4010 IR distance and ambient light sensor. Adapted from: https://www.controleverything.com/content/Light?sku=VCNL4010_I2CS#tabs-0-product_tabset-2 """ import smbus from MockSmbus import MockSmbus class VCNL4010: """A module to set up and read from a VCNL4010.""" def __init__(...
Python
0.001158
@@ -176,16 +176,25 @@ -2%0A%22%22%22%0A%0A +try:%0A import s @@ -197,16 +197,45 @@ rt smbus +%0Aexcept ImportError:%0A pass %0A%0Afrom M @@ -859,15 +859,28 @@ ept +( IOError +, NameError) :%0A
ebdc7e764c37f3c55e7dfa8f28872f83df0e0eea
remove threading
robot_core.py
robot_core.py
from Adafruit_PWM_Servo_Driver import PWM from time import sleep import threading """ joint_key convention: R - right, L - left F - front, M - middle, B - back H - hip, K - knee, A - Ankle key : (channel, minimum_pulse_length, maximum_pulse_length) """ joint_properties = { 'LFH': (0, 248, 398), ...
Python
0.000057
@@ -61,26 +61,8 @@ leep -%0Aimport threading %0A%0A%22%22
2aa3afdf7b53c2296341c1f9f66d83f83d7d916d
Fix pifm_agent so it doesn't save the pickle every time
client_agent/pifm_agent.py
client_agent/pifm_agent.py
#!/usr/bin/env python import os import pickle import requests import pdb import json import logging from sh import sudo CACHE_FILE = "/home/pi/cache.pickle" PIFM_HOST = "http://pi_director" def getmac(interface): try: mac = open('/sys/class/net/'+interface+'/address').readline() except: mac ...
Python
0.000001
@@ -59,19 +59,8 @@ sts%0A -import pdb%0A impo @@ -67,16 +67,16 @@ rt json%0A + import l @@ -174,16 +174,56 @@ ector%22%0A%0A +logging.basicConfig(level=logging.INFO)%0A %0Adef get @@ -411,16 +411,34 @@ ache'''%0A +original_cache=%7B%7D%0A if os.pa @@ -551,16 +551,46 @@ e = %7B%7D%0A%0A +original_cache = cache....
05f4c0ae11879afecfc9cb9d155905ad4f3bf5fe
change json to find
signapp.py
signapp.py
#!/usr/bin/env python """ signapp.py created by Rolly Maulana Awangga """ import config import pymongo import urllib import json from Crypto.Cipher import AES class Signapp(object): def __init__(self): self.key = config.key self.iv = config.iv self.opendb() def opendb(self): self.conn = pymongo.MongoClie...
Python
0.000001
@@ -116,20 +116,8 @@ lib%0A -import json%0A from @@ -1289,85 +1289,47 @@ )%0A%09%09 -data = json.loads(html)%0A%09%09if (data%5B'aud'%5D == config.aud) and (data%5B'iss'%5D == +if html.find(config.aud) and html.find( conf @@ -1350,21 +1350,15 @@ t = -data%5B'email'%5D +%22valid%22 %0A%09%09e @@ -1372,16 +1372,2...
b90394696d8668891cef8ae218e9170be5bf86dd
Fix - Include isBinary flag
clue/websocket/protocol.py
clue/websocket/protocol.py
from autobahn.twisted.websocket import WebSocketServerProtocol from twisted.python import log from clue import errors from uuid import uuid1 from txaio import create_future class ClueServerProtocol(WebSocketServerProtocol): def __init__(self): self.id = uuid1() self.is_closed = create_future() ...
Python
0.000001
@@ -1310,16 +1310,40 @@ PING%22):%0A + # PING/PONG%0A @@ -1367,14 +1367,22 @@ age( +u %22PONG%22 +, False )%0A @@ -1409,32 +1409,61 @@ -self.sendMessage(message +# Echo%0A self.sendMessage(payload, isBinary )%0A%0A
61f6763f750084bf4c81e3975ffb042ae5f07179
Fix style
didyoumean/didyoumean_re.py
didyoumean/didyoumean_re.py
# -*- coding: utf-8 """Regular expressions to parse error messages.""" import re VARREFBEFOREASSIGN_RE = r"^(?:local|free) variable '(?P<name>\w+)' " \ r"referenced before assignment(?: in enclosing scope)?$" NAMENOTDEFINED_RE = r"^(?:global )?name '(?P<name>\w+)' is not defined$" ATTRIBUTEERROR_RE = r"^(?:class ...
Python
0.000001
@@ -1708,16 +1708,26 @@ uments? +%22 %5C%0A r%22 %5C(?(?:bu
00ffe6505273ca2717d4df8f2b947e1a577829bd
Remove extra annotations
watset_wsd.py
watset_wsd.py
#!/usr/bin/env python from flask import Flask, render_template, url_for, redirect, request from flask_misaka import Misaka from wsd.models import RequestWSD app = Flask(__name__) Misaka(app) @app.route('/', methods=['GET']) def index(): return render_template('index.html') @app.route('/wsd', methods=['GET']) ...
Python
0.000027
@@ -187,17 +187,16 @@ a(app)%0A%0A -%0A @app.rou @@ -201,33 +201,16 @@ oute('/' -, methods=%5B'GET'%5D )%0Adef in @@ -258,17 +258,16 @@ html')%0A%0A -%0A @app.rou @@ -275,33 +275,16 @@ e('/wsd' -, methods=%5B'GET'%5D )%0Adef ws @@ -347,17 +347,16 @@ e=302)%0A%0A -%0A @app.rou @@ -552,17 +552,16 @@ esult)%0A%...
7e7bdd474cde49757bff4357e76ae9f72bbefac1
increase position zoom of the camera flyer
software/ddapp/src/python/ddapp/cameracontrol.py
software/ddapp/src/python/ddapp/cameracontrol.py
import vtk import time import numpy as np from ddapp.timercallback import TimerCallback class OrbitController(TimerCallback): def __init__(self, view): TimerCallback.__init__(self) self.view = view self.orbitTime = 20.0 def tick(self): speed = 360.0 / self.orbitTime de...
Python
0
@@ -665,17 +665,17 @@ oom = 0. -2 +7 %0A%0A de @@ -1428,16 +1428,107 @@ osition) +%0A #newPosition = newFocalPoint - self.positionZoom*(newFocalPoint - newPosition) %0A%0A
d0385db6d6dd1623ea0e97b93b7fd70d591c3687
signature function should support unicode
vkontakte/tests.py
vkontakte/tests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Tests for vkontakte package. Requires mock >= 0.7.2. """ import os import sys sys.path.insert(0, os.path.abspath('..')) import unittest import mock import vkontakte import vkontakte.api API_ID = 'api_id' API_SECRET = 'api_secret' class VkontakteTest(unittest.TestCas...
Python
0.99833
@@ -421,16 +421,275 @@ PI())%0A%0A%0A +class SignatureTest(unittest.TestCase):%0A def test_signature_supports_unicode(self):%0A params = %7B'foo': u'%D0%BA%D0%BB%D0%B5%D0%BD'%7D%0A self.assertEqual(%0A vkontakte.signature(API_SECRET, params),%0A '560b3f1e09ff65167b8dc211604fed2b'...
4411e904d7c81ccbf6a6953d48fdf5a4306501f9
change image_file widget before initializing
cmsplugin_cascade/image.py
cmsplugin_cascade/image.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import apps from django.contrib.admin.sites import site from django.core.exceptions import ObjectDoesNotExist from django.forms import widgets from django.db.models.fields.related import ManyToOneRel from django.utils.encoding import pyth...
Python
0.000001
@@ -691,16 +691,136 @@ wargs):%0A + self.base_fields%5B'image_file'%5D.widget = AdminFileWidget(ManyToOneRel(FilerImageField, Image, 'file_ptr'), site)%0A @@ -1025,123 +1025,8 @@ pass -%0A self.fields%5B'image_file'%5D.widget = AdminFileWidget(ManyToOneRel(FilerImageField, Image, 'file_ptr'), ...
7823cf7536a13155ed21468e77c84bcbb5adb310
Use PositiveIntegerField for security
cmsplugin_zinnia/models.py
cmsplugin_zinnia/models.py
"""Models of Zinnia CMS Plugins""" from django.db import models from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import python_2_unicode_compatible from cms.models.pluginmodel import CMSPlugin from cmsplugin_zinnia.settings import PLUGINS_TEMPLATES TEMPLATES = [ ('cmsplugin_zinn...
Python
0
@@ -1362,32 +1362,40 @@ ntries = models. +Positive IntegerField(%0A @@ -1495,32 +1495,40 @@ offset = models. +Positive IntegerField(%0A @@ -3334,32 +3334,40 @@ ntries = models. +Positive IntegerField(%0A @@ -3356,32 +3356,32 @@ veIntegerField(%0A - _('numbe @@ -4144,32 +4144,40 @@ ntries = models...
63736a2958aae03749560dd3109fb4fea3b3ca7a
Switch calendar labels to be in Japanese
wanikani/django.py
wanikani/django.py
from __future__ import absolute_import from django.http import HttpResponse from django.views.generic.base import View from icalendar import Calendar, Event from wanikani.core import WaniKani, Radical, Kanji class WaniKaniView(View): def get(self, request, **kwargs): client = WaniKani(kwargs['api_key...
Python
0
@@ -1,12 +1,36 @@ +# -*- coding: utf-8 -*-%0A %0Afrom __futu @@ -900,16 +900,70 @@ Event()%0A + if counts%5BRadical%5D and counts%5BKanji%5D:%0A @@ -991,21 +991,184 @@ y', -'R +u'%E9%83%A8%E9%A6%96 : %7B0%7D -K: %7B1 +%E6%BC%A2%E5%AD%97: %7B1%7D'.format(%0A counts%5BRad...
1c59f6522072a3a1846a9e8124a359d0651b00d7
Change dependency as well
dojo/db_migrations/0019_system_settings_allow_anonymous_survey_repsonse.py
dojo/db_migrations/0019_system_settings_allow_anonymous_survey_repsonse.py
# Generated by Django 2.2.1 on 2019-08-21 19:34 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dojo', '0014_jira_conf_resolution_mappings'), ] operations = [ migrations.AddField( model_name='system_settings', na...
Python
0
@@ -171,39 +171,35 @@ '001 -4_jira_conf_resolution_mappings +8_sonarqube_api_integration '),%0A
7214eac33db2a03cfdd3f749ef67e3fb5e6d27ba
Version 0.4.3
openapi_core/__init__.py
openapi_core/__init__.py
"""OpenAPI core module""" from openapi_core.shortcuts import ( create_spec, validate_parameters, validate_body, ) __author__ = 'Artur Maciąg' __email__ = 'maciag.artur@gmail.com' __version__ = '0.4.2' __url__ = 'https://github.com/p1c2u/openapi-core' __license__ = 'BSD 3-Clause License' __all__ = ['create_spec', ...
Python
0.000001
@@ -196,17 +196,17 @@ = '0.4. -2 +3 '%0A__url_
16e253812a0bb81a3eb419fd7f4af5a56cca11f6
Fix param default value error
piazza_api.py
piazza_api.py
import requests import json import getpass class AuthenticationError(Exception): """AuthenticationError""" class NotAuthenticatedError(Exception): """NotAuthenticatedError""" class RequestError(Exception): """RequestError""" class PiazzaAPI(object): """Tiny wrapper around Piazza'...
Python
0.000002
@@ -6532,25 +6532,20 @@ ne, nid= -self._nid +None , nid_ke @@ -7412,32 +7412,73 @@ henticated()%0D%0A%0D%0A + nid = nid if nid else self._nid%0D%0A if data
baf1ee8369565c198128469fadbd1421b5c67dea
Add ShapeFactory.generateStrokePath()
xie/graphics/factory.py
xie/graphics/factory.py
from .stroke import Stroke, StrokePosition from .component import Component, ComponentInfo from .stroke_info import * from .shape import Pane class ShapeFactory: def __init__(self): self.strokeInfoFactory=StrokeInfoFactory() def _generateStroke(self, startPoint, strokeInfo, pane = None): if not pane: stroke...
Python
0
@@ -224,16 +224,114 @@ tory()%0A%0A +%09def generateStrokePath(self, segments):%0A%09%09strokePath = StrokePath(segments)%0A%09%09return strokePath%0A%0A %09def _ge
884208477f0556cbe05c2ed965e6a42f57969fd9
Remove unused import
yunity/groups/models.py
yunity/groups/models.py
from django.db.models import Model from django.db.models import TextField, ManyToManyField, CharField from yunity.base.base_models import BaseModel, LocationModel from config import settings class Group(BaseModel, LocationModel): name = CharField(max_length=settings.NAME_MAX_LENGTH) description = TextField(bl...
Python
0.000001
@@ -1,39 +1,4 @@ -from django.db.models import Model%0A from
acce9a50d4ef5cb9e62693a2311e8da47fa5b511
Revert "Update airplay play_state logic"
pyatv/airplay/player.py
pyatv/airplay/player.py
"""Play media on a device by sending an URL.""" import logging import asyncio import plistlib from aiohttp import ClientSession from pyatv import const _LOGGER = logging.getLogger(__name__) # This is the default port. It is also included in the Bonjour service # _airplay._tcp, so it might be a good idea to get it ...
Python
0
@@ -128,33 +128,8 @@ on%0A%0A -from pyatv import const%0A%0A _LOG @@ -1862,17 +1862,108 @@ playing. + It might take%0A # some time until the media starts playing, give it 5 seconds (attempts) %0A - @asy @@ -2092,45 +2092,50 @@ -play +attempts = 5%0A video _sta +r te +d = -const.PLAY_STATE_...
7d68808843d209d46bd4c5e77ebdcbf4017532b3
implement upload_show()
pybooru/api_danbooru.py
pybooru/api_danbooru.py
# -*- coding: utf-8 -*- """pybooru.api_danbooru This module contains all API calls of Danbooru for Pybooru. Classes: Danbooru -- Contains all API calls. """ # __future__ imports from __future__ import absolute_import # pybooru imports from .exceptions import PybooruAPIError class DanbooruApi(object): """...
Python
0
@@ -6142,28 +6142,273 @@ s.json', params, auth=True)%0A +%0A def upload_show(self, upload_id):%0A %22%22%22Get a upload (Requires login).%0A%0A Parameters:%0A upload_id: Where upload_id is the upload id.%0A %22%22%22%0A return self._get('uploads/%7B0%7D.json'.format(upload_id)...
17f5015e24a926abc5133663dfd63dff8334c5d1
Fix a comment.
pybtex/plugin/loader.py
pybtex/plugin/loader.py
# Copyright (c) 2007, 2008, 2009, 2010, 2011, 2012 Andrey Golovizin # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, c...
Python
0.000008
@@ -2696,19 +2696,21 @@ ter_ -xxx +plugin method -s %0A
ab8ea5329bc4566b877e2f2991f096909842f9d9
Bump version to 0.1.4
orchestrator/__init__.py
orchestrator/__init__.py
import logging from conf.appconfig import LOG_FORMAT, LOG_DATE, LOG_ROOT_LEVEL __version__ = '0.1.0' __author__ = 'sukrit' logging.basicConfig(format=LOG_FORMAT, datefmt=LOG_DATE, level=LOG_ROOT_LEVEL) logging.getLogger('boto').setLevel(logging.INFO)
Python
0.000001
@@ -92,17 +92,17 @@ = '0.1. -0 +4 '%0A__auth
3429293244359b5635b7d060caf527a36850f3a2
Prepare for next dev version to incorporate encofing fixes in flask-hyperschema library
orchestrator/__init__.py
orchestrator/__init__.py
from __future__ import absolute_import from celery.signals import setup_logging import orchestrator.logger __version__ = '0.3.5' __author__ = 'sukrit' orchestrator.logger.init_logging() setup_logging.connect(orchestrator.logger.init_celery_logging)
Python
0
@@ -124,9 +124,9 @@ 0.3. -5 +6 '%0A__
657ec7f2239cc0a48cb656cfd01ca03f854e0abc
bump version
pydeploy/__version__.py
pydeploy/__version__.py
__version__ = "0.2.5"
Python
0
@@ -16,7 +16,7 @@ 0.2. -5 +6 %22%0A
e8b404b4525983df8b790d18afcca4cc79430133
Make python clean up after itself by removing its /tmp subdir.
pydir/build-pnacl-ir.py
pydir/build-pnacl-ir.py
#!/usr/bin/env python2 import argparse import os import tempfile from utils import shellcmd from utils import FindBaseNaCl if __name__ == '__main__': argparser = argparse.ArgumentParser() argparser.add_argument('cfile', nargs='+', type=str, help='C file(s) to convert') argparser.add_argument('--di...
Python
0.000007
@@ -40,18 +40,45 @@ %0Aimport -os +errno%0Aimport os%0Aimport shutil %0Aimport @@ -760,16 +760,29 @@ ATH'%5D)%0A%0A + try:%0A temp @@ -811,16 +811,20 @@ ()%0A%0A + + for cnam @@ -848,16 +848,20 @@ + + basename @@ -890,16 +890,20 @@ ame)%5B0%5D%0A + @@ -951,32 +95...
41941ce6ff0e8b2ac917f14c7ffddfa325ebb008
Bump version
pyexperiment/version.py
pyexperiment/version.py
"""Defines the version of pyexperiment """ __version__ = '0.2.9'
Python
0
@@ -60,7 +60,8 @@ 0.2. -9 +10 '%0A
6a757106717235c55b720f71fee66e894f908a7d
add single quoted string: still bugged
pygments/lexers/golo.py
pygments/lexers/golo.py
# -*- coding: utf-8 -*- """ pygments.lexers.golo ~~~~~~~~~~~~~~~~~~~~~~ Lexer for Golo source code. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ #TODO: single quoted string #TODO: backquote escaped litterals from pygments.lexer imp...
Python
0.999904
@@ -2536,32 +2536,76 @@ oublestring')),%0A + (r%22'%22, String, 'singlestring'),%0A (r'- @@ -3583,16 +3583,167 @@ string') +,%0A %5D,%0A 'singlestring': %5B%0A (r%22'%22, String, '#pop'),%0A (r%22%5C%5C%5C%5C%7C%5C%5C'%7C%5C%5Cn%22, String.Escape),%0A ...
f3979f9619f514eee6e6c997534ddf11ab5ce092
support for the new 4 version of the Ride language
pygments/lexers/ride.py
pygments/lexers/ride.py
# -*- coding: utf-8 -*- """ pygments.lexers.ride ~~~~~~~~~~~~~~~~~~~~ Lexer for the Ride programming language. :copyright: Copyright 2006-2019 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, words, include from pygments.token i...
Python
0
@@ -802,16 +802,22 @@ ', '::', + ':+', ':', '! @@ -839,17 +839,17 @@ '.', ' -- += %3E', '-', @@ -869,16 +869,22 @@ &', '%25', + '++', %0A )%0A%0A @@ -1750,24 +1750,175 @@ , 'SHA3512', + 'BinaryEntry',%0A 'BooleanEntry' , 'IntEntry', 'StringEntry', 'List', 'Ceiling',%0A 'Down', 'Floor', 'HalfD...
098e99ca70ea1b8362ecf82514cb50992143f3fe
Convert DuplicateChannelError to RaidenRecoverableError
raiden/exceptions.py
raiden/exceptions.py
class RaidenError(Exception): """ Base exception, used to catch all raiden related exceptions. """ pass class RaidenRecoverableError(RaidenError): pass class RaidenUnrecoverableError(RaidenError): pass # Exceptions raised due to programming errors class HashLengthNot32(RaidenError): """ Rai...
Python
0.999999
@@ -3690,32 +3690,43 @@ nnelError(Raiden +Recoverable Error):%0A %22%22%22R
bcb887b24e19905655b3fe54e58c71319673ed46
Update version
pysendpulse/__init__.py
pysendpulse/__init__.py
__author__ = 'Maksym Ustymenko' __author_email__ = 'tech@sendpulse.com' __copyright__ = 'Copyright 2017, SendPulse' __credits__ = ['Maksym Ustymenko', ] __version__ = '0.0.8'
Python
0
@@ -169,7 +169,7 @@ 0.0. -8 +9 '%0A
f28459497dbfa0535323cce52a4ea4dc2daa2bf9
fix pylint in setup
python-package/setup.py
python-package/setup.py
# pylint: disable=invalid-name """Setup xgboost package.""" from __future__ import absolute_import import sys from setuptools import setup, find_packages import subprocess sys.path.insert(0, '.') import os #build on the fly if install in pip #otherwise, use build.sh in the parent directory if 'pip' in __file__: i...
Python
0.000001
@@ -23,16 +23,27 @@ lid-name +, exec-used %0A%22%22%22Setu
96722247494f5a8edf23499a3e5bdc26fef87eaa
Add a 'default' argument.
python/argparse/test.py
python/argparse/test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org) # 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 withou...
Python
0.000003
@@ -3435,17 +3435,51 @@ t option -%22 + (default: 3)%22, type=int, default=3 , metava @@ -3489,26 +3489,16 @@ INTEGER%22 -, type=int )%0A pa
7545fa1787461a19c5ece7cac6bf6e7bcec0299a
Add Vote.value column
pikyak_app.py
pikyak_app.py
#!/usr/bin/python2 from flask import Flask, request, g, jsonify, url_for from flask.ext.sqlalchemy import SQLAlchemy from flask.ext.httpauth import HTTPBasicAuth from sqlalchemy import exc, exists from sqlalchemy.orm.exc import NoResultFound from passlib.hash import sha256_crypt as crypt import os app = Flask(__name_...
Python
0.000001
@@ -2791,32 +2791,84 @@ ullable = False) +%0A value = db.Column(db.Integer, nullable = False) %0A%0A def __init @@ -3044,16 +3044,55 @@ ost_id') +%0A self.value = args.get('value') %0A%0A# Auth
6cb5c6f14c66b5f21214cfc4aa3e08e1f113c856
add ds9 fits parser
ds9/parsers/fitsparser.tac
ds9/parsers/fitsparser.tac
%{ %} #include string.tin %start command %token MASK_ %token NEW_ %token SLICE_ %% # XPA/SAMP only command : fits ; fits: NEW_ {CreateFrame; FitsCmdLoad {} {} {}} | new STRING_ {FitsCmdLoad $2 {} {}} | new MASK_ STRING_ {FitsCmdLoad $3 mask {}} | new SLICE_ STRING_ {FitsCmdLoad $3 {} slice} | new MASK_ SLIC...
Python
0.000001
@@ -127,63 +127,20 @@ ts: -NEW_ %7BCreateFrame; FitsCmdLoad %7B%7D %7B%7D %7B%7D%7D%0A %7C new STRING_ +new filename %7BFi @@ -172,23 +172,24 @@ w MASK_ -STRING_ +filename %7BFitsCm @@ -212,39 +212,40 @@ %7D%0A %7C new SLICE_ -STRING_ +filename %7BFitsCmdLoad $3 @@ -279,15 +279,16 @@ CE_ -STRING_ +filenam...
7d1527b4d6e874ce06ed2bc329c3c0f5555cd2a4
revise parallel model file
pjit_model.py
pjit_model.py
from functools import partial import numpy.random as npr import jax.numpy as np from jax import lax from jax import pjit, grad ### set up some synthetic data rng = npr.RandomState(0) R = lambda *shape: rng.randn(*shape).astype("float32") layer_sizes = [3, 2] params = [(R(m, n), R(n)) for m, n in zip(layer_sizes[:-...
Python
0
@@ -115,18 +115,26 @@ ort -pjit, grad +grad, pjit, papply %0A%0A%0A# @@ -881,143 +881,8 @@ ly%0A%0A -def predict(params, inputs):%0A for W, b in params:%0A outputs = np.dot(inputs, W) + b%0A inputs = np.tanh(outputs)%0A return outputs%0A%0A def @@ -2036,38 +2036,286 @@ ram -automagically with papply%0A%...
10b1e000240cd9670e502a2a66c5ab85734c2152
Remove host to ip
python/hacker/config.py
python/hacker/config.py
__author__ = 'shijianliu' host = 'http://music.liverliu.com' server_host='127.0.0.1' server_port=80
Python
0.000001
@@ -39,26 +39,21 @@ p:// -music.liverliu.com +223.252.199.7 '%0A%0As
3b237d7ef2c418cfcf361f8d9ca32806a265f823
Rename class
rdmo/core/swagger.py
rdmo/core/swagger.py
from django.conf.urls import include, url from rdmo.accounts.urls import accounts_patterns_api from rdmo.conditions.urls import conditions_patterns_api from rdmo.domain.urls import domain_patterns_api from rdmo.options.urls import options_patterns_api from rdmo.projects.urls import projects_patterns_api from rdmo.ques...
Python
0.000001
@@ -1429,22 +1429,24 @@ ass -S +s wagger -S +_s chema -V +_v iew(
8c158debdfa575e7cae3487d8d1b7ba0b64afd42
add method to VisGraph, calling visible_vertices on a given point.
pyvisgraph/vis_graph.py
pyvisgraph/vis_graph.py
""" The MIT License (MIT) Copyright (c) 2016 Christian August Reksten-Monsen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights t...
Python
0
@@ -3683,24 +3683,165 @@ ge(edge)%0D%0A%0D%0A + def find_visible(self, point):%0D%0A %22%22%22Find vertices visible from point.%22%22%22%0D%0A%0D%0A return visible_vertices(point, self.graph)%0D%0A%0D%0A def upda
966fe99da944ee2864db8a35705c4e021bc29a98
Add median pivot point for quick sort
quick-sort/quicksort.py
quick-sort/quicksort.py
""" Quick Sort Implementation""" def sort(arr, l=None, r=None): """Sort Array""" # Init l and r, if not provided if l is None: l = 0 if r is None: r = len(arr) - 1 # Check for Base case if l >= r: # Length equal 1 return p = getP(arr, l, r) # Swap p with firs...
Python
0.000002
@@ -1126,16 +1126,660 @@ # Last element%0A + # return medianPivotPoint(arr, l, r)%0A%0Adef medianPivotPoint(arr, l, r):%0A arrLength = len(arr)%0A if arrLength %3C 3:%0A return l%0A left = arr%5Bl%5D%0A right = arr%5Br%5D%0A%0A if arrLength %25 2 == 0: # Even%0A middleIndex = arrLength...
9e1598a5e6cff2af8d1d580c1de617e9bfdeba34
replace win_list to reduce test noise
source/referee_chair.py
source/referee_chair.py
from facilitator_credentials import Facilitator from game_table import TableTop from player_chair import * from announcer_chair import Announcer class Referee(Facilitator): def __init__(self, table_top, player1, player2): self.announcer = Announcer() self.table_top = table_top self.player1...
Python
0.000001
@@ -1945,27 +1945,94 @@ t = -self.get_win_list() +%5B%5B0,1,2%5D,%5B3,4,5%5D,%5B6,7,8%5D,%5B0,3,6%5D,%0A %5B1,4,7%5D,%5B2,5,8%5D,%5B0,4,8%5D,%5B2,4,6%5D%5D %0A @@ -2087,19 +2087,18 @@ (0, len( -sca +wi n_list)) @@ -2151,11 +2151,10 @@ in -sca +wi n_li
63a2076d09f47599c9c9193ac44c91c0167928c1
Change template name in hujibot_25
HujiBot/hujibot_25.py
HujiBot/hujibot_25.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ hujibot_25 - a script that moves certain templates to the article talk page usage: python pwb.py hujibot_25 """ # # (C) w:fa:User:Huji, 2021 # # Distributed under the terms of the MIT license. # import pywikibot from pywikibot import pagegenerators from pywikibot.b...
Python
0
@@ -2624,11 +2624,13 @@ ot(' -%D8%B9%DA%A9%D8%B3 +%D8%AA%D8%B5%D9%88%DB%8C%D8%B1 -%D9%86%DB%8C%D8%A7 @@ -2740,33 +2740,8 @@ le)%0A - bot.treat_page(page)%0A %0A%0Aif
9aabda0e489639a753d6589e9d0f7923505643cb
Update parseSecure.py
parseSecure.py
parseSecure.py
#!/usr/bin/python import time import re import subprocess import os def follow(thefile): thefile.seek(0,2) while True: line = thefile.readline() if not line: time.sleep(0.1) continue yield line if __name__ == '__main__': logfile = open("/var/log/secure","r") ...
Python
0
@@ -61,16 +61,29 @@ port os%0A +import iptc%0A%0A def foll @@ -714,17 +714,16 @@ %0A - if count @@ -732,219 +732,375 @@ 4:%0A - count = 0%0A ipString = str(ipNew)%0A subprocess.call(%5B%22iptables -A INPUT -s %22, ipString,%22 -j +%09%09count = 0%0A%09%09ipStr...
09bfdd6334c5a93d7781f21ebed7542d29b1774e
add quotes for path in verbose message
easy_karabiner/__main__.py
easy_karabiner/__main__.py
# -*- coding: utf-8 -*- """A tool to generate key remap configuration for Karabiner Usage: easy_karabiner [-evr] [SOURCE] [TARGET | --string] easy_karabiner [--help | --version] """ from __future__ import print_function import os import click from hashlib import sha1 from subprocess import call from easy_karab...
Python
0.000001
@@ -2277,17 +2277,17 @@ int( -%22 +' Execute %25s%22 @@ -2282,19 +2282,21 @@ Execute +%22 %25s%22 +' %25 confi @@ -2511,42 +2511,27 @@ int( -%22 +' Write -generated XML config +XML to +%22 %25s%22 +' %25 o
5006ba3124cd80a4529b9ed645aa8981d06a9886
Stop generate feeds when publishing
publishconf.py
publishconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. import os import sys sys.path.append(os.curdir) from pelicanconf import * SITEURL = '' RELATIVE_URLS = False FEED_ALL_ATOM = 'fee...
Python
0.000001
@@ -18,74 +18,9 @@ thon -%0A# -*- coding: utf-8 -*- #%0Afrom __future__ import unicode_literals +3 %0A%0A# @@ -232,87 +232,8 @@ se%0A%0A -FEED_ALL_ATOM = 'feeds/all.atom.xml'%0ACATEGORY_FEED_ATOM = 'feeds/%25s.atom.xml'%0A%0A DELE
58fdc741d01ad6f19135fca8230bc47623f2b1f6
Add Google Group to Links
pelicanconf.py
pelicanconf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # from __future__ import unicode_literals AUTHOR = u'DIANA HEP' SITENAME = u'DIANA HEP' SITEURL = '' TIMEZONE = 'Europe/Paris' DEFAULT_LANG = u'en' # Feed generation is usually not desired when developing FEED_ALL_ATOM = None CATEGORY_FEED_ATOM = None TRANSLATION_FEED_A...
Python
0
@@ -1127,24 +1127,105 @@ ry/7192/'),%0A + ('Google Group', 'https://groups.google.com/forum/#!forum/diana-hep'),%0A ('
7e9ff1866c6c640e8709a16f783805bc935e198f
Rename options to user_options.
penchy/jvms.py
penchy/jvms.py
""" This module provides JVMs to run programs. """ import os import shlex from penchy.maven import get_classpath class JVM(object): """ This class represents a JVM. """ def __init__(self, path, options=""): """ :param path: path to jvm executable relative to basepath :param ...
Python
0
@@ -471,21 +471,100 @@ -self. +# XXX: a passed classpath must be filtered and readded before run%0A self.user_ options
ddd3373ce078cf9bf40da7ebd8591995e819b750
Add function to swap byte order
phell/utils.py
phell/utils.py
# -*- coding: utf-8 -*- # # (c) 2016 Björn Ricks <bjoern.ricks@gmail.com> # # See LICENSE comming with the source of 'phell' for details. # import sys def to_hex(value): if sys.version_info.major < 3: return value.encode('hex') return "".join("%02x" % b for b in value) def from_hex(value): if sy...
Python
0.000004
@@ -407,16 +407,169 @@ value)%0A%0A +def swap_bytes(value):%0A if sys.version_info.major %3C 3:%0A return %22%22.join(%5Bbytes(b) for b in reversed(value)%5D)%0A return bytes(reversed(value))%0A%0A # vim: s
63b5362e4ba531544ea732c1daaaca920e73e936
Extend nice regex
phenny/suck.py
phenny/suck.py
#!/usr/bin/env python # coding=utf-8 import time import random ACTION = chr(1) + "ACTION " AFIN = chr(1) NICE_CHOICES = ['Aww, ik vind jou lief, %s!', ACTION + ' knuffelt %s' + AFIN, '%s: jij bent officieel cool!', ACTION + ' knuffelt %s plat' +AFIN, '...
Python
0.000003
@@ -1544,16 +1544,25 @@ '( +leuk%7Ctof%7C lief%7Caar
ef577700b2174def1535e2e35e744d38b44b5855
Make cli.py PEP-8 compatible
py2deb/cli.py
py2deb/cli.py
# Command line interface for the `py2deb' program. # # Author: Peter Odding <peter@peterodding.com> # Last Change: June 5, 2014 # URL: https://py2deb.readthedocs.org """ Usage: py2deb [OPTIONS] ... Convert Python packages to Debian packages according to the given command line options (see below). The positional argum...
Python
0.000002
@@ -3719,16 +3719,17 @@ ame__)%0A%0A +%0A def main @@ -6427,16 +6427,17 @@ xit(1)%0A%0A +%0A def usag @@ -6902,16 +6902,17 @@ ines))%0A%0A +%0A # vim: t
eba9a9703b65f0bb360c136b61cc83687c93452a
Implement earth.rate_n
pyins/earth.py
pyins/earth.py
"""Earth geometry and gravity models.""" import numpy as np from . import dcm from . util import mv_prod #: Rotation rate of Earth in rad/s. RATE = 7.2921157e-5 #: Schuller frequency. SF = 1.2383e-3 #: Approximate value of gravity. G0 = 9.8 #: Semi major axis of Earth ellipsoid (or radius of Earth approximately). R0 ...
Python
0.999611
@@ -3704,8 +3704,453 @@ result%0A +%0A%0Adef rate_n(lat):%0A %22%22%22Compute Earth rate resolved in ENU frame.%0A%0A Parameters%0A ----------%0A lat : array_like%0A Latitude.%0A%0A Returns%0A -------%0A earth_rate_n : ndarray%0A %22%22%22%0A lat = np.asarray(lat)%0A n = 1 if lat....
7b5b1153ed2500161ca9ee81d2cde51a05660913
fix status command
reports/management/commands/status.py
reports/management/commands/status.py
import csv import os import sys import requests from django.core.management.base import BaseCommand from six import StringIO from reports.models import Report from reports.utils import module_name_to_division_id class Command(BaseCommand): args = '<population-threshold module module ...>' help = 'Reports sta...
Python
0.000002
@@ -427,16 +427,42 @@ ers'))%0A%0A + args = list(args)%0A @@ -482,16 +482,20 @@ rgs and +int( args.pop @@ -497,16 +497,17 @@ s.pop(0) +) or 5000 @@ -508,17 +508,16 @@ r 50000%0A -%0A
5f12cb04d892d1a3c5ac09cc68d08524df72cf27
fix all_rows
reports/management/commands/upload.py
reports/management/commands/upload.py
# coding: utf-8 from __future__ import unicode_literals import codecs import csv import importlib import logging import os import re import sys from boto.s3.connection import S3Connection from boto.s3.key import Key from django.core.management.base import BaseCommand from django.template.defaultfilters import slugify...
Python
0.999945
@@ -2250,16 +2250,20 @@ .error(' +%7B%7D: UnicodeE @@ -2285,16 +2285,21 @@ .format( +key, e))%0A @@ -8218,16 +8218,44 @@ report)%0A + all_rows += rows %0A @@ -8350,41 +8350,8 @@ ount -%0A all_rows += rows %0A%0A
4ac8d799aa6b272aefdfb6a10100475dad8f8f56
change name of age standardized rate model to model.asr
dismod_mr/model/__init__.py
dismod_mr/model/__init__.py
import likelihood, spline, age_groups, priors, covariates, process from process import age_specific_rate, consistent from covariates import predict_for
Python
0
@@ -97,16 +97,23 @@ fic_rate + as asr , consis
d9d8fad9f17907f349fa3c483f0409ed5105352c
Fix typos and missing imports
job-logs/python/generate_submit.py
job-logs/python/generate_submit.py
#!/usr/bin/env python import sys import datetime import urllib2 import os import argparse JOB_LOG_URL = "http://atlas-panda-jobsarchived.s3.amazonaws.com/" CONDOR_SUBMIT_TEMPLATE = "../condor/submit_template" def validate_date(arg): """ Validate that text string provided is a valid date """ if len(ar...
Python
0.998521
@@ -83,16 +83,46 @@ argparse +%0Aimport tempfile%0Aimport shutil %0A%0AJOB_LO @@ -2692,21 +2692,16 @@ sed_file -_file ), 'w')%0A
1408a2fca6127e3fb090b64fc012b21530ae4c0f
Fix severe floating point bug
py-backend/server.py
py-backend/server.py
#!/usr/bin/python import os from flask import Flask, request, json, Response from flask_jwt import JWT, jwt_required, current_identity import hashlib from datetime import timedelta import deptCalculator import storage ''' Simple Flask-API for serving requests. API offers stuff like calculating depts among people o...
Python
0.000035
@@ -215,16 +215,39 @@ torage%0A%0A +from decimal import *%0A%0A %0A'''%0ASim @@ -2469,13 +2469,15 @@ t = -float +Decimal (jso @@ -2498,16 +2498,33 @@ mount')) + * Decimal('100') %0A if @@ -2760,14 +2760,8 @@ ount - * 100 ))%0A
78d7162d05d8f288ba9a162ef9e610efa5344e2e
use models folder by default in rank_models
rank_models.py
rank_models.py
#!/usr/bin/env python """ Rank all available models @copyright: The Broad Institute of MIT and Harvard 2015 """ import os, glob, argparse import operator var_file = "./data/variables.txt" def load_vars(fn): res = [] if not os.path.exists(fn): fn = var_file with open(fn, "rb") as vfile: f...
Python
0
@@ -1413,16 +1413,8 @@ nt(' --B', '-- base @@ -1441,16 +1441,22 @@ ult=%5B%22./ +models %22%5D,%0A @@ -1481,22 +1481,17 @@ lp=%22 -Base d +D irectory %22)%0Ap @@ -1486,16 +1486,35 @@ irectory + to look for models %22)%0Aparse
886a55cde5b2463878ffc95a91b7f3c6b715fcf3
更新 modules main/signals.py, 修正 PEP8 警告
commonrepo/main/signals.py
commonrepo/main/signals.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import from actstream import action from actstream import registry from django_comments.signals import comment_was_posted from threadedcomments.models import ThreadedComment # Comment has been registeded with actstream.registry.register def com...
Python
0
@@ -306,16 +306,18 @@ egister%0A +%0A%0A def comm @@ -392,16 +392,25 @@ on.send( +%0A request. @@ -414,16 +414,24 @@ st.user, +%0A verb='p @@ -445,16 +445,24 @@ omment', +%0A action_ @@ -476,16 +476,24 @@ comment, +%0A target=
42c78e5f48f9a3fb3b2b6dd06a2f199a93bc7c72
Check the address
continuousintegration.py
continuousintegration.py
import socket import requests import sys from globalvars import GlobalVars def watchCi(): HOST = '' PORT = 49494 s=socket.socket(socket.AF_INET, socket.SOCK_STREAM) print "CI Socket Created" try: s.bind((HOST, PORT)) except socket.error as msg: print 'Bind Failed. Error code: ...
Python
0.000006
@@ -871,17 +871,32 @@ CircleCI -%22 + from %25s%22 %25 addr )%0A
1fe2640a229c4ee48b9d1d5241b81ac36cbd1661
add docstrings for public methods
pyvka/auth.py
pyvka/auth.py
from urlparse import urlparse, parse_qsl from urllib import urlencode, unquote_plus import requests from .config import CONFIG from .exceptions import AuthError class VKAuth(object): def __init__(self, config={}): self.access_token = '' self.used_id = 0 self.config = CONFIG self...
Python
0
@@ -184,43 +184,182 @@ t):%0A -%0A def __init__(self, config=%7B%7D): + %22%22%22%0A Class for get access_token for vkontakte api.%0A %22%22%22%0A%0A def __init__(self, config=%7B%7D):%0A %22%22%22%0A Method support set custom configuration%0A %22%22%22%0A %0A @@ -543,32 +543,10...
5656eb24e50a753aa442944ee73dd944b01d43ed
Bump version number
datac/__init__.py
datac/__init__.py
# -*- coding: utf-8 -*- """ Base Library (:mod:`datac`) =========================== .. currentmodule:: datac """ from datac import Datac __version__ = "0.1.0"
Python
0.000002
@@ -154,9 +154,9 @@ %220. -1 +2 .0%22%0A
9f140946dad470756d0e8cdc7f85836895274a7a
remove unnecessary sort, in namesort code
doc/tools/reportificate.py
doc/tools/reportificate.py
#!/usr/bin/python # # github API abusing script for report metrics # # C. Orchard - 29/11/2012 # import itertools import requests import getpass import tempfile import os import dateutil.parser import datetime import percache import keyring import httplib import matplotlib.pyplot as plt import numpy as np from oper...
Python
0.000006
@@ -5213,35 +5213,8 @@ a))%0A - namecount%5Bname%5D.sort()%0A %0A%0Ana
f5ee9a1e517a890f0372894479202c5b2b67774c
Increase size and number of log files (at 100000 bytes and 10 files, we only had a few days worth when full of debugging info)
portal/app.py
portal/app.py
"""Poral module""" from logging import handlers import logging import os import sys from flask import Flask from .audit import configure_audit_log from .config import DefaultConfig from .extensions import celery, db, mail, oauth, user_manager from .views.api import api from .views.auth import auth from .views.portal i...
Python
0
@@ -2586,16 +2586,17 @@ s=100000 +0 , backup @@ -2601,17 +2601,17 @@ upCount= -1 +2 0)%0A i
426b3f8e523fb487a86d1b0b1a25029476a07b26
version change to 1.1.5
spellbooker/__init__.py
spellbooker/__init__.py
VERSION = '1.1.4'
Python
0.000069
@@ -12,7 +12,7 @@ 1.1. -4 +5 '%0A
ab3353990e654386162e95937c51ef9cc4d58dc4
Update util.py
redis_pubsub/util.py
redis_pubsub/util.py
import functools as ft import asyncio import json try: from django.db.models.loading import get_model except ImportError: from django.apps import apps get_model = apps.get_model import redis import aioredis from . import REDIS_PUBSUB from .compat import ensure_future __all__ = ( "ASYNCREDIS", "SYNC...
Python
0
@@ -6177,27 +6177,16 @@ future = - yield from asyncio @@ -6204,16 +6204,40 @@ routines +, return_exceptions=True )%0A%0A @