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 |
|---|---|---|---|---|---|
0a5b1611f38c81209fa6abbc610e86d7ac9ae847 | diff --git a/ruby_event_store/lib/ruby_event_store/client.rb b/ruby_event_store/lib/ruby_event_store/client.rb
index <HASH>..<HASH> 100644
--- a/ruby_event_store/lib/ruby_event_store/client.rb
+++ b/ruby_event_store/lib/ruby_event_store/client.rb
@@ -132,7 +132,7 @@ module RubyEventStore
# @param to [Class, String] type of events to get list of sybscribed handlers
# @return [Array<Object, Class>]
def subscribers_for(event_type)
- subscriptions.all_for(event_type.to_s)
+ subscriptions.all_for(event_type)
end
# Builder object for collecting temporary handlers (subscribers) | Use event type resolver to transform argument into valid event type
Event type resolver will be invoked by subscriptions
objects in all_for method. No need to use to_s here.
That's responsibility of the event type resolver. | RailsEventStore_rails_event_store | train | rb |
35ffc77b8a8eb5be43888faba88e2e5814233a4d | diff --git a/app/Http/Composers/MenuComposer.php b/app/Http/Composers/MenuComposer.php
index <HASH>..<HASH> 100644
--- a/app/Http/Composers/MenuComposer.php
+++ b/app/Http/Composers/MenuComposer.php
@@ -89,7 +89,7 @@ class MenuComposer
'route' => route('dashboard.posts.type', [$page->slug]),
'label' => $page->name,
'childs' => false,
- 'permission' => 'dashboard.posts.type.' . $page->slug,
+ 'permission' => 'dashboard.posts.type.'.$page->slug,
];
if (reset($allPost) == $page) {
@@ -195,7 +195,6 @@ class MenuComposer
*/
protected function registerMenuSystems(Dashboard $dashboard)
{
-
$systemsMenu = [
'slug' => 'Systems',
'icon' => 'icon-organization',
@@ -209,7 +208,6 @@ class MenuComposer
$dashboard->menu->add('Main', 'dashboard::partials.leftMainMenu', $systemsMenu, 1000);
-
$settingsMenu = [
'slug' => 'settings',
'icon' => 'fa fa-cog', | Apply fixes from StyleCI (#<I>)
[ci skip] [skip ci] | orchidsoftware_platform | train | php |
ddbf1bfeb576f1c4eae8dda36e74ab27fbfb0c3d | diff --git a/src/com/google/javascript/jscomp/NodeUtil.java b/src/com/google/javascript/jscomp/NodeUtil.java
index <HASH>..<HASH> 100644
--- a/src/com/google/javascript/jscomp/NodeUtil.java
+++ b/src/com/google/javascript/jscomp/NodeUtil.java
@@ -2786,7 +2786,7 @@ public final class NodeUtil {
}
/**
- * Is a FUNCTION node an function expression? An function expression is one
+ * Is a FUNCTION node a function expression? A function expression is one
* that has either no name or a name that is not added to the current scope.
*
* <p>Some examples of function expressions:
@@ -4544,7 +4544,8 @@ public final class NodeUtil {
if (main.isFunction()) {
map.put(main, clone);
}
- Node mchild = main.getFirstChild(), cchild = clone.getFirstChild();
+ Node mchild = main.getFirstChild();
+ Node cchild = clone.getFirstChild();
while (mchild != null) {
mtocHelper(map, mchild, cchild);
mchild = mchild.getNext(); | Grammar police
-------------
Created by MOE: <URL> | google_closure-compiler | train | java |
9d4585a1cf4cd137e5078127243fcfdd0031e76d | diff --git a/src/test/java/net/spy/memcached/ProtocolBaseCase.java b/src/test/java/net/spy/memcached/ProtocolBaseCase.java
index <HASH>..<HASH> 100644
--- a/src/test/java/net/spy/memcached/ProtocolBaseCase.java
+++ b/src/test/java/net/spy/memcached/ProtocolBaseCase.java
@@ -410,6 +410,15 @@ public abstract class ProtocolBaseCase extends ClientBaseCase {
assertEquals(9, client.decr("mtest2", 1, 9));
}
+ public void testMutateWithDefaultAndExp() throws Exception {
+ assertEquals(3, client.incr("mtest", 1, 3, 1));
+ assertEquals(4, client.incr("mtest", 1, 3, 1));
+ assertEquals(3, client.decr("mtest", 1, 9, 1));
+ assertEquals(9, client.decr("mtest2", 1, 9, 1));
+ Thread.sleep(2000);
+ assertNull(client.get("mtest"));
+ }
+
public void testAsyncIncrement() throws Exception {
String k="async-incr";
client.set(k, 0, "5"); | Test for mutation with default and expiration. | dustin_java-memcached-client | train | java |
2b50769579d3003fcf764bab6850a92323d5a225 | diff --git a/aws/resource_aws_fsx_lustre_file_system.go b/aws/resource_aws_fsx_lustre_file_system.go
index <HASH>..<HASH> 100644
--- a/aws/resource_aws_fsx_lustre_file_system.go
+++ b/aws/resource_aws_fsx_lustre_file_system.go
@@ -56,7 +56,6 @@ func resourceAwsFsxLustreFileSystem() *schema.Resource {
validation.StringLenBetween(3, 900),
validation.StringMatch(regexp.MustCompile(`^s3://`), "must begin with s3://"),
),
- RequiredWith: []string{"auto_import_policy"},
},
"imported_file_chunk_size": {
Type: schema.TypeInt, | resource/aws_fsx_lustre_file_system: remove required with for auto policy import (#<I>) | terraform-providers_terraform-provider-aws | train | go |
be692569084caf4b0f8b5019824aa0df8016af29 | diff --git a/test/unit/processors/RequireJSTests.rb b/test/unit/processors/RequireJSTests.rb
index <HASH>..<HASH> 100644
--- a/test/unit/processors/RequireJSTests.rb
+++ b/test/unit/processors/RequireJSTests.rb
@@ -42,7 +42,7 @@ class RequireJS < Test::Unit::TestCase
def test_requireJs_lib
# Just point options[:rjs] to a file to look if its there,
- # the user is expected to point to a correct r.js file if he really
+ # the user is expected to point to a correct r.js file if he
# doesn't want to use the r.js shipped with npm
options = {:rjs => __FILE__}
requirejs_processor = HtmlMockup::Release::Processors::Requirejs.new(options)
@@ -51,7 +51,7 @@ class RequireJS < Test::Unit::TestCase
rjs_command = ''
assert_nothing_raised RuntimeError do
- # The file does is there - it's this one, so it should raise
+ # The file is there - it's this one in fact, so it shouldn't raise
rjs_command = requirejs_processor.rjs_check
end | Further refined comments of RequireJSTests.rb | DigitPaint_roger | train | rb |
de2332637dfa249d38327a91e26ba4620c01dcd9 | diff --git a/lib/api-client/resources/batch.js b/lib/api-client/resources/batch.js
index <HASH>..<HASH> 100644
--- a/lib/api-client/resources/batch.js
+++ b/lib/api-client/resources/batch.js
@@ -27,6 +27,15 @@ Batch.get = function(id, done) {
});
};
+Batch.suspended = function(params, done) {
+ return this.http.put(this.path + '/' + params.id + '/suspended', {
+ data: {
+ suspended: !!params.suspended
+ },
+ done: done
+ });
+};
+
Batch.statistics = function(params, done) {
return this.http.get(this.path + '/statistics/', {
data: params, | improve(batch-client): add suspended
Related to CAM-<I> | camunda_camunda-bpm-sdk-js | train | js |
7453a78656dd6ec7207040763fd59f1d8ebe31a8 | diff --git a/zounds/learn/util.py b/zounds/learn/util.py
index <HASH>..<HASH> 100644
--- a/zounds/learn/util.py
+++ b/zounds/learn/util.py
@@ -1,8 +1,9 @@
import numpy as np
+
def sigmoid(a):
return 1. / (1 + np.exp(-a))
def stochastic_binary(a):
- return a > np.random.random_sample(a.shape)
\ No newline at end of file
+ return a > np.random.random_sample(a.shape)
diff --git a/zounds/ui/api.py b/zounds/ui/api.py
index <HASH>..<HASH> 100644
--- a/zounds/ui/api.py
+++ b/zounds/ui/api.py
@@ -630,4 +630,5 @@ class ZoundsApp(object):
def start(self, port=8888):
app = self.build_app()
app.listen(port)
+ print 'Interactive REPL at http://localhost:{port}'.format(port=port)
tornado.ioloop.IOLoop.current().start() | When starting the server for the in-browser repl, a message is printed to the console with the repl's url | JohnVinyard_zounds | train | py,py |
789c07633f1e61f2e8637e3b418b4428e859cdb1 | diff --git a/src/defaultTransportFactory.js b/src/defaultTransportFactory.js
index <HASH>..<HASH> 100644
--- a/src/defaultTransportFactory.js
+++ b/src/defaultTransportFactory.js
@@ -6,7 +6,7 @@ let selected = null;
export default function defaultTransportFactory() {
if (!selected) {
- if (typeof window.ReadableByteStream === 'function') {
+ if (typeof ReadableByteStream === 'function') {
selected = fetchRequest;
} else if (navigator.userAgent.toLowerCase().indexOf('firefox') !== -1) {
selected = mozXhrRequest; | remove window for web worker compatibility (#<I>)
For web workers, `ReadableByteStream` is available, but `window.ReadableByteStream` is not, which makes this library fail in a web worker. Is there any reason to keep window? | jonnyreeves_chunked-request | train | js |
00847cdc6bc0681281315c85b310507722048feb | diff --git a/blockchain/pool.go b/blockchain/pool.go
index <HASH>..<HASH> 100644
--- a/blockchain/pool.go
+++ b/blockchain/pool.go
@@ -240,7 +240,9 @@ func (pool *BlockPool) RemovePeer(peerID string) {
func (pool *BlockPool) removePeer(peerID string) {
for _, requester := range pool.requesters {
if requester.getPeerID() == peerID {
- pool.numPending++
+ if requester.getBlock() != nil {
+ pool.numPending++
+ }
go requester.redo() // pick another peer and ...
}
} | blockpool: fix removePeer bug | tendermint_tendermint | train | go |
c3074d8e47d6ad639545eb6912756db2967caff2 | diff --git a/lib/cache/global.js b/lib/cache/global.js
index <HASH>..<HASH> 100644
--- a/lib/cache/global.js
+++ b/lib/cache/global.js
@@ -98,8 +98,6 @@ Global.prototype.set = function(fn) {
return
}
- value = value == null ? '' : value.toString()
-
// Update the cache with the new value and locks.
async.parallel([
function(fin) { | Don't cast all cached values to strings. | impromptu_impromptu | train | js |
dad33190cacd0d81fc534917524f6e8811f2369c | diff --git a/custom.js b/custom.js
index <HASH>..<HASH> 100644
--- a/custom.js
+++ b/custom.js
@@ -8,12 +8,15 @@ var through = require('through')
var types = ['html']
, tag = /\<[img|video|audio][\S\s?!\<]*?src\=[\"\'](.*?)[\"\'][\S\s]*?\>/g
+ , processed
, res
function resrcify (file, opts) {
if (!isValidFile(file, opts)) return through()
+ processed = {}
+
var buffer = ''
return through(function (chunk) {
@@ -41,7 +44,6 @@ function resrc (asset, file, opts) {
, prefix = opts.prefix || ''
, retainName = typeof opts.retainName !== 'undefined' ? opts.retainName : true
, onError = opts.onError || defaultError
- , processed = {}
, u = url.parse(asset)
// ignore abs urls | Move processed var so it actually works | bclinkinbeard_resrcify | train | js |
650408a336c55a123e5d12f61c142b08f70e6c02 | diff --git a/course/lib.php b/course/lib.php
index <HASH>..<HASH> 100644
--- a/course/lib.php
+++ b/course/lib.php
@@ -1743,7 +1743,7 @@ function print_courses($category, $hidesitecourse = false) {
if (empty($category)) {
$categories = get_categories(0); // Parent = 0 ie top-level categories only
- if (count($categories) == 1) {
+ if ($categories != null and count($categories) == 1) {
$category = array_shift($categories);
$courses = get_courses($category->id, 'c.sortorder ASC', 'c.id,c.category,c.sortorder,c.visible,c.fullname,c.shortname,c.password,c.summary,c.teacher,c.cost,c.currency,c.enrol,c.guest');
} else { | MDL-<I> - merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
b06f08e66baa1583fb0f2095bc3e8ff1da430e13 | diff --git a/tests/lax_numpy_einsum_test.py b/tests/lax_numpy_einsum_test.py
index <HASH>..<HASH> 100644
--- a/tests/lax_numpy_einsum_test.py
+++ b/tests/lax_numpy_einsum_test.py
@@ -22,7 +22,6 @@ import itertools
import numpy as onp
from absl.testing import absltest
from absl.testing import parameterized
-import six
import jax.numpy as np
import jax.test_util as jtu
@@ -214,10 +213,6 @@ class EinsumTest(jtu.JaxTestCase):
self._check(s, x, y)
def test_tf_unsupported_3(self):
- # TODO(mattjj): heisenbug! fails sometimes in python3. opt_einsum bug?
- if six.PY3:
- return absltest.unittest.skip("py3 failures")
-
# from https://www.tensorflow.org/api_docs/python/tf/einsum
r = rng()
x = r.randn(2, 3) | Enable the remaining einsum tests.
Fixes #<I>. | tensorflow_probability | train | py |
1fadc57136735700b16265628c7cc274a3a6a90f | diff --git a/fuzzywuzzy/process.py b/fuzzywuzzy/process.py
index <HASH>..<HASH> 100644
--- a/fuzzywuzzy/process.py
+++ b/fuzzywuzzy/process.py
@@ -92,7 +92,10 @@ def extractWithoutOrder(query, choices, processor=default_processor, scorer=defa
pass
# If the scorer performs full_ratio with force ascii don't run full_process twice
- if scorer in [fuzz.WRatio, fuzz.QRatio] and processor == utils.full_process:
+ if scorer in [fuzz.WRatio, fuzz.QRatio,
+ fuzz.token_set_ratio, fuzz.token_sort_ratio,
+ fuzz.partial_token_set_ratio, fuzz.partial_token_sort_ratio] \
+ and processor == utils.full_process:
processor = no_process
# If the processor was removed by setting it to None | Add token ratios to the list of scorers that skip running full_process as a processor. | seatgeek_fuzzywuzzy | train | py |
91b50ffeac6d4ea746726779c3f6ad1ce5ad2b56 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100755
--- a/index.js
+++ b/index.js
@@ -327,7 +327,7 @@ exports.queue_to_mongodb = function(next, connection) {
plugin.logerror('--------------------------------------');
var _header = connection.transaction && connection.transaction.header ? connection.transaction.header : null;
_sendMessageBack('limit', plugin, _header);
- return next(DENYSOFT, "storage error");
+ return next(DENYDISCONNECT, "storage error");
}
}
@@ -626,7 +626,12 @@ function _limitIncoming(plugin, email, cb) {
// plugin.lognotice("bcc", _bcc);
// plugin.lognotice("_to 1", _to);
// plugin.lognotice("_from 1", _from);
- _from = _from[0].address || from[0];
+ _from = _from[0].address || null;
+ // plugin.lognotice("_from 2", _from);
+ // Even now we might have some _from values without any email address
+ if (!_from) {
+ return cb(null, null);
+ }
_to = _to.map(t => t.address || t);
// plugin.lognotice("_from 2", _from);
// plugin.lognotice("_to 2", _to); | Storage error because of a limit is doing a DENYDISCONNECT now. Fixed an issue with limits | Helpmonks_haraka-plugin-mongodb | train | js |
f9cec376f422d310f1e4ad64ce64a6b2f5f2b55d | diff --git a/addon/database/database-push.js b/addon/database/database-push.js
index <HASH>..<HASH> 100644
--- a/addon/database/database-push.js
+++ b/addon/database/database-push.js
@@ -1,17 +1,29 @@
import Ember from 'ember';
+const {
+ merge
+} = Ember;
+
export default Ember.Mixin.create({
- push(doc, expectedModelName, optional=true) {
+ push(doc, opts) {
+ opts = merge({ optional: true, instantiate: true }, opts);
+
let ExpectedModelClass;
- if(expectedModelName) {
- ExpectedModelClass = this.modelClassForName(expectedModelName);
+ if(opts.model) {
+ ExpectedModelClass = this.modelClassForName(opts.model);
}
- let internal = this._deserializeDocumentToInternalModel(doc, ExpectedModelClass, optional);
+
+ let internal = this._deserializeDocumentToInternalModel(doc, ExpectedModelClass, opts.optional);
if(!internal) {
return;
}
- return internal.getModel();
+
+ if(opts.instantiate) {
+ return internal.getModel();
+ } else {
+ return { model: internal.modelName, id: internal.values.id, deleted: internal.state.isDeleted };
+ }
}
}); | database.push with opts and allow instantiate:false | ampatspell_ember-cli-sofa | train | js |
dc5a704cfc378f1975d3304cbc6146c8bdd53cb9 | diff --git a/tcex/tcex_resources.py b/tcex/tcex_resources.py
index <HASH>..<HASH> 100644
--- a/tcex/tcex_resources.py
+++ b/tcex/tcex_resources.py
@@ -2533,7 +2533,7 @@ class DataStore(object):
"""
return self._request(domain, type_name, search_command, 'DELETE', None)
- def read(self, domain, type_name, search_command):
+ def read(self, domain, type_name, search_command, body=None):
"""Read entry in ThreatConnect Data Store
Args:
@@ -2541,8 +2541,9 @@ class DataStore(object):
type_name (string): This is a free form index type name. The ThreatConnect API will use
this resource verbatim.
search_command (string): Search command to pass to ES.
+ body (str): JSON body
"""
- return self._request(domain, type_name, search_command, 'GET', None)
+ return self._request(domain, type_name, search_command, 'GET', body)
def update(self, domain, type_name, search_command, body):
"""Update entry in ThreatConnect Data Store | Add a body when reading from the datastore | ThreatConnect-Inc_tcex | train | py |
729f53ef1f5b7a6c27018fe9edb6458289b49eb4 | diff --git a/d1_mn_generic/src/gmn/app/__init__.py b/d1_mn_generic/src/gmn/app/__init__.py
index <HASH>..<HASH> 100644
--- a/d1_mn_generic/src/gmn/app/__init__.py
+++ b/d1_mn_generic/src/gmn/app/__init__.py
@@ -18,4 +18,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "2.0.0"
+__version__ = "2.0.1" | Bump GMN version to <I> | DataONEorg_d1_python | train | py |
51d3330becc804c3cbf609c4f39ac70f30f3687a | diff --git a/glue/ligolw/table.py b/glue/ligolw/table.py
index <HASH>..<HASH> 100644
--- a/glue/ligolw/table.py
+++ b/glue/ligolw/table.py
@@ -489,9 +489,11 @@ class Table(ligolw.Table, list):
that name.
"""
try:
- return getColumnsByName(self, name)[0]
- except IndexError:
+ col, = getColumnsByName(self, name)
+ except ValueError:
+ # did not find exactly 1 matching child
raise KeyError, name
+ return col
def appendColumn(self, name):
@@ -502,8 +504,12 @@ class Table(ligolw.Table, list):
this table does not contain an entry for a column by that
name.
"""
- if getColumnsByName(self, name):
+ try:
+ self.getColumnByName(name)
+ # if we get here the table already has that column
raise ValueError, "duplicate Column '%s'" % name
+ except KeyError:
+ pass
column = Column(AttributesImpl({u"Name": "%s:%s" % (StripTableName(self.tableName), name), u"Type": self.validcolumns[name]}))
streams = self.getElementsByTagName(ligolw.Stream.tagName)
if streams: | Some touch-ups to the use of getColumnByName(). | gwastro_pycbc-glue | train | py |
d26e9b33f8d2fa9ae2e59eaeea74d694c4da48db | diff --git a/h2o-bindings/bin/custom/python/gen_extendedisolationforest.py b/h2o-bindings/bin/custom/python/gen_extendedisolationforest.py
index <HASH>..<HASH> 100644
--- a/h2o-bindings/bin/custom/python/gen_extendedisolationforest.py
+++ b/h2o-bindings/bin/custom/python/gen_extendedisolationforest.py
@@ -1,3 +1,5 @@
+supervised_learning = False
+
doc = dict(
__class__="""
Builds an Extended Isolation Forest model. Extended Isolation Forest generalizes its predecessor algorithm,
diff --git a/h2o-py/h2o/estimators/extended_isolation_forest.py b/h2o-py/h2o/estimators/extended_isolation_forest.py
index <HASH>..<HASH> 100644
--- a/h2o-py/h2o/estimators/extended_isolation_forest.py
+++ b/h2o-py/h2o/estimators/extended_isolation_forest.py
@@ -29,6 +29,7 @@ class H2OExtendedIsolationForestEstimator(H2OEstimator):
"""
algo = "extendedisolationforest"
+ supervised_learning = False
def __init__(self,
model_id=None, # type: Optional[Union[None, str, H2OEstimator]] | PUBDEV-<I> - add new version of generated API for Extended Isolation Forest | h2oai_h2o-3 | train | py,py |
fab92ef114d43e1e54711b1b0ef16e7d20e2605b | diff --git a/lib/Resque/Event.php b/lib/Resque/Event.php
index <HASH>..<HASH> 100644
--- a/lib/Resque/Event.php
+++ b/lib/Resque/Event.php
@@ -73,7 +73,7 @@ class Resque_Event
$key = array_search($callback, self::$events[$event]);
if ($key !== false) {
- unset(self::$events[$key]);
+ unset(self::$events[$event][$key]);
}
return true;
@@ -86,4 +86,4 @@ class Resque_Event
{
self::$events = array();
}
-}
\ No newline at end of file
+} | fix bug preventing stopListening from working | chrisboulton_php-resque | train | php |
6f973cb96a8f75f10a6a120d140370e49269ba8b | diff --git a/niftypet/nimpa/prc/prc.py b/niftypet/nimpa/prc/prc.py
index <HASH>..<HASH> 100644
--- a/niftypet/nimpa/prc/prc.py
+++ b/niftypet/nimpa/prc/prc.py
@@ -1286,6 +1286,8 @@ def bias_field_correction(fmr, fimout='', outpath='', fcomment='_N4bias', execut
if len(outdct['fim']) == 1:
outdct['fim'] = outdct['fim'][0]
+ outdct['fmsk'] = outdct['fmsk'][0]
+
return outdct | slight output modification for bias field corr | pjmark_NIMPA | train | py |
fa0d1c7997d41a2615e6c25123473491d8c866c6 | diff --git a/lib/Cake/Error/ExceptionRenderer.php b/lib/Cake/Error/ExceptionRenderer.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/Error/ExceptionRenderer.php
+++ b/lib/Cake/Error/ExceptionRenderer.php
@@ -291,8 +291,8 @@ class ExceptionRenderer {
* @return void
*/
protected function _outputMessageSafe($template) {
- $this->controller->layoutPath = '';
- $this->controller->subDir = '';
+ $this->controller->layoutPath = null;
+ $this->controller->subDir = null;
$this->controller->viewPath = 'Errors/';
$this->controller->viewClass = 'View';
$this->controller->layout = 'error'; | Fix layout path value causing View to generate layout paths with extra slash at end | cakephp_cakephp | train | php |
0e477ac7b5bf6b120932a1cf8e82914fe92ab9f8 | diff --git a/gsh/main.py b/gsh/main.py
index <HASH>..<HASH> 100644
--- a/gsh/main.py
+++ b/gsh/main.py
@@ -47,17 +47,8 @@ def kill_all():
def parse_cmdline():
usage = '%s [OPTIONS] HOSTS...' % (sys.argv[0])
parser = optparse.OptionParser(usage, version='gsh ' + VERSION)
- try:
- parser.add_option('--log-dir', type='str', dest='log_dir',
- help='directory to log each machine conversation' +
- ' [none]')
- except optparse.OptionError:
- # Starting with python-2.4 'str' is recognized as an alias to 'string',
- # so we use this to check the python version
- print >> sys.stderr, 'Your python version is too old (%s)' % \
- (sys.version.split()[0])
- print >> sys.stderr, 'You need at least Python 2.4'
- sys.exit(1)
+ parser.add_option('--log-dir', type='str', dest='log_dir',
+ help='directory to log each machine conversation [none]')
parser.add_option('--hosts-file', type='str', dest='hosts_filename',
default=None, metavar='FILE',
help='read hostnames from given file, one per line') | Check python version only once | innogames_polysh | train | py |
2cb2b713fa4bc95d74a75faa263f3cb7c481eb41 | diff --git a/src/Symfony/Console/Command/FastRouteCacheCommand.php b/src/Symfony/Console/Command/FastRouteCacheCommand.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Console/Command/FastRouteCacheCommand.php
+++ b/src/Symfony/Console/Command/FastRouteCacheCommand.php
@@ -36,7 +36,7 @@ class FastRouteCacheCommand extends Command
$cacheFilename .= '.cache';
- $compiler = Compiler::ObtainDispatcher(
+ Compiler::ObtainDispatcher(
[
'cacheFile' => $cacheFilename,
], | variable does not need to be created here | SignpostMarv_daft-framework | train | php |
106128ba71eb54d90df5bae4a3188682b3e3acbc | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -44,11 +44,16 @@ module.exports = CachingWriter.extend({
if (entry) {
return this.newTranspilerCache[key] = entry;
}
- var compiler = new ES6Transpiler(source, moduleName);
- patchRelativeImports(moduleName, compiler);
- return this.newTranspilerCache[key] = {
- amd: compiler.toAMD()
- };
+ try {
+ var compiler = new ES6Transpiler(source, moduleName);
+ patchRelativeImports(moduleName, compiler);
+ return this.newTranspilerCache[key] = {
+ amd: compiler.toAMD()
+ };
+ } catch(err) {
+ err.file = moduleName;
+ throw err;
+ }
}
}); | tag transpilation errors with filename | ember-cli_broccoli-es6modules | train | js |
fa71e79095c8513f479f60adb0b2394d00df7263 | diff --git a/commons-lib/src/main/java/org/opencb/commons/run/ParallelTaskRunner.java b/commons-lib/src/main/java/org/opencb/commons/run/ParallelTaskRunner.java
index <HASH>..<HASH> 100644
--- a/commons-lib/src/main/java/org/opencb/commons/run/ParallelTaskRunner.java
+++ b/commons-lib/src/main/java/org/opencb/commons/run/ParallelTaskRunner.java
@@ -437,7 +437,7 @@ public class ParallelTaskRunner<I, O> {
List<O> drain = task.drain(); // empty the system
if (null != drain && !drain.isEmpty() && writeBlockingQueue != null) {
// submit final batch received from draining
- writeBlockingQueue.put(new Batch<O>(batchResult, batch.position));
+ writeBlockingQueue.put(new Batch<O>(drain, batch.position + 1));
}
synchronized (tasks) {
timeBlockedAtPutWrite += threadTimeBlockedAtSendWrite; | common: add drain function to parallel runner | opencb_java-common-libs | train | java |
76e4334d647e4d20e939eb8fabcb218a43d05a75 | diff --git a/tests/risk/test_risk_cumulative.py b/tests/risk/test_risk_cumulative.py
index <HASH>..<HASH> 100644
--- a/tests/risk/test_risk_cumulative.py
+++ b/tests/risk/test_risk_cumulative.py
@@ -59,9 +59,12 @@ class TestRisk(unittest.TestCase):
returns['Benchmark Returns'])
def test_algorithm_volatility_06(self):
- np.testing.assert_almost_equal(
- ANSWER_KEY.ALGORITHM_CUMULATIVE_VOLATILITY,
- self.cumulative_metrics_06.metrics.algorithm_volatility.values)
+ algo_vol_answers = answer_key.RISK_CUMULATIVE.volatility
+ for dt, value in algo_vol_answers.iterkv():
+ np.testing.assert_almost_equal(
+ self.cumulative_metrics_06.metrics.algorithm_volatility[dt],
+ value,
+ err_msg="Mismatch at %s" % (dt,))
def test_sharpe_06(self):
for dt, value in answer_key.RISK_CUMULATIVE.sharpe.iterkv(): | TST: Change cumulative risk test to use some style as rest of suite.
Change the algorithm volatility test to use the same iterkv style
as the rest of the suite, as it was useful to be able to zero in
on the offending date when debugging changes to the risk module. | quantopian_zipline | train | py |
c8781968ac8d99cfdb8506660a3d485833a84678 | diff --git a/lib/assets.js b/lib/assets.js
index <HASH>..<HASH> 100644
--- a/lib/assets.js
+++ b/lib/assets.js
@@ -9,7 +9,7 @@ var Assets = module.exports = function (Mincer, options) {
options = Mincer
Mincer = require('mincer')
}
-
+
this.options = options;
if (this.options.compile) {
@@ -213,6 +213,30 @@ Assets.prototype.helper = function (tagWriter, ext) {
};
};
+Assets.prototype.helperInline = function (tagWriter, ext) {
+ var instance = this,
+ extRE = new RegExp("\\." + ext + "$")
+ ;
+
+ return function (given, options) {
+ var asset, path;
+
+ path = (ext && !extRE.test(given))
+ ? given + "." + ext
+ : given
+ ;
+
+ try {
+ asset = instance.getAssetByPath(path, { bundle: true });
+ } catch (err) {}
+
+ if (!asset)
+ throw new Error("Asset '" + path + "' not found");
+
+ return tagWriter(asset.buffer, parseAttributes(options));
+ };
+};
+
Assets.prototype.getAssetByPath = function (pathname, options) {
if (!this.options.compile) {
var assetTitle = this.manifest.assets[pathname]; | add function capable of driving a tag-writer function that outputs a css/js asset inline | js-kyle_connect-assets | train | js |
2ba97316c9ba81237808754d7774b6570298d5d5 | diff --git a/salt/cloud/clouds/nova.py b/salt/cloud/clouds/nova.py
index <HASH>..<HASH> 100644
--- a/salt/cloud/clouds/nova.py
+++ b/salt/cloud/clouds/nova.py
@@ -827,8 +827,8 @@ def list_nodes(call=None, **kwargs):
'image': server_tmp['image']['id'],
'size': server_tmp['flavor']['id'],
'state': server_tmp['state'],
- 'private_ips': public,
- 'public_ips': private,
+ 'private_ips': private,
+ 'public_ips': public,
}
return ret | List public and private ips under the correct label
Fixes #<I> | saltstack_salt | train | py |
154c70c7835f7256bc3f8dfee1bb59dbe91cc712 | diff --git a/lib/mixins/family_tree.rb b/lib/mixins/family_tree.rb
index <HASH>..<HASH> 100644
--- a/lib/mixins/family_tree.rb
+++ b/lib/mixins/family_tree.rb
@@ -6,6 +6,7 @@ module BBLib
module FamilyTree
# Return all classes that inherit from this class
def descendants(include_singletons = false)
+ return _inherited_by.map { |c| [c, c.descendants] }.flatten.uniq if BBLib.in_opal?
ObjectSpace.each_object(Class).select do |c|
(include_singletons || !c.singleton_class?) && c < self
end
@@ -15,6 +16,7 @@ module BBLib
# Return all classes that directly inherit from this class
def direct_descendants(include_singletons = false)
+ return _inherited_by if BBLib.in_opal?
ObjectSpace.each_object(Class).select do |c|
(include_singletons || !c.singleton_class?) && c.ancestors[1] == self
end
@@ -37,5 +39,15 @@ module BBLib
alias direct_subclasses direct_descendants
+ # If we are in Opal we need to track descendants a bit differently
+ if BBLib.in_opal?
+ def _inherited_by
+ @_inherited_by ||= []
+ end
+
+ def inherited(klass)
+ _inherited_by.push(klass)
+ end
+ end
end
end | Added descendant tracking to support Opal where ObjectSpace doesn't exist. | bblack16_bblib-ruby | train | rb |
158c5d998017d8165e7c963d43222d37e2cb5cad | diff --git a/lib/serializer-utils.js b/lib/serializer-utils.js
index <HASH>..<HASH> 100644
--- a/lib/serializer-utils.js
+++ b/lib/serializer-utils.js
@@ -43,7 +43,7 @@ module.exports = function (collectionName, payload, opts) {
if (serializationConfig && serializationConfig.ref) {
// Embedded array with relationships.
- data.relationships[attribute] = {
+ data.relationships[dasherize(attribute)] = {
data: record[attribute].map(function (item) {
var id = getRef(record, item, serializationConfig);
var type = getType(attribute);
@@ -81,7 +81,7 @@ module.exports = function (collectionName, payload, opts) {
};
} else {
// Embedded array without relationships.
- data.attributes[attribute] = record[attribute];
+ data.attributes[dasherize(attribute)] = record[attribute];
}
};
@@ -97,7 +97,7 @@ module.exports = function (collectionName, payload, opts) {
attributes: pick(record[attribute], serializationConfig.attributes)
});
- data.relationships[attribute] = {
+ data.relationships[dasherize(attribute)] = {
data: { id: id, type: type }
};
} else { | Dasherize key attributes in objects/arrays | SeyZ_jsonapi-serializer | train | js |
e6c5915ba1d4dce87bb86265f678bfa916fddd5e | diff --git a/lib/main.js b/lib/main.js
index <HASH>..<HASH> 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -34,9 +34,7 @@ module.exports = function(config) {
config.ContainerName,
Number(config.Concurrency),
config.StackName
- ).on('error', function(err) {
- log.error('Error in tasks: %s', err.message);
- });
+ );
var messages = require('../lib/messages')(
config.QueueUrl,
diff --git a/lib/tasks.js b/lib/tasks.js
index <HASH>..<HASH> 100644
--- a/lib/tasks.js
+++ b/lib/tasks.js
@@ -23,7 +23,7 @@ module.exports = function(cluster, taskDefinition, containerName, concurrency, s
/**
* An ECS task runner and status tracker
*/
- var tasks = new events.EventEmitter();
+ var tasks = {};
var tasksInFlight = tasks.inFlight = {};
/** | Error will be logged in other ways | mapbox_ecs-watchbot | train | js,js |
42750e0caac0a0556142e15174558c4ac73fe79c | diff --git a/lib/MetaTemplate/Template/TypeScriptTemplate.php b/lib/MetaTemplate/Template/TypeScriptTemplate.php
index <HASH>..<HASH> 100644
--- a/lib/MetaTemplate/Template/TypeScriptTemplate.php
+++ b/lib/MetaTemplate/Template/TypeScriptTemplate.php
@@ -45,10 +45,6 @@ class TypeScriptTemplate extends Base
}
$process->run();
-
- $data = file_get_contents($outputFile);
-
- unlink($outputFile);
unlink($inputFile);
if ($process->getErrorOutput()) {
@@ -57,6 +53,9 @@ class TypeScriptTemplate extends Base
);
}
+ $data = file_get_contents($outputFile);
+ unlink($outputFile);
+
return $data;
}
} | [TypeScript] Read back contents of output file only if run successfully | CHH_meta-template | train | php |
455a89129a6860215d8e79972f720eaa7564e625 | diff --git a/lib/puppet/reports/store.rb b/lib/puppet/reports/store.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/reports/store.rb
+++ b/lib/puppet/reports/store.rb
@@ -15,7 +15,10 @@ Puppet::Reports.register_report(:store) do
dir = File.join(Puppet[:reportdir], client)
- Dir.mkdir(dir, 0750) unless FileTest.exists?(dir)
+ if ! FileTest.exists?(dir)
+ FileUtils.mkdir_p(dir)
+ FileUtils.chmod_R(0750, dir)
+ end
# Now store the report.
now = Time.now.gmtime
diff --git a/spec/unit/reports/store_spec.rb b/spec/unit/reports/store_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/reports/store_spec.rb
+++ b/spec/unit/reports/store_spec.rb
@@ -11,7 +11,7 @@ describe processor do
describe "#process" do
include PuppetSpec::Files
before :each do
- Puppet[:reportdir] = tmpdir('reports')
+ Puppet[:reportdir] = tmpdir('reports') << '/reports'
@report = YAML.load_file(File.join(PuppetSpec::FIXTURE_DIR, 'yaml/report2.6.x.yaml')).extend processor
end | (#<I>) create reports directory when creating host specific directory | puppetlabs_puppet | train | rb,rb |
d953b18495c82e7ac48b7d4b75fc4972df0f7ed6 | diff --git a/lib/formslib.php b/lib/formslib.php
index <HASH>..<HASH> 100644
--- a/lib/formslib.php
+++ b/lib/formslib.php
@@ -922,6 +922,22 @@ abstract class moodleform {
}
/**
+ * Renders the html form (same as display, but returns the result).
+ *
+ * Note that you can only output this rendered result once per page, as
+ * it contains IDs which must be unique.
+ *
+ * @return string HTML code for the form
+ */
+ public function render() {
+ ob_start();
+ $this->display();
+ $out = ob_get_contents();
+ ob_end_clean();
+ return $out;
+ }
+
+ /**
* Form definition. Abstract method - always override!
*/
protected abstract function definition(); | MDL-<I> (2) Forms: Function to render form to string
Previously it was only possible to display the form immediately as
HTML output. You had to wrap in an output buffer in order to put
it in a renderer. This new function does the output buffer for you. | moodle_moodle | train | php |
b962fe38cd09f61c0587606b77a257c44609d0e5 | diff --git a/agent/testagent.go b/agent/testagent.go
index <HASH>..<HASH> 100644
--- a/agent/testagent.go
+++ b/agent/testagent.go
@@ -25,6 +25,7 @@ import (
"github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/logger"
"github.com/hashicorp/consul/sdk/freeport"
+ "github.com/hashicorp/consul/sdk/testutil"
"github.com/hashicorp/consul/sdk/testutil/retry"
"github.com/stretchr/testify/require"
@@ -149,7 +150,7 @@ func (a *TestAgent) Start(t *testing.T) *TestAgent {
logOutput := a.LogOutput
if logOutput == nil {
- logOutput = os.Stderr
+ logOutput = testutil.TestWriter(t)
}
agentLogger := log.New(logOutput, a.Name+" - ", log.LstdFlags|log.Lmicroseconds) | test: send testagent logs through testing.Logf (#<I>) | hashicorp_consul | train | go |
768b529c4f20059946be297438404735bd3ff4c2 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -166,6 +166,25 @@ class RPMCommand(Command):
os.system("mv /tmp/python-bugzilla.spec .")
+requirements = {}
+
+try:
+ from pip.req import parse_requirements
+
+ requirement_files = {
+ 'install_requires': 'requirements.txt',
+ 'tests_require': 'test-requirements.txt',
+ }
+
+ for name, fname in requirement_files.items():
+ requirements[name] = [
+ str(ir.req) for ir in parse_requirements(fname)
+ ]
+except ImportError:
+ # ignore as this is not useful without pip anyway
+ pass
+
+
setup(name='python-bugzilla',
version=get_version(),
description='Bugzilla XMLRPC access module',
@@ -181,5 +200,6 @@ setup(name='python-bugzilla',
"pylint" : PylintCommand,
"rpm" : RPMCommand,
"test" : TestCommand,
- }
+ },
+ **requirements
) | Handle requirements in setup.py | python-bugzilla_python-bugzilla | train | py |
96dda67f62a1780f7c815d299d795337f2e1a7c4 | diff --git a/bin/php-cs-fixer-config.php b/bin/php-cs-fixer-config.php
index <HASH>..<HASH> 100644
--- a/bin/php-cs-fixer-config.php
+++ b/bin/php-cs-fixer-config.php
@@ -68,6 +68,7 @@ return
'lowercase_constants',
'lowercase_keywords',
'method_argument_space',
+ 'multiple_use',
'parenthesis',
'php_closing_tag',
'single_line_after_imports', | Added 'multiple_use'.
Fixes #8 | sabre-io_cs | train | php |
575cbee74c421ee0d1a90cba35d1882187f200b9 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -16,7 +16,7 @@ const iterateObject = require("iterate-object")
* @return {Object} Flattened object
*/
module.exports = function flattenObject (obj, del) {
- if (typpy(obj, String)) return obj;
+ if (!typpy(obj, Object) && !typpy(obj, Array)) return obj;
let result = {};
del = del || ".";
diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -99,6 +99,12 @@ test('arrays', function (t) {
}, 'flatten objects inside arrays');
t.deepEqual(flatten({
+ latlon: [ -1, -22]
+ }, '_'), {
+ latlon: [ -1, -22]
+ }, 'array with numbers');
+
+ t.deepEqual(flatten({
personalDetails: {
firstName: 'Frank',
lastName: 'Sinatra', | Fixes #<I>, fix primary types in arrays | IonicaBizau_obj-flatten | train | js,js |
882b7e324547206ceee75b2b84152aac4a61dfe3 | diff --git a/Net/SmartIRC.php b/Net/SmartIRC.php
index <HASH>..<HASH> 100644
--- a/Net/SmartIRC.php
+++ b/Net/SmartIRC.php
@@ -2554,14 +2554,14 @@ class Net_SmartIRC extends Net_SmartIRC_messagehandler
$result = fwrite($this->_socket, $data.SMARTIRC_CRLF);
- if ($result === false) {
+ if (!$result) {
// writing to the socket failed, means the connection is broken
$this->_connectionerror = true;
} else {
$this->_lasttx = time();
}
- return ($result !== false);
+ return $result;
}
/** | fixed bug #<I> - corrected for error in php fwrite() docs | pear_Net_SmartIRC | train | php |
f004d747f1e7d090e71fc33fd6ba9ce9b055b967 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -1516,7 +1516,7 @@ function DiscordClient(options) {
var data = JSON.parse(message);
if (data.t === "VOICE_STATE_UPDATE") {
- if (data.d.user_id === self.id) {
+ if (data.d.user_id === self.id && data.d.channel_id !== null) {
session = data.d.session_id;
}
} else if (data.t === "VOICE_SERVER_UPDATE") { | Correct handling of rejoining the voice channel | izy521_discord.io | train | js |
3590495eb87ed355bd239ecb47db5f756289d34a | diff --git a/testapp/testapp/testmain/tests/test_webservices.py b/testapp/testapp/testmain/tests/test_webservices.py
index <HASH>..<HASH> 100644
--- a/testapp/testapp/testmain/tests/test_webservices.py
+++ b/testapp/testapp/testmain/tests/test_webservices.py
@@ -54,6 +54,7 @@ class AfipTestCase(TestCase):
AfipTestCase.ticket.save()
+@tag('live')
class AuthTicketTest(TestCase):
"""Test AuthTicket methods.""" | Tag AuthTicketTest as `live` | WhyNotHugo_django-afip | train | py |
0273ca476819b88ed0e5ccd600752f8273b7deb6 | diff --git a/src/qnet/algebra/library/circuit_components.py b/src/qnet/algebra/library/circuit_components.py
index <HASH>..<HASH> 100644
--- a/src/qnet/algebra/library/circuit_components.py
+++ b/src/qnet/algebra/library/circuit_components.py
@@ -48,7 +48,7 @@ class CoherentDriveCC(Component):
class PhaseCC(Component):
r"""Coherent phase shift.
- The field passing through obtains a phase factor $e^i \phi$ \phi` for a
+ The field passing through obtains a phase factor $e^{i \phi}$ for a
real-valued phase $\phi$. The component has no dynamics, i.e. a trivial
Hamiltonian and Lindblad operators | Typo in PhaseCC docstring | mabuchilab_QNET | train | py |
9311ae19786dbe328beca071240d587ea1228412 | diff --git a/src/DependencyInjection/EightPointsGuzzleExtension.php b/src/DependencyInjection/EightPointsGuzzleExtension.php
index <HASH>..<HASH> 100644
--- a/src/DependencyInjection/EightPointsGuzzleExtension.php
+++ b/src/DependencyInjection/EightPointsGuzzleExtension.php
@@ -123,14 +123,14 @@ class EightPointsGuzzleExtension extends Extension
$handler = new Definition(HandlerStack::class);
$handler->setFactory([HandlerStack::class, 'create']);
+ $handler->addMethodCall('push', [$logExpression, 'log']);
foreach ($this->plugins as $plugin) {
$plugin->loadForClient($config['plugin'][$plugin->getPluginName()], $container, $name, $handler);
}
- $handler->addMethodCall('push', [$logExpression]);
// goes on the end of the stack.
- $handler->addMethodCall('unshift', [$eventExpression]);
+ $handler->addMethodCall('unshift', [$eventExpression, 'events']);
return $handler;
} | [FIX] Add names to middlewares | 8p_EightPointsGuzzleBundle | train | php |
e9d433982b2fa3cd56e953d7f9cfc1a5f3e4fddc | diff --git a/test/test_legacy_api.py b/test/test_legacy_api.py
index <HASH>..<HASH> 100644
--- a/test/test_legacy_api.py
+++ b/test/test_legacy_api.py
@@ -1263,6 +1263,7 @@ class TestLegacy(IntegrationTest):
# Clean up indexes for later tests
db.test.drop_indexes()
+ @client_context.require_version_max(4, 1) # PYTHON-1734
def test_ensure_index_threaded(self):
coll = self.db.threaded_index_creation
index_docs = []
@@ -1323,6 +1324,7 @@ class TestLegacy(IntegrationTest):
finally:
coll.drop()
+ @client_context.require_version_max(4, 1) # PYTHON-1734
def test_ensure_unique_index_threaded(self):
coll = self.db.test_unique_threaded
coll.drop() | PYTHON-<I> Skip failing index tests on MongoDB <I> | mongodb_mongo-python-driver | train | py |
f21bdb9a4936e0caac65f2d5f65ca3256d83c9eb | diff --git a/tests/MatthiasNoback/MicrosoftTranslator/MicrosoftTranslatorFunctionalTest.php b/tests/MatthiasNoback/MicrosoftTranslator/MicrosoftTranslatorFunctionalTest.php
index <HASH>..<HASH> 100644
--- a/tests/MatthiasNoback/MicrosoftTranslator/MicrosoftTranslatorFunctionalTest.php
+++ b/tests/MatthiasNoback/MicrosoftTranslator/MicrosoftTranslatorFunctionalTest.php
@@ -3,6 +3,7 @@
namespace MatthiasNoback\Tests\MicrosoftTranslator;
use Buzz\Browser;
+use Buzz\Client\Curl;
use MatthiasNoback\MicrosoftOAuth\AccessTokenProvider;
use MatthiasNoback\MicrosoftTranslator\MicrosoftTranslator;
use MatthiasNoback\MicrosoftOAuth\AccessTokenCache;
@@ -23,7 +24,8 @@ class MicrosoftTranslatorFunctionalTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
- $this->browser = new Browser();
+ $client = new Curl();
+ $this->browser = new Browser($client);
$clientId = $this->getEnvironmentVariable('MICROSOFT_OAUTH_CLIENT_ID');
$clientSecret = $this->getEnvironmentVariable('MICROSOFT_OAUTH_CLIENT_SECRET'); | Switch to Curl for the Buzz browser client implementation | matthiasnoback_microsoft-translator | train | php |
6a13bca81f9b1d18ffdd0b4029fd0cd7e146622c | diff --git a/sonnet/python/modules/batch_norm.py b/sonnet/python/modules/batch_norm.py
index <HASH>..<HASH> 100644
--- a/sonnet/python/modules/batch_norm.py
+++ b/sonnet/python/modules/batch_norm.py
@@ -112,8 +112,7 @@ class BatchNorm(base.AbstractModule):
...
update_ops = tf.group(*tf.get_collection(tf.GraphKeys.UPDATE_OPS))
- with tf.control_dependencies([update_ops]):
- train_op = tf.group(train_op)
+ train_op = tf.group(train_op, update_ops)
Then, whenever `train_op` is run so also are the moving average update ops. | Update batch-norm example in comment.
PiperOrigin-RevId: <I> | deepmind_sonnet | train | py |
fc1049ce93555e3e73c42a9759cc61b347a6c16a | diff --git a/core/server/src/main/java/alluxio/worker/netty/DataServerHandler.java b/core/server/src/main/java/alluxio/worker/netty/DataServerHandler.java
index <HASH>..<HASH> 100644
--- a/core/server/src/main/java/alluxio/worker/netty/DataServerHandler.java
+++ b/core/server/src/main/java/alluxio/worker/netty/DataServerHandler.java
@@ -55,7 +55,7 @@ final class DataServerHandler extends SimpleChannelInboundHandler<RPCMessage> {
* @param worker the Alluxio worker handle
*/
public DataServerHandler(final AlluxioWorkerService worker) {
- Preconditions.checkNotNull(worker);
+ Preconditions.checkNotNull(worker, "worker");
mBlockHandler = new BlockDataServerHandler(worker.getBlockWorker());
mUnderFileSystemHandler = new UnderFileSystemDataServerHandler(worker.getFileSystemWorker());
} | Improve precondition check
Adding error message from
Preconditions.checkNotNull(worker);
to
Preconditions.checkNotNull(worker, "worker"); | Alluxio_alluxio | train | java |
caadc4f20166a1d5236d572d206de6609d84a2d3 | diff --git a/tweepy/api.py b/tweepy/api.py
index <HASH>..<HASH> 100644
--- a/tweepy/api.py
+++ b/tweepy/api.py
@@ -1659,14 +1659,24 @@ class API:
Obtain a collection of the lists the specified user is subscribed to,
20 lists per page by default. Does not include the user's own lists.
- :param user_id: |user_id|
- :param screen_name: |screen_name|
- :param count: |count|
- :param cursor: |cursor|
+ Parameters
+ ----------
+ user_id
+ |user_id|
+ screen_name
+ |screen_name|
+ count
+ |count|
+ cursor
+ |cursor|
- :rtype: list of :class:`List` objects
+ Returns
+ -------
+ :py:class:`List`\ [:class:`~tweepy.models.List`]
- :reference: https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscriptions
+ References
+ ----------
+ https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/create-manage-lists/api-reference/get-lists-subscriptions
"""
return self.request(
'GET', 'lists/subscriptions', endpoint_parameters=( | Update and improve documentation for API.lists_subscriptions | tweepy_tweepy | train | py |
34125161284622f8d056746a31a44d43c0769851 | diff --git a/polyfills/IntersectionObserver/tests.js b/polyfills/IntersectionObserver/tests.js
index <HASH>..<HASH> 100644
--- a/polyfills/IntersectionObserver/tests.js
+++ b/polyfills/IntersectionObserver/tests.js
@@ -2,7 +2,7 @@
/* global proclaim, it */
before(function(done) {
- var head = head = document.head || document.getElementsByTagName('head')[0];
+ var head = document.head || document.getElementsByTagName('head')[0];
var scriptEl = document.createElement('script');
var readywait = null;
scriptEl.src = 'https://cdnjs.cloudflare.com/ajax/libs/sinon.js/1.15.4/sinon.min.js';
@@ -1129,4 +1129,4 @@ function removeFixtures() {
targetEl2 = null;
targetEl3 = null;
targetEl4 = null;
-}
\ No newline at end of file
+} | Remove the double assignment (#<I>) | Financial-Times_polyfill-service | train | js |
e295b79701195823b394ed1706989d5bd33ad94e | diff --git a/montblanc/impl/rime/tensorflow/config.py b/montblanc/impl/rime/tensorflow/config.py
index <HASH>..<HASH> 100644
--- a/montblanc/impl/rime/tensorflow/config.py
+++ b/montblanc/impl/rime/tensorflow/config.py
@@ -265,9 +265,13 @@ A = [
default = lambda s, a: np.zeros(a.shape, a.dtype),
test = lambda s, a: rc(a.shape, a.dtype)),
+ # Model Visibilities
+ ary_dict('model_vis', ('ntime','nbl','nchan',4), 'ct',
+ default = lambda s, a: np.zeros(a.shape, a.dtype),
+ test = lambda s, a: rc(a.shape, a.dtype)),
+
# Result arrays
ary_dict('bsqrt', ('nsrc', 'ntime', 'nchan', 4), 'ct', temporary=True),
ary_dict('ant_jones', ('nsrc','ntime','na','nchan',4), 'ct', temporary=True),
- ary_dict('model_vis', ('ntime','nbl','nchan',4), 'ct', temporary=True),
ary_dict('chi_sqrd_result', ('ntime','nbl','nchan'), 'ft', temporary=True),
] | model_vis is a full input and output array
rather than a temporary scratch array | ska-sa_montblanc | train | py |
66c376bb7356129656d897e87ec852416cbfd7c4 | diff --git a/builtin/credential/aws/path_config_rotate_root_test.go b/builtin/credential/aws/path_config_rotate_root_test.go
index <HASH>..<HASH> 100644
--- a/builtin/credential/aws/path_config_rotate_root_test.go
+++ b/builtin/credential/aws/path_config_rotate_root_test.go
@@ -73,6 +73,9 @@ func TestPathConfigRotateRoot(t *testing.T) {
t.Fatalf("expected new access key buzz2 but received %s", resp.Data["access_key"])
}
newClientConf, err := b.nonLockedClientConfigEntry(ctx, req.Storage)
+ if err != nil {
+ t.Fatal(err)
+ }
if resp.Data["access_key"].(string) != newClientConf.AccessKey {
t.Fatalf("expected new access key buzz2 to be saved to storage but receieved %s", clientConf.AccessKey)
} | builtin/credential/aws: fix dropped test error (#<I>) | hashicorp_vault | train | go |
39798f7ab1ff4332efcdb32366aff530b8771536 | diff --git a/lib/discordrb/bot.rb b/lib/discordrb/bot.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/bot.rb
+++ b/lib/discordrb/bot.rb
@@ -752,6 +752,8 @@ module Discordrb
user_id = data['user']['id'].to_i
server.delete_member(user_id)
+ rescue Discordrb::Errors::NoPermission
+ Discordrb::LOGGER.warn("delete_guild_member attempted to access a server for which the bot doesn't have permission! Not sure what happened here, ignoring")
end
# Internal handler for GUILD_CREATE | Warn instead of throwing a gateway error when delete_guild_member fails its `server` call, fixes #<I> | meew0_discordrb | train | rb |
05f407a70ee9c6d916a4e557562d3ff6e0c3bbf1 | diff --git a/ui/src/components/tree/QTree.js b/ui/src/components/tree/QTree.js
index <HASH>..<HASH> 100644
--- a/ui/src/components/tree/QTree.js
+++ b/ui/src/components/tree/QTree.js
@@ -617,9 +617,11 @@ export default createComponent({
if (hasSelection.value) {
if (meta.selectable) {
- const val = meta.key !== props.selected ? meta.key : null
- if (props.noSelectionUnset !== true || val !== null) {
- emit('update:selected', val)
+ if (props.noSelectionUnset === false) {
+ emit('update:selected', meta.key !== props.selected ? meta.key : null)
+ }
+ else if (meta.key !== props.selected) {
+ emit('update:selected', meta.key || null)
}
}
} | fix(QTree): #<I> with "noSelectionUnset" QTree can't emit null (#<I>)
* fix: Adding an extra props "unSelectable" to QTree (fix #<I>)
* Update QTree.js
* fix: with "noSelectionUnset" QTree can't emit null (fix #<I>)
* Update QTree.js | quasarframework_quasar | train | js |
73e336e74ea1de79b82f3bec47f9fb97e3aaf5fd | diff --git a/ryu/ofproto/oxm_fields.py b/ryu/ofproto/oxm_fields.py
index <HASH>..<HASH> 100644
--- a/ryu/ofproto/oxm_fields.py
+++ b/ryu/ofproto/oxm_fields.py
@@ -225,6 +225,7 @@ def parse(mod, buf, offset):
oxm_len = mod.oxm_tlv_header_extract_length(header)
oxm_class = oxm_type >> 7
if oxm_class == OFPXMC_EXPERIMENTER:
+ # Experimenter OXMs have 64-bit header. (vs 32-bit for other OXMs)
exp_hdr_pack_str = '!I' # experimenter_id
(exp_id, ) = struct.unpack_from(exp_hdr_pack_str, buf,
offset + hdr_len)
@@ -242,6 +243,8 @@ def parse(mod, buf, offset):
else:
num = oxm_type
exp_hdr_len = 0
+ # Note: OXM payload length (oxm_len) includes Experimenter ID (exp_hdr_len)
+ # for experimenter OXMs.
value_offset = offset + hdr_len + exp_hdr_len
value_len = oxm_len - exp_hdr_len
value_pack_str = '!%ds' % value_len | oxm_fields: Add comments | osrg_ryu | train | py |
1674d0e06ca7114139b2fa2896407360f523e6bb | diff --git a/Framework/Component/DalEl.cmp.php b/Framework/Component/DalEl.cmp.php
index <HASH>..<HASH> 100644
--- a/Framework/Component/DalEl.cmp.php
+++ b/Framework/Component/DalEl.cmp.php
@@ -74,6 +74,9 @@ class DalElement {
}
foreach ($paramArray as $key => &$value) {
+ if($value instanceof DateTime) {
+ $value = $value->format("Y-m-d H:i:s");
+ }
$stmt->bindParam($key, $value);
} | Automatically converts DateTime objects to MySQL compatible datetime strings. | PhpGt_WebEngine | train | php |
064ab5a6faab5cdf07efdaded920fe29f570fd38 | diff --git a/src/Yangqi/Htmldom/Htmldomnode.php b/src/Yangqi/Htmldom/Htmldomnode.php
index <HASH>..<HASH> 100644
--- a/src/Yangqi/Htmldom/Htmldomnode.php
+++ b/src/Yangqi/Htmldom/Htmldomnode.php
@@ -699,7 +699,7 @@ class Htmldomnode
else
{
$sourceCharset = trim($sourceCharset);
- $converted_text = iconv($sourceCharset, $targetCharset, $text);
+ $converted_text = iconv($sourceCharset, $targetCharset . '//IGNORE', $text);
}
} | Remove invalid code points, convert everything else
The package presents an error when it detects the encoding as 'CP<I>' as well as Windows-<I>. This change allows the package to finish executing without an error and display the text properly. | yangqi_Htmldom | train | php |
6faaa6f3bdb04f7a10594bb44a7dd64ef16b1018 | diff --git a/bin/inline_forms_installer_core.rb b/bin/inline_forms_installer_core.rb
index <HASH>..<HASH> 100755
--- a/bin/inline_forms_installer_core.rb
+++ b/bin/inline_forms_installer_core.rb
@@ -24,7 +24,7 @@ gem 'jquery-timepicker-rails'
gem 'jquery-ui-sass-rails'
gem 'mini_magick'
gem 'mysql2'
-gem 'paper_trail'
+gem 'paper_trail', git: 'https://github.com/acesuares/paper_trail.git'
gem 'rails-i18n', :git => 'https://github.com/svenfuchs/rails-i18n.git' # since https://github.com/svenfuchs/rails-i18n/pull/794 we don't have to maintain 'https://github.com/acesuares/rails-i18n.git' anymore!
gem 'rails-jquery-autocomplete'
gem 'rails', '6.1.3.1'
@@ -301,7 +301,7 @@ say "- Install ckeditor..."
generate "ckeditor:install --orm=active_record --backend=carrierwave"
say "- Paper_trail install..."
-# generate "paper_trail:install --with-changes"
+generate "paper_trail:install --with-changes --with-mysql"
# Create Translations
say "- Generate models and tables and views for translations..." # TODO Translations need to be done in inline_forms, and then generate a yml file, perhaps | upgrade Gemfile, gemspec and delete some files | acesuares_inline_forms | train | rb |
58475b9fe084e677cf520fc60734760829e4cdae | diff --git a/psamm/commands/robustness.py b/psamm/commands/robustness.py
index <HASH>..<HASH> 100644
--- a/psamm/commands/robustness.py
+++ b/psamm/commands/robustness.py
@@ -103,6 +103,8 @@ class RobustnessCommand(SolverCommandMixin, Command):
del self._mm.limits[varying_reaction].bounds
p = fluxanalysis.FluxBalanceProblem(self._mm, solver)
+ if not self._args.no_tfba:
+ p.add_thermodynamic()
for i in range(steps):
fixed_flux = flux_min + i*(flux_max - flux_min)/float(steps-1) | robustness: Fix bug causing tFBA to never be enabled | zhanglab_psamm | train | py |
62a787ae152306cdb0907b4dc37b367ba9706c56 | diff --git a/lib/reform/form.rb b/lib/reform/form.rb
index <HASH>..<HASH> 100644
--- a/lib/reform/form.rb
+++ b/lib/reform/form.rb
@@ -68,11 +68,6 @@ module Reform
extend PropertyMethods
- def initialize(model)
- @model = model # we need this for #save.
- @fields = setup_fields # delegate all methods to Fields instance.
- end
-
def aliased_model
# TODO: cache the Expose.from class!
Reform::Expose.from(self.class.representer_class).new(:model => model)
diff --git a/lib/reform/form/setup.rb b/lib/reform/form/setup.rb
index <HASH>..<HASH> 100644
--- a/lib/reform/form/setup.rb
+++ b/lib/reform/form/setup.rb
@@ -1,5 +1,10 @@
class Reform::Form
module Setup
+ def initialize(model)
+ @model = model # we need this for #save.
+ @fields = setup_fields # delegate all methods to Fields instance.
+ end
+
def setup_fields
representer = mapper.new(aliased_model).extend(Setup::Representer) | move #initialize into Setup. | trailblazer_reform | train | rb,rb |
f749bf099e18db476feb4695378ed83f723c9984 | diff --git a/src/LooseEqualityComparer.php b/src/LooseEqualityComparer.php
index <HASH>..<HASH> 100644
--- a/src/LooseEqualityComparer.php
+++ b/src/LooseEqualityComparer.php
@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace Emonkak\Enumerable;
/**
- * @template T of ?scalar
* @implements EqualityComparerInterface<?scalar>
*/
class LooseEqualityComparer implements EqualityComparerInterface | Fix a typing of `LooseEqualityComparer` | emonkak_php-enumerable | train | php |
1d28e3b5dd8934d075f79a46c6f623398d465453 | diff --git a/src/Persistence/Sql.php b/src/Persistence/Sql.php
index <HASH>..<HASH> 100644
--- a/src/Persistence/Sql.php
+++ b/src/Persistence/Sql.php
@@ -939,7 +939,7 @@ class Sql extends Persistence
// If our Model has expr() method (inherited from Persistence\Sql) then use it
if ($field->owner->hasMethod('expr')) {
- $field->owner->expr($mask, $prop);
+ return $field->owner->expr($mask, $prop);
}
// Otherwise call method from expression | [fix] return expression using field owner expr method (#<I>) | atk4_data | train | php |
145bbae00245901c3f82221fd042c597fd343364 | diff --git a/examples/connection_protector.rb b/examples/connection_protector.rb
index <HASH>..<HASH> 100644
--- a/examples/connection_protector.rb
+++ b/examples/connection_protector.rb
@@ -23,13 +23,21 @@ class ConnectionProtector
end
end
+def self.sometimes(num, connection)
+ if num%2 == 0
+ "#{num}:#{connection.value}"
+ else
+ "connection not used!"
+ end
+end
+
protector = ConnectionProtector.new
-19.times { Thread.new {
+19.times {|i| Thread.new {
protector.protect do |connection|
- puts connection.value
+ puts sometimes(i, connection)
end
} }
-
+
protector.protect do |connection|
- puts connection.value
+ puts sometimes(20, connection)
end | Better example of ConnectionProtector to illustrate higher concurrency and greater modularity when compared to manual Monitor use | larrytheliquid_dataflow | train | rb |
3d4e0e3474d1a4a42988032cae68b228a1ee1452 | diff --git a/packages/ember-testing/tests/acceptance_test.js b/packages/ember-testing/tests/acceptance_test.js
index <HASH>..<HASH> 100644
--- a/packages/ember-testing/tests/acceptance_test.js
+++ b/packages/ember-testing/tests/acceptance_test.js
@@ -262,6 +262,22 @@ test("Unhandled exceptions are logged via Ember.Test.adapter#exception", functio
asyncHandled = click(".does-not-exist");
});
+test("Unhandled exceptions in `andThen` are logged via Ember.Test.adapter#exception", function () {
+ expect(1);
+
+ Test.adapter = QUnitAdapter.create({
+ exception: function(error) {
+ equal(error.message, "Catch me", "Exception successfully caught and passed to Ember.Test.adapter.exception");
+ }
+ });
+
+ visit('/posts');
+
+ andThen(function() {
+ throw new Error('Catch me');
+ });
+});
+
test("should not start routing on the root URL when visiting another", function(){
visit('/posts'); | Add test for errors thrown in andThen. | emberjs_ember.js | train | js |
50498b852a9c1ccad9af8428c84a8afadce0b8e3 | diff --git a/mbuild/compound.py b/mbuild/compound.py
index <HASH>..<HASH> 100755
--- a/mbuild/compound.py
+++ b/mbuild/compound.py
@@ -2476,8 +2476,8 @@ class Compound(object):
if not val:
box_vec_max[dim] += 0.25
box_vec_min[dim] -= 0.25
- box.mins = np.asarray(box_vec_min)
box.maxs = np.asarray(box_vec_max)
+ box.mins = np.asarray(box_vec_min)
box_vector = np.empty(6)
if box.angles is not None: | Switch order that box mins and maxs are set | mosdef-hub_mbuild | train | py |
cd31f3b7733341d00a2419d9a91f39b5a8022a96 | diff --git a/lib/GoCardless/Request.php b/lib/GoCardless/Request.php
index <HASH>..<HASH> 100644
--- a/lib/GoCardless/Request.php
+++ b/lib/GoCardless/Request.php
@@ -102,6 +102,9 @@ class GoCardless_Request {
} elseif ($method == 'put') {
$curl_options[CURLOPT_PUT] = 1;
+ $fh = fopen('php://memory', 'rw+');
+ $curl_options[CURLOPT_INFILE] = $fh;
+ $curl_options[CURLOPT_INFILESIZE] = 0;
}
@@ -160,6 +163,10 @@ class GoCardless_Request {
curl_close($ch);
+ if (isset($fh)) {
+ fclose($fh);
+ }
+
return json_decode($result, true);
} | Extra curl vars for PUT | gocardless_gocardless-legacy-php | train | php |
cf11e229a92d55c4934907d4fdf0244a01fa2937 | diff --git a/lib/veritas/relation/proxy.rb b/lib/veritas/relation/proxy.rb
index <HASH>..<HASH> 100644
--- a/lib/veritas/relation/proxy.rb
+++ b/lib/veritas/relation/proxy.rb
@@ -11,7 +11,7 @@ module Veritas
# Relation methods to proxy
ENUMERABLE_METHODS = Enumerable.public_instance_methods.map(&:to_s).freeze
PROXY_METHODS = %w[ header each empty? ].freeze
- RELATION_METHODS = %w[ take drop sort_by join ].freeze
+ RELATION_METHODS = %w[ take drop sort_by ].freeze
# Hook called when module is included
# | Remove join from the list of Enumerable methods to exclude from proxying
* The latest version of backports (<I>) removes Enumerable#join since it was
removed from Ruby <I> a while ago. Now that this method is no longer added,
this exception is no longer needed. | dkubb_axiom | train | rb |
e1afe5a835423642e3755c46e54405d3dc229c10 | diff --git a/modules/org.opencms.editors/resources/system/workplace/resources/editors/ade/js/cms.toolbar.js b/modules/org.opencms.editors/resources/system/workplace/resources/editors/ade/js/cms.toolbar.js
index <HASH>..<HASH> 100644
--- a/modules/org.opencms.editors/resources/system/workplace/resources/editors/ade/js/cms.toolbar.js
+++ b/modules/org.opencms.editors/resources/system/workplace/resources/editors/ade/js/cms.toolbar.js
@@ -144,7 +144,7 @@
cms.data.deleteResources([elemId], function(ok) {
var elemList = [elemId];
deleteFromFavListAndRecList(elemList);
- $(cms.util.getContainerSelector()).find('.cms-element [rel="' + elemId + '"]').remove();
+ $(cms.util.getContainerSelector()).find('.cms-element[rel="' + elemId + '"]').remove();
for (var key in cms.data.containers) {
cms.move.updateContainer(key);
} | Fixed issue with direct-edit delete. | alkacon_opencms-core | train | js |
6550a1638dc3e8f6c15eb4c9e0aa770803587e58 | diff --git a/apollo-api/src/main/java/com/apollographql/apollo/api/Input.java b/apollo-api/src/main/java/com/apollographql/apollo/api/Input.java
index <HASH>..<HASH> 100644
--- a/apollo-api/src/main/java/com/apollographql/apollo/api/Input.java
+++ b/apollo-api/src/main/java/com/apollographql/apollo/api/Input.java
@@ -11,7 +11,7 @@ import javax.annotation.Nullable;
* @param <V> the type of instance that can be contained
*/
public final class Input<V> {
- public final V value;
+ @Nullable public final V value;
public final boolean defined;
private Input(V value, boolean defined) { | annotate input value as nullable (#<I>) | apollographql_apollo-android | train | java |
16c4d141483f5e10e5901549f895fd71133dff68 | diff --git a/statik/config.py b/statik/config.py
index <HASH>..<HASH> 100644
--- a/statik/config.py
+++ b/statik/config.py
@@ -19,6 +19,7 @@ class StatikConfig(YamlLoadable):
super().__init__(*args, **kwargs)
self.project_name = self.vars.get('project-name', 'Untitled project')
self.base_path = self.vars.get('base-path', '/')
+ self.encoding = self.vars.get('encoding')
# relative to the output folder
self.assets_src_path = self.assets_dest_path = 'assets'
if 'assets' in self.vars and isinstance(self.vars['assets'], dict):
@@ -43,10 +44,11 @@ class StatikConfig(YamlLoadable):
def __repr__(self):
return ("<StatikConfig project_name=%s\n" +
" base_path=%s\n" +
+ " encoding=%s\n" +
" assets_src_path=%s\n" +
" assets_dest_path=%s\n" +
" context_static=%s\n" +
" context_dynamic=%s>") % (
- self.project_name, self.base_path, self.assets_src_path,
+ self.project_name, self.base_path, self.encoding, self.assets_src_path,
self.assets_dest_path, self.context_static, self.context_dynamic
) | added 'encoding' option to config.yml | thanethomson_statik | train | py |
242f8f106216fbaed3ccefd10aa38150144d5d60 | diff --git a/reflections/type/type.js b/reflections/type/type.js
index <HASH>..<HASH> 100644
--- a/reflections/type/type.js
+++ b/reflections/type/type.js
@@ -491,6 +491,7 @@ module.exports = {
},
/**
* @function can-reflect.isPromise isPromise
+ * @parent can-reflect/type
* @description Test if a value is a promise.
*
* @signature `isPromise(obj)` | Add @parent to isPromise docs
I think this method was supposed to be documented, but accidentally wasn’t.
Part of <URL> | canjs_can-reflect | train | js |
236b0499acc167551df9553f7d20e8a5d0c010e0 | diff --git a/setuptools/version.py b/setuptools/version.py
index <HASH>..<HASH> 100644
--- a/setuptools/version.py
+++ b/setuptools/version.py
@@ -1 +1 @@
-__version__ = '20.1.1'
+__version__ = '20.1.2' | Bumped to <I> in preparation for next release. | pypa_setuptools | train | py |
de63ca72a47bb5093820aa6c032862270c3d4fc1 | diff --git a/citrination_client/search/pif/query/core/base_field_operation.py b/citrination_client/search/pif/query/core/base_field_operation.py
index <HASH>..<HASH> 100644
--- a/citrination_client/search/pif/query/core/base_field_operation.py
+++ b/citrination_client/search/pif/query/core/base_field_operation.py
@@ -52,7 +52,7 @@ class BaseFieldOperation(Serializable):
@offset.setter
def offset(self, offset):
- from client.search.pif.query.core.field_operation import FieldOperation
+ from citrination_client.search.pif.query.core.field_operation import FieldOperation
self._offset = self._get_object(FieldOperation, offset)
@offset.deleter
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
setup(name='citrination-client',
- version='1.1.13',
+ version='1.1.14',
url='http://github.com/CitrineInformatics/python-citrination-client',
description='Python client for accessing the Citrination api',
packages=find_packages(), | fix impot bug in base_field_operation v2 | CitrineInformatics_python-citrination-client | train | py,py |
f1e0a8033002c03c36d963f1c499e25b8128c154 | diff --git a/presto-main/src/test/java/com/facebook/presto/block/BlockAssertions.java b/presto-main/src/test/java/com/facebook/presto/block/BlockAssertions.java
index <HASH>..<HASH> 100644
--- a/presto-main/src/test/java/com/facebook/presto/block/BlockAssertions.java
+++ b/presto-main/src/test/java/com/facebook/presto/block/BlockAssertions.java
@@ -115,7 +115,11 @@ public final class BlockAssertions
public static Block createAllNullsBlock(Type type, int positionCount)
{
- return new RunLengthEncodedBlock(type.createBlockBuilder(null, 1).appendNull().build(), positionCount);
+ BlockBuilder blockBuilder = type.createBlockBuilder(null, 1);
+ for (int i = 0; i < positionCount; i++) {
+ blockBuilder.appendNull();
+ }
+ return blockBuilder.build();
}
public static Block createStringsBlock(String... values) | Create normal block with all null positions in createAllNullsBlock
It is somehow not intuitive that the createAllNullsBlock creates an
RLE block. If the RLE block of a null value is needed - it feels like
there should be an explicit method that does that. | prestodb_presto | train | java |
a4a00298e9dcd3bdf7b70c96c8d72296b2dddee2 | diff --git a/tests/Sabre/DAV/Xml/Property/SupportedMethodSetTest.php b/tests/Sabre/DAV/Xml/Property/SupportedMethodSetTest.php
index <HASH>..<HASH> 100644
--- a/tests/Sabre/DAV/Xml/Property/SupportedMethodSetTest.php
+++ b/tests/Sabre/DAV/Xml/Property/SupportedMethodSetTest.php
@@ -52,5 +52,12 @@ class SupportedMethodSetTest extends DAV\AbstractServer {
}
+ function testGetObj() {
+
+ $result = $this->server->getProperties('/', ['{DAV:}supported-method-set']);
+ $this->assertTrue($result['{DAV:}supported-method-set']->has('PROPFIND'));
+
+ }
+
} | Covered supported-method-set. | sabre-io_dav | train | php |
76856b967af1f9d467451b229822b8a03d76e29f | diff --git a/src/structures/interfaces/Application.js b/src/structures/interfaces/Application.js
index <HASH>..<HASH> 100644
--- a/src/structures/interfaces/Application.js
+++ b/src/structures/interfaces/Application.js
@@ -115,7 +115,7 @@ class Application extends Base {
/**
* When concatenated with a string, this automatically returns the application's name instead of the
- * Oauth2Application object.
+ * Application object.
* @returns {?string}
* @example
* // Logs: Application name: My App | docs(Application): rename Oauth2Application to Application (#<I>) | discordjs_discord.js | train | js |
873b028fa457009a6aae40e2a8f68cd6519079c0 | diff --git a/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/TreeFile.java b/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/TreeFile.java
index <HASH>..<HASH> 100644
--- a/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/TreeFile.java
+++ b/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/fs/TreeFile.java
@@ -70,7 +70,7 @@ public class TreeFile extends File
if (fp.isDirectory())
{
String[] ls = fp.list();
- if (ls.length <= 0)
+ if (ls != null && ls.length <= 0)
{
if (res = fp.delete())
{ | EXOJCR-<I>: Check on null in TreeFile class added. | exoplatform_jcr | train | java |
153f5e78490bcb52021f5e0b2da4a3f200fe32f5 | diff --git a/src/article/metadata/FiguresSectionComponent.js b/src/article/metadata/FiguresSectionComponent.js
index <HASH>..<HASH> 100644
--- a/src/article/metadata/FiguresSectionComponent.js
+++ b/src/article/metadata/FiguresSectionComponent.js
@@ -11,7 +11,7 @@ export default class FiguresSectionComponent extends Component {
render ($$) {
const model = this.props.model
const figures = model.getItems()
- let el = $$('div').addClass('sc-collection-editor')
+ let el = $$('div').addClass('sc-figures-section sc-collection-editor')
for (let figure of figures) {
el.append(
$$(FigurePanelsComponent, { model: createValueModel(this.context.api, [figure.id, 'panels']) }).ref(figure.id) | Fulfill the 'sc-' class contract. | substance_texture | train | js |
7ff51acd94dcb574d9b68d42e3c3f08c35b14285 | diff --git a/Tests/Functional/ESDoctrineTestCase.php b/Tests/Functional/ESDoctrineTestCase.php
index <HASH>..<HASH> 100644
--- a/Tests/Functional/ESDoctrineTestCase.php
+++ b/Tests/Functional/ESDoctrineTestCase.php
@@ -58,9 +58,14 @@ abstract class ESDoctrineTestCase extends ElasticsearchTestCase
{
parent::setUp();
+ $baseDir = dirname(dirname(__DIR__));
+ if (basename(dirname(dirname($baseDir))) == 'vendor') {
+ $baseDir = dirname(dirname(dirname($baseDir)));
+ }
+
AnnotationRegistry::registerFile(
- __DIR__ . '/../../' .
- 'vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'
+ $baseDir .
+ '/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'
);
/** @var EntityManager $entityManager */ | Test case now correctly locates DoctrineAnnotations when bundle is in vendor directory. | ongr-archive_ConnectionsBundle | train | php |
03b40faf5c589d16a0a25b4c9a812839a05bd2ab | diff --git a/lib/scoped_search/query_builder.rb b/lib/scoped_search/query_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/scoped_search/query_builder.rb
+++ b/lib/scoped_search/query_builder.rb
@@ -38,7 +38,9 @@ module ScopedSearch
# Initializes the instance by setting the relevant parameters
def initialize(definition, ast, profile)
- @definition, @ast, @definition.profile = definition, ast, profile
+ @definition = definition
+ @ast = ast
+ @definition.profile = profile
end
# Actually builds the find parameters hash that should be used in the search_for | Fix tests on ruby-head
Ruby-head changed behavior of this kind of assignments
@definition, @ast, @definition.profile = definition, ast, profile
With ruby head it "expanded" to
@definition = definition
@ast = ast
nil.profile = profile
and nil.profile was raising a NoMethodError | wvanbergen_scoped_search | train | rb |
a70ff17b1a70f2125f9fd85aa97f713beabfcb40 | diff --git a/rset/rsets/having.go b/rset/rsets/having.go
index <HASH>..<HASH> 100644
--- a/rset/rsets/having.go
+++ b/rset/rsets/having.go
@@ -199,8 +199,8 @@ func (v *havingVisitor) VisitIdent(i *expression.Ident) (expression.Expression,
// select c1 as c2, c2 from t having c2 is ambiguous
// select c1 as c2, c2 from t having c2 + 1 is ambiguous
- // The identifier in having must exist in group by, select list and outer query, so select c1 from t having c2 is wrong,
- // the idenfitier will first try to find the reference in group by, then in select list and finally in outer query.
+ // The identifier in having must exist in group by, select list or outer query, so select c1 from t having c2 is wrong,
+ // the identifier will first try to find the reference in group by, then in select list and finally in outer query.
// Having identifier reference check
// select c1 from t group by c2 having c2, c2 in having references group by c2. | rsets: Address comment. | pingcap_tidb | train | go |
712217c1044714607ac7a8f45cef2b8feee84971 | diff --git a/src/Error/ErrorHandlerTrait.php b/src/Error/ErrorHandlerTrait.php
index <HASH>..<HASH> 100644
--- a/src/Error/ErrorHandlerTrait.php
+++ b/src/Error/ErrorHandlerTrait.php
@@ -21,6 +21,7 @@ use Cake\Http\Exception\UnavailableForLegalReasonsException;
use Cake\Routing\Exception\MissingRouteException;
use Cake\View\Exception\MissingTemplateException;
use Cake\View\Exception\MissingViewException;
+use InvalidArgumentException;
/**
* @property array $_options
@@ -35,6 +36,7 @@ trait ErrorHandlerTrait {
*/
protected static $blacklist = [
InvalidPrimaryKeyException::class,
+ InvalidArgumentException::class,
NotFoundException::class,
MethodNotAllowedException::class,
NotAcceptableException::class, | Add also InvalidArgument to whitelist | dereuromark_cakephp-tools | train | php |
0ac7b74ece7b2d5faccad4b4e72fa8f7a724f875 | diff --git a/lib/vault/client.rb b/lib/vault/client.rb
index <HASH>..<HASH> 100644
--- a/lib/vault/client.rb
+++ b/lib/vault/client.rb
@@ -157,6 +157,9 @@ module Vault
# Turn on SSL
connection.use_ssl = true
+ # Vault requires TLS1.2
+ connection.ssl_version = :TLSv1_2
+
# Turn on secure cookies
cookie.secure = true | Vault requires TLS<I> - make sure we use it | hashicorp_vault-ruby | train | rb |
8593d9c70df732a62f7abfb4ac1548f095ab8275 | diff --git a/govc/version/command.go b/govc/version/command.go
index <HASH>..<HASH> 100644
--- a/govc/version/command.go
+++ b/govc/version/command.go
@@ -24,15 +24,21 @@ import (
"github.com/vmware/govmomi/govc/flags"
)
+var gitVersion string
+
type version struct {
*flags.EmptyFlag
}
func init() {
+ if gitVersion == "" {
+ gitVersion = "unknown"
+ }
+
cli.Register("version", &version{})
}
func (c *version) Run(f *flag.FlagSet) error {
- fmt.Println("govc version 0.0.1-dev")
+ fmt.Printf("govc %s\n", gitVersion)
return nil
} | Add version variable that can be set by the linker | vmware_govmomi | train | go |
34c7c617a2939254ca0baed2aa3f15b757d85c27 | diff --git a/lib/util/indent.js b/lib/util/indent.js
index <HASH>..<HASH> 100644
--- a/lib/util/indent.js
+++ b/lib/util/indent.js
@@ -78,7 +78,7 @@ function sanitize(startToken) {
// we also need to remove any indent that happens after a token that
// isn't a line break
if ( token.type === 'Indent' &&
- ( token.indentLevel == null || !_tk.isBr(token.prev) ) ) {
+ ( token.level == null || !_tk.isBr(token.prev) ) ) {
_tk.remove(token);
}
token = next; | fix indent.sanitize | millermedeiros_esformatter | train | js |
5b17aae1b2ed2f92c796dd76d5f73b061aff969a | diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go
index <HASH>..<HASH> 100644
--- a/cmd/syncthing/main.go
+++ b/cmd/syncthing/main.go
@@ -197,7 +197,7 @@ are mostly useful for developers. Use with care.
"minio" for the github.com/minio/sha256-simd implementation,
and blank (the default) for auto detection.
- STDBCHECKEVERY Set to a time interval to override the default database
+ STRECHECKDBEVERY Set to a time interval to override the default database
check interval of 30 days (720h). The interval understands
"h", "m" and "s" abbreviations for hours minutes and seconds.
Valid values are like "720h", "30s", etc. | cmd/syncthing: Fix help text for STRECHECKDBEVERY (fixes #<I>) | syncthing_syncthing | train | go |
f3d136a77377970921d4e7028c66e4e095af99c0 | diff --git a/scripts/pub_script.py b/scripts/pub_script.py
index <HASH>..<HASH> 100644
--- a/scripts/pub_script.py
+++ b/scripts/pub_script.py
@@ -44,6 +44,10 @@ try:
from .utils import read_yaml_config
except:
from utils import read_yaml_config
+if sys.version_info < (3, 5):
+ from asyncio import async as ensure_future
+else:
+ from asyncio import ensure_future
logger = logging.getLogger(__name__)
@@ -90,6 +94,7 @@ def _get_message(arguments):
@asyncio.coroutine
def do_pub(client, arguments):
+ running_tasks = []
try:
logger.info("%s Connecting to broker" % client.client_id)
@@ -103,7 +108,10 @@ def do_pub(client, arguments):
topic = arguments['-t']
for message in _get_message(arguments):
logger.info("%s Publishing to '%s'" % (client.client_id, topic))
- yield from client.publish(topic, message, qos, arguments['-r'])
+ task = ensure_future(client.publish(topic, message, qos, arguments['-r']))
+ running_tasks.append(task)
+ if running_tasks:
+ yield from asyncio.wait(running_tasks)
yield from client.disconnect()
logger.info("%s Disconnected from broker" % client.client_id)
except KeyboardInterrupt: | Make client.publish calls async | beerfactory_hbmqtt | train | py |
1889600cef56dee46c1b89d732605e3a23dc9557 | diff --git a/pprofile.py b/pprofile.py
index <HASH>..<HASH> 100755
--- a/pprofile.py
+++ b/pprofile.py
@@ -857,7 +857,7 @@ class Profile(ProfileBase, ProfileRunnerBase):
"""
self.total_time += time() - self.enabled_start
self.enabled_start = None
- del self.stack
+ self.stack = None
def disable(self):
"""
@@ -900,7 +900,10 @@ class Profile(ProfileBase, ProfileRunnerBase):
if local_trace is not None:
event_time = time()
callee_entry = [event_time, 0, frame.f_lineno, event_time, 0]
- stack, callee_dict = self.stack
+ try:
+ stack, callee_dict = self.stack
+ except TypeError:
+ return None
try:
caller_entry = stack[-1]
except IndexError:
@@ -916,7 +919,10 @@ class Profile(ProfileBase, ProfileRunnerBase):
def _real_local_trace(self, frame, event, arg):
if event == 'line' or event == 'return':
event_time = time()
- stack, callee_dict = self.stack
+ try:
+ stack, callee_dict = self.stack
+ except TypeError:
+ return None
try:
stack_entry = stack[-1]
except IndexError: | pprofile: Abort tracing when disabled.
Instead of raising an AttributeError.
Also, do not delete self.stack when disabling, to get in a state consistent
with a just-constructed instance. | vpelletier_pprofile | train | py |
74c463092f277171c152c965482e0ad71cd2f88e | diff --git a/presto-main/src/main/java/com/facebook/presto/operator/scalar/JsonOperators.java b/presto-main/src/main/java/com/facebook/presto/operator/scalar/JsonOperators.java
index <HASH>..<HASH> 100644
--- a/presto-main/src/main/java/com/facebook/presto/operator/scalar/JsonOperators.java
+++ b/presto-main/src/main/java/com/facebook/presto/operator/scalar/JsonOperators.java
@@ -18,6 +18,7 @@ import com.facebook.presto.type.SqlType;
import io.airlift.slice.Slice;
import static com.facebook.presto.metadata.OperatorType.EQUAL;
+import static com.facebook.presto.metadata.OperatorType.HASH_CODE;
import static com.facebook.presto.metadata.OperatorType.NOT_EQUAL;
public final class JsonOperators
@@ -26,6 +27,13 @@ public final class JsonOperators
{
}
+ @ScalarOperator(HASH_CODE)
+ @SqlType(StandardTypes.BIGINT)
+ public static long hashCode(@SqlType(StandardTypes.JSON) Slice value)
+ {
+ return value.hashCode();
+ }
+
@ScalarOperator(EQUAL)
@SqlType(StandardTypes.BOOLEAN)
public static boolean equals(@SqlType(StandardTypes.JSON) Slice leftJson, @SqlType(StandardTypes.JSON) Slice rightJson) | Implement HASH_CODE operator for JSON type | prestodb_presto | train | java |
5b1aaad1d8143bd507bb348a76b0a8c3d0e4548b | diff --git a/lib/tugboat/middleware/list_droplets.rb b/lib/tugboat/middleware/list_droplets.rb
index <HASH>..<HASH> 100644
--- a/lib/tugboat/middleware/list_droplets.rb
+++ b/lib/tugboat/middleware/list_droplets.rb
@@ -15,7 +15,7 @@ module Tugboat
private_addr = droplet.networks.v4.detect { |address| address.type == 'private' }
if private_addr
- private_ip = ", privateip: #{private_addr.ip_address}"
+ private_ip = ", private_ip: #{private_addr.ip_address}"
end
if droplet.status == "active" | Changes to private_ip
Keeps in line with the name of the attribute from porcelain | petems_tugboat | train | rb |
c6b306f5f9f290ccfb1cd5ffea6d2a54e91b81fd | diff --git a/tests/iacli/test_ia_metadata.py b/tests/iacli/test_ia_metadata.py
index <HASH>..<HASH> 100644
--- a/tests/iacli/test_ia_metadata.py
+++ b/tests/iacli/test_ia_metadata.py
@@ -26,7 +26,6 @@ def test_ia_metadata_formats():
stdout, stderr = proc.communicate()
test_output_set = set([
"Text",
- "Archive BitTorrent",
"Metadata",
"Unknown",
]) | iacli-test-item<I> no longer has a torrent. Fixed format test. | jjjake_internetarchive | train | py |
d2d121aab24a115559ae348340bf573103a5ee65 | diff --git a/src/discoursegraphs/readwrite/rst/rs3/rs3tree.py b/src/discoursegraphs/readwrite/rst/rs3/rs3tree.py
index <HASH>..<HASH> 100644
--- a/src/discoursegraphs/readwrite/rst/rs3/rs3tree.py
+++ b/src/discoursegraphs/readwrite/rst/rs3/rs3tree.py
@@ -501,6 +501,14 @@ def get_rs3_data(rs3_file, word_wrap=0):
return children, elements, ordered_edus
+def n(children):
+ return ('N', children)
+
+
+def s(children):
+ return ('S', children)
+
+
def n_wrap(tree, debug=False, root_id=None):
root_label = tree.label() | minor: added n() and s() helper functions | arne-cl_discoursegraphs | train | py |
540b1eff7069128df5d95e09968569f2266d9a6a | diff --git a/context.go b/context.go
index <HASH>..<HASH> 100644
--- a/context.go
+++ b/context.go
@@ -987,7 +987,7 @@ func (c *Context) FileFromFS(filepath string, fs http.FileSystem) {
// FileAttachment writes the specified file into the body stream in an efficient way
// On the client side, the file will typically be downloaded with the given filename
func (c *Context) FileAttachment(filepath, filename string) {
- c.Writer.Header().Set("content-disposition", fmt.Sprintf("attachment; filename=\"%s\"", filename))
+ c.Writer.Header().Set("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", filename))
http.ServeFile(c.Writer, c.Request, filepath)
} | update content-disposition header to MIME-style (#<I>) | gin-gonic_gin | train | go |
f2653d40a44515f0830b556c3c5ffab056ceee79 | diff --git a/vector_worker.js b/vector_worker.js
index <HASH>..<HASH> 100644
--- a/vector_worker.js
+++ b/vector_worker.js
@@ -16,6 +16,8 @@ VectorWorker.worker = this;
VectorWorker.tiles = {}; // tiles being loaded by this worker (removed on load)
+GLBuilders.setTileScale(VectorRenderer.tile_scale);
+
// Load tile
VectorWorker.worker.addEventListener('message', function (event) {
if (event.data.type != 'loadTile') { | set tile scale in web worker to fix tile edge detection | tangrams_tangram | train | js |
f267343afa0539f6f15b9ae0361c802dd40ca949 | diff --git a/src/styles/points/points.js b/src/styles/points/points.js
index <HASH>..<HASH> 100755
--- a/src/styles/points/points.js
+++ b/src/styles/points/points.js
@@ -185,7 +185,7 @@ Object.assign(Points, {
// Spacing parameter (in pixels) to equally space points along a line
if (draw.spacing) {
- style.spacing = parseInt(draw.spacing);
+ style.spacing = StyleParser.evalCachedProperty(draw.spacing, context);
}
// Angle parameter (can be a number or the string "auto")
@@ -361,6 +361,9 @@ Object.assign(Points, {
// Repeat rules
draw.repeat_distance = StyleParser.createPropertyCache(draw.repeat_distance || 0, parseFloat);
+ // Spacing
+ draw.spacing = StyleParser.createPropertyCache(draw.spacing || 80, parseFloat);
+
// Optional text styling
draw.text = this.preprocessText(draw.text); // will return null if valid text styling wasn't provided
if (draw.text) { | make point placement spacing able to accept zoom stops or functions
set default placement to <I>px | tangrams_tangram | train | js |
96322222ed6879819cace4b8c27d9542775510cf | diff --git a/src/frontend/org/voltdb/OpsAgent.java b/src/frontend/org/voltdb/OpsAgent.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/OpsAgent.java
+++ b/src/frontend/org/voltdb/OpsAgent.java
@@ -58,7 +58,8 @@ public abstract class OpsAgent
protected static final VoltLogger hostLog = new VoltLogger("HOST");
private static final byte JSON_PAYLOAD = 0;
private static final byte OPS_PAYLOAD = 1;
- private static final int MAX_IN_FLIGHT_REQUESTS = 5;
+ // ENG-5125
+ private static final int MAX_IN_FLIGHT_REQUESTS = 20;
static int OPS_COLLECTION_TIMEOUT = 60 * 1000;
private long m_nextRequestId = 0; | Up max stats pending request. | VoltDB_voltdb | train | java |
fed88290a9658924a257351dbd5851c850ec220f | diff --git a/lib/runner.js b/lib/runner.js
index <HASH>..<HASH> 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -30,6 +30,7 @@ class FailError extends Error {
this.cause = convertError( cause );
this.result = result;
+ this.stack = cause.stack;
}
} | Keep the real stack for error reporters
When the FailError class is used it makes the stack that is reported to test reports the stack where the error is invoked.
This overwrites that stack so error messages are useful. | vandium-io_lambda-tester | train | js |
62f48a7b997a39461bbe67190b7849784bf08ad5 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -26,6 +26,7 @@ try:
except ImportError:
pass
-setuptools.setup(
- setup_requires=['pbr>=1.8'],
- pbr=True)
+setuptools.setup(setup_requires=['pbr>=1.8'],
+ pbr=True,
+ test_suite='test',
+ ) | Enable tests with python setup.py test
and make it flake8-compatible | openSUSE_py2pack | 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.