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
|
---|---|---|---|---|---|
c623ff2fe576e0d0df78ab628fe06eff8ac0cd43
|
diff --git a/pylibdmtx/pylibdmtx.py b/pylibdmtx/pylibdmtx.py
index <HASH>..<HASH> 100644
--- a/pylibdmtx/pylibdmtx.py
+++ b/pylibdmtx/pylibdmtx.py
@@ -246,7 +246,7 @@ def decode(image, timeout=None, gap_size=None, shrink=1, shape=None,
if res:
results.append(res)
- # Stop if we've reached maximium count
+ # Stop if we've reached maximum count
if max_count and len(results) == max_count:
break
|
[#<I>] Fix typo in comment
|
NaturalHistoryMuseum_pylibdmtx
|
train
|
py
|
78d40761d4ae2da88e7ed7ab7084b5e8c2c7c9e9
|
diff --git a/lib/vagrant-dns/command.rb b/lib/vagrant-dns/command.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant-dns/command.rb
+++ b/lib/vagrant-dns/command.rb
@@ -1,6 +1,6 @@
require 'optparse'
require 'daemons'
-require 'rbconfig'
+require 'vagrant'
module VagrantDNS
@@ -68,7 +68,7 @@ module VagrantDNS
protected
def manage_installation(vms, options)
- if RbConfig::CONFIG["host_os"].match /darwin/
+ if Vagrant::Util::Platform.darwin?
installer = VagrantDNS::Installers::Mac.new(tmp_path)
if options[:install]
|
Use the platform abstraction already present in Vagrant
|
BerlinVagrant_vagrant-dns
|
train
|
rb
|
6648babdedb8cb9494dec69d2f7efac3da1d239c
|
diff --git a/railties/lib/rails/commands.rb b/railties/lib/rails/commands.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/rails/commands.rb
+++ b/railties/lib/rails/commands.rb
@@ -11,7 +11,17 @@ command = ARGV.shift
command = aliases[command] || command
case command
-when 'generate', 'destroy', 'plugin', 'benchmarker', 'profiler'
+when 'generate', 'destroy', 'plugin'
+ require APP_PATH
+ Rails.application.require_environment!
+
+ if defined?(ENGINE_PATH)
+ engine = Rails.application.railties.engines.find { |r| r.root.to_s == ENGINE_PATH }
+ Rails.application = engine
+ end
+ require "rails/commands/#{command}"
+
+when 'benchmarker', 'profiler'
require APP_PATH
Rails.application.require_environment!
require "rails/commands/#{command}"
|
Allow running generators for Engine with usage of other application.
After that commit, developers can set ENGINE_PATH in ENGINE/scripts/rails
file and load application's ./script/rails (most of the time it will be
dummy application used for testing). When running ./script/rails g it will
use application to boot up, but then it will use Engine's root and
configuration for generators.
|
rails_rails
|
train
|
rb
|
762ffbe764b6c2eaf52c638ee528ccca4f38854a
|
diff --git a/lib/solargraph/language_server/message/text_document/signature_help.rb b/lib/solargraph/language_server/message/text_document/signature_help.rb
index <HASH>..<HASH> 100644
--- a/lib/solargraph/language_server/message/text_document/signature_help.rb
+++ b/lib/solargraph/language_server/message/text_document/signature_help.rb
@@ -12,7 +12,7 @@ module Solargraph
sugg.each do |s|
info.push({
label: s.label + '(' + s.arguments.join(', ') + ')',
- documentation: s.documentation
+ documentation: ReverseMarkdown.convert(s.documentation)
})
end
set_result({
|
Convert signature documentation to markdown.
|
castwide_solargraph
|
train
|
rb
|
b29c3220c7d0130f9cadd9b447360435b301a7cd
|
diff --git a/lib/database_consistency/checkers/association_checkers/missing_index_checker.rb b/lib/database_consistency/checkers/association_checkers/missing_index_checker.rb
index <HASH>..<HASH> 100644
--- a/lib/database_consistency/checkers/association_checkers/missing_index_checker.rb
+++ b/lib/database_consistency/checkers/association_checkers/missing_index_checker.rb
@@ -64,7 +64,7 @@ module DatabaseConsistency
def index
@index ||= association.klass.connection.indexes(association.klass.table_name).find do |index|
- index_keys(index, limit: 2) == association_keys
+ index_keys(index, limit: association_keys.size) == association_keys
end
end
|
Fixes (#<I>)
|
djezzzl_database_consistency
|
train
|
rb
|
671fc724e16c0649153b2419dd43596a209c7d62
|
diff --git a/client/lib/users/store.js b/client/lib/users/store.js
index <HASH>..<HASH> 100644
--- a/client/lib/users/store.js
+++ b/client/lib/users/store.js
@@ -115,7 +115,7 @@ function deleteUserFromSite( siteId, userId ) {
function deleteUserFromNamespaces( siteId, userId ) {
Object.keys( _userIDsByNamespace ).forEach( function( namespace ) {
if ( endsWith( namespace, 'siteId=' + siteId ) && _userIDsByNamespace[ namespace ].has( userId ) ) {
- delete _userIDsByNamespace[ namespace ][ userId ];
+ _userIDsByNamespace[ namespace ].delete( userId );
}
} );
}
|
Users: Change on deletion sentence in /lib/users/store
The object _userIDsByNamespace has a Set structure by namespace, so the correct way to remove an entry from that set is with the delete method rather than the delete expression.
```js
delete _userIDsByNamespace[ namespace ][ userId ];
// to
_userIDsByNamespace[ namespace ].delete( userId );
```
|
Automattic_wp-calypso
|
train
|
js
|
7209dd27af052fead65d298c391df27d8f3dcab8
|
diff --git a/launch_control/tests/sample.py b/launch_control/tests/sample.py
index <HASH>..<HASH> 100644
--- a/launch_control/tests/sample.py
+++ b/launch_control/tests/sample.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
"""
Test cases for launch_control.sample module
"""
|
Remove obsolete shebang from sample.py
|
zyga_json-schema-validator
|
train
|
py
|
a004c016fea596703c3886363d48a342ab0a268a
|
diff --git a/lib/dev_training_bot/services/topics_service.rb b/lib/dev_training_bot/services/topics_service.rb
index <HASH>..<HASH> 100644
--- a/lib/dev_training_bot/services/topics_service.rb
+++ b/lib/dev_training_bot/services/topics_service.rb
@@ -3,7 +3,7 @@ class TopicsService
@drive_service = drive_service
end
- def to_s
+ def to_poll
"\"#{topics.join('" "')}\""
end
diff --git a/spec/dev_training_bot/services/topics_service_spec.rb b/spec/dev_training_bot/services/topics_service_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/dev_training_bot/services/topics_service_spec.rb
+++ b/spec/dev_training_bot/services/topics_service_spec.rb
@@ -21,10 +21,10 @@ describe TopicsService do
end
end
- describe '#to_s' do
+ describe '#to_poll' do
it 'returns the topics in the poll format' do
allow(subject).to receive(:topics).and_return(['first item', 'second item'])
- expect(subject.to_s).to eq '"first item" "second item"'
+ expect(subject.to_poll).to eq '"first item" "second item"'
end
end
end
|
Rename TopicService#to_s to #to_poll
TopicService#to_s seemed a bit too implicit for my taste
|
iovis9_dev_training_bot
|
train
|
rb,rb
|
cc7b81e45166d9bda33508930b14d5cf12ade286
|
diff --git a/python_cowbull_game/GameObject.py b/python_cowbull_game/GameObject.py
index <HASH>..<HASH> 100644
--- a/python_cowbull_game/GameObject.py
+++ b/python_cowbull_game/GameObject.py
@@ -13,7 +13,7 @@ class GameObject(object):
_guesses_made = None
_last_guess = None
- game_modes = ["easy", "normal", "hard", "crazy"]
+ game_modes = ["easy", "normal", "hard"]
game_states = ["won", "lost", "playing"]
schema = {
@@ -43,15 +43,13 @@ class GameObject(object):
digits_used = {
'easy': 3,
'normal': 4,
- 'hard': 6,
- 'crazy': 10
+ 'hard': 6
}
guesses_allowed = {
'easy': 15,
'normal': 10,
- 'hard': 6,
- 'crazy': 10
+ 'hard': 6
}
def __init__(self):
|
Upgrade to <I> to correctly support inheritance.
|
dsandersAzure_python_cowbull_game
|
train
|
py
|
18f70f07ec87eb652f0d12a2ff78fbd258dc3b61
|
diff --git a/Classes/Core/Runtime/FormRuntime.php b/Classes/Core/Runtime/FormRuntime.php
index <HASH>..<HASH> 100644
--- a/Classes/Core/Runtime/FormRuntime.php
+++ b/Classes/Core/Runtime/FormRuntime.php
@@ -227,6 +227,7 @@ class FormRuntime implements \TYPO3\Form\Core\Model\Renderable\RootRenderableInt
$result = $this->mapAndValidatePage($this->lastDisplayedPage);
if ($result->hasErrors()) {
$this->currentPage = $this->lastDisplayedPage;
+ $this->request->setArgument('__submittedArguments', $this->request->getArguments());
$this->request->setArgument('__submittedArgumentValidationResults', $result);
}
}
|
[BUGFIX] Elements are not prefilled when re-displayed
With the adjustments to the HTTP changes in the FLOW3 package
we forgot to set the "__submittedArguments" request argument
in FormRuntime::processSubmittedFormValues().
Change-Id: I2a<I>e<I>d4a<I>b<I>ef<I>e<I>b3fff<I>a<I>d<I>
|
neos_form
|
train
|
php
|
47a8c734ec9dc163ce4fd6a648ede34bbc97eb3d
|
diff --git a/estnltk/taggers/morph_analysis/postanalysis_tagger.py b/estnltk/taggers/morph_analysis/postanalysis_tagger.py
index <HASH>..<HASH> 100644
--- a/estnltk/taggers/morph_analysis/postanalysis_tagger.py
+++ b/estnltk/taggers/morph_analysis/postanalysis_tagger.py
@@ -454,6 +454,7 @@ class PostMorphAnalysisTagger(Retagger):
# Rewrite spans of the old layer
morph_span_id = 0
morph_spans = layers[self.output_layer].spans
+ words_layer = layers[self.input_layers[1]]
while morph_span_id < len(morph_spans):
# 0) Convert SpanList to list of Span-s
morph_annotations = morph_spans[morph_span_id].annotations
@@ -463,7 +464,7 @@ class PostMorphAnalysisTagger(Retagger):
morph_annotations = _remove_duplicate_morph_spans(morph_annotations)
# A.2) Check for empty spans
- word = morph_annotations[0].span.parent
+ word = words_layer[morph_spans[morph_span_id].base_span]
is_empty = _is_empty_annotation(morph_annotations[0])
if is_empty:
empty_morph_record = \
|
get the word span that corresponds to the morph span from the input layers without using the parent attribute of the morph span.
|
estnltk_estnltk
|
train
|
py
|
6589f30174a4d7673d5b8095a3f94d5bcb280d47
|
diff --git a/test/e2e/latency.go b/test/e2e/latency.go
index <HASH>..<HASH> 100644
--- a/test/e2e/latency.go
+++ b/test/e2e/latency.go
@@ -39,7 +39,7 @@ import (
. "github.com/onsi/gomega"
)
-var _ = Describe("[Performance] Latency [Skipped]", func() {
+var _ = Describe("Latency [Skipped]", func() {
var c *client.Client
var nodeCount int
var additionalPodsPrefix string
|
Do not run Latency test as part of scalability suite
|
kubernetes_kubernetes
|
train
|
go
|
f1a52c93cfc172e8e546b98e340daaacd94265a8
|
diff --git a/tools/dbmaint.py b/tools/dbmaint.py
index <HASH>..<HASH> 100755
--- a/tools/dbmaint.py
+++ b/tools/dbmaint.py
@@ -29,8 +29,6 @@ migration.
-n | --dryrun : don't do anything just show what needs done
-p | --path P : path to schema upgrade files [default: db/schema/upgrades]
-U | --user U : database user to use [default: postgres]
-
-TODO: extend the tool to perform upgrades across versions.
"""
import getopt
|
Remove TODO now that it's done.
Former-commit-id: a<I>b<I>dd<I>cc<I>ea<I>e5e<I>f<I>c4d<I>f<I>
|
gem_oq-engine
|
train
|
py
|
71bb19920ebe508698e35b16e7678dbd62672241
|
diff --git a/lib/knife-attribute/version.rb b/lib/knife-attribute/version.rb
index <HASH>..<HASH> 100644
--- a/lib/knife-attribute/version.rb
+++ b/lib/knife-attribute/version.rb
@@ -1,3 +1,3 @@
module KnifeAttribute
- VERSION = "0.1.1"
+ VERSION = "0.1.2"
end
|
Bump to version <I>
|
pdf_knife-attribute
|
train
|
rb
|
e1edb1b3a155bfe18e18cd82d059241425792733
|
diff --git a/media/boom/js/boom.page.js b/media/boom/js/boom.page.js
index <HASH>..<HASH> 100755
--- a/media/boom/js/boom.page.js
+++ b/media/boom/js/boom.page.js
@@ -1459,9 +1459,10 @@ $.extend($.boom.page, {
/** @function */
edit: function( event ){
+ url = '/cms/page/version/feature/' + $.boom.page.config.id;
$.boom.dialog.open({
- url: '/cms/page/version/feature/' + $.boom.page.config.id + '?vid=' + $.boom.page.config.vid,
+ url: url + '?vid=' + $.boom.page.config.vid,
event: event,
title: 'Page feature image',
width: 300,
@@ -1475,7 +1476,7 @@ $.extend($.boom.page, {
function(){
$.boom.page.settings.save(
- '/cms/page/settings/feature/' + $.boom.page.config.id,
+ url,
{feature_image_id : 0},
"Page feature image removed."
);
@@ -1487,7 +1488,7 @@ $.extend($.boom.page, {
Save: function(){
$.boom.page.settings.save(
- '/cms/page/settings/feature/' + $.boom.page.config.id,
+ url,
$("#boom-form-pagesettings-featureimage").serialize(),
"Page feature image saved."
);
|
Fixed feature image change being submitted to wrong URL by removing duplication of controller url in JS
|
boomcms_boom-core
|
train
|
js
|
25dfc2ce97b8a2da230c367e2a24f2a27232e20e
|
diff --git a/ballet/project.py b/ballet/project.py
index <HASH>..<HASH> 100644
--- a/ballet/project.py
+++ b/ballet/project.py
@@ -6,6 +6,7 @@ import git
from dynaconf import LazySettings
from funcy import cached_property, fallback, re_find
+from ballet.compat import safepath
from ballet.exc import ConfigurationError
from ballet.util import needs_path, raiseifnone
from ballet.util.ci import get_travis_branch, get_travis_pr_num
@@ -36,8 +37,8 @@ def load_config_at_path(path):
if path.exists() and path.is_file():
options = DYNACONF_OPTIONS.copy()
options.update({
- 'ROOT_PATH_FOR_DYNACONF': path.parent,
- 'SETTINGS_FILE_FOR_DYNACONF': path.name,
+ 'ROOT_PATH_FOR_DYNACONF': safepath(path.parent),
+ 'SETTINGS_FILE_FOR_DYNACONF': safepath(path.name),
})
return LazySettings(**options)
else:
|
Fix py<I> path issue
Yet again
|
HDI-Project_ballet
|
train
|
py
|
6d5a68bbc4553cefc080ac16a3347ed747b301ef
|
diff --git a/pyqrcode/__init__.py b/pyqrcode/__init__.py
index <HASH>..<HASH> 100644
--- a/pyqrcode/__init__.py
+++ b/pyqrcode/__init__.py
@@ -43,8 +43,6 @@ Examples:
#Imports required for 2.7 support
from __future__ import absolute_import, division, print_function, with_statement, unicode_literals
-import io
-import base64
import pyqrcode.tables
import pyqrcode.builder as builder
@@ -502,6 +500,9 @@ class QRCode:
>>> image_as_str = code.png_as_base64_str(scale=5)
>>> html_img = '<img src="data:image/png;base64,{}">'.format(image_as_str)
"""
+ import io
+ import base64
+
with io.BytesIO() as virtual_file:
self.png(file=virtual_file, scale=scale, module_color=module_color,
background=background, quiet_zone=quiet_zone)
|
Moved two imports to the method they acutally used with.
|
mnooner256_pyqrcode
|
train
|
py
|
acfac1fa2edc7182b8ae4afcd77ea8d1c769030d
|
diff --git a/lib/xmlconv/util/destination.rb b/lib/xmlconv/util/destination.rb
index <HASH>..<HASH> 100644
--- a/lib/xmlconv/util/destination.rb
+++ b/lib/xmlconv/util/destination.rb
@@ -226,6 +226,7 @@ module XmlConv
end
def do_deliver(delivery)
@transport.start(@uri.host, @uri.user,
+ :user_known_hosts_file => CONFIG.ssh_known_hosts_file,
:keys => CONFIG.ssh_identities) { |conn|
deliver_to_connection(conn, delivery)
}
|
Sftp-Destination needs known-hosts-file
|
zdavatz_xmlconv
|
train
|
rb
|
310df97b242a509d739242994124c258480e0063
|
diff --git a/lib/gesund/version.rb b/lib/gesund/version.rb
index <HASH>..<HASH> 100644
--- a/lib/gesund/version.rb
+++ b/lib/gesund/version.rb
@@ -1,3 +1,3 @@
module Gesund
- VERSION = "0.0.1"
+ VERSION = "0.0.2"
end
diff --git a/spec/lib/gesund/version_spec.rb b/spec/lib/gesund/version_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/gesund/version_spec.rb
+++ b/spec/lib/gesund/version_spec.rb
@@ -1,3 +1,3 @@
describe Gesund::VERSION do
- it { should == "0.0.1" }
+ it { should == "0.0.2" }
end
|
bump dev version to <I> after release of <I>
|
devops-israel_gesund
|
train
|
rb,rb
|
d5240b59992088085e81c4696e2416fda97e65b6
|
diff --git a/spec/lib/jekyll_spec.rb b/spec/lib/jekyll_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/jekyll_spec.rb
+++ b/spec/lib/jekyll_spec.rb
@@ -7,6 +7,7 @@ describe "Relation between glynn and jekyll" do
File.open('/test/test/README', 'w') {|f| f.write 'Hello World'}
File.open('/test/test/test', 'w') {|f| f.write 'Hello World'}
File.open('/_config.yml', 'w') { |f| f.write 'auto: true' }
+ File.open('/.jekyll-metadata', 'w') {|f| }
end
after(:all) do
FakeFS.deactivate!
diff --git a/spec/support/file.rb b/spec/support/file.rb
index <HASH>..<HASH> 100644
--- a/spec/support/file.rb
+++ b/spec/support/file.rb
@@ -7,6 +7,10 @@ module FakeFS
def fnmatch?(pattern, path)
path.match(pattern)
end
+
+ def binwrite(name, string, offset=0)
+ File.open(name, 'w') {|f| f.write string }
+ end
end
end
end
|
fix spec support for the latest jekyll
|
dmathieu_glynn
|
train
|
rb,rb
|
e936d6d24f1cb257cb2a66a70c32c89f65306d0a
|
diff --git a/command/build_ext.py b/command/build_ext.py
index <HASH>..<HASH> 100644
--- a/command/build_ext.py
+++ b/command/build_ext.py
@@ -186,7 +186,7 @@ class build_ext (Command):
# for extensions under Cygwin and AtheOS Python's library directory must be
# appended to library_dirs
if sys.platform[:6] == 'cygwin' or sys.platform[:6] == 'atheos':
- if string.find(sys.executable, sys.exec_prefix) != -1:
+ if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
# building third party extensions
self.library_dirs.append(os.path.join(sys.prefix, "lib",
"python" + get_python_version(),
@@ -199,7 +199,7 @@ class build_ext (Command):
# Python's library directory must be appended to library_dirs
if (sys.platform.startswith('linux') or sys.platform.startswith('gnu')) \
and sysconfig.get_config_var('Py_ENABLE_SHARED'):
- if string.find(sys.executable, sys.exec_prefix) != -1:
+ if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
# building third party extensions
self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
else:
|
Patch #<I>: fix a bug in distutils when building Python from a
directory within sys.exec_prefix.
(backport from rev. <I>)
|
pypa_setuptools
|
train
|
py
|
4ce5dc910b00855d94f1a36b782e29e1244f7f57
|
diff --git a/gears/compressors/__init__.py b/gears/compressors/__init__.py
index <HASH>..<HASH> 100644
--- a/gears/compressors/__init__.py
+++ b/gears/compressors/__init__.py
@@ -1,2 +1,3 @@
+from .base import BaseCompressor, ExecCompressor
from .cleancss import CleanCSSCompressor
from .uglifyjs import UglifyJSCompressor
|
BaseCompressor and ExecCompressor can be imported from gears.compressors now
|
gears_gears
|
train
|
py
|
ed599640a27b62b1ec1ac489d9f104fed08c9f2f
|
diff --git a/tests/django_mysql_tests/test_operations.py b/tests/django_mysql_tests/test_operations.py
index <HASH>..<HASH> 100644
--- a/tests/django_mysql_tests/test_operations.py
+++ b/tests/django_mysql_tests/test_operations.py
@@ -122,8 +122,15 @@ class AlterStorageEngineTests(TransactionTestCase):
self.assertEqual(operation.describe(),
"Alter storage engine for Pony from MyISAM to InnoDB")
+ def test_references_model(self):
+ operation = AlterStorageEngine("Pony", "InnoDB")
+ self.assertTrue(operation.references_model("PONY"))
+ self.assertTrue(operation.references_model("Pony"))
+ self.assertTrue(operation.references_model("pony"))
+ self.assertFalse(operation.references_model("poony"))
+
@override_mysql_variables(storage_engine='MyISAM') # Force default
- def test_basic(self):
+ def test_running_with_changes(self):
project_state = self.set_up_test_model("test_arstd")
operation = AlterStorageEngine("Pony", from_engine="MyISAM",
to_engine="InnoDB")
|
<I>% coverage of AlterStorageEngine
|
adamchainz_django-mysql
|
train
|
py
|
cbb7421dd3c41806a5ee1729cc88048b219ff1ba
|
diff --git a/src/main/java/de/cubeisland/engine/logging/Filterable.java b/src/main/java/de/cubeisland/engine/logging/Filterable.java
index <HASH>..<HASH> 100644
--- a/src/main/java/de/cubeisland/engine/logging/Filterable.java
+++ b/src/main/java/de/cubeisland/engine/logging/Filterable.java
@@ -24,12 +24,12 @@ package de.cubeisland.engine.logging;
import de.cubeisland.engine.logging.filter.LogFilter;
+import java.util.Deque;
import java.util.LinkedList;
-import java.util.List;
public abstract class Filterable
{
- protected List<LogFilter> filters = new LinkedList<LogFilter>();
+ protected Deque<LogFilter> filters = new LinkedList<LogFilter>();
protected LogLevel level = LogLevel.ALL;
public final void prependFilter(LogFilter filter)
|
I actually do not want a simple List here
|
CubeEngine_LogScribe
|
train
|
java
|
b6385c184c0e6579e516f9110ddc2d7e1fb652da
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -10,7 +10,11 @@ codecs.ndjson = createJSON(true)
codecs.json = createJSON(false)
codecs.binary = {
encode: function encodeBinary (obj) {
- return typeof obj === 'string' ? Buffer.from(obj, 'utf-8') : obj
+ return typeof obj === 'string'
+ ? Buffer.from(obj, 'utf-8')
+ : Buffer.isBuffer(obj)
+ ? obj
+ : Buffer.from(obj.buffer, obj.byteOffset, obj.byteLength)
},
decode: function decodeBinary (buf) {
return buf
diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -45,3 +45,11 @@ tape('custom', function (t) {
t.same(enc.decode(Buffer.from('lol')), 42)
t.end()
})
+
+tape('uint8arrays in binary', function (t) {
+ var enc = codecs('binary')
+
+ var buf = enc.encode(new Uint8Array([1, 2, 3]))
+ t.same(buf, Buffer.from([1, 2, 3]))
+ t.end()
+})
|
co-oerce typedarrays to buffers
|
mafintosh_codecs
|
train
|
js,js
|
70b9efb5a9e73a278406f61c62ba2638ad5774d2
|
diff --git a/stacktest/graphite/validate.go b/stacktest/graphite/validate.go
index <HASH>..<HASH> 100644
--- a/stacktest/graphite/validate.go
+++ b/stacktest/graphite/validate.go
@@ -1,6 +1,9 @@
package graphite
-import "math"
+import (
+ "fmt"
+ "math"
+)
// Response is a convenience type:
// it provides original http and json decode errors, if applicable
@@ -13,6 +16,18 @@ type Response struct {
Decoded Data
}
+func (r Response) StringWithoutData() string {
+ data := "{"
+ for i, serie := range r.Decoded {
+ if i > 0 {
+ data += ","
+ }
+ data += fmt.Sprintf("%q", serie.Target)
+ }
+ data += "}"
+ return fmt.Sprintf("<Response>{HTTPErr: %v, DecodeErr: %v, Code: %d, TraceID: %s, Decoded: %s}", r.HTTPErr, r.DecodeErr, r.Code, r.TraceID, data)
+}
+
type Validator func(resp Response) bool
// ValidateTargets returns a function that validates that the response contains exactly all named targets
|
allow printing response type in a compact way
|
grafana_metrictank
|
train
|
go
|
cf0ae806913c4010deca500cdef33ebf505abc5b
|
diff --git a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php
index <HASH>..<HASH> 100755
--- a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php
+++ b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php
@@ -25,7 +25,7 @@ class PinStickiedDiscussionsToTop
public function subscribe(Dispatcher $events)
{
$events->listen(ConfigureDiscussionGambits::class, [$this, 'addStickyGambit']);
- $events->listen(Searching::class, [$this, 'reorderSearch'], -100);
+ $events->listen(Searching::class, [$this, 'reorderSearch']);
}
/**
|
Remove use of event priorities
Event priorities are no longer in Laravel - see <URL>
|
flarum_core
|
train
|
php
|
e1cbf0624483b1df07eae0f7ba9d1dcf45dc0ded
|
diff --git a/salt/states/pip_state.py b/salt/states/pip_state.py
index <HASH>..<HASH> 100644
--- a/salt/states/pip_state.py
+++ b/salt/states/pip_state.py
@@ -115,6 +115,7 @@ def installed(name,
no_install=False,
no_download=False,
install_options=None,
+ global_options=None,
user=None,
runas=None,
no_chown=False,
@@ -385,6 +386,7 @@ def installed(name,
no_install=no_install,
no_download=no_download,
install_options=install_options,
+ global_options=global_options,
user=user,
no_chown=no_chown,
cwd=cwd,
|
Allow passing `global_options`
|
saltstack_salt
|
train
|
py
|
7a0220a1123c5fcaf60b0205b25e400b2ea35681
|
diff --git a/src/js/bs3/module/AirPopover.js b/src/js/bs3/module/AirPopover.js
index <HASH>..<HASH> 100644
--- a/src/js/bs3/module/AirPopover.js
+++ b/src/js/bs3/module/AirPopover.js
@@ -68,6 +68,9 @@ define([
};
this.hide = function () {
+ if (!options.airMode || list.isEmpty(options.popover.air)) {
+ return;
+ }
this.$popover.hide();
};
};
|
Prevent script error on airpopover.
|
summernote_summernote
|
train
|
js
|
3c3095d4d045d65010e1871a571953d72e4f4cb8
|
diff --git a/pythonforandroid/recipes/android/__init__.py b/pythonforandroid/recipes/android/__init__.py
index <HASH>..<HASH> 100644
--- a/pythonforandroid/recipes/android/__init__.py
+++ b/pythonforandroid/recipes/android/__init__.py
@@ -13,7 +13,7 @@ class AndroidRecipe(IncludedFilesBehaviour, CythonRecipe):
src_filename = 'src'
- depends = [('pygame', 'sdl2'), ('python2', 'python3')]
+ depends = [('pygame', 'sdl2', 'webviewjni'), ('python2', 'python3')]
config_env = {}
|
Added webviewjni build alternative for android
|
kivy_python-for-android
|
train
|
py
|
097d26584ba94f416a937274c730ecbb210aa63c
|
diff --git a/lib/parallel.rb b/lib/parallel.rb
index <HASH>..<HASH> 100644
--- a/lib/parallel.rb
+++ b/lib/parallel.rb
@@ -183,7 +183,7 @@ module Parallel
Signal.trap signal do
yield
- if old == "DEFAULT"
+ if old == "DEFAULT" || !old.respond_to?(:call)
raise Interrupt
else
old.call
|
Within the Interrupt Signal handler, ensure the trapped signal is callable (more than likely nil if not).
|
grosser_parallel
|
train
|
rb
|
0a9ceec55ad0266b894563afd8a6024f3540544e
|
diff --git a/src/providers/perfectaudience/perfectaudience-test.js b/src/providers/perfectaudience/perfectaudience-test.js
index <HASH>..<HASH> 100644
--- a/src/providers/perfectaudience/perfectaudience-test.js
+++ b/src/providers/perfectaudience/perfectaudience-test.js
@@ -30,6 +30,8 @@
// -----
test('calls track on track', function () {
+ expect(window._pa.track).not.to.be(undefined);
+
var event = 'event';
var properties = {
orderId: 12345,
|
make sure _pa.track is defined when testing track
|
segmentio_analytics.js-core
|
train
|
js
|
f9ecd858e8377946fd27f4f6273621a5540a8a2d
|
diff --git a/src/main/java/tachyon/MasterClient.java b/src/main/java/tachyon/MasterClient.java
index <HASH>..<HASH> 100644
--- a/src/main/java/tachyon/MasterClient.java
+++ b/src/main/java/tachyon/MasterClient.java
@@ -135,6 +135,7 @@ public class MasterClient {
} catch (TTransportException e) {
LOG.error("Failed to connect (" +tries + ") to master " + mMasterAddress +
" : " + e.getMessage(), e);
+ CommonUtils.sleepMs(LOG, 1000);
continue;
}
mIsConnected = true;
|
sleep 1sec for each connecting master try
|
Alluxio_alluxio
|
train
|
java
|
1c7df2698eea300ba775f857970666082bc8952e
|
diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -184,7 +184,31 @@ describe('FiveBeansClient', function()
returnPayload[ptr].should.equal(payload[ptr]);
ptr++;
}
+ consumer.destroy(returnID, function(err)
+ {
+ should.not.exist(err);
+ done();
+ });
+ });
+ });
+ });
+ it('jobs can contain utf8 data', function(done)
+ {
+ var payload = "Many people like crème brûlée.";
+ var ptr = 0;
+ producer.put(0, 0, 60, payload, function(err, jobid)
+ {
+ should.not.exist(err);
+ jobid.should.exist;
+
+ consumer.reserve(function(err, returnID, returnPayload)
+ {
+ should.not.exist(err);
+ returnID.should.equal(jobid);
+
+ // we should get back exactly the same bytes we put in
+ returnPayload.should.equal(payload);
consumer.destroy(returnID, function(err)
{
should.not.exist(err);
|
Added a unit test for utf8 strings.
The unit test fails right now.
|
ceejbot_fivebeans
|
train
|
js
|
c015d11303339f50254a10be7335fd33546911ab
|
diff --git a/modules/activiti-modeler/src/main/java/org/activiti/rest/editor/main/StencilsetRestResource.java b/modules/activiti-modeler/src/main/java/org/activiti/rest/editor/main/StencilsetRestResource.java
index <HASH>..<HASH> 100644
--- a/modules/activiti-modeler/src/main/java/org/activiti/rest/editor/main/StencilsetRestResource.java
+++ b/modules/activiti-modeler/src/main/java/org/activiti/rest/editor/main/StencilsetRestResource.java
@@ -27,11 +27,11 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
public class StencilsetRestResource {
- @RequestMapping(value="/editor/stencilset", method = RequestMethod.GET, produces = "application/json")
+ @RequestMapping(value="/editor/stencilset", method = RequestMethod.GET, produces = "application/json;charset=utf-8")
public @ResponseBody String getStencilset() {
InputStream stencilsetStream = this.getClass().getClassLoader().getResourceAsStream("stencilset.json");
try {
- return IOUtils.toString(stencilsetStream);
+ return IOUtils.toString(stencilsetStream, "utf-8");
} catch (Exception e) {
throw new ActivitiException("Error while loading stencil set", e);
}
|
Fix read stencilset.json gibberish when in other languages
|
Activiti_Activiti
|
train
|
java
|
d9f3367a779094edcbded25992bf26b09e43ba4c
|
diff --git a/test/integration.js b/test/integration.js
index <HASH>..<HASH> 100644
--- a/test/integration.js
+++ b/test/integration.js
@@ -1531,8 +1531,6 @@ test('print correct link in legacy warning', async t => {
const deploymentPath = fixture('v1-warning-link');
const { code, stderr } = await execute([deploymentPath]);
- console.log(stderr);
-
// It is expected to fail,
// since the package.json does not have a start script
t.is(code, 1);
|
Remove leftover `console.log()` in integration tests (#<I>)
|
zeit_now-cli
|
train
|
js
|
39967c82b9df548aec2a9996c17199d9175fa9d7
|
diff --git a/classes/fields/color.php b/classes/fields/color.php
index <HASH>..<HASH> 100644
--- a/classes/fields/color.php
+++ b/classes/fields/color.php
@@ -111,7 +111,7 @@ class PodsField_Color extends PodsField {
// @todo Ask for a specific format in error message
$errors[] = __( 'Invalid value provided for this field.', 'pods' );
}
- } elseif ( ! in_array( strlen( $color ), array( 3, 6 ), true ) ) {
+ } elseif ( $color && ! in_array( strlen( $color ), array( 3, 6 ), true ) ) {
$errors[] = __( 'Invalid Hex Color value provided for this field.', 'pods' );
}
}
|
Check if $color has a value before checking this value.
|
pods-framework_pods
|
train
|
php
|
e6bb9d3ebc3097775098a72e0fc781d9fee163a7
|
diff --git a/cerberus/__init__.py b/cerberus/__init__.py
index <HASH>..<HASH> 100644
--- a/cerberus/__init__.py
+++ b/cerberus/__init__.py
@@ -3,7 +3,7 @@ import logging
__all__ = ['aws_auth', 'client', 'network_util', 'url_util', 'user_auth']
-CLIENT_VERSION = '2.5.2'
+CLIENT_VERSION = '2.5.3'
class CerberusClientException(Exception):
|
Bumped version to <I>
|
Nike-Inc_cerberus-python-client
|
train
|
py
|
a08eccf9b84b5754f7cf09c06292a76ea3f1a6bb
|
diff --git a/testem.js b/testem.js
index <HASH>..<HASH> 100644
--- a/testem.js
+++ b/testem.js
@@ -8,6 +8,7 @@ let config = {
test_page: smokeTests ? 'tests/index.html?smoke_tests=true' : 'tests/index.html?hidepassed',
disable_watching: true,
browser_start_timeout: smokeTests ? 300000 : 30000,
+ browser_disconnect_timeout: smokeTests ? 120 : 10,
browser_args: {
Chrome: {
mode: 'ci',
|
Increase browser disconnect timeout in smoke tests
|
glimmerjs_glimmer-vm
|
train
|
js
|
431e6f1943efb7d3308b159e20b0daf0e0c2f1fd
|
diff --git a/src/Api.php b/src/Api.php
index <HASH>..<HASH> 100644
--- a/src/Api.php
+++ b/src/Api.php
@@ -654,7 +654,7 @@ class Api
*
* @throws TelegramSDKException
*/
- public function get($endpoint, $params = [])
+ protected function get($endpoint, $params = [])
{
return $this->sendRequest(
'GET',
@@ -673,7 +673,7 @@ class Api
*
* @throws TelegramSDKException
*/
- public function post($endpoint, array $params = [])
+ protected function post($endpoint, array $params = [])
{
return $this->sendRequest(
'POST',
@@ -693,7 +693,7 @@ class Api
*
* @throws TelegramSDKException
*/
- public function uploadFile($endpoint, array $params = [])
+ protected function uploadFile($endpoint, array $params = [])
{
$i = 0;
$multipart_params = [];
@@ -729,7 +729,7 @@ class Api
*
* @throws TelegramSDKException
*/
- public function sendRequest(
+ protected function sendRequest(
$method,
$endpoint,
array $params = []
@@ -748,7 +748,7 @@ class Api
*
* @return TelegramRequest
*/
- public function request(
+ protected function request(
$method,
$endpoint,
array $params = []
|
Update Method Visibility to Protected for Non-Public Methods.
|
exileed_telegram-bot-api
|
train
|
php
|
b8d1550ee0c3722a1b926ae41c71b53c53b934d4
|
diff --git a/lib/twitter.py b/lib/twitter.py
index <HASH>..<HASH> 100644
--- a/lib/twitter.py
+++ b/lib/twitter.py
@@ -41,7 +41,7 @@ def __post(user, password, path, args={}):
def __get(user, password, path, delegate, params={}):
url = BASE_URL + path
if params:
- url += '?' + __urlencode(params),
+ url += '?' + __urlencode(params)
return client.downloadPage(url, txml.Feed(delegate),
headers=makeAuthHeader(user, password))
|
Fixed typo in get with params.
|
dustin_twitty-twister
|
train
|
py
|
abb84d065ef9ed67660472fe0aecb155ca0633dc
|
diff --git a/core/server/auth/utils.js b/core/server/auth/utils.js
index <HASH>..<HASH> 100644
--- a/core/server/auth/utils.js
+++ b/core/server/auth/utils.js
@@ -13,7 +13,7 @@ var Promise = require('bluebird'),
* This access token auto expires and get's cleaned up on bootstrap (see oauth.js).
*/
_private.decreaseOldAccessTokenExpiry = function decreaseOldAccessTokenExpiry(data, options) {
- debug('decreaseOldAccessTokenExpiry', data, options);
+ debug('decreaseOldAccessTokenExpiry', data);
if (!data.token) {
return Promise.resolve();
@@ -32,7 +32,7 @@ _private.decreaseOldAccessTokenExpiry = function decreaseOldAccessTokenExpiry(da
};
_private.destroyOldRefreshToken = function destroyOldRefreshToken(options) {
- debug('destroyOldRefreshToken', options);
+ debug('destroyOldRefreshToken', options.token);
if (!options.token) {
return Promise.resolve();
|
Improved debug logs for auth utils (#<I>)
no issue
- reduce the debug logs
- it's okay to log the old token to delete, because this token is getting removed anyway
|
TryGhost_Ghost
|
train
|
js
|
8df7f0da57cff349e63bf4fe939a53b2de35ef1d
|
diff --git a/client/next-dev.js b/client/next-dev.js
index <HASH>..<HASH> 100644
--- a/client/next-dev.js
+++ b/client/next-dev.js
@@ -1,4 +1,3 @@
-import 'react-hot-loader/patch'
import patch from './patch-react'
// apply patch first
@@ -7,5 +6,7 @@ patch((err) => {
next.renderError(err)
})
+require('react-hot-loader/patch')
+
const next = require('./next')
window.next = next
|
fix HMR (#<I>)
|
zeit_next.js
|
train
|
js
|
6ec6eff163fc26744cef0207943fce4cc368174a
|
diff --git a/lib/Watching.js b/lib/Watching.js
index <HASH>..<HASH> 100644
--- a/lib/Watching.js
+++ b/lib/Watching.js
@@ -49,7 +49,7 @@ class Watching {
this.watchOptions = {};
}
if (typeof this.watchOptions.aggregateTimeout !== "number") {
- this.watchOptions.aggregateTimeout = 200;
+ this.watchOptions.aggregateTimeout = 20;
}
this.compiler = compiler;
this.running = false;
|
Lower default aggregateTimeout to <I>ms
|
webpack_webpack
|
train
|
js
|
c6dc0bb05a56902f88aad60f01ec5e22c5c45ea3
|
diff --git a/tests/test.attachments.js b/tests/test.attachments.js
index <HASH>..<HASH> 100644
--- a/tests/test.attachments.js
+++ b/tests/test.attachments.js
@@ -324,6 +324,20 @@ describe('attachments', function () {
});
});
+ it("Test put another attachment on a doc with attachments", function(done) {
+ testUtils.initTestDB(testHelpers.name, function(err, db) {
+ db.put({ _id: 'mydoc' }, function(err, res1) {
+ var blob = testUtils.makeBlob('Mytext');
+ db.putAttachment('mydoc', 'mytext', res1.rev, blob, 'text/plain', function(err, res2) {
+ db.putAttachment('mydoc', 'mytext2', res2.rev, blob, 'text/plain', function(err, res3) {
+ should.exist(res3.ok);
+ done();
+ });
+ });
+ });
+ });
+ });
+
it('Test get with attachments: true if empty attachments', function(done) {
testUtils.initTestDB(testHelpers.name, function(erro, db) {
db.put({_id: 'foo', _attachments: {}}, function(err, resp) {
|
(#<I>) - added test for multiple attachements
|
pouchdb_pouchdb
|
train
|
js
|
791e49d860087391660ede1cc30c88af0df067a7
|
diff --git a/dpark/rdd.py b/dpark/rdd.py
index <HASH>..<HASH> 100644
--- a/dpark/rdd.py
+++ b/dpark/rdd.py
@@ -1510,6 +1510,10 @@ class MultiOutputTextFileRDD(OutputTextFileRDD):
def flush_file(self, key, f):
f.flush()
+ if self.compress:
+ f.compress = zlib.compressobj(9, zlib.DEFLATED,
+ -zlib.MAX_WBITS, zlib.DEF_MEM_LEVEL, 0)
+
if len(self.files) > self.MAX_OPEN_FILES:
if self.compress:
open_files = sum(1 for f in self.files.values() if f.fileobj is not None)
|
fix MultiOutputTextFile is not independent for compress
|
douban_dpark
|
train
|
py
|
cbcd7eee9be0d215f18a0aa502279c3ef7731c7d
|
diff --git a/models/SettingsForm.php b/models/SettingsForm.php
index <HASH>..<HASH> 100644
--- a/models/SettingsForm.php
+++ b/models/SettingsForm.php
@@ -75,7 +75,7 @@ class SettingsForm extends Model
return [
'usernameRequired' => ['username', 'required'],
'usernameTrim' => ['username', 'filter', 'filter' => 'trim'],
- 'usernameLenth' => ['username', 'string', 'min' => 3, 'max' => 20],
+ 'usernameLength' => ['username', 'string', 'min' => 3, 'max' => 255],
'usernamePattern' => ['username', 'match', 'pattern' => '/^[-a-zA-Z0-9_\.@]+$/'],
'emailRequired' => ['email', 'required'],
'emailTrim' => ['email', 'filter', 'filter' => 'trim'],
|
Fix validation rule (fixes #<I>)
|
dektrium_yii2-user
|
train
|
php
|
cf32eda312ac6651569a3a685d46ee21bcdbae77
|
diff --git a/lib/watson_developer_cloud/iam_token_manager.rb b/lib/watson_developer_cloud/iam_token_manager.rb
index <HASH>..<HASH> 100644
--- a/lib/watson_developer_cloud/iam_token_manager.rb
+++ b/lib/watson_developer_cloud/iam_token_manager.rb
@@ -72,8 +72,7 @@ class IAMTokenManager
)
return @token_info["access_token"]
elsif _is_token_expired?
- token_info = _request_token if _is_refresh_token_expired?
- token_info = _refresh_token unless _is_refresh_token_expired?
+ token_info = _is_refresh_token_expired? ? _request_token : _refresh_token
_save_token_info(
token_info: token_info
)
|
refactor(iam logic): Consolidate if unless into ternary operator
|
watson-developer-cloud_ruby-sdk
|
train
|
rb
|
d3fc213da4f167b5d6d16489c6c244439ac27cf4
|
diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/ServiceProvider.php
+++ b/src/ServiceProvider.php
@@ -29,6 +29,8 @@ class ServiceProvider extends Injectable {
$this->di->set('config.debugbar', function() use($configPath){
if ( $configPath===null ) {
$configPath = __DIR__ . '/config/debugbar.php';
+ }elseif( is_object($configPath) && $configPath instanceof Php){
+ return $configPath;
}
return new Php($configPath);
});
|
ServiceProvider's construct function support Phalcon\Config\Adapter\Php instance
|
snowair_phalcon-debugbar
|
train
|
php
|
e8226226cbe0e41215f831ee788b02fa7598d9fa
|
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -3,6 +3,8 @@ var GameCtrl = require('./ctrl/game');
var CommandLine = require("./command_line");
var m = require("mithril");
+var GamesAwaitingMoveComponent = require('./ui/overview/games_awaiting_move');
+
module.exports = () => {
ssbClient(
@@ -14,7 +16,11 @@ module.exports = () => {
sbot.whoami((err,ident) => {
const gameCtrl = GameCtrl(sbot, ident.id);
-
+ const gamesAwaitingMove = GamesAwaitingMoveComponent(gameCtrl);
+
+ m.mount(document.body, gamesAwaitingMove);
+
+
})
}
|
ooo, it's excitin'
|
Happy0_ssb-chess
|
train
|
js
|
631219651d987042dc6409b6757db2dab1c2f3e8
|
diff --git a/nsqd.py b/nsqd.py
index <HASH>..<HASH> 100644
--- a/nsqd.py
+++ b/nsqd.py
@@ -16,7 +16,7 @@ HOSTNAME = socket.gethostname()
SHORTNAME = HOSTNAME.split('.')[0]
class Nsqd(object):
- def __init__(self, address, tcp_port=None, http_port=None, timeout=1.0):
+ def __init__(self, address, tcp_port=None, http_port=None, timeout=60.0):
self.address = address
self.tcp_port = tcp_port
self.http_port = http_port
|
Increase timeout to <I> seconds.
|
wtolson_gnsq
|
train
|
py
|
243497925a786dfbbd5cc99f0c16ac3d6b6f3b22
|
diff --git a/config/webpack/test.webpack.config.js b/config/webpack/test.webpack.config.js
index <HASH>..<HASH> 100644
--- a/config/webpack/test.webpack.config.js
+++ b/config/webpack/test.webpack.config.js
@@ -19,7 +19,7 @@ function getWebpackConfig(skyPagesConfig) {
const aliasBuilder = require('./alias-builder');
const ENV = process.env.ENV = process.env.NODE_ENV = 'test';
- const srcPath = path.resolve(process.cwd(), 'src', 'app');
+ const srcPath = path.resolve(process.cwd(), 'src');
const moduleLoader = outPath('loader', 'sky-pages-module');
const resolves = [
|
allow karma to find all .spec files from src, instead of just inside app. (#<I>)
|
blackbaud_skyux-builder
|
train
|
js
|
1f81868d1061a18b334753eabc6b3bfb9d68c67d
|
diff --git a/src/test/java/com/netflix/zeno/fastblob/state/ByteArrayOrdinalMapTest.java b/src/test/java/com/netflix/zeno/fastblob/state/ByteArrayOrdinalMapTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/netflix/zeno/fastblob/state/ByteArrayOrdinalMapTest.java
+++ b/src/test/java/com/netflix/zeno/fastblob/state/ByteArrayOrdinalMapTest.java
@@ -17,11 +17,6 @@
*/
package com.netflix.zeno.fastblob.state;
-import com.netflix.zeno.fastblob.record.ByteDataBuffer;
-import com.netflix.zeno.fastblob.record.VarInt;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.HashSet;
import java.util.Map;
@@ -35,6 +30,9 @@ import java.util.concurrent.TimeUnit;
import org.junit.Assert;
import org.junit.Test;
+import com.netflix.zeno.fastblob.record.ByteDataBuffer;
+import com.netflix.zeno.fastblob.record.VarInt;
+
public class ByteArrayOrdinalMapTest {
@Test
|
Unit test for ByteArrayOrdinalMap
|
Netflix_zeno
|
train
|
java
|
f911ccfe5d8baea0a7edcacc09c16cfc18f2c4bf
|
diff --git a/cgutils/cgroup.py b/cgutils/cgroup.py
index <HASH>..<HASH> 100644
--- a/cgutils/cgroup.py
+++ b/cgutils/cgroup.py
@@ -271,10 +271,13 @@ class SubsystemCpuset(Subsystem):
class SubsystemMemory(Subsystem):
NAME = 'memory'
STATS = {
+ 'failcnt': long,
'usage_in_bytes': long,
+ 'max_usage_in_bytes': long,
+ 'memsw.failcnt': long,
+ 'memsw.max_usage_in_bytes': long,
'memsw.usage_in_bytes': long,
'stat': SimpleStat,
- 'memsw.failcnt': long,
}
MAX_ULONGLONG = 2**63-1
CONFIGS = {
|
Add missing control files of memory subsystems
|
peo3_cgroup-utils
|
train
|
py
|
12e9a891117f1915043d4025cb5049403719a46a
|
diff --git a/tests/unit/test_csp.py b/tests/unit/test_csp.py
index <HASH>..<HASH> 100644
--- a/tests/unit/test_csp.py
+++ b/tests/unit/test_csp.py
@@ -221,7 +221,11 @@ def test_includeme():
"'self'",
"camo.url.value",
],
- "script-src": ["'self'", "www.googletagmanager.com"],
+ "script-src": [
+ "'self'",
+ "www.googletagmanager.com",
+ "www.google-analytics.com",
+ ],
"style-src": ["'self'", "fonts.googleapis.com"],
},
})
diff --git a/warehouse/csp.py b/warehouse/csp.py
index <HASH>..<HASH> 100644
--- a/warehouse/csp.py
+++ b/warehouse/csp.py
@@ -86,7 +86,11 @@ def includeme(config):
SELF,
config.registry.settings["camo.url"],
],
- "script-src": [SELF, "www.googletagmanager.com"],
+ "script-src": [
+ SELF,
+ "www.googletagmanager.com",
+ "www.google-analytics.com",
+ ],
"style-src": [SELF, "fonts.googleapis.com"],
},
})
|
Add another domain to the CSP policy (#<I>)
|
pypa_warehouse
|
train
|
py,py
|
f4e313094485a0d3bea6e2063a69ff650ee4de0b
|
diff --git a/core/committer/txvalidator/validator.go b/core/committer/txvalidator/validator.go
index <HASH>..<HASH> 100644
--- a/core/committer/txvalidator/validator.go
+++ b/core/committer/txvalidator/validator.go
@@ -695,6 +695,15 @@ func (v *vsccValidatorImpl) VSCCValidateTx(payload *common.Payload, envBytes []b
}
}
+ // Verify the header extension and response payload contain the ChaincodeId
+ if hdrExt.ChaincodeId == nil {
+ return errors.New("nil ChaincodeId in header extension"), peer.TxValidationCode_INVALID_OTHER_REASON
+ }
+
+ if respPayload.ChaincodeId == nil {
+ return errors.New("nil ChaincodeId in ChaincodeAction"), peer.TxValidationCode_INVALID_OTHER_REASON
+ }
+
// get name and version of the cc we invoked
ccID := hdrExt.ChaincodeId.Name
ccVer := respPayload.ChaincodeId.Version
|
[FAB-<I>] Missing nil check in VSCCValidateTx
There is a missing nil check in the function VSCCValidateTx in case
the header extension's ChaincodeId is nil.
I added a nil check for that, and for the ChaincodeAction too
Change-Id: I<I>e<I>cccf<I>ba8d<I>b<I>db<I>f<I>a<I>d
|
hyperledger_fabric
|
train
|
go
|
fc80fa331a5f35e9526afa826b3cdd802767ad8b
|
diff --git a/src/funnies.js b/src/funnies.js
index <HASH>..<HASH> 100644
--- a/src/funnies.js
+++ b/src/funnies.js
@@ -169,5 +169,9 @@ export default [
"Ordering 1s and 0s...",
"Updating dependencies...",
"Loading funny message...",
- "Feel free to spin in your chair"
+ "Feel free to spin in your chair",
+ "What the what?",
+ "format C: ...",
+ "Forget you saw that password I just typed into the IM ...",
+ "What's under there?"
];
|
Adding funny phrases (#<I>)
* Update funnies.js
Add more funny phrases! #6
* Update funnies.js
|
1egoman_funnies
|
train
|
js
|
f45dd6c826fcfef9498f5a2d26cc5fd49f6f888e
|
diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -19,7 +19,8 @@ module.exports = function (grunt) {
},
continuous: {
configFile: 'karma.conf.js',
- singleRun: true
+ singleRun: true,
+ browsers: ['PhantomJS']
}
},
coveralls: {
|
Fixed the build since there is a known issue of running tests in Chrome on Travis.
|
emmaguo_angular-poller
|
train
|
js
|
477f23f3c0aeeba6d906ec5d30273c97f30be3af
|
diff --git a/okdownload/src/main/java/com/liulishuo/okdownload/core/dispatcher/DownloadDispatcher.java b/okdownload/src/main/java/com/liulishuo/okdownload/core/dispatcher/DownloadDispatcher.java
index <HASH>..<HASH> 100644
--- a/okdownload/src/main/java/com/liulishuo/okdownload/core/dispatcher/DownloadDispatcher.java
+++ b/okdownload/src/main/java/com/liulishuo/okdownload/core/dispatcher/DownloadDispatcher.java
@@ -258,7 +258,7 @@ public class DownloadDispatcher {
}
for (DownloadCall call : runningSyncCalls) {
- if (call.task == task|| call.task.getId() == task.getId()) {
+ if (call.task == task || call.task.getId() == task.getId()) {
needCallbackCalls.add(call);
needCancelCalls.add(call);
return;
|
chore: fix stylecheck issue on download-dispatcher
|
lingochamp_okdownload
|
train
|
java
|
ca4931a3cec73de46f4762fa9c985210c871a52c
|
diff --git a/lib/branch_io_cli/configuration/setup_configuration.rb b/lib/branch_io_cli/configuration/setup_configuration.rb
index <HASH>..<HASH> 100644
--- a/lib/branch_io_cli/configuration/setup_configuration.rb
+++ b/lib/branch_io_cli/configuration/setup_configuration.rb
@@ -191,13 +191,13 @@ EOF
menu.prompt = "What would you like to do?"
end
- self.sdk_integration_mode = SDK_OPTIONS[selected]
+ @sdk_integration_mode = SDK_OPTIONS[selected]
case sdk_integration_mode
when :cocoapods
- self.podfile_path = File.expand_path "../Podfile", xcodeproj_path
+ @podfile_path = File.expand_path "../Podfile", xcodeproj_path
when :carthage
- self.cartfile_path = File.expand_path "../Cartfile", xcodeproj_path
+ @cartfile_path = File.expand_path "../Cartfile", xcodeproj_path
@carthage_command = options.carthage_command
end
end
|
Use ivars instead of self.
|
BranchMetrics_branch_io_cli
|
train
|
rb
|
300f82eda426c179a5f20bb693cec1a5acc36a23
|
diff --git a/cheroot/test/conftest.py b/cheroot/test/conftest.py
index <HASH>..<HASH> 100644
--- a/cheroot/test/conftest.py
+++ b/cheroot/test/conftest.py
@@ -19,14 +19,14 @@ from ..testing import ( # noqa: F401
from ..testing import get_server_client
[email protected] # noqa: F811
-def wsgi_server_client(wsgi_server):
[email protected]
+def wsgi_server_client(wsgi_server): # noqa: F811
"""Create a test client out of given WSGI server."""
return get_server_client(wsgi_server)
[email protected] # noqa: F811
-def native_server_client(native_server):
[email protected]
+def native_server_client(native_server): # noqa: F811
"""Create a test client out of given HTTP server."""
return get_server_client(native_server)
|
Fix noqa F<I> placing in conftest
|
cherrypy_cheroot
|
train
|
py
|
0458f7ba4359c217e3e09914512ac4cd915eed73
|
diff --git a/cpnav/CpNavPlugin.php b/cpnav/CpNavPlugin.php
index <HASH>..<HASH> 100644
--- a/cpnav/CpNavPlugin.php
+++ b/cpnav/CpNavPlugin.php
@@ -190,8 +190,8 @@ class CpNavPlugin extends BasePlugin
foreach ($allNavs as $newNav) {
- // Allow Enviroment Variables to be used in the URL
- $url = craft()->config->parseEnvironmentString(trim($newNav->url));
+ // Do some extra work on the url if needed
+ $url = craft()->cpNav->processUrl($newNav);
if ($newNav->enabled) {
$nav[$newNav->handle] = array(
diff --git a/cpnav/services/CpNavService.php b/cpnav/services/CpNavService.php
index <HASH>..<HASH> 100644
--- a/cpnav/services/CpNavService.php
+++ b/cpnav/services/CpNavService.php
@@ -108,4 +108,22 @@ class CpNavService extends BaseApplicationComponent
return $allNavs;
}
+ public function processUrl($newNav)
+ {
+ // Allow Enviroment Variables to be used in the URL
+ $url = craft()->config->parseEnvironmentString(trim($newNav->url));
+
+ // And a spcial case for global - always direct to first global set
+ if ($newNav->handle == 'globals') {
+ $globals = craft()->globals->getEditableSets();
+
+ if ($globals) {
+ $url = 'globals/' . $globals[0]->handle;
+ }
+ }
+
+ return $url;
+ }
+
+
}
|
support for globals - always use first editable set for url
|
verbb_cp-nav
|
train
|
php,php
|
0e8278e97a980a5cf3b27e9413f1b69f10cd8f3f
|
diff --git a/parse_gapfind_noproduction.py b/parse_gapfind_noproduction.py
index <HASH>..<HASH> 100755
--- a/parse_gapfind_noproduction.py
+++ b/parse_gapfind_noproduction.py
@@ -6,7 +6,8 @@ The GapFind file should be produced with parameter "ps=0".
'''
import sys
-import csv
+import csv
+import re
if __name__ == '__main__':
if len(sys.argv) < 3:
@@ -19,6 +20,7 @@ if __name__ == '__main__':
compound_map = {}
+ c.readline() # Skip header
readerc = csv.reader(c, dialect='excel')
for rowc in readerc:
SEED_cid, Formula, Mass, KEGG_cid, CPD_name = rowc[:5]
@@ -40,8 +42,14 @@ if __name__ == '__main__':
fields = line.split()
cpdid = fields[0]
produced = fields[2] != '.'
+ comp = None
- if not cpdid.endswith('_e'):
+ m = re.match(r'(.+?)_(.+)$', cpdid)
+ if m is not None:
+ cpdid = m.group(1)
+ comp = m.group(2)
+
+ if comp is None and cpdid in compound_map:
count += 1
if not produced:
Formula, KEGG_cid, CPD_name = compound_map[cpdid]
|
When parsing GapFind result exclude all non-cytosol compounds
|
zhanglab_psamm
|
train
|
py
|
e5b93a0b4a2b0da4758f0e7010e7f8ef364b9812
|
diff --git a/tests/ast/test_folding.py b/tests/ast/test_folding.py
index <HASH>..<HASH> 100644
--- a/tests/ast/test_folding.py
+++ b/tests/ast/test_folding.py
@@ -108,6 +108,8 @@ builtins_modified = [
"def foo(bar: int128 = MAX_INT128): pass",
"def foo(): bar = MAX_INT128",
"def foo(): return MAX_INT128",
+ "log.foo(MAX_INT128)",
+ "log.foo(42, MAX_INT128)",
]
@@ -127,6 +129,7 @@ builtins_unmodified = [
"def foo(MAX_INT128: int128 = 42): pass",
"def foo(): MAX_INT128 = 42",
"def MAX_INT128(): pass",
+ "log.MAX_INT128(42)",
]
|
test: constants as call args
|
ethereum_vyper
|
train
|
py
|
2fde12ce1d027ed07c885820f16b42b4e02ce8fc
|
diff --git a/testproject/testproject/settings.py b/testproject/testproject/settings.py
index <HASH>..<HASH> 100644
--- a/testproject/testproject/settings.py
+++ b/testproject/testproject/settings.py
@@ -156,3 +156,5 @@ LOGGING = {
},
}
}
+
+TEST_RUNNER = 'django.test.runner.DiscoverRunner'
|
Avoid Django to raise warnings for test runners.
|
stefanfoulis_django-phonenumber-field
|
train
|
py
|
5c4f60f09bf7d323f24c047e0484cba6350f3fe1
|
diff --git a/concrete/src/Express/Association/Applier.php b/concrete/src/Express/Association/Applier.php
index <HASH>..<HASH> 100644
--- a/concrete/src/Express/Association/Applier.php
+++ b/concrete/src/Express/Association/Applier.php
@@ -121,10 +121,12 @@ class Applier
if ($oneAssociation) {
// Let's see if THAT entry relates back to this.
$oneEntry = $oneAssociation->getSelectedEntry();
- $oneEntryAssociation = $oneEntry->getEntryAssociation($association);
- if ($oneEntryAssociation) {
- $oneEntryAssociation->getSelectedEntriesCollection()->removeElement($selectedEntry);
- $this->entityManager->persist($oneEntryAssociation);
+ if ($oneEntry) {
+ $oneEntryAssociation = $oneEntry->getEntryAssociation($association);
+ if ($oneEntryAssociation) {
+ $oneEntryAssociation->getSelectedEntriesCollection()->removeElement($selectedEntry);
+ $this->entityManager->persist($oneEntryAssociation);
+ }
}
$this->entityManager->remove($oneAssociation);
}
@@ -132,6 +134,12 @@ class Applier
$this->entityManager->flush();
+ foreach($manyAssociation->getSelectedEntries() as $manyAssociationSelectedEntry) {
+ $manyAssociation->getSelectedEntriesCollection()->removeElement($manyAssociationSelectedEntry);
+ }
+ $this->entityManager->persist($manyAssociation);
+ $this->entityManager->flush();
+
$manyAssociation->setSelectedEntries($associatedEntries);
$this->entityManager->persist($manyAssociation);
$this->entityManager->flush();
|
Fixing some outlier express association issues
|
concrete5_concrete5
|
train
|
php
|
3002cebaace65d85b7a1b03271998810332db15d
|
diff --git a/tests/src/main/java/com/hazelcast/stabilizer/tests/map/MapCasTest.java b/tests/src/main/java/com/hazelcast/stabilizer/tests/map/MapCasTest.java
index <HASH>..<HASH> 100644
--- a/tests/src/main/java/com/hazelcast/stabilizer/tests/map/MapCasTest.java
+++ b/tests/src/main/java/com/hazelcast/stabilizer/tests/map/MapCasTest.java
@@ -100,8 +100,8 @@ public class MapCasTest {
@Override
protected void timeStep() {
- Integer key = nextInt(keyCount);
- long incrementValue = nextInt(100);
+ Integer key = randomInt(keyCount);
+ long incrementValue = randomInt(100);
for (;;) {
Long current = map.get(key);
|
Fixed outdated method name in MapCasTest.
|
hazelcast_hazelcast-simulator
|
train
|
java
|
d322b68f292a31505a71edb3bb26dfdf377703fd
|
diff --git a/Kwf/Component/Generator/Box/StaticSelect.php b/Kwf/Component/Generator/Box/StaticSelect.php
index <HASH>..<HASH> 100644
--- a/Kwf/Component/Generator/Box/StaticSelect.php
+++ b/Kwf/Component/Generator/Box/StaticSelect.php
@@ -75,4 +75,24 @@ class Kwf_Component_Generator_Box_StaticSelect extends Kwf_Component_Generator_S
{
return array($this->_idSeparator.$this->getGeneratorKey());
}
+
+ public function duplicateChild($source, $parentTarget, Zend_ProgressBar $progressBar = null)
+ {
+ if ($source->generator !== $this) {
+ throw new Kwf_Exception("you must call this only with the correct source");
+ }
+
+ $sourceRow = $this->_getModel()->getRow($source->dbId);
+
+ if ($sourceRow) { //if not row exists that's ok, it's also not needed in the duplicated one
+ $id = $this->_idSeparator . array_pop(explode($this->_idSeparator, $source->componentId));
+ $target = $parentTarget->getChildComponent($id);
+
+ $sourceRow->duplicate(array(
+ 'component_id' => $target->dbId,
+ ));
+ }
+
+ return parent::duplicateChild($source, $parentTarget, $progressBar);
+ }
}
|
duplicate Generator_Box_StaticSelect row
|
koala-framework_koala-framework
|
train
|
php
|
f72f68842244c53c30a028ddeaf8d42af494fd08
|
diff --git a/cronjobs/linkcheck.php b/cronjobs/linkcheck.php
index <HASH>..<HASH> 100644
--- a/cronjobs/linkcheck.php
+++ b/cronjobs/linkcheck.php
@@ -66,7 +66,7 @@ foreach ( $linkList as $link )
}
else
{
- $cli->output( "Couldn't check https protocol" );
+ $cli->output( "HTTPS protocol is not supported by linkcheck" );
}
}
else
|
Fix EZP-<I>: Updated linkcheck.php https warning message
|
ezsystems_ezpublish-legacy
|
train
|
php
|
e061639a909bda2bd174e4dbdf418c5a71c8c146
|
diff --git a/lib/rails_sso/helpers.rb b/lib/rails_sso/helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/rails_sso/helpers.rb
+++ b/lib/rails_sso/helpers.rb
@@ -43,6 +43,8 @@ module RailsSso
yield if block_given?
rescue ::OAuth2::Error
nil
+ rescue ResponseError => e
+ nil if e.code == :unauthenticated
end
private
|
Do not raise error when unauthenticated
Fixes #7
|
monterail_rails_sso
|
train
|
rb
|
738c04fd1651dad56670ce587370adb34ef607c4
|
diff --git a/gandi/cli/core/client.py b/gandi/cli/core/client.py
index <HASH>..<HASH> 100644
--- a/gandi/cli/core/client.py
+++ b/gandi/cli/core/client.py
@@ -27,8 +27,7 @@ class XMLRPCClient(object):
def __init__(self, host, debug=False):
self.debug = debug
- self.endpoint = xmlrpclib.ServerProxy(host,
- transport=GandiTransport())
+ self.endpoint = xmlrpclib.ServerProxy(host)
def request(self, apikey, method, *args):
try:
|
Disable sending of custom user-agent through xlmrpc as it doesn't work
|
Gandi_gandi.cli
|
train
|
py
|
ce2caea9ce1d24bb7928244a062aceefbc3b5661
|
diff --git a/LiSE/LiSE/query.py b/LiSE/LiSE/query.py
index <HASH>..<HASH> 100644
--- a/LiSE/LiSE/query.py
+++ b/LiSE/LiSE/query.py
@@ -91,9 +91,9 @@ def windows_intersection(windows):
def intersect2(left, right):
if left == right:
return left
- elif left is (None, None):
+ elif left == (None, None):
return right
- elif right is (None, None):
+ elif right == (None, None):
return left
elif left[0] is None:
if right[0] is None:
|
Fix bad `is` in intersect2 in windows_intersection
|
LogicalDash_LiSE
|
train
|
py
|
99fe337e36866b29e235ae6352a4b837083ffc0b
|
diff --git a/describe.go b/describe.go
index <HASH>..<HASH> 100644
--- a/describe.go
+++ b/describe.go
@@ -14,10 +14,8 @@ var cmdDescribe = &Command{
Examples
- force describe metadata -n=CustomObject
- force describe sobject -n=Account
- force describe metata
- force describe sobject
+ force describe -t=metadata -n=CustomObject
+ force describe -t=sobject -n=Account
`,
}
|
Update describe help text
As far as I can tell from use, the describe function fails unless the `-t` flag is explicitly set. This commit also removes what I think are two extraneous lines.
|
ForceCLI_force
|
train
|
go
|
8dcd854bc25575d71224b3b5dc99e559a0318278
|
diff --git a/lib/line-header.js b/lib/line-header.js
index <HASH>..<HASH> 100644
--- a/lib/line-header.js
+++ b/lib/line-header.js
@@ -106,7 +106,14 @@ class LineHeader extends stream.Transform {
this.checks.forEach(function (check) {
let err = check(fieldData);
if (err) {
- this.emit("error", err);
+ if (!data.error) {
+ data.error = [];
+ }
+ if (Array.isArray(err)) {
+ data.error.push.apply(err);
+ } else {
+ data.error.push(err);
+ }
}
});
@@ -120,12 +127,19 @@ class LineHeader extends stream.Transform {
}
}
- this.emit("header", header);
+ this.emit('header', header);
if (this.mandatoryColumnCheck) {
let err = this.mandatoryColumnCheck(foundColumns);
if (err) {
- this.emit("error", err);
+ if (!data.error) {
+ data.error = [];
+ }
+ if (Array.isArray(err)) {
+ data.error.push.apply(err);
+ } else {
+ data.error.push(err);
+ }
}
}
}
|
fix: The errors will now be embedded into the data stream.
|
Kronos-Integration_kronos-interceptor-line-header
|
train
|
js
|
3c110fc586b45245ede049fa2bab554e15d3197c
|
diff --git a/mapchete/_processing.py b/mapchete/_processing.py
index <HASH>..<HASH> 100644
--- a/mapchete/_processing.py
+++ b/mapchete/_processing.py
@@ -444,12 +444,17 @@ def _preprocess(
)
# process all remaining tiles using todo list from before
- for future in executor.as_completed(
- func=_preprocess_task_wrapper,
- iterable=[(k, v) for k, v in tasks.items()],
+ for i, future in enumerate(
+ executor.as_completed(
+ func=_preprocess_task_wrapper,
+ iterable=[(k, v) for k, v in tasks.items()],
+ ),
+ 1,
):
task_key, result = future.result()
- logger.debug(f"preprocessing task {task_key} processed successfully")
+ logger.debug(
+ f"preprocessing task {i}/{len(tasks)} {task_key} processed successfully"
+ )
process.config.set_preprocessing_task_result(task_key, result)
yield f"preprocessing task {task_key} finished"
finally:
|
add preprocessing task counter to logs
|
ungarj_mapchete
|
train
|
py
|
d69827ac56c10effcce6248ea1ec61126549b02d
|
diff --git a/src/NamelessCoder/GizzleGitPlugins/GizzlePlugins/ClonePlugin.php b/src/NamelessCoder/GizzleGitPlugins/GizzlePlugins/ClonePlugin.php
index <HASH>..<HASH> 100644
--- a/src/NamelessCoder/GizzleGitPlugins/GizzlePlugins/ClonePlugin.php
+++ b/src/NamelessCoder/GizzleGitPlugins/GizzlePlugins/ClonePlugin.php
@@ -30,6 +30,7 @@ class ClonePlugin extends AbstractGitPlugin implements PluginInterface {
*/
public function process(Payload $payload) {
$directory = $this->getDirectorySettingOrFail(FALSE);
+ $directory = sprintf($directory, $payload->getRepository()->getName());
$url = $this->getSettingValue(self::OPTION_REPOSITORY, $payload->getRepository()->getUrl());
$depth = $this->getSettingValue(self::OPTION_DEPTH, 0);
$git = $this->resolveGitCommand();
|
[TASK] Sprintf directory in clone plugin to insert repository name
|
NamelessCoder_gizzle-git-plugins
|
train
|
php
|
0151013ddbce79f82316725bfaad2628f297c108
|
diff --git a/salt/client/__init__.py b/salt/client/__init__.py
index <HASH>..<HASH> 100644
--- a/salt/client/__init__.py
+++ b/salt/client/__init__.py
@@ -481,6 +481,8 @@ class LocalClient(object):
following exceptions.
:param sub: The number of systems to execute on
+ :param cli: When this is set to True, a generator is returned,
+ otherwise a dictionary of the minion returns is returned
.. code-block:: python
|
document `cli` option for cmd_subset
It would be really nice to have a better name for `cmd_cli` in a future
release, possibly cmd_gen. I don't feel comfortable making this change in
<I> though
|
saltstack_salt
|
train
|
py
|
44fd9a1bde9b73d84c3370f4ce14293108095180
|
diff --git a/xwiki-commons-core/xwiki-commons-groovy/src/test/java/org/xwiki/groovy/internal/GroovyExecutionTest.java b/xwiki-commons-core/xwiki-commons-groovy/src/test/java/org/xwiki/groovy/internal/GroovyExecutionTest.java
index <HASH>..<HASH> 100644
--- a/xwiki-commons-core/xwiki-commons-groovy/src/test/java/org/xwiki/groovy/internal/GroovyExecutionTest.java
+++ b/xwiki-commons-core/xwiki-commons-groovy/src/test/java/org/xwiki/groovy/internal/GroovyExecutionTest.java
@@ -60,7 +60,7 @@ class GroovyExecutionTest
private GroovyConfiguration configuration;
@Test
- void execute()
+ void executeWhenCompilationCustomizerThrowsException()
{
CompilationCustomizer customizer = mock(CompilationCustomizer.class);
when(this.configuration.getCompilationCustomizers()).thenReturn(Arrays.asList(customizer));
|
[Misc] Improve test name
|
xwiki_xwiki-commons
|
train
|
java
|
7f998b1b832dd69cfdd8455afd5b8af3b2f77df8
|
diff --git a/transformers/tokenization_utils.py b/transformers/tokenization_utils.py
index <HASH>..<HASH> 100644
--- a/transformers/tokenization_utils.py
+++ b/transformers/tokenization_utils.py
@@ -910,7 +910,7 @@ class PreTrainedTokenizer(object):
token_type_ids = [0] * len(ids) + ([1] * len(pair_ids) if pair else [])
special_tokens_mask = [0] * (len(ids) + (len(pair_ids) if pair else 0))
if return_special_tokens_mask:
- encoded_inputs["special_tokens_mask"] = self.get_special_tokens_mask(ids, pair_ids)
+ encoded_inputs["special_tokens_mask"] = special_tokens_mask
# Prepare inputs as tensors if asked
if return_tensors == 'tf' and is_tf_available():
|
special_tokens_mask value was unused and calculated twice
|
huggingface_pytorch-pretrained-BERT
|
train
|
py
|
cdf78b63d018d767853c1488ead451c61a2ecf4d
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ requires = [
setup(
name='amaascore',
- version='0.3.6',
+ version='0.4.0',
description='Asset Management as a Service - Core SDK',
license='Apache License 2.0',
url='https://github.com/amaas-fintech/amaas-core-sdk-python',
|
Increment version now we connect to prod by default
|
amaas-fintech_amaas-core-sdk-python
|
train
|
py
|
15117956c244b7415aacf4cd76f50752fa9a1a22
|
diff --git a/install.py b/install.py
index <HASH>..<HASH> 100644
--- a/install.py
+++ b/install.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python3
-
import json
import os
import re
|
Remove shebang from install.py. (#<I>)
Always executed like $ /path/to/python install.py .
|
junaruga_rpm-py-installer
|
train
|
py
|
06a73751bb756b4366ea778bd9572585dfd228b4
|
diff --git a/modules/directives/date/test/dateSpec.js b/modules/directives/date/test/dateSpec.js
index <HASH>..<HASH> 100644
--- a/modules/directives/date/test/dateSpec.js
+++ b/modules/directives/date/test/dateSpec.js
@@ -48,6 +48,16 @@ describe('uiDate', function() {
return expect(element.datepicker('getDate').toISOString().substring(0, 10)).toEqual(aDateString);
});
});
+ it('should not freak out when the model is null', function() {
+ return inject(function($compile, $rootScope) {
+ var element = $compile('<input ui-date="{dateFormat: \'yy-mm-dd\'}" ng-model="x"/>')($rootScope);
+ $rootScope.$apply(function() {
+ return $rootScope.x = null;
+ });
+ return expect(element.datepicker('getDate')).toBe(null);
+ });
+ });
+
describe('use with ng-required directive', function() {
it('should be invalid initially', function() {
return inject(function($compile, $rootScope) {
|
bug <I>: added a test to prove null handling works ok
|
angular-ui_ui-scrollpoint
|
train
|
js
|
5487cf20707cd51e94e53de8b01eb70ab22993bc
|
diff --git a/src/client.js b/src/client.js
index <HASH>..<HASH> 100644
--- a/src/client.js
+++ b/src/client.js
@@ -1506,7 +1506,7 @@ MatrixClient.prototype.createKeyBackupVersion = async function(info) {
await this._crypto._signObject(data.auth_data);
if (
- this._cryptoCallbacks.getSecretStorageKey &&
+ this._cryptoCallbacks.getCrossSigningKey &&
this._crypto._crossSigningInfo.getId()
) {
// now also sign the auth data with the cross-signing master key
diff --git a/src/crypto/index.js b/src/crypto/index.js
index <HASH>..<HASH> 100644
--- a/src/crypto/index.js
+++ b/src/crypto/index.js
@@ -218,7 +218,7 @@ export default function Crypto(baseApis, sessionStore, userId, deviceId,
);
// Assuming no app-supplied callback, default to getting from SSSS.
- if (!cryptoCallbacks.getCrossSigningKey) {
+ if (!cryptoCallbacks.getCrossSigningKey && cryptoCallbacks.getSecretStorageKey) {
cryptoCallbacks.getCrossSigningKey = async (type) => {
return CrossSigningInfo.getFromSecretStorage(type, this._secretStorage);
};
|
Fix callback check
We need to check for getCrossSisgningKey but that was added
unconditionally elsewhere - only add it if we actually have a
getSecretStorageKey callback to use.
|
matrix-org_matrix-js-sdk
|
train
|
js,js
|
c7d919ec24216f8cac8a695ceeec0504ee3ecfd0
|
diff --git a/src/a-frame/component/gblock.js b/src/a-frame/component/gblock.js
index <HASH>..<HASH> 100644
--- a/src/a-frame/component/gblock.js
+++ b/src/a-frame/component/gblock.js
@@ -62,7 +62,12 @@ export default {
fetch('https://us-central1-gblock-api.cloudfunctions.net/get-gltf-url/?url=' + src).then(function (response) {
return response.json().then(function (message) {
- if (!response.ok) throw new Error('ERROR: ' + response.status + ' "' + message.message + '"')
+
+ if (!response.ok) {
+ el.emit('model-error', { message: message.message })
+ console.error('ERROR: ' + response.status + ' "' + message.message + '"')
+ return
+ }
// load glTF model from original URL
var gltfUrl = message.gltfUrl
|
emits events on gblock loading errors
|
archilogic-com_3dio-js
|
train
|
js
|
b21e027bb56ec77986d76fc1990f4e420c6de869
|
diff --git a/pyPodcastParser/Item.py b/pyPodcastParser/Item.py
index <HASH>..<HASH> 100644
--- a/pyPodcastParser/Item.py
+++ b/pyPodcastParser/Item.py
@@ -50,10 +50,6 @@ class Item(object):
def set_time_published(self):
if self.published_date is None:
- self.time_published = None
- self.day_published = None
- self.month_published = None
- self.year_published = None
return
time_tuple = email.utils.parsedate_tz(self.published_date)
try:
diff --git a/pyPodcastParser/Podcast.py b/pyPodcastParser/Podcast.py
index <HASH>..<HASH> 100644
--- a/pyPodcastParser/Podcast.py
+++ b/pyPodcastParser/Podcast.py
@@ -86,9 +86,6 @@ class Podcast():
def set_time_published(self):
if self.published_date is None:
self.time_published = None
- self.day_published = None
- self.month_published = None
- self.year_published = None
return
time_tuple = email.utils.parsedate_tz(self.published_date)
self.time_published = email.utils.mktime_tz(time_tuple)
|
fixed errors in set_time_published
|
jrigden_pyPodcastParser
|
train
|
py,py
|
fedfaea2a130ac7817e2ffdc547acd771d3fdcfc
|
diff --git a/test/helper.js b/test/helper.js
index <HASH>..<HASH> 100644
--- a/test/helper.js
+++ b/test/helper.js
@@ -1,3 +1,12 @@
+var fs = require('fs'),
+ path = require('path');
+
+function loadDataFromFile(filename) {
+ var dataString = fs.readFileSync(filename, 'utf8');
+
+ return JSON.parse(dataString);
+}
+
function validateHash(expectedHash, actualHash) {
var count = 0;
@@ -13,5 +22,6 @@ function validateHash(expectedHash, actualHash) {
}
module.exports = {
- validateHash: validateHash
+ validateHash: validateHash,
+ loadDataFromFile: loadDataFromFile
};
\ No newline at end of file
|
implemented loading of data from a json file
|
FenrirUnbound_flipit
|
train
|
js
|
416cbbe3a432a96b45c65a1b845446ac47e92a75
|
diff --git a/shared/api/certificate.go b/shared/api/certificate.go
index <HASH>..<HASH> 100644
--- a/shared/api/certificate.go
+++ b/shared/api/certificate.go
@@ -26,6 +26,12 @@ type CertificatesPost struct {
// Server trust password (used to add an untrusted client)
// Example: blah
Password string `json:"password" yaml:"password"`
+
+ // Whether to create a certificate add token
+ // Example: true
+ //
+ // API extension: certificate_token
+ Token bool `json:"token" yaml:"token"`
}
// CertificatePut represents the modifiable fields of a LXD certificate
|
shared/api: Add Token to CertificatesPost
|
lxc_lxd
|
train
|
go
|
da61e2d784f89bf4860386e9d07a8f2757c13024
|
diff --git a/packages/article-summary/src/article-summary-headline.js b/packages/article-summary/src/article-summary-headline.js
index <HASH>..<HASH> 100644
--- a/packages/article-summary/src/article-summary-headline.js
+++ b/packages/article-summary/src/article-summary-headline.js
@@ -1,5 +1,5 @@
import React from "react";
-import { Text } from "react-native";
+import { Text, Platform } from "react-native";
import PropTypes from "prop-types";
import styles from "./styles";
@@ -9,6 +9,7 @@ const ArticleSummaryHeadline = ({ className, headline, style }) => (
<Text
accessibilityRole="header"
aria-level="3"
+ allowFontScaling={Platform.OS === "ios"}
className={className}
style={[styles.headline, styles.headlineWrapper, style]}
>
|
fix: (REPLAT-<I>) disable fontSizing on article headlines (#<I>)
|
newsuk_times-components
|
train
|
js
|
08a287c08db71d77005fc18468e941fe77be1e7d
|
diff --git a/molo/core/tests/test_middleware.py b/molo/core/tests/test_middleware.py
index <HASH>..<HASH> 100644
--- a/molo/core/tests/test_middleware.py
+++ b/molo/core/tests/test_middleware.py
@@ -91,4 +91,4 @@ class TestUtils(TestCase, MoloTestCaseMixin):
middleware = MoloGoogleAnalyticsMiddleware()
account = ''
response = middleware.submit_tracking(account, request, response)
- self.assertContains(response, '&cd2')
\ No newline at end of file
+ self.assertContains(response, '&cd2')
|
add line at the end of a file
|
praekeltfoundation_molo
|
train
|
py
|
37eb9507570d6f07574867843368e26d74304b7d
|
diff --git a/modules/orionode/lib/git/remotes.js b/modules/orionode/lib/git/remotes.js
index <HASH>..<HASH> 100755
--- a/modules/orionode/lib/git/remotes.js
+++ b/modules/orionode/lib/git/remotes.js
@@ -19,8 +19,6 @@ var clone = require('./clone');
var mConfig = require('./config');
var express = require('express');
var bodyParser = require('body-parser');
-var log4js = require('log4js');
-var logger = log4js.getLogger("git");
var util = require('./util');
module.exports = {};
@@ -290,7 +288,7 @@ function fetchRemote(req, res, remote, branch, force) {
refSpec = "refs/heads/" + remoteBranch + ":refs/remotes/" + remoteObj.name() + "/" + branch;
if (force) refSpec = "+" + refSpec;
}
- logger.debug("fetchRemote ", remote," Starting");
+
return remoteObj.fetch(
refSpec ? [refSpec] : null,
{
@@ -301,7 +299,6 @@ function fetchRemote(req, res, remote, branch, force) {
);
})
.then(function(err) {
- logger.debug("err in fetchRemote is", err);
if (!err) {
task.done({
HttpCode: 200,
|
remove investigation code for Bug <I> - [Node]FetchRemote might never returns
|
eclipse_orion.client
|
train
|
js
|
c481e352ebd8e8bcfd0beb1036c1606b0501154a
|
diff --git a/Kwf/Component/PluginRoot/PostRenderCutter.php b/Kwf/Component/PluginRoot/PostRenderCutter.php
index <HASH>..<HASH> 100644
--- a/Kwf/Component/PluginRoot/PostRenderCutter.php
+++ b/Kwf/Component/PluginRoot/PostRenderCutter.php
@@ -26,7 +26,7 @@ abstract class Kwf_Component_PluginRoot_PostRenderCutter implements
return self::MASK_TYPE_NOMASK;
}
- public final function getMask(Kwf_Component_Data $page)
+ public function getMask(Kwf_Component_Data $page)
{
$maskParams = null;
$mask = $this->_getMask($page);
@@ -51,7 +51,7 @@ abstract class Kwf_Component_PluginRoot_PostRenderCutter implements
}
}
- public final function getMaskCode(Kwf_Component_Data $page)
+ public function getMaskCode(Kwf_Component_Data $page)
{
$mask = $this->getMask($page);
$maskType = $mask['type'];
|
Remove final to allow customizing mask
required for porsche dealer news+gallery
|
koala-framework_koala-framework
|
train
|
php
|
e06f25493c2c78f0b7e9ac26f14e9236eed58fd5
|
diff --git a/src/main/java/org/cellprofiler/imageset/ImageFile.java b/src/main/java/org/cellprofiler/imageset/ImageFile.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/cellprofiler/imageset/ImageFile.java
+++ b/src/main/java/org/cellprofiler/imageset/ImageFile.java
@@ -109,14 +109,14 @@ public class ImageFile implements Comparable<ImageFile>{
int lastSepIndex = path.lastIndexOf("/");
if (lastSepIndex <= 0) {
final URI uriOut = new URI(uri.getScheme(), uri.getHost(), null, null);
- pathName = uriOut.toURL().toString();
+ pathName = uriOut.toString();
} else {
final URI uriOut = new URI(
uri.getScheme(),
uri.getHost(),
path.substring(0, lastSepIndex),
null);
- pathName = uriOut.toURL().toString();
+ pathName = uriOut.toString();
}
}
} catch (URISyntaxException e) {
@@ -124,10 +124,6 @@ public class ImageFile implements Comparable<ImageFile>{
"Failed to extract metadata from badly formed URL: " +
uri.toString());
return null;
- } catch (MalformedURLException e) {
- LoggerFactory.getLogger(getClass()).warn(
- String.format("Failed to reconstitute path from URL, \"%s\"", uri.toString()));
- return null;
}
}
return pathName;
|
Support s3 URIs.
toURL() fails if the URI's scheme is s3. Since the URI gets converted
to a string, just return toString().
|
CellProfiler_prokaryote
|
train
|
java
|
423200f004700227068b864f9499a4e5ea6a0ae5
|
diff --git a/src/utilities/assertValidName.js b/src/utilities/assertValidName.js
index <HASH>..<HASH> 100644
--- a/src/utilities/assertValidName.js
+++ b/src/utilities/assertValidName.js
@@ -11,6 +11,10 @@
const NAME_RX = /^[_a-zA-Z][_a-zA-Z0-9]*$/;
const ERROR_PREFIX_RX = /^Error: /;
+// Silences warnings if an environment flag is enabled
+const noNameWarning =
+ Boolean(process && process.env && process.env.GRAPHQL_NO_NAME_WARNING);
+
// Ensures console warnings are only issued once.
let hasWarnedAboutDunder = false;
@@ -26,7 +30,12 @@ export function assertValidName(
`Must be named. Unexpected name: ${name}.`
);
}
- if (!isIntrospection && name.slice(0, 2) === '__' && !hasWarnedAboutDunder) {
+ if (
+ !isIntrospection &&
+ !hasWarnedAboutDunder &&
+ !noNameWarning &&
+ name.slice(0, 2) === '__'
+ ) {
hasWarnedAboutDunder = true;
/* eslint-disable no-console */
if (console && console.warn) {
|
[RFC] Environment var to silence warning about invalid names.
This provides an opt-out of a spec compliance naming style for legacy schema
|
graphql_graphql-js
|
train
|
js
|
55a94ede78eb473767bfde73678b93971ceebab0
|
diff --git a/examples/hello_world.py b/examples/hello_world.py
index <HASH>..<HASH> 100644
--- a/examples/hello_world.py
+++ b/examples/hello_world.py
@@ -3,4 +3,4 @@ import hug
@hug.get()
def hello_world():
- return "Hello world"
+ return "Hello world!"
diff --git a/hug/output_format.py b/hug/output_format.py
index <HASH>..<HASH> 100644
--- a/hug/output_format.py
+++ b/hug/output_format.py
@@ -5,6 +5,8 @@ from datetime import datetime
def _json_converter(item):
if isinstance(item, datetime):
return item.isoformat()
+ elif isinstance(item, bytes):
+ return item.decode('utf8')
raise TypeError("Type not serializable")
|
Automatically handle converting bytes to utf8
|
hugapi_hug
|
train
|
py,py
|
b43043c4d82b5c16d0a5f81cb1f072aff2d41831
|
diff --git a/jenkins/plugin/src/main/java/com/hp/octane/plugins/jenkins/model/snapshots/SnapshotItem.java b/jenkins/plugin/src/main/java/com/hp/octane/plugins/jenkins/model/snapshots/SnapshotItem.java
index <HASH>..<HASH> 100644
--- a/jenkins/plugin/src/main/java/com/hp/octane/plugins/jenkins/model/snapshots/SnapshotItem.java
+++ b/jenkins/plugin/src/main/java/com/hp/octane/plugins/jenkins/model/snapshots/SnapshotItem.java
@@ -83,7 +83,7 @@ public final class SnapshotItem extends AbstractItem<ParameterInstance, Snapshot
}
@Exported(inline = true)
- public int getNumber() {
+ public Integer getNumber() {
return number;
}
@@ -103,17 +103,17 @@ public final class SnapshotItem extends AbstractItem<ParameterInstance, Snapshot
}
@Exported(inline = true)
- public long getEstimatedDuration() {
+ public Long getEstimatedDuration() {
return estimatedDuration;
}
@Exported(inline = true)
- public long getStartTime() {
+ public Long getStartTime() {
return startTime;
}
@Exported(inline = true)
- public long getDuration() {
+ public Long getDuration() {
return duration;
}
|
adjusting snapshot JSON api to the MQM standard (non available numerics should be nulls)
|
hpsa_hpe-application-automation-tools-plugin
|
train
|
java
|
18e0642d24b8db8f0ff2ebc3151fe85966ba00bd
|
diff --git a/src/constraint/MouseConstraint.js b/src/constraint/MouseConstraint.js
index <HASH>..<HASH> 100644
--- a/src/constraint/MouseConstraint.js
+++ b/src/constraint/MouseConstraint.js
@@ -106,7 +106,7 @@ var MouseConstraint = {};
* Triggers mouse constraint events
* @method _triggerEvents
* @private
- * @param {mouse} mouse
+ * @param {mouse} mouseConstraint
*/
var _triggerEvents = function(mouseConstraint) {
var mouse = mouseConstraint.mouse,
|
Update JSDoc
This might need fixing later, I don't know if I did it right.
|
liabru_matter-js
|
train
|
js
|
f3b3b0e9f7db578cc9ed94865a2bfd37834eb08b
|
diff --git a/lib/rubocop/cop/style/hash_syntax.rb b/lib/rubocop/cop/style/hash_syntax.rb
index <HASH>..<HASH> 100644
--- a/lib/rubocop/cop/style/hash_syntax.rb
+++ b/lib/rubocop/cop/style/hash_syntax.rb
@@ -54,10 +54,6 @@ module RuboCop
private
- def space_before_operator?(op, key)
- op.begin_pos - key.begin_pos - key.source.length > 0
- end
-
def check(pairs, delim, msg)
pairs.each do |pair|
if pair.loc.operator && pair.loc.operator.is?(delim)
|
Remove unused method
This method was left behind after commit <I>a<I>f<I>e4fe7a.
|
rubocop-hq_rubocop
|
train
|
rb
|
18bf299abd1332b2632007e2c9850ddb1d336ecb
|
diff --git a/classes/MUtil/View/Helper/Exhibitor.php b/classes/MUtil/View/Helper/Exhibitor.php
index <HASH>..<HASH> 100644
--- a/classes/MUtil/View/Helper/Exhibitor.php
+++ b/classes/MUtil/View/Helper/Exhibitor.php
@@ -63,6 +63,7 @@ class MUtil_View_Helper_Exhibitor extends Zend_View_Helper_FormElement
public function exhibitor($name, $value = null, $attribs = null)
{
$result = $value;
+ MUtil_Echo::track($result);
if (isset($attribs['default'])) {
if (null === $result) {
@@ -142,6 +143,9 @@ class MUtil_View_Helper_Exhibitor extends Zend_View_Helper_FormElement
if (isset($attribs['nohidden']) && $attribs['nohidden'] || is_array($value)) {
return $result;
} else {
+ if ($value instanceof Zend_Date) {
+ $value = $value->toString(Zend_Date::ISO_8601);
+ }
return $this->_hidden($name, $value) . $result;
}
}
|
Exhibitor screwed up the dateformat, resulting in 1-1-<I> dates being saved (track start date for example)
|
GemsTracker_gemstracker-library
|
train
|
php
|
c161757af713840e2fd4408e4f8d711c27ccd9d9
|
diff --git a/lib/ruby-jmeter/dsl.rb b/lib/ruby-jmeter/dsl.rb
index <HASH>..<HASH> 100755
--- a/lib/ruby-jmeter/dsl.rb
+++ b/lib/ruby-jmeter/dsl.rb
@@ -202,7 +202,9 @@ module RubyJmeter
def exists(variable, &block)
params ||= {}
- params[:condition] = "'${#{variable}}'.length > 0"
+ params[:condition] = "\"${#{variable}}\" != \"\\${#{variable}}\""
+ params[:useExpression] = false
+ params[:name] = "if ${#{variable}}"
node = RubyJmeter::IfController.new(params)
attach_node(node, &block)
end
@@ -460,6 +462,8 @@ module RubyJmeter
:threads => params[:threads],
:rampup => params[:ramup],
:duration => params[:duration],
+ :override_hosts => params[:override_hosts],
+ :override_parameters => params[:override_parameters],
# specials for API
:started => params[:started],
:stopped => params[:stopped]
|
fix up exists check and specify additional params in flood method
|
flood-io_ruby-jmeter
|
train
|
rb
|
083a139488764f45e2601d5dd61e978b4c6f0aae
|
diff --git a/lib/transports/polling-xhr.js b/lib/transports/polling-xhr.js
index <HASH>..<HASH> 100755
--- a/lib/transports/polling-xhr.js
+++ b/lib/transports/polling-xhr.js
@@ -219,6 +219,10 @@ Request.prototype.create = function () {
} catch (e) {}
}
+ try {
+ xhr.setRequestHeader('Accept', '*/*');
+ } catch (e) {}
+
// ie6 check
if ('withCredentials' in xhr) {
xhr.withCredentials = true;
|
[fix] Set accept header to */* to support react app proxy (#<I>)
|
socketio_engine.io-client
|
train
|
js
|
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.