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
a4957da1ab59e101ff41d5702681803a13442812
diff --git a/Treant.js b/Treant.js index <HASH>..<HASH> 100644 --- a/Treant.js +++ b/Treant.js @@ -1864,6 +1864,12 @@ // TEXT if ( this.text ) { for ( var key in this.text ) { + + // adding DATA Attributes to the node + if(key.match(/data/g)){ + node.setAttribute(key, this.text[key]); + } + if ( TreeNode.CONFIG.textClass[key] ) { var text = document.createElement( this.text[key].href? 'a' : 'p' ); @@ -2135,4 +2141,4 @@ /* expose constructor globally */ window.Treant = Treant; -})(); \ No newline at end of file +})();
Updated Treant.js Updated Treant.js so that data-attributes could be added
fperucic_treant-js
train
js
ac2b76daa7aec1fa0234c5da6a684b62f466737f
diff --git a/core/src/main/java/org/parboiled/buffers/MutableInputBuffer.java b/core/src/main/java/org/parboiled/buffers/MutableInputBuffer.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/parboiled/buffers/MutableInputBuffer.java +++ b/core/src/main/java/org/parboiled/buffers/MutableInputBuffer.java @@ -53,7 +53,7 @@ public class MutableInputBuffer implements InputBuffer { } public int getOriginalIndex(int index) { - return fix(index); + return buffer.getOriginalIndex(fix(index)); } public String extractLine(int lineNumber) {
core: Fix in MutableInputBuffer
sirthias_parboiled
train
java
e37b9a236323481b1cc024b03f0a68ba1b5c837e
diff --git a/manifest.php b/manifest.php index <HASH>..<HASH> 100755 --- a/manifest.php +++ b/manifest.php @@ -30,7 +30,7 @@ return array( 'label' => 'Browser and OS diagnostic tool', 'description' => 'Check compatibility of the os and browser of a client', 'license' => 'GPL-2.0', - 'version' => '6.1.0', + 'version' => '7.0.0', 'author' => 'Open Assessment Technologies SA', 'requires' => array( 'generis' => '>=12.5.0', diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php index <HASH>..<HASH> 100755 --- a/scripts/update/Updater.php +++ b/scripts/update/Updater.php @@ -780,6 +780,6 @@ class Updater extends \common_ext_ExtensionUpdater $this->setVersion('6.0.1'); } - $this->skip('6.0.1', '6.1.0'); + $this->skip('6.0.1', '7.0.0'); } }
TTD-<I> changed major version
oat-sa_extension-tao-clientdiag
train
php,php
b094a62dee994674cbd07fa8765b95e28a192654
diff --git a/heron/executor/tests/python/heron_executor_unittest.py b/heron/executor/tests/python/heron_executor_unittest.py index <HASH>..<HASH> 100644 --- a/heron/executor/tests/python/heron_executor_unittest.py +++ b/heron/executor/tests/python/heron_executor_unittest.py @@ -121,7 +121,7 @@ class HeronExecutorTest(unittest.TestCase): "-Xloggc:log-files/gc.healthmgr.log -Djava.net.preferIPv4Stack=true " \ "-cp scheduler_classpath:healthmgr_classpath " \ "com.twitter.heron.healthmgr.HealthManager --cluster cluster --role role " \ - "--environment environ --topology_name topname" + "--environment environ --topology_name topname --verbose" def get_expected_instance_command(component_name, instance_id, container_id): instance_name = "container_%d_%s_%d" % (container_id, component_name, instance_id)
fix the executor unit test (#<I>)
apache_incubator-heron
train
py
125070958d3f5bdf8a66bed74179b22c4bc30e7b
diff --git a/transport/src/main/java/io/netty/channel/ChannelPipeline.java b/transport/src/main/java/io/netty/channel/ChannelPipeline.java index <HASH>..<HASH> 100644 --- a/transport/src/main/java/io/netty/channel/ChannelPipeline.java +++ b/transport/src/main/java/io/netty/channel/ChannelPipeline.java @@ -117,7 +117,7 @@ import java.util.NoSuchElementException; * <ul> * <li>3 and 4 don't implement {@link ChannelInboundHandler}, and therefore the actual evaluation order of an inbound * event will be: 1, 2, and 5.</li> - * <li>1 and 2 implement {@link ChannelOutboundHandler}, and therefore the actual evaluation order of a + * <li>1 and 2 don't implement {@link ChannelOutboundHandler}, and therefore the actual evaluation order of a * outbound event will be: 5, 4, and 3.</li> * <li>If 5 implements both {@link ChannelInboundHandler} and {@link ChannelOutboundHandler}, the evaluation order of * an inbound and a outbound event could be 125 and 543 respectively.</li>
Fix up ChannelPipeline javadocs by add lost "don't "
netty_netty
train
java
3ab76e40ff0962c14a86c34a479d169b8e5a1da3
diff --git a/src/Symfony/Component/Console/Helper/ProcessHelper.php b/src/Symfony/Component/Console/Helper/ProcessHelper.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Console/Helper/ProcessHelper.php +++ b/src/Symfony/Component/Console/Helper/ProcessHelper.php @@ -37,6 +37,10 @@ class ProcessHelper extends Helper */ public function run(OutputInterface $output, $cmd, $error = null, callable $callback = null, $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE) { + if (!class_exists(Process::class)) { + throw new \LogicException('The Process helper requires the "Process" component. Install "symfony/process" to use it.'); + } + if ($output instanceof ConsoleOutputInterface) { $output = $output->getErrorOutput(); }
Add meaningful message when Process is not installed (ProcessHelper)
symfony_symfony
train
php
fdc5141d59ee8158be76ffe9cea1605eaa356b3a
diff --git a/courriers/forms.py b/courriers/forms.py index <HASH>..<HASH> 100644 --- a/courriers/forms.py +++ b/courriers/forms.py @@ -69,7 +69,7 @@ class UnsubscribeForm(forms.Form): return email def save(self, user=None): - from_all = self.cleaned_data['from_all'] + from_all = self.cleaned_data.get('from_all', False) if from_all or not self.newsletter_list: self.backend.unregister(self.cleaned_data['email'])
Fix from_all in UnsubscribeForm.save
ulule_django-courriers
train
py
c43a00d46d94ac23d39e938eaf9cfd6c9a32d6b8
diff --git a/src/Charcoal/Queue/AbstractQueueManager.php b/src/Charcoal/Queue/AbstractQueueManager.php index <HASH>..<HASH> 100644 --- a/src/Charcoal/Queue/AbstractQueueManager.php +++ b/src/Charcoal/Queue/AbstractQueueManager.php @@ -465,7 +465,14 @@ abstract class AbstractQueueManager implements */ public function totalChunks() { - return (int)ceil($this->totalQueuedItems() / $this->chunkSize()); + $total = $this->totalQueuedItems(); + + $limit = $this->limit(); + if ($limit > 0 && $total > $limit) { + $total = $limit; + } + + return (int)ceil($total / $this->chunkSize()); } /**
Fix use of chunk size and limit on queue manager
locomotivemtl_charcoal-queue
train
php
7c95b0e1f3990cb926ac2fe1dac02b8109ec95f2
diff --git a/src/main/java/com/lmax/disruptor/dsl/Disruptor.java b/src/main/java/com/lmax/disruptor/dsl/Disruptor.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/lmax/disruptor/dsl/Disruptor.java +++ b/src/main/java/com/lmax/disruptor/dsl/Disruptor.java @@ -248,7 +248,7 @@ public class Disruptor<T> checkNotStarted(); if (!(this.exceptionHandler instanceof ExceptionHandlerWrapper)) { - throw new IllegalStateException("Mixing calls to handleExceptionsWith and setDefaultExceptionHandler is not supported."); + throw new IllegalStateException("setDefaultExceptionHandler can not be used after handleExceptionsWith"); } ((ExceptionHandlerWrapper<T>)this.exceptionHandler).switchTo(exceptionHandler); }
More accurate exception message when attempting to use setDefaultExceptionHandler after handleExceptionsWith.
LMAX-Exchange_disruptor
train
java
d2fc0a46764b1ac8a657cbc4db009167e9c909b0
diff --git a/lib/contextify.js b/lib/contextify.js index <HASH>..<HASH> 100644 --- a/lib/contextify.js +++ b/lib/contextify.js @@ -18,13 +18,13 @@ function Contextify (sandbox) { sandbox.dispose = function () { sandbox.run = function () { - throw new Error("Called run() after dispose()."); + throw new Error('Called run() after dispose().'); }; sandbox.getGlobal = function () { - throw new Error("Called getGlobal() after dispose()."); + throw new Error('Called getGlobal() after dispose().'); }; sandbox.dispose = function () { - throw new Error("Called dispose() after dispose()."); + throw new Error('Called dispose() after dispose().'); }; ctx = null; }
Fix to use single quotes instead of double quotes
brianmcd_contextify
train
js
3f148c74ba3d9383002fc28af39c53a2117724d5
diff --git a/catalog/src/main/java/org/killbill/billing/catalog/plugin/StandaloneCatalogMapper.java b/catalog/src/main/java/org/killbill/billing/catalog/plugin/StandaloneCatalogMapper.java index <HASH>..<HASH> 100644 --- a/catalog/src/main/java/org/killbill/billing/catalog/plugin/StandaloneCatalogMapper.java +++ b/catalog/src/main/java/org/killbill/billing/catalog/plugin/StandaloneCatalogMapper.java @@ -257,7 +257,7 @@ public class StandaloneCatalogMapper { if (tmpDefaultProducts == null) { final Map<String, Product> map = new HashMap<String, Product>(); for (final Product product : input) map.put(product.getName(), toDefaultProduct(product)); - tmpDefaultProducts = ImmutableMap.copyOf(map); + tmpDefaultProducts = map; } return tmpDefaultProducts.values(); } @@ -285,7 +285,7 @@ public class StandaloneCatalogMapper { if (tmpDefaultPlans == null) { final Map<String, Plan> map = new HashMap<String, Plan>(); for (final Plan plan : input) map.put(plan.getName(), toDefaultPlan(plan)); - tmpDefaultPlans = ImmutableMap.copyOf(map); + tmpDefaultPlans = map; } return tmpDefaultPlans.values(); }
catalog: Remove unused copy of plans and products. Improvement on <I>a<I>c<I>c5be0ac<I>bb<I>c0efad3aafdb0
killbill_killbill
train
java
65ecd11b4d4689108eabd464377afdb20ff95240
diff --git a/rest_framework_simplejwt/utils.py b/rest_framework_simplejwt/utils.py index <HASH>..<HASH> 100644 --- a/rest_framework_simplejwt/utils.py +++ b/rest_framework_simplejwt/utils.py @@ -6,11 +6,11 @@ from datetime import datetime from django.conf import settings from django.utils import six from django.utils.functional import lazy -from django.utils.timezone import is_aware, make_aware, utc +from django.utils.timezone import is_naive, make_aware, utc def make_utc(dt): - if settings.USE_TZ and not is_aware(dt): + if settings.USE_TZ and is_naive(dt): return make_aware(dt, timezone=utc) return dt
Use is_naive here for clarity
davesque_django-rest-framework-simplejwt
train
py
2e4d89bc84b978314dde5b962a72c6a55ceffc27
diff --git a/pyum/repometadata/base.py b/pyum/repometadata/base.py index <HASH>..<HASH> 100644 --- a/pyum/repometadata/base.py +++ b/pyum/repometadata/base.py @@ -21,12 +21,12 @@ class Data(HTTPClient): self.repo_url = new_url def location(self): - return "{0}/{1}".format(self.repo_url.replace('repodata/repomd.xml',''), self._attributes['location']) + return "{0}/{1}".format(self.repo_url.replace('repodata/repomd.xml', ''), self._attributes['location']) def load(self): data = self._http_request(self.location()) self._parse(data) return self - def _parse(self, xml): + def _parse(self, *args, **kwargs): raise Exception("_parse() is not implemented.")
Removed unused args.
drewsonne_pyum
train
py
75707c2bee85a17a0c8f2d9a78f79c2346be309e
diff --git a/src/stickyfill.js b/src/stickyfill.js index <HASH>..<HASH> 100644 --- a/src/stickyfill.js +++ b/src/stickyfill.js @@ -196,11 +196,11 @@ }, //checks whether stickies start or stop positions have changed - _fastCheck: function() { + _dirtyCheck: function() { var _this = this; for (var i = this.watchArray.length - 1; i >= 0; i--) { - _this.watchArray[i]._fastCheck(); + _this.watchArray[i]._dirtyCheck(); } }, @@ -232,7 +232,7 @@ var _this = this; this._checkTimer = setInterval(function() { - _this._fastCheck(); + _this._dirtyCheck(); }, 500); }, @@ -381,6 +381,7 @@ }, turnOn: function() { + if (this._turnedOn) return; if (isNaN(parseFloat(this._p.computed.top)) || this._isCell) return; this._turnedOn = true; @@ -398,6 +399,7 @@ }, turnOff: function() { + if (!this._turnedOn) return; var _this = this, deinitParent = true; @@ -510,7 +512,7 @@ this._mode = mode; }, - _fastCheck: function() { + _dirtyCheck: function() { if (!this._turnedOn) return; var deltaTop = Math.abs(getDocOffsetTop(this._clone) - this._p.docOffsetTop),
additional checks for api functions, naming changes
wilddeer_stickyfill
train
js
c44a415bfdea2deaa2dab01f5fbc5ec6f341f64d
diff --git a/bundles/org.eclipse.orion.client.git/web/git/plugins/gitPlugin.js b/bundles/org.eclipse.orion.client.git/web/git/plugins/gitPlugin.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.git/web/git/plugins/gitPlugin.js +++ b/bundles/org.eclipse.orion.client.git/web/git/plugins/gitPlugin.js @@ -92,7 +92,8 @@ function(PluginProvider, xhr, mServiceregistry, mGitClient, mSshTools, i18nUtil, }); provider.registerService("orion.page.link.related", null, { - id: "eclipse.git.status" + id: "eclipse.git.status", + category: "git" }); provider.registerService("orion.page.link.related", null, {
Fix category on Git Status related link
eclipse_orion.client
train
js
865c7d84368583ed04d5361528bc6bdd284ee18e
diff --git a/splitlog-core/src/main/java/com/github/triceo/splitlog/DefaultMessage.java b/splitlog-core/src/main/java/com/github/triceo/splitlog/DefaultMessage.java index <HASH>..<HASH> 100644 --- a/splitlog-core/src/main/java/com/github/triceo/splitlog/DefaultMessage.java +++ b/splitlog-core/src/main/java/com/github/triceo/splitlog/DefaultMessage.java @@ -15,7 +15,7 @@ import com.github.triceo.splitlog.api.MessageType; import com.github.triceo.splitlog.api.TailSplitter; import com.github.triceo.splitlog.splitters.SimpleTailSplitter; -final public class DefaultMessage implements Message { +final class DefaultMessage implements Message { private static final TailSplitter DEFAULT_SPLITTER = new SimpleTailSplitter();
Issue #<I>: DefaultMessage needn't be public anymore
triceo_splitlog
train
java
955e3ce26dae2332d9fe1ca1c1aabd38d83389ea
diff --git a/client-runtime/src/main/java/com/microsoft/rest/RestClient.java b/client-runtime/src/main/java/com/microsoft/rest/RestClient.java index <HASH>..<HASH> 100644 --- a/client-runtime/src/main/java/com/microsoft/rest/RestClient.java +++ b/client-runtime/src/main/java/com/microsoft/rest/RestClient.java @@ -12,7 +12,13 @@ import com.microsoft.rest.protocol.ResponseBuilder; import com.microsoft.rest.protocol.SerializerAdapter; import com.microsoft.rest.v2.http.HttpClient; import com.microsoft.rest.v2.http.RxNettyAdapter; -import com.microsoft.rest.v2.policy.*; +import com.microsoft.rest.v2.policy.CredentialsPolicy; +import com.microsoft.rest.v2.policy.LoggingPolicy; +import com.microsoft.rest.v2.policy.RequestPolicy; +import com.microsoft.rest.v2.policy.RequestPolicyChain; +import com.microsoft.rest.v2.policy.RetryPolicy; +import com.microsoft.rest.v2.policy.SendRequestPolicyFactory; +import com.microsoft.rest.v2.policy.UserAgentPolicy; import java.util.ArrayList; import java.util.List;
Fix import package.* Fixing IntelliJ settings so it won't do that any more...
Azure_azure-sdk-for-java
train
java
653256c85895ed3abf362522bcb669eac3d8f853
diff --git a/lib/mongify/database/column.rb b/lib/mongify/database/column.rb index <HASH>..<HASH> 100644 --- a/lib/mongify/database/column.rb +++ b/lib/mongify/database/column.rb @@ -122,7 +122,7 @@ module Mongify return {} if ignored? case type when :key - {"pre_mongified_id" => value} + {"pre_mongified_id" => value.to_i} else {"#{name}" => type_cast(value)} end diff --git a/spec/mongify/database/column_spec.rb b/spec/mongify/database/column_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mongify/database/column_spec.rb +++ b/spec/mongify/database/column_spec.rb @@ -189,6 +189,10 @@ describe Mongify::Database::Column do @column = Mongify::Database::Column.new('id', :key) @column.translate(123123).should == {"pre_mongified_id" => 123123} end + it "should return an integer for pre_mongified_id" do + @column = Mongify::Database::Column.new('id', :key) + @column.translate('123123').should == {"pre_mongified_id" => 123123} + end end context :type_cast do it "should return value if unknown type" do
Bug fixed where pre_mongified_id was being changed to a string.
anlek_mongify
train
rb,rb
1c91aea6fd92edbfe95020a310a8150141f6bc7f
diff --git a/durastore/src/main/java/org/duracloud/durastore/config/PropertyConfig.java b/durastore/src/main/java/org/duracloud/durastore/config/PropertyConfig.java index <HASH>..<HASH> 100644 --- a/durastore/src/main/java/org/duracloud/durastore/config/PropertyConfig.java +++ b/durastore/src/main/java/org/duracloud/durastore/config/PropertyConfig.java @@ -20,11 +20,9 @@ import org.springframework.core.io.ResourceLoader; @Configuration @Order(Ordered.HIGHEST_PRECEDENCE) @PropertySource("${duracloud.config.file}") //this references the system property. - public class PropertyConfig { - @Bean - public PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer(ResourceLoader resourceLoader) throws IOException{ + public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer(ResourceLoader resourceLoader) throws IOException{ PropertySourcesPlaceholderConfigurer p = new PropertySourcesPlaceholderConfigurer(); return p; }
Sets the PropertyConfig method in DuraStore to be static. This makes it consistent with DurAdmin and resolves a runtime warning.
duracloud_duracloud
train
java
552238b72a3e2e3e0e434bb9ce38a31ffdcb2c43
diff --git a/vyper/codegen/return_.py b/vyper/codegen/return_.py index <HASH>..<HASH> 100644 --- a/vyper/codegen/return_.py +++ b/vyper/codegen/return_.py @@ -8,6 +8,7 @@ from vyper.parser.lll_node import ( from vyper.parser.parser_utils import ( getpos, zero_pad, + make_setter, # typechecker ) from vyper.types import ( BaseType, @@ -104,7 +105,13 @@ def gen_tuple_return(stmt, context, sub): abi_typ = abi_type_of(context.return_type) abi_bytes_needed = abi_typ.static_size() + abi_typ.dynamic_size_bound() dst, _ = context.memory_allocator.increase_memory(32 * abi_bytes_needed) - return_buffer = LLLnode(dst, location='memory', annotation='return_buffer') + return_buffer = LLLnode(dst, + location='memory', + annotation='return_buffer', + typ=context.return_type) + + # call make_setter for its typechecking side effects :) + make_setter(return_buffer, sub, 'memory', pos=getpos(stmt)) encode_out = abi_encode(return_buffer, sub, pos=getpos(stmt), returns=True) load_return_len = ['mload', MemoryPositions.FREE_VAR_SPACE]
Run typechecker in gen_tuple_return by using make_setter for its typechecking side effects.
ethereum_vyper
train
py
e8db3a0391f27c7b81dd423f585ee5a501768adc
diff --git a/error/custom.js b/error/custom.js index <HASH>..<HASH> 100644 --- a/error/custom.js +++ b/error/custom.js @@ -14,7 +14,7 @@ exports = module.exports = function (message/*, code, ext*/) { } } if (ext != null) assign(err, ext); - if (code != null) err.code = String(code); + if (code != null) err.code = code; if (captureStackTrace) captureStackTrace(err, exports); return err; };
fix(Error.custom): allow non-string code
medikoo_es5-ext
train
js
ddeae8ab020e8aca782124ac368126b9dea4c659
diff --git a/Source/com/drew/tools/ProcessAllImagesInFolderUtility.java b/Source/com/drew/tools/ProcessAllImagesInFolderUtility.java index <HASH>..<HASH> 100644 --- a/Source/com/drew/tools/ProcessAllImagesInFolderUtility.java +++ b/Source/com/drew/tools/ProcessAllImagesInFolderUtility.java @@ -510,7 +510,7 @@ public class ProcessAllImagesInFolderUtility for (Map.Entry<Integer, Integer> pair2 : counts) { Integer tagType = pair2.getKey(); Integer count = pair2.getValue(); - System.out.format("%s, 0x%05X, %d\n", directoryName, tagType, count); + System.out.format("%s, 0x%04X, %d\n", directoryName, tagType, count); } } }
Log 4-char hex, not 5.
drewnoakes_metadata-extractor
train
java
752d9945656a1a9bf375fe5e02a16dc3607d7c7e
diff --git a/src/Builder.php b/src/Builder.php index <HASH>..<HASH> 100644 --- a/src/Builder.php +++ b/src/Builder.php @@ -74,6 +74,9 @@ class Builder if ($parsedHeaders['Content-Type'] === null) { $parsedHeaders['Content-Type'] = 'application/octet-stream'; } + if ($this->operation['API'] === 'DeleteMultipleObjects') { + $parsedHeaders['Content-MD5'] = base64_encode(md5($this->parseRequestBody())); + } return $parsedHeaders; }
Calculate Content-MD5 for user on DeleteMultipleObjects
yunify_qingstor-sdk-php
train
php
881390a9d89db556be4e92299d72524c2a3fe509
diff --git a/lib/rabl/helpers.rb b/lib/rabl/helpers.rb index <HASH>..<HASH> 100644 --- a/lib/rabl/helpers.rb +++ b/lib/rabl/helpers.rb @@ -4,7 +4,7 @@ module Rabl # data_object(@user => :person) => @user # data_object(:user => :person) => @_object.send(:user) def data_object(data) - data = (data.is_a?(Hash) && data.keys.one?) ? data.keys.first : data + data = (data.is_a?(Hash) && data.keys.size == 1) ? data.keys.first : data data.is_a?(Symbol) && @_object ? @_object.send(data) : data end
changed for <I> compatibility (does not have one? method on Enumerable)
nesquena_rabl
train
rb
7e6f4624954d62e6900c3927c7608785cb4a593f
diff --git a/tests/test_ops/test_rotated_feature_align.py b/tests/test_ops/test_rotated_feature_align.py index <HASH>..<HASH> 100644 --- a/tests/test_ops/test_rotated_feature_align.py +++ b/tests/test_ops/test_rotated_feature_align.py @@ -3,11 +3,21 @@ import pytest import torch from mmcv.ops import rotated_feature_align +from mmcv.utils import IS_CUDA_AVAILABLE @pytest.mark.skipif( not torch.cuda.is_available(), reason='requires CUDA support') -@pytest.mark.parametrize('device', ['cuda', 'cpu']) +@pytest.mark.parametrize('device', [ + pytest.param( + 'cuda', + marks=pytest.mark.skipif( + not IS_CUDA_AVAILABLE, reason='requires CUDA support')), + pytest.param( + 'cpu', + marks=pytest.mark.skipif( + torch.__version__ == 'parrots', reason='requires PyTorch support')) +]) def test_rotated_feature_align(device): feature = torch.tensor([[[[1.2924, -0.2172, -0.5222, 0.1172], [0.9144, 1.2248, 1.3115, -0.9690],
[Fix] Skip CPU test in test_rotated_feature_align.py for parrots (#<I>) * skip test_rotated_feature_align.py for parrots
open-mmlab_mmcv
train
py
7bf6a678d4ce55bbac92f94e3d73300ce13f336a
diff --git a/src/frontend/org/voltcore/logging/VoltLog4jLogger.java b/src/frontend/org/voltcore/logging/VoltLog4jLogger.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltcore/logging/VoltLog4jLogger.java +++ b/src/frontend/org/voltcore/logging/VoltLog4jLogger.java @@ -51,16 +51,6 @@ public class VoltLog4jLogger implements CoreVoltLogger { true, e); } Logger.getRootLogger().setResourceBundle(rb); - - // Make the LogManager shutdown hook the last thing to be done, - // so that we'll get logging from any other shutdown behavior. - ShutdownHooks.registerFinalShutdownAction( - new Runnable() { - @Override - public void run() { - LogManager.shutdown(); - } - }); } @@ -191,6 +181,16 @@ public class VoltLog4jLogger implements CoreVoltLogger { * @param logRootDH log directory root */ public static void setFileLoggerRoot(File logRootDH) { + + // Make the LogManager shutdown hook the last thing to be done, + // so that we'll get logging from any other shutdown behavior. + ShutdownHooks.registerFinalShutdownAction( + new Runnable() { + @Override + public void run() { + LogManager.shutdown(); + } + }); if (System.getProperty("log4j.configuration", "").toLowerCase().contains("/voltdb/tests/")) { return; }
ENG-<I>: Register VoltLogger shutdown hook in the config path rather than in the VoltLogger ClassLoader path because the ShutdownHook is cleaned up after each test even when the class survives between tests.
VoltDB_voltdb
train
java
0a0322a8ea3bc9bc2e7b4c2a839a576db3ad7898
diff --git a/spec/matchers/login_system_matcher.rb b/spec/matchers/login_system_matcher.rb index <HASH>..<HASH> 100644 --- a/spec/matchers/login_system_matcher.rb +++ b/spec/matchers/login_system_matcher.rb @@ -62,8 +62,8 @@ module RSpec @example.request.session['user_id'] = user.id @proc.call response = @example.response - @urls[user] = response.redirect_url if @url && !response.redirect_url_match?(@url) - @result[user] = response.redirect? && (@url.nil? || response.redirect_url_match?(@url)) + @urls[user] = response.redirect_url if @url && !response.location =~ Regexp.new(@url) + @result[user] = response.redirect? && (@url.nil? || response.location =~ Regexp.new(@url) ) end end
Replace response.redirect_url_match? w/ response.location =~ regexp
radiant_radiant
train
rb
e92689a24f5c4a4d7c14c37c74c344a6d0867ce5
diff --git a/grimoire/elk/bugzilla.py b/grimoire/elk/bugzilla.py index <HASH>..<HASH> 100644 --- a/grimoire/elk/bugzilla.py +++ b/grimoire/elk/bugzilla.py @@ -172,6 +172,10 @@ class BugzillaEnrich(Enrich): u = urlparse(self.perceval_backend.url) return u.scheme+"//"+u.netloc + if 'bug_id' not in issue: + logging.warning("Bug without bug_id %s" % (issue)) + return None + eitem = {} # Fields that are the same in item and eitem copy_fields = ["ocean-unique-id"] @@ -286,6 +290,8 @@ class BugzillaEnrich(Enrich): bulk_json = "" current = 0 eitem = self.enrich_issue(issue) + if not eitem: + continue data_json = json.dumps(eitem) bulk_json += '{"index" : {"_id" : "%s" } }\n' % (issue["bug_id"]) bulk_json += data_json +"\n" # Bulk document
[Enrich Bugzilla] Some bug comes without bug_id. Handle it.
chaoss_grimoirelab-elk
train
py
3b2de5f15049a3b5d2a66f24e06c75e2581e5d83
diff --git a/charmhelpers/contrib/openstack/context.py b/charmhelpers/contrib/openstack/context.py index <HASH>..<HASH> 100644 --- a/charmhelpers/contrib/openstack/context.py +++ b/charmhelpers/contrib/openstack/context.py @@ -506,7 +506,9 @@ class ApacheSSLContext(OSContextGenerator): content=b64decode(key)) def configure_ca(self): - install_ca_cert(get_ca_cert()) + ca_cert = get_ca_cert() + if ca_cert: + install_ca_cert(b64decode(ca_cert)) def canonical_names(self): '''Figure out which canonical names clients will access this service'''
Ensure ca_cert is decoded
juju_charm-helpers
train
py
e9d821ec5b6f45ea9cec58522a4c5f7011843c34
diff --git a/test/create-server-test.js b/test/create-server-test.js index <HASH>..<HASH> 100644 --- a/test/create-server-test.js +++ b/test/create-server-test.js @@ -57,13 +57,13 @@ vows.describe('nssocket/create-server').addBatch({ "When using NsSocket": { "with `(PORT)` argument": getBatch(PORT), "with `(PORT, HOST)` arguments": getBatch(PORT, HOST), - "with `(PIPE)` argument": getBatch(PIPE) + //"with `(PIPE)` argument": getBatch(PIPE) } -}).addBatch({ +})/*.addBatch({ "When tests are finished": { "`PIPE` should be removed": function () { fs.unlinkSync(PIPE); } } -}).export(module); +})*/.export(module);
[test fix] Remove failing tests until #gh-4 is resolved
foreverjs_nssocket
train
js
b15997fa50c2e569ad081d4b3c2a75f8adbfd35e
diff --git a/src/Illuminate/Log/Logger.php b/src/Illuminate/Log/Logger.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Log/Logger.php +++ b/src/Illuminate/Log/Logger.php @@ -36,10 +36,7 @@ class Logger implements LoggerInterface public function __construct(LoggerInterface $logger, Dispatcher $dispatcher = null) { $this->logger = $logger; - - if (isset($dispatcher)) { - $this->dispatcher = $dispatcher; - } + $this->dispatcher = $dispatcher; } /**
Unnecessary to check EventDispatcher on Logger constructor (#<I>) (#<I>) (cherry picked from commit <I>da<I>a)
laravel_framework
train
php
a0c232174b36fb882105de2643754b6f091329ad
diff --git a/lxc/list_test.go b/lxc/list_test.go index <HASH>..<HASH> 100644 --- a/lxc/list_test.go +++ b/lxc/list_test.go @@ -52,7 +52,7 @@ func TestShouldShow(t *testing.T) { } // Used by TestColumns and TestInvalidColumns -const shorthand = "46abcdlnpPsSt" +const shorthand = "46abcdlnNpPsSt" const alphanum = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" func TestColumns(t *testing.T) {
lxc_list_test: added N option to tests
lxc_lxd
train
go
be7d54f6b9ddc80f3d07f81a4c1757cad233ee67
diff --git a/library/Public.php b/library/Public.php index <HASH>..<HASH> 100644 --- a/library/Public.php +++ b/library/Public.php @@ -194,3 +194,14 @@ if (!function_exists('municipio_post_taxonomies_to_display')) { return $taxonomies; } } + +if (!function_exists('municipio_current_url')) { + /** + * Gets the current url + * @return string + */ + function municipio_intranet_current_url() + { + return "//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"; + } +}
Function to retrive current url
helsingborg-stad_Municipio
train
php
93fa8ff3ffb4dd542dcad0b8af43ee31141b60f9
diff --git a/tests/test_players.py b/tests/test_players.py index <HASH>..<HASH> 100644 --- a/tests/test_players.py +++ b/tests/test_players.py @@ -21,7 +21,7 @@ class TestPlayers(unittest.TestCase): def test_random(self): self._test_player_interface(dominoes.players.random) - gs = [dominoes.Game.new() for _ in range(3)] + gs = [dominoes.Game.new(starting_player=0) for _ in range(3)] valid_moves_before = tuple(g.valid_moves for g in gs) for g in gs: dominoes.players.random(g)
being explicit about starting_player=0 in random player test
abw333_dominoes
train
py
1f3e1f2e373f4ffbe18cd9ee2e345d8fbdc005c8
diff --git a/closure/goog/dom/tagname.js b/closure/goog/dom/tagname.js index <HASH>..<HASH> 100644 --- a/closure/goog/dom/tagname.js +++ b/closure/goog/dom/tagname.js @@ -26,14 +26,6 @@ goog.require('goog.dom.HtmlElement'); * and that's not possible with literal or enum types. It is a record type so * that runtime type checks don't try to validate the lie. * - * Closure Compiler unconditionally converts the following constants to their - * string value (goog.dom.TagName.A -> 'A'). These are the consequences: - * 1. Don't add any members or static members to goog.dom.TagName as they - * couldn't be accessed after this optimization. - * 2. Keep the constant name and its string value the same: - * goog.dom.TagName.X = new goog.dom.TagName('Y'); - * is converted to 'X', not 'Y'. - * * @template T * @record */
Delete outdated comments from `tagname.js`. RELNOTES: n/a PiperOrigin-RevId: <I>
google_closure-library
train
js
f233b1f0f093ae2e6865475bbd80071bd70e48a3
diff --git a/source/MySQLiMultiple.php b/source/MySQLiMultiple.php index <HASH>..<HASH> 100644 --- a/source/MySQLiMultiple.php +++ b/source/MySQLiMultiple.php @@ -41,7 +41,7 @@ trait MySQLiMultiple $stmt = $this->mySQLconnection->stmt_init(); $alocated = $stmt->prepare($qry); if ($stmt->errno != 0) { - throw new Exception('MySQL error, when preparing statement ' . $stmt->error . ' (' . $qry . ')'); + throw new \Exception('MySQL error, when preparing statement ' . $stmt->error . ' (' . $qry . ')'); } if ($alocated) { foreach ($prmtrs as $vParams) { @@ -54,7 +54,7 @@ trait MySQLiMultiple call_user_func_array([$stmt, 'bind_param'], $aParams); $stmt->execute(); if ($stmt->errno != 0) { - throw new Exception('MySQL error, on executing prepared statement ' + throw new \Exception('MySQL error, on executing prepared statement ' . $stmt->error . ' (' . $qry . ')'); } }
exceptions just added are meant to standard PHP functionality and now that will be crystal clear
danielgp_common-lib
train
php
9beed9c70627aa84c8efa1176882151b430f7829
diff --git a/js/src/qgrid.editors.js b/js/src/qgrid.editors.js index <HASH>..<HASH> 100644 --- a/js/src/qgrid.editors.js +++ b/js/src/qgrid.editors.js @@ -63,11 +63,17 @@ class SelectEditor { } var option_str = ""; + + this.elem = $("<SELECT tabIndex='0' class='editor-select'>"); + for (var i in this.options) { var opt = $.trim(this.options[i]); // remove any white space including spaces after comma - option_str += "<OPTION value='" + opt + "'>" + opt + "</OPTION>"; + var opt_elem = $("<OPTION>"); + opt_elem.val(opt); + opt_elem.text(opt); + opt_elem.appendTo(this.elem); } - this.elem = $("<SELECT tabIndex='0' class='editor-select'>" + option_str + "</SELECT>"); + this.elem.appendTo(args.container); this.elem.focus(); }
Fix for issue where editing a categorical fails when selecting an item with single quotes, issue #<I>.
quantopian_qgrid
train
js
4934eb4d746503a70d0c9ad535d0765691fb3f7c
diff --git a/_pydevd_bundle/pydevd_comm.py b/_pydevd_bundle/pydevd_comm.py index <HASH>..<HASH> 100644 --- a/_pydevd_bundle/pydevd_comm.py +++ b/_pydevd_bundle/pydevd_comm.py @@ -266,7 +266,9 @@ class PyDBDaemonThread(threading.Thread): created_pydb_daemon[self] = 1 try: try: - if IS_JYTHON: + if IS_JYTHON and not isinstance(threading.currentThread(), threading._MainThread): + # we shouldn't update sys.modules for the main thread, cause it leads to the second importing 'threading' + # module, and the new instance of main thread is created import org.python.core as PyCore #@UnresolvedImport ss = PyCore.PySystemState() # Note: Py.setSystemState() affects only the current thread.
Debugger hangs on Jython with "Attach to subprocess" option enabled (PY-<I>) We shouldn't update sys.modules for the main thread, cause it leads to the second importing 'threading' module, and the new instance of main thread is created. In this case we lose thread id and thread additional info, so it totally breaks the debugger. (cherry picked from commit 2eb<I>e)
fabioz_PyDev.Debugger
train
py
31aa0f64e8cca2a6b1d463db2a33d804adba44c9
diff --git a/actions/poll/edit.php b/actions/poll/edit.php index <HASH>..<HASH> 100644 --- a/actions/poll/edit.php +++ b/actions/poll/edit.php @@ -95,7 +95,7 @@ $poll->question = $question; $poll->title = $question; $poll->description = $description; $poll->open_poll = $open_poll ? 1 : 0; -$poll->close_date = $close_date; +$poll->close_date = empty($close_date) ? null : $close_date; $poll->tags = string_to_tag_array($tags); if (!$poll->save()) {
Make sure closing date gets saved only if it has a value
iionly_poll
train
php
fc433ad757145ba008fc03baef4dca2f489a1fd4
diff --git a/src/main/java/org/minimalj/security/Subject.java b/src/main/java/org/minimalj/security/Subject.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/minimalj/security/Subject.java +++ b/src/main/java/org/minimalj/security/Subject.java @@ -41,6 +41,11 @@ public class Subject implements Serializable { } return false; } + + public static boolean currentHasRole(String... roleNames) { + Subject currentSubject = getCurrent(); + return currentSubject != null ? currentSubject.hasRole(roleNames) : false; + } public static void setCurrent(Subject subject) { Subject.subject.set(subject);
Subject: added static helper method to check current role
BrunoEberhard_minimal-j
train
java
04754daaa9601993051e1baff50b28cdf8647cc6
diff --git a/demos/widgets.js b/demos/widgets.js index <HASH>..<HASH> 100644 --- a/demos/widgets.js +++ b/demos/widgets.js @@ -81,11 +81,14 @@ $( function () { { 'widget': new OO.ui.ToggleSwitchWidget( { 'onLabel': 'Any', - 'offLabel': 'Label', + 'offLabel': 'Label' } ) }, { - 'widget': new OO.ui.ToggleSwitchWidget( { 'disabled': true } ) + 'widget': new OO.ui.ToggleSwitchWidget( { + 'offLabel': 'Disabled', + 'disabled': true + } ) }, { 'label': 'CheckboxInputWidget',
Change label of disabled switch to 'disabled' in demo To match other disabled widgets in the demo. Change-Id: I<I>b<I>aa<I>a<I>be<I>f0c<I>ea1d
wikimedia_oojs-ui
train
js
8e40313abf0bb1b0d07dd35baf134c7049b29ddd
diff --git a/gcloud/datastore/connection.py b/gcloud/datastore/connection.py index <HASH>..<HASH> 100644 --- a/gcloud/datastore/connection.py +++ b/gcloud/datastore/connection.py @@ -339,8 +339,9 @@ class Connection(connection.Connection): """Save an entity to the Cloud Datastore with the provided properties. .. note:: - Any existing properties for the entity will be cleared before - applying those passed in 'properties'. + Any existing properties for the entity identified by 'key_pb' + will be replaced by those passed in 'properties'; properties + not passed in 'properties' no longer be set for the entity. :type dataset_id: string :param dataset_id: The dataset in which to save the entity. diff --git a/gcloud/datastore/entity.py b/gcloud/datastore/entity.py index <HASH>..<HASH> 100644 --- a/gcloud/datastore/entity.py +++ b/gcloud/datastore/entity.py @@ -187,6 +187,12 @@ class Entity(dict): # pylint: disable=too-many-public-methods def save(self): """Save the entity in the Cloud Datastore. + .. note:: + Any existing properties for the entity will be replaced by those + currently set on this instance. Already-stored properties which do + not correspond to keys set on this instance will be removed from + the datastore. + :rtype: :class:`gcloud.datastore.entity.Entity` :returns: The entity with a possibly updated Key. """
Update doctstrings for 'Entity.save' and 'Connection.save_entity'. Reinforce that previously-stored properties which don't have values set in the current entity instance will be removed.
googleapis_google-cloud-python
train
py,py
e1671df1928d2dfb2e6f12d4613bb902cc02311b
diff --git a/src/singleton.js b/src/singleton.js index <HASH>..<HASH> 100644 --- a/src/singleton.js +++ b/src/singleton.js @@ -11,6 +11,15 @@ define( Singleton.extends(Base); + Singleton.method(meta({ + "entity": "method", + "for": "Singleton", + "static": true, + "name": "getInstance", + "description": "Useful for getting the singleton instance from class constructor.", + "implementation": getInstance + })); + function addInstance () { var constructor = this.constructor; if (!constructor.instances) { @@ -19,15 +28,9 @@ define( constructor.instances.unshift(this); } - Singleton.method(meta({ - "entity": "method", - "for": "Singleton", - "name": "getInstance", - "description": "Useful for getting the singleton instance from class constructor.", - "implementation": function () { - return this.instances && this.instances[0]; - } - })); + function getInstance () { + return this.instances && this.instances[0]; + } return Singleton; }
flagging getInstance as a static method
bob-gray_solv
train
js
5e4a6c0f2ae0bd9334b9726a3384bf99b1af1245
diff --git a/test/ntp-client_test.js b/test/ntp-client_test.js index <HASH>..<HASH> 100644 --- a/test/ntp-client_test.js +++ b/test/ntp-client_test.js @@ -33,15 +33,17 @@ ntpClient.getNetworkTime(ntpClient.defaultNtpServer, ntpClient.defaultNtpPort, function (err, date) { var now = new Date(); + + console.log(); + console.log("System reported : %s", now); + test.ok(err === null); test.ok(date !== null); - test.equal(now.getDate(), date.getDate()); // I'm pretty sure the date things will be OK - test.equal(now.getMonth(), date.getMonth()); - test.equal(now.getYear(), date.getYear()); + console.log("NTP Reported : %s", date); - // For the hours and minute parts, really depends if testing machine is synched - test.equal(now.getHours(), date.getHours()); + // I won't test returned datetime against the system datetime + // this is the whole purpose of NTP : putting clocks in sync. }); // I'm pretty sure there is no NTP Server listening at google.com
Travis CI is not blocking communication on the <I> port, tests are working as expected.
moonpyk_node-ntp-client
train
js
b34fb8ff55347f63235b73ee8497832f2ca49eba
diff --git a/Crud/ActionHandler/DetailActionHandler.php b/Crud/ActionHandler/DetailActionHandler.php index <HASH>..<HASH> 100644 --- a/Crud/ActionHandler/DetailActionHandler.php +++ b/Crud/ActionHandler/DetailActionHandler.php @@ -117,6 +117,10 @@ class DetailActionHandler extends AbstractActionHandler implements ContainerAwar $output = array(); foreach ($this->showFields as $key => $property) { + if (is_array($property)) { + $property = $property['field']; + } + if ($value = MethodInvoker::invokeGet($this->viewData, $property)) { array_push($output, array( 'name' => $property,
bugfix: when using advance config in grid
SymfonyId_SymfonyIdAdminBundle
train
php
c08f4a92ddb5b3ffb045bb6e268631b8b145295b
diff --git a/geojson.js b/geojson.js index <HASH>..<HASH> 100644 --- a/geojson.js +++ b/geojson.js @@ -1,13 +1,15 @@ -exports.version = '0.0.5'; +exports.version = '0.0.6'; exports.defaults = {}; exports.parse = function(objects, params) { - var geojson = {"type": "FeatureCollection", "features": []}; - setGeom(params); + var geojson = {"type": "FeatureCollection", "features": []}, + settings = applyDefaults(params, this.defaults); + + setGeom(settings); objects.forEach(function(item){ - geojson.features.push(getFeature(item, params)); + geojson.features.push(getFeature(item, settings)); }); return geojson; @@ -17,6 +19,18 @@ exports.parse = function(objects, params) { var geoms = ['Point', 'MultiPoint', 'LineString', 'MultiLineString', 'Polygon', 'MultiPolygon'], geomAttrs = []; +function applyDefaults(params, defaults) { + var settings = params || {}; + + for(var setting in defaults) { + if(defaults.hasOwnProperty(setting) && !settings[setting]) { + settings[setting] = defaults[setting]; + } + } + + return settings; +} + function setGeom(params) { params.geom = {};
Implemented handling for default settings. Closes #3
caseycesari_GeoJSON.js
train
js
f578f88886c26db7f04452feff30e4967c882a62
diff --git a/Pragma/ORM/Model.php b/Pragma/ORM/Model.php index <HASH>..<HASH> 100644 --- a/Pragma/ORM/Model.php +++ b/Pragma/ORM/Model.php @@ -491,10 +491,10 @@ class Model extends QueryBuilder implements \JsonSerializable{ return $this; } - public function describe() { + public function describe($force = false) { $db = DB::getDB(); - if (empty(self::$table_desc[$this->table])) { + if (empty(self::$table_desc[$this->table]) || $force) { foreach ($db->describe($this->table) as $data) { if ($data['default'] === null && !$data['null']) { self::$table_desc[$this->table][$data['field']] = '';
EVO ORM\Model::describe() allows to force the description even it has already be done
pragma-framework_core
train
php
b23681b840f50a64014d550a3bd46c4bf44d03b8
diff --git a/playhouse/tests/test_reflection.py b/playhouse/tests/test_reflection.py index <HASH>..<HASH> 100644 --- a/playhouse/tests/test_reflection.py +++ b/playhouse/tests/test_reflection.py @@ -45,7 +45,7 @@ class ColTypes(BaseModel): class Meta: indexes = ( (('f10', 'f11'), True), - (('f11', 'f12', 'f13'), False), + (('f11', 'f8', 'f13'), False), ) class Nullable(BaseModel): @@ -163,7 +163,7 @@ class TestReflection(PeeweeTestCase): indexes = col_types._meta.indexes self.assertEqual(sorted(indexes), [ (['f10', 'f11'], True), - (['f11', 'f12', 'f13'], False), + (['f11', 'f8', 'f13'], False), ]) def test_table_subset(self):
Fix index with unspecified length.
coleifer_peewee
train
py
cbd4c963651e8bc3800c52bc6f81c217bb8aade4
diff --git a/fbchat_archive_parser/name_resolver.py b/fbchat_archive_parser/name_resolver.py index <HASH>..<HASH> 100644 --- a/fbchat_archive_parser/name_resolver.py +++ b/fbchat_archive_parser/name_resolver.py @@ -156,6 +156,10 @@ class FacebookNameResolver(object): class DummyNameResolver(FacebookNameResolver): + def __init__(self): super(DummyNameResolver, self).__init__(None, None) self._cached_profiles = {} + + def resolve(self, facebook_id_string): + return facebook_id_string
fix dummy parser to not try to go online
ownaginatious_fbchat-archive-parser
train
py
e8cc0c3f765959417451174a289a2685053b8d41
diff --git a/packages/lingui-i18n/src/compile.test.js b/packages/lingui-i18n/src/compile.test.js index <HASH>..<HASH> 100644 --- a/packages/lingui-i18n/src/compile.test.js +++ b/packages/lingui-i18n/src/compile.test.js @@ -50,7 +50,8 @@ describe('compile', function () { const currency = compile('en', '{value, number, currency}', { currency: { style: 'currency', - currency: 'EUR' + currency: 'EUR', + minimumFractionDigits: 2 } }) expect(currency({ value: 0.1 })).toEqual('€0.10') diff --git a/packages/lingui-react/src/Trans.test.js b/packages/lingui-react/src/Trans.test.js index <HASH>..<HASH> 100644 --- a/packages/lingui-react/src/Trans.test.js +++ b/packages/lingui-react/src/Trans.test.js @@ -76,7 +76,8 @@ describe('Trans component', function () { params={{ value: 1 }} formats={{ currency: { style: 'currency', - currency: 'EUR' + currency: 'EUR', + minimumFractionDigits: 2 }}} />) expect(translation).toEqual('€1.00')
test: Fix test suit to run correctly on node 4
lingui_js-lingui
train
js,js
6d79a9a00d3ec76753cc4e7cb944bf2551af009a
diff --git a/integration/networking/networking_suite_test.go b/integration/networking/networking_suite_test.go index <HASH>..<HASH> 100644 --- a/integration/networking/networking_suite_test.go +++ b/integration/networking/networking_suite_test.go @@ -56,6 +56,13 @@ func restartGarden(argv ...string) { startGarden(argv...) } +func ensureGardenRunning() { + if err := client.Ping(); err != nil { + client = startGarden() + } + Ω(client.Ping()).ShouldNot(HaveOccurred()) +} + func TestNetworking(t *testing.T) { if rootFSPath == "" { log.Println("GARDEN_TEST_ROOTFS undefined; skipping") @@ -104,6 +111,7 @@ func TestNetworking(t *testing.T) { }) AfterEach(func() { + ensureGardenRunning() gardenProcess.Signal(syscall.SIGQUIT) Eventually(gardenProcess.Wait(), "10s").Should(Receive()) })
Ensure garden is running before stopping it (during tests) Mirrors the code from lifecyce suite, avoids an occasional deadlock when the server isn't running and we wait for it to stop.
cloudfoundry-attic_garden-linux
train
go
d31ce5ebf7dd2ca17ef7ddf14adb102a7d431c11
diff --git a/symphony/lib/boot/defines.php b/symphony/lib/boot/defines.php index <HASH>..<HASH> 100644 --- a/symphony/lib/boot/defines.php +++ b/symphony/lib/boot/defines.php @@ -241,6 +241,14 @@ define_safe('__SECURE__', ); /** + * Returns the protocol used to this request. + * If __SECURE__ it will be https: + * If not, http: + * @var string + */ +define_safe('HTTP_PROTO', 'http' . (defined('__SECURE__') && __SECURE__ ? 's' : '') . ':'); + +/** * The root url directory. * This constant will always ends with '/' * to avoid problems when the root is simply / @@ -260,7 +268,7 @@ define_safe('DOMAIN', HTTP_HOST . rtrim(DIRROOT, '/')); * The base URL of this Symphony install, minus the symphony path. * @var string */ -define_safe('URL', 'http' . (defined('__SECURE__') && __SECURE__ ? 's' : '') . '://' . DOMAIN); +define_safe('URL', HTTP_PROTO . '//' . DOMAIN); /** * Returns the folder name for Symphony as an application
Split out the http protocol logic into a constant This extraction creates a new constant, HTTP_PROTO, whill which will either hold http: or https: The URL constant value will remain unchanged. Re: <I> Picked from e<I>f2f<I>
symphonycms_symphony-2
train
php
0e009ab613a25ebd140a4f307aaa0b8ae8dd3eba
diff --git a/tests/TestCase/Controller/Component/RequestHandlerComponentTest.php b/tests/TestCase/Controller/Component/RequestHandlerComponentTest.php index <HASH>..<HASH> 100644 --- a/tests/TestCase/Controller/Component/RequestHandlerComponentTest.php +++ b/tests/TestCase/Controller/Component/RequestHandlerComponentTest.php @@ -70,7 +70,11 @@ class RequestHandlerComponentTest extends TestCase { $this->Controller = new RequestHandlerTestController($request, $response); $this->Controller->constructClasses(); $this->RequestHandler = new RequestHandlerComponent($this->Controller->components()); - $this->_extensions = Router::extensions(); + + Router::scope('/', function($routes) { + $routes->extensions('json'); + $routes->fallbacks(); + }); } /** @@ -83,10 +87,6 @@ class RequestHandlerComponentTest extends TestCase { DispatcherFactory::clear(); $this->_init(); unset($this->RequestHandler, $this->Controller); - if (!headers_sent()) { - header('Content-type: text/html'); //reset content type. - } - call_user_func_array('Cake\Routing\Router::parseExtensions', [$this->_extensions, false]); } /**
Remove a bunch of dead code. This code is basically garbage and does nothing.
cakephp_cakephp
train
php
09fe8cf57990fa0a6ff7c6fb00e39f3172a97dd7
diff --git a/src/main/java/com/j256/ormlite/android/AndroidDatabaseConnection.java b/src/main/java/com/j256/ormlite/android/AndroidDatabaseConnection.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/j256/ormlite/android/AndroidDatabaseConnection.java +++ b/src/main/java/com/j256/ormlite/android/AndroidDatabaseConnection.java @@ -40,7 +40,7 @@ public class AndroidDatabaseConnection implements DatabaseConnection { return false; } - public boolean getAutoCommit() throws SQLException { + public boolean isAutoCommit() throws SQLException { try { boolean inTransaction = db.inTransaction(); logger.trace("{}: in transaction is {}", this, inTransaction);
Renamed stupid getAutoCommit() to be is...().
j256_ormlite-android
train
java
a6d67bce2033dfea0a239705a66c7b2042beb46c
diff --git a/tensorlayer/layers/convolution/dorefa_conv.py b/tensorlayer/layers/convolution/dorefa_conv.py index <HASH>..<HASH> 100644 --- a/tensorlayer/layers/convolution/dorefa_conv.py +++ b/tensorlayer/layers/convolution/dorefa_conv.py @@ -18,7 +18,7 @@ __all__ = ['DorefaConv2d'] class DorefaConv2d(Layer): - """The :class:`DorefaConv2d` class is a binary fully connected layer, which weights are 'bitW' bits and the output of the previous layer + """The :class:`DorefaConv2d` class is a 2D quantized convolutional layer, which weights are 'bitW' bits and the output of the previous layer are 'bitA' bits while inferencing. Note that, the bias vector would not be binarized.
Fix wrong description (#<I>)
tensorlayer_tensorlayer
train
py
f3bec365175205b1c156292d41356fe1af01f4e7
diff --git a/allegedb/allegedb/window.py b/allegedb/allegedb/window.py index <HASH>..<HASH> 100644 --- a/allegedb/allegedb/window.py +++ b/allegedb/allegedb/window.py @@ -96,7 +96,10 @@ class WindowDictItemsView(ItemsView): class WindowDictPastFutureKeysView(KeysView): def __contains__(self, item): - for rev in map(itemgetter(0), self._mapping.deq): + deq = self._mapping.deq + if not deq or item < deq[0][0] or item > deq[-1][0]: + return False + for rev in map(itemgetter(0), deq): if rev == item: return True return False @@ -114,8 +117,11 @@ class WindowDictFutureKeysView(WindowDictPastFutureKeysView): class WindowDictPastFutureItemsView(ItemsView): def __contains__(self, item): + deq = self._mapping.deq + if not deq or item[0] < deq[0][0] or item[0] > deq[-1][0]: + return False rev, v = item - for mrev, mv in self._mapping.deq: + for mrev, mv in deq: if mrev == rev: return mv == v return False
Simple optimizations for some WindowDict views
LogicalDash_LiSE
train
py
24a4319809af4633146b2673699a36ccd93cc837
diff --git a/convertbng/util.py b/convertbng/util.py index <HASH>..<HASH> 100644 --- a/convertbng/util.py +++ b/convertbng/util.py @@ -36,7 +36,7 @@ import numpy as np import os __author__ = u"Stephan Hügel" -__version__ = "0.5.5" +__version__ = "0.5.6" file_path = os.path.dirname(__file__) @@ -133,8 +133,6 @@ def _void_array_to_list(restuple, _func, _args): ls_n = np.frombuffer(array_str_n, float, array_size).tolist() return ls_e, ls_n - finally: - drop_array(restuple.e, restuple.n) # Multi-threaded FFI functions convert_bng = lib.convert_to_bng_threaded
No need to drop array, since Rust doesn't take ownership of it
urschrei_convertbng
train
py
b41059f4fca56429a5956b98630ed7fb1de3bd86
diff --git a/src/cryptojwt/key_issuer.py b/src/cryptojwt/key_issuer.py index <HASH>..<HASH> 100755 --- a/src/cryptojwt/key_issuer.py +++ b/src/cryptojwt/key_issuer.py @@ -323,15 +323,20 @@ class KeyIssuer(object): lst = [key for key in lst if not key.alg or key.alg == alg] # if elliptic curve, have to check if I have a key of the right curve - if key_type and key_type.upper() == "EC" and alg: - name = "P-{}".format(alg[2:]) # the type - _lst = [] - for key in lst: - if name != key.crv: - continue - _lst.append(key) - lst = _lst - + if key_type and key_type.upper() == "EC": + if alg: + name = "P-{}".format(alg[2:]) # the type + _lst = [] + for key in lst: + if name != key.crv: + continue + _lst.append(key) + lst = _lst + else: + _crv = kwargs.get('crv') + if _crv: + _lst = [k for k in lst if k.crv == _crv] + lst = _lst return lst def copy(self):
Allow setting crv as argument when looking for a key.
openid_JWTConnect-Python-CryptoJWT
train
py
a03c25c74cefb212864f9d79446c3b7a53adee61
diff --git a/pkg/client/sync.go b/pkg/client/sync.go index <HASH>..<HASH> 100644 --- a/pkg/client/sync.go +++ b/pkg/client/sync.go @@ -24,7 +24,7 @@ import ( // enumerations of blobs from two blob servers) and sends to // 'destMissing' any blobs which appear on the source but not at the // destination. destMissing is closed at the end. -func ListMissingDestinationBlobs(destMissing, srcch, dstch chan blobref.SizedBlobRef) { +func ListMissingDestinationBlobs(destMissing chan<- blobref.SizedBlobRef, srcch, dstch <-chan blobref.SizedBlobRef) { defer close(destMissing) src := &blobref.ChanPeeker{Ch: srcch}
client: qualify channel directions Change-Id: I<I>d7c9d<I>b<I>beb1fbc7af2a<I>da<I>cf<I>a2
perkeep_perkeep
train
go
cd58c5cb44141c19a0481237eb2f2fdb603802ee
diff --git a/tests/phpunit/unit/Storage/RepositoryTest.php b/tests/phpunit/unit/Storage/RepositoryTest.php index <HASH>..<HASH> 100644 --- a/tests/phpunit/unit/Storage/RepositoryTest.php +++ b/tests/phpunit/unit/Storage/RepositoryTest.php @@ -177,6 +177,7 @@ class RepositoryTest extends BoltUnitTest { $this->eventCount[$event] = 0; $phpunit = $this; + $count = 0; $app['dispatcher']->addListener($event, function () use ($count, $phpunit, $event) { $count ++; $phpunit->eventCount[$event] = $count;
[Tests] Fix "Undefined variable: count" in RepositoryTest::testInsert
bolt_bolt
train
php
0cfa1e48e8ed05fd22ae8099bb7bebbd4822d33f
diff --git a/examples/consumer/finish_auth.php b/examples/consumer/finish_auth.php index <HASH>..<HASH> 100644 --- a/examples/consumer/finish_auth.php +++ b/examples/consumer/finish_auth.php @@ -27,7 +27,7 @@ if ($status != Auth_OpenID_SUCCESS) { $esc_identity ); } else { - // This means the authentication was ancelled. + // This means the authentication was cancelled. $msg = 'Verification cancelled.'; } }
[project @ Fixed a typo in consumer example code.]
openid_php-openid
train
php
31a3cc95c5b0f6a79414e2975475adc7c6a68b87
diff --git a/ipyrad/analysis/svd4tet.py b/ipyrad/analysis/svd4tet.py index <HASH>..<HASH> 100644 --- a/ipyrad/analysis/svd4tet.py +++ b/ipyrad/analysis/svd4tet.py @@ -354,7 +354,7 @@ def svdconvert(arr, sidxs): best = 10000 ## filter the array to remove Ns - narr = arr[sidx, :] + narr = arr[sidxs, :] arr = narr[~np.any(narr == 84, axis=0)] for sidx in [0, 1, 2]: @@ -380,7 +380,9 @@ def reduce_arr(arr, map, sidx): """ If a map file is provided then the array is reduced to a single unlinked snp from each locus for this quartet. - "" + """ + pass + @jit('u4[:,:](u1[:,:], u2[:])', nopython=True) @@ -413,6 +415,7 @@ def jseq_to_matrix(arr, sidx): return mat + def seq_to_matrix(arr, sidx): """ testing alternative
tmp fix for svd4tet test function so we can put up this hotfix
dereneaton_ipyrad
train
py
d12314136c228af4f07393febb7dc6be837f7456
diff --git a/pypot/utils/stoppablethread.py b/pypot/utils/stoppablethread.py index <HASH>..<HASH> 100644 --- a/pypot/utils/stoppablethread.py +++ b/pypot/utils/stoppablethread.py @@ -166,7 +166,11 @@ def make_update_loop(thread, update_func): thread.wait_to_resume() start = time.time() + if hasattr(thread, '_updated'): + thread._updated.clear() update_func() + if hasattr(thread, '_updated'): + thread._updated.set() end = time.time() dt = thread.period - (end - start) @@ -190,6 +194,7 @@ class StoppableLoopThread(StoppableThread): self.period = 1.0 / frequency self._update = self.update if update is None else update + self._updated = threading.Event() def run(self): """ Called the update method at the pre-defined frequency. """
Add an _updated event in the LoopThread to add the possibility to check whether the update loop has been called.
poppy-project_pypot
train
py
22e12d6767d6293b425dc1fa44536096da9f7f47
diff --git a/lib/openassets/api.rb b/lib/openassets/api.rb index <HASH>..<HASH> 100644 --- a/lib/openassets/api.rb +++ b/lib/openassets/api.rb @@ -31,7 +31,7 @@ module OpenAssets # get UTXO for colored coins. # @param [String] address Obtain the balance of this address only, or all addresses if unspecified. - def list_unspent(address = nil) + def list_unspent(address = []) result = [] unspents = provider.list_unspent(address) unspents.each do |unspent| diff --git a/lib/openassets/provider/bitcoin_core_provider.rb b/lib/openassets/provider/bitcoin_core_provider.rb index <HASH>..<HASH> 100644 --- a/lib/openassets/provider/bitcoin_core_provider.rb +++ b/lib/openassets/provider/bitcoin_core_provider.rb @@ -30,7 +30,6 @@ module OpenAssets end def request(command, *params) - puts params.nil? data = { :method => command, :params => params,
modify listunspent argument. String to Array.
haw-itn_openassets-ruby
train
rb,rb
5cb6f7210a1f2278e63620bb1fb6a1f386f88820
diff --git a/lib/draper/base.rb b/lib/draper/base.rb index <HASH>..<HASH> 100644 --- a/lib/draper/base.rb +++ b/lib/draper/base.rb @@ -51,6 +51,7 @@ module Draper def self.decorates(input) self.model_class = input.to_s.camelize.constantize model_class.send :include, Draper::ModelSupport + define_method(input){ @model } end # Specifies a black list of methods which may *not* be proxied to diff --git a/spec/base_spec.rb b/spec/base_spec.rb index <HASH>..<HASH> 100644 --- a/spec/base_spec.rb +++ b/spec/base_spec.rb @@ -40,6 +40,11 @@ describe Draper::Base do BusinessDecorator.model_class.should == Business end.should_not raise_error end + + it "creates a named accessor for the wrapped model" do + pd = ProductDecorator.new(source) + pd.send(:product).should == source + end end context(".model / .to_model") do
Automatically create a named accessor method for the wrapped model
drapergem_draper
train
rb,rb
0c172823d9830a091e36148aa081574fb583d720
diff --git a/presto-main/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushPartialAggregationThroughJoin.java b/presto-main/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushPartialAggregationThroughJoin.java index <HASH>..<HASH> 100644 --- a/presto-main/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushPartialAggregationThroughJoin.java +++ b/presto-main/src/main/java/com/facebook/presto/sql/planner/iterative/rule/PushPartialAggregationThroughJoin.java @@ -76,9 +76,7 @@ public class PushPartialAggregationThroughJoin JoinNode joinNode = (JoinNode) childNode; - if (joinNode.getType() != JoinNode.Type.INNER || joinNode.getFilter().isPresent()) { - // TODO: add support for filter function. - // All availableSymbols used in filter function could be added to pushedDownGroupingSet + if (joinNode.getType() != JoinNode.Type.INNER) { return Optional.empty(); }
Add support for filter functions in partial aggregation pushdown
prestodb_presto
train
java
8bd1730fc8570fe8d0b71a6de06690ee49d18ebc
diff --git a/mutation_summary.js b/mutation_summary.js index <HASH>..<HASH> 100644 --- a/mutation_summary.js +++ b/mutation_summary.js @@ -758,6 +758,9 @@ parentNode = change.oldParentNode; change = this.childlistChanges.get(parentNode); + if (!change) + return false; + if (change.moved) return change.moved.get(node);
exit early from wasRemoved if no childlist changes exist
rafaelw_mutation-summary
train
js
a7de5388afe8b8962dcc7c08c2064876b25d6c8e
diff --git a/polyaxon/logs_handlers/log_queries/base.py b/polyaxon/logs_handlers/log_queries/base.py index <HASH>..<HASH> 100644 --- a/polyaxon/logs_handlers/log_queries/base.py +++ b/polyaxon/logs_handlers/log_queries/base.py @@ -15,6 +15,7 @@ def query_logs(k8s_manager, pod_id, container_job_name, stream=False): pod_id, k8s_manager.namespace, container=container_job_name, + timestamps=True, **params)
Use k8s log timestamps
polyaxon_polyaxon
train
py
e30314a24da8de00bb016f78237fcd93c71498f8
diff --git a/src/Behat/Behat/Gherkin/Subject/Locator/FilesystemFeatureLocator.php b/src/Behat/Behat/Gherkin/Subject/Locator/FilesystemFeatureLocator.php index <HASH>..<HASH> 100644 --- a/src/Behat/Behat/Gherkin/Subject/Locator/FilesystemFeatureLocator.php +++ b/src/Behat/Behat/Gherkin/Subject/Locator/FilesystemFeatureLocator.php @@ -177,12 +177,7 @@ class FilesystemFeatureLocator implements SubjectLocator RegexIterator::MATCH ); $paths = array_map('strval', iterator_to_array($iterator)); - - uasort( - $paths, function ($path1, $path2) { - return strnatcasecmp($path1, $path2); - } - ); + uasort($paths, 'strnatcasecmp'); return $paths; }
Simplified FilesystemFeatureLocator::findFeatureFiles
Behat_Behat
train
php
d745765c7590d90919e02cc4b6acd29f954eb750
diff --git a/nion/swift/Workspace.py b/nion/swift/Workspace.py index <HASH>..<HASH> 100644 --- a/nion/swift/Workspace.py +++ b/nion/swift/Workspace.py @@ -144,21 +144,9 @@ class Workspace(object): self.__data_item_deleted_event_listener = None def periodic(self): - # for each of the panels too - ts = [] - t0 = time.time() for dock_widget in self.dock_widgets if self.dock_widgets else list(): - start = time.time() dock_widget.panel.periodic() - time1 = time.time() dock_widget.periodic() - time2 = time.time() - elapsed = time.time() - start - if elapsed > 0.15: - logging.debug("panel %s %s", dock_widget.panel, elapsed) - ts.append("{0}: panel {1}ms / widget {2}ms".format(str(dock_widget.panel), (time1-start)*1000, (time2-time1)*1000)) - if time.time() - t0 > 0.003: - pass # logging.debug("{0} --> {1}".format(time.time() - t0, " /// ".join(ts))) def restore_geometry_state(self): geometry = self.ui.get_persistent_string("Workspace/%s/Geometry" % self.workspace_id)
Speed up two critical pieces of code for updating.
nion-software_nionswift
train
py
cf4883dc03537ea73d78f35f16dd9d8f4b9dcaa8
diff --git a/src/Env.php b/src/Env.php index <HASH>..<HASH> 100644 --- a/src/Env.php +++ b/src/Env.php @@ -1,8 +1,6 @@ <?php namespace Sil\PhpEnv; -use Sil\PhpEnv; - class Env { /** @@ -61,7 +59,7 @@ class Env $message = 'Required environment variable: ' . $varname . ', not found.'; throw new EnvVarNotFoundException($message); } elseif ($value === '') { - $message = 'Required environment variable: ' . $varname . ', cannot be empty.'; + $message = 'Required environment variable: ' . $varname . ', value cannot be empty.'; throw new EnvVarNotFoundException($message); }
Two minor improvements to Env.php.
silinternational_php-env
train
php
2c7e200aded7c83e0dd10bdc1543bcc21bbc619f
diff --git a/Tone/core/OfflineContext.js b/Tone/core/OfflineContext.js index <HASH>..<HASH> 100644 --- a/Tone/core/OfflineContext.js +++ b/Tone/core/OfflineContext.js @@ -17,7 +17,7 @@ define(["Tone/core/Tone", "Tone/core/Context"], function (Tone) { * @param {Number} sampleRate the sample rate to render at */ Tone.OfflineContext = function(channels, duration, sampleRate){ - + /** * The offline context * @private @@ -81,11 +81,12 @@ define(["Tone/core/Tone", "Tone/core/Context"], function (Tone) { /** * Close the context - * @return {Number} + * @return {Promise} */ Tone.OfflineContext.prototype.close = function(){ this._context = null; + return Promise.resolve(); }; return Tone.OfflineContext; -}); \ No newline at end of file +});
close returns promise like in AudioContext
Tonejs_Tone.js
train
js
6f375117a7b3a26b7f33549f066d4b69fa8a7eb6
diff --git a/plan/physical_plans.go b/plan/physical_plans.go index <HASH>..<HASH> 100644 --- a/plan/physical_plans.go +++ b/plan/physical_plans.go @@ -642,10 +642,8 @@ func buildSchema(p PhysicalPlan) { func rebuildSchema(p PhysicalPlan) bool { needRebuild := false for _, ch := range p.Children() { - needRebuild = needRebuild || rebuildSchema(ch.(PhysicalPlan)) - } - if needRebuild { - buildSchema(p) + childRebuilt := rebuildSchema(ch.(PhysicalPlan)) + needRebuild = needRebuild || childRebuilt } switch p.(type) { case *PhysicalIndexJoin, *PhysicalHashJoin, *PhysicalMergeJoin, *PhysicalIndexLookUpReader: @@ -654,5 +652,8 @@ func rebuildSchema(p PhysicalPlan) bool { case *PhysicalProjection, *PhysicalHashAgg, *PhysicalStreamAgg: needRebuild = false } + if needRebuild { + buildSchema(p) + } return needRebuild }
plan: check every child and rebuild their schema if necessary (#<I>)
pingcap_tidb
train
go
e3600281b629fe7694267921f05ee7924516e766
diff --git a/src/Illuminate/Foundation/Testing/TestResponse.php b/src/Illuminate/Foundation/Testing/TestResponse.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Foundation/Testing/TestResponse.php +++ b/src/Illuminate/Foundation/Testing/TestResponse.php @@ -114,7 +114,7 @@ class TestResponse if (! is_null($value)) { PHPUnit::assertEquals( - $value, $this->headers->get($headerName), + $this->headers->get($headerName), $value, "Header [{$headerName}] was found, but value [{$actual}] does not match [{$value}]." ); } @@ -528,15 +528,16 @@ class TestResponse * * @param string|array $keys * @param mixed $format + * @param string $errorBag * @return $this */ - public function assertSessionHasErrors($keys = [], $format = null) + public function assertSessionHasErrors($keys = [], $format = null, $errorBag = 'default') { $this->assertSessionHas('errors'); $keys = (array) $keys; - $errors = app('session.store')->get('errors'); + $errors = app('session.store')->get('errors')->getBag($errorBag); foreach ($keys as $key => $value) { if (is_int($key)) {
allow using assertSessionHasErrors to look into different error bags
laravel_framework
train
php
0c9dec513355fade2c1961e1ef9fc7b4b86f5993
diff --git a/grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/env/GrailsEnvironment.java b/grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/env/GrailsEnvironment.java index <HASH>..<HASH> 100644 --- a/grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/env/GrailsEnvironment.java +++ b/grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/env/GrailsEnvironment.java @@ -19,6 +19,7 @@ import grails.util.Environment; import java.util.Set; +import org.apache.commons.lang.StringUtils; import org.codehaus.groovy.grails.commons.GrailsApplication; import org.springframework.core.env.PropertiesPropertySource; import org.springframework.core.env.PropertySource; @@ -53,7 +54,7 @@ public class GrailsEnvironment extends StandardServletEnvironment { private class GrailsConfigPropertySource extends PropertySource<GrailsApplication> { public GrailsConfigPropertySource() { - super(grailsApplication.getMetadata().getApplicationName(), grailsApplication); + super(StringUtils.defaultIfBlank(grailsApplication.getMetadata().getApplicationName(), "grailsApplication"), grailsApplication); } @Override
Fix error "Property source name must contain at least one character"
grails_grails-core
train
java
17cf5c3fa310a0c6076d34f6bb466cfd88b8aed1
diff --git a/backend.js b/backend.js index <HASH>..<HASH> 100644 --- a/backend.js +++ b/backend.js @@ -129,6 +129,10 @@ Backend.prototype.buildVectorTile = function(z, x, y, callback) { var buffer = image.getData(self.dataopts); buffer.metatile = self.metatile; buffer._vtile = image; + buffer._vx = x; + buffer._vy = y; + buffer._vz = z; + callback(null, buffer); }); }); diff --git a/test/index.js b/test/index.js index <HASH>..<HASH> 100644 --- a/test/index.js +++ b/test/index.js @@ -25,9 +25,14 @@ describe('Provider Implementation "vtile"', function() { 'Content-Type': 'application/x-protobuf', 'Content-Encoding': 'gzip' }); + assert.instanceOf(buffer, Buffer); assert.instanceOf(buffer._vtile, mapnik.VectorTile, 'buffer._vtile'); + assert.equal(buffer._vx, 5, 'buffer._vx'); + assert.equal(buffer._vy, 12, 'buffer._vy'); + assert.equal(buffer._vz, 5, 'buffer._vz'); assert.equal(buffer.metatile, 1, 'buffer.metatile'); + // fs.writeFileSync(__dirname + '/fixtures/world.pbf', buffer); assertVTile(5, 5, 12, buffer, __dirname + '/fixtures/world.pbf'); done();
Expose vector tile z,y,z on buffer for downstream plugins (x,y,z not available on mapnik.VectorTile)
naturalatlas_tilestrata-vtile
train
js,js
63975a07ad84b76bfc793a82d3da13ca9180684f
diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index <HASH>..<HASH> 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -2849,7 +2849,7 @@ class Mastodon: # Connect function (called and then potentially passed to async handler) def connect_func(): - headers = {"Authorization": "Bearer " + self.access_token} + headers = {"Authorization": "Bearer " + self.access_token} if self.access_token else {} connection = self.session.get(url + endpoint, headers = headers, data = params, stream = True, timeout=(self.request_timeout, timeout))
Only set authorization header if access_token is present
halcy_Mastodon.py
train
py
4ea27ce1d7ec31ec5a96a03f3c00e53aacc2ab0b
diff --git a/packages/react-solid-state/src/index.js b/packages/react-solid-state/src/index.js index <HASH>..<HASH> 100644 --- a/packages/react-solid-state/src/index.js +++ b/packages/react-solid-state/src/index.js @@ -3,6 +3,7 @@ import { createEffect, createMemo, createComputed, + createMutable, createSignal, onCleanup, createRoot @@ -23,7 +24,7 @@ let inSolidEffect = false; function trackNesting(args) { const fn = args[0]; return [ - function() { + function () { const outside = inSolidEffect; inSolidEffect = true; const ret = fn.call(this, arguments); @@ -72,6 +73,11 @@ export function useState(v) { return rMemo(() => createState(v), []); } +export function useMutable(v) { + if (inSolidEffect) return createMutable(v); + return rMemo(() => createMutable(v), []); +} + export function useSignal(v) { if (inSolidEffect) return createSignal(v); return rMemo(() => createSignal(v), []);
useMutableState hook for React via createMutable (#<I>) * useMutableState hook for React via createMutable * useMutableState -> useMutable
ryansolid_solid
train
js
cf6bafc07ef355d7d7bb11a42560955f8cb06c53
diff --git a/oscrypto/_win/tls.py b/oscrypto/_win/tls.py index <HASH>..<HASH> 100644 --- a/oscrypto/_win/tls.py +++ b/oscrypto/_win/tls.py @@ -345,6 +345,20 @@ class TLSSocket(object): return new_socket def __init__(self, address, port, timeout=10, session=None): + """ + :param address: + A unicode string of the domain name or IP address to conenct to + + :param port: + An integer of the port number to connect to + + :param timeout: + An integer timeout to use for the socket + + :param session: + An oscrypto.tls.TLSSession object to allow for session reuse and + controlling the protocols and validation performed + """ self._received_bytes = b'' self._decrypted_bytes = b''
Add a missing docstring for tls.TLSSocket on Windows
wbond_oscrypto
train
py
88667377fe2d829dd8aa55b3b7a8db90304a5b70
diff --git a/lib/codemirror.js b/lib/codemirror.js index <HASH>..<HASH> 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -12,6 +12,7 @@ window.CodeMirror = (function() { var ie_lt9 = /MSIE [1-8]\b/.test(navigator.userAgent); var ie_lt10 = /MSIE [1-9]\b/.test(navigator.userAgent); var webkit = /WebKit\//.test(navigator.userAgent); + var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(navigator.userAgent); var chrome = /Chrome\//.test(navigator.userAgent); var opera = /Opera\//.test(navigator.userAgent); var safari = /Apple Computer/.test(navigator.vendor); @@ -1616,7 +1617,7 @@ window.CodeMirror = (function() { }, 50); var name = keyNames[e_prop(e, "keyCode")], handled = false; - var flipCtrlCmd = opera && mac; + var flipCtrlCmd = mac && (opera || qtwebkit); if (name == null || e.altGraphKey) return false; if (e_prop(e, "altKey")) name = "Alt-" + name; if (e_prop(e, flipCtrlCmd ? "metaKey" : "ctrlKey")) name = "Ctrl-" + name;
Add Qt webkit as exception for Ctrl and Cmd key event properties Just like Opera, it flips the ctrlKey and metaKey on Mac Closes #<I>
codemirror_CodeMirror
train
js
ebf60c080d297d6680b112121082876977e34276
diff --git a/lib/rspec/benchmark/timing_matcher.rb b/lib/rspec/benchmark/timing_matcher.rb index <HASH>..<HASH> 100644 --- a/lib/rspec/benchmark/timing_matcher.rb +++ b/lib/rspec/benchmark/timing_matcher.rb @@ -50,12 +50,12 @@ module RSpec def positive_failure_reason return 'wan not a block' unless @block.is_a?(Proc) - "performed above #{@average.round(@scale)} " + "performed above #{@average} " end def negative_failure_reason return 'was not a block' unless @block.is_a?(Proc) - "performed #{@average.round(@scale)} below" + "performed #{@average} below" end end # Matcher
Change to stop rounding for increased accuracy.
piotrmurach_rspec-benchmark
train
rb
b0a603615fe91a2a5a1d8ff825e195cc70fe78b0
diff --git a/logic/sentiments.js b/logic/sentiments.js index <HASH>..<HASH> 100644 --- a/logic/sentiments.js +++ b/logic/sentiments.js @@ -1,17 +1,17 @@ var dbA = require('../db/dbA'); var sentiment = require('sentiment'); -var posSentiment; -var negSentiment; -var posTweets; -var negTweets; -var nullTweets; +var posSentiment = 0; +var negSentiment = 0; +var posTweets = 0; +var negTweets = 0; +var nullTweets = 0; exports.calculateSentimentsForTweets = function (characterName, tweets, startDate, endDate, isSaved, callback) { for (var index in tweets) { var currentTweet = tweets[index]; - var sentimentScore = sentiment(currentTweet.text); + var sentimentScore = sentiment(currentTweet.text).score; if (sentimentScore > 0) { posSentiment += sentimentScore;
added inital values for tweet and sentiment counters, fixed sentiment score lookup
Rostlab_JS16_ProjectD_Group5
train
js
50b060241cd59bb94212ecbc7c59eaec1ad490a0
diff --git a/lfs/pointer_smudge.go b/lfs/pointer_smudge.go index <HASH>..<HASH> 100644 --- a/lfs/pointer_smudge.go +++ b/lfs/pointer_smudge.go @@ -111,7 +111,7 @@ func downloadObject(ptr *Pointer, obj *ObjectResource, mediafile string, cb Copy } if err := bufferDownloadedFile(mediafile, reader, ptr.Size, cb); err != nil { - return Errorf(err, "Error buffering media file.") + return Errorf(err, "Error buffering media file: %s", err) } return nil
Be consistent in error reporting from bufferDownloadedFile result
git-lfs_git-lfs
train
go
2c547fb70f1c7ab5b58c7daa2712c6e9d6f534af
diff --git a/pythonforandroid/recipes/flask/__init__.py b/pythonforandroid/recipes/flask/__init__.py index <HASH>..<HASH> 100644 --- a/pythonforandroid/recipes/flask/__init__.py +++ b/pythonforandroid/recipes/flask/__init__.py @@ -3,7 +3,7 @@ from pythonforandroid.recipe import PythonRecipe class FlaskRecipe(PythonRecipe): - version = '1.1.2' + version = '2.0.3' url = 'https://github.com/pallets/flask/archive/{version}.zip' depends = ['setuptools']
Upgrading the flask version to avoid exception at the start of webview application
kivy_python-for-android
train
py
f85db6a59339c484a9404cedd03fefb29465475c
diff --git a/hdf5storage/utilities.py b/hdf5storage/utilities.py index <HASH>..<HASH> 100644 --- a/hdf5storage/utilities.py +++ b/hdf5storage/utilities.py @@ -451,7 +451,7 @@ def convert_numpy_str_to_uint16(data): strings) to UTF-16 in the equivalent array of ``numpy.uint16``. The conversion will throw an exception if any characters cannot be converted to UTF-16. Strings are expanded along rows (across columns) - so a 2x3x4 array of 10 element strings will get turned into a 2x30x4 + so a 2x3x4 array of 10 element strings will get turned into a 2x2x40 array of uint16's if every UTF-32 character converts easily to a UTF-16 singlet, as opposed to a UTF-16 doublet. @@ -505,7 +505,7 @@ def convert_numpy_str_to_uint32(data): Convert a ``numpy.unicode_`` or an array of them (they are UTF-32 strings) into the equivalent array of ``numpy.uint32`` that is byte for byte identical. Strings are expanded along rows (across columns) - so a 2x3x4 array of 10 element strings will get turned into a 2x30x4 + so a 2x3x4 array of 10 element strings will get turned into a 2x3x40 array of uint32's. Parameters
Fixed errors in the docstrings regarding the shapes of the converted objects in the convert_numpy_str_to_uint<I> and convert_numpy_str_to_uint<I> functions in utilities.
frejanordsiek_hdf5storage
train
py
016010c4c5c423b77d2284196bc225588d5a157b
diff --git a/lib/openxml/has_children.rb b/lib/openxml/has_children.rb index <HASH>..<HASH> 100644 --- a/lib/openxml/has_children.rb +++ b/lib/openxml/has_children.rb @@ -2,7 +2,8 @@ module OpenXml module HasChildren attr_reader :children - def initialize + def initialize(*) + super @children = [] end
[improvement] Ensured HasChildren mixin doesn’t clobber initialize (1m)
openxml_openxml-package
train
rb
ca477bb6e8ce0190b894a3cda4dac1757285183c
diff --git a/src/bn/pagination.php b/src/bn/pagination.php index <HASH>..<HASH> 100644 --- a/src/bn/pagination.php +++ b/src/bn/pagination.php @@ -13,7 +13,7 @@ return [ | */ - 'previous' => '&laquo; Previous', - 'next' => 'Next &raquo;', + 'previous' => '&laquo; আগে', + 'next' => 'পরবর্তী &raquo;', ];
update pagination.php file and add bangla language
caouecs_Laravel-lang
train
php
eae0cd988cdf9f894c9be0a98e2ea438d78e3c91
diff --git a/src/WebMidi.js b/src/WebMidi.js index <HASH>..<HASH> 100644 --- a/src/WebMidi.js +++ b/src/WebMidi.js @@ -1125,10 +1125,15 @@ class WebMidi extends EventEmitter { // extensible (properties can be added at will). const wm = new WebMidi(); wm.constructor = null; -export {wm as WebMidi}; export {Enumerations} from "./Enumerations.js"; export {Forwarder} from "./Forwarder.js"; +export {Input} from "./Input.js"; +export {InputChannel} from "./InputChannel.js"; export {Message} from "./Message.js"; export {Note} from "./Note.js"; +export {Output} from "./Output.js"; +export {OutputChannel} from "./OutputChannel.js"; export {Utilities} from "./Utilities.js"; +export {wm as WebMidi}; +
Explicitly export all classes (mainly for TypeScript)
djipco_webmidi
train
js
1b042744fcab9d28766b8ce86c7249b765a74167
diff --git a/flask_sqlalchemy_bundle/meta/model_registry.py b/flask_sqlalchemy_bundle/meta/model_registry.py index <HASH>..<HASH> 100644 --- a/flask_sqlalchemy_bundle/meta/model_registry.py +++ b/flask_sqlalchemy_bundle/meta/model_registry.py @@ -2,7 +2,7 @@ import sqlalchemy as sa import warnings from collections import defaultdict -from flask_sqlalchemy import DefaultMeta +from flask_sqlalchemy import DefaultMeta, Model from sqlalchemy.exc import SAWarning from sqlalchemy.ext.declarative import declared_attr from sqlalchemy.orm.interfaces import MapperProperty @@ -14,7 +14,11 @@ from .utils import deep_getattr class _ModelRegistry: def __init__(self): - self._base_model_classes = {} + # keyed by: full.base.model.module.name.BaseModelClassName + # values are the base classes themselves + # ordered by registration/discovery order, so the last class to be + # inserted into this lookup is the correct base class to use + self._base_model_classes: Dict[str, Type[Model]] = {} # all discovered models "classes", before type.__new__ has been called: # - keyed by model class name
add comment for ModelRegistry._base_model-classes
briancappello_flask-sqlalchemy-bundle
train
py
3768b14276aac0581a2bf57a7f576b6c00529be9
diff --git a/jackal/core.py b/jackal/core.py index <HASH>..<HASH> 100755 --- a/jackal/core.py +++ b/jackal/core.py @@ -31,8 +31,8 @@ class CoreSearch(object): else: response = search.scan() - for hit in response: - yield hit + return [hit for hit in response] + def argument_search(self): """
Changed generator to a list of results.
mwgielen_jackal
train
py
d215bb705cfceae01ea0f228e25bb83077e19cd9
diff --git a/lib/serializer.js b/lib/serializer.js index <HASH>..<HASH> 100644 --- a/lib/serializer.js +++ b/lib/serializer.js @@ -540,7 +540,7 @@ class Serializer { let prm; let prmValue; if (item.param) { - prm = item.param.toUpperCase(); + prm = item.param; prmValue = self._inputParams ? self._inputParams[prm] : null; } else if (self.strictParams && !(item.value instanceof SqlObject)) { prm = self.prmGen;
Fix: always named params are always upper cased issue
sqbjs_sqb
train
js
4acf771bdb53af9ab2a8b22955b1ddba92c291f4
diff --git a/readabilitySAX.js b/readabilitySAX.js index <HASH>..<HASH> 100644 --- a/readabilitySAX.js +++ b/readabilitySAX.js @@ -491,10 +491,8 @@ Readability.prototype.onclosetag = function(tagName){ if(contentLength === 0){ if(elem.children.length === 0) return; - if("a" in elem.info.tagCount) return; if(elem.children.length === 1 && typeof elem.children[0] === "string") return; } - else if(elem.info.tagCount.img > p ) return; if((elem.info.tagCount.li - 100) > p && tagName !== "ul" && tagName !== "ol") return; if(contentLength < 25 && (!("img" in elem.info.tagCount) || elem.info.tagCount.img > 2) ) return; if(elem.info.density > .5) return;
Removed two rules from cleanConditionally Fixes #<I> & #<I> Images shouldn't get removed anymore without a reason (just because they have a container element or link to a bigger version)
fb55_readabilitySAX
train
js
d622cf1b70e086fbd56b81082eed802b0805053e
diff --git a/src/Behat/Behat/Context/ContextClass/SimpleClassGenerator.php b/src/Behat/Behat/Context/ContextClass/SimpleClassGenerator.php index <HASH>..<HASH> 100644 --- a/src/Behat/Behat/Context/ContextClass/SimpleClassGenerator.php +++ b/src/Behat/Behat/Context/ContextClass/SimpleClassGenerator.php @@ -25,20 +25,22 @@ final class SimpleClassGenerator implements ClassGenerator protected static $template = <<<'PHP' <?php -{namespace}use Behat\Behat\Context\SnippetAcceptingContext; +{namespace}use Behat\Behat\Context\Context; +use Behat\Behat\Context\SnippetAcceptingContext; use Behat\Gherkin\Node\PyStringNode; use Behat\Gherkin\Node\TableNode; /** - * Behat context class. + * Defines application features from the specific context. */ -class {className} implements SnippetAcceptingContext +class {className} implements Context, SnippetAcceptingContext { /** * Initializes context. * - * Every scenario gets its own context object. - * You can also pass arbitrary arguments to the context constructor through behat.yml. + * Every scenario gets its own context instance. + * You can also pass arbitrary arguments to the + * context constructor through behat.yml. */ public function __construct() {
Improve generated context class - Force it to implement both Context and SnippetAcceptingContext interfaces - Change the class description with something closer to real life
Behat_Behat
train
php
78a0826d5322379d26a69de3d3ae4360c6c1144c
diff --git a/gromacs/version.py b/gromacs/version.py index <HASH>..<HASH> 100644 --- a/gromacs/version.py +++ b/gromacs/version.py @@ -5,7 +5,7 @@ #: Package version; this is the only place where it is set. -VERSION = 0,4,1 +VERSION = 0,5,0 #: Set to ``True`` for a release. If set to ``False`` then the patch level #: will have the suffix "-dev". RELEASE = False
bumped release to <I>-dev
Becksteinlab_GromacsWrapper
train
py
f9d78d026eebb1f8101c91ea0d03a0fc4dd9a36f
diff --git a/lib/aws/credentials.rb b/lib/aws/credentials.rb index <HASH>..<HASH> 100644 --- a/lib/aws/credentials.rb +++ b/lib/aws/credentials.rb @@ -14,15 +14,6 @@ module Aws class Credentials - # @return [String, nil] - attr_accessor :access_key_id - - # @return [String, nil] - attr_accessor :secret_access_key - - # @return [String, nil] - attr_accessor :session_token - # @param [String] access_key_id # @param [String] secret_access_key # @param [String] session_token (nil) @@ -32,6 +23,15 @@ module Aws @session_token = session_token end + # @return [String, nil] + attr_accessor :access_key_id + + # @return [String, nil] + attr_accessor :secret_access_key + + # @return [String, nil] + attr_accessor :session_token + def set? @access_key_id && @secret_access_key end
Reordered credentials class to be consistent with how other code is formatted.
aws_aws-sdk-ruby
train
rb
66294d54f798908928eb126924cda70f78e256e2
diff --git a/uncompyle6/parsers/parse26.py b/uncompyle6/parsers/parse26.py index <HASH>..<HASH> 100644 --- a/uncompyle6/parsers/parse26.py +++ b/uncompyle6/parsers/parse26.py @@ -145,6 +145,9 @@ class Python26Parser(Python2Parser): whilestmt ::= SETUP_LOOP testexpr l_stmts_opt jb_cf_pop bp_come_from whilestmt ::= SETUP_LOOP testexpr l_stmts_opt jb_cf_pop POP_BLOCK whilestmt ::= SETUP_LOOP testexpr returns POP_BLOCK COME_FROM + + # In the "whilestmt" below, there can be no COME_FROM when the "while" is the + # last thing in the program. whilestmt ::= SETUP_LOOP testexpr returns POP_TOP POP_BLOCK whileelsestmt ::= SETUP_LOOP testexpr l_stmts_opt jb_pop POP_BLOCK
Comment what's up in last change.
rocky_python-uncompyle6
train
py
797d315457d171b60a969a5bafa6e28da1a0699f
diff --git a/src/Response.php b/src/Response.php index <HASH>..<HASH> 100644 --- a/src/Response.php +++ b/src/Response.php @@ -39,7 +39,7 @@ final class Response extends Message /** * @param int $code Status code. - * @param string[][] $headers + * @param string[]|string[][] $headers * @param InputStream|string|null $stringOrStream * @param Trailers|null $trailers *
Improve documented header type for Response::__construct (#<I>)
amphp_http-server
train
php
598d7ac6b3a588712428fe827e01c7ecabed9967
diff --git a/validation.py b/validation.py index <HASH>..<HASH> 100644 --- a/validation.py +++ b/validation.py @@ -53,7 +53,8 @@ TERMINAL_VOWELS = { STRIPPED_VOWELS = set(map(mark.strip, VOWELS)) -STRIPPED_TERMINAL_VOWELS = set(map(mark.strip, TERMINAL_VOWELS)) +# 'uo' may clash with 'ươ' and prevent typing 'thương' +STRIPPED_TERMINAL_VOWELS = set(map(mark.strip, TERMINAL_VOWELS)) - {'uo'} SoundTuple = \
Remove 'uo' from STRIPPED_TERMINAL_VOWELS It may clash with 'ươ' and prevent typing 'thương'.
BoGoEngine_bogo-python
train
py
f8ff5723ce1f670bd2a455adfdcdc41f279e7375
diff --git a/src/Generators/Google.php b/src/Generators/Google.php index <HASH>..<HASH> 100644 --- a/src/Generators/Google.php +++ b/src/Generators/Google.php @@ -27,8 +27,7 @@ class Google implements Generator // Add timezone name if it is specified in both from and to dates and is the same for both if ( - $link->from->getTimezone() !== false - && $link->to->getTimezone() !== false + $link->from->getTimezone() && $link->to->getTimezone() && $link->from->getTimezone()->getName() === $link->to->getTimezone()->getName() ) { $url .= '&ctz=' . $link->from->getTimezone()->getName();
Change timezone check to anything false-y
spatie_calendar-links
train
php
1feed296d9d67823207223d0fa7b4e9af8eb7e25
diff --git a/spec/unit/provider/group_spec.rb b/spec/unit/provider/group_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/provider/group_spec.rb +++ b/spec/unit/provider/group_spec.rb @@ -101,19 +101,19 @@ describe Chef::Provider::User do end it "should return false if append is true and the group member(s) already exists" do - @current_resource.members += [ "extra_user" ] + @current_resource.members << "extra_user" @new_resource.append(true) expect(@provider.compare_group).to be_falsey end it "should return true if append is true and the group member(s) do not already exist" do - @new_resource.members += [ "extra_user" ] + @new_resource.members << "extra_user" @new_resource.append(true) expect(@provider.compare_group).to be_truthy end it "should return false if append is true and excluded_members include a non existing member" do - @new_resource.excluded_members += [ "extra_user" ] + @new_resource.excluded_members << "extra_user" @new_resource.append(true) expect(@provider.compare_group).to be_falsey end
Revert some changes to tests that now pass again The dup'ing of property defaults change now allows these to pass again so the breaking change here in the API is reverted.
chef_chef
train
rb