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
30179b9aeaaae99fb709147f8ef6d60efa8fae96
allow unset DEBUG in env
tgrsite/settings.py
tgrsite/settings.py
""" Django settings for tgrsite project. Generated by 'django-admin startproject' using Django 1.10.2. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os...
Python
0
@@ -1012,16 +1012,25 @@ ariable%0A +try:%0A if os.en @@ -1055,16 +1055,20 @@ 'True':%0A + DEBU @@ -1080,12 +1080,55 @@ rue%0A -else + else:%0A DEBUG = False%0Aexcept KeyError :%0A @@ -1250,16 +1250,29 @@ p.co.uk' +, 'localhost' %5D%0A%0A# App
aec4647e7599979de06952739459376c87fdb7ee
switch mime-type from text/plain to kml
lingcod/studyregion/views.py
lingcod/studyregion/views.py
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest, HttpResponseServerError, HttpResponseForbidden from django.template import RequestContext from django.shortcuts import get_object_or_404, render_to_response from lingcod.common import mimetypes from lingcod.common.utils import KmlWr...
Python
0.000042
@@ -848,36 +848,37 @@ ontent_type= -'text/plain' +mimetypes.KML ) %0D%0A %0D%0A @@ -1193,28 +1193,29 @@ nt_type= -'text/plain' +mimetypes.KML ) %0D%0A @@ -1483,18 +1483,19 @@ ype= -'text/plain' +mimetypes.KML )
80caf89a7279daf0803d6c07a0014445d5dc761c
Remove `delete-merged` option from validate
lobster/commands/validate.py
lobster/commands/validate.py
import logging from lobster import fs from lobster.core.command import Command from lobster.core.unit import UnitStore logger = logging.getLogger('lobster.validate') class Validate(Command): @property def help(self): return 'validate task output and remove output files for failed tasks' def s...
Python
0
@@ -521,203 +521,8 @@ ed') -%0A argparser.add_argument('--delete-merged', action='store_true', dest='delete_merged', default=False,%0A help='remove intermediate files that have been merged') %0A%0A @@ -2218,28 +2218,8 @@ %5B%5D%0A - merged = %5B%5D%0A @@ -2964,22 ...
dccebd6b6a679adf052e0809dbd6c253b4b980aa
Remove oooq -nv jobs
tripleoci/config.py
tripleoci/config.py
import logging import os logging.basicConfig( format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') log = logging.getLogger('watchcat') log.setLevel(logging.DEBUG) DIR = os.path.dirname(os.path.realpath(__file__)) # https://github.com/openstack-infra/project-config/blob/master/ # gerritbot/channels.yaml ...
Python
0.000001
@@ -4123,64 +4123,8 @@ v%22,%0A - %22gate-tripleo-ci-centos-7-nonha-multinode-oooq-nv%22,%0A
0c413737488895dcd7bcc55014e6d51fb3b29c7b
Update MWAA per 2021-06-21 changes
troposphere/mwaa.py
troposphere/mwaa.py
# Copyright (c) 2012-2018, Mark Peek <mark@peek.org> # All rights reserved. # # See LICENSE file for full license. from . import AWSObject, AWSProperty, Tags from .validators import boolean, integer class UpdateError(AWSProperty): props = { "ErrorCode": (str, False), "ErrorMessage": (str, False),...
Python
0
@@ -1923,32 +1923,72 @@ : (str, False),%0A + %22Schedulers%22: (integer, False),%0A %22SourceB
ecc8c7c0bc869e9afa82a941586c840e80d91ba8
Improve docstring
txscrypt/wrapper.py
txscrypt/wrapper.py
""" Wrapper around scrypt. """ import os import scrypt from twisted.cred import error from twisted.internet import threads NONCE_LENGTH = 64 MAX_TIME = .1 def verifyPassword(stored, provided): """ Verifies that the stored derived key was computed from the provided password. Returns a deferred that...
Python
0.000032
@@ -1009,16 +1009,127 @@ assword. +%0A%0A Returns a deferred that will fire with %60%60True%60%60 (if the password was%0A correct) or %60%60False%60%60 otherwise. %0A %22%22%22
2bc2736da4e3aa6aa41fe21942217d49a8fc9110
Fix neighutil invocation of ipn_is_local
confluent_server/confluent/neighutil.py
confluent_server/confluent/neighutil.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2016 Lenovo # # 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 ...
Python
0.998521
@@ -3484,16 +3484,17 @@ tutil.ip +n _is_loca @@ -3844,8 +3844,9 @@ gv%5B1%5D))) +%0A
052b515947780e8d3ca3b8fc6367317c1c9d7d71
Change to imports to follow the style guide: http://code.google.com/p/soc/wiki/PythonStyleGuide#Module_and_package_imports
app/soc/views/helpers/custom_widgets.py
app/soc/views/helpers/custom_widgets.py
#!/usr/bin/python2.5 # # Copyright 2008 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
Python
0
@@ -710,16 +710,30 @@ ',%0A %5D%0A%0A +%0Aimport copy%0A%0A from dja @@ -785,24 +785,16 @@ orms -.widgets import flat @@ -789,23 +789,20 @@ import -flatatt +util %0Afrom dj @@ -818,21 +818,16 @@ orms -.util import smar @@ -822,29 +822,23 @@ import -smart_unicode +widgets %0Afrom dj @@ -851,21 +851,...
ff8de93d1c06667472a0577ebe15fb41668a8c1d
Remove debug output
upstream/clitool.py
upstream/clitool.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # The MIT License (MIT) # # Copyright (c) 2014 Paul Durivage for Storj Labs # # 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 restrictio...
Python
0.000037
@@ -3446,28 +3446,8 @@ s):%0A - print shard%0A
c0933cd553043858f0a996edca2f4dc1b1da78c9
clarify comment
usefullFunctions.py
usefullFunctions.py
#!/usr/bin/python3.4 # -*-coding:Utf-8 -* import time def now(short = True): '''return short (HH:MM:SS) or long (DD.MM.AAAA-HH:MM:SS) formated current date strings''' if short == True: return time.strftime('%H:%M:%S') else: return time.strftime('%d.%m.%Y-%H:%M:%S') def columnLimit(value, limit, begin = Tru...
Python
0.000001
@@ -84,21 +84,50 @@ 'return -short +current date in short or long form (HH:MM: @@ -132,19 +132,12 @@ M:SS -) or -long ( DD.M @@ -156,38 +156,8 @@ :SS) - formated current date strings '''%0A
2462c55041c1b2345839c0858ef5722ab3f29495
fix image upload
usermedia/models.py
usermedia/models.py
from __future__ import unicode_literals from django.utils.encoding import python_2_unicode_compatible import os import uuid from django.db import models from django.contrib.auth.models import User from django.db import IntegrityError from PIL import Image as PilImage try: # Python 2 from StringIO import Stri...
Python
0
@@ -117,16 +117,73 @@ ort uuid +%0Afrom PIL import Image as PilImage%0Afrom io import BytesIO %0A%0Afrom d @@ -249,16 +249,16 @@ rt User%0A + from dja @@ -289,160 +289,8 @@ rror -%0A%0Afrom PIL import Image as PilImage%0Atry:%0A # Python 2%0A from StringIO import StringIO%0Aexcept ImportError:%0A # Python...
4da8a2ae2e2ae428c3c4b834350069598e1fe123
Fix string removal
metafetishbot/definitions.py
metafetishbot/definitions.py
from telegram.ext import CommandHandler from .base import MetafetishPickleDBBase import cgi class DefinitionManager(MetafetishPickleDBBase): def __init__(self, dbdir, cm): super().__init__(__name__, dbdir, "definitions", True) self.cm = cm def register_with_dispatcher(self, dispatcher): ...
Python
0.000054
@@ -5012,162 +5012,75 @@ at! -The term %3Ci%3E%25s%3C/i%3E is now defined as:%5Cn%5Cn%22 %25 (def_name)%0A update_msg += self.get_definition_list(def_name)%0A update_msg += %22%5CnAll done! /help%22 +Index %25d has been removed from term %3Ci%3E%25s%3C/i%3E.%22 %25 (index, def_name) %0A
ab469b45eae773e8b16491a5155470a02af0fb7e
Exit outside curl cli function.
uwsgi_tools/curl.py
uwsgi_tools/curl.py
import socket from .compat import urlsplit from .utils import pack_uwsgi_vars, parse_addr, get_host_from_url def ask_uwsgi(uwsgi_addr, var, body='', timeout=0, udp=False): sock_type = socket.SOCK_DGRAM if udp else socket.SOCK_STREAM if isinstance(uwsgi_addr, str) and '/' in uwsgi_addr: addr = uwsgi_ad...
Python
0
@@ -7,16 +7,27 @@ socket%0A +import sys%0A from .co @@ -1868,31 +1868,16 @@ argparse -%0A import sys %0A%0A pa @@ -3044,22 +3044,8 @@ urn -sys.exit(0 if 200 @@ -3063,16 +3063,8 @@ 300 - else 1) %0A%0A%0Ai @@ -3097,22 +3097,24 @@ -import sys%0A +sys.exit(int(not cli @@ -3116,21 +3116,23 @@ ...
7b47a35ef77a71bc20570453d242f755e575d35a
Refactor index().
viewer/web/views.py
viewer/web/views.py
""" viewer.web.views ~~~~~~~~~~~~~~~~ Views for the web. :copyright: © 2014 by Petr Zemek <s3rvac@gmail.com> and contributors :license: BSD, see LICENSE for more details """ from flask import render_template from flask import g from viewer import git from . import app @app.before_request def b...
Python
0
@@ -416,24 +416,79 @@ ():%0A +context = %7B%0A 'repo_name': g.repo.name,%0A ' branches = g.rep @@ -479,18 +479,18 @@ branches - = +': g.repo. @@ -538,16 +538,22 @@ MOTE'%5D)%0A + %7D%0A retu @@ -589,46 +589,15 @@ l', -repo_name=g.repo.name, branches=branches +**context )%0A
3a60636f269a02ac3856c310e6035e924e6af174
make extract and list actions mutually exclusive
vimball/__init__.py
vimball/__init__.py
import argparse import bz2 import errno import gzip import os import re import sys import tempfile from vimball._version import __version__ from vimball.exceptions import NoFilesFound from vimball.utils import mkdir_p class Vimball: def __init__(self, filepath, extractdir=None, verbose=False): self.filep...
Python
0.999578
@@ -3437,231 +3437,8 @@ =1)%0A - parser.add_argument('-x', '--extract', action='store_true',%0A help='extract files from a vimball archive')%0A parser.add_argument('-l', '--list', action='store_true',%0A help='list files a vimball archive')%0A @@ -3688,24 +3688,302 @@ irectory')%0A%0A + a...
e9bf19dbacbfc9986956d2289257573264ce6cc3
Update organize.py
virtool/organize.py
virtool/organize.py
import logging import os import pymongo.errors import shutil import virtool.db.references import virtool.db.utils import virtool.references import virtool.users import virtool.utils logger = logging.getLogger(__name__) REFERENCE_QUERY = { "reference": { "$exists": False } } async def add_original_r...
Python
0.000001
@@ -5121,16 +5121,76 @@ %22hmm%22,%0A + %22installed%22: None,%0A %22process%22: None,%0A
3b8436fd182cbba395741621af9ce41607421b9f
Improve detection of host architecture.
vlfeat/vl_ctypes.py
vlfeat/vl_ctypes.py
from ctypes import (cdll, sizeof, Structure, c_float, c_double, c_int, c_int8, c_int16, c_int32, c_int64, c_uint, c_uint8, c_uint16, c_uint32, c_uint64) import numpy as np import platform import os def load_library(version="0.9.16"): filenames = { ("Linux", "32bit"): "libvl-x86.so", ...
Python
0
@@ -156,16 +156,29 @@ c_uint64 +,%0A c_voidp )%0A%0Aimpor @@ -287,15 +287,10 @@ x%22, -%22 32 -bit%22 ): %22 @@ -336,15 +336,10 @@ x%22, -%22 64 -bit%22 ): %22 @@ -404,34 +404,27 @@ (), -platform.architecture()%5B0%5D +8 * sizeof(c_voidp) )%5D%0A @@ -4028,113 +4028,123 @@ ##%0A%0A -# TODO actually fig...
ce18939a9ee952906677b7a6be8a42e06dc21fb0
Update Matrices
vulk/math/matrix.py
vulk/math/matrix.py
'''Matrix module This module contains all class relative to Matrix ''' import numpy as np class Matrix(): '''Base class for Matrix''' def __init__(self, values): self._values = np.array(values, dtype=np.float32) @property def values(self): return self._values class Matrix3(Matrix):...
Python
0
@@ -196,13 +196,14 @@ np. -array +matrix (val @@ -291,16 +291,183 @@ values%0A%0A + def set(self, values, offset=0):%0A self._values%5Boffset:%5D = values%0A%0A def mul(self, matrix):%0A self._values = np.matmul(self._values, matrix.values)%0A%0A %0Aclass M @@ -498,32 +498,77 @@ atrix3 class''...
0c4d2e99d5b2ffef043ec8b35d47ee49f0d382f7
Clean processors
src/processors.py
src/processors.py
import numpy as np class FourierTransform: def __init__(self, real=True, timestep=1): # Define helpers self.fft = np.fft.rfft if real else np.fft.fft self.freq = np.fft.fftfreq self.shift = np.fft.fftshift self.real = real self.timestep = timestep d...
Python
0.000001
@@ -312,31 +312,28 @@ %0A def -process +work (self, data) @@ -685,34 +685,31 @@ def -process +work (self, -x, y +A, B ):%0A @@ -715,338 +715,60 @@ -_x = sum(x)/len(x)%0A _y = sum(y)/len(y)%0A %0A a_num = 0%0A a_den = 0%0A for i in range(len(x)):%0A ...
39cfae32ea9fcb2c45c22c0727e5625f6063669e
fix imports
src/smash/venv.py
src/smash/venv.py
""" smash.venv """ import os import sys get_path = lambda: os.environ['PATH'] get_venv = lambda: os.environ['VIRTUAL_ENV'] to_vbin = lambda venv: os.path.join(venv, 'bin') def is_venv(dir): """ naive.. seems to work TODO: find a canonical version of this function or refine it """ y = 'lib b...
Python
0.000002
@@ -3431,35 +3431,30 @@ from -ipy_ +smash. project -_manager +s import
2fdf35f8a9bf7a6249bc92236952655314a47080
Add author and lincense variables
swapify/__init__.py
swapify/__init__.py
# -*- encoding: utf-8 -*- __version__ = VERSION = '0.0.0'
Python
0
@@ -20,16 +20,48 @@ -8 -*-%0A%0A +__author__ = 'Sebastian Vetter'%0A __versio @@ -83,8 +83,29 @@ '0.0.0' +%0A__license__ = 'MIT'%0A
2b791865c454f3bd08aa16431ef506305f712609
version bump
synapse/__init__.py
synapse/__init__.py
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2018 New Vector Ltd # # 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.000001
@@ -1006,7 +1006,10 @@ .33. -7 +8rc1 %22%0A
3f407cb30a60fcefb03e7fed8e83118a650d51d6
make everything a property
synthesizAR/loop.py
synthesizAR/loop.py
""" Class for an individual loop structure that is part of a larger active region. """ import os import numpy as np import astropy.units as u import h5py class Loop(object): """ Container for geometric and thermodynamic properties of a coronal loop Parameters ---------- name : `str` coordin...
Python
0.000066
@@ -1067,24 +1067,25 @@ self. +_ coordinates @@ -1116,24 +1116,25 @@ self. +_ field_streng @@ -1578,16 +1578,325 @@ 2f%7D'''%0A%0A + @property%0A def coordinates(self):%0A %22%22%22%0A World coordinates of loop%0A %22%22%22%0A return self._coordinates%0A%0A @prop...
cffca7b354847f299ed0c253e2ee209cd97efa6c
Update Ubuntu LTS ISO to 18.04.2
labs/stacktrain/distros/ubuntu_18_04_server_amd64.py
labs/stacktrain/distros/ubuntu_18_04_server_amd64.py
#!/usr/bin/env python # Force Python 2 to use float division even for ints from __future__ import division from __future__ import print_function import logging import os import re import sys import stacktrain.core.cond_sleep as cs import stacktrain.core.download as dl import stacktrain.core.keycodes as kc import sta...
Python
0.000001
@@ -1318,17 +1318,17 @@ u-18.04. -1 +2 -server- @@ -1367,40 +1367,40 @@ = %22 -e8264fa4c417216f4304079bd94f895e +34416ff83179728d54583bf3f18d42d2 %22%0A
c6ddb39477aedd0dd37ac65a2aa6c75714582881
append genotypes to new analyses when loading excel
taboo/load/excel.py
taboo/load/excel.py
# -*- coding: utf-8 -*- import os import logging import xlrd from taboo.compat import zip from taboo.exc import SexConflictError from taboo.store.models import Analysis, Genotype log = logging.getLogger(__name__) def load_excel(excel_file, include_key=None): """Load genotypes from an Excel file. 3. go ove...
Python
0.000001
@@ -1462,16 +1462,20 @@ for +new_ analysis @@ -1640,47 +1640,89 @@ -analysis.genotypes = list(new_genotypes +for genotype in new_genotypes:%0A new_analysis.genotypes.append(genotype )%0A @@ -1723,24 +1723,28 @@ pe)%0A +new_ analysis.sex @@ -1774,16 +1774,20 @@ yield +new_ analy...
f90588ea092e57ad26535163f42647d9f532eeeb
update import statement
armstrong/core/tt_sections/utils.py
armstrong/core/tt_sections/utils.py
from django.conf import settings from django.utils.importlib import import_module def get_module_and_model_names(): s = (getattr(settings, "ARMSTRONG_SECTION_ITEM_MODEL", False) or "armstrong.apps.content.models.Content") return s.rsplit(".", 1) def get_item_model_class(): module_name, class...
Python
0
@@ -48,17 +48,22 @@ ils. -importlib +module_loading imp
bb05f21ca47f636197764fb9518282318270d663
Add tests around hatband.autodiscover functionality
armstrong/hatband/tests/__init__.py
armstrong/hatband/tests/__init__.py
from pkgutil import extend_path __path__ = extend_path(__path__, __name__) from .widgets import *
Python
0
@@ -78,22 +78,3092 @@ rom -.widgets import * +contextlib import contextmanager%0Aimport fudge%0A%0Afrom .widgets import *%0A%0Afrom ... import hatband%0A%0A%0Adef generate_random_registry():%0A from ._utils import random_range%0A return dict(%5B(%22key%25d%22 %25 i, i) for i in random_range()%5D)%0A%0A%0A@conte...
97889f7ea9a64a6f4e0a615de317d329720cc105
Replace two variables with one nested dict
scot/datasets.py
scot/datasets.py
# Released under The MIT License (MIT) # http://opensource.org/licenses/MIT # Copyright (c) 2016 SCoT Development Team from os import makedirs from os.path import expanduser, isfile, isdir, join from requests import get import numpy as np from .matfiles import loadmat from .eegtopo.eegpos3d import positions from . im...
Python
0.999468
@@ -376,20 +376,23 @@ data%22))%0A -file +dataset s = %7B%22mi @@ -393,16 +393,26 @@ = %7B%22mi%22: + %7B%22files%22: %5B%22motor @@ -428,20 +428,14 @@ at%22%5D -%7D%0Aurl = %7B%22mi +, %22url %22: %22 @@ -494,16 +494,17 @@ tdata/%22%7D +%7D %0A%0A%0Adef f @@ -1495,20 +1495,23 @@ not in -file +dataset s:%0...
18af4f3b6ead1e7090486676efeeada37a70b564
Build script tries to upload to pypi and tag git
scripts/build.py
scripts/build.py
import os import sys base_dir = os.path.join(os.path.dirname(__file__), '..') sys.path.insert(0, base_dir) import setup import git import subprocess from dropbox import client, rest # Dropbox auth details are not checked in, you must create # them locally according to your Dropbox developer account. try: from b...
Python
0
@@ -3523,16 +3523,109 @@ PyPI')%0A + subprocess.call(%5B'python', 'setup.py', 'sdist', '--formats=zip', 'upload'%5D, cwd=base_dir) %0A%0Adef ge @@ -4609,16 +4609,130 @@ patch)%0A%0A +def tag(version):%0A subprocess.call(%5B'git', 'tag', '-a', 'v%25s' %25 version, 'Release %25s' %25 version%5D, shell=True)%0A%...
515e782fb4508443a23a2e708f82a1b321c04482
replace sheet name spaces with underscores
tdb/crick_upload.py
tdb/crick_upload.py
import os, re, time, datetime, csv, sys, json from upload import upload from rethinkdb import r from Bio import SeqIO import argparse import subprocess from parse import parse from upload import parser sys.path.append('') # need to import from base from base.rethink_io import rethink_io from vdb.flu_upload import flu_...
Python
0
@@ -1667,24 +1667,220 @@ k.sheets():%0A + # Replace spaces with underscores in sheet name so that the call to%0A # elife_upload does not error out due to the space in --fstem%0A sheet.name = sheet.name.replace(' ', '_')%0A with
5687e1fc6c7748b915eb8105931ae65dc0b5ecd4
Fix log formatting
project_management/pmtools/__init__.py
project_management/pmtools/__init__.py
""" Pipeline Management Tools Usage: pm command [options] """ import os import re import argparse import textwrap from cement.core import foundation, controller, handler, backend ## I personally don't like the default help formatting output from ## argparse which I think is difficult to read ## Currently identical t...
Python
0.000005
@@ -4968,17 +4968,16 @@ path %25s%22 -, %25 d)%0A
91f8e139ab2924f0fd8e683298db1bbb303d15e7
fix linting
tdp_core/swagger.py
tdp_core/swagger.py
import json import logging from collections import OrderedDict from flask import render_template from jinja2 import Template from phovea_server.ns import Namespace, Response from . import db from .utils import secure_replacements __author__ = 'Samuel Gratzl' _log = logging.getLogger(__name__) app = Namespace('flask_s...
Python
0.000003
@@ -4140,17 +4140,16 @@ part)%0A%0A -%0A # post
4d1b3b2ae58f214d8d78e8b853c7cf5570c097ff
Update to guestagent #169
manifestspecific.py
manifestspecific.py
# Copyright (c) Citrix Systems Inc. # All rights reserved. # # Redistribution and use in source and binary forms, # with or without modification, are permitted provided # that the following conditions are met: # # * Redistributions of source code must retain the above # copyright notice, this list of conditions a...
Python
0
@@ -1579,17 +1579,17 @@ t.git%5C16 -8 +9 %5Cxengues
40897be402bd05ed5fb53e116f03d2d954720245
Fix plate-solving on local development mode
astrobin_apps_platesolving/utils.py
astrobin_apps_platesolving/utils.py
# Python import urllib2 # Django from django.conf import settings from django.core.files import File from django.core.files.temp import NamedTemporaryFile def getFromStorage(image, alias): url = image.thumbnail(alias) if "://" in url: url = url.split('://')[1] else: url = settings.BASE_UR...
Python
0.000003
@@ -185,16 +185,91 @@ alias):%0A + def encoded(path):%0A return urllib2.quote(path.encode('utf-8'))%0A%0A url @@ -293,16 +293,17 @@ (alias)%0A +%0A if %22 @@ -323,19 +323,167 @@ -url +# We are getting the full path and must only encode the part after the protocol%0A # (we assume ...
4c5bd1b9ecbc52b8eb8c3badb2889447c6cecc81
ADD button to product form
purchase_quotation_products/product.py
purchase_quotation_products/product.py
# -*- coding: utf-8 -*- ############################################################################## # For copyright and license notices, see __openerp__.py file in module root # directory ############################################################################## from openerp import models, fields, api from opene...
Python
0
@@ -302,17 +302,20 @@ lds, api +, _ %0A - from ope @@ -1848,16 +1848,394 @@ se'%5D))%0A%0A + # add button tu open form%0A placeholder = doc.xpath(%22//tree%22)%5B0%5D%0A placeholder.append(%0A etree.Element('button', %7B%0A 'name': 'action_product_f...
41cb93a625e732e40deb8b0d5db6a70a38bd8f60
fix settings.
pyexplain/pyexplain/settings/common.py
pyexplain/pyexplain/settings/common.py
# Common settings import os PROJECT_DIR = os.path.dirname(__file__) DEBUG = False TEMPLATE_DEBUG = DEBUG ADMINS = ( ('Lucas Magnum', 'contato@lucasmagnum.com.br'), ) DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': os.environ.get('EXPLAIN_DB'), 'USER': os.envi...
Python
0
@@ -385,16 +385,19 @@ EXPLAIN_ +DB_ PASS')%0A
f2d207c5ea21c362b4916fa3cbcb9e417f00a229
fix invalid joiner PSKd (#14)
pylibs/unittests/test_commissioning.py
pylibs/unittests/test_commissioning.py
#!/usr/bin/env python3 # Copyright (c) 2020, The OTNS Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notice, this...
Python
0
@@ -2979,20 +2979,20 @@ , %22*%22, %22 -test +TEST 123%22)%0A%0A @@ -3046,20 +3046,20 @@ rt(n2, %22 -test +TEST 123%22)%0A
1165cb98c364d2eca9d313b02c710bc9a26ca3f0
Fix borg test.
pymatgen/apps/borg/tests/test_queen.py
pymatgen/apps/borg/tests/test_queen.py
""" Created on Mar 18, 2012 """ from __future__ import division __author__ = "Shyue Ping Ong" __copyright__ = "Copyright 2012, The Materials Project" __version__ = "0.1" __maintainer__ = "Shyue Ping Ong" __email__ = "shyue@mit.edu" __date__ = "Mar 18, 2012" import unittest import os from pymatgen.apps.borg.hive imp...
Python
0
@@ -662,12 +662,9 @@ ir, -None +1 )%0A%0A
6fdac375e6ff21e2856fd3c12f655e08b2658d1d
add missing script
python/hosts_file/update_hosts_file.py
python/hosts_file/update_hosts_file.py
#!/usr/bin/python ##------------------------------------------------------------------- ## @copyright 2017 DennyZhang.com ## Licensed under MIT ## https://raw.githubusercontent.com/DennyZhang/devops_public/master/LICENSE ## ## File : update_hosts_file.py ## Author : Denny <denny@dennyzhang.com> ## Created : <2017-05-...
Python
0.000003
@@ -354,19 +354,19 @@ -07- -05 20:35:30 +11 16:37:35 %3E%0A## @@ -653,16 +653,66 @@ logging%0A +log_folder = %22%25s/log%22 %25 (os.path.expanduser('~'))%0A if os.pa
5fe4ffa6c1cc042c3554bca4db4b99723d8bd847
remove the debugging print in test_mapmri_odf.py
dipy/reconst/tests/test_mapmri_odf.py
dipy/reconst/tests/test_mapmri_odf.py
import numpy as np from dipy.data import get_sphere, get_3shell_gtab, get_isbi2013_2shell_gtab from dipy.reconst.mapmri import MapmriModel from dipy.reconst.peaks import gfa, peak_directions from numpy.testing import (assert_equal, assert_almost_equal, run_module_su...
Python
0.001221
@@ -1222,96 +1222,8 @@ re)%0A - print('odf')%0A print(odf.dtype)%0A print('sphere')%0A print(sphere.edges.dtype)%0A
64888afcd8696a8159aa2eda2bb78681ac22d668
Prepare v0.9.3
_pyrsistent_version.py
_pyrsistent_version.py
__version__ = '0.9.2'
Python
0.000002
@@ -16,7 +16,7 @@ 0.9. -2 +3 '%0A
625279d8b76e4187ee90e9c2fd4a84553d980e02
Use 10 second buckets instead of 1 second bucket
django_redis_monitor/redis_monitor.py
django_redis_monitor/redis_monitor.py
import datetime # we use utcnow to insulate against daylight savings errors import redis class RedisMonitor(object): def __init__(self, prefix=''): assert prefix and ' ' not in prefix, \ 'prefix (e.g. "rps") is required and must not contain spaces' self.prefix = prefix self.r = ...
Python
0.00087
@@ -516,64 +516,108 @@ t = -dt.strftime('%25M%25S') +'%2502d:%25d' %25 ( # 24 -05 +:3 for -5th second - of 24th minute +s 30-39 in minute 24%0A dt.minute, dt.second / 10%0A ) %0A
6aba9d1f6de927b2a78530ff36edf0603e4c4e43
Fix bugs in demo_threadcrawler.py
doc/sample_code/demo_threadcrawler.py
doc/sample_code/demo_threadcrawler.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' 2chの「将棋の棋譜貼り専門スレッド」から棋譜を収集するデモ ''' import sys sys.path.append('./../../') from pyogi.kifu import Kifu from pyogi.threadcrawler import ThreadCrawler from pyogi.ki2converter import Ki2converter if __name__ == '__main__': # Crawl html that contains kifu of KI2 fo...
Python
0.000001
@@ -80,16 +80,26 @@ %E3%83%87%E3%83%A2%0A'''%0A%0A +import re%0A import s @@ -534,19 +534,23 @@ xtract_k -ifu +akikomi txt()%0A%0A @@ -591,20 +591,16 @@ ki2 = %5Bm -%5B10%5D for m i @@ -621,20 +621,16 @@ '%E2%96%B2' in m -%5B10%5D and '%E2%96%B3' @@ -638,12 +638,8 @@ in m -%5B10%5D %5D%0A @@ -666,16 +666...
81364d11dd935409fddfdeca865e30220960f4ba
Bump version
activelink/__init__.py
activelink/__init__.py
__version__ = '0.1' __author__ = 'Jamie Matthews (http://j4mie.org) <jamie.matthews@gmail.com>'
Python
0
@@ -14,9 +14,9 @@ '0. -1 +2 '%0A__
1bac0bdb890eb9f1d2e1c2544df127e19783699b
Fix Google Requests
aiopogo/auth_google.py
aiopogo/auth_google.py
from concurrent.futures import ThreadPoolExecutor from functools import partial from time import time try: from gpsoauth import perform_master_login, perform_oauth except ImportError: def perform_master_login(*args, **kwargs): raise ImportError('Must install gpsoauth to use Google accounts') perfor...
Python
0.999833
@@ -2878,16 +2878,22 @@ xpiry = +float( token_da @@ -2904,16 +2904,17 @@ Expiry'%5D +) %0A
7825b4df35152f032df09d18f332d679eb1af497
Define __all__ for asyncio adapter
amqproto/io/asyncio.py
amqproto/io/asyncio.py
import asyncio from asyncio.streams import _DEFAULT_LIMIT from amqproto import protocol from amqproto.channel import Channel as SansioChannel from amqproto.connection import Connection as SansioConnection class Channel(SansioChannel): def __init__(self, *args, loop: asyncio.BaseEventLoop, ...
Python
0.000537
@@ -200,16 +200,53 @@ ection%0A%0A +__all__ = %5B'Connection', 'Channel'%5D%0A%0A %0Aclass C
3eb1a6cb196262618c1da3feb385dbd12d09c719
Create constraints after indexes
mysql2pgsql/lib/converter.py
mysql2pgsql/lib/converter.py
from __future__ import absolute_import from . import print_start_table class Converter(object): def __init__(self, reader, writer, file_options, verbose=False): self.verbose = verbose self.reader = reader self.writer = writer self.file_options = file_options self.exclude_t...
Python
0
@@ -2036,16 +2036,62 @@ (table)%0A + %0A for table in tables:%0A
ead833bb3ed0dca1e50f497d3b419a1827749ec0
Add test
myuw/test/util/test_cache.py
myuw/test/util/test_cache.py
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from datetime import timedelta from unittest import skipIf from django.test import TestCase from django.conf import settings from restclients_core.models import MockHTTP from restclients_core.exceptions import DataFailureException f...
Python
0.000005
@@ -2565,32 +2565,150 @@ xpiration_time(%0A + %22pws%22, %22/nws/v1/uwnetid%22, status=404), 60 * 5)%0A self.assertEquals(cache.get_cache_expiration_time(%0A %22uwn
02741b82c75615d3129f8fa7da12312852f800dd
add comment
TaskList/RenderingTask/RenderingTask.py
TaskList/RenderingTask/RenderingTask.py
'''Rendering task in blender''' import bpy, sys, os, socket, time, datetime, threading sys.path.append(os.path.abspath(sys.argv[4]+'/../../../..')) def RenderingTask(task, preferences): '''rendering each scene of the task''' # Create a socket to communicate with blender-render-manager connexion = socket.socket(sock...
Python
0
@@ -1678,19 +1678,22 @@ atus = ' -NOW +FINISH '%0A%09conne @@ -2061,11 +2061,14 @@ == ' -NOW +FINISH ':%0A%09 @@ -2078,45 +2078,134 @@ reak -%0A%09%09if msg%5B-4:%5D != ' EOS':%0A%09%09%09continue +# the task is finihed, listener must be stoped%0A%09%09%0A%09%09if msg%5B-4:%5D != ' EOS':%0A%09%09%09continue# loop ...
def8609eb74c5b4af0a6e884b39001f3654229d9
update tests
Test/Modules/Indexer/TstDialsIndexer.py
Test/Modules/Indexer/TstDialsIndexer.py
import os import sys if not os.environ.has_key('XIA2CORE_ROOT'): raise RuntimeError, 'XIA2CORE_ROOT not defined' if not os.environ.has_key('XIA2_ROOT'): raise RuntimeError, 'XIA2_ROOT not defined' if not os.path.join(os.environ['XIA2CORE_ROOT'], 'Python') in sys.path: sys.path.append(os.path...
Python
0.000001
@@ -2057,17 +2057,17 @@ '%5D, 0.02 -9 +7 , eps=1e @@ -2067,17 +2067,17 @@ eps=1e- -3 +2 )%0A asse
e5024fa05c1ebe3221b1c39325e420f9d82c1922
Fix vlan instantiation bug
dcclient/xml_manager/data_structures.py
dcclient/xml_manager/data_structures.py
""" Data structures used to build the XML """ import xml.etree.ElementTree as ET import utils class Pbits(object): """ Class pbits represents bitmasks (usually from ports) This class has one property: bits: Internally this property is implemented as an integer. It can be se...
Python
0.000001
@@ -2832,20 +2832,24 @@ , ports= -None +Pbits(0) ):%0A @@ -2878,70 +2878,27 @@ -if ports:%0A self.ports = ports%0A if name:%0A +self.ports = ports%0A
f4e16c73ad9d46f5645f349112b6c0e420601433
Fix pylint warning W0611: Unused import os [W:unused-import]
Testing/PythonTests/transformix_test.py
Testing/PythonTests/transformix_test.py
# ========================================================================= # # Copyright UMC Utrecht and contributors # # 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://ww...
Python
0
@@ -757,18 +757,8 @@ ==%0A%0A -import os%0A impo
8a0ec58b2a01ee179fcbc4c3c722df37f42b7687
Add more test cases
nltk/test/unit/test_aline.py
nltk/test/unit/test_aline.py
# -*- coding: utf-8 -*- """ Unit tests for nltk.metrics.aline """ from __future__ import unicode_literals import unittest from nltk.metrics import aline class TestAline(unittest.TestCase): """ Test Aline algorithm for aligning phonetic sequences """ def test_aline(self): result = aline.alig...
Python
0.000001
@@ -470,8 +470,1737 @@ pected)%0A + %0A result = aline.align('jo', '%CA%92%C9%99')%0A expected = %5B%5B('j', '%CA%92'), ('o', '%C9%99')%5D%5D%0A self.assertEqual(result, expected)%0A %0A result = aline.align('pematesiweni', 'pematesewen')%0A expected = %5B%5B('p', 'p'),...
3ef08477fa6131d67020cb000657cb9c2b78b06a
Bump graql and client-java versions
dependencies/graknlabs/dependencies.bzl
dependencies/graknlabs/dependencies.bzl
# # GRAKN.AI - THE KNOWLEDGE GRAPH # Copyright (C) 2018 Grakn Labs Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later v...
Python
0
@@ -954,48 +954,48 @@ = %22 -2b4ea9781ba164104e4e00fb2ffe8d0928f14848 +b0a7a7488a51fedf82a905febef2c9421594193e %22,%0A @@ -1177,48 +1177,48 @@ = %22 -cf13125f696481549710c1dc5b146bc14374d2e1 +ec2470f7f051981c0127579f4cd03e1ffd529f1b %22,%0A
bd992f31c2ef7685566da2a639424cd0eb8675f6
Return None if optional parameters are empty
VMEncryption/main/ExtensionParameter.py
VMEncryption/main/ExtensionParameter.py
#!/usr/bin/env python # # VMEncryption extension # # Copyright 2015 Microsoft Corporation # # 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.000486
@@ -3456,38 +3456,40 @@ (self):%0A -return +secret = self.params_con @@ -3534,24 +3534,66 @@ ntSecretKey) +%0A return secret if secret else None %0A%0A def ge @@ -3617,38 +3617,38 @@ (self):%0A -return +cert = self.params_con @@ -3701,24 +3701,62 @@ umbprintKey) +%0A return cer...
0c9e6e7712eb2a236969c26f8f9bc2cac5964251
Revert "test inline target def update"
numba/tests/test_inlining.py
numba/tests/test_inlining.py
from __future__ import print_function, absolute_import import re import numpy as np from .support import TestCase, override_config, captured_stdout import numba from numba import unittest_support as unittest from numba import jit, njit, types, ir, compiler from numba.ir_utils import guard, find_callname, find_const f...
Python
0
@@ -241,22 +241,8 @@ ypes -, ir, compiler %0Afro @@ -289,20 +289,8 @@ name -, find_const %0Afro @@ -4740,1081 +4740,8 @@ ))%0A%0A - @skip_unsupported%0A def test_inline_update_target_def(self):%0A%0A def test_impl(a):%0A if a == 1:%0A b = 2%0A else:%0A ...
1bb17ec985f53aa6a8d367e60122f28178e48009
Enhance to allow deleting virtual machines.
lib/python2.5/aquilon/server/commands/del_machine.py
lib/python2.5/aquilon/server/commands/del_machine.py
# ex: set expandtab softtabstop=4 shiftwidth=4: -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # # Copyright (C) 2008,2009 Contributor # # This program is free software; you can redistribute it and/or modify # it under the terms of the EU DataGrid Software License. You should # have received a copy of the license...
Python
0
@@ -2068,33 +2068,16 @@ not in %5B -%0A 'blade', @@ -2093,35 +2093,150 @@ nt', - 'workstation', 'aurora_nod +%0A 'workstation', 'aurora_node',%0A 'virtual_machin e'%5D: @@ -3460,16 +3460,70 @@ remove() +%0...
d369202464f08c62d8d32a43165d4cbfe6b00de2
Remove deprecation warning and update docstring
api/base/exceptions.py
api/base/exceptions.py
import httplib as http import warnings from rest_framework import status from rest_framework.exceptions import APIException, ParseError def json_api_exception_handler(exc, context): """ Custom exception handler that returns errors object as an array """ # Import inside method to avoid errors when the OSF is...
Python
0
@@ -19,24 +19,8 @@ http -%0Aimport warnings %0A%0Afr @@ -115,17 +115,16 @@ eError%0A%0A -%0A def json @@ -938,165 +938,8 @@ t):%0A - warnings.warn('Passing a %3Cdict%3E value for a DRF exception detail is deprecated. Please switch to using a subclass of JSONAPIException instead.')%0A @@ -1728,24 +...
c8e2eb7e56e6ebc014983d856007cdad324e2242
Fix Python3.x error related to unicode.
draalcore/auth/registration/models.py
draalcore/auth/registration/models.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Registration model(s)""" # System imports import hashlib import random from django.db import models from django.contrib.auth.models import User # Project imports from draalcore.models.base_model import ModelLogger, ModelBaseManager class UserAccountManager(ModelBaseM...
Python
0.000001
@@ -186,16 +186,81 @@ ort User +%0Atry:%0A bool(type(unicode))%0Aexcept NameError:%0A unicode = str %0A%0A# Proj
eab5d44e3afa7c5c48720acaefa8022b6f82f205
Update NLP thingie
api/controllers/nlp.py
api/controllers/nlp.py
from flask import Flask from flask import session from flask import Response from flask import request from flask import redirect, url_for from flask import render_template from api.core import app, db from api.models.user import User from api.models.page import Page from gensim import corpora, models, similarities i...
Python
0
@@ -2788,57 +2788,11 @@ ps(s -orted(enumerate(sims), key=lambda item: -item%5B1%5D) +ims ), m
0a988cde1f94f4a5c631522480bb64e0d59ef6b8
replace copy by deepcopy
agent/AgentReporter.py
agent/AgentReporter.py
import logging import re from agent.Calculator import Calculator logger = logging.getLogger() class AgentReporter: def __init__(self, client, logger, args): self.client = client self.logger = logger self.args = args self.calculator = Calculator() self.local_cache = {} ...
Python
0.000001
@@ -19,16 +19,29 @@ ort re%0A%0A +import copy%0A%0A from age @@ -6000,18 +6000,26 @@ %5D = -meta. +copy.deep copy( +meta )%0A
7c43327af91dc672c02099c788221e6b3073612a
Complete traverse_dfs()
alg_knight_tour_dfs.py
alg_knight_tour_dfs.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division from collections import defaultdict from itertools import product MOVE_OFFSETS = ( (-1, -2), (1, -2), (-2, -1), (2, -1), (-2, 1), (2, 1), ...
Python
0.000007
@@ -1062,17 +1062,16 @@ t%0A%0A%0Adef -_ get_firs @@ -1237,16 +1237,34 @@ vertex, +%0A graph_di @@ -1282,34 +1282,16 @@ quares, -%0A sorted_f @@ -1794,25 +1794,247 @@ d_func)%0A -%0A pass + return get_first_next_vertex(%0A traverse_dfs(%0A ...
e3cc16a156cafa1efe8f1314807e39c6071150c3
check for account ID param
weboob/applications/boobank/boobank.py
weboob/applications/boobank/boobank.py
# -*- coding: utf-8 -*- # Copyright(C) 2009-2010 Romain Bignon, Christophe Benz # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in t...
Python
0
@@ -4791,32 +4791,164 @@ lf.parse_id(id)%0A + if not id:%0A print %3E%3Esys.stderr, 'Error: please give an account ID (hint: use list command)'%0A return 1%0A names =
f462be35ca867fd2b487ac151f1c3be26eda6cbb
FIX report verson
report_extended_voucher/__openerp__.py
report_extended_voucher/__openerp__.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
Python
0
@@ -1028,17 +1028,17 @@ ': '8.0. -1 +2 .2.0',%0A
bcc2bb0a250022650e5182a9806b0b0c7e9fdc5f
Refactor HospitalEquipment
ambulances/viewsets.py
ambulances/viewsets.py
from django.core.exceptions import PermissionDenied from rest_framework import viewsets from rest_framework import mixins from rest_framework import generics from rest_framework import filters from rest_framework.permissions import IsAuthenticated from rest_framework import permissions from .models import Ambulance,...
Python
0
@@ -5496,16 +5496,75 @@ ter = %7B%7D +%0A%0A print('kwargs = %7B%7D'.format(self.kwargs))%0A %0A
796602f451c0c5fe96c6cbb9bff9c65f9034aec7
Fix deprecated mimetype argument
annoying/decorators.py
annoying/decorators.py
from django.shortcuts import render_to_response from django import forms from django.template import RequestContext from django.db.models import signals as signalmodule from django.http import HttpResponse # Try to be compatible with Django 1.5+. try: import json except ImportError: from django.utils import sim...
Python
0.000034
@@ -899,16 +899,35 @@ te=None, + content_type=None, mimetyp @@ -1301,16 +1301,78 @@ to use%0A + - content_type: content type to send in response headers%0A - m @@ -1420,16 +1420,29 @@ headers + (deprecated) %0A%0A Ex @@ -3048,26 +3048,70 @@ equest), - mimetype= +%0A content_...
36311b2de7e259c47c002f40026d3b2a415c9ffd
Update NLP thingie
api/controllers/nlp.py
api/controllers/nlp.py
from flask import Flask from flask import session from flask import Response from flask import request from flask import redirect, url_for from flask import render_template from api.core import app, db from api.models.user import User from api.models.page import Page from gensim import corpora, models, similarities i...
Python
0
@@ -2089,35 +2089,16 @@ int -dictionary%0A%0A print corpu +question s%0A%0A
ab33e00aa1c18558b01f9ef68a4e271bc7d6b3d3
version bump
meshio/__about__.py
meshio/__about__.py
# -*- coding: utf-8 -*- # __version__ = '1.8.7' __author__ = u'Nico Schlömer' __author_email__ = 'nico.schloemer@gmail.com' __website__ = 'https://github.com/nschloe/meshio' __license__ = 'License :: OSI Approved :: MIT License' __status__ = 'Development Status :: 5 - Production/Stable'
Python
0.000001
@@ -42,9 +42,9 @@ 1.8. -7 +8 '%0A__
dc95d9597d8edba6f806f6eb9c34800a4a107d81
Upgrade to Pebble containing letsencrypt/pebble#294
test/e2e/images.bzl
test/e2e/images.bzl
# Copyright 2019 The Jetstack cert-manager contributors. # # 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 l...
Python
0
@@ -1298,47 +1298,122 @@ = %222 -e69bb16af048c491720f23cb284fce685e65fec +787c898960ca6326da21ab48b76b080f89a8fec%22,%0A remote = %22https://github.com/munnerz/pebble%22,%0A vcs = %22git %22,%0A
3086400e10f9166dacf7ed572b572995aa67bb2f
update problem api
app/api_1_0/problem.py
app/api_1_0/problem.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime from flask import jsonify, request, g, abort, url_for, current_app from ..exceptions import ValidationError from .. import db from ..models import Problem, OJList, Permission from . import api from .decorators import permission_required @api....
Python
0
@@ -1360,16 +1360,21 @@ elif +long( problem_ @@ -1382,20 +1382,26 @@ ld.oj_id +) != +long( problem_ @@ -1409,20 +1409,25 @@ ew.oj_id +) or +str( problem_ @@ -1439,20 +1439,25 @@ emote_id +) != +str( problem_ @@ -1469,16 +1469,17 @@ emote_id +) :%0A @@ -2869,24 +2869,36 @@ d.visible = +Tru...
4789e8e8024fd25e1d0191ee8de91ef8a97c9943
Fix case study redirect
app/casestudy/views.py
app/casestudy/views.py
from django.views.generic import TemplateView from django.shortcuts import redirect from thumber.decorators import thumber_feedback from casestudy.casestudies import CASE_STUDIES @thumber_feedback class CaseStudyView(TemplateView): """ The simple view for a case story page """ comment_placeholder = ...
Python
0.000003
@@ -536,13 +536,9 @@ DIES -.get( +%5B self @@ -552,17 +552,17 @@ %5B'slug'%5D -) +%5D %0A
075b01955da51865b13683b377ab56a8dc166e9a
fix in pytorchapproximator
mushroom/approximators/parametric/pytorch_network.py
mushroom/approximators/parametric/pytorch_network.py
import torch import numpy as np from tqdm import trange, tqdm from mushroom.utils.minibatches import minibatch_generator class PyTorchApproximator: """ Class to interface a pytorch model to the mushroom Regressor interface. This class implements all is needed to use a generic pytorch model and train ...
Python
0.999796
@@ -5384,30 +5384,24 @@ batch(batch, - args, kwargs))%0A%0A @@ -5468,22 +5468,16 @@ , batch, - args, kwargs) @@ -5639,36 +5639,37 @@ cuda() for x in -args +batch %5D%0A%0A x = t
70d9f68f78d8b4ba8e08b445a1b508806c0463f7
Fix home url
organization/pages/models.py
organization/pages/models.py
from django.db import models from django.utils.translation import ugettext_lazy as _ from django.core.urlresolvers import reverse, reverse_lazy from mezzanine.core.models import Displayable, Slugged, Orderable from organization.core.models import * class CustomPage(Page, SubTitled, RichText): class Meta: ...
Python
0.999956
@@ -1601,34 +1601,6 @@ ome%22 -, kwargs=%7B%22slug%22: self.slug%7D )%0A
8255eb399559f786eeec245c44877066ed878883
change MAX_NUM_QUESTIONS_PER_ELECTION on eorchestra settings
eorchestra/templates/base_settings.py
eorchestra/templates/base_settings.py
# This file is part of agora-dev-box. # Copyright (C) 2014-2016 Agora Voting SL <agora@agoravoting.com> # agora-dev-box is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License....
Python
0.000001
@@ -1953,16 +1953,140 @@ = True%0A%0A +# Maximum number of questions per election%0AMAX_NUM_QUESTIONS_PER_ELECTION = %7B%7B config.election_limits.max_num_questions %7D%7D%0A%0A QUEUES_O
661574a081e21bc8118084d2f3214c23275e6d68
modelsim.py Adapt to CAPI 1
orpsoc/simulator/modelsim.py
orpsoc/simulator/modelsim.py
import os import subprocess from .simulator import Simulator class Modelsim(Simulator): def __init__(self, system): super(Modelsim, self).__init__(system) self.sim_root = os.path.join(self.build_root, 'sim-modelsim') if system.config.has_option('modelsim', 'vlog_options'): self...
Python
0.999873
@@ -1003,19 +1003,19 @@ for -rtl +src _file in @@ -1020,19 +1020,19 @@ in self. -rtl +src _files:%0A @@ -1055,85 +1055,11 @@ ite( -rtl_file + '%5Cn')%0A for tb_file in self.tb_files:%0A f.write(tb +src _fil
0dbbde4eebf4af51d03d1739e9d370885cec37dd
fix bad escaping
migra/statements.py
migra/statements.py
from __future__ import unicode_literals import re def check_for_drop(s): return not not re.search("(drop\s+)", s, re.IGNORECASE) class Statements(list): def __init__(self, *args, **kwargs): self.safe = True super(Statements, self).__init__(*args, **kwargs) @property def sql(self): ...
Python
0.00022
@@ -98,16 +98,17 @@ .search( +r %22(drop%5Cs
7e1bf9c88c1ab1b4f254c65fdb4f8465d1e920ca
not an option
rplugin/python3/blackarrow/__init__.py
rplugin/python3/blackarrow/__init__.py
import sys import io import argparse import neovim from . import blackarrow # TODO: integrate with netrw @neovim.plugin class BlackArrow(object): def __init__(self, vim): self.vim = vim @neovim.command('BlackArrow', nargs='+', sync=False) def search(self, args: str): args = blackarrow.g...
Python
0.998944
@@ -526,12 +526,8 @@ ho %22 -%7B%7D, %7B%7D%22' @@ -538,45 +538,8 @@ mat( -self.vim.options%5B'netrw_list_hide'%5D, self
85eab101b02a3f7e1b594e5277882cd44b7d2f55
Update header sent in list parts from part-marker to part-number-marker
minio/generators.py
minio/generators.py
# Minimal Object Storage Library, (C) 2015 Minio, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
Python
0
@@ -6775,16 +6775,23 @@ y%5B'part- +number- marker'%5D
4f3baae486afb6937ba9b96a99f0b48bc1bf8313
Change rmake back to using localhost for rbuilderurl (RCE-1438)
mint/rmake_setup.py
mint/rmake_setup.py
# # Copyright (c) 2008 rPath, Inc. # # All Rights Reserved # import os from mint import helperfuncs from mint import shimclient from mint import mint_error from conary.lib import util def setupRmake(cfg, rmakeConfigFilePath, restartRmake=False): # Create a product (as the admin user) for use by the internal rma...
Python
0
@@ -1952,26 +1952,18 @@ s:// -%25s%22 %25 cfg.siteH +localh ost +%22 ,%0A
2b7d50f9ac6d0f4f6a032e60053b5923c292a0a1
Remove unused assert
wqflask/utility/corr_result_helpers.py
wqflask/utility/corr_result_helpers.py
def normalize_values(a_values, b_values): """ Trim two lists of values to contain only the values they both share Given two lists of sample values, trim each list so that it contains only the samples that contain a value in both lists. Also returns the number of such samples. >>> normalize_val...
Python
0.000004
@@ -1133,17 +1133,16 @@ amples)%0A -%0A a_ne @@ -1286,105 +1286,8 @@ e%5D%0A%0A - num_overlap = len(a_new)%0A assert num_overlap == len(b_new), %22Lengths should be the same%22%0A%0A
6d2b0a7f34978fd77b906bb24f4056eeea779c9e
update release to 2.1.29-dev
aminator/__init__.py
aminator/__init__.py
# -*- coding: utf-8 -*- # # # Copyright 2013 Netflix, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
Python
0
@@ -1021,17 +1021,17 @@ = '2.1.2 -8 +9 -dev'%0A__
4955c9c797300ea3db5ef4c2083d2cb4379fc926
allow specifying splitter for `camelcaseify`
amino/util/string.py
amino/util/string.py
import re from functools import singledispatch # type: ignore def snake_case(name): s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() @singledispatch def decode(value): return value @decode.register(bytes) def decode_bytes(value): return valu...
Python
0
@@ -729,16 +729,30 @@ , sep='' +, splitter='_' ):%0A r @@ -795,19 +795,17 @@ in -nam +r e.split( '_') @@ -800,19 +800,30 @@ e.split( -'_' +splitter, name )%5D)%0A%0A%0Ade @@ -873,11 +873,8 @@ Try -, L %0A
9d540e2b774dc7aac6074cea9773389d75151a3a
add M-Dock-01
analisys/analisys.py
analisys/analisys.py
######################################################################### # Developed in the framework of INDIGO project, # # Author: Mario David <mariojmdavid@gmail.com> ######################################################################### import os import pprint import numpy as np import matplotlib.pyplot as plt...
Python
0.000001
@@ -490,16 +490,29 @@ hys-04', + 'M-Dock-01', 'M-Dock @@ -547,16 +547,20 @@ , 8, 24, + 24, 8%5D%0A
8f976adbd4ba39e565200153c6ef2c392f35b9eb
split scan_results in getting the results and displaying them
analysis/cli/irma.py
analysis/cli/irma.py
import requests import json import sys import argparse # ADDRESS = "http://brain.irma.qb:8080" ADDRESS = "http://192.168.130.133:8080" def probe_list(): try: resp = requests.get(url=ADDRESS + '/probe_list') data = json.loads(resp.content) if data['result'] == "success": print ...
Python
0
@@ -1851,32 +1851,463 @@ %25 e%0A return%0A%0A +def print_results(list_res, justify=12):%0A for (name, res) in list_res.items():%0A print %22%25s%22 %25 name%0A for av in res:%0A print %22%5Ct%25s%22 %25 (av.ljust(justify)),%0A avres = res%5Bav%5D%5B'result'%5D%0A i...
c660f39f0077637d351baca6b716bd26e6528a30
Make it more flexible
angr/analyses/cfg.py
angr/analyses/cfg.py
import sys from ..analysis import register_analysis from .cfg_fast import CFGFast class OutdatedError(Exception): pass class CFG(CFGFast): """ tl;dr CFG is just a wrapper around CFGFast for compatibility issues. It will be fully replaced by CFGFast in future releases. Feel free to use CFG if you ...
Python
0.000001
@@ -1892,1439 +1892,20 @@ elf, -%0A # parameters that CFGFast takes%0A binary=None,%0A start=None,%0A end=None,%0A pickle_intermediate_results=False,%0A symbols=True,%0A function_prologues=True,%0A ...
321ed038efbe6007a917d8a60b683ab1923f3389
fix registry
yosaipy2/registry/flask/webregistry.py
yosaipy2/registry/flask/webregistry.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from yosaipy2.web.registry.abcs import WebRegistry from flask import request, g from typing import Callable, Dict, Any from werkzeug.exceptions import Forbidden, Unauthorized import json class FlaskWebRegistry(WebRegistry): def __init__(self): # type: (Callabl...
Python
0.000001
@@ -713,78 +713,58 @@ -if request.mimetype == 'application/json':%0A return +resource = dict()%0A resource.update( request. json @@ -763,13 +763,14 @@ est. -json( +values )%0A @@ -779,47 +779,102 @@ -else:%0A return request.values +if request.json is not None:%0A ...
05181ba532437583f1cf66a8b3e04bb6bbf9de39
Set the priority of EvalHook to LOW. (#5882)
mmdet/apis/train.py
mmdet/apis/train.py
# Copyright (c) OpenMMLab. All rights reserved. import random import warnings import numpy as np import torch from mmcv.parallel import MMDataParallel, MMDistributedDataParallel from mmcv.runner import (HOOKS, DistSamplerSeedHook, EpochBasedRunner, Fp16OptimizerHook, OptimizerHook, build_optim...
Python
0
@@ -5507,16 +5507,167 @@ valHook%0A + # In this PR (https://github.com/open-mmlab/mmcv/pull/1193), the%0A # priority of IterTimerHook has been modified from 'NORMAL' to 'LOW'.%0A @@ -5687,16 +5687,29 @@ er_hook( +%0A eval_hoo @@ -5737,16 +5737,32 @@ val_cfg) +, priority='LOW' )%...
10822c71c04a8a2368b59012b88cbbccf9c65d7c
revert version bump up to 0.0.3.10: I merged many updates since then, so have to check carefully more before the next release
anyconfig/globals.py
anyconfig/globals.py
# # Copyright (C) 2013 Satoru SATOH <ssato @ redhat.com> # License: MIT # import logging AUTHOR = 'Satoru SATOH <ssat@redhat.com>' VERSION = "0.0.3.10" _LOGGING_FORMAT = "%(asctime)s %(name)s: [%(levelname)s] %(message)s" def getLogger(name="anyconfig", format=_LOGGING_FORMAT, level=logging.WARNING, ...
Python
0
@@ -147,10 +147,9 @@ 0.3. -10 +9 %22%0A%0A_
4bbe94b51d7b41e11c2cd30b60c0f8718b9be694
switch logging to INFO
examples/market/add-ratings/market.py
examples/market/add-ratings/market.py
import sys import argparse import json import logging import os import time logging.basicConfig(level=logging.DEBUG) from flask import Flask, render_template, url_for, request, jsonify # Import the interface to our ratings service from ratings import * from datawire_connect.resolver import DiscoveryConsumer as DWCR...
Python
0.000001
@@ -109,13 +109,12 @@ ing. -DEBUG +INFO )%0A%0Af
fa420f4f2b2ec06def3a5053e7fbd516326a0618
Fix bug where Teff was not being fixed when selected
var/www/cgi-bin/ewmethodConf.py
var/www/cgi-bin/ewmethodConf.py
#!/home/daniel/Software/anaconda3/bin/python # Import modules for CGI handling import cgi, cgitb from ewDriver import ewdriver def cgi2dict(form): """Convert the form from cgi.FieldStorage to a python dictionary""" params = {'initial': False, 'fixTeff': False, 'fixlogg': False, ...
Python
0
@@ -262,25 +262,25 @@ 'fix -T +t eff': False, @@ -1819,17 +1819,17 @@ orm%5B'fix -T +t eff'%5D:%0A
cc3b7170575e9e106d628076761be67affb330fe
Add device command to neblinaTest argument and commands helper
test/neblinaTest.py
test/neblinaTest.py
#!/usr/bin/env python ################################################################################### # # Copyright (c) 2010-2016 Motsai # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Softwa...
Python
0
@@ -1732,16 +1732,18 @@ --help + : Displa @@ -1791,16 +1791,18 @@ --port + : COM po @@ -1810,24 +1810,83 @@ t to use.%22)%0A + print(%22 -d --device : Bluetooth LE device to use.%22)%0A print(%22%22
2d137bb11ba0582c139f80a8d84a21e46b262a48
Updated the visualizer so that output is a) from 10 to -70 volts and b) rectangular instead of square outputs
examples/testLPU/visualize_testLPU.py
examples/testLPU/visualize_testLPU.py
#@author: Amol Kapoor #date: 3-13-15 #Visualizer for simpleLPU stuff import matplotlib as mpl mpl.use('agg') import neurokernel.LPU.utils.visualizer as vis import networkx as nx # Temporary fix for bug in networkx 1.8: nx.readwrite.gexf.GEXF.convert_bool = {'false':False, 'False':False, ...
Python
0.999994
@@ -1474,17 +1474,17 @@ .rows = -3 +5 %0AV.cols @@ -1680,10 +1680,9 @@ .0, --4 +1 0.0%5D @@ -1714,13 +1714,56 @@ = (1 -2, 8) +6, 9)%0A%0AV.title = %22Simple LPU Testing RK4 Models%22 %0A%0A#r
069b60e5860b6af81c136f55c84b6d1930442285
Fix plugin_test for workflow object
test/plugin_test.py
test/plugin_test.py
from mock import call, MagicMock as Mock, patch from nose.tools import raises import spreads import spreads.plugin as plugin from spreads.util import DeviceException class TestPlugin(object): def setUp(self): reload(plugin) spreads.config.clear() spreads.config.read(user=False) sp...
Python
0
@@ -86,16 +86,33 @@ spreads +.confit as confit %0Aimport @@ -238,486 +238,305 @@ -reload(plugin)%0A spreads.config.clear()%0A spreads.config.read(user=False)%0A spreads.config%5B'plugins'%5D = %5B%5D%0A%0A def test_pluginmanager(self):%0A plugin.SpreadsNamedExtensionManager = Mo...
8c4be231cc4f62b2e677bf237cfc9c9ada95e159
sale margin module : wrong computation
addons/sale_margin/sale_margin.py
addons/sale_margin/sale_margin.py
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public L...
Python
0
@@ -2772,112 +2772,497 @@ -_columns = %7B%0A 'margin': fields.function(_product_margin, method=True, string='Margin', store=True +def _get_sale_order(self, cr, uid, ids, context=None):%0A list_order_line = %5B%5D%0A for line in self.pool.get('sale.order').browse(cr, uid, ids, context=context)...
92dfdc25a325359964a59889c23377f2038ba4e4
disable googlemap plugin
vfoss_org/vfoss_org/settings.py
vfoss_org/vfoss_org/settings.py
# -*- coding: utf-8 -*- import os gettext = lambda s: s PROJECT_DIR = os.path.abspath(os.path.dirname(__file__)) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS LANGUAGES = [('en', 'en')] DEFAULT_LANGUAGE = 0 DATABASES = { 'default': { ...
Python
0
@@ -4875,24 +4875,25 @@ ippet',%0A +# 'cms.plugins
48f44fb2c499ac1ee6fed160d9d2e06a549fbcea
add __all__ string to scene/cameras/__init__.py
vispy/scene/cameras/__init__.py
vispy/scene/cameras/__init__.py
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. """ Cameras are responsible for determining which part of a scene is displayed in a viewbox and for handling user input to change the view. Several Camera subclasses are avail...
Python
0.000039
@@ -772,16 +772,155 @@ ox.%0A%22%22%22%0A +__all__ = %5B'ArcballCamera', 'BaseCamera', 'FlyCamera', 'MagnifyCamera',%0A 'Magnify1DCamera', 'PanZoomCamera', 'TurntableCamera'%5D%0A%0A from ._b
b9fccc33f3fb1c6408701f11c6a894c9001f843a
Fix YoutubeScrape error handling
steve/scrapers.py
steve/scrapers.py
####################################################################### # This file is part of steve. # # Copyright (C) 2012-2015 Will Kahn-Greene # Licensed under the Simplified BSD License. See LICENSE for full # license. ####################################################################### from datetime import da...
Python
0
@@ -382,16 +382,58 @@ ocess%0A%0A%0A +class ScraperError(Exception):%0A pass%0A%0A%0A class Sc @@ -1346,32 +1346,93 @@ ape(self, url):%0A + %22%22%22Scrapes a url by passing it through youtube-dl%22%22%22%0A parts = @@ -1445,16 +1445,16 @@ se(url)%0A - @@ -1613,168 +1613,383 @@ -...
5887e9a70c011e6b1b6c6ba720849c486740fac9
use the new ColorBarVisual's size in ColorBarWidget:
vispy/scene/widgets/colorbar.py
vispy/scene/widgets/colorbar.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright (c) 2015, Vispy Development Team. All Rights Reserved. # Distributed under the (new) BSD License. See LICENSE.txt for more info. # -------------------------------------------------------------------------...
Python
0
@@ -1161,16 +1161,99 @@ placed. + The colorbar automatically resizes when its%0A container's dimension changes. %0A%0A @@ -2574,19 +2574,16 @@ entation -=%22%22 ,%0A @@ -2701,23 +2701,20 @@ dummy_ -halfdim +size = (1, 1 @@ -2759,29 +2759,23 @@ ual( -halfdim=dummy_halfdim +size=dummy_size ...
c5a2448125bc516e9f8326e6ef3211af04c2d77a
add test for bad regex
test/test_pynmea.py
test/test_pynmea.py
import pytest import pynmea2 data = "$GPGGA,184353.07,1929.045,S,02410.506,E,1,04,2.6,100.00,M,-33.9,M,,0000*6D" def test_version(): version = '1.4.0' assert pynmea2.version == version assert pynmea2.__version__ == version def test_sentence(): msg = pynmea2.parse(data) assert msg....
Python
0.000003
@@ -2835,16 +2835,147 @@ GGA'%0D%0A%0D%0A +def test_slash():%0D%0A with pytest.raises(pynmea2.nmea.ParseError):%0D%0A msg = pynmea2.parse('$GPGSV,3,3,09,24,03,046,*47%5C%5C')%0D%0A %0D%0A#%0D%0A# %5E
11b35c79ff8d2108d572929334e4e3f30c70eea5
Allow debug and verbose modes to be set directly from config.
modules/__init__.py
modules/__init__.py
import argparse import botconfig from settings import wolfgame as var # Todo: Allow game modes to be set via config # Carry over settings from botconfig into settings/wolfgame.py for setting, value in botconfig.__dict__.items(): if not setting.isupper(): continue # Not a setting if not setting in var...
Python
0
@@ -115,357 +115,8 @@ ig%0A%0A -# Carry over settings from botconfig into settings/wolfgame.py%0A%0Afor setting, value in botconfig.__dict__.items():%0A if not setting.isupper():%0A continue # Not a setting%0A if not setting in var.__dict__.keys():%0A continue # Don't carry over config-only setting...