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
0ee2315e8cae44eeaee9bf64a47fe9640f577f27
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -63,13 +63,6 @@ class build_ext(_build_ext): self.discount_configure_opts = DEFAULT_DISCOUNT_CONFIGURE_OPTS def build_extension(self, ext): -#TODO: put all the build_extension_discount here since this is discount specific anyway - if ext.name == '_discount': - self.build_extension_discount(ext) - else: - _build_ext.build_extension(self, ext) - - def build_extension_discount(self, ext): if self.discount_src_path is None: filepath = os.path.join( self.build_temp,
Updated setup.py file.
trapeze_python-discount
train
py
8c8a6da0c253aaea1c0241011982fd922b3c347e
diff --git a/lib/Loop/UvDriver.php b/lib/Loop/UvDriver.php index <HASH>..<HASH> 100644 --- a/lib/Loop/UvDriver.php +++ b/lib/Loop/UvDriver.php @@ -14,7 +14,7 @@ class UvDriver extends Driver { /** @var resource[] */ private $events = []; - /** @var \Amp\Loop\Watcher[]|\Amp\Loop\Watcher[][] */ + /** @var \Amp\Loop\Watcher[][] */ private $watchers = []; /** @var resource[] */ @@ -50,7 +50,7 @@ class UvDriver extends Driver { } foreach ($watchers as $watcher) { - if (!($watcher->enabled && $watcher->type & $events)) { + if (!($watcher->enabled && ($watcher->type & $events || ($events | 4) === 4))) { continue; }
Invoke watcher callback if events is 0 or 4 4 is UV_DISCONNECT
amphp_amp
train
php
2b515ab0bd90b75e8ed43b12895f45e2e3c1a414
diff --git a/salt/crypt.py b/salt/crypt.py index <HASH>..<HASH> 100644 --- a/salt/crypt.py +++ b/salt/crypt.py @@ -227,7 +227,7 @@ def sign_message(privkey_path, message, passphrase=None): return key.sign(digest) else: signer = PKCS1_v1_5.new(key) - return signer.sign(SHA.new(message)) + return signer.sign(SHA.new(salt.utils.stringutils.to_bytes(message))) def verify_signature(pubkey_path, message, signature): @@ -245,7 +245,7 @@ def verify_signature(pubkey_path, message, signature): return pubkey.verify(digest, signature) else: verifier = PKCS1_v1_5.new(pubkey) - return verifier.verify(SHA.new(message), signature) + return verifier.verify(SHA.new(salt.utils.stringutils.to_bytes(message)), signature) def gen_signature(priv_path, pub_path, sign_path, passphrase=None):
salt.crypt: Ensure message is encoded before signing Conflicts: - salt/crypt.py
saltstack_salt
train
py
2e0f1afca926b14d03478f8445651edfecf555ee
diff --git a/packages/core/parcel/src/cli.js b/packages/core/parcel/src/cli.js index <HASH>..<HASH> 100755 --- a/packages/core/parcel/src/cli.js +++ b/packages/core/parcel/src/cli.js @@ -179,11 +179,15 @@ async function run(entries: Array<string>, command: any) { } let Parcel = require('@parcel/core').default; let options = await normalizeOptions(command); - let packageManager = new NodePackageManager(new NodeFS()); + let fs = new NodeFS(); + let packageManager = new NodePackageManager(fs); let parcel = new Parcel({ entries, packageManager, - defaultConfig: '@parcel/config-default', + // $FlowFixMe - flow doesn't know about the `paths` option (added in Node v8.9.0) + defaultConfig: require.resolve('@parcel/config-default', { + paths: [fs.cwd(), __dirname], + }), patchConsole: true, ...options, });
fix: use require.resolve when resolving default config (#<I>)
parcel-bundler_parcel
train
js
ee738312be8413c7b4bfba13deb60df5b7960efb
diff --git a/tests/test_io.py b/tests/test_io.py index <HASH>..<HASH> 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -12,6 +12,8 @@ from auditok.io import ( AudioIOError, AudioParameterError, BufferAudioSource, + RawAudioSource, + WaveAudioSource, check_audio_data, _guess_audio_format, _normalize_use_channel, @@ -269,6 +271,19 @@ class TestIO(TestCase): from_file(filename, audio_format, **kwargs) self.assertTrue(patch_function.called) + def test_from_file_large_file_raw(self, ): + filename = "tests/data/test_16KHZ_mono_400Hz.raw" + audio_source = from_file(filename, large_file=True, + sampling_rate=16000, + sample_width=2, + channels=1) + self.assertIsInstance(audio_source, RawAudioSource) + + def test_from_file_large_file_wave(self, ): + filename = "tests/data/test_16KHZ_mono_400Hz.wav" + audio_source = from_file(filename, large_file=True) + self.assertIsInstance(audio_source, WaveAudioSource) + @genty_dataset( missing_sampling_rate=("sr",), missing_sample_width=("sw",),
Add tests for from_file with large_file=True
amsehili_auditok
train
py
e3df1a5894d1e67800c3794498421be055d9ac93
diff --git a/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java b/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java index <HASH>..<HASH> 100644 --- a/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java +++ b/src/java/com/threerings/whirled/spot/client/SpotSceneDirector.java @@ -1,5 +1,5 @@ // -// $Id: SpotSceneDirector.java,v 1.11 2002/04/15 16:28:03 shaper Exp $ +// $Id: SpotSceneDirector.java,v 1.12 2002/06/12 07:03:23 ray Exp $ package com.threerings.whirled.spot.client; @@ -149,8 +149,9 @@ public class SpotSceneDirector */ public void changeLocation (int locationId, ChangeObserver obs) { - // refuse if there's a pending location change - if (_pendingLocId != -1) { + // refuse if there's a pending location change or if we're already + // at the specified location + if ((locationId == _locationId) || (_pendingLocId != -1)) { return; }
Don't request to change locations if we're already there. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
threerings_narya
train
java
2de9c657e68c86cfeb4af10a049c5724dc938638
diff --git a/resolwe/flow/executors/docker/run.py b/resolwe/flow/executors/docker/run.py index <HASH>..<HASH> 100644 --- a/resolwe/flow/executors/docker/run.py +++ b/resolwe/flow/executors/docker/run.py @@ -312,7 +312,7 @@ class FlowExecutor(LocalFlowExecutor): environment["LISTENER_IP"] = "host.docker.internal" communication_arguments = { - "auto_remove": False, + "auto_remove": True, "volumes": self._communicator_volumes(), "command": ["/usr/local/bin/python", "/startup.py"], "image": communicator_image, @@ -328,7 +328,7 @@ class FlowExecutor(LocalFlowExecutor): "environment": environment, } processing_arguments = { - "auto_remove": False, + "auto_remove": True, "volumes": self._processing_volumes(), "command": ["python3", "/start.py"], "image": processing_image,
Auto-remove finished docker containers
genialis_resolwe
train
py
a157f3ac44273a04c559d43f3cb7bb83947ff0aa
diff --git a/core/src/test/java/org/kohsuke/stapler/framework/io/LargeTextTest.java b/core/src/test/java/org/kohsuke/stapler/framework/io/LargeTextTest.java index <HASH>..<HASH> 100644 --- a/core/src/test/java/org/kohsuke/stapler/framework/io/LargeTextTest.java +++ b/core/src/test/java/org/kohsuke/stapler/framework/io/LargeTextTest.java @@ -48,7 +48,6 @@ public class LargeTextTest { @Issue("JENKINS-37664") @Test - @Ignore public void writeLogTo() throws Exception { assertEquals("", tail("", 0)); assertEquals("abcde", tail("abcde", 0));
remove @Ignore that should not have been added
stapler_stapler
train
java
272fd716d636946cf7e17704730f364829e275da
diff --git a/views/js/qtiItem/core/Container.js b/views/js/qtiItem/core/Container.js index <HASH>..<HASH> 100755 --- a/views/js/qtiItem/core/Container.js +++ b/views/js/qtiItem/core/Container.js @@ -156,7 +156,7 @@ define(['taoQtiItem/qtiItem/core/Element', 'lodash', 'jquery', 'taoQtiItem/qtiIt if(this.elements[serial]){ - found = {'parent' : parent || this, 'element' : this.elements[serial]}; + found = {parent : parent || this, element : this.elements[serial], location : 'body'}; }else{
fixed issue : interaction removal does not remove its response git-svn-id: <URL>
oat-sa_extension-tao-itemqti
train
js
3499d319574a07211f193c7ef0c7626d6f096926
diff --git a/lib/anyplayer/players/itunes_mac.rb b/lib/anyplayer/players/itunes_mac.rb index <HASH>..<HASH> 100644 --- a/lib/anyplayer/players/itunes_mac.rb +++ b/lib/anyplayer/players/itunes_mac.rb @@ -1,4 +1,12 @@ class Anyplayer::ItunesMac < Anyplayer::Player + def play + itunes 'play' + end + + def pause + itunes 'pause' + end + def playpause itunes 'playpause' end
iTunes Mac now can play or pause independently
sunny_anyplayer
train
rb
8e10b85d4ac097631d4a77d158b61a6c4b531fec
diff --git a/garlic.rb b/garlic.rb index <HASH>..<HASH> 100644 --- a/garlic.rb +++ b/garlic.rb @@ -24,7 +24,7 @@ garlic do run do cd "vendor/plugins/response_for" do - sh "rake spec:rcov:verify" + sh "rake spec" end end end
Dropping coverage verification from garlic as it's different across the different targets (because of BC code)
ianwhite_response_for
train
rb
66452a58de50e64258859b3b54a6ddb31c8c9e29
diff --git a/epylint.py b/epylint.py index <HASH>..<HASH> 100755 --- a/epylint.py +++ b/epylint.py @@ -58,7 +58,7 @@ def lint(filename): parentPath = os.path.dirname(parentPath) # Start pylint - process = Popen("pylint -f parseable -r n --disable=C,R,I '%s'" % + process = Popen('pylint -f parseable -r n --disable=C,R,I "%s"' % childPath, shell=True, stdout=PIPE, stderr=PIPE, cwd=parentPath) p = process.stdout
apply patch provided by vijayendra bapte on the python projects list for using epylint under windows environment
PyCQA_pylint
train
py
724bb40e68e466b42650012f2a1851706c4da566
diff --git a/lib/any.js b/lib/any.js index <HASH>..<HASH> 100644 --- a/lib/any.js +++ b/lib/any.js @@ -182,7 +182,7 @@ class Collector { if (this.one) { // Shouldn’t happen, safeguards performance problems. /* c8 ignore next */ - if (this.found) throw new Error('Cannot collect multiple nodes') + if (this.found) return this.found = true } diff --git a/test/select.js b/test/select.js index <HASH>..<HASH> 100644 --- a/test/select.js +++ b/test/select.js @@ -76,6 +76,12 @@ test('select.select()', (t) => { 'nothing if not given an element' ) + t.deepEqual( + select('h1, h2', h('main', [h('h1', 'Alpha'), h('h2', 'Bravo')])), + h('h1', 'Alpha'), + 'should select one of several elements' + ) + t.end() })
Fix exception on selector list in `select`
syntax-tree_hast-util-select
train
js,js
bc20b3e92227d3c8afa99776070788a29aba0510
diff --git a/src/org/opencms/ade/contenteditor/shared/CmsContentDefinition.java b/src/org/opencms/ade/contenteditor/shared/CmsContentDefinition.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/ade/contenteditor/shared/CmsContentDefinition.java +++ b/src/org/opencms/ade/contenteditor/shared/CmsContentDefinition.java @@ -251,7 +251,7 @@ public class CmsContentDefinition extends ContentDefinition { List<String> values = attribute.getSimpleValues(); result = values.get(index); } - } else if (attribute.getValueCount() > (index + 1)) { + } else if (attribute.getValueCount() > (index)) { List<I_Entity> values = attribute.getComplexValues(); result = getValueForPath(values.get(index), path); }
Fixing issue where nested value could not be read by path.
alkacon_opencms-core
train
java
ac9d4b6616e07f6fc7de697bed3186c4770bf504
diff --git a/structr-core/src/main/java/org/structr/core/entity/Principal.java b/structr-core/src/main/java/org/structr/core/entity/Principal.java index <HASH>..<HASH> 100644 --- a/structr-core/src/main/java/org/structr/core/entity/Principal.java +++ b/structr-core/src/main/java/org/structr/core/entity/Principal.java @@ -74,7 +74,6 @@ public interface Principal extends NodeInterface, AccessControllable { boolean valid = true; valid &= ValidationHelper.isValidStringNotBlank(this, name, errorBuffer); - valid &= ValidationHelper.isValidUniqueProperty(this, name, errorBuffer); valid &= ValidationHelper.isValidUniqueProperty(this, eMail, errorBuffer); return valid;
Removes uniqueness constraint on name property of class Principal.
structr_structr
train
java
bef5fd6ed4dc1c96aa8823aee4ea2b97c796033b
diff --git a/lib/vagrant-vcloudair/driver/meta.rb b/lib/vagrant-vcloudair/driver/meta.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant-vcloudair/driver/meta.rb +++ b/lib/vagrant-vcloudair/driver/meta.rb @@ -124,10 +124,11 @@ module VagrantPlugins # Instantiate the proper version driver for vCloud Air @logger.debug("Finding driver for vCloud Air version: #{@version}") driver_map = { - '5.1' => Version_5_1, - '5.5' => Version_5_1, - '5.6' => Version_5_1, - '5.7' => Version_5_1 + '5.1' => Version_5_1, + '5.5' => Version_5_1, + '5.6' => Version_5_1, + '5.7' => Version_5_1, + '11.0' => Version_5_1 } if @version.start_with?('0.9') ||
Add API version <I> to driver map
frapposelli_vagrant-vcloudair
train
rb
49e5efdaf871761d78c5247844a8a23c9515be33
diff --git a/lib/utils/pathRegex.js b/lib/utils/pathRegex.js index <HASH>..<HASH> 100644 --- a/lib/utils/pathRegex.js +++ b/lib/utils/pathRegex.js @@ -34,7 +34,12 @@ class PathRegexp { }; let m = this.regexp.exec(path); - if (!m) return result; + if (!m) { + if (path == "" && this.regexp.exec(" ")) /*if path == "" this.regexp.exec("") return false. We test it with this.regexp.exec(" ")*/ + m = ["dummy", ""]; + else + return result; + } result.match = true;
Fix bug in case of empty param in url ex: /api//test for /api/:name/test :name could be empty.
BenoitClaveau_qwebs
train
js
576bc0d2960856280041634994b2c77c8f4b1a5f
diff --git a/plugins/snmppinfo/class.snmppinfo.inc.php b/plugins/snmppinfo/class.snmppinfo.inc.php index <HASH>..<HASH> 100644 --- a/plugins/snmppinfo/class.snmppinfo.inc.php +++ b/plugins/snmppinfo/class.snmppinfo.inc.php @@ -81,7 +81,9 @@ class SNMPPInfo extends PSI_Plugin } foreach ($printers as $printer) { if (! PSI_DEBUG) restore_error_handler(); - $bufferarr=snmprealwalk($printer, "public", "1.3.6.1.2.1.1.5"); + $bufferarr=snmprealwalk($printer, "public", "1.3.6.1.2.1.1.5", 1000000, 1); + if($bufferarr === FALSE) return; + if (! PSI_DEBUG) set_error_handler('errorHandlerPsi'); if (! empty($bufferarr)) { $buffer="";
reduce retry for offline printer to reduce load time and avoid timeout
phpsysinfo_phpsysinfo
train
php
90ab8b635974c244f89575c2688d93dae1d7b493
diff --git a/openquake/commonlib/calc.py b/openquake/commonlib/calc.py index <HASH>..<HASH> 100644 --- a/openquake/commonlib/calc.py +++ b/openquake/commonlib/calc.py @@ -218,10 +218,9 @@ class PmapGetter(object): if len(self.weights) == 1: # one realization return self.get(self.sids, 0, grp) else: # multiple realizations, assume hcurves/mean is there - return (self.dstore['hcurves/mean'] if grp is None - else self.rlzs_assoc.compute_pmap_stats( - {grp: self.dstore['poes/' + grp]}, - [stats.mean_curve])) + dic = ({g: self.dstore['poes/' + g] for g in self.dstore['poes']} + if grp is None else {grp: self.dstore['poes/' + grp]}) + return self.rlzs_assoc.compute_pmap_stats(dic, [stats.mean_curve]) # ######################### hazard maps ################################### #
Fixed get_mean to dynamically recompute the mean [skip hazardlib]
gem_oq-engine
train
py
eb6fc17e0d16240e359034e2478f9b9b7d35a702
diff --git a/nhlib/gsim/chiou_youngs_2008.py b/nhlib/gsim/chiou_youngs_2008.py index <HASH>..<HASH> 100644 --- a/nhlib/gsim/chiou_youngs_2008.py +++ b/nhlib/gsim/chiou_youngs_2008.py @@ -74,7 +74,7 @@ class ChiouYoungs2008(GMPE): stddev_types, component_type): """ See :meth:`superclass method - <nhlib.gsim.base.GroundShkingIntensityModel.get_mean_and_stddevs>` + <nhlib.gsim.base.GroundShakingIntensityModel.get_mean_and_stddevs>` for spec of input and result values. """ # extracting dictionary of coefficients specific to required
gsim/chiou_youngs_<I> [doc]: fixed a typo in get_mean_and_stddevs()
gem_oq-engine
train
py
ee23bdf0a044fe1bb2378f77e21181fe2d39b07f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ def get_readme(): setup( name="docx2html", - version="0.0.10", + version="0.1.0", description="docx (OOXML) to html converter", author="Jason Ward", author_email="jason.louard.ward@gmail.com",
Bumped to version <I>
PolicyStat_docx2html
train
py
76bb8e34b2e540e66e0cfb423b10f45c24d355f1
diff --git a/Controller/Widget/SimpleTextController.php b/Controller/Widget/SimpleTextController.php index <HASH>..<HASH> 100644 --- a/Controller/Widget/SimpleTextController.php +++ b/Controller/Widget/SimpleTextController.php @@ -31,12 +31,15 @@ class SimpleTextController extends Controller $form->bind($this->getRequest()); if ($form->isValid()) { + $formDatas = $form->get('content')->getData(); + $content = is_null($formDatas) ? '' : $formDatas; + if ($simpleTextConfig) { - $simpleTextConfig->setContent($form->get('content')->getData()); + $simpleTextConfig->setContent($content); } else { $simpleTextConfig = new SimpleTextConfig(); $simpleTextConfig->setWidgetInstance($widget); - $simpleTextConfig->setContent($form->get('content')->getData()); + $simpleTextConfig->setContent($content); } } else { return $$this->render(
Fixed bug when submitting empty content at the first config of SimpleText widget
claroline_CoreBundle
train
php
a876de5a82b8a60ccd3e83563b5f3b7064db14b8
diff --git a/ext/psych/extconf.rb b/ext/psych/extconf.rb index <HASH>..<HASH> 100644 --- a/ext/psych/extconf.rb +++ b/ext/psych/extconf.rb @@ -7,7 +7,7 @@ require 'fileutils' dir_config 'libyaml' -if enable_config("bundled-libyaml", false) || !(find_header('yaml.h') && find_library('yaml', 'yaml_get_version')) +if enable_config("bundled-libyaml", false) || !pkg_config('yaml-0.1') && !(find_header('yaml.h') && find_library('yaml', 'yaml_get_version')) # Embed libyaml since we could not find it. $VPATH << "$(srcdir)/yaml"
Added condition for macOS homebrew
ruby_psych
train
rb
c0f09544e532c3f61c07c9ddd57cb9ade3088ae8
diff --git a/checkers/classes.py b/checkers/classes.py index <HASH>..<HASH> 100644 --- a/checkers/classes.py +++ b/checkers/classes.py @@ -585,6 +585,8 @@ a metaclass class method.'} return slots = klass.slots() + if slots is None: + return # If any ancestor doesn't use slots, the slots # defined for this class are superfluous. if any('__slots__' not in ancestor.locals and
Check the return value of slots, it can be None.
PyCQA_pylint
train
py
6e34547c1181f874b23621ea07c20d16c0e7779c
diff --git a/src/main/java/io/vlingo/actors/testkit/TestEnvironment.java b/src/main/java/io/vlingo/actors/testkit/TestEnvironment.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/vlingo/actors/testkit/TestEnvironment.java +++ b/src/main/java/io/vlingo/actors/testkit/TestEnvironment.java @@ -15,12 +15,12 @@ import io.vlingo.actors.plugin.mailbox.testkit.TestMailbox; public class TestEnvironment extends Environment { public TestEnvironment() { super( - TestWorld.testWorld.world().stage(), - TestWorld.testWorld.world().addressFactory().uniqueWith("test"), + TestWorld.Instance.get().world().stage(), + TestWorld.Instance.get().world().addressFactory().uniqueWith("test"), Definition.has(null, Definition.NoParameters), - TestWorld.testWorld.world().defaultParent(), + TestWorld.Instance.get().world().defaultParent(), new TestMailbox(), - TestWorld.testWorld.world().defaultSupervisor(), + TestWorld.Instance.get().world().defaultSupervisor(), JDKLogger.testInstance()); } }
Refactored to make current TestWorld ThreadLocal to enable parallel tests.
vlingo_vlingo-actors
train
java
9284baffb0f862c445becb02e0e47a595800d482
diff --git a/lib/views/cpu-view.js b/lib/views/cpu-view.js index <HASH>..<HASH> 100644 --- a/lib/views/cpu-view.js +++ b/lib/views/cpu-view.js @@ -43,7 +43,7 @@ class CpuView { } onEvent(data) { - this.line.setLabel(` cpu utilization (${data.cpu.utilization}%) `); + this.line.setLabel(` cpu utilization (${data.cpu.utilization.toFixed(1)}%) `); this.cpuHistory.push(data.cpu.utilization); if (this.cpuHistory.length > this.historyDepth) { this.cpuHistory.shift();
Round cpu percentage to nearest decimal.
FormidableLabs_nodejs-dashboard
train
js
142dff12942ea0608a0b3f62cabc2243d2807a6b
diff --git a/src/com/google/javascript/jscomp/Compiler.java b/src/com/google/javascript/jscomp/Compiler.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/Compiler.java +++ b/src/com/google/javascript/jscomp/Compiler.java @@ -560,7 +560,7 @@ public class Compiler extends AbstractCompiler implements ErrorHandler, SourceFi /** * Do any initialization that is dependent on the compiler options. */ - private void initBasedOnOptions() { + public void initBasedOnOptions() { inputSourceMaps.putAll(options.inputSourceMaps); // Create the source map if necessary. if (options.sourceMapOutputPath != null) { @@ -2164,8 +2164,8 @@ public class Compiler extends AbstractCompiler implements ErrorHandler, SourceFi } } return null; - } - }); + } + }); } /**
Make the Compiler's initBasedOnOptions() method public in order to allow non-standard Compiler flows to use the applyInputSourceMaps option. ------------- Created by MOE: <URL>
google_closure-compiler
train
java
352cf1db61aefd159554e210f44a2e3a38ced51d
diff --git a/tests/Routing/RouteTest.php b/tests/Routing/RouteTest.php index <HASH>..<HASH> 100644 --- a/tests/Routing/RouteTest.php +++ b/tests/Routing/RouteTest.php @@ -419,7 +419,7 @@ class RouteTest extends TestCase $responseProphecy = $this->prophesize(ResponseInterface::class); $callableResolverProphecy = $this->prophesize(CallableResolverInterface::class); - $callable = 'CallableTest:toCall'; + $callable = 'callableWhatever'; $callableResolverProphecy ->resolve(Argument::is($callable))
Rename test callable to make it clear that Callable:toCall is not expected to be called
slimphp_Slim
train
php
4a0a3bf2eb3acacf134f1825bbc4889fd1bbac3a
diff --git a/ezp/Persistence/Content/CreateStruct.php b/ezp/Persistence/Content/CreateStruct.php index <HASH>..<HASH> 100644 --- a/ezp/Persistence/Content/CreateStruct.php +++ b/ezp/Persistence/Content/CreateStruct.php @@ -67,8 +67,7 @@ class CreateStruct extends ValueObject public $remoteId; /** - * TODO: Document - * + * Language id the content was initially created in * @var mixed */ public $initialLanguageId = false;
PHPDoc: Sync doc from Content to CreateStruct
ezsystems_ezpublish-kernel
train
php
8af8ed816dc9ed3a7f53a999273d81236a89cc9d
diff --git a/lib/boom/platform.rb b/lib/boom/platform.rb index <HASH>..<HASH> 100644 --- a/lib/boom/platform.rb +++ b/lib/boom/platform.rb @@ -75,10 +75,12 @@ module Boom # # Returns the String value of the Item. def copy(item) + value = item.value.gsub("\'","\\'") unless windows? - system("printf '#{item.value.gsub("\'","\\'")}' | #{copy_command}") + value = value.gsub('%','%%') + system("printf \"#{value}\" | #{copy_command}") else - system("echo #{item.value.gsub("\'","\\'")} | #{copy_command}") + system("echo #{value} | #{copy_command}") end item.value diff --git a/test/test_platform.rb b/test/test_platform.rb index <HASH>..<HASH> 100644 --- a/test/test_platform.rb +++ b/test/test_platform.rb @@ -5,6 +5,11 @@ class TestPlatform < Test::Unit::TestCase def setup end + def test_can_handle_percent_strings + Boom::Platform.expects("system").with('printf "val%%ue" | pbcopy') + Boom::Platform.copy(Boom::Item.new('name','val%ue')) + end if !Boom::Platform.windows? + def test_darwin assert_equal Boom::Platform.darwin?, RUBY_PLATFORM.include?('darwin') end
Percent signs should be escaped for `printf` This is relevant to non-Windows environments. Closes #<I>.
holman_boom
train
rb,rb
ea867cd199f96080648cf19992708fccf7f1b6d8
diff --git a/pysparkling/sql/casts.py b/pysparkling/sql/casts.py index <HASH>..<HASH> 100644 --- a/pysparkling/sql/casts.py +++ b/pysparkling/sql/casts.py @@ -6,7 +6,8 @@ from functools import lru_cache import pytz from dateutil.tz import tzlocal -from pysparkling.sql.types import TimestampType, DateType, StringType, NumericType, BooleanType, BinaryType, StructType +from pysparkling.sql.types import TimestampType, DateType, StringType, NumericType, BooleanType, BinaryType, StructType, \ + ArrayType, MapType from pysparkling.sql.utils import AnalysisException NO_TIMESTAMP_CONVERSION = object() @@ -55,6 +56,14 @@ def cast_to_string(value, from_type, options): return str(value) +def cast_nested_to_str(value, from_type, options): + if isinstance(from_type, (ArrayType, StructType)): + return cast_sequence(value, from_type, options) + if isinstance(from_type, MapType): + return cast_map(value, from_type, options) + raise TypeError("Unable to cast {0}".format(type(from_type))) + + def cast_map(value, from_type, options): casted_values = [ (cast_to_string(key, from_type.keyType, options),
Implement a cast of nested types
svenkreiss_pysparkling
train
py
8eb7561ac6e8f020ec09608532de310c6b0b8dcd
diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/attribute_methods.rb +++ b/activerecord/lib/active_record/attribute_methods.rb @@ -8,7 +8,7 @@ module ActiveRecord include ActiveModel::AttributeMethods included do - @attribute_methods_generated = false + initialize_generated_modules include Read include Write include BeforeTypeCast diff --git a/activerecord/test/cases/attribute_methods/read_test.rb b/activerecord/test/cases/attribute_methods/read_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/attribute_methods/read_test.rb +++ b/activerecord/test/cases/attribute_methods/read_test.rb @@ -15,13 +15,6 @@ module ActiveRecord include ActiveRecord::AttributeMethods - def self.define_attribute_methods - # Created in the inherited/included hook for "proper" ARs - @attribute_methods_mutex ||= Mutex.new - - super - end - def self.column_names %w{ one two three } end
initialize generated modules on inclusion and on inheritence
rails_rails
train
rb,rb
77e7bea7d8382d2df77877769ba284f59f29367e
diff --git a/lib/connection.js b/lib/connection.js index <HASH>..<HASH> 100644 --- a/lib/connection.js +++ b/lib/connection.js @@ -44,7 +44,7 @@ function escapeCQL(val) return 'NULL'; if (Buffer.isBuffer(val)) return val.toString('hex'); - if (isFinite(val)) + if (typeof val == 'number' || typeof val == 'boolean') return String(val); if (Array.isArray(val)) return String(_.map(val, escapeCQL));
`escapeCQL`: Avoid serializing numeric strings as numbers.
lyveminds_scamandrios
train
js
510f20048b7cf6bb403186842b7e58a6514c4610
diff --git a/render/form/Foreignkey.php b/render/form/Foreignkey.php index <HASH>..<HASH> 100644 --- a/render/form/Foreignkey.php +++ b/render/form/Foreignkey.php @@ -49,7 +49,7 @@ class Foreignkey extends Text foreach ($parts as &$part) { $part = ucfirst($part); } - $class = $namespace.implode('/', $parts); + $class = $namespace.implode('_', $parts); return "{$class}_Finder"; }
ehm, that should be an underscore, not a slash
monomelodies_monad
train
php
771b1cbfa4a135f4f4c447f5c091d4f67d9c5885
diff --git a/src/test/java/com/github/chen0040/gp/treegp/program/TerminalUnitTest.java b/src/test/java/com/github/chen0040/gp/treegp/program/TerminalUnitTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/github/chen0040/gp/treegp/program/TerminalUnitTest.java +++ b/src/test/java/com/github/chen0040/gp/treegp/program/TerminalUnitTest.java @@ -53,4 +53,11 @@ public class TerminalUnitTest { t.setValue(0.3); t.read(Arrays.asList(0.1, 0.2)); } + + @Test + public void testTerminalWithDefaultConstructor(){ + Terminal t = new Terminal(); + assertThat(t.getSymbol()).isEqualTo(""); + assertThat(t.isReadOnly()).isFalse(); + } }
Increase the code coverage for the terminal class
chen0040_java-genetic-programming
train
java
10b2074d0d6bf97ef384c63e2ebb9680aafe11dd
diff --git a/pkg/datapath/linux/linux_defaults/linux_defaults.go b/pkg/datapath/linux/linux_defaults/linux_defaults.go index <HASH>..<HASH> 100644 --- a/pkg/datapath/linux/linux_defaults/linux_defaults.go +++ b/pkg/datapath/linux/linux_defaults/linux_defaults.go @@ -23,6 +23,12 @@ const ( // RouteTableIPSec is the default table ID to use for IPSec routing rules RouteTableIPSec = 200 + // RouteTableInterfacesOffset is the offset for the per-ENI routing tables. + // Each ENI interface will have its own table starting with this offset. It + // is 10 because it is highly unlikely to collide with the main routing + // table which is between 253-255. See ip-route(8). + RouteTableInterfacesOffset = 10 + // RouteMarkDecrypt is the default route mark to use to indicate datapath // needs to decrypt a packet. RouteMarkDecrypt = 0x0D00
linux_defaults: Add RouteTableInterfacesOffset [ upstream commit e<I>b; forward-ported from <I> tree ] This new value is the table ID for the per-ENI routing tables in the new ENI datapath. Upcoming commits will use this value and implement the new datapath. See <URL>
cilium_cilium
train
go
c7e4159780e7f58a134340ca93fdf212045ed390
diff --git a/salt/modules/boto_vpc.py b/salt/modules/boto_vpc.py index <HASH>..<HASH> 100644 --- a/salt/modules/boto_vpc.py +++ b/salt/modules/boto_vpc.py @@ -1421,11 +1421,11 @@ def delete_nat_gateway(nat_gateway_id, # wait for deleting nat gateway to finish prior to attempt to release elastic ips if wait_for_delete: for retry in range(wait_for_delete_retries, 0, -1): - gwinfo = conn3.describe_nat_gateways(NatGatewayIds=[nat_gateway_id]) - if gwinfo: - gw = gwinfo.get('NatGateways', [None])[0] - if gw and gw['State'] not in ['deleted', 'failed']: - time.sleep((2 ** (wait_for_delete_retries - retry)) + (random.randint(0, 1000) / 1000)) + if gwinfo and gwinfo['State'] not in ['deleted', 'failed']: + time.sleep((2 ** (wait_for_delete_retries - retry)) + (random.randint(0, 1000) / 1000)) + gwinfo = conn3.describe_nat_gateways(NatGatewayIds=[nat_gateway_id]) + if gwinfo: + gwinfo = gwinfo.get('NatGateways', [None])[0] continue break
fixed a bug in retry mechanism.
saltstack_salt
train
py
6d8d6a86f0354caa3b328a0554a53bdc830a790e
diff --git a/.buildkite/pipeline.py b/.buildkite/pipeline.py index <HASH>..<HASH> 100644 --- a/.buildkite/pipeline.py +++ b/.buildkite/pipeline.py @@ -18,7 +18,7 @@ TOX_MAP = { } # https://github.com/dagster-io/dagster/issues/1662 -DO_COVERAGE = True +DO_COVERAGE = False def wait_step():
Turn off coveralls Summary: It's down Test Plan: BK Reviewers: alangenfeld Reviewed By: alangenfeld Differential Revision: <URL>
dagster-io_dagster
train
py
2bc9d8098eab435aedfc04e0e6c33d124a14916e
diff --git a/soupsieve/__meta__.py b/soupsieve/__meta__.py index <HASH>..<HASH> 100644 --- a/soupsieve/__meta__.py +++ b/soupsieve/__meta__.py @@ -186,5 +186,5 @@ def parse_version(ver, pre=False): return Version(major, minor, micro, release, pre, post, dev) -__version_info__ = Version(1, 0, 2, "final") +__version_info__ = Version(1, 1, 0, ".dev") __version__ = __version_info__._get_canonical()
Use dev version for dev branch
facelessuser_soupsieve
train
py
4ca0729caf000db2e7a1c23a86c12487fb20e5af
diff --git a/server/src/main/java/org/uiautomation/ios/wkrdp/model/RemoteWebNativeBackedElement.java b/server/src/main/java/org/uiautomation/ios/wkrdp/model/RemoteWebNativeBackedElement.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/org/uiautomation/ios/wkrdp/model/RemoteWebNativeBackedElement.java +++ b/server/src/main/java/org/uiautomation/ios/wkrdp/model/RemoteWebNativeBackedElement.java @@ -134,8 +134,8 @@ public class RemoteWebNativeBackedElement extends RemoteWebElement { } case CENTER: { Dimension size = getSize(); - script.append("var top = (" + top + " + " + size.getHeight() + " / 2) * ratioX);"); - script.append("var left = (" + left + " + " + size.getWidth() + " / 2) * ratioY);"); + script.append("var top = (" + top + " + " + size.getHeight() + " / 2) * ratioX;"); + script.append("var left = (" + left + " + " + size.getWidth() + " / 2) * ratioY;"); break; } }
fix script error with extra paren left in
ios-driver_ios-driver
train
java
739d4731fb82c69d662afdc0b3a0cf38f031922c
diff --git a/underscore.util.operators.js b/underscore.util.operators.js index <HASH>..<HASH> 100644 --- a/underscore.util.operators.js +++ b/underscore.util.operators.js @@ -29,14 +29,38 @@ mod: function(x, y) { return x % y; }, - inc: function(x, y) { + inc: function(x) { return ++x; }, - dec: function(x, y) { + dec: function(x) { return --x; }, - neg: function(x, y) { + neg: function(x) { return -x; + }, + eq: function(x, y) { + return x == y; + }, + seq: function(x, y) { + return x === y; + }, + neq: function(x, y) { + return x != y; + }, + sneq: function(x, y) { + return x !== y; + }, + gt: function(x, y) { + return x > y; + }, + lt: function(x, y) { + return x < y; + }, + gte: function(x, y) { + return x >= y; + }, + lte: function(x, y) { + return x <= y; } }); })(this);
added equality operators, some may be redundant since underscore supports deep equality.
documentcloud_underscore-contrib
train
js
c117ba8ebde27f535522506aaf66df2e44fb8651
diff --git a/gntp/shim.py b/gntp/shim.py index <HASH>..<HASH> 100644 --- a/gntp/shim.py +++ b/gntp/shim.py @@ -1,3 +1,10 @@ +""" +Python2.5 and Python3.3 compatibility shim + +Heavily inspirted by the "six" library. +https://pypi.python.org/pypi/six +""" + import sys PY3 = sys.version_info[0] == 3 @@ -13,9 +20,7 @@ if PY3: return s.decode('utf8', 'replace') return s - import io - StringIO = io.StringIO - BytesIO = io.BytesIO + from io import StringIO from configparser import RawConfigParser else: def b(s): @@ -30,7 +35,8 @@ else: s = str(s) return unicode(s, "utf8", "replace") - int2byte = chr - import StringIO - StringIO = BytesIO = StringIO.StringIO + from StringIO import StringIO from ConfigParser import RawConfigParser + +b.__doc__ = "Ensure we have a byte string" +u.__doc__ = "Ensure we have a unicode string"
Cleanup and docs for our shim
kfdm_gntp
train
py
691d3ce54d20d0cfeb8c0a8764814922ddc6448b
diff --git a/findbugsTestCases/src/java/npe/ErrorInFinallyClause.java b/findbugsTestCases/src/java/npe/ErrorInFinallyClause.java index <HASH>..<HASH> 100644 --- a/findbugsTestCases/src/java/npe/ErrorInFinallyClause.java +++ b/findbugsTestCases/src/java/npe/ErrorInFinallyClause.java @@ -21,7 +21,7 @@ public class ErrorInFinallyClause { } } finally { - in.close(); + in.close(); // TODO: we should report a medium priority NP warning here out.close(); // TODO: we should report a medium priority NP warning here }
actually, we should report medium priority NP warnings for both of these git-svn-id: <URL>
spotbugs_spotbugs
train
java
9754a0842aabdfbf2b1ba1797cda0a20699d9aca
diff --git a/lib/ApiRequest.js b/lib/ApiRequest.js index <HASH>..<HASH> 100644 --- a/lib/ApiRequest.js +++ b/lib/ApiRequest.js @@ -8,7 +8,7 @@ var rest = require('restling'); var nconf = require('nconf'); var Q = require('q'); -var API = 'https://api.uber.com/v1/'; +var API = 'https://sandbox-api.uber.com/v1/'; var REFRESH_SECONDS_BEFORE_EXPIRY = 10; var access_token; var expires_at; @@ -90,6 +90,12 @@ function call(path, options) { console.log('using access token', options.accessToken, options); return rest.request(API + path, options); }).then(function(result) { + try { + if (typeof result.data == 'string') result.data = JSON.parse(result.data); + } + catch (e) { + } + if (options.method == 'GET') { if (result.response.statusCode == 200) { return result.data; @@ -112,7 +118,8 @@ module.exports = { 'post': function (path, data) { var options = {}; options.method = 'POST'; - options.data = data; + options.headers = {'content-type': 'application/json'}; + options.data = JSON.stringify(data); return call(path, options); },
Explicitly using application/json for POSTs.
mjk_uber-rush
train
js
38317d2cd99683dc920c8e64f81bf06abf25b281
diff --git a/lib/rspec/requestable-examples.rb b/lib/rspec/requestable-examples.rb index <HASH>..<HASH> 100644 --- a/lib/rspec/requestable-examples.rb +++ b/lib/rspec/requestable-examples.rb @@ -12,6 +12,10 @@ module RSpec end end + def examples_that_can_be_requested + @examples_that_can_be_requested ||= [] + end + def request_examples(options) @requested_examples = RequestedExamples.new(options) end @@ -21,7 +25,7 @@ module RSpec end def requestable_example(description, options={}, &blk) - requestable_examples << description + examples_that_can_be_requested << description it description, &blk if requested_examples.run?(options[:as] || description) end alias_method :requestable_it, :requestable_example @@ -36,6 +40,13 @@ module RSpec describe description, &blk if requested_examples.run?(label) end alias_method :requestable_context, :requestable_describe + + def verify_requested_examples! + missing_examples = requested_examples - examples_that_can_be_requested + if missing_examples.any? + raise %|Trying to request examples that don't exist:\n#{missing_examples.join("\n")}| + end + end end end \ No newline at end of file
Adding #verify_requested_examples! which can be run at the end of any shared_examples block that uses requested examples. This will report any requested examples that do not exist (perhaps from typos or wording differences).
mhs_rspec-requestable-examples
train
rb
b93be9d7a247b044f16b1622f589c1be2eaf223f
diff --git a/components/auth/auth.js b/components/auth/auth.js index <HASH>..<HASH> 100644 --- a/components/auth/auth.js +++ b/components/auth/auth.js @@ -569,12 +569,12 @@ export default class Auth { * if user is logged in or log her in otherwise */ async login() { - await this._checkBackendsStatusesIfEnabled(); if (this.config.windowLogin && this._authDialogService !== undefined) { this._showAuthDialog(); return; } + await this._checkBackendsStatusesIfEnabled(); try { const accessToken = await this._backgroundFlow.authorize(); const user = await this.getUser(accessToken);
RG-<I> RG-<I> check backend statuses only if logging in without window login enabled: otherwise it causes blocked popup
JetBrains_ring-ui
train
js
fffd223f90f4c4cacb041a602c5cafcac68b0da2
diff --git a/lib/terraforming/cli.rb b/lib/terraforming/cli.rb index <HASH>..<HASH> 100644 --- a/lib/terraforming/cli.rb +++ b/lib/terraforming/cli.rb @@ -43,6 +43,11 @@ module Terraforming execute(Terraforming::Resource::IAMGroup, options) end + desc "iamgm", "IAM Group Membership" + def iamgm + execute(Terraforming::Resource::IAMGroupMembership, options) + end + desc "iamgp", "IAM Group Policy" def iamgp execute(Terraforming::Resource::IAMGroupPolicy, options) diff --git a/spec/lib/terraforming/cli_spec.rb b/spec/lib/terraforming/cli_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/terraforming/cli_spec.rb +++ b/spec/lib/terraforming/cli_spec.rb @@ -81,6 +81,13 @@ module Terraforming it_behaves_like "CLI examples" end + describe "iamgm" do + let(:klass) { Terraforming::Resource::IAMGroupMembership } + let(:command) { :iamgm } + + it_behaves_like "CLI examples" + end + describe "iamgp" do let(:klass) { Terraforming::Resource::IAMGroupPolicy } let(:command) { :iamgp }
Define CLI command iamgm for IAM Group Membership
dtan4_terraforming
train
rb,rb
081f632daf9e598b818c1f07b7a069082685f38b
diff --git a/lib/active_admin/views/components/active_admin_form.rb b/lib/active_admin/views/components/active_admin_form.rb index <HASH>..<HASH> 100644 --- a/lib/active_admin/views/components/active_admin_form.rb +++ b/lib/active_admin/views/components/active_admin_form.rb @@ -78,7 +78,7 @@ module ActiveAdmin end def add_create_another_checkbox - if %w(new create).include?(action_name) && active_admin_config && active_admin_config.create_another + if %w(new create).include?(helpers.action_name) && active_admin_config && active_admin_config.create_another current_arbre_element.add_child(create_another_checkbox) end end
Delegate to `helpers` instead of relying on `method_missing`
activeadmin_activeadmin
train
rb
f1130b9833f477ae4fb050ea87a08e20f127435c
diff --git a/js/browser.js b/js/browser.js index <HASH>..<HASH> 100755 --- a/js/browser.js +++ b/js/browser.js @@ -728,7 +728,7 @@ var igv = (function (igv) { start = r[searchConfig.startField] - searchConfig.coords; end = r[searchConfig.endField]; type = r["featureType"]; - handleSearchResult(feature, chr, start, end, chr, type); + handleSearchResult(feature, chr, start, end, type); } else { presentSearchResults(results, searchConfig, feature);
bug in call to "handleSearchResult" -- affects gtex
igvteam_igv.js
train
js
6c3931cacb5d203a926217792634bfe61e0fb7f6
diff --git a/source/test/common/test_data_ports.py b/source/test/common/test_data_ports.py index <HASH>..<HASH> 100644 --- a/source/test/common/test_data_ports.py +++ b/source/test/common/test_data_ports.py @@ -87,6 +87,9 @@ def test_unique_port_names(): state.add_output_data_port("in", "int", 0) state.add_input_data_port("out", "int", 0) + assert len(state.input_data_ports) == 2 + assert len(state.output_data_ports) == 2 + state = HierarchyState('hierarchy state') state.add_input_data_port("in", "int", 0) @@ -115,6 +118,10 @@ def test_unique_port_names(): state.add_input_data_port("scope", "int", 0) state.add_output_data_port("scope", "int", 0) + assert len(state.input_data_ports) == 3 + assert len(state.output_data_ports) == 3 + assert len(state.scoped_variables) == 3 + if __name__ == '__main__': test_default_values_of_data_ports()
Extend tests to assert correct port count
DLR-RM_RAFCON
train
py
3211b7ee3739c880077e15e7cc10a981467855f9
diff --git a/torchvision/transforms.py b/torchvision/transforms.py index <HASH>..<HASH> 100644 --- a/torchvision/transforms.py +++ b/torchvision/transforms.py @@ -204,7 +204,7 @@ class CenterCrop(object): Args: size (sequence or int): Desired output size of the crop. If size is an - int instead of sequence like (w, h), a square crop (size, size) is + int instead of sequence like (h, w), a square crop (size, size) is made. """ @@ -275,7 +275,7 @@ class RandomCrop(object): Args: size (sequence or int): Desired output size of the crop. If size is an - int instead of sequence like (w, h), a square crop (size, size) is + int instead of sequence like (h, w), a square crop (size, size) is made. padding (int or sequence, optional): Optional padding on each border of the image. Default is 0, i.e no padding. If a sequence of length
Fix docs for CenterCrop and RandomCrop (#<I>) Wrong order of dimensions In transforms.CenterCrop and transforms.RandomCrop: Documentation says it should be (w, h), but it actually is (h, w). Fixing docs to match the code
pytorch_vision
train
py
5391524fc75aa9615fa2cb93f96a37b970d7dac9
diff --git a/test/test_string.rb b/test/test_string.rb index <HASH>..<HASH> 100644 --- a/test/test_string.rb +++ b/test/test_string.rb @@ -136,4 +136,9 @@ XML CFPropertyList::List.parsers = orig_parsers end + def test_data_string_is_blob + assert_equal parsed_binary('string_binary_data').class, CFPropertyList::Blob + assert_equal parsed_xml('string_binary_data').class, CFPropertyList::Blob + end + end
added a test for #<I>/#<I>
ckruse_CFPropertyList
train
rb
0b4d21d4c4de55133bd4b55cf39126958e0dd105
diff --git a/src/Condition/In.php b/src/Condition/In.php index <HASH>..<HASH> 100644 --- a/src/Condition/In.php +++ b/src/Condition/In.php @@ -43,7 +43,7 @@ class In extends AbstractSpecification * * @return string */ - protected function generateParameterName(QueryBuilder $queryBuilder) + private function generateParameterName(QueryBuilder $queryBuilder) { return sprintf('in_%d', count($queryBuilder->getParameters())); }
method should be private because it is overriden
rikbruil_Doctrine-Specification
train
php
824dbedddac967c3ba779dba84118b15e3502e91
diff --git a/tests/src/main/java/com/hazelcast/simulator/tests/icache/CreateDestroyICacheTest.java b/tests/src/main/java/com/hazelcast/simulator/tests/icache/CreateDestroyICacheTest.java index <HASH>..<HASH> 100644 --- a/tests/src/main/java/com/hazelcast/simulator/tests/icache/CreateDestroyICacheTest.java +++ b/tests/src/main/java/com/hazelcast/simulator/tests/icache/CreateDestroyICacheTest.java @@ -28,7 +28,6 @@ import com.hazelcast.simulator.worker.selector.OperationSelectorBuilder; import com.hazelcast.simulator.worker.tasks.AbstractWorker; import javax.cache.Cache; -import javax.cache.CacheException; import javax.cache.CacheManager; import static com.hazelcast.simulator.tests.icache.helpers.CacheUtils.createCacheManager;
Removed unused import in CreateDestroyICacheTest.
hazelcast_hazelcast-simulator
train
java
cbb1446d163196d3715637cdaeceb968c0686375
diff --git a/types/options.go b/types/options.go index <HASH>..<HASH> 100644 --- a/types/options.go +++ b/types/options.go @@ -230,7 +230,11 @@ func getRootlessStorageOpts(rootlessUID int, systemOpts StoreOptions) (StoreOpti opts.GraphDriverName = overlayDriver } - if opts.GraphDriverName == overlayDriver { + // If the configuration file was explicitly set, then copy all the options + // present. + if defaultConfigFileSet { + opts.GraphDriverOptions = systemOpts.GraphDriverOptions + } else if opts.GraphDriverName == overlayDriver { for _, o := range systemOpts.GraphDriverOptions { if strings.Contains(o, "ignore_chown_errors") { opts.GraphDriverOptions = append(opts.GraphDriverOptions, o)
options: copy all options on explicit config file when the configuration file was explicitly specified, all the graph drivers options are copied, not only the ones allowed for rootless. Closes: <URL>
containers_storage
train
go
89c9345e36591a87df654a08333eb20fb48984f8
diff --git a/poseidon/tests/test_api.py b/poseidon/tests/test_api.py index <HASH>..<HASH> 100644 --- a/poseidon/tests/test_api.py +++ b/poseidon/tests/test_api.py @@ -46,8 +46,9 @@ def test_regions(client): assert hasattr(client, 'regions') assert isinstance(client.regions, P.Regions) regions = client.regions.list() # it works - expected = set([u'New York 1', u'Amsterdam 1', u'San Francisco 1', - u'New York 2', u'Amsterdam 2', u'Singapore 1', u'London 1']) + expected = set([u'New York 1', u'New York 3', u'Amsterdam 1', + u'San Francisco 1', u'New York 2', u'Amsterdam 2', + u'Singapore 1', u'London 1']) results = set([x['name'] for x in regions]) assert expected == results
TST: update unit test for new region NYC3
changhiskhan_poseidon
train
py
17c6a11dd0f7d834aa76b1703185adf9cae1b8a9
diff --git a/app/Statistics/Service/CountryService.php b/app/Statistics/Service/CountryService.php index <HASH>..<HASH> 100644 --- a/app/Statistics/Service/CountryService.php +++ b/app/Statistics/Service/CountryService.php @@ -555,6 +555,7 @@ class CountryService public function iso3166(): array { return [ + 'GBR' => 'GB', // Must come before ENG, NIR, SCT and WLS 'ABW' => 'AW', 'AFG' => 'AF', 'AGO' => 'AO', @@ -632,7 +633,6 @@ class CountryService 'FRO' => 'FO', 'FSM' => 'FM', 'GAB' => 'GA', - 'GBR' => 'GB', 'GEO' => 'GE', 'GHA' => 'GH', 'GIB' => 'GI',
Fix: GBR shown as England on distribution charts
fisharebest_webtrees
train
php
c9c088cdd2577376ffa8a2fccb586eb959e79531
diff --git a/bolt/org_config.go b/bolt/org_config.go index <HASH>..<HASH> 100644 --- a/bolt/org_config.go +++ b/bolt/org_config.go @@ -67,15 +67,15 @@ func (s *OrganizationConfigStore) FindOrCreate(ctx context.Context, orgID string // Update replaces the OrganizationConfig in the store func (s *OrganizationConfigStore) Update(ctx context.Context, cfg *chronograf.OrganizationConfig) error { - if cfg == nil { - return fmt.Errorf("config provided was nil") - } return s.client.db.Update(func(tx *bolt.Tx) error { return s.update(ctx, tx, cfg) }) } func (s *OrganizationConfigStore) update(ctx context.Context, tx *bolt.Tx, cfg *chronograf.OrganizationConfig) error { + if cfg == nil { + return fmt.Errorf("config provided was nil") + } if v, err := internal.MarshalOrganizationConfig(cfg); err != nil { return err } else if err := tx.Bucket(OrganizationConfigBucket).Put([]byte(cfg.OrganizationID), v); err != nil {
Move nil config guard to helper update method
influxdata_influxdb
train
go
9a4b3f8abbf641312b0808728a73c79940e9051a
diff --git a/src/main/java/com/github/uderscore/_.java b/src/main/java/com/github/uderscore/_.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/uderscore/_.java +++ b/src/main/java/com/github/uderscore/_.java @@ -414,8 +414,7 @@ public final class _ { } public static <E> List<E> shuffle(final List<E> list) { - final List<E> shuffled = new ArrayList<E>(list.size()); - Collections.copy(list, shuffled); + final List<E> shuffled = new ArrayList<E>(list); Collections.shuffle(shuffled); return shuffled; } diff --git a/src/test/java/com/github/underscore/_Test.java b/src/test/java/com/github/underscore/_Test.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/github/underscore/_Test.java +++ b/src/test/java/com/github/underscore/_Test.java @@ -257,6 +257,16 @@ _.min(numbers); } /* +_.shuffle([1, 2, 3, 4, 5, 6]); +=> [4, 1, 6, 3, 5, 2] +*/ + @Test + public void shuffle() { + final List<Integer> result = _.shuffle(asList(1, 2, 3, 4, 5, 6)); + assertEquals(6, result.size()); + } + +/* _.sample([1, 2, 3, 4, 5, 6]); => 4
Added test for the shuffle
javadev_underscore-java
train
java,java
b1ee49de8c80ea72acf019315d3dffc0ce6e06ff
diff --git a/deprecated.go b/deprecated.go index <HASH>..<HASH> 100644 --- a/deprecated.go +++ b/deprecated.go @@ -15,7 +15,7 @@ import ( func (c *Context) BindWith(obj interface{}, b binding.Binding) error { log.Println(`BindWith(\"interface{}, binding.Binding\") error is going to be deprecated, please check issue #662 and either use MustBindWith() if you - want HTTP 400 to be automatically returned if any error occur, of use + want HTTP 400 to be automatically returned if any error occur, or use ShouldBindWith() if you need to manage the error.`) return c.MustBindWith(obj, b) }
fix typo (#<I>)
gin-gonic_gin
train
go
effff490ba4a30ecc5a5f353cab14cbc2e44ff14
diff --git a/lib/chore/cli.rb b/lib/chore/cli.rb index <HASH>..<HASH> 100644 --- a/lib/chore/cli.rb +++ b/lib/chore/cli.rb @@ -89,7 +89,7 @@ module Chore register_option 'aws_secret_key', '--aws-secret-key KEY', 'Valid AWS Secret Key' - register_option 'num_workers', '--concurrency NUM', 'Number of workers to run concurrently' + register_option 'num_workers', '--concurrency NUM', Integer, 'Number of workers to run concurrently' register_option 'worker_strategy', '--worker-strategy CLASS_NAME', 'Name of a class to use as the worker strategy (default: ForkedWorkerStrategy' do |arg| options[:worker_strategy] = constantize(arg)
Make sure we convert this to an integer, otherwise things don't work so good.
Tapjoy_chore
train
rb
41a22db8260a96d2bd3ccb70c77cd6c127a13f61
diff --git a/raja.js b/raja.js index <HASH>..<HASH> 100644 --- a/raja.js +++ b/raja.js @@ -27,8 +27,9 @@ Raja.prototype.updateLink = function(resource, mtime) { link = document.createElement('link'); link.rel = "resource"; link.href = resource.url; - document.head.appendChild(link); - document.head.appendChild(document.createTextNode("\n")); + var tn = document.createTextNode("\n"); + document.head.insertBefore(tn, document.head.firstChild); + document.head.insertBefore(link, tn); } if (mtime != null) { resource.mtime = mtime;
Keep a newline after a <link>
kapouer_raja
train
js
03a2a3513ea7fb026dab40316d4dcf046af5c75e
diff --git a/webapps/ui/cockpit/plugins/base/app/views/processInstance/jobRetryBulkDialog.js b/webapps/ui/cockpit/plugins/base/app/views/processInstance/jobRetryBulkDialog.js index <HASH>..<HASH> 100644 --- a/webapps/ui/cockpit/plugins/base/app/views/processInstance/jobRetryBulkDialog.js +++ b/webapps/ui/cockpit/plugins/base/app/views/processInstance/jobRetryBulkDialog.js @@ -55,7 +55,8 @@ module.exports = [ JobResource.count({ processInstanceId: processInstance.id, - withException: true + withException: true, + noRetriesLeft: true }).$promise.then(function(data) { jobPages.total = data.count;
fix(cockpit): show error message in "Increment Number of Retries" modal dialog related to CAM-<I>
camunda_camunda-bpm-platform
train
js
700521b2028b95266d95abf87a3539b59f10c201
diff --git a/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/JSONTool.java b/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/JSONTool.java index <HASH>..<HASH> 100644 --- a/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/JSONTool.java +++ b/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/tools/JSONTool.java @@ -97,7 +97,7 @@ public class JSONTool try { return objectMapper.readValue(str, Object.class); } catch (Exception e) { - LOGGER.info("Failed to parse JSON [{}]: ", StringUtils.abbreviate(str, 32), + LOGGER.info("Failed to parse JSON [{}]: {}", StringUtils.abbreviate(str, 32), ExceptionUtils.getRootCauseMessage(e)); return null;
[Misc] Fix error-reporting bug thanks to LGTM
xwiki_xwiki-commons
train
java
ac18ec30ea7b34d3a6880dd3996867ae288a9ca5
diff --git a/src/Behat/Gherkin/Dumper.php b/src/Behat/Gherkin/Dumper.php index <HASH>..<HASH> 100644 --- a/src/Behat/Gherkin/Dumper.php +++ b/src/Behat/Gherkin/Dumper.php @@ -13,7 +13,7 @@ use Behat\Gherkin\Exception\Exception, /* * This file is part of the Behat Gherkin. - * (c) 2011 Konstantin Kudryashov <ever.zet@gmail.com> + * (c) 2012 Konstantin Kudryashov <ever.zet@gmail.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -245,9 +245,9 @@ class Dumper */ public function dumpText($text, $indent = 0) { - return $this->dumpIndent($indent) - . implode(PHP_EOL . $this->dumpIndent($indent) - , explode(PHP_EOL, $text) + return $this->dumpIndent($indent) . implode( + PHP_EOL . $this->dumpIndent($indent), + explode(PHP_EOL, $text) ); } @@ -274,9 +274,7 @@ class Dumper */ public function dumpLanguage($language) { - return $this->dumpComment( - $this->dumpKeyword('language', $language) - ); + return $this->dumpComment($this->dumpKeyword('language', $language)); } } \ No newline at end of file
copyrights, indent...
Behat_Gherkin
train
php
9dad1d00a52ac6c308766a86257b8d3461d9af07
diff --git a/client/js/util.js b/client/js/util.js index <HASH>..<HASH> 100644 --- a/client/js/util.js +++ b/client/js/util.js @@ -1,4 +1,4 @@ -/*globals window, navigator, document, FormData, File, HTMLInputElement, XMLHttpRequest, Blob*/ +/*globals window, navigator, document, FormData, File, HTMLInputElement, XMLHttpRequest, Blob, Storage*/ var qq = function(element) { "use strict"; @@ -432,7 +432,7 @@ qq.each = function(iterableItem, callback) { if (iterableItem) { // Iterate through [`Storage`](http://www.w3.org/TR/webstorage/#the-storage-interface) items - if (iterableItem.constructor === window.Storage) { + if (window.Storage && iterableItem.constructor === window.Storage) { for (keyOrIndex = 0; keyOrIndex < iterableItem.length; keyOrIndex++) { retVal = callback(iterableItem.key(keyOrIndex), iterableItem.getItem(iterableItem.key(keyOrIndex))); if (retVal === false) {
fix(util.js): fix qq-each path detection for IE7
FineUploader_fine-uploader
train
js
d68b8e4524fd03d35333dfdcadc3fbd071be3ebd
diff --git a/fusesoc/simulator/verilator.py b/fusesoc/simulator/verilator.py index <HASH>..<HASH> 100644 --- a/fusesoc/simulator/verilator.py +++ b/fusesoc/simulator/verilator.py @@ -106,7 +106,7 @@ class Verilator(Simulator): stdout = open(_s.format('out'),'w')).run() def run(self, args): - fusesoc_cli_parser = (self.tool_options['cli_parser'] == 'fusesoc') + fusesoc_cli_parser = ('cli_parser' in self.tool_options and self.tool_options['cli_parser'] == 'fusesoc') super(Verilator, self).run(args)
verilator: Check for cli_parser in tool_options before using it
olofk_fusesoc
train
py
399512a4220e34825400b27317914108b6325c51
diff --git a/saucelabs.karma.conf.js b/saucelabs.karma.conf.js index <HASH>..<HASH> 100644 --- a/saucelabs.karma.conf.js +++ b/saucelabs.karma.conf.js @@ -65,7 +65,7 @@ module.exports = (config) => { 'libs/png_support/zlib.js', 'tests/utils/compare.js', { - pattern: 'tests/**/*.spec.js', + pattern: 'tests/!(acroform|unicode)*/*.spec.js', included: true }, { pattern: 'tests/**/reference/*.pdf',
Update saucelabs.karma.conf.js
MrRio_jsPDF
train
js
3d4c5ae1f0fcc5ee97bc370baf9022746c31da49
diff --git a/src/Support/helpers.php b/src/Support/helpers.php index <HASH>..<HASH> 100644 --- a/src/Support/helpers.php +++ b/src/Support/helpers.php @@ -266,12 +266,12 @@ if (!function_exists('input')) { function input($name = null, $default = null) { if ($name === null) - return Input::all(); + return Request::all(); // Array field name, eg: field[key][key2][key3] $name = implode('.', name_to_array($name)); - return Input::get($name, $default); + return Request::get($name, $default); } }
Use Request facade instead of Input facade
tastyigniter_flame
train
php
7fd036d7757e80bc5a53b0f626a4687a058d9f5c
diff --git a/cgi-bin/speed.py b/cgi-bin/speed.py index <HASH>..<HASH> 100644 --- a/cgi-bin/speed.py +++ b/cgi-bin/speed.py @@ -1,15 +1,17 @@ #!c:/python33/python.exe # -*- coding: utf-8 -*- - +import os import cgi import time print('Content-type: text/html\n\n') - -fs = cgi.FieldStorage() -src = fs['src'].value -t0 = time.perf_counter() -exec(src) -print('CPython: %6.2f ms' % ((time.perf_counter() - t0) * 1000.0)) \ No newline at end of file +if os.environ['REMOTE_ADDR']!='127.0.0.1': + print('forbidden access') +else: + fs = cgi.FieldStorage() + src = fs['src'].value + t0 = time.perf_counter() + exec(src) + print('CPython: %6.2f ms' % ((time.perf_counter() - t0) * 1000.0)) \ No newline at end of file
Add test on REMOTE_ADDR in speed.py
brython-dev_brython
train
py
ef1ef234cc87737c631bdc31322495613c22715f
diff --git a/src/rejester/run.py b/src/rejester/run.py index <HASH>..<HASH> 100644 --- a/src/rejester/run.py +++ b/src/rejester/run.py @@ -33,6 +33,8 @@ def getch(): capture one char from stdin for responding to Y/N prompt ''' fd = sys.stdin.fileno() + if not os.isatty(fd): + return sys.stdin.read(1) old_settings = termios.tcgetattr(fd) try: tty.setraw(sys.stdin.fileno())
'rejester delete' doesn't crash if run noninteractively
diffeo_rejester
train
py
ffad10343916fb6cf3029742717936c8745932a5
diff --git a/src/components/hand-controls.js b/src/components/hand-controls.js index <HASH>..<HASH> 100644 --- a/src/components/hand-controls.js +++ b/src/components/hand-controls.js @@ -27,7 +27,6 @@ var EVENTS = {}; EVENTS[ANIMATIONS.fist] = 'grip'; EVENTS[ANIMATIONS.thumbUp] = 'pistol'; EVENTS[ANIMATIONS.point] = 'pointing'; -EVENTS[ANIMATIONS.thumb] = 'thumb'; /** * Hand controls component that abstracts 6DoF controls: @@ -378,7 +377,7 @@ function getGestureEventName (gesture, active) { if (eventName === 'grip') { return eventName + (active ? 'close' : 'open'); } - if (eventName === 'point' || eventName === 'thumb') { + if (eventName === 'point') { return eventName + (active ? 'up' : 'down'); } if (eventName === 'pointing' || eventName === 'pistol') {
Remove unused reference to thumb events `ANIMATIONS.thumb` did not exist, so "thumb" events would never be triggered
aframevr_aframe
train
js
1f714c0faa495c21c73b16e8c85a7edba905cf09
diff --git a/src/libhoney.js b/src/libhoney.js index <HASH>..<HASH> 100644 --- a/src/libhoney.js +++ b/src/libhoney.js @@ -33,10 +33,10 @@ const defaults = Object.freeze({ // the maximum number of pending events we allow in our queue before they get batched pendingWorkCapacity: 10000, - // the maximum number of s we enqueue before we drop. + // the maximum number of events we enqueue before we begin dropping them. maxResponseQueueSize: 1000, - // if this is false, all sending is disabled. useful for disabling libhoney when testing + // if this is set to true, all sending is disabled. useful for disabling libhoney when testing disabled: false });
Tweak Libhoney config comments
honeycombio_libhoney-js
train
js
2e17b88ef18ccf3d4aa74878ef5d932b0a44bd30
diff --git a/src/PdoAdapter.php b/src/PdoAdapter.php index <HASH>..<HASH> 100644 --- a/src/PdoAdapter.php +++ b/src/PdoAdapter.php @@ -370,9 +370,7 @@ class PdoAdapter implements AdapterInterface */ protected function getChunkResource($pathId, $isCompressed) { - $filename = $this->getTempFilename(); - $resource = $this->getTempResource($filename, ''); - + $resource = fopen('php://temp', 'w+b'); $compressFilter = null; if ($isCompressed) { $compressFilter = stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_WRITE);
Fix #3 Use php://temp for file resources When getChunkResource is called for file reads, it now uses the php://temp resource which automatically cleans up. This should mean less temporary files left behind.
phlib_flysystem-pdo
train
php
c5baaaf034ebf79b3b775f3835e41754686a9ecd
diff --git a/lib/generators/hyrax/templates/catalog_controller.rb b/lib/generators/hyrax/templates/catalog_controller.rb index <HASH>..<HASH> 100644 --- a/lib/generators/hyrax/templates/catalog_controller.rb +++ b/lib/generators/hyrax/templates/catalog_controller.rb @@ -21,6 +21,10 @@ class CatalogController < ApplicationController config.view.gallery.partials = [:index_header, :index] config.view.slideshow.partials = [:index] + # Because too many times on Samvera tech people raise a problem regarding a failed query to SOLR. + # Often, it's because they inadvertantly exceeded the character limit of a GET request. + config.http_method :post + ## Default parameters to send to solr for all search-like requests. See also SolrHelper#solr_search_params config.default_solr_params = { qt: "search",
Switching blacklight http_method to :post Because too many times on Samvera tech people raise a problem regarding a failed query to SOLR. Often, it's because they inadvertantly exceeded the character limit of a GET request.
samvera_hyrax
train
rb
c5ddf8aa81e878538158cac3e998b803c639d524
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -39,8 +39,8 @@ install_requires = [ 'Flask~=0.0,>=0.12.2', 'IDUtils~=0.0,>=0.2.4', 'dojson~=1.0,>=1.3.1', - 'inspire-schemas~=54.0,>=54.0.0', - 'inspire-utils~=0.0,>=0.1.0', + 'inspire-schemas~=55.0,>=55.0.1', + 'inspire-utils~=1.0,>=1.0.0', 'isbnid_fork~=0.0,>=0.5.2', 'langdetect~=1.0,>=1.0.7', 'pycountry~=17.0,>=17.5.4', diff --git a/tests/test_hep_bd9xx.py b/tests/test_hep_bd9xx.py index <HASH>..<HASH> 100644 --- a/tests/test_hep_bd9xx.py +++ b/tests/test_hep_bd9xx.py @@ -1017,6 +1017,7 @@ def test_references_from_999C50_9_r_u_h_m_o(): assert expected == result['999C5'] +@pytest.mark.xfail(reason='name is normalized incorrectly') def test_reference_from_999C5t_p_y_e_o(): schema = load_schema('hep') subschema = schema['properties']['references']
setup: bump inspire-schemas to version ~<I> Sem-ver: breaks compatibility
inspirehep_inspire-dojson
train
py,py
7c89c8037c3a6cb358c99732e83c4c6d5c791886
diff --git a/salt/states/user.py b/salt/states/user.py index <HASH>..<HASH> 100644 --- a/salt/states/user.py +++ b/salt/states/user.py @@ -270,7 +270,7 @@ def present(name, gid The id of the default group to assign to the user. Either a group name or gid can be used. If not specified, and the user does not exist, then - he next available gid will be assigned. + the next available gid will be assigned. gid_from_name : False If ``True``, the default group id will be set to the id of the group
Porting PR #<I> to <I>
saltstack_salt
train
py
d66ba348be507e530189e33c55e9678394e168b4
diff --git a/presto-main/src/main/java/com/facebook/presto/sql/planner/planPrinter/PlanPrinter.java b/presto-main/src/main/java/com/facebook/presto/sql/planner/planPrinter/PlanPrinter.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/sql/planner/planPrinter/PlanPrinter.java +++ b/presto-main/src/main/java/com/facebook/presto/sql/planner/planPrinter/PlanPrinter.java @@ -1351,9 +1351,8 @@ public class PlanPrinter return "NULL"; } - Signature coercion = functionRegistry.getCoercion(type, VARCHAR); - try { + Signature coercion = functionRegistry.getCoercion(type, VARCHAR); Slice coerced = (Slice) new FunctionInvoker(functionRegistry).invoke(coercion, session.toConnectorSession(), value); return coerced.toStringUtf8(); }
Fix exception caused by coersion in plan printer PlanPrinter can throw an exception when attempting to convert a constant to a String
prestodb_presto
train
java
6847577c232e68bfa0b731c09bd29cd1c66e38eb
diff --git a/library/CM/SmartyPlugins/function.date_period.php b/library/CM/SmartyPlugins/function.date_period.php index <HASH>..<HASH> 100644 --- a/library/CM/SmartyPlugins/function.date_period.php +++ b/library/CM/SmartyPlugins/function.date_period.php @@ -8,8 +8,8 @@ function smarty_function_date_period(array $params, Smarty_Internal_Template $te if (($seconds / (365 * 86400)) >= 1) { $count = floor($seconds / (365 * 86400)); $periodName = 'year'; - } elseif (($seconds / (31 * 86400)) >= 1) { - $count = floor($seconds / (31 * 86400)); + } elseif (($seconds / (30 * 86400)) >= 1) { + $count = floor($seconds / (30 * 86400)); $periodName = 'month'; } elseif (($seconds / (7 * 86400)) >= 1) { $count = floor($seconds / (7 * 86400));
Make a month have <I> days, so it fits all our serviceBundles
cargomedia_cm
train
php
a8aef8e6be1663e0327790abe25a2e9f3bba9cee
diff --git a/app/framework/directives/module.js b/app/framework/directives/module.js index <HASH>..<HASH> 100644 --- a/app/framework/directives/module.js +++ b/app/framework/directives/module.js @@ -2,7 +2,7 @@ var directiveModules = angular.module('onsen.directives', []); // [] -> create n directiveModules.factory('ONSEN_CONSTANTS', function() { var CONSTANTS = { - DIRECTIVE_TEMPLATE_URL: "onsenui/templates" + DIRECTIVE_TEMPLATE_URL: "plugins/onsenui/templates" }; return CONSTANTS;
change template file path prefix with plugins
OnsenUI_OnsenUI
train
js
4fef1f0154aaea41cf92de7366388cada38333d8
diff --git a/lib/buildbox/monitor.rb b/lib/buildbox/monitor.rb index <HASH>..<HASH> 100644 --- a/lib/buildbox/monitor.rb +++ b/lib/buildbox/monitor.rb @@ -20,11 +20,8 @@ module Buildbox if build.started? || build.finished? new_build = @api.update_build(build) - p new_build.state - # Try and cancel the build if we haven't tried already if new_build.state == 'canceled' && !@build.cancelling? - p 'going tot ry and cancel' Buildbox::Canceler.cancel(@build) end end @@ -32,7 +29,7 @@ module Buildbox if build.finished? break else - sleep 3 # 3 seconds seems reasonable for now + sleep 2 # 2 seconds seems reasonable for now end end end
Removed some debugging code from the monitor.
buildkite_buildbox-agent-ruby
train
rb
8860bfa6c9e656704fe0d843bb75117dc5d1958b
diff --git a/cmd/pivnet/commands/pivnet.go b/cmd/pivnet/commands/pivnet.go index <HASH>..<HASH> 100644 --- a/cmd/pivnet/commands/pivnet.go +++ b/cmd/pivnet/commands/pivnet.go @@ -14,7 +14,7 @@ const ( printAsJSON = "json" printAsYAML = "yaml" - host = "https://network.pivotal.io" + defaultHost = "https://network.pivotal.io" ) type PivnetCommand struct { @@ -51,7 +51,7 @@ func init() { } if Pivnet.Host == "" { - Pivnet.Host = host + Pivnet.Host = defaultHost } } diff --git a/cmd/pivnet/main.go b/cmd/pivnet/main.go index <HASH>..<HASH> 100644 --- a/cmd/pivnet/main.go +++ b/cmd/pivnet/main.go @@ -8,9 +8,16 @@ import ( "github.com/pivotal-cf-experimental/go-pivnet/cmd/pivnet/version" ) +var ( + // buildVersion is deliberately left uninitialized so it can be set at compile-time + buildVersion string +) + func main() { - if version.Version == "" { + if buildVersion == "" { version.Version = "dev" + } else { + version.Version = buildVersion } parser := flags.NewParser(&commands.Pivnet, flags.HelpFlag)
Inject version into cli correctly. [#<I>]
pivotal-cf_go-pivnet
train
go,go
a16e0bba2f3284278cafbc702c068f9fa4be5de0
diff --git a/repo/config/init.go b/repo/config/init.go index <HASH>..<HASH> 100644 --- a/repo/config/init.go +++ b/repo/config/init.go @@ -35,7 +35,8 @@ func Init(out io.Writer, nBitsForKeypair int) (*Config, error) { "/ip4/0.0.0.0/tcp/4001", // "/ip4/0.0.0.0/udp/4002/utp", // disabled for now. }, - API: "/ip4/127.0.0.1/tcp/5001", + API: "/ip4/127.0.0.1/tcp/5001", + Gateway: "/ip4/127.0.0.1/tcp/8080", }, Bootstrap: BootstrapPeerStrings(bootstrapPeers),
repo/config: Added default gateway address to initial config
ipfs_go-ipfs
train
go
e4ca183733535222018b86edb4d23697be0f49b8
diff --git a/redis/client.py b/redis/client.py index <HASH>..<HASH> 100644 --- a/redis/client.py +++ b/redis/client.py @@ -65,7 +65,10 @@ def parse_info(response): if line and not line.startswith('#'): key, value = line.split(':') try: - info[key] = float(value) if '.' in value else int(value) + if '.' in value: + info[key] = float(value) + else: + info[key] = int(value) except ValueError: info[key] = get_value(value) return info
Remove ternary operator to support Python <I>
andymccurdy_redis-py
train
py
84af9dc155bc5430352e51bbd0d7d989a82f73a3
diff --git a/devices/tuya.js b/devices/tuya.js index <HASH>..<HASH> 100644 --- a/devices/tuya.js +++ b/devices/tuya.js @@ -331,6 +331,7 @@ module.exports = [ {modelID: 'TS0601', manufacturerName: '_TZE200_dfxkcots'}, {modelID: 'TS0601', manufacturerName: '_TZE200_ojzhk75b'}, {modelID: 'TS0601', manufacturerName: '_TZE200_swaamsoy'}, + {modelID: 'TS0601', manufacturerName: '_TZE200_3p5ydos3'}, ], model: 'TS0601_dimmer', vendor: 'TuYa',
Add _TZE<I>_3p5ydos3 to TS<I>_dimmer (#<I>)
Koenkk_zigbee-shepherd-converters
train
js
d5afa3c0508094f35f659cb22ce012143a9dd48f
diff --git a/api/src/main/java/org/hobsoft/microbrowser/MicrodataProperty.java b/api/src/main/java/org/hobsoft/microbrowser/MicrodataProperty.java index <HASH>..<HASH> 100644 --- a/api/src/main/java/org/hobsoft/microbrowser/MicrodataProperty.java +++ b/api/src/main/java/org/hobsoft/microbrowser/MicrodataProperty.java @@ -67,5 +67,16 @@ public interface MicrodataProperty */ double getDoubleValue(); + /** + * Gets this item property as the specified type to allow access to the provider-specific API. + * + * @param <T> + * the type of the provider-specific API + * @param type + * the type of the provider-specific API required + * @return an instance of the provider-specific API + * @throws IllegalArgumentException + * if the provider does not support the specific type + */ <T> T unwrap(Class<T> type); }
Issue #6: Added Javadoc for MicrodataProperty.unwrap
markhobson_microbrowser
train
java
bc16ea79084120025e67f9d0875e3231ec8b5d13
diff --git a/redis_collections/sortedsets.py b/redis_collections/sortedsets.py index <HASH>..<HASH> 100644 --- a/redis_collections/sortedsets.py +++ b/redis_collections/sortedsets.py @@ -444,12 +444,9 @@ class GeoDB(SortedSetBase): """ pickled_place_1 = self._pickle(place_1) pickled_place_2 = self._pickle(place_2) - try: - return self.redis.geodist( - self.key, pickled_place_1, pickled_place_2, unit=unit - ) - except TypeError: - return None + return self.redis.geodist( + self.key, pickled_place_1, pickled_place_2, unit=unit + ) def get_hash(self, place): """ @@ -458,10 +455,7 @@ class GeoDB(SortedSetBase): instead. """ pickled_place = self._pickle(place) - try: - return self.redis.geohash(self.key, pickled_place)[0] - except (AttributeError, TypeError): - return None + return self.redis.geohash(self.key, pickled_place)[0] def get_location(self, place): """
Rely on redis <I>
honzajavorek_redis-collections
train
py
e2b217f2407a4f16b99516caf8934a12b16d58de
diff --git a/src/humanize/filesize.py b/src/humanize/filesize.py index <HASH>..<HASH> 100644 --- a/src/humanize/filesize.py +++ b/src/humanize/filesize.py @@ -23,6 +23,9 @@ def naturalsize(value, binary=False, gnu=False, format="%.1f"): gnu (bool): If `True`, the binary argument is ignored and GNU-style (`ls -sh` style) prefixes are used (K, M) with the 2**10 definition. format (str): Custom formatter. + + Returns: + str: Human readable representation of a filesize. """ if gnu: suffix = suffixes["gnu"] diff --git a/src/humanize/i18n.py b/src/humanize/i18n.py index <HASH>..<HASH> 100644 --- a/src/humanize/i18n.py +++ b/src/humanize/i18n.py @@ -36,6 +36,9 @@ def activate(locale, path=None): Returns: dict: Translations. + + Raises: + Exception: If humanize cannot find the locale folder. """ if path is None: path = _get_default_locale_path()
Add some missing returns/raises
jmoiron_humanize
train
py,py
0969439c702fb49430391f3655640eadafc43648
diff --git a/_config.php b/_config.php index <HASH>..<HASH> 100644 --- a/_config.php +++ b/_config.php @@ -9,8 +9,6 @@ * and if absolutely necessary if you can't use the yml file, mysite/_config.php instead. */ -use CWP\Core\Extension\CwpControllerExtension; -use SilverStripe\Core\Config\Config; use SilverStripe\Core\Environment; use SilverStripe\HybridSessions\HybridSession; use SilverStripe\i18n\i18n; @@ -29,8 +27,8 @@ if (!Environment::getEnv('WKHTMLTOPDF_BINARY')) { // Configure password strength requirements $pwdValidator = new PasswordValidator(); -$pwdValidator->characterStrength(3, ["lowercase", "uppercase", "digits", "punctuation"]); - +$pwdValidator->setMinTestScore(3); +$pwdValidator->setTestNames(["lowercase", "uppercase", "digits", "punctuation"]); Member::set_password_validator($pwdValidator); // Automatically configure session key for activedr with hybridsessions module
MINOR Remove deprecated use of characterStrength and remove unused imports
silverstripe_cwp-core
train
php
ca95ef9bc5917d04bc21290bdb9a18c4789d3d1b
diff --git a/shims.php b/shims.php index <HASH>..<HASH> 100644 --- a/shims.php +++ b/shims.php @@ -3,7 +3,7 @@ namespace { // PHPUnit 6 compat - if (class_exists('PHPUnit\Framework\TestCase')) { + if ( class_exists( 'PHPUnit\Runner\Version' ) && version_compare( PHPUnit\Runner\Version::id(), '6.0', '>=' ) ) { $aliases = [ 'PHPUnit\Framework\Test' => 'PHPUnit_Framework_Test', 'PHPUnit\Framework\TestSuite' => 'PHPUnit_Framework_TestSuite',
use the runner version to load shims
lucatume_wp-browser
train
php
6c74bfdf1f0851ebb3d34811eac1488b48748471
diff --git a/lib/Constants.js b/lib/Constants.js index <HASH>..<HASH> 100644 --- a/lib/Constants.js +++ b/lib/Constants.js @@ -88,10 +88,11 @@ module.exports = { changeNickname: 1 << 26, manageNicknames: 1 << 27, manageRoles: 1 << 28, - all: 0b11111111101111111110000111111, - allGuild: 0b11100000000000000000000111111, - allText: 0b10000000001111111110000010001, - allVoice: 0b10011111100000000000000010001 + manageEmojis: 1 << 30, + all: 0b1111111111101111111110000111111, + allGuild: 0b1111100000000000000000000111111, + allText: 0b0010000000001111111110000010001, + allVoice: 0b0010011111100000000000000010001 }, VoiceOPCodes: { IDENTIFY: 0,
Add manageEmojis permission constant Bonus question: what's this hidden 1 << <I>?
abalabahaha_eris
train
js
5f63670dabfe45ef72b618e5191e39c4fc48e012
diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/classical.py +++ b/openquake/calculators/classical.py @@ -190,9 +190,12 @@ def preclassical(srcs, srcfilter, params, monitor): # this can be slow for src in srcs: t0 = time.time() - src.nsites = len(srcfilter.close_sids(src)) + if srcfilter.sitecol: + src.nsites = len(srcfilter.close_sids(src)) + else: + src.nsites = 1 # don't discard # NB: it is crucial to split only the close sources, for - # performance reasons (think of Ecuador in SAM) + # performance reasons (think of Ecuador in SAM)q splits = split_source(src) if ( params['split_sources'] and src.nsites) else [src] sources.extend(splits)
Small fix of preclassical for missing sitecol
gem_oq-engine
train
py
21d26012d58f0b2ef2b087e23c55e836cc4c98a6
diff --git a/test/e2e/nvidia-gpus.go b/test/e2e/nvidia-gpus.go index <HASH>..<HASH> 100644 --- a/test/e2e/nvidia-gpus.go +++ b/test/e2e/nvidia-gpus.go @@ -163,8 +163,17 @@ func dsFromManifest(url string) *extensions.DaemonSet { var controller extensions.DaemonSet framework.Logf("Parsing ds from %v", url) - response, err := http.Get(url) + var response *http.Response + var err error + for i := 1; i <= 5; i++ { + response, err = http.Get(url) + if err == nil && response.StatusCode == 200 { + break + } + time.Sleep(time.Duration(i) * time.Second) + } Expect(err).NotTo(HaveOccurred()) + Expect(response.StatusCode).To(Equal(200)) defer response.Body.Close() data, err := ioutil.ReadAll(response.Body)
Retry downloading the daemonset installer few times to avoid spurious network issues.
kubernetes_kubernetes
train
go
2f1dc83cd0ecf0e86ffb84afd8347bd071055b21
diff --git a/sub_peers.js b/sub_peers.js index <HASH>..<HASH> 100644 --- a/sub_peers.js +++ b/sub_peers.js @@ -88,6 +88,13 @@ TChannelSubPeers.prototype.add = function add(hostPort, options) { peer = topChannel.peers.add(hostPort, options); peer.setPreferConnectionDirection(self.preferConnectionDirection); + if (peer.countConnections('out') > 0) { + this.currentConnectedPeers++; + } + + peer.incrementOutConnectionEvent.on(self.boundOnOutConnectionIncrement); + peer.decrementOutConnectionEvent.on(self.boundOnOutConnectionDecrement); + self._map[hostPort] = peer; self._keys.push(hostPort); @@ -113,6 +120,15 @@ TChannelSubPeers.prototype._delete = function _del(peer) { return; } + if (peer.countConnections('out') > 0) { + this.currentConnectedPeers--; + } + + peer.incrementOutConnectionEvent + .removeListener(self.boundOnOutConnectionIncrement); + peer.decrementOutConnectionEvent + .removeListener(self.boundOnOutConnectionDecrement); + delete self._map[peer.hostPort]; popout(self._keys, index);
sub_peers: hook up event listeners
uber_tchannel-node
train
js
ee7625a3a2d0c9db0ab7d1b4b98c5f6e705d970d
diff --git a/uDMX.py b/uDMX.py index <HASH>..<HASH> 100644 --- a/uDMX.py +++ b/uDMX.py @@ -250,6 +250,7 @@ def send_dmx_message(message_tokens): # Open the uDMX USB device dev = pyuDMX.uDMXDevice() if not dev.open(): + print "Unable to find and open uDMX interface" return False # Translate the tokens into integers.
Show error message when no uDMX is found
dhocker_udmx-pyusb
train
py
6bab83683bf46352b59ab01cf596804dfdf7d973
diff --git a/examples/seq2seq/finetune_trainer.py b/examples/seq2seq/finetune_trainer.py index <HASH>..<HASH> 100755 --- a/examples/seq2seq/finetune_trainer.py +++ b/examples/seq2seq/finetune_trainer.py @@ -175,11 +175,11 @@ def main(): bool(training_args.parallel_mode == ParallelMode.DISTRIBUTED), training_args.fp16, ) + transformers.utils.logging.enable_default_handler() + transformers.utils.logging.enable_explicit_format() # Set the verbosity to info of the Transformers logger (on main process only): if is_main_process(training_args.local_rank): transformers.utils.logging.set_verbosity_info() - transformers.utils.logging.enable_default_handler() - transformers.utils.logging.enable_explicit_format() logger.info("Training/evaluation parameters %s", training_args) # Set seed
fix logger format for non-main process (#<I>)
huggingface_pytorch-pretrained-BERT
train
py
3cfc9d43eb8f7c90e99bf09967027c8a9ccbddcd
diff --git a/test/minimal_app_test.rb b/test/minimal_app_test.rb index <HASH>..<HASH> 100644 --- a/test/minimal_app_test.rb +++ b/test/minimal_app_test.rb @@ -26,7 +26,7 @@ if RubotoTest::RUBOTO_PLATFORM == 'STANDALONE' '1.6.8' => 3.5, '1.7.0.preview1' => 4.6, '1.7.0.preview2' => ANDROID_TARGET < 15 ? 4.7 : 4.9, - '1.7.0.rc1' => ANDROID_TARGET < 15 ? 4.7 : 4.9, + '1.7.0.rc1' => ANDROID_TARGET < 15 ? 4.7 : 5.3, }[JRUBY_JARS_VERSION.to_s] || 3.2 lower_limit = upper_limit * 0.9 version_message ="JRuby: #{JRUBY_JARS_VERSION}, ANDROID_TARGET: #{ANDROID_TARGET}"
* Adjust minimal app side to new JRuby
ruboto_ruboto
train
rb
c0da0af85d044e9a7bc7b64c86657857df1e27fe
diff --git a/src/app/Traits/UpdatedBy.php b/src/app/Traits/UpdatedBy.php index <HASH>..<HASH> 100644 --- a/src/app/Traits/UpdatedBy.php +++ b/src/app/Traits/UpdatedBy.php @@ -6,6 +6,10 @@ trait UpdatedBy { protected static function bootUpdatedBy() { + self::creating(function ($model) { + $model->updated_by = optional(auth()->user())->id; + }); + self::updating(function ($model) { $model->updated_by = optional(auth()->user())->id; });
updates updatedBy to fit Laravel style
laravel-enso_TrackWho
train
php
e33a160cf0f2943892f7698761d0500ee53c8e2a
diff --git a/demo/src/index.js b/demo/src/index.js index <HASH>..<HASH> 100644 --- a/demo/src/index.js +++ b/demo/src/index.js @@ -8,7 +8,7 @@ import { } from "three"; import { DemoManager } from "three-demo"; -import { EffectComposer } from "../../src"; +import { EffectComposer, OverrideMaterialManager } from "../../src"; import { AntialiasingDemo } from "./demos/AntialiasingDemo.js"; import { BloomDemo } from "./demos/BloomDemo.js"; @@ -217,6 +217,9 @@ window.addEventListener("load", (event) => { renderer.shadowMap.needsUpdate = true; renderer.shadowMap.enabled = true; + // Enable the override material workaround. + OverrideMaterialManager.workaroundEnabled = true; + // Create the effect composer. composer = new EffectComposer(renderer, { frameBufferType: HalfFloatType
Enable override material workaround
vanruesc_postprocessing
train
js
b754836feb490091841366c0902d29c0816d9149
diff --git a/lib/tomlrb.rb b/lib/tomlrb.rb index <HASH>..<HASH> 100644 --- a/lib/tomlrb.rb +++ b/lib/tomlrb.rb @@ -1,6 +1,9 @@ require 'time' require 'stringio' require "tomlrb/version" +require 'tomlrb/local_date_time' +require 'tomlrb/local_date' +require 'tomlrb/local_time' require 'tomlrb/string_utils' require "tomlrb/scanner" require "tomlrb/parser"
Load LocalDateTime and so on
fbernier_tomlrb
train
rb