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
|
|---|---|---|---|---|---|
c80d6cda243bc829cac4539f7e073774fedcac43
|
diff --git a/lib/signore/executable.rb b/lib/signore/executable.rb
index <HASH>..<HASH> 100644
--- a/lib/signore/executable.rb
+++ b/lib/signore/executable.rb
@@ -13,7 +13,7 @@ module Signore class Executable
@no_tags.map! { |tag| tag[1..-1] }
end
- def run output = STDOUT, input = STDIN
+ def run output = $stdout, input = $stdin
case @action
when 'prego'
output.puts Database.find(tags: @tags, no_tags: @no_tags).display
|
Executable#run: use IO variables rather than constants
|
chastell_signore
|
train
|
rb
|
97c5d94b0885e6a8fa77eeedcfd37560d50a24e8
|
diff --git a/inflect.py b/inflect.py
index <HASH>..<HASH> 100644
--- a/inflect.py
+++ b/inflect.py
@@ -2285,11 +2285,22 @@ class engine:
def postprocess(self, orig: str, inflected) -> str:
inflected = str(inflected)
- result = inflected.split(" ")
+ if "|" in inflected:
+ word_options = inflected.split("|")
+ # When two parts of a noun need to be pluralized
+ if len(word_options[0].split(" ")) == len(word_options[1].split(" ")):
+ result = inflected.split("|")[self.classical_dict["all"]].split(" ")
+ # When only the last part of the noun needs to be pluralized
+ else:
+ result = inflected.split(" ")
+ for index, word in enumerate(result):
+ if "|" in word:
+ result[index] = word.split("|")[self.classical_dict["all"]]
+ else:
+ result = inflected.split(" ")
+
# Try to fix word wise capitalization
- for index, word in enumerate(result):
- if "|" in word:
- result[index] = word.split("|")[self.classical_dict["all"]]
+ for index, word in enumerate(orig.split(" ")):
if word == "I":
# Is this the only word for exceptions like this
# Where the original is fully capitalized
|
Support compound nouns where several parts need pluralization
|
jazzband_inflect
|
train
|
py
|
f4e164821632a6ac4b582b715703ec1f9d1368bb
|
diff --git a/cmd/containeragent/initialize/package_test.go b/cmd/containeragent/initialize/package_test.go
index <HASH>..<HASH> 100644
--- a/cmd/containeragent/initialize/package_test.go
+++ b/cmd/containeragent/initialize/package_test.go
@@ -39,7 +39,6 @@ func (*importSuite) TestImports(c *gc.C) {
"api/common/cloudspec",
"api/controller/instancepoller",
"api/agent/keyupdater",
- "api/agent/reboot",
"api/agent/unitassigner",
"api/watcher",
"apiserver/errors",
|
Remove not unneeded dependency in package_test
|
juju_juju
|
train
|
go
|
a5c961f4a8162cd154f19056ce2101c881b18def
|
diff --git a/pkg/kubelet/volumemanager/populator/desired_state_of_world_populator.go b/pkg/kubelet/volumemanager/populator/desired_state_of_world_populator.go
index <HASH>..<HASH> 100644
--- a/pkg/kubelet/volumemanager/populator/desired_state_of_world_populator.go
+++ b/pkg/kubelet/volumemanager/populator/desired_state_of_world_populator.go
@@ -343,10 +343,14 @@ func (dswp *desiredStateOfWorldPopulator) checkVolumeFSResize(
volumeSpec *volume.Spec,
uniquePodName volumetypes.UniquePodName,
mountedVolumesForPod map[volumetypes.UniquePodName]map[string]cache.MountedVolume) {
- if podVolume.PersistentVolumeClaim == nil || pvc == nil {
+
+ // if a volumeSpec does not have PV or has InlineVolumeSpecForCSIMigration set or pvc is nil
+ // we can't resize the volume and hence resizing should be skipped.
+ if volumeSpec.PersistentVolume == nil || volumeSpec.InlineVolumeSpecForCSIMigration || pvc == nil {
// Only PVC supports resize operation.
return
}
+
uniqueVolumeName, exist := getUniqueVolumeName(uniquePodName, podVolume.Name, mountedVolumesForPod)
if !exist {
// Volume not exist in ASW, we assume it hasn't been mounted yet. If it needs resize,
|
Fix resizing of ephemeral volumes
|
kubernetes_kubernetes
|
train
|
go
|
6551c4959a0d459a4e4e69374b19b0d984960382
|
diff --git a/lib/test/examiner.js b/lib/test/examiner.js
index <HASH>..<HASH> 100644
--- a/lib/test/examiner.js
+++ b/lib/test/examiner.js
@@ -236,8 +236,8 @@ Test.prototype.run = function() {
this.status = stati.fail;
this.messages.push('' + ex);
console.error(ex);
- if (console.trace) {
- console.trace();
+ if (ex.stack) {
+ console.error(ex.stack);
}
}
|
Bug <I> (tests): Log the exception stack
Don't trace(). It's always going to say the same
|
joewalker_gcli
|
train
|
js
|
41f02daf30afc19d37a7bc4f5d1194b421f7919c
|
diff --git a/src/Dkim/Signer/Signer.php b/src/Dkim/Signer/Signer.php
index <HASH>..<HASH> 100644
--- a/src/Dkim/Signer/Signer.php
+++ b/src/Dkim/Signer/Signer.php
@@ -3,6 +3,7 @@
namespace Dkim\Signer;
use Dkim\Header\Dkim;
+use Zend\Mail\Header\GenericHeader;
use Zend\Mail\Message;
use Zend\Mime\Message as MimeMessage;
use Zend\Mail\Header;
@@ -171,9 +172,6 @@ PKEY;
}
$body = $this->normalizeNewlines($body);
- if (!preg_match('/\r\n$/', $body)) {
- $body = $body . "\r\n";
- }
$message->setBody($body);
}
@@ -253,8 +251,8 @@ PKEY;
/**
* Generate signature.
*
+ * @return string
* @throws \Exception
- * @return void
*/
private function generateSignature()
{
@@ -320,9 +318,9 @@ PKEY;
}
/**
- * Get emtpy DKIM header.
+ * Get empty DKIM header.
*
- * @return Header\GenericHeader
+ * @return GenericHeader
*/
private function getEmptyDkimHeader()
{
|
Updated PHP docs + removed unused REGEX check.
|
fastnloud_zf2-dkim
|
train
|
php
|
37757bc3650c202497cf80932260e8aec6438329
|
diff --git a/lib/discordrb/commands/parser.rb b/lib/discordrb/commands/parser.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/commands/parser.rb
+++ b/lib/discordrb/commands/parser.rb
@@ -81,13 +81,15 @@ module Discordrb::Commands
# @return [String] the result of the execution.
def call(event, arguments, chained = false, check_permissions = true)
if arguments.length < @attributes[:min_args]
- event.respond "Too few arguments for command `#{name}`!"
- event.respond "Usage: `#{@attributes[:usage]}`" if @attributes[:usage]
+ response = "Too few arguments for command `#{name}`!"
+ response += "\nUsage: `#{@attributes[:usage]}`" if @attributes[:usage]
+ event.respond(response)
return
end
if @attributes[:max_args] >= 0 && arguments.length > @attributes[:max_args]
- event.respond "Too many arguments for command `#{name}`!"
- event.respond "Usage: `#{@attributes[:usage]}`" if @attributes[:usage]
+ response = "Too many arguments for command `#{name}`!"
+ response += "\nUsage: `#{@attributes[:usage]}`" if @attributes[:usage]
+ event.respond(response)
return
end
unless @attributes[:chain_usable]
|
Send argument number errors with usage as a single message (#<I>)
|
meew0_discordrb
|
train
|
rb
|
8746eb17f4763a6cc2931630b8b10a8dd05303a1
|
diff --git a/doc/conf.py b/doc/conf.py
index <HASH>..<HASH> 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -45,9 +45,9 @@ copyright = u'2010, Timothy Farrell'
# built documents.
#
# The short X.Y version.
-version = '0.2'
+version = '0.3'
# The full version, including alpha/beta/rc tags.
-release = '0.2'
+release = '0.3'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/rocket/__init__.py b/rocket/__init__.py
index <HASH>..<HASH> 100644
--- a/rocket/__init__.py
+++ b/rocket/__init__.py
@@ -11,7 +11,7 @@ import logging
import platform
# Define Constants
-VERSION = '0.2.1'
+VERSION = '0.3'
SERVER_NAME = socket.gethostname()
SERVER_SOFTWARE = 'Rocket %s' % VERSION
HTTP_SERVER_SOFTWARE = '%s Python/%s' % (SERVER_SOFTWARE, sys.version.split(' ')[0])
|
Proper traffic logging calls for version <I>.
|
explorigin_Rocket
|
train
|
py,py
|
547b3b1f28603ec725d953cefb207a0b99969dd6
|
diff --git a/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/controller/RealmImpl.java b/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/controller/RealmImpl.java
index <HASH>..<HASH> 100644
--- a/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/controller/RealmImpl.java
+++ b/core/jdiameter/impl/src/main/java/org/jdiameter/client/impl/controller/RealmImpl.java
@@ -103,7 +103,9 @@ public class RealmImpl implements IRealm {
* name of peer host
*/
public void addPeerName(String name) {
- hosts.add(name);
+ if(!hasPeerName(name)) {
+ hosts.add(name);
+ }
}
/**
|
Don't add peer name dups to peer table on (re)connection
|
RestComm_jdiameter
|
train
|
java
|
77cf2432d543537045209d8be4c7e3dfce8fadcf
|
diff --git a/tests/bundle/DependencyInjection/CompilerPass/HttpCache/ConfigureHttpCachePassTest.php b/tests/bundle/DependencyInjection/CompilerPass/HttpCache/ConfigureHttpCachePassTest.php
index <HASH>..<HASH> 100644
--- a/tests/bundle/DependencyInjection/CompilerPass/HttpCache/ConfigureHttpCachePassTest.php
+++ b/tests/bundle/DependencyInjection/CompilerPass/HttpCache/ConfigureHttpCachePassTest.php
@@ -86,7 +86,9 @@ class ConfigureHttpCachePassTest extends AbstractCompilerPassTestCase
{
$this->assertThat(
$this->container,
- new \PHPUnit_Framework_Constraint_Not(new ContainerBuilderHasAliasConstraint($aliasId, null))
+ $this->logicalNot(
+ new ContainerBuilderHasAliasConstraint($aliasId)
+ )
);
}
}
|
Do not build logical not constraint by hand
|
netgen-layouts_layouts-ezplatform
|
train
|
php
|
34f080b8eea9e47d7d9c6a33990eaf26ee8ca558
|
diff --git a/Command/AbstractCommand.php b/Command/AbstractCommand.php
index <HASH>..<HASH> 100644
--- a/Command/AbstractCommand.php
+++ b/Command/AbstractCommand.php
@@ -36,6 +36,16 @@ class AbstractCommand extends Command
protected $output;
/**
+ * @var int
+ */
+ private $startMemory;
+
+ /**
+ * @var float
+ */
+ private $startedAt;
+
+ /**
* @var bool
*/
private $initialized;
@@ -60,6 +70,8 @@ class AbstractCommand extends Command
$this->input = $input;
$this->output = $output;
+ $this->startMemory = memory_get_usage(true);
+ $this->startedAt = microtime(true);
$this->initialized = true;
}
@@ -147,7 +159,13 @@ class AbstractCommand extends Command
*/
private function decorateMessage(&$message, $messageType)
{
- $message = sprintf('<%s>%s</%1$s>', $messageType, $message);
+ $message = sprintf(
+ '<comment>%ds %.1fMB</comment> <%s>%s</%3$s>',
+ round(microtime(true) - $this->startedAt),
+ (memory_get_usage(true) - $this->startMemory) / pow(1024, 2),
+ $messageType,
+ $message
+ );
}
private function checkIfInitialized()
|
Output elapsed time and memory usage in abstract console command.
|
DarvinStudio_darvin-utils
|
train
|
php
|
c9436f4f23c934c629e98acbabe488c1c513fee8
|
diff --git a/app/models/kuhsaft/page.rb b/app/models/kuhsaft/page.rb
index <HASH>..<HASH> 100644
--- a/app/models/kuhsaft/page.rb
+++ b/app/models/kuhsaft/page.rb
@@ -94,11 +94,7 @@ class Kuhsaft::Page < ActiveRecord::Base
end
def collect_fulltext
- self.fulltext = bricks.localized.inject('') do |text, brick|
- text << brick.fulltext
- text
- end
- self.fulltext = self.fulltext + [title.to_s, keywords.to_s, description.to_s].join(' ')
+ self.fulltext =[super, title.to_s, keywords.to_s, description.to_s].join(' ')
end
def nesting_name
diff --git a/app/models/kuhsaft/text_brick.rb b/app/models/kuhsaft/text_brick.rb
index <HASH>..<HASH> 100644
--- a/app/models/kuhsaft/text_brick.rb
+++ b/app/models/kuhsaft/text_brick.rb
@@ -5,5 +5,9 @@ module Kuhsaft
def render_as_horizontal_form?
true unless parents.map(&:class).include? Kuhsaft::TwoColumnBrick
end
+
+ def collect_fulltext
+ [super, text, read_more_text].join(' ')
+ end
end
end
|
implement fulltext colletors on page and text brick models
|
brandleadership_kuhsaft
|
train
|
rb,rb
|
f2507789237c39316e29fba912b9233fc0eb6457
|
diff --git a/wss-agent-parent/wss-agent-domain/src/main/java/org/whitesource/agent/api/model/DependencyInfo.java b/wss-agent-parent/wss-agent-domain/src/main/java/org/whitesource/agent/api/model/DependencyInfo.java
index <HASH>..<HASH> 100644
--- a/wss-agent-parent/wss-agent-domain/src/main/java/org/whitesource/agent/api/model/DependencyInfo.java
+++ b/wss-agent-parent/wss-agent-domain/src/main/java/org/whitesource/agent/api/model/DependencyInfo.java
@@ -29,6 +29,8 @@ public class DependencyInfo implements Serializable {
private String classifier;
private String scope;
+
+ private String sha1;
private String systemPath;
@@ -59,6 +61,16 @@ public class DependencyInfo implements Serializable {
this.version = version;
}
+ /**
+ * Constructor
+ *
+ * @param sha1
+ */
+ public DependencyInfo(String sha1) {
+ this();
+ this.sha1 = sha1;
+ }
+
/* --- Overridden methods --- */
@Override
@@ -158,6 +170,14 @@ public class DependencyInfo implements Serializable {
this.scope = scope;
}
+ public String getSha1() {
+ return sha1;
+ }
+
+ public void setSha1(String sha1) {
+ this.sha1 = sha1;
+ }
+
public String getSystemPath() {
return systemPath;
}
|
Add sha1 to dependency info.
|
whitesource_agents
|
train
|
java
|
a32bfc3a6d534ec60b119e01e336edccfecba4ff
|
diff --git a/src/Codeception/Lib/InnerBrowser.php b/src/Codeception/Lib/InnerBrowser.php
index <HASH>..<HASH> 100644
--- a/src/Codeception/Lib/InnerBrowser.php
+++ b/src/Codeception/Lib/InnerBrowser.php
@@ -490,6 +490,7 @@ class InnerBrowser extends Module implements Web, PageSourceSaver, ElementLocato
$this->fail("No links containing text '$text' and URL '$url' were found in page " . $this->_getCurrentUri());
}
}
+ $this->assertTrue(true);
}
public function dontSeeLink($text, $url = null)
|
[InnerBrowser] seeLink assertion counter (#<I>)
* Added successful assertion counter
fixes #<I>
* Update InnerBrowser.php
|
Codeception_base
|
train
|
php
|
2041551bbf3a8106e076e85c411ea0bfefdbbfe0
|
diff --git a/addon/components/pikaday-input.js b/addon/components/pikaday-input.js
index <HASH>..<HASH> 100644
--- a/addon/components/pikaday-input.js
+++ b/addon/components/pikaday-input.js
@@ -90,8 +90,9 @@ export default Ember.Component.extend({
},
setPikadayDate: function() {
+ const DATE_FORMAT = 'YYYY-MM-DD';
const value = this.get('value');
- const date = this.get('useUTC') ? moment(moment.utc(value).format('YYYY-MM-DD')).toDate() : value;
+ const date = this.get('useUTC') ? moment(moment.utc(value).format(DATE_FORMAT), DATE_FORMAT).toDate() : value;
this.get('pikaday').setDate(date, true);
},
|
Issue <I>: Pass format string to moment to avoid deprecation warning
- New versions of moment desire a format string passed to the moment
constructor
|
adopted-ember-addons_ember-pikaday
|
train
|
js
|
19f4fcf2acbedd78b4510b8260e95f7d389f812b
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@ from setuptools import setup
INSTALL_REQUIRES = (
- ['pycodestyle >= 2.5.0']
+ ['pycodestyle == 2.5.0']
)
|
Fix the version of pycodestyle to <I>
|
hhatto_autopep8
|
train
|
py
|
d6a1f18946f0221548bd2244f101d8129571a30e
|
diff --git a/com/linuxense/javadbf/DBFReader.java b/com/linuxense/javadbf/DBFReader.java
index <HASH>..<HASH> 100644
--- a/com/linuxense/javadbf/DBFReader.java
+++ b/com/linuxense/javadbf/DBFReader.java
@@ -8,7 +8,7 @@
Author: anil@linuxense
License: LGPL (http://www.gnu.org/copyleft/lesser.html)
- $Id: DBFReader.java,v 1.3 2003-06-22 14:28:31 anil Exp $
+ $Id: DBFReader.java,v 1.4 2003-06-26 17:34:35 anil Exp $
*/
package com.linuxense.javadbf;
@@ -314,7 +314,7 @@ public class DBFReader {
if( t_numeric.length > 0 && !Utils.contains( t_numeric, (byte)'?')) {
- recordObjects[i] = new Integer( new String( t_numeric));
+ recordObjects[i] = new Double( new String( t_numeric));
}
else {
|
Fixed a bug on Numeric fields with decimal places.
|
albfernandez_javadbf
|
train
|
java
|
351bbeaa2727c32b6fc38b2314eb5dc518ae909b
|
diff --git a/tests/AlignmentFile_test.py b/tests/AlignmentFile_test.py
index <HASH>..<HASH> 100644
--- a/tests/AlignmentFile_test.py
+++ b/tests/AlignmentFile_test.py
@@ -2316,6 +2316,7 @@ class TestHeader1000Genomes(unittest.TestCase):
'''see issue 110'''
bamfile = "http://ftp.1000genomes.ebi.ac.uk/vol1/ftp/technical/phase3_EX_or_LC_only_alignment/data/HG00104/alignment/HG00104.chrom11.ILLUMINA.bwa.GBR.low_coverage.20130415.bam" # noqa
+ bambase = "HG00104.chrom11.ILLUMINA.bwa.GBR.low_coverage.20130415.bam" # noqa
def testRead(self):
@@ -2326,6 +2327,10 @@ class TestHeader1000Genomes(unittest.TestCase):
data = f.header.copy()
self.assertTrue(data)
+ def tearDown(self):
+ if os.path.exists(self.bambase + ".bai"):
+ os.unlink(self.bambase + ".bai")
+
class TestLargeCigar(unittest.TestCase):
|
Remove temporary downloaded test file after test case finishes
|
pysam-developers_pysam
|
train
|
py
|
3534b7e3d86aa3fc6f43dd334f3e526007fe8ab4
|
diff --git a/trunk/JLanguageTool/src/java/de/danielnaber/languagetool/tokenizers/WordTokenizer.java b/trunk/JLanguageTool/src/java/de/danielnaber/languagetool/tokenizers/WordTokenizer.java
index <HASH>..<HASH> 100644
--- a/trunk/JLanguageTool/src/java/de/danielnaber/languagetool/tokenizers/WordTokenizer.java
+++ b/trunk/JLanguageTool/src/java/de/danielnaber/languagetool/tokenizers/WordTokenizer.java
@@ -34,7 +34,7 @@ public class WordTokenizer implements Tokenizer {
public List<String> tokenize(final String text) {
List<String> l = new ArrayList<String>();
- StringTokenizer st = new StringTokenizer(text, " ,.;()!?:\"'\n", true);
+ StringTokenizer st = new StringTokenizer(text, " ,.;()!?:\"'„”\n", true);
while (st.hasMoreElements()) {
l.add(st.nextToken());
}
|
adding Polish quotes to tokenizer (should we make different classes for all languages...?)
|
languagetool-org_languagetool
|
train
|
java
|
4f96d8a8dfde9b4cac9d2103b5f58d5705b26ded
|
diff --git a/sdk/search/azure-search-documents/samples/async_samples/sample_indexers_operations_async.py b/sdk/search/azure-search-documents/samples/async_samples/sample_indexers_operations_async.py
index <HASH>..<HASH> 100644
--- a/sdk/search/azure-search-documents/samples/async_samples/sample_indexers_operations_async.py
+++ b/sdk/search/azure-search-documents/samples/async_samples/sample_indexers_operations_async.py
@@ -65,7 +65,7 @@ async def create_indexer():
indexer = SearchIndexer(
name="async-sample-indexer",
data_source_name="async-indexer-datasource",
- target_index_name="indexer-hotels"
+ target_index_name="async-indexer-hotels"
)
result = await indexers_client.create_indexer(indexer)
print("Create new Indexer - async-sample-indexer")
|
update sample (#<I>)
|
Azure_azure-sdk-for-python
|
train
|
py
|
58e1e0268861802c2613d7fa346e6059af450428
|
diff --git a/etcd/etcd.go b/etcd/etcd.go
index <HASH>..<HASH> 100644
--- a/etcd/etcd.go
+++ b/etcd/etcd.go
@@ -233,6 +233,6 @@ func (e *Etcd) Stop() {
// ReadyNotify returns a channel that is going to be closed
// when the etcd instance is ready to accept connections.
-func (e *Etcd) ReadyNotify() chan bool {
+func (e *Etcd) ReadyNotify() <-chan bool {
return e.readyC
}
|
refactor(main): return only receiving channel from Etcd.ReadyNotify()
|
etcd-io_etcd
|
train
|
go
|
7704b7150287e72f49216d358e47090c11c81591
|
diff --git a/spyderlib/utils/qthelpers.py b/spyderlib/utils/qthelpers.py
index <HASH>..<HASH> 100644
--- a/spyderlib/utils/qthelpers.py
+++ b/spyderlib/utils/qthelpers.py
@@ -81,7 +81,12 @@ def mimedata2url(source, extlist=None):
path = unicode(url.toString())
if path.startswith(r"file://"):
if os.name == 'nt':
- path = path[8:]
+ # On Windows platforms, a local path reads: file:///c:/...
+ # and a UNC based path reads like: file://server/share
+ if path.startswith(r"file:///"): # this is a local path
+ path=path[8:]
+ else: # this is a unc path
+ path = path[5:]
else:
path = path[7:]
if osp.exists(path):
|
Fixed Issue <I>: Impossible to drag files to editor from Windows network shares (mimedata2url helper does not recognize UNC paths)
|
spyder-ide_spyder
|
train
|
py
|
c344f17caca40ebf830bb46682ff5477d33a4f0e
|
diff --git a/hamper/plugins/karma.py b/hamper/plugins/karma.py
index <HASH>..<HASH> 100644
--- a/hamper/plugins/karma.py
+++ b/hamper/plugins/karma.py
@@ -159,7 +159,7 @@ class Karma(ChatCommandPlugin):
"""
# !karma <username>
- regex = r'^(?:score|karma) ([^-].+)$'
+ regex = r'^(?:score|karma)\s+([^-].*)$'
def command(self, bot, comm, groups):
# Play nice when the user isn't in the db
|
Karma: get scores for single characters.
Fixes #<I>
|
hamperbot_hamper
|
train
|
py
|
ca31091b1272fe0ac9bedf584c1ce061804a2291
|
diff --git a/files/index.php b/files/index.php
index <HASH>..<HASH> 100644
--- a/files/index.php
+++ b/files/index.php
@@ -135,7 +135,7 @@
displaydir($wdir);
} else {
- $upload_max_filesize = get_max_upload_file_size();
+ $upload_max_filesize = get_max_upload_file_size($CFG->maxbytes);
$filesize = display_size($upload_max_filesize);
$struploadafile = get_string("uploadafile");
|
Uploading in course restricted by site setting ...
|
moodle_moodle
|
train
|
php
|
36fd1d24afec374f0820cc9f6c8a46eb2c3c9cc4
|
diff --git a/init.php b/init.php
index <HASH>..<HASH> 100644
--- a/init.php
+++ b/init.php
@@ -1,7 +1,7 @@
<?php
// Route for displaying assets
-Route::set('asset', 'asset/<action>/<id>(/<width>(/<height>(/<quality>(/<crop>))))')
+Route::set('asset', 'asset/<action>/<id>(.<extension>)(/<width>(/<height>(/<quality>(/<crop>))))')
->defaults(array(
'action' => 'view',
'quality' => 85,
|
Allow asset routes to accept a file extension (which is ignored).
Fixes bugs where browsers can't identify the filetype because there's no file extension
|
boomcms_boom-core
|
train
|
php
|
38f53c30cd7153cbcbc03b31a17d305867faafe8
|
diff --git a/src/gitgraph.js b/src/gitgraph.js
index <HASH>..<HASH> 100644
--- a/src/gitgraph.js
+++ b/src/gitgraph.js
@@ -674,7 +674,11 @@
if ( !branch.isfinish ) {
this.column++;
} else {
- break;
+ if ( !branch.isdead ) {
+ this.column = branch.column;
+ branch.isdead = true;
+ break;
+ }
}
}
|
Reuse a deleted branch's column only once
This should fix bug #<I>: Git Branches overlap when using .delete()
|
nicoespeon_gitgraph.js
|
train
|
js
|
c9b07f1b17a5f17391471cc740c1b5a32764b63d
|
diff --git a/src/main/java/net/malisis/core/util/EntityUtils.java b/src/main/java/net/malisis/core/util/EntityUtils.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/malisis/core/util/EntityUtils.java
+++ b/src/main/java/net/malisis/core/util/EntityUtils.java
@@ -111,6 +111,9 @@ public class EntityUtils
*/
public static ForgeDirection getEntityFacing(Entity entity, boolean sixWays)
{
+ if (entity == null)
+ return ForgeDirection.UNKNOWN;
+
float pitch = entity.rotationPitch;
if (sixWays && pitch < -45)
return ForgeDirection.UP;
|
Fixed NPE if entity passed was null for EntityUtils.getEntityFacing()
|
Ordinastie_MalisisCore
|
train
|
java
|
0985dd17df3695aad83dc55899f6dfd3fbcb0553
|
diff --git a/lib/sfn/command/create.rb b/lib/sfn/command/create.rb
index <HASH>..<HASH> 100644
--- a/lib/sfn/command/create.rb
+++ b/lib/sfn/command/create.rb
@@ -75,7 +75,7 @@ module Sfn
poll_stack(stack.name)
stack = provider.connection.stacks.get(name)
- if(stack.reload.success?)
+ if(stack.reload.state == :create_complete)
ui.info "Stack create complete: #{ui.color('SUCCESS', :green)}"
namespace.const_get(:Describe).new({:outputs => true}, [name]).execute!
else
|
Only output successful creation if the state of the stack is completed create
|
sparkleformation_sfn
|
train
|
rb
|
507603e33dfcad606b3c4d261f4d4c00bdce1bd8
|
diff --git a/resources/views/partials/component.blade.php b/resources/views/partials/component.blade.php
index <HASH>..<HASH> 100644
--- a/resources/views/partials/component.blade.php
+++ b/resources/views/partials/component.blade.php
@@ -1,4 +1,4 @@
-<li class="list-group-item {{ $component->group_id ? "sub-component" : "component" }}">
+<li class="list-group-item {{ $component->group_id ? "sub-component" : "component" }} status-{{ $component->status }}">
@if($component->link)
<a href="{{ $component->link }}" target="_blank" class="links">{!! $component->name !!}</a>
@else
|
add a CSS class for status to each component element
the class can be used to style components based on their status using
.component.status-1 as a rule. They can then be made bold, have a
different background or be hiddend depending on their status.
|
CachetHQ_Cachet
|
train
|
php
|
32f5c3b174454d9675a34f53a437c6951c5e7c52
|
diff --git a/pyfolio/interesting_periods.py b/pyfolio/interesting_periods.py
index <HASH>..<HASH> 100644
--- a/pyfolio/interesting_periods.py
+++ b/pyfolio/interesting_periods.py
@@ -16,6 +16,8 @@
"""Generates a list of historical event dates that may have had
significant impact on markets. See extract_interesting_date_ranges."""
+import pandas as pd
+
from collections import OrderedDict
PERIODS = OrderedDict()
@@ -60,4 +62,4 @@ PERIODS['Apr14'] = (pd.Timestamp('20140401'), pd.Timestamp('20140501'))
PERIODS['Oct14'] = (pd.Timestamp('20141001'), pd.Timestamp('20141101'))
# Market down-turn in August/Sept 2015
-PERIODS['Aug15'] = (pd.Timestamp('20150820'), pd.Timestamp('20150904'))
+PERIODS['Fall2015'] = (pd.Timestamp('20150815'), pd.Timestamp('20150930'))
|
MAINT Rename time period. Add missing pandas import.
|
quantopian_pyfolio
|
train
|
py
|
25b71d43ac82a7411dd16a3a7d2654160a51d6ca
|
diff --git a/gem/lib/frank-cucumber/version.rb b/gem/lib/frank-cucumber/version.rb
index <HASH>..<HASH> 100644
--- a/gem/lib/frank-cucumber/version.rb
+++ b/gem/lib/frank-cucumber/version.rb
@@ -1,5 +1,5 @@
module Frank
module Cucumber
- VERSION = "0.8.9"
+ VERSION = "0.8.10"
end
end
|
gem version bump (to <I>)
|
moredip_Frank
|
train
|
rb
|
56725d387b82753f9e73e9b18e503203c812f077
|
diff --git a/indra/statements/concept.py b/indra/statements/concept.py
index <HASH>..<HASH> 100644
--- a/indra/statements/concept.py
+++ b/indra/statements/concept.py
@@ -39,8 +39,6 @@ class Concept(object):
# If there's no grounding, just use the name as key
if not db_ns and not db_id:
return self.name
- if '/' in db_id:
- return str((db_ns, db_id.split('/')[-1]))
return str((db_ns, db_id))
def equals(self, other):
|
Remove taking the last piece of the grounding path
|
sorgerlab_indra
|
train
|
py
|
cd18afae4932fd29b614a1b399edb84184d7a053
|
diff --git a/cmd/argo/commands/resubmit.go b/cmd/argo/commands/resubmit.go
index <HASH>..<HASH> 100644
--- a/cmd/argo/commands/resubmit.go
+++ b/cmd/argo/commands/resubmit.go
@@ -42,5 +42,8 @@ func ResubmitWorkflow(cmd *cobra.Command, args []string) {
if err != nil {
log.Fatal(err)
}
- submitWorkflow(newWF)
+ _, err = submitWorkflow(newWF)
+ if err != nil {
+ log.Fatal(err)
+ }
}
|
Missed handling of a error during workflow resubmission
|
argoproj_argo
|
train
|
go
|
6c418677af82ccc9e1823969b81f92c40c0c5ab8
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -6,7 +6,7 @@ The setup script for salt
from distutils.core import setup
setup(name='salt',
- version='0.6',
+ version='0.6.0',
description='Portable, distrubuted, remote execution system',
author='Thomas S Hatch',
author_email='thatch45@gmail.com',
|
add a <I> to <I>, because it works better that way
|
saltstack_salt
|
train
|
py
|
a4391a31263f07e7344fab55bab1d3c951bf59a4
|
diff --git a/synapse/cortex.py b/synapse/cortex.py
index <HASH>..<HASH> 100644
--- a/synapse/cortex.py
+++ b/synapse/cortex.py
@@ -84,7 +84,7 @@ def choptag(tag):
parts = tag.split('.')
return [ '.'.join(parts[:x+1]) for x in range(len(parts)) ]
-if __name__ == '__main__':
+if __name__ == '__main__': # pragma: no cover
import sys
import code
|
Add nocover to a untestable code block.
|
vertexproject_synapse
|
train
|
py
|
45af770101b84d7f8ab43369b2f9d7179249b0d8
|
diff --git a/egg/_gui.py b/egg/_gui.py
index <HASH>..<HASH> 100644
--- a/egg/_gui.py
+++ b/egg/_gui.py
@@ -2829,7 +2829,7 @@ class DataboxPlot(_d.databox, GridLayout):
# get globals for sin, cos etc
g = _n.__dict__
g.update(_scipy_special.__dict__)
- g.update(dict(d=self))
+ g.update(dict(d=self, ex=None, ey=None))
g.update(dict(xlabels='x', ylabels='y'))
# run the script.
@@ -2838,6 +2838,8 @@ class DataboxPlot(_d.databox, GridLayout):
# x & y should now be data arrays, lists of data arrays or Nones
x = g['x']
y = g['y']
+ ex = g['ex']
+ ey = g['ey']
# make it the right shape
if x == None: x = [None]
|
started adding ex and ey to DataboxPlot scripts.
|
Spinmob_spinmob
|
train
|
py
|
5a4b70dad727e32427f498a1d3bd97a3ef119013
|
diff --git a/superset/views/core.py b/superset/views/core.py
index <HASH>..<HASH> 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -1449,10 +1449,8 @@ class Superset(BaseSupersetView):
def checkbox(self, model_view, id_, attr, value):
"""endpoint for checking/unchecking any boolean in a sqla model"""
modelview_to_model = {
- 'TableColumnInlineView':
- ConnectorRegistry.sources['table'].column_class,
- 'DruidColumnInlineView':
- ConnectorRegistry.sources['druid'].column_class,
+ '{}ColumnInlineView'.format(name.capitalize()): source.column_class
+ for name, source in ConnectorRegistry.sources.items()
}
model = modelview_to_model[model_view]
col = db.session.query(model).filter_by(id=id_).first()
|
Fix checkbox is fails When disable Druid datasource (#<I>)
|
apache_incubator-superset
|
train
|
py
|
1b0adb334be468c7148dca36a26caf032bc5b33e
|
diff --git a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySession.java b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySession.java
index <HASH>..<HASH> 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySession.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySession.java
@@ -323,9 +323,7 @@ final class SpdySession {
}
}
- private final class StreamComparator implements Comparator<Integer>, Serializable {
-
- private static final long serialVersionUID = 1161471649740544848L;
+ private final class StreamComparator implements Comparator<Integer> {
StreamComparator() { }
|
Fix incorrect Serializable
Motivation:
SpdySession.StreamComparator should not be Serializable since SpdySession is not Serializable
Modifications:
Remove Serializable fom SpdySession.StreamComparator
Result:
StreamComparator is not Serializable any more
|
netty_netty
|
train
|
java
|
5343ffe25315415f965b1b160ed7caa395eee522
|
diff --git a/src/Test/API/PluginTest.php b/src/Test/API/PluginTest.php
index <HASH>..<HASH> 100644
--- a/src/Test/API/PluginTest.php
+++ b/src/Test/API/PluginTest.php
@@ -4,6 +4,7 @@ namespace CF\Test\API;
use CF\API\Request;
use CF\Integration\DefaultIntegration;
+use CF\Integration\DataStoreInterface;
use CF\API\Plugin;
class PluginTest extends \PHPUnit_Framework_TestCase
@@ -62,4 +63,23 @@ class PluginTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($response['success']);
}
+
+ public function testCreatePluginSettingObject()
+ {
+ $pluginSettingKey = 'key';
+ $value = 'value';
+ $editable = false;
+ $modifiedOn = null;
+
+ $expected = array(
+ DataStoreInterface::ID_KEY => $pluginSettingKey,
+ DataStoreInterface::VALUE_KEY => $value,
+ DataStoreInterface::EDITABLE_KEY => $editable,
+ DataStoreInterface::MODIFIED_DATE_KEY => $modifiedOn,
+ );
+
+ $result = $this->pluginAPIClient->createPluginSettingObject($pluginSettingKey, $value, $editable, $modifiedOn);
+
+ $this->assertEquals($expected, $result);
+ }
}
|
PI-<I> added tests
|
cloudflare_cloudflare-plugin-backend
|
train
|
php
|
46a1b68095d58610ef0c26dd150097931ac3d488
|
diff --git a/lib/rudy/routines/handlers/rye.rb b/lib/rudy/routines/handlers/rye.rb
index <HASH>..<HASH> 100644
--- a/lib/rudy/routines/handlers/rye.rb
+++ b/lib/rudy/routines/handlers/rye.rb
@@ -73,7 +73,8 @@ module Rudy::Routines::Handlers;
opts = {
:user => (current_machine_user).to_s,
- :parallel => @@global.parallel
+ :parallel => @@global.parallel,
+ :quiet => Rudy.quiet?
}.merge(opts)
set = ::Rye::Set.new current_machine_group, opts
|
Rye should be in quiet mode when Rudy.quiet?
|
solutious_rudy
|
train
|
rb
|
b93c04da6e1d032525b7d412447ae2b1afa6580b
|
diff --git a/Profiler/ElasticsearchProfiler.php b/Profiler/ElasticsearchProfiler.php
index <HASH>..<HASH> 100644
--- a/Profiler/ElasticsearchProfiler.php
+++ b/Profiler/ElasticsearchProfiler.php
@@ -82,7 +82,7 @@ class ElasticsearchProfiler implements DataCollectorInterface
*/
public function getTime()
{
- return round($this->time * 100, 2);
+ return round($this->time * 1000, 2);
}
/**
|
changed the getTime() in profiler to return ms
|
ongr-io_ElasticsearchBundle
|
train
|
php
|
6cea7f3964a282fd6d729b0303bc35da11f59cc1
|
diff --git a/generators/heroku/index.js b/generators/heroku/index.js
index <HASH>..<HASH> 100644
--- a/generators/heroku/index.js
+++ b/generators/heroku/index.js
@@ -448,8 +448,7 @@ module.exports = class extends BaseGenerator {
this.buildCmd = child.buildCmd;
child.stdout.on('data', (data) => {
- const line = data.toString().trim();
- if (line.length !== 0) this.log(line);
+ process.stdout.write(data.toString());
});
},
|
Fix build output buffering issue in Heroku subgen
|
jhipster_generator-jhipster
|
train
|
js
|
bf57c132cde405dd9ffe64b1dface9df3693b8de
|
diff --git a/src/tooltip.js b/src/tooltip.js
index <HASH>..<HASH> 100644
--- a/src/tooltip.js
+++ b/src/tooltip.js
@@ -72,6 +72,8 @@ export default class Tooltip {
// set initial state
this._isOpen = false
+ this._isDisposed = false
+
// set event listeners
this._setEventListeners(reference, events, options)
}
@@ -349,13 +351,19 @@ export default class Tooltip {
// Fix position
requestAnimationFrame(() => {
- if (this.popperInstance) {
+ if (!this._isDisposed && this.popperInstance) {
this.popperInstance.update()
// Show the tooltip
requestAnimationFrame(() => {
- tooltipNode.setAttribute('aria-hidden', 'false')
+ if (!this._isDisposed) {
+ tooltipNode.setAttribute('aria-hidden', 'false')
+ } else {
+ this.dispose()
+ }
})
+ } else {
+ this.dispose()
}
})
@@ -392,6 +400,8 @@ export default class Tooltip {
}
_dispose () {
+ this._isDisposed = true
+
// remove event listeners first to prevent any unexpected behaviour
this._events.forEach(({ func, event }) => {
this.reference.removeEventListener(event, func)
|
Fix cases of tooltips not being disposed on Firefox
|
Akryum_v-tooltip
|
train
|
js
|
ba579a7d3a7169aea708bb45f6306a81e723cc1c
|
diff --git a/MapServicePublisher.py b/MapServicePublisher.py
index <HASH>..<HASH> 100644
--- a/MapServicePublisher.py
+++ b/MapServicePublisher.py
@@ -98,6 +98,7 @@ class MapServicePublisher:
def publish(self, services):
for service_config in services:
+ self.message("Publishing " + service_config["input"])
extension = os.path.splitext(self.currentDirectory + service_config["input"])[1]
self.get_publication_method_by_service_type(extension)(service_config)
print service_config["input"] + " published successfully"
|
Adds message with source path at start of each service run
|
lobsteropteryx_slap
|
train
|
py
|
a6f8b16f96289ba41cc6674fbdd3e636595039eb
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -266,7 +266,7 @@ var fieldList = function(props) {
Selection(ou.merge(props, {
key : makeKey(props.path),
options : props.schema['enum'],
- selected: props.getValue(props.path),
+ selected: props.getValue(props.path) || props.schema['enum'][0],
errors : props.getErrors(props.path)
}))
];
|
make selections default to the first option listed
|
ismaelga_react-json-editor
|
train
|
js
|
f958494b46745eba997d48d80ef194c86bb3432f
|
diff --git a/spyderlib/config.py b/spyderlib/config.py
index <HASH>..<HASH> 100644
--- a/spyderlib/config.py
+++ b/spyderlib/config.py
@@ -434,7 +434,7 @@ DEFAULTS = [
'wrap': True,
'name_filters': NAME_FILTERS,
'show_hidden': True,
- 'show_all': False,
+ 'show_all': True,
'show_icontext': False,
}),
('find_in_files',
@@ -714,7 +714,7 @@ DEFAULTS = [
# 2. If you want to *remove* options that are no longer needed in our codebase,
# you need to do a MAJOR update in version, e.g. from 3.0.0 to 4.0.0
# 3. You don't need to touch this value if you're just adding a new option
-CONF_VERSION = '11.0.0'
+CONF_VERSION = '11.1.0'
# XXX: Previously we had load=(not DEV) here but DEV was set to *False*.
# Check if it *really* needs to be updated or not
|
File Explorer: Show all files by default
- It can be confusing if you don't see all files when using the File Explorer
- Filters are really useful but they have to be opt-in not opt-out
|
spyder-ide_spyder
|
train
|
py
|
f0370d9542d75b7ff166429578f60d64097fe945
|
diff --git a/tests/package.js b/tests/package.js
index <HASH>..<HASH> 100644
--- a/tests/package.js
+++ b/tests/package.js
@@ -25,6 +25,8 @@ Package.onTest(function(api) {
api.use('angular:angular@1.4.8', 'client');
api.use('isobuild:compiler-plugin@1.0.0');
+ api.use('mdg:camera@1.1.5');
+
api.addFiles([
'../dist/angular-meteor.js'
], 'client');
@@ -39,4 +41,14 @@ Package.onTest(function(api) {
api.addFiles([
'collections.js'
], 'client', 'server');
+
+ // legacy
+ api.addFiles([
+ // auxiliary
+ 'integration/auxiliary/test_data.js',
+ 'integration/auxiliary/matchers.js',
+ // modules
+ 'integration/pre1.3/angular-meteor-get-updates-spec.js',
+ 'integration/pre1.3/angular-meteor-diff-array-spec.js'
+ ], 'client');
});
|
chore: add missing tests of getUpdates and diffArray
|
Urigo_angular-meteor
|
train
|
js
|
7e6ae4404c63f028dc0d309c0256264e48fb1fd5
|
diff --git a/pymatbridge/matlab_magic.py b/pymatbridge/matlab_magic.py
index <HASH>..<HASH> 100644
--- a/pymatbridge/matlab_magic.py
+++ b/pymatbridge/matlab_magic.py
@@ -268,6 +268,7 @@ def load_ipython_extension(ip, **kwargs):
def unload_ipython_extension(ip):
global _loaded
if _loaded:
- ip.magics_manager.registry['MatlabMagics'].Matlab.stop()
+ magic = ip.magics_manager.registry.pop('MatlabMagics')
+ magic.Matlab.stop()
|
Use 'pop' to also remove the magic from the registry, while you're at it.
|
arokem_python-matlab-bridge
|
train
|
py
|
ce02336af910788f79008aa6f5a8297859052c5f
|
diff --git a/atlas/panelgeneration/models.py b/atlas/panelgeneration/models.py
index <HASH>..<HASH> 100644
--- a/atlas/panelgeneration/models.py
+++ b/atlas/panelgeneration/models.py
@@ -181,8 +181,8 @@ class AlleleGenerator(object):
return combination_context
def _get_start_end(self, pos, delta = 0):
- start_delta = math.floor(delta / 2)
- end_delta = math.ceil(delta / 2)
+ start_delta = int(math.floor(delta / 2))
+ end_delta = int(math.ceil(delta / 2))
start_index = pos - self.kmer - start_delta
end_index = pos + self.kmer + end_delta + 1
|
List indices should be ints
|
Phelimb_atlas
|
train
|
py
|
3ea93cc098b7baa1243ffbe50e075138fdb601b0
|
diff --git a/lib/rules/focusable-tabindex-style.js b/lib/rules/focusable-tabindex-style.js
index <HASH>..<HASH> 100644
--- a/lib/rules/focusable-tabindex-style.js
+++ b/lib/rules/focusable-tabindex-style.js
@@ -21,10 +21,10 @@ module.exports.lint = function (element, opts) {
if (this.detectedStyle !== null &&
this.detectedStyle !== tabIndexStyle) {
- // unused?
- // var data = { op: tabIndexStyle ? 'remove the tabindex' : 'add a positive tabindex' };
- return new Issue('E026', element.openLineCol);
+ var msg = tabIndexStyle ? 'remove the tabindex'
+ : 'add a positive tabindex';
+ return new Issue('E026', element.openLineCol, {op: msg});
}
this.detectedStyle = tabIndexStyle;
@@ -36,9 +36,11 @@ module.exports.isDisabled = function (element) {
};
module.exports.getTabIndexStyle = function (element) {
- if (!element.attribs || !element.attribs.hasOwnProperty('tabindex')) {
- return false;
+ var a = element.attribs;
+
+ if (a && a.hasOwnProperty('tabindex') && typeof a !== 'undefined') {
+ return a.tabindex.value > 0;
}
- return element.attribs.tabindex.value > 0;
+ return false;
};
|
Correct focusable-tabindex-style (fixes #<I>)
|
htmllint_htmllint
|
train
|
js
|
ba26d0fd6fa29821ff76b88e506a67c9eae4bd74
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100755
--- a/index.js
+++ b/index.js
@@ -63,7 +63,13 @@ function* run() {
}
}
- const dbPath = typeof commander.dbpath === 'string' ? `${commander.dbpath}` : './data';
+ let dbPath;
+ if(typeof commander.dbpath === 'string'){
+ dbPath = `${commander.dbpath}` ;
+ }
+ else {
+ dbPath = isWin ? 'data' : './data';
+ }
if (!fs.existsSync(`${dbPath}`)) {
execSync(isWin ? `md .\\${dbPath}` : `mkdir -p ${dbPath}`);
|
Update index.js
Fixes Issue #<I>
|
vkarpov15_run-rs
|
train
|
js
|
a08d0192b726ac21698c4f525296225a52864790
|
diff --git a/rpcc/conn.go b/rpcc/conn.go
index <HASH>..<HASH> 100644
--- a/rpcc/conn.go
+++ b/rpcc/conn.go
@@ -21,9 +21,6 @@ var (
const (
defaultWriteBufferSize = 4096
-
- // Fixed header size used by gorilla/websocket.
- websocketMaxHeaderSize = 2 + 8 + 4
)
// DialOption represents a dial option passed to Dial.
@@ -119,17 +116,17 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
ws.WriteBufferSize = defaultWriteBufferSize
}
- // Base writeLimit on the buffer size allocated by the
- // websocket package, we assume a message of this size
- // is fragmented and subtract one.
- writeLimit := ws.WriteBufferSize + websocketMaxHeaderSize - 1
-
// Set NetDial to dial with context, this action will
// override the HandshakeTimeout setting.
ws.NetDial = func(network, addr string) (net.Conn, error) {
conn, err := (&net.Dialer{}).DialContext(ctx, network, addr)
+ // Use writeLimiter to avoid writing fragmented
+ // websocket messages. We're not accounting for
+ // the header length here because it varies, as
+ // a result we might block some valid writes
+ // that are a few bytes too large.
return &writeLimiter{
- limit: writeLimit,
+ limit: ws.WriteBufferSize,
Conn: conn,
}, err
}
|
rpcc: Set write limit to WriteBufferSize
The previous assumption that WriteBufferSize+WebSocketMaxHeaderLength
will be written when a message is fragmented was incorrect. The header
size can vary and the easiest solution is to not account for header
size. This should always be correct.
Fixes #<I>.
|
mafredri_cdp
|
train
|
go
|
6f242c9266cd48621af7db8c36131d58c1c8dadb
|
diff --git a/examples/tomo/xray_trafo.py b/examples/tomo/xray_trafo.py
index <HASH>..<HASH> 100644
--- a/examples/tomo/xray_trafo.py
+++ b/examples/tomo/xray_trafo.py
@@ -211,8 +211,8 @@ def helical():
if __name__ == '__main__':
- #parallel_2d()
- #parallel_3d()
- #fanbeam()
+ parallel_2d()
+ parallel_3d()
+ fanbeam()
conebeam()
- #helical()
+ helical()
|
MAINT: fix uncommented lines in xray_trafo example
|
odlgroup_odl
|
train
|
py
|
01d4e5c5ad6ca573eb55e94276ec84b59d48e4ce
|
diff --git a/vstutils/static/js/guiElements.js b/vstutils/static/js/guiElements.js
index <HASH>..<HASH> 100644
--- a/vstutils/static/js/guiElements.js
+++ b/vstutils/static/js/guiElements.js
@@ -1547,8 +1547,6 @@ guiElements.crontab = function (opt = {}, value)
this.model.HoursStr = "*"
this.model.MinutesStr = "*"
- this.value = value || "* * * * *";
-
this.render = function(render_options)
{
if(render_options !== undefined)
@@ -1564,8 +1562,7 @@ guiElements.crontab = function (opt = {}, value)
{
this.render_options.description = "Time must be specified according to " + window.timeZone + " time zone";
}
-
- this.parseCronString(this.value);
+ this.parseCronString(this.db_value);
return spajs.just.render("guiElements."+this.name, {opt:this.render_options, guiElement: this, value: this.value }, () => {
this._onRender();
this._callAllonChangeCallback();
|
Fix rendering of crontab field with value from DB.
vst/vst-utils#<I>
[ci skip]
|
vstconsulting_vstutils
|
train
|
js
|
0c5c1bc1c7c54de33f895a173056d26a3702e4c5
|
diff --git a/src/Runtime/LambdaRuntime.php b/src/Runtime/LambdaRuntime.php
index <HASH>..<HASH> 100755
--- a/src/Runtime/LambdaRuntime.php
+++ b/src/Runtime/LambdaRuntime.php
@@ -320,6 +320,11 @@ final class LambdaRuntime
return;
}
+ // Support cases where the sockets extension is not installed
+ if (! function_exists('socket_create')) {
+ return;
+ }
+
// Only run the code in 1% of requests
// We don't need to collect all invocations, only to get an approximation
if (rand(0, 99) > 0) {
|
Support cases where the sockets extension is not installed
|
mnapoli_bref
|
train
|
php
|
fbe935dfc86097aef79aa26c70931dcae525fc6c
|
diff --git a/code/Debug/Block/Abstract.php b/code/Debug/Block/Abstract.php
index <HASH>..<HASH> 100644
--- a/code/Debug/Block/Abstract.php
+++ b/code/Debug/Block/Abstract.php
@@ -1,6 +1,22 @@
<?php
class Sheep_Debug_Block_Abstract extends Mage_Core_Block_Template
{
+ /** @var Sheep_Debug_Helper_Data */
+ protected $helper;
+
+
+ /**
+ * Sheep_Debug_Block_Abstract constructor.
+ *
+ * @param array $args
+ */
+ public function __construct(array $args)
+ {
+ parent::__construct($args);
+ $this->helper = Mage::helper('sheep_debug');
+ }
+
+
public function getDefaultStoreId(){
return Mage::app()
->getWebsite()
@@ -16,4 +32,13 @@ class Sheep_Debug_Block_Abstract extends Mage_Core_Block_Template
{
return false;
}
+
+ /**
+ * TODO: use a request info model
+ * @return Sheep_Debug_Model_Observer
+ */
+ public function getRequestInfo()
+ {
+ return Mage::getSingleton('sheep_debug/observer');
+ }
}
|
Adds requirest info (for future) and module's helper as protected member to our base block class
|
madalinoprea_magneto-debug
|
train
|
php
|
53d8a59762ab318788d3ec8a5a0f6c50b81c077b
|
diff --git a/src/Client.php b/src/Client.php
index <HASH>..<HASH> 100644
--- a/src/Client.php
+++ b/src/Client.php
@@ -115,7 +115,8 @@ class Client {
}
/**
- * Closes the connection to the beanstalk server.
+ * Closes the connection to the beanstalk server by first signaling
+ * that we want to quit then actually closing the socket connection.
*
* @return boolean `true` if diconnecting was successful.
*/
@@ -123,6 +124,7 @@ class Client {
if (!is_resource($this->_connection)) {
$this->connected = false;
} else {
+ $this->_write('quit');
$this->connected = !fclose($this->_connection);
if (!$this->connected) {
|
Use quit cmd when closing the connection.
|
mariuswilms_beanstalk
|
train
|
php
|
fb07277f823bd7b80f2e27e9e9cb68ee73a634ec
|
diff --git a/src/base/SpinBox.js b/src/base/SpinBox.js
index <HASH>..<HASH> 100644
--- a/src/base/SpinBox.js
+++ b/src/base/SpinBox.js
@@ -45,6 +45,7 @@ export class SpinBox extends Base {
super[internal.goDown]();
}
this.stepDown();
+ return true; // Handled
}
[internal.goUp]() {
@@ -52,6 +53,7 @@ export class SpinBox extends Base {
super[internal.goUp]();
}
this.stepUp();
+ return true; // Handled
}
[internal.render](changed) {
@@ -93,7 +95,12 @@ export class SpinBox extends Base {
// Render value state to input.
if (changed.value) {
const { value } = this[internal.state];
- /** @type {any} */ (this[internal.ids].input).value = value;
+ /** @type {any} */ const input = this[internal.ids].input;
+ input.value = value;
+ // Put cursor at end of text.
+ const length = value.length;
+ input.selectionStart = length;
+ input.selectionEnd = length;
}
}
|
Put cursor at end of text after updating value.
|
elix_elix
|
train
|
js
|
6ba4f1d63c72e8642710ceb86c69815714bda973
|
diff --git a/Classes/Domain/Repository/AddressRepository.php b/Classes/Domain/Repository/AddressRepository.php
index <HASH>..<HASH> 100755
--- a/Classes/Domain/Repository/AddressRepository.php
+++ b/Classes/Domain/Repository/AddressRepository.php
@@ -8,7 +8,6 @@ namespace FriendsOfTYPO3\TtAddress\Domain\Repository;
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*/
-
use FriendsOfTYPO3\TtAddress\Domain\Model\Dto\Demand;
use FriendsOfTYPO3\TtAddress\Service\CategoryService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
Apply fixes from StyleCI (#<I>)
[ci skip] [skip ci]
|
FriendsOfTYPO3_tt_address
|
train
|
php
|
a1611d6a95dd571823ed4110ea78863d864008d1
|
diff --git a/lib/http-server.js b/lib/http-server.js
index <HASH>..<HASH> 100644
--- a/lib/http-server.js
+++ b/lib/http-server.js
@@ -32,7 +32,7 @@ var HTTPServer = exports.HTTPServer = function (options) {
cache: this.cache
})
],
- headers: this.headers || {}
+ headers: this.headers || {};
});
};
diff --git a/test/http-server-test.js b/test/http-server-test.js
index <HASH>..<HASH> 100644
--- a/test/http-server-test.js
+++ b/test/http-server-test.js
@@ -63,7 +63,7 @@ vows.describe('http-server').addBatch({
},
'should respond with headers set in options': function (err, res, body) {
assert.equal(res.headers['access-control-allow-origin'], '*');
- assert.equal(res.headers['access-control-allow-credentials'], 'true')
+ assert.equal(res.headers['access-control-allow-credentials'], 'true');
}
}
}
|
[fix] style fix to match the project's semicolon usage
|
cubbles_cubx-http-server
|
train
|
js,js
|
9ee5df334b9628e0836942795cfc38a7acaa911e
|
diff --git a/src/Behat/Testwork/ServiceContainer/Configuration/ConfigurationLoader.php b/src/Behat/Testwork/ServiceContainer/Configuration/ConfigurationLoader.php
index <HASH>..<HASH> 100644
--- a/src/Behat/Testwork/ServiceContainer/Configuration/ConfigurationLoader.php
+++ b/src/Behat/Testwork/ServiceContainer/Configuration/ConfigurationLoader.php
@@ -174,6 +174,21 @@ class ConfigurationLoader
$basePath = rtrim(dirname($configPath), DIRECTORY_SEPARATOR);
$config = Yaml::parse($configPath);
+
+ return $this->loadConfigs($basePath, $config, $profile);
+ }
+
+ /**
+ * Loads configs for provided config and profile.
+ *
+ * @param string $basePath
+ * @param string $config
+ * @param string $profile
+ *
+ * @return array
+ */
+ private function loadConfigs($basePath, $config, $profile)
+ {
$configs = array();
// first load default profile from current config, but only if custom profile requested
|
Simplified ConfigurationLoader even more
|
Behat_Behat
|
train
|
php
|
3ca2bc63776def7441c302125713e853dc456b0a
|
diff --git a/tasks/protractor_runner.js b/tasks/protractor_runner.js
index <HASH>..<HASH> 100644
--- a/tasks/protractor_runner.js
+++ b/tasks/protractor_runner.js
@@ -9,6 +9,7 @@
'use strict';
var util = require('util');
+var path = require('path');
module.exports = function(grunt) {
@@ -34,7 +35,11 @@ module.exports = function(grunt) {
var listArgs = ["specs"];
var boolArgs = ["includeStackTrace", "verbose"];
- var args = ['./node_modules/protractor/bin/protractor', opts.configFile];
+ // '.../node_modules/protractor/lib/protractor.js'
+ var protractorMainPath = require.resolve('protractor');
+ // '.../node_modules/protractor/bin/protractor'
+ var protractorBinPath = path.resolve(protractorMainPath, '../../bin/protractor');
+ var args = [protractorBinPath, opts.configFile];
if (opts.noColor){
args.push('--no-jasmineNodeOpts.showColors');
}
|
Fixed protractor bin path for non-local node_modules
|
teerapap_grunt-protractor-runner
|
train
|
js
|
f81e08a84cb6b24348d2bd7695ad498c72a1b8a7
|
diff --git a/packages/razzle/scripts/start.js b/packages/razzle/scripts/start.js
index <HASH>..<HASH> 100755
--- a/packages/razzle/scripts/start.js
+++ b/packages/razzle/scripts/start.js
@@ -133,6 +133,13 @@ function main() {
logger.error(err);
}
});
+
+ ['SIGINT', 'SIGTERM'].forEach(sig => {
+ process.on(sig, () => {
+ clientDevServer.close();
+ });
+ });
+
resolve();
}
);
|
fix(razzle): make sure client dev server closes
|
jaredpalmer_razzle
|
train
|
js
|
36859f85890f7b5dd51673b454251bbc4a56118e
|
diff --git a/lib/natural/normalizers/normalizer_no.js b/lib/natural/normalizers/normalizer_no.js
index <HASH>..<HASH> 100644
--- a/lib/natural/normalizers/normalizer_no.js
+++ b/lib/natural/normalizers/normalizer_no.js
@@ -47,6 +47,8 @@ var remove_diacritics = function(text) {
text = text.replace('Ó', 'o');
text = text.replace('û', 'u');
text = text.replace('Û', 'u');
+ text = text.replace('š', 's');
+ text = text.replace('Š', 'S');
return text;
};
|
Added s with caron to the norwegian string normalization.
|
NaturalNode_natural
|
train
|
js
|
2cd411d83e35435479552027eee79f91b66415ce
|
diff --git a/src/sap.uxap/test/sap/uxap/demokit/sample/ObjectPageTabNavigationMode/Component.js b/src/sap.uxap/test/sap/uxap/demokit/sample/ObjectPageTabNavigationMode/Component.js
index <HASH>..<HASH> 100644
--- a/src/sap.uxap/test/sap/uxap/demokit/sample/ObjectPageTabNavigationMode/Component.js
+++ b/src/sap.uxap/test/sap/uxap/demokit/sample/ObjectPageTabNavigationMode/Component.js
@@ -12,8 +12,8 @@ sap.ui.define(["sap/ui/core/UIComponent"], function (UIComponent) {
sample: {
stretch: true,
files: [
- "ObjectPageWithIconTabBar.view.xml",
- "ObjectPageWithIconTabBar.controller.js",
+ "ObjectPageTabNavigationMode.view.xml",
+ "ObjectPageTabNavigationMode.controller.js",
"../SharedBlocks/employment/BlockEmpDetailPart1.js",
"../SharedBlocks/employment/BlockEmpDetailPart1.view.xml",
"../SharedBlocks/employment/BlockEmpDetailPart2.js",
|
[INTERNAL][FIX] sap.uxap.ObjectPage: sample had outdated code paths
Change-Id: I<I>d<I>d<I>a2e9f0b<I>a<I>ee8e<I>f<I>b6f
|
SAP_openui5
|
train
|
js
|
895bd18e57bf78434afc2c089c2f4ccb2c49f066
|
diff --git a/.scrutinizer.yml b/.scrutinizer.yml
index <HASH>..<HASH> 100644
--- a/.scrutinizer.yml
+++ b/.scrutinizer.yml
@@ -11,7 +11,7 @@ filter:
- "tests/"
dependency_paths:
- "vendor/"
-
+
tools:
php_mess_detector: true
php_cpd:
diff --git a/src/Model/Data.php b/src/Model/Data.php
index <HASH>..<HASH> 100644
--- a/src/Model/Data.php
+++ b/src/Model/Data.php
@@ -39,7 +39,7 @@ class Data
protected $id;
/**
- * @var null|srting
+ * @var null|string
*/
protected $tag;
diff --git a/src/Model/Data/Value.php b/src/Model/Data/Value.php
index <HASH>..<HASH> 100644
--- a/src/Model/Data/Value.php
+++ b/src/Model/Data/Value.php
@@ -43,6 +43,11 @@ class Value
*/
public function getEndTime(bool $asDateTime = true)
{
- return ($asDateTime) ? \DateTime::createFromFormat(\DateTime::ISO8601, $this->endTime) : $this->endTime;
+ $endTime = \DateTime::createFromFormat(\DateTime::ISO8601, $this->endTime);
+ if ($asDateTime && $endTime instanceof \DateTime) {
+ return $endTime;
+ }
+
+ return $this->endTime;
}
}
|
[n/a] fix issues reported by scrutinier
|
ker0x_messenger
|
train
|
yml,php,php
|
4acd94782b7f9e85f71413f98394e55501fbceea
|
diff --git a/src/flask_allows/allows.py b/src/flask_allows/allows.py
index <HASH>..<HASH> 100644
--- a/src/flask_allows/allows.py
+++ b/src/flask_allows/allows.py
@@ -21,7 +21,9 @@ class Allows(object):
authorization fails.
"""
- def __init__(self, app=None, identity_loader=None, throws=Forbidden, on_fail=None):
+ def __init__(
+ self, app=None, identity_loader=None, throws=Forbidden, on_fail=None
+ ):
self._identity_loader = identity_loader
self.throws = throws
@@ -121,9 +123,13 @@ class Allows(object):
identity = identity or self._identity_loader()
if self.overrides.current is not None:
- requirements = (r for r in requirements if r not in self.overrides.current)
+ requirements = (
+ r for r in requirements if r not in self.overrides.current
+ )
- return all(_call_requirement(r, identity, request) for r in requirements)
+ return all(
+ _call_requirement(r, identity, request) for r in requirements
+ )
def clear_all_overrides(self):
"""
|
Reformat allows.py with black
|
justanr_flask-allows
|
train
|
py
|
e05a4e19822eea3fbf3aa9369bbb9ec8fb6588b1
|
diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -26,7 +26,7 @@ module.exports = function(grunt) {
},
travis: {
singleRun: true,
- browsers: ['sl_chorme', 'sl_firefox', 'sl_opera', 'sl_safari', 'sl_ie10', 'sl_iphone'],
+ browsers: ['sl_safari', 'sl_ie10', 'sl_iphone'],
// global config for SauceLabs
sauceLabs: {
username: process.env.SAUCE_USERNAME,
|
fix: left three most buggy browsers due to parallelization limit
|
flowjs_flow.js
|
train
|
js
|
f4023a778e6ae7d6a05c9cb6dd29f9859f759fa1
|
diff --git a/src/Classifiers/ObserverClassifier.php b/src/Classifiers/ObserverClassifier.php
index <HASH>..<HASH> 100644
--- a/src/Classifiers/ObserverClassifier.php
+++ b/src/Classifiers/ObserverClassifier.php
@@ -29,7 +29,10 @@ class ObserverClassifier implements Classifier
})
->collapse()
->unique()
- ->filter(function ($eventListenerSignature) use ($class) {
+ ->filter(function ($eventListener) {
+ return is_string($eventListener);
+ })
+ ->filter(function (string $eventListenerSignature) use ($class) {
return Str::contains($eventListenerSignature, $class->getName());
})
->count() > 0;
|
Ignore Closure based EventListeners
|
stefanzweifel_laravel-stats
|
train
|
php
|
aef408d972a273070bd7219ad584da7ee64a7540
|
diff --git a/Command/ClearIndexCommand.php b/Command/ClearIndexCommand.php
index <HASH>..<HASH> 100644
--- a/Command/ClearIndexCommand.php
+++ b/Command/ClearIndexCommand.php
@@ -18,7 +18,7 @@ class ClearIndexCommand extends ContainerAwareCommand
protected function execute(InputInterface $input, OutputInterface $output)
{
- $solr = $this->getContainer()->get('solr');
+ $solr = $this->getContainer()->get('solr.client.default');
try {
$solr->clearIndex();
diff --git a/Command/SynchronizeIndexCommand.php b/Command/SynchronizeIndexCommand.php
index <HASH>..<HASH> 100644
--- a/Command/SynchronizeIndexCommand.php
+++ b/Command/SynchronizeIndexCommand.php
@@ -46,7 +46,7 @@ class SynchronizeIndexCommand extends ContainerAwareCommand
return;
}
- $solr = $this->getContainer()->get('solr');
+ $solr = $this->getContainer()->get('solr.client.default');
$synchronicedEntities = 0;
$notSynchronicedEntities = 0;
|
solr service was renamed
|
floriansemm_SolrBundle
|
train
|
php,php
|
d79b5a85e1c4360a40a3436c7115c90e225b068a
|
diff --git a/lib/faraday/raise_errors.rb b/lib/faraday/raise_errors.rb
index <HASH>..<HASH> 100644
--- a/lib/faraday/raise_errors.rb
+++ b/lib/faraday/raise_errors.rb
@@ -3,7 +3,7 @@ module Faraday
def self.register_on_complete(env)
env[:response].on_complete do |response|
case response[:status].to_i
- when 400
+ when 400, 420
raise Twitter::RateLimitExceeded, "#{response[:body]['error'] if response[:body]}"
when 401
raise Twitter::Unauthorized, "#{response[:body]['error'] if response[:body]}"
|
Catch HTTP <I> rate limit exceeded responses from the Twitter Search API (kmstest)
|
sferik_twitter
|
train
|
rb
|
6010a8387dd681b4637df019a7c73c3e6c1c3f91
|
diff --git a/django_jenkins/functions.py b/django_jenkins/functions.py
index <HASH>..<HASH> 100644
--- a/django_jenkins/functions.py
+++ b/django_jenkins/functions.py
@@ -2,6 +2,15 @@
import os.path
import subprocess
+class CalledProcessError(subprocess.CalledProcessError):
+ def __init__(self, returncode, cmd, output=None):
+ self.output = output
+ super(CalledProcessError, self).__init__(returncode, cmd)
+
+ def __str__(self):
+ return "Command '%s' returned non-zero exit status %d\nOutput:\n%s" % (self.cmd, self.returncode, self.output)
+
+
def relpath(path, start=os.path.curdir):
"""
Return a relative version of a path
@@ -37,7 +46,6 @@ def check_output(*popenargs, **kwargs):
if cmd is None:
cmd = popenargs[0]
- exception = subprocess.CalledProcessError(retcode, cmd)
- exception.output = output
+ exception = CalledProcessError(retcode, cmd, output=output)
raise exception
return output
|
Improove error logging for external processes, #<I>
|
kmmbvnr_django-jenkins
|
train
|
py
|
e57c4680d489180177842bcfcf69e4dfe4e71cf4
|
diff --git a/spec/aruba/processes/spawn_process_spec.rb b/spec/aruba/processes/spawn_process_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/aruba/processes/spawn_process_spec.rb
+++ b/spec/aruba/processes/spawn_process_spec.rb
@@ -1,14 +1,12 @@
require 'spec_helper'
RSpec.describe Aruba::Processes::SpawnProcess do
- subject(:process) { described_class.new(command, exit_timeout, io_wait, working_directory, environment, main_class) }
+ subject(:process) { described_class.new(command, exit_timeout, io_wait, working_directory) }
let(:command) { 'echo "yo"' }
let(:exit_timeout) { 1 }
let(:io_wait) { 1 }
let(:working_directory) { Dir.getwd }
- let(:environment) { ENV.to_hash.dup }
- let(:main_class) { nil }
describe '#stdout' do
before(:each) { process.start }
|
Remove parameters with defaults
SpawnProcess should work without specifying these, and there are no
specs that essentially override these defaults.
|
cucumber_aruba
|
train
|
rb
|
0789ce7f5505a3d1e374f4d88f91e3950815d7c3
|
diff --git a/src/Intahwebz/Request.php b/src/Intahwebz/Request.php
index <HASH>..<HASH> 100644
--- a/src/Intahwebz/Request.php
+++ b/src/Intahwebz/Request.php
@@ -14,5 +14,14 @@ interface Request {
function getPath();
function getPort();
function getMethod();
+
+
+ /**
+ * @param $variableName
+ * @param mixed $default
+ * @param mixed $minimum
+ * @param mixed $maximum
+ * @return mixed
+ */
function getVariable($variableName, $default = false, $minimum = false, $maximum = false);
}
\ No newline at end of file
diff --git a/src/Intahwebz/Route.php b/src/Intahwebz/Route.php
index <HASH>..<HASH> 100644
--- a/src/Intahwebz/Route.php
+++ b/src/Intahwebz/Route.php
@@ -16,6 +16,9 @@ interface Route{
public function matchRequestAndStoreParams(Request $request);
public function getTemplate();
+
+ public function getMergedParameters(Request $request);
+
public function getRouteParam($name);
public function getRouteParams();
|
Added function that should be in interface.
|
Danack_intahwebz-core
|
train
|
php,php
|
e12aa89675d637b9c5d85f408f070edc0f537466
|
diff --git a/lib/image_processing/mini_magick.rb b/lib/image_processing/mini_magick.rb
index <HASH>..<HASH> 100644
--- a/lib/image_processing/mini_magick.rb
+++ b/lib/image_processing/mini_magick.rb
@@ -227,7 +227,7 @@ module ImageProcessing
# IO object that responds to `#read(length = nil, outbuf = nil)`.
def _copy_to_tempfile(file)
extension = File.extname(file.path) if file.respond_to?(:path)
- tempfile = Tempfile.new(["mini_magick", *extension], binmode: true)
+ tempfile = Tempfile.new(["mini_magick", extension.to_s], binmode: true)
IO.copy_stream(file, tempfile.path)
file.rewind
tempfile
|
Fix backward compatibility with older Rubies again
|
janko_image_processing
|
train
|
rb
|
c53dc7132a90a54cb2c5700f9efde47b4e604095
|
diff --git a/test/moTest.js b/test/moTest.js
index <HASH>..<HASH> 100644
--- a/test/moTest.js
+++ b/test/moTest.js
@@ -2,7 +2,7 @@
if ('undefined' != typeof require) {
/* Node */
var Jed = require('jed');
- var jedGettextParser = require('../jedGettextParser');
+ var jedGettextParser = require('..');
var Promise = require('promise');
var fs = require('fs');
}
|
Load library by directory.
If I understand things correctly, Node should see the package.json and
use that to load the library.
|
Ortham_jed-gettext-parser
|
train
|
js
|
458a4d1239403b62d9506a0d886c908dc93657a5
|
diff --git a/src/Lodash.php b/src/Lodash.php
index <HASH>..<HASH> 100644
--- a/src/Lodash.php
+++ b/src/Lodash.php
@@ -43,4 +43,16 @@ final class _
'_\escape' => '__e',
],
];
+
+ /**
+ * @param string $method
+ * @param array $args
+ *
+ * @return mixed
+ * @throws Exception
+ */
+ public static function __callStatic(string $method, array $args)
+ {
+ return ("_\\$method")(...$args);
+ }
}
\ No newline at end of file
|
Add method to _ class to call all lodash functions
|
lodash-php_lodash-php
|
train
|
php
|
b57df64656838869c9e9ebdb23eaa285a482343c
|
diff --git a/asv/commands/publish.py b/asv/commands/publish.py
index <HASH>..<HASH> 100644
--- a/asv/commands/publish.py
+++ b/asv/commands/publish.py
@@ -79,10 +79,6 @@ class Publish(object):
params[key].add(val)
for key, val in six.iteritems(results.results):
- for param in six.iterkeys(params):
- if param not in results.params:
- params[param].add(None)
-
benchmark_names.add(key)
graph = Graph(key, results.params, params)
if graph.path in graphs:
|
Don't include "none" dependencies
|
airspeed-velocity_asv
|
train
|
py
|
bf4858ccf59076fc2c6eb15c2b6f97985f6ca54c
|
diff --git a/tests/basic_tests.py b/tests/basic_tests.py
index <HASH>..<HASH> 100644
--- a/tests/basic_tests.py
+++ b/tests/basic_tests.py
@@ -24,6 +24,19 @@ def test_binary_classification():
+# def test_multilabel_classification():
+# df_twitter_train, df_twitter_test = utils.get_twitter_sentiment_multilabel_classification_dataset()
+# ml_predictor = utils.train_basic_multilabel_classifier(df_twitter_train)
+
+# test_score = ml_predictor.score(df_twitter_test, df_twitter_test.airline_sentiment, verbose=0)
+# # Right now we're getting a score of -.205
+# # Make sure our score is good, but not unreasonably good
+# print('test_score')
+# print(test_score)
+# assert 0.67 < test_score < 0.75
+
+
+
def test_regression():
df_boston_train, df_boston_test = utils.get_boston_regression_dataset()
|
adds code for basic test for multi-label, but runs into XGB sparse issue
|
ClimbsRocks_auto_ml
|
train
|
py
|
c598682d2e3a9654f0a0f18393a113d859ff1dc6
|
diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go
index <HASH>..<HASH> 100644
--- a/pkg/features/kube_features.go
+++ b/pkg/features/kube_features.go
@@ -192,7 +192,7 @@ const (
BlockVolume utilfeature.Feature = "BlockVolume"
// owner: @pospispa
- // beta: v1.10
+ // GA: v1.11
//
// Postpone deletion of a PV or a PVC when they are being used
StorageObjectInUseProtection utilfeature.Feature = "StorageObjectInUseProtection"
@@ -307,7 +307,7 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
CSIPersistentVolume: {Default: true, PreRelease: utilfeature.Beta},
CustomPodDNS: {Default: true, PreRelease: utilfeature.Beta},
BlockVolume: {Default: false, PreRelease: utilfeature.Alpha},
- StorageObjectInUseProtection: {Default: true, PreRelease: utilfeature.Beta},
+ StorageObjectInUseProtection: {Default: true, PreRelease: utilfeature.GA},
ResourceLimitsPriorityFunction: {Default: false, PreRelease: utilfeature.Alpha},
SupportIPVSProxyMode: {Default: true, PreRelease: utilfeature.Beta},
SupportPodPidsLimit: {Default: false, PreRelease: utilfeature.Alpha},
|
Bring StorageObjectInUseProtection feature to GA
StorageObjectInUseProtection is Beta in K8s <I>.
It's brought to GA in K8s <I>.
|
kubernetes_kubernetes
|
train
|
go
|
e7e88ba4e395ca6d828ce4d247c3e1f918c5da4b
|
diff --git a/src/main/java/org/elasticsearch/hadoop/hive/FieldAlias.java b/src/main/java/org/elasticsearch/hadoop/hive/FieldAlias.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/elasticsearch/hadoop/hive/FieldAlias.java
+++ b/src/main/java/org/elasticsearch/hadoop/hive/FieldAlias.java
@@ -19,7 +19,8 @@ import java.util.LinkedHashMap;
import java.util.Map;
/**
- * Basic class for field aliasing since Hive column names are restricted to: [0-9a-z_] and cannot start with numbers. Without any mapping, the alias will convert all hive columns to lower case.n
+ * Basic class for field aliasing since Hive column names are restricted to: [0-9a-z_] and cannot start with numbers. Without any mapping, the alias will convert all hive columns to lower case.
+ * Note that hive does this automatically for top-level fields but not for nested ones.
*/
class FieldAlias {
|
add more comments to Hive Field alias
|
elastic_elasticsearch-hadoop
|
train
|
java
|
200c2f96e6545d6f89b3111ff71af814a1c8c71c
|
diff --git a/lib/incremental-typescript-compiler.js b/lib/incremental-typescript-compiler.js
index <HASH>..<HASH> 100644
--- a/lib/incremental-typescript-compiler.js
+++ b/lib/incremental-typescript-compiler.js
@@ -64,7 +64,8 @@ module.exports = class IncrementalTypescriptCompiler {
});
});
- return new MergeTrees(addonAppTrees, { overwrite: true });
+ let tree = new MergeTrees(addonAppTrees, { overwrite: true });
+ return new Funnel(tree, { srcDir: 'app' });
}
treeForAddons() {
|
Fix in-repo addons' app trees
|
typed-ember_ember-cli-typescript
|
train
|
js
|
327d736b193c7ce3b46406cd1519cafd39424659
|
diff --git a/ironman/communicator.py b/ironman/communicator.py
index <HASH>..<HASH> 100644
--- a/ironman/communicator.py
+++ b/ironman/communicator.py
@@ -85,7 +85,7 @@ class SimpleIO(object):
def read(self, offset, size):
with open(self.__f__, 'rb') as f:
f.seek(offset)
- return f.read(size)
+ return f.read(4*size)
def write(self, offset, data):
with open(self.__f__, 'r+b') as f:
@@ -98,7 +98,7 @@ class ComplexIO(object):
def read(self, offset, size):
with open(self.__f__.get(offset), 'rb') as f:
- return f.read(size)
+ return f.read(4*size)
def write(self, offset, data):
with open(self.__f__.get(offset), 'r+b') as f:
|
this fixes a bug in the communicator
|
kratsg_ironman
|
train
|
py
|
c06ef88b5381b111250bf2557eb42dc345a0e32f
|
diff --git a/lib/k8s/client/version.rb b/lib/k8s/client/version.rb
index <HASH>..<HASH> 100644
--- a/lib/k8s/client/version.rb
+++ b/lib/k8s/client/version.rb
@@ -3,6 +3,6 @@
module K8s
class Client
# Updated on releases using semver.
- VERSION = "0.5.0"
+ VERSION = "0.6.0"
end
end
|
Release <I> (#<I>)
|
kontena_k8s-client
|
train
|
rb
|
63e102aaee2e05755cf8ff69cc0e003f26e5000d
|
diff --git a/main.go b/main.go
index <HASH>..<HASH> 100644
--- a/main.go
+++ b/main.go
@@ -25,12 +25,12 @@ var commands = []*Command{
cmdSecurity,
cmdVersion,
cmdUpdate,
- cmdHelp,
cmdPush,
cmdAura,
cmdPassword,
cmdNotifySet,
cmdLimits,
+ cmdHelp,
}
func main() {
|
Help command moved
Dropped it to the end of the list so it’s not lost in the middle
|
ForceCLI_force
|
train
|
go
|
f742bbe9478f94355ec12a7f3e13ccf0c75574b1
|
diff --git a/backbone.js b/backbone.js
index <HASH>..<HASH> 100644
--- a/backbone.js
+++ b/backbone.js
@@ -756,7 +756,7 @@
// Get the cross-browser normalized URL fragment, either from the URL,
// the hash, or the override.
getFragment : function(fragment, forcePushState) {
- if (!fragment) {
+ if (fragment == null) {
if (this._hasPushState || forcePushState) {
fragment = window.location.pathname;
var search = window.location.search;
@@ -820,7 +820,7 @@
// calls `loadUrl`, normalizing across the hidden iframe.
checkUrl : function(e) {
var current = this.getFragment();
- if (current == this.fragment && this.iframe) current = this.getFragment(this.iframe.location);
+ if (current == this.fragment && this.iframe) current = this.getFragment(this.iframe.location.hash);
if (current == this.fragment || current == decodeURIComponent(this.fragment)) return false;
if (this.iframe) this.saveLocation(current);
this.loadUrl() || this.loadUrl(window.location.hash);
|
fixing IE support for <I>
|
jashkenas_backbone
|
train
|
js
|
6457180a96681ba11345c4366f49700cabd74b3c
|
diff --git a/fastlane/lib/fastlane/actions/gradle.rb b/fastlane/lib/fastlane/actions/gradle.rb
index <HASH>..<HASH> 100644
--- a/fastlane/lib/fastlane/actions/gradle.rb
+++ b/fastlane/lib/fastlane/actions/gradle.rb
@@ -258,8 +258,21 @@ module Fastlane
# ...
properties: {
- "versionCode" => 100,
- "versionName" => "1.0.0",
+ "exampleNumber" => 100,
+ "exampleString" => "1.0.0",
+ # ...
+ }
+ )
+ ```
+
+ You can use this to change the version code and name of your app:
+ ```ruby
+ gradle(
+ # ...
+
+ properties: {
+ "android.injected.version.code" => 100,
+ "android.injected.version.name" => "1.0.0",
# ...
}
)
|
[docs] Improve gradle action explaining android.injected.version.code and name can be used to change versionCode and versionName. (#<I>)
|
fastlane_fastlane
|
train
|
rb
|
6431445846846f013be60a8ea6e48b9fcfe19b2d
|
diff --git a/lib/devise/parameter_sanitizer.rb b/lib/devise/parameter_sanitizer.rb
index <HASH>..<HASH> 100644
--- a/lib/devise/parameter_sanitizer.rb
+++ b/lib/devise/parameter_sanitizer.rb
@@ -71,7 +71,7 @@ module Devise
# DEPRECATED: Remove this branch on Devise 4.1.
if respond_to?(action, true)
deprecate_instance_method_sanitization(action)
- return send(action)
+ return cast_to_hash send(action)
end
if permissions.respond_to?(:call)
|
Cast the result of deperecated sanitization calls to a HWIA as well.
|
plataformatec_devise
|
train
|
rb
|
f0f1f7589a4cae3d1660484be52f8e8608e95992
|
diff --git a/pushbullet.go b/pushbullet.go
index <HASH>..<HASH> 100644
--- a/pushbullet.go
+++ b/pushbullet.go
@@ -27,7 +27,12 @@ type Client struct {
// New creates a new client with your personal API key.
func New(apikey string) *Client {
- return &Client{apikey, &http.Client{}}
+ return &Client{apikey, http.DefaultClient}
+}
+
+// New creates a new client with your personal API key and the given http Client
+func NewWithClient(apikey string, client *http.Client) *Client {
+ return &Client{apikey, client}
}
// A Device represents an Android Device as reported by PushBullet.
|
NewWithClient: allow injecting other http.Clients
|
xconstruct_go-pushbullet
|
train
|
go
|
94efb7d42916e8c4ef7b6520f8b0296a41725e45
|
diff --git a/common/src/main/java/com/turn/ttorrent/common/protocol/udp/UDPAnnounceRequestMessage.java b/common/src/main/java/com/turn/ttorrent/common/protocol/udp/UDPAnnounceRequestMessage.java
index <HASH>..<HASH> 100644
--- a/common/src/main/java/com/turn/ttorrent/common/protocol/udp/UDPAnnounceRequestMessage.java
+++ b/common/src/main/java/com/turn/ttorrent/common/protocol/udp/UDPAnnounceRequestMessage.java
@@ -235,8 +235,8 @@ public class UDPAnnounceRequestMessage
data.put(infoHash);
data.put(peerId);
data.putLong(downloaded);
- data.putLong(uploaded);
data.putLong(left);
+ data.putLong(uploaded);
data.putInt(event.getId());
data.put(ip.getAddress());
data.putInt(key);
|
merged pull request #<I>
|
mpetazzoni_ttorrent
|
train
|
java
|
c5d2ae47a108c3fb47ac5588d21e4c7aa14be767
|
diff --git a/liquibase-core/src/main/java/liquibase/diff/output/changelog/core/ChangedColumnChangeGenerator.java b/liquibase-core/src/main/java/liquibase/diff/output/changelog/core/ChangedColumnChangeGenerator.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/main/java/liquibase/diff/output/changelog/core/ChangedColumnChangeGenerator.java
+++ b/liquibase-core/src/main/java/liquibase/diff/output/changelog/core/ChangedColumnChangeGenerator.java
@@ -81,6 +81,11 @@ public class ChangedColumnChangeGenerator extends AbstractChangeGenerator implem
change.setColumnName(column.getName());
change.setRemarks(column.getRemarks());
+ LiquibaseDataType columnDataType = DataTypeFactory.getInstance().from(column.getType(), comparisonDatabase);
+ if (columnDataType != null) {
+ change.setColumnDataType(columnDataType.toString());
+ }
+
changes.add(change);
}
|
Issue #<I>: Fix for Null Pointer Exception During Diff Change Log Generation
|
liquibase_liquibase
|
train
|
java
|
e8b4247108bb238c63d927fd4995d8f125234d5c
|
diff --git a/lxd/networks.go b/lxd/networks.go
index <HASH>..<HASH> 100644
--- a/lxd/networks.go
+++ b/lxd/networks.go
@@ -700,7 +700,16 @@ func networkLeasesGet(d *Daemon, r *http.Request) response.Response {
// Go through all its devices (including profiles
for k, d := range inst.ExpandedDevices() {
// Skip uninteresting entries
- if d["type"] != "nic" || d.NICType() != "bridged" || d["parent"] != name {
+ if d["type"] != "nic" || d.NICType() != "bridged" {
+ continue
+ }
+
+ // Temporarily populate parent from network setting if used.
+ if d["network"] != "" {
+ d["parent"] = d["network"]
+ }
+
+ if d["parent"] != name {
continue
}
|
lxd/networks: Fix network leases list for instances using "network" option
|
lxc_lxd
|
train
|
go
|
274e748109b635bccb774eca099899afc2206934
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -149,6 +149,10 @@ Modularity.prototype.require = function (parent, dependency, ancestors, callback
var cache_key = path.join(dependency, file)
, file_path = path.join(module_path, file)
, file_module = require(file_path);
+ if (cache_key in self.cache) {
+ module[file] = self.cache[cache_key];
+ return next();
+ }
self.loadModule(cache_key, dir_ancestors, file_module, file_path, function (err) {
if (err) {
return callback(err);
diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -164,5 +164,17 @@ describe('Modularity', function () {
});
});
+ it('should let you inject modules from a directory', function (done) {
+ var inject = {};
+ inject['foo/qux'] = 'injected';
+ modularity
+ .include(path.join(__dirname, 'fixtures', '10'))
+ .inject(inject)
+ .load(function (foo) {
+ assert.equal(foo.bar, 'barinjected');
+ done();
+ });
+ });
+
});
|
Ensure directory modules check for an injected version first
|
sydneystockholm_modularity
|
train
|
js,js
|
ab80fa8283dc938e354d094e34fb0e86b5316ea4
|
diff --git a/kafka/producer.py b/kafka/producer.py
index <HASH>..<HASH> 100644
--- a/kafka/producer.py
+++ b/kafka/producer.py
@@ -180,7 +180,7 @@ class Producer(object):
# Raise TypeError if any message is not encoded as bytes
if any(not isinstance(m, six.binary_type) for m in msg):
- raise TypeError("all produce message payloads must be type str")
+ raise TypeError("all produce message payloads must be type bytes")
if self.async:
for m in msg:
diff --git a/test/testutil.py b/test/testutil.py
index <HASH>..<HASH> 100644
--- a/test/testutil.py
+++ b/test/testutil.py
@@ -88,7 +88,7 @@ class KafkaIntegrationTestCase(unittest.TestCase):
if s not in self._messages:
self._messages[s] = '%s-%s-%s' % (s, self.id(), str(uuid.uuid4()))
- return self._messages[s]
+ return self._messages[s].encode('utf-8')
class Timer(object):
def __enter__(self):
|
Bytes in self.msg()
|
dpkp_kafka-python
|
train
|
py,py
|
7f3bdec250fef0a4415d9f25af9823354f5e3fdb
|
diff --git a/src/__tests__/fixtures/eval-macro.js b/src/__tests__/fixtures/eval-macro.js
index <HASH>..<HASH> 100644
--- a/src/__tests__/fixtures/eval-macro.js
+++ b/src/__tests__/fixtures/eval-macro.js
@@ -1 +1 @@
-module.exports = require('./eval.macro.js')
+module.exports = require('./eval.macro')
|
chore: fix build
Probably the new kcd-scripts introduced new lint rule or something. Lack
of lockfile made build less reproducible.
|
kentcdodds_babel-plugin-macros
|
train
|
js
|
35017d8575078e84d7af6ef003b027ae6c3c7983
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -124,8 +124,8 @@ def get_version_info():
vinfo = _version_helper.generate_git_version_info()
except:
vinfo = vdummy()
- vinfo.version = '1.16.dev5'
- vinfo.release = 'False'
+ vinfo.version = '1.16.5'
+ vinfo.release = 'True'
with open('pycbc/version.py', 'w') as f:
f.write("# coding: utf-8\n")
|
prep for release <I> (#<I>)
|
gwastro_pycbc
|
train
|
py
|
59965923ee442be8870b95f2dd29fc6ba6782dbd
|
diff --git a/instant/templates/instant/channels/client.js b/instant/templates/instant/channels/client.js
index <HASH>..<HASH> 100644
--- a/instant/templates/instant/channels/client.js
+++ b/instant/templates/instant/channels/client.js
@@ -23,7 +23,11 @@ var {{ chan_name }}_callbacks = {
"Data: ", JSON.stringify(data, null, 2)
);
}
- handlers_for_{{ chan_name }}(event_class, channel, message, data, site, uid);
+ {% if request.path|slice:'8' == "/instant" %}
+ handlers_for_event(event_class, channel, message, data, site, uid);
+ {% else %}
+ handlers_for_{{ chan_name }}(event_class, channel, message, data, site, uid);
+ {% endif %}
},
{% include "instant/js/join_events.js" %}
}
|
Disable default handlers for user declared channels in the frontend
|
synw_django-instant
|
train
|
js
|
9eca514f37560d94b6e8c10479314dd363c6c724
|
diff --git a/phoebe/units/conversions.py b/phoebe/units/conversions.py
index <HASH>..<HASH> 100644
--- a/phoebe/units/conversions.py
+++ b/phoebe/units/conversions.py
@@ -511,8 +511,11 @@ import datetime
#-- optional libraries: WARNING: when these modules are not installed, the
# module's use is restricted
-try: import ephem
-except ImportError: print("Unable to load pyephem, stellar coordinate transformations unavailable")
+try:
+ import ephem
+except ImportError:
+ pass
+ #print("Unable to load pyephem, stellar coordinate transformations unavailable")
#-- from IVS repository
from phoebe.units import constants
|
removed pyephem warning when importing conversions
|
phoebe-project_phoebe2
|
train
|
py
|
29e366253f7bd9fad4aa7447c15ca13e1a8d311a
|
diff --git a/aiohttp/streams.py b/aiohttp/streams.py
index <HASH>..<HASH> 100644
--- a/aiohttp/streams.py
+++ b/aiohttp/streams.py
@@ -37,9 +37,16 @@ class AsyncStreamIterator:
return rv
-class ChunkTupleAsyncStreamIterator(AsyncStreamIterator):
- async def __anext__(self) -> bytes:
- rv = await self.read_func()
+class ChunkTupleAsyncStreamIterator:
+
+ def __init__(self, stream: 'StreamReader') -> None:
+ self._stream = stream
+
+ def __aiter__(self) -> 'ChunkTupleAsyncStreamIterator':
+ return self
+
+ async def __anext__(self) -> Tuple[bytes, bool]:
+ rv = await self._stream.readchunk()
if rv == (b'', False):
raise StopAsyncIteration # NOQA
return rv
@@ -72,7 +79,7 @@ class AsyncStreamReaderMixin:
Python-3.5 available for Python 3.5+ only
"""
- return ChunkTupleAsyncStreamIterator(self.readchunk) # type: ignore
+ return ChunkTupleAsyncStreamIterator(self) # type: ignore
class StreamReader(AsyncStreamReaderMixin):
|
fix iter_chunks type hint (#<I>) (#<I>)
|
aio-libs_aiohttp
|
train
|
py
|
d3cae937583492d6e4d6dfef2841984e92a94505
|
diff --git a/update-server/otupdate/balena/__main__.py b/update-server/otupdate/balena/__main__.py
index <HASH>..<HASH> 100644
--- a/update-server/otupdate/balena/__main__.py
+++ b/update-server/otupdate/balena/__main__.py
@@ -14,8 +14,6 @@ def main():
parser.add_argument('--host', dest='host', type=str, default='127.0.0.1')
parser.add_argument('--test', action='store_true')
parser.add_argument('--debug', action='store_true')
- parser.add_argument('--with-migration',
- dest='with_migration', action='store_true')
args = parser.parse_args()
if sys.platform == 'win32':
@@ -59,5 +57,5 @@ def main():
update_package=update_package,
smoothie_version=smoothie_version,
test=args.test,
- with_migration=args.with_migration)
+ with_migration=True)
web.run_app(app, host=args.host, port=args.port)
|
feat(update-server): Default buildroot migration to available (#<I>)
The buildroot migration process is no longer gated behind a feature flag.
|
Opentrons_opentrons
|
train
|
py
|
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.