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
c6aac7a7c3c2d3491050f53b329325b38a5de9c0
diff --git a/app/models/concerns/worthwhile/solr_document_behavior.rb b/app/models/concerns/worthwhile/solr_document_behavior.rb index <HASH>..<HASH> 100644 --- a/app/models/concerns/worthwhile/solr_document_behavior.rb +++ b/app/models/concerns/worthwhile/solr_document_behavior.rb @@ -14,7 +14,7 @@ module Worthwhile end def to_param - noid + noid || id end ##
SolrDocument to_parm should work with noid or pid
samvera_hyrax
train
rb
730e90ffe66402f8c414dee311680073f1b0357d
diff --git a/indra/explanation/model_checker/pybel.py b/indra/explanation/model_checker/pybel.py index <HASH>..<HASH> 100644 --- a/indra/explanation/model_checker/pybel.py +++ b/indra/explanation/model_checker/pybel.py @@ -40,8 +40,10 @@ class PybelModelChecker(ModelChecker): include_variants=include_variants, symmetric_variant_links=symmetric_variant_links, include_components=include_components, - symmetric_component_links=symmetric_component_links) - self.graph = signed_edges_to_signed_nodes(signed_edges) + symmetric_component_links=symmetric_component_links, + propagate_annotations=True) + self.graph = signed_edges_to_signed_nodes( + signed_edges, copy_edge_data={'belief'}) return self.graph def process_statement(self, stmt):
Update pybel graph in modelchecker
sorgerlab_indra
train
py
bdafe63845b80ce6496c633f9edeceeb8fba849a
diff --git a/propagation.go b/propagation.go index <HASH>..<HASH> 100644 --- a/propagation.go +++ b/propagation.go @@ -178,7 +178,13 @@ func extractTraceContext(opaqueCarrier interface{}) (SpanContext, error) { return spanContext, ot.ErrSpanContextNotFound } - if !spanContext.Suppressed && (spanContext.SpanID == 0 != (spanContext.TraceIDHi == 0 && spanContext.TraceID == 0)) { + // when the context is not suppressed + // and instana headers either can not be parsed or present partially + // and w3 context is not there + if !spanContext.Suppressed && + (spanContext.SpanID == 0 != (spanContext.TraceIDHi == 0 && spanContext.TraceID == 0)) && + spanContext.W3CContext.IsZero() { + return spanContext, ot.ErrSpanContextCorrupted }
return from tracerS.Extract spanContext, when Instana headers were corrupted but w3 context was found
instana_go-sensor
train
go
30826e578b04a42e03aac86d51deb68f62b8e131
diff --git a/rachiopy/__init__.py b/rachiopy/__init__.py index <HASH>..<HASH> 100644 --- a/rachiopy/__init__.py +++ b/rachiopy/__init__.py @@ -33,11 +33,8 @@ class Rachio(object): (resp, content) = _HTTP.request(url, method, headers=self._headers, body=body) - status = resp.get('status') content_type = resp.get('content-type') - if status != '200': - content = None - elif content_type == 'application/json': + if content_type and content_type.startswith('application/json'): content = json.loads(content.decode('UTF-8')) return (resp, content)
Better handling of request responses. Better detection of JSON data encoding in the response.
rfverbruggen_rachiopy
train
py
17ed1477864dd101eb5264b86464e1298572e7eb
diff --git a/be/cli.py b/be/cli.py index <HASH>..<HASH> 100644 --- a/be/cli.py +++ b/be/cli.py @@ -128,10 +128,10 @@ def in_(ctx, context, yes): "BE_PROJECTROOT": os.path.join( _extern.cwd(), project).replace("\\", "/"), "BE_PROJECTSROOT": _extern.cwd(), - "BE_ACTIVE": "true", + "BE_ACTIVE": "True", } - for map_source, map_dest in settings.get("environment_map", {}).items(): + for map_source, map_dest in settings.get("redirect", {}).items(): env[map_dest] = env[map_source] if "BE_TESTING" in os.environ: @@ -378,7 +378,7 @@ def dump(): project = os.environ["BE_PROJECT"] root = os.environ["BE_PROJECTSROOT"] settings = _extern.load(project, "be", optional=True, root=root) - environ = settings.get("environment_map", {}).items() + environ = settings.get("redirect", {}).items() for map_source, map_dest in sorted(environ): lib.echo("%s=%s" % (map_dest, os.environ.get(map_dest)))
Refactored environment_map to redirect
mottosso_be
train
py
0ffd22745fb2eefe2c83cc3e84fd82b5a9bea2ca
diff --git a/lib/chrome/launch.js b/lib/chrome/launch.js index <HASH>..<HASH> 100644 --- a/lib/chrome/launch.js +++ b/lib/chrome/launch.js @@ -31,7 +31,7 @@ module.exports = function() { if (config.fps) args.push('--show-fps-counter') - const child = cp.spawn(path, args, { detached: process.platform !== 'win32' }) + const child = cp.spawn(path, args) child.on('error', err => { if (err.code === 'ENOENT')
Don't detach chrome (close on wright exit)
porsager_wright
train
js
6b79152d33c4c5d156cb3a8e7a9e15991f4a6d7e
diff --git a/src/Object3D.js b/src/Object3D.js index <HASH>..<HASH> 100644 --- a/src/Object3D.js +++ b/src/Object3D.js @@ -29,6 +29,8 @@ export default class Object3D { return this; } + raycast() {} + render(gl, scene, camera) { this.childs.forEach(object => object.render(gl, scene, camera)); } diff --git a/src/Renderer.js b/src/Renderer.js index <HASH>..<HASH> 100644 --- a/src/Renderer.js +++ b/src/Renderer.js @@ -1,6 +1,8 @@ export default class Renderer { constructor(options) { - this._container = document.getElementById(options.container); + this._container = typeof options.container === 'string' ? + document.getElementById(options.container) : options.container; + this._pixelRatio = options.pixelRatio || 1; this._antialias = options.antialias !== undefined ? options.antialias : true; this.autoClear = options.autoClear !== undefined ? options.autoClear : true;
add empty raycast method to object3d
2gis_2gl
train
js,js
59229e62e4c7007be58f5d8cd080a2758dc1ada6
diff --git a/acrachilisync-tools/src/main/java/fr/dudie/acrachilisync/tools/MigrateDescriptions.java b/acrachilisync-tools/src/main/java/fr/dudie/acrachilisync/tools/MigrateDescriptions.java index <HASH>..<HASH> 100644 --- a/acrachilisync-tools/src/main/java/fr/dudie/acrachilisync/tools/MigrateDescriptions.java +++ b/acrachilisync-tools/src/main/java/fr/dudie/acrachilisync/tools/MigrateDescriptions.java @@ -170,7 +170,8 @@ public class MigrateDescriptions { msg.append(pIssue.getDescription()); LOGGER.trace(msg.toString()); } - // redmine.updateIssue(pIssue); + LOGGER.info("update Issue #{}", pIssue.getId()); + redmine.updateIssue(pIssue); } catch (final Exception e) { throw new DescriptionUpgradeException(pIssue, e); }
uncomment call to redmine.updateIssue()
jeremiehuchet_acrachilisync
train
java
4370168485aeafa4dda23287947f996af9a4df2d
diff --git a/src/Adapter/AbstractCriterion.php b/src/Adapter/AbstractCriterion.php index <HASH>..<HASH> 100644 --- a/src/Adapter/AbstractCriterion.php +++ b/src/Adapter/AbstractCriterion.php @@ -81,7 +81,7 @@ abstract class AbstractCriterion implements IteratorAggregate * @return static The found criterion * @throws CriterionNotFoundException if the criterion is not found */ - protected function getCriterion($name) + public function getCriterion($name) { if ($name instanceof self) { $name = $name->getName();
The getter from the AbstractCriterion is now public
Calendart_CalendArt
train
php
e16050158a6c557695a3acf6ca6e5ea08c453a2c
diff --git a/src/ExternalModule.php b/src/ExternalModule.php index <HASH>..<HASH> 100644 --- a/src/ExternalModule.php +++ b/src/ExternalModule.php @@ -75,7 +75,6 @@ class ExternalModule extends Module implements iExternalModule return $o; } - /** Обработчик сериализации объекта */ public function __sleep() { @@ -83,15 +82,6 @@ class ExternalModule extends Module implements iExternalModule return array_diff( array_keys( get_object_vars( $this )), array( 'view_path', 'view_html', 'view_data' )); } - /** Deserialization logic */ - public function __wakeup() - { - parent::__wakeup(); - - // Subscribe to an config ready core event - Event::subscribe('core.started', array($this, 'init')); - } - /** @see Module::duplicate() */ public function & duplicate( $id, $class_name = null ) {
Removed Event::subscribe from ExternalModule from __wakeup
samsonos_php_core
train
php
398357be6a712ac4a5e62345a6a7215d96b91ce8
diff --git a/lib/pake/pakeGit.class.php b/lib/pake/pakeGit.class.php index <HASH>..<HASH> 100644 --- a/lib/pake/pakeGit.class.php +++ b/lib/pake/pakeGit.class.php @@ -20,6 +20,11 @@ class pakeGit $this->repository_path = $repository_path; } + public function getPath() + { + return $this->repository_path; + } + public function add($files = null) { if (null === $files) {
as repository-path is guessed sometimes, code might need to get real path at some point
indeyets_pake
train
php
33b7c734547f9a4594a364710963a1bbb9dc1440
diff --git a/src/usertiming.js b/src/usertiming.js index <HASH>..<HASH> 100644 --- a/src/usertiming.js +++ b/src/usertiming.js @@ -453,8 +453,8 @@ window.performance.measure = function (measureName, startMark, endMark) { var now = window.performance.now(); - if (!measureName) { - throw new Error('Measure must be specified'); + if (typeof(measureName) === 'undefined') { + throw new SyntaxError('Measure must be specified'); } // if there isn't a startMark, we measure from navigationStart to now
measure() without a measureName should do a typeof check instead of truthy, and throw a SyntaxError
nicjansma_usertiming.js
train
js
75131c81db87bc8add1b28b5f4d0f99ef0a6ce32
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -43,6 +43,6 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-simple-mocha'); grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.registerTask('phpwatch', ['php:test', 'watch']); + grunt.registerTask('phpwatch', ['php:test200', 'watch']); grunt.registerTask('default', ['php:test200', 'php:test301', 'simplemocha:test']); };
Fix target in `phpwatch` task to point to a valid target.
sindresorhus_grunt-php
train
js
c0ae8a032bf96cad88ef51a9f857a8bbc9dcd892
diff --git a/test.py b/test.py index <HASH>..<HASH> 100644 --- a/test.py +++ b/test.py @@ -1,6 +1,7 @@ import contextlib import datetime +import time import unittest2 import pyoo @@ -633,12 +634,14 @@ class ChartsTestCase(BaseTestCase): with self.create_chart() as chart: series = chart.diagram.series[0] series.line_color = 0xFF0000 + time.sleep(0.1) # OpenOffice needs some time to apply the change self.assertEqual(0xFF0000, series.line_color) def test_series_fill_color(self): with self.create_chart() as chart: series = chart.diagram.series[0] series.fill_color = 0xFF0000 + time.sleep(0.1) # OpenOffice needs some time to apply the change self.assertEqual(0xFF0000, series.fill_color)
Fix failing tests because of delay before changes are applied by OpenOffice.
mila_pyoo
train
py
ca119af43df5aeb286c1ff0830e7b9e9e6d4b7d2
diff --git a/devices/orvibo.js b/devices/orvibo.js index <HASH>..<HASH> 100644 --- a/devices/orvibo.js +++ b/devices/orvibo.js @@ -75,6 +75,26 @@ module.exports = [ }, }, { + zigbeeModel: ['396483ce8b3f4e0d8e9d79079a35a420'], + model: 'CM10ZW', + vendor: 'ORVIBO', + description: 'Multi-functional 3 gang relay', + extend: extend.switch(), + exposes: [e.switch().withEndpoint('l1'), e.switch().withEndpoint('l2'), e.switch().withEndpoint('l3')], + endpoint: (device) => { + return {l1: 1, l2: 2, l3: 3}; + }, + meta: {multiEndpoint: true}, + configure: async (device, coordinatorEndpoint, logger) => { + const endpoint1 = device.getEndpoint(1); + await reporting.bind(endpoint1, coordinatorEndpoint, ['genOnOff']); + const endpoint2 = device.getEndpoint(2); + await reporting.bind(endpoint2, coordinatorEndpoint, ['genOnOff']); + const endpoint3 = device.getEndpoint(3); + await reporting.bind(endpoint3, coordinatorEndpoint, ['genOnOff']); + }, + }, + { zigbeeModel: ['b467083cfc864f5e826459e5d8ea6079'], model: 'ST20', vendor: 'ORVIBO',
Add CM<I>ZW (#<I>) The new CM<I>ZW model is a multi-functional 3 gang relay to replace the RL<I>QZB model. It's the same device, with a different ID. Issue : <URL>
Koenkk_zigbee-shepherd-converters
train
js
bed35da9a4d9e2a35077d995d55b33db3f7a8035
diff --git a/lib/couchdb/database.rb b/lib/couchdb/database.rb index <HASH>..<HASH> 100644 --- a/lib/couchdb/database.rb +++ b/lib/couchdb/database.rb @@ -285,6 +285,15 @@ module Couchdb Response.new(http.request(uri, req)) end + def head(doc_id, credentials = nil) + uri = doc_uri(doc_id) + req = Net::HTTP::Head.new(uri.to_s) + + set_credentials(req, credentials) + + Response.new(http.request(uri, req)) + end + def get_attachment(loc, credentials = nil, &block) uri = doc_uri(loc) req = Net::HTTP::Get.new(uri.to_s)
Couchdb::Database#head. #<I>. Useful for detecting the presence of a document, which in turn is useful for attaching objects to documents. (In order to attach objects to documents, a rev must be provided. The easiest way to get that rev, if it isn't already present, is to do a HEAD on the document ID.)
yipdw_analysand
train
rb
0d1412a1e2997042299ed95212351ba09a3f918a
diff --git a/lib/Unexpected.js b/lib/Unexpected.js index <HASH>..<HASH> 100644 --- a/lib/Unexpected.js +++ b/lib/Unexpected.js @@ -258,7 +258,14 @@ Unexpected.prototype.addType = function (type) { return inspect.apply(this, arguments); } }; - this.types.unshift(extendedType); + if (extendedType.identify === false) { + extendedType.identify = function () { + return false; + }; + this.types.push(extendedType); + } else { + this.types.unshift(extendedType); + } return this.expect; }; diff --git a/lib/types.js b/lib/types.js index <HASH>..<HASH> 100644 --- a/lib/types.js +++ b/lib/types.js @@ -572,9 +572,7 @@ module.exports = function (expect) { base: 'array', digitWidth: 2, hexDumpWidth: 16, - identify: function () { - return false; - }, + identify: false, equal: function (a, b) { if (a === b) { return true;
Add support for "abstract" types (identify: false).
unexpectedjs_unexpected
train
js,js
0cc29f815447d1b7cf6efe5b9d22d77765213dc5
diff --git a/src/de/mrapp/android/preference/activity/PreferenceFragment.java b/src/de/mrapp/android/preference/activity/PreferenceFragment.java index <HASH>..<HASH> 100644 --- a/src/de/mrapp/android/preference/activity/PreferenceFragment.java +++ b/src/de/mrapp/android/preference/activity/PreferenceFragment.java @@ -255,7 +255,7 @@ public abstract class PreferenceFragment extends final Object oldValue, final Object newValue) { for (RestoreDefaultsListener listener : restoreDefaultsListeners) { listener.onRestoredDefaultValue(this, preference, oldValue, - newValue); + newValue != null ? newValue : oldValue); } }
Bugfix #3: The new value, which is passed to a listener, is not null anymore, when restoring the default value has not changed the value.
michael-rapp_AndroidPreferenceActivity
train
java
706c0672d906da7dbded86e4ae1219bee6362d60
diff --git a/examples/opf/bin/OpfRunExperiment.py b/examples/opf/bin/OpfRunExperiment.py index <HASH>..<HASH> 100755 --- a/examples/opf/bin/OpfRunExperiment.py +++ b/examples/opf/bin/OpfRunExperiment.py @@ -20,7 +20,7 @@ # ---------------------------------------------------------------------- """This script is a command-line client of Online Prediction Framework (OPF). -It executes a single expiriment. +It executes a single experiment. """ @@ -39,7 +39,10 @@ def main(): # in the 'conf' subdirectory of the NuPic install location. nupic.support.initLogging(verbose=True) - # Initialize PRNGs + # Initialize pseudo-random number generators (PRNGs) + # + # This will fix the seed that is used by numpy when generating 'random' + # numbers. This allows for repeatability across experiments. initExperimentPrng() # Run it!
Fix typos, expand non-obvious acronyms.
numenta_nupic
train
py
95a35477b2fe5629e31c36013e81a36724719019
diff --git a/marshmallow_jsonapi/fields.py b/marshmallow_jsonapi/fields.py index <HASH>..<HASH> 100644 --- a/marshmallow_jsonapi/fields.py +++ b/marshmallow_jsonapi/fields.py @@ -7,6 +7,7 @@ from marshmallow.fields import * # noqa from .utils import resolve_params, get_value_or_raise + class BaseRelationship(Field): """Base relationship field. This is used by `marshmallow_jsonapi.Schema` to determine which fields should be formatted as relationship objects. @@ -98,6 +99,25 @@ class Relationship(BaseRelationship): } return included_data + def validate_type(self, relationship): + if 'type' not in relationship: + raise ValueError('Must have a `type` field') + if relationship['type'] != self.type_: + raise ValueError('Invalid `type` specified') + + def _deserialize(self, value, attr, obj): + if self.many: + data = value.get('data', []) + for item in data: + self.validate_type(item) + else: + data = value.get('data', {}) + self.validate_type(data) + + if self.many: + return [item.get('id') for item in data] + return data.get('id') + def _serialize(self, value, attr, obj): dict_class = self.parent.dict_class if self.parent else dict ret = dict_class()
Overloaded _deserialize method and added type validation
marshmallow-code_marshmallow-jsonapi
train
py
b185639d30525aac279b2262ffe01d9b447829db
diff --git a/src/AddMany.php b/src/AddMany.php index <HASH>..<HASH> 100644 --- a/src/AddMany.php +++ b/src/AddMany.php @@ -106,7 +106,7 @@ class AddMany { return false; } $subpost = new \SubPost; - $subpost->set('post_title', 'subpost'); + $subpost->set('post_title', 'AddMany subpost '.md5(mt_rand())); $subpost->set('post_parent', $post_data['parent_id']); $subpost->set( 'field_assigned_to',
Make title and slug of subpost unique
jasand-pereza_addmany
train
php
3ba2ca9c06a6f4eaf2e0d62e19c06f5014d5b25b
diff --git a/src/locale/lang/ua.js b/src/locale/lang/ua.js index <HASH>..<HASH> 100644 --- a/src/locale/lang/ua.js +++ b/src/locale/lang/ua.js @@ -1,7 +1,7 @@ export default { el: { colorpicker: { - confirm: 'OK', + confirm: 'Обрати', clear: 'Очистити' }, datepicker: { @@ -107,14 +107,14 @@ export default { hasCheckedFormat: '{checked}/{total} вибрано' }, image: { - error: 'FAILED' // to be translated + error: 'ПОМИЛКА' }, pageHeader: { - title: 'Back' // to be translated + title: 'Назад' }, popconfirm: { - confirmButtonText: 'Yes', // to be translated - cancelButtonText: 'No' // to be translated + confirmButtonText: 'Так', + cancelButtonText: 'Ні' } } };
fix: Update ua locale (#<I>)
ElemeFE_element
train
js
db48ee38471b95cca883217f671d271b6119afc8
diff --git a/activerecord/lib/active_record/model_schema.rb b/activerecord/lib/active_record/model_schema.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/model_schema.rb +++ b/activerecord/lib/active_record/model_schema.rb @@ -115,7 +115,7 @@ module ActiveRecord # the documentation for ActiveRecord::Base#table_name. def table_name=(value) @original_table_name = @table_name if defined?(@table_name) - @table_name = value + @table_name = value && value.to_s @quoted_table_name = nil @arel_table = nil @relation = Relation.new(self, arel_table) diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index <HASH>..<HASH> 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1446,6 +1446,11 @@ class BasicsTest < ActiveRecord::TestCase end end + def test_set_table_name_symbol_converted_to_string + Joke.table_name = :cold_jokes + assert_equal 'cold_jokes', Joke.table_name + end + def test_quoted_table_name_after_set_table_name klass = Class.new(ActiveRecord::Base)
call to_s on value passed to table_name=
rails_rails
train
rb,rb
9d92a958c4d817d786bdee6749a563151ee811e6
diff --git a/lib/config/cli.js b/lib/config/cli.js index <HASH>..<HASH> 100644 --- a/lib/config/cli.js +++ b/lib/config/cli.js @@ -22,7 +22,8 @@ function getConfig(argv) { const coersions = { boolean: val => val === 'true', - list: val => val.split(',').map(el => el.trim()), + list: val => + val === '[]' || val === '' ? [] : val.split(',').map(el => el.trim()), string: val => val, integer: parseInt, };
refactor: massage [] or empty string for cli lists
renovatebot_renovate
train
js
c5ba7efa1eb4413ab6c6c62d37b592f62d8b1d83
diff --git a/lib/puppet/face/facts.rb b/lib/puppet/face/facts.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/face/facts.rb +++ b/lib/puppet/face/facts.rb @@ -11,7 +11,7 @@ EXCLUDE_LIST = %w[ facterversion memory\.swap\.available memory\.swap\.capacity memory\.swap\.used memory\.system\.available_bytes memory\.system\.used_bytes memory\.system\.available memory\.system\.capacity memory\.system\.used - mountpoints\..*\.available* mountpoints\..*\.capacity mountpoints\..*\.used* + mountpoints\..*\.available.* mountpoints\..*\.capacity mountpoints\..*\.used.* sp_uptime system_profiler\.uptime uptime uptime_days uptime_hours uptime_seconds system_uptime\.uptime system_uptime\.days system_uptime\.hours system_uptime\.seconds
(maint) Fix exclude_list for `puppet facts diff` This commit adds missing characters from the `EXCLUDE_LIST` array of regular expressions used for filtering the `puppet facts diff` output of volatile facts.
puppetlabs_puppet
train
rb
489aaa3ff9dda4875968d66e38cf3d42087ab67c
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -23,6 +23,7 @@ require 'vcr' VCR.configure do |c| c.cassette_library_dir = 'spec/fixtures/coal_cassettes' c.hook_into :webmock + config.ignore_hosts 'codeclimate.com' end require_relative 'support/api_settings'
VCR should ignore codeclimate.com
locomotivecms_coal
train
rb
94c13ce90af64c24687b996b407f359ca8bea61c
diff --git a/src/main/java/io/redlink/sdk/util/ApiHelper.java b/src/main/java/io/redlink/sdk/util/ApiHelper.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/redlink/sdk/util/ApiHelper.java +++ b/src/main/java/io/redlink/sdk/util/ApiHelper.java @@ -12,7 +12,7 @@ import java.util.regex.Pattern; */ public class ApiHelper { - public static final Pattern VERSION_PATTERN= Pattern.compile("(\\d)+\\.(\\d)+(\\.\\d+)?\\-([A-Z]+)(\\-SNAPSHOT)?"); + public static final Pattern VERSION_PATTERN = Pattern.compile("(\\d)+\\.(\\d)+(\\.\\d+)?\\-([A-Z]+)(\\-SNAPSHOT)?"); /** * Build a proper api version from the artifact version @@ -21,7 +21,8 @@ public class ApiHelper { * @see <a href="http://dev.redlink.io/sdk#introduction">api/sdk versioning</a> */ public static String getApiVersion() { - return getApiVersion(ApiHelper.class.getPackage().getImplementationVersion()); + String version = getApiVersion(ApiHelper.class.getPackage().getImplementationVersion()); + return (version != null ? version : "1.0-ALPHA"); //FIXME } /**
quick fix for getting the version when sdk is used as library (TODO: solve this)
redlink-gmbh_redlink-java-sdk
train
java
7b40847da69a90579ab0a29a7963239140a2592f
diff --git a/lib/data_mapper/support/inflection.rb b/lib/data_mapper/support/inflection.rb index <HASH>..<HASH> 100644 --- a/lib/data_mapper/support/inflection.rb +++ b/lib/data_mapper/support/inflection.rb @@ -2,7 +2,9 @@ # part of the Ruby On Rails web-framework (http://rubyonrails.org) # # Methods have been modified or removed. English inflection is now provided via -# the english gem (http://english.rubyforge.org) +# the english gem (http://english.rubyforge.org) +# +# sudo gem install english # require 'english/inflect' module DataMapper
You must have english gem installed now. sudo gem install english
datamapper_dm-core
train
rb
e0aaf2c2e0b89e2d8993a8bdb2f19164a0230cf0
diff --git a/pyrax/fakes.py b/pyrax/fakes.py index <HASH>..<HASH> 100644 --- a/pyrax/fakes.py +++ b/pyrax/fakes.py @@ -619,7 +619,7 @@ class FakeIdentity(BaseIdentity): self._default_region = random.choice(("DFW", "ORD")) self.services = {"fake": FakeIdentityService(self)} - def authenticate(self): + def authenticate(self, connect=False): if ((self.username == self._good_username) and (self.password == self._good_password)): self._parse_response(self.fake_response())
Add backwards compatibility param to fake method
pycontribs_pyrax
train
py
984536c12b25fc182362bbc9ba26c474e2fb5b10
diff --git a/lint-staged.config.js b/lint-staged.config.js index <HASH>..<HASH> 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,6 +1,6 @@ 'use strict'; module.exports = { - '*.js': ['prettier --write', 'eslint --fix', 'git add'], - '*.{json,md,yml,css}': ['prettier --write', 'git add'], + '*.js': ['prettier --write', 'eslint --fix'], + '*.{json,md,yml,css}': ['prettier --write'], };
chore: update lint-staged config (#<I>)
webpack_webpack-dev-server
train
js
759749c50d34efb2ef4f4ed9331d9a7c436a67cf
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -49,6 +49,7 @@ setup(name='palladium', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', ], packages=find_packages(), include_package_data=True,
Added Python <I> support info to setup.py
ottogroup_palladium
train
py
5590ec3d3628109c20b9e64d826ac2fbd4040d0d
diff --git a/underfs/swift/src/main/java/tachyon/underfs/swift/SwiftUnderFileSystemUtils.java b/underfs/swift/src/main/java/tachyon/underfs/swift/SwiftUnderFileSystemUtils.java index <HASH>..<HASH> 100644 --- a/underfs/swift/src/main/java/tachyon/underfs/swift/SwiftUnderFileSystemUtils.java +++ b/underfs/swift/src/main/java/tachyon/underfs/swift/SwiftUnderFileSystemUtils.java @@ -22,9 +22,11 @@ import tachyon.conf.TachyonConf; public class SwiftUnderFileSystemUtils { /** - * Replace default key with user provided key - * @param conf - * @param key + * Replaces default key with user provided key. + * + * @param conf the Hadoop configuration + * @param tachyonConf the Tachyon configuration + * @param key the key to add */ public static void addKey(Configuration conf, TachyonConf tachyonConf, String key) { if (System.getProperty(key) != null && conf.get(key) == null) {
Fixing "mvn site" warnings and cleaning up JavaDoc style in tachyon.underfs.swift.
Alluxio_alluxio
train
java
b4c73bee1b2cf9eed8686d42c4544c3b22c0161a
diff --git a/samples/send.js b/samples/send.js index <HASH>..<HASH> 100644 --- a/samples/send.js +++ b/samples/send.js @@ -29,6 +29,7 @@ var fs = require('fs'); var types = { service: String, topic: String, + id: String, 'message-ttl': Number, delay: Number, file: String
Add id to known types for send.js
mqlight_nodejs-mqlight
train
js
c5b6d6b756b75d716e7d3a3c9ebbcdf8d577e0ea
diff --git a/packages/perspective-common/common.config.js b/packages/perspective-common/common.config.js index <HASH>..<HASH> 100644 --- a/packages/perspective-common/common.config.js +++ b/packages/perspective-common/common.config.js @@ -1,17 +1,21 @@ const UglifyJSPlugin = require('uglifyjs-webpack-plugin'); +const plugins = [] + +if (!process.env.PSP_FASTCOMP) { + plugins.push(new UglifyJSPlugin({ + sourceMap: true, + uglifyOptions: { + sourceMap: true, + ecma: 5 + } + })); +} + module.exports = function() { return { - plugins: [ - new UglifyJSPlugin({ - sourceMap: true, - uglifyOptions: { - sourceMap: true, - ecma: 5 - } - }) - ], + plugins: plugins, devtool: 'source-map', node: { fs: "empty"
Added flag to disable minification for faster development builds.
finos_perspective
train
js
4a70fb3353107bf1be596958d395ec29b32dbbec
diff --git a/src/Monolog/Handler/BufferHandler.php b/src/Monolog/Handler/BufferHandler.php index <HASH>..<HASH> 100644 --- a/src/Monolog/Handler/BufferHandler.php +++ b/src/Monolog/Handler/BufferHandler.php @@ -126,4 +126,22 @@ class BufferHandler extends AbstractHandler $this->handler->reset(); } } + + /** + * {@inheritdoc} + */ + public function setFormatter(FormatterInterface $formatter) + { + $this->handler->setFormatter($formatter); + + return $this; + } + + /** + * {@inheritdoc} + */ + public function getFormatter() + { + return $this->handler->getFormatter(); + } }
Add formatter forwarding to BufferHandler as well
Seldaek_monolog
train
php
6a4b8081e003183ad1b36006ea4949e0b0cb89d8
diff --git a/test/Utils/ProjectTest.php b/test/Utils/ProjectTest.php index <HASH>..<HASH> 100644 --- a/test/Utils/ProjectTest.php +++ b/test/Utils/ProjectTest.php @@ -52,10 +52,10 @@ class ProjectTest extends \PHPUnit_Framework_TestCase public function testDownloadArchive() { $project = new Project(sys_get_temp_dir() . '/project' . rand()); - $archiveUrl = 'https://github.com/GoogleCloudPlatform/google-cloud-php/archive/master.zip'; + $archiveUrl = 'https://github.com/GoogleCloudPlatform/google-cloud-php/archive/main.zip'; $project->downloadArchive('Google Cloud client libraries', $archiveUrl); $this->assertTrue(file_exists( - $project->getDir() . '/google-cloud-php-master/composer.json')); + $project->getDir() . '/google-cloud-php-main/composer.json')); } public function testCopyFiles()
chore: fix master main (#<I>)
GoogleCloudPlatform_php-tools
train
php
6b2e5dce8c8be52981b21ae5863b90dd6cf0dc1e
diff --git a/apiclient/discovery.py b/apiclient/discovery.py index <HASH>..<HASH> 100644 --- a/apiclient/discovery.py +++ b/apiclient/discovery.py @@ -64,6 +64,11 @@ class JsonModel(object): def request(self, headers, path_params, query_params, body_value): query = self.build_query(query_params) headers['accept'] = 'application/json' + if 'user-agent' in headers: + headers['user-agent'] += ' ' + else: + headers['user-agent'] = '' + headers['user-agent'] += 'google-api-client-python/1.0' if body_value is None: return (headers, path_params, query, None) else:
Added user-agent for the library
googleapis_oauth2client
train
py
11f4c1cbfc161551f9c9c595afbf358cbcd623c6
diff --git a/neurondm/neurondm/models/apinat_npo.py b/neurondm/neurondm/models/apinat_npo.py index <HASH>..<HASH> 100644 --- a/neurondm/neurondm/models/apinat_npo.py +++ b/neurondm/neurondm/models/apinat_npo.py @@ -81,10 +81,20 @@ def main(): log.error(f'bad data for {c} {s} {p} {o}') raise e + problems = ('8a', '8v', 'sstom-6', 'keast-2', 'sdcol-k', 'sdcol-l') + def eff(n): + return bool([x for x in problems + if x in n.id_ and '20' not in n.id_]) + config = Config('apinat-simple-sheet') + sigh = [] nrns = [] for id, phenos in dd.items(): n = NeuronApinatSimple(*phenos, id_=id) + if eff(n): + n._sigh() # XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX FIXME figure out why this is not getting called internally + sigh.append(n) + nrns.append(n) config.write()
apinat npo hardcode fix for _sigh failures amusingly I named the variable sigh before I knew that _sigh not being called was the issue
tgbugs_pyontutils
train
py
ffc1f2a2e495a303904e4119de080b046d885cd2
diff --git a/luigi/parameter.py b/luigi/parameter.py index <HASH>..<HASH> 100644 --- a/luigi/parameter.py +++ b/luigi/parameter.py @@ -94,9 +94,9 @@ class Parameter(object): * Any value provided on the command line: - - With qualified task name (eg. ``--TaskA-param xyz``) + - To the root task (eg. ``--param xyz``) - - Without (eg. ``--param xyz``) + - Then to the class, using the qualified task name syntax (eg. ``--TaskA-param xyz``). * With ``[TASK_NAME]>PARAM_NAME: <serialized value>`` syntax. See :ref:`ParamConfigIngestion`
docs: Correct order of parameter resolution There were some changes in #<I> and #<I> in which I forgot to update the docs.
spotify_luigi
train
py
873cabd6cef77f88d57c261417bc2a4563538e45
diff --git a/salt/_compat.py b/salt/_compat.py index <HASH>..<HASH> 100644 --- a/salt/_compat.py +++ b/salt/_compat.py @@ -144,6 +144,12 @@ class IPv6AddressScoped(ipaddress.IPv6Address): :param address: ''' + # pylint: disable-all + if not hasattr(self, '_is_packed_binary'): + # This method (below) won't be around for some Python 3 versions + # and we need check this differently anyway + self._is_packed_binary = lambda p: isinstance(p, bytes) + # pylint: enable-all if isinstance(address, string_types) and '%' in address: buff = address.split('%') if len(buff) != 2:
Roll back some changes to _compat.py
saltstack_salt
train
py
ca846ef9df6c4d21c2be2cb5277ccd5ce0dc29fc
diff --git a/openquake/commonlib/readinput.py b/openquake/commonlib/readinput.py index <HASH>..<HASH> 100644 --- a/openquake/commonlib/readinput.py +++ b/openquake/commonlib/readinput.py @@ -380,9 +380,9 @@ def get_site_collection(oqparam): an :class:`openquake.commonlib.oqvalidation.OqParam` instance """ mesh = get_mesh(oqparam) + req_site_params = get_gsim_lt(oqparam).req_site_params if oqparam.inputs.get('site_model'): sm = get_site_model(oqparam) - req_site_params = set(sm.dtype.names) - {'lon', 'lat'} try: # in the future we could have elevation in the site model depth = sm['depth'] @@ -420,7 +420,6 @@ def get_site_collection(oqparam): # a None sitecol is okay when computing the ruptures only return else: # use the default site params - req_site_params = get_gsim_lt(oqparam).req_site_params sitecol = site.SiteCollection.from_points( mesh.lons, mesh.lats, mesh.depths, oqparam, req_site_params) ss = os.environ.get('OQ_SAMPLE_SITES')
Restored req_site_params as it was [skip CI]
gem_oq-engine
train
py
62487aecbf32286d2c142c90f30a3c29a52386ef
diff --git a/views/js/qtiCreator/editor/ckEditor/htmlEditor.js b/views/js/qtiCreator/editor/ckEditor/htmlEditor.js index <HASH>..<HASH> 100755 --- a/views/js/qtiCreator/editor/ckEditor/htmlEditor.js +++ b/views/js/qtiCreator/editor/ckEditor/htmlEditor.js @@ -172,17 +172,8 @@ define([ } - /* - dirty trick: shows and hides combo boxes (styles for instance) - in the CKE toolbar and acts as a pre-loader for the iframes in these boxes - */ - $('#cke_' + e.editor.name).find('.cke_combo_button').each(function(){ - var btn = this; - btn.click(); - setTimeout(function(){ - btn.click(); - }, 500); - }); + //fix ck editor combo box display issue + $('#cke_' + e.editor.name + ' .cke_combopanel').hide(); //store it in editable elt data attr $editable.data('editor', editor); @@ -235,6 +226,7 @@ define([ }, blur : function(e){ + return false; if(options.hideTriggerOnBlur){ $trigger.hide(); }
replace old dirty hack with a better fix for ck combobox visibility issue
oat-sa_extension-tao-itemqti
train
js
b224ac389d00161b77df5e204bd39d67335ec766
diff --git a/ospd/ospd.py b/ospd/ospd.py index <HASH>..<HASH> 100644 --- a/ospd/ospd.py +++ b/ospd/ospd.py @@ -504,11 +504,6 @@ class OSPDaemon: stream.close() - def calculate_progress(self, scan_id: str) -> float: - """ Calculate the total scan progress. """ - - return self.scan_collection.calculate_target_progress(scan_id) - def process_finished_hosts(self, scan_id: str, finished_hosts: str) -> None: """ Process the finished hosts before launching the scans.""" @@ -606,7 +601,7 @@ class OSPDaemon: ): self.scan_collection.set_host_progress(scan_id, host_progress) - scan_progress = self.calculate_progress(scan_id) + scan_progress = self.scan_collection.calculate_target_progress(scan_id) self.scan_collection.set_progress(scan_id, scan_progress) def set_scan_host_progress(
Remove wrapper and access scan_collection method directly
greenbone_ospd
train
py
5d34880640aafcfdb12be44b6b05e41e34f1f921
diff --git a/Model/Api/ShippingMethods.php b/Model/Api/ShippingMethods.php index <HASH>..<HASH> 100644 --- a/Model/Api/ShippingMethods.php +++ b/Model/Api/ShippingMethods.php @@ -795,7 +795,7 @@ class ShippingMethods implements ShippingMethodsInterface $ignoredShippingAddressCoupons = $this->configHelper->getIgnoredShippingAddressCoupons($quote->getStoreId()); return $parentQuoteCoupon && - !$quote->getCouponCode() && - in_array($parentQuoteCoupon, $ignoredShippingAddressCoupons); + in_array($parentQuoteCoupon, $ignoredShippingAddressCoupons) && + !$quote->setTotalsCollectedFlag(false)->collectTotals()->getCouponCode(); } }
Collect immutable quote totals when checking if the coupon is invalid for the shipping address (#<I>)
BoltApp_bolt-magento2
train
php
969ddd0ff3d30f7c4e0019bef26cf20e6ae7729a
diff --git a/acceptance-tests/src/test/java/me/atam/atam4jsampleapp/PassingTestAcceptanceTest.java b/acceptance-tests/src/test/java/me/atam/atam4jsampleapp/PassingTestAcceptanceTest.java index <HASH>..<HASH> 100644 --- a/acceptance-tests/src/test/java/me/atam/atam4jsampleapp/PassingTestAcceptanceTest.java +++ b/acceptance-tests/src/test/java/me/atam/atam4jsampleapp/PassingTestAcceptanceTest.java @@ -14,11 +14,12 @@ public class PassingTestAcceptanceTest extends AcceptanceTest { public static final int MAX_ATTEMPTS = 2000; public static final int RETRY_POLL_INTERVAL = 1; + public static final int TEN_SECONDS_IN_MILLIS = 10000; @Test public void givenSampleApplicationStartedWithPassingTest_whenHealthCheckCalledBeforeTestRun_thenTooEarlyMessageReceived(){ - applicationConfigurationDropwizardTestSupport = Atam4jApplicationStarter.startApplicationWith(PassingTest.class, 1000); + applicationConfigurationDropwizardTestSupport = Atam4jApplicationStarter.startApplicationWith(PassingTest.class, TEN_SECONDS_IN_MILLIS); checkResponseIsOKAndWithMessage(AcceptanceTestsHealthCheck.TOO_EARLY_MESSAGE, getResponseFromHealthCheck()); }
Increased intital delay to ten seconds as sometimes tests were completing quicker than expected and making the actual test fail.
atam4j_atam4j
train
java
91e7fd8b945874f4747023e211a5f366ff1154b2
diff --git a/lib/carbon_date/version.rb b/lib/carbon_date/version.rb index <HASH>..<HASH> 100644 --- a/lib/carbon_date/version.rb +++ b/lib/carbon_date/version.rb @@ -1,3 +1,3 @@ module CarbonDate - VERSION = "0.0.4" + VERSION = "0.0.5" end
Bumped version to <I>
bradleymarques_carbon_date
train
rb
321d5391813caf1e3bfc13675b9c7cb3944b513d
diff --git a/lib/phobos/deep_struct.rb b/lib/phobos/deep_struct.rb index <HASH>..<HASH> 100644 --- a/lib/phobos/deep_struct.rb +++ b/lib/phobos/deep_struct.rb @@ -16,9 +16,10 @@ module Phobos end def to_deep_struct(v) - if v.is_a?(Hash) + case v + when Hash self.class.new(v) - elsif v.is_a?(Array) + when Enumerable v.map { |el| to_deep_struct(el) } else v
Moved from if-elseif to case
phobos_phobos
train
rb
c2d91cb7cdbb21200130cd59a989704b8c2bce2d
diff --git a/cmd/fe/main.go b/cmd/fe/main.go index <HASH>..<HASH> 100644 --- a/cmd/fe/main.go +++ b/cmd/fe/main.go @@ -105,7 +105,11 @@ Options: var assets string if s, ok := utils.Argument(d, "--assets-dir"); ok { - assets = s + abspath, err := filepath.Abs(s) + if err != nil { + log.PanicErrorf(err, "get absolute path of %s failed", s) + } + assets = abspath } else { binpath, err := filepath.Abs(filepath.Dir(os.Args[0])) if err != nil { @@ -115,12 +119,9 @@ Options: } log.Warnf("set assets = %s", assets) - fi, err := os.Stat(assets) - if err != nil { - log.PanicErrorf(err, "get stat of %s failed", assets) - } - if !fi.IsDir() { - log.Panicf("%s is not a directory", assets) + indexFile := filepath.Join(assets, "index.html") + if _, err := os.Stat(indexFile); err != nil { + log.PanicErrorf(err, "get stat of %s failed", indexFile) } var loader ConfigLoader
fe: panic if index.html doesn't exist
CodisLabs_codis
train
go
11ff6f646ebb73a3b388327b145c9338ea89f80d
diff --git a/piprot/piprot.py b/piprot/piprot.py index <HASH>..<HASH> 100755 --- a/piprot/piprot.py +++ b/piprot/piprot.py @@ -90,7 +90,7 @@ def get_version_and_release_date(requirement, version=None, verbose=False, relea print ('{} isn\'t even on PyPi. Check that the project still exists!'.format( requirement)) return None, None - except: + except ValueError: if verbose: print ('Decoding the JSON response for {} ({}) failed'.format(requirement, version)) return None, None
Remove that hideous except: and replace it with ValueError
sesh_piprot
train
py
c3259ccd66863d119d94c28cca16f1b0d105efbc
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -13,22 +13,23 @@ import os from setuptools import setup -def read(fname): - return open(os.path.join(os.path.dirname(__file__), fname)).read() +LONG_DESC = open('pypi_readme.rst').read() +LICENSE = open('LICENSE').read() setup( name="mbed-cli", - packages=["mbed"], version="0.8.6", + description="ARM mbed command line tool for repositories version control, publishing and updating code from remotely hosted repositories (GitHub, GitLab and mbed.org), and invoking mbed OS own build system and export functions, among other operations", + long_description=LONG_DESC, url='http://github.com/ARMmbed/mbed-cli', author='ARM mbed', author_email='[email protected]', - license='Apache-2.0', + license=LICENSE, + packages=["mbed"], entry_points={ 'console_scripts': [ 'mbed=mbed.mbed:main', 'mbed-cli=mbed.mbed:main', ] }, - long_description=read('pypi_readme.rst'), )
Improve package information (e.g. description and license
ARMmbed_mbed-cli
train
py
db8a26734ad11aa82c7e6d04f4a6ea271ffd6477
diff --git a/app/javascripts/FormInput.js b/app/javascripts/FormInput.js index <HASH>..<HASH> 100644 --- a/app/javascripts/FormInput.js +++ b/app/javascripts/FormInput.js @@ -86,16 +86,16 @@ class FormInput extends React.Component { } if(this.state.accounts.length > 0){ - console.log('detail', this.state.detail.ended, this.state.detail) + var availableSpots = this.state.detail.limitOfParticipants - this.state.detail.registered; if(this.state.detail.ended){ registerButton = <span>This even is over </span> - }else if (this.state.detail.limitOfParticipants > this.state.detail.registered){ + }else if (availableSpots <= 0){ + registerButton = <span>No more spots left</span> + }else{ registerButton = <RaisedButton secondary={this.showRegister()} disabled={!this.showRegister()} label="Register" style={styles} onClick={this.handleAction.bind(this, 'register')} /> - }else{ - registerButton = <span>No more spots left</span> } }else{ registerButton = <span>No account is set</span>
Fix bug showing No more spots left when there are more spots available.
wearekickback_contracts
train
js
c96d02218718c02fc9a58cafc38ac9a0b8c7dd59
diff --git a/src/factories/Resource.js b/src/factories/Resource.js index <HASH>..<HASH> 100644 --- a/src/factories/Resource.js +++ b/src/factories/Resource.js @@ -46,6 +46,13 @@ export default ['$resource', '$rootScope', ($resource, $rootScope) => { }; /** + * Manually mark this model as "clean" (i.e. not "dirty"). + */ + res.prototype.$markClean = function () { + wm.set(this, {initial: this, deleted: false}); + }; + + /** * Checks if this model is "dirty". * * @return boolean True if dirty, false if pristine.
add method to manually mark models as "clean"
monomelodies_monad
train
js
eff80fb01434e860d31504359de699c4c50d5eb6
diff --git a/sos/jupyter/kernel.py b/sos/jupyter/kernel.py index <HASH>..<HASH> 100644 --- a/sos/jupyter/kernel.py +++ b/sos/jupyter/kernel.py @@ -1025,8 +1025,11 @@ class SoS_Kernel(Kernel): return self._do_execute(remaining_code, silent, store_history, user_expressions, allow_stdin) elif self.MAGIC_MATPLOTLIB.match(code): options, remaining_code = self.get_magic_and_code(code, False) - self.shell.enable_gui = lambda gui: None - gui, backend = self.shell.enable_matplotlib(options) + try: + self.shell.enable_gui = lambda gui: None + gui, backend = self.shell.enable_matplotlib(options) + except Exception as e: + self.warn('Failed to set matplotlib backnd {}: {}'.format(options, e)) return self._do_execute(remaining_code, silent, store_history, user_expressions, allow_stdin) elif self.MAGIC_SET.match(code): options, remaining_code = self.get_magic_and_code(code, False)
Display error message of enable_matplotlib, this magic still does not work though.
vatlab_SoS
train
py
391aa4264b2d60c60ae23c8f129ceb7e6197988a
diff --git a/steam/tf2.py b/steam/tf2.py index <HASH>..<HASH> 100644 --- a/steam/tf2.py +++ b/steam/tf2.py @@ -188,6 +188,13 @@ class backpack: pass return ilist + def get_item_by_id(self, id): + """ Takes an id (serial number) and returns the item if one is found """ + for item in self.get_items(): + if self.get_item_id(item) == id: + return item + + def format_attribute_description(self, attr): """ Returns a formatted description_string (%s* tokens replaced) """ val = self.get_attribute_value(attr)
Add get_item_by_id to steamodd
Lagg_steamodd
train
py
c05d7aef1b05eb9fab6948c7d14e3d80a275c913
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -79,7 +79,7 @@ function scopedName(name, filename, css) { return loaderUtils.interpolateName( { resourcePath: filename }, localModuleNameFormat.replace(/\[localName\]/g, name), - { content: css } + { content: css.substring(css.indexOf('.' + name)) } ); }
fix all classes from same file having same hashes/emojis
EverledgerIO_postcss-modules-component-plugin
train
js
7e577acedeaf9a3d95ad05dd9b227bc7f3a7ac56
diff --git a/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php b/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php index <HASH>..<HASH> 100644 --- a/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php +++ b/tests/Symfony/Tests/Component/Locale/Stub/StubIntlDateFormatterTest.php @@ -29,8 +29,8 @@ class StubIntlDateFormatterTest extends LocaleTestCase public function testConstructor() { - $formatter = new StubIntlDateFormatter('en', StubIntlDateFormatter::MEDIUM, StubIntlDateFormatter::SHORT, 'UTC', StubIntlDateFormatter::GREGORIAN, 'Y-M-d'); - $this->assertEquals('Y-M-d', $formatter->getPattern()); + $formatter = new StubIntlDateFormatter('en', StubIntlDateFormatter::MEDIUM, StubIntlDateFormatter::SHORT, 'UTC', StubIntlDateFormatter::GREGORIAN, 'y-M-d'); + $this->assertEquals('y-M-d', $formatter->getPattern()); } /**
[Locale] do not use unimplemented chars in examples
symfony_symfony
train
php
69f347b38ba47426d4ff3ed23430ed42e79306fc
diff --git a/pyprophet/levels_contexts.py b/pyprophet/levels_contexts.py index <HASH>..<HASH> 100644 --- a/pyprophet/levels_contexts.py +++ b/pyprophet/levels_contexts.py @@ -288,9 +288,11 @@ def subsample_osw(infile, outfile, subsample_ratio, test): ms2_present = check_sqlite_table(conn, "FEATURE_MS2") transition_present = check_sqlite_table(conn, "FEATURE_TRANSITION") ## Check if infile contains multiple entries for run table, if only 1 entry, then infile is a single run, else infile is multiples run - multiple_runs = True if conn.cursor().execute("SELECT COUNT(*) AS NUMBER_OF_RUNS FROM RUN").fetchall()[0][0] > 1 else False + n_runs = conn.cursor().execute("SELECT COUNT(*) AS NUMBER_OF_RUNS FROM RUN").fetchall()[0][0] + multiple_runs = True if n_runs > 1 else False + click.echo("Warn: There are %s runs in %s" %(n_runs, multiple_runs) conn.close() - + conn = sqlite3.connect(outfile) c = conn.cursor()
[FEATURE Subsample Merged File] Debugging
PyProphet_pyprophet
train
py
5c33a7256fa04e3d401b91379d116b344e95323f
diff --git a/src/Validator.php b/src/Validator.php index <HASH>..<HASH> 100644 --- a/src/Validator.php +++ b/src/Validator.php @@ -25,7 +25,7 @@ use stdClass; class Validator implements IValidator { - private const BELL = "\x07"; + const BELL = "\x07"; /** @var IValidatorHelper */ protected $helper = null;
Removed access modifier to maintain php 7 compatibility
opis_json-schema
train
php
6fdf062ccecec19f7b1501edd7aefb6a83249e2b
diff --git a/js/coinfloor.js b/js/coinfloor.js index <HASH>..<HASH> 100644 --- a/js/coinfloor.js +++ b/js/coinfloor.js @@ -59,7 +59,6 @@ module.exports = class coinfloor extends Exchange { 'markets': { 'BTC/GBP': { 'id': 'XBT/GBP', 'symbol': 'BTC/GBP', 'base': 'BTC', 'quote': 'GBP', 'baseId': 'XBT', 'quoteId': 'GBP' }, 'BTC/EUR': { 'id': 'XBT/EUR', 'symbol': 'BTC/EUR', 'base': 'BTC', 'quote': 'EUR', 'baseId': 'XBT', 'quoteId': 'EUR' }, - 'BCH/GBP': { 'id': 'BCH/GBP', 'symbol': 'BCH/GBP', 'base': 'BCH', 'quote': 'GBP', 'baseId': 'BCH', 'quoteId': 'GBP' }, 'ETH/GBP': { 'id': 'ETH/GBP', 'symbol': 'ETH/GBP', 'base': 'ETH', 'quote': 'GBP', 'baseId': 'ETH', 'quoteId': 'GBP' }, }, });
[coinfloor] removed bugus BCH/GBP market
ccxt_ccxt
train
js
f4abbe4a0c21181cdf327398fe023338101fc8d7
diff --git a/salt/states/tomcat.py b/salt/states/tomcat.py index <HASH>..<HASH> 100644 --- a/salt/states/tomcat.py +++ b/salt/states/tomcat.py @@ -104,6 +104,7 @@ def war_deployed(name, war, url='http://localhost:8080/manager', __env__='base', # Test if __opts__['test']: + ret['result'] = None return ret # make sure the webapp is up if deployed
fixing prereq tomcat.war_deployed function
saltstack_salt
train
py
1770e3ce90fd2e206eeadf6c9e25172d90d64c55
diff --git a/lib/active_record/connection_adapters/sqlserver_adapter.rb b/lib/active_record/connection_adapters/sqlserver_adapter.rb index <HASH>..<HASH> 100644 --- a/lib/active_record/connection_adapters/sqlserver_adapter.rb +++ b/lib/active_record/connection_adapters/sqlserver_adapter.rb @@ -87,6 +87,8 @@ module ActiveRecord def type_cast(value) if value && type == :string && is_utf8? self.class.string_to_utf8_encoding(value) + elsif value && type == :timestamp + "0x#{value}" else super end
Add binary timestamp datatype handling.
rails-sqlserver_activerecord-sqlserver-adapter
train
rb
3aad4300fb3b2a5a4616cd700f3eb5ee3e0087e5
diff --git a/src/chippyash/Type/TypeFactory.php b/src/chippyash/Type/TypeFactory.php index <HASH>..<HASH> 100644 --- a/src/chippyash/Type/TypeFactory.php +++ b/src/chippyash/Type/TypeFactory.php @@ -253,7 +253,7 @@ abstract class TypeFactory if (!in_array($requiredType, self::$validTypes)) { throw new \InvalidArgumentException("{$requiredType} is not a supported number type"); } - if ($requiredType == self::TYPE_GMP && !function_exists('gmp_init')) { + if ($requiredType == self::TYPE_GMP && !extension_loaded('gmp')) { throw new \InvalidArgumentException('GMP not supported'); } self::$supportType = $requiredType;
change function_exists to extension_loaded
chippyash_Strong-Type
train
php
529d3f5a3c8d71df23d795275f01ec4a4aca994b
diff --git a/neutronclient/neutron/v2_0/rbac.py b/neutronclient/neutron/v2_0/rbac.py index <HASH>..<HASH> 100644 --- a/neutronclient/neutron/v2_0/rbac.py +++ b/neutronclient/neutron/v2_0/rbac.py @@ -32,12 +32,14 @@ class ListRBACPolicy(neutronV20.ListCommand): list_columns = ['id', 'object_id'] pagination_support = True sorting_support = True + allow_names = False class ShowRBACPolicy(neutronV20.ShowCommand): """Show information of a given RBAC policy.""" resource = 'rbac_policy' + allow_names = False class CreateRBACPolicy(neutronV20.CreateCommand): @@ -81,6 +83,7 @@ class UpdateRBACPolicy(neutronV20.UpdateCommand): """Update RBAC policy for given tenant.""" resource = 'rbac_policy' + allow_names = False def add_known_arguments(self, parser): parser.add_argument( @@ -97,3 +100,4 @@ class DeleteRBACPolicy(neutronV20.DeleteCommand): """Delete a RBAC policy.""" resource = 'rbac_policy' + allow_names = False
Do not allow name lookups on RBAC policies RBAC policies have no name field so the name query to the server was always returning all entries since the name filter was ignored. This corrects the behavior by disabling the name lookup for RBAC policies. Change-Id: I6c5afa<I>cefb<I>e<I>a1aaf<I>c<I>dc<I>c Closes-Bug: #<I>
rackerlabs_rackspace-python-neutronclient
train
py
6e36aa39c173390edd37d14fa30d27f3d9f90306
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -11,5 +11,6 @@ setup(name='Flask-PAM', install_requires=[ 'simplepam>=0.1.5', 'Flask>=0.10.1', + 'python-jose>=0.6.1', ], )
jwt: add python-jose dependency to setup.py
KujiraProject_Flask-PAM
train
py
b07a1908540da81b6415d734908986427161a835
diff --git a/SoftLayer/managers/firewall.py b/SoftLayer/managers/firewall.py index <HASH>..<HASH> 100644 --- a/SoftLayer/managers/firewall.py +++ b/SoftLayer/managers/firewall.py @@ -10,7 +10,7 @@ from SoftLayer import utils RULE_MASK = ('mask[orderValue,action,destinationIpAddress,' 'destinationIpSubnetMask,protocol,destinationPortRangeStart,' 'destinationPortRangeEnd,sourceIpAddress,sourceIpSubnetMask,' - 'version]') + 'version,notes]') def has_firewall(vlan):
Add notes to RULE_MASK in firewall manager (#<I>)
softlayer_softlayer-python
train
py
7dc4edbc2504677f4a9b613365577d13633cb5be
diff --git a/app/Module/TopSurnamesModule.php b/app/Module/TopSurnamesModule.php index <HASH>..<HASH> 100644 --- a/app/Module/TopSurnamesModule.php +++ b/app/Module/TopSurnamesModule.php @@ -111,6 +111,10 @@ class TopSurnamesModule extends AbstractModule implements ModuleBlockInterface ->groupBy(['surname']) ->select([new Expression('n_surname /*! COLLATE utf8_bin */ AS surname'), new Expression('count(*) AS total')]) ->pluck('total', 'surname') + ->map(static function ($n): int { + // Some database drivers return numeric columns strings. + return (int) $n; + }) ->all(); $all_surnames[$top_surname] = $variants;
Fix: #<I> - some database drivers return numeric columns as strings
fisharebest_webtrees
train
php
bdf1c45e8d7ea8e3afdfb184740b68f843dc54b1
diff --git a/ripe/atlas/sagan/__init__.py b/ripe/atlas/sagan/__init__.py index <HASH>..<HASH> 100644 --- a/ripe/atlas/sagan/__init__.py +++ b/ripe/atlas/sagan/__init__.py @@ -1,6 +1,6 @@ from __future__ import absolute_import -from .base import ResultParseError +from .base import Result, ResultParseError from .dns import DnsResult from .http import HttpResult from .ping import PingResult
Added Result to __init__
RIPE-NCC_ripe.atlas.sagan
train
py
2f9ab27c746749b7f8033702a7257e5c947bac5c
diff --git a/tests/settings.py b/tests/settings.py index <HASH>..<HASH> 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -117,3 +117,5 @@ DJSTRIPE_WEBHOOK_VALIDATION = "verify_signature" DJSTRIPE_WEBHOOK_SECRET = os.environ.get("DJSTRIPE_TEST_WEBHOOK_SECRET", "whsec_XXXXX") STATIC_URL = "/static/" + +DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
Set DEFAULT_AUTO_FIELD in tests
dj-stripe_dj-stripe
train
py
855d32a1b84c775a21aa77102699df0e8f38875c
diff --git a/src/Http/Controllers/Cms/ShowPostController.php b/src/Http/Controllers/Cms/ShowPostController.php index <HASH>..<HASH> 100644 --- a/src/Http/Controllers/Cms/ShowPostController.php +++ b/src/Http/Controllers/Cms/ShowPostController.php @@ -154,6 +154,9 @@ class ShowPostController extends CmsController // Lets check if there are any manipulators active $collection = $this->showMutator($postTypeModel, $collection); + // Cleaning up the output + unset($collection['postmeta']); + // Returning the full collection return response()->json($collection); } @@ -410,6 +413,7 @@ class ShowPostController extends CmsController } } + // When output is disabled, we need to remove the fields from the arrays if(array_key_exists('output', $customField) && !$customField['output']){ unset($view[$templateKey]['customFields'][$customFieldKey]); }
Cleaned up the output of the showcontroller by removing the postmeta from it.
nickkuijpers_laravel-custom-post-manager
train
php
a31d86390b3ddb73b48903122966d532956a7d65
diff --git a/backbone.js b/backbone.js index <HASH>..<HASH> 100644 --- a/backbone.js +++ b/backbone.js @@ -711,6 +711,7 @@ // Do not add multiple models with the same `id`. model = existing || model; + if (!model) continue; if (order && (model.isNew() || !modelMap[model.id])) order.push(model); modelMap[model.id] = true; } diff --git a/test/collection.js b/test/collection.js index <HASH>..<HASH> 100644 --- a/test/collection.js +++ b/test/collection.js @@ -1333,6 +1333,8 @@ c.set([{id: 1}, {id: 1}]); equal(c.length, 1); equal(c.models.length, 1); - }); + // Does not run check when model is not added + c.set([{id: 1}], {add: false}); + }); })();
Check that model exists before trying to verify uniqueness When calling fetch with {add: false} and model does not exist in collection, model uniqueness check tries to access id of undefined. This verifies that model is set before checking for existing models.
jashkenas_backbone
train
js,js
61e6adce50b6dcb8dc89022447c8b1035b9b101a
diff --git a/lib/processMultipart.js b/lib/processMultipart.js index <HASH>..<HASH> 100644 --- a/lib/processMultipart.js +++ b/lib/processMultipart.js @@ -58,14 +58,12 @@ module.exports = (options, req, res, next) => { ? tempFileHandler(options, field, filename) // Upload into temporary file. : memHandler(options, field, filename); // Upload into RAM. - const writePromise = getWritePromise(); - if (options.useTempFiles) { - writePromise.catch(err => { + const writePromise = options.useTempFiles + ? getWritePromise().catch(err => { uploadTimer.clear(); cleanup(); next(err); - }); - } + }) : getWritePromise(); // Define upload timer. const uploadTimer = new UploadTimer(options.uploadTimeout, () => { @@ -152,10 +150,6 @@ module.exports = (options, req, res, next) => { .then(() => { delete req[waitFlushProperty]; next(); - }).catch(err => { - delete req[waitFlushProperty]; - debugLog(options, `Error while waiting files flush: ${err}`); - next(err); }); });
Fixes richardgirges/express-fileupload#<I>
richardgirges_express-fileupload
train
js
c2b88c9e94ea41872584e11f2e739835a5ecb130
diff --git a/pavement.py b/pavement.py index <HASH>..<HASH> 100644 --- a/pavement.py +++ b/pavement.py @@ -38,7 +38,8 @@ def sdist(): @task def clean(): - for p in map(path, ('greenhouse.egg-info', 'dist', 'build', 'MANIFEST.in')): + for p in map(path, ( + 'greenhouse.egg-info', 'dist', 'build', 'MANIFEST.in', 'docs/build')): if p.exists(): if p.isdir(): p.rmtree()
purge docs builds on 'clean' command
teepark_greenhouse
train
py
1a320fc11ba4801c52b5449aeb213c3d76bd60f0
diff --git a/lib/plucky/query.rb b/lib/plucky/query.rb index <HASH>..<HASH> 100644 --- a/lib/plucky/query.rb +++ b/lib/plucky/query.rb @@ -63,7 +63,7 @@ module Plucky end def reverse - self[:sort].map! { |s| [s[0], -s[1]] } + self[:sort].map! { |s| [s[0], -s[1]] } unless self[:sort].nil? self end diff --git a/test/plucky/test_query.rb b/test/plucky/test_query.rb index <HASH>..<HASH> 100644 --- a/test/plucky/test_query.rb +++ b/test/plucky/test_query.rb @@ -230,6 +230,12 @@ class QueryTest < Test::Unit::TestCase Query.new(@collection).sort(:age).reverse.all.should == [@steve, @john, @chris] end + should "not error if no sort provided" do + assert_nothing_raised do + Query.new(@collection).reverse + end + end + should "reverse the sort order" do query = Query.new(@collection, :order => 'foo asc, bar desc') query.reverse.options[:sort].should == [['foo', -1], ['bar', 1]]
Do nothing if no sort provided.
mongomapper_plucky
train
rb,rb
488b4dde1bd7d84be1872d5dea5a5adbaf1986e9
diff --git a/code/model/jobs/DNDataTransfer.php b/code/model/jobs/DNDataTransfer.php index <HASH>..<HASH> 100644 --- a/code/model/jobs/DNDataTransfer.php +++ b/code/model/jobs/DNDataTransfer.php @@ -79,9 +79,10 @@ class DNDataTransfer extends DataObject { if($this->AuthorID) { $author = $this->Author(); $message = sprintf( - 'Initiated by %s (%s)', + 'Initiated by %s (%s), with IP Address %s', $author->getName(), - $author->Email + $author->Email, + Controller::curr()->getRequest()->getIP() ); $log->write($message); }
Add IP address into transfer log (completed HUMP-<I>)
silverstripe-archive_deploynaut
train
php
120dbf72ec2a2aac6382681d04f855f9db8a5176
diff --git a/src/Drupal/Driver/Cores/Drupal7.php b/src/Drupal/Driver/Cores/Drupal7.php index <HASH>..<HASH> 100644 --- a/src/Drupal/Driver/Cores/Drupal7.php +++ b/src/Drupal/Driver/Cores/Drupal7.php @@ -18,6 +18,7 @@ class Drupal7 implements CoreInterface { public function __construct($drupalRoot, $uri = 'default') { $this->drupalRoot = realpath($drupalRoot); $this->uri = $uri; + $this->random = new Random(); } /** @@ -196,7 +197,7 @@ class Drupal7 implements CoreInterface { // Create new role. $role = new \stdClass(); - $role->name = Random::name(8); + $role->name = $this->random->name(8); user_role_save($role); user_role_grant_permissions($role->rid, $permissions);
Updating D7 driver for core's random generator.
jhedstrom_DrupalDriver
train
php
48bd25dbdaa7d879ded2dc36fa5966b81ff89596
diff --git a/lib/platform/bitbucket-server/index.js b/lib/platform/bitbucket-server/index.js index <HASH>..<HASH> 100644 --- a/lib/platform/bitbucket-server/index.js +++ b/lib/platform/bitbucket-server/index.js @@ -257,11 +257,13 @@ async function deleteBranch(branchName, closePr = false) { if (closePr) { // getBranchPr const pr = await getBranchPr(branchName); - await api.post( - `/rest/api/1.0/projects/${config.projectKey}/repos/${ - config.repositorySlug - }/pull-requests/${pr.number}/decline?version=${pr.version + 1}` - ); + if (pr) { + await api.post( + `/rest/api/1.0/projects/${config.projectKey}/repos/${ + config.repositorySlug + }/pull-requests/${pr.number}/decline?version=${pr.version + 1}` + ); + } } return config.storage.deleteBranch(branchName); }
fix(bitbucket-server): pr check after deleting branch Closes #<I>
renovatebot_renovate
train
js
e9d6bcd19fb4f6a7ae697339c555e2477e040ce1
diff --git a/actionpack/test/controller/new_base/metal_test.rb b/actionpack/test/controller/new_base/metal_test.rb index <HASH>..<HASH> 100644 --- a/actionpack/test/controller/new_base/metal_test.rb +++ b/actionpack/test/controller/new_base/metal_test.rb @@ -20,8 +20,8 @@ module MetalTest class TestMiddleware < ActiveSupport::TestCase def setup @app = Rack::Builder.new do - use MetalMiddleware - run Endpoint.new + use MetalTest::MetalMiddleware + run MetalTest::Endpoint.new end.to_app end
Update MetalTest for constant scoping change in <I>
rails_rails
train
rb
088fa7b759eb9f92041d43adf3732fe742a38abe
diff --git a/src/transformers/tokenization_xlnet.py b/src/transformers/tokenization_xlnet.py index <HASH>..<HASH> 100644 --- a/src/transformers/tokenization_xlnet.py +++ b/src/transformers/tokenization_xlnet.py @@ -240,7 +240,7 @@ class XLNetTokenizer(PreTrainedTokenizer): cls_segment_id = [2] if token_ids_1 is None: - return len(token_ids_0 + sep + cls) * [0] + return len(token_ids_0 + sep) * [0] + cls_segment_id return len(token_ids_0 + sep) * [0] + len(token_ids_1 + sep) * [1] + cls_segment_id def save_vocabulary(self, save_directory):
Correct segment ID for XLNet single sequence
huggingface_pytorch-pretrained-BERT
train
py
d1a7619884a0ff09f5107658f80afb33f19d0a66
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ REQUIRES = ["PyYAML"] PKG_ROOT = os.path.dirname(__file__) -VERSION = "0.2.16" +VERSION = "0.2.17" def get_long_description():
Bumped version in setup.py
Julius2342_pyvlx
train
py
73c9c9cd900c359727dc81202051ade991ab7251
diff --git a/src/BoomCMS/Core/Console/Commands/InstallTemplates.php b/src/BoomCMS/Core/Console/Commands/InstallTemplates.php index <HASH>..<HASH> 100644 --- a/src/BoomCMS/Core/Console/Commands/InstallTemplates.php +++ b/src/BoomCMS/Core/Console/Commands/InstallTemplates.php @@ -51,9 +51,10 @@ class InstallTemplates extends Command $this->info("Installed $template in theme $theme"); } + + $this->call('vendor:publish', ['--force']); } else { $this->info('No templates to install'); } - $this->call('vendor:publish', ['--force']); } }
Updated install templates artisan command to only call vendor:publish if templates have been installed
boomcms_boom-core
train
php
41040d9e9040cfb096426bb24fd00a02afae8989
diff --git a/clc/client.go b/clc/client.go index <HASH>..<HASH> 100644 --- a/clc/client.go +++ b/clc/client.go @@ -3,6 +3,7 @@ package clc import ( "bytes" "encoding/json" + "errors" "fmt" "io" "io/ioutil" @@ -80,6 +81,11 @@ func (c *Client) do(method, url string, body io.Reader, resp interface{}) error if err != nil { return err } + + if res.StatusCode >= 300 { + return errors.New(fmt.Sprintf("http error: %s", res.Status)) + } + return json.NewDecoder(res.Body).Decode(resp) }
evaluate server response for non-success error codes
CenturyLinkCloud_clc-sdk
train
go
92006d3c097fe3f41e806c16e38abfd12c5a3c6d
diff --git a/library/BrowserDetector/BrowserDetector.php b/library/BrowserDetector/BrowserDetector.php index <HASH>..<HASH> 100644 --- a/library/BrowserDetector/BrowserDetector.php +++ b/library/BrowserDetector/BrowserDetector.php @@ -274,7 +274,7 @@ class BrowserDetector ); } - $cacheId = $this->cachePrefix . $this->agent; + $cacheId = $this->cachePrefix . $this->agent;//hash('sha512', $this->cachePrefix . $this->agent); $result = null; $success = false; diff --git a/library/BrowserDetector/Input/Browscap.php b/library/BrowserDetector/Input/Browscap.php index <HASH>..<HASH> 100644 --- a/library/BrowserDetector/Input/Browscap.php +++ b/library/BrowserDetector/Input/Browscap.php @@ -121,10 +121,13 @@ class Browscap extends Core } $this->parser->setCache($this->cache) - ->setLocaleFile($this->localFile) ->setCachePrefix($this->cachePrefix) ; + if (null !== $this->localFile) { + $this->parser->setLocaleFile($this->localFile); + } + if (null !== $this->logger) { $this->setLogger($this->logger); }
fixed error when localfile is not set for Browscap input
mimmi20_BrowserDetector
train
php,php
bb80a8a3575c2f14878ef3733d30df8a32f4b9b8
diff --git a/lib/SendGrid.php b/lib/SendGrid.php index <HASH>..<HASH> 100644 --- a/lib/SendGrid.php +++ b/lib/SendGrid.php @@ -33,7 +33,7 @@ class SendGrid { $form['api_user'] = $this->api_user; $form['api_key'] = $this->api_key; - $response = $this->makeRequest($form); + $response = $this->makeRequest(http_build_query($form)); return $response; }
Fix limitations which do not allow to send email with multiple bcc This request would help you to fix a nasty bug - limitations which do not allow to send email with multiple bcc. When we add multiple bcc, we get a multidimensional array and an error : [php] Array to string conversion in: vendor/sendgrid/sendgrid/lib/SendGrid.php:<I>
sendgrid_sendgrid-php
train
php
483b113df547dd745deb50e1317d478c9dda3ec1
diff --git a/src/helpers/ModelSort.php b/src/helpers/ModelSort.php index <HASH>..<HASH> 100644 --- a/src/helpers/ModelSort.php +++ b/src/helpers/ModelSort.php @@ -13,7 +13,7 @@ class ModelSort { public static function byType(): \Closure { - $order = ['CHASSIS', 'MOTHERBOARD', 'CPU', 'RAM', 'HDD', 'SSD']; + $order = ['SERVER', 'CHASSIS', 'MOTHERBOARD', 'CPU', 'RAM', 'HDD', 'SSD']; return function (Model $model) use ($order) { $type = mb_strtoupper($model->type);
Enhanced hardware sorters: SERVER should be first
hiqdev_hipanel-module-stock
train
php
084cb0f3ef5cea235f805f2ce2d9ea9ebe5021ac
diff --git a/main.go b/main.go index <HASH>..<HASH> 100644 --- a/main.go +++ b/main.go @@ -33,6 +33,7 @@ func main() { defer close(threadDumpChan) go dumpGoRoutine(threadDumpChan) + log.Printf("Targeting datadog API URL: %s \n", config.DataDogURL) datadog_nozzle := datadogfirehosenozzle.NewDatadogFirehoseNozzle(config, tokenFetcher) datadog_nozzle.Start() }
Logs API url on the start up [#<I>]
cloudfoundry-attic_datadog-firehose-nozzle
train
go
8558a3ccfe047d08e6625af8c191ce78acbd623d
diff --git a/js/theocean.js b/js/theocean.js index <HASH>..<HASH> 100644 --- a/js/theocean.js +++ b/js/theocean.js @@ -170,7 +170,7 @@ module.exports = class theocean extends Exchange { parseOHLCV (ohlcv, market = undefined, timeframe = '5m', since = undefined, limit = undefined) { const baseDecimals = this.safeInteger (this.options['decimals'], market['base'], 18); return [ - this.safeInteger (ohlcv, 'startTime') * 1000, + this.safeTimestamp (ohlcv, 'startTime'), this.safeFloat (ohlcv, 'open'), this.safeFloat (ohlcv, 'high'), this.safeFloat (ohlcv, 'low'),
theocean safeTimestamp
ccxt_ccxt
train
js
96e29b51eafa580295228299930e2441207434e0
diff --git a/src/Types/PaymentMethod.php b/src/Types/PaymentMethod.php index <HASH>..<HASH> 100644 --- a/src/Types/PaymentMethod.php +++ b/src/Types/PaymentMethod.php @@ -44,7 +44,7 @@ class PaymentMethod const EPS = "eps"; /** - * Gift cards + * @link https://www.mollie.com/gift-cards */ const GIFTCARD = "giftcard"; @@ -80,7 +80,7 @@ class PaymentMethod /** * @deprecated - * @link https://www.mollie.com/giftcards + * @link https://www.mollie.com/gift-cards */ const PODIUMCADEAUKAART = "podiumcadeaukaart";
Fix error in giftcards payment link, and added it to podiumcadeaukaart constant.
mollie_mollie-api-php
train
php
977b1fd9e04d286e592d89b86da4d7a4d40bdd02
diff --git a/src/v2/tasks/shell.js b/src/v2/tasks/shell.js index <HASH>..<HASH> 100644 --- a/src/v2/tasks/shell.js +++ b/src/v2/tasks/shell.js @@ -34,6 +34,7 @@ module.exports = (state) => new Promise((resolve, reject) => { const options = _.reduce(ACCEPTED_OPTIONS, (result, value) => _.set(result, value, state.get(value)), {}); state.logger.info(`Executing: ${state.get('command')}`); options.env = reduceEnvArrayToObject(options.env); + options.env['PYTHONIOENCODING'] = 'utf-8'; // Filthy hack to satistfy python environments which lose encoding when piping output const child = exec(state.get('command'), options, (err, stdout) => { if (err) {
Forcing python encoding when execing tasks
findmypast_usher
train
js
1f9d9e21b81dc55a097af71a747604ea6613b8c5
diff --git a/combine/checks/open_graph.py b/combine/checks/open_graph.py index <HASH>..<HASH> 100644 --- a/combine/checks/open_graph.py +++ b/combine/checks/open_graph.py @@ -69,7 +69,10 @@ class OpenGraphURLCheck(BaseOpenGraphCheck): # ) # ) - if not url.startswith("https://"): + # TODO figure out better solution for local -- want to catch those if building production + if not url.startswith("https://") and not url.startswith( + "http://127.0.0.1" + ): issues.append( Issue( type="open-graph-url-not-canonical-https", @@ -102,7 +105,10 @@ class OpenGraphImageCheck(BaseOpenGraphCheck): # ) # ) - if not url.startswith("https://"): + # TODO figure out better solution for local -- want to catch those if building production + if not url.startswith("https://") and not url.startswith( + "http://127.0.0.1" + ): issues.append( Issue( type="open-graph-image-not-canonical-https", diff --git a/combine/core.py b/combine/core.py index <HASH>..<HASH> 100644 --- a/combine/core.py +++ b/combine/core.py @@ -123,8 +123,6 @@ class Combine: for issue in FaviconCheck(site_dir=self.output_path).run(): self.issues.append(issue) - # broken links? - if self.issues: self.issues.print(f"Issues across your site")
Allow og:url and og:image to be http://<I> for now
dropseed_combine
train
py,py
7e081b9fae859f162abeffa6cc5f14e06fd2eb83
diff --git a/framework/widgets/BaseListView.php b/framework/widgets/BaseListView.php index <HASH>..<HASH> 100644 --- a/framework/widgets/BaseListView.php +++ b/framework/widgets/BaseListView.php @@ -40,14 +40,14 @@ abstract class BaseListView extends Widget * @var array the configuration for the pager widget. By default, [[LinkPager]] will be * used to render the pager. You can use a different widget class by configuring the "class" element. * Note that the widget must support the `pagination` property which will be populated with the - * [[\yii\data\BaseDataProvider::pagination|pagination]] value of the [[dataProvider]]. + * [[\yii\data\BaseDataProvider::pagination|pagination]] value of the [[dataProvider]] and will overwrite this value. */ public $pager = []; /** * @var array the configuration for the sorter widget. By default, [[LinkSorter]] will be * used to render the sorter. You can use a different widget class by configuring the "class" element. * Note that the widget must support the `sort` property which will be populated with the - * [[\yii\data\BaseDataProvider::sort|sort]] value of the [[dataProvider]]. + * [[\yii\data\BaseDataProvider::sort|sort]] value of the [[dataProvider]] and will overwrite this value. */ public $sorter = []; /**
Fixes #<I>: Added note clarifying config for ListView pager and sorter [skip ci]
yiisoft_yii-core
train
php
680b589b0d5cc15d78e5f648b2ba802b6f8b8a4e
diff --git a/emma2/msm/analysis/api.py b/emma2/msm/analysis/api.py index <HASH>..<HASH> 100644 --- a/emma2/msm/analysis/api.py +++ b/emma2/msm/analysis/api.py @@ -651,6 +651,7 @@ def mfpt(T, target): 0 & x=y \\ 1+\sum_{z} T_{x,z} \mathbb{E}_z[T_y] & x \neq y \end{array} \right. + References ---------- .. [1] Hoel, P G and S C Port and C J Stone. 1972. Introduction to
[msm/analysis] Added blank line
markovmodel_PyEMMA
train
py
ac7ba64bcb85180a67749105602d9d12de2316eb
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ import os html_context = { 'version' : '3.1', 'full_version' : '3.1.9', - 'maven_plugin_version' : '3.1.8', + 'maven_plugin_version' : '3.1.9', 'gradle_plugin_version' : '1.6.5', 'archetype_version' : '0.2.2' }
bump up maven plugin version to the latest
spotbugs_spotbugs
train
py
89ec7e622e1ed669a2c391bdfb5ee70c3365ebe9
diff --git a/admin/tests/LeftAndMainTest.php b/admin/tests/LeftAndMainTest.php index <HASH>..<HASH> 100644 --- a/admin/tests/LeftAndMainTest.php +++ b/admin/tests/LeftAndMainTest.php @@ -24,7 +24,7 @@ class LeftAndMainTest extends FunctionalTest { public function testSaveTreeNodeSorting() { $this->loginWithPermission('ADMIN'); - $rootPages = DataObject::get('LeftAndMainTest_Object', '"ParentID" = 0'); // implicitly sorted + $rootPages = DataObject::get('LeftAndMainTest_Object', '"ParentID" = 0', '"ID"'); // forcing sorting for non-MySQL $siblingIDs = $rootPages->column('ID'); $page1 = $rootPages->offsetGet(0); $page2 = $rootPages->offsetGet(1); @@ -197,4 +197,4 @@ class LeftAndMainTest_Object extends DataObject implements TestOnly { 'Hierarchy' ); -} \ No newline at end of file +}
When relying on the order of returned objects, sort explicitly as it is nondeterminate for non-MySQL.
silverstripe_silverstripe-framework
train
php
87fda568c5e8e8833ffff8034a6c66bc00ad3c7b
diff --git a/src/utils/elasticDSL.js b/src/utils/elasticDSL.js index <HASH>..<HASH> 100644 --- a/src/utils/elasticDSL.js +++ b/src/utils/elasticDSL.js @@ -43,12 +43,10 @@ let simplifyBucket = _.flow( _.mapValues(flattenMetrics), _.mapKeys(renameMetrics) ) - let simplifyBuckets = _.flow( F.when(_.isPlainObject, F.unkeyBy('key')), _.map(simplifyBucket) ) - // VERY hacky and inefficient tree simpification // inefficient due to copying the entire tree to flatten, again to unflatten, and running regex replaces on EVERY key // This will be superseeded by a transmuteTree version later :) @@ -79,10 +77,15 @@ let basicSimplifyTree = _.flow( ), // Rename __DOT__ to '.' tree => { - F.walk()(x => { + F.walk()((x, index) => { let dots = _.filter(_.includes('__DOT__'), _.keys(x)) _.each(dot => renameOn(dot, _.replace(/__DOT__/g, '.', dot), x), dots) + + if (index === 'rows' || index === 'columns') { + tree['results'][index] = simplifyBuckets(x) + } })(tree) + console.log(JSON.stringify(tree, null, 2)) return tree } )
fix: simplify buckets on rows and columns
smartprocure_contexture-elasticsearch
train
js
c86ea25338eac43c037c449e149808a563b023b9
diff --git a/lib/octokit/client.rb b/lib/octokit/client.rb index <HASH>..<HASH> 100644 --- a/lib/octokit/client.rb +++ b/lib/octokit/client.rb @@ -19,7 +19,7 @@ require 'octokit/client/users' module Octokit class Client - attr_accessor *Configuration::VALID_OPTIONS_KEYS + attr_accessor(*Configuration::VALID_OPTIONS_KEYS) def initialize(options={}) options = Octokit.options.merge(options) diff --git a/lib/octokit/configuration.rb b/lib/octokit/configuration.rb index <HASH>..<HASH> 100644 --- a/lib/octokit/configuration.rb +++ b/lib/octokit/configuration.rb @@ -22,7 +22,7 @@ module Octokit DEFAULT_OAUTH_TOKEN = nil DEFAULT_USER_AGENT = "Octokit Ruby Gem #{Octokit::VERSION}".freeze - attr_accessor *VALID_OPTIONS_KEYS + attr_accessor(*VALID_OPTIONS_KEYS) def self.extended(base) base.reset
Avoid the following ruby warnings: .../lib/octokit/configuration.rb:<I>: warning: `*' interpreted as argument prefix .../lib/octokit/client.rb:<I>: warning: `*' interpreted as argument prefix (by helping out the ruby interpreter with some parentheses)
octokit_octokit.rb
train
rb,rb
48b820fc06f6522c32b4ba82889f7156f4a4e3b2
diff --git a/css-components/gulpfile.js b/css-components/gulpfile.js index <HASH>..<HASH> 100644 --- a/css-components/gulpfile.js +++ b/css-components/gulpfile.js @@ -80,7 +80,7 @@ function cssnext() { root: __dirname + '/src/components/' }), cssnextPlugin({ - browsers: babelrc.presets[0][1].targets.browsers, + browsers: corePkg.browserslist, }), reporter({ clearAllMessages: true,
chore(css-components): Fix serve command by using browserslist
OnsenUI_OnsenUI
train
js
65b7cf2393aab52b2bbe9d6076ae867131e96989
diff --git a/cosmic_ray/version.py b/cosmic_ray/version.py index <HASH>..<HASH> 100644 --- a/cosmic_ray/version.py +++ b/cosmic_ray/version.py @@ -1,4 +1,4 @@ """Cosmic Ray version info.""" -__version_info__ = (3, 1, 1) +__version_info__ = (3, 1, 2) __version__ = '.'.join(map(str, __version_info__))
Bumped patch version to initiate new release.
sixty-north_cosmic-ray
train
py
91b5600466fe4c85e97009b93ceb77e037eb6765
diff --git a/lib/filestorage/local.rb b/lib/filestorage/local.rb index <HASH>..<HASH> 100644 --- a/lib/filestorage/local.rb +++ b/lib/filestorage/local.rb @@ -37,10 +37,11 @@ module Filestorage File.open(fullpath, "rb") end - def delete(path) + def delete(path, delete_dir: false) fullpath = @base_dir + path raise NotExist.new("Not exist #{path}") unless File.exist?(fullpath) FileUtils.rm(fullpath) + sweep(fullpath.parent) if delete_dir path end @@ -58,6 +59,23 @@ module Filestorage files end + private + + def sweep(path) + paths(path).reverse.each do |p| + FileUtils.rmdir(p) if p.children.empty? + end + end + + def paths(path) + p = [] + until path.to_s == @base_dir.to_s + p << path + path = path.parent + end + p.reverse + end + end # of class Local end # of module LocalFilestorage
lib/filestorage/local.rb: Add keyword option 'delete_dir' to Local#delete.
takatoh_filestorage
train
rb
3d0cda4138fc980975f551d0ae1ec9eca973a98a
diff --git a/src/SensiolabHelper.php b/src/SensiolabHelper.php index <HASH>..<HASH> 100644 --- a/src/SensiolabHelper.php +++ b/src/SensiolabHelper.php @@ -80,7 +80,7 @@ class SensiolabHelper $colorTag = $this->getColorTagForStatusCode($e->getResponse()->getStatusCode()); $this->command->line("HTTP StatusCode: <{$colorTag}>" . $e->getResponse()->getStatusCode() . "<{$colorTag}>"); $resp = $e->getResponse(); - if ($resp != null) { + if ($resp !== null) { $this->printMessage($resp); } $this->printMessage($e->getRequest()); @@ -91,7 +91,7 @@ class SensiolabHelper $colorTag = $this->getColorTagForStatusCode($e->getResponse()->getStatusCode()); $this->command->line("HTTP StatusCode: <{$colorTag}>" . $e->getResponse()->getStatusCode() . "<{$colorTag}>"); $resp = $e->getResponse(); - if ($resp != null) { + if ($resp !== null) { $this->printMessage($resp); } }
insight.sensiolabs.com
padosoft_laravel-composer-security
train
php
7ffd3af0d5525b56e5923423aad4f0437305ec52
diff --git a/www/tests/test_file.py b/www/tests/test_file.py index <HASH>..<HASH> 100644 --- a/www/tests/test_file.py +++ b/www/tests/test_file.py @@ -16,7 +16,7 @@ with open('compression/du cote de chez swann.txt', 'r') as f: counter = 0 for line in f: counter += 1 - assert counter == 2118 + assert counter in [2117, 2118] # last LF might be removed try: with open('files/text-latin1.txt') as f:
In test_file.py, change test on number of lines read on text mode. Related to issue #<I>.
brython-dev_brython
train
py