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
ab792ad9afe9ec87127a716ccc6e7ea3396390bd
Add JenkinsBuildStep.cancel_step test
tests/changes/backends/jenkins/test_buildstep.py
tests/changes/backends/jenkins/test_buildstep.py
from __future__ import absolute_import import mock from changes.backends.jenkins.builder import JenkinsBuilder from changes.backends.jenkins.buildstep import JenkinsBuildStep from changes.testutils import TestCase class JenkinsBuildStepTest(TestCase): def get_buildstep(self): return JenkinsBuildStep(job...
Python
0.000001
@@ -2055,24 +2055,676 @@ with(step)%0A%0A + @mock.patch.object(JenkinsBuildStep, 'get_builder')%0A def test_cancel_step(self, get_builder):%0A builder = mock.Mock()%0A get_builder.return_value = builder%0A%0A build = self.create_build(self.create_project())%0A job = self.create_job(bu...
9c9e564d51d44fb27101249d57d769828f14e97e
Fix the failing dns test on Windows
tests/integration/modules/test_win_dns_client.py
tests/integration/modules/test_win_dns_client.py
# -*- coding: utf-8 -*- # Import Python libs from __future__ import absolute_import # Import Salt Testing libs from tests.support.case import ModuleCase from tests.support.unit import skipIf from tests.support.helpers import destructiveTest # Import Salt libs import salt.utils.platform @skipIf(not salt.utils.platf...
Python
0.000164
@@ -574,23 +574,115 @@ -dns = '8.8.8.8' +# Get a list of interfaces on the system%0A interfaces = self.run_function('network.interfaces_names') %0A @@ -678,32 +678,39 @@ names')%0A +skipIf( interface = 'Eth @@ -706,20 +706,121 @@ face - = 'Ethernet +s.count == 0, 'This test requires a networ...
2af82fe3aeb9031a70c3586faf64866d423b6550
add test
tests/unit_test/preprocess/test_process_units.py
tests/unit_test/preprocess/test_process_units.py
from matchzoo.preprocessor.process_units import * import pytest import numpy as np @pytest.fixture def raw_input(): return "This is an Example sentence to BE ! cleaned with digits 31." @pytest.fixture def list_input(): return ['this', 'Is', 'a', 'the', 'test', 'lIst', '36', '!', 'input'] @pytest.fixture def ...
Python
0.000002
@@ -1988,16 +1988,52 @@ (3, 15)%0A + # test shorter than window data%0A out
7f3357b1ca67ad869b5bba9b4535033fa988132f
use __slots__
hwtHls/allocator/time_independent_rtl_resource.py
hwtHls/allocator/time_independent_rtl_resource.py
from typing import Union, List from hwt.hdl.value import HValue from hwt.synthesizer.interface import Interface from hwt.synthesizer.interfaceLevel.unitImplHelpers import getSignalName from hwt.synthesizer.rtlLevel.rtlSignal import RtlSignal from hwtHls.clk_math import start_clk, end_clk, epsilon from hwt.synthesizer....
Python
0
@@ -398,16 +398,51 @@ eItem(): +%0A __slots__ = %5B%22parent%22, %22data%22%5D %0A%0A de @@ -1210,16 +1210,76 @@ any time +%0A __slots__ = %5B%22timeOffset%22, %22allocator%22, %22valuesInTime%22%5D %0A%0A de
577a72831479f971de4c8ad16496984d25578de5
Remove Redundant Information in Example Dags (#5497)
airflow/example_dags/example_subdag_operator.py
airflow/example_dags/example_subdag_operator.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
Python
0
@@ -1351,39 +1351,16 @@ start',%0A - default_args=args,%0A dag= @@ -1356,32 +1356,32 @@ ',%0A dag=dag,%0A + )%0A%0Asection_1 = S @@ -1468,39 +1468,16 @@ args),%0A - default_args=args,%0A dag= @@ -1548,39 +1548,16 @@ -task',%0A - default_args=args,%0A dag= @@ -1665,39 +1665,16 @@ args)...
a8b533f12731648392c361af90a6d4f2b9309055
Stop creating hook on instantiating of S3 operator
airflow/operators/s3_file_transform_operator.py
airflow/operators/s3_file_transform_operator.py
import logging from tempfile import NamedTemporaryFile import subprocess from airflow.exceptions import AirflowException from airflow.hooks import S3Hook from airflow.models import BaseOperator from airflow.utils.decorators import apply_defaults class S3FileTransformOperator(BaseOperator): """ Copies data fr...
Python
0.000023
@@ -2180,29 +2180,57 @@ _script%0A +%0A - self. +def execute(self, context):%0A source_s @@ -2251,16 +2251,21 @@ conn_id= +self. source_s @@ -2279,29 +2279,24 @@ id)%0A -self. dest_s3 = S3 @@ -2311,16 +2311,21 @@ conn_id= +self. dest_s3_ @@ -2336,41 +2336,8 @@ _id) -%0A%0A def execu...
a806bb51961b6640cc77c4fcb0ec05bac5f9616a
Update __manifest__.py
l10n_ro_stock_account_date_wizard/__manifest__.py
l10n_ro_stock_account_date_wizard/__manifest__.py
# Copyright (C) 2022 NextERP Romania # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { "name": "Romania - Stock Accounting Date Wizard", "version": "14.0.1.2.0", "category": "Localization", "summary": "Romania - Stock Accounting Date Wizard", "author": "NextERP Romania," "Odoo C...
Python
0.000063
@@ -434,16 +434,21 @@ _account +_date %22%5D,%0A
f1087c9a3b792f68d288a802e2b6192cbc3b7aaa
Fix using dicts as objects...again
bridgetest/twitter/proxy/handlers/status.py
bridgetest/twitter/proxy/handlers/status.py
from tornado.web import RequestHandler from .users import TUsersHandler import logging from json import dumps logger = logging.getLogger(__name__) class TStatusHandler(RequestHandler): def post(self, path): logger.warn("No handler for %s", path) self.set_status(404) def get_posts_profile_chan...
Python
0.000001
@@ -861,19 +861,22 @@ user -.id +%5B%22id%22%5D = TUser @@ -896,19 +896,22 @@ y_user() -.id +%5B%22id%22%5D %0A @@ -915,23 +915,26 @@ user -. +%5B%22 id_str +%22%5D = TUser @@ -958,15 +958,18 @@ er() -. +%5B%22 id_str +%22%5D %0A
8f63a9bf1d25f9da4577a8b5444a6b5b3d6bbc5c
Fix failing test for children
Orange/widgets/visualize/utils/tree/treeadapter.py
Orange/widgets/visualize/utils/tree/treeadapter.py
"""Base tree adapter class with common methods needed for visualisations.""" from abc import ABCMeta, abstractmethod from functools import reduce from operator import add class BaseTreeAdapter(metaclass=ABCMeta): """Base class for tree representation. Any subclass should implement the methods listed in this ...
Python
0
@@ -5969,29 +5969,71 @@ return -node.children +%5Bchild for child in node.children if child is not None%5D %0A%0A de
2f282ce7921b67a1be4a2f6d98c3d0462d6c20bb
Fix file closing
wp2github.py
wp2github.py
#!/usr/bin/env python """ Copyright (c) 2013, Sergey Storchay. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, me...
Python
0.000002
@@ -1885,16 +1885,18 @@ le.close +() %0A%0A ou @@ -2219,16 +2219,18 @@ le.close +() %0A%0Adef sp
5c3af82e2a75f2604b187d38840798526ec6746d
Use performance counter for measuring
wutu/util.py
wutu/util.py
import os import inspect import tempfile from flask import Response from logbook import Logger from contextlib import contextmanager from wutu.module import Module def get_logger(name): """ Returns a logging provider :param name: name for logger :return: logger """ return Logger(name) log = get_logger("util")...
Python
0.000001
@@ -5098,20 +5098,34 @@ import -time +perf_counter as pc %0A%09start @@ -5126,20 +5126,18 @@ start = -time +pc ()%0A%09try: @@ -5169,20 +5169,18 @@ diff = ( -time +pc () - sta
231969addd7abffb4cddebff88ed3983c04f61d7
Make English strings modifiable
nikola/data/themes/default/messages/messages_en.py
nikola/data/themes/default/messages/messages_en.py
from __future__ import unicode_literals MESSAGES = [ "Posts for year %s", "Archive", "Posts about %s", "Tags", "Also available in", "More posts about", "Posted", "Original site", "Read in English", "Newer posts", "Older posts", "Previous post", "Next post", "old ...
Python
0.999955
@@ -1,8 +1,33 @@ +# -*- encoding:utf-8 -*-%0A from __f @@ -74,13 +74,59 @@ S = -%5B +%7B %0A +%22LANGUAGE%22: %22English%22,%0A %22Posts for year %25s%22: %22Po @@ -146,16 +146,26 @@ %25s%22,%0A +%22Archive%22: %22Archiv @@ -167,24 +167,41 @@ rchive%22,%0A +%22Posts about %25s%22: %22Posts abou @...
f3a275f4acda2afee4d071961f78ef8705d547f9
Create bddirectory-amarphonebook-com-css.py
quotesbot/spiders/bddirectory-amarphonebook-com-css.py
quotesbot/spiders/bddirectory-amarphonebook-com-css.py
# -*- coding: utf-8 -*- import scrapy class ToScrapeCSSSpider(scrapy.Spider): name = "amarphonebook-com-css" start_urls = [ 'http://www.amarphonebook.com/list/Dhaka/All-Groceries/1/1113', ] def parse(self, response): for quote in response.css("div.list_common1"): yield { ...
Python
0.00012
@@ -379,22 +379,16 @@ .extract -_first (),%0A @@ -583,16 +583,20 @@ category + %3E i ::text%22)
dabdae4ec8aef552cb59472fd454ebd8db6ed004
Bump version to 0.7.5 (final)
sympy/__init__.py
sympy/__init__.py
""" SymPy is a Python library for symbolic mathematics. It aims to become a full-featured computer algebra system (CAS) while keeping the code as simple as possible in order to be comprehensible and easily extensible. SymPy is written entirely in Python and does not require any external libraries, except optionally for...
Python
0
@@ -510,12 +510,8 @@ .7.5 -.rc1 %22%0A%0Ai
4baf18bab50eec9bf9d432a37d3b1c6a04dc1e10
fix flake8 errors
simphony/cuds/tests/test_particles.py
simphony/cuds/tests/test_particles.py
import unittest import uuid from functools import partial from simphony.cuds.particles import Particle, Bond, Particles from simphony.core.data_container import DataContainer from simphony.core.cuba import CUBA from simphony.testing.utils import compare_data_containers from simphony.testing.abc_check_particles import ...
Python
0.000001
@@ -24,38 +24,8 @@ uuid -%0Afrom functools import partial %0A%0Afr @@ -179,67 +179,8 @@ UBA%0A -from simphony.testing.utils import compare_data_containers%0A from
dc6500b6a2cc58585b6971fee9efd695cd6124bb
Update homedept_assignment_filter.py
uf_examples/people/homedept_assignment_filter.py
uf_examples/people/homedept_assignment_filter.py
#!/usr/bin/env/python """ homedept_assignment_filter.py -- for home departments matched to patterns in an exception file, assign new home departments as indicated in the exception file """ __author__ = "Michael Conlon" __copyright__ = "Copyright 2015 (c) Michael Conlon" __license__ = "New BSD License" __versi...
Python
0.000001
@@ -256,9 +256,9 @@ 201 -5 +6 (c)
b3d99eef049751c03ca3b860e4c7daeeafa77575
Add diffs for deleted paragraphs
regserver/regulations/generator/layers/diff_applier.py
regserver/regulations/generator/layers/diff_applier.py
import types from collections import deque class DiffApplier(object): """ Diffs between two versions of a regulation are represented in our particular JSON format. This class applies that diff to the older version of the regulation, generating HTML that clearly shows the changes between old and new. "...
Python
0
@@ -362,16 +362,43 @@ 'delete' +%0A DELETED_OP = 'deleted' %0A%0A de @@ -980,73 +980,310 @@ def -apply_diff(self, original, label):%0A if label in self.diff: +delete_all(self, text):%0A %22%22%22 Mark all the text passed in as deleted. %22%22%22%0A return '%3Cdel%3E' + text + '%3C/del%3E'...
b9b551e64fb9db5ea47c981be5c8cc905e4d6860
Remove static rnaseq image
resolwe/flow/management/commands/list_docker_images.py
resolwe/flow/management/commands/list_docker_images.py
""".. Ignore pydocstyle D400. ================== List Docker images ================== """ import functools import logging import operator import shlex import subprocess import threading import time import yaml from django.conf import settings from django.core.management.base import BaseCommand, CommandError from...
Python
0.000002
@@ -2775,94 +2775,8 @@ )%0A%0A - unique_docker_images.add(%22public.ecr.aws/s4q6j6e8/resolwebio/rnaseq:5.12.0%22)%0A%0A
88c605eda3948adbf62fc18bd4a3e015f59aac85
remove unused code
syntax_def_dev.py
syntax_def_dev.py
import json import os import plistlib import sys import uuid import sublime_plugin from sublime_lib.path import root_at_packages from sublime_lib.view import has_file_ext, in_one_edit JSON_TMLANGUAGE_SYNTAX = 'Packages/AAAPackageDev/Support/Sublime JSON Syntax Definition.tmLanguage' # XXX: Move thi...
Python
0.000017
@@ -38,20 +38,8 @@ ib%0D%0A -import sys%0D%0A impo @@ -2400,65 +2400,8 @@ ):%0D%0A - # XXX: Can we/Should we use sublimelog.log?%0D%0A @@ -2628,102 +2628,8 @@ th)%0D -%0A # self.window.run_command(%22aaa_package_dev%22, %7B%22cmd%22: cmd, %22file_regex%22: file_regex%7D)%0D %0A%0D%0A @@ -3...
7f74a3d8bfae9c578a3ec4cfee53b19550728cac
Fix unit tests
dojo/unittests/test_microfocus_webinspect_parser.py
dojo/unittests/test_microfocus_webinspect_parser.py
from django.test import TestCase from dojo.tools.microfocus_webinspect.parser import MicrofocusWebinspectXMLParser from dojo.models import Test, Engagement, Product class TestMicrofocusWebinspectXMLParser(TestCase): def test_parse_without_file_has_no_findings(self): parser = MicrofocusWebinspectXMLParser...
Python
0.000005
@@ -1198,39 +1198,38 @@ self.assert -Equal(1 +Less(0 , len(item.unsav @@ -1848,31 +1848,30 @@ self.assert -Equal(1 +Less(0 , len(item.u @@ -2016,20 +2016,68 @@ %22Info%22, +MicrofocusWebinspectXMLParser.convert_severity( %220%22) +) %0A @@ -2157,16 +2157,66 @@ al(%22 -Info%22, +Medium%22, Microfo...
29366d6b23caefa390abb0c2f401844ea1827d06
update SendWriteDiaryEmailTask: send email to users who didn't write diary
english_diary/users/tasks/send_write_diary_email.py
english_diary/users/tasks/send_write_diary_email.py
from django.conf import settings from django.contrib.auth import get_user_model from celery import Task from users.utils.send_email import send_email class SendWriteDiaryEmailTask(Task): def run(self): for user in get_user_model().objects.all(): send_email( sender=settings.A...
Python
0.000002
@@ -72,16 +72,46 @@ er_model +%0Afrom datetime import datetime %0A%0Afrom c @@ -234,16 +234,68 @@ (self):%0A + today = datetime.now().strftime(%22%25Y/%25m/%25d%22)%0A @@ -338,16 +338,83 @@ .all():%0A + if not user.diary_set.get_or_none(datetime=today):%0A @@ -429,16 +429,2...
54157be4bbf1d0c7cb0ecdc50b5463a717472e43
Check that table files have two columns
table_handling.py
table_handling.py
import csv from random import randint from itertools import chain class TableFormatError(Exception): '''Raised when the user tries to load an improperly formatted table file.''' def __init__(self, msg): self.err_msg = msg def load_table(filepath, headers=False): '''Return a dict represen...
Python
0
@@ -1510,16 +1510,180 @@ reader:%0A + if len(row) != 2:%0A # Tables should only have two columns.%0A raise TableFormatError(%22Tables should only have two columns.%22)%0A
2b1c2d38113a35c73b0a4c0727421247025cdd3b
Fix FixedString to work with the new extract() API
biwako/bin/fields/strings.py
biwako/bin/fields/strings.py
from .base import Field, DynamicValue from .numbers import Integer class String(Field): def __init__(self, *args, encoding, padding=b'\x00', terminator=b'\x00', **kwargs): ''.encode(encoding) # Check for a valid encoding self.encoding = DynamicValue(encoding) sel...
Python
0
@@ -2483,37 +2483,38 @@ e))%0D%0A%0D%0A def e -ncode +xtract (self, obj, valu @@ -2503,33 +2503,68 @@ ct(self, obj -, value): +):%0D%0A value = obj.read(self.size(obj)) %0D%0A if @@ -2574,26 +2574,26 @@ lue != self. -d e +n coded_value: @@ -2650,26 +2650,26 @@ r.' %25 (self. -d e +n coded_val...
05078fdca2c2ad30ebb12234f5873470c20ade94
Add a context manager to the useful read/writer lock.
taskflow/utils.py
taskflow/utils.py
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (C) 2012 Yahoo! 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 # # ...
Python
0.000001
@@ -694,8 +694,2273 @@ icense.%0A +%0Aimport contextlib%0Aimport threading%0A%0A%0Aclass ReaderWriterLock(object):%0A %22%22%22A simple reader-writer lock.%0A%0A Several readers can hold the lock simultaneously, and only one writer.%0A Write locks have priority over reads to prevent write starvation.%0A%0A ...
b73a8f283972b686fa7b2aeb83b1314fb042e619
Add comment
pubres/tests/logging_test.py
pubres/tests/logging_test.py
import logging import logging.handlers import multiprocessing import pubres from pubres.pubres_logging import setup_logging from .base import * class MultiprocessingQueueStreamHandler(logging.handlers.BufferingHandler): """A logging handler that pushes the getMessage() of every LogRecord into a multiprocess...
Python
0
@@ -141,16 +141,233 @@ ort *%0A%0A%0A +# Tests if the logging works.%0A# Uses a custom logging handler that collects log messages into a list%0A# and then asserts that they are there.%0A# Care is taken about the server actually running in a different process.%0A%0A%0A class Mu
c719802c83c8c5f77e27d2ac8b2bc59516cafe4f
Add new version of zlib, deprecate 1.2.10 (#3136)
var/spack/repos/builtin/packages/zlib/package.py
var/spack/repos/builtin/packages/zlib/package.py
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
Python
0
@@ -1477,92 +1477,47 @@ .2.1 -0 +1 ', ' -d9794246f853d15ce0fcbf79b9a3cf13')%0A # author had this to say about 1.2.9.... +1c9f62f0778697a09d36121ead88e08e') %0A @@ -1568,16 +1568,26 @@ f 1.2.9 +or 1.2.10 should b @@ -1587,16 +1587,22 @@ hould be +%0A # immedia @@ -1605,22 +1605,16 @@ ediately -%0A ...
2f75327ce3be5c67f815f53d9afd8e8341a4235a
Fix default value quotes, test was failing
py3status/modules/systemd.py
py3status/modules/systemd.py
# -*- coding: utf-8 -*- """ Check systemd unit status. Check the status of a systemd unit. Configuration parameters: cache_timeout: How often we refresh this module in seconds (default 5) format: Format for module output (default "{unit}: {status}") unit: Name of the unit (default dbus.service) Format of...
Python
0.00001
@@ -289,16 +289,17 @@ default +%22 dbus.ser @@ -302,16 +302,17 @@ .service +%22 )%0A%0AForma
c99112e94f925ffccc98d730424134598494c06b
Fix py_solve tests
py_solve/tests/test_solve.py
py_solve/tests/test_solve.py
import sys import os import numpy as np import scipy.sparse as sp import scipy.sparse.linalg as spla import pytest this_dir = os.path.dirname(__file__) sys.path.insert(0, os.path.join(this_dir, os.pardir)) DTYPES = ['f8', np.complex128] @pytest.mark.parametrize('dtype', DTYPES) def test_solve_identity_ones(dtype)...
Python
0.000194
@@ -96,16 +96,43 @@ s spla%0A%0A +import py_solve as solver%0A%0A import p
2059d4e052f94b23cdeb7418b7b3cc4e5610d329
Allow to upload to an specific asset.
pybossa/uploader/__init__.py
pybossa/uploader/__init__.py
# -*- coding: utf8 -*- # This file is part of PyBossa. # # Copyright (C) 2014 SF Isle of Man Limited # # PyBossa 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...
Python
0
@@ -1675,19 +1675,26 @@ lf, file +, asset ):%0A - @@ -1748,32 +1748,333 @@ %22%0A pass%0A%0A + def get_filename_extension(self, filename):%0A %22%22%22Return filename extension.%22%22%22%0A try:%0A extension = filename.rsplit('.', 1)%5B1%5D.lower()%0A if extens...
adf53cd061161ddf9fed5a2c25b1f1bf71b290dd
remove cover coverage
pychecker/pychecker2/test.py
pychecker/pychecker2/test.py
import os import sys import unittest import inspect import glob class Tester: def __init__(self): self.modules = [] self.exit_status = 0 self.verbosity = 1 self.coverage = None def __call__(self): for m in self.modules: s = unittest.defaultTestLoader.loadTes...
Python
0.000001
@@ -41,207 +41,44 @@ ort -inspect%0Aimport glob%0A%0Aclass Tester:%0A def __init__(self):%0A self.modules = %5B%5D%0A self.exit_status = 0%0A self.verbosity = 1%0A self.coverage = None%0A%0A def __call__(self):%0A +glob%0A%0Adef test(modules, verbosity):%0A @@ -86,21 +86,16...
738de13f662e441583a4abaa83e59e69b37af30c
Add default values for AcousticMaterial2ndOrder.
pyfds/nonlinear_acoustics.py
pyfds/nonlinear_acoustics.py
import numpy as np from . import fields as fld from . import acoustics as ac class IdealGas1D(fld.Field1D): """Class for simulation of one dimensional nonlinear acoustic fields in ideal gases.""" def __init__(self, convective=True, nl_state=True, *args, **kwargs): """Class constructor. Args:...
Python
0
@@ -6620,16 +6620,21 @@ d_rho_p +=None , d_rho2 @@ -6635,16 +6635,18 @@ d_rho2_p +=0 , *args, @@ -6937,16 +6937,17 @@ %22%22%22%0A +%0A @@ -6972,32 +6972,127 @@ args, **kwargs)%0A + if not d_rho_p:%0A self.d_rho_p = super().sound_velocity**2%0A else:%0A self.d_...
16f9d0943c8ae7bde5bde8a58c5aaa119342ecd8
Fix docstring for python.call
pyinfra/operations/python.py
pyinfra/operations/python.py
''' The Python module allows you to execute Python code within the context of a deploy. ''' from pyinfra.api import FunctionCommand, operation @operation def call(function, *args, **kwargs): ''' Execute a Python function within a deploy. + func: the function to execute + args: additional arguments t...
Python
0.000028
@@ -253,16 +253,20 @@ + func +tion : the fu
2393de5f80744baf86c4ca1d822dc9d0bc1ff905
Fix package doc.
pymatgen/matproj/__init__.py
pymatgen/matproj/__init__.py
Python
0
@@ -0,0 +1,85 @@ +%22%22%22%0AThis module implements high-level interfaces to the public Materials Project.%0A%22%22%22
6f3336ef5dd43c02c851001715cf0f231c269276
Add keystone to the request
pyramid_keystone/__init__.py
pyramid_keystone/__init__.py
default_settings = [ ('auth_url', str, 'http://localhost:5000/v3'), ('region', str, 'RegionOne'), ('user_domain_name', str, 'Default'), ('cacert', str, ''), ] def parse_settings(settings): parsed = {} def populate(name, convert, default): sname = '%s%s' % ('keystone.',...
Python
0
@@ -1061,16 +1061,74 @@ ister)%0A%0A + # Allow the user to use our auth policy (recommended)%0A conf @@ -1200,12 +1200,164 @@ h_policy')%0A%0A + # Add the keystone property to the request%0A config.add_request_method('.keystone.request_keystone', name='keystone', property=True, reify=True)%0A%0A
1f0f551edc3dcb2146a802296f1931658af0c129
Squashed commit of the following:
pyrate/services/mailchimp.py
pyrate/services/mailchimp.py
from pyrate.main import Pyrate from pyrate.utils import clean_dict, ExceptionWithCode class ListNotFoundError(Exception): pass class MailchimpPyrate(Pyrate): # request base_url = None # see __init__ default_header_content = None default_body_content = None # see __init__ auth_data = {'typ...
Python
0.999994
@@ -706,12 +706,22 @@ ikey -%5B-3: +.split('-')%5B-1 %5D +
02ac0956f1c8ed114aa65e59e5b4c14ded7df554
Convert HTML entities in reader, and recognise <i> for italic
pyth/plugins/xhtml/reader.py
pyth/plugins/xhtml/reader.py
""" Read documents from xhtml """ import BeautifulSoup from pyth import document from pyth.format import PythReader from pyth.plugins.xhtml.css import CSS class XHTMLReader(PythReader): @classmethod def read(self, source, css_source=None): reader = XHTMLReader(source, css_source) return rea...
Python
0
@@ -507,24 +507,126 @@ (self.source +,%0A convertEntities=BeautifulSoup.BeautifulSoup.HTML_ENTITIES )%0A # @@ -2028,12 +2028,19 @@ ent( +%5B 'em' +, 'i'%5D ) is
41912722601e1296c05530641170401cc29a6bbb
Update __init__.py
pythainlp/corpus/__init__.py
pythainlp/corpus/__init__.py
# -*- coding: utf-8 -*- """ Corpus related functions. Access to dictionaries, word lists, and language models. Including download manager. """ __all__ = [ "corpus_path", "corpus_db_path", "corpus_db_url", "countries", "download", "get_corpus", "get_corpus_db", "get_corpus_db_detail", ...
Python
0.000072
@@ -885,16 +885,21 @@ db.json%22 + #2.2 %0A)%0A%0A# lo
6ebeba5ebc7c76f9f0803a1cdbc2babd2ac57d63
Update CUBE-AI example.
scripts/examples/25-Machine-Learning/nn_stm32cubeai.py
scripts/examples/25-Machine-Learning/nn_stm32cubeai.py
# STM32 CUBE.AI on OpenMV MNIST Example import sensor, image, time, nn_st sensor.reset() # Reset and initialize the sensor. sensor.set_contrast(3) sensor.set_brightness(0) sensor.set_auto_gain(True) sensor.set_auto_exposure(True) sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to Graysc...
Python
0
@@ -32,16 +32,93 @@ Example +%0A# See https://github.com/openmv/openmv/blob/master/src/stm32cubeai/README.MD %0A%0Aimport
def792a1fc19c727fd538d1826c22feea1a3c3f0
Move the import to the top
flumotion/component/common/avproducer/avproducer.py
flumotion/component/common/avproducer/avproducer.py
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 # Flumotion - a streaming media server # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. # Copyright (C) 2010,2011 Flumotion Services, S.A. # All rights reserved. # # This file may be distributed and/or modified under the terms of # the GNU Lesser General Pub...
Python
0.000004
@@ -1145,16 +1145,70 @@ cheduler +%0Afrom flumotion.component.effects.volume import volume %0A%0A__vers @@ -5225,70 +5225,8 @@ e%22)%0A - from flumotion.component.effects.volume import volume%0A
98ad4e14371c387ea69e175283b84547eb268b1a
add usecase to bluetooth test
python/run_bluetooth_test.py
python/run_bluetooth_test.py
#!/usr/bin/env python # -- Content-Encoding: UTF-8 -- """ Runs an Herald HTTP framework :author: Thomas Calmant :copyright: Copyright 2014, isandlaTech :license: Apache License 2.0 :version: 0.0.3 :status: Alpha .. Copyright 2014 isandlaTech Licensed under the Apache License, Version 2.0 (the "License"); ...
Python
0.000001
@@ -2678,16 +2678,40 @@ 'ping', +%0A 'testUseCase', %0A%0A
ef8c319bfd09add62f64e3cab0f733c068d311da
Rename _VALID_FIELDS to MATCH_FIELDS
zof/ofctl.py
zof/ofctl.py
# N.B. This module must remain compatibile with Python 2.7. try: # For Python 2.x compatibility. _BASESTRING = basestring except NameError: _BASESTRING = str def _convert_tp_dst(_key, ofctl): return '%s_dst' % _ip_proto_name(ofctl) def _convert_tp_src(_key, ofctl): return '%s_src' % _ip_proto_n...
Python
0.999999
@@ -2590,22 +2590,21 @@ id_fn = -_VALID +MATCH _FIELDS. @@ -3603,14 +3603,13 @@ )%0A%0A%0A -_VALID +MATCH _FIE
ac0f2c967ccd6fab47607fb246fc8e359c56073b
update user context to take program
web/impact/impact/tests/contexts/user_context.py
web/impact/impact/tests/contexts/user_context.py
# MIT License # Copyright (c) 2017 MassChallenge, Inc. from datetime import timedelta from django.utils import timezone from impact.tests.factories import ( BaseProfileFactory, EntrepreneurProfileFactory, ExpertProfileFactory, IndustryFactory, MemberProfileFactory, UserFactory, ) class UserC...
Python
0
@@ -298,16 +298,69 @@ actory,%0A + ProgramRoleFactory,%0A ProgramRoleGrantFactory,%0A )%0A%0A%0Aclas @@ -613,16 +613,47 @@ ilies=%5B%5D +,%0A program=None ):%0A @@ -795,16 +795,16 @@ amilies%0A - @@ -873,16 +873,47 @@ r_type)%0A + self.program = program%0A @@ ...
a4d5e7895db53c91308f51d7532eed9abdb1abfe
Fix unicode
zopy/core.py
zopy/core.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from schemas import ZohoResponse from xml import etree from xml.etree.ElementTree import Element, tostring, fromstring, SubElement import requests class ZohoException(Exception): pass class Properties(object): # Set properties @property def user(self): try: r...
Python
0.999999
@@ -4506,16 +4506,49 @@ != str:%0A +%09%09%09%09%09%09fl.text = value%0A%09%09%09%09%09else:%0A %09%09%09%09%09%09if @@ -4626,41 +4626,8 @@ xt = - value%0A%09%09%09%09%09else:%0A%09%09%09%09%09%09fl.text = val
001f783bce460abb56ee6d84cc901bb849771ac5
fix PEP8 warnings
smartcard/Examples/scard-api/sample_getStatusChange.py
smartcard/Examples/scard-api/sample_getStatusChange.py
#! /usr/bin/env python """ Sample for python PCSC wrapper module: Detect card insertion/removal __author__ = "http://www.gemalto.com" Copyright 2001-2012 gemalto Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com Copyright 2010 Ludovic Rousseau Author: Ludovic Rousseau, mailto:ludovic.rousseau@free.fr ...
Python
0.000007
@@ -2517,34 +2517,32 @@ ish context: ' + - %5C %0A SCa @@ -2775,26 +2775,24 @@ readers: ' + - %5C %0A @@ -3736,18 +3736,16 @@ ext: ' + - %5C %0A
031674f1da357a8d7bae3d2fc8c3f636e35eec9e
Remove vestigal comments about old format.
blaze/tests/test_pipeline.py
blaze/tests/test_pipeline.py
# TODO assertsion for the output'd values... right now they have # pointer addresses so its hard to do string matching from blaze.expr import ops from blaze.table import NDArray from blaze.compile.pipeline import compile from blaze.expr.graph import IntNode, FloatNode, VAL, OP, APP from pprint import pprint from diffl...
Python
0
@@ -1573,652 +1573,197 @@ -# Add(Array(39558864)%7Bdshape(%223 int64%22)%7D,Array(39558864)%7Bdshape(%223 int64%22)%7D)%0A if DEBUG:%0A pprint(plan, width=1)%0A%0A plan = compile(d+d)%0A%0A # Add(%0A # Add(Array(39558864)%7Bdshape(%223 int64%22)%7D, Array(39558864)%7Bdshape(%223 int64%22)%7D)...
160b5754ebe3dc65a5d28254b4240af40bbf520e
Make logged nnz/total message more intuitive
nupic/research/frameworks/pytorch/imagenet/mixins/rezero_weights.py
nupic/research/frameworks/pytorch/imagenet/mixins/rezero_weights.py
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2020, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
Python
0
@@ -1651,17 +1651,17 @@ ams +nnz/ total -/nnz %25s @@ -1698,39 +1698,24 @@ - params_sparse, nonzero_par @@ -1726,16 +1726,31 @@ sparse2, + params_sparse, %0A @@ -2636,16 +2636,17 @@ %22Params +n nz/total
1e71af28ddac2a07fbcc3e1c2f6eaa9280702e9d
Version bump
blinkpy/helpers/constants.py
blinkpy/helpers/constants.py
"""Generates constants for use in blinkpy.""" import os MAJOR_VERSION = 0 MINOR_VERSION = 14 PATCH_VERSION = '0.dev3' __version__ = '{}.{}.{}'.format(MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION) REQUIRED_PYTHON_VER = (3, 5, 3) PROJECT_NAME = 'blinkpy' PROJECT_PACKAGE_NAME = 'blinkpy' PROJECT_LICENSE = 'MIT' PROJEC...
Python
0.000001
@@ -108,16 +108,9 @@ N = -'0.dev3' +0 %0A%0A__
c67af0278ed13105f541764e979ad4b4bb44233d
Fix median
bluelytics/dolar_blue/api.py
bluelytics/dolar_blue/api.py
from django.http import HttpResponse import json, datetime from operator import itemgetter from decimal import Decimal from dolar_blue.models import DolarBlue, Source from dolar_blue.utils import DecimalEncoder, arg, median from dolar_blue.calculations import maxCurrencies, convCurr def api_dolar(d): return {'date...
Python
0.998691
@@ -1452,29 +1452,28 @@ %5B'compra'%5D, -input +blue )),%0A @@ -1510,29 +1510,28 @@ x%5B'venta'%5D, -input +blue )),%0A @@ -1576,37 +1576,36 @@ 'compra_ayer'%5D, -input +blue )),%0A 'ven @@ -1652,21 +1652,20 @@ ayer'%5D, -input +blue )),%0A
22b3b7e254714aa2c33cbad11126a05d1e7ecfc6
Add new CloudSearch regions. Closes #1465.
boto/cloudsearch/__init__.py
boto/cloudsearch/__init__.py
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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...
Python
0
@@ -1784,32 +1784,592 @@ layer1.Layer1),%0A + RegionInfo(name='us-west-1',%0A endpoint='cloudsearch.us-west-1.amazonaws.com',%0A connection_cls=boto.cloudsearch.layer1.Layer1),%0A RegionInfo(name='us-west-2',%0A endpoint='cloudsear...
5143d0b9f15b5d61ad081d852d347a4da7c5b8a4
Implement getCfgVersion
plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py
plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py
# Copyright (c) 2016 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.VersionUpgrade import VersionUpgrade # Superclass of the plugin. from . import MachineInstance # To upgrade machine instances. from . import Profile # To upgrade profiles. ## Converts configuration from Cura 2.1'...
Python
0
@@ -90,16 +90,80 @@ igher.%0A%0A +import configparser #To get version numbers from config files.%0A%0A from UM. @@ -336,16 +336,602 @@ files.%0A%0A +## Gets the version number from a config file.%0A#%0A# In all config files that concern this version upgrade, the version%0A# number is stored in general/version, ...
d33459cd709d618757ada3f9d592c43c236176b9
Return from replace_numpy
bridge/npbackend/__init__.py
bridge/npbackend/__init__.py
""" The module initialization of npbackend/bohrium imports and exposes all methods required to become a drop-in replacement for numpy. """ import sys if 'numpy_force' not in sys.modules: import numpy sys.modules['numpy_force'] = numpy del numpy #We import all of NumPy and overwrite with the objects we impl...
Python
0.00046
@@ -1313,16 +1313,25 @@ %0A + result = functio @@ -1580,16 +1580,39 @@ y_linalg +%0A%0A return result %0A ret
1fafa34eb132fa07d4d152ee4c85829e064cb716
Fix typo and update style to match the other platforms (#7621)
homeassistant/components/image_processing/opencv.py
homeassistant/components/image_processing/opencv.py
""" Component that performs OpenCV classification on images. For more details about this component, please refer to the documentation at https://home-assistant.io/components/image_processing.opencv/ """ from datetime import timedelta import logging from homeassistant.core import split_entity_id from homeassistant.com...
Python
0
@@ -373,20 +373,16 @@ gEntity, -%0A PLATFOR @@ -389,18 +389,16 @@ M_SCHEMA -,%0A )%0Afrom h @@ -454,20 +454,16 @@ MATCHES, -%0A CLASSIF @@ -479,20 +479,16 @@ _CONFIG, -%0A CONF_CL @@ -496,20 +496,16 @@ SSIFIER, -%0A CONF_EN @@ -527,20 +527,16 @@ NF_NAME, -%0A process @@ -545,40 +545,11 @...
a24a2305bf78e2b331623d78a91e457feffef8a8
Print warning only if node is not installed (#137)
kaggle_environments/envs/lux_ai_2021/lux_ai_2021.py
kaggle_environments/envs/lux_ai_2021/lux_ai_2021.py
import json import math import random from os import path from .agents import agents as all_agents from subprocess import Popen, PIPE, STDOUT import time import sys import atexit from .test_agents.python.lux.game import Game dimension_process = None game_state = Game() def cleanup_dimensions(): global dimension_p...
Python
0
@@ -837,32 +837,49 @@ E, stdout=PIPE)%0A + try:%0A dimensio @@ -980,32 +980,167 @@ E, stdout=PIPE)%0A + except FileNotFoundError:%0A import warnings%0A warnings.warn(%22Node not installed%22)%0A return state%0A atexit.r
3902897c97977eb51f034696b376143d17a8c09a
Fix spelling in docstring.
01/solve_1.py
01/solve_1.py
"""Report the manhattan distance between a starting point and an ending point, given a set of directions to follow to get move between the two points.""" from distance import get_distance from directions import load_directions, follow_directions def main(): directions = load_directions('directions.txt') sta...
Python
0.000175
@@ -115,12 +115,8 @@ to -get move
a072c7d9ae80b06af2bbbb195933098baad3d791
Fix migration 053 when email addresses or non-null but not parseable.
migrations/versions/053_canonicalize_addresses.py
migrations/versions/053_canonicalize_addresses.py
"""canonicalize addresses Revision ID: 3795b2a97af1 Revises:358d0320397f Create Date: 2014-07-15 22:11:38.037716 """ # revision identifiers, used by Alembic. revision = '3795b2a97af1' down_revision = '358d0320397f' from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql def upgrade():...
Python
0
@@ -1776,16 +1776,105 @@ y=True)%0A + if not isinstance(parsed_address, address.EmailAddress):%0A return addr%0A
a361fd3eaccfa3ca16bdc1080ceea00b9a24c1cd
Change navbar DropdownMenu to right aligned so menu doesn't render off screen
src/chime_dash/app/components/menu.py
src/chime_dash/app/components/menu.py
"""component/menu Dropdown menu which appears on the navigation bar at the top of the screen refactor incoming """ from typing import List from dash.development.base_component import ComponentMeta import dash_bootstrap_components as dbc from chime_dash.app.components.base import Component class Menu(Component): ...
Python
0
@@ -1596,16 +1596,39 @@ light%22,%0A + right=True%0A
6559bb2fe2022cbcea66642d086017cd1d433ace
Remove unused logs.
modules/tools/voice_detection/snowboy_detector.py
modules/tools/voice_detection/snowboy_detector.py
#!/usr/bin/env python ############################################################################### # Copyright 2018 The Apollo 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 ...
Python
0
@@ -2769,80 +2769,8 @@ se)%0A - f.write('Action %7B%7D is triggered!%5Cn'.format(hotword.action))%0A
2dd6ba84f348fa2680de896c306cdb9a788634d8
fix attribute name
monasca_notification/plugins/abstract_notifier.py
monasca_notification/plugins/abstract_notifier.py
# (C) Copyright 2015 Hewlett Packard Enterprise Development LP # # 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.000142
@@ -1486,16 +1486,17 @@ te(self. +_ template
72ad8b41d4326c49b4326040f76ba453dd0a9c4d
Improve revision migration
normandy/recipes/migrations/0035_revision_data.py
normandy/recipes/migrations/0035_revision_data.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.11 on 2016-11-28 13:48 # flake8: noqa from __future__ import unicode_literals import hashlib import json from django.db import migrations def hash_revision_data(revision): data = '{}{}{}{}{}{}'.format(revision.recipe.id, revision.created, revision.name, ...
Python
0.000002
@@ -1915,16 +1915,301 @@ save()%0A%0A + if revision is None:%0A revision = RecipeRevision(recipe=r, parent=None, name=r.name, action=r.action,%0A arguments_json=r.arguments_json,%0A filter_expression=r.filter_ex...
8a4819daa627f06e1a0eac87ab44176b7e2a0115
Correct renamed module names for bank-statement-import repository.
openerp/addons/openupgrade_records/lib/apriori.py
openerp/addons/openupgrade_records/lib/apriori.py
""" Encode any known changes to the database here to help the matching process """ renamed_modules = { 'base_calendar': 'calendar', 'mrp_jit': 'procurement_jit', 'project_mrp': 'sale_service', # OCA/account-invoicing 'invoice_validation_wkfl': 'account_invoice_validation_workflow', 'account_inv...
Python
0
@@ -523,24 +523,32 @@ ing_camt': ' +account_ bank_stateme @@ -550,21 +550,22 @@ atement_ -parse +import _camt',%0A @@ -589,57 +589,155 @@ ing_ -nl_ing_mt940': 'bank_statement_parse_nl_ing_mt940 +mt940':%0A 'account_bank_statement_import_mt940_base',%0A 'account_banking_nl_ing_mt940':%0A 'account_b...
8da28f4d36660021632dc148f3be24d9926d5dd3
Fix comment on how to use this file
paying_for_college/data_sources/bls_processing.py
paying_for_college/data_sources/bls_processing.py
import json from csv import DictReader as cdr from paying_for_college.models import School """ # Data processing steps This script was used to process a few xlsx files to look at expediture data based on income and region - source: http://www.bls.gov/cex/ - files under Region of residence by income before taxes: -...
Python
0
@@ -762,20 +762,16 @@ mport *%0A -a = create_b @@ -790,20 +790,101 @@ ()%0A%60%60%60%0A%0A +This will create a new file in %60paying_for_college/fixtures/bls_data_new.json%60%0A%0A %22%22%22%0A +%0A BASE_DIR
64ed33f387f065803f305cbdb27c43c1b203a189
remove minor error
pliers/tests/extractors/test_vector_extractors.py
pliers/tests/extractors/test_vector_extractors.py
from pliers.extractors import (VectorMetricExtractor) from pliers.stimuli import VectorStim from pliers.tests.utils import get_test_data_path import numpy as np import scipy from os.path import join import pytest VECTOR_DIR = join(get_test_data_path(), 'vector') def test_vector_metric_extractor(): def dummy(arra...
Python
0.000035
@@ -1696,17 +1696,16 @@ %5B0%5D == 2 -. %0A ass
f026af91d39cf8f5f4db0925d09fc6ddff2cc443
Use breadcrumbs from lava-server
dashboard_app/bread_crumbs.py
dashboard_app/bread_crumbs.py
# Copyright (C) 2010 Linaro Limited # # Author: Zygmunt Krynicki <zygmunt.krynicki@linaro.org> # # This file is part of Launch Control. # # Launch Control is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License version 3 # as published by the Free Software F...
Python
0
@@ -725,1851 +725,168 @@ %3E.%0A%0A -from django.core.urlresolvers import reverse%0Aimport logging%0A%0A%0Aclass BreadCrumb(object):%0A%0A def __init__(self, name, parent=None, needs=None):%0A self.name = name%0A self.view = None%0A self.parent = parent%0A self.needs = needs or %5B%5D%0A...
10b5d4e697fa0a66da23e399ae84ba809472922e
Remove the multi visualization combo box.
ui/parameters/RenderParameterWidget.py
ui/parameters/RenderParameterWidget.py
""" RenderParameterWidget :Authors: Berend Klein Haneveld """ from PySide.QtGui import QLabel from PySide.QtGui import QComboBox from PySide.QtGui import QWidget from PySide.QtGui import QGridLayout from PySide.QtGui import QScrollArea from PySide.QtGui import QFrame from PySide.QtCore import Slot from PySide.QtCore...
Python
0
@@ -1214,24 +1214,26 @@ AlignTop)%0A%09%09 +# layout.addWi @@ -1263,16 +1263,17 @@ ion type +: %22), 0, 0 @@ -1272,24 +1272,26 @@ %22), 0, 0)%0A%09%09 +# layout.addWi
931267a0fedb97e3b53d1a3792dd2eee72e6510b
Add todo.
matchzoo/metrics/__init__.py
matchzoo/metrics/__init__.py
from .precision import Precision from .average_precision import AveragePrecision from .discounted_cumulative_gain import DiscountedCumulativeGain from .mean_reciprocal_rank import MeanReciprocalRank from .mean_average_precision import MeanAveragePrecision from .normalized_discounted_cumulative_gain import \ Normali...
Python
0.000001
@@ -321,28 +321,62 @@ zedDiscountedCumulativeGain%0A +%0A# TODO: unify ALIAS to list form%0A
bc29c044f271ca9940b8357d1194412de4986e3c
Resuelve compatibilidad con el guardado desde el API
API/models.py
API/models.py
# -*- coding: utf-8 -*- from django.db import models class Operacion(models.Model): OPERACIONES = ( (u'+', u'Suma'), (u'-', u'Resta'), (u'*', u'Multiplicación'), (u'/', u'División'), ) op1 = models.DecimalField( max_digits=14, decimal_places=4, defau...
Python
0
@@ -978,24 +978,34 @@ ef save(self +, **kwargs ):%0A r
5a060bef8b70d51d4121257f89f4796cf4c0c927
Fix bugs sending emails
realestate/property/views.py
realestate/property/views.py
from django.core.mail import send_mail from django.shortcuts import render_to_response from django.template import RequestContext from django.http import HttpResponse from realestate.home.forms import SearchForm from realestate.property.forms import PropiedadContactForm from realestate.property.models import Propiedad...
Python
0.00001
@@ -11,32 +11,76 @@ o.co -re.mail import send_mail +nf import settings%0Afrom django.core.mail.message import EmailMessage %0Afro @@ -3860,34 +3860,91 @@ -send_mail(asunto, mensaje, +_from = settings.DEFAULT_FROM_EMAIL%0A to = %5Bprop.agente.user.email, %5D%0A reply = for @@ -3974,46 +3974,106 @@ il') ...
665c9f9811d6ee432384b205211aa053e4f401fe
Update SARSA
capstone/algorithms/sarsa.py
capstone/algorithms/sarsa.py
import random from capstone.policy import RandomPolicy class Sarsa(object): def __init__(self, env, policy=RandomPolicy(), qf={}, alpha=0.1, gamma=0.99, n_episodes=1000): self.env = env self.policy = policy self.qf = qf self.alpha = alpha self.gamma = gamm...
Python
0.000001
@@ -7,16 +7,58 @@ random%0A +from capstone.policy import EGreedyPolicy%0A from cap @@ -149,22 +149,23 @@ policy= -Random +EGreedy Policy() @@ -1103,40 +1103,104 @@ -while not self.env.is_terminal() +self.init()%0A action = self.policy.action(self.env, qf=self.qf)%0A while True :%0A ...
1d4bbdfac78c63566438e59e7ca6836d4cee07be
Simplify run_swf_command helper
caravan/commands/__init__.py
caravan/commands/__init__.py
import importlib import inspect import sys import boto3 from botocore.exceptions import ClientError from caravan.swf import get_connection def is_response_success(response): status_code = response.get('ResponseMetadata', {}).get('HTTPStatusCode') return status_code == 200 def run_swf_command(command, **kwa...
Python
0.000141
@@ -143,188 +143,122 @@ def -is_response_success(response):%0A status_code = response.get('ResponseMetadata', %7B%7D).get('HTTPStatusCode')%0A return status_code == 200%0A%0A%0Adef run_swf_command(command, **kwargs):%0A +run_swf_command(command_name, **kwargs):%0A connection = kwargs.get('connection')%0A ...
f098d1d47cc4f93a40258f84488d381d1246e261
change imports
CGAN/train.py
CGAN/train.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data import numpy as np import time import cgan import image_utils as iu dirs = { 'sample_output': './CGAN/', 'checkpoint...
Python
0.000001
@@ -229,16 +229,84 @@ ort cgan +%0A%0Aimport sys%0Asys.path.insert(0, '../')%0A%0Afrom datasets import DataSet %0Aimport @@ -620,63 +620,61 @@ t = -input_data.read_ +DataSet( data -_ set -s('./MNIST_data', one_hot=True) +_name='mnist')%0A mnist = mnist.mnist %0A%0A
4fe357515917a53b5b462cf43f091ef0a80375f2
Fix unsafe file path in image_path_writer (#1823)
python/dllib/src/bigdl/dllib/utils/file_utils.py
python/dllib/src/bigdl/dllib/utils/file_utils.py
# # Copyright 2018 Analytics Zoo 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 or agreed to...
Python
0
@@ -723,16 +723,250 @@ y as np%0A +import os%0A%0A%0Adef convert_to_safe_path(input_path, follow_symlinks=True):%0A # resolves symbolic links%0A if follow_symlinks:%0A return os.path.realpath(input_path)%0A # covert to abs path%0A return os.path.abspath(input_path)%0A %0A%0Adef to
268d38d8370d12384f932cb18937afbfe900e71b
Use a pipeline when generating the group chats list.
charat2/views/rp/__init__.py
charat2/views/rp/__init__.py
import os import json from flask import abort, g, jsonify, make_response, render_template, request, redirect, url_for from sqlalchemy import and_ from sqlalchemy.orm import joinedload from sqlalchemy.orm.exc import NoResultFound from charat2.helpers import alt_formats from charat2.helpers.auth import log_in_required f...
Python
0
@@ -2754,24 +2754,49 @@ )) -%0A groups = %5B%5D +.all()%0A%0A pipeline = g.redis.pipeline() %0A @@ -2835,38 +2835,16 @@ -online_users = len(set(g.redis +pipeline .hva @@ -2874,18 +2874,103 @@ roup.id) +%0A%0A groups = %5B%5D%0A for group, online_users in zip(groups_query, pipeline.execute( )...
324af0eefaa3e453049b050633f52c403d5746cd
Update __init__.py
reddit2telegram/channels/r_apphookup/__init__.py
reddit2telegram/channels/r_apphookup/__init__.py
Python
0.000072
@@ -1 +1,18 @@ +# Just empty file %0A
43a974f2fe1203160699c044aab80492b2cfd5d6
Make SignalQueue singleton
py/g1/asyncs/kernels/g1/asyncs/kernels/signals.py
py/g1/asyncs/kernels/g1/asyncs/kernels/signals.py
__all__ = [ 'SignalQueue', ] import signal import socket import struct import threading from g1.bases.assertions import ASSERT from . import adapters class SignalQueue: """Signal queue. Python runtime implements a UNIX signal handler that writes signal number to a file descriptor (which is globall...
Python
0.000907
@@ -125,16 +125,59 @@ t ASSERT +%0Afrom g1.bases.classes import SingletonMeta %0A%0Afrom . @@ -212,16 +212,41 @@ nalQueue +(metaclass=SingletonMeta) :%0A %22%22 @@ -471,16 +471,203 @@ terface. +%0A%0A NOTE: This class is a singleton (calling %60%60SignalQueue()%60%60 returns%0A the same instance). We mak...
fbcae346a308a4cf327ea5696cdc76f6c1d13e24
make it 1 jvm
py/testdir_single_jvm/test_rf_model_key_unique.py
py/testdir_single_jvm/test_rf_model_key_unique.py
import os, json, unittest, time, shutil, sys sys.path.extend(['.','..','py']) import h2o, h2o_cmd, h2o_hosts import argparse class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): localhost = h2o.decide_if_localhost() i...
Python
0.999549
@@ -356,17 +356,17 @@ d_cloud( -2 +1 )%0A @@ -541,53 +541,8 @@ f):%0A - SYNDATASETS_DIR = h2o.make_syn_dir()%0A @@ -600,16 +600,16 @@ 1,5,1):%0A + @@ -672,191 +672,8 @@ v')%0A - # key = h2o.nodes%5B0%5D.put_file(csvPathname)%0A # parseKey = h2o.nodes%5B0%5D.parse(...
8ab5d22170b80a086c7d05c3527532d1885554bb
Refactor createuser plugin
cloudbaseinit/plugins/freebsd/createuser.py
cloudbaseinit/plugins/freebsd/createuser.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Pellaeon Lin <pellaeon@hs.ntnu.edu.tw> # # 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...
Python
0
@@ -1535,17 +1535,8 @@ elf, - service, osu @@ -1546,363 +1546,8 @@ s):%0A - meta_data = service.get_meta_data('openstack')%0A meta = meta_data.get('meta')%0A%0A if CONF.inject_user_password and meta and 'admin_pass' in meta:%0A LOG.warn('Using admin_pass metadata user password. Consi...
ae1aee27d07e2972b84da40d808d027a6c460384
Implement own numpy.isclose function
scanpointgenerator/generators/concatgenerator.py
scanpointgenerator/generators/concatgenerator.py
from annotypes import Anno, deserialize_object, Array from scanpointgenerator.compat import np from scanpointgenerator.core import Generator, AAlternate with Anno("The array containing points"): AGenerator = Array[Generator] @Generator.register_subclass( "scanpointgenerator:generator/ConcatGenerator:1.0") cl...
Python
0.000588
@@ -406,16 +406,39 @@ ther %22%22%22 +%0A DIFF_LIMIT = 1e-05 %0A%0A de @@ -2795,18 +2795,15 @@ ert +( np. -isclose +abs (cur @@ -2812,17 +2812,18 @@ rray%5B-1%5D -, + - axis_ar @@ -2829,16 +2829,41 @@ rray%5B0%5D) + %3C self.DIFF_LIMIT).all() , %5C%0A
2344e5bdc2663bcc222376faba32a292ed3e686d
Update python 3 classifiers
{{cookiecutter.package_name}}/setup.py
{{cookiecutter.package_name}}/setup.py
import setuptools setuptools.setup( name="{{ cookiecutter.package_name }}", version="{{ cookiecutter.package_version }}", url="{{ cookiecutter.package_url }}", author="{{ cookiecutter.author_name }}", author_email="{{ cookiecutter.author_email }}", description="{{ cookiecutter.package_descrip...
Python
0
@@ -735,17 +735,17 @@ on :: 3. -3 +4 ',%0A %5D
87a008ec3951b1bae0a8e35287766c23a1d81b9d
Delete non-deterministic testEmpty() test (#10512)
tensorflow/python/kernel_tests/matrix_solve_op_test.py
tensorflow/python/kernel_tests/matrix_solve_op_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.000037
@@ -3759,182 +3759,8 @@ ()%0A%0A - def testEmpty(self):%0A with self.test_session():%0A self._verifySolve(np.empty(%5B0, 0%5D), np.empty(%5B0, 0%5D))%0A self._verifySolve(np.empty(%5B2, 2%5D), np.empty(%5B2, 0%5D))%0A%0A %0Aif
c6cc2f7bee87b5bdb1046f550ec5b6a7930003ee
version 1.1.7
cloudmesh_vagrant/version.py
cloudmesh_vagrant/version.py
__version__ = "1.1.6"
Python
0.000001
@@ -16,7 +16,7 @@ 1.1. -6 +7 %22%0A
9d523363c71800c04386aeb8cd5dda330322b4d5
Fix location of MPI_Comm type
src/python/tod/sim_det_atm.py
src/python/tod/sim_det_atm.py
# Copyright (c) 2015-2017 by the parties listed in the AUTHORS file. # All rights reserved. Use of this source code is governed by # a BSD-style license that can be found in the LICENSE file. from ..mpi import MPI import numpy as np import healpy as hp from .. import qarray as qa from .tod import TOD from ..op ...
Python
0.000002
@@ -209,16 +209,26 @@ port MPI +, MPI_Comm %0A%0Aimport @@ -366,18 +366,8 @@ rt ( -MPI_Comm, atm_
9d6627cfe276035a7936e785c6eea2c03422cd03
eliminate warning pycharm warning message
tests/integration_tests/test_model_training_options.py
tests/integration_tests/test_model_training_options.py
import os.path import json from collections import namedtuple import pandas as pd import numpy as np from sklearn.model_selection import train_test_split from sklearn.metrics import mean_squared_error import pytest from ludwig.experiment import full_experiment from ludwig.predict import full_predict GeneratedData =...
Python
0.999819
@@ -4295,24 +4295,28 @@ th.join( +str( tmp_path , 'data_ @@ -4307,16 +4307,17 @@ tmp_path +) , 'data_
b12c0e0f8706cac061d30854c3cab9586645d3aa
Update to latest stable release (#4543)
var/spack/repos/builtin/packages/fontconfig/package.py
var/spack/repos/builtin/packages/fontconfig/package.py
############################################################################## # Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
Python
0
@@ -1504,17 +1504,17 @@ ig-2.12. -1 +3 .tar.gz%22 @@ -1515,16 +1515,74 @@ ar.gz%22%0A%0A + version('2.12.3', 'aca0c734c1a38eb3ba12b2447dd90ab0')%0A vers
b5c931816099b8d9b738de9708c289c2541c3005
Add dependency (#21271)
var/spack/repos/builtin/packages/py-cheroot/package.py
var/spack/repos/builtin/packages/py-cheroot/package.py
# Copyright 2013-2021 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 PyCheroot(PythonPackage): """ Highly-optimized, pure-python HTTP server """ homepage...
Python
0
@@ -985,16 +985,93 @@ @:3.3')%0A + depends_on('py-jaraco-functools', when='@8.3.0:', type=('build', 'run'))%0A depe
b0bf2c4c99a3f2de5341eccb31bcab9bc299f85e
add version 2.0.1 to r-magrittr (#21085)
var/spack/repos/builtin/packages/r-magrittr/package.py
var/spack/repos/builtin/packages/r-magrittr/package.py
# Copyright 2013-2021 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 RMagrittr(RPackage): """Provides a mechanism for chaining commands with a new forward-pipe...
Python
0
@@ -247,16 +247,51 @@ %0A %22%22%22 +A Forward-Pipe Operator for R%0A%0A Provides @@ -821,16 +821,112 @@ rittr%22%0A%0A + version('2.0.1', sha256='75c265d51cc2b34beb27040edb09823c7b954d3990a7a931e40690b75d4aad5f')%0A vers
4e10b47eefac56bdcc91a79b00a3c23afd0f7bd8
Update Weather_Station.py
07_Weather_Station/Weather_Station/Weather_Station.py
07_Weather_Station/Weather_Station/Weather_Station.py
import MCP3202 import os from time import sleep try: while True: os.system("clear") value1= MCP3202.readADC(0) voltage = round(float(value1 * 5000 / 4096), 2) temperature = (voltage - 550) / 10 tampil = round(float(temperature), 2) print("Weather Station") print("Curent Temperature : ", tamp...
Python
0.000001
@@ -165,9 +165,9 @@ 409 -6 +5 ), 2 @@ -197,17 +197,17 @@ tage - 5 -5 +0 0) / 10%0D
692f2493378a2b6dafce14d05de9001ec70d1984
Change the paths I've got on my box
libravatar/settings.py
libravatar/settings.py
# Django settings for libravatar project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'libravatar.db' # Or pat...
Python
0
@@ -1391,32 +1391,39 @@ /francois/devel/ +remote/ libravatar/'%0A%0A# @@ -2737,16 +2737,23 @@ s/devel/ +remote/ libravat
c9456b870e867c1694c266cd8482913d2f10e16e
Clarify exception
microscopes/lda/runner.py
microscopes/lda/runner.py
"""Implements the Runner interface fo LDA """ from microscopes.common import validator from microscopes.common.rng import rng from microscopes.lda.definition import model_definition from microscopes.lda.kernels import lda_crp_gibbs from microscopes.lda.kernels import sample_gamma, sample_alpha, sample_beta def _vali...
Python
0.998671
@@ -4316,40 +4316,65 @@ -assert False, %22should not be reach%22 +raise ValueError(%22Bad kernel specification %7B%7D%22.format(name)) %0A
b6f2fdbc037aafca734bf88cf47261427cd99519
Add autospec
mkdocs/tests/cli_tests.py
mkdocs/tests/cli_tests.py
#!/usr/bin/env python # coding: utf-8 import unittest import mock from click.testing import CliRunner from mkdocs import cli class CLITests(unittest.TestCase): def setUp(self): self.runner = CliRunner() @mock.patch('mkdocs.serve.serve') def test_serve(self, mock_serve): result = self...
Python
0.000001
@@ -251,18 +251,33 @@ e.serve' +, autospec=True )%0A - def @@ -529,32 +529,47 @@ ocs.build.build' +, autospec=True )%0A def test_b @@ -815,32 +815,47 @@ ocs.build.build' +, autospec=True )%0A def test_b @@ -1128,16 +1128,31 @@ d.build' +, autospec=True )%0A de @@ -1408,16 +1408,31 @@ new.new' +,...
41cd071b02bcfe83941e35de7da73a9435eeb934
fix the pylint complain
scripts/monitoring/cron-send-project-operation.py
scripts/monitoring/cron-send-project-operation.py
#!/usr/bin/env python """ project creation and deletion check for v3 """ # We just want to see any exception that happens # don't want the script to die under any cicumstances # script must try to clean itself up # pylint: disable=broad-except # pylint: disable=invalid-name # pylint: disable=import-error import argpa...
Python
0.001138
@@ -3974,17 +3974,16 @@ heck the - %0A
6dc2646b048c95908a5b33590e1fcd75421045a9
Use percent if units are not present.
services/core/ForwardHistorian/forwarder/agent.py
services/core/ForwardHistorian/forwarder/agent.py
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # # Copyright (c) 2013, Battelle Memorial Institute # 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. Redistrib...
Python
0
@@ -5474,16 +5474,193 @@ %5B2:%5D))%0A%0A + if not 'units' in meta.keys():%0A #print('unit for topic %7B%7D is now %7B%7D'.format(topic, 'percent'))%0A meta%5B'units'%5D = 'percent'%0A%0A
766e870b488bf4c66bb971fbb2983045a1b538eb
Create direct invoice
mexal_ddt/wizard/ddt_create_direct_invoice.py
mexal_ddt/wizard/ddt_create_direct_invoice.py
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2014 Abstract (http://www.abstract.it) # Copyright (C) 2014 Agile Business Group (http://www.agilebg.com) # # This program is free software: you can redistribute it and/or modify # it und...
Python
0.00001
@@ -4049,16 +4049,24 @@ cking'%5D%0A + %0A @@ -4097,16 +4097,108 @@ .browse( +%0A self.env.cr, self.env.uid, self.env.context%5B'active_ids'%5D,%0A context= self.env @@ -4205,30 +4205,16 @@ .context -%5B'active_ids'%5D )%0A @@ -4389,31 +4389,8 @@ %22))%0A - #pick...
a7c0482b94f212a09d93368c126c0af37ebebba1
replace force_text to support django 3
modeltranslation/utils.py
modeltranslation/utils.py
# -*- coding: utf-8 -*- from contextlib import contextmanager import six from django.utils.encoding import force_text from django.utils.translation import get_language as _get_language from django.utils.translation import get_language_info from django.utils.functional import lazy from modeltranslation import settings...
Python
0.000133
@@ -107,20 +107,19 @@ t force_ -text +str %0Afrom dj @@ -1575,20 +1575,19 @@ n force_ -text +str ('%25s %5B%25s @@ -1599,20 +1599,19 @@ (force_ -text +str (verbose
d838afa824fa6b626ba87e5b4eabe1e95c960016
Bump version
lintreview/__init__.py
lintreview/__init__.py
__version__ = '2.22.0'
Python
0
@@ -11,13 +11,13 @@ _ = '2.2 -2 +3 .0'%0A
7ce972e7155fd0e0aaf7352656c0805d9a2afad5
fix 'error E275 missing whitespace after keyword'
module_utils/ca_common.py
module_utils/ca_common.py
import os import datetime def generate_ceph_cmd(sub_cmd, args, user_key=None, cluster='ceph', user='client.admin', container_image=None, interactive=False): ''' Generate 'ceph' command line to execute ''' if not user_key: user_key = '/etc/ceph/{}.{}.keyring'.format(cluster, user) cmd = p...
Python
0.000012
@@ -2665,17 +2665,17 @@ raise -( + Exceptio @@ -2684,10 +2684,9 @@ message) -) %0A
f8d507cb7d439b8451a6633d46ab02df7858297f
Update ipc_lista1.5.py
lista1/ipc_lista1.5.py
lista1/ipc_lista1.5.py
#ipc_lista1.5 #Professor: Jucimar Junior #Any Mendes Carvalho - 1615310044 # # # # #Faça um programa que converta metros para centímetros. metros = input("Digite o valor em metros que deseja converter em centímetros: ") centimetros = metros * 100 print "Esse valor equivale a: %d" %centime
Python
0
@@ -284,9 +284,13 @@ %25centime +tros %0A
6ed3c705e8e89d1a69d7930271d6e1144d28722a
Update ipc_lista2.7.py
lista2/ipc_lista2.7.py
lista2/ipc_lista2.7.py
# # Ana Beatriz Faria Frota - 1615310027 # Mateus Mota de Souza - 1615310016 # Matheus Henrique Araujo Batista - 1615310039 # Nahan Trindade Passos - 1615310021 # Victor Hugo Souza Correia - 1615310024 # n1 = int(input("Insira um número: ")) n2 = int(input("Insira outro número: ")) n3 = int(input("Insira mai...
Python
0
@@ -1,8 +1,25 @@ +#EQUIPE 2%0D%0A#%0D%0A#%0D%0A #%0D%0A# Ana @@ -59,169 +59,42 @@ %0D%0A# -Mateus Mota de Souza - 1615310016%0D%0A# Matheus Henrique Araujo Batista - 1615310039%0D%0A# Nahan Trindade Passos - 1615310021%0D%0A# Victor Hugo Souza Correia - 1615310024 +Nahan Trindade Passos - 1615310021 %0D%0A#%0D
f116d42a539d2e9ba473ab425c03e93aee80cec1
add search fields to reported cases view
malaria24/ona/admin.py
malaria24/ona/admin.py
from datetime import timedelta from django import forms from django.contrib import admin, messages from django.conf.urls import url from django.http import HttpResponse from django.shortcuts import redirect from django.template.response import TemplateResponse from django.utils.translation import ugettext_lazy as _ fr...
Python
0
@@ -2121,16 +2121,95 @@ tFilter) +%0A search_fields = ('case_number', 'first_name', 'last_name', 'sa_id_number') %0A%0A de
6cf4367485ae79e7dcd19733cbec4ec7c844d624
test to new style
tests/chainer_tests/distributions_tests/test_multivariate_normal.py
tests/chainer_tests/distributions_tests/test_multivariate_normal.py
from chainer import distributions from chainer import testing import numpy @testing.parameterize(*testing.product({ 'shape': [(3, 2), (1,)], 'is_variable': [True, False], 'sample_shape': [(3, 2), ()], })) @testing.fix_random() @testing.with_requires('scipy') class TestMultivariateNormal(testing.distributi...
Python
0.000003
@@ -336,74 +336,61 @@ -def setUp(self):%0A testing.distribution_unittest.setUp +scipy_onebyone = True%0A%0A def setUp_configure (self) +: %0A @@ -719,35 +719,8 @@ %5D)%0A%0A - def params_init(self):%0A
3a5be9612ccb5cf51459f61d72f13375565eadef
Fix tests
nodeconductor/openstack/tests/test_backups.py
nodeconductor/openstack/tests/test_backups.py
from __future__ import unicode_literals from rest_framework import status from rest_framework import test from nodeconductor.core.tests import helpers from nodeconductor.openstack import models from nodeconductor.openstack.tests import factories from nodeconductor.structure import models as structure_models from node...
Python
0
@@ -2254,104 +2254,8 @@ )),%0A - 'image': factories.ImageFactory.get_url(factories.ImageFactory(settings=settings)),%0A