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
db54b301e9ad9573eaa9fe1d9ce349f67d2c4102
diff --git a/lib/puppet/indirector/catalog/static_compiler.rb b/lib/puppet/indirector/catalog/static_compiler.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/indirector/catalog/static_compiler.rb +++ b/lib/puppet/indirector/catalog/static_compiler.rb @@ -115,7 +115,7 @@ class Puppet::Resource::Catalog::StaticCompiler < Puppet::Indirector::Code existing_names = catalog.resources.collect { |r| r.to_s } both = (existing_names & children.keys).inject({}) { |hash, name| hash[name] = true; hash } - + both.each { |name| children.delete(name) } end @@ -130,8 +130,8 @@ class Puppet::Resource::Catalog::StaticCompiler < Puppet::Indirector::Code Puppet.info "Content for '#{resource[:source]}' already exists" else Puppet.info "Storing content for source '#{resource[:source]}'" - content = Puppet::FileServing::Content.find(resource[:source]) - Puppet::FileBucket::File.new(content.content).save + content = Puppet::FileServing::Content.indirection.find(resource[:source]) + Puppet::FileBucket::File.indirection.save(Puppet::FileBucket::File.new(content.content)) end end end
Properly call indirector when storing file content Prior to this commit, the static compiler did not specify to use indirection when finding file content nor when saving a file to the filebucket. This commit properly calls the indirection method to resolve the issue
puppetlabs_puppet
train
rb
4d694e471948bba51922f0998aaa2186208f2bb3
diff --git a/src/main/Rendering.js b/src/main/Rendering.js index <HASH>..<HASH> 100644 --- a/src/main/Rendering.js +++ b/src/main/Rendering.js @@ -173,15 +173,13 @@ class Rendering { /** * Creates a Template to use as start and end marks - * @param {String} id * @param {String} text * @returns {Node} * @private */ - _createStartEndWrapTemplate(id, text) { + _createStartEndWrapTemplate(text) { var el = this._createWrapTemplate(), vTrue = "true"; el.setAttribute(ATTR_DATA_START_END, vTrue); - el.id = id; el.textContent = text; return el; } @@ -197,7 +195,7 @@ class Rendering { * @returns {Node} */ _createStartOrEndContainer(initialNode, prefix, text, offset, index) { - const wrapper = this._createStartEndWrapTemplate(prefix + this.getId(), text); + const wrapper = this._createStartEndWrapTemplate(text); wrapper.setAttribute(ATTR_DATA_ORIGINAL_INDEX, Rendering._getIndexParentIfHas(initialNode, index)); wrapper.setAttribute(ATTR_DATA_ORIGINAL_OFFSET_START, offset); wrapper.setAttribute(DATA_ORIGINAL_TEXT_NODE_INDEX, index);
removed ID from start/end element(s)
BowlingX_marklib
train
js
0b380aed816db3cea01159dcdc2bcb75d481d3ed
diff --git a/xwiki-commons-tools/xwiki-commons-tool-verification-resources/src/main/java/org/xwiki/tool/checkstyle/UnstableAnnotationCheck.java b/xwiki-commons-tools/xwiki-commons-tool-verification-resources/src/main/java/org/xwiki/tool/checkstyle/UnstableAnnotationCheck.java index <HASH>..<HASH> 100644 --- a/xwiki-commons-tools/xwiki-commons-tool-verification-resources/src/main/java/org/xwiki/tool/checkstyle/UnstableAnnotationCheck.java +++ b/xwiki-commons-tools/xwiki-commons-tool-verification-resources/src/main/java/org/xwiki/tool/checkstyle/UnstableAnnotationCheck.java @@ -22,7 +22,7 @@ package org.xwiki.tool.checkstyle; import java.util.ArrayList; import java.util.List; -import com.puppycrawl.tools.checkstyle.api.AnnotationUtility; +import com.puppycrawl.tools.checkstyle.AnnotationUtility; import com.puppycrawl.tools.checkstyle.api.Check; import com.puppycrawl.tools.checkstyle.api.CheckstyleException; import com.puppycrawl.tools.checkstyle.api.DetailAST;
[misc] Fix deprecated call (and make it usable with current Eclipsecs version)
xwiki_xwiki-commons
train
java
07a3c124115b2d4eaeee829fccd80f9cd583ff51
diff --git a/channelpack/pack.py b/channelpack/pack.py index <HASH>..<HASH> 100644 --- a/channelpack/pack.py +++ b/channelpack/pack.py @@ -246,7 +246,7 @@ class ChannelPack: diffs.append((diff, diff[0], sc)) if hasattr(self, 'metamulti'): - for sc in self.metamulti['slicelist']: + for sc in self.metamulti['slices']: diffsappend(self(key)[sc], sc) else: diffsappend(self(key), slice(0, self.rec_cnt))
Bugfix in rebase function.
tomnor_channelpack
train
py
c1ae7e65d56d4a079ce9bf9ddac5d4fa6edb45c1
diff --git a/test/helper.rb b/test/helper.rb index <HASH>..<HASH> 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -66,7 +66,7 @@ class Sidetiq::TestCase < MiniTest::Test end end -# Override Celluloid's at_exit hook. +# Override Celluloid's at_exit hook manually. at_exit { - Minitest.run ARGV + exit Minitest.run(ARGV) || false }
Return status code correctly when running tests.
endofunky_sidetiq
train
rb
f29e8ebc8aa6abe5f3de9dff80986a357a838a60
diff --git a/bundles/LayoutsAdminBundle/Controller/Admin/LayoutResolver/CopyRule.php b/bundles/LayoutsAdminBundle/Controller/Admin/LayoutResolver/CopyRule.php index <HASH>..<HASH> 100644 --- a/bundles/LayoutsAdminBundle/Controller/Admin/LayoutResolver/CopyRule.php +++ b/bundles/LayoutsAdminBundle/Controller/Admin/LayoutResolver/CopyRule.php @@ -30,7 +30,7 @@ final class CopyRule extends AbstractController $this->denyAccessUnlessGranted('nglayouts:mapping:edit'); $updateStruct = $this->layoutResolverService->newRuleMetadataUpdateStruct(); - $updateStruct->priority = $rule->getPriority() + 1; + $updateStruct->priority = $rule->getPriority() - 1; $copiedRule = $this->layoutResolverService->updateRuleMetadata( $this->layoutResolverService->copyRule($rule),
Place the copied rule below the original one
netgen-layouts_layouts-core
train
php
dc1aa8092220200b01c0a5bbc3f26b9e3f173ef9
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ setup(name=PACKAGE_NAME, keywords='scratch static-analysis', license='Simplified BSD License', long_description=README, - packages=[PACKAGE_NAME], + packages=[PACKAGE_NAME, '{0}.plugins'.format(PACKAGE_NAME)], test_suite=PACKAGE_NAME, url='https://github.com/ucsb-cs-education/hairball', version=VERSION)
Inform setup.py of hairball.plugins.
ucsb-cs-education_hairball
train
py
63255bfb8c32773ee405441185c5d036f325b95a
diff --git a/tests/test_jams.py b/tests/test_jams.py index <HASH>..<HASH> 100644 --- a/tests/test_jams.py +++ b/tests/test_jams.py @@ -1120,6 +1120,6 @@ def test_deprecated(): def test_numpy_serialize(): - + # Test to trigger issue #159 - serializing numpy dtypes jobj = jams.JObject(key=np.float32(1.0)) - jobj.__json__ + jobj.dumps()
added unit test for fix to #<I>
marl_jams
train
py
a2ab1eda1a1e7799f6de43eb77e8d66e388ca35b
diff --git a/dev/com.ibm.ws.threading_policy_fat/test-applications/basicfat/src/web/PolicyExecutorServlet.java b/dev/com.ibm.ws.threading_policy_fat/test-applications/basicfat/src/web/PolicyExecutorServlet.java index <HASH>..<HASH> 100644 --- a/dev/com.ibm.ws.threading_policy_fat/test-applications/basicfat/src/web/PolicyExecutorServlet.java +++ b/dev/com.ibm.ws.threading_policy_fat/test-applications/basicfat/src/web/PolicyExecutorServlet.java @@ -4368,7 +4368,10 @@ public class PolicyExecutorServlet extends FATServlet { assertTrue(future.isDone()); assertFalse(future.isCancelled()); assertEquals(0, future.getElapsedRunTime(TimeUnit.NANOSECONDS)); - assertEquals(queueTimeNS, future.getElapsedQueueTime(TimeUnit.NANOSECONDS)); + boolean sameQueueTime = false; + for (long start = System.nanoTime(); !sameQueueTime && System.nanoTime() - start < TIMEOUT_NS; Thread.sleep(200)) + sameQueueTime = queueTimeNS == future.getElapsedQueueTime(TimeUnit.NANOSECONDS); + assertTrue(sameQueueTime); // Additional testing for the measured run time of the blocker task assertTrue(blockerFuture.get(TIMEOUT_NS, TimeUnit.NANOSECONDS));
Issue #<I> testStartTimeout makes invalid timing assumption
OpenLiberty_open-liberty
train
java
8152f3dc53669c76e794b33e356a5ed9ae2f5814
diff --git a/lib/swag_dev/project/tasks/gem/install.rb b/lib/swag_dev/project/tasks/gem/install.rb index <HASH>..<HASH> 100644 --- a/lib/swag_dev/project/tasks/gem/install.rb +++ b/lib/swag_dev/project/tasks/gem/install.rb @@ -4,17 +4,19 @@ require 'cliver' require_relative '../gem' -project = SwagDev.project -builder = project.tools.fetch(:gemspec_builder) - desc 'Install gem' task 'gem:install': ['gem:build'] do - sh(*[Cliver.detect(:sudo), - Cliver.detect!(:gem), - :install, - '-u', - '--verbose', - '--no-document', - '--clear-sources', - project.gem.package].compact.map(&:to_s)) + project = SwagDev.project + command = [ + Cliver.detect(:sudo), + Cliver.detect!(:gem), + :install, + '-u', + '--verbose', + '--no-document', + '--clear-sources', + project.tools.fetch(:gemspec_builder).buildable + ].compact.map(&:to_s) + + sh(*command) end
gem/install (tasks) gemspec_builder use + rewrite
SwagDevOps_kamaze-project
train
rb
94a5c8759c2f85fdd15851df9d38dbf63de302e3
diff --git a/splunklib/client.py b/splunklib/client.py index <HASH>..<HASH> 100644 --- a/splunklib/client.py +++ b/splunklib/client.py @@ -2457,6 +2457,7 @@ class Job(Entity): """ if (not self.is_ready()): return False + self.refresh() return self['isDone'] == '1' def is_ready(self):
Fix behavior of is_done() -- it needed to refresh, since is_ready is no longer doing so.
splunk_splunk-sdk-python
train
py
dbf6010494c4b7a1800867516d6aa4d64fb35147
diff --git a/openquake/db/models.py b/openquake/db/models.py index <HASH>..<HASH> 100644 --- a/openquake/db/models.py +++ b/openquake/db/models.py @@ -1531,15 +1531,14 @@ class GmfSet(djm.Model): """ job = self.gmf_collection.output.oq_job hc = job.hazard_calculation - job_stats = JobStats.objects.get(oq_job=job.id) - block_size = len(hc.points_to_compute()) + num_tasks = JobStats.objects.get(oq_job=job.id).num_tasks imts = [parse_imt(x) for x in hc.intensity_measure_types] for imt, sa_period, sa_damping in imts: - for task_ordinal in xrange(1, job_stats.num_tasks + 1): + for task_ordinal in xrange(1, num_tasks + 1): gmfs = Gmf.objects.filter( gmf_set=self.id, imt=imt, sa_period=sa_period, sa_damping=sa_damping, task_ordinal=task_ordinal)
db/models: Minor tweak to the use of job_stats.num_tasks in GMF tree construction.
gem_oq-engine
train
py
846c63a42e89a90e5eed025d984abe3161ab4af9
diff --git a/lib/spreewald/web_steps.rb b/lib/spreewald/web_steps.rb index <HASH>..<HASH> 100644 --- a/lib/spreewald/web_steps.rb +++ b/lib/spreewald/web_steps.rb @@ -576,7 +576,7 @@ Then /^I should see in this order:?$/ do |text| pattern = lines.collect(&Regexp.method(:quote)).join('.*?') pattern = Regexp.compile(pattern) patiently do - page.find('body').text.gsub(/\s+/, ' ').should =~ pattern + page.text.gsub(/\s+/, ' ').should =~ pattern end end
Don't search for ordered text within a 'body' element in case the DOM context has changed. Refs #<I>
makandra_spreewald
train
rb
03f37e286ec32c9d5cc0fd14dc0702331da82fe2
diff --git a/lib/dataflow/nodes/select_keys_node.rb b/lib/dataflow/nodes/select_keys_node.rb index <HASH>..<HASH> 100644 --- a/lib/dataflow/nodes/select_keys_node.rb +++ b/lib/dataflow/nodes/select_keys_node.rb @@ -15,16 +15,15 @@ module Dataflow private def compute_batch(records:) - k = keys - k = k.map(&:to_sym) if dependencies.first.use_symbols? - select_keys(records: records, keys: k) + keys_tokens = keys.map { |k| [k, record_dig_tokens(key: k, use_sym: dependencies.first.use_symbols?)] } + select_keys(records: records, keys_tokens: keys_tokens) end - def select_keys(records:, keys:) + def select_keys(records:, keys_tokens:) records.map do |base_record| new_record = {} - keys.each do |key| - value = record_value(record: base_record, key: key) + keys_tokens.each do |key, tokens| + value = base_record.dig(*tokens) next unless value.present? add_value_to_record(record: new_record, key: key, value: value)
Optimize the select keys node to avoid recomputing keys at each record.
Phybbit_dataflow-rb
train
rb
61024011ab010ea8be4448341d3ef5cbc937b04e
diff --git a/spdx/utils.py b/spdx/utils.py index <HASH>..<HASH> 100644 --- a/spdx/utils.py +++ b/spdx/utils.py @@ -58,6 +58,12 @@ class NoAssert(object): pass +class UnKnown(object): + + """Represents SPDX UNKNOWN value.""" + pass + + class LicenseListLexer(object): def __init__(self):
Implements utils.Unknown to represent SPDX UNKNOWN values
spdx_tools-python
train
py
20d768ccffcd6dd5a11f666ded1f141b24be725a
diff --git a/lib/shirtsio/dsl.rb b/lib/shirtsio/dsl.rb index <HASH>..<HASH> 100644 --- a/lib/shirtsio/dsl.rb +++ b/lib/shirtsio/dsl.rb @@ -80,6 +80,8 @@ class Shirtsio::DSL args[0].each_with_index do |v,i| params[method] = { i => v } end + elsif args[0].kind_of?(File) + params[method] = Faraday::UploadIO.new(args[0].path, Shirtsio::Utils.mime_type(args[0].path)) else params[method] = args[0] end
Implemented File to Faraday::UploadIO translation.
anthonator_shirtsio
train
rb
80deae2ad9178a379160872f8a88cea49f5705e6
diff --git a/src/views/layouts/sidebar.php b/src/views/layouts/sidebar.php index <HASH>..<HASH> 100644 --- a/src/views/layouts/sidebar.php +++ b/src/views/layouts/sidebar.php @@ -31,7 +31,7 @@ switch ($userBalance) { <?= Yii::$app->user->identity->username ?> <?php if (Yii::$app->user->can('support') && Yii::$app->user->identity->seller !== null) print ' / ' . Yii::$app->user->identity->seller ?> </p> - <a href="#"> + <a href="<?= Url::to('@pay/deposit') ?>"> <i class="fa fa-circle <?= $balanceColor ?>"></i> <?= Yii::t('app', 'Balance') . ': ' ?><?= Yii::$app->formatter->asCurrency($userBalance, 'USD') ?> </a> </div>
Add link to rechange account to sidebar balance link
hiqdev_yii2-theme-adminlte
train
php
91da305b04ba5cf0a52f3e3f312b9053ffeea100
diff --git a/alphatwirl/summary/KeyValueComposer.py b/alphatwirl/summary/KeyValueComposer.py index <HASH>..<HASH> 100755 --- a/alphatwirl/summary/KeyValueComposer.py +++ b/alphatwirl/summary/KeyValueComposer.py @@ -72,7 +72,7 @@ class KeyValueComposer(object): return self._repr def begin(self, event): - arrays = self._collect_arrays(event, self.attr_names) + arrays = self._collect_arrays(event, self.attr_names) self.active = True if arrays is not None else False if not self.active: return self._array_reader = self.ArrayReader(arrays, self.idxs_conf, self.backref_idxs) @@ -84,8 +84,7 @@ class KeyValueComposer(object): attr = getattr(event, varname) except AttributeError as e: logger = logging.getLogger(__name__) - logger.warning(e) - logger.warning(self) + logger.warning('{!r}: {!s}'.format(self, e)) return None ret.append(attr) return ret
update logging, change space in KeyValueComposer
alphatwirl_alphatwirl
train
py
a7d6fa6dd183d5dac6c83f2e194298e0b2cd49b6
diff --git a/test/test_backbone_utils.py b/test/test_backbone_utils.py index <HASH>..<HASH> 100644 --- a/test/test_backbone_utils.py +++ b/test/test_backbone_utils.py @@ -15,11 +15,11 @@ class ResnetFPNBackboneTester(unittest.TestCase): x = torch.rand(1, 3, 300, 300, dtype=self.dtype, device=device) resnet18_fpn = resnet_fpn_backbone(backbone_name='resnet18', pretrained=False) y = resnet18_fpn(x) - assert list(y.keys()) == [0, 1, 2, 3, 'pool'] + self.assertEqual(list(y.keys()), [0, 1, 2, 3, 'pool']) def test_resnet50_fpn_backbone(self): device = torch.device('cpu') x = torch.rand(1, 3, 300, 300, dtype=self.dtype, device=device) resnet50_fpn = resnet_fpn_backbone(backbone_name='resnet50', pretrained=False) y = resnet50_fpn(x) - assert list(y.keys()) == [0, 1, 2, 3, 'pool'] + self.assertEqual(list(y.keys()), [0, 1, 2, 3, 'pool'])
test: Updated assert in test_backbone_utils (#<I>) Updated all raw asserts to corresponding unittest.TestCase.assert. See #<I>
pytorch_vision
train
py
bcba24e4234830882b5706af53851e644d1856f9
diff --git a/pymzn/mzn/minizinc.py b/pymzn/mzn/minizinc.py index <HASH>..<HASH> 100644 --- a/pymzn/mzn/minizinc.py +++ b/pymzn/mzn/minizinc.py @@ -154,10 +154,6 @@ def minizinc(mzn, *dzn_files, data=None, keep=False, include=None, solver=None, keep = config.get('keep', keep) - if include is None: - include = [] - include += config.get('include', []) - if not output_dir: output_dir = config.get('output_dir', None) @@ -304,8 +300,12 @@ def mzn2fzn(mzn_file, *dzn_files, data=None, keep_data=False, globals_dir=None, include = [include] elif not isinstance(include, list): raise TypeError('The path provided is not valid.') - for path in include: - args += ['-I', path] + else: + include = [] + + include += config.get('include', []) + for path in include: + args += ['-I', path] dzn_files = list(dzn_files) data, data_file = process_data(mzn_file, data, keep_data)
minizinc: fix usage of include defaults
paolodragone_pymzn
train
py
4c461b390ac2544c39e5f8fff37e170a92ad6aec
diff --git a/template/app/Auth.js b/template/app/Auth.js index <HASH>..<HASH> 100644 --- a/template/app/Auth.js +++ b/template/app/Auth.js @@ -18,7 +18,7 @@ Ext.define('Docs.Auth', { */ init: function(callback, scope) { Ext.Ajax.request({ - url: Docs.data.commentsUrl + '/session_new', + url: Docs.data.commentsUrl + '/session', params: { sid: this.getSid() }, method: 'GET', cors: true,
Switch back to using /session request. Drop the temporarily used /session_new.
senchalabs_jsduck
train
js
cf53a8621683ef610e8dd2ec0db8dc4039e2fd82
diff --git a/eZ/Bundle/EzPublishCoreBundle/DependencyInjection/Compiler/ComplexSettingsPass.php b/eZ/Bundle/EzPublishCoreBundle/DependencyInjection/Compiler/ComplexSettingsPass.php index <HASH>..<HASH> 100644 --- a/eZ/Bundle/EzPublishCoreBundle/DependencyInjection/Compiler/ComplexSettingsPass.php +++ b/eZ/Bundle/EzPublishCoreBundle/DependencyInjection/Compiler/ComplexSettingsPass.php @@ -5,7 +5,7 @@ * @copyright Copyright (C) eZ Systems AS. All rights reserved. * @license For full copyright and license information view LICENSE file distributd with this source code. */ -namespace eZ\Bundle\EzPublishIOBundle\DependencyInjection\Compiler; +namespace eZ\Bundle\EzPublishCoreBundle\DependencyInjection\Compiler; use eZ\Bundle\EzPublishIOBundle\DependencyInjection\Compiler\ComplexSettings\ComplexSettingParser; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
EZP-<I>: Moved ComplexSettingPass to CoreBundle
ezsystems_ezpublish-kernel
train
php
a5399c93b5a375a14e9ad49ca8c2ac2b83fbc43b
diff --git a/picoweb/__init__.py b/picoweb/__init__.py index <HASH>..<HASH> 100644 --- a/picoweb/__init__.py +++ b/picoweb/__init__.py @@ -93,6 +93,8 @@ class WebApp: def run(self, debug=False): loop = asyncio.get_event_loop() + if debug: + print("* Running on http://127.0.0.1:8081/") loop.call_soon(asyncio.start_server(self._handle, "127.0.0.1", 8081)) loop.run_forever() loop.close() diff --git a/test_webapp.py b/test_webapp.py index <HASH>..<HASH> 100644 --- a/test_webapp.py +++ b/test_webapp.py @@ -29,4 +29,4 @@ logging.basicConfig(level=logging.DEBUG) app = picoweb.WebApp(ROUTES) mem_info() -app.run() +app.run(debug=True)
App.run(): Print URL on which server is running if debug=True.
pfalcon_picoweb
train
py,py
232b06945d389ddde47bd5be9c7bf9ba377a2ad2
diff --git a/src/org/openscience/cdk/layout/StructureDiagramGenerator.java b/src/org/openscience/cdk/layout/StructureDiagramGenerator.java index <HASH>..<HASH> 100644 --- a/src/org/openscience/cdk/layout/StructureDiagramGenerator.java +++ b/src/org/openscience/cdk/layout/StructureDiagramGenerator.java @@ -293,7 +293,7 @@ public class StructureDiagramGenerator { } while(!atomPlacer.allPlaced(molecule)); fixRest(); - //OverlapResolver.resolveOverlap(molecule, sssr); + new OverlapResolver().resolveOverlap(molecule, sssr); } /**
Now uses OverlapResolver to clear overlaps at the end of the SDG process git-svn-id: <URL>
cdk_cdk
train
java
219107e9f2d34e9f45a58fd193bc11265a147c84
diff --git a/sentinelhub/download/models.py b/sentinelhub/download/models.py index <HASH>..<HASH> 100644 --- a/sentinelhub/download/models.py +++ b/sentinelhub/download/models.py @@ -61,6 +61,10 @@ class DownloadRequest: self.request_type = RequestType(self.request_type) self.data_type = MimeType(self.data_type) + def __hash__(self) -> int: + """This dataclass is mutable, but we still assign its id as its hash.""" + return id(self) + def raise_if_invalid(self) -> None: """Method that raises an error if something is wrong with request parameters
Added DownloadRequest.__hash__ method
sentinel-hub_sentinelhub-py
train
py
f9c239fa9c1ff6858bff3604e6790a75731bba96
diff --git a/classes/image_tool_watermark.php b/classes/image_tool_watermark.php index <HASH>..<HASH> 100644 --- a/classes/image_tool_watermark.php +++ b/classes/image_tool_watermark.php @@ -24,7 +24,7 @@ class eZIEImageToolWatermark extends eZIEImageAction $img_path = realpath( dirname( __FILE__ ) . "/../design/standard/images/watermarks" ) . "/" . $image; // retrieve image dimensions - $analyzer = new eZIEImageAnalyzer( $img_path ); + $analyzer = new ezcImageAnalyzer( $img_path ); // percentage of the watermark original size to use $pc = $region['w'] / $analyzer->data->width;
Fixed #<I>: (tc-<I>)(Imageeditor) Applying a watermark on cluster mode, deletes the watermark image from the ez installation
ezsystems_ezie
train
php
33d2d8edbe1aed2c333078e1f22165ee1c8075cd
diff --git a/astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/reader/AllRowsReader.java b/astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/reader/AllRowsReader.java index <HASH>..<HASH> 100644 --- a/astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/reader/AllRowsReader.java +++ b/astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/reader/AllRowsReader.java @@ -221,6 +221,21 @@ public class AllRowsReader<K, C> implements Callable<Boolean> { } /** + * Use the specific executor for executing the tasks. Note that this should be used with care + * when specifying the withConcurrencyLevel. + * e.g if you have a concurrencyLevel of 10 with a fixed threadpool of size 1 then this effectively + * negates the point of the concurrencyLevel + * + * @param executor + * @return + */ + public Builder<K, C> withExecutor(ExecutorService executor) { + Preconditions.checkArgument(executor != null, "Supplied executor must not be null"); + this.executor = executor; + return this; + } + + /** * Execute the operation on a specific token range, instead of the entire range. * Use this only is combination with setConcurrencyLevel being called otherwise * it currently will not have any effect on the query. When using forTokenRange
issue # <I> - Adding setter for AllRowsReader ExecutorService
Netflix_astyanax
train
java
5ab0c62b005c0d93d65af336dbed21b1e35036f7
diff --git a/playhouse/tests/test_postgres.py b/playhouse/tests/test_postgres.py index <HASH>..<HASH> 100644 --- a/playhouse/tests/test_postgres.py +++ b/playhouse/tests/test_postgres.py @@ -781,8 +781,8 @@ class TestBinaryJsonField(BaseJsonFieldTestCase, ModelTestCase): {'k1': 'v1', 'k2': 'v2', 'k3': {'k4': ['i1', 'i2'], 'k5': {}}}, ['a1', 'a2', {'a3': 'a4'}], {'a1': 'x1', 'a2': 'x2', 'k4': ['i1', 'i2']}, - range(10), - range(5, 15), + list(range(10)), + list(range(5, 15)), ['k4', 'k1']] self._bjson_objects = []
Fix failing tests on py3k
coleifer_peewee
train
py
8c545e69261855d1b9dd7de66ece1c5b3452d64c
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -108,7 +108,7 @@ def get_packages(): dstdir = osp.join(LIBNAME, 'utils', 'external', name) shutil.copytree(srcdir, dstdir) atexit.register(shutil.rmtree, osp.abspath(dstdir)) - packages = get_subpackages(LIBNAME)+get_subpackages('spyderplugins') + packages = get_subpackages(LIBNAME) + get_subpackages('spyplugins') return packages @@ -276,6 +276,7 @@ editor, Python console, etc.""", package_data={LIBNAME: get_package_data(LIBNAME, EXTLIST), 'spyplugins': get_package_data('spyplugins', EXTLIST), }, + include_package_data=True, scripts=[osp.join('scripts', fname) for fname in SCRIPTS], data_files=get_data_files(), options={"bdist_wininst":
Update setup.py to correctly build wheel
spyder-ide_spyder
train
py
86a72bf8b4b9b26d38e93eaf30aca37dfa66f23d
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -3,7 +3,7 @@ import pathExists from 'path-exists'; import fn from './'; test('meme', t => { - await fn('Don\t forget to be awesome', {delay: 500, background: '#1d2628', filename: 'out.gif'}); + await fn('Don\'t forget to be awesome', {delay: 500, background: '#1d2628', filename: 'out.gif'}); t.true(pathExists.sync('out.gif')); });
add support for :heart_eyes:
beatfreaker_text-meme
train
js
bbc42f0d518c1eb2e5feaf0ece33c537861cb513
diff --git a/dev/deps.py b/dev/deps.py index <HASH>..<HASH> 100644 --- a/dev/deps.py +++ b/dev/deps.py @@ -127,7 +127,15 @@ def _install_requirements(_pip, tmpdir, path): A unicoe filesystem path to a requirements file """ - from pip.pep425tags import get_supported + import pip + + pip_version_info = tuple(map(int, pip.__version__.split('.'))) + + if pip_version_info < (10, ): + from pip.pep425tags import get_supported + else: + from pip._internal.pep425tags import get_supported + valid_tags = tuple(get_supported()) + (('py2.py3', 'none', 'any'),) packages = _parse_requires(path)
Support pip <I> internals
wbond_asn1crypto
train
py
e0a2d37833499814d9ef80fe69095b6766521314
diff --git a/core/typechecker/src/main/java/org/overture/typechecker/assistant/definition/SClassDefinitionAssistantTC.java b/core/typechecker/src/main/java/org/overture/typechecker/assistant/definition/SClassDefinitionAssistantTC.java index <HASH>..<HASH> 100644 --- a/core/typechecker/src/main/java/org/overture/typechecker/assistant/definition/SClassDefinitionAssistantTC.java +++ b/core/typechecker/src/main/java/org/overture/typechecker/assistant/definition/SClassDefinitionAssistantTC.java @@ -767,7 +767,7 @@ public class SClassDefinitionAssistantTC { public static void typeCheckPass(SClassDefinition c, Pass p, Environment base, TypeCheckVisitor tc) throws Throwable { - if (c.getIsTypeChecked()) return; + if (c.getTypeChecked()) return; for (PDefinition d: c.getDefinitions()) {
Fixing TC isTypechecked
overturetool_overture
train
java
77e21098e057c35fb61df20fe050851c420687e6
diff --git a/examples/example/core/views.py b/examples/example/core/views.py index <HASH>..<HASH> 100644 --- a/examples/example/core/views.py +++ b/examples/example/core/views.py @@ -1,5 +1,5 @@ from core.models import Message -from django.shortcuts import render_to_response +from django.shortcuts import render_to_response, get_object_or_404 from django.template.context import RequestContext from django.views.decorators.csrf import csrf_protect @@ -14,6 +14,6 @@ def home(request): @csrf_protect def message(request, id): context = { - 'message': Message.objects.get(id=id), + 'message': get_object_or_404(Message, pk=id), } return render_to_response('core/message.html', context, context_instance=RequestContext(request))
Using get_object_or_<I> in the example Nicely suggested by @HonzaKral in the comments of pull #<I>
HonzaKral_django-threadedcomments
train
py
6a12dfc6f54c91f368b183110c59fd82e7647321
diff --git a/game.js b/game.js index <HASH>..<HASH> 100644 --- a/game.js +++ b/game.js @@ -1141,26 +1141,6 @@ Function.prototype.once = function() { }; }; -Function.prototype.withBefore = function(interception) { - var method; - method = this; - return function() { - interception.apply(this, arguments); - return method.apply(this, arguments); - }; -}; - -Function.prototype.withAfter = function(interception) { - var method; - method = this; - return function() { - var result; - result = method.apply(this, arguments); - interception.apply(this, arguments); - return result; - }; -}; - /** Calling a debounced function will postpone its execution until after wait milliseconds have elapsed since the last time the function was
Removing before and after function composing helpers
PixieEngine_Cornerstone
train
js
9a4c24e091c80ee23346fbae785c59a34dde1320
diff --git a/src/Http/Requests/CreateUserRequest.php b/src/Http/Requests/CreateUserRequest.php index <HASH>..<HASH> 100644 --- a/src/Http/Requests/CreateUserRequest.php +++ b/src/Http/Requests/CreateUserRequest.php @@ -14,13 +14,7 @@ class CreateUserRequest extends Request */ public function authorize() { - $id = \Auth()->user()->id; - $user = UserManager::findOrFail($id); - if(in_array('admin', $user->roles->lists('name')->toArray()) OR in_array('source', $user->roles->lists('name')->toArray())) { - return true; - } else { - return false; - } + return true; } /**
Update CreateUserRequest.php
intothesource_laravel-users
train
php
590fc51a17573046314a3e14c73a1ab8ca70584b
diff --git a/Ajax/semantic/widgets/base/FieldAsTrait.php b/Ajax/semantic/widgets/base/FieldAsTrait.php index <HASH>..<HASH> 100644 --- a/Ajax/semantic/widgets/base/FieldAsTrait.php +++ b/Ajax/semantic/widgets/base/FieldAsTrait.php @@ -261,7 +261,7 @@ trait FieldAsTrait { public function fieldAsDropDown($index, $elements = [], $multiple = false, $attributes = NULL) { return $this->_fieldAs(function ($id, $name, $value, $caption) use ($elements, $multiple, $attributes) { - $dd = new HtmlFormDropdown($id, $elements, $caption, $value); + $dd = new HtmlFormDropdown($id, $elements, $caption, $value ?? ''); $dd->asSelect($name, $multiple); return $this->_prepareFormFields($dd, $name, $attributes); }, $index, $attributes, "dd");
Fix empty fields pb with HtmlDropdown
phpMv_phpMv-UI
train
php
09cf08e76b056d3473ce83e2a574e32b232197a6
diff --git a/quotequail/_internal.py b/quotequail/_internal.py index <HASH>..<HASH> 100644 --- a/quotequail/_internal.py +++ b/quotequail/_internal.py @@ -22,7 +22,7 @@ def find_pattern_on_line(lines, n, max_wrap_lines): match_line = ''.join(lines[n:n+1+m]) if match_line.startswith('>'): match_line = match_line[1:].strip() - if re.match(regex, match_line.strip()): + if regex.match(match_line.strip()): return n+m, typ return None, None
Speed up regex matching (#<I>)
closeio_quotequail
train
py
72120cce74f5dd9cc78ce21b32720c948eabc933
diff --git a/pushy/src/main/java/com/relayrides/pushy/apns/MockApnsServer.java b/pushy/src/main/java/com/relayrides/pushy/apns/MockApnsServer.java index <HASH>..<HASH> 100644 --- a/pushy/src/main/java/com/relayrides/pushy/apns/MockApnsServer.java +++ b/pushy/src/main/java/com/relayrides/pushy/apns/MockApnsServer.java @@ -154,7 +154,7 @@ public class MockApnsServer { * Registers a public key for verifying authentication tokens for the given topics. Clears any keys and topics * previously associated with the given team. * - * @param verificationKey TODO + * @param verificationKey the key to be used to verify authentication tokens for the given topics * @param topics the topics belonging to the given team for which the given public key can be used to verify * authentication tokens; must not be {@code null} * @@ -171,7 +171,7 @@ public class MockApnsServer { * Registers a public key for verifying authentication tokens for the given topics. Clears any keys and topics * previously associated with the given team. * - * @param verificationKey TODO + * @param verificationKey the key to be used to verify authentication tokens for the given topics * @param topics the topics belonging to the given team for which the given public key can be used to verify * authentication tokens; must not be null *
Resolved a pair of documentation TODOs.
relayrides_pushy
train
java
5559cd8c065b9b9bb5d35bfdaea1aa931766d953
diff --git a/scripts/deploy.py b/scripts/deploy.py index <HASH>..<HASH> 100644 --- a/scripts/deploy.py +++ b/scripts/deploy.py @@ -202,6 +202,7 @@ def check_checkout(): abort() extras = run("git status --porcelain").split("\n") + extras = [x for x in extras if x != ''] if extras: failed("Local checkout is NOT clean", extras) else:
need to account for empty strings in working case
bokeh_bokeh
train
py
df5125f2be0e6710df978e6ac558a6b623c412cf
diff --git a/djangosaml2/views.py b/djangosaml2/views.py index <HASH>..<HASH> 100644 --- a/djangosaml2/views.py +++ b/djangosaml2/views.py @@ -380,7 +380,8 @@ class AssertionConsumerServiceView(SPConfigMixin, View): create_unknown_user=create_unknown_user) if user is None: logger.warning("Could not authenticate user received in SAML Assertion. Session info: %s", session_info) - return self.handle_acs_failure(request, exception=PermissionDenied('No user could be authenticated.')) + return self.handle_acs_failure(request, exception=PermissionDenied('No user could be authenticated.'), + session_info=session_info) auth.login(self.request, user) _set_subject_id(request.saml_session, session_info['name_id'])
Add session_info to user auth failed template (#<I>) This lets people customise the error page when a user fails to authenticate with useful information if they wish.
knaperek_djangosaml2
train
py
fb2636b39c2965a27b2a4a7f9446cec5b03749d8
diff --git a/Tank/Plugins/bfg/guns.py b/Tank/Plugins/bfg/guns.py index <HASH>..<HASH> 100644 --- a/Tank/Plugins/bfg/guns.py +++ b/Tank/Plugins/bfg/guns.py @@ -52,8 +52,12 @@ class SqlGun(AbstractPlugin): self.log.debug("Missile: %s\n%s", marker, missile) start_time = time.time() errno = 0 + httpCode = 200 try: self.engine.execute(missile.replace('%', '%%')).fetchall() + except exc.ResourceClosedError as e: + httpCode = 404 + self.log.warn(e) except exc.SQLAlchemyError as e: errno = e.orig.args[0] self.log.warn(e.orig.args) @@ -62,7 +66,7 @@ class SqlGun(AbstractPlugin): marker, # marker th.active_count(), # threads rt, # overallRT - 0, # httpCode + httpCode, # httpCode errno, # netCode 0, # sent 0, # received
catch ResourceClosedError
yandex_yandex-tank
train
py
5e41052ce9585c507b6e6a50127ed4e60c32a07e
diff --git a/did/plugins/gerrit.py b/did/plugins/gerrit.py index <HASH>..<HASH> 100644 --- a/did/plugins/gerrit.py +++ b/did/plugins/gerrit.py @@ -43,10 +43,10 @@ class Change(object): return u"{0}#{1} - {2}".format(self.prefix, self.id, self.subject) def __eq__(self, other): - return self.__unicode__() == other.__unicode__() - + return unicode(self) == unicode(other) + def __hash__(self): - return hash(self.__unicode__()) + return hash(unicode(self)) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Gerrit Stats
Adjustments for the gerrit deduplication
psss_did
train
py
3bb3c73d4c373f7e5eaa9066a91ab62815759afa
diff --git a/chance.js b/chance.js index <HASH>..<HASH> 100644 --- a/chance.js +++ b/chance.js @@ -270,7 +270,7 @@ options = initOptions(options, {min: 0, max: MAX_INT, casing: 'lower'}); testRange(options.min < 0, "Chance: Min cannot be less than zero."); var integer = chance.natural({min: options.min, max: options.max}); - if (options.casing == 'upper') { + if (options.casing === 'upper') { return integer.toString(16).toUpperCase(); } return integer.toString(16);
Fixed another Node Warning Fixed another Node Warning
chancejs_chancejs
train
js
9e2075c190f1cd5161a7831c1dea1cecc8d8cdaa
diff --git a/src/org/opencms/scheduler/jobs/CmsRemoveOldDbLogEntriesJob.java b/src/org/opencms/scheduler/jobs/CmsRemoveOldDbLogEntriesJob.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/scheduler/jobs/CmsRemoveOldDbLogEntriesJob.java +++ b/src/org/opencms/scheduler/jobs/CmsRemoveOldDbLogEntriesJob.java @@ -63,9 +63,9 @@ public class CmsRemoveOldDbLogEntriesJob implements I_CmsScheduledJob { public String launch(CmsObject cms, Map<String, String> parameters) throws Exception { String maxAgeStr = parameters.get(PARAM_MAX_AGE); - int maxAgeHours = parseMaxAge(maxAgeStr); + long maxAgeHours = parseMaxAge(maxAgeStr); if (maxAgeHours > 0) { - long maxAgeMillis = maxAgeHours * 3600 * 1000; + long maxAgeMillis = maxAgeHours * 3600L * 1000L; long now = System.currentTimeMillis(); CmsLogFilter filter = CmsLogFilter.ALL.filterTo(now - maxAgeMillis); LOG.info("Removing all entries from CMS_LOG older than " + maxAgeHours + " hours...");
Fixed int overflow in CmsRemoveOldDbLogEntriesJob, which caused too many log entries to be deleted.
alkacon_opencms-core
train
java
2a945ef37868f8ba7974aeeaaa944f19ccff2354
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -33,7 +33,9 @@ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', - 'sphinxcontrib.napoleon'] + # 'sphinxcontrib.napoleon' # see https://readthedocs.org/projects/sphinxcontrib-napoleon/ + # 'sphinx.ext.napoleon' # use this in Sphinx 1.3+ + ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates']
Don't require the napoleon sphinx extension yet
PythonCharmers_python-future
train
py
0c2e5e8ff9b115ef0c629354aacec87ae227aaf9
diff --git a/tests/test_gym.py b/tests/test_gym.py index <HASH>..<HASH> 100644 --- a/tests/test_gym.py +++ b/tests/test_gym.py @@ -2,12 +2,15 @@ import wandb from .utils import git_repo from gym import core from gym.wrappers.monitoring.video_recorder import ImageEncoder +import pytest +import sys [email protected](sys.version_info < (3, 0), reason="gym no longer supports python 2.7") def test_patch(wandb_init_run, git_repo): wandb.gym.monitor() with open("test.gif", "w") as f: f.write("test") - ir = ImageEncoder("test.gif", (28, 28, 3), 10) + ir = ImageEncoder("test.gif", (28, 28, 3), 10, 10) ir.close() assert wandb_init_run.summary["videos"]['_type'] == "video-file"
Fix/gym test (#<I>) * gym added output framerate * skip py2 for gym
wandb_client
train
py
ea04577642028b9b80df4904ef83aeaef1eac8c4
diff --git a/applications/default/public/js/controllers.js b/applications/default/public/js/controllers.js index <HASH>..<HASH> 100644 --- a/applications/default/public/js/controllers.js +++ b/applications/default/public/js/controllers.js @@ -227,8 +227,10 @@ function InlineReferenceElementController($scope, $location, applicationState, C // We are editing a item, store data. if (data) { - $scope.data = data; $scope.editing = true; + + // Make a copy of original data for restoring on cancel. + $scope.data = angular.copy(data); } else { $scope.editing = false;
Issue #<I>: Fixing "cancel" button when editing an inline referenced item.
recidive_choko
train
js
792c9babeeb4aa848175318c038449f21e241ccd
diff --git a/library/CM/Db/Client.php b/library/CM/Db/Client.php index <HASH>..<HASH> 100644 --- a/library/CM/Db/Client.php +++ b/library/CM/Db/Client.php @@ -93,6 +93,13 @@ class CM_Db_Client { } /** + * @param bool $enabled + */ + public function setBuffered($enabled){ + $this->_pdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, $enabled); + } + + /** * @param string $sqlTemplate * @return CM_Db_Statement */
Added setBuffered() to db client
cargomedia_cm
train
php
502d8ef947e6dfc4a8ee5cd02f3bee4df5b1ae81
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -138,10 +138,7 @@ func (c *Client) cleanup(s *Server) { } func (c *Client) listener(s *Server) { - throttle := time.NewTicker(time.Millisecond * 10) - defer throttle.Stop() for { - <-throttle.C mtype, data, err := c.conn.ReadMessage() if err != nil { c.cleanup(s) @@ -184,5 +181,6 @@ func (c *Client) listener(s *Server) { reqPool.Put(js) replyPool.Put(replyJs) }() + time.Sleep(10 * time.Millisecond) } }
Use time.Sleep for rate-limiting.
TF2Stadium_wsevent
train
go
08440d1cdfdd1909cccc78ee194d76c66eaa0bad
diff --git a/lib/tune_spec/instances/groups.rb b/lib/tune_spec/instances/groups.rb index <HASH>..<HASH> 100644 --- a/lib/tune_spec/instances/groups.rb +++ b/lib/tune_spec/instances/groups.rb @@ -8,7 +8,7 @@ module TuneSpec class Groups < Tuner class << self # Groups specific rules - def rules_passed?(instance, _args) + def rules_passed?(instance, _opts) instance end diff --git a/lib/tune_spec/instances/page.rb b/lib/tune_spec/instances/page.rb index <HASH>..<HASH> 100644 --- a/lib/tune_spec/instances/page.rb +++ b/lib/tune_spec/instances/page.rb @@ -8,7 +8,7 @@ module TuneSpec class Page < Tuner class << self # Page specific rules - def rules_passed?(instance, _args) + def rules_passed?(instance, _opts) instance end
renamed args to opts
igor-starostenko_tune_spec
train
rb,rb
c0d9c59267110b26919cef753a9475fa1f9da8df
diff --git a/bugzoo/build.py b/bugzoo/build.py index <HASH>..<HASH> 100644 --- a/bugzoo/build.py +++ b/bugzoo/build.py @@ -36,7 +36,14 @@ class BuildInstructions(object): """ Loads a set of build instructions from a dictionary. """ - yml = yml['docker'] # TODO: why? + if 'docker' in yml: + yml = yml['docker'] + print("WARNING: use `build` property rather than `docker` to provide build instructions.") + elif 'build' in yml: + yml = yml['build'] + else: + raise Exception("Illegal build instructions: missing `build` or `docker` property") + tag = yml['tag'] context = yml.get('context', '.') filename = yml.get('file', 'Dockerfile') diff --git a/bugzoo/tool.py b/bugzoo/tool.py index <HASH>..<HASH> 100644 --- a/bugzoo/tool.py +++ b/bugzoo/tool.py @@ -19,8 +19,8 @@ class Tool(Source): environment = d.get('environment', {}) # TODO: tidy up this mess - assert 'docker' in d - build = {'docker': d['docker']} + assert 'build' in d + build = {'build': d['build']} return Tool(manager, url, name, environment, build)
updated build instructions and tools to use build property rather than docker property
squaresLab_BugZoo
train
py,py
e74976a3b60e4d1b35f49d005f18e25a00712275
diff --git a/pycdlib/rockridge.py b/pycdlib/rockridge.py index <HASH>..<HASH> 100644 --- a/pycdlib/rockridge.py +++ b/pycdlib/rockridge.py @@ -855,6 +855,12 @@ class RRSLRecord(object): ''' self.flags |= (1 << 0) + def __eq__(self, other): + return self.flags == other.flags and self.curr_length == other.curr_length and self.data == other.data + + def __ne__(self, other): + return not self.__eq__(other) + @staticmethod def length(symlink_component): '''
Make sure Rock Ridge SymLink Components can be compared.
clalancette_pycdlib
train
py
e9fa5481f2ad01a9323a91f1e63c226d8df3cc57
diff --git a/celerite/build.py b/celerite/build.py index <HASH>..<HASH> 100644 --- a/celerite/build.py +++ b/celerite/build.py @@ -64,10 +64,10 @@ class build_ext(_build_ext): # Building on RTDs takes a bit of special care if os.environ.get("READTHEDOCS", None) == "True": for ext in self.extensions: - ext.include_dirs = [ - "/home/docs/checkouts/readthedocs.org/user_builds/celerite/conda/latest/include/eigen3" - ] + ext.include_dirs - ext.extra_compile_args = ["-std=c++14", "-O0"] + # ext.include_dirs = [ + # "/home/docs/checkouts/readthedocs.org/user_builds/celerite/conda/latest/include/eigen3" + # ] + ext.include_dirs + ext.extra_compile_args = ["-std=c++14", "-O0", "-DNO_AUTODIFF"] _build_ext.build_extensions(self) return
trying RTDs again [ci skip]
dfm_celerite
train
py
4fc93036af2ea043fb048b9709820ce0f608b3cc
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -177,7 +177,7 @@ GlobalOffensive.prototype.requestLiveGameForUser = function(steamid) { } this._send(Language.MatchListRequestLiveGameForUser, Protos.CMsgGCCStrike15_v2_MatchListRequestLiveGameForUser, { - accountid: sid.accountid + accountid: steamid.accountid }); };
fix incorrect name for steamid variable in requestLiveGameForUser
DoctorMcKay_node-globaloffensive
train
js
079d8e2de1881f502dd0023ddafe9d3bdea5c7be
diff --git a/lib/ruby_home.rb b/lib/ruby_home.rb index <HASH>..<HASH> 100644 --- a/lib/ruby_home.rb +++ b/lib/ruby_home.rb @@ -38,6 +38,8 @@ module RubyHome end def shutdown + hap_server.shutdown + threads.each(&:exit) end diff --git a/lib/ruby_home/hap/server.rb b/lib/ruby_home/hap/server.rb index <HASH>..<HASH> 100644 --- a/lib/ruby_home/hap/server.rb +++ b/lib/ruby_home/hap/server.rb @@ -5,6 +5,7 @@ module RubyHome @port = port @host = host @selector = NIO::Selector.new + @status = :running end attr_reader :port, :host @@ -17,10 +18,18 @@ module RubyHome monitor.value = proc { accept } loop do - @selector.select { |monitor| monitor.value.call(monitor) } + if @status == :running + @selector.select { |monitor| monitor.value.call(monitor) } + else + @selector.close + end end end + def shutdown + @status = :shutdown + end + private SESSIONS = {}
Graceful shutdown When the hap server is shutdown close the connected sockets
karlentwistle_ruby_home
train
rb,rb
2d67061fe39225208c2f9ec3883f6d3d1eb8ddf3
diff --git a/lib/modules/vyper/index.js b/lib/modules/vyper/index.js index <HASH>..<HASH> 100644 --- a/lib/modules/vyper/index.js +++ b/lib/modules/vyper/index.js @@ -35,15 +35,15 @@ class Vyper { if (!contractFiles || !contractFiles.length) { return cb(); } - self.logger.info(__("compiling Vyper contracts") + "..."); - + const vyper = shelljs.which('vyper'); if (!vyper) { self.logger.warn(__('%s is not installed on your machine', 'Vyper')); self.logger.info(__('You can install it by visiting: %s', 'https://vyper.readthedocs.io/en/latest/installing-vyper.html')); return cb(); } - + self.logger.info(__("compiling Vyper contracts") + "..."); + const compiled_object = {}; async.each(contractFiles, function (file, fileCb) {
put compiling message only after checking for binary
embark-framework_embark
train
js
b4a61f27fcbd53cb903318f2ff955eb36b41a59b
diff --git a/shinken/modules/livestatus_broker/livestatus_query.py b/shinken/modules/livestatus_broker/livestatus_query.py index <HASH>..<HASH> 100644 --- a/shinken/modules/livestatus_broker/livestatus_query.py +++ b/shinken/modules/livestatus_broker/livestatus_query.py @@ -545,7 +545,7 @@ class LiveStatusQuery(object): objects_get_handlers = { 'hosts': get_hosts_livedata, 'services': get_services_livedata, - 'commands': get_filtered_livedata, + 'commands': get_simple_livedata, 'schedulers': get_simple_livedata, 'brokers': get_simple_livedata, 'pollers': get_simple_livedata,
Fix a bug in livestatus "GET commands"
Alignak-monitoring_alignak
train
py
c93ebb1c4448857fc784dad869589429783154f1
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -29,13 +29,11 @@ function plugin(opts) { jsdom.env({ html: contents, - scripts: ["https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"], done: function(err, window) { if (err) { console.log("We have an error"); throw(err); } - window.document.$ = window.$; mjAPI.start(); mjAPI.typeset({
Don't actually need jQuery
wilson428_metalsmith-mathjax
train
js
240e0fd4d1fda79c0304a8d8e7acece48f383c18
diff --git a/app/index.js b/app/index.js index <HASH>..<HASH> 100644 --- a/app/index.js +++ b/app/index.js @@ -451,6 +451,16 @@ KeystoneGenerator.prototype.updates = function routes() { KeystoneGenerator.prototype.files = function files() { - this.directory('public'); + this.directory('public/fonts'); + this.directory('public/images'); + this.directory('public/js'); + this.copy('public/favicon.ico'); + + if (this.preprocessor === 'less') { + this.directory('public/styles'); + } + else { + this.directory('public/stylesSass', 'public/styles'); + } };
Selective copy of public directive, depends on preprocessor chosen
keystonejs_generator-keystone
train
js
fd1985587856995b9904abf914c2ba218a466386
diff --git a/command/status.go b/command/status.go index <HASH>..<HASH> 100644 --- a/command/status.go +++ b/command/status.go @@ -75,6 +75,7 @@ func (c *StatusCommand) Run(args []string) int { // No output if we have no jobs if len(jobs) == 0 { + c.Ui.Output("No running jobs") return 0 }
Add message to nomad status when there are no jobs
hashicorp_nomad
train
go
586b7d8128ffd49a884d1bdf523d505def3beeaf
diff --git a/merb-gen/lib/generators/merb/merb_very_flat.rb b/merb-gen/lib/generators/merb/merb_very_flat.rb index <HASH>..<HASH> 100644 --- a/merb-gen/lib/generators/merb/merb_very_flat.rb +++ b/merb-gen/lib/generators/merb/merb_very_flat.rb @@ -40,9 +40,9 @@ module Merb template.destination = "#{base_name}.rb" end - template :gitignore do |template| - template.source = File.join(common_templates_dir, 'dotgitignore') - template.destination = ".gitignore" + file :gitignore do |file| + file.source = File.join(common_templates_dir, 'dotgitignore') + file.destination = ".gitignore" end directory :test_dir do |directory|
Do not process file that should be just copied with Erb.
wycats_merb
train
rb
70b416b12ce34f290e57e82c60ad1208491fce62
diff --git a/lib/Cake/Model/Datasource/Database/Query.php b/lib/Cake/Model/Datasource/Database/Query.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Model/Datasource/Database/Query.php +++ b/lib/Cake/Model/Datasource/Database/Query.php @@ -347,18 +347,21 @@ class Query implements IteratorAggregate { return $this; } - public function having($field, $value = null) { - $this->_parts['having']->andWhere($field, $value); + public function having($conditions = null, $types = [], $overwrite = false) { + if ($overwrite) { + $this->_parts['having'] = $this->newExpr(); + } + $this->_conjugate('having', $conditions, 'AND', $types); return $this; } - public function andHaving($field, $value = null) { - $this->having($field, $value); + public function andHaving($conditions, $types = []) { + $this->_conjugate('having', $conditions, 'AND', $types); return $this; } - public function orHaving($field, $value = null) { - $this->_parts['having']->orWhere($field, $value); + public function orHaving($conditions, $types = []) { + $this->_conjugate('having', $conditions, 'OR', $types); return $this; }
Reusing code for having() and friends
cakephp_cakephp
train
php
6bfa91a795c64c56fcc559cb842b7148baccf036
diff --git a/src/python/grpcio/grpc/_channel.py b/src/python/grpcio/grpc/_channel.py index <HASH>..<HASH> 100644 --- a/src/python/grpcio/grpc/_channel.py +++ b/src/python/grpcio/grpc/_channel.py @@ -32,6 +32,7 @@ import sys import threading import time +import logging import grpc from grpc import _common @@ -197,7 +198,16 @@ def _consume_request_iterator( event_handler = _event_handler(state, call, None) def consume_request_iterator(): - for request in request_iterator: + while True: + try: + request = next(request_iterator) + except StopIteration: + break + except Exception as e: + logging.exception("Exception iterating requests!") + call.cancel() + _abort(state, grpc.StatusCode.UNKNOWN, "Exception iterating requests!") + return serialized_request = _common.serialize(request, request_serializer) with state.condition: if state.code is None and not state.cancelled:
Handle non-iterator objects in consume_request_iterator Restructure the consume_request_iterator method to handle exceptions where the object being passed is not an iterator. Fixes #<I> and #<I>.
grpc_grpc
train
py
9febcbbf50f9212cc46a4954e350b532c8412494
diff --git a/ocelot-core/src/main/java/org/ocelotds/marshalling/annotations/JsonMarshaller.java b/ocelot-core/src/main/java/org/ocelotds/marshalling/annotations/JsonMarshaller.java index <HASH>..<HASH> 100644 --- a/ocelot-core/src/main/java/org/ocelotds/marshalling/annotations/JsonMarshaller.java +++ b/ocelot-core/src/main/java/org/ocelotds/marshalling/annotations/JsonMarshaller.java @@ -13,7 +13,7 @@ import java.lang.annotation.Target; * @author hhfrancois */ @Retention(RetentionPolicy.RUNTIME) -@Target({ElementType.METHOD}) +@Target({ElementType.METHOD, ElementType.FIELD}) public @interface JsonMarshaller { Class<? extends org.ocelotds.marshalling.JsonMarshaller> value(); }
implements new method for send payload to topic + test
ocelotds_ocelot
train
java
21bd007aa035e301cb074a034c330e88665edbc6
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -13,6 +13,7 @@ const RESOURCE_API_CLOUDWATCH_LOGS_ROLE = "GraphQlApiCloudWatchLogsRole"; const RESOURCE_API_KEY = "GraphQlApiKeyDefault"; const RESOURCE_SCHEMA = "GraphQlSchema"; const RESOURCE_URL = "GraphQlApiUrl"; +const RESOURCE_API_ID = "GraphQlApiId"; class ServerlessAppsyncPlugin { constructor(serverless, options) { @@ -860,10 +861,14 @@ class ServerlessAppsyncPlugin { getGraphQlApiOutputs(config) { const logicalIdGraphQLApi = this.getLogicalId(config, RESOURCE_API); const logicalIdGraphQLApiUrlOutput = this.getLogicalId(config, RESOURCE_URL); + const logicalIdGraphQLApiIdOutput = this.getLogicalId(config, RESOURCE_API_ID); return { [logicalIdGraphQLApiUrlOutput]: { Value: { 'Fn::GetAtt': [logicalIdGraphQLApi, 'GraphQLUrl'] }, }, + [logicalIdGraphQLApiIdOutput]: { + Value: { 'Fn::GetAtt': [logicalIdGraphQLApi, 'ApiId'] }, + }, }; }
Exposes AppSync API ID as CF Stack Output (#<I>)
sid88in_serverless-appsync-plugin
train
js
ef86799d7e7a6b2ec81c043cb867b69710a3afa2
diff --git a/src/Framework/Console/Interfaces/CommandInterface.php b/src/Framework/Console/Interfaces/CommandInterface.php index <HASH>..<HASH> 100755 --- a/src/Framework/Console/Interfaces/CommandInterface.php +++ b/src/Framework/Console/Interfaces/CommandInterface.php @@ -11,8 +11,6 @@ interface CommandInterface { /** * @param ConsoleInterface $console The currently active console - * - * @return int The return code of the call */ - public function trigger(ConsoleInterface $console): int; + public function trigger(ConsoleInterface $console); }
allow commands to return things other than exit codes
phOnion_console
train
php
d1f9a6dfbfdcacbedd1ccafa60c02e0ac08c68db
diff --git a/cmd/juju/commands/main.go b/cmd/juju/commands/main.go index <HASH>..<HASH> 100644 --- a/cmd/juju/commands/main.go +++ b/cmd/juju/commands/main.go @@ -248,7 +248,7 @@ func registerCommands(r commandRegistry, ctx *cmd.Context) { r.Register(controller.NewRegisterCommand()) r.Register(controller.NewRemoveBlocksCommand()) r.Register(controller.NewShowControllerCommand()) - + // Debug Metrics r.Register(metricsdebug.New()) r.Register(metricsdebug.NewCollectMetricsCommand())
gofmt, be happy!
juju_juju
train
go
aa15ab95eb106b259a3d519f3ac0894c6da1a20e
diff --git a/testing/test_pdb.py b/testing/test_pdb.py index <HASH>..<HASH> 100644 --- a/testing/test_pdb.py +++ b/testing/test_pdb.py @@ -4324,7 +4324,6 @@ def test_nested_completer(testdir): child.expect_exact("completeme_outer") child.send("\n") child.sendeof() - child.read() def test_ensure_file_can_write_unicode():
tests: test_nested_completer: do not read after sendeof (#<I>)
antocuni_pdb
train
py
46a8885cd9235402ad76c5cb7f5f028e7f87fcf1
diff --git a/src/main/java/com/hmsonline/dropwizard/spring/SpringServiceConfiguration.java b/src/main/java/com/hmsonline/dropwizard/spring/SpringServiceConfiguration.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/hmsonline/dropwizard/spring/SpringServiceConfiguration.java +++ b/src/main/java/com/hmsonline/dropwizard/spring/SpringServiceConfiguration.java @@ -15,7 +15,7 @@ public class SpringServiceConfiguration extends Configuration { @NotNull @JsonProperty - private ApiMetadata apiMetadata; + private ApiMetadata apiMetadata = new ApiMetadata(); public SpringConfiguration getSpring(){ return this.spring;
Added default instance of apiMetadata object so that adding to YAML is optional (i.e. doesn't break backwards compatibility)
hmsonline_dropwizard-spring
train
java
2675ac27da1f78cfe79df208b2ac6af9a530da97
diff --git a/db/sql.php b/db/sql.php index <HASH>..<HASH> 100644 --- a/db/sql.php +++ b/db/sql.php @@ -82,8 +82,9 @@ class SQL extends \PDO { * @param $cmds string|array * @param $args string|array * @param $ttl int + * @param $log bool **/ - function exec($cmds,$args=NULL,$ttl=0) { + function exec($cmds,$args=NULL,$ttl=0,$log=TRUE) { $auto=FALSE; if (is_null($args)) $args=array(); @@ -159,9 +160,10 @@ class SQL extends \PDO { user_error('PDO: '.$error[2]); } } - $this->log.=date('r').' ('. - sprintf('%.1f',1e3*(microtime(TRUE)-$now)).'ms) '. - preg_replace($keys,$vals,$cmd,1).PHP_EOL; + if ($log) + $this->log.=date('r').' ('. + sprintf('%.1f',1e3*(microtime(TRUE)-$now)).'ms) '. + preg_replace($keys,$vals,$cmd,1).PHP_EOL; } if ($this->trans && $auto) $this->commit();
Allow enabling/disabling of SQL log
bcosca_fatfree-core
train
php
c87b1016d83b8c4e194804a35dc3be84b3368df9
diff --git a/lib/fog/glesys/models/compute/server.rb b/lib/fog/glesys/models/compute/server.rb index <HASH>..<HASH> 100644 --- a/lib/fog/glesys/models/compute/server.rb +++ b/lib/fog/glesys/models/compute/server.rb @@ -74,6 +74,31 @@ module Fog data.status == 200 ? true : false end + def setup(credentials = {}) + requires :public_ip_address, :username + require 'net/ssh' + + attrs = attributes.dup + attrs.delete(:rootpassword) + + commands = [ + %{mkdir -p .ssh}, + %{echo "#{Fog::JSON.encode(Fog::JSON.sanitize(attrs))}" >> ~/attributes.json} + ] + if public_key + commands << %{echo "#{public_key}" >> ~/.ssh/authorized_keys} + end + + # wait for aws to be ready + wait_for { sshable? } + + if credentials[:password].nil? && !rootpassword.nil? + credentials[:password] = rootpassword + end + + Fog::SSH.new(public_ip_address, username, credentials).run(commands) + end + def public_ip_address(options = {}) type = options[:type] || nil
[Glesys] Add setup method to copy fog ssh keys to server
fog_fog
train
rb
96e2572a073577b0b428649328359d0430caf100
diff --git a/test/sensu_test.rb b/test/sensu_test.rb index <HASH>..<HASH> 100644 --- a/test/sensu_test.rb +++ b/test/sensu_test.rb @@ -15,8 +15,14 @@ class TestSensu < Test::Unit::TestCase end def test_cli_arguments - options = Sensu::Config.read_arguments(['-w', '-c', @options[:config_file], '-v']) - assert_equal({:worker => true, :config_file => @options[:config_file], :verbose => true}, options) + options = Sensu::Config.read_arguments(['-w', '-c', @options[:config_file], '-v', '-l', '/tmp/sensu_test.log']) + expected = { + :worker => true, + :config_file => @options[:config_file], + :verbose => true, + :log_file => '/tmp/sensu_test.log' + } + assert_equal(expected, options) done end
[cabin] add log file to cli args test
sensu_sensu
train
rb
8fe46c85a985f35c191ef9fe696c56597d02a50c
diff --git a/lib/jwt.rb b/lib/jwt.rb index <HASH>..<HASH> 100644 --- a/lib/jwt.rb +++ b/lib/jwt.rb @@ -16,13 +16,6 @@ module JWT module_function - def decoded_segments(jwt, verify = true) - raise(JWT::DecodeError, 'Nil JSON web token') unless jwt - - decoder = Decode.new jwt, verify - decoder.decode_segments - end - def encode(payload, key, algorithm = 'HS256', header_fields = {}) encoder = Encode.new payload, key, algorithm, header_fields encoder.segments
:boom: Remove obsolete code Remove the `decoded_segments` method from the `JWT` module. The code is replaced by the `JWT::Decode` class.
jwt_ruby-jwt
train
rb
92d94eb8762bb08d3a22430f5bfee1ed7e05c2b5
diff --git a/public/javascript/pump.js b/public/javascript/pump.js index <HASH>..<HASH> 100644 --- a/public/javascript/pump.js +++ b/public/javascript/pump.js @@ -938,7 +938,7 @@ var Pump = (function(_, $, Backbone) { aview.$el.on("pump.rendered", function() { aview.$el.hide(); - view.$("#sidebar").prepend(aview.$el); + view.$("#minor-stream").prepend(aview.$el); aview.$el.slideDown('slow'); }); aview.render(); @@ -976,7 +976,7 @@ var Pump = (function(_, $, Backbone) { aview.$el.on("pump.rendered", function() { aview.$el.hide(); - view.$("#sidebar").prepend(aview.$el); + view.$("#minor-stream").prepend(aview.$el); aview.$el.slideDown('slow'); }); aview.render();
Show minor activities in minor stream Closes #<I>.
pump-io_pump.io
train
js
6f443947b11c88f551c27d18909700eaaf3a00ac
diff --git a/test/browser/test.js b/test/browser/test.js index <HASH>..<HASH> 100755 --- a/test/browser/test.js +++ b/test/browser/test.js @@ -40,16 +40,6 @@ if (process.env.GREP) { testUrl += '?'; testUrl += querystring.stringify(qs); -if (process.env.TRAVIS && - client.browser !== 'firefox' && - client.browser !== 'phantomjs' && - client.browser !== 'chrome' && - process.env.TRAVIS_SECURE_ENV_VARS === 'false') { - console.error('Not running test, cannot connect to saucelabs'); - process.exit(1); - return; -} - function testError(e) { console.error(e); console.error('Doh, tests failed');
test(sauce): debug
delta-db_deltadb-common-utils
train
js
2f7b3c86b81f9bbaa499d9396fee1895b63ea3bc
diff --git a/src/Spryker/Zed/PriceProductDataImport/Business/Model/Step/AbstractSkuToIdProductAbstractStep.php b/src/Spryker/Zed/PriceProductDataImport/Business/Model/Step/AbstractSkuToIdProductAbstractStep.php index <HASH>..<HASH> 100644 --- a/src/Spryker/Zed/PriceProductDataImport/Business/Model/Step/AbstractSkuToIdProductAbstractStep.php +++ b/src/Spryker/Zed/PriceProductDataImport/Business/Model/Step/AbstractSkuToIdProductAbstractStep.php @@ -37,6 +37,8 @@ class AbstractSkuToIdProductAbstractStep implements DataImportStepInterface if (!isset($this->idProductAbstractCache[$productAbstractSku])) { $productQuery = new SpyProductAbstractQuery(); + + /** @var int|null $idProduct */ $idProduct = $productQuery ->select(SpyProductAbstractTableMap::COL_ID_PRODUCT_ABSTRACT) ->findOneBySku($productAbstractSku);
Fix up PHPStan issues.
spryker_price-product-data-import
train
php
2aae02f3ef8c74273f58e8b2657f8a24939c1dae
diff --git a/FaceDetector.php b/FaceDetector.php index <HASH>..<HASH> 100644 --- a/FaceDetector.php +++ b/FaceDetector.php @@ -68,6 +68,10 @@ class FaceDetector $this->canvas = imagecreatefromjpeg($file); + } elseif (is_string($file)) { + + $this->canvas = imagecreatefromstring($file); + } else { throw new Exception("Can not load $file");
Added ability to pass in image as string
mauricesvay_php-facedetection
train
php
a957b5891420c0225d0471f26acd8132b802a05b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ Read the README at https://github.com/deepmind/pysc2 for more information. setup( name='PySC2', - version='2.0.2', + version='3.0.0', description='Starcraft II environment and library for training agents.', long_description=description, author='DeepMind',
Bump the version to <I> for a public release. PiperOrigin-RevId: <I>
deepmind_pysc2
train
py
eae3283e4cf945841b5957563881526d94cdb115
diff --git a/code/model/UserDefinedForm.php b/code/model/UserDefinedForm.php index <HASH>..<HASH> 100755 --- a/code/model/UserDefinedForm.php +++ b/code/model/UserDefinedForm.php @@ -409,6 +409,13 @@ class UserDefinedForm extends Page { class UserDefinedForm_Controller extends Page_Controller { + public static $allowed_actions = array( + 'index', + 'ping', + 'Form', + 'finished' + ); + /** * Load all the custom jquery needed to run the custom * validation
BUG Update allowed_actions on frontend Controller.
silverstripe_silverstripe-userforms
train
php
9d8027c5cdb3eaa726dd48afe91f3bb7650cca2c
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js index <HASH>..<HASH> 100644 --- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js +++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js @@ -1051,10 +1051,10 @@ Guacamole.Keyboard = function Keyboard(element) { for (var keysym in guac_keyboard.pressed) { if (!implicitlyPressed[keysym]) - return true; + return false; } - return false; + return true; };
GUACAMOLE-<I>: Correct inverted explicit/implicit logic.
glyptodon_guacamole-client
train
js
6098ee917d2e9c2a981eed433264d198abd5a346
diff --git a/Model/Product/Image.php b/Model/Product/Image.php index <HASH>..<HASH> 100644 --- a/Model/Product/Image.php +++ b/Model/Product/Image.php @@ -307,7 +307,7 @@ class Image extends ImageModel public function getBaseFileUrl($baseFile) { - if ($baseFile === null) { + if ($baseFile === null || $this->isBaseFilePlaceholder()) { $url = $this->_assetRepo->getUrl( "Magento_Catalog::images/product/placeholder/{$this->getDestinationSubdir()}.jpg" );
Introduced check for image placeholder when building a Fastly IO URL
fastly_fastly-magento2
train
php
92b7a67aa70f394470f43c8b93ff9417aef2d37c
diff --git a/tests/node/test.js b/tests/node/test.js index <HASH>..<HASH> 100644 --- a/tests/node/test.js +++ b/tests/node/test.js @@ -1,6 +1,4 @@ /* eslint-env mocha */ -'use strict'; - const path = require('path'); const assert = require('chai').assert; const jsdom = require('jsdom');
remove use strict from test:node
aframevr_aframe
train
js
a17ca68b962d3f4ceb837333ef7fc9e5ad5d4960
diff --git a/girder/events.py b/girder/events.py index <HASH>..<HASH> 100644 --- a/girder/events.py +++ b/girder/events.py @@ -48,10 +48,6 @@ import threading from girder.utility import config from six.moves import queue -_deprecated = {} -_mapping = {} -daemon = None - class Event(object): """ @@ -318,6 +314,11 @@ def trigger(eventName, info=None, pre=None, async=False, daemon=False): return e +_deprecated = {} +_mapping = {} +daemon = ForegroundEventsDaemon() + + def setupDaemon(): global daemon if config.getConfig()['server'].get('disable_event_daemon', False):
Provide a sensible default for events.daemon Some of our own tests assumed that events.daemon us setup outside the context of the Girder server, so it's quite possible that downstream tests also make this assumption. To be less disruptive, we use a default value for the daemon. I'm not sure if it's more sensible to use the foreground handler as the default, or the threaded mode.
girder_girder
train
py
93825b69adbbb161154b7b27754eb6ef1e974252
diff --git a/interp/arith.go b/interp/arith.go index <HASH>..<HASH> 100644 --- a/interp/arith.go +++ b/interp/arith.go @@ -29,12 +29,7 @@ func (r *Runner) arithm(expr syntax.ArithmExpr) int { case *syntax.UnaryArithm: switch x.Op { case syntax.Inc, syntax.Dec: - word, ok := x.X.(*syntax.Word) - if !ok { - // TODO: error? - return 0 - } - name := r.loneWord(word) + name := r.loneWord(x.X.(*syntax.Word)) old := atoi(r.getVar(name)) val := old if x.Op == syntax.Inc {
interp: Inc and Dec only wrap around a Word now See the previous syntax commit. If the syntax node contract is broken, panicking is OK.
mvdan_sh
train
go
937e9b35e09a8dcd08d4286afbf5d2cffbb8c614
diff --git a/Tests/Functional/Controller/SitemapControllerTest.php b/Tests/Functional/Controller/SitemapControllerTest.php index <HASH>..<HASH> 100644 --- a/Tests/Functional/Controller/SitemapControllerTest.php +++ b/Tests/Functional/Controller/SitemapControllerTest.php @@ -22,6 +22,17 @@ use TYPO3\CMS\Core\Tests\FunctionalTestCase; */ class SitemapControllerTest extends FunctionalTestCase { + + /** + * Load Core Extensions + * + * @var array + */ + protected $coreExtensionsToLoad = [ + 'fluid' + ]; + + /** * @var array */
[TASK] Add fluid as depends in tests
beardcoder_sitemap_generator
train
php
a13ade4a7a0bca08d7fbaf26668fe6af407d9ff1
diff --git a/server/server.go b/server/server.go index <HASH>..<HASH> 100644 --- a/server/server.go +++ b/server/server.go @@ -190,19 +190,7 @@ func (s *WardenServer) Stop() { } s.logger.Info("waiting-for-connections-to-close") - waitChan := make(chan struct{}) - - go func() { - s.handling.Wait() - waitChan <- struct{}{} - }() - - select { - case <-waitChan: - s.logger.Info("all-connections-completed") - case <-time.After(5 * time.Second): - s.logger.Info("waiting-for-connections-to-close-timout") - } + s.handling.Wait() s.logger.Info("stopping-backend") s.backend.Stop()
actually that timeout was a bad idea
cloudfoundry_garden
train
go
49aad6a9d8167a8fee622401f39d3f86bf326f43
diff --git a/hazelcast/src/test/java/com/hazelcast/durableexecutor/DurableRetrieveResultTest.java b/hazelcast/src/test/java/com/hazelcast/durableexecutor/DurableRetrieveResultTest.java index <HASH>..<HASH> 100644 --- a/hazelcast/src/test/java/com/hazelcast/durableexecutor/DurableRetrieveResultTest.java +++ b/hazelcast/src/test/java/com/hazelcast/durableexecutor/DurableRetrieveResultTest.java @@ -24,6 +24,7 @@ import com.hazelcast.test.HazelcastParallelClassRunner; import com.hazelcast.test.TestHazelcastInstanceFactory; import com.hazelcast.test.annotation.ParallelTest; import com.hazelcast.test.annotation.QuickTest; +import org.junit.Ignore; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; @@ -116,6 +117,7 @@ public class DurableRetrieveResultTest extends ExecutorServiceTestSupport { } @Test + @Ignore(value = "https://github.com/hazelcast/hazelcast/issues/10033") public void testSingleExecution_WhenMigratedAfterCompletion_WhenOwnerMemberKilled() throws Exception { String name = randomString(); TestHazelcastInstanceFactory factory = createHazelcastInstanceFactory(3);
Ignore testSingleExecution_WhenMigratedAfterCompletion_WhenOwnerMemberKilled - unblock PR builds
hazelcast_hazelcast
train
java
2c0e3c5f9cc7a2d55421f1551d838743754eed8e
diff --git a/spark/components/card/react/SprkCard.stories.js b/spark/components/card/react/SprkCard.stories.js index <HASH>..<HASH> 100644 --- a/spark/components/card/react/SprkCard.stories.js +++ b/spark/components/card/react/SprkCard.stories.js @@ -7,7 +7,9 @@ export default { }; export const defaultStory = () => ( - <SprkCard idString="card-1" additionalContentClasses="sprk-o-Stack sprk-o-Stack--large" /> + <SprkCard idString="card-1" additionalContentClasses="sprk-o-Stack sprk-o-Stack--large"> + Base Card Content + </SprkCard> ); defaultStory.story = { @@ -21,7 +23,9 @@ export const standout = () => ( additionalContentClasses=" sprk-o-Stack sprk-o-Stack--medium" - /> + > + Base Card Content + </SprkCard> ); standout.story = { @@ -42,7 +46,7 @@ export const highlightedHeader = () => ( ); highlightedHeader.story = { - name: 'highlighted header', + name: 'Highlighted Header', }; export const teaser = () => (
Update sprkcard to be more accurate
sparkdesignsystem_spark-design-system
train
js
0eb03690f9d8f64fd3abe9704223a3236e78bd56
diff --git a/src/CodeGenerator/ReferenceClassGenerator.php b/src/CodeGenerator/ReferenceClassGenerator.php index <HASH>..<HASH> 100644 --- a/src/CodeGenerator/ReferenceClassGenerator.php +++ b/src/CodeGenerator/ReferenceClassGenerator.php @@ -198,6 +198,10 @@ class ReferenceClassGenerator extends AbstractClassGenerator */ private function generateHydratorMethod(PhpFileWriter $w, ReflectionClass $sourceClassReflection): void { + if ($sourceClassReflection->hasMethod('hydrateFromArray')) { + throw new LogicException('Method hydrateFromArray already defined in class ' . $sourceClassReflection->getName() . '.'); + } + $w->beginStaticMethod('hydrateFromArray', ['self $target', 'array $row'], 'void'); { foreach ($sourceClassReflection->getProperties() as $property) {
ReferenceClassGenerator: Check that hydrateFromArray method does not exist yet
smalldb_libSmalldb
train
php
50776f2c6ece7fe2f66eb78e5bca81e4dc775b73
diff --git a/python/ccxt/base/exchange.py b/python/ccxt/base/exchange.py index <HASH>..<HASH> 100644 --- a/python/ccxt/base/exchange.py +++ b/python/ccxt/base/exchange.py @@ -1917,7 +1917,7 @@ class Exchange(object): def parse_trades(self, trades, market=None, since=None, limit=None, params={}): array = self.to_array(trades) - array = [self.soft_extend(self.parse_trade(trade, market), params) for trade in array] + array = [self.merge(self.parse_trade(trade, market), params) for trade in array] array = self.sort_by_2(array, 'timestamp', 'id') symbol = market['symbol'] if market else None tail = since is None
exchange.py parse_trades merge
ccxt_ccxt
train
py
0835f89bb51568698fe9b30e98c9728e8c913f56
diff --git a/kubetest/anywhere.go b/kubetest/anywhere.go index <HASH>..<HASH> 100644 --- a/kubetest/anywhere.go +++ b/kubetest/anywhere.go @@ -47,6 +47,7 @@ var ( const kubernetesAnywhereConfigTemplate = ` .phase1.num_nodes=4 .phase1.cluster_name="{{.Cluster}}" +.phase1.ssh_user="" .phase1.cloud_provider="gce" .phase1.gce.os_image="ubuntu-1604-xenial-v20160420c" @@ -61,6 +62,7 @@ const kubernetesAnywhereConfigTemplate = ` .phase2.kubernetes_version="{{.KubernetesVersion}}" .phase2.provider="{{.Phase2Provider}}" .phase2.kubeadm.version="{{.KubeadmVersion}}" +.phase2.kube_context_name="{{.KubeContext}}" .phase3.run_addons=y .phase3.weave_net={{if eq .Phase2Provider "kubeadm" -}} y {{- else -}} n {{- end}} @@ -79,6 +81,7 @@ type kubernetesAnywhere struct { Project string Cluster string Zone string + KubeContext string } var _ deployer = kubernetesAnywhere{}
Updated k8s-anywhere config template
kubernetes_test-infra
train
go
46cac6f29207ea4251c3a9c48c0bb3fff65a5044
diff --git a/auth/store_test.go b/auth/store_test.go index <HASH>..<HASH> 100644 --- a/auth/store_test.go +++ b/auth/store_test.go @@ -448,6 +448,25 @@ func TestAuthInfoFromCtx(t *testing.T) { } } +func TestAuthDisable(t *testing.T) { + as, tearDown := setupAuthStore(t) + defer tearDown(t) + + as.AuthDisable() + ctx := context.WithValue(context.WithValue(context.TODO(), "index", uint64(2)), "simpleToken", "dummy") + _, err := as.Authenticate(ctx, "foo", "bar") + if err != ErrAuthNotEnabled { + t.Errorf("expected %v, got %v", ErrAuthNotEnabled, err) + } + + // Disabling disabled auth to make sure it can return safely if store is already disabled. + as.AuthDisable() + _, err = as.Authenticate(ctx, "foo", "bar") + if err != ErrAuthNotEnabled { + t.Errorf("expected %v, got %v", ErrAuthNotEnabled, err) + } +} + func contains(array []string, str string) bool { for _, s := range array { if s == str {
auth: unit-test for authStore.AuthDisable() This will cover unit-test for AuthDisable in store.go
etcd-io_etcd
train
go
993af8abefb0d905ab514bb4c4af0250cadacec4
diff --git a/benchexec/tablegenerator/react-table/src/components/QuantilePlot.js b/benchexec/tablegenerator/react-table/src/components/QuantilePlot.js index <HASH>..<HASH> 100644 --- a/benchexec/tablegenerator/react-table/src/components/QuantilePlot.js +++ b/benchexec/tablegenerator/react-table/src/components/QuantilePlot.js @@ -51,7 +51,7 @@ export default class QuantilePlot extends React.Component { linear = stringAsBoolean(linear); correct = stringAsBoolean(correct); - const isValue = column && !column.startsWith("runset"); + const isValue = column === undefined || !column.startsWith("runset"); const parameterSelection = column && isValue
Fix bug that left the selected column in Quantile Plot empty This bug crashed the application when the Quantile Plot was opened without any URL params defined and is now fixed.
sosy-lab_benchexec
train
js
001dedbc083621c0048d8d8150fbe0ff36ef86bf
diff --git a/Cursor.php b/Cursor.php index <HASH>..<HASH> 100644 --- a/Cursor.php +++ b/Cursor.php @@ -18,7 +18,7 @@ class Cursor { fwrite(self::$stream, "\033[{$count}C"); } - static function backwards($count = 1) { + static function back($count = 1) { fwrite(self::$stream, "\033[{$count}D"); } @@ -26,12 +26,12 @@ class Cursor { fwrite(self::$stream, "\033[{$row};{$col}f"); } - static function saveposition() { + static function savepos() { fwrite(self::$stream, "\033[s"); } static function save() { - fwrite(self::$stream, "\033[7"); + fwrite(self::$stream, "\0337"); } static function unsave() { @@ -39,7 +39,7 @@ class Cursor { } static function restore() { - fwrite(self::$stream, "\033[8"); + fwrite(self::$stream, "\0338"); } } \ No newline at end of file
Fixed some typos, changed a method name
donatj_CLI-Toolkit
train
php
f917b0b881a2e778da4eda8d1c4ddbdf2bdb645a
diff --git a/classes/Pods.php b/classes/Pods.php index <HASH>..<HASH> 100644 --- a/classes/Pods.php +++ b/classes/Pods.php @@ -2531,7 +2531,7 @@ class Pods implements Iterator { * @param null|int $offset Offset of rows. * @param null|int $total Total rows. * - * @return int Number of pages + * @return int Number of pages. * @since 2.3.10 */ public function total_pages( $limit = null, $offset = null, $total = null ) { @@ -2550,7 +2550,12 @@ class Pods implements Iterator { $total = $this->total_found(); } - return ceil( ( $total - $offset ) / $limit ); + // No limit means one page. + if ( $limit < 1 ) { + return 1; + } + + return (int) ceil( ( $total - $offset ) / $limit ); }
Return early if limit is less than 1 and always return an integer
pods-framework_pods
train
php
ba1de1b1f25210891a704df76bc4e1d5def2e6b1
diff --git a/app/xmpp/msg-processors/root-info.js b/app/xmpp/msg-processors/root-info.js index <HASH>..<HASH> 100644 --- a/app/xmpp/msg-processors/root-info.js +++ b/app/xmpp/msg-processors/root-info.js @@ -18,8 +18,8 @@ module.exports = MessageProcessor.extend({ }); query.c('identity', { - category: 'conference', - type: 'text', + category: 'server', + type: 'im', name: 'Let\'s chat' });
Changed XMPP root should identify itself as a server, not conference host. Fixes #<I>
sdelements_lets-chat
train
js
380443d5f8b87f0d781fa14718f551b2ff638a42
diff --git a/src/nl/auth.php b/src/nl/auth.php index <HASH>..<HASH> 100644 --- a/src/nl/auth.php +++ b/src/nl/auth.php @@ -14,6 +14,6 @@ return [ */ 'failed' => 'Deze combinatie van e-mailadres en wachtwoord is niet geldig.', - 'throttle' => 'Teveel gefaalde login pogingen. Probeer het over :seconds seconden nogmaals.', + 'throttle' => 'Teveel mislukte login pogingen. Probeer het over :seconds seconden nogmaals.', ];
more common dutch 'Gefaalde' is not a common word for failed in internet/website language for Dutch 'mislukte' is better
caouecs_Laravel-lang
train
php
ff538ee7da092483f62c9ee6b5f21adca15df63e
diff --git a/packages/ra-ui-materialui/src/layout/Sidebar.js b/packages/ra-ui-materialui/src/layout/Sidebar.js index <HASH>..<HASH> 100644 --- a/packages/ra-ui-materialui/src/layout/Sidebar.js +++ b/packages/ra-ui-materialui/src/layout/Sidebar.js @@ -14,7 +14,7 @@ const useStyles = makeStyles( theme => ({ drawerPaper: { position: 'relative', - height: 'auto', + height: '100%', overflowX: 'hidden', width: props => props.open
Fix Missing styles for full height sidebar
marmelab_react-admin
train
js
aee1652b553695b9abc4fbade96929c6e3675f83
diff --git a/mod/scorm/datamodel.php b/mod/scorm/datamodel.php index <HASH>..<HASH> 100755 --- a/mod/scorm/datamodel.php +++ b/mod/scorm/datamodel.php @@ -67,12 +67,12 @@ } } } - // Log every datamodel update requested - if (substr($element,0,15) == 'adl.nav.request' || substr($element,0,3) == 'cmi') { - if (debugging('',DEBUG_DEVELOPER)) { - add_to_log($course->id, 'scorm', 'trk: '.trim($scorm->name).' at: '.$attempt, 'view.php?id='.$cm->id, "$element => $value", $cm->id); - } - } +// // Log every datamodel update requested +// if (substr($element,0,15) == 'adl.nav.request' || substr($element,0,3) == 'cmi') { +// if (debugging('',DEBUG_DEVELOPER)) { +// add_to_log($course->id, 'scorm', 'trk: '.trim($scorm->name).' at: '.$attempt, 'view.php?id='.$cm->id, "$element => $value", $cm->id); +// } +// } } } if ($result) {
MDL-<I> - SCORM results not transferring to Gradebook. remove add_to_log.
moodle_moodle
train
php
602c04c400b53524dfaa67bbc649b5ccee905074
diff --git a/python/dllib/src/bigdl/dllib/utils/nest.py b/python/dllib/src/bigdl/dllib/utils/nest.py index <HASH>..<HASH> 100644 --- a/python/dllib/src/bigdl/dllib/utils/nest.py +++ b/python/dllib/src/bigdl/dllib/utils/nest.py @@ -41,7 +41,7 @@ def flatten(seq): def ptensor_to_numpy(seq): - return [t.numpy() for t in flatten(seq)] + return [t.data.numpy() for t in flatten(seq)] def pack_sequence_as(structure, flat_sequence):
support create featureset from pytorch dataloader creator functions. (#<I>)
intel-analytics_BigDL
train
py