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
518959b8eb5a7b6ce380535e9b791c2c1668b592
Fix flake8 error: unused import
tools/spaln/list_spaln_tables.py
tools/spaln/list_spaln_tables.py
#!/usr/bin/env python3 import argparse from io import StringIO import shlex from subprocess import run import sys from typing import TextIO def find_common_ancestor_distance(taxon: str, other_taxon: str, taxonomy_db_path: str, only_canonical: bool): canonical = '--only_canonical' if only_canonical else '' cmd...
Python
0.000004
@@ -37,32 +37,8 @@ rse%0A -from io import StringIO%0A impo @@ -111,16 +111,17 @@ TextIO%0A%0A +%0A def find @@ -142,24 +142,29 @@ or_distance( +%0A taxon: str, @@ -224,16 +224,17 @@ al: bool +%0A ):%0A c @@ -244,17 +244,17 @@ nical = -' +%22 --only_c @@ -261,17 +261,17 @@ anonical -' +%22 if only ...
67fa7b5c7485b50202348f3a1c03df287875e93a
Update ShareClassMeanReversionAlphaModel.py
Algorithm.Python/Alphas/ShareClassMeanReversionAlphaModel.py
Algorithm.Python/Alphas/ShareClassMeanReversionAlphaModel.py
# QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals. # Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect 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 Licen...
Python
0
@@ -1146,16 +1146,70 @@ import * +%0Afrom QuantConnect.Orders.Fees import ConstantFeeModel %0A%0Aimport
ab23d2ea9d274465cf282eb419f08441f55d6077
Fix is_timestamp_in_bounds 'now' default value
dci/common/signature.py
dci/common/signature.py
# -*- coding: utf-8 -*- # # Copyright (C) 2017 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 # # Unless required by applicable la...
Python
0.000006
@@ -2339,16 +2339,57 @@ now= +None):%0A if now is None:%0A now = datetime @@ -2397,18 +2397,16 @@ utcnow() -): %0A ret
b03ad153dce2fd026b632907aff8fc82fd3df407
Update __init__.py
ddsc_worker/__init__.py
ddsc_worker/__init__.py
# package
Python
0.000072
@@ -1,8 +1,64 @@ +# (c) Fugro Geoservices. MIT licensed, see LICENSE.rst.%0A # packag
8e7c29f7425c5844c9fb1c3ea7f6a9984c18ed9c
fix typo
memcached_status.py
memcached_status.py
#!/usr/bin/env python import re import argparse import memcache from ipaddr import IPv4Address from maas_common import status_ok, status_err, metric, metric_bool VERSION_RE = re.compile('STAT version (\d+\.\d+\.\d+)(?![-+0-9\\.])') VERSION = '1.4.14 (Ubuntu)' MEMCACHE_METRICS = ['total_items', '...
Python
0.999991
@@ -781,32 +781,70 @@ rt)%0A -%0A -if stats%5B'version'%5D +current_version = stats%5B'version'%5D%0A%0A if current_version !=
e956c8ef316e5e371ae9a59a84cee8c47ad84efa
replacing space in names
MiSeq_rdptool_map_parser.py
MiSeq_rdptool_map_parser.py
import os import sys if len(sys.argv) != 2: print "USAGE: python MiSeq_rdptool_map_parser.py ANL_MAPPING_FILE.txt > RDP_MAPPING_FILE.txt" sys.exit() with open(sys.argv[1], 'r') as f: next(f) for lines in f: lines = lines.strip() lexemes = lines.split('\t') sample = lexemes[0] tag = lexemes[1] print '%s\t...
Python
0.805946
@@ -145,16 +145,96 @@ exit()%0A%0A +def replace_space(SN):%0A%09if %22 %22 in SN:%0A%09%09SN.replace(%22 %22, %22_%22)%0A%09else:%0A%09%09continue%0A%0A with ope @@ -361,16 +361,52 @@ emes%5B0%5D%0A +%09%09file_name = replace_space(sample)%0A %09%09tag = @@ -441,17 +441,20 @@ %25 (tag, -sampl +file_nam e)%0A%0A...
cefee133a960124542de906cfb408dd9e6cf0aca
Make indentation consistently spaces in __init.py__
npyscreenreactor/__init__.py
npyscreenreactor/__init__.py
#!/usr/bin/env python # npyscreenreactory.py # Inspired by pausingreactor.py and xmmsreactor.py # npyscreen modifications # Copyright (c) 2015 Mark Tearle <mark@tearle.com> # See LICENSE for details. # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 """ This module provides npyscreen event loop support for Tw...
Python
0.000108
@@ -986,17 +986,24 @@ meout):%0A -%09 + # Execut @@ -1034,25 +1034,32 @@ would do...%0A -%09 + self.runUnti @@ -1070,17 +1070,24 @@ rent()%0A%0A -%09 + selectre @@ -1134,17 +1134,24 @@ meout)%0A%0A -%09 + # push e @@ -1175,33 +1175,40 @@ npyscreen queue%0A -%09 + self.n...
c0fb4c1d808446a3eb765bcad527ca1432341f60
test moar :o
apertium/__init__.py
apertium/__init__.py
import os, os.path, re from collections import defaultdict from os.path import abspath, dirname, basename from os import listdir from xml.sax import make_parser from xml.sax.handler import ContentHandler from hashlib import sha1 from datetime import datetime #import logging def checksum(data): if isinstance(data,...
Python
0.000002
@@ -301,28 +301,30 @@ %09if -isinstance(data, str +hasattr(data, 'decode' ):%0A%09 @@ -336,18 +336,18 @@ = data. +d e -n code('ut @@ -364,12 +364,8 @@ urn -str( sha1 @@ -382,17 +382,16 @@ digest() -) %0A%0Adef wh
4ee4c7ad9a14ac1b7cfaa99688ac745e6c8da693
version bump
meshio/__about__.py
meshio/__about__.py
# -*- coding: utf-8 -*- # __version__ = '1.11.2' __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
@@ -43,9 +43,9 @@ .11. -2 +3 '%0A__
d719cb75b10724b1c15bf00879c73f25dcfad97d
Fix copy/paste error in tests...
numba/tests/test_dataflow.py
numba/tests/test_dataflow.py
from __future__ import print_function import numba.unittest_support as unittest from numba.compiler import compile_isolated, Flags from numba.utils import PYVERSION from numba import types from .support import TestCase, CompilationCache enable_pyobj_flags = Flags() enable_pyobj_flags.set("enable_pyobject") force_py...
Python
0
@@ -2729,25 +2729,25 @@ ar_propagate -3 +4 , (1, 1))%0A @@ -2785,25 +2785,25 @@ ar_propagate -3 +4 , (1, 0))%0A @@ -2845,17 +2845,17 @@ ropagate -3 +4 , (1, -1 @@ -2898,25 +2898,25 @@ ar_propagate -3 +4 , (0, 1))%0A @@ -2954,25 +2954,25 @@ ar_propagate -3 +4 , (0, 0))%0A @@ -3006,33 +3006,33 @@ nc(va...
2a9b440d4125b87b19b26b2d5118f8c7e5b54c1f
Add WriteHTMLForTraceDataToFile method that allow create trace viewer in html directly from trace data
trace_viewer/build/trace2html.py
trace_viewer/build/trace2html.py
# Copyright (c) 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import base64 import gzip import optparse import shutil import os import StringIO import sys import tempfile from trace_viewer import trace_viewer_proje...
Python
0
@@ -186,16 +186,28 @@ rt gzip%0A +import json%0A import o @@ -1378,16 +1378,17 @@ turn 0%0A%0A +%0A class Vi @@ -1446,24 +1446,33 @@ _(self, -filename +trace_data_string ):%0A s @@ -1525,27 +1525,45 @@ lf._ -filename = filename +trace_data_string = trace_data_string %0A%0A @@ -1722,60 +1722,8 @@ O()%0A -...
3499928f59c611b4f815d6cc64d8e41335f34ffe
version bump
meshio/__about__.py
meshio/__about__.py
# -*- coding: utf-8 -*- # __version__ = '1.8.1' __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
@@ -38,17 +38,17 @@ = '1.8. -1 +2 '%0A__auth
58968ee7347d7f4c3f1640a6e480b212a9fbf61a
Add comment so source can be checked in tests
fmriprep/interfaces/patches.py
fmriprep/interfaces/patches.py
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Temporary patches ----------------- """ from random import randint from time import sleep from numpy.linalg.linalg import LinAlgError from nipype.algorithms import confounds a...
Python
0
@@ -1990,17 +1990,73 @@ ppet = ' -' +%3C!-- %7B%7D completed without error --%3E'.format(self._header) %0A
69cb9f4a1eae09f76875a9483e13a7f221339d85
rename metric
corehq/apps/couch_sql_migration/tasks.py
corehq/apps/couch_sql_migration/tasks.py
from __future__ import absolute_import from __future__ import unicode_literals from celery.schedules import crontab from celery.task import periodic_task from corehq.apps.es import DomainES, filters, aggregations from corehq.util.datadog.gauges import datadog_gauge @periodic_task('background_queue', run_every=cront...
Python
0.999292
@@ -785,21 +785,23 @@ gration. -total +domains _remaini
b7a00605bb96e452f50c5ec5b9cc93a154a0ce18
add logs and tests
mesoshttp/offers.py
mesoshttp/offers.py
import logging import json import requests from mesoshttp.core import CoreMesosObject from mesoshttp.exception import MesosException from google.protobuf.json_format import MessageToJson class Offer(CoreMesosObject): ''' Wrapper class for Mesos offers ''' PROTOBUF_FORMAT = 'protobuf' JSON_FORM...
Python
0.000001
@@ -552,16 +552,68 @@ sOffer%0A%0A + def get_offer(self):%0A return self.offer%0A%0A def @@ -968,32 +968,153 @@ str%0A '''%0A + if not operations:%0A self.logger.debug('Mesos:Accept:no operation to accept')%0A return True%0A%0A offer_id
d98f97e00e12eb7ba9a2cd1c2b9ae11ed47b91af
Add domain or and ilike
openacademy/models/models.py
openacademy/models/models.py
# -*- coding: utf-8 -*- from openerp import models, fields, api class Course(models.Model): _name = 'course' name = fields.Char(string='Title', required=True) description = fields.Text(string='Descripcion') responsible = fields.Many2one('res.users', ondelete='set null', string="Responsible", ...
Python
0
@@ -500,16 +500,255 @@ partner' +,string=%22Instructor%22, %0A domain=%5B'%7C',%0A (%22instructor%22,%22=%22,True),%0A (%22category_id.name%22,%22ilike%22,%22Teacher%22)%0A %5D%0A )%0A ...
3e353d54ffebbcae3afbd02c89cbc33ec4a6eec2
update tests to match change in decorators
corehq/apps/sso/tests/test_decorators.py
corehq/apps/sso/tests/test_decorators.py
from unittest import mock from django.test import TestCase, RequestFactory from corehq.apps.sso.decorators import ( identity_provider_required, use_saml2_auth, ) from corehq.apps.sso.tests import generator class TestDecorators(TestCase): @classmethod def setUpClass(cls): super().setUpClass(...
Python
0
@@ -601,16 +601,222 @@ slug, )%0A + self.request.is_secure = lambda: False%0A self.request.META = %7B%0A 'HTTP_HOST': 'test.commcarehq.org',%0A 'PATH_INFO': '/sso/test',%0A 'SERVER_PORT': '80',%0A %7D%0A @@ -1464,16 +1464,78 @@ lf.idp)%0A + self.a...
05d0eb79813319f8d1903a26e3c9718c05617e8b
fix typo in comment
website_product_subscription/controllers/main.py
website_product_subscription/controllers/main.py
# -*- coding: utf-8 -*- import base64 import datetime import re import werkzeug import werkzeug.urls from openerp import http, SUPERUSER_ID from openerp.http import request from openerp.tools.translate import _ class WebsiteProductSubscription(http.Controller): @http.route(['/page/become_sub...
Python
0.000054
@@ -993,20 +993,16 @@ iber is -not connecte
9b6fdbe9ace861d81662a300904a641a2ed45f40
Make spotify scrollable and support unicode in all python versions
bumblebee/modules/spotify.py
bumblebee/modules/spotify.py
# pylint: disable=C0111,R0903 """Displays the current song being played Requires the following library: * python-dbus Parameters: * spotify.format: Format string (defaults to "{artist} - {title}") Available values are: {album}, {title}, {artist}, {trackNumber}, {playbackStatus} * ...
Python
0
@@ -705,16 +705,28 @@ WN%0A%22%22%22%0A%0A +import sys%0A%0A import b @@ -2246,10 +2246,8 @@ %22)%0A%0A -## @@ -2305,30 +2305,31 @@ return s -tr(s elf. +string _song -) %0A%0A de @@ -2364,22 +2364,23 @@ rn s -tr(s elf. +string _song -) == @@ -3342,16 +3342,29 @@ se %22%22,)%0A + %0A ...
0e779581be648ca80eea6b97f9963606d85659b9
Add exporter to VisualSfM format
opensfm/commands/__init__.py
opensfm/commands/__init__.py
import extract_metadata import detect_features import match_features import create_tracks import reconstruct import mesh import undistort import compute_depthmaps import export_ply import export_openmvs opensfm_commands = [ extract_metadata, detect_features, match_features, create_tracks, reconstr...
Python
0.000001
@@ -196,16 +196,40 @@ _openmvs +%0Aimport export_visualsfm %0A%0Aopensf @@ -426,10 +426,32 @@ penmvs,%0A + export_visualsfm,%0A %5D%0A
910992cecab497b673d0d530602d34cc2c42b77c
Remove person_entities method.
dexter/models/person.py
dexter/models/person.py
# -*- coding: utf-8 -*- from itertools import groupby from sqlalchemy import ( Column, DateTime, ForeignKey, Integer, String, func, ) from sqlalchemy.orm import relationship from .support import db class Person(db.Model): """ A person, with a bit more info than just the 'person' ...
Python
0.000003
@@ -2447,635 +2447,8 @@ p%0A%0A%0A - @classmethod%0A def person_entities(cls):%0A %22%22%22%0A Get a list of (person_id, entity_id, person_name) tuples for all%0A entities that are linked to a Person. Each person is returned only once.%0A %22%22%22%0A from . import Entity%0A%0A...
c44fca355d93d3a46d4782af1e4c859f6d640f34
Change back to the working directory for git hashing.
metaplot/helpers.py
metaplot/helpers.py
import os import sys import subprocess import pkg_resources try: import pkg_resources _has_pkg_resources = True except: _has_pkg_resources = False try: import svn.local _has_svn_local = True except: _has_svn_local = False def test_helper(): return "test helper text" def dict_to_str(d...
Python
0
@@ -3968,24 +3968,41 @@ ry.%0A %22%22%22%0A + thisdir = ''%0A if gitpa @@ -4005,16 +4005,46 @@ itpath:%0A + thisdir = os.getcwd()%0A @@ -4061,16 +4061,25 @@ itpath)%0A + %0A try: @@ -4288,24 +4288,47 @@ return %7B%7D +%0A%0A os.chdir(thisdir) %0A %0A if
4938c7d32f4f95001b5ebb7dc35b5121880de87c
add info log
cameo/spiderForTECHORANGE.py
cameo/spiderForTECHORANGE.py
# -*- coding: utf-8 -*- """ Copyright (C) 2015, MuChu Hsu Contributed by Muchu Hsu (muchu1983@gmail.com) This file is part of BSD license <https://opensource.org/licenses/BSD-3-Clause> """ from selenium import webdriver import os import time import logging import re import random from cameo.utility import Utility from...
Python
0
@@ -4766,16 +4766,73 @@ %3E 200:%0A + logging.info(%22limit str less then 200 char%22)%0A
6da148e4dbcfdbc633efb4ada1e736356aed5d34
Add compatibility for cms 3.5
cms_bootstrap3/templatetags/bootstrap_tags.py
cms_bootstrap3/templatetags/bootstrap_tags.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django import template from menus.menu_pool import menu_pool from classytags.arguments import IntegerArgument, StringArgument, Argument, Flag from classytags.helpers import InclusionTag from classytags.core import Options from menus.templatetags.menu_...
Python
0
@@ -2515,45 +2515,205 @@ -nodes = menu_pool.get_nodes(request, +menu_renderer = context.get('cms_menu_renderer')%0A %0A if not menu_renderer:%0A menu_renderer = menu_pool.get_renderer(request)%0A %0A nodes = menu_renderer.get_nodes( name @@ -3395,20 +3395,24 @@ = menu_ -...
52f21a4f3a61497099fc6483bde00d60307297c7
Fix formatting
base10/transports/udp_transport.py
base10/transports/udp_transport.py
import sys from socket import socket, AF_INET, SOCK_DGRAM from base10.base import Writer from base10.exceptions import TransportError PY3 = sys.version_info.major == 3 class UDPWriter(Writer): def __init__(self, host, port): self._host = host self._port = port self._socket = socket(AF_...
Python
0.057169
@@ -129,17 +129,16 @@ tError%0A%0A -%0A PY3 = sy @@ -404,24 +404,41 @@ cket.sendto( +%0A string.encod @@ -480,16 +480,29 @@ f._port) +%0A )%0A
4a5ea8cd5f60a18519467ac910dd7577a417240b
make error clearer
migrate/__init__.py
migrate/__init__.py
# -*- coding: utf-8 -*- from .migration import Migration from importlib import import_module import os # the way this is used in a slice means that if we want all the migrations we # need to specify them as `None` (because `[1,2,3][:None] == [1,2,3]`). Since # this is pretty confusing, it's specified in this name inst...
Python
0.000087
@@ -1214,18 +1214,20 @@ run in +%22 %25s +%22 ' %25 self
416575ca3cc684925be0391b43b98a9fa1d9f909
Save the image of the selection (to be able to reinitialise later)
ObjectTracking/testTrack.py
ObjectTracking/testTrack.py
from SimpleCV import ColorSegmentation, Image, Camera, VirtualCamera, Display # Open reference video cam=VirtualCamera('/media/bat/DATA/Baptiste/Nautilab/kite_project/zenith-wind-power-read-only/KiteControl-Qt/videos/kiteFlying.avi','video') # Select reference image img=cam.getFrame(50) modelImage = img.crop(255, 180...
Python
0
@@ -71,16 +71,23 @@ Display +, Color %0A%0A# Open @@ -586,16 +586,55 @@ es = 1)%0A +%09modelImage = Image('kite_detail.jpg')%0A @@ -991,12 +991,43 @@ draw -Path +()%0A%09ts.drawBB()%0A%09ts.showCoordinates ()%0A%09
68a1ac1aa5a886460968348aac2ba843d6c5d624
Version 3.1.0
mimesis/__init__.py
mimesis/__init__.py
# -*- coding: utf-8 -*- """Mimesis is a Python library, which helps generate synthetic data. Copyright (c) 2016 - 2018 Likid Geimfari (Isaak Uchakaev) Repository: https://github.com/lk-geimfari/mimesis Email: <likid.geimfari@gmail.com> """ from mimesis.providers import * __all__ = [ 'Address', 'BaseDataProv...
Python
0.000001
@@ -844,17 +844,17 @@ __ = '3. -0 +1 .0'%0A__ti
1ad9130ed788fcc0d7aadef3365082ce2fa2c78c
Remove modifying sys.path in package __init__
distutilazy/__init__.py
distutilazy/__init__.py
""" distutilazy ----------- Extra distutils command classes. :license: MIT, see LICENSE for more details. """ from os.path import dirname, abspath import sys __version__ = "0.4.0" __all__ = ("clean", "pyinstaller", "command") base_dir = abspath(dirname(dirname(__file__))) if base_dir not in sys.path: if len(sy...
Python
0.000001
@@ -110,57 +110,8 @@ %22%22%0A%0A -from os.path import dirname, abspath%0Aimport sys%0A%0A __ve @@ -178,184 +178,4 @@ d%22)%0A -%0Abase_dir = abspath(dirname(dirname(__file__)))%0Aif base_dir not in sys.path:%0A if len(sys.path):%0A sys.path.insert(1, base_dir)%0A else:%0A sys.path.append(base_di...
0500d6daceffc3a58af11f1c063e5e580ce726dc
Update opentelemetry-proto for bazel build to 0.9.0 (#984)
bazel/repository.bzl
bazel/repository.bzl
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def opentelemetry_cpp_deps(): """Loads dependencies need to compile the opentelemetry-cpp library.""" # Google Benchmark library. # Only needed for benchmarks, not to build t...
Python
0
@@ -1971,72 +1971,72 @@ = %22 -08f090570e0a112bfae276ba37e9c45bf724b64d902a7a001db33123b840ebd6 +9ec38ab51eedbd7601979b0eda962cf37bc8a4dc35fcef604801e463f01dcc00 %22,%0A @@ -2080,17 +2080,17 @@ proto-0. -6 +9 .0%22,%0A @@ -2181,17 +2181,17 @@ hive/v0. -6 +9 .0.tar.g
2b44e3a6580307c4332bda2a70eb6d2d5cb56ec7
Save model after epoch
Utils/py/cnn-segmentation-classification/train.py
Utils/py/cnn-segmentation-classification/train.py
#!/usr/bin/env python3 import argparse import pickle import keras from keras.models import * from keras.layers import * def conv_block(inputs, filters, kernel_size): x = inputs if kernel_size is not None and (kernel_size[0] == 3 and kernel_size[1] == 3): x = ZeroPadding2D((1,1))(x) x = Conv2D(filt...
Python
0
@@ -2612,16 +2612,135 @@ mary())%0A +%0Asave_callback = keras.callbacks.ModelCheckpoint(filepath='model.h5', monitor='loss', verbose=1, save_best_only=True)%0A%0A model.fi @@ -2804,16 +2804,43 @@ plit=0.1 +, callbacks=%5Bsave_callback%5D )%0Amodel.
9f5a2b51b74ae7fcb8e5e7309ea0deaa5ab7548a
Rectify assert msg grammar
bears/tests/LocalBearTestHelper.py
bears/tests/LocalBearTestHelper.py
from queue import Queue import unittest from coalib.bears.LocalBear import LocalBear from coalib.results.Result import Result from coalib.settings.Section import Section from coalib.settings.Setting import Setting from bears.tests.BearTestHelper import generate_skip_decorator class LocalBearTestHelper(unittest.TestC...
Python
0.003304
@@ -2540,32 +2540,35 @@ given bear is no +t a local bear.%22)%0A @@ -4740,16 +4740,19 @@ ar is no +t a local b
a0ac251bec891a6c511ea1c0b11faa6525b81545
Support more C++ extensions by default
bfg9000/languages.py
bfg9000/languages.py
ext2lang = { '.cpp': 'c++', '.c': 'c', }
Python
0
@@ -6,16 +6,33 @@ ang = %7B%0A + '.c' : 'c',%0A '.cp @@ -49,18 +49,117 @@ %0A '.c -' +c' : 'c +++',%0A '.cp' : 'c++',%0A '.cxx': 'c++',%0A '.CPP': 'c++',%0A '.c++': 'c++',%0A '.C' : 'c++ ',%0A%7D%0A
117e228dbb7cb50d2b7a963d24fb4dc869903a3e
Add default point size and frames per second information to kiwi scene file
VelodyneHDL/python/veloview/kiwiviewerExporter.py
VelodyneHDL/python/veloview/kiwiviewerExporter.py
import json import shutil import zipfile import contextlib import os import tempfile import datetime def colorMapProperties(t): p = {} p['rgb_points'] = list(t.RGBPoints) if t.ColorSpace == 'HSV' and t.HSVWrap: p['color_space'] = 'WrappedHSV' else: p['color_space'] = t.ColorSpace p...
Python
0
@@ -1696,16 +1696,53 @@ ata(rep) +%0A objectMetaData%5B'point_size'%5D = 2 %0A%0A if @@ -1818,16 +1818,65 @@ lenames%0A + objectMetaData%5B'frames_per_second'%5D = 18%0A else
3c7714e22304b6bbdefccc87d4ab3f449c233f44
change indicator type
Packs/FeedSpamhaus/Integrations/FeedSpamhaus/FeedSpamhaus.py
Packs/FeedSpamhaus/Integrations/FeedSpamhaus/FeedSpamhaus.py
from CommonServerPython import * def main(): params = {k: v for k, v in demisto.params().items() if v is not None} feed_url_to_config = { # TODO: Add this sub feed once we have an indicator type of ASN 'https://www.spamhaus.org/drop/asndrop.txt': { 'indicator_type': 'ASN', ...
Python
0.000001
@@ -916,34 +916,36 @@ edIndicatorType. -IP +CIDR ,%0A 'i @@ -1174,10 +1174,12 @@ ype. -IP +CIDR ,%0A
d303c63b2d868dbe66b8d34f99a2c8a436fbc2a2
Remove static file from settings.py. Was not used.
django_723e/settings.py
django_723e/settings.py
""" Django settings for django_723e project. For more information on this file, see https://docs.djangoproject.com/en/1.6/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.6/ref/settings/ """ # Build paths inside the project like this: os.path.join(BASE_DIR, ......
Python
0
@@ -1990,302 +1990,8 @@ %0A%5D%0A%0A -# Additional locations of static files%0ASTATICFILES_DIRS = (%0A # Put strings here, like %22/home/html/static%22 or %22C:/www/django/static%22.%0A # Always use forward slashes, even on Windows.%0A # Don't forget to use absolute paths, not relative paths.%0A os.path.jo...
ca4e7393c4d9ddd50e14dd06da10d8389b018670
Update ImpNotes.py
DeepNetwork/ImpNotes.py
DeepNetwork/ImpNotes.py
#### https://www.youtube.com/watch?v=yX8KuPZCAMo # Very Good Link from Edureka for tensorflow basics Really Good # A placeholder is nothing but a promise to provide the value later a = tf.placeholder(tf.float32) b = tf.placeholder(tf.float32) adder_node = a+b sess = tf.Session() print(sess.run(adder_node...
Python
0
@@ -1302,28 +1302,871 @@ ###########################%0A +### Now by changing W and b we can actually reduce the loss.%0A## Now if W = -1 and b =1 then our our linear_model becomes y i.e. output of our model becomes the actual output%0A## -1 x 1 + 1 = 0%0A## -1 x 2 + 1 = -1%0A## -1 x 3 + 1 = -2%0A## -1 x 4 + 1 = -3%0A#...
22281b85427fbee77fd2dcde1f0480bf6cf43ea0
Add south_triple_field
django_bleach/models.py
django_bleach/models.py
from django.db import models from django_bleach import forms from django_bleach.utils import get_bleach_default_options from django_bleach.forms import default_widget class BleachField(models.TextField): def __init__(self, allowed_tags=None, allowed_styles=None, allowed_attributes=None, strip_tags=None, strip_...
Python
0.999992
@@ -1278,8 +1278,123 @@ ptions)%0A +%0A def south_field_triple(self):%0A return ('django_bleach.forms.BleachField', %5B%5D, self.formfield_defaults)%0A
fe3c91ed7ca2997a7b80839ab6357271788bf059
Fix expiry notice script
ccvpn/scripts/expire_mail.py
ccvpn/scripts/expire_mail.py
""" This script sends an email to accounts that are going to expire or has expired. """ import sys from argparse import ArgumentParser, RawTextHelpFormatter from datetime import datetime, timedelta from sqlalchemy import engine_from_config from sqlalchemy.sql import or_ from sqlalchemy.sql import func from sqlalchemy...
Python
0.000014
@@ -302,40 +302,8 @@ unc%0A -from sqlalchemy import Interval%0A from @@ -536,55 +536,26 @@ der%0A -from pyramid.i18n import -T +t rans -l a +c tion -String as _ %0A%0Afr @@ -676,17 +676,16 @@ ailer):%0A -%0A body @@ -1837,20 +1837,16 @@ s=days)%0A - %0A q = @@ -2600,16 +2600,17 @@ users%0A%0A...
059c1d9e99bb20a17c2d2c84215e53bd2cbe517d
remove unused declaration
polling_stations/apps/data_collection/management/commands/import.py
polling_stations/apps/data_collection/management/commands/import.py
import glob, os, re from importlib.machinery import SourceFileLoader from multiprocessing import Pool from django.apps import apps from django.core.management.base import BaseCommand from pollingstations.models import PollingStation # does this regular expression match any of the elements in this list? def match_in(...
Python
0.000002
@@ -4810,93 +4810,8 @@ ()%0A%0A - opts = %7B%0A 'noclean': False,%0A 'verbosity': 1%0A %7D%0A%0A
0f9224a8c10c49a395b876e139968b30d7b2209a
Fix bug where a file without existing labels was handled incorrectly.
analysis/apply-label-mapping.py
analysis/apply-label-mapping.py
#!/usr/bin/env python # vim: set sw=2 ts=2 softtabstop=2 expandtab tw=80 colorcolumn=80: """ This script takes a correctness mapping file and applies it to the provide results YAML file """ import argparse import logging import os import pprint import sys import yaml try: # Try to use libyaml which is faster from ...
Python
0
@@ -3082,24 +3082,150 @@ stingLabel:%0A + logging.info('Existing label is missing. Using correctness label of %7B%7D'%0A 'for %7B%7D'.format(newLabel, programName))%0A r%5B'exp @@ -3247,24 +3247,52 @@ = newLabel%0A + labelChangeCount += 1%0A else:%0A
9d9e32693f9bb1f707b38dcee49a18374b7a2067
Update __init__.py
dmoj/cptbox/__init__.py
dmoj/cptbox/__init__.py
from collections import defaultdict from dmoj.cptbox.sandbox import SecurePopen, PIPE from dmoj.cptbox.handlers import DISALLOW, ALLOW from dmoj.cptbox.chroot import CHROOTSecurity from dmoj.cptbox.syscalls import SYSCALL_COUNT if sys.version_info.major == 2: range = xrange class NullSecurity(defaultdict): d...
Python
0.000072
@@ -256,23 +256,24 @@ == -2 +3 :%0A +x range = xran @@ -268,17 +268,16 @@ range = -x range%0A%0Ac @@ -349,16 +349,17 @@ or i in +x range(SY
a41a76b7e4cdf4a8cbc533550963921839dcd998
Fix formatting errors reported by flake8.
mopidy_pandora/rpc.py
mopidy_pandora/rpc.py
import json import requests class RPCClient(object): def __init__(self, hostname, port): self.url = 'http://' + str(hostname) + ':' + str(port) + '/mopidy/rpc' self.id = 0 def _do_rpc(self, method, params=None): self.id += 1 data = { 'method': method, 'jsonrpc': '2.0', 'id'...
Python
0
@@ -272,17 +272,16 @@ data = %7B - 'method' @@ -321,17 +321,16 @@ self.id - %7D%0A @@ -771,9 +771,8 @@ %5B'uri'%5D%0A -%0A
e17f8f4abbe6fbde638b4bb14db5cf1c7d3bd47f
Update setup.py
browsertest/setup.py
browsertest/setup.py
from setuptools import setup import sys sys.path.append('./tests') setup(name='browsertest', version='1.0', description='test a project by browser', test_suite = 's_test.suite', install_requires=[ 'selenium', ], )
Python
0.000001
@@ -147,10 +147,10 @@ ect -by +on bro @@ -253,8 +253,9 @@ ,%0A ) +%0A
d197e11bb9b41417ed4866b10c21c3cb5d57ab63
Implement an access check method to determine if the mentor can access a particular survey.
app/soc/modules/gsoc/views/helper/access_checker.py
app/soc/modules/gsoc/views/helper/access_checker.py
#!/usr/bin/env python2.5 # # Copyright 2011 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 applic...
Python
0.000048
@@ -4500,16 +4500,770 @@ T_MSG)%0A%0A + def isMentorForSurvey(self):%0A %22%22%22Checks if the user is the mentor for the project or org admin.%0A %22%22%22%0A assert access_checker.isSet(self.data.project)%0A%0A self.isProjectInURLValid()%0A%0A # check if the currently logged in user is the mentor or ...
bafd781aae282523c506f068d41cf34057320e2b
Fix redundant list comprehensions in recently introduced code.
benchmark/scripts/compare_perf_tests.py
benchmark/scripts/compare_perf_tests.py
#!/usr/bin/python # -*- coding: utf-8 -*- # ===--- compare_perf_tests.py --------------------------------------------===// # # This source file is part of the Swift.org open source project # # Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors # Licensed under Apache License v2.0 with Runtime Librar...
Python
0.000001
@@ -4659,36 +4659,29 @@ keys = -%5Bf for f in +list( set(scores.k @@ -4682,25 +4682,25 @@ ores.keys()) -%5D +) %0A key @@ -5103,20 +5103,13 @@ s = -%5Bf for f in +list( set( @@ -5140,17 +5140,17 @@ .keys()) -%5D +) %0A key
4ebdf285e71db51544367a7839687fe1a8f317d8
version 1.0
modipyd/__init__.py
modipyd/__init__.py
""" Modipyd: Autotest for Python, and more ======================================= **Modipyd** is a `Python`_ module dependency analysis and monitoring modification framework, written by Takanori Ishikawa and licensed under `the MIT license`_. **This project aims to provide:** * Automated testing tool **pyautotest**...
Python
0.000002
@@ -861,11 +861,8 @@ '1.0 -rc2 '%0A__
3a2338bce37811a1d7fdbcbba6d6b7b0c46edff2
Fix time-sensitivity (< 0.002 second execution) in output format.
test/scons-time/func/format-gnuplot.py
test/scons-time/func/format-gnuplot.py
#!/usr/bin/env python # # __COPYRIGHT__ # # 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, modify, merge, publish, ...
Python
0.000002
@@ -2105,68 +2105,68 @@ p%0A0 -0.00%5B012%5D%0A1 0.00%5B012%5D%0Ae%0A# Full build%0A0 0.00%5B012%5D%0A1 0.00%5B012%5D +%5Cd.%5Cd%5Cd%5Cd%0A1 %5Cd.%5Cd%5Cd%5Cd%0Ae%0A# Full build%0A0 %5Cd.%5Cd%5Cd%5Cd%0A1 %5Cd.%5Cd%5Cd%5Cd %0Ae%0A# @@ -2189,29 +2189,29 @@ d%0A0 -0.00%5B012%5D%0A1 0.00%5B012%5D +%5Cd.%5Cd%5Cd%5Cd%0A...
e1c1831f8126c25515d6acbeea6cedc38d82fa8c
Increase maximum parameter to 20, and increase logbf threshold
modish/estimator.py
modish/estimator.py
import matplotlib.pyplot as plt import numpy as np import pandas as pd from .model import ModalityModel CHANGING_PARAMETERS = np.arange(2, 20) TWO_PARAMETER_MODELS = {'bimodal': {'alphas': 1./CHANGING_PARAMETERS, 'betas': 1./CHANGING_PARAMETERS}, 'middle': ...
Python
0.000001
@@ -135,17 +135,17 @@ nge(2, 2 -0 +1 )%0A%0ATWO_P @@ -1176,17 +1176,18 @@ _thresh= -3 +10 , model_
0788aaf316a2b200c5283fe9f5f902a8da701403
Add a test for julian_to_gregorian.
calexicon/internal/tests/test_julian.py
calexicon/internal/tests/test_julian.py
import unittest from calexicon.internal.julian import distant_julian_to_gregorian class TestJulian(unittest.TestCase): def test_distant_julian_to_gregorian(self): self.assertEqual(distant_julian_to_gregorian(9999, 12, 1), (10000, 2, 12))
Python
0.000187
@@ -75,16 +75,37 @@ regorian +, julian_to_gregorian %0A%0A%0Aclass @@ -267,8 +267,123 @@ 2, 12))%0A +%0A def test_julian_to_gregorian(self):%0A self.assertEqual(julian_to_gregorian(1984, 2, 29), (1984, 3, 13))%0A
c53551059c5e960b14da97bb89b21e3f4e001638
Fix security patch.
src/python/frontend/RequestsDBAPI.py
src/python/frontend/RequestsDBAPI.py
"""Requests Database RESTful API.""" import json import logging from datetime import datetime from collections import Mapping import cherrypy from utils.sqlalchemy_utils import create_db, db_session from tables import Requests, Users, ParametricJobs logger = logging.getLogger(__name__) # pylint: disable=invalid-name ...
Python
0
@@ -5312,32 +5312,119 @@ .verified_user%0A%0A + if kwargs.get('status') != %22Approved%22:%0A kwargs.pop('status', None)%0A%0A with db_ @@ -5447,32 +5447,32 @@ rl) as session:%0A - quer @@ -5547,32 +5547,75 @@ equester.admin:%0A + kwargs.pop('status', None)%0A ...
206eaf2c20361c86b7441cd49ba8ec0313bb347b
Fix DepsTracker to also list @rpath file paths
cerbero/tools/depstracker.py
cerbero/tools/depstracker.py
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2013 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
Python
0
@@ -2255,38 +2255,39 @@ n')%5B1:%5D%0A -return +files = %5Bx.split(' ')%5B0 @@ -2313,32 +2313,110 @@ s if prefix in x + or %22@rpath%22 in x%5D%0A return %5Bx.replace(%22@rpath/%22, prefix) for x in files %5D%0A%0A%0Aclass LddLis
dc11f71ff0fa95813c0bca120827e8c5607003ba
Add NextToken element to appropriate SNS responses. cc #144
moto/sns/responses.py
moto/sns/responses.py
import json from moto.core.responses import BaseResponse from moto.core.utils import camelcase_to_underscores from .models import sns_backend class SNSResponse(BaseResponse): def create_topic(self): name = self._get_param('Name') topic = sns_backend.create_topic(name) return json.dumps(...
Python
0.000006
@@ -856,16 +856,56 @@ topics%5D +,%0A 'NextToken': None, %0A @@ -4582,32 +4582,72 @@ n subscriptions%5D +,%0A 'NextToken': None, %0A @@ -5492,16 +5492,56 @@ iptions%5D +,%0A 'NextToken': None, %0A
e382085c89371002706ab6a9efd31ca1ed79796c
Mark version info with beta1 tag.
IPython/core/release.py
IPython/core/release.py
# -*- coding: utf-8 -*- """Release data for the IPython project.""" #----------------------------------------------------------------------------- # Copyright (c) 2008, IPython Development Team. # Copyright (c) 2001, Fernando Perez <fernando.perez@colorado.edu> # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>...
Python
0
@@ -1037,16 +1037,17 @@ d above%0A +# _version @@ -1061,16 +1061,41 @@ = 'dev'%0A +_version_extra = 'beta1'%0A #_versio
e728dc8fdfb0955844626cf0e1b26c294bc512b3
add detail endpoint
InvenTree/plugin/api.py
InvenTree/plugin/api.py
""" JSON API for the plugin app """ # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.conf.urls import url from django.utils.translation import ugettext_lazy as _ from rest_framework import generics from plugin.models import PluginConfig import plugin.serializers as PluginSerializers cla...
Python
0.000001
@@ -758,27 +758,548 @@ %5D%0A%0A%0A -plugin_api_urls = %5B +class PluginDetail(generics.RetrieveUpdateDestroyAPIView):%0A %22%22%22 API detail endpoint for PluginConfig object%0A%0A get:%0A Return a single PluginConfig object%0A%0A post:%0A Update a PluginConfig%0A%0A delete:%0A Remove a PluginCon...
d9a236f446af8c7724ebcabaec8d8b8ed4bae30b
Fix checks
cogs/utils/checks.py
cogs/utils/checks.py
# noinspection PyUnresolvedReferences from discord.ext import commands # noinspection PyUnresolvedReferences import __main__ def owner_check(ctx): return ctx.message.author.id in __main__.liara.owners def is_owner(): return commands.check(owner_check) def is_bot_account(): def predicate(ctx): ...
Python
0.000002
@@ -1394,32 +1394,24 @@ permission, -default= False)%0A @@ -2273,32 +2273,24 @@ permission, -default= False)%0A @@ -2865,16 +2865,8 @@ on, -default= Fals
bbb893792bcc4b4ec24218246ef03b6ce1be05cc
Fix for working with most recent version of pyral
src/TestManagementLibrary/connection_manager.py
src/TestManagementLibrary/connection_manager.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015 Lingaro import traceback import socket from robot.api import logger from .utils import get_netloc_and_path from .rally import WrappedRally class ConnectionManager(object): """ Connection Manager handles the connection & disconnection to th...
Python
0
@@ -4037,23 +4037,28 @@ ect'%5D = +str( project +) %0A @@ -4106,16 +4106,20 @@ ace'%5D = +str( workspac @@ -4119,16 +4119,17 @@ orkspace +) %0A
0b8ac543e21b2a9752bdd38e0c7beb94ba3e32e7
Remove 11699 annotation
upgrade_crc_check_chance_test.py
upgrade_crc_check_chance_test.py
from assertions import assert_crc_check_chance_equal, assert_one from dtest import Tester, debug from tools import known_failure, since @since('3.0') class TestCrcCheckChanceUpgrade(Tester): def __init__(self, *args, **kwargs): # Ignore these log patterns: self.ignore_log_patterns = [ ...
Python
0.000001
@@ -111,23 +111,8 @@ port - known_failure, sin @@ -625,166 +625,8 @@ s)%0A%0A - @known_failure(failure_source='test',%0A jira_url='https://issues.apache.org/jira/browse/CASSANDRA-11699',%0A flaky=True)%0A
0ce5ed4edcbc61e01071b2c8a280c07fdac74236
Use build image in prestoadmin_installer.py
tests/product/prestoadmin_installer.py
tests/product/prestoadmin_installer.py
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
Python
0
@@ -3328,16 +3328,23 @@ rovider( +%22build%22 )%0A%0A
7a46373f8b95a0d8b09efc8b6afccb49420e392a
fix version handling
ddt_request_history/panels/request_history.py
ddt_request_history/panels/request_history.py
from __future__ import absolute_import, unicode_literals from datetime import datetime import json import logging import os import threading import sys import uuid from django.conf import settings from django.http import HttpResponse from django.template import Template from django.template.context import Context fro...
Python
0.000001
@@ -55,38 +55,8 @@ ls%0A%0A -from datetime import datetime%0A impo @@ -129,16 +129,112 @@ t uuid%0A%0A +import debug_toolbar%0A%0Afrom datetime import datetime%0Afrom distutils.version import LooseVersion%0A%0A from dja @@ -433,37 +433,16 @@ y as _%0A%0A -import debug_toolbar%0A from deb @@ -697,13 +697,20 @@ n ...
7f1542bc52438e6c9796e776603553d7f5a9df7f
Debug in importing deleted module.
pySpatialTools/utils/util_classes/__init__.py
pySpatialTools/utils/util_classes/__init__.py
""" Util classes ------------ Classes which represent data types useful for the package pySpatialTools. """ from spdesc_mapper import Sp_DescriptorMapper from spatialelements import SpatialElementsCollection, Locations from Membership import Membership from general_mapper import General1_1Mapper from mapper_vals_i i...
Python
0
@@ -253,52 +253,8 @@ hip%0A -from general_mapper import General1_1Mapper%0A from
cfdca2464aab57e8fdb29d03bff88307d1dff609
Fix deprecation warnings in testsuite
vasputil/tests/test_supercell.py
vasputil/tests/test_supercell.py
# -*- coding: utf-8 -*- # vim: set fileencoding=utf-8 # Copyright (c) 2008, 2010 Janne Blomqvist # This file is part of Vasputil. # Vasputil is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either versio...
Python
0.000045
@@ -883,18 +883,40 @@ s s%0A -import ase +from ase.io import read as aread %0Aimp @@ -1248,27 +1248,24 @@ )%0A c1 = a -se. read(p1, for @@ -1326,27 +1326,24 @@ )%0A c2 = a -se. read(p2, for @@ -1790,19 +1790,16 @@ cell = a -se. read(pat
73ae36396b7562233b06083412b81d86ce487177
Update rockets.py
src/tenyksscripts/scripts/rockets.py
src/tenyksscripts/scripts/rockets.py
import datetime import requests import time def run(data, settings): if data["payload"] != "nextlaunch": return launches = requests.get("https://launchlibrary.net/1.2/launch", params={"next": 1, "mode": "verbose"}).json() if not launches["count"]: return "No launches scheduled" launc...
Python
0
@@ -91,11 +91,16 @@ d%22%5D -!= +not in %5B %22nex @@ -107,16 +107,75 @@ tlaunch%22 +, %22next launch%22, %22smooth baby rocket%22, %22WHOOOOOOOOOOOOOSH%22%5D :%0A
01288bb6785e3eeb8daa1328901cd5827e95b2fd
Update problem_27.py
python_challenges/project_euler/problem_27.py
python_challenges/project_euler/problem_27.py
import os import sys current_path = os.path.dirname(os.path.abspath(__file__)) lib_path = os.path.join(current_path, '..') sys.path.append(lib_path) from lib.prime import Prime class QuadraticPrimes: """ Quadratic primes Problem 27 Euler discovered the remarkable quadratic formula: n^2 + n + 41...
Python
0
@@ -2226,17 +2226,16 @@ eries%0A%0A%0A -%0A if __nam
0f104fc6b09bc2ec89ab665edc57adfa86bc8553
Add gruneisen lauch example
workflows/launcher/launch_gruneisen_lammps_lj.py
workflows/launcher/launch_gruneisen_lammps_lj.py
StructureData = DataFactory('structure') ParameterData = DataFactory('parameter') import numpy as np cell = [[ 3.987594, 0.000000, 0.000000], [-1.993797, 3.453358, 0.000000], [ 0.000000, 0.000000, 6.538394]] symbols=['Ar'] * 2 scaled_positions = [(0.33333, 0.66666, 0.25000), (...
Python
0.000038
@@ -1,8 +1,90 @@ +from aiida import load_dbenv%0Aload_dbenv()%0Afrom aiida.orm import Code, DataFactory%0A %0AStructu
504544eaf961b619e87541e7571acf18591a133f
Update completion loop check limit for test_threadedExternal.
thespian/test/test_threadedExternal.py
thespian/test/test_threadedExternal.py
import logging import time, datetime from thespian.test import * from thespian.actors import * import threading ASK_WAIT = datetime.timedelta(seconds=5) THREAD_WAIT_TIME=5 # seconds finishes_lock = threading.Lock() success_finishes = 0 failure_finishes = 0 def asker_main(asys, count, finished_address, ordered=Fals...
Python
0
@@ -6328,34 +6328,37 @@ for t in range( -10 +count ):%0A i
00697aeabb356c4aa3c653f9b3dfe1b619eb4dca
remove comment
src/compas_ghpython/artists/_primitiveartist.py
src/compas_ghpython/artists/_primitiveartist.py
from __future__ import print_function from __future__ import absolute_import from __future__ import division from compas_ghpython.artists._artist import BaseArtist __all__ = ["PrimitiveArtist"] class PrimitiveArtist(BaseArtist): """Base class for artists for geometry primitives. Parameters ---------- ...
Python
0
@@ -1015,54 +1015,8 @@ %22%22%22%0A - # if hasattr(self.primitive, 'name'):%0A
9b31d7135f0d1c8a434da5bce609fde2bb313974
use to correct incorrect timestamp
tierpsy/debugging/add_default_attrs.py
tierpsy/debugging/add_default_attrs.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon May 8 16:19:07 2017 @author: ajaver """ import glob import os import tables from tierpsy.helper.misc import RESERVED_EXT from tierpsy.helper.params import set_unit_conversions, read_unit_conversions from tierpsy import DFLT_PARAMS_PATH, DFLT_PARAMS_F...
Python
0.00082
@@ -761,16 +761,17 @@ =True)%0A%0A +# dname = @@ -822,16 +822,101 @@ *.hdf5'%0A +dname = '/Volumes/behavgenom_archive$/Ida/LoopBio_rig/180222_blue_light/3/**/*.hdf5'%0A fnames = @@ -1522,25 +1522,17 @@ )%0A%0A%0A +# for -skeletons_fil +fnam e in @@ -1546,16 +1546,17 @@ _files:%0A +# chan @@ -1568,30 +156...
738857645637099bcfc2b761ceadb05827774c08
Fix problem with use of unix times with relative times introduced in r739
webapp/graphite/render/attime.py
webapp/graphite/render/attime.py
"""Copyright 2008 Orbitz WorldWide Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
Python
0.000011
@@ -1340,16 +1340,21 @@ amp( - int(s) - +,tzinfo )%0A
7fd709ebd32764a15b26ec0e8086ef69080dd4cc
Use ggrep instead of grep for pcre on mac os
pre_commit/languages/pcre.py
pre_commit/languages/pcre.py
from __future__ import unicode_literals from pre_commit.languages.helpers import file_args_to_stdin from pre_commit.util import shell_escape ENVIRONMENT_DIR = None def install_environment(repo_cmd_runner, version='default'): """Installation for pcre type is a noop.""" raise AssertionError('Cannot install p...
Python
0.000001
@@ -34,16 +34,42 @@ terals%0A%0A +from sys import platform%0A%0A from pre @@ -120,16 +120,16 @@ o_stdin%0A - from pre @@ -401,16 +401,121 @@ _args):%0A + grep_command = 'grep -H -n -P'%0A if platform == 'darwin':%0A grep_command = 'ggrep -H -n -P'%0A%0A # Fo @@ -778,37 +778,41 @@ '! -grep -H -...
9fcc264a338949ba557f85584705adccc203dc54
Convert some exceptions to asserts.
bayeslite/bql.py
bayeslite/bql.py
# -*- coding: utf-8 -*- # Copyright (c) 2010-2014, MIT Probabilistic Computing Project # # 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/LICENS...
Python
0.999328
@@ -1120,18 +1120,34 @@ )%0A el -if +se:%0A assert select. @@ -1157,17 +1157,17 @@ ntifier -! += = ast.SE @@ -1180,68 +1180,8 @@ _ALL -:%0A raise ValueError('Invalid select: %25s' %25 (select,)) %0A @@ -2422,74 +2422,20 @@ -raise ValueError('Unknown BQL function in select: %25s' %25 (s...
efbea8320518d94c8c7eeb23a90d8e97a4727fb6
make sure test can find the test-management-command
django_extensions/tests/management_command.py
django_extensions/tests/management_command.py
# -*- coding: utf-8 -*- import logging from cStringIO import StringIO from django.core.management import call_command from django.test import TestCase class MockLoggingHandler(logging.Handler): """ Mock logging handler to check for expected logs. """ def __init__(self, *args, **kwargs): self.reset()...
Python
0.00002
@@ -693,17 +693,16 @@ tCase):%0A -%0A def @@ -901,16 +901,227 @@ dler())%0A + from django.conf import settings%0A org_apps = None%0A apps = list(settings.INSTALLED_APPS)%0A if not 'django_extensions.tests' in apps:%0A apps.append('django_extensions.tests')%0A @@ ...
8582f4bb6fb4d860e5b16666f16738e08030275d
Fix multipath blacklist checking to work with unpatched dm-multipath
drivers/wwid_conf.py
drivers/wwid_conf.py
#!/usr/bin/python # # Copyright (C) Citrix Systems Inc. # # This program 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; version 2.1 only. # # This program is distributed in the hope that it will be u...
Python
0.001199
@@ -2157,17 +2157,20 @@ returns -0 +True if the @@ -2179,20 +2179,16 @@ vice is -not blacklis @@ -2515,16 +2515,22 @@ path','- +v3','- c',dev%5D) @@ -2559,51 +2559,112 @@ is -truly blacklisted, there is nothing on stdo +blacklisted according to multipath.conf, the%0A # string %22wwid blacklisted%22 app...
55b6c1eef7244fff1880f1b91a8f0440751cb77d
Add gradient option
HARK/econforgeinterp.py
HARK/econforgeinterp.py
from .core import MetricObject from interpolation.splines import eval_linear, UCGrid from interpolation.splines import extrap_options as xto import numpy as np class LinearFast(MetricObject): distance_criteria = ["f_val", "grid_list"] def __init__(self, f_val, grids, extrap_options=None): self.f_va...
Python
0.000004
@@ -795,32 +795,41 @@ def __init__( +%0A self, f_val, gri @@ -858,24 +858,52 @@ weights=None +, extrap_gradient=False%0A ):%0A%0A @@ -1142,16 +1142,64 @@ eights%0A%0A + self.extrap_gradient = extrap_gradient%0A%0A @@ -2604,16 +2604,259 @@ t_f_ex%0A%0A + # Add gradien...
9ed095a64679ad8899ad6706487e05152ded8db1
Add DJANGO_SETTINGS_MODULE to wsgi environment settings
HedyNet/HedyNet/wsgi.py
HedyNet/HedyNet/wsgi.py
""" WSGI config for HedyNet project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` ...
Python
0
@@ -1189,16 +1189,46 @@ ngs = (%0A + %22DJANGO_SETTINGS_MODULE%22,%0A %22DAT
4bf6828c4cf24acd604a6c40324f911e8e8e944e
disable a test on jenkins
_unittests/ut_mokadi/test_LONG_rest_api_speech.py
_unittests/ut_mokadi/test_LONG_rest_api_speech.py
#-*- coding: utf-8 -*- """ @brief test log(time=10s) """ import sys import os import unittest try: import src except ImportError: path = os.path.normpath( os.path.abspath( os.path.join( os.path.split(__file__)[0], "..", ".."))) if p...
Python
0
@@ -1369,16 +1369,179 @@ return%0A%0A + if os.environ.get(%22COMPUTERNAME%22, os.environ.get(%22HOSTNAME%22)).startswith(%22VSWINDOUZE%22):%0A # jenkins remote machine: no audio%0A return%0A%0A
07494373d576be01462e5169a5a2c255e6528af4
stop comparing apples and oranges
addons/partner_autocomplete/models/res_partner.py
addons/partner_autocomplete/models/res_partner.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging import json from odoo import api, fields, models, exceptions, _ from odoo.addons.iap import jsonrpc from requests.exceptions import ConnectionError, HTTPError from odoo.addons.iap.models.iap import Insuffi...
Python
0.000013
@@ -6074,20 +6074,24 @@ untry_id - and +.code if self.co @@ -6098,21 +6098,24 @@ untry_id -.code + else '' %0A
141b54bb8e845e12fb6c88c69bd0a0edc71318e4
allow cancellation of SO if no Purchase rights
addons/purchase_requisition_stock/models/stock.py
addons/purchase_requisition_stock/models/stock.py
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from collections import defaultdict from odoo import api, fields, models class StockRule(models.Model): _inherit = 'stock.rule' @api.model def _run_buy(self, procurements): requisitions_values_b...
Python
0.000005
@@ -2215,36 +2215,176 @@ -if self.requisition_line_ids +# People without purchase rights should be able to do this operation%0A requisition_lines_sudo = self.sudo().requisition_line_ids%0A if requisition_lines_sudo :%0A @@ -2509,21 +2509,16 @@ line in -self. requisit @@ -2525,20 +2525,22 @@ i...
b50c1d0527ca97e9d21026dde3883290ab3f6c1f
change settings import
billing/views.py
billing/views.py
# -*- coding: utf-8 -*- from django.shortcuts import render from django.http import HttpResponse from django.contrib.auth.decorators import login_required from reportlab.pdfgen import canvas from reportlab.lib import colors from reportlab.lib.pagesizes import A4 from reportlab.lib.units import cm from reportlab.lib.sty...
Python
0.000001
@@ -401,12 +401,19 @@ rom -core +django.conf imp @@ -453,16 +453,24 @@ IO%0Afrom +billing. models i
1097d67534c2a34ce8a381af2814abfe23e4086e
Enable ndimage on 64-bit systems.
Lib/ndimage/__init__.py
Lib/ndimage/__init__.py
# Copyright (C) 2003-2005 Peter J. Verveer # # 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 list of conditions and the following d...
Python
0.000566
@@ -1452,107 +1452,8 @@ mpy%0A -if numpy.int_ == numpy.int64:%0A raise ImportError, %22ndimage does not yet support 64-bit systems%22%0A from
87238704cfaf981fc96e7c68f6648556d0bd736e
Document not-completely-obvious behavior in a test.
Lib/test/test_shutil.py
Lib/test/test_shutil.py
# Copyright (C) 2003 Python Software Foundation import unittest import shutil import tempfile import os import os.path from test import test_support from test.test_support import TESTFN class TestShutil(unittest.TestCase): def test_rmtree_errors(self): # filename is guaranteed not to exist filenam...
Python
0
@@ -526,16 +526,290 @@ None)%0A%0A + def test_rmtree_dont_delete_file(self):%0A # When called on a file instead of a directory, don't delete it.%0A handle, path = tempfile.mkstemp()%0A os.fdopen(handle).close()%0A self.assertRaises(OSError, shutil.rmtree, path)%0A os.remove(path)...
6b015573e6d087eb53e932ae3ba71311170472bf
Remove print
starling/flask/error_handler/json.py
starling/flask/error_handler/json.py
from flask import jsonify from werkzeug.exceptions import HTTPException def response( code, description): """ Format a response :param int code: HTTP error code :param str description: Error message :return: Tuple of a wrapped JSON snippet and the error code :rtype: Tuple of :...
Python
0.000016
@@ -688,16 +688,18 @@ %7D)%0A + # print(t
935e63e16ea6fd71dc236624de9885fc7286a944
Add error messages
birdseye/jobs.py
birdseye/jobs.py
# -*- coding: utf-8 -*- ''' Jobs of all sizes ----------------- ''' from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from google.cloud import vision from google.cloud.vision.feature import Feature from google.cloud.vision.feature import FeatureTypes import piexif from birdseye import rq im...
Python
0.000002
@@ -2800,110 +2800,231 @@ p -ass%0A try:%0A properties = %7B'vision_labels': detect_labels(image_url)%7D%0A except:%0A pass +rint('Failed to detect GPS in image EXIF.')%0A%0A try:%0A labels = %5Bl for s, l in detect_labels(image_url) if s %3E 0.5%5D%0A properties = %7B'vision_la...
6c3c02348de02f65b812076c053d260bb4684163
Chaning True to False
src/crbridge/mgmtscripts/mailchimp_subscribe.py
src/crbridge/mgmtscripts/mailchimp_subscribe.py
#!/usr/bin/python ##################################################################### # Cloud Routes Management Scripts: Mailchimp subscribe # ------------------------------------------------------------------ # Description: # ------------------------------------------------------------------ # Pull newly created use...
Python
0.999993
@@ -2801,19 +2801,20 @@ optin%22: -Tru +Fals e,%0A
62a76827ecf7c148101b62925dea04f63709012a
Update command to work with sublime 3
sublime/User/update_user_settings.py
sublime/User/update_user_settings.py
import json import urllib2 import sublime import sublime_plugin GIST_URL = u'https://raw.githubusercontent.com/RomuloOliveira/dot-files/master/sublime/User/Preferences.sublime-settings' # noqa class UpdateUserSettingsCommand(sublime_plugin.TextCommand): def run(self, edit): gist_settings = self._g...
Python
0
@@ -18,17 +18,16 @@ t urllib -2 %0A%0Aimport @@ -69,17 +69,16 @@ T_URL = -u 'https:/ @@ -250,20 +250,16 @@ mmand):%0A - %0A def @@ -604,17 +604,24 @@ = urllib -2 +.request .urlopen @@ -675,16 +675,32 @@ e.read() +.decode('utf-8') )%0A @@ -719,9 +719,14 @@ llib -2 +.error .URL
1670d93c5879721a53febfe2c6642916355cbf3c
fix import for jupyter 4.0
src/ensae_teaching_cs/faq/faq_ipython_helper.py
src/ensae_teaching_cs/faq/faq_ipython_helper.py
# -*- coding: utf-8 -*- """ @file @brief Helpers for ipython, inspired from `nbopen.py <https://github.com/takluyver/nbopen/blob/master/nbopen.py>`_ """ import os import os.path import warnings import webbrowser try: from jupyter_notebook import notebookapp from jupyter_notebook.utils import url_path_join ex...
Python
0
@@ -218,32 +218,24 @@ y:%0A from -jupyter_ notebook imp @@ -263,16 +263,8 @@ rom -jupyter_ note @@ -406,17 +406,16 @@ h_join%0A%0A -%0A from pyq
7934b3d969574fde30b56a8ffbb4ea04b22930a8
Update slack_bot.py
bot/slack_bot.py
bot/slack_bot.py
import time import logging import traceback import os from os.path import isfile, join from slack_clients import SlackClients from messenger import Messenger from event_handler import RtmEventHandler from text_corpus import gen_text_corpus logger = logging.getLogger(__name__) def spawn_bot(): return SlackBot() ...
Python
0.000001
@@ -1990,24 +1990,60 @@ r.domain))%0A%0A +%0A logger.debug('Before')%0A @@ -2151,28 +2151,44 @@ iter -, self.trump_corpus) +)%0A logger.debug('After')%0A %0A%0A
6069df489a648ef93938c0aad12f75935b31d4d8
fix within displaying of functions.
bracoujl/main.py
bracoujl/main.py
#! /usr/bin/env python # Author: Franck Michea < franck.michea@gmail.com > # License: New BSD License (See LICENSE) import argparse import os import subprocess import sys import bracoujl.graph as bg import bracoujl.writers.dotwriter as bwd import bracoujl.writers.svgwriter as bws def main(): parser = argparse....
Python
0
@@ -2219,18 +2219,8 @@ mat( -', '.join( %0A @@ -2232,16 +2232,48 @@ +function.uniq_name(), ', '.join( function @@ -2279,16 +2279,17 @@ n.within +) %0A @@ -2295,17 +2295,16 @@ )) -) %0A
abc932da4a65ef36de8367cdba91df4cb98e0e7f
Fix check digit calculation to handle 0
brazilnum/cei.py
brazilnum/cei.py
#!/usr/bin/env python import re import random from operator import mul """ Functions for working with Brazilian CEI identifiers. """ NONDIGIT = re.compile(r'[^0-9]') CEI_WEIGHTS = [7, 4, 1, 8, 5, 2, 1, 6, 3, 7, 4] def clean_cei(cei): """Takes a CEI and turns it into a string of only numbers.""" return NOND...
Python
0.000002
@@ -573,170 +573,38 @@ -# validate the check digit%0A digsum = sum(mul(*k) for k in zip(CEI_WEIGHTS, digits%5B:-1%5D))%0A check = 10 - (sum(divmod(digsum %25 100, 10)) %25 10)%0A return check +return _cei_check(digits%5B:-1%5D) == @@ -869,142 +869,32 @@ -# find the check digit%0A digsum = sum...
9a83a07dbf16198b67c80c4846bdeba5342e5374
fix related_name for FB profile
broker/models.py
broker/models.py
from django.db import models from django.contrib.auth.models import User from django.dispatch.dispatcher import receiver from django_facebook.models import FacebookModel from django.db.models.signals import post_save from django_facebook.utils import get_user_model, get_profile_model class Service(models.Model): ...
Python
0
@@ -1237,18 +1237,9 @@ me=' -Facebook P +p rofi
d4a059e286e0b2f664f1e6ada91abb2cf20f3a23
resolve conflicts
totalvoice/cliente/api/validanumero.py
totalvoice/cliente/api/validanumero.py
# coding=utf-8 from __future__ import absolute_import from .helper import utils from .helper.routes import Routes from totalvoice.cliente.api.totalvoice import Totalvoice import json, requests class ValidaNumero(Totalvoice): def __init__(self, cliente): super(ValidaNumero, self).__init__(cliente) <<<<<<...
Python
0.00004
@@ -311,1393 +311,8 @@ e)%0A%0A -%3C%3C%3C%3C%3C%3C%3C HEAD%0A def enviar(self, numero_destino, gravar_audio=None, bina=None, max_tentativas=None):%0A %22%22%22%0A :Descri%C3%A7%C3%A3o:%0A%0A Fun%C3%A7%C3%A3o para uma valida%C3%A7%C3%A3o de n%C3%BAmero%0A%0A :Utiliza%C3%A7%C3%A3o:%0A%0A ...
3d25416b0e8cba17bc98353c95d0a210643d4f49
Correct support for section type of SUBTYPE_GUID for GenFds
Source/Python/GenFds/Ffs.py
Source/Python/GenFds/Ffs.py
## @file # process FFS generation # # Copyright (c) 2007, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license may be...
Python
0
@@ -2730,24 +2730,75 @@ : '.guid',%0D%0A + 'SUBTYPE_GUID' : '.guid', %0D%0A 'FV_
d14ff8710eb029df4987ba40302965b8756308fc
Fix test_httplib when built without threads
Lib/test/ssl_servers.py
Lib/test/ssl_servers.py
import os import sys import ssl import pprint import socket import threading import urllib.parse # Rename HTTPServer to _HTTPServer so as to avoid confusion with HTTPSServer. from http.server import (HTTPServer as _HTTPServer, SimpleHTTPRequestHandler, BaseHTTPRequestHandler) from test import support here = os.pa...
Python
0
@@ -57,25 +57,8 @@ ket%0A -import threading%0A impo @@ -282,16 +282,63 @@ support +%0Athreading = support.import_module(%22threading%22) %0A%0Ahere =
839632f923ccd6691dc7135c5a49d66e1b0e3721
Add copyright notice
src/ggrc/migrations/versions/20151203153139_297131e22e28_add_final_state_to_request_status_and_.py
src/ggrc/migrations/versions/20151203153139_297131e22e28_add_final_state_to_request_status_and_.py
"""Add final state to request status and rename Unstarted to Open Revision ID: 297131e22e28 Revises: 18cbdd3a7fd9 Create Date: 2015-12-03 15:31:39.979333 """ # revision identifiers, used by Alembic. revision = '297131e22e28' down_revision = '504f541411a5' from alembic import op def upgrade(): op.execute("""ALT...
Python
0
@@ -1,12 +1,253 @@ +# Copyright (C) 2015 Google Inc., authors, and contributors %3Csee AUTHORS file%3E%0A# Licensed under http://www.apache.org/licenses/LICENSE-2.0 %3Csee LICENSE file%3E%0A# Created By: urban@reciprocitylabs.com%0A# Maintained By: urban@reciprocitylabs.com%0A %0A%22%22%22Add fina
96c3827f26370d7b3e5afbb383ec8051559e30d4
Fix indent error.
src/count/countCrfResultPhrasesFancy.py
src/count/countCrfResultPhrasesFancy.py
"""Count the occurances of phrases in the CRF results, by classifier tag.""" import argparse import json from operator import attrgetter import sys from pyspark import SparkContext class Phrase: def __init__(self, value, count): self.value = value self.count = count self.cumulativeCount = ...
Python
0.000001
@@ -2528,16 +2528,17 @@ (0)%0A%0A + if args.
e84d6231538fe0cf587648c0b9e301b3b0399db7
Support structured_code.__contains__
angr/knowledge_plugins/structured_code/manager.py
angr/knowledge_plugins/structured_code/manager.py
from typing import TYPE_CHECKING from .. import KnowledgeBasePlugin if TYPE_CHECKING: from angr.knowledge_base import KnowledgeBase from angr.analyses.decompiler.structured_codegen import StructuredCodeGenerator class StructuredCodeManager(KnowledgeBasePlugin): def __init__(self, kb): self._kb =...
Python
0.000131
@@ -871,16 +871,108 @@ value%0A%0A + def __contains__(self, key):%0A return self._normalize_key(key) in self._codegens%0A%0A def
86449f40f288bf360cb239104e62e3b1acc9f1f8
Bump to v1.0.0
enerdata/__init__.py
enerdata/__init__.py
__author__ = 'ecarreras' __version__ = '0.29.0'
Python
0.000001
@@ -37,12 +37,11 @@ = ' -0.29 +1.0 .0'%0A
1a7c9d4734b09b398ae1778fa400a6d53def227a
Replace a query with an if statement in category_tree().
satchmo/shop/templatetags/satchmo_category.py
satchmo/shop/templatetags/satchmo_category.py
from django.template import Library from satchmo.product.models import Category try: from xml.etree.ElementTree import Element, SubElement, tostring except ImportError: from elementtree.ElementTree import Element, SubElement, tostring register = Library() def recurse_for_children(current_node, parent_node, s...
Python
0.999999
@@ -1316,47 +1316,37 @@ cts. -all():%0A if not cats.parent:%0A +filter(parent__isnull=True):%0A
983ba079bb99da836f64fc2667100c66a2441f0c
use python logging module.
task_manager/task_processor/views.py
task_manager/task_processor/views.py
from django.shortcuts import render from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from django.db.models import Q from models import ImageNeuralTask from time import strftime, localtime # Create your views here. def merge_dicts(*dict_args): ''' Given any number of di...
Python
0
@@ -224,16 +224,65 @@ altime%0A%0A +import logging%0A%0Al = logging.getLogger(__name__)%0A%0A # Create @@ -654,21 +654,23 @@ ())%0A -print +l.debug (tasks)%0A @@ -791,37 +791,38 @@ **kwargs):%0A -print +l.info (args, kwargs, r @@ -1216,13 +1216,14 @@ -print +l.info (arg
673f811b8325a6926ac52ffa404a74f2ec9e5e8a
Change parcellation to DKT
extract_ts_epochs.py
extract_ts_epochs.py
import sys import numpy as np import mne from mne.minimum_norm import read_inverse_operator, apply_inverse_epochs from my_settings import (mne_folder, epochs_folder, source_folder, conditions) subject = sys.argv[1] method = "dSPM" snr = 1. lambda2 = 1. / snr**2 labels = mne.read_labels_from_annot( subject=subje...
Python
0.000218
@@ -259,16 +259,18 @@ snr**2%0A%0A +# labels = @@ -298,16 +298,18 @@ _annot(%0A +# subj @@ -365,16 +365,75 @@ odmann%22) +%0Alabels = mne.read_labels_from_annot(subject, parc=%22aparc%22) %0A%0Afor co @@ -506,19 +506,16 @@ + %22%25s_%25s -_ar -inv.fif @@ -520,35 +520,32 @@ if%22 %25 (subject,%0A - ...