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 |
|---|---|---|---|---|---|
2f7e698e4d312704041c764a4a4ed01caf3dae40 | diff --git a/scripts/serverless.js b/scripts/serverless.js
index <HASH>..<HASH> 100755
--- a/scripts/serverless.js
+++ b/scripts/serverless.js
@@ -41,7 +41,9 @@ let hasTelemetryBeenReported = false;
// to properly handle e.g. `SIGINT` interrupt
const keepAliveTimer = setTimeout(() => {}, 60 * 60 * 1000);
-const standaloneCommands = new Set(['doctor', 'plugin install', 'plugin uninstall']);
+// Names of the commands which are configured independently in root `commands` folder
+// and not in Serverless class internals
+const notIntegratedCommands = new Set(['doctor', 'plugin install', 'plugin uninstall']);
process.once('uncaughtException', (error) => {
clearTimeout(keepAliveTimer);
@@ -509,7 +511,7 @@ const processSpanPromise = (async () => {
const configurationFilename = configuration && configurationPath.slice(serviceDir.length + 1);
- const isStandaloneCommand = standaloneCommands.has(command);
+ const isStandaloneCommand = notIntegratedCommands.has(command);
if (isInteractiveSetup || isStandaloneCommand) {
if (configuration) require('../lib/cli/ensure-supported-command')(configuration); | refactor: Improve var naming | serverless_serverless | train | js |
0c3257a1b2cddbf89b680f52522455222476cb94 | diff --git a/eqcorrscan/utils/correlate.py b/eqcorrscan/utils/correlate.py
index <HASH>..<HASH> 100644
--- a/eqcorrscan/utils/correlate.py
+++ b/eqcorrscan/utils/correlate.py
@@ -400,9 +400,10 @@ def fftw_multi_normxcorr(template_array, stream_array, pad_array, seed_ids):
n_templates = template_array[seed_ids[0]].shape[0]
image_len = stream_array[seed_ids[0]].shape[0]
fft_len = next_fast_len(template_len + image_len - 1)
- template_array = np.ascontiguousarray(list(template_array.values()),
+ template_array = np.ascontiguousarray([template_array[x]
+ for x in seed_ids],
dtype=np.float32)
- stream_array = np.ascontiguousarray(list(stream_array.values()),
+ stream_array = np.ascontiguousarray([stream_array[x] for x in seed_ids],
dtype=np.float32)
cccs = np.empty((n_channels, n_templates, image_len - template_len + 1),
np.float32) | Arrays created in same order as seed_ids | eqcorrscan_EQcorrscan | train | py |
ecc6fddaf832067133769762dea8e1cdcd2ea68d | diff --git a/config/create-webpack-config-for-development.js b/config/create-webpack-config-for-development.js
index <HASH>..<HASH> 100644
--- a/config/create-webpack-config-for-development.js
+++ b/config/create-webpack-config-for-development.js
@@ -23,7 +23,7 @@ module.exports = ({ distPath, entryPoint, sourceFolders }) => ({
// to CORS errors when an error happens
// https://webpack.js.org/configuration/devtool/#devtool
// https://reactjs.org/docs/cross-origin-errors.html#source-maps
- devtool: 'cheap-module-source-map',
+ devtool: 'source-map',
// https://medium.com/webpack/webpack-4-code-splitting-chunk-graph-and-the-splitchunks-optimization-be739a861366
// https://medium.com/webpack/webpack-4-mode-and-optimization-5423a6bc597a | fix(discounts/rule-builder): merge master and fix conflicts
- Update references to '@commercetools-frontend' for relevant files.
- Add product key to predicate field/function selector. This will be
refactored later to be pulled from 'productMessages.key'
- Fix merge conflicts with the change in form of a condition's target
(from a string/undefined to an object with a 'kind' definition and value) | commercetools_merchant-center-application-kit | train | js |
426ac79299f60cd64b003edd6d12f66d80a9b69f | diff --git a/packages/site/pages/components/starrating.js b/packages/site/pages/components/starrating.js
index <HASH>..<HASH> 100644
--- a/packages/site/pages/components/starrating.js
+++ b/packages/site/pages/components/starrating.js
@@ -34,7 +34,7 @@ export default withServerProps(_ => (
props={[
PropTypes.row([
'onChange',
- 'function',
+ '(number, Event) => ()',
null,
null,
'triggered when the value changes' | refactor(site): update starrating docs with prop signature | pluralsight_design-system | train | js |
25791b46dc48bec4375a8953d9b2def52761e237 | diff --git a/actionpack/lib/action_dispatch/http/response.rb b/actionpack/lib/action_dispatch/http/response.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_dispatch/http/response.rb
+++ b/actionpack/lib/action_dispatch/http/response.rb
@@ -136,20 +136,28 @@ module ActionDispatch # :nodoc:
@committed = false
@sending = false
@sent = false
- @content_type = nil
- @charset = self.class.default_charset
- if content_type = self[CONTENT_TYPE]
- type, charset = content_type.split(/;\s*charset=/)
- @content_type = Mime::Type.lookup(type)
- @charset = charset || self.class.default_charset
- end
+ content_type = parse_content_type self[CONTENT_TYPE]
+ @content_type = content_type.mime_type
+ @charset = content_type.charset
prepare_cache_control!
yield self if block_given?
end
+ ContentTypeHeader = Struct.new :mime_type, :charset
+
+ def parse_content_type(content_type)
+ if content_type
+ type, charset = content_type.split(/;\s*charset=/)
+ ContentTypeHeader.new(Mime::Type.lookup(type),
+ charset || self.class.default_charset)
+ else
+ ContentTypeHeader.new(nil, self.class.default_charset)
+ end
+ end
+
def have_header?(key); headers.key? key; end
def get_header(key); headers[key]; end
def set_header(key, v); headers[key] = v; end | pull content type parsing in to a method
we'll use this method later to lazily parse content type headers. | rails_rails | train | rb |
20506afccb4a2f9496e84be75aef4dccb598110a | diff --git a/lib/active_admin/callbacks.rb b/lib/active_admin/callbacks.rb
index <HASH>..<HASH> 100644
--- a/lib/active_admin/callbacks.rb
+++ b/lib/active_admin/callbacks.rb
@@ -58,12 +58,14 @@ module ActiveAdmin
def define_active_admin_callbacks(*names)
names.each do |name|
[:before, :after].each do |type|
- # Create an inheritable accessor array for the callbacks
- class_inheritable_array "#{type}_#{name}_callbacks".to_sym
- send("#{type}_#{name}_callbacks=".to_sym, [])
# Define a method to set the callback
class_eval(<<-EOS, __FILE__, __LINE__ + 1)
+ # def self.before_create_callbacks
+ def self.#{type}_#{name}_callbacks
+ @#{type}_#{name}_callbacks ||= []
+ end
+
# def self.before_create
def self.#{type}_#{name}(method = nil, &block)
#{type}_#{name}_callbacks << (method || block) | Removed the usage of deprected class_inheritable_array from Callbacks | activeadmin_activeadmin | train | rb |
47b28d99a17d492b37fcdd0fc41290419a010a0f | diff --git a/extras/src/main/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactory.java b/extras/src/main/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactory.java
index <HASH>..<HASH> 100644
--- a/extras/src/main/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactory.java
+++ b/extras/src/main/java/com/google/gson/typeadapters/RuntimeTypeAdapterFactory.java
@@ -120,6 +120,18 @@ import com.google.gson.stream.JsonWriter;
* .registerSubtype(Circle.class)
* .registerSubtype(Diamond.class);
* }</pre>
+ *
+ * <h3>Serialization and deserialization</h3>
+ * In order to serialize and deserialize a polymorphic object,
+ * you must specify the base type explicitly.
+ * <pre> {@code
+ * Diamond diamond = new Diamond();
+ * String json = gson.toJson(diamond, Shape.class);
+ * }</pre>
+ * And then:
+ * <pre> {@code
+ * Shape shape = gson.fromJson(json, Shape.class);
+ * }</pre>
*/
public final class RuntimeTypeAdapterFactory<T> implements TypeAdapterFactory {
private final Class<?> baseType; | The JavaDoc is now more accurate about the type adapter serialization and deserialization (#<I>) | google_gson | train | java |
cccd702f2af1d8b264631b9628d411d94a5802d3 | diff --git a/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java b/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java
+++ b/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java
@@ -1020,7 +1020,6 @@ public class ContentSpecProcessor implements ShutdownAbleApp {
final DataProviderFactory providerFactory, final CSNodeWrapper parentNode, final ContentSpecWrapper contentSpec,
final Map<SpecNode, CSNodeWrapper> nodeMapping) throws Exception {
final CSNodeProvider nodeProvider = providerFactory.getProvider(CSNodeProvider.class);
- final List<CSNodeWrapper> processedNodes = new ArrayList<CSNodeWrapper>();
UpdateableCollectionWrapper<CSNodeWrapper> levelChildren;
if (parentNode == null) {
@@ -1118,7 +1117,6 @@ public class ContentSpecProcessor implements ShutdownAbleApp {
changed = true;
}
}
- processedNodes.add(foundNodeEntity);
// If the node is a level than merge the children nodes as well
if (childNode instanceof Level) { | Cleaned up a variable that is no longer used. | pressgang-ccms_PressGangCCMSContentSpecProcessor | train | java |
6fdd98a4bb5f07eac7065f353940954f1a65072b | diff --git a/js/repeater-list.js b/js/repeater-list.js
index <HASH>..<HASH> 100755
--- a/js/repeater-list.js
+++ b/js/repeater-list.js
@@ -411,16 +411,9 @@
}
});
- function revertCheckbox ($checkboxLabel) {
+ function revertCheckbox ($checkbox) {
self.list_revertingCheckbox = true;
- var $input = $checkboxLabel.find('input');
- if ($input.is(':checked')) {
- $checkboxLabel.removeClass('checked');
- $input.prop('checked', false);
- } else {
- $checkboxLabel.addClass('checked');
- $input.prop('checked', true);
- }
+ $checkbox.checkbox('toggle');
delete self.list_revertingCheckbox;
}
}; | making use of toggle for revertCheckbox | ExactTarget_fuelux | train | js |
36ab26fcaed7a877d213b574cecc5c5ef332d812 | diff --git a/src/Curl/Curl.php b/src/Curl/Curl.php
index <HASH>..<HASH> 100644
--- a/src/Curl/Curl.php
+++ b/src/Curl/Curl.php
@@ -206,7 +206,7 @@ class Curl
*
* @return int Returns the error code for the current curl request
*/
- protected function exec()
+ public function exec()
{
$this->response_headers = array();
$this->response = curl_exec($this->curl);
@@ -284,7 +284,7 @@ class Curl
// public methods
/**
- * @deprecated calling exec() directly is discouraged
+ * @deprecated use `exec()` directly.
*/
public function _exec()
{ | wrapper method
the use of `_exec()` is not required, unless `exec()` is public. | php-mod_curl | train | php |
fafb5244815c98d81abf18ee5f2a13c41cde3c5d | diff --git a/lib/unexpected-check.js b/lib/unexpected-check.js
index <HASH>..<HASH> 100644
--- a/lib/unexpected-check.js
+++ b/lib/unexpected-check.js
@@ -60,10 +60,20 @@
return task;
}
+ function hasShrinkableGenerators() {
+ return generators.some(function (g) {
+ return g.shrink
+ })
+ }
+
function createTasks() {
var tasks = [];
var errors = 0;
for (var i = 0; i < maxIterations && errors < maxErrors; i += 1) {
+ if (errors > 0 && !hasShrinkableGenerators()) {
+ break;
+ }
+
var task = createTask();
tasks.push(task);
if (task.error) { | Stop iterating when you have found an error and the input can not be shrunken | unexpectedjs_unexpected-check | train | js |
969d5deb10f9aa393fa9b29f6358b5f356233620 | diff --git a/sources/lib/Model/FlexibleEntity/FlexibleEntityInterface.php b/sources/lib/Model/FlexibleEntity/FlexibleEntityInterface.php
index <HASH>..<HASH> 100644
--- a/sources/lib/Model/FlexibleEntity/FlexibleEntityInterface.php
+++ b/sources/lib/Model/FlexibleEntity/FlexibleEntityInterface.php
@@ -74,13 +74,18 @@ interface FlexibleEntityInterface
/**
* status
*
- * Return or set the current status of the instance. Status can be
- * FlexibleEntityInterface::STATUS_NONE,
- * FlexibleEntityInterface::STATUS_EXIST or
- * FlexibleEntityInterface::STATUS_MODIFIED.
+ * Return or set the current status of the instance. The status is a
+ * bitmask of the different possible states an entity can have.
+ * Status can be
+ * FlexibleEntityInterface::STATUS_NONE = 0,
+ * FlexibleEntityInterface::STATUS_EXIST = 1
+ * FlexibleEntityInterface::STATUS_MODIFIED = 2
+ * STATUS_EXIST + STATUS_MODIFIED = 3
+ * @see https://github.com/pomm-project/ModelManager/issues/46#issuecomment-130650107
*
- * If a status is specified, it returns itself. If no status are provided,
- * it returns the current status.
+ * If a status is specified, it sets the current entity's status and
+ * returns itself. If no status are provided, it returns the current
+ * status.
*
* @access public
* @param int (null) | Complete docblock for #<I> | pomm-project_ModelManager | train | php |
e720632955ba4f65d015c84a7930df5f360c5967 | diff --git a/Kwf/Auth/Adapter/Service.php b/Kwf/Auth/Adapter/Service.php
index <HASH>..<HASH> 100644
--- a/Kwf/Auth/Adapter/Service.php
+++ b/Kwf/Auth/Adapter/Service.php
@@ -117,7 +117,7 @@ class Kwf_Auth_Adapter_Service implements Zend_Auth_Adapter_Interface
private function _getCacheId()
{
- return 'login_brute_force_'.str_replace(array('.', ':'), array('_', '_'), $_SERVER['REMOTE_ADDR']);
+ return 'login_brute_force_'.str_replace(array('.', ':', ',', ' '), '_', $_SERVER['REMOTE_ADDR']);
}
private function _getCache() | Replace special characters in REMOTE_ADDR more tolerant
Some load balancers are concenating the Adresses which result in something like this: x.x.x.x, x.x.x.x | koala-framework_koala-framework | train | php |
540c7c7a4ab137033038216269ac3b55d38f935c | diff --git a/cmd.go b/cmd.go
index <HASH>..<HASH> 100644
--- a/cmd.go
+++ b/cmd.go
@@ -706,6 +706,7 @@ func (cmd commandRetr) Execute(conn *Conn, param string) {
}()
bytes, data, err := conn.driver.GetFile(path, conn.lastFilePos)
if err == nil {
+ defer data.Close()
conn.writeMessage(150, fmt.Sprintf("Data transfer starting %v bytes", bytes))
err = conn.sendOutofBandDataWriter(data)
} else {
diff --git a/conn.go b/conn.go
index <HASH>..<HASH> 100644
--- a/conn.go
+++ b/conn.go
@@ -206,6 +206,7 @@ func (conn *Conn) buildPath(filename string) (fullPath string) {
fullPath = filepath.Clean(conn.namePrefix)
}
fullPath = strings.Replace(fullPath, "//", "/", -1)
+ fullPath = strings.Replace(fullPath, string(filepath.Separator), "/", -1)
return
} | Convert back slashes to forward slashes; close data handle after retr (#<I>)
* Convert any back slashes to forward slashes
filepath.Clean will convert the path to using back slashes on windows
* Close the data handle after retr | goftp_server | train | go,go |
51a354b28017067235b70620c86200d6e08e98a4 | diff --git a/lib/package_tracker/response.rb b/lib/package_tracker/response.rb
index <HASH>..<HASH> 100644
--- a/lib/package_tracker/response.rb
+++ b/lib/package_tracker/response.rb
@@ -7,21 +7,25 @@ module PackageTracker
@tracking_number = tracking_number
@carrier = carrier
@statuses = statuses
- sort_statuses
+ sort_statuses!
end
def add_status(message, time, location="")
@statuses << { :message => message, :time => time, :location => location }
- sort_statuses
+ sort_statuses!
+ end
+
+ def current_status
+ @statuses.first
end
def delivered?
- @statuses.first[:message] == @carrier.delivered_status
+ current_status[:message] == @carrier.delivered_status
end
private
- def sort_statuses
+ def sort_statuses!
@statuses.sort_by! { |status| status[:time] }.reverse!
end
end | Cleaned up the response class a little | michaeltaras_package_tracker | train | rb |
61605cfe5fe042c9581e83cd13d0576b46fb1ec2 | diff --git a/rig/machine_control/tests/test_scp_connection.py b/rig/machine_control/tests/test_scp_connection.py
index <HASH>..<HASH> 100644
--- a/rig/machine_control/tests/test_scp_connection.py
+++ b/rig/machine_control/tests/test_scp_connection.py
@@ -31,8 +31,9 @@ def mock_conn():
return conn
-@pytest.mark.parametrize("bufsize, recv_size", [(232, 256), (256, 512),
- (248, 256)])
+@pytest.mark.parametrize("bufsize, recv_size", [(232, 512), (256, 512),
+ (248, 512), (504, 512),
+ (514, 1024)])
def test_success(mock_conn, bufsize, recv_size):
"""Test successfully transmitting and receiving, where the seq of the first
returned packet is wrong. | Fixed min bufsize test.
Absolute fail on my part by not running the test suite when that change was
made... Thanks Travis! | project-rig_rig | train | py |
e32c4d01469f92573fb4df702cbdaa728cf06b60 | diff --git a/router.go b/router.go
index <HASH>..<HASH> 100644
--- a/router.go
+++ b/router.go
@@ -136,6 +136,7 @@ func (router *Router) Refresh() (err *Error) {
}
func (router *Router) updateTree() {
+ router.Tree = pathtree.New()
for _, route := range router.Routes {
router.Tree.Add(route.TreePath, route)
if route.Method == "GET" { | Fix: reset pathtree on Refresh | revel_revel | train | go |
10506dd79e54d9dfd89d7a2b71ce6e333ef1f85d | diff --git a/hazelcast/src/main/java/com/hazelcast/config/ExecutorConfig.java b/hazelcast/src/main/java/com/hazelcast/config/ExecutorConfig.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/main/java/com/hazelcast/config/ExecutorConfig.java
+++ b/hazelcast/src/main/java/com/hazelcast/config/ExecutorConfig.java
@@ -24,7 +24,7 @@ public class ExecutorConfig {
/**
* The number of executor threads per Member for the Executor based on this configuration.
*/
- public static final int DEFAULT_POOL_SIZE = 8;
+ public static final int DEFAULT_POOL_SIZE = 16;
/**
* Capacity of Queue | The programmatic ExecutorConfig is now the same as the xml based on | hazelcast_hazelcast | train | java |
e47cfff6f718a0deaf9dc08158fa6a7ddfb43f7c | diff --git a/hwtypes/fp_vector_abc.py b/hwtypes/fp_vector_abc.py
index <HASH>..<HASH> 100644
--- a/hwtypes/fp_vector_abc.py
+++ b/hwtypes/fp_vector_abc.py
@@ -2,16 +2,16 @@ from abc import ABCMeta, abstractmethod
import typing as tp
import weakref
import warnings
-from enum import Enum, auto
+import enum
from . import AbstractBitVectorMeta, AbstractBitVector, AbstractBit
-class RoundingMode(Enum):
- RNE = auto() # roundTiesToEven
- RNA = auto() # roundTiesToAway
- RTP = auto() # roundTowardPositive
- RTN = auto() # roundTowardNegative
- RTZ = auto() # roundTowardZero
+class RoundingMode(enum.Enum):
+ RNE = enum.auto() # roundTiesToEven
+ RNA = enum.auto() # roundTiesToAway
+ RTP = enum.auto() # roundTowardPositive
+ RTN = enum.auto() # roundTowardNegative
+ RTZ = enum.auto() # roundTowardZero
class AbstractFPVectorMeta(ABCMeta):
# FPVectorType, (eb, mb, mode, ieee_compliance) : FPVectorType[eb, mb, mode, ieee_compliance] | Fix hwtypes.Enum import
Fixes issue where hwtypes.Enum was being overwritten by python Enum
(because of an import * in __init__.py). | leonardt_hwtypes | train | py |
478e456e8392be1356a795a354215ba7dbf03a7b | diff --git a/transformers/tests/modeling_common_test.py b/transformers/tests/modeling_common_test.py
index <HASH>..<HASH> 100644
--- a/transformers/tests/modeling_common_test.py
+++ b/transformers/tests/modeling_common_test.py
@@ -18,7 +18,7 @@ from __future__ import print_function
import copy
import sys
-import os
+import os.path
import shutil
import tempfile
import json
@@ -222,16 +222,18 @@ class CommonTestCases:
except RuntimeError:
self.fail("Couldn't trace module.")
- try:
- torch.jit.save(traced_gpt2, "traced_model.pt")
- except RuntimeError:
- self.fail("Couldn't save module.")
+ with TemporaryDirectory() as tmp_dir_name:
+ pt_file_name = os.path.join(tmp_dir_name, "traced_model.pt")
- try:
- loaded_model = torch.jit.load("traced_model.pt")
- os.remove("traced_model.pt")
- except ValueError:
- self.fail("Couldn't load module.")
+ try:
+ torch.jit.save(traced_gpt2, pt_file_name)
+ except Exception:
+ self.fail("Couldn't save module.")
+
+ try:
+ loaded_model = torch.jit.load(pt_file_name)
+ except Exception:
+ self.fail("Couldn't load module.")
model.to(torch_device)
model.eval() | Use a random temp dir for writing file in tests. | huggingface_pytorch-pretrained-BERT | train | py |
90634c06d9636c4090e6078011dcc329e1ef5804 | diff --git a/lib/yap/shell/parser/version.rb b/lib/yap/shell/parser/version.rb
index <HASH>..<HASH> 100644
--- a/lib/yap/shell/parser/version.rb
+++ b/lib/yap/shell/parser/version.rb
@@ -3,7 +3,7 @@ require 'yap/shell/parser'
module Yap
module Shell
module Parser
- VERSION = "0.6.1"
+ VERSION = "0.6.2"
end
end
end | Bumping version to <I> | zdennis_yap-shell-parser | train | rb |
46d963d55341270de6b37092dd9bb8d10069d3b8 | diff --git a/sprd/model/Product.js b/sprd/model/Product.js
index <HASH>..<HASH> 100644
--- a/sprd/model/Product.js
+++ b/sprd/model/Product.js
@@ -333,7 +333,6 @@ define(['sprd/model/ProductBase', 'js/core/List', 'sprd/data/ConfigurationTypeRe
},
save: function (options, callback) {
-
if (this.$originalProduct) {
if (this.hasChanges()) {
this.set('id', undefined);
@@ -365,7 +364,13 @@ define(['sprd/model/ProductBase', 'js/core/List', 'sprd/data/ConfigurationTypeRe
})
.exec(function (err) {
if (!err) {
- self.$originalProduct = self.clone();
+ var clone = self.clone();
+ // change original product against the clone in the entity
+ // so that the application can work with the original product
+ self.$context.removeEntityFromCache(self);
+ self.$context.addEntityToCache(clone);
+
+ self.$originalProduct = clone;
} else {
err = ProductCreationError.createFromResponse(err);
} | DEV-<I> - Basket items not working correctly
* fixed caching of newly created products | spreadshirt_rAppid.js-sprd | train | js |
02e5b6ab66973572da6018ac78d2321c0b1efa06 | diff --git a/python/perspective/perspective/widget/widget.py b/python/perspective/perspective/widget/widget.py
index <HASH>..<HASH> 100644
--- a/python/perspective/perspective/widget/widget.py
+++ b/python/perspective/perspective/widget/widget.py
@@ -409,6 +409,10 @@ class PerspectiveWidget(Widget, PerspectiveViewer):
if self._pending_binary:
msg = self._pending_binary
+ # manager looks at the `binary_length` flag so make sure to
+ # get rid of it before passing to `_process`.
+ del msg["binary_length"]
+
# arrow is a `MemoryView` - convert to bytes
arrow = buffers[0].tobytes()
msg["args"].insert(0, arrow) | Fix distributed editing in PerspectiveWidget | finos_perspective | train | py |
d9dc2e98b0243316b0fce612cef0d0b0c9df6026 | diff --git a/spec/controllers/footnotes_controller_spec.rb b/spec/controllers/footnotes_controller_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/controllers/footnotes_controller_spec.rb
+++ b/spec/controllers/footnotes_controller_spec.rb
@@ -14,6 +14,10 @@ end
describe FootnotesController do
+ def page
+ Capybara::Node::Simple.new(response.body)
+ end
+
shared_examples 'has_footnotes' do
it 'includes footnotes' do
response.body.should have_selector('#footnotes_debug')
@@ -47,6 +51,10 @@ describe FootnotesController do
before do
get :foo
end
+
+ it 'includes footnotes in the last div in body' do
+ all('body > :last-child')[0][:id].should == 'footnotes_debug'
+ end
end
describe 'when request is xhr' do | Ensure rails-footnotes is in the last child of body by default | josevalim_rails-footnotes | train | rb |
db06a5316a508a1563f925be96d062fb3bf47f09 | diff --git a/lib/base/utils.rb b/lib/base/utils.rb
index <HASH>..<HASH> 100644
--- a/lib/base/utils.rb
+++ b/lib/base/utils.rb
@@ -76,7 +76,7 @@ module VCAP::Services::Base::Utils
end
threads = (1..instances.size).collect do |i|
Thread.new(instances[i - 1]) do |t_instance|
- check_lock.synchronize {next unless check_set.include?(t_instance.name)}
+ next unless check_lock.synchronize {check_set.include?(t_instance.name)}
begin
t_instance.run
rescue => e | Fix duplicated run provisioned instance bug
When node process crashes and restart, all the running instances don't
need to run, but due to this bug, the running instance will be run
again.
Change-Id: Ia<I>d<I>bb<I>ad<I>ea8e9a<I>baed<I>d0c8d | cloudfoundry-attic_vcap-services-base | train | rb |
02e5fbceeaeacf7265ad7276a63f3d804e49f483 | diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/HttpKernel/Kernel.php
+++ b/src/Symfony/Component/HttpKernel/Kernel.php
@@ -63,12 +63,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
private $requestStackSize = 0;
private $resetServices = false;
- const VERSION = '4.0.8';
- const VERSION_ID = 40008;
+ const VERSION = '4.0.9-DEV';
+ const VERSION_ID = 40009;
const MAJOR_VERSION = 4;
const MINOR_VERSION = 0;
- const RELEASE_VERSION = 8;
- const EXTRA_VERSION = '';
+ const RELEASE_VERSION = 9;
+ const EXTRA_VERSION = 'DEV';
const END_OF_MAINTENANCE = '07/2018';
const END_OF_LIFE = '01/2019'; | bumped Symfony version to <I> | symfony_symfony | train | php |
9673f3fd42e6cdaa8e9f7e16965173c7de58b441 | diff --git a/packages/cozy-stack-client/src/AppCollection.js b/packages/cozy-stack-client/src/AppCollection.js
index <HASH>..<HASH> 100644
--- a/packages/cozy-stack-client/src/AppCollection.js
+++ b/packages/cozy-stack-client/src/AppCollection.js
@@ -11,6 +11,8 @@ export const normalizeApp = app => {
* Implements `DocumentCollection` API along with specific methods for `io.cozy.apps`.
*/
class AppCollection {
+ endpoint = '/apps/'
+
constructor(stackClient) {
this.stackClient = stackClient
}
@@ -24,8 +26,7 @@ class AppCollection {
* @throws {FetchError}
*/
async all() {
- const path = uri`/apps/`
- const resp = await this.stackClient.fetchJSON('GET', path)
+ const resp = await this.stackClient.fetchJSON('GET', this.endpoint)
return {
data: resp.data.map(app => normalizeApp(app)),
meta: { | refactor(stack): Prepare AppCollection to be overriden 🛠 | cozy_cozy-client | train | js |
7ed3de57202356b1868c648f5fba021c990e58b1 | diff --git a/synapse/async.py b/synapse/async.py
index <HASH>..<HASH> 100644
--- a/synapse/async.py
+++ b/synapse/async.py
@@ -116,6 +116,7 @@ class Boss(EventBus):
job[1].update( event[1] )
+ job[1]['done'] = True
self.fire('job:fini', job=job)
def jobs(self):
@@ -169,6 +170,7 @@ class Boss(EventBus):
if jid == None:
jid = guidstr()
+ info['done'] = False
info['times'] = []
job = (jid,info) | add done bool to job tufo | vertexproject_synapse | train | py |
01181a50d916a55bbbc9bd9530bdefda76480347 | diff --git a/Form/ProductFormType.php b/Form/ProductFormType.php
index <HASH>..<HASH> 100644
--- a/Form/ProductFormType.php
+++ b/Form/ProductFormType.php
@@ -16,6 +16,8 @@ class ProductFormType extends AbstractType
{
public function buildForm(FormBuilder $builder, array $options)
{
-
+ $builder
+ ->add('name')
+ ->add('description');
}
} | add a couple of fields to the product form | vespolina_commerce | train | php |
f6be9d8f441dc0153d068b156f72a1cda5cc4a97 | diff --git a/lib/date_misc/version.rb b/lib/date_misc/version.rb
index <HASH>..<HASH> 100644
--- a/lib/date_misc/version.rb
+++ b/lib/date_misc/version.rb
@@ -1,3 +1,3 @@
module DateMisc
- VERSION = '1.1.0'
+ VERSION = '1.1.1'
end | :point_up: bump minor version | kwappa_date_misc | train | rb |
de4cb686cbae1225428eddb9a97941532b43ac1f | diff --git a/src/tools/CrosshairsTool.js b/src/tools/CrosshairsTool.js
index <HASH>..<HASH> 100644
--- a/src/tools/CrosshairsTool.js
+++ b/src/tools/CrosshairsTool.js
@@ -31,7 +31,7 @@ export default class CrosshairsTool extends BaseTool {
super(props, defaultProps);
- this.mouseDownCallback = this._chooseLocation.bind(this);
+ this.preMouseDownCallback = this._chooseLocation.bind(this);
this.mouseDragCallback = this._chooseLocation.bind(this);
this.touchDragCallback = this._chooseLocation.bind(this);
} | fix(CrosshairsTool.js): Fixed mousedown callback name (#<I>)
Crosshairs would not work on click or mousedown because the callback name had been misspelled.
fix #<I> | cornerstonejs_cornerstoneTools | train | js |
561536a97b7e22e0a2c5ef7aa9a3caed3ca1cb91 | diff --git a/tests/test_pfs.py b/tests/test_pfs.py
index <HASH>..<HASH> 100644
--- a/tests/test_pfs.py
+++ b/tests/test_pfs.py
@@ -406,4 +406,4 @@ def test_inspect_branch():
def test_fsck():
client = python_pachyderm.Client()
- client.fsck()
+ assert len(list(client.fsck())) == 0 | Make sure there are no fsck errors | pachyderm_python-pachyderm | train | py |
930fab08fd78c86253427a38481c1871a5c75bcf | diff --git a/python/ccxt/base/exchange.py b/python/ccxt/base/exchange.py
index <HASH>..<HASH> 100644
--- a/python/ccxt/base/exchange.py
+++ b/python/ccxt/base/exchange.py
@@ -327,7 +327,7 @@ class Exchange(object):
headers = self.prepare_request_headers(headers)
url = self.proxy + url
if self.verbose:
- print(method, url, "\nRequest:", headers, body)
+ print(method, url, "\nRequest:", headers, "\n", body)
if body:
body = body.encode()
@@ -364,7 +364,7 @@ class Exchange(object):
self.raise_error(ExchangeError, url, method, e)
if self.verbose:
- print(method, url, "\nResponse:", str(response.headers), self.last_http_response)
+ print(method, url, str(response.status_code), "\nResponse:", str(response.headers), "\n", self.last_http_response)
self.handle_errors(response.status_code, response.reason, url, method, None, self.last_http_response)
return self.handle_rest_response(self.last_http_response, url, method, headers, body) | added http status codes to verbose responses in python #<I> | ccxt_ccxt | train | py |
b44471d7ce60d06cf797f34c7204cd0a059ac982 | diff --git a/floodsub_test.go b/floodsub_test.go
index <HASH>..<HASH> 100644
--- a/floodsub_test.go
+++ b/floodsub_test.go
@@ -1057,4 +1057,11 @@ func TestImproperlySignedMessageNotRelayed(t *testing.T) {
if len(honestPeerMessages) != 1 {
t.Fatalf("got %d messages, expected 1", len(honestPeerMessages))
}
+ if string(honestPeerMessages[0].GetData()) != string(correctMessage) {
+ t.Fatalf(
+ "got %s, expected message %s",
+ honestPeerMessages[0].GetData(),
+ correctMessage,
+ )
+ }
} | Ensure that the received message is the correct one | libp2p_go-libp2p-pubsub | train | go |
1c099ccf0a25723d2e28ec43b4aabd439e2d2f9b | diff --git a/sixpack/static/js/sixpack.js b/sixpack/static/js/sixpack.js
index <HASH>..<HASH> 100644
--- a/sixpack/static/js/sixpack.js
+++ b/sixpack/static/js/sixpack.js
@@ -63,13 +63,27 @@ $(function () {
});
$('.copy-querystring').tooltip({ trigger: 'manual', placement: 'left' });
+
+ $('#choose-kpi').on('change', function(e) {
+ var this_kpi = $(this).val();
+ if (this_kpi <= 0) {
+ e.preventDefault();
+ return;
+ }
+ url = '/experiment/' + experiment_name;
+ if (this_kpi != 'default') {
+ url += '?kpi=' + this_kpi;
+ }
+ window.location.href = url;
+ });
+
});
// Focus the edit description textarea when opening the modal
$('#desc-modal').on('shown', function() {
$('#edit-description-textarea').focus();
- })
+ });
}
// Draw charts on Dashboard page. | redirect when KPI is selected, refs #<I> | sixpack_sixpack | train | js |
20299e8d819ec9972ad37fbb07fd1d3326ab5fd7 | diff --git a/lib/spree_usa_epay/client.rb b/lib/spree_usa_epay/client.rb
index <HASH>..<HASH> 100644
--- a/lib/spree_usa_epay/client.rb
+++ b/lib/spree_usa_epay/client.rb
@@ -68,7 +68,8 @@ module SpreeUsaEpay
end
end
- def void(response_code, gateway_options)
+ def void(response_code, *args)
+ gateway_options = args.last
response = request(:void_transaction, { "Token" => security_token(gateway_options), "RefNum" => response_code })
success = response[:void_transaction_response][:void_transaction_return] #just returns true
ActiveMerchant::Billing::Response.new(success, "", {}, {}) | gateway_options can be passed as second or third argument to void
Either way, it's the last argument. Accept multiple arguments to void method and interpret final argument as the options
Fixes #<I> | spree-contrib_spree_usa_epay | train | rb |
cd9f68d9d7090dfcae0b6492814b1443a8de509f | diff --git a/lhc/io/bed_/depth.py b/lhc/io/bed_/depth.py
index <HASH>..<HASH> 100644
--- a/lhc/io/bed_/depth.py
+++ b/lhc/io/bed_/depth.py
@@ -24,8 +24,9 @@ def depth(args):
for read, interval in itertools.izip(read_iterator, it):
if interval is not None:
cnt[interval.name] += 1
- for k, v in sorted(cnt.iteritems(), key=lambda x: x[1]):
- args.output.write('{}\t{}\n'.format(k, v))
+ args.output.write('amplicon\tdepth\n')
+ for interval in BedLineIterator(args.bed):
+ args.output.write('{}\t{}\n'.format(interval.name, cnt[interval.name]))
interval_set = None
alignment_file = None | fixed missing amplicons in bed depth | childsish_sofia | train | py |
fca97ff86c13a703aff5cd621bdad15ee2b17e5c | diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java
index <HASH>..<HASH> 100644
--- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java
+++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/autoconfigure/ManagementServerProperties.java
@@ -99,7 +99,8 @@ public class ManagementServerProperties implements SecurityPrerequisite {
/**
* Sets the port of the management server, use {@code null} if the
- * {@link ServerProperties#getPort() server port} should be used. To disable use 0.
+ * {@link ServerProperties#getPort() server port} should be used. Set to 0 to use a
+ * random port or set to -1 to disable.
* @param port the port
*/
public void setPort(Integer port) { | Fix javadoc of management server port
See gh-<I> | spring-projects_spring-boot | train | java |
5536b1e82bb5c51aea333c38d71c550c72609013 | diff --git a/test/WatchTestCases.test.js b/test/WatchTestCases.test.js
index <HASH>..<HASH> 100644
--- a/test/WatchTestCases.test.js
+++ b/test/WatchTestCases.test.js
@@ -80,7 +80,7 @@ describe("WatchTestCases", () => {
});
before(() => remove(tempDirectory));
it("should compile", function(done) {
- this.timeout(30000);
+ this.timeout(45000);
const outputDirectory = path.join(__dirname, "js", "watch", category.name, testName);
let options = {}; | increase timeout for unrelated tests to see if they pass on CI | webpack_webpack | train | js |
87a8e3b0bb4a33b57963ee99b4d277b2eb755610 | diff --git a/src/components/Calendar.js b/src/components/Calendar.js
index <HASH>..<HASH> 100644
--- a/src/components/Calendar.js
+++ b/src/components/Calendar.js
@@ -187,8 +187,8 @@ class Calendar extends React.Component {
null
}
key={day}
- onClick={() => {
- if (!disabledDay) this.props.onDateSelect(day.unix());
+ onClick={e => {
+ if (!disabledDay) this.props.onDateSelect(day.unix(), e);
}}
onKeyDown={this._handleDayKeyDown}
ref={ref => { | pass e, prop expects an e in DateTimePicker | mxenabled_mx-react-components | train | js |
b6d1e981782bb640ac1557f064f0056187300efd | diff --git a/src/Driver/FileLocator.php b/src/Driver/FileLocator.php
index <HASH>..<HASH> 100644
--- a/src/Driver/FileLocator.php
+++ b/src/Driver/FileLocator.php
@@ -45,11 +45,4 @@ interface FileLocator
* @return bool
*/
public function fileExists($className);
-
- /**
- * Gets the file extension that mapping files are suffixed with.
- *
- * @return string
- */
- public function getFileExtension();
} | Remove FileLocator::getFileExtension() method
This is not really a requirement for implementation | rollerworks-graveyard_metadata | train | php |
c7439c2c02cecd970fd7ba40f4b943b3cb27242d | diff --git a/src/test/java/alexh/ConverterTest.java b/src/test/java/alexh/ConverterTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/alexh/ConverterTest.java
+++ b/src/test/java/alexh/ConverterTest.java
@@ -128,7 +128,7 @@ public class ConverterTest {
.expect(Converter::intoDouble, 123451123412341231.67132123121234761239847612938743123899d)
.expect(Converter::intoDecimal, new BigDecimal("123451123412341231.6713212312123476123984761293874312389"))
.expect(Converter::intoLocalDateTime, LocalDateTime
- .ofInstant(Instant.ofEpochMilli(123451123412341232l), ZoneId.of("Europe/London")))
+ .ofInstant(Instant.ofEpochMilli(123451123412341232l), ZoneId.systemDefault()))
.throwsWhen(Converter::intoZonedDateTime);
} | test(converter): london -> system default to allow tests to run in any time zone | alexheretic_dynamics | train | java |
12eb34616d39e7eee2d88ee1502f005be729c1b6 | diff --git a/src/LdapTools/Schema/Parser/SchemaYamlParser.php b/src/LdapTools/Schema/Parser/SchemaYamlParser.php
index <HASH>..<HASH> 100644
--- a/src/LdapTools/Schema/Parser/SchemaYamlParser.php
+++ b/src/LdapTools/Schema/Parser/SchemaYamlParser.php
@@ -23,6 +23,11 @@ use Symfony\Component\Yaml\Yaml;
class SchemaYamlParser implements SchemaParserInterface
{
/**
+ * @var string The folder where the schema files are located.
+ */
+ protected $schemaFolder = '';
+
+ /**
* @param string $schemaFolder
*/
public function __construct($schemaFolder) | Add a missing variable declaration to the class. | ldaptools_ldaptools | train | php |
b9dfa69855aaa93d35039b394976d315fabcfa0e | diff --git a/lib/AuthHelper.php b/lib/AuthHelper.php
index <HASH>..<HASH> 100644
--- a/lib/AuthHelper.php
+++ b/lib/AuthHelper.php
@@ -82,12 +82,12 @@ class AuthHelper
* @param string $redirectUrl
* @param string $state
* @param string[] $options
- * @param bool $redirect
+ * @param bool $return If true, will return the authentical url instead of auto-redirecting to the page.
* @throws SdkException if required configuration is not provided in $config
*
* @return void|string
*/
- public static function createAuthRequest($scopes, $redirectUrl = null, $state = null, $options = null, $redirect = null)
+ public static function createAuthRequest($scopes, $redirectUrl = null, $state = null, $options = null, $return = false)
{
$config = ShopifySDK::$config;
@@ -121,7 +121,7 @@ class AuthHelper
// https://{shop}.myshopify.com/admin/oauth/authorize?client_id={api_key}&scope={scopes}&redirect_uri={redirect_uri}&state={nonce}&grant_options[]={option}
$authUrl = $config['AdminUrl'] . 'oauth/authorize?client_id=' . $config['ApiKey'] . '&redirect_uri=' . $redirectUrl . "&scope=$scopes" . $state . $options;
- if (!is_null($redirect)) {
+ if ($return) {
return $authUrl;
} | Added $return variable in place of $redirect to simplify the code. | phpclassic_php-shopify | train | php |
864845090f9b48936fc9d17faba8d0bbb85cc283 | diff --git a/lib/ronin/arch.rb b/lib/ronin/arch.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/arch.rb
+++ b/lib/ronin/arch.rb
@@ -64,7 +64,7 @@ module Ronin
end
arch :x86, :endian => :little, :address_length => 4
- arch :amd64, :endian => :little, :address_length => 8
+ arch :x86_64, :endian => :little, :address_length => 8
arch :ia64, :endian => :little, :address_length => 8
arch :ppc, :endian => :big, :address_length => 4
arch :ppc64, :endian => :big, :address_length => 8 | * Rename amd<I> to x<I>_<I>, it's more technical name. | ronin-ruby_ronin | train | rb |
3f2909fe423c20a191dce772af85d77f93f43205 | diff --git a/pymatgen/analysis/defects/corrections.py b/pymatgen/analysis/defects/corrections.py
index <HASH>..<HASH> 100644
--- a/pymatgen/analysis/defects/corrections.py
+++ b/pymatgen/analysis/defects/corrections.py
@@ -509,7 +509,7 @@ class KumagaiCorrection(DefectCorrection):
self.metadata["gamma"] = find_optimal_gamma(bulk_lattice, self.dielectric,
self.madelung_energy_tolerance)
- if not len(self.metadata["g_sum"]):
+ if not self.metadata["g_sum"]:
if "g_sum" in entry.parameters.keys():
self.metadata["g_sum"] = entry.parameters["g_sum"]
else: | small bug fix in kumagai gsum | materialsproject_pymatgen | train | py |
96757cc219fd5cbbcc42aceeee5f0a9a9dd144a9 | diff --git a/go/vt/topo/test/serving.go b/go/vt/topo/test/serving.go
index <HASH>..<HASH> 100644
--- a/go/vt/topo/test/serving.go
+++ b/go/vt/topo/test/serving.go
@@ -251,7 +251,7 @@ func checkWatchSrvVSchema(t *testing.T, ts topo.Impl) {
}
// update with an empty value, should get a notification
- if err := ts.UpdateSrvVSchema(ctx, cell, nil); err != nil {
+ if err := ts.UpdateSrvVSchema(ctx, cell, emptySrvVSchema); err != nil {
t.Fatalf("UpdateSrvVSchema failed: %v", err)
}
for { | Fixing test to never call with nil. | vitessio_vitess | train | go |
b6877b0b4a2dca4fa22090d01a36826f7b5fa930 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -49,7 +49,7 @@
} else if (typeof input === 'object' && Array.isArray(input)) {
var resultset = [];
for (var i in input){
- resultset.push(this.roll(inpu[i]));
+ resultset.push(this.roll(input[i]));
}
return resultset;
} | Update index.js
because I suck at typing | troygoode_node-roll | train | js |
3dd517ed16ef70e0a002477387781e1100431581 | diff --git a/lib/track.js b/lib/track.js
index <HASH>..<HASH> 100644
--- a/lib/track.js
+++ b/lib/track.js
@@ -122,14 +122,17 @@ Track.prototype.play = function () {
Track.prototype.playPreview = function () {
var spotify = this._spotify;
var stream = new PassThrough();
+ var previewUrl = this.previewUrl;
- if (!this.previewUrl) {
- stream.emit('error', new Error('Track does not have preview available'));
+ if (!previewUrl) {
+ process.nextTick(function() {
+ stream.emit('error', new Error('Track does not have preview available'));
+ });
return stream;
}
- debug('GET %s', this.previewUrl);
- var req = spotify.agent.get(this.previewUrl)
+ debug('GET %s', previewUrl);
+ var req = spotify.agent.get(previewUrl)
.set({ 'User-Agent': spotify.userAgent })
.end()
.request(); | track: cache previewUrl from getter in playPreview method and emit error on stream in nextTick | TooTallNate_node-spotify-web | train | js |
611698c0a9ee148de2bbaa7391c885232560d493 | diff --git a/insteonplm/plm.py b/insteonplm/plm.py
index <HASH>..<HASH> 100644
--- a/insteonplm/plm.py
+++ b/insteonplm/plm.py
@@ -160,7 +160,7 @@ class PLM(asyncio.Protocol):
if cmd2 is not None:
txtcmd2 = '{:02x}'.format(cmd2)
- self.log.debug('Command 1: %x Command 2: %x cmd2: ', command['cmd1'], txtcommand2, txtcmd2)
+ self.log.debug('Command 1: %x Command 2: %s cmd2: %s', command['cmd1'], txtcommand2, txtcmd2)
addr = Address(device)
command1 = command['cmd1']
command2 = command['cmd2'] | Fixed logging in send_standard in PLM | nugget_python-insteonplm | train | py |
e679e157358cb4e3e566412867e922b7c502ec6d | diff --git a/manager/manager.go b/manager/manager.go
index <HASH>..<HASH> 100644
--- a/manager/manager.go
+++ b/manager/manager.go
@@ -302,7 +302,6 @@ func (m *Manager) Run(parent context.Context) error {
// Set the raft server as serving for the health server
healthServer.SetServingStatus("Raft", api.HealthCheckResponse_SERVING)
- localHealthServer.SetServingStatus("ControlAPI", api.HealthCheckResponse_SERVING)
defer func() {
m.server.Stop()
@@ -313,6 +312,8 @@ func (m *Manager) Run(parent context.Context) error {
return fmt.Errorf("can't initialize raft node: %v", err)
}
+ localHealthServer.SetServingStatus("ControlAPI", api.HealthCheckResponse_SERVING)
+
close(m.started)
go func() { | Moved the local health servers, set serving status change for ControlAPI api.HealthCheckResponse_SERVING to after the RaftNode.JoinAndStart() call so that if there are errors joining they will be output. | docker_swarmkit | train | go |
06cf082f6a91f491889bebc7895b23ee3685d2a6 | diff --git a/generators/generator-constants.js b/generators/generator-constants.js
index <HASH>..<HASH> 100644
--- a/generators/generator-constants.js
+++ b/generators/generator-constants.js
@@ -27,7 +27,7 @@ const NODE_VERSION = '12.16.1';
const YARN_VERSION = '1.22.4';
const NPM_VERSION = '6.14.5';
-const GRADLE_VERSION = '6.4';
+const GRADLE_VERSION = '6.4.1';
const JIB_VERSION = '2.2.0';
// Libraries version | update gradle to <I> (#<I>) | jhipster_generator-jhipster | train | js |
2514290608e34ac95b47bd34fb455c52a7aadd42 | diff --git a/tensorflow_datasets/image/places365_small.py b/tensorflow_datasets/image/places365_small.py
index <HASH>..<HASH> 100644
--- a/tensorflow_datasets/image/places365_small.py
+++ b/tensorflow_datasets/image/places365_small.py
@@ -7,6 +7,7 @@ import six.moves.urllib as urllib
import tensorflow as tf
import tensorflow_datasets.public_api as tfds
import os
+import fnmatch
import numpy as np
_BASE_URL = "http://data.csail.mit.edu/places/places365/"
@@ -125,7 +126,7 @@ class Places365Small(tfds.core.GeneratorBasedBuilder):
for image_name in tf.io.gfile.listdir(class_dir):
image = os.path.join(class_dir,image_name)
else:
- for class_dir in tf.io.gfile.listdir(class_dir)
+ for class_dir1 in tf.io.gfile.listdir(class_dir):
class_dir_path = os.path.join(class_dir,class_dir1)
for image_name in tf.io.gfile.listdir(class_dir_path):
image = os.path.join(class_dir_path,image_name) | Added dataset for Places<I> small --issue-<I> | tensorflow_datasets | train | py |
f7c22b94fe9929c165dcf18d6e21676d5407cfc8 | diff --git a/src/AmazonUrlBuilder.php b/src/AmazonUrlBuilder.php
index <HASH>..<HASH> 100644
--- a/src/AmazonUrlBuilder.php
+++ b/src/AmazonUrlBuilder.php
@@ -16,12 +16,11 @@ class AmazonUrlBuilder {
* with the new authentication.
*
* @param string $request - your existing request URI
- * @param string $access_key - your Amazon AWS access key
* @param string $version - (optional) the version of the service you are using
*
* @link http://www.ilovebonnie.net/2009/07/27/amazon-aws-api-rest-authentication-for-php-5/
*/
- private function GetSignedRequest($request, $access_key = false, $version = '2011-08-01') {
+ private function GetSignedRequest($request, $version = '2011-08-01') {
// Get a nice array of elements to work with
$uri_elements = parse_url($request);
@@ -34,9 +33,6 @@ class AmazonUrlBuilder {
// Add the new required paramters
$parameters['Timestamp'] = gmdate("Y-m-d\TH:i:s\Z");
$parameters['Version'] = $version;
- if (strlen($access_key) > 0) {
- $parameters['AWSAccessKeyId'] = $access_key;
- }
// The new authentication requirements need the keys to be sorted
ksort($parameters); | Remove unused access key from URL builder | MarcL_AmazonProductAPI | train | php |
ab8226ce63fd707dcfb0b21d199cb936718435d2 | diff --git a/src/formats/frontmatter.js b/src/formats/frontmatter.js
index <HASH>..<HASH> 100644
--- a/src/formats/frontmatter.js
+++ b/src/formats/frontmatter.js
@@ -8,9 +8,21 @@ preliminaries(true);
yamlParser(true);
tomlParser(true);
+function inferFrontmatterFormat(str) {
+ const firstLine = str.substr(0, str.indexOf('\n')).trim();
+ switch (firstLine) {
+ case "---":
+ return { lang: "yaml", delims: "---" };
+ case "+++":
+ return { lang: "toml", delims: "+++" };
+ case "{":
+ return { lang: "json", delims: ["{", "}"] };
+ }
+}
+
export default class Frontmatter {
fromFile(content) {
- const result = preliminaries.parse(content);
+ const result = preliminaries.parse(content, inferFrontmatterFormat(content));
const data = result.data;
data.body = result.content;
return data; | Infer front-matter type on our own. | netlify_netlify-cms | train | js |
3616f7208a45c1ba5f00c11f704eb4a081a6b22e | diff --git a/elasticsearch/connection/thrift.py b/elasticsearch/connection/thrift.py
index <HASH>..<HASH> 100644
--- a/elasticsearch/connection/thrift.py
+++ b/elasticsearch/connection/thrift.py
@@ -1,5 +1,6 @@
from __future__ import absolute_import
from socket import timeout as SocketTimeout
+from socket import error as SocketError
import time
import logging
@@ -69,7 +70,7 @@ class ThriftConnection(PoolingConnection):
except SocketTimeout as e:
self.log_request_fail(method, url, body, time.time() - start, exception=e)
raise ConnectionTimeout('TIMEOUT', str(e), e)
- except (TException, SocketTimeout) as e:
+ except (TException, SocketError) as e:
self.log_request_fail(method, url, body, time.time() - start, exception=e)
if tclient:
try: | socket.error is now caught in perform_request aswell.
Fixes #<I> | elastic_elasticsearch-py | train | py |
b7846e94ac741ff85e59ebca5e337556831022b2 | diff --git a/aws-sdk-core/lib/aws-sdk-core/api/docs/param_formatter.rb b/aws-sdk-core/lib/aws-sdk-core/api/docs/param_formatter.rb
index <HASH>..<HASH> 100644
--- a/aws-sdk-core/lib/aws-sdk-core/api/docs/param_formatter.rb
+++ b/aws-sdk-core/lib/aws-sdk-core/api/docs/param_formatter.rb
@@ -100,7 +100,7 @@ module Aws
end
def apply_comments(ref, text)
- lines = text.lines
+ lines = text.lines.to_a
if lines[0].match(/\n$/)
lines[0] = lines[0].sub(/\n$/, comments(ref) + "\n")
else | Fix a Ruby <I> and JRuby issue. | aws_aws-sdk-ruby | train | rb |
394c7eabe9a0938ea8c2bc69905725b4363119e5 | diff --git a/js/whitebit.js b/js/whitebit.js
index <HASH>..<HASH> 100644
--- a/js/whitebit.js
+++ b/js/whitebit.js
@@ -575,12 +575,12 @@ module.exports = class whitebit extends Exchange {
parseOHLCV (ohlcv, market = undefined, timeframe = '1m', since = undefined, limit = undefined) {
return [
- ohlcv[0] * 1000, // timestamp
- parseFloat (ohlcv[1]), // open
- parseFloat (ohlcv[3]), // high
- parseFloat (ohlcv[4]), // low
- parseFloat (ohlcv[2]), // close
- parseFloat (ohlcv[5]), // volume
+ this.safeTimestamp (ohlcv, 0), // timestamp
+ this.safeFloat (ohlcv, 1), // open
+ this.safeFloat (ohlcv, 3), // high
+ this.safeFloat (ohlcv, 4), // low
+ this.safeFloat (ohlcv, 2), // close
+ this.safeFloat (ohlcv, 5), // volume
];
} | whitebit parseOHLCV safe methods | ccxt_ccxt | train | js |
ce91c3820e090da11b9ca79157a437929cc78816 | diff --git a/Core/Constants.php b/Core/Constants.php
index <HASH>..<HASH> 100644
--- a/Core/Constants.php
+++ b/Core/Constants.php
@@ -223,7 +223,7 @@ define('THEMES_PATH', BASE_PATH . '/' . THEMES_DIR);
define('FRAMEWORK_PATH', realpath(__DIR__ . '/../'));
if(strpos(FRAMEWORK_PATH, BASE_PATH) === 0) {
- define('FRAMEWORK_DIR', trim(substr(FRAMEWORK_PATH, strlen(BASE_PATH)), '/'));
+ define('FRAMEWORK_DIR', trim(substr(FRAMEWORK_PATH, strlen(BASE_PATH)), DIRECTORY_SEPARATOR));
$frameworkDirSlashSuffix = FRAMEWORK_DIR ? FRAMEWORK_DIR . '/' : '';
} else {
throw new Exception("Path error: FRAMEWORK_PATH " . FRAMEWORK_PATH . " not within BASE_PATH " . BASE_PATH); | BUGIX: Fix regression causing the admin to crash on windows due to FRAMEWORK_DIR being prefixed by a backslash | silverstripe_silverstripe-framework | train | php |
46f9968b940dcd32bf946a18345893532ff208b4 | diff --git a/generators/server/templates/src/main/java/package/security/_CustomPersistentRememberMeServices.java b/generators/server/templates/src/main/java/package/security/_CustomPersistentRememberMeServices.java
index <HASH>..<HASH> 100644
--- a/generators/server/templates/src/main/java/package/security/_CustomPersistentRememberMeServices.java
+++ b/generators/server/templates/src/main/java/package/security/_CustomPersistentRememberMeServices.java
@@ -4,6 +4,7 @@ import <%=packageName%>.domain.PersistentToken;<% if (databaseType == 'sql' || d
import <%=packageName%>.domain.User;<%}%>
import <%=packageName%>.repository.PersistentTokenRepository;
import <%=packageName%>.repository.UserRepository;
+import <%=packageName%>.config.JHipsterProperties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.env.Environment; | added import of jhipsterproperties | jhipster_generator-jhipster | train | java |
9bd503b77f05b50b2fa7ffaae324809457100023 | diff --git a/pcef/core/editor.py b/pcef/core/editor.py
index <HASH>..<HASH> 100644
--- a/pcef/core/editor.py
+++ b/pcef/core/editor.py
@@ -133,7 +133,7 @@ class QCodeEdit(QtGui.QPlainTextEdit):
#: The custom context menu
self.contextMenu = QtGui.QMenu()
- # a.setIconVisibleInMenu(True)
+ self.contextMenu.setTitle("Edit")
a = QtGui.QAction(QtGui.QIcon(constants.ICON_UNDO[0]), "Undo", self)
a.setShortcut(constants.ICON_UNDO[1]) | Set editor context menu title to "Edit" | pyQode_pyqode.core | train | py |
0b63c46928c2d27233befc39a4cadc00f64aefd9 | diff --git a/dataviews/ndmapping.py b/dataviews/ndmapping.py
index <HASH>..<HASH> 100644
--- a/dataviews/ndmapping.py
+++ b/dataviews/ndmapping.py
@@ -48,6 +48,12 @@ class Dimension(param.Parameterized):
return self.__class__(**settings)
+ @property
+ def pprint_label(self):
+ unit = '' if self.unit is None else self.unit
+ return ' '.join([self.name, unit])
+
+
def pprint_value(self, value, rounding=2):
"""
Pretty prints the dimension name and value with the format_string | Added pprint_label to Dimension object | pyviz_holoviews | train | py |
301cd037dafe063030734e2481aa163a64a83adb | diff --git a/src/org/mozilla/javascript/ScriptRuntime.java b/src/org/mozilla/javascript/ScriptRuntime.java
index <HASH>..<HASH> 100644
--- a/src/org/mozilla/javascript/ScriptRuntime.java
+++ b/src/org/mozilla/javascript/ScriptRuntime.java
@@ -829,6 +829,11 @@ public class ScriptRuntime {
}
public static String numberToString(double d, int base) {
+ if ((base < 2) || (base > 36)) {
+ throw Context.reportRuntimeError1(
+ "msg.bad.radix", Integer.toString(base));
+ }
+
if (d != d)
return "NaN";
if (d == Double.POSITIVE_INFINITY)
@@ -838,11 +843,6 @@ public class ScriptRuntime {
if (d == 0.0)
return "0";
- if ((base < 2) || (base > 36)) {
- throw Context.reportRuntimeError1(
- "msg.bad.radix", Integer.toString(base));
- }
-
if (base != 10) {
return DToA.JS_dtobasestr(base, d);
} else { | ScriptRuntime: Fix range check to follow spec in numberToString() | mozilla_rhino | train | java |
d970156bef4399e0f9973a21eee328be96206a83 | diff --git a/pyomxplayerng/omxplayer.py b/pyomxplayerng/omxplayer.py
index <HASH>..<HASH> 100644
--- a/pyomxplayerng/omxplayer.py
+++ b/pyomxplayerng/omxplayer.py
@@ -20,7 +20,7 @@ class OMXPlayer(object):
bus_address_finder = pyomxplayerng.bus_finder.BusFinder()
try:
return Connection(bus_address_finder.get_address())
- except DBusConnectionError:
+ except DBusConnectionError, IOError:
connection = None
if self.tries < 50:
self.tries += 1 | Catch IOError in case omxplayer hasn't started yet and made /tmp/omxplayerdbus | willprice_python-omxplayer-wrapper | train | py |
1861e54c21594cbf3a11633ed978a148ac70247b | diff --git a/lib/boson/repo_index.rb b/lib/boson/repo_index.rb
index <HASH>..<HASH> 100644
--- a/lib/boson/repo_index.rb
+++ b/lib/boson/repo_index.rb
@@ -34,7 +34,8 @@ module Boson
# Reads and initializes index.
def read
return if @read
- @libraries, @commands, @lib_hashes = exists? ? Marshal.load(File.read(marshal_file)) : [[], [], {}]
+ @libraries, @commands, @lib_hashes = exists? ?
+ File.open( marshal_file, 'rb' ){|f| Marshal.load( f.read ) } : [[], [], {}]
delete_stale_libraries_and_commands
set_command_namespaces
@read = true
@@ -62,7 +63,7 @@ module Boson
end
def save_marshal_index(marshal_string)
- File.open(marshal_file, 'w') {|f| f.write marshal_string }
+ File.open(marshal_file, 'wb') {|f| f.write marshal_string }
end
def delete_stale_libraries_and_commands | save marshal in binary format for windows sake | cldwalker_boson | train | rb |
74cd71a8a3264df639934ffca5645db083dc1d26 | diff --git a/base/src/org/droidparts/adapter/cursor/TypedCursorAdapter.java b/base/src/org/droidparts/adapter/cursor/TypedCursorAdapter.java
index <HASH>..<HASH> 100644
--- a/base/src/org/droidparts/adapter/cursor/TypedCursorAdapter.java
+++ b/base/src/org/droidparts/adapter/cursor/TypedCursorAdapter.java
@@ -15,6 +15,9 @@
*/
package org.droidparts.adapter.cursor;
+import org.droidparts.annotation.inject.InjectSystemService;
+import org.droidparts.inject.Injector;
+
import android.app.Activity;
import android.database.Cursor;
import android.view.LayoutInflater;
@@ -22,12 +25,13 @@ import android.widget.CursorAdapter;
public abstract class TypedCursorAdapter<Model> extends CursorAdapter {
- protected final LayoutInflater layoutInflater;
+ @InjectSystemService
+ protected LayoutInflater layoutInflater;
public TypedCursorAdapter(Activity activity, Cursor cursor) {
super(activity, cursor);
+ Injector.get().inject(activity, this);
activity.startManagingCursor(cursor);
- layoutInflater = LayoutInflater.from(activity);
}
public void requery() { | Modified TypedCursorAdapter to do injection. | droidparts_droidparts | train | java |
660bfabdc22c536be2b1a8140c39af6d72f42bf4 | diff --git a/src/fields/LinkField.php b/src/fields/LinkField.php
index <HASH>..<HASH> 100644
--- a/src/fields/LinkField.php
+++ b/src/fields/LinkField.php
@@ -112,7 +112,7 @@ class LinkField extends Field
'owner' => $element,
];
- if (is_string($value)) {
+ if (is_string($value) && Json::decode($value)) {
// If value is a string we are loading the data from the database
try {
$attr += Json::decode($value, true); | Fixes #<I>
This just validates that the JSON::decode function isn't returning null before it tries to append it to the array. | sebastian-lenz_craft-linkfield | train | php |
0398ae24a2ad93c7190bb60099214a14171d441a | diff --git a/lib/ArangoDBClient/Connection.php b/lib/ArangoDBClient/Connection.php
index <HASH>..<HASH> 100644
--- a/lib/ArangoDBClient/Connection.php
+++ b/lib/ArangoDBClient/Connection.php
@@ -713,7 +713,7 @@ class Connection
* @return string the result of the json_encode
* @throws \ArangoDBClient\ClientException
*/
- public function json_encode_wrapper($data, $options = null)
+ public function json_encode_wrapper($data, $options = 0)
{
if ($this->_options[ConnectionOptions::OPTION_CHECK_UTF8_CONFORM] === true) {
self::check_encoding($data); | json_encode_wrapper: Let $options default to 0
hhvm croaks on `json_encode($str, null);`, make it happy by passing 0 as default options. | arangodb_arangodb-php | train | php |
530738c3aaa66b64b1955c29e99816bce8052dbb | diff --git a/cmd/root.go b/cmd/root.go
index <HASH>..<HASH> 100644
--- a/cmd/root.go
+++ b/cmd/root.go
@@ -17,7 +17,7 @@ import (
"k8s.io/client-go/pkg/runtime"
"k8s.io/client-go/tools/clientcmd"
- "github.com/backsplice/kubecfg/utils"
+ "github.com/ksonnet/kubecfg/utils"
)
const (
diff --git a/main.go b/main.go
index <HASH>..<HASH> 100644
--- a/main.go
+++ b/main.go
@@ -4,7 +4,7 @@ import (
"fmt"
"os"
- "github.com/backsplice/kubecfg/cmd"
+ "github.com/ksonnet/kubecfg/cmd"
)
// Version is overridden using `-X main.version` during release builds
diff --git a/vendor/vendor.json b/vendor/vendor.json
index <HASH>..<HASH> 100644
--- a/vendor/vendor.json
+++ b/vendor/vendor.json
@@ -995,5 +995,5 @@
"versionExact": "v2.0.0"
}
],
- "rootPath": "github.com/backsplice/kubecfg"
+ "rootPath": "github.com/ksonnet/kubecfg"
} | Rename backsplice -> ksonnet
Rename early and often. | bitnami_kubecfg | train | go,go,json |
9d8ccd4e0e7b0161cd0a70c775b2abd2fd6534c8 | diff --git a/Bolts/src/bolts/AppLinkNavigation.java b/Bolts/src/bolts/AppLinkNavigation.java
index <HASH>..<HASH> 100644
--- a/Bolts/src/bolts/AppLinkNavigation.java
+++ b/Bolts/src/bolts/AppLinkNavigation.java
@@ -118,7 +118,7 @@ public class AppLinkNavigation {
Bundle data = new Bundle();
data.putAll(getAppLinkData());
data.putString(AppLinks.KEY_NAME_TARGET, getAppLink().getSourceUrl().toString());
- data.putInt(KEY_NAME_VERSION, VERSION);
+ data.putString(KEY_NAME_VERSION, VERSION);
data.putString(KEY_NAME_USER_AGENT, "Bolts Android " + Bolts.VERSION);
data.putBundle(AppLinks.KEY_NAME_EXTRAS, getExtras());
return data; | One more instance of using a string. | BoltsFramework_Bolts-Android | train | java |
cd31d2da25f65f79946981644d9f0da7c807b6d2 | diff --git a/pymongo/collection.py b/pymongo/collection.py
index <HASH>..<HASH> 100644
--- a/pymongo/collection.py
+++ b/pymongo/collection.py
@@ -805,9 +805,6 @@ class Collection(common.BaseObject):
.. note:: The `manipulate` and `compile_re` parameters may default to
False in future releases.
- .. note:: The `max_scan` parameter requires server
- version **>= 1.5.1**
-
.. versionchanged:: 3.0
Removed the `network_timeout` parameter.
Deprecated the `tag_sets`, and | Delete an ancient note about MongoDB <I>. | mongodb_mongo-python-driver | train | py |
7c2413712edcac15d82e1e9f359e8234788bf798 | diff --git a/src/Illuminate/Container/Container.php b/src/Illuminate/Container/Container.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Container/Container.php
+++ b/src/Illuminate/Container/Container.php
@@ -6,7 +6,6 @@ use Closure;
use ArrayAccess;
use LogicException;
use ReflectionClass;
-use ReflectionFunction;
use ReflectionParameter;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Contracts\Container\Container as ContainerContract;
@@ -723,7 +722,7 @@ class Container implements ArrayAccess, ContainerContract
}
/**
- * Throw an exception that the concrete is not instantiable
+ * Throw an exception that the concrete is not instantiable.
*
* @param string $concrete
* @return void | Apply fixes from StyleCI (#<I>) | laravel_framework | train | php |
fc611ad2585f2dff1d56bcffe7ef3c04a3a5f03c | diff --git a/dns.go b/dns.go
index <HASH>..<HASH> 100644
--- a/dns.go
+++ b/dns.go
@@ -22,7 +22,7 @@ func (api *API) CreateDNSRecord(zoneID string, rr DNSRecord) (*DNSRecordResponse
}
var recordResp *DNSRecordResponse
- err = json.Unmarshal(res, recordResp)
+ err = json.Unmarshal(res, &recordResp)
if err != nil {
return nil, errors.Wrap(err, errUnmarshalError)
} | [bugfix] CreateDNSRecord wasn't being passed a pointer. (#<I>) | cloudflare_cloudflare-go | train | go |
513ebaf88ce559dc8047f919492fe1de8c71e8a2 | diff --git a/src/view/resolvers/resolveReference.js b/src/view/resolvers/resolveReference.js
index <HASH>..<HASH> 100644
--- a/src/view/resolvers/resolveReference.js
+++ b/src/view/resolvers/resolveReference.js
@@ -7,7 +7,10 @@ export default function resolveReference ( fragment, ref ) {
// TODO does `this` become `.` at parse time?
if ( ref === '.' || ref === 'this' ) return context;
if ( ref === '@keypath' ) return context.getKeypathModel();
- if ( ref === '@index' ) return fragment.findRepeatingFragment().context.getIndexModel();
+ if ( ref === '@index' ) {
+ const repeater = fragment.findRepeatingFragment();
+ return repeater.context.getIndexModel( repeater.index );
+ }
if ( ref === '@key' ) return fragment.findRepeatingFragment().context.getKeyModel();
// ancestor references | fix @index ref resolution in object iteration - see previous | ractivejs_ractive | train | js |
d67953266f2aae4d4f23447b654494d32e112fbe | diff --git a/src/Composer/Util/PackageSorter.php b/src/Composer/Util/PackageSorter.php
index <HASH>..<HASH> 100644
--- a/src/Composer/Util/PackageSorter.php
+++ b/src/Composer/Util/PackageSorter.php
@@ -13,6 +13,7 @@
namespace Composer\Util;
use Composer\Package\PackageInterface;
+use Composer\Package\RootPackageInterface;
class PackageSorter
{
@@ -29,7 +30,11 @@ class PackageSorter
$usageList = array();
foreach ($packages as $package) {
- foreach (array_merge($package->getRequires(), $package->getDevRequires()) as $link) {
+ $links = $package->getRequires();
+ if ($package instanceof RootPackageInterface) {
+ $links = array_merge($links, $package->getDevRequires());
+ }
+ foreach ($links as $link) {
$target = $link->getTarget();
$usageList[$target][] = $package->getName();
} | Do not read require-dev except for the root package when sorting packages | composer_composer | train | php |
a19da5075663321d49afd9beca574e4ee527f5b7 | diff --git a/librosa/core/spectrum.py b/librosa/core/spectrum.py
index <HASH>..<HASH> 100644
--- a/librosa/core/spectrum.py
+++ b/librosa/core/spectrum.py
@@ -67,7 +67,7 @@ def stft(
at frame ``t``.
The integers ``t`` and ``f`` can be converted to physical units by means
- of the utility functions `frames_to_sample` and `fft_frequencies`.
+ of the utility functions `frames_to_samples` and `fft_frequencies`.
Parameters
---------- | Fix function name in docs of STFT (#<I>)
The function is named frames_to_samples (see: <URL> | librosa_librosa | train | py |
fad055f83a97f43263f3d24723edff0dfac5e0d7 | diff --git a/lib/nm/version.rb b/lib/nm/version.rb
index <HASH>..<HASH> 100644
--- a/lib/nm/version.rb
+++ b/lib/nm/version.rb
@@ -1,3 +1,3 @@
module Nm
- VERSION = "0.2.0"
+ VERSION = "0.3.0"
end | version to <I>
* remove "magic underscore" behavior in the `partial` method #<I>
/cc @jcredding | redding_nm | train | rb |
cadb9a5080ae92776ae5675ac74ce1143d180453 | diff --git a/src/de/mrapp/android/preference/PreferenceActivity.java b/src/de/mrapp/android/preference/PreferenceActivity.java
index <HASH>..<HASH> 100644
--- a/src/de/mrapp/android/preference/PreferenceActivity.java
+++ b/src/de/mrapp/android/preference/PreferenceActivity.java
@@ -1110,6 +1110,14 @@ public abstract class PreferenceActivity extends Activity implements
if (currentFragment != null) {
showPreferenceScreen(currentFragment, currentBundle);
showBreadCrumbs(title, shortTitle);
+
+ for (int i = 0; i < getListAdapter().getCount(); i++) {
+ PreferenceHeader preferenceHeader = getListAdapter().getItem(i);
+
+ if (preferenceHeader.getFragment().equals(currentFragment)) {
+ currentPreferenceHeader = preferenceHeader;
+ }
+ }
}
if (selectedPreferenceHeader != ListView.INVALID_POSITION) { | The attribute currentPreferenceHeader is now also restored when the activity is resumed. | michael-rapp_AndroidPreferenceActivity | train | java |
77e66a795a37c6fa2238deb8a81b9a66f9cd75e7 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -79,9 +79,7 @@ var gulpSass = function gulpSass(options, sync) {
// Grab the base file name that's being worked on
sassFileSrc = file.relative;
// Grab the path portion of the file that's being worked on
- sassFileSrcPath = sassFileSrc.split(path.sep);
- sassFileSrcPath.pop();
- sassFileSrcPath = sassFileSrcPath.join(path.sep);
+ sassFileSrcPath = path.dirname(sassFileSrc);
if (sassFileSrcPath) {
//Prepend the path to all files in the sources array except the file that's being worked on
for (sourceFileIndex = 0; sourceFileIndex < sassMap.sources.length; sourceFileIndex++) { | Use path.dirname for enhanced readability | dlmanning_gulp-sass | train | js |
3a6ff81d69c6efc5423bcd7bdd7b7cdd35f17692 | diff --git a/closure/goog/dom/dom_test.js b/closure/goog/dom/dom_test.js
index <HASH>..<HASH> 100644
--- a/closure/goog/dom/dom_test.js
+++ b/closure/goog/dom/dom_test.js
@@ -394,9 +394,6 @@ function testCreateDomWithTypeAttribute() {
function testCreateDomWithClassList() {
var el = goog.dom.createDom('div', ['foo', 'bar']);
assertEquals('foo bar', el.className);
-
- el = goog.dom.createDom('div', ['foo', 'foo']);
- assertEquals('foo', el.className);
}
function testContains() { | Remove the test that checks whether goog.dom.createDom deduplicates class names.
It didn't promise deduplication and doesn't do that consistently.
-------------
Created by MOE: <URL> | google_closure-library | train | js |
aed0bf4a37fe1bedc3710ee997162fae0753488d | diff --git a/graphicscontext.go b/graphicscontext.go
index <HASH>..<HASH> 100644
--- a/graphicscontext.go
+++ b/graphicscontext.go
@@ -82,10 +82,6 @@ func (c *graphicsContext) initializeIfNeeded() error {
}
func (c *graphicsContext) Update(afterFrameUpdate func()) error {
- if err := shareable.Error(); err != nil {
- return err
- }
-
updateCount := clock.Update()
if err := c.initializeIfNeeded(); err != nil {
@@ -130,6 +126,10 @@ func (c *graphicsContext) Update(afterFrameUpdate func()) error {
_ = c.screen.DrawImage(c.offscreen, op)
shareable.ResolveStaleImages()
+
+ if err := shareable.Error(); err != nil {
+ return err
+ }
return nil
} | graphics: Check error at the end of the frame
The error should be raised as soon as possible. | hajimehoshi_ebiten | train | go |
b46897ad39d7307a144ca7ce797f69ce9e94cd1d | diff --git a/salt/states/ssh_auth.py b/salt/states/ssh_auth.py
index <HASH>..<HASH> 100644
--- a/salt/states/ssh_auth.py
+++ b/salt/states/ssh_auth.py
@@ -272,11 +272,24 @@ def absent(name,
'comment': ''}
# Get just the key
- keydata = name.split(' ')
- if len(keydata) > 1:
- name = keydata[1]
+ sshre = re.compile(r'^(.*?)\s?((?:ssh\-|ecds)[\w-]+\s.+)$')
+ fullkey = sshre.search(name)
+ # if it is {key} [comment]
+ if not fullkey:
+ key_and_comment = name.split()
+ name = key_and_comment[0]
+ if len(key_and_comment) == 2:
+ comment = key_and_comment[1]
else:
- name = keydata[0]
+ # if there are options, set them
+ if fullkey.group(1):
+ options = fullkey.group(1).split(',')
+ # key is of format: {enc} {key} [comment]
+ comps = fullkey.group(2).split()
+ enc = comps[0]
+ name = comps[1]
+ if len(comps) == 3:
+ comment = comps[2]
if __opts__['test']:
check = __salt__['ssh.check_key']( | make ssh_auth.present and ssh_auth.absent behave sanely with same key material | saltstack_salt | train | py |
ff7db79e8bceaf62c541b39b14c91480cbda444b | diff --git a/logging/src/main/java/org/jboss/as/logging/LoggingSubsystemAdd.java b/logging/src/main/java/org/jboss/as/logging/LoggingSubsystemAdd.java
index <HASH>..<HASH> 100644
--- a/logging/src/main/java/org/jboss/as/logging/LoggingSubsystemAdd.java
+++ b/logging/src/main/java/org/jboss/as/logging/LoggingSubsystemAdd.java
@@ -120,6 +120,7 @@ class LoggingSubsystemAdd extends AbstractAddStepHandler {
subsystemHandlers.addAll(resource.getChildrenNames(CustomHandlerResourceDefinition.CUSTOM_HANDLER));
subsystemHandlers.addAll(resource.getChildrenNames(FileHandlerResourceDefinition.FILE_HANDLER));
subsystemHandlers.addAll(resource.getChildrenNames(PeriodicHandlerResourceDefinition.PERIODIC_ROTATING_FILE_HANDLER));
+ subsystemHandlers.addAll(resource.getChildrenNames(PeriodicSizeRotatingHandlerResourceDefinition.PERIODIC_SIZE_ROTATING_FILE_HANDLER));
subsystemHandlers.addAll(resource.getChildrenNames(SizeRotatingHandlerResourceDefinition.SIZE_ROTATING_FILE_HANDLER));
subsystemHandlers.addAll(resource.getChildrenNames(SyslogHandlerResourceDefinition.SYSLOG_HANDLER)); | [WFCORE-<I>] Remove configured periodic-size-rotating-file-handlers from the subsystem add operation to ensure they're not reconfigured. | wildfly_wildfly-core | train | java |
6f5bea5f8d859de5f7edca084a0c300dd639e6cc | diff --git a/library/Garp/Service/Slack.php b/library/Garp/Service/Slack.php
index <HASH>..<HASH> 100644
--- a/library/Garp/Service/Slack.php
+++ b/library/Garp/Service/Slack.php
@@ -37,7 +37,7 @@ class Garp_Service_Slack {
* @param $text Text to post in the Slack message
* @param $params Extra, optional Slack parameters that
* override the app-wide settings in app.ini,
- * that in turn override Slack's Incoming
+ * that in turn override Slack's Incoming
* Webhook settings.
* f.i.:
* 'username' => 'me',
@@ -82,6 +82,9 @@ class Garp_Service_Slack {
$port = $isHttps ? 443 : 80;
$fp = fsockopen(($isHttps ? 'ssl://' : '') . $host, $port);
+ if (false === $fp) {
+ return false;
+ }
$content = http_build_query($data);
fwrite($fp, "POST {$parsedUrl['path']} HTTP/1.1\r\n"); | Abort early when socket connection fails | grrr-amsterdam_garp3 | train | php |
0997b461c9e655d9556aee41d3cc0dbc8800fe05 | diff --git a/pelix/ipopo/handlers/temporal.py b/pelix/ipopo/handlers/temporal.py
index <HASH>..<HASH> 100644
--- a/pelix/ipopo/handlers/temporal.py
+++ b/pelix/ipopo/handlers/temporal.py
@@ -50,7 +50,7 @@ import threading
# ------------------------------------------------------------------------------
-class _HandlerFactory(requires._HandlerFactory):
+class _HandlerFactory(constants.HandlerFactory):
"""
Factory service for service registration handlers
""" | Temporal handler factory doesn't have to inherit from Requires' one | tcalmant_ipopo | train | py |
01514c3017977bc836be945ffaf0cd2dc359b6b8 | diff --git a/model/MediaSource.php b/model/MediaSource.php
index <HASH>..<HASH> 100644
--- a/model/MediaSource.php
+++ b/model/MediaSource.php
@@ -176,6 +176,7 @@ class MediaSource extends Configurable implements MediaManagement
}
$fileLink = $fileLink instanceof \core_kernel_classes_Resource ? $fileLink->getUri() : (string)$fileLink;
$fileManagement = FileManager::getFileManagementModel();
+
return $fileManagement->getFileStream($fileLink);
}
@@ -202,7 +203,15 @@ class MediaSource extends Configurable implements MediaManagement
public function getBaseName($link)
{
$stream = $this->getFileStream($link);
- return basename($stream->getMetadata('uri'));
+ $filename = $stream->getMetadata('uri');
+
+ if ($filename === 'php://temp') {
+ // We are currently retrieving a remote resource (e.g. on Amazon S3).
+ $fileinfo = $this->getFileInfo($link);
+ $filename = $fileinfo['link'];
+ }
+
+ return basename($filename);
}
/** | Get meaningful filename in compiled items. | oat-sa_extension-tao-mediamanager | train | php |
f6bfc4f716de62d8fcb832517e0d0a6da868f0ea | diff --git a/src/recurrent/rnn.js b/src/recurrent/rnn.js
index <HASH>..<HASH> 100644
--- a/src/recurrent/rnn.js
+++ b/src/recurrent/rnn.js
@@ -155,7 +155,9 @@ export default class RNN {
model.equationConnections.push(outputs);
equation.add(equation.multiply(model.outputConnector, output), model.output);
- model.allMatrices = model.allMatrices.concat(equation.allMatrices);
+ for (let i = 0, max = equation.allMatrices.length; i < max; i++) {
+ model.allMatrices.push(equation.allMatrices[i]);
+ }
model.equations.push(equation);
} | partial fix for #<I>. After all matrices get exponentially larger, duplicating allMatrices suffers a performance hit. This pushes to original rather than create a new one every time. | BrainJS_brain.js | train | js |
4fa114f0df0c7e3ccf7a5d841297ef59cfd2ce60 | diff --git a/src/Pingpong/Modules/Commands/ModuleMigrateRefreshCommand.php b/src/Pingpong/Modules/Commands/ModuleMigrateRefreshCommand.php
index <HASH>..<HASH> 100644
--- a/src/Pingpong/Modules/Commands/ModuleMigrateRefreshCommand.php
+++ b/src/Pingpong/Modules/Commands/ModuleMigrateRefreshCommand.php
@@ -21,7 +21,7 @@ class ModuleMigrateRefreshCommand extends Command {
*
* @var string
*/
- protected $description = 'Refresh the modules migrations.';
+ protected $description = 'Rollback & re-migrate the modules migrations.';
/**
* Execute the console command. | Updated command description for module:migrate-refresh | pingpong-labs_modules | train | php |
ef7fdcebde9074575af050b3b7309508e8bc11d9 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,6 @@ setup(
url=url,
packages=find_packages(exclude=['tests', 'tests.*', 'qa_tests', 'qa_tests.*']),
install_requires=[
- 'openquake',
'numpy',
'scipy'
], | virtual package openquake removed from dependencies | gem_oq-engine | train | py |
e01ff96550101fa88a80fd50d661261be180350b | diff --git a/test/set.js b/test/set.js
index <HASH>..<HASH> 100644
--- a/test/set.js
+++ b/test/set.js
@@ -71,7 +71,7 @@ describe('async-chainable.set() - simple setters', function() {
});
it('set undefined', function() {
- expect(context).to.not.have.property('mumble');
+ expect(context).to.have.property('mumble');
expect(context.mumble).to.be.undefined;
}); | BUGFIX TEST: Strange case of setting undefineds with .set() | hash-bang_async-chainable | train | js |
f00b0a877ee2cb8ca79b4d0cdf3cbb0a6a17743b | diff --git a/src/inline-attachment.js b/src/inline-attachment.js
index <HASH>..<HASH> 100644
--- a/src/inline-attachment.js
+++ b/src/inline-attachment.js
@@ -344,6 +344,8 @@
}
}
+ if (result) { e.preventDefault(); }
+
return result;
}; | If we did handle the paste, we should stop here
- otherwise, they will be additional "paste" of the filename into the textarea | Rovak_InlineAttachment | train | js |
b7d4767dd679ff81cfdf53c2cc5d8eeabab9112c | diff --git a/helper/schema/resource_importer.go b/helper/schema/resource_importer.go
index <HASH>..<HASH> 100644
--- a/helper/schema/resource_importer.go
+++ b/helper/schema/resource_importer.go
@@ -43,3 +43,10 @@ type StateFunc func(*ResourceData, interface{}) ([]*ResourceData, error)
func (r *ResourceImporter) InternalValidate() error {
return nil
}
+
+// ImportStatePassthrough is an implementation of StateFunc that can be
+// used to simply pass the ID directly through. This should be used only
+// in the case that an ID-only refresh is possible.
+func ImportStatePassthrough(d *ResourceData, m interface{}) ([]*ResourceData, error) {
+ return []*ResourceData{d}, nil
+} | helper/schema: pass through import state func | hashicorp_terraform | train | go |
1f9331988bf17b254bf1d46e5934b57cc7c7cb6a | diff --git a/hystrix-core/src/test/java/com/netflix/hystrix/HystrixObservableCommandTest.java b/hystrix-core/src/test/java/com/netflix/hystrix/HystrixObservableCommandTest.java
index <HASH>..<HASH> 100644
--- a/hystrix-core/src/test/java/com/netflix/hystrix/HystrixObservableCommandTest.java
+++ b/hystrix-core/src/test/java/com/netflix/hystrix/HystrixObservableCommandTest.java
@@ -5434,6 +5434,7 @@ public class HystrixObservableCommandTest extends CommonHystrixCommandTests<Test
.setCircuitBreaker(circuitBreaker)
.setMetrics(circuitBreaker.metrics)
.setCommandPropertiesDefaults(HystrixCommandPropertiesTest.getUnitTestPropertiesSetter()
+ .withExecutionTimeoutEnabled(false)
.withExecutionIsolationStrategy(ExecutionIsolationStrategy.SEMAPHORE)
.withCircuitBreakerEnabled(false))
.setExecutionSemaphore(semaphore)); | Do not let execution timeout break the test | Netflix_Hystrix | train | java |
8975f6b98d1f16700d09e280dbffb77dbc115d8a | diff --git a/src/test/java/org/vafer/jdependency/DependencyUtilsTestCase.java b/src/test/java/org/vafer/jdependency/DependencyUtilsTestCase.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/vafer/jdependency/DependencyUtilsTestCase.java
+++ b/src/test/java/org/vafer/jdependency/DependencyUtilsTestCase.java
@@ -62,6 +62,8 @@ public final class DependencyUtilsTestCase {
final int jdk = getJavaVersion();
+ System.out.println(jdk);
+
if (jdk >= 9) {
expectedDependencies.add("java.lang.Deprecated");
}
@@ -74,6 +76,6 @@ public final class DependencyUtilsTestCase {
expectedDependencies.add("jdk.internal.vm.annotation.IntrinsicCandidate");
}
- assertEquals(expectedDependencies, dependencies);
+ assertEquals("deps should be the same for jdk " + jdk, expectedDependencies, dependencies);
}
} | report jdk version in test | tcurdt_jdependency | train | java |
927786ebf01876a44c9018599d2451c0f5a39d22 | diff --git a/src/Gdbots/Pbj/Serializer/YamlSerializer.php b/src/Gdbots/Pbj/Serializer/YamlSerializer.php
index <HASH>..<HASH> 100644
--- a/src/Gdbots/Pbj/Serializer/YamlSerializer.php
+++ b/src/Gdbots/Pbj/Serializer/YamlSerializer.php
@@ -13,7 +13,19 @@ class YamlSerializer extends PhpArraySerializer
*/
public function serialize(Message $message, array $options = [])
{
- return Yaml::dump(parent::serialize($message, $options));
+ if (!isset($options['yaml_inline'])) {
+ $options['yaml_inline'] = 3;
+ }
+
+ if (!isset($options['yaml_indent'])) {
+ $options['yaml_indent'] = 2;
+ }
+
+ return Yaml::dump(
+ parent::serialize($message, $options),
+ (int) $options['yaml_inline'],
+ (int) $options['yaml_indent']
+ );
}
/** | go yaml inline at 3 levels | gdbots_pbj-php | train | php |
83bdd7df5e6e502471d62aba97a0ec047c379fba | diff --git a/shutit_global.py b/shutit_global.py
index <HASH>..<HASH> 100644
--- a/shutit_global.py
+++ b/shutit_global.py
@@ -158,7 +158,7 @@ class ShutIt(object):
msg = '\nWARNING: command:\n' + send + '\nreturned unaccepted exit code: ' + res + '\nIf this is expected, pass in check_exit=False or an exit_values array into the send_and_expect function call.\nIf you want to error on these errors, set the config:\n[build]\naction_on_ret_code:error'
cfg['build']['report'] = cfg['build']['report'] + msg
if cfg['build']['action_on_ret_code'] == 'error':
- self.pause_point(msg + '\n\nPause point on exit_code != 0. CTRL-C to quit',child=child,force=True)
+ util.fail(msg + '\n\nPause point on exit_code != 0. CTRL-C to quit',child=child)
#raise Exception('Exit value from command\n' + send + '\nwas:\n' + res)
def run_script(self,script,expect=None,child=None,is_bash=True): | A non-zero exit code is a failure | ianmiell_shutit | train | py |
569cbf065c1c54d0f72116e64a686ce43ca32f09 | diff --git a/_config.php b/_config.php
index <HASH>..<HASH> 100644
--- a/_config.php
+++ b/_config.php
@@ -3,8 +3,6 @@
// If subsites is installed
if(class_exists('Users_Account_Controller')) {
Users_Account_Controller::add_extension('OrdersUserAccountControllerExtension');
- Member::add_extension('OrdersMemberExtension');
- Users_Account_Controller::add_extension("CheckoutUserAccountControllerExtension");
}
// If subsites is installed
@@ -12,8 +10,3 @@ if(class_exists('Subsite')) {
Order::add_extension('SubsitesOrdersExtension');
OrderAdmin::add_extension('SubsiteMenuExtension');
}
-
-// If subsites is installed
-if(class_exists('SiteConfig')) {
- SiteConfig::add_extension('OrdersSiteConfigExtension');
-} | Tidy up requires in _config.php | silvercommerce_checkout | train | php |
18b5c65a88b4f5a6640b2c1bab76b0a39ca4a56f | diff --git a/lib/bibformatadminlib.py b/lib/bibformatadminlib.py
index <HASH>..<HASH> 100644
--- a/lib/bibformatadminlib.py
+++ b/lib/bibformatadminlib.py
@@ -1228,7 +1228,6 @@ def get_templates_that_use_element(name):
format_templates[template_name] = {'name':template_name,
'filename':possible_template}
except:
- print name+" not found in "+str(format_elements)
pass
keys = format_templates.keys() | Removed debugging code that would break HTML output of format element dependencies. | inveniosoftware_invenio-formatter | train | py |
6608fb080e32017d1d14c80cccc6736127b69dba | diff --git a/lib/alexa.rb b/lib/alexa.rb
index <HASH>..<HASH> 100644
--- a/lib/alexa.rb
+++ b/lib/alexa.rb
@@ -1,10 +1,3 @@
-require "cgi"
-require "base64"
-require "openssl"
-require "digest/sha1"
-require "net/https"
-require "time"
-
require "multi_xml"
require "alexa/version"
@@ -15,5 +8,5 @@ require "alexa/api/url_info"
module Alexa
API_VERSION = "2005-07-11"
- API_HOST = "awis.amazonaws.com"
+ API_HOST = "awis.amazonaws.com"
end
diff --git a/lib/alexa/connection.rb b/lib/alexa/connection.rb
index <HASH>..<HASH> 100644
--- a/lib/alexa/connection.rb
+++ b/lib/alexa/connection.rb
@@ -1,3 +1,10 @@
+require "cgi"
+require "base64"
+require "openssl"
+require "digest/sha1"
+require "net/http"
+require "time"
+
module Alexa
class Connection
attr_reader :secret_access_key, :access_key_id, :params | moved required libs to connection file | morgoth_alexa | train | rb,rb |
79c95ee3309da3c02c263b9cf7e963f6349654c8 | diff --git a/boiler/config.py b/boiler/config.py
index <HASH>..<HASH> 100644
--- a/boiler/config.py
+++ b/boiler/config.py
@@ -60,8 +60,8 @@ class DefaultConfig(Config):
MAX_CONTENT_LENGTH = 1024 * 1024 * 16 # megabytes
# database
- # 'mysql://user:password@server/db?charset=utf8mb'
- # 'mysql+pymysql://user:password@server/db?charset=utf8mb'
+ # 'mysql://user:password@server/db?charset=utf8mb4'
+ # 'mysql+pymysql://user:password@server/db?charset=utf8mb4'
SQLALCHEMY_ECHO = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
MIGRATIONS_PATH = os.path.join(os.getcwd(), 'migrations') | It’s actually utf8mb4 | projectshift_shift-boiler | 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.