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
|
---|---|---|---|---|---|
5def3256aefdaaf71520ff30207e922a385c0b41 | diff --git a/ArgusCore/src/test/java/com/salesforce/dva/argus/service/metric/transform/FillTransformTest.java b/ArgusCore/src/test/java/com/salesforce/dva/argus/service/metric/transform/FillTransformTest.java
index <HASH>..<HASH> 100644
--- a/ArgusCore/src/test/java/com/salesforce/dva/argus/service/metric/transform/FillTransformTest.java
+++ b/ArgusCore/src/test/java/com/salesforce/dva/argus/service/metric/transform/FillTransformTest.java
@@ -535,7 +535,6 @@ public class FillTransformTest {
}
@Test
-
public void testMinusTimestamp_1() {
long now = System.currentTimeMillis();
@@ -656,4 +655,4 @@ public class FillTransformTest {
}
}
-/* Copyright (c) 2016, Salesforce.com, Inc. All rights reserved. */
\ No newline at end of file
+/* Copyright (c) 2016, Salesforce.com, Inc. All rights reserved. */ | Update FillTransformTest.java | salesforce_Argus | train | java |
f5b3ccb7f9813943f477204a4b61370b0def76bb | diff --git a/runtests/mpi/tester.py b/runtests/mpi/tester.py
index <HASH>..<HASH> 100644
--- a/runtests/mpi/tester.py
+++ b/runtests/mpi/tester.py
@@ -312,6 +312,13 @@ class Tester(BaseTester):
# mpi subs will use system version of package
cmdargs.extend(['--mpisub-site-dir=' + site_dir])
+ # workaround the strict openmpi oversubscribe policy
+ # the parameter is found from
+ # https://github.com/open-mpi/ompi/blob/ba47f738871ff06b8e8f34b8e18282b9fe479586/orte/mca/rmaps/base/rmaps_base_frame.c#L169
+ # see the faq:
+ # https://www.open-mpi.org/faq/?category=running#oversubscribing
+ os.environ['OMPI_MCA_rmaps_base_oversubscribe'] = '1'
+
os.execvp(mpirun[0], mpirun + cmdargs + additional)
# if we are here os.execvp has failed; bail | workaround oversubscription of openmpi. | bccp_runtests | train | py |
5ee9658682c4da44a2369dda77209ff84fa72e7b | diff --git a/listing-bundle/contao/modules/ModuleListing.php b/listing-bundle/contao/modules/ModuleListing.php
index <HASH>..<HASH> 100644
--- a/listing-bundle/contao/modules/ModuleListing.php
+++ b/listing-bundle/contao/modules/ModuleListing.php
@@ -51,7 +51,7 @@ class ModuleListing extends \Module
{
$objTemplate = new \BackendTemplate('be_wildcard');
- $objTemplate->wildcard = '### LISTING ###';
+ $objTemplate->wildcard = '### ' . utf8_strtoupper($GLOBALS['TL_LANG']['FMD']['listing'][0]) . ' ###';
$objTemplate->title = $this->headline;
$objTemplate->id = $this->id;
$objTemplate->link = $this->name; | [Listing] Use the module names as back end wildcards (see #<I>) | contao_contao | train | php |
e2b982d0bee939e5b037ae99148075b6321f9b1c | diff --git a/slave/buildslave/runprocess.py b/slave/buildslave/runprocess.py
index <HASH>..<HASH> 100644
--- a/slave/buildslave/runprocess.py
+++ b/slave/buildslave/runprocess.py
@@ -36,6 +36,7 @@ from twisted.internet import protocol
from twisted.internet import reactor
from twisted.internet import task
from twisted.python import log
+from twisted.python import failure
from twisted.python import runtime
from twisted.python.win32 import quoteArguments
@@ -421,7 +422,7 @@ class RunProcess(object):
try:
self._startCommand()
except Exception:
- log.err("error in RunProcess._startCommand")
+ log.err(failure.Failure(), "error in RunProcess._startCommand")
self._addToBuffers('stderr', "error in RunProcess._startCommand\n")
self._addToBuffers('stderr', traceback.format_exc())
self._sendBuffers() | output traceback to log for AbandonChain exeption | buildbot_buildbot | train | py |
1d0fd879bca318e75f1fdddd0100bf8fd321a27e | diff --git a/src/pymlab/sensors/iic.py b/src/pymlab/sensors/iic.py
index <HASH>..<HASH> 100644
--- a/src/pymlab/sensors/iic.py
+++ b/src/pymlab/sensors/iic.py
@@ -780,8 +780,8 @@ def load_driver(**kwargs):
h.open(0x10C4, 0xEA90, serial) # Try Connect HID
kwargs['serial'] = h.get_serial_number_string()
LOGGER.info("Using HID with serial number: '%s' " %(h.get_serial_number_string()))
- h.write([0x01, 0x01]) # Reset Device for cancelling all transfers and reset configuration
- LOGGER.info("Reseting the USBI2C converter.")
+ #h.write([0x01, 0x01]) # Reset Device for cancelling all transfers and reset configuration
+ #LOGGER.info("Reseting the USBI2C converter.")
h.close()
LOGGER.info("Waiting to reinit of the device...")
time.sleep(1) # wait for system HID (re)mounting | Disable CP<I> reset causing unexpected disconnect.
This behavior connot be handled in OpenWrt usbhid implementation used in Turris MOX. | MLAB-project_pymlab | train | py |
a3d2eadbb03de02750223ca7596ff62716bf1dda | diff --git a/cachestore/jdbc/src/test/java/org/horizon/loader/jdbc/PooledConnectionFactoryTest.java b/cachestore/jdbc/src/test/java/org/horizon/loader/jdbc/PooledConnectionFactoryTest.java
index <HASH>..<HASH> 100644
--- a/cachestore/jdbc/src/test/java/org/horizon/loader/jdbc/PooledConnectionFactoryTest.java
+++ b/cachestore/jdbc/src/test/java/org/horizon/loader/jdbc/PooledConnectionFactoryTest.java
@@ -2,6 +2,7 @@ package org.horizon.loader.jdbc;
import org.horizon.loader.jdbc.connectionfactory.ConnectionFactoryConfig;
import org.horizon.loader.jdbc.connectionfactory.PooledConnectionFactory;
+import org.horizon.test.fwk.UnitTestDatabaseManager;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.Test; | Fixed up PooledConnectionFactoryTest. Was looking @ wrong place for UnitTestDatabaseManager. | infinispan_infinispan | train | java |
178413fe0c57b10a0cb25a827175d10ae18a587a | diff --git a/pywb/warcserver/index/cdxobject.py b/pywb/warcserver/index/cdxobject.py
index <HASH>..<HASH> 100644
--- a/pywb/warcserver/index/cdxobject.py
+++ b/pywb/warcserver/index/cdxobject.py
@@ -149,7 +149,7 @@ class CDXObject(OrderedDict):
cdxformat = i
if not cdxformat:
- msg = 'unknown {0}-field cdx format'.format(len(fields))
+ msg = 'unknown {0}-field cdx format: {1}'.format(len(fields), fields)
raise CDXException(msg)
for header, field in zip(cdxformat, fields): | More detailed logging of invalid cdxlines. (#<I>) | webrecorder_pywb | train | py |
94ccea7bc11c72d1c744f9fc8cbf3073a6659b9f | diff --git a/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/TtlConfig.java b/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/TtlConfig.java
index <HASH>..<HASH> 100644
--- a/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/TtlConfig.java
+++ b/blueflood-core/src/main/java/com/rackspacecloud/blueflood/service/TtlConfig.java
@@ -54,8 +54,8 @@ public enum TtlConfig implements ConfigDefaults {
TIMER_ROLLUPS_MIN240("180"), // 6 months
TIMER_ROLLUPS_MIN1440("365"), // 1 year
- TTL_CONFIG_CONST("1"), // 1 day
- ARE_TTLS_FORCED("true");
+ TTL_CONFIG_CONST("5"), // 5 days
+ ARE_TTLS_FORCED("false");
static {
Configuration.getInstance().loadDefaults(TtlConfig.values());
} | setting ttl const to 5 days and forcing ttls to false based on review comments | rackerlabs_blueflood | train | java |
1e550559daebe97b1f4c9d284dad13ab8e049c66 | diff --git a/profitbricks/client.py b/profitbricks/client.py
index <HASH>..<HASH> 100644
--- a/profitbricks/client.py
+++ b/profitbricks/client.py
@@ -1619,8 +1619,14 @@ class ProfitBricksService(object):
json_response = response.json()
if 'location' in response.headers:
- request_id = response.headers['location'].split('/')[-2]
- json_response.update({'requestId': request_id})
+ # The request URL has currently the format {host_base}/requests/{request ID}/status
+ # Thus search for a UUID.
+ match = re.search('/requests/([-A-Fa-f0-9]+)/', response.headers['location'])
+ if match:
+ json_response['requestId'] = match.group(1)
+ else:
+ raise Exception("Failed to extract request ID from response header 'location': "
+ "'{location}'".format(location=response.headers['location']))
return json_response | Improve extraction of the request ID
The response header 'location' contains the request ID URL which
contains the host base URL. The URL could change anytime and thus
do some sanity check when parsing the response header. | profitbricks_profitbricks-sdk-python | train | py |
fff3d27305de71f47c05d7ec474f2e7611b7d5f8 | diff --git a/masonite/drivers/UploadDiskDriver.py b/masonite/drivers/UploadDiskDriver.py
index <HASH>..<HASH> 100644
--- a/masonite/drivers/UploadDiskDriver.py
+++ b/masonite/drivers/UploadDiskDriver.py
@@ -35,4 +35,4 @@ class UploadDiskDriver(BaseUploadDriver, UploadContract):
open(location + prepend + filename, 'wb').write(fileitem.file.read())
- return location + prepend + filename
+ return prepend + filename
diff --git a/tests/test_upload_manager.py b/tests/test_upload_manager.py
index <HASH>..<HASH> 100644
--- a/tests/test_upload_manager.py
+++ b/tests/test_upload_manager.py
@@ -76,6 +76,9 @@ class TestUploadManager:
with pytest.raises(FileTypeException):
UploadManager(self.app).driver('disk').accept('png').store(ImageMock())
+ def test_upload_store_prepend(self):
+ assert self.app.make('UploadManager').driver('disk').store_prepend(ImageMock(), 'hey') == 'heytest.jpg'
+
class ImageMock():
""" | added test for disk driver store prepend | MasoniteFramework_masonite | train | py,py |
ff67f259d7111ce675bbd1466214b87e8cae4ba8 | diff --git a/clients/unshaded/src/main/java/tachyon/client/file/BaseFileSystem.java b/clients/unshaded/src/main/java/tachyon/client/file/BaseFileSystem.java
index <HASH>..<HASH> 100644
--- a/clients/unshaded/src/main/java/tachyon/client/file/BaseFileSystem.java
+++ b/clients/unshaded/src/main/java/tachyon/client/file/BaseFileSystem.java
@@ -15,6 +15,7 @@
package tachyon.client.file;
+import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.List;
@@ -235,6 +236,10 @@ public class BaseFileSystem implements FileSystem {
public FileInStream openFile(TachyonURI path, OpenFileOptions options)
throws FileDoesNotExistException, IOException, TachyonException {
URIStatus status = getStatus(path);
+ if (status.isFolder()) {
+ throw new FileNotFoundException(
+ ExceptionMessage.CANNOT_READ_DIRECTORY.getMessage(status.getName()));
+ }
return new FileInStream(status.getInfo(), options.toInStreamOptions());
} | Check we are not opening a directory. | Alluxio_alluxio | train | java |
bc1a397bd1e23acae5e7aeb1a1fb4280818c372f | diff --git a/src/lib/ToastContainer.js b/src/lib/ToastContainer.js
index <HASH>..<HASH> 100644
--- a/src/lib/ToastContainer.js
+++ b/src/lib/ToastContainer.js
@@ -139,11 +139,10 @@ export default class ToastContainer extends Component {
}
render() {
- const divProps = _.omit(this.props, [`toastType`, `toastMessageFactory`, `preventDuplicates`,
- `newestOnTop`]);
+ const {toastType, toastMessageFactory, preventDuplicates, newestOnTop, ...restProps} = this.props;
return (
- <div {...divProps} aria-live="polite" role="alert">
+ <div {...restProps} aria-live="polite" role="alert">
{this.state.toasts.map(toast => this.props.toastMessageFactory(toast))}
</div>
); | fix(ToastContainer): replace _.omit with object rest
* Original commit: ca<I>f0b<I>e<I>c<I>a7c<I>f<I>e<I>
* Original | tomchentw_react-toastr | train | js |
c815da66ff669dfcec94c45617943320aa76b897 | diff --git a/parsl/monitoring/db_manager.py b/parsl/monitoring/db_manager.py
index <HASH>..<HASH> 100644
--- a/parsl/monitoring/db_manager.py
+++ b/parsl/monitoring/db_manager.py
@@ -33,7 +33,7 @@ RESOURCE = 'resource' # Resource table includes task resource utilization
NODE = 'node' # Node table include node info
-class Database(object):
+class Database:
if not _sqlalchemy_enabled:
raise OptionalModuleMissing(['sqlalchemy'],
@@ -194,7 +194,7 @@ class Database(object):
)
-class DatabaseManager(object):
+class DatabaseManager:
def __init__(self,
db_url='sqlite:///monitoring.db',
logdir='.',
diff --git a/parsl/monitoring/monitoring.py b/parsl/monitoring/monitoring.py
index <HASH>..<HASH> 100644
--- a/parsl/monitoring/monitoring.py
+++ b/parsl/monitoring/monitoring.py
@@ -58,7 +58,7 @@ def start_file_logger(filename, name='monitoring', level=logging.DEBUG, format_s
return logger
-class UDPRadio(object):
+class UDPRadio:
def __init__(self, monitoring_url, source_id=None, timeout=10):
"""
@@ -328,7 +328,7 @@ class MonitoringHub(RepresentationMixin):
return wrapped
-class Hub(object):
+class Hub:
def __init__(self,
hub_address, | Remove python2 object superclass idiom from monitoring. (#<I>)
This is a mechanism to enable python2 new-style classes which
is unnecessary noise now.
This change should not affect behaviour. | Parsl_parsl | train | py,py |
c94dab63dcccda2f9d46c3896958503d0ff249c2 | diff --git a/include/setup.php b/include/setup.php
index <HASH>..<HASH> 100644
--- a/include/setup.php
+++ b/include/setup.php
@@ -49,8 +49,6 @@ if ( ! isset($CFG->vendorinclude) ) $CFG->vendorinclude = $CFG->dirroot."/vendor
if ( ! isset($CFG->vendorstatic) ) $CFG->vendorstatic = $CFG->dirroot."/vendor/tsugi/lib/static";
if ( ! isset($CFG->launchactivity) ) $CFG->launchactivity = false;
if ( ! isset($CFG->certification) ) $CFG->certification = false;
-// Legacy tools
-if ( ! isset($CFG->product_instance_guid) ) $CFG->product_instance_guid = $CFG->wwwroot;
if ( isset($CFG->staticroot) ) $CFG->staticroot = \Tsugi\Util\U::remove_relative_path($CFG->staticroot);
require_once $CFG->vendorinclude . "/lms_lib.php"; | Remove LTI <I> bit | tsugiproject_tsugi-php | train | php |
a5a83a959591df0e59ea1be26bbc839551ad69c9 | diff --git a/src/base-configuration-optimizer.js b/src/base-configuration-optimizer.js
index <HASH>..<HASH> 100644
--- a/src/base-configuration-optimizer.js
+++ b/src/base-configuration-optimizer.js
@@ -200,19 +200,21 @@ var BaseConfigurationOptimizer = ConfigurationOptimizer.extend({
if (!config) {
result = _.map(adjustableValues, function(value) {
return {
- valueId: value.valueId,
- valueIndex: value.valueIndex,
+ valueId: value.id,
+ valueIndex: value.index,
};
});
} else {
var valueByIndex = {}, valueById = {};
_.forEach(adjustableValues, function(value) {
- valueByIndex [value.valueIndex] = value;
- valueById [value.valueId] = value;
+ valueByIndex [value.index] = value;
+ valueById [value.id] = value;
});
result = _.map(config, function(value, key) {
- if (_.isObject(config)) {
+ if (_.isArray(config)) {
+ // nop
+ } else if (_.isObject(config)) {
if (_.has(valueById, key)) {
value = {
valueId: key, | Fix several bugs in `BaseConfigurationOptimizer`. | danielwippermann_resol-vbus | train | js |
f48ada15d9af559c64a936e6e85dd85e69c0d4fc | diff --git a/src/Form/FormDefault.php b/src/Form/FormDefault.php
index <HASH>..<HASH> 100644
--- a/src/Form/FormDefault.php
+++ b/src/Form/FormDefault.php
@@ -392,7 +392,7 @@ class FormDefault implements DisplayInterface, FormInterface
'instance' => $this->getModel(),
'attributes' => $this->htmlAttributesToString(),
'buttons' => $this->getButtons(),
- 'backUrl' => session('_redirectBack', url()->previous()),
+ 'backUrl' => session('_redirectBack', \URL::previous()),
];
}
diff --git a/src/Http/Controllers/AdminController.php b/src/Http/Controllers/AdminController.php
index <HASH>..<HASH> 100644
--- a/src/Http/Controllers/AdminController.php
+++ b/src/Http/Controllers/AdminController.php
@@ -412,7 +412,7 @@ class AdminController extends Controller
*/
protected function getBackUrl()
{
- if (($backUrl = Request::input('_redirectBack')) == url()->previous()) {
+ if (($backUrl = Request::input('_redirectBack')) == \URL::previous()) {
$backUrl = null;
Request::merge(['_redirectBack' => $backUrl]);
} | fix support laravel <I> | LaravelRUS_SleepingOwlAdmin | train | php,php |
6a7cba59c8c04dc225de94893ef0c1017fcdf7d6 | diff --git a/src/sap.m/src/sap/m/SplitContainer.js b/src/sap.m/src/sap/m/SplitContainer.js
index <HASH>..<HASH> 100644
--- a/src/sap.m/src/sap/m/SplitContainer.js
+++ b/src/sap.m/src/sap/m/SplitContainer.js
@@ -1240,7 +1240,8 @@ sap.ui.define(['jquery.sap.global', './library', 'sap/ui/core/Control', 'sap/ui/
this._bMasterClosing = true;
}
} else {
- if ((this._portraitHide() || this._hideMode()) && this._bMasterisOpen) {
+ if ((this._portraitHide() || this._hideMode()) &&
+ (this._bMasterisOpen || this._oMasterNav.$().hasClass("sapMSplitContainerMasterVisible"))) {
if (this._isMie9) {
_this$.animate({
left: "-=320" | [FIX] sap.m.SplitContainer: Master view properly closing issue
- Fixed master view closing on fiori client
BCP: <I>
Change-Id: I<I>a<I>fbe<I>e<I>b<I>e<I>cfacaeff | SAP_openui5 | train | js |
7fb855ca5eb546c03d1b7ea84b5b48093958ae9a | diff --git a/h2o-core/src/main/java/hex/Model.java b/h2o-core/src/main/java/hex/Model.java
index <HASH>..<HASH> 100755
--- a/h2o-core/src/main/java/hex/Model.java
+++ b/h2o-core/src/main/java/hex/Model.java
@@ -512,8 +512,16 @@ public abstract class Model<M extends Model<M,P,O>, P extends Model.Parameters,
String[] names = new String[ncols];
String[][] domains = new String[ncols][];
names[0] = "predict";
- for(int i = 1; i < names.length; ++i)
- names[i] = _output.classNames()[i-1];
+ for(int i = 1; i < names.length; ++i) {
+ names[i] = _output.classNames()[i - 1];
+ // turn integer class labels such as 0, 1, etc. into p0, p1, etc.
+ try {
+ Integer.valueOf(names[i]);
+ names[i] = "p" + names[i];
+ } catch (Throwable t) {
+ // do nothing, non-integer names are fine already
+ }
+ }
domains[0] = nc==1 || !computeMetrics ? null : adaptFrm.lastVec().domain();
// Score the dataset, building the class distribution & predictions
BigScore bs = new BigScore(domains[0],ncols,adaptFrm.means(),computeMetrics).doAll(ncols,adaptFrm); | Make predition frame column names non-integer
instead of predict, 0, 1, the col names are now predict, p0, p1, for example. | h2oai_h2o-3 | train | java |
356040fb6c047fba3dc3942116195f16cbaf89f8 | diff --git a/sigh/lib/sigh/version.rb b/sigh/lib/sigh/version.rb
index <HASH>..<HASH> 100644
--- a/sigh/lib/sigh/version.rb
+++ b/sigh/lib/sigh/version.rb
@@ -1,3 +1,3 @@
module Sigh
- VERSION = "1.9.0"
+ VERSION = "1.10.0"
end | Sigh version bump (#<I>)
[<I>:<I>:<I>]: Changes since release <I>:
* Added --keychain-path to sigh (#<I>)
* Sigh/<I> extract entitlements from app (#<I>)
* Add a ROOT path constant for sigh (#<I>)
* Disable the rubocop rules for MethodLength and AbcSize (#<I>) | fastlane_fastlane | train | rb |
7cd24ce02641eb645e0287f0d033830407565fde | diff --git a/spec/adapters/active_record_spec.rb b/spec/adapters/active_record_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/adapters/active_record_spec.rb
+++ b/spec/adapters/active_record_spec.rb
@@ -4,7 +4,11 @@ unless defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
require 'spec_helper'
require 'active_record'
+ if ActiveRecord.version.release >= Gem::Version.new('4.2')
+ ActiveRecord::Base.raise_in_transactional_callbacks = true
+ end
ActiveRecord::Base.establish_connection(QUE_URL)
+
Que.connection = ActiveRecord
QUE_ADAPTERS[:active_record] = Que.adapter | Added transaction verbosity for activerecord | chanks_que | train | rb |
c9d0a77657ccc3be144ed4de12d43c8cfcca8590 | diff --git a/daemon/names.go b/daemon/names.go
index <HASH>..<HASH> 100644
--- a/daemon/names.go
+++ b/daemon/names.go
@@ -72,7 +72,7 @@ func (daemon *Daemon) reserveName(id, name string) (string, error) {
logrus.Errorf("got unexpected error while looking up reserved name: %v", err)
return "", err
}
- return "", fmt.Errorf("Conflict. The name %q is already in use by container %s. You have to remove (or rename) that container to be able to reuse that name.", name, id)
+ return "", fmt.Errorf("Conflict. The container name %q is already in use by container %s. You have to remove (or rename) that container to be able to reuse that name.", name, id)
}
return "", fmt.Errorf("error reserving name: %s, error: %v", name, err)
} | Added the word "container" to clarify the error message. | moby_moby | train | go |
3dcf602b010ff5c092f6adad849d9243d4acc7dc | diff --git a/src/extensions/renderer/base/load-listeners.js b/src/extensions/renderer/base/load-listeners.js
index <HASH>..<HASH> 100644
--- a/src/extensions/renderer/base/load-listeners.js
+++ b/src/extensions/renderer/base/load-listeners.js
@@ -281,6 +281,12 @@ BRp.load = function(){
}
};
+ var blurActiveDomElement = function(){
+ if( document.activeElement != null && document.activeElement.blur != null ){
+ document.activeElement.blur();
+ }
+ };
+
var haveMutationsApi = typeof MutationObserver !== 'undefined';
// watch for when the cy container is removed from the dom
@@ -398,6 +404,9 @@ BRp.load = function(){
if( !eventInContainer(e) ){ return; }
e.preventDefault();
+
+ blurActiveDomElement();
+
r.hoverData.capture = true;
r.hoverData.which = e.which;
@@ -1132,6 +1141,8 @@ BRp.load = function(){
r.registerBinding( r.container, 'touchstart', touchstartHandler = function( e ){
if( !eventInContainer(e) ){ return; }
+ blurActiveDomElement();
+
r.touchData.capture = true;
r.data.bgActivePosistion = undefined; | `touchstart` and `mousedown` on the canvas do not cause the active DOM element to blur #<I> | cytoscape_cytoscape.js | train | js |
451a06603b19b896e9582d010c183b62c5c5fdb3 | diff --git a/bin/permutation_test.py b/bin/permutation_test.py
index <HASH>..<HASH> 100755
--- a/bin/permutation_test.py
+++ b/bin/permutation_test.py
@@ -29,8 +29,16 @@ def start_logging(log_file='', log_level='INFO'):
If os.devnull is specified as the log_file then the log file will
not actually be written to a file.
"""
+
if not log_file:
- log_file = 'log/log.run.' + str(datetime.datetime.now()).replace(':', '.') + '.txt'
+ # create log directory if it doesn't exist
+ file_dir = os.path.dirname(os.path.realpath(__file__))
+ log_dir = os.path.join(file_dir, '../log/')
+ if not os.path.isdir(log_dir):
+ os.mkdir(log_dir)
+
+ # path to new log file
+ log_file = log_dir + 'log.run.' + str(datetime.datetime.now()).replace(':', '.') + '.txt'
# logger options
lvl = logging.DEBUG if log_level.upper() == 'DEBUG' else logging.INFO | Automatically create log directory if not present | KarchinLab_probabilistic2020 | train | py |
032af7c65e1337f90547f6ad702c9dbea64a2e23 | diff --git a/src/Kodeine/Acl/Models/Eloquent/Role.php b/src/Kodeine/Acl/Models/Eloquent/Role.php
index <HASH>..<HASH> 100644
--- a/src/Kodeine/Acl/Models/Eloquent/Role.php
+++ b/src/Kodeine/Acl/Models/Eloquent/Role.php
@@ -28,7 +28,7 @@ class Role extends Model
*/
public function users()
{
- return $this->belongsToMany(config('auth.model'))->withTimestamps();
+ return $this->belongsToMany(config('auth.providers.users.model', config('auth.model')))->withTimestamps();
}
/** | Add support for <I> auth config | kodeine_laravel-acl | train | php |
fed689bbd1e61ce3c1087433835ea7ed8b901346 | diff --git a/packer/rpc/server.go b/packer/rpc/server.go
index <HASH>..<HASH> 100644
--- a/packer/rpc/server.go
+++ b/packer/rpc/server.go
@@ -31,11 +31,14 @@ type Server struct {
mux *MuxConn
streamId uint32
server *rpc.Server
+ closeMux bool
}
// NewServer returns a new Packer RPC server.
func NewServer(conn io.ReadWriteCloser) *Server {
- return NewServerWithMux(NewMuxConn(conn), 0)
+ result := NewServerWithMux(NewMuxConn(conn), 0)
+ result.closeMux = true
+ return result
}
func NewServerWithMux(mux *MuxConn, streamId uint32) *Server {
@@ -43,11 +46,17 @@ func NewServerWithMux(mux *MuxConn, streamId uint32) *Server {
mux: mux,
streamId: streamId,
server: rpc.NewServer(),
+ closeMux: false,
}
}
func (s *Server) Close() error {
- return s.mux.Close()
+ if s.closeMux {
+ log.Printf("[WARN] Shutting down mux conn in Server")
+ return s.mux.Close()
+ }
+
+ return nil
}
func (s *Server) RegisterArtifact(a packer.Artifact) { | packer/rpc: log when a muxconn is shut down | hashicorp_packer | train | go |
9a47979bb7a9c9696ed12ce3e53e26a99141945f | diff --git a/api/src/main/java/org/ocpsoft/rewrite/config/ConfigurationRuleBuilderPerform.java b/api/src/main/java/org/ocpsoft/rewrite/config/ConfigurationRuleBuilderPerform.java
index <HASH>..<HASH> 100644
--- a/api/src/main/java/org/ocpsoft/rewrite/config/ConfigurationRuleBuilderPerform.java
+++ b/api/src/main/java/org/ocpsoft/rewrite/config/ConfigurationRuleBuilderPerform.java
@@ -45,5 +45,5 @@ public interface ConfigurationRuleBuilderPerform extends ConfigurationBuilderRoo
/**
* Configure the {@link Parameter} with the given name.
*/
- ConfigurationRuleParameterPerform where(String string);
+ ConfigurationRuleParameterBuilder where(String string);
}
diff --git a/api/src/main/java/org/ocpsoft/rewrite/config/ConfigurationRuleParameterBuilder.java b/api/src/main/java/org/ocpsoft/rewrite/config/ConfigurationRuleParameterBuilder.java
index <HASH>..<HASH> 100644
--- a/api/src/main/java/org/ocpsoft/rewrite/config/ConfigurationRuleParameterBuilder.java
+++ b/api/src/main/java/org/ocpsoft/rewrite/config/ConfigurationRuleParameterBuilder.java
@@ -42,7 +42,7 @@ public class ConfigurationRuleParameterBuilder
}
@Override
- public ConfigurationRuleParameter where(String parameter)
+ public ConfigurationRuleParameterBuilder where(String parameter)
{
return parent.where(parameter);
} | For now the builder methods should return ConfigurationRuleParameterBuilder directly to get the code to compile | ocpsoft_rewrite | train | java,java |
88402fc81581af4fe0c3eee590cfe9d153d63968 | diff --git a/asammdf/blocks/mdf_v4.py b/asammdf/blocks/mdf_v4.py
index <HASH>..<HASH> 100755
--- a/asammdf/blocks/mdf_v4.py
+++ b/asammdf/blocks/mdf_v4.py
@@ -459,10 +459,11 @@ class MDF4(object):
# Check for finalization past version 4.10
finalisation_flags = self._check_finalised()
- if finalisation_flags:
- addresses = all_blocks_addresses(self._file)
- else:
- addresses = []
+ # TODO: the shim does not support this function
+# if finalisation_flags:
+# addresses = all_blocks_addresses(self._file)
+# else:
+# addresses = []
if finalisation_flags:
message = f"Attempting finalization of {self.name}"
diff --git a/asammdf/version.py b/asammdf/version.py
index <HASH>..<HASH> 100644
--- a/asammdf/version.py
+++ b/asammdf/version.py
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
""" asammdf version module """
-__version__ = "5.20.0.dev8"
+__version__ = "5.20.0.dev9" | remove the block search in case of unfinalised files | danielhrisca_asammdf | train | py,py |
0fe78de923bd8a2135615a72a9b853a59dc50686 | diff --git a/editor.py b/editor.py
index <HASH>..<HASH> 100644
--- a/editor.py
+++ b/editor.py
@@ -172,6 +172,7 @@ class Editor(Widget):
self.cur_line = cur_line
self.adjust_cursor_eol()
self.set_cursor()
+ return True
def handle_key(self, key):
if key == KEY_QUIT: | editor: handle_mouse(): Return True if event successfully processed. | pfalcon_picotui | train | py |
09091947c7b0554d4e0e8b1ff305ad296eb9dd90 | diff --git a/liquibase-core/src/main/java/liquibase/diff/output/changelog/DiffToChangeLog.java b/liquibase-core/src/main/java/liquibase/diff/output/changelog/DiffToChangeLog.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/main/java/liquibase/diff/output/changelog/DiffToChangeLog.java
+++ b/liquibase-core/src/main/java/liquibase/diff/output/changelog/DiffToChangeLog.java
@@ -445,12 +445,11 @@ public class DiffToChangeLog {
// If there are no tables then the
// insertion position is 0
//
- AtomicInteger i = new AtomicInteger(); // any mutable integer wrapper
- int lastTableIndex = toSort.stream()
- .peek(v -> i.incrementAndGet())
- .anyMatch(item -> item instanceof Table) ? i.get() - 1 : -1;
- if (lastTableIndex == -1) {
- lastTableIndex = 0;
+ int lastTableIndex = 0;
+ for (int i=0; i < toSort.size(); i++) {
+ if (toSort.get(i) instanceof Table) {
+ lastTableIndex=i;
+ }
}
// | Fix loop to determine last table index in diffToChangeLog sort code | liquibase_liquibase | train | java |
933cd0d8ac4b4bb63570f62a8eaa90278af8a087 | diff --git a/ohmdb-utils/src/main/java/com/ohmdb/util/U.java b/ohmdb-utils/src/main/java/com/ohmdb/util/U.java
index <HASH>..<HASH> 100644
--- a/ohmdb-utils/src/main/java/com/ohmdb/util/U.java
+++ b/ohmdb-utils/src/main/java/com/ohmdb/util/U.java
@@ -366,7 +366,12 @@ public class U {
}
public static void delete(String filename) {
- new File(filename).delete();
+ File f = new File(filename);
+
+ if (f.exists()) {
+ Check.state(f.delete(), "Cannot delete file: " + filename);
+ Check.state(!new File(filename).exists(), "Didn't delete file: " + filename);
+ }
}
public static <T> T[] expand(T[] arr, T item) { | Enriched delete util with paranoid checks. | ohmdb_ohmdb | train | java |
75e0211977111c5aa11ee1dfc8aaae70529fbe8c | diff --git a/lib/ajax-datatables-rails/version.rb b/lib/ajax-datatables-rails/version.rb
index <HASH>..<HASH> 100644
--- a/lib/ajax-datatables-rails/version.rb
+++ b/lib/ajax-datatables-rails/version.rb
@@ -9,7 +9,7 @@ module AjaxDatatablesRails
module VERSION
MAJOR = 1
MINOR = 3
- TINY = 0
+ TINY = 1
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.') | Bunp to version <I> | jbox-web_ajax-datatables-rails | train | rb |
65d90b207da8e47c41beb64de31a8382ba1902e0 | diff --git a/lib/veewee/session.rb b/lib/veewee/session.rb
index <HASH>..<HASH> 100644
--- a/lib/veewee/session.rb
+++ b/lib/veewee/session.rb
@@ -132,7 +132,7 @@ module Veewee
end
def self.list_definitions
- puts "The following defined baseboxes exit:"
+ puts "The following defined baseboxes exist:"
subdirs=Dir.glob("#{@definition_dir}/*")
subdirs.each do |sub|
puts "- "+File.basename(sub)
@@ -197,7 +197,7 @@ module Veewee
def self.build(boxname,options)
- options = { "force" => false, "format" => "vagrant", "nogui" => true }.merge(options)
+ options = { "force" => false, "format" => "vagrant", "nogui" => false }.merge(options)
#Now we have to load the definition (reads definition.rb)
load_definition(boxname)
@@ -307,6 +307,7 @@ module Veewee
end
def self.load_definition(boxname)
+
if definition_exists?(boxname)
definition_file=File.join(@definition_dir,boxname,"definition.rb")
begin
@@ -314,7 +315,11 @@ module Veewee
rescue LoadError
puts "Error loading definition of #{boxname}"
exit
- end
+ end
+ else
+ puts "Error: definition for basebox '#{boxname}' does not exist."
+ list_definitions
+ exit
end
end | fixed build when the box definition does not exist | jedi4ever_veewee | train | rb |
94eed43d8fb7a8c8ec43c8fa7fd80ad0ccfc0d0f | diff --git a/chalice/app.py b/chalice/app.py
index <HASH>..<HASH> 100644
--- a/chalice/app.py
+++ b/chalice/app.py
@@ -18,15 +18,15 @@ _PARAMS = re.compile(r'{\w+}')
# on other parts of chalice so it can stay small and lightweight, with minimal
# startup overhead. This also means we need to handle py2/py3 compat issues
# directly in this file instead of copying over compat.py
-if sys.version_info.major == 3:
- from urllib.parse import unquote_plus # pylint: disable=E0611,E0401
+try:
+ from urllib.parse import unquote_plus
unquote_str = unquote_plus
# In python 3 string and bytes are different so we explicitly check
# for both.
_ANY_STRING = (str, bytes)
-else:
+except ImportError:
from urllib import unquote_plus
# This is borrowed from botocore/compat.py
@@ -41,7 +41,7 @@ else:
return unquote_plus(byte_string).decode(encoding)
# In python 2 there is a base class for the string types that we can check
# for. It was removed in python 3 so it will cause a name error.
- _ANY_STRING = (basestring, bytes) # noqa
+ _ANY_STRING = (basestring, bytes) # noqa pylint: disable=E0602
def handle_decimals(obj): | Make pylint/flake8 happy | aws_chalice | train | py |
d3404ac0e82ff5629b6b9c0e858655be40ed79f0 | diff --git a/tests/PHPUnit/Plugins/LanguagesManagerTest.php b/tests/PHPUnit/Plugins/LanguagesManagerTest.php
index <HASH>..<HASH> 100755
--- a/tests/PHPUnit/Plugins/LanguagesManagerTest.php
+++ b/tests/PHPUnit/Plugins/LanguagesManagerTest.php
@@ -73,7 +73,7 @@ class Test_LanguagesManager extends PHPUnit_Framework_TestCase
foreach ($invalids as $invalid) {
$this->assertTrue(stripos($serializedStrings, $invalid) === false, "$language: language file containing javascript");
}
- $this->assertTrue(count($strings) > 100, "$language: expecting at least 100 translations in the language file");
+ $this->assertTrue(count($strings) > 400, "$language: expecting at least 400 translations in the language file");
$this->assertTrue(strlen($content) == 0, "$language: buffer was " . strlen($content) . " long but should be zero. Translation file for '$language' must be buggy.");
$cleanedStrings = array(); | we should at least expect <I> translations now, as translations for language names, countries, days and months have been imported | matomo-org_matomo | train | php |
5d5cfaf145ea05cf39f311d4d968aeaf55824ff1 | diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js
index <HASH>..<HASH> 100644
--- a/src/nls/root/strings.js
+++ b/src/nls/root/strings.js
@@ -318,7 +318,7 @@ define({
"MISSING_PACKAGE_VERSION" : "The package.json file doesn't specify a package version.",
"INVALID_VERSION_NUMBER" : "The package version number ({0}) is invalid.",
"INVALID_BRACKETS_VERSION" : "The Brackets compatibility string {{0}} is invalid.",
- "DISALLOWED_WORDS" : "The words {{1}} are not allowed in the {{1}} field.",
+ "DISALLOWED_WORDS" : "The words {{1}} are not allowed in the {{0}} field.",
"API_NOT_COMPATIBLE" : "The extension isn't compatible with this version of Brackets. It's installed in your disabled extensions folder.",
"MISSING_MAIN" : "The package has no main.js file.",
"ALREADY_INSTALLED" : "An extension with the same name was already installed. The new extension is installed in your disabled extensions folder.", | fix the DISALLOWED_WORDS string to include the field name properly. | adobe_brackets | train | js |
9f8dc77fd2e52692a61e6159152b0c54caa32f6f | diff --git a/lib/perpetuity/postgres/serialized_data.rb b/lib/perpetuity/postgres/serialized_data.rb
index <HASH>..<HASH> 100644
--- a/lib/perpetuity/postgres/serialized_data.rb
+++ b/lib/perpetuity/postgres/serialized_data.rb
@@ -15,6 +15,11 @@ module Perpetuity
"(#{column_names.join(',')}) VALUES #{value_strings}"
end
+ def [] key
+ index = column_names.index(key.to_s)
+ values.first[index]
+ end
+
def []= column, value
value = TextValue.new(value)
if column_names.include? column
diff --git a/spec/perpetuity/postgres/serialized_data_spec.rb b/spec/perpetuity/postgres/serialized_data_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/perpetuity/postgres/serialized_data_spec.rb
+++ b/spec/perpetuity/postgres/serialized_data_spec.rb
@@ -55,6 +55,11 @@ module Perpetuity
[['name', "'Jamie'"], ['age', 31]]
end
+ it 'accesses values like a hash' do
+ serialized['age'].should == 31
+ serialized[:age].should == 31
+ end
+
it 'equals another with the same data' do
original = SerializedData.new([:a, :b], [1, 2])
duplicate = SerializedData.new([:a, :b], [1, 2]) | Allow SerializedData to be accessed like a hash | jgaskins_perpetuity-postgres | train | rb,rb |
c283919b3a1be84a2a16a5f986fc615be92b6985 | diff --git a/test/router_test.rb b/test/router_test.rb
index <HASH>..<HASH> 100644
--- a/test/router_test.rb
+++ b/test/router_test.rb
@@ -8,15 +8,19 @@ describe Committee::Router do
end
it "builds routes without parameters" do
- assert @router.routes?("GET", "/apps")
+ refute_nil @router.routes?("GET", "/apps")[0]
end
it "builds routes with parameters" do
- assert @router.routes?("GET", "/apps/123")
+ refute_nil @router.routes?("GET", "/apps/123")[0]
+ end
+
+ it "doesn't match anything on a /" do
+ assert_nil @router.routes?("GET", "/")[0]
end
it "takes a prefix" do
# this is a sociopathic example
- assert @router.routes?("GET", "/kpi/apps/123", prefix: "/kpi")
+ refute_nil @router.routes?("GET", "/kpi/apps/123", prefix: "/kpi")[0]
end
end | More/better tests on router
Especially check that a request to / doesn't get handled by some random
link inside the schema. | interagent_committee | train | rb |
cab6831597b271c2cb313a2a360f0430def6112c | diff --git a/lib/ezutils/classes/ezini.php b/lib/ezutils/classes/ezini.php
index <HASH>..<HASH> 100644
--- a/lib/ezutils/classes/ezini.php
+++ b/lib/ezutils/classes/ezini.php
@@ -1358,11 +1358,11 @@ class eZINI
{
$GLOBALS[$globalsIsLoadedKey] = false;
- $impl = new eZINI( $fileName, $rootDir, $useTextCodec, $useCache, $useLocalOverrides, $directAccess, $addArrayDefinition );
+ $GLOBALS[$globalsKey] = new eZINI( $fileName, $rootDir, $useTextCodec, $useCache, $useLocalOverrides, $directAccess, $addArrayDefinition );
$GLOBALS[$globalsIsLoadedKey] = true;
}
- return $impl;
+ return $GLOBALS[$globalsKey];
}
/*! | - Fixed bug: eZINI doesn't use its $GLOBALS cache, introduced in rev. <I>
git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/unstable/<I>-<I>-<I>-php5@<I> a<I>eee8c-daba-<I>-acae-fa<I>f<I> | ezsystems_ezpublish-legacy | train | php |
d31dbfa77738d63a79bce1662328793808972752 | diff --git a/src/Tipsy/Tipsy.php b/src/Tipsy/Tipsy.php
index <HASH>..<HASH> 100644
--- a/src/Tipsy/Tipsy.php
+++ b/src/Tipsy/Tipsy.php
@@ -610,8 +610,12 @@ class Db {
if (!$args) {
throw new Exception('Invalid DB config.');
}
+
+ if (!$args['dsn']) {
+ $args['dsn'] = 'mysql:host='.$args['host'].';dbname='.$args['database'].';charset=utf8';
+ }
- $db = new \PDO('mysql:host='.$args['host'].';dbname='.$args['database'].';charset=utf8', $args['user'], $args['pass']);
+ $db = new \PDO($args['dsn'], $args['user'], $args['pass']);
$db->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);
$db->setAttribute(\PDO::ATTR_EMULATE_PREPARES, false);
return $db; | Added direct dsn setting | tipsyphp_tipsy | train | php |
3eefeb56cc47b96bc964826aa5946f4c0f132af9 | diff --git a/test_vcversioner.py b/test_vcversioner.py
index <HASH>..<HASH> 100644
--- a/test_vcversioner.py
+++ b/test_vcversioner.py
@@ -386,5 +386,4 @@ def test_setup_astounding_success(tmpdir):
dist, 'vcversioner',
{str('Popen'): basic_version, str('version_file'): None,
str('vcs_args'): []})
- assert dist.version == '1.0'
assert dist.metadata.version == '1.0' | And now make the test less astounding. | habnabit_vcversioner | train | py |
65070be5f0e29c8c817d62f7492e5a2cc80c3d5f | diff --git a/classes/hypeJunction/Prototyper/Elements/CategoryField.php b/classes/hypeJunction/Prototyper/Elements/CategoryField.php
index <HASH>..<HASH> 100644
--- a/classes/hypeJunction/Prototyper/Elements/CategoryField.php
+++ b/classes/hypeJunction/Prototyper/Elements/CategoryField.php
@@ -42,7 +42,7 @@ class CategoryField extends RelationshipField {
/**
* {@inheritdoc}
*/
- public function getDataType() {
+ public static function getDataType() {
return 'category';
} | fix(categories): fix category input class | hypeJunction_hypePrototyper | train | php |
51d246f408980e56f9e28b815486cc1fad3815ae | diff --git a/src/components/tabs/__tests__/CdrTabs.spec.js b/src/components/tabs/__tests__/CdrTabs.spec.js
index <HASH>..<HASH> 100644
--- a/src/components/tabs/__tests__/CdrTabs.spec.js
+++ b/src/components/tabs/__tests__/CdrTabs.spec.js
@@ -168,7 +168,7 @@ describe('CdrTabs.vue', () => {
wrapper.vm.activeTabIndex = 1;
// Trigger resize event
wrapper.vm.$nextTick(() => {
- wrapper.vm.$refs.cdrTabsHeader.children[0].dispatchEvent(new Event('click'));
+ wrapper.vm.$refs.cdrTabsHeader.children[0].children[0].dispatchEvent(new Event('click'));
// Due to debounce function, must use timeout
setTimeout(() => {
expect(wrapper.vm.activeTabIndex).toBe(1); | refactor(tabs): added unit test coverage
affects: @rei/cdr-tabs | rei_rei-cedar | train | js |
87ea7bf5ab4fb377878494060f6824ef2acab942 | diff --git a/infutils.py b/infutils.py
index <HASH>..<HASH> 100644
--- a/infutils.py
+++ b/infutils.py
@@ -239,7 +239,6 @@ def raise_if_nothing_infered(func):
# special inference objects (e.g. may be returned as nodes by .infer()) #######
YES = _Yes()
-del _Yes
class Instance(Proxy): | shouldn't delete anymore _Yes class, used in super() | PyCQA_astroid | train | py |
a66b4e79885e480d5806640ff415d6fa7e0dd110 | diff --git a/PPI/Cache/Disk.php b/PPI/Cache/Disk.php
index <HASH>..<HASH> 100644
--- a/PPI/Cache/Disk.php
+++ b/PPI/Cache/Disk.php
@@ -37,13 +37,10 @@ class Disk implements \PPI\Cache\CacheInterface {
* @return boolean
*/
public function remove($key) {
- if ($this->exists($key)) {
- $path = $this->getKeyCachePath($key);
+ if(file_exists( ($path = $this->getKeyCachePath($key)) )) {
unlink($path);
unlink($this->getKeyMetaCachePath($key));
- return true;
}
- return false;
}
/**
@@ -52,7 +49,6 @@ class Disk implements \PPI\Cache\CacheInterface {
* @return string
*/
protected function getKeyCachePath($key) {
- // @TODO robert: add leveled key paths to avoid slow disk seeks
return $this->_cacheDir . 'default--' . $key;
} | [Cache] Fixing an issue with Disk->remove() to no longer need the exists() function. | ppi_framework | train | php |
bed4069a10226c7e233eba326a28816cef6c749f | diff --git a/seleniumbase/fixtures/base_case.py b/seleniumbase/fixtures/base_case.py
index <HASH>..<HASH> 100755
--- a/seleniumbase/fixtures/base_case.py
+++ b/seleniumbase/fixtures/base_case.py
@@ -3562,7 +3562,6 @@ class BaseCase(unittest.TestCase):
if len(sb_actions) > 0:
for action in sb_actions:
data.append(" " + action)
- print(" " + action)
else:
data.append(" pass")
data.append("") | Remove a debugging statement from the previous release | seleniumbase_SeleniumBase | train | py |
6a6b6296ea6acb323925ae0e4b48f8c422f816d8 | diff --git a/holoviews/core/spaces.py b/holoviews/core/spaces.py
index <HASH>..<HASH> 100644
--- a/holoviews/core/spaces.py
+++ b/holoviews/core/spaces.py
@@ -11,7 +11,7 @@ import param
from . import traversal, util
from .dimension import OrderedDict, Dimension, ViewableElement, redim
-from .layout import Layout, AdjointLayout, NdLayout
+from .layout import Layout, AdjointLayout, NdLayout, Empty
from .ndmapping import UniformNdMapping, NdMapping, item_check
from .overlay import Overlay, CompositeOverlay, NdOverlay, Overlayable
from .options import Store, StoreOptions
@@ -225,7 +225,7 @@ class HoloMap(UniformNdMapping, Overlayable):
def __lshift__(self, other):
- if isinstance(other, (ViewableElement, UniformNdMapping)):
+ if isinstance(other, (ViewableElement, UniformNdMapping, Empty)):
return AdjointLayout([self, other])
elif isinstance(other, AdjointLayout):
return AdjointLayout(other.data+[self]) | Fix to allow use of Empty in AdjointLayouts (#<I>) | pyviz_holoviews | train | py |
a18c71739d8279a451d85f8a7d56a378b31d7762 | diff --git a/vtki/plotting.py b/vtki/plotting.py
index <HASH>..<HASH> 100644
--- a/vtki/plotting.py
+++ b/vtki/plotting.py
@@ -1401,16 +1401,16 @@ class BasePlotter(object):
if position_x is None:
if vertical:
position_x = rcParams['colorbar_vertical']['position_x']
+ position_x -= slot * width
else:
position_x = rcParams['colorbar_horizontal']['position_x']
- position_x -= slot * width
if position_y is None:
if vertical:
position_y = rcParams['colorbar_vertical']['position_y']
- position_y += slot * height
else:
position_y = rcParams['colorbar_horizontal']['position_y']
+ position_y += slot * height
# Adjust to make sure on the screen
if position_x + width > 1:
position_x -= width | Fix scalar bar placement issue | vtkiorg_vtki | train | py |
84cd11a5f3582aea4adb50eb4c568832bf19c856 | diff --git a/src/main/java/org/efaps/ui/wicket/pages/AbstractMergePage.java b/src/main/java/org/efaps/ui/wicket/pages/AbstractMergePage.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/efaps/ui/wicket/pages/AbstractMergePage.java
+++ b/src/main/java/org/efaps/ui/wicket/pages/AbstractMergePage.java
@@ -24,6 +24,7 @@ import org.apache.wicket.AttributeModifier;
import org.apache.wicket.Component;
import org.apache.wicket.MarkupContainer;
import org.apache.wicket.markup.head.IHeaderResponse;
+import org.apache.wicket.markup.html.TransparentWebMarkupContainer;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.model.IModel;
@@ -90,7 +91,7 @@ public abstract class AbstractMergePage
{
super(_model);
add(this.downloadBehavior);
- this.body = new WebMarkupContainer("body");
+ this.body = new TransparentWebMarkupContainer("body");
this.body.add(AttributeModifier.append("class", Configuration.getAttribute(ConfigAttribute.DOJO_CLASS)));
super.add(this.body); | - Issue #1: Prepare Webapp for Wicket 7
container must be transparent | eFaps_eFaps-WebApp | train | java |
d46d9f83f37e0057c8d9c288c429305dc1aae357 | diff --git a/test_isort.py b/test_isort.py
index <HASH>..<HASH> 100644
--- a/test_isort.py
+++ b/test_isort.py
@@ -2024,6 +2024,7 @@ def test_import_line_mangles_issues_439():
"""Test to ensure comment on import with parens doesn't cause issues"""
test_input = ('import a # () import\n'
'from b import b\n')
+ assert SortImports(file_contents=test_input) == test_input
def test_alias_using_paren_issue_466(): | Ensure this test does something useful (lint error) | timothycrosley_isort | train | py |
841ea1bde530b7d046262861cc39a041f42bdce3 | diff --git a/scope.go b/scope.go
index <HASH>..<HASH> 100644
--- a/scope.go
+++ b/scope.go
@@ -938,14 +938,30 @@ func (scope *Scope) initialize() *Scope {
return scope
}
+func (scope *Scope) isQueryForColumn(query interface{}, column string) bool {
+ queryStr := fmt.Sprint(query)
+ if queryStr == column {
+ return true
+ }
+
+ if strings.HasSuffix(strings.ToLower(queryStr), "as "+column) {
+ return true
+ }
+
+ return false
+}
+
func (scope *Scope) pluck(column string, value interface{}) *Scope {
dest := reflect.Indirect(reflect.ValueOf(value))
- scope.Search.Select(column)
if dest.Kind() != reflect.Slice {
scope.Err(fmt.Errorf("results should be a slice, not %s", dest.Kind()))
return scope
}
+ if query, ok := scope.Search.selects["query"]; !ok || !scope.isQueryForColumn(query, column) {
+ scope.Search.Select(column)
+ }
+
rows, err := scope.rows()
if scope.Err(err) == nil {
defer rows.Close() | Do not always override select on pluck | jinzhu_gorm | train | go |
5e0d9fab8e7365a386504dc9f28eb2aceaffd331 | diff --git a/Controller/Box/ProductStatusBoxController.php b/Controller/Box/ProductStatusBoxController.php
index <HASH>..<HASH> 100644
--- a/Controller/Box/ProductStatusBoxController.php
+++ b/Controller/Box/ProductStatusBoxController.php
@@ -23,7 +23,7 @@ use WellCommerce\Bundle\CoreBundle\Controller\Box\AbstractBoxController;
class ProductStatusBoxController extends AbstractBoxController
{
/**
- * @var \WellCommerce\Bundle\AppBundle\Manager\Front\ProductStatusManager
+ * @var \WellCommerce\Bundle\ProductStatusBundle\Manager\Front\ProductStatusManager
*/
protected $manager;
@@ -36,7 +36,7 @@ class ProductStatusBoxController extends AbstractBoxController
$requestHelper = $this->manager->getRequestHelper();
$limit = $requestHelper->getQueryBagParam('limit', $boxSettings->getParam('per_page', 12));
$conditions = $this->manager->getStatusConditions($boxSettings->getParam('status'));
- $conditions = $this->getLayeredNavigationHelper()->addLayeredNavigationConditions($conditions);
+ $conditions = $this->get('layered_navigation.helper')->addLayeredNavigationConditions($conditions);
$products = $dataset->getResult('array', [
'limit' => $limit, | Finished restructurisation of bundles
(cherry picked from commit 7fa<I>b1af<I>e1d2bcf9ad5b4a<I>bfe<I>c) | WellCommerce_WishlistBundle | train | php |
a21b23097616f9f1a0a4394448de5446efc41473 | diff --git a/test/spec/system/mixin_spec.rb b/test/spec/system/mixin_spec.rb
index <HASH>..<HASH> 100644
--- a/test/spec/system/mixin_spec.rb
+++ b/test/spec/system/mixin_spec.rb
@@ -119,7 +119,7 @@ describe PoiseLanguages::System::Mixin do
end # /describe #system_package_candidates
describe '#system_package_name' do
- let(:chefspec_options) { {platform: 'debian', version: '7.3.1611'} }
+ let(:chefspec_options) { {platform: 'debian', version: '7.0'} }
let(:version) { '' }
let(:test_provider) { provider(:poise_test).new(nil, chef_run.run_context) }
provider(:poise_test) do | Got a little overzealous with the search and replace. | poise_poise-languages | train | rb |
ffc31a8eb46185186d55a9244679d8bd58b4ef19 | diff --git a/lib/capybara/session.rb b/lib/capybara/session.rb
index <HASH>..<HASH> 100644
--- a/lib/capybara/session.rb
+++ b/lib/capybara/session.rb
@@ -199,7 +199,7 @@ module Capybara
#
# Will actually navigate to `http://google.com:4567/test`.
#
- # @param [String] url The URL to navigate to
+ # @param [#to_s] url The URL to navigate to. The parameter will be cast to a String.
#
def visit(url)
raise_server_error! | Update visit's documentation to indicate that it requires something that can become a string | teamcapybara_capybara | train | rb |
3ee3cf4a9211d13176df1b8cc53d69c83896751c | diff --git a/allennlp/training/metrics/srl_eval_scorer.py b/allennlp/training/metrics/srl_eval_scorer.py
index <HASH>..<HASH> 100644
--- a/allennlp/training/metrics/srl_eval_scorer.py
+++ b/allennlp/training/metrics/srl_eval_scorer.py
@@ -86,7 +86,9 @@ class SrlEvalScorer(Metric):
gold_path = os.path.join(tempdir, "gold.txt")
predicted_path = os.path.join(tempdir, "predicted.txt")
- with open(predicted_path, "w") as predicted_file, open(gold_path, "w") as gold_file:
+ with open(predicted_path, "w", encoding="utf-8") as predicted_file, open(
+ gold_path, "w", encoding="utf-8"
+ ) as gold_file:
for verb_index, sentence, predicted_tag_sequence, gold_tag_sequence in zip(
batch_verb_indices,
batch_sentences, | Change SrlEvalScorer to use UTF-8 encoded files (#<I>) | allenai_allennlp | train | py |
c37567051956d4977b474a644946ead30af976ad | diff --git a/DB.php b/DB.php
index <HASH>..<HASH> 100644
--- a/DB.php
+++ b/DB.php
@@ -29,6 +29,7 @@ use WASP\Config;
use WASP\Dictionary;
use PDO;
use WASP\Debug\LoggerAwareStaticTrait;
+use WASP\System;
/**
* The DB class wraps a PDO allowing for lazy connecting.
@@ -112,7 +113,7 @@ class DB
if (self::$default_db)
return self::$default_db;
- $config = Config::getConfig();
+ $config = System::config();
$default = true;
} | Fixed one request test and some small bugs | Wedeto_DB | train | php |
f43040472fb11cce38d3a5c16fefb748d1fd0f00 | diff --git a/test/helper/bento_search_helper_test.rb b/test/helper/bento_search_helper_test.rb
index <HASH>..<HASH> 100644
--- a/test/helper/bento_search_helper_test.rb
+++ b/test/helper/bento_search_helper_test.rb
@@ -106,7 +106,7 @@ class BentoSearchHelperTest < ActionView::TestCase
assert_present loading_msg, "bento_search_ajax_loading present"
assert_match /display\:none/, loading_msg["style"], "loading has CSS style hidden"
- assert loading_msg.find(:tag => "noscript"), "has <noscript> tag"
+ assert div.find(:tag => "noscript"), "has <noscript> tag"
assert (img = loading_msg.find(:tag => "img")), "Has spinner gif"
assert_equal I18n.translate("bento_search.ajax_loading"), img.attributes["alt"] | noscript is intentionally not inside loading_msg div anymore | jrochkind_bento_search | train | rb |
db36f8dfa10224384dfc2895d1b07c6ccf41a487 | diff --git a/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js b/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js
index <HASH>..<HASH> 100644
--- a/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js
+++ b/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js
@@ -170,7 +170,6 @@
function bindToggleForSteps(stepNavTracker) {
$element.find('.js-toggle-panel').click(function (event) {
- preventLinkFollowingForCurrentTab(event);
var $step = $(this).closest('.js-step');
var stepView = new StepView($step);
@@ -250,16 +249,6 @@
});
}
- function preventLinkFollowingForCurrentTab(event) {
- // If the user is holding the ⌘ or Ctrl key, they're trying
- // to open the link in a new window, so let the click happen
- if (event.metaKey || event.ctrlKey) {
- return;
- }
-
- event.preventDefault();
- }
-
function bindToggleShowHideAllButton(stepNavTracker) {
$showOrHideAllButton = $element.find('.js-step-controls-button');
$showOrHideAllButton.on('click', function () { | Remove preventLinkFollowingForCurrentTab code
- this was a hangover from the original code where the element in question was a link, not a button
- allowed users to open the link in a new tab, but buttons don't allow this | alphagov_govuk_publishing_components | train | js |
7b8b11ac8e160096bca98dbf797403ab9f53d179 | diff --git a/secedgar/filings/cik_validator.py b/secedgar/filings/cik_validator.py
index <HASH>..<HASH> 100644
--- a/secedgar/filings/cik_validator.py
+++ b/secedgar/filings/cik_validator.py
@@ -17,6 +17,8 @@ class _CIKValidator(object):
.. versionadded:: 0.1.5
"""
+ # See Stack Overflow's answer to how-do-you-pep-8-name-a-class-whose-name-is-an-acronym
+ # if you are wondering whether CIK should be capitalized in the class name or not.
def __init__(self, lookups, client=None, **kwargs):
# Make sure lookups is not empty string
if lookups and isinstance(lookups, str): | MAINT: Note on abbrev in class names | coyo8_sec-edgar | train | py |
7e13942c06f61f1fda11bb8b9986cfd947edf560 | diff --git a/src/Option.php b/src/Option.php
index <HASH>..<HASH> 100644
--- a/src/Option.php
+++ b/src/Option.php
@@ -57,6 +57,18 @@ class Option implements OptionInterface
}
/**
+ * Returns the value.
+ *
+ * @since 1.0.0
+ *
+ * @return string The value.
+ */
+ public function getValue()
+ {
+ return $this->myValue;
+ }
+
+ /**
* Returns the option as a string.
*
* @since 1.0.0
diff --git a/tests/OptionTest.php b/tests/OptionTest.php
index <HASH>..<HASH> 100644
--- a/tests/OptionTest.php
+++ b/tests/OptionTest.php
@@ -41,4 +41,14 @@ class OptionTest extends \PHPUnit_Framework_TestCase
{
new Option('foo', null);
}
+
+ /**
+ * Test getValue method.
+ */
+ public function testGetValue()
+ {
+ $option = new Option('foo', 'bar');
+
+ self::assertSame('foo', $option->getValue());
+ }
} | Add getValue method to Option | themichaelhall_bluemvc-forms | train | php,php |
f20697e4e448904027458f7cfad5546536205b60 | diff --git a/lib/Doctrine/DBAL/SQLParserUtils.php b/lib/Doctrine/DBAL/SQLParserUtils.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/DBAL/SQLParserUtils.php
+++ b/lib/Doctrine/DBAL/SQLParserUtils.php
@@ -22,8 +22,26 @@ namespace Doctrine\DBAL;
use Doctrine\DBAL\Connection;
+/**
+ * Utility class that parses sql statements with regard to types and parameters.
+ *
+ * @license http://www.opensource.org/licenses/lgpl-license.php LGPL
+ * @link www.doctrine-project.com
+ * @since 2.0
+ * @author Benjamin Eberlei <[email protected]>
+ */
class SQLParserUtils
{
+ /**
+ * Get an array of the placeholders in an sql statements as keys and their positions in the query string.
+ *
+ * Returns an integer => integer pair for a positional statement and a string => int[] pair for
+ * a named statement.
+ *
+ * @param string $statement
+ * @param bool $isPositional
+ * @return array
+ */
static public function getPlaceholderPositions($statement, $isPositional = true)
{
$match = ($isPositional) ? '?' : ':';
@@ -59,6 +77,8 @@ class SQLParserUtils
}
/**
+ * For a positional query this method can rewrite the sql statement with regard to array parameters.
+ *
* @param string $query
* @param array $params
* @param array $types | Add some more comments for SQLParserUtils class. | doctrine_dbal | train | php |
d4f8078b590eb0877befbf111584be1ea3e6dce1 | diff --git a/src/Database/Log/QueryLogger.php b/src/Database/Log/QueryLogger.php
index <HASH>..<HASH> 100644
--- a/src/Database/Log/QueryLogger.php
+++ b/src/Database/Log/QueryLogger.php
@@ -71,6 +71,7 @@ class QueryLogger
$keys = [];
$limit = is_int(key($params)) ? 1 : -1;
+ $params = array_reverse($params);
foreach ($params as $key => $param) {
$keys[] = is_string($key) ? "/:$key/" : '/[?]/';
} | QueryLogger interpolate
While interpolating the placeholders gets wrongly replaced.
When :c1 gets replaced by his param, every placeholder from :c<I> to
:c<I> gets replaced with the wrong param too + last number from original
placeholder.
an array_reverse() will prevent this behavior | cakephp_cakephp | train | php |
bcd82f35fa8504202f666c585a7f6818109b59a1 | diff --git a/src/Binder.php b/src/Binder.php
index <HASH>..<HASH> 100644
--- a/src/Binder.php
+++ b/src/Binder.php
@@ -28,10 +28,4 @@ interface Binder
* @return mixed
*/
public function bindToInstance($abstract, $instance);
-
- /**
- * @param string $abstract
- * @param string $alias
- */
- public function alias($abstract, $alias);
}
\ No newline at end of file
diff --git a/src/Container/Laravel/LaravelBinderAdapter.php b/src/Container/Laravel/LaravelBinderAdapter.php
index <HASH>..<HASH> 100644
--- a/src/Container/Laravel/LaravelBinderAdapter.php
+++ b/src/Container/Laravel/LaravelBinderAdapter.php
@@ -46,9 +46,4 @@ class LaravelBinderAdapter implements Binder
{
$this->container->instance($abstract, $instance);
}
-
- public function alias($abstract, $alias)
- {
- $this->container->alias($abstract, $alias);
- }
}
\ No newline at end of file | Remove alias from Binder interface | jjtorroglosa_cliphar | train | php,php |
340539d0e98c4eb08b5ddd4bc51642cb041d29b8 | diff --git a/mozilla/gcli/index.js b/mozilla/gcli/index.js
index <HASH>..<HASH> 100644
--- a/mozilla/gcli/index.js
+++ b/mozilla/gcli/index.js
@@ -56,10 +56,15 @@ define(function(require, exports, module) {
require('gcli/types/javascript').startup();
require('gcli/types/node').startup();
require('gcli/types/resource').startup();
+ require('gcli/types/setting').startup();
require('gcli/types/selection').startup();
+ require('gcli/settings').startup();
require('gcli/cli').startup();
+ require('gcli/ui/intro').startup();
+
require('gcli/commands/help').startup();
+ require('gcli/commands/pref').startup();
var Requisition = require('gcli/cli').Requisition;
var Console = require('gcli/ui/console').Console; | Bug <I> (refactor<I>a): Catchup moz index with main index | joewalker_gcli | train | js |
9da68bb1294b846bd0bfdbe49c131da42a5669e5 | diff --git a/lib/vagrant.rb b/lib/vagrant.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant.rb
+++ b/lib/vagrant.rb
@@ -4,12 +4,17 @@ PROJECT_ROOT = File.join(libdir, '..') unless defined?(PROJECT_ROOT)
# The libs which must be loaded prior to the rest
%w{tempfile open-uri json pathname logger uri net/http virtualbox net/ssh archive/tar/minitar
- net/scp fileutils vagrant/util vagrant/actions/base vagrant/downloaders/base vagrant/actions/runner
+ net/scp fileutils}.each do |lib|
+ require lib
+end
+
+# The vagrant specific files which must be loaded prior to the rest
+%w{vagrant/util vagrant/actions/base vagrant/downloaders/base vagrant/actions/runner
vagrant/config vagrant/provisioners/base vagrant/provisioners/chef}.each do |f|
- require f
+ require File.expand_path(f, libdir)
end
# Glob require the rest
-Dir[File.join(PROJECT_ROOT, "lib", "vagrant", "**", "*.rb")].each do |f|
- require f
+Dir[File.join(libdir, "vagrant", "**", "*.rb")].each do |f|
+ require File.expand_path(f, PROJECT_ROOT)
end | Expand paths properly for loading so that files already loaded aren't loaded twice | hashicorp_vagrant | train | rb |
d0682de146e60af7fe1084d8b1a9906c63e5050b | diff --git a/generated/python/gapic-google-cloud-speech-v1beta1/setup.py b/generated/python/gapic-google-cloud-speech-v1beta1/setup.py
index <HASH>..<HASH> 100644
--- a/generated/python/gapic-google-cloud-speech-v1beta1/setup.py
+++ b/generated/python/gapic-google-cloud-speech-v1beta1/setup.py
@@ -17,7 +17,7 @@ install_requires = [
setup(
name='gapic-google-cloud-speech-v1beta1',
- version='0.15.0',
+ version='0.15.1',
author='Google Inc',
author_email='[email protected]',
classifiers=[ | Bump speech to <I>.
We had released <I> on January before the lib_name changes. | googleapis_api-client-staging | train | py |
d1ebf655974093388b4e01551aa8303b7e82414a | diff --git a/framework/yii/db/ActiveQuery.php b/framework/yii/db/ActiveQuery.php
index <HASH>..<HASH> 100644
--- a/framework/yii/db/ActiveQuery.php
+++ b/framework/yii/db/ActiveQuery.php
@@ -124,10 +124,14 @@ class ActiveQuery extends Query
{
$command = $this->createCommand($db);
$row = $command->queryOne();
- if ($row !== false && !$this->asArray) {
- /** @var $class ActiveRecord */
- $class = $this->modelClass;
- $model = $class::create($row);
+ if ($row !== false) {
+ if ($this->asArray) {
+ $model = $row;
+ } else {
+ /** @var $class ActiveRecord */
+ $class = $this->modelClass;
+ $model = $class::create($row);
+ }
if (!empty($this->with)) {
$models = array($model);
$this->populateRelations($models, $this->with);
@@ -135,7 +139,7 @@ class ActiveQuery extends Query
}
return $model;
} else {
- return $row === false ? null : $row;
+ return null;
}
} | Fixed the issue that ActiveQuery::one() doesn't bring back related objects when asArray is true. | yiisoft_yii2-debug | train | php |
2a57c5a2b06903e1ce12954c157f4ead2a0139a4 | diff --git a/test/6-buddy-test.js b/test/6-buddy-test.js
index <HASH>..<HASH> 100644
--- a/test/6-buddy-test.js
+++ b/test/6-buddy-test.js
@@ -20,6 +20,7 @@ describe('Buddy', () => {
});
beforeEach(() => {
buddy = null;
+ process.env.NODE_ENV = 'test';
});
afterEach(() => {
if (buddy) buddy.destroy(); | fix NODE_ENV during test | popeindustries_buddy | train | js |
178f658b08ba2eb66d51fb417abfc15e5fb162f9 | diff --git a/src/Support/BridgeStack.php b/src/Support/BridgeStack.php
index <HASH>..<HASH> 100644
--- a/src/Support/BridgeStack.php
+++ b/src/Support/BridgeStack.php
@@ -26,7 +26,16 @@ class BridgeStack extends Collection
parent::__construct($items);
}
-
+ /**
+ * Mounts a Bridge on the stack.
+ *
+ * @param string $name
+ * @param string $credential
+ * @param string $service
+ * @param string $authMethod
+ *
+ * @return $this
+ */
public function mountBridge($name, $credential = null, $service = null, $authMethod = null)
{
}
diff --git a/src/config/watson-bridge.php b/src/config/watson-bridge.php
index <HASH>..<HASH> 100644
--- a/src/config/watson-bridge.php
+++ b/src/config/watson-bridge.php
@@ -81,7 +81,7 @@ return [
'auth_methods' => [
'credentials',
- 'token'
+ 'token',
],
/* | Fix Styles after service provider reworked | findbrok_php-watson-api-bridge | train | php,php |
a73a6be42d8a0d6968a8dd4581330e1d5e959029 | diff --git a/test/travis-only.test.js b/test/travis-only.test.js
index <HASH>..<HASH> 100644
--- a/test/travis-only.test.js
+++ b/test/travis-only.test.js
@@ -23,7 +23,7 @@ test.serial('not create a dev certificate on production also with ssl specified'
const {server, url} = await listen(
'./fixture', {h: 'localhost', p: port(), ssl: true}
);
- const res = await t.throws(get(human, url, '/something'));
+ const res = await t.throwsAsync(() => get(human, url, '/something'));
t.is(res.response, undefined);
const resHTTP = await get(human, url.replace('https', 'http'), '/something'); | chore: fix throws method for ava | LasaleFamine_http-server-pwa | train | js |
adfa65ac3ebc183f189f93877eb76254ccd87573 | diff --git a/src/main/java/com/blade/Environment.java b/src/main/java/com/blade/Environment.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/blade/Environment.java
+++ b/src/main/java/com/blade/Environment.java
@@ -246,6 +246,16 @@ public class Environment {
}
return defaultValue;
}
+
+ public Map<String, Object> getPrefix(@NonNull String key) {
+ Map<String, Object> map = new HashMap<>();
+ props.forEach((key_, value) -> {
+ if (key_.toString().startsWith(key)) {
+ map.put(key_.toString(), value);
+ }
+ });
+ return map;
+ }
public boolean hasKey(@NonNull String key) {
return props.containsKey(key); | 🎄 add get map by prefix | lets-blade_blade | train | java |
a805e3461fc8528778de50369f4925c71e006a83 | diff --git a/tests/Common/ConfigurationRowTest.php b/tests/Common/ConfigurationRowTest.php
index <HASH>..<HASH> 100644
--- a/tests/Common/ConfigurationRowTest.php
+++ b/tests/Common/ConfigurationRowTest.php
@@ -214,7 +214,7 @@ class ConfigurationRowTest extends StorageApiTestCase
$command = "curl '" . STORAGE_API_URL . "/v2/storage/components/wr-db/configs/main-1/rows/{$response->id}' \
-sS \
-X PUT \
- -H 'accept-encoding: gzip, deflate, br' \
+ -H 'accept-encoding: gzip, deflate' \
-H 'accept-language: en-US,en;q=0.9,de;q=0.8,sk;q=0.7' \
-H 'content-type: application/x-www-form-urlencoded' \
-H 'accept: */*' \ | Remove brotli from request header as it's not supported by bundled curl | keboola_storage-api-php-client | train | php |
f6d1ea4d7fcef5352a23034853e6a024efbfc97f | diff --git a/engine.go b/engine.go
index <HASH>..<HASH> 100644
--- a/engine.go
+++ b/engine.go
@@ -110,6 +110,14 @@ func squaresAreAttacked(pos *Position, sqs ...Square) bool {
otherColor := pos.Turn().Other()
occ := ^pos.board.emptySqs
for _, sq := range sqs {
+ // hot path check to see if attack vector is possible
+ s2BB := pos.board.blackSqs
+ if pos.Turn() == Black {
+ s2BB = pos.board.whiteSqs
+ }
+ if ((diaAttack(occ, sq)|hvAttack(occ, sq))&s2BB)|(bbKnightMoves[sq]&s2BB) == 0 {
+ continue
+ }
// check queen attack vector
queenBB := pos.board.bbForPiece(getPiece(Queen, otherColor))
bb := (diaAttack(occ, sq) | hvAttack(occ, sq)) & queenBB | added quick skip if attack vector is not possible | notnil_chess | train | go |
fa6de3e5d9d18b4894bf80d268e728ac427079c8 | diff --git a/packages/wpcom.js/lib/post.js b/packages/wpcom.js/lib/post.js
index <HASH>..<HASH> 100644
--- a/packages/wpcom.js/lib/post.js
+++ b/packages/wpcom.js/lib/post.js
@@ -97,8 +97,27 @@ Post.prototype.getBySlug = function (query, fn) {
*/
Post.prototype.add = function (query, body, fn) {
+ if ('function' === typeof body) {
+ fn = body;
+ body = query;
+ query = {};
+ }
+
var path = '/sites/' + this._sid + '/posts/new';
- return request.post(this.wpcom, null, path, query, body, fn);
+ return request.post(this.wpcom, null, path, query, body, function (err, data) {
+ if (err) {
+ return fn(err);
+ }
+
+ // update POST object
+ this._id = data.ID;
+ debug('Set post _id: %s', this._id);
+
+ this._slug = data.slug;
+ debug('Set post _slug: %s', this._slug);
+
+ fn(null, data)
+ }.bind(this));
};
/** | Merge pull request #<I> from Automattic/improve/post-add
post: propagate `id` and `slug` when post is added | Automattic_wp-calypso | train | js |
9214574ab59115099c7f3eea6ab280f4f5f5a965 | diff --git a/addon/services/clock.js b/addon/services/clock.js
index <HASH>..<HASH> 100644
--- a/addon/services/clock.js
+++ b/addon/services/clock.js
@@ -10,13 +10,21 @@ export default Ember.Service.extend({
init() {
this._super(...arguments);
+ this.start();
+ },
+
+ start() {
this.set('interval', window.setInterval(() => this.tick(), this.get('intervalTime')));
},
+ stop() {
+ window.clearInterval(this.get('interval'));
+ },
+
reset() {
- this.willDestroy();
- this.init();
+ this.stop();
this.setProperties({second: 0, minute: 0, five: 0, quarter: 0, hour: 0});
+ this.start();
},
intervalChange: Ember.observer('intervalTime', function() {
@@ -51,6 +59,6 @@ export default Ember.Service.extend({
},
willDestroy() {
- window.clearInterval(this.get('interval'));
+ this.stop();
}
}); | services/clock: Extract start() and stop() methods
Calling init() and willDestroy() may have undesired side-effects | jerel_ember-cli-clock | train | js |
0f3667c6ce48eb26e759018ca0d1f39b2d33acaa | diff --git a/Spryker/Sniffs/Commenting/TypeHintSniff.php b/Spryker/Sniffs/Commenting/TypeHintSniff.php
index <HASH>..<HASH> 100644
--- a/Spryker/Sniffs/Commenting/TypeHintSniff.php
+++ b/Spryker/Sniffs/Commenting/TypeHintSniff.php
@@ -75,7 +75,7 @@ class TypeHintSniff extends AbstractSprykerSniff
'\\ArrayAccess',
'\\ArrayObject',
'\\Stringable',
- '\\Generator',
+ '\\Countable',
'mixed',
'callable',
'resource', | Add Countable into sorting. | spryker_code-sniffer | train | php |
1128a609201427190f5e8eafa8e022dfe4a776d5 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -6,10 +6,16 @@ var stat = require('hyperdrive/lib/messages').Stat
var path = require('path')
module.exports = function (dir) {
+ let secret_dir = undefined;
+ if (typeof dir === 'object') {
+ secret_dir = dir.secret_dir;
+ dir = dir.dir;
+ }
+
return {
metadata: function (name, opts) {
if (typeof dir === 'function') return dir('.dat/metadata.' + name)
- if (name === 'secret_key') return secretStorage()(path.join(dir, '.dat/metadata.ogd'), {key: opts.key, discoveryKey: opts.discoveryKey})
+ if (name === 'secret_key') return secretStorage(secret_dir)(path.join(dir, '.dat/metadata.ogd'), {key: opts.key, discoveryKey: opts.discoveryKey})
return raf(path.join(dir, '.dat/metadata.' + name))
},
content: function (name, opts, archive) { | Add software for specifying directory of secret storage.
Secret storage specification occurs when the directory passed to
createStore is specified as an object rather than a string. That object
takes the form of:
{dir: 'data-dir', secret_dir: 'secrets'} | datproject_dat-storage | train | js |
7e28ca9607c847127984bc5dcde79814607fd619 | diff --git a/arguments/__init__.py b/arguments/__init__.py
index <HASH>..<HASH> 100644
--- a/arguments/__init__.py
+++ b/arguments/__init__.py
@@ -377,12 +377,17 @@ class Arguments(object):
self.m_reprdict = {}
self.m_doc = ""
whitespacecount = 0
+ keeplookingforindention = True
for line in doc.strip().split("\n"):
line = line.rstrip()
- if whitespacecount == 0:
- whitespacecount = len(line) - len(line.lstrip())
+ if line.lower().startswith("usage"):
+ keeplookingforindention = False
+
+ if keeplookingforindention is True:
+ if whitespacecount == 0:
+ whitespacecount = len(line) - len(line.lstrip())
line = line[whitespacecount:]
self.m_doc += line + "\n" | markdown-to-ebook
Friday <I> March <I> (week:<I> day:<I>), <I>:<I>:<I> | erikdejonge_arguments | train | py |
68879af4145c1a5697de4cec04b6b8697337bcdf | diff --git a/gems/aws-sdk-rds/lib/aws-sdk-rds/plugins/cross_region_copying.rb b/gems/aws-sdk-rds/lib/aws-sdk-rds/plugins/cross_region_copying.rb
index <HASH>..<HASH> 100644
--- a/gems/aws-sdk-rds/lib/aws-sdk-rds/plugins/cross_region_copying.rb
+++ b/gems/aws-sdk-rds/lib/aws-sdk-rds/plugins/cross_region_copying.rb
@@ -10,10 +10,6 @@ module Aws
# This parameter is required by RDS when copying an encrypted snapshot
# across regions. This plugin will be skipped if the `:pre_signed_url`
# parameter is provided by the user.
- #
- # @seahorse.client.option [String] :source_region The region which you are
- # copying an encrypted snapshot from. This parameter must be present to
- # have the plugin compute a presigned URL on your behalf.
class CrossRegionCopying < Seahorse::Client::Plugin
# @api private | Removed incorrect docstring from rds plugin. | aws_aws-sdk-ruby | train | rb |
fe86454f2932b29d9c7b90a8c4afe9cfa9513544 | diff --git a/connection.go b/connection.go
index <HASH>..<HASH> 100644
--- a/connection.go
+++ b/connection.go
@@ -619,8 +619,30 @@ func (c *Connection) writeFrames() {
c.closeNetwork()
}
-// inboundExchangeRemoved is called whenever an exchange is removed, and when Close is called.
+// checkExchanges is called whenever an exchange is removed, and when Close is called.
func (c *Connection) checkExchanges() {
+ moveState := func(fromState, toState connectionState) bool {
+ err := c.withStateLock(func() error {
+ if c.state != fromState {
+ return errors.New("")
+ }
+ c.state = toState
+ return nil
+ })
+ return err == nil
+ }
+
+ if c.readState() == connectionStartClose {
+ if c.inbound.count() > 0 || !moveState(connectionStartClose, connectionInboundClosed) {
+ return
+ }
+ }
+
+ if c.readState() == connectionInboundClosed {
+ if c.outbound.count() > 0 || !moveState(connectionInboundClosed, connectionClosed) {
+ return
+ }
+ }
}
// Close starts a graceful Close which will first reject incoming calls, reject outgoing calls | Transition connection states when Closing
When all inbound connections are drained, transition to InboundClosed
When all outbound connections are drained, transition to Closed | uber_tchannel-go | train | go |
5aed836fdd27a22bb645a270e7c93c43bd2fabe1 | diff --git a/test/module.js b/test/module.js
index <HASH>..<HASH> 100644
--- a/test/module.js
+++ b/test/module.js
@@ -309,4 +309,12 @@ describe('Unsupported CartoCSS', function () {
}`;
assert.throws(() => { tangram_carto.cartoCssToDrawGroups(ccss, 0); });
});
+ it('due to mapnik identifiers should throw an exception', function () {
+ const ccss = `#layer [ "mapnik::geometry_type" = 2]{
+ line-color: #4CC8A3;
+ line-width: 1.5;
+ line-opacity: 1;
+ }`;
+ assert.throws(() => { tangram_carto.cartoCssToDrawGroups(ccss, 0); });
+ });
}); | Test different cartocss with spaces | CartoDB_tangram-cartocss | train | js |
b0ffd86e34b50eacb2b266a0e98768465bdf47cd | diff --git a/GenerateRepositoriesDoctrineCommand.php b/GenerateRepositoriesDoctrineCommand.php
index <HASH>..<HASH> 100644
--- a/GenerateRepositoriesDoctrineCommand.php
+++ b/GenerateRepositoriesDoctrineCommand.php
@@ -58,7 +58,7 @@ EOT
}
if ($metadata->customRepositoryClassName) {
- if (strpos($metadata->customRepositoryClassName, $foundBundle->getName()) === false) {
+ if (strpos($metadata->customRepositoryClassName, $foundBundle->getNamespace()) === false) {
throw new \RuntimeException(
"Repository " . $metadata->customRepositoryClassName . " and bundle don't have a common namespace, ".
"generation failed because the target directory cannot be detected."); | [DoctrineBundle][DoctrineMongoDBBUndle]Fixed generate:repositories throws exception using the general bundle naming conventions (VendorBundleName) | saxulum_saxulum-doctrine-orm-commands | train | php |
453d72b4684f782cced2fdad348f7462b612a316 | diff --git a/js/kucoin.js b/js/kucoin.js
index <HASH>..<HASH> 100644
--- a/js/kucoin.js
+++ b/js/kucoin.js
@@ -127,6 +127,7 @@ module.exports = class kucoin extends Exchange {
'1w': '1week',
},
'exceptions': {
+ 'order not exist': OrderNotFound,
'order_not_exist': OrderNotFound, // {"code":"order_not_exist","msg":"order_not_exist"} ¯\_(ツ)_/¯
'order_not_exist_or_not_allow_to_cancel': InvalidOrder, // {"code":"400100","msg":"order_not_exist_or_not_allow_to_cancel"}
'Order size below the minimum requirement.': InvalidOrder, // {"code":"400100","msg":"Order size below the minimum requirement."} | [kucoin] handle new error message seen today when cancelling an order that's already canceled | ccxt_ccxt | train | js |
bf871fc1c818d2a2680406ef2d72cbda184309b3 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -11,6 +11,7 @@ function Runner(options) {
return new Runner(options);
}
+ options = options || {};
this.loader = createLoader(options.loader);
this.bundler = createBundler(options.bundler);
} | Added ability to handle construction with no options | MiguelCastillo_bit-bundler | train | js |
fe4e68cb71e4630283b445982e942b887566c635 | diff --git a/spacy/about.py b/spacy/about.py
index <HASH>..<HASH> 100644
--- a/spacy/about.py
+++ b/spacy/about.py
@@ -4,13 +4,13 @@
# fmt: off
__title__ = "spacy-nightly"
-__version__ = "2.1.0a5"
+__version__ = "2.1.0a6.dev0"
__summary__ = "Industrial-strength Natural Language Processing (NLP) with Python and Cython"
__uri__ = "https://spacy.io"
__author__ = "Explosion AI"
__email__ = "[email protected]"
__license__ = "MIT"
-__release__ = True
+__release__ = False
__download_url__ = "https://github.com/explosion/spacy-models/releases/download"
__compatibility__ = "https://raw.githubusercontent.com/explosion/spacy-models/master/compatibility.json" | Set version to <I>a6.dev0 | explosion_spaCy | train | py |
54a529960db439de9a42f986c98a5defcabc4772 | diff --git a/http.js b/http.js
index <HASH>..<HASH> 100644
--- a/http.js
+++ b/http.js
@@ -38,7 +38,6 @@ exports.get = (getUrl, params, callback, redirects) => {
}).then(result => {
callback(result.data, result.headers, result.status);
}).catch(err => {
- console.error(JSON.stringify(err));
callback(err);
});
};
@@ -53,11 +52,9 @@ exports.post = function (postUrl, data, callback, redirects) {
'Content-Type': 'application/x-www-form-urlencoded'
}
};
- console.log(options);
axios(options).then(response => {
callback(response.data, response.headers, response.status);
}).catch(err => {
- console.error(JSON.stringify(err, null, 2));
callback(err);
});
-};
\ No newline at end of file
+}; | removed logging that i used during testing | havard_node-openid | train | js |
60ae7793a136f9421d4a400f650156768900bf45 | diff --git a/devices/plugwise.js b/devices/plugwise.js
index <HASH>..<HASH> 100644
--- a/devices/plugwise.js
+++ b/devices/plugwise.js
@@ -149,4 +149,27 @@ module.exports = [
.withDescription('Calibrates valve on next wakeup'),
],
},
+ {
+ zigbeeModel: ['158-01'],
+ model: '158-01',
+ vendor: 'Plugwise',
+ description: 'Lisa zone thermostat',
+ fromZigbee: [fz.thermostat, fz.temperature, fz.battery],
+ toZigbee: [
+ tz.thermostat_system_mode,
+ tz.thermostat_occupied_heating_setpoint,
+ ],
+ configure: async (device, coordinatorEndpoint, logger) => {
+ const endpoint = device.getEndpoint(1);
+ await reporting.bind(endpoint, coordinatorEndpoint, ['genBasic', 'genPowerCfg', 'hvacThermostat']);
+ await reporting.batteryPercentageRemaining(endpoint);
+ await reporting.thermostatTemperature(endpoint);
+ },
+ exposes: [e.battery(),
+ exposes.climate()
+ .withSetpoint('occupied_heating_setpoint', 5, 30, 0.5, ea.ALL)
+ .withLocalTemperature(ea.STATE)
+ .withSystemMode(['off', 'auto'], ea.ALL),
+ ],
+ },
]; | Add <I>-<I> (#<I>) | Koenkk_zigbee-shepherd-converters | train | js |
6a30e001ff9282b54dcf9b00d896c02973b84a60 | diff --git a/km3pipe/tests/test_dataclasses.py b/km3pipe/tests/test_dataclasses.py
index <HASH>..<HASH> 100644
--- a/km3pipe/tests/test_dataclasses.py
+++ b/km3pipe/tests/test_dataclasses.py
@@ -196,7 +196,9 @@ class TestTable(TestCase):
def test_from_columns_with_colnames(self):
t = Table.from_columns([[1, 2, 3], [4, 5, 6]], colnames=['a', 'b'])
+ print("t.a: {}".format(t.a))
assert np.allclose([1, 2, 3], t.a)
+ print("t.b: {}".format(t.b))
assert np.allclose([4, 5, 6], t.b)
def test_from_columns_with_colnames_upcasts(self): | Add print to see the values on Jenkins | tamasgal_km3pipe | train | py |
6b8d0e47e7448f2686975c32e113387de351b14a | diff --git a/examples/xrmp-three.js b/examples/xrmp-three.js
index <HASH>..<HASH> 100644
--- a/examples/xrmp-three.js
+++ b/examples/xrmp-three.js
@@ -263,6 +263,7 @@ class XRMultiplayerTHREE {
if (objectMesh.needsUpdate) {
objectMesh.position.toArray(objectMesh.object.objectMatrix.position);
objectMesh.quaternion.toArray(objectMesh.object.objectMatrix.quaternion);
+ objectMesh.scale.toArray(objectMesh.object.objectMatrix.scale);
objectMesh.object.pushUpdate();
objectMesh.needsUpdate = false;
@@ -303,6 +304,7 @@ class XRMultiplayerTHREE {
objectMesh.position.fromArray(objectMatrix.position);
objectMesh.quaternion.fromArray(objectMatrix.quaternion);
+ objectMesh.scale.fromArray(objectMatrix.scale);
objectMesh.updateMatrixWorld();
if (objectMesh.onupdate) { | Add XRMP three.js bindings object mesh scale support | exokitxr_exokit | train | js |
437b84820d55e031dc4a775cf400fcedbd41494f | diff --git a/unittests/parser_test_case.py b/unittests/parser_test_case.py
index <HASH>..<HASH> 100644
--- a/unittests/parser_test_case.py
+++ b/unittests/parser_test_case.py
@@ -21,16 +21,15 @@ class parser_test_case_t(unittest.TestCase):
else:
pass
- def _test_type_composition(self, type, expected_compound, expected_base):
+ def _test_type_composition(self, type_, expected_compound, expected_base):
self.failUnless(
- isinstance(type, expected_compound),
+ isinstance(type_, expected_compound),
"the compound type('%s') should be '%s'" %
- (type.decl_string, expected_compound.__name__))
+ (type_.decl_string, expected_compound.__name__))
self.failUnless(
- isinstance(type.base, expected_base),
+ isinstance(type_.base, expected_base),
"base type('%s') should be '%s'" %
- (type.decl_string,
- expected_base.__name__))
+ (type_.decl_string, expected_base.__name__))
def _test_calldef_return_type(self, calldef, expected_type):
self.failUnless( | Use type_ instead of type as variable name. | gccxml_pygccxml | train | py |
f7aba1ca92f298b0d0f21145d3e4f27cb32596ef | diff --git a/juicer/juicer/__init__.py b/juicer/juicer/__init__.py
index <HASH>..<HASH> 100644
--- a/juicer/juicer/__init__.py
+++ b/juicer/juicer/__init__.py
@@ -114,7 +114,7 @@ def promote(args):
def merge(args):
pulp = j(args)
- pulp.merge(carts=args.carts, new_cart_namename=args.new_cart_name)
+ pulp.merge(carts=args.carts, new_cart_name=args.into)
def publish(args): | fix merging into a new cart | juicer_juicer | train | py |
d7590f7a7cca170302a6f1f847b47226769f90ab | diff --git a/src/main/java/org/cactoos/io/OutputTo.java b/src/main/java/org/cactoos/io/OutputTo.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/cactoos/io/OutputTo.java
+++ b/src/main/java/org/cactoos/io/OutputTo.java
@@ -64,7 +64,7 @@ public final class OutputTo implements Output {
this(
() -> {
if (mkdirs) {
- file.getParentFile().mkdirs();
+ file.getAbsoluteFile().getParentFile().mkdirs();
}
return new FileOutputStream(file);
} | (#<I>) Using getAbsoluteFile() to fix error for single filename files | yegor256_cactoos | train | java |
598e17692546fe49a02c90a412f4c239d0671d65 | diff --git a/photutils/utils/tests/test_convolution.py b/photutils/utils/tests/test_convolution.py
index <HASH>..<HASH> 100644
--- a/photutils/utils/tests/test_convolution.py
+++ b/photutils/utils/tests/test_convolution.py
@@ -5,7 +5,6 @@ Tests for the convolution module.
from astropy.convolution import Gaussian2DKernel
import astropy.units as u
-from astropy.utils.exceptions import AstropyUserWarning
from numpy.testing import assert_allclose
import pytest
@@ -35,7 +34,6 @@ class TestFilterData:
"""
Test to ensure output is a float array for integer input data.
"""
-
filt_data = _filter_data(self.data.astype(int),
self.kernel.array.astype(int))
assert filt_data.dtype == float
@@ -56,16 +54,6 @@ class TestFilterData:
"""
Test for kernel=None.
"""
-
kernel = None
filt_data = _filter_data(self.data, kernel)
assert_allclose(filt_data, self.data)
-
- def test_filter_data_check_normalization(self):
- """
- Test kernel normalization check.
- """
-
- with pytest.warns(AstropyUserWarning) as w:
- _filter_data(self.data, self.kernel, check_normalization=True)
- assert len(w) == 1 | Remove test due to upstream astropy changes | astropy_photutils | train | py |
616e0dd3984ac175e1333e949aac091c21fd5cb8 | diff --git a/src/structures/Message.js b/src/structures/Message.js
index <HASH>..<HASH> 100644
--- a/src/structures/Message.js
+++ b/src/structures/Message.js
@@ -166,7 +166,7 @@ class Message {
const clone = Util.cloneObject(this);
this._edits.unshift(clone);
- if ('editedTimestamp' in data) this.editedTimestamp = new Date(data.edited_timestamp).getTime();
+ if ('edited_timestamp' in data) this.editedTimestamp = new Date(data.edited_timestamp).getTime();
if ('content' in data) this.content = data.content;
if ('pinned' in data) this.pinned = data.pinned;
if ('tts' in data) this.tts = data.tts; | fix(Message): properly check for an edited_timestamp in patch
Fixes #<I> | discordjs_discord.js | train | js |
34809ac51302d05b6b7a3004d34e8c9c45b25aa0 | diff --git a/system/Test/Mock/MockEmail.php b/system/Test/Mock/MockEmail.php
index <HASH>..<HASH> 100644
--- a/system/Test/Mock/MockEmail.php
+++ b/system/Test/Mock/MockEmail.php
@@ -13,13 +13,12 @@ class MockEmail extends Email
public function send($autoClear = true)
{
- $this->archive = get_object_vars($this);
-
if ($autoClear)
{
$this->clear();
}
+ $this->archive = get_object_vars($this);
return true;
}
}
diff --git a/tests/system/Email/EmailTest.php b/tests/system/Email/EmailTest.php
index <HASH>..<HASH> 100644
--- a/tests/system/Email/EmailTest.php
+++ b/tests/system/Email/EmailTest.php
@@ -30,6 +30,10 @@ class EmailTest extends \CodeIgniter\Test\CIUnitTestCase
$email->setTo('[email protected]');
$this->assertTrue($email->send($autoClear));
- $this->assertEquals('[email protected]', $email->archive['recipients'][0]);
+
+ if (! $autoClear)
+ {
+ $this->assertEquals('[email protected]', $email->archive['recipients'][0]);
+ }
}
} | place archiving after clear() check | codeigniter4_CodeIgniter4 | train | php,php |
5aaf59e5e5c2adc4396d8f9c211ef18e98cff96d | diff --git a/src/module-elasticsuite-core/Client/ClientConfiguration.php b/src/module-elasticsuite-core/Client/ClientConfiguration.php
index <HASH>..<HASH> 100644
--- a/src/module-elasticsuite-core/Client/ClientConfiguration.php
+++ b/src/module-elasticsuite-core/Client/ClientConfiguration.php
@@ -131,6 +131,7 @@ class ClientConfiguration implements ClientConfigurationInterface
'servers' => $this->getServerList(),
'scheme' => $this->getScheme(),
'enable_http_auth' => $this->isHttpAuthEnabled(),
+ 'http_auth_encoded' => $this->isHttpAuthEncodingEnabled(),
'http_auth_user' => $this->getHttpAuthUser(),
'http_auth_pwd' => $this->getHttpAuthPassword(),
'is_debug_mode_enabled' => $this->isDebugModeEnabled(), | #<I> Add Basic HTTP Authentication (encrypted) support for Open Distro | Smile-SA_elasticsuite | train | php |
3ac822d5e20f973d536c30cf5036de263bece0d7 | diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php
index <HASH>..<HASH> 100644
--- a/src/Composer/Util/RemoteFilesystem.php
+++ b/src/Composer/Util/RemoteFilesystem.php
@@ -233,7 +233,10 @@ class RemoteFilesystem
$origFileUrl = $fileUrl;
if (isset($options['github-token'])) {
- $fileUrl .= (false === strpos($fileUrl, '?') ? '?' : '&') . 'access_token='.$options['github-token'];
+ // only add the access_token if it is actually a github URL (in case we were redirected to S3)
+ if (preg_match('{^https?://([a-z0-9-]+\.)*github\.com/}', $fileUrl)) {
+ $fileUrl .= (false === strpos($fileUrl, '?') ? '?' : '&') . 'access_token='.$options['github-token'];
+ }
unset($options['github-token']);
} | Fix access_token param being incorrectly added on github requests after a redirection, fixes #<I> | composer_composer | train | php |
58c661ffcfc9e2b74ff293b0ddfd5ee13369dfb1 | diff --git a/lib/sauce/config.rb b/lib/sauce/config.rb
index <HASH>..<HASH> 100644
--- a/lib/sauce/config.rb
+++ b/lib/sauce/config.rb
@@ -85,12 +85,17 @@ module Sauce
end
def load_options_from_heroku
- begin
- require 'heroku/command'
- command = Heroku::Command::BaseWithApp.new([])
- environment = command.heroku.config_vars(command.app)
- return extract_options_from_hash(environment)
- rescue LoadError
+ buffer = IO.popen("heroku config --shell") do |heroku|
+ buffer = heroku.read
+ end
+ if $? == 0
+ env = {}
+ buffer.split("\n").each do |line|
+ key, value = line.split("=")
+ env[key] = value
+ end
+ return extract_options_from_hash(env)
+ else
return {}
end
end
@@ -135,7 +140,7 @@ module Sauce
if env.include? 'SAUCE_BROWSERS'
browsers = JSON.parse(env['SAUCE_BROWSERS'])
- opts.browsers = browsers.map { |x| [x['os'], x['browser'], x['version']] }
+ opts[:browsers] = browsers.map { |x| [x['os'], x['browser'], x['version']] }
end
return opts.delete_if {|key, value| value.nil?} | Don't depend on heroku being loaded | saucelabs_sauce_ruby | train | rb |
816ea519bdd65c252981e6735ac75d67aef267c4 | diff --git a/Kwc/List/ChildPages/Teaser/Update/20150309Legacy00002.php b/Kwc/List/ChildPages/Teaser/Update/20150309Legacy00002.php
index <HASH>..<HASH> 100644
--- a/Kwc/List/ChildPages/Teaser/Update/20150309Legacy00002.php
+++ b/Kwc/List/ChildPages/Teaser/Update/20150309Legacy00002.php
@@ -19,7 +19,7 @@ class Kwc_List_ChildPages_Teaser_Update_20150309Legacy00002 extends Kwf_Update
foreach (Kwf_Model_Abstract::getInstance('Kwc_List_ChildPages_Teaser_Model')->getRows($s) as $row) {
$childPage = Kwf_Component_Data_Root::getInstance()->getComponentByDbId($row->target_page_id, array('ignoreVisible'=>true, 'limit'=>1));
$row->visible = isset($childPage->row) && isset($childPage->row->visible) ? $childPage->row->visible : true;
-
+ $row->save();
}
Kwf_Model_Abstract::clearAllRows();
} | Add missing save statement in update script
without this save nothing at all will be updated | koala-framework_koala-framework | train | php |
d7a91db097e500c6e9bae69339be6159cff80e60 | diff --git a/lib/instance/network_configurator/ubuntu_network_configurator.rb b/lib/instance/network_configurator/ubuntu_network_configurator.rb
index <HASH>..<HASH> 100644
--- a/lib/instance/network_configurator/ubuntu_network_configurator.rb
+++ b/lib/instance/network_configurator/ubuntu_network_configurator.rb
@@ -35,9 +35,9 @@ auto #{device}
iface #{device} inet static
address #{ip}
netmask #{netmask}
-gateway #{gateway}
-dns-nameservers #{nameservers.join(" ")}
- EOH
+EOH
+ config_data << "gateway #{gateway}\n" if gateway
+ config_data << "dns-nameservers #{nameservers.join(" ")}\n"
end
def ip_route_cmd(network, nat_server_ip) | acu<I> don't save gateway in config if gateway is not provided | rightscale_right_link | train | rb |
466b0487f60e71e88924e3b78d3e52a41244a2a6 | diff --git a/xchange-btcchina/src/main/java/com/xeiam/xchange/btcchina/dto/trade/streaming/BTCChinaBalance.java b/xchange-btcchina/src/main/java/com/xeiam/xchange/btcchina/dto/trade/streaming/BTCChinaBalance.java
index <HASH>..<HASH> 100644
--- a/xchange-btcchina/src/main/java/com/xeiam/xchange/btcchina/dto/trade/streaming/BTCChinaBalance.java
+++ b/xchange-btcchina/src/main/java/com/xeiam/xchange/btcchina/dto/trade/streaming/BTCChinaBalance.java
@@ -51,8 +51,8 @@ public class BTCChinaBalance {
*/
@Override
public String toString() {
-
- return ToStringBuilder.reflectionToString(this);
+ return "BTCChinaBalance [amountInteger=" + amountInteger + ", amount=" + amount + ", symbol=" + symbol
+ + ", amountDecimal=" + amountDecimal + ", currency=" + currency + "]";
}
} | Changing trade.streaming.BTCChinaBalance.toString() method to be prettier.
Before, the method printed out a nasty string that prefixed the entire package name like:
com.xeiam.xchange...streaming.BTCChinaBalance@7f<I>, which is not a useful string. The method is
now changed to behave like the toString() method in BTCChinaOrder of the same package. | knowm_XChange | train | java |
Subsets and Splits