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 |
|---|---|---|---|---|---|
d3bafc0ac067d61c1d4325bc4aa1d1c91a7dc89b | diff --git a/src/ossos/core/ossos/fitsviewer/singletviewer.py b/src/ossos/core/ossos/fitsviewer/singletviewer.py
index <HASH>..<HASH> 100644
--- a/src/ossos/core/ossos/fitsviewer/singletviewer.py
+++ b/src/ossos/core/ossos/fitsviewer/singletviewer.py
@@ -43,7 +43,7 @@ class SingletViewer(WxMPLFitsViewer):
return
try:
- radii = (cutout.apcor.aperture, cutout.apcor.sky, cutout.apcor.swidth+cutout.apcor.sky)
+ # radii = (cutout.apcor.aperture, cutout.apcor.sky, cutout.apcor.swidth+cutout.apcor.sky)
radii = (cutout.apcor.sky, cutout.apcor.swidth+cutout.apcor.sky)
except Exception as ex:
logger.info("Exception: {0}".format(ex)) | commented out deprecated definition of radii list | OSSOS_MOP | train | py |
eb8fcf833c1e898206d183a8b4a415cd487179c5 | diff --git a/npm/index.js b/npm/index.js
index <HASH>..<HASH> 100644
--- a/npm/index.js
+++ b/npm/index.js
@@ -15,4 +15,20 @@ function getElectronPath () {
}
}
-module.exports = getElectronPath()
+// A list of the main modules the people will attempt to use from the Electron API, this is not a complete list but should cover most
+// use cases.
+var electronModuleNames = ['app', 'autoUpdater', 'BrowserWindow', 'ipcMain', 'Menu', 'net', 'Notification', 'systemPreferences', 'Tray']
+var electronPath = new String(getElectronPath())
+
+electronModuleNames.forEach(function warnOnElectronAPIAccess (apiKey) {
+ Object.defineProperty(electronPath, apiKey, {
+ enumerable: false,
+ configurable: false,
+ get: function getElectronAPI () {
+ console.warn('WARNING: You are attempting to access an Electron API from a node environment.\n\n' +
+ 'You need to use the "electron" command to run your app. E.g. "npx electron ./myapp.js"')
+ }
+ })
+})
+
+module.exports = electronPath | chore: warn when people attempt to use the Electron module to do Electron things but from node (#<I>)
* chore: warn when people attempt to use the Electron module to do Electron things but from node
* update node env console warning | electron_electron | train | js |
34cd3d4191af60acc75b5fd164923f4d03763384 | diff --git a/lib/lightmodels/info_extraction.rb b/lib/lightmodels/info_extraction.rb
index <HASH>..<HASH> 100644
--- a/lib/lightmodels/info_extraction.rb
+++ b/lib/lightmodels/info_extraction.rb
@@ -22,7 +22,7 @@ class TermsBreaker
def self.from_context(language_specific_logic,context)
ser_context = LightModels::Serialization.jsonize_obj(context)
- values_map = LightModels::Query.collect_values_with_count(ser_context)
+ values_map = LightModels::QuerySerialized.collect_values_with_count(ser_context)
instance = new(language_specific_logic)
values_map.each do |value,c|
value = value.to_s.strip
@@ -108,7 +108,7 @@ end
def self.values_map(model_node)
ser_model_node = LightModels::Serialization.jsonize_obj(model_node)
- LightModels::Query.collect_values_with_count(ser_model_node)
+ LightModels::QuerySerialized.collect_values_with_count(ser_model_node)
end
def self.terms_map(language_specific_logic,model_node,context=nil) | Using QuerySerialized instead of Query | ftomassetti_codemodels | train | rb |
116e66eb1fff85978b812bb99b6cec9e6420eb51 | diff --git a/src/Model/Filter/FilterInterface.php b/src/Model/Filter/FilterInterface.php
index <HASH>..<HASH> 100644
--- a/src/Model/Filter/FilterInterface.php
+++ b/src/Model/Filter/FilterInterface.php
@@ -74,16 +74,6 @@ interface FilterInterface
public function getArgs();
/**
- * Get / Set the validation rules.
- *
- * @param array|null $value Value.
- * @return array|null
- * @codeCoverageIgnore
- * @internal
- */
- public function validate(array $value = null);
-
- /**
* Sets the query object.
*
* @param \Cake\Datasource\QueryInterface $value Value. | Removing validate() from the filter interface | FriendsOfCake_search | train | php |
5a22302824a89a1b4607f65c454f0c348834e72d | diff --git a/ai/models.py b/ai/models.py
index <HASH>..<HASH> 100644
--- a/ai/models.py
+++ b/ai/models.py
@@ -27,12 +27,14 @@ class Problem(object):
class SearchNode(object):
'''Node of a search process.'''
- def __init__(self, state, parent=None, action=None, cost=0, problem=None):
+ def __init__(self, state, parent=None, action=None, cost=0, problem=None,
+ depth=0):
self.state = state
self.parent = parent
self.action = action
self.cost = cost
self.problem = problem or parent.problem
+ self.depth = 0
def expand(self):
'''Create successors.'''
@@ -45,7 +47,8 @@ class SearchNode(object):
new_nodes.append(SearchNode(state=new_state,
parent=self,
cost=cost,
- problem=self.problem))
+ problem=self.problem,
+ depth=self.depth + 1))
return new_nodes
def has_goal_state(self): | Added deph handling on nodes | simpleai-team_simpleai | train | py |
2119dbbbeacb73f0687a72cbfef673cc43a26582 | diff --git a/gui/src/main/java/org/jboss/as/console/client/core/bootstrap/ExecutionMode.java b/gui/src/main/java/org/jboss/as/console/client/core/bootstrap/ExecutionMode.java
index <HASH>..<HASH> 100644
--- a/gui/src/main/java/org/jboss/as/console/client/core/bootstrap/ExecutionMode.java
+++ b/gui/src/main/java/org/jboss/as/console/client/core/bootstrap/ExecutionMode.java
@@ -181,8 +181,11 @@ public class ExecutionMode implements Function<BootstrapContext> {
StandardRole.add("Operator");
StandardRole.add("SuperUser");
- ModelNode whoami = response.get(RESULT).get("step-7");
+ ModelNode whoami = response.get(RESULT).get("step-6");
ModelNode whoamiResult = whoami.get(RESULT);
+
+ System.out.println(whoamiResult);
+
String username = whoamiResult.get("identity").get("username").asString();
context.setPrincipal(username);
Set<String> mappedRoles = new HashSet<String>(); | Role back HAL-<I>, part 2 | hal_core | train | java |
fddfee6e6bac5d64988663da915d9912292d7965 | diff --git a/site/build.js b/site/build.js
index <HASH>..<HASH> 100644
--- a/site/build.js
+++ b/site/build.js
@@ -81,7 +81,7 @@ metalSmith(__dirname)
.use(require('./syntax-highlight'))
.use(require('metalsmith-markdown')())
// permalinks with no options will just make pretty urls...
- .use(require('metalsmith-permalinks')())
+ .use(require('metalsmith-permalinks')({ relative: false }))
.use(function (files, metalsmith, next) {
// Useful for debugging ;-)
// require('uninspected').log(files); | disable the relative option in permalinks | unexpectedjs_unexpected | train | js |
229e0ff0732cc6dc073ad1ec69738ca2193e5e6a | diff --git a/cellbase-app/src/main/java/org/opencb/cellbase/app/cli/admin/executors/DownloadCommandExecutor.java b/cellbase-app/src/main/java/org/opencb/cellbase/app/cli/admin/executors/DownloadCommandExecutor.java
index <HASH>..<HASH> 100644
--- a/cellbase-app/src/main/java/org/opencb/cellbase/app/cli/admin/executors/DownloadCommandExecutor.java
+++ b/cellbase-app/src/main/java/org/opencb/cellbase/app/cli/admin/executors/DownloadCommandExecutor.java
@@ -163,6 +163,10 @@ public class DownloadCommandExecutor extends CommandExecutor {
break;
case EtlCommons.GENE_DATA:
downloadManager.downloadEnsemblGene(sp, spShortName, assembly.getName(), spFolder);
+ if (!dataList.contains(EtlCommons.GENOME_DATA)) {
+ // user didn't specify genome data to download, but we need it for gene data sources
+ downloadManager.downloadReferenceGenome(sp, spShortName, assembly.getName(), spFolder);
+ }
break;
case EtlCommons.VARIATION_DATA:
downloadManager.downloadVariation(sp, spShortName, spFolder); | if user has specified gene but not genome, download genome anyway. it's required. #<I> | opencb_cellbase | train | java |
38d2129d9013b7d11eaf1a07883fdbd3eb8d280d | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -403,6 +403,17 @@ export default class Carousel extends Component {
this._ignoreNextMomentum = true;
}
}
+
+ if (autoplay) {
+ // Restart autoplay after a little while
+ // This could be done when releasing touch
+ // but the event is buggy on Android...
+ clearTimeout(this._enableAutoplayTimeout);
+ this._enableAutoplayTimeout =
+ setTimeout(() => {
+ this.startAutoplay(true);
+ }, autoplayDelay + 1000);
+ }
}
snapToNext (animated = true) {
@@ -450,6 +461,7 @@ export default class Carousel extends Component {
onScrollEndDrag={!enableMomentum ? this._onScrollEnd : undefined}
onResponderRelease={this._onTouchRelease}
onResponderMove={this._onTouchMove}
+ onMoveShouldSetResponder={() => true} // enables _onTouchMove on Android
onScroll={this._onScroll}
scrollEventThrottle={50}
{...this.props} | fix(component): autoplay will start and stop properly on Android | archriss_react-native-snap-carousel | train | js |
9ad79811ec799ea23c513ef9063705ef72cbf017 | diff --git a/object/src/main/java/com/orientechnologies/orient/object/db/OObjectDatabasePool.java b/object/src/main/java/com/orientechnologies/orient/object/db/OObjectDatabasePool.java
index <HASH>..<HASH> 100644
--- a/object/src/main/java/com/orientechnologies/orient/object/db/OObjectDatabasePool.java
+++ b/object/src/main/java/com/orientechnologies/orient/object/db/OObjectDatabasePool.java
@@ -33,6 +33,11 @@ public class OObjectDatabasePool extends ODatabasePoolBase<OObjectDatabaseTx> {
return globalInstance;
}
+ public static OObjectDatabasePool global(final int iPoolMin, final int iPoolMax) {
+ globalInstance.setup(iPoolMin, iPoolMax);
+ return globalInstance;
+ }
+
@Override
protected OObjectDatabaseTx createResource(final Object owner, final String iDatabaseName, final Object... iAdditionalArgs) {
return new OObjectDatabaseTxPooled((OObjectDatabasePool) owner, iDatabaseName, (String) iAdditionalArgs[0], | Added pool initialization in Object Database Pool instance | orientechnologies_orientdb | train | java |
0b70df4ef28eafd48efc21b5257a78060c69e9ab | diff --git a/test/Exporter/Test/Source/PDOStatementSourceIteratorTest.php b/test/Exporter/Test/Source/PDOStatementSourceIteratorTest.php
index <HASH>..<HASH> 100644
--- a/test/Exporter/Test/Source/PDOStatementSourceIteratorTest.php
+++ b/test/Exporter/Test/Source/PDOStatementSourceIteratorTest.php
@@ -11,6 +11,10 @@ class PDOStatementSourceIteratorTest extends \PHPUnit_Framework_TestCase
public function setUp()
{
+ if (!in_array('sqlite', \PDO::getAvailableDrivers())) {
+ $this->markTestSkipped('the sqlite extension is not available');
+ }
+
if (is_file('foo.db')) {
unlink('foo.db');
} | Fix unit tests failing if sqlite is not present | sonata-project_exporter | train | php |
ba488cc88d5791af9c6d8660a4739fb8797c94e3 | diff --git a/blimpy/waterfall.py b/blimpy/waterfall.py
index <HASH>..<HASH> 100755
--- a/blimpy/waterfall.py
+++ b/blimpy/waterfall.py
@@ -26,8 +26,8 @@ import sys
import time
import h5py
-from .filterbank import Filterbank
-from . import file_wrapper as fw
+from filterbank import Filterbank
+import file_wrapper as fw
try:
HAS_BITSHUFFLE = True | Fixing import, but maybe breaking for install… | UCBerkeleySETI_blimpy | train | py |
464a5422cd34eaa7f5a4aab5130d3e33b9e0a69c | diff --git a/lib/quartz_torrent/peerclient.rb b/lib/quartz_torrent/peerclient.rb
index <HASH>..<HASH> 100644
--- a/lib/quartz_torrent/peerclient.rb
+++ b/lib/quartz_torrent/peerclient.rb
@@ -1067,7 +1067,11 @@ module QuartzTorrent
end
peer.bitfield = msg.bitfield
- peer.bitfield.length = torrentData.info.pieces.length
+ if torrentData.info
+ peer.bitfield.length = torrentData.info.pieces.length
+ else
+ @logger.warn "A peer connected and sent a bitfield but we don't know the length of the torrent yet. Assuming number of pieces is divisible by 8"
+ end
if ! torrentData.blockState
@logger.warn "Bitfield: no blockstate yet." | Improved handling of Bitfield messages when we don't have metadata yet. | jeffwilliams_quartz-torrent | train | rb |
25861aada62253174a2fc1b09453cc6cdd1b829e | diff --git a/xpdo/transport/xpdovehicle.class.php b/xpdo/transport/xpdovehicle.class.php
index <HASH>..<HASH> 100644
--- a/xpdo/transport/xpdovehicle.class.php
+++ b/xpdo/transport/xpdovehicle.class.php
@@ -264,7 +264,9 @@ abstract class xPDOVehicle {
$fileName = $fileMeta['name'];
$fileSource = $transport->path . $fileMeta['source'];
if (!$validated = include ($fileSource)) {
- $transport->xpdo->log(xPDO::LOG_LEVEL_ERROR, "xPDOVehicle validator failed: type php ({$fileSource})");
+ if (!isset($fileMeta['silent_fail']) || !$fileMeta['silent_fail']) {
+ $transport->xpdo->log(xPDO::LOG_LEVEL_ERROR, "xPDOVehicle validator failed: type php ({$fileSource})");
+ }
}
break; | Restore initial idea behind "silent validation failure" | modxcms_xpdo | train | php |
af3fb5c859e27224021f50416eed42acb2f33e6d | diff --git a/test/cases/offset_and_limit_test_sqlserver.rb b/test/cases/offset_and_limit_test_sqlserver.rb
index <HASH>..<HASH> 100644
--- a/test/cases/offset_and_limit_test_sqlserver.rb
+++ b/test/cases/offset_and_limit_test_sqlserver.rb
@@ -16,14 +16,6 @@ class OffsetAndLimitTestSqlserver < ActiveRecord::TestCase
assert_sql(/SELECT TOP \(10\)/) { Book.limit(10).all }
end
- should 'allow sql literal for limit' do
- assert_sql(/SELECT TOP \(3-2\)/) { Book.limit(Arel.sql('3-2')).all }
- assert_sql(/SELECT TOP \(SELECT 2 AS \[count\]\)/) do
- books = Book.all :limit => Arel.sql('SELECT 2 AS [count]')
- assert_equal 2, books.size
- end
- end
-
end
context 'When selecting with offset' do | Do not test what is now part of rails core. | rails-sqlserver_activerecord-sqlserver-adapter | train | rb |
d5efd7ade688b6e8f8663aa3df7ab8faf87e7d85 | diff --git a/sparta.go b/sparta.go
index <HASH>..<HASH> 100644
--- a/sparta.go
+++ b/sparta.go
@@ -958,7 +958,7 @@ functionName string) (*LambdaAWSInfo, error) {
lambda := NewLambda(roleNameOrIAMRoleDefinition, fn, lambdaOptions)
lambda.functionName = functionName
- return lambda
+ return lambda, nil
}
// NewLogger returns a new logrus.Logger instance. It is the caller's responsibility | Added a nil error return when the function completes successfully | mweagle_Sparta | train | go |
8c3ca46996154185dafeec615e5af4d4bba2859f | diff --git a/migrations/2016_05_02_193213_create_gateway_transactions_table.php b/migrations/2016_05_02_193213_create_gateway_transactions_table.php
index <HASH>..<HASH> 100644
--- a/migrations/2016_05_02_193213_create_gateway_transactions_table.php
+++ b/migrations/2016_05_02_193213_create_gateway_transactions_table.php
@@ -43,7 +43,7 @@ class CreateGatewayTransactionsTable extends Migration
])->default(Enum::TRANSACTION_INIT);
$table->string('ip', 20)->nullable();
$table->timestamp('payment_date')->nullable();
- $table->timestamps();
+ $table->nullableTimestamps();
$table->softDeletes();
});
} | Update <I>_<I>_<I>_<I>_create_gateway_transactions_table.php
default value for created_at and updated_at should be null or in its special format. By default it uses 0 as default value and it causes an error :) | larabook_gateway | train | php |
ac346bca8f29e641965902b6bdec886f24422c06 | diff --git a/src/connection.js b/src/connection.js
index <HASH>..<HASH> 100644
--- a/src/connection.js
+++ b/src/connection.js
@@ -138,18 +138,6 @@ class Connection {
//TODO
}
- escape(value) {
- //TODO ?
- }
-
- escapeId(value) {
- //TODO ?
- }
-
- format(sql, values) {
- //TODO ?
- }
-
on(eventName, listener) {
this.events.on(eventName, listener);
} | removing API Connection.escape, escapeId and format, not wanting client escaping | MariaDB_mariadb-connector-nodejs | train | js |
ec8039b0f4a8fa19c53319be3e8d3f402a28619a | diff --git a/src/base/model.js b/src/base/model.js
index <HASH>..<HASH> 100644
--- a/src/base/model.js
+++ b/src/base/model.js
@@ -530,9 +530,7 @@ var Model = Events.extend({
this.on('change:which', function(evt) {
//defer is necessary because other events might be queued.
//load right after such events
- utils.defer(function() {
- _this.load();
- });
+ _this.load();
});
//this is a hook, therefore it needs to reload when data changes
this.on('hook_change', function() { | Fix bubble sizes growing too large when indicator is changed | vizabi_vizabi | train | js |
d5efe56892c24714f86fb3c5cd3791c9e36ea29e | diff --git a/src/js/load.js b/src/js/load.js
index <HASH>..<HASH> 100644
--- a/src/js/load.js
+++ b/src/js/load.js
@@ -7,6 +7,10 @@
if (!url) {
if ($this.is('img')) {
+ if (!$this.attr('src')) {
+ return;
+ }
+
url = $this.prop('src');
} else if ($this.is('canvas') && SUPPORT_CANVAS) {
url = $this[0].toDataURL(); | Stop to load image when it is not src | fengyuanchen_cropper | train | js |
f18765f9bba9f0987729d0d8fce72e97ed5d29d5 | diff --git a/library/src/main/java/com/alamkanak/weekview/WeekView.java b/library/src/main/java/com/alamkanak/weekview/WeekView.java
index <HASH>..<HASH> 100755
--- a/library/src/main/java/com/alamkanak/weekview/WeekView.java
+++ b/library/src/main/java/com/alamkanak/weekview/WeekView.java
@@ -534,7 +534,7 @@ public class WeekView extends View {
maxAmountOfAllDayEventsInOneDay = Math.max(maxAmountOfAllDayEventsInOneDay, amountOfAllDayEvents);
}
}
- mHeaderHeight = mHeaderTextHeight + mAllDayEventHeight*maxAmountOfAllDayEventsInOneDay;
+ mHeaderHeight = mHeaderTextHeight + (mAllDayEventHeight + mHeaderMarginBottom) * Math.min(1, maxAmountOfAllDayEventsInOneDay);
Calendar today = today();
if (mAreDimensionsInvalid) { | Fix for multiple AllDay events on one day | alamkanak_Android-Week-View | train | java |
06b354dd4c52ae3057c52cbcc29a6e162b80fbc9 | diff --git a/gwpy/timeseries/io/losc.py b/gwpy/timeseries/io/losc.py
index <HASH>..<HASH> 100644
--- a/gwpy/timeseries/io/losc.py
+++ b/gwpy/timeseries/io/losc.py
@@ -200,7 +200,7 @@ def read_losc_hdf5(h5f, path='strain/Strain',
"""
dataset = io_hdf5.find_dataset(h5f, path)
# read data
- nddata = dataset.value
+ nddata = dataset[()]
# read metadata
xunit = parse_unit(dataset.attrs['Xunits'])
epoch = dataset.attrs['Xstart'] | gwpy.timeseries: fixed HDF5 DeprecationWarning | gwpy_gwpy | train | py |
a376a6c78cb276c0e5cb812c388a6ab88cdcde1f | diff --git a/bits/99_footer.js b/bits/99_footer.js
index <HASH>..<HASH> 100644
--- a/bits/99_footer.js
+++ b/bits/99_footer.js
@@ -3,7 +3,7 @@
/*:: declare var define:any; */
if(typeof exports !== 'undefined') make_xlsx_lib(exports);
else if(typeof module !== 'undefined' && module.exports) make_xlsx_lib(module.exports);
-else if(typeof define === 'function' && define.amd) define(function() { if(!XLSX.version) make_xlsx_lib(XLSX); return XLSX; });
+else if(typeof define === 'function' && define.amd) define('xlsx-dist', function() { if(!XLSX.version) make_xlsx_lib(XLSX); return XLSX; });
else make_xlsx_lib(XLSX);
/*exported XLS, ODS */
var XLS = XLSX, ODS = XLSX; | Use named define for requireJS
Two benefits:
* Helps avoid with mismatched anonymous errors
ref: <URL> | SheetJS_js-xlsx | train | js |
cab95cd41b0cc44892bc6248fca56ad4537a522d | diff --git a/writer.go b/writer.go
index <HASH>..<HASH> 100644
--- a/writer.go
+++ b/writer.go
@@ -1,7 +1,30 @@
package speed
+import (
+ "errors"
+ "os"
+ "path"
+ "strings"
+)
+
// Writer defines the interface of a MMV file writer's properties
type Writer interface {
- Registry() *Registry // a writer must contain a registry of metrics and instance domains
- Write() error // writes an mmv file
+ Registry() Registry // a writer must contain a registry of metrics and instance domains
+ Write() error // writes an mmv file
+}
+
+func mmvFileLocation(name string) (string, error) {
+ if strings.ContainsRune(name, os.PathSeparator) {
+ return "", errors.New("name cannot have path separator")
+ }
+
+ tdir, present := Config["PCP_TMP_DIR"]
+ var loc string
+ if present {
+ loc = path.Join(RootPath, tdir)
+ } else {
+ loc = os.TempDir()
+ }
+
+ return path.Join(loc, "mmv", name), nil
} | writer: implement mmv location getter | performancecopilot_speed | train | go |
f1e42623de5817b4807953ba91c0ab11af1ed34f | diff --git a/motion/adapters/array_model_persistence.rb b/motion/adapters/array_model_persistence.rb
index <HASH>..<HASH> 100644
--- a/motion/adapters/array_model_persistence.rb
+++ b/motion/adapters/array_model_persistence.rb
@@ -70,6 +70,11 @@ module MotionModel
bulk_update do
NSKeyedUnarchiver.unarchiveObjectWithData(data)
end
+
+ # ensure _next_id is in sync with deserialized model
+ max_id = self.all.map { |o| o.id }.max
+ increment_next_id(max_id) unless max_id.nil? || _next_id > max_id
+
return self
end
else | Call increment_next_id after deserialize
Ensures that the _next_id variable is in sync with the newly loaded data | sxross_MotionModel | train | rb |
11822a3b11a8b0844b1b21798f88cdeb60a6b175 | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -11,10 +11,10 @@
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
-#
-# import os
-# import sys
-# sys.path.insert(0, os.path.abspath('.'))
+
+import os
+import sys
+sys.path.insert(0, os.path.abspath('..'))
# -- Project information -----------------------------------------------------
@@ -156,4 +156,4 @@ texinfo_documents = [
]
-# -- Extension configuration -------------------------------------------------
\ No newline at end of file
+# -- Extension configuration ------------------------------------------------- | Make sure the fluteline module is available for sphinx | Nagasaki45_fluteline | train | py |
7cf049cfc53b43c40389dea4362c3071090b1787 | diff --git a/tests/test_db.py b/tests/test_db.py
index <HASH>..<HASH> 100644
--- a/tests/test_db.py
+++ b/tests/test_db.py
@@ -22,15 +22,15 @@
import os.path
import sys
-import shutil
-from helpers import QuiltTest
+from helpers import QuiltTest, StringIO, tmp_mapping
test_dir = os.path.dirname(__file__)
sys.path.append(os.path.join(test_dir, os.pardir))
-from quilt.db import PatchSeries
+from quilt.db import PatchSeries, Series
from quilt.db import Patch
+from quilt.utils import TmpDirectory
def patch_list(patch_names):
return [Patch(name) for name in patch_names]
@@ -74,6 +74,16 @@ class DbTest(QuiltTest):
"patchwith", "lastpatch"]),
db.patches())
+ def test_bad_args(self):
+ with TmpDirectory() as dir:
+ series = Series(dir.get_name())
+ with open(series.series_file, "wb") as file:
+ file.write(b"patch -X\n")
+ with tmp_mapping(vars(sys)) as tmp_sys:
+ tmp_sys.set("stderr", StringIO())
+ series.read()
+ self.assertIn("-X", sys.stderr.getvalue())
+
def test_add_remove(self):
# test add, remove patches | Test for series file with bad patch options | bjoernricks_python-quilt | train | py |
36d72df6ddbafc780928392466a5983777f8aa96 | diff --git a/ncbi_genome_download/core.py b/ncbi_genome_download/core.py
index <HASH>..<HASH> 100644
--- a/ncbi_genome_download/core.py
+++ b/ncbi_genome_download/core.py
@@ -12,7 +12,7 @@ from ncbi_genome_download.summary import SummaryReader
import requests
# Python < 2.7.9 hack: fix ssl support
-if sys.version_info < (2, 7, 9):
+if sys.version_info < (2, 7, 9): # pragma: no cover
from requests.packages.urllib3.contrib import pyopenssl
pyopenssl.inject_into_urllib3() | core: Don't check coverage for legacy python SSL hack | kblin_ncbi-genome-download | train | py |
869da3e265ad7660d3c9e28ebdfe560abdd97741 | diff --git a/Vpc/Paragraphs/Controller.php b/Vpc/Paragraphs/Controller.php
index <HASH>..<HASH> 100644
--- a/Vpc/Paragraphs/Controller.php
+++ b/Vpc/Paragraphs/Controller.php
@@ -46,7 +46,8 @@ class Vpc_Paragraphs_Controller extends Vps_Controller_Action_Auto_Vpc_Grid
if ($admin) $admin->setup();
$row = $this->_model->createRow();
$this->_preforeAddParagraph($row);
- $classes = Vpc_Abstract::getChildComponentClasses($this->class, 'paragraphs');
+ $generators = Vpc_Abstract::getSetting($this->class, 'generators');
+ $classes =$generators['paragraphs']['component'];
$row->component = array_search($class, $classes);
$row->visible = 0;
$row->save(); | Bug in Paragraphs-Controller | koala-framework_koala-framework | train | php |
1f5f5c66c01304c4c4619d9a432e33c035b0718b | diff --git a/Lib/ufo2ft/outlineCompiler.py b/Lib/ufo2ft/outlineCompiler.py
index <HASH>..<HASH> 100644
--- a/Lib/ufo2ft/outlineCompiler.py
+++ b/Lib/ufo2ft/outlineCompiler.py
@@ -721,8 +721,8 @@ class BaseOutlineCompiler(object):
tops.append(top)
bottoms.append(bottom)
vhea.advanceHeightMax = max(heights)
- vhea.minTopSideBearing = max(tops)
- vhea.minBottomSideBearing = max(bottoms)
+ vhea.minTopSideBearing = min(tops) if tops else 0
+ vhea.minBottomSideBearing = min(bottoms) if bottoms else 0
vhea.yMaxExtent = vhea.minTopSideBearing - (head.yMax - head.yMin)
# misc
vhea.caretSlopeRise = getAttrWithFallback(font.info, "openTypeVheaCaretSlopeRise") | outlineCompile: support no-contour-glyph fonts
vhea minTopSideBearing, minBottomSideBearing are only caclulated with contour glyphs, set to zero when there are no contour glyphs
(same as b5e<I> but for vhea) | googlefonts_ufo2ft | train | py |
b3e438c1fc1d4f6676093a3a9c382835b2010558 | diff --git a/lib/rvc/option_parser.rb b/lib/rvc/option_parser.rb
index <HASH>..<HASH> 100644
--- a/lib/rvc/option_parser.rb
+++ b/lib/rvc/option_parser.rb
@@ -76,7 +76,8 @@ class OptionParser < Trollop::Parser
@args << [name,spec]
description = "Path to a" if description == nil and spec[:lookup]
description = "Child of a" if description == nil and spec[:lookup_parent]
- text " #{name}: " + [description, spec[:lookup], spec[:lookup_parent]].compact.join(' ')
+ lookups = [spec[:lookup], spec[:lookup_parent]].flatten.compact
+ text " #{name}: " + [description, lookups*' or '].compact.join(' ')
end
def parse argv | handle multiple lookup classes in option parser help | vmware_rvc | train | rb |
469fb454161bfa950504f0c4d879b7d610dbb97c | diff --git a/mutagen/easyid3.py b/mutagen/easyid3.py
index <HASH>..<HASH> 100644
--- a/mutagen/easyid3.py
+++ b/mutagen/easyid3.py
@@ -477,7 +477,6 @@ EasyID3.RegisterKey(
EasyID3.RegisterKey("musicbrainz_trackid", musicbrainz_trackid_get,
musicbrainz_trackid_set, musicbrainz_trackid_delete)
EasyID3.RegisterKey("website", website_get, website_set, website_delete)
-EasyID3.RegisterKey("website", website_get, website_set, website_delete)
EasyID3.RegisterKey(
"replaygain_*_gain", gain_get, gain_set, gain_delete, peakgain_list)
EasyID3.RegisterKey("replaygain_*_peak", peak_get, peak_set, peak_delete) | easyid3.py: Removed duplicate website key registration. | quodlibet_mutagen | train | py |
8adc5b535a134e1d4e422d79910d7e031052f0b1 | diff --git a/lib/puppet/resource_api/data_type_handling.rb b/lib/puppet/resource_api/data_type_handling.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/resource_api/data_type_handling.rb
+++ b/lib/puppet/resource_api/data_type_handling.rb
@@ -1,4 +1,4 @@
-module Puppet; module ResourceApi; end; end # predeclare the main module # rubocop:disable Style/Documentation
+module Puppet; module ResourceApi; end; end # predeclare the main module # rubocop:disable Style/Documentation,Style/ClassAndModuleChildren
# This module is used to handle data inside types, contains methods for munging
# and validation of the type values. | (maint) teach rubocop the way of the workaround | puppetlabs_puppet-resource_api | train | rb |
1bf36088ce440e43a6e311df783e32dd9522daf3 | diff --git a/src/ScrollView.js b/src/ScrollView.js
index <HASH>..<HASH> 100644
--- a/src/ScrollView.js
+++ b/src/ScrollView.js
@@ -762,7 +762,7 @@ define(function(require, exports, module) {
if ((this._scroll.boundsReached === Bounds.BOTH) ||
(!this._scroll.scrollToDirection && (this._scroll.boundsReached === Bounds.PREV)) ||
(this._scroll.scrollToDirection && (this._scroll.boundsReached === Bounds.NEXT))) {
- //this._scroll.scrollToSequence = undefined;
+ this._scroll.scrollToSequence = undefined;
return;
} | Disable goToPage target when bounds reached | IjzerenHein_famous-flex | train | js |
5d49c8337f32646aab7e33324d1329b1d3cf74f2 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,7 @@ with codecs.open(os.path.join(here, 'CHANGELOG.rst'), encoding='utf-8') as f:
history = f.read()
requirements = [
- 'kinto>=1.11.0',
+ 'kinto>=3.3.0',
'amo2kinto',
] | Upgrade to Kinto <I> | mozilla-services_kinto-amo | train | py |
823f9a82fa63deb486d84eaf5264d22e2c46824d | diff --git a/src/util/action-stack.js b/src/util/action-stack.js
index <HASH>..<HASH> 100644
--- a/src/util/action-stack.js
+++ b/src/util/action-stack.js
@@ -57,7 +57,7 @@ ActionStack.prototype = {
var undo = this.completed.shift();
var revert = undo.reverter.run;
var revert_params = undo.reverter.params;
- if (platform == 'ios' || platform == 'wp7') revert_params.push(project_files);
+ if (platform == 'ios' || platform == 'wp7' || platform == 'wp8') revert_params.push(project_files);
try {
revert.apply(null, revert_params);
} catch(err) {
@@ -77,8 +77,8 @@ ActionStack.prototype = {
events.emit('log', 'Writing out iOS pbxproj file...');
fs.writeFileSync(project_files.pbx, project_files.xcode.writeSync());
}
- if (platform == 'wp7') {
- events.emit('log', 'Writing out WP7 project files...');
+ if (platform == 'wp7' || platform == 'wp8') {
+ events.emit('log', 'Writing out ' + platform + ' project files...');
project_files.write();
}
if (callback) callback(); | Slight tweak for wp8 support in action-stack. | apache_cordova-plugman | train | js |
179e6a8fb6fe8d97b6d318077a9d573a2baace22 | diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100755
--- a/manifest.php
+++ b/manifest.php
@@ -38,7 +38,7 @@ return array(
'label' => 'QTI test model',
'description' => 'TAO QTI test implementation',
'license' => 'GPL-2.0',
- 'version' => '25.7.3',
+ 'version' => '25.7.4',
'author' => 'Open Assessment Technologies',
'requires' => array(
'taoQtiItem' => '>=14.2.0',
diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php
index <HASH>..<HASH> 100644
--- a/scripts/update/Updater.php
+++ b/scripts/update/Updater.php
@@ -1886,5 +1886,7 @@ class Updater extends \common_ext_ExtensionUpdater {
$this->getServiceManager()->register(TimerLabelFormatterService::SERVICE_ID, $timerLabel);
$this->setVersion('25.7.3');
}
+
+ $this->skip('25.7.3', '25.7.4');
}
} | TAO-<I> version bumped | oat-sa_extension-tao-testqti | train | php,php |
dd47733e71ad65fb37a2bab8023ec6e49aa6e297 | diff --git a/client/state/imports/site-importer/actions.js b/client/state/imports/site-importer/actions.js
index <HASH>..<HASH> 100644
--- a/client/state/imports/site-importer/actions.js
+++ b/client/state/imports/site-importer/actions.js
@@ -9,7 +9,6 @@ import { get } from 'lodash';
*/
import { toApi, fromApi } from 'calypso/state/imports/api';
import wpcom from 'calypso/lib/wp';
-import user from 'calypso/lib/user';
import {
mapAuthor,
startMappingAuthors,
@@ -29,6 +28,7 @@ import {
} from 'calypso/state/action-types';
import { getImporterStatus } from 'calypso/state/imports/selectors';
import { prefetchmShotsPreview } from 'calypso/lib/mshots';
+import { getCurrentUser } from 'calypso/state/current-user/selectors';
/**
* Redux dependencies
@@ -80,7 +80,7 @@ export const startMappingSiteImporterAuthors = ( { importerStatus, site, targetS
// WXR was uploaded, map the authors
if ( singleAuthorSite ) {
- const currentUserData = user().get();
+ const currentUserData = getCurrentUser( getState() );
const currentUser = {
...currentUserData,
name: currentUserData.display_name, | Import: Use Redux current user for mapping authors (#<I>) | Automattic_wp-calypso | train | js |
c4bb3472d165d57a42b6f31712364e4621249c40 | diff --git a/spec/user.spec.js b/spec/user.spec.js
index <HASH>..<HASH> 100644
--- a/spec/user.spec.js
+++ b/spec/user.spec.js
@@ -17,10 +17,10 @@ describe('Test user and roles', function() {
before(function() {
emf = new DB.EntityManagerFactory(env.TEST_SERVER);
- return emf.createEntityManager().ready().then(function(metamodel) {
+ return emf.createEntityManager().ready().then(function() {
var userEntity = emf.metamodel.entity("User");
if(!userEntity.getAttribute("email")) {
- userEntity.addAttribute(new DB.metamodel.SingularAttribute("email", metamodel.baseType(String)));
+ userEntity.addAttribute(new DB.metamodel.SingularAttribute("email", emf.metamodel.baseType(String)));
return saveMetamodel(emf.metamodel);
}
}); | fixed test for new emf code | Baqend_js-sdk | train | js |
af6109f89ae7007cfc1ae1c413c507ea8fe55e13 | diff --git a/update-main.go b/update-main.go
index <HASH>..<HASH> 100644
--- a/update-main.go
+++ b/update-main.go
@@ -70,8 +70,8 @@ EXAMPLES:
// update URL endpoints.
const (
- minioUpdateStableURL = "https://dl.minio.io/server/minio/release/"
- minioUpdateExperimentalURL = "https://dl.minio.io/server/minio/experimental/"
+ minioUpdateStableURL = "https://dl.minio.io/server/minio/release"
+ minioUpdateExperimentalURL = "https://dl.minio.io/server/minio/experimental"
)
// updateMessage container to hold update messages. | update: Remove extraneous '/' in update message. (#<I>) | minio_minio | train | go |
0e27e405b5a6f095e085b06a8ed1d4698f258a1f | diff --git a/test_duct.py b/test_duct.py
index <HASH>..<HASH> 100644
--- a/test_duct.py
+++ b/test_duct.py
@@ -36,9 +36,14 @@ def false():
def head_bytes(c):
code = textwrap.dedent('''\
- import sys
- input_str = sys.stdin.read({0})
- sys.stdout.write(input_str)
+ import os
+ # PyPy3 on Travis has a wonky bug where stdin and stdout can't read
+ # unicode. This is a workaround. The bug doesn't repro on Arch, though,
+ # so presumably it'll be fixed when they upgrade eventually.
+ stdin = os.fdopen(0, 'r')
+ stdout = os.fdopen(1, 'w')
+ input_str = stdin.read({0})
+ stdout.write(input_str)
'''.format(c))
return cmd('python', '-c', code) | unicode workaround for pypy3 | oconnor663_duct.py | train | py |
2b36f615962a504e583a4ad496253a527e791347 | diff --git a/src/Composer/Compiler.php b/src/Composer/Compiler.php
index <HASH>..<HASH> 100644
--- a/src/Composer/Compiler.php
+++ b/src/Composer/Compiler.php
@@ -35,7 +35,7 @@ class Compiler
unlink($pharFile);
}
- $process = new Process('git log --pretty="%h" -n1 HEAD', __DIR__);
+ $process = new Process('git log --pretty="%H" -n1 HEAD', __DIR__);
if ($process->run() != 0) {
throw new \RuntimeException('Can\'t run git log. You must ensure to run compile from composer git repository clone and that git binary is available.');
} | Use full hash in version information of dev phars, fixes #<I> | mothership-ec_composer | train | php |
b6ebbd8bf557066e107de9beb61ead92d7526bb2 | diff --git a/bootstrap_datepicker/widgets.py b/bootstrap_datepicker/widgets.py
index <HASH>..<HASH> 100644
--- a/bootstrap_datepicker/widgets.py
+++ b/bootstrap_datepicker/widgets.py
@@ -42,16 +42,14 @@ class DatePicker(DateTimeInput):
# http://docs.python.org/2/library/datetime.html#strftime-strptime-behavior
format_map = (
- ('d', r'%d'),
('dd', r'%d'),
- ('D', r'%a'),
('DD', r'%A'),
- ('M', r'%b'),
+ ('D', r'%a'),
('MM', r'%B'),
- ('m', r'%m'),
+ ('M', r'%b'),
('mm', r'%m'),
- ('yy', r'%y'),
('yyyy', r'%Y'),
+ ('yy', r'%y'),
)
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,7 @@ setup(
'static/js/*.js',
'static/js/locales/*.js',]},
include_package_data=True,
- version='1.1',
+ version='1.1.1',
description='Bootstrap3/4 compatible datepicker for Django projects.',
long_description=long_description,
author='Paul Bucher', | Fix format issues version <I> to production | monim67_django-bootstrap-datepicker-plus | train | py,py |
f8e0545c45b21c1ae782bc42fb3a0221881e1cdb | diff --git a/delphi/AnalysisGraph.py b/delphi/AnalysisGraph.py
index <HASH>..<HASH> 100644
--- a/delphi/AnalysisGraph.py
+++ b/delphi/AnalysisGraph.py
@@ -97,6 +97,13 @@ class AnalysisGraph(nx.DiGraph):
def from_statements(cls, sts: List[Influence]):
""" Construct an AnalysisGraph object from a list of INDRA statements.
Unknown polarities are set to positive by default.
+
+ Args:
+ sts: A list of INDRA Statements
+
+ Returns:
+ An AnalysisGraph instance constructed from a list of INDRA
+ statements.
"""
_dict = {} | Expanded docstring for from_statements constructor in AnalysisGraph.py | ml4ai_delphi | train | py |
f4ff7aaf958e413b9cd28ca37888ce98c47084ab | diff --git a/test/integration/showexceptions_test.rb b/test/integration/showexceptions_test.rb
index <HASH>..<HASH> 100644
--- a/test/integration/showexceptions_test.rb
+++ b/test/integration/showexceptions_test.rb
@@ -11,10 +11,17 @@ describe Lotus::Router do
@app = Rack::MockRequest.new(builder)
end
- it 'shows exceptions page' do
+ it 'shows textual exception stack trace by default' do
response = @app.get('/')
response.status.must_equal 500
+ response.body.must_match 'Lotus::Routing::EndpointNotFound'
+ end
+
+ it 'shows exceptions page (when requesting HTML)' do
+ response = @app.get('/', 'HTTP_ACCEPT' => 'text/html')
+
+ response.status.must_equal 500
response.body.must_match '<body>'
response.body.must_match 'Lotus::Routing::EndpointNotFound'
end | Prepare tests for Rack <I> | hanami_router | train | rb |
e8c5af6a8e81ff4f8974eb83cc20bdb75cae3a56 | diff --git a/lib/haml_lint/report.rb b/lib/haml_lint/report.rb
index <HASH>..<HASH> 100644
--- a/lib/haml_lint/report.rb
+++ b/lib/haml_lint/report.rb
@@ -16,7 +16,7 @@ module HamlLint
# @param files [Array<String>] files that were linted
# @param fail_level [Symbol] the severity level to fail on
# @param reporter [HamlLint::Reporter] the reporter for the report
- def initialize(lints = [], files = [], fail_level = :warning, reporter:)
+ def initialize(lints = [], files = [], fail_level = :warning, reporter: nil)
@lints = lints.sort_by { |l| [l.filename, l.line] }
@files = files
@fail_level = Severity.new(fail_level) | Specify default value for named argument
I noticed that specs didn't run properly for Ruby <I> in Travis, e.g.
<URL> | sds_haml-lint | train | rb |
2839098102122d9f93a01a7af706734fb944a0ab | diff --git a/aws-sdk-core/lib/aws-sdk-core/json.rb b/aws-sdk-core/lib/aws-sdk-core/json.rb
index <HASH>..<HASH> 100644
--- a/aws-sdk-core/lib/aws-sdk-core/json.rb
+++ b/aws-sdk-core/lib/aws-sdk-core/json.rb
@@ -23,7 +23,7 @@ module Aws
class << self
def load(json)
- ENGINE.load(json)
+ ENGINE.load(json, *ENGINE_LOAD_OPTIONS)
rescue ENGINE_ERROR => e
raise ParseError.new(e)
end
@@ -40,19 +40,20 @@ module Aws
def oj_engine
require 'oj'
- [Oj, [{ mode: :compat }], Oj::ParseError]
+ [Oj, [{mode: :compat, symbol_keys: false}], [{ mode: :compat }], Oj::ParseError]
rescue LoadError
false
end
def json_engine
- [JSON, [], JSON::ParserError]
+ [JSON, [], [], JSON::ParserError]
end
end
# @api private
- ENGINE, ENGINE_DUMP_OPTIONS, ENGINE_ERROR = oj_engine || json_engine
+ ENGINE, ENGINE_LOAD_OPTIONS, ENGINE_DUMP_OPTIONS, ENGINE_ERROR =
+ oj_engine || json_engine
end
end | Ensure that Oj does not Symbolize JSON
Resolves GitHub Issue #<I> | aws_aws-sdk-ruby | train | rb |
8d96ebf5b3c2fdf21a8f066d11579dcd8254d308 | diff --git a/tasks/build_control.js b/tasks/build_control.js
index <HASH>..<HASH> 100644
--- a/tasks/build_control.js
+++ b/tasks/build_control.js
@@ -278,7 +278,7 @@ module.exports = function (grunt) {
remoteName = options.remote;
// Regex to test for remote url
- var remoteUrlRegex = new RegExp('.+[\\/:].+');
+ var remoteUrlRegex = new RegExp('(\.\.\/|.+[\\/:].+)');
if(remoteUrlRegex.test(remoteName)) {
initRemote();
} | (build) fixed missing support for
issue was introducted in #<I> | robwierzbowski_grunt-build-control | train | js |
b9d022a7878345518432a0351f10c0f7087e2bf3 | diff --git a/lib/graphql/rails/api/version.rb b/lib/graphql/rails/api/version.rb
index <HASH>..<HASH> 100644
--- a/lib/graphql/rails/api/version.rb
+++ b/lib/graphql/rails/api/version.rb
@@ -1,7 +1,7 @@
module Graphql
module Rails
module Api
- VERSION = '0.5.0'.freeze
+ VERSION = '0.6.0'.freeze
end
end
end | version added realtime, bulk and stuff | Poilon_graphql-rails-api | train | rb |
62e85175c86e3302984476cd51b12bfddf5e4512 | diff --git a/protostuff-parser/src/main/java/com/dyuproject/protostuff/parser/Message.java b/protostuff-parser/src/main/java/com/dyuproject/protostuff/parser/Message.java
index <HASH>..<HASH> 100644
--- a/protostuff-parser/src/main/java/com/dyuproject/protostuff/parser/Message.java
+++ b/protostuff-parser/src/main/java/com/dyuproject/protostuff/parser/Message.java
@@ -238,6 +238,14 @@ public class Message implements HasName
String packageName = fr.packageName;
if(packageName==null)
{
+ // field reference to owner (self).
+ if(name.equals(refName))
+ {
+ MessageField mf = newMessageField(this, fr, this);
+ fields.put(mf.name, mf);
+ continue;
+ }
+
Message msg = findMessageFrom(fr.message, refName);
if(msg!=null || (msg=p.getMessage(refName))!=null)
{ | handle field reference to owner (self).
git-svn-id: <URL> | protostuff_protostuff | train | java |
00a406478590d852b32ec6dc2f893cf9e70dd933 | diff --git a/django_renderpdf/helpers.py b/django_renderpdf/helpers.py
index <HASH>..<HASH> 100644
--- a/django_renderpdf/helpers.py
+++ b/django_renderpdf/helpers.py
@@ -23,7 +23,7 @@ def staticfiles_url_fetcher(url: str):
resources data as a string and ``mime_type``, which is the identified
mime type for the resource.
"""
- if url.startswith("/") or url.startswith(staticfiles_storage.base_url):
+ if url.startswith(staticfiles_storage.base_url):
filename = url.replace(staticfiles_storage.base_url, "", 1)
path = finders.find(filename) | Stop assuming all local URLs are static files | WhyNotHugo_django-renderpdf | train | py |
da631a3ab7aa1bb1c232bf7841bd07a4a9a465cd | diff --git a/salt/version.py b/salt/version.py
index <HASH>..<HASH> 100644
--- a/salt/version.py
+++ b/salt/version.py
@@ -650,7 +650,8 @@ def versions_report(include_salt_cloud=False):
info = []
for ver_type in ('Salt Version', 'Dependency Versions', 'System Versions'):
info.append('{0}:'.format(ver_type))
- for name in sorted(ver_info[ver_type]):
+ # List dependencies in alphabetical, case insensitive order
+ for name in sorted(ver_info[ver_type], cmp=lambda x, y: cmp(x.lower(), y.lower())):
ver = fmt.format(name,
ver_info[ver_type][name] or 'Not Installed',
pad=padding) | salt.version: case insensitive ordering of deps (#<I>) | saltstack_salt | train | py |
905502e3119351fcaae8d78b8417f95bfa3086df | diff --git a/cmd/admin-subnet-health.go b/cmd/admin-subnet-health.go
index <HASH>..<HASH> 100644
--- a/cmd/admin-subnet-health.go
+++ b/cmd/admin-subnet-health.go
@@ -593,7 +593,7 @@ type HealthDataTypeFlag struct {
// String - returns the string to be shown in the help message
func (f HealthDataTypeFlag) String() string {
- return fmt.Sprintf("--%s %s", f.Name, f.Usage)
+ return cli.FlagStringer(f)
}
// GetName - returns the name of the flag | Fix `subnet health` crash on passing invalid flag (#<I>)
The custom `String()` function written for the `HealthDataTypeFlag` was
resulting in a crash as it did not contain `\t` character on which the
usage gets split when printing the error message.
Fixed by reusing the `FlagStringer` from cli package, which is used by StringFlag.String() as well. | minio_mc | train | go |
d1c5b6fe9e18b532ad69ed4bd82e1874a6dff4df | diff --git a/src/sharding/ShardClientUtil.js b/src/sharding/ShardClientUtil.js
index <HASH>..<HASH> 100644
--- a/src/sharding/ShardClientUtil.js
+++ b/src/sharding/ShardClientUtil.js
@@ -200,13 +200,14 @@ class ShardClientUtil {
*/
_respond(type, message) {
this.send(message).catch(err => {
- err.message = `Error when sending ${type} response to master process: ${err.message}`;
+ const error = new Error(`Error when sending ${type} response to master process: ${err.message}`);
+ error.stack = err.stack;
/**
* Emitted when the client encounters an error.
* @event Client#error
* @param {Error} error The error encountered
*/
- this.client.emit(Events.ERROR, err);
+ this.client.emit(Events.ERROR, error);
});
} | fix(ShardingManager): client error event cannot be emitted (#<I>) | discordjs_discord.js | train | js |
362e72920d80c9c2e7aad36d1b3b9e323eaaf124 | diff --git a/src/DataSet.php b/src/DataSet.php
index <HASH>..<HASH> 100644
--- a/src/DataSet.php
+++ b/src/DataSet.php
@@ -323,6 +323,33 @@ class DataSet implements DumpableInterface, \ArrayAccess, \Countable, \Iterator
return array_keys($this->objects);
}
+ /**
+ * Applies a function to every object in the set (emulates array_walk).
+ *
+ * @param callable Callback function.
+ *
+ * @return boolean Returns TRUE on success or FALSE on failure.
+ *
+ * @since 1.0
+ */
+ public function walk(callable $funcname)
+ {
+ if (!is_callable($funcname))
+ {
+ $message = 'Joomla\\Data\\DataSet::walk() expects parameter 1 to be a valid callback';
+ if (is_string($funcname))
+ {
+ $message .= sprintf(', function \'%s\' not found or invalid function name', $funcname);
+ }
+ throw new \Exception($message);
+ }
+ foreach ($this->objects as $key => $object)
+ {
+ $funcname($object, $key);
+ }
+ return true;
+ }
+
/**
* Advances the iterator to the next object in the iterator.
* | DataSet::walk() method added | joomla-framework_data | train | php |
1d03841a67d5b256fa16de2a8440deaa7fd03c8a | diff --git a/lib/reqres_rspec/collector.rb b/lib/reqres_rspec/collector.rb
index <HASH>..<HASH> 100644
--- a/lib/reqres_rspec/collector.rb
+++ b/lib/reqres_rspec/collector.rb
@@ -3,11 +3,13 @@ module ReqresRspec
# Contains spec values read from rspec example, request and response
attr_accessor :records
- # param importances
+ # Param importances
PARAM_IMPORTANCES = %w[required optional]
- # param types
- PARAM_TYPES = %w[Integer Boolean String Text Float Date DateTime File Array]
+ # Param types
+ # NOTE: make sure sub-strings go at the end
+ PARAM_TYPES = ['Boolean', 'String', 'Text', 'Float', 'DateTime', 'Date', 'File',
+ 'Array of Integer', 'Array of String', 'Array', 'Integer']
# response headers contain many unnecessary information,
# everything from this list will be stripped
@@ -126,7 +128,7 @@ module ReqresRspec
# replace each first occurrence of param's value in the request path
#
- # example
+ # Example:
# request path = /api/users/123
# id = 123
# symbolized path => /api/users/:id | better parsing of param types | reqres-api_reqres_rspec | train | rb |
d21ac9a70bce0535a2f3cc3a621452ad9d0681d6 | diff --git a/src/saml2/response.py b/src/saml2/response.py
index <HASH>..<HASH> 100644
--- a/src/saml2/response.py
+++ b/src/saml2/response.py
@@ -850,9 +850,13 @@ class AuthnResponse(StatusResponse):
"""
try:
- self._verify()
- except AssertionError:
+ res = self._verify()
+ except AssertionError as err:
+ logger.error("Verification error on the response: %s" % err)
raise
+ else:
+ if res is None:
+ return None
if not isinstance(self.response, samlp.Response):
return self | Fixed one security bug pointed out by Ehsan Foroughi. | IdentityPython_pysaml2 | train | py |
ea4bf0a1d3cbf6387e028a200dc0cb317f5defcf | diff --git a/roaring/roaring_test.go b/roaring/roaring_test.go
index <HASH>..<HASH> 100644
--- a/roaring/roaring_test.go
+++ b/roaring/roaring_test.go
@@ -211,7 +211,10 @@ func testBitmapQuick(t *testing.T, n int, min, max uint64) {
}
// Verify slices are equal.
- if got, exp := bm.Slice(), uint64SetSlice(m); !reflect.DeepEqual(got, exp) {
+ // If `got` is nil and `exp` has zero length, don't perform the DeepEqual
+ // because when `a` is empty (`a = []uint64{}`) then `got` is a nil slice
+ // while `exp` is an empty slice. Therefore they will not be considered equal.
+ if got, exp := bm.Slice(), uint64SetSlice(m); !(got == nil && len(exp) == 0) && !reflect.DeepEqual(got, exp) {
t.Fatalf("unexpected values:\n\ngot=%+v\n\nexp=%+v\n\n", got, exp)
} | Fix roaring test: TestBitmap_Quick_Array1
When the random number generator was coming up 0,
then `a = []uint<I>{}`. This caused the bitmap `bm` to be empty.
In this case, `bm.Slice()` is a nil slice, while the expected
slice is an empty slice (i.e. they are not considered equal):
got: ([]uint<I>) <nil>
exp: ([]uint<I>) {} | pilosa_pilosa | train | go |
6e5319bf84bb67a022d150d68eb3d36d7eb97e43 | diff --git a/closure/goog/style/transition.js b/closure/goog/style/transition.js
index <HASH>..<HASH> 100644
--- a/closure/goog/style/transition.js
+++ b/closure/goog/style/transition.js
@@ -62,10 +62,14 @@ goog.style.transition.set = function(element, properties) {
if (goog.isString(p)) {
return p;
} else {
- goog.asserts.assert(p && p.property && goog.isNumber(p.duration) &&
- p.timing && goog.isNumber(p.delay));
- return p.property + ' ' + p.duration + 's ' + p.timing + ' ' +
- p.delay + 's';
+ goog.asserts.assertObject(p,
+ 'Expected css3 property to be an object.');
+ var propString = p.property + ' ' + p.duration + 's ' + p.timing +
+ ' ' + p.delay + 's';
+ goog.asserts.assert(p.property && goog.isNumber(p.duration) &&
+ p.timing && goog.isNumber(p.delay),
+ 'Unexpected css3 property value: %s', propString);
+ return propString;
}
});
goog.style.transition.setPropertyValue_(element, values.join(',')); | Added an assert debug statement.
R=nicksantos
DELTA=8 (4 added, 0 deleted, 4 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=<I>
git-svn-id: <URL> | google_closure-library | train | js |
4f94ce64ce4fe542b1e54b496f40035dfe894cf7 | diff --git a/host/state.go b/host/state.go
index <HASH>..<HASH> 100644
--- a/host/state.go
+++ b/host/state.go
@@ -78,7 +78,7 @@ func (s *State) Restore(backend Backend, buffers host.LogBuffers) (func(), error
return err
}
if job.CreatedAt.IsZero() {
- job.CreatedAt = time.Now()
+ job.CreatedAt = time.Now().UTC()
}
s.jobs[string(k)] = job
@@ -298,7 +298,7 @@ func (s *State) AddJob(j *host.Job) error {
job := &host.ActiveJob{
Job: j,
HostID: s.id,
- CreatedAt: time.Now(),
+ CreatedAt: time.Now().UTC(),
}
s.jobs[j.ID] = job
s.sendEvent(job, host.JobEventCreate) | host: Use UTC time for CreatedAt in host state | flynn_flynn | train | go |
71588a96dfdc2ad690feae60815e9a5537f56f1a | diff --git a/salt/modules/zk_concurrency.py b/salt/modules/zk_concurrency.py
index <HASH>..<HASH> 100644
--- a/salt/modules/zk_concurrency.py
+++ b/salt/modules/zk_concurrency.py
@@ -22,6 +22,7 @@ try:
import kazoo.recipe.party
from kazoo.exceptions import CancelledError
from kazoo.exceptions import NoNodeError
+ from socket import gethostname
# TODO: use the kazoo one, waiting for pull req:
# https://github.com/python-zk/kazoo/pull/206
@@ -33,6 +34,7 @@ try:
max_leases=1,
ephemeral_lease=True,
):
+ identifier = (identifier or gethostname())
kazoo.recipe.lock.Semaphore.__init__(self,
client,
path,
@@ -134,7 +136,7 @@ def lock_holders(path,
zookeeper connect string
identifier
- Name to identify this minion
+ Name to identify this minion, if unspecified defaults to hostname
max_concurrency
Maximum number of lock holders
@@ -180,7 +182,7 @@ def lock(path,
zookeeper connect string
identifier
- Name to identify this minion
+ Name to identify this minion, if unspecified defaults to the hostname
max_concurrency
Maximum number of lock holders
@@ -239,7 +241,7 @@ def unlock(path,
zookeeper connect string
identifier
- Name to identify this minion
+ Name to identify this minion, if unspecified defaults to hostname
max_concurrency
Maximum number of lock holders | Enable hostname as default identifier for zk_concurrency to avoid unlock bug | saltstack_salt | train | py |
9bef9e066f4f78b8f204846bc77f0182a8c4ec51 | diff --git a/tools/gen.py b/tools/gen.py
index <HASH>..<HASH> 100644
--- a/tools/gen.py
+++ b/tools/gen.py
@@ -162,9 +162,6 @@ deleted_actions = {
'mobilehub': [
'ValidateProject',
],
- 'mobilehub': [
- 'ValidateProject',
- ],
'mobiletargeting': [
'DeleteAdmChannel', 'DeleteAdmChannel', 'DeleteApnsSandboxChannel',
'GetAdmChannel', 'GetApnsSandboxChannel', 'UpdateAdmChannel', | Remove redundent mobilehub from deleted actions | cloudtools_awacs | train | py |
23d972677c6ff43b77d5c30352dd9959b517a93c | diff --git a/src/core/reducer.js b/src/core/reducer.js
index <HASH>..<HASH> 100644
--- a/src/core/reducer.js
+++ b/src/core/reducer.js
@@ -77,7 +77,8 @@ export function createGameReducer({game, numPlayers}) {
state = { ...state, G, log, _id: state._id + 1 };
// Allow the flow reducer to process any triggers that happen after moves.
- return game.flow.processMove(state, action);
+ const t = game.flow.processMove({ G: state.G, ctx: state.ctx }, action);
+ return { ...state, G: t.G, ctx: t.ctx };
}
case Actions.RESTORE: { | fix bug that was causing log to be erased after flow.processMove | nicolodavis_boardgame.io | train | js |
c2a33f486f941f9f451a015eb1c1701d978d7ee8 | diff --git a/src/test/java/io/vlingo/actors/ActorStopTest.java b/src/test/java/io/vlingo/actors/ActorStopTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/io/vlingo/actors/ActorStopTest.java
+++ b/src/test/java/io/vlingo/actors/ActorStopTest.java
@@ -59,12 +59,8 @@ public class ActorStopTest extends ActorsTest {
@Test
public void testWorldTerminateToStopAllActors() throws Exception {
- System.out.println("Test: testWorldTerminateToStopAllActors");
-
final TestResults testSpecs = new TestResults();
- System.out.println("Test: testWorldTerminateToStopAllActors: starting actors");
-
testSpecs.untilStart = TestUntil.happenings(12);
final ChildCreatingStoppable[] stoppables = setUpActors(world, testSpecs);
@@ -75,12 +71,8 @@ public class ActorStopTest extends ActorsTest {
testSpecs.untilStart.completes();
- System.out.println("Test: testWorldTerminateToStopAllActors: stopping actors");
-
testSpecs.untilTerminatingStop = TestUntil.happenings(12);
- System.out.println("Test: testWorldTerminateToStopAllActors: terminating world");
-
testSpecs.terminating.set(true);
world.terminate(); | Removed test debugging output. | vlingo_vlingo-actors | train | java |
fe5e5d0c6c9e0629469df039d0a1b65c505a2f7d | diff --git a/sonar-core/src/test/java/org/sonar/core/persistence/SemaphoreDaoTest.java b/sonar-core/src/test/java/org/sonar/core/persistence/SemaphoreDaoTest.java
index <HASH>..<HASH> 100644
--- a/sonar-core/src/test/java/org/sonar/core/persistence/SemaphoreDaoTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/persistence/SemaphoreDaoTest.java
@@ -190,7 +190,7 @@ public class SemaphoreDaoTest extends AbstractDaoTestCase {
public void should_select_semaphore_return_current_semaphore_when_acquiring() throws Exception {
dao.acquire("foo");
- SemaphoreDto semaphore = dao.selectSemaphore("foo", getMyBatis().openSession());
+ SemaphoreDto semaphore = selectSemaphore("foo");
assertThat(semaphore).isNotNull();
assertThat(semaphore.getName()).isEqualTo("foo");
assertThat(semaphore.getCreatedAt()).isNotNull(); | SONAR-<I> Improve unit test to fix issue on it-sonar-persistence tests | SonarSource_sonarqube | train | java |
87dfbedb4b419bcf566ae9ab3912e51908273b90 | diff --git a/core/src/main/java/jenkins/model/Jenkins.java b/core/src/main/java/jenkins/model/Jenkins.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/jenkins/model/Jenkins.java
+++ b/core/src/main/java/jenkins/model/Jenkins.java
@@ -2174,7 +2174,14 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
* @since 2.64
*/
public List<AdministrativeMonitor> getActiveAdministrativeMonitors() {
- return administrativeMonitors.stream().filter(m -> m.isEnabled() && m.isActivated()).collect(Collectors.toList());
+ return administrativeMonitors.stream().filter(m -> {
+ try {
+ return m.isEnabled() && m.isActivated();
+ } catch (Throwable x) {
+ LOGGER.log(Level.WARNING, null, x);
+ return false;
+ }
+ }).collect(Collectors.toList());
}
public NodeDescriptor getDescriptor() { | Behave robustly in the face of errors from AdministrativeMonitor.isActivated. | jenkinsci_jenkins | train | java |
60ee710dac2f05427a4c232cb022951c3367ca8c | diff --git a/devices.js b/devices.js
index <HASH>..<HASH> 100755
--- a/devices.js
+++ b/devices.js
@@ -143,12 +143,12 @@ const configureReporting = {
}];
await endpoint.configureReporting('msPressureMeasurement', payload);
},
- illuminance: async (endpoint) => {
+ illuminance: async (endpoint, min=0, max=repInterval.HOUR, change=0) => {
const payload = [{
attribute: 'measuredValue',
- minimumReportInterval: 0,
- maximumReportInterval: repInterval.HOUR,
- reportableChange: 0,
+ minimumReportInterval: min,
+ maximumReportInterval: max,
+ reportableChange: change,
}];
await endpoint.configureReporting('msIlluminanceMeasurement', payload);
},
@@ -1163,11 +1163,12 @@ const devices = [
supports: 'illuminance',
fromZigbee: [fz.battery_3V, fz.illuminance],
toZigbee: [],
- meta: {configureKey: 1},
+ meta: {configureKey: 2},
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await bind(endpoint, coordinatorEndpoint, ['genPowerCfg', 'msIlluminanceMeasurement']);
await configureReporting.batteryVoltage(endpoint);
+ await configureReporting.illuminance(endpoint, 15, repInterval.HOUR, 500);
},
}, | Restrict Mijia light sensor updates to <I> seconds (#<I>)
* Restrict Mijia light sensor updates to <I> seconds
* Make linter happy again
* Use function parameters instead of object for overrides
* Bump configure key to avoid re-pairing
* React faster to changes in light conditions | Koenkk_zigbee-shepherd-converters | train | js |
b4f1b0ad173295dfdc29add9ff77680aef4c89cf | diff --git a/salt/modules/rbenv.py b/salt/modules/rbenv.py
index <HASH>..<HASH> 100644
--- a/salt/modules/rbenv.py
+++ b/salt/modules/rbenv.py
@@ -18,17 +18,17 @@ def _rbenv_exec(command, args='', env=None, runas=None, ret=None):
if not is_installed(runas):
return False
- bin = _rbenv_bin(runas)
+ binary = _rbenv_bin(runas)
path = _rbenv_path(runas)
if env:
env = ' {0}'.format(env)
env = env or ''
- bin = 'env RBENV_ROOT={0}{1} {2}'.format(path, env, bin)
+ binary = 'env RBENV_ROOT={0}{1} {2}'.format(path, env, binary)
result = __salt__['cmd.run_all'](
- '{0} {1} {2}'.format(bin, command, args),
+ '{0} {1} {2}'.format(binary, command, args),
runas=runas
) | avoid shadowing built-in bin() func | saltstack_salt | train | py |
36dd7a748a7a11e4f69626e9656e453a3eb90417 | diff --git a/moto/ec2/models/key_pairs.py b/moto/ec2/models/key_pairs.py
index <HASH>..<HASH> 100644
--- a/moto/ec2/models/key_pairs.py
+++ b/moto/ec2/models/key_pairs.py
@@ -1,3 +1,4 @@
+from moto.core import BaseModel
from ..exceptions import (
FilterNotImplementedError,
InvalidKeyPairNameError,
@@ -12,7 +13,7 @@ from ..utils import (
)
-class KeyPair(object):
+class KeyPair(BaseModel):
def __init__(self, name, fingerprint, material):
self.name = name
self.fingerprint = fingerprint | [dashboard] Fix KeyPair tracking (#<I>) | spulec_moto | train | py |
e134ff41dab7ca2190204f52b132d3234d52e034 | diff --git a/src/av.js b/src/av.js
index <HASH>..<HASH> 100644
--- a/src/av.js
+++ b/src/av.js
@@ -266,7 +266,7 @@ AV._encode = function(value, seenObjects, disallowObjects) {
* @private
*/
AV._decode = function(value, key) {
- if (!_.isObject(value)) {
+ if (!_.isObject(value) || _.isDate(value)) {
return value;
}
if (_.isArray(value)) {
diff --git a/test/av.js b/test/av.js
index <HASH>..<HASH> 100644
--- a/test/av.js
+++ b/test/av.js
@@ -25,5 +25,13 @@ describe('AV utils', () => {
array[0].should.be.a.String();
array[0].should.be.exactly(value);
});
+
+ it('should bypass with non-plain object', () => {
+ const now = new Date();
+ AV._decode(now).should.be.exactly(now);
+ AV._decode(3.14).should.be.exactly(3.14);
+ AV._decode(false).should.be.exactly(false);
+ AV._decode('false').should.be.exactly('false');
+ });
});
}); | fix: bypass Date for AV._decode (#<I>) | leancloud_javascript-sdk | train | js,js |
08e65a0819233139efdd8add564e9272508e1da3 | diff --git a/src/txamqp/protocol.py b/src/txamqp/protocol.py
index <HASH>..<HASH> 100644
--- a/src/txamqp/protocol.py
+++ b/src/txamqp/protocol.py
@@ -218,6 +218,7 @@ class AMQClient(FrameReceiver):
self.work = defer.DeferredQueue()
self.started = TwistedEvent()
+ self.connectionLostEvent = TwistedEvent()
self.queueLock = defer.DeferredLock()
@@ -288,6 +289,9 @@ class AMQClient(FrameReceiver):
self.sendInitString()
self.setFrameMode()
+ def connectionLost(self, reason):
+ self.connectionLostEvent.set()
+
def frameReceived(self, frame):
self.processFrame(frame) | Adding an event to notify of lost connections. | txamqp_txamqp | train | py |
ed4fe6bd78843c6448ebd9241d9738fa7f173adc | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -40,6 +40,7 @@ setup(
description=("A dynamic nested sampling package for computing Bayesian "
"posteriors and evidences."),
long_description=long_description,
+ long_description_content_type="text/markdown",
package_data={"": ["README.md", "LICENSE", "AUTHORS.md"]},
include_package_data=True,
install_requires=["numpy", "scipy", "matplotlib", "six"], | setup.py: allow description markdown to be rendered on PyPI | joshspeagle_dynesty | train | py |
14468a0c664e3e94bb9fb1ddd3903e8cda768b68 | diff --git a/aioftp/client.py b/aioftp/client.py
index <HASH>..<HASH> 100644
--- a/aioftp/client.py
+++ b/aioftp/client.py
@@ -508,7 +508,16 @@ class Client(BaseClient):
:param recursive: list recursively
:type recursive: :py:class:`bool`
- :rtype: :py:class:`list` or :py:class:`None`
+ :rtype: :py:class:`list` or `async for` context
+
+ ::
+
+ >>> async for path, info in client.list():
+ ... print(path)
+
+ ::
+
+ >>> stats = await client.list()
"""
class AsyncClientLister(AsyncListerMixin): | client: add doc example for list method | aio-libs_aioftp | train | py |
03d3824d965f38d3c595330d697fb16dc9efdb9a | diff --git a/activesupport/lib/active_support/notifications.rb b/activesupport/lib/active_support/notifications.rb
index <HASH>..<HASH> 100644
--- a/activesupport/lib/active_support/notifications.rb
+++ b/activesupport/lib/active_support/notifications.rb
@@ -45,7 +45,7 @@ module ActiveSupport
mattr_accessor :queue
class << self
- delegate :instrument, :to => :instrumenter
+ delegate :instrument, :transaction_id, :generate_id, :to => :instrumenter
def instrumenter
Thread.current[:notifications_instrumeter] ||= Instrumenter.new(publisher)
@@ -63,7 +63,18 @@ module ActiveSupport
class Instrumenter
def initialize(publisher)
@publisher = publisher
- @id = SecureRandom.hex(10)
+ @id = random_id
+ end
+
+ def transaction
+ @id, old_id = random_id, @id
+ yield
+ ensure
+ @id = old_id
+ end
+
+ def transaction_id
+ @id
end
def instrument(name, payload={})
@@ -72,6 +83,11 @@ module ActiveSupport
ensure
@publisher.publish(name, time, Time.now, result, @id, payload)
end
+
+ private
+ def random_id
+ SecureRandom.hex(10)
+ end
end
class Publisher | Make it possible to have IDs per request | rails_rails | train | rb |
4350a10b80e52f18900d39398e2063c387ce5872 | diff --git a/porespy/filters/__funcs__.py b/porespy/filters/__funcs__.py
index <HASH>..<HASH> 100644
--- a/porespy/filters/__funcs__.py
+++ b/porespy/filters/__funcs__.py
@@ -1586,9 +1586,10 @@ def chunked_func(func, divs=2, cores=None, im_arg=['input', 'image', 'im'],
res.append(apply_func(func=func, **kwargs))
# Now has dask actually compute the function on each subsection in parallel
print('Applying function to', str(len(slices)), 'subsections')
- ims = dask.compute(res, num_workers=cores)[0]
+ with ProgressBar():
+ ims = dask.compute(res, num_workers=cores)[0]
# Finally, put the pieces back together into a single master image, im2
- im2 = sp.zeros_like(im, dtype=bool)
+ im2 = sp.zeros_like(im, dtype=im.dtype)
for i, s in enumerate(slices):
# Prepare new slice objects into main and sub-sliced image
a = [] # Slices into main image | Readded progress bar, and fixed problem with datatype | PMEAL_porespy | train | py |
ee082da20a607ca8f2bca614bba994361f47fce9 | diff --git a/lib/email_address.rb b/lib/email_address.rb
index <HASH>..<HASH> 100644
--- a/lib/email_address.rb
+++ b/lib/email_address.rb
@@ -17,7 +17,7 @@ module EmailAddress
%i(valid? error normal redact munge canonical reference).each do |proxy_method|
define_method(proxy_method) do |*args, &block|
EmailAddress::Address.new(*args).send(proxy_method, &block)
- end
+ end if EmailAddress::Address.method_defined? proxy_method
end
end | Defensive programming (don't trust proxy methods list validity) | afair_email_address | train | rb |
2407b1559c2c69535c44799c4970f374f2a5613f | diff --git a/draft-js-mention-plugin/src/MentionSuggestionsPortal/index.js b/draft-js-mention-plugin/src/MentionSuggestionsPortal/index.js
index <HASH>..<HASH> 100644
--- a/draft-js-mention-plugin/src/MentionSuggestionsPortal/index.js
+++ b/draft-js-mention-plugin/src/MentionSuggestionsPortal/index.js
@@ -2,7 +2,7 @@ import React, { Component } from 'react';
export default class MentionSuggestionsPortal extends Component {
- componentWillMount() {
+ componentDidMount() {
this.props.store.register(this.props.offsetKey);
this.updatePortalClientRect(this.props); | Fixes race condition with Japanese input
When inputting Japanese characters (or any complex alphabet which requires hitting enter to commit the characters), that action was causing a race condition. By changing componentWillMount to componentDidMount, this issue is resolved and the component will unmount unregister and then properly mount and register after. Prior to this change, componentWillMount would not fire after componentWillUnmount even though it was still in the DOM, so it wasn't re-registering the offsetkey. | draft-js-plugins_draft-js-plugins | train | js |
09f6b5743bca12f4283fac11cec9b29118779892 | diff --git a/test/ut/spec/model/Component.js b/test/ut/spec/model/Component.js
index <HASH>..<HASH> 100755
--- a/test/ut/spec/model/Component.js
+++ b/test/ut/spec/model/Component.js
@@ -46,7 +46,7 @@ describe('Component', function() {
ComponentModel.topologicalTravel(['m1', 'a2'], allList, function (componentType, dependencies) {
result.push([componentType, dependencies]);
});
- expect(result).toEqual([['a2', []], ['m1', ['a1', 'a2']]]);
+ expect(result).toEqual([['a2', ['dataset']], ['m1', ['dataset', 'a1', 'a2']]]);
});
testCase('topologicalTravel_empty', function (ComponentModel) { | refactor(UT): update update Component topologicalTravel a1IsAbsent test case | apache_incubator-echarts | train | js |
7c21cae747178ce98d3491f0ccabd88e059e13b2 | diff --git a/nion/swift/model/Region.py b/nion/swift/model/Region.py
index <HASH>..<HASH> 100644
--- a/nion/swift/model/Region.py
+++ b/nion/swift/model/Region.py
@@ -31,6 +31,7 @@ class Region(Observable.Observable, Observable.Broadcaster, Persistence.Persiste
def __init__(self, type):
super(Region, self).__init__()
self.define_type(type)
+ self.define_property("region_id", changed=self._property_changed, validate=lambda s: str(s) if s else None)
self.define_property("label", changed=self._property_changed, validate=lambda s: str(s) if s else None)
self.define_property("is_position_locked", False, changed=self._property_changed)
self.define_property("is_shape_locked", False, changed=self._property_changed) | Added region_id property to region. | nion-software_nionswift | train | py |
2be2a54a6680cdf50b0f0bb6f97b7cb38e22cea6 | diff --git a/src/AbstractResourceTest.php b/src/AbstractResourceTest.php
index <HASH>..<HASH> 100644
--- a/src/AbstractResourceTest.php
+++ b/src/AbstractResourceTest.php
@@ -71,7 +71,7 @@ abstract class AbstractResourceTest extends TestCase
$json = $jsonTemplate;
foreach ($type->$typeMethod() as $typeClass) {
$methodType = Types::get(constant($typeClass . '::SCALAR'));
- foreach ($methodType->generate(2500) as $value) {
+ foreach ($methodType->generate(250) as $value) {
$json[$property->getName()] = $value;
yield [
$property->getName(), // Name of the property to assign data to | Test <I> times, <I> is a bit much | php-api-clients_resource-test-utilities | train | php |
89a50787c66fbbd814f3f631c3acebc6008ef06a | diff --git a/flask_ldapconn/__init__.py b/flask_ldapconn/__init__.py
index <HASH>..<HASH> 100644
--- a/flask_ldapconn/__init__.py
+++ b/flask_ldapconn/__init__.py
@@ -41,6 +41,7 @@ class LDAPConn(object):
app.config.setdefault('LDAP_READ_ONLY', False)
app.config.setdefault('LDAP_VALID_NAMES', None)
app.config.setdefault('LDAP_PRIVATE_KEY_PASSWORD', None)
+ app.config.setdefault('LDAP_RAISE_EXCEPTIONS', False)
app.config.setdefault('LDAP_CONNECTION_STRATEGY', SYNC)
@@ -93,6 +94,7 @@ class LDAPConn(object):
self.ldap_server,
auto_bind=auto_bind_strategy,
client_strategy=current_app.config['LDAP_CONNECTION_STRATEGY'],
+ raise_exceptions=current_app.config['LDAP_RAISE_EXCEPTIONS'],
user=user,
password=password,
check_names=True, | Adds support for setting Connection.raise_exceptions (LDAP_RAISE_EXCEPTIONS) (#<I>) | rroemhild_flask-ldapconn | train | py |
70db37ba78d0b42c3bbd32555c318de5c7db6e2d | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -317,7 +317,7 @@ module.exports = function(grunt) {
var files = Object.keys(changedFiles);
grunt.config('eslint.amd.src', files);
grunt.config('eslint.yui.src', files);
- grunt.config('uglify.amd.files', [{ expand: true, src: files, rename: uglifyRename }]);
+ grunt.config('uglify.amd.files', [{expand: true, src: files, rename: uglifyRename}]);
grunt.config('shifter.options.paths', files);
grunt.config('stylelint.less.src', files);
changedFiles = Object.create(null); | MDL-<I> grunt: ensure gruntfile is lint free
Not related to this patch, but fixed it while I was here.. | moodle_moodle | train | js |
3fa9571ffa9ab5e70574e66b229bde733b06cea5 | diff --git a/lib/esl/connection.js b/lib/esl/connection.js
index <HASH>..<HASH> 100644
--- a/lib/esl/connection.js
+++ b/lib/esl/connection.js
@@ -681,7 +681,9 @@ Connection.prototype._onConnect = function() {
this.parser.on('esl::event', this._onEvent.bind(this));
//on parser error
- this.parser.on('error', console.log);
+ this.parser.on('error', function(err) {
+ this.emit('error', err);
+ });
//emit that we conencted
this.emit('esl::connect'); | emit and/or rethrow parser errors, don't just log to console | englercj_node-esl | train | js |
3425d326141660cd9434e271cfeb6fe9bb7dc3f4 | diff --git a/workshift/forms.py b/workshift/forms.py
index <HASH>..<HASH> 100644
--- a/workshift/forms.py
+++ b/workshift/forms.py
@@ -631,6 +631,10 @@ class SignOutForm(InteractShiftForm):
action_object=instance,
recipient=workshifter.user,
)
+ if note is None:
+ note = "Signed out by {}".format(
+ self.profile
+ )
else:
if utils.past_sign_out(instance):
liable = True | Added a note to sign out when a manager signs a member out | knagra_farnsworth | train | py |
398730d874882e5d132e92856407263e5c35bcc3 | diff --git a/neurom/features/neurite_features.py b/neurom/features/neurite_features.py
index <HASH>..<HASH> 100644
--- a/neurom/features/neurite_features.py
+++ b/neurom/features/neurite_features.py
@@ -85,6 +85,11 @@ segment_lengths = feature_getter(_seg.length)
number_of_segments = count(feature_getter(_seg.identity))
segment_taper_rates = feature_getter(_seg.taper_rate)
+segment_radii = feature_getter(_seg.radius)
+segment_x_coordinates = feature_getter(_seg.x_coordinate)
+segment_y_coordinates = feature_getter(_seg.y_coordinate)
+segment_z_coordinates = feature_getter(_seg.z_coordinate)
+
local_bifurcation_angles = feature_getter(_bifs.local_angle)
remote_bifurcation_angles = feature_getter(_bifs.remote_angle)
bifurcation_number = count(feature_getter(_bifs.identity)) | Add coordinate features in neurom features functionality | BlueBrain_NeuroM | train | py |
84b712d138f8e6449fe0452040f2053f40c9a7ce | diff --git a/serf/serf.go b/serf/serf.go
index <HASH>..<HASH> 100644
--- a/serf/serf.go
+++ b/serf/serf.go
@@ -211,11 +211,6 @@ func (s *Serf) Leave() error {
// Process the leave locally
s.handleNodeLeaveIntent(&msg)
- // If we have more than one member (more than ourself), then we need
- // to broadcast that we intend to gracefully leave.
- s.memberLock.RLock()
- defer s.memberLock.RUnlock()
-
if len(s.members) > 1 {
notifyCh := make(chan struct{})
if err := s.broadcast(messageLeaveType, &msg, notifyCh); err != nil {
@@ -229,7 +224,7 @@ func (s *Serf) Leave() error {
}
}
- err := s.memberlist.Leave()
+ err := s.memberlist.Leave(s.config.BroadcastTimeout)
if err != nil {
return err
} | serf: Fixing leave contract, will no longer block forever | hashicorp_serf | train | go |
4a60b40979c24e3ab6d624e99e46a515d52c1b6b | diff --git a/lib/ood_core/job/adapters/lsf.rb b/lib/ood_core/job/adapters/lsf.rb
index <HASH>..<HASH> 100644
--- a/lib/ood_core/job/adapters/lsf.rb
+++ b/lib/ood_core/job/adapters/lsf.rb
@@ -57,6 +57,7 @@ module OodCore
afterany = Array(afterany).map(&:to_s)
args = []
+ args += ["-P", script.accounting_id] unless script.accounting_id.nil?
# TODO: dependencies
diff --git a/spec/job/adapters/lsf_spec.rb b/spec/job/adapters/lsf_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/job/adapters/lsf_spec.rb
+++ b/spec/job/adapters/lsf_spec.rb
@@ -31,5 +31,11 @@ describe OodCore::Job::Adapters::Lsf do
it { expect(batch).to have_received(:submit_string).with(content, args: [], env: {}) }
end
+
+ context "with :accounting_id" do
+ before { adapter.submit(script: build_script(accounting_id: "my_account")) }
+
+ it { expect(batch).to have_received(:submit_string).with(content, args: ["-P", "my_account"], env: {}) }
+ end
end
end | Lsf#submit handle accounting id | OSC_ood_core | train | rb,rb |
a2fab6df759f1a30097e1074eba3c02509dccabc | diff --git a/liquibase-core/src/main/java/liquibase/diff/core/StandardDiffGenerator.java b/liquibase-core/src/main/java/liquibase/diff/core/StandardDiffGenerator.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/main/java/liquibase/diff/core/StandardDiffGenerator.java
+++ b/liquibase-core/src/main/java/liquibase/diff/core/StandardDiffGenerator.java
@@ -105,7 +105,7 @@ public class StandardDiffGenerator implements DiffGenerator {
// continue;
// }
Schema comparisonObjectSchema = comparisonObject.getSchema();
- if (comparisonObjectSchema != null && !StringUtils.trimToEmpty(comparisonObjectSchema.toCatalogAndSchema().standardize(comparisonDatabase).getSchemaName()).equalsIgnoreCase(schemaComparison.getComparisonSchema().standardize(comparisonDatabase).getSchemaName())) {
+ if (comparisonObjectSchema != null && !StringUtils.trimToEmpty(comparisonObjectSchema.toCatalogAndSchema().standardize(comparisonDatabase).getSchemaName()).equalsIgnoreCase(StringUtils.trimToEmpty(schemaComparison.getComparisonSchema().standardize(comparisonDatabase).getSchemaName()))) {
continue;
} | CORE-<I> Multi-schema improvements
- handle comparing default schemas when they are the only ones compared | liquibase_liquibase | train | java |
04b44779b0f0a9ff1ee9abf1d01ad9b96c9f1b63 | diff --git a/lib/skeptic/sexp_visitor.rb b/lib/skeptic/sexp_visitor.rb
index <HASH>..<HASH> 100644
--- a/lib/skeptic/sexp_visitor.rb
+++ b/lib/skeptic/sexp_visitor.rb
@@ -57,6 +57,7 @@ module Skeptic
when :var_ref then extract_name(first)
when :@const then first
when :@ident then first
+ when :@op then first
else '<unknown>'
end
end
diff --git a/spec/skeptic/rules/lines_per_method_spec.rb b/spec/skeptic/rules/lines_per_method_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/skeptic/rules/lines_per_method_spec.rb
+++ b/spec/skeptic/rules/lines_per_method_spec.rb
@@ -34,6 +34,19 @@ module Skeptic
analyze(code).size_of('Bar#foo').should eq 2
end
+ it "properly registers operators" do
+ code = <<-RUBY
+ class Foo
+ def <=>(other)
+ first
+ second
+ end
+ end
+ RUBY
+
+ analyze(code).size_of('Foo#<=>').should eq 2
+ end
+
it "does not count empty lines" do
expect_line_count 2, <<-RUBY
foo | Operators weren't recognized. Fix #5 | skanev_skeptic | train | rb,rb |
ef94004ad74dc25e7154fa029383d8062eb68157 | diff --git a/physical/consul.go b/physical/consul.go
index <HASH>..<HASH> 100644
--- a/physical/consul.go
+++ b/physical/consul.go
@@ -321,6 +321,9 @@ func (c *ConsulBackend) Transaction(txns []TxnEntry) error {
ops = append(ops, cop)
}
+ c.permitPool.Acquire()
+ defer c.permitPool.Release()
+
ok, resp, _, err := c.kv.Txn(ops, nil)
if err != nil {
return err | Have Consul's transaction handler use the permit pool | hashicorp_vault | train | go |
9b4ca1baa7e3f39355cf4219955325ce81ce5733 | diff --git a/test/projects.test.js b/test/projects.test.js
index <HASH>..<HASH> 100644
--- a/test/projects.test.js
+++ b/test/projects.test.js
@@ -43,6 +43,30 @@ tape('POST /publishers/$publisher/projects/$project/editions/$edition', function
test.end() })
.end(JSON.stringify({ form: form })) }) })
+tape('POST /publishers/$other-publisher/projects/$project/editions/$edition', function(test) {
+ test.plan(1)
+ var publisher = 'ana'
+ var password = 'ana\'s password'
+ var otherPublisher = 'bob'
+ var project = 'nda'
+ var edition = '1e'
+ var form = 'a'.repeat(64)
+ var path =
+ ( '/publishers/' + otherPublisher +
+ '/projects/' + project +
+ '/editions/' + edition )
+ server(function(port, done) {
+ http.request(
+ { auth: ( publisher + ':' + password ),
+ method: 'POST',
+ port: port,
+ path: path },
+ function(response) {
+ test.equal(response.statusCode, 401, '401')
+ done()
+ test.end() })
+ .end(JSON.stringify({ form: form })) }) })
+
tape('POST /publishers/$publisher/projects/$invalid-project/editions/$edition', function(test) {
test.plan(2)
var publisher = 'ana' | Test responds <I> for wrong publisher's credentials | commonform-archive_commonform-serve-projects | train | js |
372528647f181108657bf6748c7330b73ba5458d | diff --git a/src/create-synth.js b/src/create-synth.js
index <HASH>..<HASH> 100644
--- a/src/create-synth.js
+++ b/src/create-synth.js
@@ -33,7 +33,7 @@ class Synth {
Object.entries(transforms).forEach(([method, transform]) => {
functions[method] = transform
if (typeof transform.glsl_return_type === 'undefined' && transform.glsl) {
- transform.glsl_return_type = transform.glsl.replace(new RegExp(`^(?:[\\s\\S]*\\W)?(\\S+)\\s+${method}\\s*[(][\\s\\S]*`, 'ugsmi'), '$1')
+ transform.glsl_return_type = transform.glsl.replace(new RegExp(`^(?:[\\s\\S]*\\W)?(\\S+)\\s+${method}\\s*[(][\\s\\S]*`, 'ugm'), '$1')
}
}) | Remove unsupported 's' and unneeded 'i' flags | ojack_hydra-synth | train | js |
34883d6e3b40704365d67c43af063ccdfa6a4828 | diff --git a/src/main/java/org/junit/runners/ParentRunner.java b/src/main/java/org/junit/runners/ParentRunner.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/junit/runners/ParentRunner.java
+++ b/src/main/java/org/junit/runners/ParentRunner.java
@@ -168,7 +168,7 @@ public abstract class ParentRunner<T> extends Runner implements Filterable,
*/
protected Statement classBlock(final RunNotifier notifier) {
Statement statement = childrenInvoker(notifier);
- if (areAllChildrenIgnored() == false) {
+ if (!areAllChildrenIgnored()) {
statement = withBeforeClasses(statement);
statement = withAfterClasses(statement);
statement = withClassRules(statement);
@@ -178,7 +178,7 @@ public abstract class ParentRunner<T> extends Runner implements Filterable,
private boolean areAllChildrenIgnored() {
for (T child : getFilteredChildren()) {
- if(isIgnored(child) == false) {
+ if (!isIgnored(child)) {
return false;
}
} | Formatting changes
Space between 'if' and '(', '!expression' instead of 'expression ==
false' | junit-team_junit4 | train | java |
5ce2d8c9cff27aa4f27cf3aeb0ecfafe092ee840 | diff --git a/lib/rack/reverse_proxy.rb b/lib/rack/reverse_proxy.rb
index <HASH>..<HASH> 100644
--- a/lib/rack/reverse_proxy.rb
+++ b/lib/rack/reverse_proxy.rb
@@ -15,7 +15,7 @@ module Rack
def call(env)
rackreq = Rack::Request.new(env)
if @global_options[:newrelic_instrumentation]
- perform_action_with_newrelic_trace(:category => :rack, :request => rackreq) do
+ perform_action_with_newrelic_trace(:name => rackreq.path, :request => rackreq) do
proxy(env,rackreq)
end
else | Making NewRelic instrumentation display the paths of the proxied requests | waterlink_rack-reverse-proxy | train | rb |
a13539884d2a7a0bd97403351486ea9d6478fd34 | diff --git a/core_examples/update_status.py b/core_examples/update_status.py
index <HASH>..<HASH> 100644
--- a/core_examples/update_status.py
+++ b/core_examples/update_status.py
@@ -10,4 +10,4 @@ twitter = Twython()
# OAuth ritual...
-twitter.updateStatus("See how easy this was?")
+twitter.updateStatus(status = "See how easy this was?") | in get method we use *kwargs, that's why we need to provide named arguments to the function | ryanmcgrath_twython | train | py |
74200e35fa899f0a5a7fdf400520582edfb0e4ff | diff --git a/src/Model/Table/Table.php b/src/Model/Table/Table.php
index <HASH>..<HASH> 100644
--- a/src/Model/Table/Table.php
+++ b/src/Model/Table/Table.php
@@ -24,9 +24,7 @@ use InvalidArgumentException;
class Table extends CoreTable {
/**
- * @phpstan-var array<mixed, mixed>|string|null
- *
- * @var array|string|null
+ * @var array<mixed>|string|null
*/
protected $order; | Fix phpstan/cs. | dereuromark_cakephp-shim | train | php |
39982d1fb4951a3aa874cbcddfb7d212638036d9 | diff --git a/lib/gcli/cli.js b/lib/gcli/cli.js
index <HASH>..<HASH> 100644
--- a/lib/gcli/cli.js
+++ b/lib/gcli/cli.js
@@ -918,6 +918,8 @@ Requisition.prototype.exec = function(input) {
start: new Date()
};
+ this.reportList.addReport(report);
+
var onComplete = function(output, error) {
if (visible) {
report.end = new Date();
@@ -959,8 +961,6 @@ Requisition.prototype.exec = function(input) {
onComplete(ex, true);
}
- this.reportList.addReport(report);
-
cachedEnv = undefined;
return true;
}; | move call to addReport forwards so its always first called when incomplete | joewalker_gcli | train | js |
078c505aef7f19ae783ff05a08fdd5930fb0b4da | diff --git a/src/frontend/org/voltdb/dbmonitor/js/template.js b/src/frontend/org/voltdb/dbmonitor/js/template.js
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/dbmonitor/js/template.js
+++ b/src/frontend/org/voltdb/dbmonitor/js/template.js
@@ -415,4 +415,7 @@ function sizes_update_all() {
sizes_update_row(nrow);
}
sizes_update_summary();
+
+ //Update the table for sorting.
+ $("#sizetable").trigger("update");
}
\ No newline at end of file | VMC-<I> : VMC Schema/Size Worksheet sorts by original, not current Table Min/Max. | VoltDB_voltdb | train | js |
af6aedb6643710f436381adccc9029cf0d7a745f | diff --git a/addon/components/ember-popper.js b/addon/components/ember-popper.js
index <HASH>..<HASH> 100644
--- a/addon/components/ember-popper.js
+++ b/addon/components/ember-popper.js
@@ -22,9 +22,27 @@ export default Ember.Component.extend({
// Classes to be applied to the popper element
popperClass: null,
- // The popper element needs to be moved higher in the DOM tree to avoid z-index issues.
- // See the block-comment in the template for more details.
- popperContainer: self.document ? self.document.body : '',
+ popperContainer: Ember.computed({
+ set(_, value) {
+ if (value instanceof Element) {
+ return value;
+ }
+
+ const possibleContainers = document.querySelectorAll(value);
+
+ assert(`ember-popper with popperContainer selector "${value}" found `
+ + `${possibleContainers.length} possible containers when there should be exactly 1`,
+ possibleContainers.length === 1);
+
+ return possibleContainers[0];
+ },
+
+ get() {
+ // The popper element needs to be moved higher in the DOM tree to avoid z-index issues.
+ // See the block-comment in the template for more details.
+ return self.document ? self.document.body : '';
+ }
+ }),
// If `true`, the popper element will not be moved to popperContainer. WARNING: This can cause
// z-index issues where your popper will be overlapped by DOM elements that aren't nested as | feat(popperContainer) allow popperContainer to be set via selector | kybishop_ember-popper | train | js |
f8fb0f31f1c0355e7ab6dacbfb25856e86015599 | diff --git a/txkoji/estimates.py b/txkoji/estimates.py
index <HASH>..<HASH> 100644
--- a/txkoji/estimates.py
+++ b/txkoji/estimates.py
@@ -23,7 +23,7 @@ def average_build_duration(connection, package):
def average_build_durations(connection, packages):
"""
- Return the average build duration for a package (or container).
+ Return the average build duration for list of packages (or containers).
:param connection: txkoji.Connection
:param list packages: package names | estimates: document avg_build_durations accepts multiple packages
This was a bad copy & paste from average_build_duration() | ktdreyer_txkoji | 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.