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 |
|---|---|---|---|---|---|---|---|
141b5c6229505836f53a0ee49e532d3326e73e60 | Fix test case in test_volume_unicode.py | cinder/tests/tempest/api/volume/test_volume_unicode.py | cinder/tests/tempest/api/volume/test_volume_unicode.py | # -*- coding: utf-8 -*-
# Copyright 2016 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#... | Python | 0.000092 | @@ -806,16 +806,33 @@
ta_utils
+%0Aimport testtools
%0A%0ACONF =
@@ -2124,24 +2124,154 @@
lume_name)%0A%0A
+ @testtools.skipUnless(CONF.volume_feature_enabled.snapshot,%0A %22Cinder volume snapshots are disabled%22)%0A
def test
@@ -2635,16 +2635,132 @@
ption'%5D)
+%0A%0A # Cr... |
ce04714baa083bc2aa2e6aff108b96b5dae14bd1 | Make RX Reminder compatible with SMART 0.5 | rx_reminder/reminder.py | rx_reminder/reminder.py | """
Example SMArt REST Application: Parses OAuth tokens from
browser-supplied cookie, then provides a list of which prescriptions
will need to be refilled soon (based on dispense day's supply + date).
Josh Mandel
Children's Hospital Boston, 2010
"""
import sys, os
abspath = os.path.dirname(__file__)
sys.path.append(ab... | Python | 0 | @@ -476,16 +476,26 @@
.common.
+rdf_tools.
util imp
@@ -2318,17 +2318,11 @@
ent.
-records_X
+get
_med
@@ -2333,12 +2333,8 @@
ions
-_GET
()%0A%0A
|
a161de00e12fbc6a75458e59ac773e5c0fc272ae | fix relation with multi pk in preprocessing | sacrud/preprocessing.py | sacrud/preprocessing.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2014 uralbash <root@uralbash.ru>
#
# Distributed under terms of the MIT license.
"""
Preprocessing
"""
import ast
import inspect
import json
import uuid
from datetime import datetime
import six
from .common import delete_fileobj, store_f... | Python | 0.000002 | @@ -1613,14 +1613,8 @@
%5D)))
-.all()
%0A
@@ -1629,16 +1629,22 @@
urn objs
+.all()
%0A%0A pa
|
e2f83a6a5d43ebc52d03d4059a7526a579a425c1 | Set User Profile Unicode Function | darkoob/social/models.py | darkoob/social/models.py | from django.db import models
from django.contrib.auth.models import User
from django.db.models.signals import post_save
SEX_CHOICES = (
('Male', 'Male'),
('Female', 'Female'),
)
class UserProfile(models.Model):
user = models.OneToOneField(User)
sex = models.CharField(max_length = 6, choices = SEX_CHO... | Python | 0.000001 | @@ -360,16 +360,75 @@
= True)
+%0A%09def __unicode__(self):%0A%09%09return self.user.get_full_name()
%0A%0Adef cr
|
3496a5e6fc8213dbecafebe70c762c18210eaa92 | Fix PyLint C0103 on `salt.modules.systemd`. Refs #1775. | salt/modules/systemd.py | salt/modules/systemd.py | '''
Provide the service module for systemd
'''
# Import python libs
import os
import re
# Import salt libs
import salt.utils
LOCAL_CONFIG_PATH = '/etc/systemd/system'
VALID_UNIT_TYPES = ['service', 'socket', 'device', 'mount', 'automount',
'swap', 'target', 'path', 'timer']
def _sd_booted():
... | Python | 0 | @@ -680,17 +680,25 @@
-a
+cgroup_fs
= os.st
@@ -730,17 +730,30 @@
-b
+cgroup_systemd
= os.st
@@ -887,17 +887,25 @@
if
-a
+cgroup_fs
.st_dev
@@ -907,17 +907,30 @@
_dev !=
-b
+cgroup_systemd
.st_dev:
|
9929dd6d6bdd5231d8af723b0dcbcf7972a6e165 | fix typo in docstring | salt/states/timezone.py | salt/states/timezone.py | '''
Management of timezones
=======================
The timezone can be managed for the system:
.. code-block:: yaml
America/Denver:
timezone.system
utc: True
'''
def __virtual__():
'''
Only load if the timezone module is available in __salt__
'''
return 'timezone' if 'timezone.ge... | Python | 0.002553 | @@ -154,16 +154,17 @@
e.system
+:
%0A
|
ae62c5ba33a5cb1d09dd7573d11ccb3e982f9809 | Enable with-tag extension in Jinja2 render. | salt/utils/templates.py | salt/utils/templates.py | '''
Template render systems
'''
from __future__ import absolute_import
# Import python libs
import codecs
import os
import imp
import logging
import tempfile
import traceback
# Import third party libs
import jinja2
# Import salt libs
import salt.utils
import salt.exceptions
from salt.utils.jinja import SaltCacheLoa... | Python | 0 | @@ -2511,24 +2511,94 @@
ext%5B'env'%5D)%0A
+ env_args = %7B'extensions': %5B'jinja2.ext.with_'%5D, 'loader': loader%7D%0A
if opts.
@@ -2667,29 +2667,26 @@
ronment(
-loader=loader
+**env_args
)%0A el
@@ -2756,23 +2756,8 @@
- loader=loader,
und
@@ -2785,16 +2785,27 @@
ndefined
+,**env_args
)%0A ... |
2cea653025b8350fd8e586ec2a3cfd83beee1b1d | Fix #6698 | salt/utils/templates.py | salt/utils/templates.py | '''
Template render systems
'''
from __future__ import absolute_import
# Import python libs
import codecs
import os
import imp
import logging
import tempfile
import traceback
import sys
# Import third party libs
import jinja2
import jinja2.ext
# Import salt libs
import salt.utils
import salt.exceptions
from salt.ut... | Python | 0 | @@ -1525,68 +1525,8 @@
ile%0A
- with open(tmplsrc, 'r') as fp_:%0A
@@ -1579,18 +1579,15 @@
ata=
-fp_.read()
+tmplsrc
)%0A
|
2ea6cd252d92b42500b82dda4c3d9357dd314b1a | Make aws work more like joyent | saltcloud/clouds/aws.py | saltcloud/clouds/aws.py | '''
The AWS Cloud Module
====================
The AWS cloud module is used to interact with the Amazon Web Services system.
To use the AWS cloud module the following configuration parameters need to be
set in the main cloud config:
.. code-block:: yaml
# The AWS API authentication id
AWS.id: GKTADJGHEIQSXMK... | Python | 0.000032 | @@ -3073,22 +3073,22 @@
= conn.
-deploy
+create
_node(**
@@ -3617,24 +3617,85 @@
eturn False%0A
+ if saltcloud.utils.wait_for_ssh(data.public_ips%5B0%5D):%0A
cmd = ('
@@ -3746,14 +3746,8 @@
@%7B2%7D
- %22sudo
'%0A
@@ -3760,37 +3760,17 @@
-'/home/ec2-user/deployment.sh
+ '%22%7B3%7D
%22').
... |
584f4fb7487e05cfa3bc4dd0c52c57cd17f08ac1 | Add @anonymous_required decorator to django-common | django_common/decorators.py | django_common/decorators.py | try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps
import inspect
from django.conf import settings
from django.http import HttpResponseRedirect
def ssl_required(allow_non_ssl=False):
"""Views decorated with this will always get redirected to https except when ... | Python | 0 | @@ -1265,28 +1265,442 @@
*kwargs)%0A return wrapper%0A
+%0Adef anonymous_required(view, redirect_to=None):%0A %22%22%22%0A Only allow if user is NOT authenticated.%0A %22%22%22%0A%0A if redirect_to is None:%0A redirect_to = settings.LOGIN_REDIRECT_URL%0A%0A @wraps(view)%0A def wrapper(reque... |
f4e30e732252b2183e7d436c4e04245e20d5c0ab | version update | django_mako_plus/version.py | django_mako_plus/version.py | # This file should have NO imports and be entirely standalone.
# This allows it to import into the runtime DMP as well as
# setup.py during installation.
__version__ = '4.5.8'
| Python | 0.000001 | @@ -169,10 +169,10 @@
'4.
-5.8
+6.1
'%0A%0A
|
6abf96e9d0617c03a47dfa3743aa1e19202c6bfb | Fix doc | django_project/api/views.py | django_project/api/views.py | from datetime import datetime
from rest_framework import generics
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework import views
from companies.models import Company
from quotes.models import Quote
from serializers import CompanySerializer, QuoteSerializer
... | Python | 0.000001 | @@ -2008,16 +2008,25 @@
d_date%60%0A
+ %0A
|
41a002c8f4854f3bcabf395b9e8747e7aa57d0a8 | fix allele delimiter splitting | beacon/src/api/import_controllers.py | beacon/src/api/import_controllers.py | """
@package api
Data import controllers
"""
from flask import Blueprint, jsonify, Flask, request, redirect, url_for
from werkzeug.utils import secure_filename
from api.database import DataAccess
from api import app
import vcf
import io
import_controllers = Blueprint('import_controllers', __name__)
@import_controller... | Python | 0.000082 | @@ -229,16 +229,26 @@
mport io
+%0Aimport re
%0A%0Aimport
@@ -1575,16 +1575,36 @@
lleles =
+ re.split(r'%5B%5C%5C/%7C%5D',
sample.
@@ -1615,18 +1615,8 @@
ases
-.split('/'
)%0A
@@ -1847,26 +1847,8 @@
cf(%7B
-'build':'GRCh38',
'var
|
8f9e7d4ed2a99e69ff4f3ca4a51bc38846f8a0ba | Remove the unicode function | bin/addons/base/ir/ir_translation.py | bin/addons/base/ir/ir_translation.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
#... | Python | 0.000367 | @@ -1811,16 +1811,8 @@
de,
-unicode(
lang
@@ -1820,17 +1820,8 @@
name
-,'utf-8')
) fo
|
ed04c3cb86a1d39a4e7a3fa65c87ad05e7adbc8d | Fix missing keras module when auto-generating docs | tensorflow_recommenders_addons/dynamic_embedding/__init__.py | tensorflow_recommenders_addons/dynamic_embedding/__init__.py | # Copyright 2020 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.000002 | @@ -1286,24 +1286,37 @@
odel_mode',%0A
+ 'keras',%0A
'math',%0A
|
47c38b660e9cfb80d34bb59c3033275cd21469e7 | Generate binary data for linear_fft_pipeline | test/benchmarks/performance_vs_serial/linear_fft_pipeline.py | test/benchmarks/performance_vs_serial/linear_fft_pipeline.py | """ Test a pipeline with repeated FFTs and inverse FFTs """
from timeit import default_timer as timer
import bifrost as bf
from bifrost import pipeline as bfp
from bifrost import blocks as blocks
from bifrost_benchmarks import PipelineBenchmarker
class GPUFFTBenchmarker(PipelineBenchmarker):
""" Test the sigproc r... | Python | 0.999999 | @@ -95,16 +95,35 @@
s timer%0A
+import numpy as np%0A
import b
@@ -434,20 +434,20 @@
-fil_
+data
file = %22
../.
@@ -446,90 +446,129 @@
= %22
-../../../data/1chan8bitNoDM.fil%22%0A data = blocks.read_sigproc(%5Bfil_file%5D
+numpy_data0.bin%22%0A data = blocks.binary_io.BinaryFileReadBl... |
afdff7a906c87c34cf6395a197df632ee1ad9c40 | add check directly to service | biomaj_process/biomaj_process_web.py | biomaj_process/biomaj_process_web.py | '''
Web interface to query list/download status
Manage sessions and metrics
'''
import ssl
import os
import yaml
from flask import Flask
from flask import jsonify
from flask import request
from prometheus_client import Counter
from prometheus_client import Gauge
from prometheus_client.exposition import generate_lates... | Python | 0 | @@ -1713,22 +1713,16 @@
'%5D%5B'
-local_endpoint
+hostname
'%5D +
|
d3e69e7512fbc24537fa37e4e3187ec042009128 | Add a GUID, description and published date to podcast RSS items | blanc_basic_podcast/podcast/feeds.py | blanc_basic_podcast/podcast/feeds.py | from django.conf import settings
from django.core.urlresolvers import reverse_lazy
from django.contrib.sites.models import Site
from django.contrib.staticfiles.storage import staticfiles_storage
import mimetypes
from .itunesfeed import PodcastFeed
from .models import PodcastFile
class BasicPodcastFeed(PodcastFeed):
... | Python | 0 | @@ -1068,16 +1068,252 @@
.all()%0A%0A
+ def item_description(self, obj):%0A return obj.description%0A%0A def item_pubdate(self, obj):%0A return obj.date%0A%0A def item_guid(self, obj):%0A return u'%25s:podcast:%25d' %25 (Site.objects.get_current().domain, obj.pk)%0A%0A
def
|
19414cbab6bcb8f552b86dfaa7d74667cc1ce018 | Fix some tests | bluebottle/notifications/messages.py | bluebottle/notifications/messages.py | # -*- coding: utf-8 -*-
from builtins import object
from builtins import str
from operator import attrgetter
from django.contrib.admin.options import get_content_type_for_model
from django.template import loader
from django.utils.html import format_html
from future.utils import python_2_unicode_compatible
from bluebo... | Python | 0.021858 | @@ -103,16 +103,17 @@
getter%0A%0A
+%0A
from dja
@@ -511,16 +511,67 @@
anguage%0A
+from bluebottle.utils.email_backend import to_text%0A
%0A%0A@pytho
@@ -2315,35 +2315,43 @@
-context =
+return to_text.handle(
self.
-get_
generic_
@@ -2359,128 +2359,17 @@
onte
-xt()%0A template = loader.get_temp... |
5b022bd941d3cdb3656c63c72a91a36d4d81b8c6 | print out request response to enable debugging of failed tests | booster_bdd/features/src/pipeline.py | booster_bdd/features/src/pipeline.py | import time
import requests
import features.src.support.helpers as helpers
import re
import os
start_time = time.time()
class Pipeline(object):
def __init__(self):
###############################################
# Initialize variables from Environment setting
self.osoUsername = os.envir... | Python | 0.000003 | @@ -1492,32 +1492,102 @@
s=self.headers)%0A
+%0A print ('Build status response = %7B%7D'.format(r.text))%0A%0A
|
851043226c0eb28e52b19d028084796c9a272278 | Add retry to download_file.py (#10727) | build_tools/scripts/download_file.py | build_tools/scripts/download_file.py | #!/usr/bin/env python3
# Copyright 2021 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""Downloads a file from the web and decompresses it if necessary. NEVER Use
... | Python | 0 | @@ -490,16 +490,112 @@
request%0A
+import urllib.error%0Aimport logging%0Aimport time%0A%0ADEFAULT_MAX_TRIES = 3%0ARETRY_COOLDOWN_TIME = 1.0%0A
%0A%0Adef pa
@@ -1463,168 +1463,337 @@
hive
-.
%22)%0A
-return parser.parse_args()%0A%0A%0Adef main(args):%0A output_dir = os.path.dirname(args.output)%0A%0A if not os.... |
88d0bf0776923568e9ebef72552fb6904f22162a | Fix traffic icon directions | bumblebee/modules/network_traffic.py | bumblebee/modules/network_traffic.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Displays network traffic
* No extra configuration needed
"""
import psutil
import netifaces
import bumblebee.input
import bumblebee.output
import bumblebee.engine
import bumblebee.util
WIDGET_NAME = 'network_traffic'
class Module(bumblebee.engine.Module):
"""... | Python | 0.000086 | @@ -512,27 +512,26 @@
self._
-download_tx
+bytes_recv
= self.
@@ -572,25 +572,26 @@
self._
-upload_tx
+bytes_sent
= self.
@@ -1035,27 +1035,26 @@
-download_tx
+bytes_recv
= self.
@@ -1089,25 +1089,26 @@
-upload_tx
+bytes_sent
= self.
@@ -1165,95 +1165,95 @@
= (
-download_tx - self._d... |
498c00e96d85eb920b43d661facee7158dbe4262 | Set shop extra settings to empty dict in DTO if `NULL` in database | byceps/services/shop/shop/service.py | byceps/services/shop/shop/service.py | """
byceps.services.shop.shop.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from typing import List, Optional, Set
from ....database import db
from .models import Shop as DbShop
from .transfer.models import Shop, ShopID
cl... | Python | 0 | @@ -2806,24 +2806,105 @@
p) -%3E Shop:%0A
+ settings = shop.extra_settings if (shop.extra_settings is not None) else %7B%7D%0A%0A
return S
@@ -3023,35 +3023,24 @@
ed,%0A
-shop.extra_
settings,%0A
|
4d1e410baec4b586c576379a3cf630b69e756a78 | fix dumb mistake in reg tid | bin/tid.py | bin/tid.py | import gspread
import sys
from oauth2client.service_account import ServiceAccountCredentials
from datetime import datetime, timezone
import os
import time
# This script sits in /home/mattfel/regression/synth
# arg 1 = hash
# arg 2 = timestamp
# arg 3 = apphash
# arg 4 = backend
json_key = '/home/mattfel/regression/... | Python | 0.001443 | @@ -1780,37 +1780,37 @@
_cell(id,4,
-os.uname()%5B1%5D
+freq + ' MHz'
)%0A%09%09%09workshe
@@ -1827,32 +1827,32 @@
cell(id,
-4, freq + ' MHz'
+5, os.uname()%5B1%5D
)%0A%09sys.s
@@ -2622,29 +2622,29 @@
l(id,4,
-os.uname()%5B1%5D
+freq + ' MHz'
)%0A%09%09%09%09wo
@@ -2666,32 +2666,32 @@
cell(id,
-4, freq + ' MHz... |
7ef10b66ece1c56021d5a76ddaabaf5b6fdc4405 | Fix bin/try | bin/try.py | bin/try.py | #!/usr/bin/env python
# Copyright 2017 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Submit one or more try jobs."""
import argparse
import json
import os
import re
import subprocess
import sys
import tempfile
BUCKET_SKIA_PRIMARY = 'skia/sk... | Python | 0.000002 | @@ -1096,16 +1096,35 @@
root!')%0A
+ cwd = next_cwd%0A
%0A%0Adef ge
|
26b851e54139f1385d811d5cd7fef29af3cb5de7 | Move timesheet_revenue computation in a separate method | addons/sale_timesheet/models/account_invoice.py | addons/sale_timesheet/models/account_invoice.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.float_utils import float_round
class AccountInvoice(models.Model):
_inherit = "account.invoice"
timesheet_ids = fields.One2many('account.analytic.line', ... | Python | 0 | @@ -2026,16 +2026,122 @@
idate()%0A
+ self._compute_timesheet_revenue()%0A return result%0A%0A def _compute_timesheet_revenue(self):
%0A
@@ -6912,31 +6912,8 @@
%7D)%0A
-%0A return result%0A
|
110bf158f68cc3066dc8cd1f6e47b1dd04ae7fac | special character in filename | addons/website_sale_digital/controllers/main.py | addons/website_sale_digital/controllers/main.py | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import base64
from cStringIO import StringIO
from werkzeug.utils import redirect
from odoo import http
from odoo.http import request
from odoo.addons.website_portal.controllers.main import website_account
from odoo.addo... | Python | 0.999779 | @@ -4270,16 +4270,32 @@
%5B'name'%5D
+.encode('utf-8')
, as_att
|
8fd6127fe1597262039b483553b9c7d72fdad703 | Change name for content view test | CopyHaste/typing_test/tests.py | CopyHaste/typing_test/tests.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase, Client
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from django.contrib.auth.models import User
from django.core import mail
from django.test.utils import override_settings... | Python | 0 | @@ -578,20 +578,16 @@
# # # #
- # #
%0A# Clien
@@ -598,24 +598,20 @@
sts for
-Template
+View
s #%0A# #
@@ -634,20 +634,16 @@
# # # #
- # #
%0A%0A%0Aclass
@@ -1193,21 +1193,19 @@
est_
-home_template
+content_api
(sel
|
b8b19364a178628b6402a1adc8284a7b1b5dabef | fix for colors mifthtools | blender/addons/mifth_tools/mifth_vertex_paint.py | blender/addons/mifth_tools/mifth_vertex_paint.py | import bpy
from bpy.props import *
from bpy.types import Operator, AddonPreferences
from bpy.types import Menu, Panel, UIList, PropertyGroup
from bpy.props import StringProperty, BoolProperty, IntProperty, CollectionProperty, BoolVectorProperty, PointerProperty
class MFTVertexPaintMenu(bpy.types.Menu):
bl_idname... | Python | 0 | @@ -1785,57 +1785,8 @@
ue:%0A
- # rgb = %5B0 for i in range(3)%5D
%0A
@@ -1884,32 +1884,33 @@
data%5Bi%5D.color =
+(
self.strength%0A
@@ -1906,16 +1906,61 @@
strength
+%5B0%5D, self.strength%5B1%5D, self.strength%5B2%5D, 1.0)
%0A
@@ -2082,16 +2082,17 @@
color =
+(
self.str
@@ -2... |
36b9f3a925cd98612ee0f5efb23d4723b83f16d8 | Fix minus work time | src/app/timer/models.py | src/app/timer/models.py | # coding: utf-8
from datetime import datetime, time
from django.db import models
from django.db import transaction
from django.utils import timezone
from app.users.models import User
from .errors import AlreadyInputError, BlankArrivedAtError, BlankLeftAtError
class TimerLog(models.Model):
ARRIVED = "arrived"
... | Python | 0.999966 | @@ -3467,16 +3467,20 @@
_time =
+max(
in_offic
@@ -3508,16 +3508,20 @@
est_time
+, 0)
%0A
|
4e73a057354d3445d24e7e480793f2fe18940fb1 | Bump version to 0.4.4.dev1 | django_backend/__init__.py | django_backend/__init__.py | from .backend.renderable import Renderable # noqa
from .group import Group # noqa
from .sitebackend import SiteBackend
__version__ = '0.4.3'
default_app_config = 'django_backend.apps.DjangoBackendConfig'
site = SiteBackend(id='backend')
| Python | 0.000001 | @@ -139,9 +139,14 @@
0.4.
-3
+4.dev1
'%0A%0A%0A
|
a2763c608d33a9254034d650457b7efa7b434ec0 | Remove unused MiddlewareManager._process_chain_both(). | scrapy/middleware.py | scrapy/middleware.py | import logging
import pprint
from collections import defaultdict, deque
from typing import Callable, Deque, Dict, Optional, cast, Iterable
from twisted.internet.defer import Deferred
from scrapy import Spider
from scrapy.exceptions import NotConfigured
from scrapy.settings import Settings
from scrapy.utils.misc impor... | Python | 0 | @@ -410,28 +410,8 @@
hain
-, process_chain_both
%0A%0Alo
@@ -2784,328 +2784,8 @@
s)%0A%0A
- def _process_chain_both(self, cb_methodname: str, eb_methodname: str, obj, *args) -%3E Deferred:%0A cb_methods = cast(Iterable%5BCallable%5D, self.methods%5Bcb_methodname%5D)%0A eb_methods = cast(Iterable%5BC... |
64c4193879e1bcc2cd2ea9ad07a111301d502533 | version bump to 1.0.4 | djangocms_grid/__init__.py | djangocms_grid/__init__.py | __version__ = '1.0.3'
| Python | 0 | @@ -16,7 +16,7 @@
1.0.
-3
+4
'%0A
|
6e9b61a10ca47770d3e0b5ada25339fee1383385 | Fix typo and use += instead of .extend() to concat lists | djrichtextfield/widgets.py | djrichtextfield/widgets.py | from __future__ import unicode_literals
import json
from django.forms.widgets import Media, Textarea
from django.urls import reverse
from django.utils import six
from django.utils.encoding import force_text
from django.utils.html import format_html
from djrichtextfield import settings
class RichTextWidget(Textarea... | Python | 0.000005 | @@ -952,16 +952,12 @@
js
-.extend(
+ +=
%5B%0A
@@ -1079,17 +1079,16 @@
NIT_URL)
-)
%0A
@@ -1089,17 +1089,16 @@
%5D
-)
%0A
|
4d3e4b0a5514896dee7296b1f93b72de960dcdf7 | remove user variable in signup | wsgiwars/views.py | wsgiwars/views.py | from pyramid.view import view_config
from pyramid.threadlocal import get_current_registry
from pyramid.httpexceptions import HTTPFound
from pyramid.security import remember
from pyramid.security import forget
from pyramid_mailer.mailer import Mailer
from pyramid_mailer.message import Message
import bcrypt
import cou... | Python | 0.000001 | @@ -1784,39 +1784,32 @@
try:%0A
- user =
User.get(reques
|
af14f37680bd4a8d9d0e53d1dc5f8e747384b896 | add a message for missing psycopg2 | scripts/pg_backup.py | scripts/pg_backup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 1999-2015, Raffaele Salmaso <raffaele@salmaso.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includ... | Python | 0.000002 | @@ -1301,16 +1301,25 @@
atetime%0A
+try:%0A
import p
@@ -1326,16 +1326,105 @@
sycopg2%0A
+except ImportError:%0A print(%22need psycopg2, please install it %5Bpip install psycopg2%5D%22)%0A
from stu
|
b8258d3ad32fbd283f01578bf46aef4c8e5ac55d | Add assertion to prevent a class extending itself | thinglang/parser/definitions/thing_definition.py | thinglang/parser/definitions/thing_definition.py | from thinglang.compiler.buffer import CompilationBuffer
from thinglang.compiler.context import CompilationContext
from thinglang.foundation import definitions
from thinglang.lexer.definitions.tags import LexicalInheritanceTag
from thinglang.lexer.definitions.thing_definition import LexicalDeclarationThing
from thinglan... | Python | 0.000001 | @@ -2617,32 +2617,99 @@
s: Identifier):%0A
+ assert extends != thing.name, 'Class cannot extend itself'%0A
thing.ex
|
a6fd70adf79d7c735ee672c8f97ad882f59981f1 | fix apis | xml2kinto/main.py | xml2kinto/main.py | import os
import hashlib
import uuid
import xml.etree.ElementTree as ET
from kinto_client import Bucket
from kinto_client.exceptions import KintoException
# options to move to a config file
xml_file = os.path.join(os.path.dirname(__file__), 'blocklist.xml')
user = 'mark'
permissions = {'read': ["system.Everyone"]}
b... | Python | 0.99829 | @@ -1469,16 +1469,23 @@
n.delete
+_record
(data%5B'i
@@ -1624,16 +1624,23 @@
n.create
+_record
(data)%0A
@@ -3543,23 +3543,16 @@
o.delete
-_record
(record)
@@ -3715,23 +3715,16 @@
o.create
-_record
(record)
|
4fed7a50a4a6a58f4eeca657222ab6a2f4c6b3a2 | add mising python LIBDIR. | 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 | @@ -98,16 +98,94 @@
ysconfig
+%0Aimport distutils.command.build_ext as build_ext%0Aimport distutils.dist as dist
%0A%0Afrom d
@@ -498,16 +498,46 @@
tions%22,%0A
+ %22LDSHARED%22: %22linker%22,%0A
@@ -3603,46 +3603,197 @@
def
-setup_msvc(env):%0A # XXX: not tested
+_get_ext_library_dirs():%0A ... |
beeada854c72af76e2e40a680c58d2da05e12c5b | Add config option to CLI | zeus/cli/repos.py | zeus/cli/repos.py | import click
from zeus.config import db
from zeus.models import (Repository, RepositoryAccess,
RepositoryBackend, RepositoryProvider, RepositoryStatus, User)
from zeus.tasks import import_repo, sync_repo
from zeus.utils.text import slugify
from .base import cli
@cli.group('repos')
def repos... | Python | 0.000002 | @@ -34,16 +34,59 @@
port db%0A
+from zeus.db.utils import create_or_update%0A
from zeu
@@ -102,16 +102,28 @@
import (
+ItemOption,
Reposito
@@ -2214,28 +2214,1451 @@
ss)%0A db.session.commit()%0A
+%0A%0A@repos.group('config')%0Adef config():%0A pass%0A%0A%0A@config.command('get')%0A@click.argument('reposito... |
37677e052c948d5ccced28bcf62ea8f85bac9822 | test song | to_be_a_musician/djtinysong/tests/test_models.py | to_be_a_musician/djtinysong/tests/test_models.py | import unittest
from djtinysong.models import Song
class Test(unittest.TestCase):
def test_simple_class_instance(self):
dictionary = {
"Url": "http:\/\/tinysong.com\/8We2",
"SongID": 269743,
"SongName": "The Legend Of Lil' Beethoven",
"ArtistID": 7620,
"ArtistName"... | Python | 0.000008 | @@ -56,16 +56,20 @@
ass Test
+View
(unittes
|
7be67de61c7034bbc9e04ed8adbae08cdc5a118c | Update a class name | examples/test_swag_labs.py | examples/test_swag_labs.py | from seleniumbase import BaseCase
class SwagLabsTest(BaseCase):
def login(self, user="standard_user"):
""" Login to Swag Labs and assert that the login was successful. """
if user not in (["standard_user", "problem_user"]):
raise Exception("Invalid user!")
self.open("https://w... | Python | 0.000042 | @@ -47,16 +47,17 @@
LabsTest
+s
(BaseCas
|
365e3acae3973dc8fee795312ecd7a5990144af4 | remove redundant params, update annotations and comments, add doctest | ruz/utils/logging.py | ruz/utils/logging.py | import logging
from collections import Callable
from functools import wraps
def Logger(name: str, level: int=logging.INFO, **kwargs) -> logging.RootLogger:
logging.basicConfig(
format=kwargs.pop(
"format",
"%(asctime)s - %(name)s - %(levelname)s - %(message)s"
),
le... | Python | 0 | @@ -151,16 +151,754 @@
Logger:%0A
+ %22%22%22%0A Creates configured logger%0A%0A :param name, required - name for logger.%0A :param level - logging level.%0A :param format, str - logging format.%0A%0A Usage%0A -----%0A logger = Logger(__name__)%0A%0A %3E%3E%3E... |
958b86044e92ab44c95acae86155be0547569c9e | Use rescent linuxdeployqt for appimage | share/ci/appimage.py | share/ci/appimage.py | import common as c
from config import *
import os
import sys
import subprocess as sub
import shutil
from glob import glob
if len(sys.argv) > 1 and sys.argv[1] == 'glibc_version': # subcommand
sub.run('ldd --version | head -n 1 | grep -Po "\\d\\.\\d\\d"', shell=True)
exit(0)
tag = os.environ.get('TAG', '')
ar... | Python | 0 | @@ -808,22 +808,26 @@
t_url =
-tagged
+continuous
_url%0Alin
@@ -2015,16 +2015,91 @@
b_dir)%0A%0A
+c.ensure_got_path('%7B%7D/usr/share/doc/libc6/copyright'.format(install_dir))%0A%0A
c.run('%7B
|
70c5e7392db6e93f5470a0b19703edb40f4034fd | fix typo | trunk/toolserver/public_html/cgi-bin/reflinks.py | trunk/toolserver/public_html/cgi-bin/reflinks.py | #!/usr/bin/python
#
# (C) Legoktm 2008-2009, MIT License
#
import cgitb; cgitb.enable()
import cgi, sys, urllib2, re, time
import monobook
print "Content-Type: text/html\n"
months = {
'1':'01',
'2':'02',
'3':'03',
'4':'04',
'5':'05',
'6':'06',
'7':'07',
'8':'08',
'9':'09',
'10':'10',
'11':'11',
'12':'12',... | Python | 0.999999 | @@ -1584,16 +1584,23 @@
er%3C/h2%3E%0A
+%3Cbr /%3E%0A
%3Cform na
@@ -1708,17 +1708,24 @@
%0A%3Cbr /%3E%0A
-U
+Do not u
se %3Ccode
@@ -1810,16 +1810,22 @@
%3E%0A%3Cbr /%3E
+%3Cbr /%3E
%0A%3Cinput
|
58acfa1cdfadd60d63c0e485c512bbe974f89407 | Fix to pythonpep code. | update-database/stackdoc/namespaces/pythonpep.py | update-database/stackdoc/namespaces/pythonpep.py | import re
import urllib
############### Functions called by stackdoc
def get_version():
return 1
def get_ids(title, body, tags):
ids = []
if "http://docs.python.org/" in body:
urls = re.findall(r'<a href="([^"]+)"', body)
for url in urls:
m = re.match("http:\/\/www\.python\.o... | Python | 0.002593 | @@ -162,12 +162,11 @@
p://
-docs
+www
.pyt
|
93c491f7297ab4e700a414d33ba533968a4be464 | Allow use of git branch versions (#10156) | var/spack/repos/builtin/packages/cgns/package.py | var/spack/repos/builtin/packages/cgns/package.py | # Copyright 2013-2018 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Cgns(CMakePackage):
"""The CFD General Notation System (CGNS) provides a general, portable... | Python | 0 | @@ -542,16 +542,142 @@
tar.gz%22%0A
+ git = %22https://github.com/CGNS/CGNS%22%0A%0A version('develop', branch='develop')%0A version('master', branch='master')
%0A ver
|
f6e5833e60015f762a95dd1753e2aa43b6baddda | Update melodyextraction.py | extras/melodyextraction.py | extras/melodyextraction.py | # -*- coding: utf-8 -*-
from predominantmelodymakam.predominantmelodymakam import PredominantMelodyMakam
from fileoperations.fileoperations import get_filenames_in_dir
import os
import json
import numpy as np
import sys
import math
# Number of decimal points to round the pitch track to.
DECIMAL = 2
# get the input in... | Python | 0.000001 | @@ -935,23 +935,8 @@
s):%0A
- print(' ')%0A
|
85e089e3fa573e90e966927322257728f5fc7df7 | add new version (#16130) | var/spack/repos/builtin/packages/nccl/package.py | var/spack/repos/builtin/packages/nccl/package.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Nccl(MakefilePackage):
"""Optimized primitives for collective multi-GPU communication."""
... | Python | 0 | @@ -420,19 +420,19 @@
hive/v2.
-4.8
+6.4
-1.tar.g
@@ -435,16 +435,150 @@
ar.gz%22%0A%0A
+ maintainers = %5B'adamjstewart'%5D%0A%0A version('2.6.4-1', sha256='ed8c9dfd40e013003923ae006787b1a30d3cb363b47d2e4307eaa2624ebba2ba')%0A
vers
|
6855e8e10fa5e0c00bceabbe8baee942dfadd5d1 | Add 8.44 (#16397) | var/spack/repos/builtin/packages/pcre/package.py | var/spack/repos/builtin/packages/pcre/package.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Pcre(AutotoolsPackage):
"""The PCRE package contains Perl Compatible Regular Expression
... | Python | 0 | @@ -554,16 +554,111 @@
r.bz2%22%0A%0A
+ version('8.44', sha256='19108658b23b3ec5058edc9f66ac545ea19f9537234be1ec62b714c84399366d')%0A
vers
|
5acb4e9246b217fd919f89de95636d909c508a83 | Update system.py | fabtools/require/system.py | fabtools/require/system.py | """
System settings
===============
"""
from re import escape
from fabric.api import settings, warn
from fabric.contrib.files import append, uncomment
from fabtools.files import is_file, watch
from fabtools.system import (
UnsupportedFamily,
distrib_family, distrib_id,
get_hostname, set_hostname,
get... | Python | 0 | @@ -1764,221 +1764,8 @@
es'%0A
- if distrib_id() == 'Ubuntu':%0A config_file = '/var/lib/locales/supported.d/local'%0A if not is_file(config_file):%0A run_as_root('touch %25s' %25 config_file)%0A else:%0A
|
4b557815786cad895e6d836a8a93a2ee517c0b2a | Fix disk.usage for Synology OS | salt/modules/disk.py | salt/modules/disk.py | # -*- coding: utf-8 -*-
'''
Module for gathering disk information
'''
from __future__ import absolute_import
# Import python libs
import logging
import os
import re
# Import salt libs
import salt.utils
import salt.utils.decorators as decorators
from salt.exceptions import CommandExecutionError
from salt.ext.six.move... | Python | 0 | @@ -1880,32 +1880,49 @@
e).splitlines()%0A
+ oldline=None%0A
for line in
@@ -1918,32 +1918,32 @@
or line in out:%0A
-
if not l
@@ -2039,36 +2039,197 @@
-comps = line.split()
+if oldline:%0A %09line = oldline + %22 %22 + line%0A comps = line.split()%0A if len(comps) == ... |
f65ec11fd763dda6d7b8988a6764f89aa5383df8 | Increment to version 1.11.4 | smartmin/__init__.py | smartmin/__init__.py | from __future__ import unicode_literals
__version__ = '1.11.3'
| Python | 0.995086 | @@ -58,7 +58,7 @@
.11.
-3
+4
'%0A
|
74ca49c62ba63b7eb42f3825ea5c036e32b98d50 | Work around null TfL common names | busstops/management/commands/import_tfl_stops.py | busstops/management/commands/import_tfl_stops.py | """
Usage:
./manage.py import_tfl_stops < data/tfl/bus-stops.csv
"""
import requests
from titlecase import titlecase
from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned
from busstops.management.import_from_csv import ImportFromCSVCommand
from busstops.models import StopPoint
class C... | Python | 0.000006 | @@ -1229,16 +1229,36 @@
co_code)
+ or stop.common_name
%0A
|
05f7c621b7c7504771349900d74633c2c2698fee | update test | callisto_core/wizard_builder/tests/test_forms.py | callisto_core/wizard_builder/tests/test_forms.py | from django.test import TestCase
from .. import managers
class FormSerializationTest(TestCase):
manager = managers.FormManager
fixtures = [
'wizard_builder_data',
]
expected_data = [{
'descriptive_text': 'answer wisely',
'field_id': 'question_2',
'id': 2,
'page... | Python | 0.000001 | @@ -520,16 +520,43 @@
s': %5B%5D,%0A
+ 'skip_eval': True,%0A
%7D%5D%0A%0A
|
b2556609dbf4920f3b197beb814ab30f28e5cda3 | converted all strings to unicode | progressbar/__about__.py | progressbar/__about__.py | '''Text progress bar library for Python.
A text progress bar is typically used to display the progress of a long
running operation, providing a visual cue that processing is underway.
The ProgressBar class manages the current progress, and the format of the line
is given by a number of widgets. A widget is an object ... | Python | 1 | @@ -854,9 +854,9 @@
'3.1
-6
+7
.0'%0A
|
9a8fd944fb78d582f06d7165f097c1e54cb870dc | Add a mixin for calling full_clean() on save() | project/asylum/mixins.py | project/asylum/mixins.py | from reversion import revisions
from django.db import transaction
# Monkeypatch the revisions
try:
revisions.create_revision
except AttributeError:
revisions.create_revision = revisions.revision_context_manager.create_revision
class AtomicVersionMixin(object):
def save(self, *args, **kwargs):
wit... | Python | 0.000001 | @@ -264,16 +264,150 @@
bject):%0A
+ %22%22%22Makes sure saves and deletes go via transactions and version control%0A even when objects are modified outside Django Admin%22%22%22
%0A def
@@ -688,24 +688,279 @@
delete(*args, **kwargs)%0A
+%0A%0Aclass CleanSaveMixin(object):%0A %22%22%22Makes sure clean() i... |
8dfbe9cf475dd8b2978e14c8afe30c6c7d5e6e5f | Fix for rack/resource_class association | tuskar_ui/infrastructure/resource_management/racks/tables.py | tuskar_ui/infrastructure/resource_management/racks/tables.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | Python | 0.000326 | @@ -2516,20 +2516,16 @@
Column('
-get_
resource
|
9100bbba7936c4944bae91062670d199bcfe9634 | change the input url | ScheduleUpdateData.py | ScheduleUpdateData.py | __author__ = 'chuqiao'
from apscheduler.schedulers.blocking import BlockingScheduler
import EventsPortal
import sys
import logging
def logger():
"""
Function that initialises logging system
"""
global logger
# create logger with 'syncsolr'
logger = logging.getLogger('scheduleAddData')
... | Python | 0.999997 | @@ -1644,32 +1644,34 @@
+ #
%22http://bioeven
@@ -1880,35 +1880,126 @@
://bioevents
--portal.org
+.pro/events?combine=&state=published&field_type_tid=All%22,%0A %22http://bioevents.pro
/events%22,%0A
|
b492c988a8b51214b746cceb99bda0f046a550fd | Use numpy | chainer/functions/array/permutate.py | chainer/functions/array/permutate.py | import numpy
from chainer import cuda
from chainer import function
from chainer.utils import type_check
def _reverse_indices(indices):
r = numpy.empty(len(indices), 'i')
for i, ind in enumerate(indices):
r[ind] = i
return r
class Permutate(function.Function):
def __init__(self, indices, ax... | Python | 0.00006 | @@ -970,15 +970,15 @@
is
-cuda.cu
+not num
py:%0A
|
29511cfd2d4c8116956282b27e0826ed8d65fd7d | fix inconsistent return statement | analyzer/libretime_analyzer/pipeline/_ffmpeg.py | analyzer/libretime_analyzer/pipeline/_ffmpeg.py | import re
from math import inf
from pathlib import Path
from typing import List, Optional, Tuple
from ._utils import run_
def _ffmpeg(*args, **kwargs):
return run_(
"ffmpeg",
*args,
"-f",
"null",
"/dev/null",
"-hide_banner",
"-nostats",
**kwargs,
... | Python | 0.001341 | @@ -834,16 +834,32 @@
oup(1))%0A
+ return None%0A
%0A%0A_COMPU
@@ -1322,16 +1322,32 @@
oup(1))%0A
+ return None%0A
%0A%0A_SILEN
|
c8ca1b61de58d5f73a5e9fdf09399fc791672ccb | update example | examples/full_radiation_with_insolation_gcm.py | examples/full_radiation_with_insolation_gcm.py | import climt
from sympl import PlotFunctionMonitor
import numpy as np
from metpy import calc
from metpy.units import units
import matplotlib.pyplot as plt
def plot_function(fig, state):
ax = fig.add_subplot(2, 2, 1)
surf_flux = state['downwelling_shortwave_flux_in_air'][:, :, 0]
surf_flux.transpose().plo... | Python | 0.000001 | @@ -983,16 +983,17 @@
0.95%5D)%0A%0A
+%0A
monitor
|
a7686d673a52ac1f00b71f4b1e55fc9735003073 | Make harmonic oscillator in 2D work | examples/harmonic_oscillators/harmonic_2D_f.py | examples/harmonic_oscillators/harmonic_2D_f.py | algorithm = "fourier"
T = 12
dt = 0.01
dimension = 2
ncomponents = 1
eps = 0.1
potential = "quadratic_2d"
# The grid of our simulation domain
limits = [(-6.283185307179586, 6.283185307179586), (-6.283185307179586, 6.283185307179586)]
number_nodes = [512, 512]
# The parameter set of the initial wavepacket
Q = [[1.... | Python | 0.000005 | @@ -232,16 +232,17 @@
79586)%5D%0A
+#
number_n
@@ -258,16 +258,44 @@
12, 512%5D
+%0Anumber_nodes = %5B2048, 2048%5D
%0A%0A# The
@@ -1215,47 +1215,8 @@
isk%0A
-# WARNING: Produces about 1GB of data!%0A
writ
|
39f7530f9082062abdd530255ab34d642097b605 | Update ptvsd version number for 2.2 release. | Python/Product/PythonTools/ptvsd/setup.py | Python/Product/PythonTools/ptvsd/setup.py | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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 ... | Python | 0 | @@ -857,11 +857,8 @@
.2.0
-rc2
',%0D%0A
@@ -1146,16 +1146,29 @@
::
-4 - Beta
+5 - Production/Stable
',%0D%0A
|
aa72ac13733badef0e679bea22d8691d4ea05b88 | Rebase off of develop | whats_fresh/whats_fresh_api/views/data_entry/preparations.py | whats_fresh/whats_fresh_api/views/data_entry/preparations.py | from django.http import (HttpResponse,
HttpResponseNotFound,
HttpResponseServerError)
from django.http import HttpResponseRedirect
from django.shortcuts import render
from django.core.urlresolvers import reverse
from django.utils.datastructures import MultiValueDictKeyE... | Python | 0.000001 | @@ -1687,32 +1687,43 @@
direct(reverse('
+entry-list-
preparations-lis
@@ -1718,26 +1718,16 @@
arations
--list-edit
'))%0A
@@ -2017,16 +2017,27 @@
everse('
+entry-list-
preparat
@@ -2044,18 +2044,8 @@
ions
--list-edit
'),%0A
|
2bf9589a32cb0a8be157e09e789799608b8f386f | update dependency | custom/icds_reports/migrations/0022_fix_aggregation.py | custom/icds_reports/migrations/0022_fix_aggregation.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from corehq.sql_db.operations import RawSQLMigration
migrator = RawSQLMigration(('custom', 'icds_reports', 'migrations', 'sql_templates'))
class Migration(migrations.Migration):
dependencies = [
('i... | Python | 0.000001 | @@ -344,30 +344,27 @@
'002
-0_combine_person_query
+1_remove_categories
'),%0A
|
ae92b8962781fc7b9d3a2277c6e2b02f44500a6f | Update transportrequests.py | SolrClient/transport/transportrequests.py | SolrClient/transport/transportrequests.py | import time
from .transportbase import TransportBase
from ..exceptions import SolrError, ConnectionError
try:
import requests
req = True
except ImportError:
req = False
class TransportRequests(TransportBase):
"""
Class that Uses Requests as Transport Mechanism.
"""
def setup(self):
... | Python | 0 | @@ -1000,16 +1000,75 @@
kwargs)%0A
+ if not host.endswith('/'):%0A host += '/'%0A
|
7eab91efc4ee7f8fbcfe768440ef88c077989e66 | Add a test for `svo_fps` query parameter names | astroquery/svo_fps/tests/test_svo_fps_remote.py | astroquery/svo_fps/tests/test_svo_fps_remote.py | import pytest
from astropy import units as u
from ..core import SvoFps
@pytest.mark.remote_data
class TestSvoFpsClass:
def test_get_filter_index(self):
table = SvoFps.get_filter_index(12_000*u.angstrom, 12_100*u.angstrom)
# Check if column for Filter ID (named 'filterID') exists in table
... | Python | 0 | @@ -1,12 +1,36 @@
+from io import BytesIO%0A%0A
import pytes
@@ -66,34 +66,142 @@
s u%0A
-%0A
from
-..core import SvoFps
+astropy.io.votable import parse%0A%0Afrom astroquery.svo_fps import conf, SvoFps%0Afrom astroquery.svo_fps.core import QUERY_PARAMETERS
%0A%0A%0A@
@@ -1180,28 +1180,1017 @@
filterID' in table.... |
5c810c173c1ab864719eea29133016b27464a3e6 | Add extra log message when dock item missing | psi/experiment/plugin.py | psi/experiment/plugin.py | import logging
log = logging.getLogger(__name__)
from atom.api import Typed
from enaml.application import deferred_call
from enaml.layout.api import FloatItem, InsertItem
from enaml.layout.dock_layout import DockLayoutValidator
from enaml.workbench.plugin import Plugin
from enaml.widgets.api import Action, ToolBar
fro... | Python | 0 | @@ -2887,16 +2887,88 @@
issing:%0A
+ log.debug('%7B%7D missing from saved dock layout'.format(item))%0A
|
d6926ca94b647250161f3163fcfb3ea350fbbf56 | Fix spiking rate computation (forgot burnin) | script_fig_netw_freq.py | script_fig_netw_freq.py | # -*- coding:utf-8 -*-
import tables
import numpy as np
import matplotlib.pyplot as plt
from h5manager import get_all_attrs
def plot_netw_freq(db_filename, point_color, label):
"""Plot `g_Ein0` against `FFTMAX` for the given DB."""
db = tables.openFile(db_filename) # Open the HDF5 database-like
# ... | Python | 0.000002 | @@ -1980,16 +1980,19 @@
return
+1.*
time_mas
@@ -2009,16 +2009,17 @@
_mitral*
+(
simu_len
@@ -2021,16 +2021,26 @@
u_length
+ - burnin)
)%0A%0A%0Adef
|
c429dc2c134122b048a728de5b84a6b19e0b9f3d | use staging rack and ctor | scripts/RasterPallet.py | scripts/RasterPallet.py | #!/usr/bin/env python
# * coding: utf8 *
'''
RasterPallet.py
A module that contains a forklift pallet definition for the Raster app.
It updates all data in the raster.gdb database.
The DRG.gdb database is managed manually in staging.
'''
from forklift.models import Pallet
from os.path import join
class RasterPallet... | Python | 0 | @@ -335,82 +335,113 @@
def
-build(self, configuration):%0A self.staging = r'C:%5CScheduled%5Cstaging'
+__init__(self):%0A super(RasterPallet, self).__init__()%0A %0A def build(self, configuration):
%0A
@@ -473,16 +473,21 @@
.staging
+_rack
, 'drg.g
@@ -530,16 +530,21 @@
.staging
+_rack
... |
ab6e049061026378a3be986794d465b44d7f2692 | disable c++0x for now as it breaks userspace c++ builds | scripts/defaultFlags.py | scripts/defaultFlags.py | # Default flags for Pedigree's build, per architecture
#------------------------- All Architectures -------------------------#
# Generic entry-level flags (that everyone should have)
generic_cflags = '-std=gnu99 -fno-builtin -nostdinc -nostdlib -ffreestanding -g0 -O3 '
generic_cxxflags = generic_cflags.replace('-std=... | Python | 0.000001 | @@ -334,10 +334,10 @@
=c++
-0x
+98
') +
@@ -356,16 +356,24 @@
ptions '
+ # c++0x
%0A%0A# Warn
|
db17570097e2b9005ebbd942f4f268bceae3b12e | demo mode email subject TDD | callisto_core/tests/reporting/test_demo_mode.py | callisto_core/tests/reporting/test_demo_mode.py | from unittest.mock import call, patch
from django.contrib.sites.models import Site
from callisto_core.reporting.views import ReportingConfirmationView
from callisto_core.tests.test_base import (
ReportFlowHelper as ReportFlowTestCase,
)
from callisto_core.tests.utils.api import CustomNotificationApi
from callisto... | Python | 0.999535 | @@ -351,16 +351,780 @@
iteID%0A%0A%0A
+class DemoModeNotificationSubjectTest(%0A ReportFlowTestCase,%0A):%0A%0A def test_default(self):%0A with patch.object(CustomNotificationApi, '_logging') as api_logging:%0A self.client_post_report_creation()%0A self.client_post_reporting_end_step... |
00f9f3ec94e0abc754b2417ad9a1eda3c3397bd0 | Fix base class name. | chainer/functions/pooling/average_pooling_nd.py | chainer/functions/pooling/average_pooling_nd.py | import numpy
import six
import functools
import operator
from chainer import cuda
from chainer.functions.pooling import average_pooling_nd_kernel
from chainer.functions.pooling import pooling_nd
from chainer import utils
from chainer.utils import conv_nd
if cuda.cudnn_enabled:
cudnn = cuda.cudnn
libcudnn =... | Python | 0 | @@ -362,16 +362,17 @@
ling_nd.
+_
PoolingN
|
6794bb897e7e8730b1c3ab2fc6b856865887ac8b | Use a simpler trace logger that does not prepend timestamps | scripts/upsrv_schema.py | scripts/upsrv_schema.py | #!/usr/bin/python
# Copyright (c) 2006 rPath, Inc
# All rights reserved
import sys
import os
import pwd
from conary.server import schema
from conary.lib import cfgtypes, tracelog
from conary.repository.netrepos.netserver import ServerConfig
from conary import dbstore
cnrPath = '/srv/conary/repository.cnr'
cfg = Ser... | Python | 0.000015 | @@ -264,16 +264,128 @@
bstore%0A%0A
+class SimpleFileLog(tracelog.FileLog):%0A def printLog(self, level, msg):%0A self.fd.write(%22%25s%5Cn%22 %25 msg)%0A%0A
cnrPath
@@ -438,16 +438,49 @@
nfig()%0A%0A
+tracelog.FileLog = SimpleFileLog%0A
tracelog
|
5d60a94ffb68fc79c4f6fda31c3f954fa684c573 | add studio_api | xarm/wrapper/studio_api.py | xarm/wrapper/studio_api.py | #!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2020, UFACTORY, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com>
import json
import functools
from .xarm_api import XArmAPI
try:
from requests import Session
except:
import urllib.r... | Python | 0.000001 | @@ -1224,25 +1224,24 @@
ArmAPI(self.
-_
call_sdk_api
@@ -1371,25 +1371,24 @@
self.
-_
call_studio_
@@ -1401,24 +1401,37 @@
, api_name='
+Core.command.
xarm_set_blo
@@ -1541,33 +1541,32 @@
return self.
-_
call_studio_api(
@@ -1583,16 +1583,29 @@
i_name='
+Core.command.
run_bloc
@@ -1663,33 +1663,32 ... |
4063380b3112cd7f36a709be9c52d88ca5149c9a | Update to version v0.0.4.1 | sandman2/__init__.py | sandman2/__init__.py | """*sandman2*'s main module."""
# Third-party imports
from flask import Flask, current_app, jsonify
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.ext.declarative import declarative_base
# Application imports
from sandman2.exception import (
BadRequestException,
ForbiddenException,
NotFou... | Python | 0 | @@ -616,16 +616,18 @@
= '0.0.4
+.1
'%0A%0A# Aug
|
67f1b624bf30cdcb60d97c2af2712dc45de8e456 | Add subnet to VPN Tenant model | xos/services/vpn/models.py | xos/services/vpn/models.py | from core.models import Service, TenantWithContainer
from django.db import transaction
VPN_KIND = "vpn"
class VPNService(Service):
KIND = VPN_KIND
class Meta:
proxy = True
# The name used to find this service, all directories are named this
app_label = "vpn"
verbose_name = "VP... | Python | 0.000001 | @@ -2098,18 +2098,37 @@
, ns.mac
+, ns.network.subnet
)%0A
-
@@ -2286,32 +2286,38 @@
et(%22nat%22, (None,
+ None,
None))%5B0%5D%0A%0A
@@ -2472,12 +2472,119 @@
None
-))%5B1
+, None))%5B1%5D%0A%0A @property%0A def subnet(self):%0A return self.addresses.get(%22nat%22, (None, None, None))%5... |
71ae8013ec5e981c9b44699afd82162c6f6c625b | Use user_details instead of a wrapper class | spacy/ja/__init__.py | spacy/ja/__init__.py | # encoding: utf8
from __future__ import unicode_literals, print_function
from os import path
from ..language import Language, BaseDefaults
from ..tokenizer import Tokenizer
from ..tagger import Tagger
from ..attrs import LANG
from ..tokens import Doc
from .language_data import *
import re
from collections import na... | Python | 0 | @@ -416,372 +416,37 @@
%5D)%0A%0A
-class JapaneseDoc(Doc):%0A def __init__(self, detailed_tokens, vocab, words=None, spaces=None, orths_and_spaces=None):%0A super(JapaneseDoc, self).__init__(vocab, words, spaces, orths_and_spaces)%0A # This saves tokenizer output so mecab doesn't have to be called aga... |
a617b8b1587e42fb323584c3102a21d6731996bc | fix spelling | InvenTree/plugin/serializers.py | InvenTree/plugin/serializers.py | """
JSON serializers for Stock app
"""
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import subprocess
from django.core.exceptions import ValidationError
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from ... | Python | 0.999999 | @@ -957,17 +957,17 @@
abel=_('
-s
+S
ource UR
|
ff3d9e373c9a78b0a584f347bcf449591e7613a6 | change order back | InvenTree/plugin/test_plugin.py | InvenTree/plugin/test_plugin.py | """ Unit tests for plugins """
from django.test import TestCase
from django.conf import settings
import plugin.plugin
import plugin.integration
from plugin.samples.integration.sample import SampleIntegrationPlugin
from plugin.samples.integration.another_sample import WrongIntegrationPlugin, NoIntegrationPlugin
from p... | Python | 0 | @@ -1832,21 +1832,18 @@
on)), %5B'
-Wrong
+No
Integrat
@@ -1855,18 +1855,21 @@
ugin', '
-No
+Wrong
Integrat
|
5b50c1067673a0284a1bf47f7f7eabd780a95b14 | Complete TODO | ckanext/privatedatasets/converters_validators.py | ckanext/privatedatasets/converters_validators.py | import db
from ckan.common import _
from itertools import count
def private_datasets_metadata_checker(key, data, errors, context):
# TODO: In some cases, we will need to retireve all the dataset information if it isn't present...
private_val = data.get(('private',))
private = private_val is True if isi... | Python | 0.998589 | @@ -4,16 +4,49 @@
ort db%0A%0A
+from ckan.plugins import toolkit%0A
from cka
@@ -169,108 +169,318 @@
-# TODO: In some cases, we will need to retireve all the dataset information if it isn't present...%0A%0A
+dataset_id = data.get(('id',))%0A private_val = data.get(('private',))%0A%0A # If the private fiel... |
934b2ac6fc9cc208862577cd37d46760df4a61bd | Add docstring for RReLU | chainer/functions/activation/randomized_leaky_relu.py | chainer/functions/activation/randomized_leaky_relu.py | from chainer import cuda
from chainer import function
from chainer.utils import type_check
import numpy as np
def _kern():
return cuda.elementwise(
'T cond, T x, T slope', 'T y',
'y = cond >= 0 ? x : (T)(slope * x)', 'rrelu')
class RReLU(function.Function):
"""Randomized Leaky rectifier unit... | Python | 0 | @@ -2771,24 +2771,411 @@
float array.
+%0A%0A .. admonition:: Example%0A%0A %3E%3E%3E x = np.array(%5B%5B-1, 0%5D, %5B2, -3%5D, %5B-2, 1%5D%5D, 'f')%0A %3E%3E%3E x%0A array(%5B%5B-1., 0.%5D,%0A %5B 2., -3.%5D,%0A %5B-2., 1.%5D%5D, dtype=float32)%0A %3E%3E%3E... |
cf16a58224191bc823f0b4aa97536aebeb000a41 | fix deprecated function | src/bda/ldap/session.py | src/bda/ldap/session.py | # Copyright 2008-2009, BlueDynamics Alliance, Austria - http://bluedynamics.com
# GNU General Public Licence Version 2 or later
import ldap
from bda.ldap import (
LDAPConnector,
LDAPCommunicator,
)
from bda.ldap.base import testLDAPConnectivity
class LDAPSession(object):
def __init__(self, props):
... | Python | 0.007686 | @@ -1261,16 +1261,17 @@
self.
+_
communic
@@ -1279,25 +1279,23 @@
tor.
-setB
+b
aseDN
-(
+ =
baseDN
-)
%0A
|
d5bac2315ae9c75788e8459882a35bbbe9edc88d | fix doc | chainercv/links/faster_rcnn/utils/proposal_creator.py | chainercv/links/faster_rcnn/utils/proposal_creator.py | import numpy as np
from chainer import cuda
from chainercv.links import bbox_regression_target_inv
from chainercv.utils import non_maximum_suppression
class ProposalCreator(object):
"""Proposal regions are generated by calling this object.
The :meth:`__call__` of this object outputs object detection propos... | Python | 0.000001 | @@ -2847,34 +2847,41 @@
nercv.links.
+faster_rcnn.
utils
-.bbox
.bbox_regres
@@ -2951,26 +2951,33 @@
v.links.
+faster_rcnn.
utils
-.bbox
.bbox_re
|
82d26186562ceec5e7f59aed263d2f90b02397e9 | Fix a bug that only happens when you run alpha/beta versions of Python | spiny/projectdata.py | spiny/projectdata.py | # Extracts information from a project that has a distutils setup.py file.
import os
import sys
import logging
class FakeContext(object):
def __init__(self, path):
self._path = path
def __enter__(self):
self._old_path = os.path.abspath(os.curdir)
if self._old_path in sys.path:
... | Python | 0.000002 | @@ -95,23 +95,571 @@
%0Aimport
-logging
+string%0Aimport logging%0A%0A%0Adef parse_version(version):%0A vmap = %7B'a': 'alpha', 'b': 'beta', 'c': 'candidate'%7D%0A res = %5B%5D%0A version = list(reversed(version))%0A v = ''%0A while version:%0A x = version.pop()%0A if x in string.digits:%... |
f542d2856f2df723a580f93125a79b97fca96098 | change save filename | committee_list/crawlers/committee_list/parser.py | committee_list/crawlers/committee_list/parser.py | #! /usr/bin/python2.7
# -*- coding: utf-8 -*-
import os
import urllib2
import html5lib
def get_webpage(f):
page = html5lib.HTMLParser(\
tree=html5lib.treebuilders.getTreeBuilder("lxml"),\
namespaceHTMLElements=False)
p = page.parse(f)
return p
def get_elements(p, x):
elems = p.xpath(x... | Python | 0.000001 | @@ -571,16 +571,147 @@
codes%0A%0A
+def get_committee_name(inf, x):%0A with open(inf, 'r') as f:%0A p = get_webpage(f)%0A e = p.xpath(x)%5B0:%5D%0A%0A return e%0A%0A
def get_
@@ -1370,16 +1370,61 @@
nclick'%0A
+ x_name = '//h4%5B@class=%22title02%22%5D/node()'%0A
x2 =
@@ -1482,24 +1482,2... |
d51d7e20dba132d163266041c74c49200a7ce1dd | Fix annoying too many arguments issue | controller/management/commands/call_ml_grader.py | controller/management/commands/call_ml_grader.py | from django.conf import settings
from django.core.management.base import NoArgsCommand
from django.db import transaction
from django.utils import timezone
import requests
import urlparse
import time
import json
import logging
import sys
import os
from path import path
import logging
import project_urls
from statsd im... | Python | 0.000007 | @@ -3738,21 +3738,8 @@
ata,
- grader_path,
Non
@@ -4837,24 +4837,38 @@
Errors: %7B1%7D
+ Feedback: %7B2%7D
%22.format(res
@@ -4901,16 +4901,37 @@
errors'%5D
+, results%5B'feedback'%5D
))%0A
|
74e0d58e13e2c27d5df39036b165f9f5a1bb7249 | Move the flush to after the print it's flushing. | couchdb/tools/replicate.py | couchdb/tools/replicate.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2009 Maximillian Dornseif <md@hudora.de>
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
"""
This script replicates databases from one CouchDB server to an other.
This is mainly f... | Python | 0.000002 | @@ -3462,16 +3462,43 @@
- start)
+%0A sys.stdout.flush()
%0A%0A if
@@ -3535,39 +3535,16 @@
return%0A%0A
- sys.stdout.flush()%0A
for
|
9c2f638da50cbac20925bdd2cdbcd3868ea1f8db | update model | country_dialcode/models.py | country_dialcode/models.py | from django.db import models
from django.utils.translation import ugettext as _
from datetime import *
from common.intermediate_model_base_class import Model
prefix_type_list = ((0, _("Landline")),
(1, _("Mobile")),
(2, _("NGN (Non Geographic Numbers)")))
# Create your models ... | Python | 0.000001 | @@ -1002,42 +1002,8 @@
ta:%0A
- db_table = 'simu_country'%0A
@@ -2101,41 +2101,8 @@
ta:%0A
- db_table = 'simu_prefix'%0A
@@ -2116,38 +2116,32 @@
_label = _('
-prefix_country
+dialcode
')%0A v
|
1a288b14c047f5ec823017b33af23e3f51fdfb5e | fix minor bug in pageobjects/__init__ This if block wasn't executing the class defined _object_name as None, but it should. | cumulusci/robotframework/pageobjects/__init__.py | cumulusci/robotframework/pageobjects/__init__.py | from robot.libraries.BuiltIn import BuiltIn
from .PageObjects import PageObjects # noqa: F401
from .baseobjects import BasePage, ListingPage, HomePage, DetailPage # noqa: F401
def pageobject(page_type, object_name=None):
"""A decorator to designate a class as a page object"""
BuiltIn().log("importing page o... | Python | 0 | @@ -484,15 +484,11 @@
if
-not has
+get
attr
@@ -507,17 +507,31 @@
ct_name%22
-)
+, None) is None
:%0A
|
fbd57a4b62772368182425ae15226d78de0ce13e | Reset fix | controller/management/commands/remove_expired_subs.py | controller/management/commands/remove_expired_subs.py | from django.core.management.base import BaseCommand
from django.conf import settings
from django.utils import timezone
#from http://jamesmckay.net/2009/03/django-custom-managepy-commands-not-committing-transactions/
#Fix issue where db data in manage.py commands is not refreshed at all once they start running
from dja... | Python | 0.000001 | @@ -1631,16 +1631,72 @@
k(subs)%0A
+ expire_submissions.reset_ml_subs_to_in()
%0A%0A%0A
|
d9b185de321a4f3b6b7cc343a7b8b914db1bd4bf | Fix docs of eigh and eigvalsh | cupy/linalg/_eigenvalue.py | cupy/linalg/_eigenvalue.py | import numpy
import cupy
from cupy_backends.cuda.libs import cublas
from cupy_backends.cuda.libs import cusolver
from cupy.cuda import device
from cupy.linalg import _util
def _syevd(a, UPLO, with_eigen_vector):
if UPLO not in ('L', 'U'):
raise ValueError('UPLO argument must be \'L\' or \'U\'')
# re... | Python | 0 | @@ -2139,17 +2139,33 @@
%0A %22%22%22
-E
+%0A Return the e
igenvalu
@@ -2193,114 +2193,270 @@
f a
-symmetric matrix.%0A%0A This method calculates eigenvalues and eigenvectors of a given%0A symmetric matrix
+complex Hermitian%0A (conjugate symmetric) or a real symmetric matrix.%0A%0A Returns two ob... |
62e8b35ceccb6d63b1769a93e1ff18a4bdeff112 | Update mesh_comparisons.py | curvox/mesh_comparisons.py | curvox/mesh_comparisons.py | import math
import meshlabxml
import os
import tempfile
import plyfile
import numpy as np
import numba
import binvox_rw
import commands
def print_hausdorff(hausdorff_distance):
for key, value in hausdorff_distance.items():
print('{}: {}'.format(key, value))
@numba.njit
def minmax(array):
# Ravel the... | Python | 0 | @@ -3268,16 +3268,70 @@
(union)%0A
+ %0A if union_count == 0:%0A return 0.0%0A %0A
retu
|
7a890ef8edc02870219aa85a9a3295674a7a50d3 | Update getClanUserJSONs.py | Leaderboard/getClanUserJSONs.py | Leaderboard/getClanUserJSONs.py | #!/usr/bin/python
import json
import requests
from getHeader import getHeader
def retrieveClanUserJSON():
morePages = True
pageCounter = 1
while morePages:
clan_url = "https://bungie.net/Platform/Group/1407546/Members/?lc=en&fmt=true¤tPage="+str(pageCounter)+"&platformType=2"
print "... | Python | 0 | @@ -221,15 +221,8 @@
oup/
-1407546
/Mem
|
94a2ef24863602c3f43c91252c2c1a1dd52ba8b5 | add default __future__imports; fix sorted .items() and `filter` having no len() | Lib/ufo2ft/kernFeatureWriter.py | Lib/ufo2ft/kernFeatureWriter.py | from feaTools import parser
from feaTools.writers.baseWriter import AbstractFeatureWriter
class KernFeatureWriter(AbstractFeatureWriter):
"""Generates a kerning feature based on glyph class definitions.
Uses the kerning rules contained in an RFont's kerning attribute, as well as
glyph classes from parsed... | Python | 0.000001 | @@ -1,20 +1,103 @@
+from __future__ import print_function, division, absolute_import, unicode_literals%0A
from feaTools import
@@ -1296,20 +1296,16 @@
.groups.
-iter
items():
@@ -1674,61 +1674,8 @@
e %22%22
-%0A pairs = kerning.items()%0A pairs.sort()
%0A%0A
@@ -1706,21 +1706,39 @@
val in
-pairs... |
84ad17a2d968f47da0f8d22b3a371f51d2f65411 | Update humidity_chart.py | MVP_UI/python/humidity_chart.py | MVP_UI/python/humidity_chart.py | import pygal
import requests
import json
#Query the database for data
#Order descending so the last rows are first
#These modifiers get humidity and return only 60 rows
r = requests.get('http://127.0.0.1:5984/mvp_sensor_data/_design/doc/_view/attribute_value?startkey=["humidity",{}]&endkey=["humidity"]&descending=true... | Python | 0.000002 | @@ -1,12 +1,35 @@
+# /usr/bin/env python%0A%0A
import pygal
|
16e05702109c5e1a326eb3c084a3cb2e84feb002 | Update Sunshine_Calibration.py | Modules/Sunshine_Calibration.py | Modules/Sunshine_Calibration.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 4 18:08:04 2017
@author: Yu-Hsuan Tu
"""
import os
import tkinter as tk
from tkinter.filedialog import askopenfilename
import numpy as np
import gdal
from osgeo import gdal_array
import Retrieve_Metadata
from Retrieve_Metadata import PathImage
impo... | Python | 0 | @@ -101,16 +101,368 @@
Hsuan Tu
+%0A%0AThis module uses Sequoia's sunshine irradiance to adjust photo's brightness.%0AUsage:%0ASelect a folder containing all the photos, then select one reference image (Band doesn't matter)%0AThe program will use the selected image's sunshine irradiance as reference,%0Aand manipulate ... |
fa7c40243c1167c33d46f3f743675e5aa50475cf | Fix Overflow exception in the bignum factorial benchmark that is due to the recent change of the default value for context.Emax. | Modules/_decimal/tests/bench.py | Modules/_decimal/tests/bench.py | #!/usr/bin/env python
#
# Copyright (C) 2001-2012 Python Software Foundation. All Rights Reserved.
# Modified and extended by Stefan Krah.
#
# Usage: ../../../python bench.py
import time
from math import log, ceil
from test.support import import_fresh_module
C = import_fresh_module('decimal', fresh=['_decimal'])
P... | Python | 0 | @@ -2314,16 +2314,20 @@
==%5Cn%22)%0A%0A
+c =
C.getcon
@@ -2324,32 +2324,34 @@
= C.getcontext()
+%0Ac
.prec = C.MAX_PR
@@ -2352,16 +2352,56 @@
MAX_PREC
+%0Ac.Emax = C.MAX_EMAX%0Ac.Emin = C.MIN_EMIN
%0A%0Afor n
|
fc4b6a5551be2ff504732a80d22f076513d53fb6 | Fix bug with enum constants names. | WordExtraction/scripts/TablesGenerator.py | WordExtraction/scripts/TablesGenerator.py | from urllib import request
from os import path, system, sys
import re
from collections import defaultdict
UNICODE_VERSION = '6.3.0'
BASE_URL = r'http://www.unicode.org/Public/{}/ucd/auxiliary/'.format(UNICODE_VERSION)
WORD_BREAK_PROPERTY_FILENAME = 'WordBreakProperty.txt'
HEXADECIMAL = r'[0-9A-F]+'
SINGLE_PROPERTY ... | Python | 0 | @@ -3286,21 +3286,8 @@
ems,
- format_func,
cou
@@ -3304,16 +3304,40 @@
, indent
+, format_func=lambda x:x
):%0A r
@@ -3432,16 +3432,17 @@
i += 1%0A
+%0A
@@ -3479,16 +3479,17 @@
) + ','%0A
+%0A
@@ -3617,24 +3617,24 @@
ing += '%5Cn'%0A
-
@@ -3635,24 +3635,25 @@
i = 0%0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.