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
96f2a536ca7db9d8f741d24586ef9888e382db4b
Add a domain property to the request object
usingnamespace/__init__.py
usingnamespace/__init__.py
import logging log = logging.getLogger(__name__) from pyramid.config import Configurator from pyramid.session import UnencryptedCookieSessionFactoryConfig from pyramid.authentication import AuthTktAuthenticationPolicy from pyramid.authorization import ACLAuthorizationPolicy from sqlalchemy import engine_from_config f...
Python
0
@@ -2255,24 +2255,230 @@ d_mailer')%0A%0A +%0A def cur_domain(request):%0A host = request.host if %22:%22 not in request.host else request.host.split(%22:%22)%5B0%5D%0A%0A return host%0A%0A config.set_request_property(cur_domain, 'domain', reify=True)%0A%0A return c
d0b34699e7c09b312a8c08944640983c8849892a
Fix import_analysis so it adds/updates correctly
utility/import_analyses.py
utility/import_analyses.py
import os import json #import glob import argparse import romanesco from girder_client import GirderClient def import_analyses(client, analyses_path): # First get the minerva analysis folder minerva_analyses_folder = client.get('/minerva_analysis/folder') if not minerva_analyses_folder['folder']: ...
Python
0
@@ -442,24 +442,191 @@ %5B'folder'%5D%0A%0A + # Note: this will clobber any analyses that have the same name%0A items = %7Bv%5B'name'%5D: v for v in%0A client.listItem(minerva_analyses_folder%5B'_id'%5D)%7D%0A%0A%0A # look f @@ -682,17 +682,16 @@ es/bsve%0A -%0A for @@ -1745,180 +1745,64...
6abd3bca2f0d21691df3705dc7b6a0f4b53803c6
Fix month parsing
app/tools.py
app/tools.py
# -*- coding: utf-8 -*- # # Copyright © 2009-2011 Alexander Kojevnikov <alexander@kojevnikov.com> # # muspy 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...
Python
0.000003
@@ -1780,16 +1780,22 @@ t(month) + * 100 %0A day
1e1e35b899471224c28515bd5bf9b561799e1c58
edit coupon view
usermanage/views.py
usermanage/views.py
from django.shortcuts import render, redirect from django.http import HttpResponseRedirect from django.contrib.auth import login, authenticate, logout from django.contrib.auth.models import User, Group from django.contrib.auth.decorators import login_required, user_passes_test, permission_required from django.contrib.a...
Python
0
@@ -347,16 +347,94 @@ ionForm%0A +from customermanage.models import Coupon%0Afrom storemanage.models import Ticket %0A# Creat @@ -5601,24 +5601,211 @@ -printf(%5Bc.ticket +context = %7B%0A 'coupon':%5B%7B'Name':c.ticket.name,'store':c.ticket.store.store.store_name,'exp':c.ticket.expire_date.strftime('%25...
9ed00018d8fe83739797e7c3944c4fdadd3347eb
update test for cordgene
tests/test_apis/test_cordgene.py
tests/test_apis/test_cordgene.py
import unittest from biothings_explorer.registry import Registry from biothings_explorer.user_query_dispatcher import SingleEdgeQueryDispatcher reg = Registry() class TestSingleHopQuery(unittest.TestCase): def test_gene2protein(self): """Test gene-protein""" seqd = SingleEdgeQueryDispatcher(outpu...
Python
0
@@ -432,36 +432,36 @@ input_id=' -hgnc +HGNC ',%0A @@ -867,36 +867,36 @@ input_id=' -hgnc +HGNC ',%0A @@ -1313,36 +1313,36 @@ input_id=' -hgnc +HGNC ',%0A @@ -1723,36 +1723,36 @@ input_id=' -hgnc +HGNC ',%0A @@ -2142,36 +2142,36 @@ ...
0514ec7d279da61b489f3388e2106cde5a54921b
fix example
examples/4-ideal-payment.py
examples/4-ideal-payment.py
# coding=utf-8 # # Example 4 - How to prepare an iDEAL payment with the Mollie API. # from __future__ import print_function import os import time import flask import mollie from app import database_write def main(): try: # # Initialize the Mollie API library with your API key. # ...
Python
0.0001
@@ -159,21 +159,79 @@ sk%0A%0A -import mollie +from mollie.api.client import Client%0Afrom mollie.api.error import Error %0Afro @@ -532,26 +532,8 @@ t = -mollie.api.client. Clie @@ -551,16 +551,23 @@ mollie +_client .set_api @@ -3130,28 +3130,17 @@ except -mollie.api.e +E rror as
4afdc1fed8b0b6813ecafe61b605a49d8d07f26d
Fix warnings for GObject.main_depth() is deprecated
gaphas/decorators.py
gaphas/decorators.py
""" Custom decorators. """ from __future__ import print_function from builtins import object __version__ = "$Revision$" # $HeadURL$ import threading import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk, GObject # from GObject import PRIORITY_HIGH, PRIORITY_HIGH_IDLE, PRIORITY_DEFAULT, \ # ...
Python
0
@@ -227,16 +227,22 @@ GObject +, GLib %0A%0A# from @@ -3217,22 +3217,19 @@ if G -Object +Lib .main_de
770612bac975d19702569893a661b3074f10dcca
Use print function on Python 2
xprocess.py
xprocess.py
from __future__ import division import sys import os import warnings import abc import functools import itertools from py import std import psutil # make map appear from the future if sys.version_info < (3,): map = itertools.imap class XProcessInfo: def __init__(self, path, name): self.name = name...
Python
0.998793
@@ -24,16 +24,32 @@ division +, print_function %0A%0Aimport
bfd4bf6118d69a70926982c602d411dc6f9ab1d4
Check return value of bdist_egg command
tests/test_python33_bdist_egg.py
tests/test_python33_bdist_egg.py
import sys import os import tempfile import unittest import shutil import copy CURDIR = os.path.abspath(os.path.dirname(__file__)) TOPDIR = os.path.split(CURDIR)[0] sys.path.insert(0, TOPDIR) from distribute_setup import (use_setuptools, _build_egg, _python_cmd, _do_download, _install, D...
Python
0.000005
@@ -550,16 +550,32 @@ +self.assertTrue( _python_ @@ -602,16 +602,17 @@ st_egg%22) +) %0A%0A%0Aif __
433ad91ebc3b79fbb19e1a9d90d4a7e20c98d020
edit utils
utils/Dictionary.py
utils/Dictionary.py
from config.config import config import os, sys, re import cPickle as pickle class Entry(object): def __init__(self, doc_id, doc_path): assert os.path.exists(doc_path), "File {} doesn't exits.".format(doc_path) self.docID = doc_id self.tokens = {} doc = open(doc_path, "r") ...
Python
0.000001
@@ -3276,24 +3276,25 @@ s):%0A +# if config.DE @@ -3318,24 +3318,25 @@ 00:%0A +# break%0A
ffcf8247272e5b63e0594e9a0a9aa931722fb08d
Fix classname of OSMAnd map creator.
utils/osmand_obf.py
utils/osmand_obf.py
# -*- coding: utf-8 -*- import logging import os import subprocess from utils.artifact import Artifact LOG = logging.getLogger(__name__) BATCH_XML = """<?xml version="1.0" encoding="utf-8"?> <!-- OsmAnd Batch Creation Config Template. Determines where the OBF creation process is staged and configures the...
Python
0
@@ -1165,18 +1165,12 @@ and. -data.index +util .Ind
9787692dcd067844a6f774d8de4159fa7a511f72
Update integer-break.py
Python/integer-break.py
Python/integer-break.py
# Time: O(logn), pow is O(logn). # Space: O(logn) # Given a positive integer n, break it into the sum of # at least two positive integers and maximize the product # of those integers. Return the maximum product you can get. # # For example, given n = 2, return 1 (2 = 1 + 1); given n = 10, # return 36 (10 = 3 + 3 + 4)...
Python
0.000012
@@ -2143,16 +2143,17 @@ rn res%0A%0A +%0A # Time:
825502e2fab40a930bfa6ba678c6a9bbcd939c7f
rename local variable for attribute names
yamltomd.py
yamltomd.py
from jinja2 import Template import yaml def yaml_to_md(table): out.write('## ' + table + '\n\n') data = yaml.load(inp) key1 = data['layers'][table]['attributes'].keys() dicts = data['layers'][table]['attributes'] dicts2 = dicts['type']['values'] key2 = dicts2.keys() with open('templates...
Python
0.000003
@@ -128,20 +128,31 @@ p)%0A%0A -key1 +attribute_names = data%5B @@ -428,25 +428,47 @@ st1= -key1, a1=len(key1 +attribute_names, a1=len(attribute_names ), s
9855e7b0acf70266a3280e0c699961a587d62d57
Add string representation for ExperimentAction
psi/controller/experiment_action.py
psi/controller/experiment_action.py
import logging log = logging.getLogger(__name__) from functools import partial from atom.api import Unicode, Int, Dict, Bool, Typed, Callable, List from enaml.core.api import Declarative, d_ from psi.util import get_dependencies class ExperimentState(Declarative): ''' Allows for indication of a state (e.g....
Python
0.999997
@@ -2039,16 +2039,116 @@ code)%0A%0A + def __str__(self):%0A return f'%7Bself.event%7D (weight=%7Bself.weight%7D; kwargs=%7Bself.kwargs%7D)'%0A%0A %0Aclass E
4241e8f5ca6114e6bcc5b9fda2e79cfa83ba6f3b
Test for ScheduledAnalysis get_sample
tests/test_scheduled_analysis.py
tests/test_scheduled_analysis.py
import json from mass_api_client.resources import ScheduledAnalysis from tests.serialization_test_case import SerializationTestCase class ScheduledAnalysisTestCase(SerializationTestCase): def test_is_data_correct_after_serialization(self): with open('tests/data/scheduled_analysis.json') as data_file: ...
Python
0
@@ -30,108 +30,292 @@ ient -.resources import ScheduledAnalysis%0Afrom tests.serialization_test_case import SerializationTestCase%0A + import ConnectionManager%0Afrom mass_api_client.resources import ScheduledAnalysis%0Afrom mass_api_client.resources import FileSample%0Afrom tests.serialization_test_case import Serial...
770ebc46a554f65c2a13bb83290f3f759b4c540c
Add filename
scripts/simple_weather_capture.py
scripts/simple_weather_capture.py
import datetime import os import pandas import sys import time from plotly import graph_objs as go from plotly import plotly sys.path.append(os.getenv('PEAS', '.')) # Append the $PEAS dir from peas import weather names = [ 'date', 'safe', 'ambient_temp_C', 'sky_temp_C', 'rain_sensor_temp_C', ...
Python
0.999042
@@ -3470,16 +3470,40 @@ am_token +, filename=args.filename )%0A%0A w
8d84926f525dfd0728325e43cd39dbcb28fd3601
Remove duplicated testConv1DTranspose
tensorflow/python/kernel_tests/conv1d_test.py
tensorflow/python/kernel_tests/conv1d_test.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Python
0.00003
@@ -3516,1282 +3516,8 @@ )%0A%0A%0A - def testConv1DTranspose(self):%0A with self.test_session():%0A stride = 2%0A%0A # Input, output: %5Bbatch, width, depth%5D%0A x_shape = %5B2, 4, 3%5D%0A y_shape = %5B2, 9, 2%5D%0A%0A # Filter: %5Bkernel_width, output_depth, input_depth%5D%0A f_sha...
be22dd951a14e0da35b575719439e6f42f411f1b
purge PieceData after writing to disk, otherwise when we have massive torrents we get memory errors
academictorrents/Piece.py
academictorrents/Piece.py
__author__ = 'alexisgallepe' import math import time import logging from . import utils from pubsub import pub BLOCK_SIZE = 2 ** 14 class Piece(object): def __init__(self, pieceIndex, pieceSize, pieceHash): self.pieceIndex = pieceIndex self.pieceSize = pieceSize self.pieceHash = pieceHa...
Python
0
@@ -4241,16 +4241,45 @@ eOffset) +%0A self.pieceData = b'' %0A%0A de
dba40486c0f8e0ff22f2b3491a179ef7d6d664b7
Check for owner in the loader module
acolyte/modules/loader.py
acolyte/modules/loader.py
from discord.ext import commands from discord.ext.commands.errors import ExtensionAlreadyLoaded from discord.ext.commands.errors import ExtensionNotFound from discord.ext.commands.errors import ExtensionNotLoaded class Loader(commands.Cog): """ Module loader """ def __init__(self, bot): self.bot = bot...
Python
0
@@ -315,16 +315,41 @@ = bot%0A%0A + @commands.is_owner()%0A @com @@ -367,32 +367,32 @@ nd(hidden=True)%0A - async def lo @@ -1017,24 +1017,49 @@ : :tada:%22)%0A%0A + @commands.is_owner()%0A @command @@ -1595,24 +1595,49 @@ loaded!%22)%0A%0A + @commands.is_owner()%0A @command @@ -1887,...
943738e9ea13ccb77198b78094a2af53629918cc
Add test
tests/unit/utils/test_columns.py
tests/unit/utils/test_columns.py
# coding=UTF-8 """Unit tests for cartoframes.data.columns""" from pandas import DataFrame from geopandas import GeoDataFrame from cartoframes.utils.geom_utils import set_geometry from cartoframes.utils.columns import ColumnInfo, get_dataframe_columns_info, normalize_names class TestColumns(object): """Tests fo...
Python
0.000005
@@ -268,16 +268,178 @@ ze_names +, %5C%0A obtain_converters, _convert_int, _convert_float, %5C%0A _convert_bool, _convert_generic %0A%0A%0Aclass @@ -4425,28 +4425,788 @@ ', 'text', False)%0A %5D%0A +%0A def test_converters(self):%0A ...
a6168f3b81e341c3ce2cd6516c689b35b357fe65
Fix set_white_color_scheme
pyqode/python/frontend/code_edit.py
pyqode/python/frontend/code_edit.py
# -*- coding: utf-8 -*- """ This package contains python specific modes, panels and editor. """ from pyqode.qt import QtCore, QtGui from pyqode.core.frontend import CodeEdit from pyqode.core import frontend from pyqode.core.frontend import modes from pyqode.core.frontend import panels from pyqode.python.frontend impor...
Python
0
@@ -6798,38 +6798,38 @@ QtGui.QColor(%22# -252525 +FFFFFF %22)%0A code_edit @@ -6849,38 +6849,38 @@ QtGui.QColor(%22# -A9B7C6 +000000 %22)%0A code_edit
95a21b8c52ca967ab30dfc259ba8a855253e7f82
changed 'nested' commands to '.' separation
python/src/OLMpstat/potentiostat.py
python/src/OLMpstat/potentiostat.py
import numpy as np import pylab import serial, yaml from StringIO import StringIO BAUDRATE = 9600 EOL = "\n" class Potentiostat(object): def __init__(self, port, baudrate = BAUDRATE, eol = EOL, debug = False): self._ser = serial.Serial(port, baudrate = baudrate) self._eol = eol self.debu...
Python
0.999999
@@ -91,10 +91,12 @@ E = -96 +1152 00%0AE @@ -959,17 +959,17 @@ (%22VSWEEP -_ +. START %25f @@ -1015,17 +1015,17 @@ (%22VSWEEP -_ +. END %25f%22 @@ -1067,17 +1067,17 @@ (%22VSWEEP -_ +. RAMP %25f%22 @@ -1121,17 +1121,17 @@ (%22VSWEEP -_ +. SAMPLE %25 @@ -1180,17 +1180,17 @@ (%22VSWEEP -_ +. CYCLES %25 @@ -...
e342a9eef2f4d1bef28f9284feecd18c6c9b941e
fix to m2m
PersonalSite/analytics/models.py
PersonalSite/analytics/models.py
from django.db import models # Create your models here. class Visit(models.Model): url = models.CharField(max_length=256) date = models.DateTimeField(editable=False) visitor = models.ForeignKey('Visitor',related_name) # Possibly extend this class in the future to make a tree # that gives something...
Python
0.999999
@@ -210,29 +210,16 @@ Visitor' -,related_name )%0A #
5224d55d4b65ae7142a51bf2ce58221cd69102f6
fix race condition in issue6171-sdk-start-crash
test/sanity/issue6171-sdk-start-crash/test.py
test/sanity/issue6171-sdk-start-crash/test.py
import time import os from selenium import webdriver from selenium.webdriver.chrome.options import Options chrome_options = Options() chrome_options.add_argument("nwapp=" + os.path.dirname(os.path.abspath(__file__))) driver = webdriver.Chrome(executable_path=os.environ['CHROMEDRIVER'], chrome_options=chrome_options) ...
Python
0
@@ -14,16 +14,126 @@ mport os +%0Aimport sys%0Asys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))%0Afrom nw_util import * %0A%0Afrom s @@ -517,25 +517,8 @@ sh'%0A - time.sleep(5) %0A @@ -531,19 +531,16 @@ t = -driver.find +wait_for _ele @@ -548,14 +548,19 @@ ent_ -by_ id( +drive...
2889be81b3861becf98cd16b7755e679874b4419
use fake constructed pillow in change tests
testapps/test_pillowtop/tests/test_changes.py
testapps/test_pillowtop/tests/test_changes.py
import uuid from django.test import TestCase from mock import MagicMock from couchforms.models import XFormInstance from pillowtop.feed.couch import get_current_seq from pillowtop.listener import BasicPillow class ChangeFeedDbTest(TestCase): def setUp(self): super(ChangeFeedDbTest, self).setUp() ...
Python
0
@@ -177,29 +177,42 @@ top. -listener import Basic +tests.utils import FakeConstructed Pill @@ -484,86 +484,40 @@ w = -BasicPillow(couch_db=self.couch_db)%0A self._apply_mocks_to_pillow(pillow +_make_couch_pillow(self.couch_db )%0A @@ -1098,59 +1098,42 @@ w = -BasicPillow(couch_db=self.couch_db)%0A ...
d0bf235af3742a17c722488fe3679d5b73a0d945
Fix gemm calls in Softmax
thinc/neural/_classes/softmax.py
thinc/neural/_classes/softmax.py
from .affine import Affine from ... import describe from ...describe import Dimension, Synapses, Biases from ...check import has_shape from ... import check @describe.attributes( W=Synapses("Weights matrix", lambda obj: (obj.nO, obj.nI), lambda W, ops: None) ) class Softmax(Affine): name = 'so...
Python
0
@@ -820,19 +820,12 @@ ops. -batch_outer +gemm (gra @@ -832,32 +832,45 @@ d__BO, input__BI +, trans1=True )%0A se @@ -936,11 +936,12 @@ ops. -dot +gemm (gra
13723e6238f3026b9f37909c3e2a0e1668c8a1b9
Update quiz-eliecer.py
laboratorios/quiz1/quiz-eliecer.py
laboratorios/quiz1/quiz-eliecer.py
base=5 altura=7 perimetro=2*5+2*7 print ("mi perimetro es" + str(perimetro)) area=5*7 print ("mi area es" + str (area)) metrop=perimetro/100 print ("mi perimetro en metro es" + str(metrop)) pulgadap=perimetro/2.54 print ("mi perimetro en pulgada es" + str(pulgadap)) metroa=area/100 print ("mi area en metro es" +...
Python
0
@@ -1,9 +1,123 @@ - +#calcular el area y perimetro de un rectangulo %0A#base=5 %0A#altura=7 convertir area y perimetro en metros y pulgadas%0A %0Abase=5%0A
93304e3a498e24f16894a8e3f75da61bb1383a45
check if document associated to a file
advancedSettings/views.py
advancedSettings/views.py
from django.shortcuts import render import os #from django.conf import settings from classif.models import Cluster from fileupload.models import Document from graphdesign.models import GraphNode def index(request): output = '' if(request.GET.get('check_db')): output = run_check_db() if(request.GET.get('clean_d...
Python
0.000001
@@ -1357,16 +1357,38 @@ ile = 0%0A +%09docname_no_file = %5B%5D%0A %09for doc @@ -1402,32 +1402,50 @@ ument_set:%0A%09%09if +doc.file == '' or not os.path.isfi @@ -1481,16 +1481,52 @@ file+=1%0A +%09%09%09docname_no_file.append(doc.name)%0A %09return @@ -1526,17 +1526,19 @@ return ( -' +%22%22%22 %7B%7D docu...
6b77953070822867fbcb14e64fdb07ff0ab06534
resolve settings inside view and refine error handling
advanced_filters/views.py
advanced_filters/views.py
from operator import itemgetter from pprint import pformat import logging from django.conf import settings from django.contrib.admin.util import get_fields_from_path from django.db import models from django.db.models.fields import FieldDoesNotExist from django.views.generic import View from braces.views import (CsrfE...
Python
0
@@ -29,35 +29,8 @@ ter%0A -from pprint import pformat%0A impo @@ -216,16 +216,61 @@ otExist%0A +from django.utils.encoding import force_text%0A from dja @@ -471,194 +471,8 @@ ')%0A%0A -DISABLE_FOR_FIELDS = getattr(settings, 'ADVANCED_FILTERS_DISABLE_FOR_FIELDS',%0A tuple())%0AMAX_CHOICE...
46f19702c0edb82db6ad72fa4e07e082fcadd61d
set explicit identity in tests
tests/cupy_tests/core_tests/test_reduction.py
tests/cupy_tests/core_tests/test_reduction.py
import unittest import cupy from cupy import core from cupy import testing _noncontiguous_params = [ # reduce at head axes {'shape': (2, 4, 3), 'trans': (2, 1, 0), 'axis': (0, 1)}, # reduce at middle axes {'shape': (2, 4, 5, 3), 'trans': (3, 2, 1, 0), 'axis': (1, 2)}, # reduce at tail axes {'...
Python
0.000001
@@ -1309,16 +1309,19 @@ ', None) +, 0 )%0A%0A%0A@tes
7b4142dff34b253a6324d67e3f90313088d83f48
Improve output JSON interpretation cleaning for tests
tests/integration/cloud/helpers/virtualbox.py
tests/integration/cloud/helpers/virtualbox.py
import json import logging import os import unittest import integration from integration.cloud.helpers import random_name from salt.utils import virtualbox # Create the cloud instance name to be used throughout the tests INSTANCE_NAME = random_name() PROVIDER_NAME = "virtualbox" CONFIG_NAME = PROVIDER_NAME + "-config...
Python
0
@@ -2076,22 +2076,8 @@ %22'%5D%0A - i = 0%0A @@ -2132,15 +2132,15 @@ ne) -%3E 0 and +== 0 or (li @@ -2205,33 +2205,10 @@ pop( -i)%0A i += 1 +0) %0A
7cb1199d0904e3799a3695bdef465bc8021a2ff4
Fix pt_br
tests/test_builtins/pt_br/test_brazil_spec.py
tests/test_builtins/pt_br/test_brazil_spec.py
import re import pytest from mimesis.builtins import BrazilSpecProvider @pytest.fixture def pt_br(): return BrazilSpecProvider() def test_cpf(pt_br): # test if the cpf has 14 digits with the mask cpf_with_mask = pt_br.cpf() assert len(cpf_with_mask) == 14 # test the mask non_numeric_digits...
Python
0.000083
@@ -315,32 +315,33 @@ digits = re.sub( +r %22%5Cd%22, %22%22, cpf_wi @@ -341,32 +341,32 @@ cpf_with_mask)%0A - assert %22..-%22 @@ -424,32 +424,33 @@ sert len(re.sub( +r %22%5CD%22, %22%22, cpf_wi @@ -605,32 +605,33 @@ digits = re.sub( +r %22%5Cd%22, %22%22, cpf_wi @@ -869,32 +869,33 @@ digits = re.sub( +...
553202bc0ef99ee817e1fd502c07a841cde94795
Fix report period dates empty value error
akvo/rest/views/report.py
akvo/rest/views/report.py
# -*- coding: utf-8 -*- # Akvo RSR is covered by the GNU Affero General Public License. # See more details in the license.txt file located at the root folder of the Akvo RSR module. # For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. from django.db.models import Q from dj...
Python
0.000004
@@ -5437,16 +5437,51 @@ periods + if p.period_start and p.period_end %7D, key=l
b9d8434d310ceb0654c8d69a0c54309bb33ccfe2
Fix docstring typo.
tf_agents/environments/atari_wrappers_test.py
tf_agents/environments/atari_wrappers_test.py
# coding=utf-8 # Copyright 2018 The TF-Agents 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 law...
Python
0.001034
@@ -625,19 +625,21 @@ nts. -gym +atari _wrapper .%22%22%22 @@ -634,16 +634,17 @@ _wrapper +s .%22%22%22%0A%0Afr
61f9947f75c489722e6b5f4b4659161014c8ebed
change code to provide Parent premir name in the GFF
tools/mircounts/mature_mir_gff_translation.py
tools/mircounts/mature_mir_gff_translation.py
#!/usr/bin/env python import sys import argparse def Parser(): the_parser = argparse.ArgumentParser() the_parser.add_argument( '--input', action="store", type=str, help="input miRBase GFF3 file") the_parser.add_argument( '--output', action="store", type=str, help="output GFF3 file with co...
Python
0
@@ -1776,16 +1776,391 @@ elds%5B8%5D%0A + if %22Derives_from%22 in gff_dict%5BID%5D%5B%22attributes%22%5D:%0A parent_primary_transcript=gff_dict%5BID%5D%5B%22attributes%22%5D.split(%22Derives_from=%22)%5B1%5D%0A parent_primary_transcript=gff_dict%5Bparent_primary_transcript%5D%5B%22attribu...
29fd5fd3462016ea4b3912fbb0c7e8d62721669e
make initial input to decoding RNN zeros
anna/model/decoder/rnn.py
anna/model/decoder/rnn.py
"""MLP/FFN-based decoder for Multi-label Classification.""" import os import numpy as np import tensorflow as tf class RNNDecoder(): """ RNN-based decoder for Multi-label Classification. """ def __init__(self, data_dir, labels, hidden_size, ...
Python
0.000046
@@ -5271,19 +5271,20 @@ ut = tf. -one +zero s(%5Bshape @@ -5308,25 +5308,8 @@ ls%5D) - / self.nr_labels %0A
f8bf6f54c8700d2031c6bd833ad57ccb090730ad
fix pylint:no-self-use of .backend.cbor.Parser._load
anyconfig/backend/cbor.py
anyconfig/backend/cbor.py
# # Copyright (C) 2017 Satoru SATOH <ssato @ redhat.com> # License: MIT # r"""CBOR backend: - Format to support: CBOR, http://cbor.io, https://tools.ietf.org/html/rfc7049 - Requirements: cbor, https://pypi.python.org/pypi/cbor - Development Status :: 4 - Beta - Limitations: None obvious - Special options: - All opt...
Python
0.000798
@@ -596,16 +596,67 @@ compat%0A%0A +from anyconfig.backend.pickle import load_with_fn%0A%0A %0Aclass P @@ -1062,496 +1062,65 @@ mp)%0A -%0A -def _load -(self, load_fn, content_or_strm, to_container, **opts):%0A %22%22%22%0A Load CBOR config from given string or stream %60content_or_strm%60.%0A%...
2cd792c057796d0dee27ac925581a458631ce728
check min wavelength
examples/continuum_stack.py
examples/continuum_stack.py
#!/usr/bin/env python """ Stacks boss spectra. """ import argparse import numpy as np import h5py import qusp def main(): # parse command-line arguments parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument("--verbose", action="store_true", ...
Python
0
@@ -1828,16 +1828,106 @@ aths):%0A%0A + if norm_min.observed(target%5B'z'%5D) %3C combined.wavelength%5B0%5D:%0A continue%0A%0A
cd357379fd8b7e9c070302001b1bb4e5be3458b9
Implement some more entity stuff
spock/plugins/helpers/entities.py
spock/plugins/helpers/entities.py
""" An entity tracker """ from spock.utils import pl_announce, Info import logging logger = logging.getLogger('spock') class MCEntity(Info): eid = 0 class ClientPlayerEntity(MCEntity): metadata = None class MovementEntity(MCEntity): x = 0 y = 0 z = 0 yaw = 0 pitch = 0 on_ground = True class PlayerEntity(Mo...
Python
0.000002
@@ -140,24 +140,48 @@ o):%0A%09eid = 0 +%0A%09status = 0%0A%09nbt = None %0A%0Aclass Clie @@ -2012,33 +2012,32 @@ self.handle_ -unhandled +set_dict ),%0A%09%09%09('PLAY @@ -2343,33 +2343,32 @@ self.handle_ -unhandled +set_dict ),%0A%09%09)%0A%09%09for
fdb8931e476396fa69298b6914db4f0bb855eabe
check for copyright in .bat files
tools/distrib/check_copyright.py
tools/distrib/check_copyright.py
#!/usr/bin/env python2.7 # Copyright 2015, Google 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 li...
Python
0
@@ -2717,16 +2717,44 @@ FIX = %7B%0A + '.bat': r'@rem%5Cs*',%0A '.c':
592fec29bb65dc182dd7befc671b6e0aa8dd2624
Version 3.1.3
seleniumbase/__version__.py
seleniumbase/__version__.py
# seleniumbase package __version__ = "3.1.2"
Python
0.000001
@@ -39,7 +39,7 @@ 3.1. -2 +3 %22%0A
b943de2bf43066454de6ed35cb367163f4647e2a
Version 2.2.3
seleniumbase/__version__.py
seleniumbase/__version__.py
# seleniumbase package __version__ = "2.2.2"
Python
0.000001
@@ -35,11 +35,11 @@ = %222.2. -2 +3 %22%0A
d8da48870fd0cd8dc0aa753102d6ddf462990552
add support for python 3 (#53)
sentry_ldap_auth/backend.py
sentry_ldap_auth/backend.py
from __future__ import absolute_import from django_auth_ldap.backend import LDAPBackend from django.conf import settings from django.db.models import Q from sentry.models import ( Organization, OrganizationMember, UserOption, ) def _get_effective_sentry_role(group_names): role_priority_order = [ ...
Python
0
@@ -601,12 +601,8 @@ ing. -iter item
e9d8b2c16e34a781b9fdc564b8b2fe68d7c874bc
fix documentation
sequana/scripts/taxonomy.py
sequana/scripts/taxonomy.py
# -*- coding: utf-8 -*- # # This file is part of Sequana software # # Copyright (c) 2016 - Sequana Development Team # # File author(s): # Thomas Cokelaer <thomas.cokelaer@pasteur.fr> # Dimitri Desvillechabrol <dimitri.desvillechabrol@pasteur.fr>, # <d.desvillechabrol@gmail.com> # # Distributed un...
Python
0
@@ -2171,16 +2171,17 @@ database +s /home/u
c7269558d4e6575f236d727c439ec286b6a87ba3
Fix parser (case insensitive)
serenata_toolbox/xml2csv.py
serenata_toolbox/xml2csv.py
import json import os import sys from csv import DictWriter from datetime import datetime from io import StringIO from bs4 import BeautifulSoup from lxml.etree import iterparse def output(*args, **kwargs): """Helper to print messages with a date/time marker""" now = datetime.strftime(datetime.now(), '%Y-%m-%...
Python
0.000005
@@ -568,22 +568,15 @@ for -event, element +_, node in @@ -648,16 +648,24 @@ = %7Bc.tag +.lower() : c.text @@ -674,23 +674,20 @@ or c in -element +node .iter() @@ -715,15 +715,12 @@ -element +node .cle @@ -964,17 +964,17 @@ eld 'ide -D +d ocumento @@ -1248,16 +1248,24 @@ .strip() +.lower() %0A ...
0d4093c768ee107eb962f7bb3142048493ff7f5e
Update processMIMTokens.py to remove abbreviations.
Backend/scripts/processMIMTokens.py
Backend/scripts/processMIMTokens.py
import sys import os import re def process(sortedSentDir, lowerWCBound, upperWCBound, dest): with open(dest, 'w', encoding='utf8') as f: for i in range(int(lowerWCBound), int(upperWCBound)+1): pathToWords = os.path.join(sortedSentDir, str(i), 'sentences.words') if (os.path.exists(pa...
Python
0
@@ -25,16 +25,59 @@ ort re%0A%0A +wordsToRemove = %5B%0A 'hv',%0A 'h%C3%A6stv'%0A%5D%0A%0A def proc @@ -891,31 +891,8 @@ ta)%0A - #data = list(data)%0A @@ -988,24 +988,88 @@ ion, words)%0A + words = filter(lambda x: x not in wordsToRemove, words)%0A word @@ -1110,16 +1110,50 @@ ds) %...
0dece1167815327a272b590a7cec9a99464bf5ed
Bump version
uvicorn/__init__.py
uvicorn/__init__.py
from uvicorn.run import run __version__ = '0.0.15' __all__ = ['run']
Python
0
@@ -43,12 +43,11 @@ '0. -0.15 +1.0 '%0A__
c9ada050f2fcfcd11ba1461e0be0370de77cfe92
Fix request's response
appengine.py
appengine.py
#!/usr/bin/env python from __future__ import with_statement import argparse import os import stat import sys import urlparse import zipfile from distutils import version as dist_version import yaml import requests __version__ = '0.2' USER_AGENT = 'appengine.py/' + __version__ VERSION_URL = 'https://appengine.googl...
Python
0.000003
@@ -92,16 +92,32 @@ rt stat%0A +import StringIO%0A import s @@ -4255,16 +4255,34 @@ return +StringIO.StringIO( file_dow @@ -4291,11 +4291,16 @@ oad. -raw +content) %0A%0A%0Ad @@ -5369,16 +5369,31 @@ dest = + args.prefix or os.path
215cbbb4f9d9127d8ce2e60c9e49cb597e9d1633
add BANNED_LINKS
generate_card_csv.py
generate_card_csv.py
"""Fetches latest card names and links from hearthpwn. Outputs to cards.csv. """ import bs4 import collections import csv import httplib2 import logging import util BANNED_CARD_LIST = [ "Bananas", "Blizzard", "Boar", "Silence", "Charge", "Chicken", "Claw", "DEBUG", "Defender", "Dream", "Dispel"...
Python
0
@@ -161,16 +161,61 @@ t util%0A%0A +# These cards cause too many false positives%0A BANNED_C @@ -533,16 +533,164 @@ %22,%0A %5D%0A%0A +BANNED_LINKS = %5B%0A # There's a Lorewalker Cho NPC as well as minion. We want the minion%0A %22http://www.hearthpwn.com/cards/655-lorewalker-cho%22,%0A %5D%0A%0A def get_ @@ -...
01cab1aa48b12f33001851cbdc9755275f6aeb99
add some of the fit keywords to the write_input_nml routine
apogee/modelspec/ferre.py
apogee/modelspec/ferre.py
############################################################################### # ferre.py: module for interacting with Carlos Allende Prieto's FERRE code ############################################################################### import os import subprocess import numpy from apogee.modelspec import paramArrayInput...
Python
0.000001
@@ -1156,24 +1156,122 @@ offile,%0A + ffile=None,%0A erfile=None,%0A opfile=None,%0A @@ -1378,16 +1378,104 @@ nter=3,%0A + errbar=1,%0A indini=0,%0A init=0,%0A @@ -1802,24 +180...
d13dca630b2d34a7a0c41b8c3ef5dd79c75ec6cb
Update proxy examples
seleniumbase/config/proxy_list.py
seleniumbase/config/proxy_list.py
""" Proxy Server "Phone Book". Simplify running browser tests through a proxy server by adding your frequently-used proxies here. Now you can do something like this on the command line: "pytest SOME_TEST.py --proxy=proxy1" Format of PROXY_LIST server entries: * "ip_address:port" OR "username:password@ip_address:po...
Python
0
@@ -728,20 +728,22 @@ %22: %22 -212.87.220.2 +134.209.128.61 :312 @@ -806,20 +806,22 @@ %22: %22 -51.75.147.44 +165.227.83.185 :312
433227ccaa099b67ae3bd6076029b5cb504093e1
Fix python3 compatibility with the hide_std function
vcdriver/helpers.py
vcdriver/helpers.py
from __future__ import print_function import contextlib import datetime import os import socket import sys import time from colorama import init, Style from fabric.api import run from fabric.context_managers import settings from pyVmomi import vim import winrm from vcdriver.exceptions import ( TooManyObjectsFound...
Python
0.000003
@@ -2352,17 +2352,16 @@ null, 'w -b ') as nu
6ce072631d43903b2d623843213930552ed6f8f9
Standardize Python paths for master/slave/tools.
recipe_engine/unittests/test_env.py
recipe_engine/unittests/test_env.py
# Copyright (c) 2012 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. """Script to setup the environment to run unit tests. Modifies PYTHONPATH to automatically include parent, common and pylibs directories. """ import os...
Python
0.999962
@@ -474,16 +474,21 @@ abspath( +%0A os.path. @@ -510,24 +510,39 @@ IR, -'..', '..', '..' +os.pardir, os.pardir, os.pardir ))%0AD @@ -608,16 +608,53 @@ ools')%0A%0A +# Load our common Infra environment.%0A sys.path @@ -703,348 +703,59 @@ '))%0A -sys.path.insert(0, os.path.join(BASE_DIR, 'site_config'))%0Asys...
6a8e7152c9427f9152ce9651bb5a25b0b6f61b35
fix error while creating user
app/institutions/views.py
app/institutions/views.py
from django.contrib.auth import (login as django_login, authenticate, logout as django_logout) from django.contrib.auth.decorators import login_required from django.contrib.auth.forms import SetPasswordForm from django.http import JsonResponse, HttpResponseRedirect from django.shortcuts...
Python
0.000001
@@ -3467,84 +3467,84 @@ user -.organization = organization%0A user = user_form.save(commit=False) + = user_form.save(commit=False)%0A user.organization = organization %0A
3ad342a986efb47e06b2af38467f54f27eedd9c6
Add support for ouput files of the same dialog
accounting/convert_csv_distris_paymentorder.py
accounting/convert_csv_distris_paymentorder.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import StringIO import csv import sys ## SYNTAX # script.py facturasF55091367_20190603.csv #DISTRI CONSTANTS DISTRI_UFD = '0703' class CSVParser: def __init__(self, invoice_list): self.invoice_list = invoice_list pass def parseUFD(self): ...
Python
0
@@ -640,16 +640,345 @@ ne%5B1:%5D%0A%0A + def parseERP(self):%0A #%22J419004903723%22;%2257.91%22;%22No trobada%22%0A i = 0%0A dist_line = %5B%5D%0A while i%3Clen(self.invoice_list)-1:%0A if len(self.invoice_list%5Bi%5D) == 3:%0A dist_line.append(%5Bself.invoice...
d2834322478c9c3a7e42d37683d664459085d3f9
Fix comment
ginga/util/loader.py
ginga/util/loader.py
# # loader.py -- upper level routines used to load data # # This is open-source software licensed under a BSD license. # Please see the file LICENSE.txt for details. # from ginga.misc import Bunch from ginga.util import iohelper, io_fits, io_rgb def load_data(filespec, idx=None, logger=None, **kwargs): """Load d...
Python
0
@@ -360,26 +360,54 @@ to -determine the type +load a data item from a filespec (path or URL) %0A%0A
9448c082b158dcab960d33982e8189f2d2da4729
Fix flake8
git/compat/typing.py
git/compat/typing.py
# -*- coding: utf-8 -*- # config.py # Copyright (C) 2021 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php import sys if sys.version_info[:2] >= (3, 8): from typing import Final, Litera...
Python
0
@@ -314,16 +314,30 @@ Literal + # noqa: F401 %0Aelse:%0A @@ -383,9 +383,23 @@ Literal + # noqa: F401 %0A
99cf264a53025f8c80688f4ce89410a678eee876
update import statements
examples/pymata_i2c_read.py
examples/pymata_i2c_read.py
__author__ = 'Copyright (c) 2013 Alan Yorinks All rights reserved.' """ Copyright (c) 2013 Alan Yorinks All rights reserved. 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; either version 3 of the ...
Python
0
@@ -1108,15 +1108,8 @@ rom -PyMata. pyma
203fe9d57e6e66eae7375d8f4df1f5663cecfe93
list('abc') = ['a', 'b', 'c'], what we want is ['abc']
conary/lib/log.py
conary/lib/log.py
# # Copyright (c) 2004-2005 rPath, Inc. # # This program is distributed under the terms of the Common Public License, # version 1.0. A copy of this license should have been distributed with this # source file in a file called LICENSE. If it is not present, the license # is always available at http://www.opensource.org/...
Python
1
@@ -2500,18 +2500,14 @@ h = -list( +%5B path -) +%5D %0A
0d2ac990d69b7293524de9037a74161ca2f1ab60
simplified some of the code
examples/retriever-multi.py
examples/retriever-multi.py
#! /usr/bin/env python # -*- coding: iso-8859-1 -*- # vi:ts=4:et # $Id$ import sys import pycurl try: import signal from signal import SIGPIPE, SIG_IGN signal.signal(signal.SIGPIPE, signal.SIG_IGN) except ImportError: pass assert sys.version[:3] >= "2.2", "requires Python 2.2 or better" try: urls...
Python
0.999979
@@ -1104,19 +1104,8 @@ = 0%0A -curls = %7B%7D%0A mult @@ -1298,34 +1298,8 @@ (0)%0A - f = open(n, %22wb%22)%0A @@ -1314,32 +1314,60 @@ freelist.pop(0)%0A + c.f = open(n, %22wb%22)%0A c.setopt @@ -1421,31 +1421,12 @@ TA, +c. f) -%0A curls%5Bc%5D = f %0A @@ -1820,16 +1820,11...
5b2544ae494adabeeeb6e4ea34f888fe50e6809b
use iterator in evaluate
examples/segnet/evaluate.py
examples/segnet/evaluate.py
from __future__ import division import argparse import chainer from chainer import cuda from chainer.dataset import concat_examples import chainer.functions as F from chainer import serializers from chainercv.datasets import camvid_label_names from chainercv.datasets import CamVidDataset from chainercv.links import ...
Python
0.000004
@@ -958,16 +958,162 @@ ='test') +%0A it = chainer.iterators.SerialIterator(test, batch_size=args.batchsize,%0A repeat=False, shuffle=False) %0A%0A n_ @@ -1254,48 +1254,19 @@ for -i in range(0, len(test), args.batchsize) +batch in it :%0A @@ -1276,16 +1276,19 @@ ...
ac4457ca1b606fc7188f751f0d135bbcf8d9e44a
Include publisher, image/text url and author in TelegraafScraper
amcatscraping/scrapers/newspapers/telegraaf.py
amcatscraping/scrapers/newspapers/telegraaf.py
########################################################################### # (C) Vrije Universiteit, Amsterdam (the Netherlands) # # # # This file is part of AmCAT - The Amsterdam Content Analysis Toolkit # # ...
Python
0
@@ -1381,16 +1381,26 @@ ections%0A +import re%0A from dat @@ -1888,16 +1888,66 @@ week%22%0A%0A%0A +AUTHOR_RE = re.compile(%22%5Edoor (?P%3Cauthor%3E.+)$%22)%0A%0A%0A def mkda @@ -2073,16 +2073,48 @@ raper):%0A + publisher = %22De Telegraaf%22%0A%0A def @@ -4256,24 +4256,535 @@ caption%22))%0A%0A + ...
891d1c6528d3b36fce382190f7909b0aa31386bb
Fix mcsema-disass checks (#161)
tools/mcsema_disass/__main__.py
tools/mcsema_disass/__main__.py
#!/usr/bin/env python # Copyright 2017 Peter Goodman (peter@trailofbits.com), all rights reserved. import argparse import os import shutil import sys import tempfile import traceback import textwrap SUPPORTED_OS = ('linux', 'windows',) SUPPORTED_ARCH = ('x86', 'amd64',) def main(args=None): arg_parser = argparse....
Python
0
@@ -523,17 +523,17 @@ --std -_ +- defs %3Cfi @@ -2265,16 +2265,296 @@ _file)%0A%0A + fixed_command_args = %5B%5D%0A # ensure that any paths in arguments to the disassembler%0A # are absolute path%0A for fix_arg in command_args:%0A if os.path.exists(fix_arg):%0A fixed_command_args.append(os.path.abspat...
fb2e1799700cb678521f9fa44a657b0d2947ed12
Remove Tapastic/TheGodsPack (deleted from host)
dosagelib/plugins/tapastic.py
dosagelib/plugins/tapastic.py
# SPDX-License-Identifier: MIT # Copyright (C) 2019-2020 Tobias Gruetzmacher # Copyright (C) 2019-2020 Daniel Ring from ..scraper import _ParserScraper from ..helpers import indirectStarter class Tapastic(_ParserScraper): baseUrl = 'https://tapas.io/' imageSearch = '//article[contains(@class, "js-episode-arti...
Python
0
@@ -2636,57 +2636,8 @@ y'), -%0A cls('TheGodsPack', 'The-Gods-Pack'), %0A%0A
568dd436fe7a603aacae08e49eb876ec0d96b16d
call get_user_model() at run time
templated_emails/utils.py
templated_emails/utils.py
import logging import os from django.core.mail import EmailMultiAlternatives from django.conf import settings from django.template import Context, TemplateDoesNotExist from django.contrib.sites.models import Site from django.template.loader import render_to_string from django.utils.translation import get_language, acti...
Python
0
@@ -455,33 +455,8 @@ el%0A%0A -User = get_user_model()%0A%0A %0Atry @@ -1441,20 +1441,32 @@ ance(r, -User +get_user_model() )%5D%0A r @@ -1527,20 +1527,32 @@ ance(e, -User +get_user_model() )%5D%0A s @@ -1901,20 +1901,32 @@ = list( -User +get_user_model() .objects @@ -2499,36 +2499,48 @@ ance(recipien...
007a4a1ba529e2913357387c1f42b6028860fe98
Clean up coverage_coverage.py
test/coverage_coverage.py
test/coverage_coverage.py
"""Coverage-test Coverage.py itself.""" import os, shutil, sys import nose HTML_DIR = "htmlcov" def run_tests_with_coverage(): import coverage tracer = os.environ.get('COVERAGE_TEST_TRACER', 'c') version = "%s%s" % sys.version_info[:2] suffix = ".%s_%s" % (version, tracer) cov = coverage.co...
Python
0.000561
@@ -119,24 +119,85 @@ coverage():%0A + %22%22%22Run the test suite with coverage measuring itself.%22%22%22%0A import c @@ -1236,20 +1236,16 @@ - covmods%5B @@ -1256,20 +1256,16 @@ %5D = mod%0A - @@ -1659,24 +1659,86 @@ iles():%0A +%22%22%22Combine all the .coverage files and...
6881525aaada9b8a6c895be4dbc40b2fddc6eec6
Update booted.py
apps/led_berepi/booted.py
apps/led_berepi/booted.py
## This code for HW init ## It will show LED Blue ON, 30secs after booting ## We can easily check the booting has problem thispath='...BerePi/trunk/apps/led_berepi' import sys from ledinit import * debug_print = 1 def BootLed(): ledr_on() time.sleep(1) ledr_off() time.sleep(1) if __name__== "__main__" : if...
Python
0.000001
@@ -230,17 +230,17 @@ ():%0A%09led -r +b _on()%0A%09t @@ -256,17 +256,17 @@ (1)%0A%09led -r +b _off()%0A%09
2b2a730e45675151fe173c90a91f409b2d8c19fd
fix tests for mock protocol scheme and API subfolders
aptly_api/tests/client.py
aptly_api/tests/client.py
# -* encoding: utf-8 *- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from typing import Any, cast from unittest.case import TestCase import requests import requests...
Python
0
@@ -834,261 +834,381 @@ -def test_api_root_url(self) -%3E None:%0A cl = AptlyClient(%22http://test////%22)%0A self.assertEqual(cl.files.base_url, %22http://test%22)%0A%0A @requests_mock.Mocker(kw='r +@requests_mock.Mocker(kw='rmock')%0A def test_api_subdir_get(self, *, rmock: requests_mock.Moc...
246971d8dd7d6c5fdc480c55e4e79ffd7a840b9b
Add a render method to view that should be reimplemented
Cura/View/View.py
Cura/View/View.py
#Abstract for all views class View(object): def __init__(self): self._renderer = None
Python
0.000003
@@ -90,8 +90,56 @@ r = None +%0A%0A def render(self, glcontext):%0A pass%0A
014364b59a349430de2840dd2c5ad9e1df525b69
handle non-json errors
asyncio_apns/h2_client.py
asyncio_apns/h2_client.py
import asyncio import enum import ssl import collections import json from urllib.parse import urlsplit from h2.connection import H2Connection, ConnectionState from h2.events import (ConnectionTerminated, DataReceived, ResponseReceived, StreamEnded) from h2.exceptions import TooManyStreamsError ...
Python
0.000017
@@ -389,161 +389,47 @@ ass -HTTP2Error(Exception):%0A def __init__(self, code, headers, data=None):%0A self.code = code%0A self.headers = headers%0A self. +ExceptionJSONDataMixin:%0A data = -data +None %0A%0A @@ -477,32 +477,53 @@ ta is not None:%0A + try:%0A ...
169746eea4f8b520af9b7388ae62cdf903dd288b
remove redundant lambda usage
backend/maguire/celery.py
backend/maguire/celery.py
from __future__ import absolute_import import os from celery import Celery from django.conf import settings # set the default Django settings module for the 'celery' program. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'maguire.settings') app = Celery('maguire') # Using a string here means the worker will not...
Python
0.987853
@@ -43,17 +43,16 @@ port os%0A -%0A from cel @@ -74,42 +74,8 @@ ry%0A%0A -from django.conf import settings%0A%0A # se @@ -421,39 +421,8 @@ sks( -lambda: settings.INSTALLED_APPS )%0A%0A%0A
920209c1bb25ca59161414b285551a08da44a7b2
Add sponsors to admin
backend/sponsors/admin.py
backend/sponsors/admin.py
# from django.contrib import admin # from .models import Post # @admin.register(Post) # class PostAdmin(admin.ModelAdmin): # list_display = ("title", "published", "author")
Python
0
@@ -1,14 +1,12 @@ -# from django. @@ -27,18 +27,16 @@ admin%0A%0A -# from .mo @@ -51,17 +51,32 @@ ort -Post +Sponsor, SponsorLevel %0A%0A%0A -# @adm @@ -91,26 +91,40 @@ ter( -Post)%0A# class Post +SponsorLevel)%0Aclass SponsorLevel Admi @@ -148,14 +148,12 @@ n):%0A -# - list @@ -169,35 +169,99 @@ ...
ca674b743b6d48593f45d999335ae893cf2a90d6
Add github and facebook oauth credentials.
base/config/production.py
base/config/production.py
" Production settings must be here. " from .core import * from os import path as op SECRET_KEY = 'SecretKeyForSessionSigning' ADMINS = frozenset([MAIL_USERNAME]) # flask.ext.collect # ----------------- COLLECT_STATIC_ROOT = op.join(op.dirname(ROOTDIR), 'static') # auth.oauth # ---------- OAUTH_TWITTER = dict( ...
Python
0
@@ -317,141 +317,357 @@ -# flask-base-template app%0A consumer_key='ydcXz2pWyePfc3MX3nxJw',%0A consumer_secret='Pt1t2PjzKu8vsX5ixbFKu5gNEAekYrbpJrlsQMIwquc' +consumer_key='750sRyKzvdGPJjPd96yfgw',%0A consumer_secret='UGcyjDCUOb1q44w1nUk8FA7aXxvwwj1BCbiFvYYI',%0A)%0A%0AOAUTH_FACEBOOK = dict(%0A consume...
7ee399950ef6cacfbb666b09a0e01d8f14de3c98
Fix uom asignment
medical_pharmacy/wizard/medical_prescription_to_sale_wizard.py
medical_pharmacy/wizard/medical_prescription_to_sale_wizard.py
# -*- coding: utf-8 -*- ############################################################################## # # Author: Dave Lasley <dave@laslabs.com> # Copyright: 2015 LasLabs, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public Lic...
Python
0.998781
@@ -3589,16 +3589,38 @@ _id': l. +medical_medication_id. uom_id.i
436495835604d58b5c188bb0151e88d11e8e5de2
fix httprpc_soap_basic.py
src/rpclib/test/interop/server/httprpc_soap_basic.py
src/rpclib/test/interop/server/httprpc_soap_basic.py
#!/usr/bin/env python # # rpclib - Copyright (C) Rpclib contributors. # # This library 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 2.1 of the License, or (at your option) any later ...
Python
0.000923
@@ -1326,24 +1326,29 @@ b.server +.wsgi import wsgi%0A%0Aif @@ -1339,20 +1339,31 @@ import -w +W sgi +Application %0A%0Aif __n @@ -1525,13 +1525,12 @@ n = -w +W sgi -. Appl
7722cba00b05a74c4e3f1266baf26afb8ffbc286
Mark prepare tests as slow for Travis
Yank/tests/test_prepare.py
Yank/tests/test_prepare.py
#!/usr/bin/python #============================================================================================= # MODULE DOCSTRING #============================================================================================= """ Test 'yank prepare'. """ #===========================================================...
Python
0
@@ -482,45 +482,8 @@ le%0A%0A -from openmmtools import testsystems%0A%0A from @@ -500,20 +500,22 @@ ins. -skip +attrib import Skip @@ -514,22 +514,12 @@ ort -Skip, SkipTest +attr %0A%0Afr @@ -1562,32 +1562,68 @@ dispatch(args)%0A%0A +%0A@attr('slow') # Skip on Travis-CI%0A def test_prepare @@ -2387,16 +238...
994ee0a4f7d9603b37f8e2ec6e9e49eb8c5eaf38
Fix test broken by traitlets 5.2.2 release. (#1795)
tests/integration/cli/commands/test_issue_1667.py
tests/integration/cli/commands/test_issue_1667.py
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import os.path import subprocess import sys import pytest from pex.cli.testing import run_pex3 from pex.interpreter import PythonInterpreter from pex.testing import run_pex_command from ...
Python
0
@@ -910,16 +910,207 @@ %3E None%0A%0A + # The traitlets 5.2.2 release breaks IPython.%0A constraints = os.path.join(str(tmpdir), %22constraints.txt%22)%0A with open(constraints, %22w%22) as fp:%0A fp.write(%22traitlets%3C5.2.2%5Cn%22)%0A%0A # We @@ -1619,16 +1619,62 @@ binary,%0A + %22--co...
70332af1d948c882372c91264d776d73b0bcfb29
Bump version
sqliteschema/__version__.py
sqliteschema/__version__.py
# encoding: utf-8 from datetime import datetime __author__ = "Tsuyoshi Hombashi" __copyright__ = "Copyright 2016-{}, {}".format(datetime.now().year, __author__) __license__ = "MIT License" __version__ = "0.15.3" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
Python
0
@@ -209,9 +209,9 @@ .15. -3 +4 %22%0A__
c7b6e04c9cc2c218ef816619320d1dc17420ae4c
Bump version
sqliteschema/__version__.py
sqliteschema/__version__.py
__author__ = "Tsuyoshi Hombashi" __copyright__ = f"Copyright 2016, {__author__}" __license__ = "MIT License" __version__ = "1.2.0" __maintainer__ = __author__ __email__ = "tsuyoshi.hombashi@gmail.com"
Python
0
@@ -121,17 +121,17 @@ = %221.2. -0 +1 %22%0A__main
7f687783f3461b4aecb3bd2e905ef3f703c5cf66
Fix tst_qml_indent
tests/system/suite_editors/tst_qml_indent/test.py
tests/system/suite_editors/tst_qml_indent/test.py
############################################################################# ## ## Copyright (C) 2015 The Qt Company Ltd. ## Contact: http://www.qt.io/licensing ## ## This file is part of Qt Creator. ## ## Commercial License Usage ## Licensees holding valid commercial Qt licenses may use this file in ## accordance wit...
Python
0
@@ -2873,16 +2873,18 @@ ark the +2 last lin @@ -2884,17 +2884,49 @@ ast line -%0A +s%0A for _ in range(2):%0A
931e88af93a0ad9f234be0db0056610037f7a289
improve print msg
tests/test_nb_relationships_change_dcnt_values.py
tests/test_nb_relationships_change_dcnt_values.py
#!/usr/bin/env python """Test notebook code""" from goatools.base import get_godag from goatools.gosubdag.gosubdag import GoSubDag from goatools.gosubdag.plot.gosubdag_plot import GoSubDagPlot def test_nb(): """Test notebook code""" godag = get_godag("go-basic.obo", optional_attrs={'relationship'}) go_lea...
Python
0.999994
@@ -188,16 +188,17 @@ agPlot%0A%0A +%0A def test @@ -512,32 +512,35 @@ ion)%0A print(' +r0 THE VALUE OF dcn @@ -574,32 +574,33 @@ t_virion.dcnt))%0A +%0A gosubdag_r1 @@ -713,32 +713,35 @@ ion)%0A print(' +r1 THE VALUE OF dcn @@ -779,24 +779,25 @@ rion.dcnt))%0A +%0A gosubdag @@ -1152,17 +1152...
aabdc3276098db1a44c0518c2078bbd201879306
remove readlines
cps/crawl.py
cps/crawl.py
# coding=utf-8 import os import io import sys import json import time import urllib2 import hashlib from bs4 import BeautifulSoup from cps.gmail import Gmail class CPS(object): folder = os.path.dirname(os.path.abspath(__file__)) filenameconf = "conf.json" def __init__(self, conf_file=None): pri...
Python
0
@@ -2056,29 +2056,16 @@ tigos = -self._linhas( self.car @@ -2079,17 +2079,16 @@ _dados() -) %0A @@ -3154,13 +3154,8 @@ read -lines ()%0A%0A
891e4574d024fdb745bfe86f4cc83bf803968a3b
throw exception when loading a director message fails
lg_common/src/lg_common/helpers.py
lg_common/src/lg_common/helpers.py
import json import rospy import urllib import urlparse def escape_asset_url(asset_url): """ Replace all non-alnum characters with underscore """ ss = '' try: for ch in asset_url: if str.isalnum(str(ch)): ss += ch else: ss += "_" ...
Python
0
@@ -2619,29 +2619,27 @@ and -returns an empty dict +throws an exception %0A @@ -2900,16 +2900,32 @@ message) +%0A raise e %0A%0A re
5443d47cbfc59723df103e334262c6485c855b01
add missing import for `_`
addons/note/models/note.py
addons/note/models/note.py
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, fields, models from odoo.tools import html2plaintext class Stage(models.Model): _name = "note.stage" _description = "Note Stage" _order = 'sequence' name = fields.Char('Stage Nam...
Python
0
@@ -129,16 +129,19 @@ , models +, _ %0Afrom od
ec8eda3bfbaf38ec5545fd08e24b5fe2e1af94d5
remove unused variables
advection_rk/simulation.py
advection_rk/simulation.py
from __future__ import print_function import importlib import numpy as np import matplotlib.pyplot as plt import advection import advection_rk.fluxes as flx import mesh.patch as patch import mesh.integration as integration import mesh.array_indexer as ai from util import profile class Simulation(advection.Simulati...
Python
0.000014
@@ -36,77 +36,8 @@ on%0A%0A -import importlib%0Aimport numpy as np%0Aimport matplotlib.pyplot as plt%0A%0A impo @@ -45,24 +45,24 @@ t advection%0A + import advec @@ -87,35 +87,8 @@ flx%0A -import mesh.patch as patch%0A impo @@ -118,24 +118,24 @@ integration%0A + import mesh. @@ -159,34 +159,8 @@ ai%0A%0A -from...
b24de4ee1e641194b378b99462ec1db1d5c4ad2c
Remove unnecessary TODO.
airtime_service/service.py
airtime_service/service.py
from twisted.application import strports from twisted.internet import reactor from twisted.python import usage from twisted.web import server from .api import AirtimeServiceApp DEFAULT_PORT = '8080' class Options(usage.Options): """Command line args when run as a twistd plugin""" # TODO other args optP...
Python
0.000001
@@ -287,30 +287,8 @@ %22%22%22%0A - # TODO other args%0A
53dd5ef261d0b7e2e406d0a4a97c4b5d5b691b70
use mock in testing output function
retirement_api/tests/test_models.py
retirement_api/tests/test_models.py
import os import sys from retirement_api.models import AgeChoice, Question, Step, Page, Tooltip import mock from django.test import TestCase BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) sys.path.append(BASE_DIR) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") class ViewModels(Te...
Python
0.000005
@@ -1296,16 +1296,18 @@ %0A + # outfile @@ -1350,24 +1350,26 @@ slug%0A + # self.testqu @@ -1409,32 +1409,34 @@ ut=True)%0A + # self.assertTrue @@ -1458,24 +1458,425 @@ (outfile))%0A%0A + def test_question_dump_mock_output(self):%0A open_name = '%25s.open' %25 __name__%0A ...
b2c0a8dac5de83139e6dbe1a568f9f388e89aa74
remove db calls
retirement_api/tests/test_models.py
retirement_api/tests/test_models.py
import os import sys from retirement_api.models import AgeChoice, Question, Step, Page, Tooltip import mock from django.test import TestCase BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) sys.path.append(BASE_DIR) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") class ViewModels(Te...
Python
0.000001
@@ -294,16 +294,17 @@ ings%22)%0A%0A +%0A class Vi @@ -327,16 +327,18 @@ e):%0A%0A + # fixture @@ -369,19 +369,24 @@ test -cas +agechoic e = AgeC @@ -390,35 +390,39 @@ geChoice -.objects.get(age=62 +(age=62, aside=%22Aside.%22 )%0A te @@ -442,33 +442,39 @@ Question -.objects.all()%5B0%5D +(title=%22...
5f6fd59fdc137255a12f2b145a59d1fedfc42706
Fix api/quotes endpoint
django_project/api/views/quotes_views.py
django_project/api/views/quotes_views.py
import json from datetime import datetime from django.conf import settings from django.core.paginator import Paginator import requests from rest_framework import generics from rest_framework import views from rest_framework.pagination import PaginationSerializer from rest_framework.renderers import BrowsableAPIRender...
Python
0.000031
@@ -2456,32 +2456,214 @@ rom_date is not +None and to_date is not None:%0A quote_date = datetime.strptime(from_date, '%25Y-%25m-%25d')%0A items = items.filter(quote_date=quote_date)%0A elif from_date is not None:%0A @@ -2785,16 +2785,18 @@ +el if to_da
a1dce3d7ab710106bf3bfaaa01536efebb17c44e
Make sqlite wait longer for locked files
server/src/voodoo/dbutil.py
server/src/voodoo/dbutil.py
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2005-2009 University of Deusto # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # This software consists of contributions made by many individuals, # listed...
Python
0.000001
@@ -974,16 +974,383 @@ ag'%5D = 2 +%0A elif engine == 'sqlite':%0A # By default, sqlite uses a timeout of 5 seconds. Given the %0A # concurrency levels that WebLab-Deusto might achieve with%0A # multiple users in a queue, this might not be enough. We%0A # increase it to a minute and a ha...
5ffc9dfe861db660018dec42b5145c7ed026a3d0
add find_git_project_root
commitizen/git.py
commitizen/git.py
import os from tempfile import NamedTemporaryFile from typing import Optional, List from commitizen import cmd def tag(tag: str): c = cmd.run(f"git tag {tag}") return c def commit(message: str, args=""): f = NamedTemporaryFile("wb", delete=False) f.write(message.encode("utf-8")) f.close() c...
Python
0.000005
@@ -3,16 +3,41 @@ port os%0A +from pathlib import Path%0A from tem @@ -1399,8 +1399,119 @@ trip()%5D%0A +%0A%0Adef find_git_project_root() -%3E Path:%0A c = cmd.run(%22git rev-parse --show-toplevel%22)%0A return Path(c.out)%0A
7c6cf62089c5601d1db9703a578a175a1d51834d
make sure cc is always a list when detecting distutils C compiler.
yaku/sysconfig.py
yaku/sysconfig.py
import os import sys import distutils.unixccompiler import distutils.ccompiler import distutils.sysconfig from distutils \ import \ errors UNIX_ENV_ATTR = { "CC": "compiler", "CXX": "compiler_cxx", "CCSHARED": "compiler_so", "LDSHARED": "linker_so", "LINKCC": "linke...
Python
0
@@ -538,16 +538,170 @@ one%5D%0A%7D%0A%0A +def _mingw32_cc():%0A compiler_type = %22mingw32%22%0A compiler = distutils.ccompiler.new_compiler(compiler=compiler_type)%0A return compiler.compiler_so%0A%0A def dete @@ -1206,32 +1206,33 @@ cc = +%5B compiler.cc%0A @@ -1226,16 +1226,17 @@ piler...
4d8ed9f6785b17fe3281cd7e140a4835af431c39
check if log is provided
yerba/workflow.py
yerba/workflow.py
import heapq import logging import os import core import utils from services import Service logger = logging.getLogger('yerba.workflow') def _format_args(args): argstring = "" for (arg, value, shorten) in args: if shorten == 1: val = os.path.basename(str(value)) else: ...
Python
0.000005
@@ -3060,25 +3060,24 @@ if self. -_ workflow._lo @@ -3080,16 +3080,41 @@ ._logged + or not self.workflow.log :%0A @@ -3185,25 +3185,24 @@ h open(self. -_ workflow.log
347c1ef92894841640704c645ba8f23e390e8b2e
Add touch option to uri command
ykman/cli/oath.py
ykman/cli/oath.py
# Copyright (c) 2015 Yubico AB # 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 list of conditi...
Python
0.000001
@@ -1763,16 +1763,142 @@ rse_qs%0A%0A +click_touch_option = click.option(%0A '-t', '--touch', is_flag=True,%0A help='Require touch on YubiKey to generate code.')%0A%0A %0A@click. @@ -3460,106 +3460,21 @@ lick -.option(%0A '-t', '--touch', is_flag=True,%0A help='Require touch on YubiKey to generate code.'...
0005a11dcfb3f5e8ae796d058fa5d855d2b91e65
Version 0.2.0
ynm3k/__init__.py
ynm3k/__init__.py
__VERSION__ = "0.1.11"
Python
0.000001
@@ -14,10 +14,9 @@ %220. -1.11 +2.0 %22%0A
b4635cb6f33804cac298697da593aade08dcac4d
Fix missing import: sys
zerorpc/socket.py
zerorpc/socket.py
# -*- coding: utf-8 -*- # Open Source Initiative OSI - The MIT License (MIT):Licensing # # The MIT License (MIT) # Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com) # # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated documentation files (the "Softwa...
Python
0.999999
@@ -1225,16 +1225,27 @@ WARE.%0A%0A%0A +import sys%0A import t
5b4a64baf0261d32bffb4471cd2f51a14a38f075
Fix a bug
zq_calc/mv_avg.py
zq_calc/mv_avg.py
from zq_db.mongodb import get_recent_stock_data from zq_gen.str import cmd_str2dic def mv_avg(cmd_str): '''Calculate the top stocks ranked by moving average Args: cmd_str: The command string -d: days range used when calculating moving average -n: number of th...
Python
0.000015
@@ -642,16 +642,53 @@ ta(days) + # the d @@ -753,16 +753,16 @@ e stock%0A - for @@ -853,22 +853,8 @@ e'%5D%0A - i = 1%0A @@ -877,54 +877,130 @@ -docs_len = len(docs)%0A while i%3Cdocs_len: +for doc in docs: ...
297ed628a7a9f00f0a4ed8f026c5ae02c8ab57b9
Store the correct revision
cloud_browser/cloud/cernvmfs.py
cloud_browser/cloud/cernvmfs.py
"""File-system datastore.""" from __future__ import with_statement import os from cloud_browser.app_settings import settings from cloud_browser.cloud import errors, base from cloud_browser.common import SEP from cvmfs import Repository ###############################################################################...
Python
0.000099
@@ -4611,16 +4611,30 @@ evision +%5C%0A if revis @@ -4654,20 +4654,49 @@ t' else -None +self.repository.manifest.revision %0A @@ -4699,29 +4699,24 @@ if -self. revision :%0A @@ -4707,16 +4707,28 @@ revision + != 'latest' :%0A
2cd120eccc9ffd2c726646bad4bfc0a00415dbea
Use module import
contextvars/__init__.py
contextvars/__init__.py
import collections.abc import threading from immutables import Map __all__ = ('ContextVar', 'Context', 'Token', 'copy_context') _NO_DEFAULT = object() class ContextMeta(type(collections.abc.Mapping)): # contextvars.Context is not subclassable. def __new__(mcls, names, bases, dct): cls = super()...
Python
0.000001
@@ -38,12 +38,14 @@ ng%0A%0A -from +import imm @@ -55,19 +55,8 @@ bles - import Map %0A%0A%0A_ @@ -618,16 +618,27 @@ _data = +immutables. Map()%0A
f936843de5d535a4e59d5c0c819f9e3882f39624
Make cluster-info.py executable
contrib/cluster-info.py
contrib/cluster-info.py
import argparse import json import botocore.session def tag_dict(tags): return dict([(item['Key'], item['Value']) for item in tags]) def get_stack_info(cfn_client, cluster): stack_name = 'klondike-cluster-{}'.format(cluster) info = { 'stack_name': stack_name, } cfn_resp = cfn_client.de...
Python
0.001782
@@ -1,12 +1,35 @@ +#!/usr/bin/env python%0A%0A import argpa