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
9009a83ae138317a64e2dddb3d3c74e1044dafaa
diff --git a/src/GridFieldOrderableRows.php b/src/GridFieldOrderableRows.php index <HASH>..<HASH> 100755 --- a/src/GridFieldOrderableRows.php +++ b/src/GridFieldOrderableRows.php @@ -531,8 +531,12 @@ class GridFieldOrderableRows extends RequestHandler implements // If not a ManyManyList and using versioning, detect it. $this->validateSortField($list); + $isVersioned = false; $class = $list->dataClass(); - $isVersioned = $class::has_extension(Versioned::class); + + if (DataObject::getSchema()->tableName($class) == $this->getSortTable($list)) { + $isVersioned = $class::has_extension(Versioned::class); + } // Loop through each item, and update the sort values which do not // match to order the objects.
Revert back to previous version check to allow many many version objects to pass through the non-ORM method
symbiote_silverstripe-gridfieldextensions
train
php
11f843e1dfa63efda4eb09c692c4cd35acaf931c
diff --git a/quilt/utils.py b/quilt/utils.py index <HASH>..<HASH> 100644 --- a/quilt/utils.py +++ b/quilt/utils.py @@ -169,7 +169,7 @@ class TmpDirectory(Directory): directory is deleted automatically. """ - def __init__(self, suffix=None, prefix=None, dir=None): + def __init__(self, suffix="", prefix="temp", dir=None): tmp_dir = tempfile.mkdtemp(suffix, prefix, dir) super(TmpDirectory, self).__init__(tmp_dir)
suffix ad prefix can't be None suffix ad prefix can't be None when creating a temporary directoy.
bjoernricks_python-quilt
train
py
63c6326a63c11ecd5422df284ed1786e58f7232c
diff --git a/code/Model/EditableFormField/EditableFileField.php b/code/Model/EditableFormField/EditableFileField.php index <HASH>..<HASH> 100755 --- a/code/Model/EditableFormField/EditableFileField.php +++ b/code/Model/EditableFormField/EditableFileField.php @@ -201,7 +201,7 @@ class EditableFileField extends EditableFormField $field = FileField::create($this->Name, $this->Title ?: false) ->setFieldHolderTemplate(EditableFormField::class . '_holder') ->setTemplate(__CLASS__) - ->setValidator(Injector::inst()->get(Upload_Validator::class . '.userforms')); + ->setValidator(Injector::inst()->get(Upload_Validator::class . '.userforms', false)); $field->setFieldHolderTemplate(EditableFormField::class . '_holder') ->setTemplate(__CLASS__);
FIX MAX_FILE_SIZE of the last EditableFileField
silverstripe_silverstripe-userforms
train
php
e52920b4af94147485bbe2892e9719901c8361b4
diff --git a/rebulk/pattern.py b/rebulk/pattern.py index <HASH>..<HASH> 100644 --- a/rebulk/pattern.py +++ b/rebulk/pattern.py @@ -110,9 +110,10 @@ class Pattern(object): :rtype: """ if yield_parent or self.format_all: - match.formatter = self.formatters.get(match.name, self._default_formatter) + match.formatter = self.formatters.get(match.name, + self.formatters.get('__parent__', self._default_formatter)) if yield_parent or self.validate_all: - validator = self.validators.get(match.name, self._default_validator) + validator = self.validators.get(match.name, self.validators.get('__parent__', self._default_validator)) if not validator(match): return False return True @@ -128,9 +129,10 @@ class Pattern(object): :rtype: """ if yield_children or self.format_all: - child.formatter = self.formatters.get(child.name, self._default_formatter) + child.formatter = self.formatters.get(child.name, + self.formatters.get('__children__', self._default_formatter)) if yield_children or self.validate_all: - validator = self.validators.get(child.name, self._default_validator) + validator = self.validators.get(child.name, self.validators.get('__children__', self._default_validator)) if not validator(child): return False return True
Add __parent__ and __children__ magic keys for validator and formatters
Toilal_rebulk
train
py
c3099b840db190b47ad5ed127a3caf745e2f9c23
diff --git a/tensorflow_probability/python/math/psd_kernels/rational_quadratic.py b/tensorflow_probability/python/math/psd_kernels/rational_quadratic.py index <HASH>..<HASH> 100644 --- a/tensorflow_probability/python/math/psd_kernels/rational_quadratic.py +++ b/tensorflow_probability/python/math/psd_kernels/rational_quadratic.py @@ -70,7 +70,7 @@ class RationalQuadratic(PositiveSemidefiniteKernel): representation of the Matern class with applications in state space approximations and Bayesian quadrature. In _28th IEEE International Workshop on Machine Learning for Signal Processing_, 2018. - https://users.aalto.fi/~karvont2/pdf/TronarpKarvonenSarkka2018-MLSP.pdf + https://acris.aalto.fi/ws/portalfiles/portal/30548539/ELEC_Tronarp_etal_Mixture_Presentation_of_the_Matern_MLSP2018.pdf """ def __init__(
Update rational_quadratic.py Updated broken link do the paper.
tensorflow_probability
train
py
c98ddcf1ae7d6c542011fe6cb6abf7bb833b99ae
diff --git a/node_modules/generator-xtc/app/templates/_controllers/index.js b/node_modules/generator-xtc/app/templates/_controllers/index.js index <HASH>..<HASH> 100644 --- a/node_modules/generator-xtc/app/templates/_controllers/index.js +++ b/node_modules/generator-xtc/app/templates/_controllers/index.js @@ -10,7 +10,7 @@ module.exports = function(app) { // render home.hbs and include it in the default layout (defined in config.js) home: function(req, res, next) { - res.render('home'); + res.render('home', {}); } } };
Add an empty obj to res.render as a hint that data can be passed to the view.
MarcDiethelm_xtc
train
js
a6a8706af18a9ea02fc281d6b6b8d3855e21c312
diff --git a/src/engine/test/Tester.js b/src/engine/test/Tester.js index <HASH>..<HASH> 100644 --- a/src/engine/test/Tester.js +++ b/src/engine/test/Tester.js @@ -177,13 +177,16 @@ function Tester(engine) { }); }); - engine.run(); - - return Promise.resolve({ - success: passedExpectations === totalExpectations, - passed: passedExpectations, - total: totalExpectations, - errors: errors + return new Promise((resolve) => { + engine.on('done', () => { + resolve({ + success: passedExpectations === totalExpectations, + passed: passedExpectations, + total: totalExpectations, + errors: errors + }); + }); + engine.run(); }); }); };
update promise to resolve only when engine is done
lps-js_lps.js
train
js
7dd80d68e509134cb0f821142b6b3ec46262a5a4
diff --git a/activesupport/lib/active_support/core_ext/string/access.rb b/activesupport/lib/active_support/core_ext/string/access.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/core_ext/string/access.rb +++ b/activesupport/lib/active_support/core_ext/string/access.rb @@ -1,5 +1,3 @@ -require 'active_support/multibyte' - class String # If you pass a single Fixnum, returns a substring of one character at that # position. The first character of the string is at position 0, the next at diff --git a/activesupport/lib/active_support/core_ext/string/filters.rb b/activesupport/lib/active_support/core_ext/string/filters.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/core_ext/string/filters.rb +++ b/activesupport/lib/active_support/core_ext/string/filters.rb @@ -1,5 +1,3 @@ -require 'active_support/core_ext/string/multibyte' - class String # Returns the string, first removing all whitespace on both ends of # the string, and then changing remaining consecutive whitespace
remove unnecessary require AS::Multibyte are no longer required by access and filters string core extensions.
rails_rails
train
rb,rb
5997e99aa0ff6ef770b4d9a160db0098fd68f299
diff --git a/server/sonar-web/src/main/js/apps/issues/workspace-home-view.js b/server/sonar-web/src/main/js/apps/issues/workspace-home-view.js index <HASH>..<HASH> 100644 --- a/server/sonar-web/src/main/js/apps/issues/workspace-home-view.js +++ b/server/sonar-web/src/main/js/apps/issues/workspace-home-view.js @@ -127,6 +127,10 @@ define([ this.$('[data-toggle="tooltip"]').tooltip({ container: 'body' }); }, + onDestroy: function () { + this.$('[data-toggle="tooltip"]').tooltip('destroy'); + }, + selectBar: function (e) { var periodStart = $(e.currentTarget).data('period-start'), periodEnd = $(e.currentTarget).data('period-end');
fix tooltips on issues home page
SonarSource_sonarqube
train
js
369bf6ec14b76f1b7089e922e440ed950e74d810
diff --git a/addon/utils/general.js b/addon/utils/general.js index <HASH>..<HASH> 100644 --- a/addon/utils/general.js +++ b/addon/utils/general.js @@ -1,7 +1,7 @@ // converts slash paths to dot paths so nested hash values can be fetched with Ember.get // foo/bar/baz -> foo.bar.baz export function dottify(path) { - return (path || '').replace(/\//g, '.'); + return (path || '').replace(/^\//g, '').replace(/\//g, '.'); } // maybe this should be a component with tagName: 'svg' and strip the outer <svg> tag diff --git a/tests/unit/utils/general-test.js b/tests/unit/utils/general-test.js index <HASH>..<HASH> 100644 --- a/tests/unit/utils/general-test.js +++ b/tests/unit/utils/general-test.js @@ -11,6 +11,10 @@ test('replaces slashes with dots', function(assert) { assert.equal(dottify("foo/bar/baz"), "foo.bar.baz"); }); +test('removes leading slashes before replacing slashes with dots', function(assert) { + assert.equal(dottify("/foo/bar/baz"), "foo.bar.baz"); +}); + module('utils: applyClass'); test('adds class to svg element', function(assert) {
remove any leading slashes from paths before dottify-ing
minutebase_ember-inline-svg
train
js,js
ba7fd2e1b428b2b76378aa90d0a19e8ec0d12498
diff --git a/lib/utils/telemetry/areDisabled.js b/lib/utils/telemetry/areDisabled.js index <HASH>..<HASH> 100644 --- a/lib/utils/telemetry/areDisabled.js +++ b/lib/utils/telemetry/areDisabled.js @@ -2,4 +2,8 @@ const configUtils = require('@serverless/utils/config'); -module.exports = Boolean(process.env.SLS_TRACKING_DISABLED || configUtils.get('trackingDisabled')); +module.exports = Boolean( + process.env.SLS_TELEMETRY_DISABLED || + process.env.SLS_TRACKING_DISABLED || + configUtils.get('trackingDisabled') +);
feat(Telemetry): Allow to disable telemetry via `SLS_TELEMETRY_DISABLED`
serverless_serverless
train
js
ce956056fbf1c8eca82f59cfac98e2aa1225ca25
diff --git a/DatabaseManager.php b/DatabaseManager.php index <HASH>..<HASH> 100644 --- a/DatabaseManager.php +++ b/DatabaseManager.php @@ -84,7 +84,7 @@ class DatabaseManager implements ConnectionResolverInterface { return call_user_func($this->extensions[$name], $config); } - return $this->factory->make($this->getConfig($name)); + return $this->factory->make($config); } /**
Multiple calls to `DatabaseManager::getConfig`
illuminate_database
train
php
41ed07d534f4c437815e7a29f8a9bfa4d29a70d1
diff --git a/mintapi/api.py b/mintapi/api.py index <HASH>..<HASH> 100644 --- a/mintapi/api.py +++ b/mintapi/api.py @@ -1331,5 +1331,6 @@ def main(): with open(options.filename, 'w+') as f: f.write(attention_msg) + if __name__ == '__main__': main()
added blank line to make flake happy
mrooney_mintapi
train
py
cbd5142a6ebf7e5bb6da157212d7f771b11d4de2
diff --git a/src/main/java/tachyon/web/WebInterfaceBrowseServlet.java b/src/main/java/tachyon/web/WebInterfaceBrowseServlet.java index <HASH>..<HASH> 100644 --- a/src/main/java/tachyon/web/WebInterfaceBrowseServlet.java +++ b/src/main/java/tachyon/web/WebInterfaceBrowseServlet.java @@ -208,21 +208,19 @@ public class WebInterfaceBrowseServlet extends HttpServlet { if (tFile == null) { throw new FileDoesNotExistException(path); } - - InStream is = tFile.getInStream(ReadType.NO_CACHE); - int len = Math.min(5 * Constants.KB, (int) tFile.length()); - if (len > 0) { + if (tFile.isComplete()) { + InStream is = tFile.getInStream(ReadType.NO_CACHE); + int len = Math.min(5 * Constants.KB, (int) tFile.length()); byte[] data = new byte[len]; is.read(data, 0, len); fileData = CommonUtils.convertByteArrayToString(data); if (fileData == null) { fileData = "The requested file is not completely encoded in ascii"; } + is.close(); } else { - fileData = "The requested file has not finished initializing."; + fileData = "The requested file is not complete yet."; } - is.close(); - try { tachyonClient.close(); } catch (TException e) {
Use isComplete to check if file is valid instead of explicity checking length
Alluxio_alluxio
train
java
6ffda92ef783f12860b906dccb1764a7fc229480
diff --git a/src/ngn.js b/src/ngn.js index <HASH>..<HASH> 100644 --- a/src/ngn.js +++ b/src/ngn.js @@ -6,6 +6,8 @@ import Core from './class.js' import Middleware from './middleware.js' import { defineException, stack } from './exception.js' import EventEmitter from './emitter/emitter.js' +import Relationship from './relationships/relationship.js' +import Relationships from './relationships/manager.js' // The NGN namespace. const NGN = Object.defineProperties({}, Object.assign({}, base, type)) @@ -45,6 +47,8 @@ Object.defineProperties(NGN, { Class: NGN.public(Core), Middleware: NGN.public(Middleware), EventEmitter: NGN.public(EventEmitter), + Relationships: NGN.public(Relationships), + Relationship: NGN.public(Relationship), // Plugin access plugins: NGN.constant(internal.plugins) diff --git a/tests/01-sanity.js b/tests/01-sanity.js index <HASH>..<HASH> 100644 --- a/tests/01-sanity.js +++ b/tests/01-sanity.js @@ -45,6 +45,8 @@ test('Method Existence', t => { 'Class', 'Middleware', 'EventEmitter', + 'Relationships', + 'Relationship', // Extras 'version',
Expose Relationships (manager) and Relationship class.
ngnjs_NGN
train
js,js
3680a4781d65d06af649cd9724daf424ea5d5ca8
diff --git a/framework/yii/db/QueryBuilder.php b/framework/yii/db/QueryBuilder.php index <HASH>..<HASH> 100644 --- a/framework/yii/db/QueryBuilder.php +++ b/framework/yii/db/QueryBuilder.php @@ -478,7 +478,7 @@ class QueryBuilder extends \yii\base\Object { if (isset($this->typeMap[$type])) { return $this->typeMap[$type]; - } elseif ((preg_match('/^(\w+)\((.+?)\)(.*)$/', $type, $matches))) { + } elseif (preg_match('/^(\w+)\((.+?)\)(.*)$/', $type, $matches)) { if (isset($this->typeMap[$matches[1]])) { return preg_replace('/\(.+\)/', '(' . $matches[2] . ')', $this->typeMap[$matches[1]]) . $matches[3]; }
removed unneccessary brackets
yiisoft_yii2-debug
train
php
64af14afb6429592517b7c74a2ff539ad4940408
diff --git a/src/com/google/javascript/jscomp/AstValidator.java b/src/com/google/javascript/jscomp/AstValidator.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/AstValidator.java +++ b/src/com/google/javascript/jscomp/AstValidator.java @@ -55,7 +55,7 @@ public final class AstValidator implements CompilerPass { private boolean isTypeValidationEnabled = false; /** Validate that a SCRIPT's FeatureSet property includes all features if this is enabled. */ - private boolean isScriptFeatureValidationEnabled; + private final boolean isScriptFeatureValidationEnabled; public AstValidator( AbstractCompiler compiler, ViolationHandler handler, boolean validateScriptFeatures) {
Make effectively-final field explicitly final ------------- Created by MOE: <URL>
google_closure-compiler
train
java
27f8586d64575e0e6654b3cf52529e9098112008
diff --git a/pt/validation.php b/pt/validation.php index <HASH>..<HASH> 100644 --- a/pt/validation.php +++ b/pt/validation.php @@ -27,7 +27,7 @@ return array( "string" => "O campo :attribute deverá conter entre :min - :max caracteres.", "array" => "O campo :attribute deverá conter entre :min - :max elementos." ), - "boolean" => "The :attribute field must be true or false", + "boolean" => "O campo :attribute deverá conter o valor true ou false", "confirmed" => "A confirmação para o campo :attribute não coincide.", "date" => "O campo :attribute não contém uma data válida.", "date_format" => "A data indicada para o campo :attribute não respeita o formato :format.",
Update boolean validation Update boolean validation to portuguese
caouecs_Laravel-lang
train
php
391ce7362fdf1d1972b65dec72f7d185f0de58b1
diff --git a/asyncpg/connect_utils.py b/asyncpg/connect_utils.py index <HASH>..<HASH> 100644 --- a/asyncpg/connect_utils.py +++ b/asyncpg/connect_utils.py @@ -610,7 +610,9 @@ async def _negotiate_ssl_connection(host, port, conn_factory, *, loop, ssl, sock = sock.dup() # Must come before tr.close() finally: - tr.close() + writer.close() + if hasattr(writer, 'wait_closed'): + await writer.wait_closed() try: return await conn_factory(sock=sock) # Must come after tr.close() diff --git a/asyncpg/connection.py b/asyncpg/connection.py index <HASH>..<HASH> 100644 --- a/asyncpg/connection.py +++ b/asyncpg/connection.py @@ -1223,6 +1223,8 @@ class Connection(metaclass=ConnectionMeta): waiter.set_result(None) if w is not None: w.close() + if hasattr(w, 'wait_closed'): + await w.wait_closed() def _cancel_current_command(self, waiter): self._cancellations.add(self._loop.create_task(self._cancel(waiter)))
Close asyncio.Streams explicitly (do not rely on GC)
MagicStack_asyncpg
train
py,py
e954866d4955fd99a0f9c6c11d331028a1499092
diff --git a/examples/lib/chatterbox/exception_notification/presenter_example.rb b/examples/lib/chatterbox/exception_notification/presenter_example.rb index <HASH>..<HASH> 100644 --- a/examples/lib/chatterbox/exception_notification/presenter_example.rb +++ b/examples/lib/chatterbox/exception_notification/presenter_example.rb @@ -25,8 +25,8 @@ PATH: /usr/bin Ruby Info ---------- -:ruby_version: 1.8.6 :ruby_platform: darwin +:ruby_version: 1.8.6 EOL presenter.body.strip.should == expected.strip end diff --git a/lib/chatterbox/exception_notification/presenter.rb b/lib/chatterbox/exception_notification/presenter.rb index <HASH>..<HASH> 100644 --- a/lib/chatterbox/exception_notification/presenter.rb +++ b/lib/chatterbox/exception_notification/presenter.rb @@ -49,7 +49,7 @@ module Chatterbox::ExceptionNotification def inspect_value(value) len = 512 result = object_to_yaml(value).rstrip - result = result[0, len] + "... (#{result.length-len} bytes more)" if result.length > len+20 + result = result[0, len] + "... (#{result.length-len} bytes more)" if result.length > len + 20 result end
Switch order of platform/version to satisfy spec
rsanheim_chatterbox
train
rb,rb
2d11a28e4ef20b9d8c534e1152de98b4fabc1d55
diff --git a/lib/gruff/base.rb b/lib/gruff/base.rb index <HASH>..<HASH> 100644 --- a/lib/gruff/base.rb +++ b/lib/gruff/base.rb @@ -19,9 +19,6 @@ require 'bigdecimal' module Gruff class Base - # Draw extra lines showing where the margins and text centers are - DEBUG = false - # Space around text elements. Mostly used for vertical spacing LEGEND_MARGIN = TITLE_MARGIN = 20.0 LABEL_MARGIN = 10.0 @@ -804,18 +801,6 @@ module Gruff private - # Takes a block and draws it if DEBUG is true. - # - # Example: - # debug { @d.rectangle x1, y1, x2, y2 } - def debug - if DEBUG - @d.fill 'transparent' - @d.stroke 'turquoise' - yield - end - end - # Return a formatted string representing a number value that should be # printed as a label. def label(value, increment)
refactor: Remove unused debug method (#<I>)
topfunky_gruff
train
rb
adcf2e37366a3c01345eb0a5ac358f97b35d365e
diff --git a/generators/clearance/clearance_generator.rb b/generators/clearance/clearance_generator.rb index <HASH>..<HASH> 100644 --- a/generators/clearance/clearance_generator.rb +++ b/generators/clearance/clearance_generator.rb @@ -9,8 +9,13 @@ class ClearanceGenerator < Rails::Generator::Base m.insert_into "app/controllers/application_controller.rb", "include Clearance::Authentication" - m.directory File.join("app", "models") - m.file "user.rb", "app/models/user.rb" + user_model = "app/models/user.rb" + if File.exists?(user_model) + m.insert_into user_model, "include Clearance::User" + else + m.directory File.join("app", "models") + m.file "user.rb", user_model + end m.directory File.join("test", "factories") m.file "factories.rb", "test/factories/clearance.rb"
Inserting Clearance::User into the user model if it exists [#<I> state:resolved]
thoughtbot_clearance
train
rb
1f62319533aab1f22f608134afe358487319c224
diff --git a/lib/autoprefixer-rails/processor.rb b/lib/autoprefixer-rails/processor.rb index <HASH>..<HASH> 100644 --- a/lib/autoprefixer-rails/processor.rb +++ b/lib/autoprefixer-rails/processor.rb @@ -63,7 +63,7 @@ module AutoprefixerRails .map(&:strip) .reject(&:empty?) .each do |line| - if IS_SECTION.match?(line) + if IS_SECTION =~ line current = line.match(IS_SECTION)[1].strip sections[current] ||= [] else @@ -108,7 +108,7 @@ module AutoprefixerRails converted = {} opts.each_pair do |name, value| - if /_/.match?(name) + if /_/ =~ name name = name.to_s.gsub(/_\w/) { |i| i.delete("_").upcase }.to_sym end value = convert_options(value) if value.is_a? Hash
Convert from match? to match to support rubies < <I> (#<I>) * Convert from match? to match to support rubies < <I> * Different syntax
ai_autoprefixer-rails
train
rb
8fea5a9627bd862a3a67b22a44b24a9c88caec59
diff --git a/lib/bcsec/rack/session_timer.rb b/lib/bcsec/rack/session_timer.rb index <HASH>..<HASH> 100644 --- a/lib/bcsec/rack/session_timer.rb +++ b/lib/bcsec/rack/session_timer.rb @@ -73,10 +73,7 @@ module Bcsec::Rack return @app.call(env) unless previous_timeout - window = (previous_timeout...previous_timeout + window_size) - - - if window.include?(now) + if now < previous_timeout + window_size @app.call(env) else Rack::Response.new { |r| r.redirect('/logout') }
Ranges aren't necessary. #<I>. Although the timeout window is technically defined as [last timeout, last timeout + timeout window length) we can assume that Time.now is monotonically increasing and therefore don't need to worry about the lower end.
NUBIC_aker
train
rb
2d0d136930a7348663d61115a90ac1dbaff1505d
diff --git a/lib/ProMotion/table/table_builder.rb b/lib/ProMotion/table/table_builder.rb index <HASH>..<HASH> 100644 --- a/lib/ProMotion/table/table_builder.rb +++ b/lib/ProMotion/table/table_builder.rb @@ -4,7 +4,7 @@ module ProMotion return mp("Action not implemented: #{action.to_s}", force_color: :green) unless self.respond_to?(action) case self.method(action).arity when 0 then self.send(action) # Just call the method - when 2 then self.send(action, arguments, index_path) # Send arguments and index path + when -2 then self.send(action, arguments, index_path) # Send arguments and index path else self.send(action, arguments) # Send arguments end end
Update table_builder.rb Fixes problem of `self.method(action).arity` case with `-2` value instead of `2`. `self.method(action).arity` returns less then zero value if the action has at least one parameter. Checked on: ``` # RubyMotion version motion --version <I> # Ruby version ruby -v ruby <I>p<I> ```
infinitered_ProMotion
train
rb
a6d3cffe959247f765b17fffdfbe00701408cd1f
diff --git a/code/libraries/koowa/database/row/table.php b/code/libraries/koowa/database/row/table.php index <HASH>..<HASH> 100644 --- a/code/libraries/koowa/database/row/table.php +++ b/code/libraries/koowa/database/row/table.php @@ -242,7 +242,7 @@ class KDatabaseRowTable extends KDatabaseRowAbstract */ public function reset() { - $result = false; + $result = parent::reset(); if($this->isConnected()) {
The reset() function should call it's parent.
joomlatools_joomlatools-framework
train
php
f2592448636bc35b7f9ec0fdc48b92135ba9852f
diff --git a/pkg/apis/workflow/v1alpha1/workflow_types.go b/pkg/apis/workflow/v1alpha1/workflow_types.go index <HASH>..<HASH> 100644 --- a/pkg/apis/workflow/v1alpha1/workflow_types.go +++ b/pkg/apis/workflow/v1alpha1/workflow_types.go @@ -243,9 +243,7 @@ func (p *ParallelSteps) UnmarshalJSON(value []byte) error { } func (p *ParallelSteps) MarshalJSON() ([]byte, error) { - fmt.Println(p.Steps) return json.Marshal(p.Steps) - } func (wfs *WorkflowSpec) HasPodSpecPatch() bool {
Removed uneccessary debug Println (#<I>)
argoproj_argo
train
go
268de7b1428f3c415a617b54046cabc848a01855
diff --git a/converters/toZigbee.js b/converters/toZigbee.js index <HASH>..<HASH> 100644 --- a/converters/toZigbee.js +++ b/converters/toZigbee.js @@ -1,4 +1,4 @@ -"use strict"; +'use strict'; const converters = { onoff: {
Update toZigbee.js
Koenkk_zigbee-shepherd-converters
train
js
9921d2aef38c8179d78dd2b32750c5d207e465dd
diff --git a/lib/discovery_delegate.js b/lib/discovery_delegate.js index <HASH>..<HASH> 100644 --- a/lib/discovery_delegate.js +++ b/lib/discovery_delegate.js @@ -18,6 +18,11 @@ const ip = require('ip'); // because JS does not have interfaces or multiple inheritance module.exports = class DiscoveryDelegate { + // offer the user a device as a choice from discovery + deviceFound(device) { + throw new Error('Not Implemented'); + } + // ask the user to click an oauth link // returns undefined askOAuth() {
Add deviceFound() method to DiscoveryDelegate
stanford-oval_thingpedia-api
train
js
e83c1996d45d560cdb85939bae572219b8439f6d
diff --git a/pcat_interface.py b/pcat_interface.py index <HASH>..<HASH> 100644 --- a/pcat_interface.py +++ b/pcat_interface.py @@ -42,6 +42,6 @@ def pcat(star_matrix, degree=7): reconstruction_matrix = pca_reconstruction(eigenvectors, principle_scores) std_x, x_mean, x_std = standardize(star_matrix) reconstruction_matrix = unstandardize(reconstruction_matrix, x_mean, x_std) - for f in ["data", "pcat.f", "pcat"]: + for f in ["pcat.f", "pcat"]: os.remove(f) return eigenvectors, principle_scores, reconstruction_matrix diff --git a/plotypus.py b/plotypus.py index <HASH>..<HASH> 100644 --- a/plotypus.py +++ b/plotypus.py @@ -44,7 +44,7 @@ def main(): matshow(pca_input_matrix, cmap=cm.gray) savefig("matrix_full.png") clf() - matshow(pca_input_matrix, fignum=100, cmap=cm.gray) + matshow(pca_input_matrix[:100,:], cmap=cm.gray) savefig("matrix_part.png") if (options.PCA_degree): pca_input_matrix = lightcurve_matrix(stars, options.evaluator)
messing things up. this will be undone
astroswego_plotypus
train
py,py
57604c86cd3d4d4dadb935a0d755535afa37918c
diff --git a/json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java b/json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java index <HASH>..<HASH> 100644 --- a/json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java +++ b/json-path/src/main/java/com/jayway/jsonpath/internal/path/PathCompiler.java @@ -484,7 +484,8 @@ public class PathCompiler { if (inBracket) { int wildCardIndex = path.indexOfNextSignificantChar(WILDCARD); if (!path.nextSignificantCharIs(wildCardIndex, CLOSE_SQUARE_BRACKET)) { - throw new InvalidPathException("Expected wildcard token to end with ']' on position " + wildCardIndex + 1); + int offset = wildCardIndex + 1; + throw new InvalidPathException("Expected wildcard token to end with ']' on position " + offset); } int bracketCloseIndex = path.indexOfNextSignificantChar(wildCardIndex, CLOSE_SQUARE_BRACKET); path.setPosition(bracketCloseIndex + 1);
Fixes #<I>: To report correct index of invalid jsonpath failure. This should add 1 to the position instead of appending 1 to its text value.
json-path_JsonPath
train
java
c4a98145a020df4ff00f0dcc728effdb3626da92
diff --git a/docroot/modules/custom/ymca_blog_listing/src/Controller/YMCANewsEventsPageController.php b/docroot/modules/custom/ymca_blog_listing/src/Controller/YMCANewsEventsPageController.php index <HASH>..<HASH> 100644 --- a/docroot/modules/custom/ymca_blog_listing/src/Controller/YMCANewsEventsPageController.php +++ b/docroot/modules/custom/ymca_blog_listing/src/Controller/YMCANewsEventsPageController.php @@ -45,7 +45,8 @@ class YMCANewsEventsPageController extends ControllerBase { $node_storage = \Drupal::entityManager()->getStorage('node'); $nodes = $node_storage->loadMultiple($nids); foreach ($nodes as $node) { - $output['#markup'] .= render(node_view($node, 'location_blog_teaser')); + $node_view = node_view($node, 'location_blog_teaser'); + $output['#markup'] .= render($node_view); } } break;
[YMCA-<I>] replace blog listing with new logic
ymcatwincities_openy
train
php
f90d66356498eb51f272102f98be829a8b935374
diff --git a/tests/server_conf.py b/tests/server_conf.py index <HASH>..<HASH> 100644 --- a/tests/server_conf.py +++ b/tests/server_conf.py @@ -19,8 +19,8 @@ CONFIG = { "debug": 1, "key_file": full_path("test.key"), "cert_file": full_path("test.pem"), - "encryption_keypairs": [{"key_file": "test_1.key", "cert_file": "test_1.crt"}, - {"key_file": "test_2.key", "cert_file": "test_2.crt"}], + "encryption_keypairs": [{"key_file": full_path("test_1.key"), "cert_file": full_path("test_1.crt")}, + {"key_file": full_path("test_2.key"), "cert_file": full_path("test_2.crt")}], "ca_certs": full_path("cacerts.txt"), "xmlsec_binary": xmlsec_path, "metadata": [{
Added fullpath for keys and certs to hopefully make travis work.
IdentityPython_pysaml2
train
py
c5fb48176e1d342fe2efdfb30733373ef2927050
diff --git a/remix-debug/src/cmdline/index.js b/remix-debug/src/cmdline/index.js index <HASH>..<HASH> 100644 --- a/remix-debug/src/cmdline/index.js +++ b/remix-debug/src/cmdline/index.js @@ -130,6 +130,14 @@ class CmdLine { this.debugger.step_manager.stepIntoBack(solidityMode) } + jumpTo(step) { + this.debugger.step_manager.jumpTo(step) + } + + getTraceLength() { + return this.debugger.step_manager.traceLength + } + currentStep() { return this.debugger.step_manager.currentStepIndex }
add jumpto and get trace length steps
ethereum_remix
train
js
1de47b8f86fc5bb51c39c113163f1ad264498e1a
diff --git a/pghoard/rohmu/object_storage/google.py b/pghoard/rohmu/object_storage/google.py index <HASH>..<HASH> 100644 --- a/pghoard/rohmu/object_storage/google.py +++ b/pghoard/rohmu/object_storage/google.py @@ -139,7 +139,7 @@ class GoogleTransfer(BaseTransfer): while True: try: return action() - except (IncompleteRead, HttpError, ssl.SSLEOFError, socket.timeout, OSError) as ex: + except (IncompleteRead, HttpError, ssl.SSLEOFError, socket.timeout, OSError, socket.gaierror) as ex: # Note that socket.timeout and ssl.SSLEOFError inherit from OSError # and the order of handling the errors here needs to be correct if not retries: @@ -155,6 +155,9 @@ class GoogleTransfer(BaseTransfer): # httplib2 commonly fails with Bad File Descriptor and Connection Reset elif isinstance(ex, OSError) and ex.errno not in [errno.EBADF, errno.ECONNRESET]: raise + # getaddrinfo sometimes fails with "Name or service not known" + elif isinstance(ex, socket.gaierror) and ex.errno != socket.EAI_NONAME: + raise self.log.warning("%s failed: %s (%s), retrying in %.2fs", action, ex.__class__.__name__, ex, retry_wait)
rohmu: retry on failed getaddrinfo
aiven_pghoard
train
py
da8e2a7d915774074a6fc383b285721ecd029fab
diff --git a/src/Web/Controller/TaskRunnerController.php b/src/Web/Controller/TaskRunnerController.php index <HASH>..<HASH> 100644 --- a/src/Web/Controller/TaskRunnerController.php +++ b/src/Web/Controller/TaskRunnerController.php @@ -175,9 +175,16 @@ class TaskRunnerController extends AbstractRestrictedController */ private function spawn(Task $task) { + $phpCli = 'php'; + $config = $this->getTenside()->getConfigSource(); + if ($config->has('php-cli')) { + $phpCli = $config->get('php-cli'); + } + $cmd = sprintf( - '%s %s', - escapeshellcmd($this->getTenside()->getCliExecutable()), + '%s %s %s', + escapeshellcmd($phpCli), + escapeshellarg($this->getTenside()->getCliExecutable()), escapeshellarg($task->getId()) );
Provide support to override the php cli executable
tenside_core
train
php
3de48a29f0e13b418ea90ed11e7e2feabe619663
diff --git a/planet/models.py b/planet/models.py index <HASH>..<HASH> 100644 --- a/planet/models.py +++ b/planet/models.py @@ -24,7 +24,6 @@ import string import httpx from tqdm.asyncio import tqdm - LOGGER = logging.getLogger(__name__) @@ -174,6 +173,7 @@ class StreamingBody(): async def write(self, filename, overwrite=True, progress_bar=True): '''Write the body to a file. + :param filename: Name to assign to downloaded file. :type filename: str :param overwrite: Overwrite any existing files. Defaults to True
revert blank line changes to models.py
planetlabs_planet-client-python
train
py
eb1861983aa930e55453a38a0413755b678a7e3e
diff --git a/theme/font.php b/theme/font.php index <HASH>..<HASH> 100644 --- a/theme/font.php +++ b/theme/font.php @@ -57,7 +57,11 @@ if (empty($component) or $component === 'moodle' or $component === 'core') { $component = 'core'; } -if (preg_match('/^[a-z0-9_-]+\.woff$/i', $font, $matches)) { +if (preg_match('/^[a-z0-9_-]+\.woff2$/i', $font, $matches)) { + $font = $matches[0]; + $mimetype = 'application/font-woff2'; + +} else if (preg_match('/^[a-z0-9_-]+\.woff$/i', $font, $matches)) { // This is the real standard! $font = $matches[0]; $mimetype = 'application/font-woff';
MDL-<I> themes: WOFF2 fonts are not supported.
moodle_moodle
train
php
2296f5d45904e1277f78bb8b51b114a1c80bf5e4
diff --git a/daemon/daemonbuilder/pod.go b/daemon/daemonbuilder/pod.go index <HASH>..<HASH> 100644 --- a/daemon/daemonbuilder/pod.go +++ b/daemon/daemonbuilder/pod.go @@ -13,6 +13,7 @@ import ( "github.com/docker/docker/pkg/archive" "github.com/docker/docker/pkg/chrootarchive" "github.com/docker/docker/pkg/idtools" + "github.com/docker/docker/pkg/ioutils" "github.com/docker/engine-api/types" containertypes "github.com/docker/engine-api/types/container" "github.com/golang/glog" @@ -24,9 +25,8 @@ import ( // ContainerAttach attaches streams to the container cID. If stream is true, it streams the output. func (d Docker) ContainerAttach(cId string, stdin io.ReadCloser, stdout, stderr io.Writer, stream bool) error { - return nil tag := pod.RandStr(8, "alphanum") - return d.Daemon.Attach(stdin, stdout.(io.WriteCloser), "container", cId, tag) + return d.Daemon.Attach(stdin, ioutils.NopWriteCloser(stdout), "container", cId, tag) } func (d Docker) Commit(cId string, cfg *types.ContainerCommitConfig) (string, error) {
fix ContainerAttach in daemonbuilder
hyperhq_hyperd
train
go
ab4592a84a88cb3ebcc91092cfcacd3553e32d3c
diff --git a/Assets/ImageManipulation.php b/Assets/ImageManipulation.php index <HASH>..<HASH> 100644 --- a/Assets/ImageManipulation.php +++ b/Assets/ImageManipulation.php @@ -159,7 +159,7 @@ trait ImageManipulation { * @config * @var int */ - private static $asset_preview_width = 400; + private static $asset_preview_width = 930; // max for mobile full-width /** * The height of an image preview in the Asset section
adjust max width of file to expand over max allowable width if thin
silverstripe_silverstripe-framework
train
php
1e6702b55a7afe795770f86ce76c13836a591904
diff --git a/envy.go b/envy.go index <HASH>..<HASH> 100644 --- a/envy.go +++ b/envy.go @@ -168,7 +168,7 @@ func Map() map[string]string { for k, v := range env { cp[k] = v } - return env + return cp } // Temp makes a copy of the values and allows operation on
Fix unused variable bug in Map() (#<I>) In Map(), we create a copy of the `env` map to return to the user, but we end up returning our internal map instead. This fixes that bug and returns our copied map to the user.
gobuffalo_envy
train
go
92065a652a7d42f521469f50502b555cc14ff005
diff --git a/nptdms/tdms.py b/nptdms/tdms.py index <HASH>..<HASH> 100644 --- a/nptdms/tdms.py +++ b/nptdms/tdms.py @@ -754,12 +754,14 @@ class TdmsObject(object): # When absolute_time is True, # use the wf_start_time as offset for the time_track() try: - time = self.time_track(absolute_time) + time = self.time_track(absolute_time) except KeyError: time = None if self.channel is None: - return pd.DataFrame.from_items([(ch.channel, pd.Series(ch.data)) \ - for ch in self.tdms_file.group_channels(self.group)]) + return pd.DataFrame.from_items( + [ + (ch.channel, pd.Series(ch.data)) + for ch in self.tdms_file.group_channels(self.group)]) else: return pd.DataFrame(self._data, index=time, columns=[self.path])
line breaks modified to meet pep8
adamreeve_npTDMS
train
py
8d1588e3a8257642f7d1ef471c3372392895510e
diff --git a/src/Role/ObjectRepositoryProvider.php b/src/Role/ObjectRepositoryProvider.php index <HASH>..<HASH> 100644 --- a/src/Role/ObjectRepositoryProvider.php +++ b/src/Role/ObjectRepositoryProvider.php @@ -49,7 +49,9 @@ class ObjectRepositoryProvider } } - $roles[] = new Role\Role($role->getRoleId(), $parents); + // ACL roles for parents read right to left. These are built + // left to right so reverse the array + $roles[] = new Role\Role($role->getRoleId(), array_reverse($parents)); } }
Reverse parent roles for FILO
API-Skeletons_zf-oauth2-doctrine-permissions-acl
train
php
ea17644069e17ed5dc6e9e4913bc8e0f30284610
diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/external/index.js b/spring-boot-admin-server-ui/src/main/frontend/views/external/index.js index <HASH>..<HASH> 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/external/index.js +++ b/spring-boot-admin-server-ui/src/main/frontend/views/external/index.js @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 the original author or authors. + * Copyright 2014-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,6 +39,7 @@ const addIframeView = (viewRegistry, {url, label, order}) => { const addExternalLink = (viewRegistry, {url, label, order}) => { viewRegistry.addView({ + name: url, href: url, label, order
Fix only last of multiple external-views is active closes #<I>
codecentric_spring-boot-admin
train
js
052675a1e0de104dfc4d4c78da5c25bb9655e290
diff --git a/openquake/calculators/views.py b/openquake/calculators/views.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/views.py +++ b/openquake/calculators/views.py @@ -406,7 +406,7 @@ def view_exposure_info(token, dstore): Display info about the exposure model """ assetcol = dstore['assetcol'][:] - taxonomies = dstore['taxonomies'][:] + taxonomies = dstore['assetcol/taxonomies'][:] counts = numpy.zeros(len(taxonomies), numpy.uint32) for ass in assetcol: tax_idx = ass['taxonomy'] @@ -424,7 +424,7 @@ def view_assetcol(token, dstore): Display the exposure in CSV format """ assetcol = dstore['assetcol'].value - taxonomies = dstore['taxonomies'].value + taxonomies = dstore['assetcol/taxonomies'].value header = list(assetcol.dtype.names) columns = [None] * len(header) for i, field in enumerate(header):
Fixed some views on the taxonomies
gem_oq-engine
train
py
de3b17a86f1988871804f2b601f60a08b0f13f9b
diff --git a/test/e2e/cluster_upgrade.go b/test/e2e/cluster_upgrade.go index <HASH>..<HASH> 100644 --- a/test/e2e/cluster_upgrade.go +++ b/test/e2e/cluster_upgrade.go @@ -196,10 +196,6 @@ var _ = Describe("Upgrade [Feature:Upgrade]", func() { }) Describe("kube-push", func() { - BeforeEach(func() { - SkipUnlessProviderIs("gce") - }) - It("of master should maintain responsive services", func() { By("Validating cluster before master upgrade") expectNoError(validate(f, svcName, rcName, ingress, replicas)) @@ -261,8 +257,6 @@ var _ = Describe("Upgrade [Feature:Upgrade]", func() { }) It("should maintain a functioning cluster", func() { - SkipUnlessProviderIs("gce", "gke") - By("Validating cluster before node upgrade") expectNoError(validate(f, svcName, rcName, ingress, replicas)) By("Performing a node upgrade")
Remove silent provider skips, since upgrade tests are feature tests, and aren't turned on by default anyway
kubernetes_kubernetes
train
go
75c723cf81f25cd18ddadfa83cd09b0ebf4e718f
diff --git a/Routing/UrlGenerator.php b/Routing/UrlGenerator.php index <HASH>..<HASH> 100644 --- a/Routing/UrlGenerator.php +++ b/Routing/UrlGenerator.php @@ -63,8 +63,8 @@ class UrlGenerator extends Generator throw new \InvalidArgumentException( "Legacy module '$moduleName' doesn't exist. Cannot generate URL." ); $moduleViews = $module->attribute( 'views' ); - if ( !isset( $moduleViews[$viewName] ) ) - throw new \InvalidArgumentException( "Legacy module '$moduleName' doesn't have any view named '$viewName'. Cannot generate URL." ); + if ( !isset( $moduleViews[$viewName] ) && !isset( $module->Module['function'] ) ) + throw new \InvalidArgumentException( "Legacy module '$moduleName' doesn't have any view named '$viewName'. It doesn't define any function either. Cannot generate URL." ); $unorderedParams = ''; foreach ( $parameters as $paramName => $paramValue )
Fixed EZP-<I> Twig exception trying to generate path to legacy module with no views
ezsystems_LegacyBridge
train
php
7ffd7100d40ff52f44e88f41dd64c5ff81cc0d85
diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithSession.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithSession.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithSession.php +++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithSession.php @@ -118,7 +118,7 @@ trait InteractsWithSession public function assertSessionMissing($key) { if (is_array($key)) { - foreach ( $key as $k ) { + foreach ($key as $k) { $this->assertSessionMissing($k); } } else {
typo: removed spaces in foreach confition
laravel_framework
train
php
cbe1f4f506fc33fe5a6b1d7840c3b90fad552d9d
diff --git a/phantomcss.js b/phantomcss.js index <HASH>..<HASH> 100755 --- a/phantomcss.js +++ b/phantomcss.js @@ -364,7 +364,11 @@ function compareFiles(baseFile, file) { } // Always create non-flattened failure images - casper.captureSelector(file.replace('.diff.png', '.fail.png'), 'img'); + if (file.indexOf('.diff.png') !== -1) { + casper.captureSelector(file.replace('.diff.png', '.fail.png'), 'img'); + } else { + casper.captureSelector(file.replace('.png', '.fail.png'), 'img'); + } casper.evaluate(function(){ window._imagediff_.hasImage = false;
verify we dont' accidentally replace the original image with the fail image
HuddleEng_PhantomCSS
train
js
2930f450981e9f9e4c3d3face9083f016dbf9cab
diff --git a/lib/deployml/configuration.rb b/lib/deployml/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/deployml/configuration.rb +++ b/lib/deployml/configuration.rb @@ -120,11 +120,11 @@ module DeploYML TASKS.each do |task| if (config.has_key?(:before) && config[:before].has_key?(task)) - @before[task] = parse_command(config[:before][task]) + @before[task] = parse_commands(config[:before][task]) end if (config.has_key?(:after) && config[:after].has_key?(task)) - @after[task] = parse_command(config[:after][task]) + @after[task] = parse_commands(config[:after][task]) end end end @@ -299,7 +299,7 @@ module DeploYML # # @since 0.5.0 # - def parse_command(command) + def parse_commands(command) case command when Array command.map { |line| line.to_s }
Renamed parse_command to parse_commands.
postmodern_deployml
train
rb
f6a37a23bc15503b89b6b4d6a47957457dc99746
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,6 @@ var hypercore = require('hypercore') var Archive = require('./archive') +var xtend = require('xtend') module.exports = Drive @@ -23,5 +24,5 @@ Drive.prototype.createArchive = function (key, opts) { key = Buffer(key, 'hex') } - return new Archive(this, key, opts) + return new Archive(this, key, xtend({}, opts)) }
clone opts before passing them to archive
mafintosh_hyperdrive
train
js
8c50d1e6b959e39bfa3303d851b1873b32e28de0
diff --git a/src/Palladium/Service/Registration.php b/src/Palladium/Service/Registration.php index <HASH>..<HASH> 100644 --- a/src/Palladium/Service/Registration.php +++ b/src/Palladium/Service/Registration.php @@ -61,7 +61,7 @@ class Registration } - public function prepareNewIdentity(Entity\EmailIdentity $identity) + private function prepareNewIdentity(Entity\EmailIdentity $identity) { $identity->setStatus(Entity\Identity::STATUS_NEW);
Minor: edited method should not be visible
teresko_palladium
train
php
72bc9d54fcf004bf1990619e4e3814fb3118f0ab
diff --git a/src/core/PromiseMap.js b/src/core/PromiseMap.js index <HASH>..<HASH> 100644 --- a/src/core/PromiseMap.js +++ b/src/core/PromiseMap.js @@ -16,7 +16,7 @@ var Deferred = require('Deferred'); var invariant = require('invariant'); -import type * as Promise from 'Promise'; +import type Promise from 'Promise'; /** * A map of asynchronous values that can be get or set in any order. Unlike a
import type * as Promise -> import type Promise
facebook_fbjs
train
js
a2c471a2acce7b81659096d989da10d0eb4f776b
diff --git a/tasks/lint.js b/tasks/lint.js index <HASH>..<HASH> 100644 --- a/tasks/lint.js +++ b/tasks/lint.js @@ -2,7 +2,7 @@ var gulp = require('gulp'); var plugins = require('gulp-load-plugins')(); gulp.task('lint', function() { - return gulp.src(['gulpfile.js', 'tasks/**/*.js', 'src/**/*.js', 'spec/**/*.js', '!src/lib/console.js']) + return gulp.src(['gulpfile.js', 'tasks/**/*.js', 'src/**/*.js', 'spec/**/*.js']) .pipe(plugins.plumber()) .pipe(plugins.eslint()) .pipe(plugins.eslint.format('stylish'))
chore(ci): Remove missing file from gulp lint task
pivotal-cf_dr-frankenstyle
train
js
9c9f63e0087b85340fd6ed8b798db35f45eef6b4
diff --git a/napalm_iosxr/iosxr.py b/napalm_iosxr/iosxr.py index <HASH>..<HASH> 100644 --- a/napalm_iosxr/iosxr.py +++ b/napalm_iosxr/iosxr.py @@ -18,6 +18,7 @@ from __future__ import unicode_literals # import stdlib import re import copy +import socket from collections import defaultdict # import third party lib @@ -75,6 +76,18 @@ class IOSXRDriver(NetworkDriver): self.device.close() def is_alive(self): + null = chr(0) + try: + # Try sending ASCII null byte to maintain + # the connection alive + self.device.device.send_command(null) + except (socket.error, EOFError): + # If unable to send, we can tell for sure + # that the connection is unusable, + # hence return False. + return { + 'is_alive': False + } return { 'is_alive': self.device.device.remote_conn.transport.is_active() }
Add is_alive functionality similar to ios
napalm-automation_napalm
train
py
107beb79f51d34f72404bee788bf2eaa0fc5efd9
diff --git a/js/cloudmine.js b/js/cloudmine.js index <HASH>..<HASH> 100644 --- a/js/cloudmine.js +++ b/js/cloudmine.js @@ -1154,8 +1154,6 @@ 'X-CloudMine-UT': opts.user_token }; - this.requestHeaders = merge({}, this.requestHeaders, config.headers); - this.responseHeaders = {}; this.responseText = null; this.status = null;
didn't mean to leave this in
cloudmine_CloudMineSDK-JavaScript
train
js
36effd916c1f372ae94bcff54e947050538aa12d
diff --git a/activesupport/test/dependencies_test.rb b/activesupport/test/dependencies_test.rb index <HASH>..<HASH> 100644 --- a/activesupport/test/dependencies_test.rb +++ b/activesupport/test/dependencies_test.rb @@ -28,8 +28,6 @@ class DependenciesTest < ActiveSupport::TestCase end def test_depend_on_path - skip "LoadError#path does not exist" if RUBY_VERSION < '2.0.0' - expected = assert_raises(LoadError) do Kernel.require 'omgwtfbbq' end
Remove LoadError#path hack for Ruby <I> Now that Rails requires Ruby >= <I> there is need to skip the `test_depend_on_path` test.
rails_rails
train
rb
3f0cc106966c45d87e6ed0711d613a5acbd93635
diff --git a/statik/common.py b/statik/common.py index <HASH>..<HASH> 100644 --- a/statik/common.py +++ b/statik/common.py @@ -33,6 +33,8 @@ class YamlLoadable(object): # load the variables from the YAML file self.vars = yaml.load(self.file_content) if len(self.file_content) else {} + if not isinstance(self.vars, dict): + self.vars = {} class ContentLoadable(object): @@ -85,9 +87,14 @@ class ContentLoadable(object): # if it's a YAML file if self.file_type == 'yaml': self.vars = yaml.load(self.file_content) if len(self.file_content) else {} + if not isinstance(self.vars, dict): + self.vars = {} else: md = Markdown( - extensions=[MarkdownYamlMetaExtension()], + extensions=[ + MarkdownYamlMetaExtension(), + 'markdown.extensions.fenced_code', + ], ) self.content = md.convert(self.file_content) self.vars = md.meta
fixing minor bug when loading empty yaml models; also now supporting fenced code blocks in Markdown
thanethomson_statik
train
py
7ef312bde5b7c30b0687b3c2911a461e8b022da3
diff --git a/src/Storefront/Resources/app/storefront/src/plugin/google-analytics/google-analytics.plugin.js b/src/Storefront/Resources/app/storefront/src/plugin/google-analytics/google-analytics.plugin.js index <HASH>..<HASH> 100644 --- a/src/Storefront/Resources/app/storefront/src/plugin/google-analytics/google-analytics.plugin.js +++ b/src/Storefront/Resources/app/storefront/src/plugin/google-analytics/google-analytics.plugin.js @@ -63,7 +63,7 @@ export default class GoogleAnalyticsPlugin extends Plugin handleTrackingLocation() { this.trackingUrl = new URL(window.location.href); - let gclid = this.trackingUrl.searchParams.get('gclid'); + const gclid = this.trackingUrl.searchParams.get('gclid'); if (gclid) { this.storage.setItem( this._getGclidStorageKey(),
NEXT-<I> - Changed let to const in order to fix eslint warning
shopware_platform
train
js
265ace33f5bbcd313113ac87b4750c7b05f15f26
diff --git a/src/lib/InstantSearch.js b/src/lib/InstantSearch.js index <HASH>..<HASH> 100644 --- a/src/lib/InstantSearch.js +++ b/src/lib/InstantSearch.js @@ -1,4 +1,6 @@ -import algoliasearch from 'algoliasearch/lite'; +// we use the fullpath to the lite build to solve a meteor.js issue: +// https://github.com/algolia/instantsearch.js/issues/1024#issuecomment-221618284 +import algoliasearch from 'algoliasearch/src/browser/builds/algoliasearchLite.js'; import algoliasearchHelper from 'algoliasearch-helper'; import forEach from 'lodash/collection/forEach'; import merge from 'lodash/object/merge';
fix(meteorjs): lite build must point to the browser lite (#<I>) fixes #<I> Actually I had previously fixed #<I> by pointing to the lite build (side effect). But since <URL>)
algolia_instantsearch.js
train
js
443bff8da20206fd8b982ec4439c6dcf3e46f885
diff --git a/src/GitHub_Updater/Install.php b/src/GitHub_Updater/Install.php index <HASH>..<HASH> 100644 --- a/src/GitHub_Updater/Install.php +++ b/src/GitHub_Updater/Install.php @@ -245,8 +245,6 @@ class Install extends Base { // Save branch setting. $branch = new Branch(); $branch->set_branch_on_install( self::$install ); - parent::$options[ 'current_branch_' . self::$install['repo'] ] = self::$install['github_updater_branch']; - update_site_option( 'github_updater', parent::$options ); } if ( $wp_cli ) {
cleanup these processes done in preceeding function
afragen_github-updater
train
php
7be1956df7639eb825bf7799465a703ae8daad1b
diff --git a/src/ParseMenu.php b/src/ParseMenu.php index <HASH>..<HASH> 100644 --- a/src/ParseMenu.php +++ b/src/ParseMenu.php @@ -104,7 +104,7 @@ class ParseMenu implements ParserInterface */ public function getBreadCrumbs($menu) { - $breadcrumbs = []; + $breadcrumbs = array(); foreach ((array)$menu['meta']['path'] as $menu_item_id) { $array_path[] = array_shift($menu['meta']['path']); $crumb = static::array_get($menu['menu'], implode('.submenu.', $array_path));
switch from php<I> short array to php<I> array()
waynestate_parse-menu
train
php
a183d90043998d65b3e6187108689aa59fc02c3c
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -61,10 +61,7 @@ function censorNegativeZero(x) { function createIntegerConversion(bitLength, { unsigned }) { let lowerBound, upperBound; - if (bitLength === 64) { - upperBound = Number.MAX_SAFE_INTEGER; - lowerBound = unsigned ? 0 : Number.MIN_SAFE_INTEGER; - } else if (unsigned) { + if (unsigned) { lowerBound = 0; upperBound = 2 ** bitLength - 1; } else {
Remove dead code d<I>eb<I>f<I>b<I>bf<I>d<I>cf<I>f<I>ba made it so that createIntegerConversion no longer ever is called with <I> as the bitLength.
jsdom_webidl-conversions
train
js
2f990922c6b5fefd4100ed173b412c16898acc5b
diff --git a/lib/datapathy/model.rb b/lib/datapathy/model.rb index <HASH>..<HASH> 100644 --- a/lib/datapathy/model.rb +++ b/lib/datapathy/model.rb @@ -30,8 +30,6 @@ module Datapathy::Model def merge!(attributes = {}) attributes.each do |name, value| - #ivar = "@#{name.to_s.gsub(/\?$/, '')}" - #instance_variable_set(ivar, value) send(:"#{name}=", value) end end @@ -118,7 +116,6 @@ module Datapathy::Model query.add_condition(self, self.key, :==, key) record = adapter.read(query) new(record) if record - #detect(self.key => key) end def select(*attrs, &blk) diff --git a/spec/model_spec.rb b/spec/model_spec.rb index <HASH>..<HASH> 100644 --- a/spec/model_spec.rb +++ b/spec/model_spec.rb @@ -1,6 +1,9 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper') -describe "Defining models" do +describe "Defining models with read/write-only attributes" do + before do + pending "Is this even a good idea?" + end class PersistenceAuthority include Datapathy::Model
Put read/write only specs on hold for now
paul_datapathy
train
rb,rb
48204cf1c92925203410443d83e33c6013e93aa7
diff --git a/xmantissa/test/test_theme.py b/xmantissa/test/test_theme.py index <HASH>..<HASH> 100644 --- a/xmantissa/test/test_theme.py +++ b/xmantissa/test/test_theme.py @@ -8,11 +8,10 @@ from nevow.stan import Tag from nevow.tags import ( html, head, body, div, span, img, script, link, invisible, directive) from nevow.context import WovenContext -from nevow.testutil import FakeRequest +from nevow.testutil import FakeRequest, AccumulatingFakeRequest as makeRequest from nevow.flat import flatten from nevow.inevow import IRequest from nevow.page import renderer -from nevow.test.test_rend import req as makeRequest from axiom.store import Store from axiom.substore import SubStore
Merge nit-errors-<I>-2 Author: idnar Reviewer: glyph, exarkun Fixes #<I> Add support for trial's mechanism for reporting errors during the test collection process.
twisted_mantissa
train
py
b9d81488a100c410aa393a85114a2706912c8481
diff --git a/src/shogun2-core/shogun2-model/src/main/java/de/terrestris/shogun2/model/layer/source/LayerDataSource.java b/src/shogun2-core/shogun2-model/src/main/java/de/terrestris/shogun2/model/layer/source/LayerDataSource.java index <HASH>..<HASH> 100644 --- a/src/shogun2-core/shogun2-model/src/main/java/de/terrestris/shogun2/model/layer/source/LayerDataSource.java +++ b/src/shogun2-core/shogun2-model/src/main/java/de/terrestris/shogun2/model/layer/source/LayerDataSource.java @@ -21,7 +21,7 @@ import de.terrestris.shogun2.model.PersistentObject; * */ @Entity -@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) +@Inheritance(strategy = InheritanceType.JOINED) public abstract class LayerDataSource extends PersistentObject { /**
use JOINED as inheritance type since there is no deep hierarchy
terrestris_shogun-core
train
java
094109ff2a826620143acb2c446ad3a6733587ff
diff --git a/lib/sass/importers/base.rb b/lib/sass/importers/base.rb index <HASH>..<HASH> 100644 --- a/lib/sass/importers/base.rb +++ b/lib/sass/importers/base.rb @@ -101,12 +101,6 @@ module Sass raise "Implement Me" end - # Whether the file was found on disk. - # @return [Boolean] - def on_disk? - false - end - protected def split(name) extension = nil diff --git a/lib/sass/importers/filesystem.rb b/lib/sass/importers/filesystem.rb index <HASH>..<HASH> 100644 --- a/lib/sass/importers/filesystem.rb +++ b/lib/sass/importers/filesystem.rb @@ -26,11 +26,6 @@ module Sass @root end - # @see Base#on_disk? - def on_disk? - true - end - private def _find(full_filename, options)
[Sass] Get rid of Importers::Base#on_disk?
sass_ruby-sass
train
rb,rb
35d1bb7ae3a56f6d3e848c7d1c409eb939ee3b6e
diff --git a/providers/core/peerconnection.unprivileged.js b/providers/core/peerconnection.unprivileged.js index <HASH>..<HASH> 100644 --- a/providers/core/peerconnection.unprivileged.js +++ b/providers/core/peerconnection.unprivileged.js @@ -78,6 +78,9 @@ function SimpleDataPeer(peerName, stunServers, dataChannelCallbacks, mocks) { this.pc.addEventListener("signalingstatechange", function () { // TODO: come up with a better way to detect connection. We start out // as "stable" even before we are connected. + // TODO: this is not fired for connections closed by the other side. + // This will be fixed in m37, at that point we should dispatch an onClose + // event here for freedom.transport to pick up. if (this.pc.signalingState === "stable") { this.pcState = SimpleDataPeerState.CONNECTED; this.onConnectedQueue.map(function(callback) { callback(); });
Add TODO so we remember to fix peerconnection closing.
freedomjs_freedom
train
js
80a729eed852da40833dacf5b57e06a28782b338
diff --git a/zero/bool_test.go b/zero/bool_test.go index <HASH>..<HASH> 100644 --- a/zero/bool_test.go +++ b/zero/bool_test.go @@ -173,7 +173,7 @@ func TestBoolScan(t *testing.T) { func assertBool(t *testing.T, b Bool, from string) { if b.Bool != true { - t.Errorf("bad %s bool: %d ≠ %v\n", from, b.Bool, true) + t.Errorf("bad %s bool: %v ≠ %v\n", from, b.Bool, true) } if !b.Valid { t.Error(from, "is invalid, but should be valid")
Fix test The tests no longer run: $ go test ./... zero/bool_test.go:<I>: Errorf format %d has arg b.Bool of wrong type bool This is because go test now automatically runs go vet.
guregu_null
train
go
d3d8a013d491300ce377765fa1f7c2275bb45975
diff --git a/chatterbot/languages.py b/chatterbot/languages.py index <HASH>..<HASH> 100644 --- a/chatterbot/languages.py +++ b/chatterbot/languages.py @@ -779,7 +779,7 @@ class GRB: class GRE: - ISO_639_1 = '' + ISO_639_1 = 'el' ISO_639 = 'gre' ENGLISH_NAME = 'Greek'
Update languages.py Added ISO <I>-1 code for Modern Greek (class GRE).
gunthercox_ChatterBot
train
py
e26705e979cd52a74835d4d61e27f89a46d0cca0
diff --git a/internal/services/mssql/mssql_database_resource.go b/internal/services/mssql/mssql_database_resource.go index <HASH>..<HASH> 100644 --- a/internal/services/mssql/mssql_database_resource.go +++ b/internal/services/mssql/mssql_database_resource.go @@ -774,7 +774,6 @@ func resourceMsSqlDatabaseSchema() map[string]*pluginsdk.Schema { "license_type": { Type: pluginsdk.TypeString, Optional: true, - Computed: true, ValidateFunc: validation.StringInSlice([]string{ string(sql.DatabaseLicenseTypeBasePrice), string(sql.DatabaseLicenseTypeLicenseIncluded),
remove computed flag from license type (#<I>)
terraform-providers_terraform-provider-azurerm
train
go
1d2bb9cb633935234ec79b7722e7a3fc12e15617
diff --git a/bcbio/pipeline/main.py b/bcbio/pipeline/main.py index <HASH>..<HASH> 100644 --- a/bcbio/pipeline/main.py +++ b/bcbio/pipeline/main.py @@ -274,6 +274,8 @@ def fastrnaseqpipeline(config, run_info_yaml, parallel, dirs, samples): dirs, "fastrnaseq") as run_parallel: with profile.report("fastrnaseq", dirs): samples = rnaseq.fast_rnaseq(samples, run_parallel) + with profile.report("quality control", dirs): + samples = qcsummary.generate_parallel(samples, run_parallel) with profile.report("upload", dirs): samples = run_parallel("upload_samples", samples) for samples in samples:
Create project summary file when running fast RNA-seq.
bcbio_bcbio-nextgen
train
py
637dc4d24b41f23841b1cb9d164763495bc33795
diff --git a/src/JSTACK.Murano.js b/src/JSTACK.Murano.js index <HASH>..<HASH> 100644 --- a/src/JSTACK.Murano.js +++ b/src/JSTACK.Murano.js @@ -214,6 +214,8 @@ JSTACK.Murano = (function (JS, undefined) { } } + console.log('CREAT', service); + data['?'][id] = { "name": service.name, };
Fixed a bug with Ceph containers
ging_jstack
train
js
2c41403b8660e8d0d53406be26468b09a4f17e17
diff --git a/specs-go/config.go b/specs-go/config.go index <HASH>..<HASH> 100644 --- a/specs-go/config.go +++ b/specs-go/config.go @@ -53,15 +53,15 @@ type Process struct { SelinuxLabel string `json:"selinuxLabel,omitempty" platform:"linux"` } -// User specifies Linux specific user and group information for the container's +// User specifies Linux/Solaris specific user and group information for the container's // main process. type User struct { // UID is the user id. (this field is platform dependent) - UID uint32 `json:"uid" platform:"linux"` + UID uint32 `json:"uid" platform:"linux,solaris"` // GID is the group id. (this field is platform dependent) - GID uint32 `json:"gid" platform:"linux"` + GID uint32 `json:"gid" platform:"linux,solaris"` // AdditionalGids are additional group ids set for the container's process. (this field is platform dependent) - AdditionalGids []uint32 `json:"additionalGids,omitempty" platform:"linux"` + AdditionalGids []uint32 `json:"additionalGids,omitempty" platform:"linux,solaris"` } // Root contains information about the container's root filesystem on the host.
Correction to User struct in specs-go/config.json
opencontainers_runtime-spec
train
go
a4c0fbff1015cd8d6b75f8246b51faad5734931c
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -15,8 +15,8 @@ function file(options, contents) { } function find(globs, options) { - const localGlobs = concat.call([], globs || []); - const localOptions = options || {}; + var localGlobs = concat.call([], globs || []); + var localOptions = options || {}; var cwd = localOptions.cwd || process.cwd(); var base = localOptions.base || path.resolve(cwd, globParent(localGlobs[0])); @@ -39,13 +39,13 @@ function read(globs, options) { } function remove(globs) { - const localGlobs = concat.call([], globs || []); + var localGlobs = concat.call([], globs || []); return trash(localGlobs); } function write(folder, options) { - const localOptions = assign({}, { base: folder }, options); + var localOptions = assign({}, { base: folder }, options); return function (fileObj) { return fileObj.write(localOptions);
Corrected <I> issue.
shannonmoeller_spiff
train
js
6a0c0b87ee40923dc4d0faa0114183419812f8e6
diff --git a/spec/origin/extensions/array_spec.rb b/spec/origin/extensions/array_spec.rb index <HASH>..<HASH> 100644 --- a/spec/origin/extensions/array_spec.rb +++ b/spec/origin/extensions/array_spec.rb @@ -268,6 +268,17 @@ describe Array do end end + describe "#__expand_complex__" do + + let(:array) do + [{ :test.in => [ "value" ] }] + end + + it "expands all keys inside the array" do + array.__expand_complex__.should eq([{ "test" => { "$in" => [ "value" ]}}]) + end + end + describe "#__intersect__" do context "when the other object is a non-enumerable" do
Add failing spec for #<I>
mongoid_origin
train
rb
74268466b4714381e21cc78c459ecde10990a4ed
diff --git a/src/tabris/Crypto.js b/src/tabris/Crypto.js index <HASH>..<HASH> 100644 --- a/src/tabris/Crypto.js +++ b/src/tabris/Crypto.js @@ -15,8 +15,8 @@ export default class Crypto extends NativeObject { throw new Error('Unsupported type in Crypto.getRandomValues'); } let byteLength = typedArray.byteLength; - let values = this._nativeCall('getRandomValues', {byteLength}); - if (values.length !== byteLength) { + let values = new Uint8Array(this._nativeCall('getRandomValues', {byteLength})); + if (values.byteLength !== byteLength) { throw new Error('Not enough random bytes available'); } new Uint8Array(typedArray.buffer).set(values);
Change Crypto for compatibility with windows client On Windows, `TypedArray.prototype.set()` doesn't work with an arraybuffer as a parameter. Also, the `length` property is not supported on arraybuffers. On iOS, the byteLength is not supported on arraybuffers. Change-Id: I<I>fccacbe8ad<I>ff9ace<I>eb<I>da<I>c
eclipsesource_tabris-js
train
js
e2d673dafa8b88604e2738916e0235ffc0852de8
diff --git a/packages/babel/src/traversal/scope/index.js b/packages/babel/src/traversal/scope/index.js index <HASH>..<HASH> 100644 --- a/packages/babel/src/traversal/scope/index.js +++ b/packages/babel/src/traversal/scope/index.js @@ -543,7 +543,7 @@ export default class Scope { this.registerBinding("module", specifier); } } else if (path.isExportDeclaration()) { - this.registerBinding("module", path.get("declaration")); + this.registerDeclaration(path.get("declaration")); } else { this.registerBinding("unknown", path); }
don't register export declarations as a module binding
babel_babel
train
js
4f1bbb5444946138d76bf3ca28cc53893213abc4
diff --git a/sos/plugins/megacli.py b/sos/plugins/megacli.py index <HASH>..<HASH> 100644 --- a/sos/plugins/megacli.py +++ b/sos/plugins/megacli.py @@ -34,6 +34,12 @@ class MegaCLI(Plugin, RedHatPlugin): def get_megacli_files(self): """ MegaCLI specific output """ - self.add_cmd_output("/opt/MegaRAID/MegaCli/MegaCli64 LDPDInfo -aALL") - self.add_cmd_output("/opt/MegaRAID/MegaCli/MegaCli64 -AdpAllInfo -aALL") - self.add_cmd_output("/opt/MegaRAID/MegaCli/MegaCli64 -AdpBbuCmd -GetBbuStatus -aALL") + self.add_cmd_outputs([ + megacli_cmd + " LDPDInfo -aALL", + megacli_cmd + " -AdpAllInfo -aALL", + megacli_cmd + " -AdpBbuCmd -GetBbuStatus -aALL", + megacli_cmd + " -ShowSummary -a0" + ]) + +# vim: et ts=4 sw=4 +
[megacli] add new command and switch to add_copy_specs
sosreport_sos
train
py
a1fb905511eedf6415738e311721fc53128a6236
diff --git a/lib/active_record_deprecated_finders/base.rb b/lib/active_record_deprecated_finders/base.rb index <HASH>..<HASH> 100644 --- a/lib/active_record_deprecated_finders/base.rb +++ b/lib/active_record_deprecated_finders/base.rb @@ -55,8 +55,9 @@ module ActiveRecord def with_scope(scope = {}, action = :merge) ActiveSupport::Deprecation.warn( - "ActiveRecord::Base#with_scope is deprecated. Please use" \ - "ActiveRecord::Relation#scoping instead." + "ActiveRecord::Base#with_scope and #with_exclusive_scope are deprecated. " \ + "Please use ActiveRecord::Relation#scoping instead. (You can use #merge " \ + "to merge multiple scopes together.)" ) # If another Active Record class has been passed in, get its current scope diff --git a/test/with_scope_test.rb b/test/with_scope_test.rb index <HASH>..<HASH> 100644 --- a/test/with_scope_test.rb +++ b/test/with_scope_test.rb @@ -27,4 +27,10 @@ describe 'with_scope' do end end end + + it 'gives a deprecation for #with_exclusive_scope' do + assert_deprecated do + Post.send(:with_exclusive_scope) {} + end + end end
test for with_exclusive_scope deprecation
rails_activerecord-deprecated_finders
train
rb,rb
6bfdef3b5e01bfb666b47eea6096d167672253f9
diff --git a/src/collections/ArrayHelper.php b/src/collections/ArrayHelper.php index <HASH>..<HASH> 100644 --- a/src/collections/ArrayHelper.php +++ b/src/collections/ArrayHelper.php @@ -28,7 +28,7 @@ class ArrayHelper return Option::of($array[$key]); } - $parts = self::getKeyParts($key); + $parts = self::normalizeKey($key); if (empty($parts)) { @@ -69,7 +69,7 @@ class ArrayHelper public static function set(array &$array, $key, $value): void { $container = &$array; // This needs to be a pointer in order for the value to be stored correctly. - $parts = self::getKeyParts($key); + $parts = self::normalizeKey($key); if (empty($parts)) { @@ -105,7 +105,7 @@ class ArrayHelper * @return array * @throws InvalidArgumentException */ - private static function getKeyParts($key): array + private static function normalizeKey($key): array { $validateKey = function ($key): void {
Renaming this method to something clearer.
jurchiks_commons
train
php
341fb20e269202a5745fc7d10de3f5d15c35f1c4
diff --git a/lib/prey/plugins/providers/network/index.js b/lib/prey/plugins/providers/network/index.js index <HASH>..<HASH> 100644 --- a/lib/prey/plugins/providers/network/index.js +++ b/lib/prey/plugins/providers/network/index.js @@ -25,7 +25,8 @@ var Network = function(){ 'private_ip', 'active_network_interface', 'access_points_list', - 'active_access_point' + 'active_access_point', + 'open_access_points_list' ]; this.is_ip_address = function(str){
Add open access points list to Network getters
prey_prey-node-client
train
js
17dd4981c7611c9df418be551709e7294fa2b76a
diff --git a/code/libraries/koowa/libraries/template/abstract.php b/code/libraries/koowa/libraries/template/abstract.php index <HASH>..<HASH> 100644 --- a/code/libraries/koowa/libraries/template/abstract.php +++ b/code/libraries/koowa/libraries/template/abstract.php @@ -304,7 +304,7 @@ abstract class KTemplateAbstract extends KObject implements KTemplateInterface */ public function escape($string) { - return htmlspecialchars($string); + return htmlspecialchars($string, ENT_COMPAT, 'UTF-8'); } /**
Use UTF-8 character set in escape method
joomlatools_joomlatools-framework
train
php
dee25535e7e8763c51afd5728e918063edb44f2d
diff --git a/i3pystatus/core/desktop.py b/i3pystatus/core/desktop.py index <HASH>..<HASH> 100644 --- a/i3pystatus/core/desktop.py +++ b/i3pystatus/core/desktop.py @@ -30,6 +30,8 @@ class DesktopNotification(BaseDesktopNotification): try: + import gi + gi.require_version('Notify', '0.7') from gi.repository import Notify except ImportError: pass
Fix some warning from some glib-thing.
enkore_i3pystatus
train
py
585f5d6b311f49d59d322f7e204545490a8a4620
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,9 +1,12 @@ #!/usr/bin/env python -from distutils.core import setup +try: + from setuptools import setup +except ImportError: + from distutils.core import setup setup(name='gos-asm', - version='0.0', + version='0.0.0-a', description='Multi-genome gene order based assembler', install_requires=list(map(lambda entry: entry.strip(), open("requirements.txt", "rt").readlines())), author='Sergey Aganezov', @@ -12,6 +15,7 @@ setup(name='gos-asm', keywords=["breakpoint graph", "data structures", "python", "scaffolding", "gene order", "assembly", "genome"], url='https://github.com/aganezov/gos-asm', packages=['gos_asm', 'tests'], + test_suite="tests", classifiers=[ "Development Status :: 1 - Planning", "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
added setuptools support for setup.py script added support for `setup.py test` invocation
aganezov_gos-asm
train
py
7986308fc3130a734e1706a36380f5ba5d3acc6c
diff --git a/packages/enzyme/src/ReactWrapper.js b/packages/enzyme/src/ReactWrapper.js index <HASH>..<HASH> 100644 --- a/packages/enzyme/src/ReactWrapper.js +++ b/packages/enzyme/src/ReactWrapper.js @@ -186,7 +186,7 @@ class ReactWrapper { * @return {Array<ReactElement>} */ getElements() { - return this[NODES].map(getAdapter(this[OPTIONS]).nodeToElement); + return this[NODES].map(n => getAdapter(this[OPTIONS]).nodeToElement(n)); } // eslint-disable-next-line class-methods-use-this diff --git a/packages/enzyme/src/ShallowWrapper.js b/packages/enzyme/src/ShallowWrapper.js index <HASH>..<HASH> 100644 --- a/packages/enzyme/src/ShallowWrapper.js +++ b/packages/enzyme/src/ShallowWrapper.js @@ -480,7 +480,7 @@ class ShallowWrapper { * @return {Array<ReactElement>} */ getElements() { - return this.getNodesInternal().map(getAdapter(this[OPTIONS]).nodeToElement); + return this.getNodesInternal().map(n => getAdapter(this[OPTIONS]).nodeToElement(n)); } // eslint-disable-next-line class-methods-use-this
[Refactor] `ReactWrapper`/`ShallowWrapper`: ensure calling an adapter‘s nodeToElement preserves the receiver
airbnb_enzyme
train
js,js
9185750c2bdad2199fb6252d2864b4a7cc23518c
diff --git a/tests/integration/nupic/opf/hotgym_regression_test.py b/tests/integration/nupic/opf/hotgym_regression_test.py index <HASH>..<HASH> 100644 --- a/tests/integration/nupic/opf/hotgym_regression_test.py +++ b/tests/integration/nupic/opf/hotgym_regression_test.py @@ -63,7 +63,7 @@ class HotgymRegressionTest(unittest.TestCase): # Changes that affect prediction results will cause this test to fail. If # the change is understood and reviewers agree that there has not been a # regression then this value can be updated to reflect the new result. - self.assertAlmostEqual(float(lastRow[14]), 5.81912873271) + self.assertAlmostEqual(float(lastRow[14]), 5.84456654247) finally: shutil.rmtree(resultsDir, ignore_errors=True)
update expected result in hotgym, result change due to different rounding rules in boosting
numenta_nupic
train
py
081e57917f756b8b806568265e187757ec386325
diff --git a/maven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/AbstractSarlMojo.java b/maven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/AbstractSarlMojo.java index <HASH>..<HASH> 100644 --- a/maven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/AbstractSarlMojo.java +++ b/maven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/AbstractSarlMojo.java @@ -119,7 +119,6 @@ public abstract class AbstractSarlMojo extends AbstractMojo { /** * @parameter property="testInput" - * @required */ private File testInput;
[maven] Remove the "@required" flag. The "@required" flag is removed from the sarl-maven-plugin configuration.
sarl_sarl
train
java
71bb2b2ea33744c76483265d4db161a0b03ac959
diff --git a/detect-indent.js b/detect-indent.js index <HASH>..<HASH> 100644 --- a/detect-indent.js +++ b/detect-indent.js @@ -49,6 +49,10 @@ return '\t'; } + if (spaces.length === 0) { + return null; + } + // greatest common divisor is most likely the indent size var indentSize = spaces.reduce(gcd); diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -64,4 +64,8 @@ describe('detectIndent()', function () { assert.equal(e.message, 'Argument must be a string.'); } }); + + it('should return `null` when there are no indentation', function () { + assert.equal(detectIndent('<ul></ul>'), null); + }); });
Return `null` if there are no indentation Fixes #4
sindresorhus_detect-indent
train
js,js
214f71f80d093156f0343f860cd8e565db95459e
diff --git a/src/abcWalletTxLib-TRD.js b/src/abcWalletTxLib-TRD.js index <HASH>..<HASH> 100644 --- a/src/abcWalletTxLib-TRD.js +++ b/src/abcWalletTxLib-TRD.js @@ -130,7 +130,7 @@ class ABCTxLibTRD { fetchGet (cmd, params) { return this.io.fetch(baseUrl + cmd + '/' + params, { - method: 'get' + method: 'GET' }) } @@ -140,7 +140,7 @@ class ABCTxLibTRD { Accept: 'application/json', 'Content-Type': 'application/json' }, - method: 'post', + method: 'POST', body: JSON.stringify(body) }) }
Properly capitalize `GET` and `POST`
EdgeApp_edge-currency-ethereum
train
js
9322cccda3ca59690f543bc623d7674cad2774c5
diff --git a/src/frontend/org/voltdb/RealVoltDB.java b/src/frontend/org/voltdb/RealVoltDB.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/RealVoltDB.java +++ b/src/frontend/org/voltdb/RealVoltDB.java @@ -1588,8 +1588,8 @@ public class RealVoltDB implements VoltDBInterface, RestoreAgent.Callback { String[] zkInterface = m_config.m_zkInterface.split(":"); stringer.key("zkPort").value(zkInterface[1]); stringer.key("zkInterface").value(zkInterface[0]); - stringer.key("drPort").value(m_config.m_drAgentPortStart); - stringer.key("drInterface").value(m_config.m_drInterface); + stringer.key("drPort").value(VoltDB.getReplicationPort(m_catalogContext.cluster.getDrproducerport())); + stringer.key("drInterface").value(VoltDB.getDefaultReplicationInterface()); stringer.key("publicInterface").value(m_config.m_publicInterface); stringer.endObject(); JSONObject obj = new JSONObject(stringer.toString());
ENG-<I>: Include correct DR interface and port in the cluster metadata. The DR port can be passed in from the command line or set in the deployment file. The cluster metadata should include the final decision instead of just the command line arguments.
VoltDB_voltdb
train
java
1504ebb398eb670f146e1eefadec1eb7979dccb9
diff --git a/core/Plugin/Manager.php b/core/Plugin/Manager.php index <HASH>..<HASH> 100644 --- a/core/Plugin/Manager.php +++ b/core/Plugin/Manager.php @@ -779,7 +779,7 @@ class Manager extends Singleton public function getActivatedPluginsFromConfig() { - $plugins = Config::getInstance()->Plugins['Plugins']; + $plugins = @Config::getInstance()->Plugins['Plugins']; return $this->makePluginsToLoad($plugins); }
Hide error when reading the Plugins array, when this function is called before we have a config.ini.php file fixes <URL>
matomo-org_matomo
train
php
f5782084e57a03c65731f80c2bdfc85c258c9ded
diff --git a/builder/openstack/artifact.go b/builder/openstack/artifact.go index <HASH>..<HASH> 100644 --- a/builder/openstack/artifact.go +++ b/builder/openstack/artifact.go @@ -41,6 +41,6 @@ func (a *Artifact) State(name string) interface{} { } func (a *Artifact) Destroy() error { - log.Printf("Destroying image: %d", a.ImageId) + log.Printf("Destroying image: %s", a.ImageId) return a.Conn.DeleteImageById(a.ImageId) } diff --git a/builder/openstack/step_wait_for_rackconnect.go b/builder/openstack/step_wait_for_rackconnect.go index <HASH>..<HASH> 100644 --- a/builder/openstack/step_wait_for_rackconnect.go +++ b/builder/openstack/step_wait_for_rackconnect.go @@ -21,7 +21,6 @@ func (s *StepWaitForRackConnect) Run(state multistep.StateBag) multistep.StepAct csp := state.Get("csp").(gophercloud.CloudServersProvider) server := state.Get("server").(*gophercloud.Server) ui := state.Get("ui").(packer.Ui) - fmt.Printf("%s", server) ui.Say(fmt.Sprintf("Waiting for server (%s) to become RackConnect ready...", server.Id))
builder/openstack: address vet reports Fixes the following vet reports: builder/openstack/artifact.go:<I>: arg a.ImageId for printf verb %d of wrong type: string builder/openstack/step_wait_for_rackconnect.go:<I>: arg server for printf verb %s of wrong type: *github.com/mitchellh/gophercloud-fork-<I>fb.Server
hashicorp_packer
train
go,go
13ce4e0ea514627e1cbab17ce7fae4744f229fcf
diff --git a/manage.py b/manage.py index <HASH>..<HASH> 100644 --- a/manage.py +++ b/manage.py @@ -34,19 +34,5 @@ def check(): os.system('pep257 examples/') [email protected] -def test(): - """Run unittests.""" - os.system('find ./objects -name "*.pyc" -exec rm -rf {} \\;') - os.system('find ./tests -name "*.pyc" -exec rm -rf {} \\;') - - os.system('find ./objects -name "*.pyo" -exec rm -rf {} \\;') - os.system('find ./tests -name "*.pyo" -exec rm -rf {} \\;') - - os.system('coverage run --rcfile=./.coveragerc `which unit2` discover') - os.system('coverage html --rcfile=./.coveragerc') - os.system('rm -f .coverage') - - if __name__ == '__main__': manager.main()
Remove test command from manage.py
ets-labs_python-dependency-injector
train
py
8245125349961ef0f2c35f91b10633f3ab0ae812
diff --git a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php index <HASH>..<HASH> 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php @@ -92,7 +92,7 @@ class CmsFormsContext extends BehatContext { $element = $page->findField($locator); assertNotNull($element, sprintf('HTML field "%s" not found', $locator)); - $actual = $element->getAttribute('value'); + $actual = $element->getHTML(); $regex = '/'.preg_quote($html, '/').'/ui'; if (!preg_match($regex, $actual)) { $message = sprintf(
Don't rely on Behat/Selenium returning 'value' for textarea Technically a textarea DOM node doesn't have a 'value' attribute, but rather a HTML content. This used to work, but likely broke either by updated browser handling or updated selenium logic. Fixes "Scenario: I can edit title and content and see the changes on draft"
silverstripe_silverstripe-framework
train
php
4f8d2326a3e534300c4948dab5791ae107f56a6f
diff --git a/mongo/mongo.go b/mongo/mongo.go index <HASH>..<HASH> 100644 --- a/mongo/mongo.go +++ b/mongo/mongo.go @@ -705,7 +705,7 @@ func installMongod(mongoDep packaging.Dependency, usingMongoFromSnap bool, hostS } } - prerequisites := []snap.App{snap.NewApp("core")} + prerequisites := []snap.App{} backgroundServices := []snap.BackgroundService{ { Name: "daemon", diff --git a/packaging/dependency/mongo.go b/packaging/dependency/mongo.go index <HASH>..<HASH> 100644 --- a/packaging/dependency/mongo.go +++ b/packaging/dependency/mongo.go @@ -55,10 +55,6 @@ func (dep mongoDependency) PackageList(series string) ([]packaging.Package, erro snapList = append( snapList, packaging.Package{ - Name: "core", - PackageManager: packaging.SnapPackageManager, - }, - packaging.Package{ Name: "juju-db", InstallOptions: fmt.Sprintf("--channel %s", dep.snapChannel), PackageManager: packaging.SnapPackageManager,
Core isn't required for installing juju-db Juju-db already brings in core<I> and so we don't need to bring in core. We can save ourselves sometime during bootstrapping to just installing what is required. This should be a general speed up as we're only installing one thing instead of two.
juju_juju
train
go,go
0c4b83a6c3f2a044201a7866abd0ebb0e869fa8c
diff --git a/controllers.js b/controllers.js index <HASH>..<HASH> 100644 --- a/controllers.js +++ b/controllers.js @@ -32,7 +32,7 @@ module.exports.login = function(req, res) { // If we get here, it means the user didn't supply required form fields. error: function(form) { - res.render('login', { error: 'Required fields missing.', form: form }); + res.render('login', { form: form }); }, // If we get here, it means the user is doing a simple GET request, so we
Removing errors due to the way CSRF handling is done.
stormpath_express-stormpath
train
js
03f84656d8e5db3974d16e48959194201f3322f9
diff --git a/pymc/plots.py b/pymc/plots.py index <HASH>..<HASH> 100644 --- a/pymc/plots.py +++ b/pymc/plots.py @@ -45,6 +45,8 @@ def traceplot(trace, vars=None, figsize=None, lines=None, combined=False): traces = [trace.combined()] else: traces = trace.traces + else: + traces = [trace] n = len(vars)
Fix to address #<I>. Passes local tests.
pymc-devs_pymc
train
py
cd985d5bd8cdf7ea69c6ceddec934714ec686fcd
diff --git a/tests/integration/test_crossmodel.py b/tests/integration/test_crossmodel.py index <HASH>..<HASH> 100644 --- a/tests/integration/test_crossmodel.py +++ b/tests/integration/test_crossmodel.py @@ -180,19 +180,22 @@ async def test_add_bundle(event_loop): assert 'mysql' in model_1.applications await model_1.block_until( lambda: all(unit.workload_status == 'active' - for unit in application.units)) + for unit in application.units), + timeout=60 * 4) await model_1.create_offer("mysql:db") offers = await model_1.list_offers() await model_1.block_until( lambda: all(offer.application_name == 'mysql' - for offer in offers.results)) + for offer in offers.results), + timeout=60 * 4) # farm off a new model to test the consumption async with base.CleanModel() as model_2: await model_2.deploy('local:{}'.format(tmp_path)) await model_2.block_until( lambda: all(unit.agent_status == 'executing' - for unit in application.units)) + for unit in application.units), + timeout=60 * 4) await model_1.remove_offer("admin/{}.mysql".format(model_1.info.name), force=True)
introduce timouts to avoid complete blocks
juju_python-libjuju
train
py
768d1141f37324715f84371907c334e5e334dcdc
diff --git a/api/symboltable.py b/api/symboltable.py index <HASH>..<HASH> 100644 --- a/api/symboltable.py +++ b/api/symboltable.py @@ -428,6 +428,8 @@ class SymbolTable(object): entry.type_ = type_ entry.scope = SCOPE.global_ if self.current_scope == self.global_scope else SCOPE.local + entry.callable = False + entry.class_ = CLASS.var # Make it a variable if entry.type_ != type_: if not implicit and entry.type_ is not None:
Adds class and callable settings for variable declaration.
boriel_zxbasic
train
py