hash
stringlengths
40
40
diff
stringlengths
131
26.7k
message
stringlengths
7
694
project
stringlengths
5
67
split
stringclasses
1 value
diff_languages
stringlengths
2
24
b9635e2792c557dc33376dbd40ca78a51d7a29fc
diff --git a/executor/explain_test.go b/executor/explain_test.go index <HASH>..<HASH> 100644 --- a/executor/explain_test.go +++ b/executor/explain_test.go @@ -20,6 +20,7 @@ import ( "strings" "testing" + "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/parser/auth" plannercore "github.com/pingcap/tidb/planner/core" "github.com/pingcap/tidb/session" @@ -296,6 +297,10 @@ func checkActRows(t *testing.T, tk *testkit.TestKit, sql string, expected []stri } func TestCheckActRowsWithUnistore(t *testing.T) { + defer config.RestoreFunc()() + config.UpdateGlobal(func(conf *config.Config) { + conf.EnableCollectExecutionInfo = true + }) store, clean := testkit.CreateMockStore(t) defer clean() // testSuite1 use default mockstore which is unistore
executor: fix unstable TestCheckActRowsWithUnistore (#<I>) close pingcap/tidb#<I>
pingcap_tidb
train
go
47dc8a906cf74fb15e65f4ec81d2725a512aec5c
diff --git a/spec/views/hyrax/base/_form_share.erb_spec.rb b/spec/views/hyrax/base/_form_share.erb_spec.rb index <HASH>..<HASH> 100644 --- a/spec/views/hyrax/base/_form_share.erb_spec.rb +++ b/spec/views/hyrax/base/_form_share.erb_spec.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true RSpec.describe 'hyrax/base/_form_share.html.erb', type: :view do - let(:ability) { double } + let(:ability) { instance_double(Ability, admin?: false, user_groups: [], current_user: user) } + let(:user) { stub_model(User) } let(:work) { GenericWork.new } let(:form) do Hyrax::GenericWorkForm.new(work, ability, controller) @@ -24,10 +25,8 @@ RSpec.describe 'hyrax/base/_form_share.html.erb', type: :view do end before do - user = stub_model(User) allow(view).to receive(:current_ability).and_return(ability) allow(view).to receive(:current_user).and_return(user) - allow(ability).to receive(:admin?).and_return(false) allow(view).to receive(:action_name).and_return('new') end
Fixing spec to account for upstream changes The previous commit (fde<I>eeb<I>cb8ed<I>ed<I>f<I>c5da3f<I>ef) was worked on over a year ago, and recently re-opened and rebased against the main branch. In that time, aspects of the implementation have changed.
samvera_hyrax
train
rb
c6f8b5e192daeceef7794f79af52e9e9388e3684
diff --git a/src/drawer.js b/src/drawer.js index <HASH>..<HASH> 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -228,8 +228,7 @@ $.Drawer.prototype = { } if( this.viewer ){ this.viewer.raiseEvent( 'clear-overlay', { - viewer: this.viewer, - element: element + viewer: this.viewer }); } return this; @@ -583,8 +582,8 @@ function updateLevel( drawer, haveDrawn, level, levelOpacity, levelVisibility, v level: level, opacity: levelOpacity, visibility: levelVisibility, - topleft: viewportTopLeft, - bottomright: viewportBottomRight, + topleft: viewportTL, + bottomright: viewportBR, currenttime: currentTime, best: best });
Fixed broken viewer.raiseEvent calls in drawer.js
openseadragon_openseadragon
train
js
ff05458b070e4463865dce331c2759b2c51b1fdc
diff --git a/holoviews/operation/element.py b/holoviews/operation/element.py index <HASH>..<HASH> 100644 --- a/holoviews/operation/element.py +++ b/holoviews/operation/element.py @@ -316,8 +316,12 @@ class gradient(ElementOperation): dx = np.diff(data, 1, axis=1)[0:r-1, 0:c-1] dy = np.diff(data, 1, axis=0)[0:r-1, 0:c-1] + if matrix_dim.cyclic and (None in matrix_dim.range): + raise Exception("Cyclic range must be specified to compute " + "the gradient of cyclic quantities") cyclic_range = None if not matrix_dim.cyclic else np.diff(matrix_dim.range) if cyclic_range is not None: # Wrap into the specified range + raise NotImplementedError("Cyclic ranges are not supported currently") # shift values such that wrapping works ok dx += matrix_dim.range[0] dy += matrix_dim.range[0]
More checks on cyclic ranges, but still not supported in gradient
pyviz_holoviews
train
py
c1fad2de07432619ced095ad15e1c3b7490ea7c2
diff --git a/ee/src/main/java/org/jboss/as/ee/structure/EJBClientDescriptor10Parser.java b/ee/src/main/java/org/jboss/as/ee/structure/EJBClientDescriptor10Parser.java index <HASH>..<HASH> 100644 --- a/ee/src/main/java/org/jboss/as/ee/structure/EJBClientDescriptor10Parser.java +++ b/ee/src/main/java/org/jboss/as/ee/structure/EJBClientDescriptor10Parser.java @@ -246,6 +246,11 @@ class EJBClientDescriptor10Parser implements XMLElementReader<EJBClientDescripto if (!required.isEmpty()) { missingAttributes(reader.getLocation(), required); } + // This element is just composed of attributes which we already processed, so no more content + // is expected + if (reader.hasNext() && reader.nextTag() != END_ELEMENT) { + unexpectedContent(reader); + } } private static void unexpectedEndOfDocument(final Location location) throws XMLStreamException {
fix parse fail when jboss-ejb-client.xml has multiple remote-ejb-receiver element
wildfly_wildfly
train
java
19a8575282bb16ee96e1406b8f82ad00d0212dac
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,7 @@ setup( 'requests' ], extras_require={ - 'test': ['tox', 'pytest', 'flake8', 'responses', 'mock'], + 'test': ['tox', 'pytest', 'flake8', 'responses'], 'doc': ['Sphinx==1.4.6', 'sphinx-rtd-theme==0.1.9', 'sphinxcontrib-napoleon==0.5.3'], } ) diff --git a/test/client_test.py b/test/client_test.py index <HASH>..<HASH> 100644 --- a/test/client_test.py +++ b/test/client_test.py @@ -1,7 +1,6 @@ import pytest import responses import json -from mock import MagicMock from matrix_client.client import MatrixClient, Room, User from matrix_client.api import MATRIX_V2_API_PATH
Remove unneeded test dependency on mock package
matrix-org_matrix-python-sdk
train
py,py
e0acdf234c32cb977e0cd2b2a788fa1b023d7008
diff --git a/lib/qyu/store/base.rb b/lib/qyu/store/base.rb index <HASH>..<HASH> 100644 --- a/lib/qyu/store/base.rb +++ b/lib/qyu/store/base.rb @@ -94,6 +94,10 @@ module Qyu fail Qyu::Errors::NotImplementedError end + def task_status_counts(_job_id) + fail Qyu::Errors::NotImplementedError + end + def select_tasks_by_job_id fail Qyu::Errors::NotImplementedError end
Add task_status_counts to store interface
QyuTeam_qyu
train
rb
ffb36428f33c405859ec666e5e3aba1ca0c6aaef
diff --git a/src/plugins/Transloadit/index.js b/src/plugins/Transloadit/index.js index <HASH>..<HASH> 100644 --- a/src/plugins/Transloadit/index.js +++ b/src/plugins/Transloadit/index.js @@ -282,6 +282,10 @@ module.exports = class Transloadit extends Plugin { // A file ID that is part of this assembly... const fileID = fileIDs[0] + if (!fileID) { + return Promise.resolve() + } + // If we don't have to wait for encoding metadata or results, we can close // the socket immediately and finish the upload. if (!this.shouldWait()) { diff --git a/test/unit/Transloadit.spec.js b/test/unit/Transloadit.spec.js index <HASH>..<HASH> 100644 --- a/test/unit/Transloadit.spec.js +++ b/test/unit/Transloadit.spec.js @@ -149,3 +149,19 @@ test('Transloadit: Should merge files with same parameters into one assembly', ( }) }, t.fail) }) + +test('Does not create an assembly if no files are being uploaded', (t) => { + t.plan(0) + + const uppy = new Core() + uppy.use(Transloadit, { + getAssemblyOptions () { + t.fail('should not create assembly') + } + }) + uppy.run() + + uppy.upload().then(() => { + t.end() + }).catch(t.fail) +})
transloadit: Fix crash when no files are being uploaded
transloadit_uppy
train
js,js
800d6739214b66d6ec0cc9918bb8cb0cba0b8d96
diff --git a/faker/providers/misc/__init__.py b/faker/providers/misc/__init__.py index <HASH>..<HASH> 100644 --- a/faker/providers/misc/__init__.py +++ b/faker/providers/misc/__init__.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import hashlib import random import string +import uuid from faker.providers.date_time import Provider as DatetimeProvider @@ -70,6 +71,13 @@ class Provider(BaseProvider): return cls.random_element(cls.language_codes) @classmethod + def uuid4(cls): + """ + Generates a random UUID4 string. + """ + return str(uuid.uuid4()) + + @classmethod def password(cls, length=10, special_chars=True, digits=True, upper_case=True, lower_case=True): """ Generates a random password.
Adds uuid support
joke2k_faker
train
py
5cd2e19361137e5a4a2c9dfa9bb1b54a37a7ffd9
diff --git a/src/_parsers.py b/src/_parsers.py index <HASH>..<HASH> 100644 --- a/src/_parsers.py +++ b/src/_parsers.py @@ -376,7 +376,8 @@ def _is_allowed(input): '--export', '--export-secret-keys', '--export-secret-subkeys', - '--fingerprint',]) + '--fingerprint', + ]) ## check that allowed is a subset of possible try:
Minor and unnecessary obsessive compulsive code formatting change.
isislovecruft_python-gnupg
train
py
0d5927d81231476c18f9fdf29df60843d0996cfe
diff --git a/framework/core/js/lib/components/badge.js b/framework/core/js/lib/components/badge.js index <HASH>..<HASH> 100644 --- a/framework/core/js/lib/components/badge.js +++ b/framework/core/js/lib/components/badge.js @@ -6,10 +6,12 @@ export default class Badge extends Component { var iconName = this.props.icon; var label = this.props.title = this.props.label; delete this.props.icon, this.props.label; - this.props.config = function(element) { + this.props.config = function(element, isInitialized) { + if (isInitialized) return; $(element).tooltip(); }; this.props.className = 'badge '+(this.props.className || ''); + this.props.key = this.props.className; return m('span', this.props, [ icon(iconName+' icon-glyph'),
Prevent incorrect badge redraw diffing
flarum_core
train
js
60f34fd7ef08e507e765c6df3fa1664b22e851e6
diff --git a/actionpack/test/controller/force_ssl_test.rb b/actionpack/test/controller/force_ssl_test.rb index <HASH>..<HASH> 100644 --- a/actionpack/test/controller/force_ssl_test.rb +++ b/actionpack/test/controller/force_ssl_test.rb @@ -229,14 +229,12 @@ class ForceSSLFlashTest < ActionController::TestCase assert_response 302 assert_equal "http://test.host/force_ssl_flash/cheeseburger", redirect_to_url - # FIXME: AC::TestCase#build_request_uri doesn't build a new uri if PATH_INFO exists @request.env.delete("PATH_INFO") get :cheeseburger assert_response 301 assert_equal "https://test.host/force_ssl_flash/cheeseburger", redirect_to_url - # FIXME: AC::TestCase#build_request_uri doesn't build a new uri if PATH_INFO exists @request.env.delete("PATH_INFO") get :use_flash
Remove unneeded FIXME note This is the intended behavior. You should not do more than one request in a controller test.
rails_rails
train
rb
d498487794a6807fe26abf7e7716c853ebd2d900
diff --git a/spec/lib/compiler_spec.rb b/spec/lib/compiler_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/compiler_spec.rb +++ b/spec/lib/compiler_spec.rb @@ -44,7 +44,7 @@ describe Opal::Compiler do end it 'adds method missing stubs with operators' do - expect_compiled("class Foo; end; Foo.new > 5").to include("Opal.add_stubs(['$new', '$>'])") + expect_compiled("class Foo; end; Foo.new > 5").to include("Opal.add_stubs(['$>', '$new'])") end it "should compile constant lookups" do
Reverse test order since impl was done in different order than original PR
opal_opal
train
rb
58f265fc1611427d51e3840d6291d788f93f12be
diff --git a/panels/_version.py b/panels/_version.py index <HASH>..<HASH> 100644 --- a/panels/_version.py +++ b/panels/_version.py @@ -1,2 +1,2 @@ # Versions compliant with PEP 440 https://www.python.org/dev/peps/pep-0440 -__version__ = "0.0.37" +__version__ = "0.0.38"
Update version number to <I>
chaoss_grimoirelab-sigils
train
py
41eb8d0ffc4cbdb8b46354bdce990e8769daaca5
diff --git a/src/Entity/Status/StatusAwareEntityInterface.php b/src/Entity/Status/StatusAwareEntityInterface.php index <HASH>..<HASH> 100644 --- a/src/Entity/Status/StatusAwareEntityInterface.php +++ b/src/Entity/Status/StatusAwareEntityInterface.php @@ -6,7 +6,7 @@ * @license MIT * @copyright 2013 - 2017 Cross Solution <http://cross-solution.de> */ - + /** */ namespace Core\Entity\Status; @@ -19,13 +19,6 @@ namespace Core\Entity\Status; interface StatusAwareEntityInterface { /** - * FQCN of the concrete status entity for this entity. - * - * @var string - */ - const STATUS_ENTITY_CLASS = StatusInterface::class; - - /** * Set the state of this entity. * * * If a string is passed, {@łink STATUS_ENTITY_CLASS} is used
fix(Core): StatusAwareEntityInterface must not define constant. in PHP constants defined in interfaces cannot be overridden by implementing classes. This behaviour is essential to the function of the StatusAwareEntityTrait however.
yawik_core
train
php
ab1058ebeaec4bd6389acdd177cff7c35e90c96b
diff --git a/plugin/Storagebox/AccessMethods/Methods/SFTP/SFTPConnection.php b/plugin/Storagebox/AccessMethods/Methods/SFTP/SFTPConnection.php index <HASH>..<HASH> 100644 --- a/plugin/Storagebox/AccessMethods/Methods/SFTP/SFTPConnection.php +++ b/plugin/Storagebox/AccessMethods/Methods/SFTP/SFTPConnection.php @@ -71,10 +71,10 @@ class SFTPConnection { public function receiveFile($remote_file) { $sftp = $this->sftp; - $stream = @fopen("ssh2.sftp://$sftp$remote_file", 'r'); + $stream = @fopen("ssh2.sftp://".intval($sftp)."$remote_file", 'r'); if (! $stream) throw new Exception("Could not open file: $remote_file"); - $contents = fread($stream, filesize("ssh2.sftp://$sftp$remote_file")); + $contents = fread($stream, filesize("ssh2.sftp://".intval($sftp)."$remote_file")); @fclose($stream); return $contents; }
added intval to sftpconnection
ipunkt_rancherize-backup-storagebox
train
php
1ee9472bca672a14512e6866e53edbaee5250dbd
diff --git a/src/Lavary/Menu/Builder.php b/src/Lavary/Menu/Builder.php index <HASH>..<HASH> 100644 --- a/src/Lavary/Menu/Builder.php +++ b/src/Lavary/Menu/Builder.php @@ -466,7 +466,7 @@ class Builder public function sortBy($sort_by, $sort_type = 'asc') { if (is_callable($sort_by)) { - $rslt = call_user_func($sort_by, $this->items->to[]); + $rslt = call_user_func($sort_by, $this->items->toArray()); if (!is_array($rslt)) { $rslt = array($rslt);
Fix bug introduced by docblock cleanup Docblock cleanup c9be1d2e<I>cde4c<I>c<I>d<I> introduced a bug when converting `toArray()` to `to[]`
lavary_laravel-menu
train
php
3c0e1163c7afcc42fdcbbf22dd61ac869a6857ee
diff --git a/redis/client.py b/redis/client.py index <HASH>..<HASH> 100755 --- a/redis/client.py +++ b/redis/client.py @@ -2892,9 +2892,18 @@ class Redis: the existing score will be incremented by. When using this mode the return value of ZADD will be the new score of the element. + ``LT`` Only update existing elements if the new score is less than + the current score. This flag doesn't prevent adding new elements. + + ``GT`` Only update existing elements if the new score is greater than + the current score. This flag doesn't prevent adding new elements. + The return value of ZADD varies based on the mode specified. With no options, ZADD returns the number of new elements added to the sorted set. + + ``NX``, ``LT``, and ``GT`` are mutually exclusive options. + See: https://redis.io/commands/ZADD """ if not mapping: raise DataError("ZADD requires at least one element/score pair") @@ -2904,7 +2913,9 @@ class Redis: raise DataError("ZADD option 'incr' only works when passing a " "single element/score pair") if nx is True and (gt is not None or lt is not None): - raise DataError("Only one of 'nx', 'lt', or 'gr' may be defined.") + raise DataError("Only one of 'nx', 'lt', or 'gt' may be defined.") + if gt is not None and lt is not None: + raise DataError("Only one of 'gt' or 'lt' can be set.") pieces = [] options = {}
exclusive gt and lt in zadd (#<I>) * exclusive gt and lt in zadd * docs update
andymccurdy_redis-py
train
py
ce3e162a951812858b25557aeed37bd8666e02d1
diff --git a/consume.js b/consume.js index <HASH>..<HASH> 100644 --- a/consume.js +++ b/consume.js @@ -1,9 +1,10 @@ module.exports = consume; -// conusme( (Error) => void, (T) => void ) => Callback<T> +// conusme( (Error) => Any, (T) => Any ) => (Error, T) => Any function consume(onError, onData) { return function(err, val) { - if (err) return onError(err) - else return onData(val) + return err + ? onError(err) + : onData(val) } }
Stylechange, makes it more clear that returned function always returns something.
pirfalt_consume
train
js
07b2b211829ddf99611fd184e90de1719f650625
diff --git a/Lib/fontbakery/specifications/googlefonts.py b/Lib/fontbakery/specifications/googlefonts.py index <HASH>..<HASH> 100644 --- a/Lib/fontbakery/specifications/googlefonts.py +++ b/Lib/fontbakery/specifications/googlefonts.py @@ -2463,6 +2463,8 @@ def check_nonligated_sequences_kerning_info(ttFont, ligatures, has_kerning_info) for pairpos in table.SubTable: for i, glyph in enumerate(pairpos.Coverage.glyphs): if glyph in ligatures.keys(): + if not hasattr(pairpos, 'PairSet'): + continue for pairvalue in pairpos.PairSet[i].PairValueRecord: if pairvalue.SecondGlyph in ligatures[glyph]: del remaining[glyph]
[check-googlefonts] don't ERROR when 'PairPos' attribute is not present.
googlefonts_fontbakery
train
py
ee9fb63dbb67e88d9698f3c64192b412526f2db3
diff --git a/src/basis.js b/src/basis.js index <HASH>..<HASH> 100644 --- a/src/basis.js +++ b/src/basis.js @@ -2522,7 +2522,10 @@ // if resource exists and resolved -> apply patch var resource = getResource.get(filename); if (resource && resource.isResolved()) + { + /** @cut */ consoleMethods.info('Apply patch for ' + resource.url); patchFn(resource.get(), resource.url); + } }
core: fix basis.patch to notify when patch apply to resolved resource
basisjs_basisjs
train
js
2a71cca13c275b18b08547ce3703d9780ce253a7
diff --git a/test/test_hexahedron.py b/test/test_hexahedron.py index <HASH>..<HASH> 100644 --- a/test/test_hexahedron.py +++ b/test/test_hexahedron.py @@ -56,7 +56,7 @@ def test_normality(n=4): def test_write(): orthopy.hexahedron.write( - "hexa.vtu", lambda X: orthopy.hexahedron.tree(X.T, 5)[5][5] + "hexa.vtk", lambda X: orthopy.hexahedron.tree(X.T, 5)[5][5] ) return diff --git a/test/test_sphere_sph.py b/test/test_sphere_sph.py index <HASH>..<HASH> 100644 --- a/test/test_sphere_sph.py +++ b/test/test_sphere_sph.py @@ -163,7 +163,7 @@ def test_write(): out = abs(out) return out - orthopy.sphere.write("sph.vtu", sph22) + orthopy.sphere.write("sph.vtk", sph22) return
test: vtu -> vtk
nschloe_orthopy
train
py,py
5427d334c3d2055850c93e67ebd09059519b15c8
diff --git a/lib/classes/module/console/checkExtension.class.php b/lib/classes/module/console/checkExtension.class.php index <HASH>..<HASH> 100644 --- a/lib/classes/module/console/checkExtension.class.php +++ b/lib/classes/module/console/checkExtension.class.php @@ -44,7 +44,7 @@ class module_console_checkExtension extends Command if (!extension_loaded('phrasea2')) printf("Missing Extension php-phrasea"); - $appbox = \appbox::get_instance(); + $appbox = \appbox::get_instance(\bootstrap::getCore()); $registry = $appbox->get_registry(); $usr_id = $input->getOption('usr_id'); diff --git a/lib/classes/module/console/systemExport.class.php b/lib/classes/module/console/systemExport.class.php index <HASH>..<HASH> 100644 --- a/lib/classes/module/console/systemExport.class.php +++ b/lib/classes/module/console/systemExport.class.php @@ -139,7 +139,7 @@ class module_console_systemExport extends Command $output->writeln("Export datas from selected base_ids"); } - $appbox = \appbox::get_instance(); + $appbox = \appbox::get_instance(\bootstrap::getCore()); $total = $errors = 0;
Fix tasks for <I>+
alchemy-fr_Phraseanet
train
php,php
a1d93f92cd9e8d37ffca11466408557414aae559
diff --git a/core/dbt/context/parser.py b/core/dbt/context/parser.py index <HASH>..<HASH> 100644 --- a/core/dbt/context/parser.py +++ b/core/dbt/context/parser.py @@ -111,14 +111,13 @@ class SourceResolver(dbt.context.common.BaseResolver): def __call__(self, *args): # When you call source(), this is what happens at parse time if len(args) == 2: - source_name = args[0] - table_name = args[1] + self.model.sources.append(list(args)) + else: dbt.exceptions.raise_compiler_error( - "Source requires exactly two arguments", + "source() takes at exactly two arguments ({} given)".format(len(args)), self.model) - self.model.sources.append([source_name, table_name]) return self.Relation.create_from(self.config, self.model)
refactor to make more similar to RefResolver
fishtown-analytics_dbt
train
py
da9f88ece7048a68535ba6f97889f98f4274e8a3
diff --git a/packer/rpc/muxconn.go b/packer/rpc/muxconn.go index <HASH>..<HASH> 100644 --- a/packer/rpc/muxconn.go +++ b/packer/rpc/muxconn.go @@ -300,10 +300,14 @@ func (m *MuxConn) loop() { case streamStateFinWait2: stream.remoteClose() - // Remove this stream from being active so that it - // can be re-used m.mu.Lock() delete(m.streams, stream.id) + + // Make sure we attempt to use the next biggest stream ID + if stream.id >= m.curId { + m.curId = stream.id + 1 + } + m.mu.Unlock() default: log.Printf("[ERR] Fin received for stream %d in state: %d", id, stream.state)
packer/rpc: make sure curID in MuxConn is highest [GH-<I>]
hashicorp_packer
train
go
c14fd7f75542c8d281664dc13ed38a819bf2e95a
diff --git a/slave/signal_recovery/sr7230.py b/slave/signal_recovery/sr7230.py index <HASH>..<HASH> 100644 --- a/slave/signal_recovery/sr7230.py +++ b/slave/signal_recovery/sr7230.py @@ -439,6 +439,17 @@ class SR7230(Driver): '500 fA', '1 pA', '2 pA', '5 pA', '10 pA', '20 pA', '50 pA', '100 pA', '200 pA', '500 pA', '1 nA', '2 nA', '5 nA', '10 nA' ] + + @property + def SENSITIVITY(self): + imode = self.current_mode + if imode == 'off': + return self.SENSITIVITY_VOLTAGE + elif imode == 'high bandwidth': + return self.SENSITIVITY_CURRENT_HIGHBW + else: + return self.SENSITIVITY_CURRENT_LOWNOISE + AC_GAIN = [ '0 dB', '6 dB', '12 dB', '18 dB', '24 dB', '30 dB', '36 dB', '42 dB', '48 dB', '54 dB', '60 dB', '66 dB', '72 dB', '78 dB', '84 dB', '90 dB'
Added SENSITIVITY property to `SR<I>` driver, returning the appropriate sensitivity ranges.
p3trus_slave
train
py
d4224b926c093e7e8716f04fbff8844646857dfc
diff --git a/mldb/index.py b/mldb/index.py index <HASH>..<HASH> 100644 --- a/mldb/index.py +++ b/mldb/index.py @@ -4,7 +4,7 @@ # @Email: atremblay@datacratic.com # @Date: 2015-03-19 10:28:23 # @Last Modified by: Alexis Tremblay -# @Last Modified time: 2015-04-09 13:31:45 +# @Last Modified time: 2015-04-09 14:44:44 # @File Name: index.py from mldb.query import Query @@ -42,5 +42,13 @@ class Index(object): copy_bf = self._bf.copy() copy_bf.query.addWHERE("rowName()='{}'".format(val)) return copy_bf + elif isinstance(val, list): + copy_bf = self._bf.copy() + where = [] + for v in val: + where.append("rowName()='{}'".format(v)) + + copy_bf.query.addWHERE("({})".format(" OR ".join(where))) + return copy_bf else: raise NotImplementedError()
Supporting list in the ix method
datacratic_pymldb
train
py
a36c1c9c118ab3611e705c293006de08d0a61bab
diff --git a/Zebra_Image.php b/Zebra_Image.php index <HASH>..<HASH> 100644 --- a/Zebra_Image.php +++ b/Zebra_Image.php @@ -707,16 +707,16 @@ class Zebra_Image { * * When set to -1 the script will preserve transparency for transparent GIF * and PNG images. For non-transparent images the background will be white - * in this case. + * (#FFFFFF) in this case. * - * Default is #FFFFFF. + * Default is -1 * * @return boolean Returns TRUE on success or FALSE on error. * * If FALSE is returned, check the {@link error} property to see what went * wrong */ - public function resize($width = 0, $height = 0, $method = ZEBRA_IMAGE_CROP_CENTER, $background_color = '#FFFFFF') { + public function resize($width = 0, $height = 0, $method = ZEBRA_IMAGE_CROP_CENTER, $background_color = -1) { // if image resource was successfully created if ($this->_create_from_source()) {
The default value of the "background_color" argument of the "resize" method is now -1
stefangabos_Zebra_Image
train
php
be28ad7d1496ad5e9f94234ee152ef8e853c07cd
diff --git a/examples/basic/buildmesh.py b/examples/basic/buildmesh.py index <HASH>..<HASH> 100644 --- a/examples/basic/buildmesh.py +++ b/examples/basic/buildmesh.py @@ -15,4 +15,4 @@ a.backColor('violet').lineColor('black').lineWidth(1) print('getCells() format is :', a.getCells()) print('getConnectivity() format is:', a.getConnectivity()) -show(a, Text(__doc__), viewup='z', axes=8) \ No newline at end of file +show(a, Text(__doc__), viewup='z', axes=8)
Removed trailing spaces in examples/basic/buildmesh.py
marcomusy_vtkplotter
train
py
1b6200337dfbd3190c33f1c52dd36e8c55e12109
diff --git a/lib/nydp.rb b/lib/nydp.rb index <HASH>..<HASH> 100644 --- a/lib/nydp.rb +++ b/lib/nydp.rb @@ -19,6 +19,7 @@ module Nydp ns = { } setup(ns) loadall ns, loadfiles + loadall ns, testfiles loadall ns, extra_files if extra_files ns end @@ -47,7 +48,7 @@ module Nydp verbose = options.include?(:verbose) ? "t" : "nil" puts "welcome to nydp : running tests" reader = Nydp::StringReader.new "(run-all-tests #{verbose})" - Nydp::Runner.new(VM.new, build_nydp(testfiles), reader).run + Nydp::Runner.new(VM.new, build_nydp, reader).run end end
testing: always load testfiles, so examples are available for inspection at all times
conanite_nydp
train
rb
beb2e4aae324cd89038aabf9718c01a3607bc1a1
diff --git a/graphene_django/utils/testing.py b/graphene_django/utils/testing.py index <HASH>..<HASH> 100644 --- a/graphene_django/utils/testing.py +++ b/graphene_django/utils/testing.py @@ -28,7 +28,9 @@ def graphql_query( variables (dict) - If provided, the "variables" field in GraphQL will be set to this value. headers (dict) - If provided, the headers in POST request to GRAPHQL_URL - will be set to this value. + will be set to this value. Keys should be prepended with + "HTTP_" (e.g. to specify the "Authorization" HTTP header, + use "HTTP_AUTHORIZATION" as the key). client (django.test.Client) - Test client. Defaults to django.test.Client. graphql_url (string) - URL to graphql endpoint. Defaults to "/graphql". @@ -85,7 +87,9 @@ class GraphQLTestCase(TestCase): variables (dict) - If provided, the "variables" field in GraphQL will be set to this value. headers (dict) - If provided, the headers in POST request to GRAPHQL_URL - will be set to this value. + will be set to this value. Keys should be prepended with + "HTTP_" (e.g. to specify the "Authorization" HTTP header, + use "HTTP_AUTHORIZATION" as the key). Returns: Response object from client
Doc clarification for headers arg in testing utils (#<I>) I think it might be helpful to add an explicit hint that HTTP headers should be prepended with `HTTP_` as required by `django.test.Client` (at least it was not super obvious to me when I tried to use it).
graphql-python_graphene-django
train
py
a89e01b8c826a37a8df8df5645f6086028045315
diff --git a/src/js/components/Select/Select.js b/src/js/components/Select/Select.js index <HASH>..<HASH> 100644 --- a/src/js/components/Select/Select.js +++ b/src/js/components/Select/Select.js @@ -83,7 +83,7 @@ const Select = forwardRef( const inputRef = useRef(); const formContext = useContext(FormContext); - const [value] = formContext.useFormContext(name, valueProp); + const [value, setValue] = formContext.useFormContext(name, valueProp); const [open, setOpen] = useState(propOpen); useEffect(() => { @@ -106,6 +106,7 @@ const Select = forwardRef( const onSelectChange = (event, ...args) => { if (closeOnChange) onRequestClose(); + setValue(event.value); if (onChange) onChange({ ...event, target: inputRef.current }, ...args); };
fix: select dropdown entry when the input isnt controlled (#<I>) In <I>, when using a select without passing value as a prop, selecting a dropdown entry won't update the Select component to have that entry selected. This sets the value using `setValue` from the `useFormContext` hook.
grommet_grommet
train
js
a97b296f90530b629e550d304ef9a6cb08282764
diff --git a/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/Call.java b/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/Call.java index <HASH>..<HASH> 100644 --- a/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/Call.java +++ b/restcomm/restcomm.telephony/src/main/java/org/restcomm/connect/telephony/Call.java @@ -1263,6 +1263,11 @@ public final class Call extends UntypedActor { if(logger.isInfoEnabled()) { logger.info("Completing Call sid: "+id+" from: "+from+" to: "+to+" direction: "+direction+" current external state: "+external); } + if (conferencing) { + // Tell conference to remove the call from participants list + // before moving to a stopping state + conference.tell(new RemoveParticipant(self()), self()); + } //In the case of canceled that reach the completed method, don't change the external state if (!external.equals(CallStateChanged.State.CANCELED)) {
notify conference to remove participant when hungup cam from outside
RestComm_Restcomm-Connect
train
java
f9e49bbc695f72b356770a41968502adf5ea87bd
diff --git a/django_tenants/log.py b/django_tenants/log.py index <HASH>..<HASH> 100644 --- a/django_tenants/log.py +++ b/django_tenants/log.py @@ -10,5 +10,5 @@ class TenantContextFilter(logging.Filter): """ def filter(self, record): record.schema_name = connection.tenant.schema_name - record.domain_url = getattr(connection.tenant, 'domain_url', '') + record.domain_url = getattr(connection.tenant, 'domain_url', 'none') return True
Update log.py it would be better for logging output to use a string that indicates blank/not set/ etc than an empty string
tomturner_django-tenants
train
py
1ed616a606d3ebccc7b57b510aabb9dbf5e09438
diff --git a/bsdploy/__init__.py b/bsdploy/__init__.py index <HASH>..<HASH> 100644 --- a/bsdploy/__init__.py +++ b/bsdploy/__init__.py @@ -54,14 +54,19 @@ class PloyConfigureHostCmd(object): add_help=False, ) masters = dict((master.id, master) for master in self.aws.get_masters('ezjail_admin')) - parser.add_argument( - "master", - nargs=1, - metavar="master", - help="Name of the jailhost from the config.", - choices=masters) + if len(masters) > 1: + parser.add_argument( + "master", + nargs=1, + metavar="master", + help="Name of the jailhost from the config.", + choices=masters) args = parser.parse_args(argv[:1]) - instance = self.aws.instances[args.master[0]] + if len(masters) > 1: + master = args.master[0] + else: + master = masters.keys()[0] + instance = self.aws.instances[master] instance.apply_playbook(path.join(ploy_path, 'roles', 'jailhost.yml'))
Don't require name of master if there only is one.
ployground_bsdploy
train
py
96d0535d0976d0bd8b207d3240374920d49989cd
diff --git a/modules/backend/classes/Controller.php b/modules/backend/classes/Controller.php index <HASH>..<HASH> 100644 --- a/modules/backend/classes/Controller.php +++ b/modules/backend/classes/Controller.php @@ -555,6 +555,13 @@ class Controller extends Extendable } } + /* + * Generic handler that does nothing + */ + if ($handler == 'onAjax') { + return true; + } + return false; } diff --git a/modules/cms/classes/Controller.php b/modules/cms/classes/Controller.php index <HASH>..<HASH> 100644 --- a/modules/cms/classes/Controller.php +++ b/modules/cms/classes/Controller.php @@ -723,6 +723,13 @@ class Controller } } + /* + * Generic handler that does nothing + */ + if ($handler == 'onAjax') { + return true; + } + return false; }
Add generic onAjax handler that does nothing
octobercms_october
train
php,php
249c0ed7f883ebdca530c4ee1e93f56270e48b54
diff --git a/lib/dm-validations/contextual_validators.rb b/lib/dm-validations/contextual_validators.rb index <HASH>..<HASH> 100644 --- a/lib/dm-validations/contextual_validators.rb +++ b/lib/dm-validations/contextual_validators.rb @@ -64,10 +64,16 @@ module DataMapper # Attribute names given to validation macro, example: # [:first_name, :last_name] in validates_presence_of :first_name, :last_name # - # @param [Hash] opts + # @param [Hash] options # Options supplied to validation macro, example: # {:context=>:default, :maximum=>50, :allow_nil=>true, :message=>nil} - + # + # @option [Symbol] :context + # the context in which the new validator should be run + # @option [Boolean] :allow_nil + # whether or not the new validator should allow nil values + # @option [Boolean] :message + # the error message the new validator will provide on validation failure def add(validator_class, *attributes) options = attributes.last.kind_of?(Hash) ? attributes.pop.dup : {} normalize_options(options)
Clean up and add some more docs for ContextualValidators#add.
emmanuel_aequitas
train
rb
de45698075aff9a64a08503680dcb4115fd1f9d5
diff --git a/glance-client/src/main/java/org/openstack/glance/api/DownloadImage.java b/glance-client/src/main/java/org/openstack/glance/api/DownloadImage.java index <HASH>..<HASH> 100644 --- a/glance-client/src/main/java/org/openstack/glance/api/DownloadImage.java +++ b/glance-client/src/main/java/org/openstack/glance/api/DownloadImage.java @@ -22,7 +22,7 @@ public class DownloadImage implements GlanceCommand<ImageDownload> { @Override public ImageDownload execute(WebTarget target) { - Response response = target.path("images").path(id).request(MediaType.APPLICATION_OCTET_STREAM).head(); + Response response = target.path("images").path(id).request(MediaType.APPLICATION_OCTET_STREAM).get(); Image image = new Image(); image.setUri(response.getHeaderString("x-image-meta-uri")); image.setName(response.getHeaderString("x-image-meta-name"));
[openstack-java-sdk] DownloadImage looks not worked (#<I>)
woorea_openstack-java-sdk
train
java
6c6aba3b1cead439a74e9119ac8c1ec04231f9d8
diff --git a/packages/lib/src/utils/errors/DeployError.js b/packages/lib/src/utils/errors/DeployError.js index <HASH>..<HASH> 100644 --- a/packages/lib/src/utils/errors/DeployError.js +++ b/packages/lib/src/utils/errors/DeployError.js @@ -1,17 +1,9 @@ 'use strict' export class DeployError extends Error { - constructor(message, thepackage, directory) { + constructor(message, props) { super(message) - this.package = thepackage - this.directory = directory - } -} - -export class AppDeployError extends DeployError { - constructor(message, thepackage, directory, app) { - super(message, thepackage, directory) - this.app = app + Object.keys(props).forEach(prop => this[prop] = props[prop]) } }
Reimplement DeployError to support generic errors
zeppelinos_zos
train
js
6fc69934b74d6e11727f530b702590ceda9fdda0
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -99,7 +99,10 @@ if __name__ == '__main__': " (like config files) from name-value pairs.", long_description=get_long_description(), license='MIT', - keywords='templating text', + keywords=[ + 'templating', + 'text', + ], url='https://github.com/blubberdiblub/eztemplate/', packages=find_packages(exclude=[ 'tests',
Split keywords up into a list.
blubberdiblub_eztemplate
train
py
928c8acd01a4d46c863f7fa9088637e10d46d75c
diff --git a/pyrogram/methods/users/iter_profile_photos.py b/pyrogram/methods/users/iter_profile_photos.py index <HASH>..<HASH> 100644 --- a/pyrogram/methods/users/iter_profile_photos.py +++ b/pyrogram/methods/users/iter_profile_photos.py @@ -28,7 +28,7 @@ class IterProfilePhotos(Scaffold): chat_id: Union[int, str], offset: int = 0, limit: int = 0, - ) -> Optional[AsyncGenerator["types.Message", None]]: + ) -> Optional[AsyncGenerator["types.Photo", None]]: """Iterate through a chat or a user profile photos sequentially. This convenience method does the same as repeatedly calling :meth:`~pyrogram.Client.get_profile_photos` in a
Fix iter_profile_photos wrong hinted return type
pyrogram_pyrogram
train
py
80c122b0040b911dd5a63803f604b60137ea8053
diff --git a/lib/FsEntry.js b/lib/FsEntry.js index <HASH>..<HASH> 100644 --- a/lib/FsEntry.js +++ b/lib/FsEntry.js @@ -54,11 +54,10 @@ FsEntry.prototype.clone = function () { }; FsEntry.prototype.getTarget = function (cb) { - var that = this; - if (that.type === 'directory') { - FsEntry.getEntriesInDirectory(that.fsPath, that.path, cb); + if (this.type === 'directory') { + FsEntry.getEntriesInDirectory(this.fsPath, this.path, cb); } else { - fs.readFile(that.fsPath, cb); + fs.readFile(this.fsPath, cb); } };
FsEntry: Removed no longer necessary that=this aliasing.
papandreou_node-gitfakefs
train
js
434bc82ee775c41bd92af027abc72644268f922d
diff --git a/models/PodioItemField.php b/models/PodioItemField.php index <HASH>..<HASH> 100644 --- a/models/PodioItemField.php +++ b/models/PodioItemField.php @@ -398,7 +398,7 @@ class PodioContactItemField extends PodioItemField { */ public function contacts() { return array_map(function($value){ - return new PodioFile($value['value']); + return new PodioContact($value['value']); }, $this->values); } @@ -448,7 +448,7 @@ class PodioAssetItemField extends PodioItemField { */ public function files() { return array_map(function($value){ - return new PodioContact($value['value']); + return new PodioFile($value['value']); }, $this->values); } }
Contacts should return contacts and files should return files. Not the other way around.
podio-community_podio-php
train
php
92313dd84036e0de851e5660abd5adb14c98537c
diff --git a/src/Migration/MigrationManager.php b/src/Migration/MigrationManager.php index <HASH>..<HASH> 100644 --- a/src/Migration/MigrationManager.php +++ b/src/Migration/MigrationManager.php @@ -38,7 +38,7 @@ class MigrationManager /** * @var string[] */ - private $knownVersions; + private $knownVersions = array(); /** * Creates a new migration manager. diff --git a/tests/Migration/MigrationManagerTest.php b/tests/Migration/MigrationManagerTest.php index <HASH>..<HASH> 100644 --- a/tests/Migration/MigrationManagerTest.php +++ b/tests/Migration/MigrationManagerTest.php @@ -282,6 +282,13 @@ class MigrationManagerTest extends PHPUnit_Framework_TestCase $this->assertSame(array('0.8', '0.10', '1.0', '2.0'), $this->manager->getKnownVersions()); } + public function testGetKnownVersionsWithoutMigrations() + { + $this->manager = new MigrationManager(array()); + + $this->assertSame(array(), $this->manager->getKnownVersions()); + } + /** * @param string $sourceVersion * @param string $targetVersion
Fixed bug when no migrations are passed
webmozart_json
train
php,php
6b0b08675f0bf71d7aae36d8069546aab86052d9
diff --git a/lib/from-new.js b/lib/from-new.js index <HASH>..<HASH> 100644 --- a/lib/from-new.js +++ b/lib/from-new.js @@ -157,7 +157,7 @@ var fs = require('fs') resolver = unfinishedPaths.first.resolvers.firstThat(function(resolver){ return !resolver.paths }) console.error("?? $["+($.length-1)+"].paths has tested but not-yet-fully-resolved entries") $.push(resolver) - console.error("-- pushed the first unhandled resolver ("+resolver.tag+") onto the stack") + console.error("-- pushed the first unhandled resolver ("+resolver.resolver.tag+") onto the stack") return $$($) } // / if (!unfinishedPaths.empty) @@ -169,8 +169,9 @@ var fs = require('fs') var path = untestedPaths.first console.error("-- testing "+path.path) - console.error(new(Array)($.length).join(' ')+"("+$[-1].resolver.tag+") "+path.path) + console.error("## "+new(Array)($.length).join(' ')+"("+$[-1].resolver.tag+") "+path.path) return probe(path.path, function(error, extant){ + console.error("(( probe() called back ))") if (!error) { console.error("-- "+path.path+" exists") console.error("!! calling back")
(minor debug) Slight reformatting of debugging output.
ELLIOTTCABLE_from
train
js
7c20226442ef2561b23cde193975586ca1aee276
diff --git a/chef/lib/chef/platform.rb b/chef/lib/chef/platform.rb index <HASH>..<HASH> 100644 --- a/chef/lib/chef/platform.rb +++ b/chef/lib/chef/platform.rb @@ -45,7 +45,6 @@ class Chef :template => Chef::Provider::Template, :remote_file => Chef::Provider::RemoteFile, :remote_directory => Chef::Provider::RemoteDirectory, - :sysctl => Chef::Provider::Sysctl, :execute => Chef::Provider::Execute, :script => Chef::Provider::Script, :service => Chef::Provider::Service::Init,
Removing sysctl from platform.rb
chef_chef
train
rb
937b83fb86842278574a128b5d3b7e36c5949e8f
diff --git a/modules/custom/social_lazy_loading/src/SocialLazyLoadingTextFormatOverride.php b/modules/custom/social_lazy_loading/src/SocialLazyLoadingTextFormatOverride.php index <HASH>..<HASH> 100644 --- a/modules/custom/social_lazy_loading/src/SocialLazyLoadingTextFormatOverride.php +++ b/modules/custom/social_lazy_loading/src/SocialLazyLoadingTextFormatOverride.php @@ -54,14 +54,6 @@ class SocialLazyLoadingTextFormatOverride implements ConfigFactoryOverrideInterf } } - // Set lazy loading settings. - if (in_array('lazy.settings', $names, FALSE)) { - $overrides['lazy.settings']['alter_tag'] = [ - 'img' => 'img', - 'iframe' => 'iframe', - ]; - } - return $overrides; } @@ -85,7 +77,10 @@ class SocialLazyLoadingTextFormatOverride implements ConfigFactoryOverrideInterf 'provider' => 'lazy', 'status' => TRUE, 'weight' => 999, - 'settings' => [], + 'settings' => [ + 'image' => TRUE, + 'iframe' => TRUE, + ], ]; } }
Issue #<I> by alex.ksis: Update config override to be compatible with lazy <I>.
goalgorilla_open_social
train
php
2df4f55ca26dffd892d937a39e7f0f454edd4eed
diff --git a/lib/dtrace.js b/lib/dtrace.js index <HASH>..<HASH> 100644 --- a/lib/dtrace.js +++ b/lib/dtrace.js @@ -27,6 +27,7 @@ function addProbes(dtrace, name) { 'char *', 'int', 'char *', + 'int', 'int'); // id, requestid, statusCode, content-type, content-length, @@ -38,7 +39,6 @@ function addProbes(dtrace, name) { 'char *', 'int', 'int', - 'char *', 'char *'); obj.start = function fireProbeStart(req) {
Different number of probe arguments defined than fired.
restify_plugins
train
js
e60e23c023f3da0e7f4dfda1aa3b5d6b2a1c550d
diff --git a/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java b/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java index <HASH>..<HASH> 100644 --- a/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java +++ b/mapsforge-map-reader/src/main/java/org/mapsforge/map/reader/MapFile.java @@ -366,10 +366,7 @@ public class MapFile implements MapDataStore { @Override public boolean supportsTile(Tile tile) { - if (getMapFileInfo().supportsZoomLevel(tile.zoomLevel)) { - return tile.getBoundingBox().intersects(getMapFileInfo().boundingBox); - } - return false; + return tile.getBoundingBox().intersects(getMapFileInfo().boundingBox); } private void decodeWayNodesDoubleDelta(LatLong[] waySegment, double tileLatitude, double tileLongitude) {
Removed zoom-level check from map data read operation, partially resolves #<I> (cherry picked from commit <I>df<I>f<I>bb<I>a<I>c<I>add<I>bd<I>)
mapsforge_mapsforge
train
java
e67456c08a1728a87eed6d9fbd8be0933df30ba1
diff --git a/definition/entity/container.js b/definition/entity/container.js index <HASH>..<HASH> 100644 --- a/definition/entity/container.js +++ b/definition/entity/container.js @@ -12,11 +12,6 @@ var checkIsObject = require('../../util/object/check'); const SEPARATOR = "."; /** - * Definition of the search informations. - * @type {object} - */ -var searchDefinition = require('../../store/search/definition'); -/** * Container for the application entities. * @type {object} */ @@ -68,7 +63,6 @@ function getFieldConfiguration(fieldPath, customFieldConf){ return _getNode(fieldPath, customFieldConf).toJS(); } -setEntityConfiguration(searchDefinition); module.exports = { getEntityConfiguration: getEntityConfiguration,
[definition] Remove search definition from entity definition.
KleeGroup_focus-core
train
js
8ac0a3561aba8af45418780dbc76652f47a92951
diff --git a/ford/sourceform.py b/ford/sourceform.py index <HASH>..<HASH> 100644 --- a/ford/sourceform.py +++ b/ford/sourceform.py @@ -2175,7 +2175,7 @@ class FortranVariable(FortranBase): self.optional = optional self.kind = kind self.strlen = strlen - self.proto = proto + self.proto = copy.copy(proto) self.doc = doc self.permission = permission self.points = points diff --git a/test/test_project.py b/test/test_project.py index <HASH>..<HASH> 100644 --- a/test/test_project.py +++ b/test/test_project.py @@ -538,6 +538,23 @@ def test_display_private_derived_types(copy_fortran_file): assert type_names == {"no_attrs", "public_attr", "private_attr"} +def test_interface_type_name(copy_fortran_file): + """Check for shared prototype list""" + data = """\ + module foo + type name_t + end type name_t + + type(name_t) :: var, var2 + end module foo + """ + + settings = copy_fortran_file(data) + project = create_project(settings) + proto_names = [var.proto[0].name for var in project.modules[0].variables] + assert proto_names == ["name_t", "name_t"] + + def test_display_internal_procedures(copy_fortran_file): """_very_ basic test of 'proc_internals' setting"""
Fix variables declared on same line sharing prototype Introduced in <I> because `FortranVariable` creation used to create new `list(proto)` for each variable on a line
Fortran-FOSS-Programmers_ford
train
py,py
4ae8bff1b6526bea702eaba135d1074985ea8a08
diff --git a/lib/RestClient.js b/lib/RestClient.js index <HASH>..<HASH> 100644 --- a/lib/RestClient.js +++ b/lib/RestClient.js @@ -179,8 +179,13 @@ RestClient.prototype.request = function (options, callback) { } processKeys(data); - //hang response off the JSON-serialized data - data.nodeClientResponse = response; + //hang response off the JSON-serialized data, as unenumerable to allow for stringify. + Object.defineProperty(data, 'nodeClientResponse', { + value: response, + configurable: true, + writeable: true, + enumerable: false + }); // Resolve promise if (error) {
Make nodeClientResponse unenumerable to allow for stringification of the data object.
twilio_twilio-node
train
js
fc6951be5c95657a451fc6bc8bb9d51233720c35
diff --git a/html/components/toggle.js b/html/components/toggle.js index <HASH>..<HASH> 100644 --- a/html/components/toggle.js +++ b/html/components/toggle.js @@ -110,6 +110,13 @@ const bindToggleUIEvents = (element) => { // Add click event listener to trigger for each toggle collection we find toggleTrigger.addEventListener('click', (e) => { e.preventDefault(); + + // If we are in the middle of handling the previous toggle event, + // then we should ignore this event + if (e.currentTarget.style.pointerEvents === 'none') { + return; + } + // Disable clicks till animation runs e.currentTarget.style.pointerEvents = 'none'; handleToggleClick(
#<I> - bug - Fix HTML toggle to look at other triggers for click events, not just click
sparkdesignsystem_spark-design-system
train
js
5505d2374a88baa2e00ee21bcbd2829e02a635f7
diff --git a/asq/test/test_join.py b/asq/test/test_join.py index <HASH>..<HASH> 100644 --- a/asq/test/test_join.py +++ b/asq/test/test_join.py @@ -61,4 +61,10 @@ class TestJoin(unittest.TestCase): e = [(2, 2), (3, 3), (4, 4)] self.assertEqual(d, e) - + def test_join_closed(self): + a = [1, 2, 3, 4, 5] + b = [4, 5, 6, 7, 8] + c = Queryable(a) + c.close() + self.assertRaises(ValueError, lambda: c.join(b)) +
Improved test coverage for join().
sixty-north_asq
train
py
7d0c18034e1a7967c1aabc84e66e6fd020cd541d
diff --git a/src/manipulation.js b/src/manipulation.js index <HASH>..<HASH> 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -283,7 +283,18 @@ function cloneCopyEvent(orig, ret) { return; } - jQuery.data( this, jQuery.data( orig[i++] ) ); + var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData.events; + + if ( events ) { + delete curData.handle; + curData.events = {}; + + for ( var type in events ) { + for ( var handler in events[ type ] ) { + jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data ); + } + } + } }); }
Explicitly re-bind the events on clone. Copying over the data isn't enough. Fixes #<I>.
jquery_jquery
train
js
1575867b40fe110979cac689aa602fb78f8edbda
diff --git a/zipline/finance/slippage.py b/zipline/finance/slippage.py index <HASH>..<HASH> 100644 --- a/zipline/finance/slippage.py +++ b/zipline/finance/slippage.py @@ -141,15 +141,14 @@ def create_transaction(event, order, price, amount): if amount_magnitude < 1: raise Exception("Transaction magnitude must be at least 1.") - txn = { - 'sid': event.sid, - 'amount': int(amount), - 'dt': event.dt, - 'price': price, - 'order_id': order.id - } - - transaction = Transaction(**txn) + transaction = Transaction( + sid=event.sid, + amount=int(amount), + dt=event.dt, + price=price, + order_id=order.id + ) + return transaction
STY: Use named args for Transaction object creation. Instead of creating and passing a dict of the object values, use named args directly.
quantopian_zipline
train
py
095ad9829afd1cea58f5d7e597b7417200dab651
diff --git a/test/more_paranoid_test.rb b/test/more_paranoid_test.rb index <HASH>..<HASH> 100644 --- a/test/more_paranoid_test.rb +++ b/test/more_paranoid_test.rb @@ -2,6 +2,20 @@ require 'test_helper' class MoreParanoidTest < ParanoidBaseTest + test "bidirectional has_many :through association clear is paranoid" do + left = ParanoidManyManyParentLeft.create + right = ParanoidManyManyParentRight.create + left.paranoid_many_many_parent_rights << right + + child = left.paranoid_many_many_children.first + assert_equal left, child.paranoid_many_many_parent_left, "Child's left parent is incorrect" + assert_equal right, child.paranoid_many_many_parent_right, "Child's right parent is incorrect" + + left.paranoid_many_many_parent_rights.clear + + assert_paranoid_deletion(child) + end + test "bidirectional has_many :through association delete is paranoid" do left = ParanoidManyManyParentLeft.create right = ParanoidManyManyParentRight.create
bidirectional many:many clear is paranoid
goncalossilva_acts_as_paranoid
train
rb
a3f798d0c8eebdde6ed102086a675c334f94f503
diff --git a/bin/ugrid.js b/bin/ugrid.js index <HASH>..<HASH> 100755 --- a/bin/ugrid.js +++ b/bin/ugrid.js @@ -177,6 +177,7 @@ function handleClose(sock) { pubmon({event: 'disconnect', uuid: cli.uuid}); cli.sock = null; } + releaseWorkers(cli.uuid); if (sock.index) delete crossbar[sock.index]; for (var i in cli.topics) { // remove owned topics delete topicIndex[topics[i].name]; @@ -227,6 +228,14 @@ function register(from, msg, sock) msg.data = {uuid: uuid, token: 0, id: sock.index}; } +function releaseWorkers(master) { + for (var i in clients) { + var d = clients[i].data; + if (d && d.jobId == master) + d.jobId = ""; + } +} + function devices(query) { var result = []; for (var i in clients) {
ugrid.js releases workers at master disconnect Former-commit-id: d<I>d<I>cb8affe<I>bd<I>cdac<I>fd7a<I>
skale-me_skale
train
js
a7573621af4274c4e8aeff042c41df4dfe470b06
diff --git a/src/Users/ValueObjects/Email.php b/src/Users/ValueObjects/Email.php index <HASH>..<HASH> 100644 --- a/src/Users/ValueObjects/Email.php +++ b/src/Users/ValueObjects/Email.php @@ -29,4 +29,15 @@ class Email { return $this->address; } + + /** + * The __toString method allows a class to decide how it will react when it is converted to a string. + * + * @return string + * @link http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring + */ + function __toString() + { + return $this->getAddress(); + } } diff --git a/src/Users/ValueObjects/Password.php b/src/Users/ValueObjects/Password.php index <HASH>..<HASH> 100644 --- a/src/Users/ValueObjects/Password.php +++ b/src/Users/ValueObjects/Password.php @@ -34,4 +34,15 @@ class Password { return password_verify($password, $this->hash); } + + /** + * The __toString method allows a class to decide how it will react when it is converted to a string. + * + * @return string + * @link http://php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring + */ + function __toString() + { + return '******'; + } }
Default toString in Email and Password
digbang_security
train
php,php
6db2cd927b9e2f882e874b7543864f2f3dee83ed
diff --git a/oleutil/connection_windows.go b/oleutil/connection_windows.go index <HASH>..<HASH> 100644 --- a/oleutil/connection_windows.go +++ b/oleutil/connection_windows.go @@ -49,6 +49,7 @@ func ConnectObject(disp *ole.IDispatch, iid *ole.GUID, idisp interface{}) (cooki point.Release() return } + return } container.Release()
Add a missing return to the ConnectObject function Without the return added by this commit the ConnectObject will return E_INVALIDARG even if everything went fine.
go-ole_go-ole
train
go
4fda4d35febe938ee6429b746ad84d5d3b480832
diff --git a/proxy.go b/proxy.go index <HASH>..<HASH> 100644 --- a/proxy.go +++ b/proxy.go @@ -166,7 +166,8 @@ func (p *Proxy) proxy(local net.Conn, address string) { var remote net.Conn - glog.V(0).Info("Abount to dial: %s", remoteAddr) + glog.Infof("Dialing hostAgent:%v to proxy %v<->%v", + remoteAddr, local.LocalAddr(), address) if p.useTLS && (p.tcpMuxPort > 0) { // Only do TLS if connecting to a TCPMux config := tls.Config{InsecureSkipVerify: true} remote, err = tls.Dial("tcp4", remoteAddr, &config) @@ -182,6 +183,8 @@ func (p *Proxy) proxy(local net.Conn, address string) { io.WriteString(remote, fmt.Sprintf("Zen-Service: %s/%d\n\n", p.name, remotePort)) } + glog.Infof("Using hostAgent:%v to proxy %v<->%v<->%v<->%v", + remote.RemoteAddr(), local.LocalAddr(), local.RemoteAddr(), remote.LocalAddr(), address) go io.Copy(local, remote) go io.Copy(remote, local) }
added logging for proxy connect and reconnect
control-center_serviced
train
go
3a57f6f4d4bbe0522b2a53223d30714dfdd3fd1f
diff --git a/tests/phpunit/BoltListener.php b/tests/phpunit/BoltListener.php index <HASH>..<HASH> 100644 --- a/tests/phpunit/BoltListener.php +++ b/tests/phpunit/BoltListener.php @@ -325,13 +325,15 @@ class BoltListener implements \PHPUnit_Framework_TestListener unlink($file); } + // Sort the array by value, in reverse order arsort($this->tracker); + foreach ($this->tracker as $test => $time) { - $time = substr($time, 0, 6); + $time = number_format($time, 6); file_put_contents($file, "$time\t\t$test\n", FILE_APPEND); } - } - echo "\n\033[32mTest timings written out to: " . TEST_ROOT . "/app/cache/phpunit-test-timer.txt\033[0m\n\n"; + echo "\n\033[32mTest timings written out to: " . $file . "\033[0m\n\n"; + } } }
[Tests] Output timings correctly for exponential numbers
bolt_bolt
train
php
a83502e42da59f2f4a99c406905cf393549de7dc
diff --git a/github_release.py b/github_release.py index <HASH>..<HASH> 100755 --- a/github_release.py +++ b/github_release.py @@ -641,7 +641,7 @@ def gh_asset_upload(repo_name, tag_name, pattern, dry_run=False, verbose=False): filenames = [] for package in pattern: filenames.extend(glob.glob(package)) - set(filenames) + filenames = set(filenames) elif pattern: filenames = glob.glob(pattern) else: diff --git a/tests/test_integration_asset.py b/tests/test_integration_asset.py index <HASH>..<HASH> 100644 --- a/tests/test_integration_asset.py +++ b/tests/test_integration_asset.py @@ -42,7 +42,8 @@ def test_upload(tmpdir): ])) with push_dir(tmpdir): - ghr.gh_asset_upload(REPO_NAME, tag_name, "dist/asset_*") + ghr.gh_asset_upload( + REPO_NAME, tag_name, ["dist/asset_*", "dist/asset_1"]) assert (check_releases([ {"tag_name": tag_name,
gh_asset_upload: filter duplicated filename when list of pattern is provided
j0057_github-release
train
py,py
6ec0785068cc99f4ede0f2a52a6ff2685ce80f1b
diff --git a/ecore.py b/ecore.py index <HASH>..<HASH> 100644 --- a/ecore.py +++ b/ecore.py @@ -1,8 +1,17 @@ +"""Support for generation for models based on pyecore.""" + + class ModelTypeMixin: - """Implements the model filter by returning all elements of a certain element type.""" + """ + Implements the model filter by returning all elements of a certain element type. + + Use this mixin to add the model type iteration faility to another generator task class. + + Attributes: + element_type: Ecore type to be searched in model and to be iterated over. + """ element_type = None def filtered_elements(self, model): - # TODO: yield from model.elements.where(isinstance(e, self.element_type)) - yield from () + return (e for e in model.eAllContents() if isinstance(e, self.element_type)) diff --git a/generator.py b/generator.py index <HASH>..<HASH> 100644 --- a/generator.py +++ b/generator.py @@ -1,3 +1,4 @@ +"""Small framework for multifile generation on top of another template code generator.""" import logging import os diff --git a/jinja.py b/jinja.py index <HASH>..<HASH> 100644 --- a/jinja.py +++ b/jinja.py @@ -1,3 +1,4 @@ +"""Jinja2 support for multifile generation.""" import jinja2 from pygen.generator import TemplateGenerator, TemplateFileTask
implemented and tested ecore model type filter mixin
pyecore_pyecoregen
train
py,py,py
acdc18ef34cfecfabe245276ba735265031b5660
diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/CriteriaConverter.php b/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/CriteriaConverter.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/CriteriaConverter.php +++ b/eZ/Publish/Core/Persistence/Legacy/Content/Search/Gateway/CriteriaConverter.php @@ -10,8 +10,8 @@ namespace eZ\Publish\Core\Persistence\Legacy\Content\Search\Gateway; use eZ\Publish\API\Repository\Values\Content\Query\Criterion; +use eZ\Publish\API\Repository\Exceptions\NotImplementedException; use ezcQuerySelect; -use RuntimeException; /** * Content locator gateway implementation using the zeta database component. @@ -57,6 +57,6 @@ class CriteriaConverter } } - throw new RuntimeException( 'No conversion for criterion ' . get_class( $criterion ) . ' found.' ); + throw new NotImplementedException( "No visitor available for: " . get_class( $criterion ) . ' with operator ' . $criterion->operator ); } }
Throw not implemented exception for unknown criteria in legacy search
ezsystems_ezpublish-kernel
train
php
1f9bf5b78fe15fe67434e0eed7143a5a0a7aaad3
diff --git a/lib/allscripts_unity_client/client.rb b/lib/allscripts_unity_client/client.rb index <HASH>..<HASH> 100644 --- a/lib/allscripts_unity_client/client.rb +++ b/lib/allscripts_unity_client/client.rb @@ -198,7 +198,19 @@ module AllscriptsUnityClient patientid: patientid, parameter1: transaction_id } - magic(magic_parameters) + result = magic(magic_parameters) + + if transaction_id == 0 || transaction_id == '0' + # When transaction_id is 0 all medications should be + # returned and the result should always be an array. + if !result.is_a?(Array) && !result.empty? + result = [ result ] + elsif result.empty? + result = [] + end + end + + result end def get_medication_info(userid, ddid, patientid = nil) diff --git a/lib/allscripts_unity_client/version.rb b/lib/allscripts_unity_client/version.rb index <HASH>..<HASH> 100644 --- a/lib/allscripts_unity_client/version.rb +++ b/lib/allscripts_unity_client/version.rb @@ -1,3 +1,3 @@ module AllscriptsUnityClient - VERSION = '2.1.5' + VERSION = '2.1.6' end
Added support for GetMedicationByTransId 0.
healthfinch_allscripts-unity-client
train
rb,rb
cc4aeeaaec8aee450615c0a40d314cc78ae3cd0d
diff --git a/tests/unit/test_example.py b/tests/unit/test_example.py index <HASH>..<HASH> 100644 --- a/tests/unit/test_example.py +++ b/tests/unit/test_example.py @@ -46,4 +46,4 @@ def test_example(get_data_file, test_output_dir): type(profile.get_description()) == dict and len(profile.get_description().items()) == 7 ), "Unexpected result" - assert "<span class=badge>10</span>" in profile.to_html() + assert "<span class=badge>12</span>" in profile.to_html()
Update test: More types of warning are shown
pandas-profiling_pandas-profiling
train
py
1c3415759a4e8abe6109be1d95c94db349c3d7ab
diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index <HASH>..<HASH> 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -213,7 +213,7 @@ class FormHelper extends AppHelper { } } - $object =& $this->_introspectModel($model); + $object = $this->_introspectModel($model); $this->setEntity($model . '.', true); $modelEntity = $this->model();
Fixing 'Only variables should be assigned by reference' errors in php4 in form helper. Fixes #<I>
cakephp_cakephp
train
php
73d886194bbf71990bfddd76a6346433e7969b08
diff --git a/app/traits/taggable.rb b/app/traits/taggable.rb index <HASH>..<HASH> 100644 --- a/app/traits/taggable.rb +++ b/app/traits/taggable.rb @@ -102,13 +102,13 @@ module Taggable super end - def save + def save(options={}) reconcile_tag_ids - super + super(options) end - def save! + def save!(options={}) reconcile_tag_ids - super + super(options) end end \ No newline at end of file
Allow save to take hash of options This makes it compatible with the new auditable work.
alphagov_govuk_content_models
train
rb
bc0262938941f7c9b6ea2e346b0b86a5865e399d
diff --git a/lib/core/plugin/cloud_action.rb b/lib/core/plugin/cloud_action.rb index <HASH>..<HASH> 100644 --- a/lib/core/plugin/cloud_action.rb +++ b/lib/core/plugin/cloud_action.rb @@ -42,8 +42,8 @@ class CloudAction < CORL.plugin_class(:nucleon, :action) def configure super do - node_config yield if block_given? + node_config end end
Node action configurations should come after all child action provider configurations.
coralnexus_corl
train
rb
a00ef35b5d7228e29e16e797476d6da085438249
diff --git a/src/Graviton/RestBundle/Restriction/Handler/Whoami.php b/src/Graviton/RestBundle/Restriction/Handler/Whoami.php index <HASH>..<HASH> 100644 --- a/src/Graviton/RestBundle/Restriction/Handler/Whoami.php +++ b/src/Graviton/RestBundle/Restriction/Handler/Whoami.php @@ -5,6 +5,7 @@ namespace Graviton\RestBundle\Restriction\Handler; use Doctrine\ODM\MongoDB\DocumentRepository; +use Graviton\SecurityBundle\Entities\SecurityUser; use Graviton\SecurityBundle\Service\SecurityUtils; /** @@ -50,7 +51,13 @@ class Whoami implements HandlerInterface */ public function getValue(DocumentRepository $repository, $fieldPath) { - var_dump($this->securityUtils->getSecurityUser()); - return 'anonymous'; + $user = 'anonymous'; + + $securityUser = $this->securityUtils->getSecurityUser(); + if ($securityUser instanceof SecurityUser) { + $user = trim(strtolower($securityUser->getUsername())); + } + + return $user; } }
finalize the whoami restriction handler
libgraviton_graviton
train
php
3f9814b98b058a5478af3b212f0369e3f75f3fcc
diff --git a/src/Tokenly/XChainClient/Client.php b/src/Tokenly/XChainClient/Client.php index <HASH>..<HASH> 100644 --- a/src/Tokenly/XChainClient/Client.php +++ b/src/Tokenly/XChainClient/Client.php @@ -56,6 +56,16 @@ class Client } /** + * destroys the payment address + * @param string $uuid id of the paymehnt address + * @return array an empty array + */ + public function destroyPaymentAddress($uuid) { + $result = $this->newAPIRequest('DELETE', '/addresses/'.$uuid); + return $result; + } + + /** * monitor a new address * @param string $address bitcoin/counterparty address * @param string $webhook_endpoint webhook callback URL diff --git a/src/Tokenly/XChainClient/Mock/MockBuilder.php b/src/Tokenly/XChainClient/Mock/MockBuilder.php index <HASH>..<HASH> 100644 --- a/src/Tokenly/XChainClient/Mock/MockBuilder.php +++ b/src/Tokenly/XChainClient/Mock/MockBuilder.php @@ -206,6 +206,11 @@ class MockBuilder } + // handle delete message with an empty array + if ($method == 'DELETE') { + return []; + } + throw new Exception("No sample method for $method $path", 1); }));
Added destroy payment address and mock handler
tokenly_xchain-client
train
php,php
04b5ae324730fd04fc602dfa833725d335551aab
diff --git a/Webservice/Interfaces/ISchema.php b/Webservice/Interfaces/ISchema.php index <HASH>..<HASH> 100644 --- a/Webservice/Interfaces/ISchema.php +++ b/Webservice/Interfaces/ISchema.php @@ -10,7 +10,7 @@ interface ISchema /** * Gets the method argument that was passed, using the param name * @param string $method - * @param string $paranName + * @param string $paramName * @return string */ function MethodArgument($method, $paramName); diff --git a/Wording/Worder.php b/Wording/Worder.php index <HASH>..<HASH> 100644 --- a/Wording/Worder.php +++ b/Wording/Worder.php @@ -55,7 +55,7 @@ class Worder } /** - * Replaces + * Replaces the placeholder using a given realizer and optional arguments * @param string $placeholder * @param Interfaces\IRealizer $realizer * @param $realizer,... Optional strings inserted via String::Format @@ -63,7 +63,6 @@ class Worder */ static function ReplaceUsing($placeholder, Interfaces\IRealizer $realizer = null) { - echo($placeholder); $args = func_get_args(); array_shift($args); if (count($args) >= 2)
- Corrections in comments and removal of test code in Worder
agentmedia_phine-framework
train
php,php
ede87adffe37ce511f429a220e2d4e13436cd464
diff --git a/pkg/pod/pods.go b/pkg/pod/pods.go index <HASH>..<HASH> 100644 --- a/pkg/pod/pods.go +++ b/pkg/pod/pods.go @@ -269,7 +269,7 @@ func getPod(dataDir string, uuid *types.UUID) (*Pod, error) { p.FileLock = l - if p.isRunning() { + if p.isRunning() || p.isExit() { cfd, err := p.Fd() if err != nil { return nil, errwrap.Wrap(fmt.Errorf("error acquiring pod %v dir fd", uuid), err) @@ -1200,6 +1200,11 @@ func (p *Pod) IsFinished() bool { return p.isExited || p.isAbortedPrepare || p.isGarbage || p.isGone } +// isExit returns true if the pod is in exited states +func (p *Pod) isExit() bool { + return p.isExited +} + // AppExitCode returns the app's exit code. // It returns an error if the exit code file doesn't exit or the content of the file is invalid. func (p *Pod) AppExitCode(appName string) (int, error) {
list: add ip of non running pods to the json format
rkt_rkt
train
go
e1af47b54577258d796a6aa98ca3118412d46792
diff --git a/opinel/utils_s3.py b/opinel/utils_s3.py index <HASH>..<HASH> 100644 --- a/opinel/utils_s3.py +++ b/opinel/utils_s3.py @@ -4,6 +4,23 @@ from opinel.utils import * ######################################## +##### S3-related arguments +######################################## + +# +# Add an S3-related argument to a recipe +# +def add_s3_argument(parser, default_args, argument_name): + if argument_name == 'bucket-name': + parser.add_argument('--bucket-name', + dest='bucket_name', + default=[], + nargs='+', + help='Name of S3 buckets that the script will iterate through.') + else: + raise Exception('Invalid parameter name: %s' % argument_name) + +######################################## ##### Helpers ########################################
Add --bucket-name as a common S3 argument
nccgroup_opinel
train
py
cbdfb594d6b484fbf385838cf62b7d95314d6c0f
diff --git a/georasters/georasters.py b/georasters/georasters.py index <HASH>..<HASH> 100755 --- a/georasters/georasters.py +++ b/georasters/georasters.py @@ -679,9 +679,13 @@ class GeoRaster(object): geo.map_pixel(point_x, point_y) Return value of raster in location + Note: (point_x, point_y) must belong to the geographic coordinate system and the coverage of the raster ''' row, col =map_pixel(point_x, point_y, self.x_cell_size, self.y_cell_size, self.xmin, self.ymax) - return self.raster[row, col] + try: + return self.raster[row, col] + except: + raise Exception('There has been an error. Make sure the point belongs to the raster coverage and it is in the correct geographic coordinate system.') def map_pixel_location(self, point_x, point_y): ''' diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ def readme(): return f.read() setup(name='georasters', - version='0.5', + version='0.5.1', description='Tools for working with Geographical Information System Rasters', url='http://github.com/ozak/georasters', author='Ömer Özak',
Included error message for map_pixel
ozak_georasters
train
py,py
04db4c286888aad1023c05488fe4def876f85e1c
diff --git a/actionmailer/lib/action_mailer/test_case.rb b/actionmailer/lib/action_mailer/test_case.rb index <HASH>..<HASH> 100644 --- a/actionmailer/lib/action_mailer/test_case.rb +++ b/actionmailer/lib/action_mailer/test_case.rb @@ -68,6 +68,15 @@ module ActionMailer ActionMailer::Base.deliveries.clear end + def set_delivery_method(method) + @old_delivery_method = ActionMailer::Base.delivery_method + ActionMailer::Base.delivery_method = method + end + + def restore_delivery_method + ActionMailer::Base.delivery_method = @old_delivery_method + end + def set_expected_mail @expected = Mail.new @expected.content_type ["text", "plain", { "charset" => charset }]
Add `set_delivery_method` and `restore_delivery_method` to `ActionMailer::TestCase`. This way these methods are available outside the ActionMailer test suite, but they are still duplicated inside `test/abstract_unit` for test cases that don't inherit from the `ActionMailer::TestCase` class.
rails_rails
train
rb
006cd0af6a000059928e56ab2f45bb25a9a6f3e9
diff --git a/src/mol.js b/src/mol.js index <HASH>..<HASH> 100644 --- a/src/mol.js +++ b/src/mol.js @@ -569,17 +569,17 @@ Chain.prototype._cacheBackboneTraces = function() { if (!residue.isAminoacid()) { if (stretch.length() > 1) { this._cachedTraces.push(stretch); - stretch = new BackboneTrace(); } + stretch = new BackboneTrace(); continue; } if (stretch.length() === 0) { stretch.push(residue); continue; } - var ca_prev = this._residues[i-1].atom('C'); - var n_this = residue.atom('N'); - if (Math.abs(vec3.sqrDist(ca_prev.pos(), n_this.pos()) - 1.5*1.5) < 1) { + var caPrev = this._residues[i-1].atom('C'); + var nThis = residue.atom('N'); + if (Math.abs(vec3.sqrDist(caPrev.pos(), nThis.pos()) - 1.5*1.5) < 1) { stretch.push(residue); } else { if (stretch.length() > 1) {
fix backbone trace creation The backbone trace creation was failing when a single amino acid was followed by a non-aminoacid residue, which was then again followed by an amino acid.
biasmv_pv
train
js
846a928498c2244058e4bbf8ecc170031f4699e8
diff --git a/nanoplot/version.py b/nanoplot/version.py index <HASH>..<HASH> 100644 --- a/nanoplot/version.py +++ b/nanoplot/version.py @@ -1 +1 @@ -__version__ = "1.36.2" +__version__ = "1.37.0"
bumping version, after Ilias readded the output format of figures as requested in <URL>
wdecoster_NanoPlot
train
py
604c93176c257ade6daa60c70e36c0d2caa2ee4c
diff --git a/src/Client/Signature/HmacSha1Signature.php b/src/Client/Signature/HmacSha1Signature.php index <HASH>..<HASH> 100644 --- a/src/Client/Signature/HmacSha1Signature.php +++ b/src/Client/Signature/HmacSha1Signature.php @@ -2,7 +2,8 @@ namespace League\OAuth1\Client\Signature; -use Guzzle\Http\Url; +use GuzzleHttp\Psr7; +use GuzzleHttp\Psr7\Uri; class HmacSha1Signature extends Signature implements SignatureInterface { @@ -35,7 +36,7 @@ class HmacSha1Signature extends Signature implements SignatureInterface */ protected function createUrl($uri) { - return Url::factory($uri); + return Psr7\uri_for($uri); } /** @@ -48,11 +49,11 @@ class HmacSha1Signature extends Signature implements SignatureInterface * * @return string */ - protected function baseString(Url $url, $method = 'POST', array $parameters = array()) + protected function baseString(\GuzzleHttp\Psr7\Uri $url, $method = 'POST', array $parameters = array()) { $baseString = rawurlencode($method).'&'; - $schemeHostPath = Url::buildUrl(array( + $schemeHostPath = Uri::fromParts(array( 'scheme' => $url->getScheme(), 'host' => $url->getHost(), 'path' => $url->getPath(),
migrate to Guzzlehttp 6 for compatibility with oauth2-client
thephpleague_oauth1-client
train
php
a5b4393a9b10839da310f11f32364743ceac65aa
diff --git a/tests/utils/test_utils.py b/tests/utils/test_utils.py index <HASH>..<HASH> 100644 --- a/tests/utils/test_utils.py +++ b/tests/utils/test_utils.py @@ -265,6 +265,11 @@ def test_cross_validator_with_predictor_and_kwargs(): assert len(results_06) == 3 +def test_cross_validator_with_stratified_cox_model(): + cf = CoxPHFitter(strata=['race']) + utils.k_fold_cross_validation(cf, load_rossi(), duration_col='week', event_col='arrest') + + def test_cross_validator_with_specific_loss_function(): def square_loss(y_actual, y_pred): return ((y_actual - y_pred) ** 2).mean() @@ -275,6 +280,7 @@ def test_cross_validator_with_specific_loss_function(): results_con = utils.k_fold_cross_validation(cf, load_regression_dataset(), duration_col='T', event_col='E') assert list(results_sq) != list(results_con) + def test_concordance_index(): size = 1000 T = np.random.normal(size=size)
example on how to use strata in k_fold
CamDavidsonPilon_lifelines
train
py
68c23a902073c7c9d1b04f5bded27f90ba491689
diff --git a/packages/qix/src/utils/makeReactNativeConfig.js b/packages/qix/src/utils/makeReactNativeConfig.js index <HASH>..<HASH> 100644 --- a/packages/qix/src/utils/makeReactNativeConfig.js +++ b/packages/qix/src/utils/makeReactNativeConfig.js @@ -77,6 +77,9 @@ const getDefaultConfig = ({ exclude: /node_modules\/(?!react|@expo|pretty-format|qix)/, use: [ { + loader: require.resolve('thread-loader'), + }, + { loader: require.resolve('babel-loader'), options: Object.assign({}, getBabelConfig(root), { /**
chore: use `thread-loader`
longseespace_react-qml
train
js
974e20370db8c90e73f012957d59793f939cd675
diff --git a/web/concrete/src/Localization/Localization.php b/web/concrete/src/Localization/Localization.php index <HASH>..<HASH> 100755 --- a/web/concrete/src/Localization/Localization.php +++ b/web/concrete/src/Localization/Localization.php @@ -198,6 +198,8 @@ class Localization */ public static function clearCache() { + $locale = static::activeLocale(); self::getCache()->flush(); + static::changeLocale($locale); } }
Make sure we reload the translation files immediately on cache clear Former-commit-id: a<I>fadf<I>ed<I>d<I>a<I>d<I>a<I>c9c<I>
concrete5_concrete5
train
php
04aa8f9dcdbc575fde37e25e45315359b0aa1ca6
diff --git a/staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder.go b/staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder.go index <HASH>..<HASH> 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder.go +++ b/staging/src/k8s.io/apiserver/pkg/server/mux/pathrecorder.go @@ -103,10 +103,11 @@ func (m *PathRecorderMux) ListedPaths() []string { } func (m *PathRecorderMux) trackCallers(path string) { + stack := string(debug.Stack()) if existingStack, ok := m.pathStacks[path]; ok { - utilruntime.HandleError(fmt.Errorf("registered %q from %v", path, existingStack)) + utilruntime.HandleError(fmt.Errorf("duplicate path registration of %q: original registration from %v\n\nnew registration from %v", path, existingStack, stack)) } - m.pathStacks[path] = string(debug.Stack()) + m.pathStacks[path] = stack } // refreshMuxLocked creates a new mux and must be called while locked. Otherwise the view of handlers may
Improve pathrecorder duplicate registration info Print information from both the original path registration and the new path registration stack traces when encountering a duplicate. This helps the developer determine where the duplication is coming from and makes it much easier to resolve.
kubernetes_kubernetes
train
go
3600bf1df91afa28769366047e1422af11305239
diff --git a/bcbio/bam/highdepth.py b/bcbio/bam/highdepth.py index <HASH>..<HASH> 100644 --- a/bcbio/bam/highdepth.py +++ b/bcbio/bam/highdepth.py @@ -14,6 +14,7 @@ import yaml from bcbio import utils from bcbio.distributed.transaction import file_transaction +from bcbio.log import logger from bcbio.pipeline import datadict as dd from bcbio.provenance import do @@ -41,9 +42,12 @@ def identify(data): "--window-size {window_size} {work_bam} " "| head -n {sample_size} " """| cut -f 5 | {py_cl} -l 'numpy.median([float(x) for x in l if not x.startswith("mean")])'""") + median_depth_out = subprocess.check_output(cmd.format(**locals()), shell=True) try: - median_cov = float(subprocess.check_output(cmd.format(**locals()), shell=True)) + median_cov = float(median_depth_out) except ValueError: + logger.info("Skipping high coverage region detection; problem calculating median depth: %s" % + median_depth_out) median_cov = None if median_cov and not numpy.isnan(median_cov): high_thresh = int(high_multiplier * median_cov)
Provide better debugging of failed high depth runs Help assist with #<I>
bcbio_bcbio-nextgen
train
py
4c3a1a157ff82fcb2e79f303b3498ee36f9f3552
diff --git a/src/toil/test/src/fileStoreTest.py b/src/toil/test/src/fileStoreTest.py index <HASH>..<HASH> 100644 --- a/src/toil/test/src/fileStoreTest.py +++ b/src/toil/test/src/fileStoreTest.py @@ -639,13 +639,12 @@ class hidden(object): F.addChild(G) Job.Runner.startToil(A, self.options) except FailedJobsException as err: - self.assertEqual(err.numberOfFailedJobs, 1) with open(self.options.logFile) as f: logContents = f.read() if CacheUnbalancedError.message in logContents: self.assertEqual(expectedResult, 'Fail') else: - self.fail('Toil did not raise the expected AssertionError') + self.fail('Toil did not raise the expected CacheUnbalancedError but failed for some other reason') @staticmethod def _writeFileToJobStoreWithAsserts(job, isLocalFile, nonLocalDir=None, fileMB=1):
Make _testCacheEviction not care about the total failed job count
DataBiosphere_toil
train
py
ad3222207fe614136069e6e86cc2d35d401ab843
diff --git a/includes/functions.php b/includes/functions.php index <HASH>..<HASH> 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -421,11 +421,6 @@ function add_network( $args = array() ) { update_network_option( $new_network_id, 'site_name', $network_name ); - switch_to_network( $new_network_id ); - add_site_option( 'site_admins', array() ); - grant_super_admin( $r['network_admin_id']); - restore_current_network(); - /** * Fix upload_path for main sites on secondary networks * This applies only to new installs (WP 3.5+) @@ -508,6 +503,14 @@ function add_network( $args = array() ) { restore_current_network(); } + switch_to_network( $new_network_id ); + // Grant super admin adds 'admin' as network admin if the 'site_admins' option does not exist. + if ( empty( $r['clone_network'] ) ) { + add_site_option( 'site_admins', array() ); + } + grant_super_admin( $r['network_admin_id']); + restore_current_network(); + // Clean network cache clean_network_cache( array() );
Grant super admin after network options cloning so network admin argument is respected #fix-<I>
stuttter_wp-multi-network
train
php
f15fad752afc72ba603ccf611b5aa448bf36878c
diff --git a/src/Classes/Bulk.php b/src/Classes/Bulk.php index <HASH>..<HASH> 100644 --- a/src/Classes/Bulk.php +++ b/src/Classes/Bulk.php @@ -41,6 +41,12 @@ class Bulk */ public $body = []; + /** + * Number of pending operations + * @var int + */ + public $operationCount = 0; + /** * Bulk constructor. @@ -177,6 +183,8 @@ class Bulk $this->body["body"][] = $data; } + $this->operationCount++; + $this->reset(); } @@ -203,5 +211,15 @@ class Bulk } + /** + * Commit all pending operations + */ + public function commit() + { + $this->query->connection->bulk($this->body); + $this->operationCount = 0; + $this->body = []; + + } }
Add commit method to Bulk class for easier use outside of the Query class
basemkhirat_elasticsearch
train
php
a8c84941a0513ddbff259dcb596e7d857ffa58ad
diff --git a/src/utils/convertToNumberWithinIntervalBounds.js b/src/utils/convertToNumberWithinIntervalBounds.js index <HASH>..<HASH> 100644 --- a/src/utils/convertToNumberWithinIntervalBounds.js +++ b/src/utils/convertToNumberWithinIntervalBounds.js @@ -1,4 +1,6 @@ function convertToNumberWithinIntervalBounds (number, min, max) { + min = typeof min === 'number' ? min : -Infinity; + max = typeof max === 'number' ? max : Infinity; return Math.max(min, Math.min(number, max)); }
convertToNumberWithinIntervalBounds uses -/+ Infinity for min/max if unspecified.
benwiley4000_cassette
train
js
c3f93136ef3b3557fdf94723d1099692e1ad461a
diff --git a/salt/output/nested.py b/salt/output/nested.py index <HASH>..<HASH> 100644 --- a/salt/output/nested.py +++ b/salt/output/nested.py @@ -1,5 +1,5 @@ ''' -Recursively display netsted data +Recursively display nested data, this is the default outputter. ''' # Import salt libs diff --git a/salt/output/pprint_out.py b/salt/output/pprint_out.py index <HASH>..<HASH> 100644 --- a/salt/output/pprint_out.py +++ b/salt/output/pprint_out.py @@ -1,5 +1,5 @@ ''' -The python pretty print system is the default outputter. This outputter +The python pretty print system was the default outputter. This outputter simply passed the data passed into it through the pprint module. '''
Fix docstrings for the outputters
saltstack_salt
train
py,py
e3c9159e12305149c9876fd38ae7c4810ca72019
diff --git a/xchange-core/src/main/java/org/knowm/xchange/Exchange.java b/xchange-core/src/main/java/org/knowm/xchange/Exchange.java index <HASH>..<HASH> 100644 --- a/xchange-core/src/main/java/org/knowm/xchange/Exchange.java +++ b/xchange-core/src/main/java/org/knowm/xchange/Exchange.java @@ -1,6 +1,7 @@ package org.knowm.xchange; import java.io.IOException; +import java.util.ArrayList; import java.util.List; import org.knowm.xchange.client.ResilienceRegistries; import org.knowm.xchange.currency.CurrencyPair; @@ -50,7 +51,7 @@ public interface Exchange { * @return The exchange's instruments */ default List<Instrument> getExchangeInstruments() { - throw new NotYetImplementedForExchangeException(); + return new ArrayList<>(getExchangeSymbols()); } /**
[core] Improved Exchange.getExchangeInstruments()
knowm_XChange
train
java
3626619f60a969fe845bf717bb1e41061fa4c7d3
diff --git a/src/mink.js b/src/mink.js index <HASH>..<HASH> 100644 --- a/src/mink.js +++ b/src/mink.js @@ -14,6 +14,8 @@ const DEFAULT_CONFIG = { width: 1366, height: 768, }, + headless: process.env.RUN_HEADLESS !== '0', + devtools: process.env.RUN_DEVTOOLS === '1', }; function gherkin(cucumber) { @@ -35,7 +37,10 @@ Mink.prototype.hook = function (cucumber) { }); }; Mink.prototype.setup = async function () { - this.browser = await puppeteer.launch(); + this.browser = await puppeteer.launch({ + headless: this.config.headless && !this.config.devtools, + devtools: this.config.devtools, + }); this.page = await this.browser.newPage(); return this.page.setViewport(this.config.viewport); };
Added headless and dev-tool options
Adezandee_cucumber-mink
train
js
386f472af552e133351ec32ba1508f2077997c4a
diff --git a/papi-v1/rules.go b/papi-v1/rules.go index <HASH>..<HASH> 100644 --- a/papi-v1/rules.go +++ b/papi-v1/rules.go @@ -27,6 +27,7 @@ type Rules struct { func NewRules() *Rules { rules := &Rules{} rules.Rules = NewRule(rules) + rules.Rules.Name = "default" rules.Init() return rules @@ -759,7 +760,7 @@ func NewBehavior(parent *Rule) *Behavior { // OptionValue is a map with string keys, and any // type of value. You can nest OptionValues as necessary // to create more complex values. -type OptionValue client.JSONBody +type OptionValue map[string]interface{} // AvailableCriteria represents a collection of available rule criteria type AvailableCriteria struct {
The first rule should always be called default
akamai_AkamaiOPEN-edgegrid-golang
train
go
fa3269a8aa307fc3cb51492161084edc65cda0e9
diff --git a/src/Payum/YiiExtension/PayumComponent.php b/src/Payum/YiiExtension/PayumComponent.php index <HASH>..<HASH> 100644 --- a/src/Payum/YiiExtension/PayumComponent.php +++ b/src/Payum/YiiExtension/PayumComponent.php @@ -1,6 +1,8 @@ <?php namespace Payum\YiiExtension; +\Yii::import('Payum\YiiExtension\TokenFactory', true); + use Payum\Core\PaymentInterface; use Payum\Core\Registry\RegistryInterface; use Payum\Core\Registry\SimpleRegistry;
Add required code to include TokenFactory in Yii
Payum_PayumYiiExtension
train
php
1329512ff9a2ffd33a26e1d8f88e9325feb2a308
diff --git a/hydpy/tests/test_everything.py b/hydpy/tests/test_everything.py index <HASH>..<HASH> 100644 --- a/hydpy/tests/test_everything.py +++ b/hydpy/tests/test_everything.py @@ -16,8 +16,7 @@ import warnings import matplotlib exitcode = int(os.system('python test_pyplot_backend.py')) -print('Exit code is %s.' % exitcode) -standard_backend_missing = exitcode == 1 +standard_backend_missing = exitcode in (1, 256) if standard_backend_missing: matplotlib.use('Agg') print('The standard backend of matplotlib does not seem to be available '
Try to fix commit #<I>b1e. On Linux, exit code 1 seems to become <I>...
hydpy-dev_hydpy
train
py
8ef4392951afac5fd2943857aa741bc3e20dd1a3
diff --git a/src/lib/collections/list.js b/src/lib/collections/list.js index <HASH>..<HASH> 100644 --- a/src/lib/collections/list.js +++ b/src/lib/collections/list.js @@ -237,23 +237,6 @@ extend(List, Collection, { }, /** - * Performs the specified action on each element of the List. - * @param {Function} action The action function to perform on each element of the List. eg. function(item) - */ - forEach: function (action, thisArg) { - assertType(action, Function); - - for (var i = 0, len = this.length; i < len; i++) { - if (thisArg) { - action.call(thisArg, this[i]); - } - else { - action(this[i]); - } - } - }, - - /** * Gets the element at the specified index. * @param {Number} index The zero-based index of the element to get. * @returns {Object}
remove List's redundant 'forEach' method
multiplex_multiplex.js
train
js
2903cd930a7f0394acd263a7ab7e84e1ea977763
diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,9 +1,7 @@ -$:.unshift(File.dirname(__FILE__) + '/../lib') - -require 'rubygems' require 'test/unit' -require 'mocha' require 'whois' +require 'rubygems' +require 'mocha' class Test::Unit::TestCase
No need to change $LOAD_PATH. Currenty library folder is already appended.
weppos_whois
train
rb
85833ef3a2767e8999e479f6e3df198d2f2b288f
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -33,8 +33,6 @@ extensions = [ 'sphinx.ext.coverage', 'sphinx.ext.pngmath', 'sphinx.ext.mathjax', - 'IPython.sphinxext.ipython_console_highlighting', - 'IPython.sphinxext.ipython_directive' ] # Add any paths that contain templates here, relative to this directory.
removing ipython directives from docs; wasn't building
CamDavidsonPilon_lifelines
train
py
1cdbea69af1c622a861bada660b054009bd826e3
diff --git a/tofu/spectro/_fit12d_dextract.py b/tofu/spectro/_fit12d_dextract.py index <HASH>..<HASH> 100644 --- a/tofu/spectro/_fit12d_dextract.py +++ b/tofu/spectro/_fit12d_dextract.py @@ -853,7 +853,9 @@ def fit2d_extract( d3[k0][k1]['values'][~indphi, jj] = np.nan # update validity according to indphi - dfit2d['validity'][np.all(~indphi, axis=1)] = -3 + dfit2d['validity'][ + (dfit2d['validity'] == 0) & np.all(~indphi, axis=1) + ] = -3 # ---------- # func diff --git a/tofu/version.py b/tofu/version.py index <HASH>..<HASH> 100644 --- a/tofu/version.py +++ b/tofu/version.py @@ -1,2 +1,2 @@ # Do not edit, pipeline versioning governed by git tags! -__version__ = '1.5.0-231-ge4efc387' +__version__ = '1.5.0-232-g5578af59'
[#<I>] validity set to -3 only if not already negative
ToFuProject_tofu
train
py,py
032713f8b9120afc31642469560f38a49e539bf2
diff --git a/test/test_response.py b/test/test_response.py index <HASH>..<HASH> 100644 --- a/test/test_response.py +++ b/test/test_response.py @@ -26,7 +26,7 @@ def test_response_reference(): foo = bar.foo # This used to cause an exception about invalid pointers because the response got garbage collected - foo.foo().wait() + assert foo.foo().wait().val == 1 def test_response_reference2(): baz = test_response_capnp.Baz._new_client(BazServer()) @@ -37,4 +37,4 @@ def test_response_reference2(): response = baz.grault().wait() bar = response.bar foo = bar.foo - foo.foo().wait() + assert foo.foo().wait().val == 1
Add asserts to test_response.py
capnproto_pycapnp
train
py