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
a217d793614a28a0fc9df0825f42f5cb12fcdf2c
diff --git a/bootstrap.py b/bootstrap.py index <HASH>..<HASH> 100755 --- a/bootstrap.py +++ b/bootstrap.py @@ -28,7 +28,7 @@ parser = optparse.OptionParser( "options.\n") parser.add_option('--gui', dest="gui", default=None, help="GUI toolkit: pyqt (for PyQt4) or pyside (for PySide)") -parser.add_option('--hideconsole', dest="hide_console", action='store_true', +parser.add_option('--hide-console', dest="hide_console", action='store_true', default=False, help="Hide parent console (Windows only)") options, args = parser.parse_args() assert options.gui in (None, 'pyqt', 'pyside'), \
bootstrap script: renamed command line option --hideconsole to --hide-console, which is coherent with the --show-console option of Spyder itself.
spyder-ide_spyder
train
py
1dcff29dd482987c6eb2afd69acc2470a0d3ce8c
diff --git a/datajoint/autopopulate.py b/datajoint/autopopulate.py index <HASH>..<HASH> 100644 --- a/datajoint/autopopulate.py +++ b/datajoint/autopopulate.py @@ -81,6 +81,7 @@ class AutoPopulate: jobs = self.connection.jobs[self.target.database] if reserve_jobs else None todo -= self.target.proj() + n_to_populate = len(todo) keys = todo.fetch.keys() if order == "reverse": keys = list(keys) @@ -89,6 +90,7 @@ class AutoPopulate: keys = list(keys) random.shuffle(keys) + logger.info('Found %d keys to populate' % n_to_populate) for key in keys: if not reserve_jobs or jobs.reserve(self.target.table_name, key): self.connection.start_transaction()
Report number of missing keys to be populated
datajoint_datajoint-python
train
py
66c86a6689aaac82006fa47762bd86496ad76bf7
diff --git a/lib/config.js b/lib/config.js index <HASH>..<HASH> 100644 --- a/lib/config.js +++ b/lib/config.js @@ -23,18 +23,19 @@ var UrlPattern = function(url) { var createPatternObject = function(pattern) { - if (helper.isString(pattern)) { + if (pattern && helper.isString(pattern)) { return helper.isUrlAbsolute(pattern) ? new UrlPattern(pattern) : new Pattern(pattern); } if (helper.isObject(pattern)) { - if (!helper.isDefined(pattern.pattern)) { - log.warn('Invalid pattern %s!\n\tObject is missing "pattern" property".', pattern); - } - - return helper.isUrlAbsolute(pattern.pattern) ? + if (pattern.pattern && helper.isString(pattern.pattern)) { + return helper.isUrlAbsolute(pattern.pattern) ? new UrlPattern(pattern.pattern) : new Pattern(pattern.pattern, pattern.served, pattern.included, pattern.watched); + } + + log.warn('Invalid pattern %s!\n\tObject is missing "pattern" property.', pattern); + return new Pattern(null, false, false, false); } log.warn('Invalid pattern %s!\n\tExpected string or object with "pattern" property.', pattern);
fix(config): ignore empty string patterns An empty string pattern is a mistake - there is no reason to do that. It can however happen (for instance when you generate the config file). Before this fix, Karma would try to watch this empty string pattern, which would result in watching the entire `basePath` directory. Now, the pattern will be ignored and a warning showed.
karma-runner_karma
train
js
d2c6bdf00df557213e61ca6a0a32603cb6dc1f56
diff --git a/src/vuex-i18n-plugin.js b/src/vuex-i18n-plugin.js index <HASH>..<HASH> 100644 --- a/src/vuex-i18n-plugin.js +++ b/src/vuex-i18n-plugin.js @@ -312,6 +312,9 @@ VuexI18nPlugin.install = function install(Vue, store, config) { localeExists: checkLocaleExists, keyExists: checkKeyExists, + translate: translate, + translateIn: translateInLanguage, + exists: phaseOutExistsFn }; @@ -332,10 +335,10 @@ VuexI18nPlugin.install = function install(Vue, store, config) { exists: phaseOutExistsFn }; - // register the translation function on the vue instance + // register the translation function on the vue instance directly Vue.prototype.$t = translate; - // register the specific language translation function on the vue instance + // register the specific language translation function on the vue instance directly Vue.prototype.$tlang = translateInLanguage; // register a filter function for translations
add the methods translate and translateIn to the $i<I>n instance object to keep api consistent
dkfbasel_vuex-i18n
train
js
0f7e7e86c98a03bc0ec9afaaccdbc0f0e5dc88bc
diff --git a/src/InputValidation/Form.php b/src/InputValidation/Form.php index <HASH>..<HASH> 100755 --- a/src/InputValidation/Form.php +++ b/src/InputValidation/Form.php @@ -773,7 +773,7 @@ class Form * @param $key string The field name * @return string */ - protected function getFieldCaption($key) + public function getFieldCaption($key) { $caption = $this->getDefinition($key, 'caption'); diff --git a/src/InputValidation/Validator.php b/src/InputValidation/Validator.php index <HASH>..<HASH> 100644 --- a/src/InputValidation/Validator.php +++ b/src/InputValidation/Validator.php @@ -48,6 +48,17 @@ class Validator } /** + * Returns a translated field caption + * + * @param $key string The field name + * @return string + */ + public function getFieldCaption($key) + { + return $this->getForm()->getFieldCaption($key); + } + + /** * @param string $key Field key * @param string $token Text token * @param array $params Text replacements
Bugfix: Added getFieldCaption() to Validator
symlex_input-validation
train
php,php
9ebf0de2e4db5fcb40bac146a9e7a69edfd92adf
diff --git a/demo/src/AddressView.js b/demo/src/AddressView.js index <HASH>..<HASH> 100644 --- a/demo/src/AddressView.js +++ b/demo/src/AddressView.js @@ -27,10 +27,29 @@ export default function AddressView(props) { const country = getAddressComponent(address, ['country']); const postalCode = getAddressComponent(address, ['postal_code']); + const room = getAddressComponent(address, ['room']); + const floor = getAddressComponent(address, ['floor']); + const unitNumber = getAddressComponent(address, ['unit_number']); + const unitDesignator = getAddressComponent(address, ['unit_designator']); + + const subunit = room + ? ` room ${room}` + : floor + ? ` floor ${floor}` + : unitDesignator + ? ` ${unitDesignator} ${unitNumber}` + : ''; + + const combinedNumber = + !floor && !room && !unitDesignator && unitNumber + ? `${unitNumber}-${streetNumber}` + : streetNumber; + return ( <div className="address"> <div className="address__line1"> - {streetNumber} {streetName} + {combinedNumber} + {subunit} {streetName} </div> <div className="address__line2"> {city} {provState}
Update demo address view to render unit number and designator
silverorange_accessible-google-places-autocomplete
train
js
332836cf4e00a3853dd887b530b3facdc0dfc669
diff --git a/src/terra/Factory/EnvironmentFactory.php b/src/terra/Factory/EnvironmentFactory.php index <HASH>..<HASH> 100644 --- a/src/terra/Factory/EnvironmentFactory.php +++ b/src/terra/Factory/EnvironmentFactory.php @@ -609,4 +609,18 @@ class EnvironmentFactory return false; } } + + /** + * Get the name of the drush alias. + */ + public function getDrushAlias() { + return "@{$this->app->name}.{$this->environment->name}"; + } + + /** + * Get the path to document root + */ + public function getDocumentRoot() { + return $this->environment->path . '/' . $this->config['document_root']; + } }
Adding methods to get drush alias and document root path.
terra-ops_terra-cli
train
php
301a83b324f85396c225cc426f92e0008f9e20b4
diff --git a/lib/git.js b/lib/git.js index <HASH>..<HASH> 100644 --- a/lib/git.js +++ b/lib/git.js @@ -22,7 +22,7 @@ git.target = path.normalize(target + '/.git/'); git.failure = path.normalize(target + '/.git/hooks/build-failed'); git.success = path.normalize(target + '/.git/hooks/build-worked'); - return path.exists(git.target, function(exists) { + return fs.exists(git.target, function(exists) { if (exists === false) { console.log(("'" + target + "' is not a valid Git repo").red); process.exit(1);
[fix] fs.exists was moved to fs.exists
ryankee_concrete
train
js
47625d52e469202d33f3f44181824281603fa220
diff --git a/rinoh/backend/pdf/cos.py b/rinoh/backend/pdf/cos.py index <HASH>..<HASH> 100644 --- a/rinoh/backend/pdf/cos.py +++ b/rinoh/backend/pdf/cos.py @@ -70,9 +70,7 @@ class Object(object): document.register(self) -NoneType = type(None) - -class Null(Object, NoneType): +class Null(Object): def __init__(self, indirect=False): super().__init__(indirect)
Don't inherit from NoneType bool(Null()) == True anyway, so there're no reason to do this.
brechtm_rinohtype
train
py
873b36eefb7591adfa38437d493853b305084238
diff --git a/colorise/__init__.py b/colorise/__init__.py index <HASH>..<HASH> 100644 --- a/colorise/__init__.py +++ b/colorise/__init__.py @@ -28,7 +28,6 @@ __all__ = [ 'highlight' ] - # Determine which platform-specific color manager to import if _SYSTEM_OS.startswith('win'): from colorise.win.color_functions import\ @@ -53,6 +52,7 @@ else: from colorise.nix.cluts import\ can_redefine_colors as _can_redefine_colors + def num_colors(): """Return the number of colors supported by the terminal.""" return _num_colors() diff --git a/colorise/error.py b/colorise/error.py index <HASH>..<HASH> 100644 --- a/colorise/error.py +++ b/colorise/error.py @@ -3,5 +3,6 @@ """Custom colorise exceptions.""" + class NotSupportedError(Exception): """Raised when functionality is not supported."""
Use some flake8 whitespace suggestions [ci skip]
MisanthropicBit_colorise
train
py,py
8558b6ee5cfdcba2bc40fe83c507835251d81361
diff --git a/lib/OpenLayers/Layer/Grid.js b/lib/OpenLayers/Layer/Grid.js index <HASH>..<HASH> 100644 --- a/lib/OpenLayers/Layer/Grid.js +++ b/lib/OpenLayers/Layer/Grid.js @@ -677,8 +677,10 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { * Generate parameters for the grid layout. * * Parameters: - * bounds - {<OpenLayers.Bound>} - * origin - {<OpenLayers.LonLat>} + * bounds - {<OpenLayers.Bound>|Object} OpenLayers.Bounds or an + * object with a 'left' and 'top' properties. + * origin - {<OpenLayers.LonLat>|Object} OpenLayers.LonLat or an + * object with a 'lon' and 'lat' properties. * resolution - {Number} * * Returns: @@ -686,8 +688,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, { * tileoffsetlat, tileoffsetx, tileoffsety */ calculateGridLayout: function(bounds, origin, resolution) { - bounds = bounds.clone(); - var tilelon = resolution * this.tileSize.w; var tilelat = resolution * this.tileSize.h;
Update OpenLayers.Layer.Grid.calculateGridLayout inputs type. No need to clone the passed bounds (read only access). 'bounds' can be either a Bounds instance or a simple javascript object. Same for 'origin': LonLat instance or a simple javascript object.
openlayers_openlayers
train
js
4d27c54bd1bd7306e79029417c40d2f24c516d8f
diff --git a/mr/awsome/plain.py b/mr/awsome/plain.py index <HASH>..<HASH> 100644 --- a/mr/awsome/plain.py +++ b/mr/awsome/plain.py @@ -62,6 +62,7 @@ class Instance(FabricMixin): for k, v in self.master.instances.items())) d.update(self.config) d['known_hosts'] = self.master.known_hosts + d['path'] = self.master.main_config.path return proxy_command.format(**d) def init_ssh_key(self, user=None):
Add config path to variables usable in proxy_command.
ployground_ploy_fabric
train
py
76380210cc5185bb05f7397564ba79bfd768cb72
diff --git a/lib/graph-manifest.js b/lib/graph-manifest.js index <HASH>..<HASH> 100644 --- a/lib/graph-manifest.js +++ b/lib/graph-manifest.js @@ -52,7 +52,7 @@ function node (state, createEdge, emit) { if (res.err) return self.emit('error', 'manifest', 'JSON.parse', res.err) debug('creating edges') - createEdge('color', Buffer.from(res.value.color || '#fff')) + createEdge('color', Buffer.from(res.value.theme_color || '#fff')) createEdge('bundle', Buffer.from(JSON.stringify(res.value))) }) })
read theme_color from manifest.json (#<I>)
choojs_bankai
train
js
ce110979f75e0d121e29d33c1b5e709237e5879b
diff --git a/bosh-stemcell/spec/os_image/ubuntu_trusty_spec.rb b/bosh-stemcell/spec/os_image/ubuntu_trusty_spec.rb index <HASH>..<HASH> 100644 --- a/bosh-stemcell/spec/os_image/ubuntu_trusty_spec.rb +++ b/bosh-stemcell/spec/os_image/ubuntu_trusty_spec.rb @@ -2,9 +2,9 @@ require 'spec_helper' require 'rbconfig' describe 'Ubuntu 14.04 OS image', os_image: true do - it_behaves_like 'every OS image' + # it_behaves_like 'every OS image' it_behaves_like 'an upstart-based OS image' - it_behaves_like 'a Linux kernel 3.x based OS image' + # it_behaves_like 'a Linux kernel 3.x based OS image' describe package('apt') do it { should be_installed }
fix tests for stemcell on power arch
cloudfoundry_bosh
train
rb
f7b1eaf848005baf60c7de5dd1f13b56b2534724
diff --git a/spec/spec-helper/jasmine-tagged-spec.js b/spec/spec-helper/jasmine-tagged-spec.js index <HASH>..<HASH> 100644 --- a/spec/spec-helper/jasmine-tagged-spec.js +++ b/spec/spec-helper/jasmine-tagged-spec.js @@ -26,4 +26,5 @@ describe("jasmine-tagged", function () { }); }); +env.setIncludedTags(); env.includeSpecsWithoutTags(true);
set included back to none after jasmine-tagged tests
UziTech_atom-jasmine3-test-runner
train
js
d0872ffaa02260387621b03343a8629837215b62
diff --git a/src/Models/User.php b/src/Models/User.php index <HASH>..<HASH> 100644 --- a/src/Models/User.php +++ b/src/Models/User.php @@ -1350,8 +1350,15 @@ class User extends Entry implements Authenticatable ->whereHas($this->schema->objectClass()) ->first(); + $maxPasswordAge = $rootDomainObject->getMaxPasswordAge(); + + if (empty ($maxPasswordAge)) { + // There is not a max password age set on the LDAP server. + return false; + } + // Get the users password expiry in Windows time. - $passwordExpiry = bcsub($lastSet, $rootDomainObject->getMaxPasswordAge()); + $passwordExpiry = bcsub($lastSet, $maxPasswordAge); // Convert the Windows time to unix. $passwordExpiryTime = Utilities::convertWindowsTimeToUnixTime($passwordExpiry);
Properly return false if the AD server does not have a max password age.
Adldap2_Adldap2
train
php
74a0e8b195640c54c4d5e934f18fbac07af7584e
diff --git a/twitterscraper/query.py b/twitterscraper/query.py index <HASH>..<HASH> 100644 --- a/twitterscraper/query.py +++ b/twitterscraper/query.py @@ -96,7 +96,7 @@ def query_single_page(query, lang, pos, retry=50, from_user=False, timeout=60): else: html = '' try: - json_resp = json.loads(response.text) + json_resp = response.json() html = json_resp['items_html'] or '' except ValueError as e: logger.exception('Failed to parse JSON "{}" while requesting "{}"'.format(e, url))
Use request json() method instead of manual json parsing. (#<I>)
taspinar_twitterscraper
train
py
055d1fb5e19ed80e89d858f9b5086fc21a0bf165
diff --git a/django_ulogin/models.py b/django_ulogin/models.py index <HASH>..<HASH> 100644 --- a/django_ulogin/models.py +++ b/django_ulogin/models.py @@ -24,7 +24,8 @@ AUTH_USER_MODEL = ( class ULoginUser(models.Model): user = models.ForeignKey(AUTH_USER_MODEL, related_name='ulogin_users', - verbose_name=_('user')) + verbose_name=_('user'), + on_delete=models.CASCADE) network = models.CharField(_('network'), db_index=True, max_length=255,
Fix models for Django <I>
marazmiki_django-ulogin
train
py
b31379e018ce360191dba6457793106f5474a294
diff --git a/test/simple.rb b/test/simple.rb index <HASH>..<HASH> 100644 --- a/test/simple.rb +++ b/test/simple.rb @@ -1035,7 +1035,6 @@ module SimpleTestMethods end def test_query_cache - pend '#839 is open to resolve if this is really a valid test or not in 5.1' if ActiveRecord::Base.connection.adapter_name =~ /mysql|sqlite|postgres/i user_1 = User.create! :login => 'query_cache_1' user_2 = User.create! :login => 'query_cache_2' user_3 = User.create! :login => 'query_cache_3' diff --git a/test/test_helper.rb b/test/test_helper.rb index <HASH>..<HASH> 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -505,7 +505,7 @@ module ActiveRecord end def call(name, start, finish, message_id, values) - return if 'CACHE' == values[:name] + return if values[:cached] sql = values[:sql] sql = sql.to_sql unless sql.is_a?(String)
[test] fix query cache tests for Rail <I> (#<I>) <I> and higher changed the way cached queries are accounted for... Fixes #<I>
jruby_activerecord-jdbc-adapter
train
rb,rb
438bce6e775709ae2ba2af999945793ea84ece7e
diff --git a/h2o-bindings/bin/custom/python/gen_generic.py b/h2o-bindings/bin/custom/python/gen_generic.py index <HASH>..<HASH> 100644 --- a/h2o-bindings/bin/custom/python/gen_generic.py +++ b/h2o-bindings/bin/custom/python/gen_generic.py @@ -11,6 +11,7 @@ def class_extensions(): """ Creates new Generic model by loading existing embedded model into library, e.g. from H2O MOJO. The imported model must be supported by H2O. + :param file: A string containing path to the file to create the model from :return: H2OGenericEstimator instance representing the generic model diff --git a/h2o-py/h2o/estimators/generic.py b/h2o-py/h2o/estimators/generic.py index <HASH>..<HASH> 100644 --- a/h2o-py/h2o/estimators/generic.py +++ b/h2o-py/h2o/estimators/generic.py @@ -106,6 +106,7 @@ class H2OGenericEstimator(H2OEstimator): """ Creates new Generic model by loading existing embedded model into library, e.g. from H2O MOJO. The imported model must be supported by H2O. + :param file: A string containing path to the file to create the model from :return: H2OGenericEstimator instance representing the generic model
PUBDEV-<I>: separated param/return from description
h2oai_h2o-3
train
py,py
019559f7debf8296877cdd1ad9c646cf902f973d
diff --git a/app/models/music_release.rb b/app/models/music_release.rb index <HASH>..<HASH> 100755 --- a/app/models/music_release.rb +++ b/app/models/music_release.rb @@ -153,11 +153,17 @@ class MusicRelease < ActiveRecord::Base musicbrainz_release_group, musicbrainz_releases = nil, nil if mbid.present? - musicbrainz_release_group = MusicBrainz::Release.find(mbid).release_group - musicbrainz_release_group.releases = nil - musicbrainz_releases = musicbrainz_release_group.releases - musicbrainz_release_group = musicbrainz_release_group.to_primitive - else + musicbrainz_release = MusicBrainz::Release.find(mbid) + + unless musicbrainz_release.nil? + musicbrainz_release_group = musicbrainz_release.release_group + musicbrainz_release_group.releases = nil + musicbrainz_releases = musicbrainz_release_group.releases + musicbrainz_release_group = musicbrainz_release_group.to_primitive + end + end + + if musicbrainz_release_group.nil? list = groups(false, true).select{|a| ((is_lp && a.first[:type] == 'Album') || (!is_lp && a.first[:type] != 'Album')) && a.first[:title].downcase == name.downcase }.first return [] if list.nil?
refs #1 find release group by name if it cannot be found through music release by mbid.
volontariat_voluntary_music_metadata_enrichment
train
rb
1493a48bcb125ce8546cebedc15ef8adebe8bc76
diff --git a/lib/component.js b/lib/component.js index <HASH>..<HASH> 100644 --- a/lib/component.js +++ b/lib/component.js @@ -218,11 +218,14 @@ * @listens Backbone.Collection#sync */ onSync: function (modelOrCollection, key) { - this.setProps({isRequesting: false}); - if (modelOrCollection instanceof Backbone.Model) - this.setPropsModel(modelOrCollection, key); - else if (modelOrCollection instanceof Backbone.Collection) - this.setPropsCollection(modelOrCollection, key); + // Set props only if there's no silent option + if (!arguments[arguments.length - 1].silent) { + this.setProps({isRequesting: false}); + if (modelOrCollection instanceof Backbone.Model) + this.setPropsModel(modelOrCollection, key); + else if (modelOrCollection instanceof Backbone.Collection) + this.setPropsCollection(modelOrCollection, key); + } }, /** * Stops all listeners and removes this component from the DOM.
onSync now only setProps if options doesn't pass silent as true
magalhas_backbone-react-component
train
js
72b137b7f061772b88043f5da79f7c2645dd45d1
diff --git a/package.php b/package.php index <HASH>..<HASH> 100644 --- a/package.php +++ b/package.php @@ -4,7 +4,7 @@ require_once 'PEAR/PackageFileManager2.php'; -$version = '1.1.0'; +$version = '1.1.1'; $notes = <<<EOT see ChangeLog EOT;
prepare for release of <I> svn commit r<I>
silverorange_swat
train
php
d12f25ab8e689f38bafa50173b14081f5bd38eb2
diff --git a/hazelcast-client-legacy/src/main/java/com/hazelcast/client/proxy/NearCachedClientMapProxy.java b/hazelcast-client-legacy/src/main/java/com/hazelcast/client/proxy/NearCachedClientMapProxy.java index <HASH>..<HASH> 100644 --- a/hazelcast-client-legacy/src/main/java/com/hazelcast/client/proxy/NearCachedClientMapProxy.java +++ b/hazelcast-client-legacy/src/main/java/com/hazelcast/client/proxy/NearCachedClientMapProxy.java @@ -389,6 +389,7 @@ public class NearCachedClientMapProxy<K, V> extends ClientMapProxy<K, V> { if (event instanceof CleaningNearCacheInvalidation) { nearCache.clear(); + return; } throw new IllegalArgumentException("Unexpected event received [" + event + ']');
fixed missing return in case of CleaningNearCacheInvalidation received at NearCachedClientMapProxy for legacy client
hazelcast_hazelcast
train
java
123e604b1b59bb74cdec580e294de43fc32ba881
diff --git a/config/routes.rb b/config/routes.rb index <HASH>..<HASH> 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,15 +1,10 @@ Ems::Engine.routes.draw do + get "ems/index" + root :to => "ems#index" resources :reports - resources :news - resources :articles - resources :tags resources :channels resources :categories - - get "ems/index" - - root :to => "ems#index" end
fixing route problem in ems
thebeansgroup_ems
train
rb
daf8b8f5fdb1d1589982c2586dec5ddf1cfb2d50
diff --git a/legit/scm.py b/legit/scm.py index <HASH>..<HASH> 100644 --- a/legit/scm.py +++ b/legit/scm.py @@ -157,7 +157,7 @@ class SCMRepo(object): else: verb = 'merge' - if self.pull_ff_only(): + if verb != 'rebase' and self.pull_ff_only(): return self.git_exec([verb, '--ff-only', branch]) else: try: @@ -177,7 +177,7 @@ class SCMRepo(object): def pull_ff_only(self): reader = self.repo.config_reader() if reader.has_option('pull', 'ff'): - if reader.getboolean('pull', 'ff') == 'only': + if reader.get('pull', 'ff') == 'only': return True else: return False
properly deal with ff-only when registered in the git options
kennethreitz_legit
train
py
3fde25f9924a4fca1d1fbdf44fa184aaed4c6983
diff --git a/analytics.go b/analytics.go index <HASH>..<HASH> 100644 --- a/analytics.go +++ b/analytics.go @@ -124,13 +124,16 @@ type batch struct { // func Client(key string) *client { - return &client{ - key: key, - url: api, - flushAt: 500, - flushAfter: 10 * time.Second, - buffer: make([]*interface{}, 0), + c := &client{ + key: key, + url: api, + buffer: make([]*interface{}, 0), } + + c.FlushAt(500) + c.FlushAfter(10 * time.Second) + + return c } //
add dog-fooding of buffer methods
segmentio_analytics-go
train
go
e60973137f4700c905bc2777e814bf5e61d90774
diff --git a/lib/calabash.rb b/lib/calabash.rb index <HASH>..<HASH> 100644 --- a/lib/calabash.rb +++ b/lib/calabash.rb @@ -112,7 +112,6 @@ module Calabash raise ArgumentError, "Expected a 'Class', got '#{page_class.class}'" end - page_name = page_class.name full_page_name = "#{platform_module}::#{page_name}" @@ -120,6 +119,17 @@ module Calabash page_class = platform_module.const_get(page_name, false) if page_class.is_a?(Class) + modules = page_class.included_modules.map(&:to_s) + + unless modules.include?("Calabash::#{platform_module}") + raise "Page '#{page_class}' does not include Calabash::#{platform_module}" + end + + if modules.include?('Calabash::Android') && + modules.include?('Calabash::IOS') + raise "Page '#{page_class}' includes both Calabash::Android and Calabash::IOS" + end + page = page_class.send(:new, self) if page.is_a?(Calabash::Page)
Pages: Fail if page does not include CalA xor CalI
calabash_calabash
train
rb
215f9bef1c0f99376271802dd37ed8e8cea658f5
diff --git a/moztelemetry/scalar.py b/moztelemetry/scalar.py index <HASH>..<HASH> 100644 --- a/moztelemetry/scalar.py +++ b/moztelemetry/scalar.py @@ -19,7 +19,6 @@ from parse_scalars import ScalarType SCALARS_YAML_PATH = '/toolkit/components/telemetry/Scalars.yaml' REVISIONS = {'nightly': 'https://hg.mozilla.org/mozilla-central/rev/tip', - 'aurora': 'https://hg.mozilla.org/releases/mozilla-aurora/rev/tip', 'beta': 'https://hg.mozilla.org/releases/mozilla-beta/rev/tip', 'release': 'https://hg.mozilla.org/releases/mozilla-release/rev/tip'}
Remove aurora scalar definitions (#<I>)
mozilla_python_moztelemetry
train
py
bfe9b9e88b7dea7d3830f33c2d5f3bf194525b1e
diff --git a/go/client/chat_svc_handler.go b/go/client/chat_svc_handler.go index <HASH>..<HASH> 100644 --- a/go/client/chat_svc_handler.go +++ b/go/client/chat_svc_handler.go @@ -9,6 +9,7 @@ import ( "github.com/araddon/dateparse" "github.com/keybase/client/go/chat" + "github.com/keybase/client/go/chat/attachments" "github.com/keybase/client/go/chat/utils" "github.com/keybase/client/go/libkb" "github.com/keybase/client/go/protocol/chat1" @@ -615,6 +616,9 @@ func (c *chatServiceHandler) DownloadV1(ctx context.Context, opts downloadOption if opts.Output == "-" { fsink = &StdoutSink{} } else { + if err := attachments.Quarantine(ctx, opts.Output); err != nil { + c.G().Log.Warning("failed to quarantine attachment download: %s", err) + } fsink = NewFileSink(c.G(), opts.Output) } defer fsink.Close()
quarantine through stream download path CORE-<I> (#<I>)
keybase_client
train
go
a01e597a539a6dd73d788dc70c10313acc781720
diff --git a/cycle/src/test/java/com/camunda/fox/cycle/web/service/resource/RoundtripServiceTest.java b/cycle/src/test/java/com/camunda/fox/cycle/web/service/resource/RoundtripServiceTest.java index <HASH>..<HASH> 100644 --- a/cycle/src/test/java/com/camunda/fox/cycle/web/service/resource/RoundtripServiceTest.java +++ b/cycle/src/test/java/com/camunda/fox/cycle/web/service/resource/RoundtripServiceTest.java @@ -166,6 +166,8 @@ public class RoundtripServiceTest { RoundtripDTO testRoundtrip = createAndFlushRoundtrip(); BpmnDiagramDTO rightHandSide = testRoundtrip.getRightHandSide(); + // needs to be here because invoke of diagramService.getImage(...), expects + // the image date to be 'now' + 5 secs. 'now' is set in roundtripService.doSynchronize(...) Thread.sleep(6000); roundtripService.doSynchronize(SyncMode.LEFT_TO_RIGHT, testRoundtrip.getId());
HEMERA-<I> Added comment why there is a Thread.sleep
camunda_camunda-bpm-platform
train
java
da799464afca1eb5fbdbe18dd9948e3fcc1c5e8a
diff --git a/src/Symfony/Component/Messenger/Worker.php b/src/Symfony/Component/Messenger/Worker.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Messenger/Worker.php +++ b/src/Symfony/Component/Messenger/Worker.php @@ -87,6 +87,7 @@ class Worker while (false === $this->shouldStop) { $envelopeHandled = false; + $envelopeHandledStart = microtime(true); foreach ($this->receivers as $transportName => $receiver) { if ($queueNames) { $envelopes = $receiver->getFromQueues($queueNames); @@ -113,10 +114,12 @@ class Worker } } - if (false === $envelopeHandled) { + if (!$envelopeHandled) { $this->dispatchEvent(new WorkerRunningEvent($this, true)); - usleep($options['sleep']); + if (0 < $sleep = (int) ($options['sleep'] - 1e6 * (microtime(true) - $envelopeHandledStart))) { + usleep($sleep); + } } }
[Messenger] subtract handling time from sleep time in worker
symfony_symfony
train
php
ddf88292c1775531d92d6211904f9f2046207b1f
diff --git a/lib/mdl.rb b/lib/mdl.rb index <HASH>..<HASH> 100644 --- a/lib/mdl.rb +++ b/lib/mdl.rb @@ -88,7 +88,6 @@ module MarkdownLint error_lines.each do |line| line += doc.offset # Correct line numbers for any yaml front matter if Config[:json] - require 'json' results << { 'filename' => filename, 'line' => line, @@ -106,6 +105,7 @@ module MarkdownLint end if Config[:json] + require 'json' puts JSON.generate(results) elsif status != 0 puts "\nA detailed description of the rules is available at "\
Imports JSON when generating results (#<I>) * Imports JSON when generating results * Removes json require statement as requested
markdownlint_markdownlint
train
rb
45fe96fb056d7f90e229af71fa52db15114392fb
diff --git a/ford/utils.py b/ford/utils.py index <HASH>..<HASH> 100644 --- a/ford/utils.py +++ b/ford/utils.py @@ -31,7 +31,8 @@ import os.path NOTE_TYPE = {'note':'info', 'warning':'warning', 'todo':'success', - 'bug':'danger'} + 'bug':'danger', + 'history':'history'} NOTE_RE = [re.compile(r"@({})\s*(((?!@({})).)*?)@end\1\s*(</p>)?".format(note, '|'.join(NOTE_TYPE.keys())), re.IGNORECASE|re.DOTALL) for note in NOTE_TYPE] \ + [re.compile(r"@({})\s*(.*?)\s*</p>".format(note),
add history as a note_type
Fortran-FOSS-Programmers_ford
train
py
b3a242dc513ce3dd53be2c0f0073acf36a7f1038
diff --git a/azure-keyvault/azure/keyvault/custom/key_vault_authentication.py b/azure-keyvault/azure/keyvault/custom/key_vault_authentication.py index <HASH>..<HASH> 100644 --- a/azure-keyvault/azure/keyvault/custom/key_vault_authentication.py +++ b/azure-keyvault/azure/keyvault/custom/key_vault_authentication.py @@ -6,6 +6,7 @@ import urllib from requests.auth import AuthBase import requests +import os from msrest.authentication import Authentication @@ -30,7 +31,7 @@ class KeyVaultAuthBase(AuthBase): # send the request to retrieve the challenge, then request the token and update # the request # TODO: wire up commons flag for things like Fiddler, logging, etc. - response = requests.Session().request(request) + response = requests.Session().send(request, verify=os.environ.get('REQUESTS_CA_BUNDLE') or os.environ.get('CURL_CA_BUNDLE')) if response.status_code == 401: auth_header = response.headers['WWW-Authenticate'] if HttpBearerChallenge.is_bearer_challenge(auth_header):
fix in KeyVaultAuthBase to call send with environment CA verify into
Azure_azure-sdk-for-python
train
py
c71f6aec0c7b88c22fc1ea1ffa76f63c5092764e
diff --git a/hug/routing.py b/hug/routing.py index <HASH>..<HASH> 100644 --- a/hug/routing.py +++ b/hug/routing.py @@ -591,10 +591,7 @@ class HTTPRouter(Router): callable_method.interface = interface callable_method.without_directives = api_function - if is_method: - api_function.__dict__['interface'] = interface - else: - api_function.interface = interface + api_function.__dict__['interface'] = interface interface.api_function = api_function interface.output_format = function_output interface.defaults = defaults
Simplify logic, since method based approach works for both
hugapi_hug
train
py
a3967826aa7481335e3f8026fd9f344a4f7b428d
diff --git a/psamm/graph.py b/psamm/graph.py index <HASH>..<HASH> 100644 --- a/psamm/graph.py +++ b/psamm/graph.py @@ -473,9 +473,9 @@ def make_network_dict(nm, mm, subset=None, method='fpp', else: logger.warning( 'Reaction {} is excluded from visualization due ' - 'missing or invalid compound formula'.format(r.id)) + 'missing or undefined compound formula'.format(r.id)) - reaction_pairs = [(r.id, r.equation) for r in testing_list] + reaction_pairs = [(r.id, r.equation) for r in testing_list_update] fpp_dict, _ = findprimarypairs.predict_compound_pairs_iterated( reaction_pairs, compound_formula, element_weight=element_weight)
fix the problem that the function stops if undefined formula presents (such as (C3H3O3)n)
zhanglab_psamm
train
py
c5806460b493050c6f83c917eeaeb0f6089c552b
diff --git a/test/test_pkcs11_thread.rb b/test/test_pkcs11_thread.rb index <HASH>..<HASH> 100644 --- a/test/test_pkcs11_thread.rb +++ b/test/test_pkcs11_thread.rb @@ -35,7 +35,7 @@ class TestPkcs11Thread < Test::Unit::TestCase } # This should take some seconds: pub_key, priv_key = session.generate_key_pair(:RSA_PKCS_KEY_PAIR_GEN, - {:MODULUS_BITS=>1408, :PUBLIC_EXPONENT=>[3].pack("N"), :TOKEN=>false}, + {:MODULUS_BITS=>2048, :PUBLIC_EXPONENT=>[3].pack("N"), :TOKEN=>false}, {}) th.kill assert_operator count, :>, 10, "The second thread should count further concurrent to the key generation"
RSA-<I> is too small on a faster CPU.
larskanis_pkcs11
train
rb
a733beb933d67b725c4972c97b8e5929792224bd
diff --git a/lib/compiler/js.js b/lib/compiler/js.js index <HASH>..<HASH> 100644 --- a/lib/compiler/js.js +++ b/lib/compiler/js.js @@ -34,7 +34,7 @@ let js = { return s .replace(/\\/g, "\\\\") // backslash .replace(/\//g, "\\/") // closing slash - .replace(/\]/g, "\\]") // closing bracket + .replace(/]/g, "\\]") // closing bracket .replace(/\^/g, "\\^") // caret .replace(/-/g, "\\-") // dash .replace(/\0/g, "\\0") // null
Remove unnecessary escaping of "]" in a regexp This fixes the following ESLint error, which started to appear after eslint/eslint#<I> was fixed: /Users/dmajda/Programming/PEG.js/pegjs/lib/compiler/js.js <I>:<I> error Unnecessary escape character: \] no-useless-escape This should fix broken Travis CI builds: <URL>
pegjs_pegjs
train
js
c93bafe2171fccdf01b3194589824fbca539d395
diff --git a/src/wyil/lang/IntersectionRewrites.java b/src/wyil/lang/IntersectionRewrites.java index <HASH>..<HASH> 100755 --- a/src/wyil/lang/IntersectionRewrites.java +++ b/src/wyil/lang/IntersectionRewrites.java @@ -49,7 +49,7 @@ public final class IntersectionRewrites implements RewriteRule { Object data = null; int kind = Type.K_ANY; - for(int i=0;i!=children.length;++i) { + for(int i=0;i<children.length;++i) { int iChild = children[i]; // check whether this child is subsumed Automata.State child = automata.states[iChild]; @@ -60,7 +60,10 @@ public final class IntersectionRewrites implements RewriteRule { automata.states[index] = new Automata.State(Type.K_VOID); return true; } else if (kind == child.kind) { - if((data == null && child.data != null) || !data.equals(child.data)) { + if ((data == child.data) + || (data != null && data.equals(child.data))) { + // this is ok + } else { automata.states[index] = new Automata.State(Type.K_VOID); return true; }
Making progress on simplification of types ...
Whiley_WhileyCompiler
train
java
dcffdfa3968534639d8942afacd33b39d93eab7a
diff --git a/lib/argus/nav_monitor.rb b/lib/argus/nav_monitor.rb index <HASH>..<HASH> 100644 --- a/lib/argus/nav_monitor.rb +++ b/lib/argus/nav_monitor.rb @@ -65,6 +65,9 @@ module Argus if @nav_data.bootstrap? @controller.demo_mode end + if @nav_data.control_command_ack? + @controller.ack_control_mode + end data.options.each do |opt| @nav_options[opt.tag] = opt if opt.tag < 100 end
Add ack_control_mode command to NavMonitor This was done to see if it improves the nav data stream. We still reached a point where the nav data had stopped, so I don't think we are there yet. Perhaps we need better logging capability to monitor program state along with the nav data.
jimweirich_argus
train
rb
1862d258e3cfbeb31f3b2be27affe6fc5f226801
diff --git a/backends/graphite.js b/backends/graphite.js index <HASH>..<HASH> 100644 --- a/backends/graphite.js +++ b/backends/graphite.js @@ -34,6 +34,7 @@ var post_stats = function graphite_post_stats(statString) { } }); graphite.on('connect', function() { + var ts = Math.round(new Date().getTime() / 1000); statString += 'statsd.graphiteStats.last_exception ' + last_exception + ' ' + ts + "\n"; statString += 'statsd.graphiteStats.last_flush ' + last_flush + ' ' + ts + "\n"; this.write(statString);
we need a timestamp of course
statsd_statsd
train
js
31c7876f0693a1335c8e41b340e8580aa9a510ae
diff --git a/src/test/java/org/mockitousage/verification/VerificationAfterDelayTest.java b/src/test/java/org/mockitousage/verification/VerificationAfterDelayTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/mockitousage/verification/VerificationAfterDelayTest.java +++ b/src/test/java/org/mockitousage/verification/VerificationAfterDelayTest.java @@ -4,6 +4,10 @@ package org.mockitousage.verification; +import static org.mockito.Mockito.after; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + import java.util.LinkedList; import java.util.List; @@ -17,8 +21,6 @@ import org.mockito.Mock; import org.mockito.exceptions.base.MockitoAssertionError; import org.mockitoutil.TestBase; -import static org.mockito.Mockito.*; - public class VerificationAfterDelayTest extends TestBase { @Rule
same that before just modified some imports
mockito_mockito
train
java
2d18e84d0432070f5657ee3cfa9820bf40ce33b6
diff --git a/client.go b/client.go index <HASH>..<HASH> 100644 --- a/client.go +++ b/client.go @@ -235,7 +235,7 @@ func (c *Client) mCleaner(m map[string]*HostClient) { } } -// Maximum number of concurrent connections http client can establish per host +// Maximum number of concurrent connections http client may establish per host // by default. const DefaultMaxConnsPerHost = 100 @@ -436,6 +436,29 @@ func (c *HostClient) DoTimeout(req *Request, resp *Response, timeout time.Durati } func clientDoTimeout(req *Request, resp *Response, timeout time.Duration, c clientDoer) error { + deadline := time.Now().Add(timeout) + for { + err := clientDoTimeoutFreeConn(req, resp, timeout, c) + if err != ErrNoFreeConns { + return err + } + timeout = -time.Since(deadline) + if timeout <= 0 { + return ErrTimeout + } + sleepTime := 100 * time.Millisecond + if sleepTime > timeout { + sleepTime = timeout + } + time.Sleep(sleepTime) + timeout = -time.Since(deadline) + if timeout <= 0 { + return ErrTimeout + } + } +} + +func clientDoTimeoutFreeConn(req *Request, resp *Response, timeout time.Duration, c clientDoer) error { var ch chan error chv := errorChPool.Get() if chv == nil {
Handle 'no free connections to host' error when doing request with user-defined timeout
valyala_fasthttp
train
go
46bf235d5b4a981aa6ab826171bb784c1215c62c
diff --git a/libraries/validform.js b/libraries/validform.js index <HASH>..<HASH> 100644 --- a/libraries/validform.js +++ b/libraries/validform.js @@ -11,7 +11,7 @@ * * @package ValidFormBuilder * @author Felix Langfeldt - * @version 0.2.1 + * @version 0.2.2 */ function ValidFormValidator(strFormId) { @@ -365,7 +365,7 @@ ValidFormFieldValidator.prototype.validate = function(value) { } //*** Check specific types using regular expression. - if(typeof this.check != "function") { + if(typeof this.check != "function" && typeof this.check != "object") { return true; } else { blnReturn = this.check.test(value);
Fixed a client side validation issue. Related to issue 5 (<URL>
validformbuilder_validformbuilder
train
js
abbd0343b69b6a3f79824e3d531ba5194116edec
diff --git a/lib/slack-notifier/link_formatter.rb b/lib/slack-notifier/link_formatter.rb index <HASH>..<HASH> 100644 --- a/lib/slack-notifier/link_formatter.rb +++ b/lib/slack-notifier/link_formatter.rb @@ -54,7 +54,7 @@ module Slack # http://rubular.com/r/fLEdmTSghW def markdown_pattern - /\[ ([^\[\]]*?) \] \( (https?:\/\/.*?) \) /x + /\[ ([^\[\]]*?) \] \( ((https?:\/\/.*?) | (mailto:.*?)) \) /x end end diff --git a/spec/lib/slack-notifier/link_formatter_spec.rb b/spec/lib/slack-notifier/link_formatter_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/slack-notifier/link_formatter_spec.rb +++ b/spec/lib/slack-notifier/link_formatter_spec.rb @@ -63,6 +63,11 @@ describe Slack::Notifier::LinkFormatter do expect(formatted).to eq "こんにちは" end + it "handles email links in markdown" do + formatted = described_class.format("[John](mailto:[email protected])") + expect(formatted).to eq "<mailto:[email protected]|John>" + end + end end
Handle mailto link within markdown.
stevenosloan_slack-notifier
train
rb,rb
05cb7fd20e082c5838fc6a57216578b9b930626a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -6,6 +6,11 @@ if sys.version_info < (3, 2): print("ApiDoc requires Python 3.2 or later") raise SystemExit(1) +if sys.version_info == (3, 2): + requirements = ['Jinja2 == 2.6', 'PyYAML'] +else: + requirements = ['Jinja2', 'PyYAML'] + from setuptools import setup, find_packages setup( @@ -38,8 +43,5 @@ setup( 'template/resource/js/*.js', 'template/resource/img/*.png', ]}, - install_requires=[ - 'Jinja2', - 'PyYAML', - ] + install_requires=requirements )
Fix Jinja version for python = <I>
SolutionsCloud_apidoc
train
py
b1f8c042d0d77e2c9b48b757bcfb38e4f5fc6336
diff --git a/py/h2o_cmd.py b/py/h2o_cmd.py index <HASH>..<HASH> 100644 --- a/py/h2o_cmd.py +++ b/py/h2o_cmd.py @@ -332,7 +332,7 @@ def check_key_distribution(): print 'num_keys:', n['num_keys'], 'value_size_bytes:', n['value_size_bytes'],\ 'name:', n['name'] delta = (abs(avgKeys - int(n['num_keys']))/avgKeys) - if delta > 0.05: + if delta > 0.10: print "WARNING. avgKeys:", avgKeys, "and n['num_keys']:", n['num_keys'], "have >", "%.1f" % (100 * delta), "% delta"
only warn about <I>% delta in key distribution
h2oai_h2o-2
train
py
830fd6641fe7d4a82076780d18182f9949e4895c
diff --git a/lib/hammer_cli_katello/repository.rb b/lib/hammer_cli_katello/repository.rb index <HASH>..<HASH> 100644 --- a/lib/hammer_cli_katello/repository.rb +++ b/lib/hammer_cli_katello/repository.rb @@ -203,7 +203,7 @@ module HammerCLIKatello end def request_headers - {:content_type => 'multipart/form-data', :multipart => true} + {:content_type => 'multipart/form-data'} end def execute @@ -238,10 +238,12 @@ module HammerCLIKatello offset = 0 while (content = file.read(CONTENT_CHUNK_SIZE)) - params = {:offset => offset, - :id => upload_id, - :content => content, - :repository_id => repo_id + params = { + :offset => offset, + :id => upload_id, + :content => content, + :repository_id => repo_id, + :multipart => true } content_upload_resource.call(:update, params, request_headers)
Fixes #<I> - Upload content as multipart/form-data
Katello_hammer-cli-katello
train
rb
e3372628e7ec0c3f7746d1d4d5531a61db393e00
diff --git a/src/DockerBase.php b/src/DockerBase.php index <HASH>..<HASH> 100644 --- a/src/DockerBase.php +++ b/src/DockerBase.php @@ -9,6 +9,7 @@ namespace mglaman\Docker; +use Symfony\Component\Process\ExecutableFinder; use Symfony\Component\Process\ProcessBuilder; /** @@ -21,7 +22,10 @@ abstract class DockerBase implements DockerInterface { * @return bool */ public static function native() { - return PHP_OS == 'Linux'; + $finder = new ExecutableFinder(); + // If a Docker executable can be found then assume that native commands will + // work regardless of OS. + return PHP_OS === 'Linux' || (bool) $finder->find('docker'); } /**
Use native commands on all OS's if supported (#4)
mglaman_docker-helper
train
php
f84cfd2eff56bdf338c226950d2ae6e331f27da1
diff --git a/lib/mini_fb.rb b/lib/mini_fb.rb index <HASH>..<HASH> 100644 --- a/lib/mini_fb.rb +++ b/lib/mini_fb.rb @@ -652,14 +652,9 @@ module MiniFB res_hash = JSON.parse("{\"response\": #{resp.to_s}}") end end - -#This is bad because it strips off paging parameters and what not. - # if res_hash.size == 1 && res_hash["data"] -# res_hash = res_hash["data"] -# end if res_hash.is_a? Array # fql return this - res_hash.collect! { |x| Hashie::Mash.new(x) } + res_hash.collect! { |x| x.is_a?(Hash) ? Hashie::Mash.new(x) : x } else res_hash = Hashie::Mash.new(res_hash) end @@ -670,7 +665,7 @@ module MiniFB return res_hash rescue RestClient::Exception => ex - puts ex.http_code.to_s + puts "ex.http_code=" + ex.http_code.to_s puts 'ex.http_body=' + ex.http_body if @@logging res_hash = JSON.parse(ex.http_body) # probably should ensure it has a good response raise MiniFB::FaceBookError.new(ex.http_code, "#{res_hash["error"]["type"]}: #{res_hash["error"]["message"]}")
Added fix for responses that return an array of non-hashes.
appoxy_mini_fb
train
rb
2de35e9c185e0ed7ad978851f7f2c4f4779c1ee7
diff --git a/library/UnitTestCase.php b/library/UnitTestCase.php index <HASH>..<HASH> 100755 --- a/library/UnitTestCase.php +++ b/library/UnitTestCase.php @@ -109,6 +109,9 @@ abstract class UnitTestCase extends BaseTestCase if ($testConfig->getModulesToActivate()) { $oTestModuleLoader = $this->_getModuleLoader(); $oTestModuleLoader->activateModules($testConfig->getModulesToActivate()); + + // Modules might add new translations, and language object has a static cache which must be flushed + \OxidEsales\Eshop\Core\Registry::set('oxLang', null); } \OxidEsales\Eshop\Core\Registry::set(\OxidEsales\Eshop\Core\UtilsDate::class, new modOxUtilsDate());
ESDEV-<I> Properly reset/flush Language object as registered in Registry
OXID-eSales_testing_library
train
php
4adee7597aad7a338db8d3eb320575ae618a8c81
diff --git a/core/src/main/java/hudson/model/CauseAction.java b/core/src/main/java/hudson/model/CauseAction.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/model/CauseAction.java +++ b/core/src/main/java/hudson/model/CauseAction.java @@ -82,14 +82,21 @@ public class CauseAction implements FoldableAction, RunAction2 { public CauseAction(CauseAction ca) { addCauses(ca.getCauses()); } - + + /** + * Lists all causes of this build. + * Note that the current implementation does not preserve insertion order of duplicates. + * @return an immutable list; + * to create an action with multiple causes use either of the constructors that support this; + * to append causes retroactively to a build you must create a new {@link CauseAction} and replace the old + */ @Exported(visibility=2) public List<Cause> getCauses() { List<Cause> r = new ArrayList<>(); for (Map.Entry<Cause,Integer> entry : causeBag.entrySet()) { r.addAll(Collections.nCopies(entry.getValue(), entry.getKey())); } - return r; + return Collections.unmodifiableList(r); } /**
[JENKINS-<I>] Clarifying that CauseAction.getCauses is immutable and you should construct the action with the causes you want.
jenkinsci_jenkins
train
java
c85940333557be53a460a3e31915f277c1d8c966
diff --git a/core/toolbox.js b/core/toolbox.js index <HASH>..<HASH> 100644 --- a/core/toolbox.js +++ b/core/toolbox.js @@ -351,6 +351,7 @@ Blockly.Toolbox.prototype.setSelectedItem = function(item) { var scrollPositions = this.flyout_.categoryScrollPositions; for (var i = 0; i < scrollPositions.length; i++) { if (categoryName === scrollPositions[i].categoryName) { + this.flyout_.setVisible(true); this.flyout_.scrollTo(scrollPositions[i].position); return; }
Show flyout on selecting category in autoclose mode
LLK_scratch-blocks
train
js
4faa84daa050a60ac6ab643c6d7a5cd78b6bdb37
diff --git a/src/type/s2k.js b/src/type/s2k.js index <HASH>..<HASH> 100644 --- a/src/type/s2k.js +++ b/src/type/s2k.js @@ -161,15 +161,13 @@ S2K.prototype.produce_key = async function (passphrase, numBytes) { case 'iterated': { const count = s2k.get_count(); const data = util.concatUint8Array([s2k.salt, passphrase]); - let isp = new Array(Math.ceil(count / data.length)); - - isp = util.concatUint8Array(isp.fill(data)); - - if (isp.length > count) { - isp = isp.subarray(0, count); + const datalen = data.length; + const isp = new Uint8Array(prefix.length + count + datalen); + isp.set(prefix); + for (let pos = prefix.length; pos < count; pos += datalen) { + isp.set(data, pos); } - - return crypto.hash.digest(algorithm, util.concatUint8Array([prefix, isp])); + return crypto.hash.digest(algorithm, isp.subarray(0, prefix.length + count)); } case 'gnu': throw new Error("GNU s2k type not supported.");
Inline iterated S2K loop
openpgpjs_openpgpjs
train
js
78a359e2c6ceeca0aa8788c99533fa857a4f9d3c
diff --git a/lib/vagrant-vcloudair.rb b/lib/vagrant-vcloudair.rb index <HASH>..<HASH> 100644 --- a/lib/vagrant-vcloudair.rb +++ b/lib/vagrant-vcloudair.rb @@ -54,7 +54,7 @@ module Vagrant def get_vapp_id vappid_file = @data_dir.join('../../../vcloudair_vappid') if vappid_file.file? - @vappid = vappid_file.read + @vappid = vappid_file.read.chomp else nil end
Strip whitespace from vappid When reading the vappid from a file strip any leading or trailing whitespace so that the URL can be constructed correctly.
frapposelli_vagrant-vcloudair
train
rb
ab44c06bc810e3125f9a9e69a386fee8dea6e1fe
diff --git a/message_sender/tests.py b/message_sender/tests.py index <HASH>..<HASH> 100644 --- a/message_sender/tests.py +++ b/message_sender/tests.py @@ -4145,7 +4145,7 @@ class TestWhatsAppAPISender(TestCase): send_hsm should make the appropriate request to the WhatsApp API """ sender = WhatsAppApiSender( - "http://whatsapp", "test-token", "hsm-namespace", "hsm-element-name", "ttl" + "http://whatsapp", "test-token", "hsm-namespace", "hsm-element-name", 604800 ) responses.add( @@ -4161,7 +4161,7 @@ class TestWhatsAppAPISender(TestCase): json.loads(request.body), { "to": "27820001001", - "ttl": "ttl", + "ttl": 604800, "type": "hsm", "hsm": { "namespace": "hsm-namespace",
changed send_hsm test to include ttl with specific value
praekeltfoundation_seed-message-sender
train
py
77402d2dd172b1a846c0e6c9d526efc7a78426e8
diff --git a/registration/views.py b/registration/views.py index <HASH>..<HASH> 100644 --- a/registration/views.py +++ b/registration/views.py @@ -62,8 +62,7 @@ class RegistrationView(FormView): # # Manually implementing this method, and passing the form # instance to get_context_data(), solves this issue (which - # will be fixed, at the very least, in Django 1.10, and may - # also be backported into the Django 1.9 release series). + # will be fixed in Django 1.9.1 and Django 1.10). return self.render_to_response(self.get_context_data(form=form)) def registration_allowed(self):
Fix form_invalid comment now that the fix is backported into <I>.x.
ubernostrum_django-registration
train
py
7d8bd9865854032af610ea73382aa23ebe9dfe62
diff --git a/src/Enhavo/Bundle/AppBundle/Form/Type/RoutingType.php b/src/Enhavo/Bundle/AppBundle/Form/Type/RoutingType.php index <HASH>..<HASH> 100644 --- a/src/Enhavo/Bundle/AppBundle/Form/Type/RoutingType.php +++ b/src/Enhavo/Bundle/AppBundle/Form/Type/RoutingType.php @@ -9,6 +9,7 @@ namespace Enhavo\Bundle\AppBundle\Form\Type; use Enhavo\Bundle\AppBundle\Entity\Route; +use Enhavo\Bundle\AppBundle\Exception\UrlResolverException; use Enhavo\Bundle\AppBundle\Route\GeneratorInterface; use Enhavo\Bundle\AppBundle\Route\Routeable; use Enhavo\Bundle\AppBundle\Route\Routing; @@ -84,7 +85,7 @@ class RoutingType extends AbstractType 'data' => $url, 'read_only' => true )); - } catch (\InvalidArgumentException $e) { + } catch (UrlResolverException $e) { return; } }
fix wrong catched exception in routing type
enhavo_enhavo
train
php
5bafda643d57420a6a06406954a41962a3fc0c6f
diff --git a/exe/arduino_ci_remote.rb b/exe/arduino_ci_remote.rb index <HASH>..<HASH> 100755 --- a/exe/arduino_ci_remote.rb +++ b/exe/arduino_ci_remote.rb @@ -144,9 +144,13 @@ all_platforms = {} aux_libraries = Set.new(config.aux_libraries_for_unittest + config.aux_libraries_for_build) # while collecting the platforms, ensure they're defined config.platforms_to_unittest.each { |p| all_platforms[p] = assured_platform("unittest", p, config) } +example_platforms = {} library_examples.each do |path| ovr_config = config.from_example(path) - ovr_config.platforms_to_build.each { |p| all_platforms[p] = assured_platform("library example", p, config) } + ovr_config.platforms_to_build.each do |p| + # assure the platform if we haven't already + example_platforms[p] = all_platforms[p] = assured_platform("library example", p, config) unless example_platforms.key?(p) + end aux_libraries.merge(ovr_config.aux_libraries_for_build) end
don't redundantly report assured platforms
ianfixes_arduino_ci
train
rb
0627114ab3c9d440d852933a54f63be715dcb748
diff --git a/src/plugin/release/index.js b/src/plugin/release/index.js index <HASH>..<HASH> 100644 --- a/src/plugin/release/index.js +++ b/src/plugin/release/index.js @@ -46,6 +46,12 @@ function action (config, directory, options) { ? config.releaseBranch : 'master' + const { code } = execSync('git checkout ' + releaseBranch) + + if (code !== 0) { + throw new Error('Could not switch to ' + releaseBranch) + } + const packages = config.packages.map(getPkg(directory)) checkRelease(packages).then(function (status) {
fix(northbrook): switch to releaseBranch before doing anything
northbrookjs_northbrook
train
js
80e1ee829fe6f9f03f0b7ef1c2c19e4fa19aa819
diff --git a/src/now.js b/src/now.js index <HASH>..<HASH> 100755 --- a/src/now.js +++ b/src/now.js @@ -403,10 +403,20 @@ const main = async (argv_) => { process.exit(1) } - ctx.authConfig.credentials.push({ + const obj = { provider: 'sh', token - }) + } + + const credentialsIndex = ctx.authConfig.credentials.findIndex( + cred => cred.provider === 'sh' + ) + + if (credentialsIndex === -1) { + ctx.authConfig.credentials.push(obj) + } else { + ctx.authConfig.credentials[credentialsIndex] = obj + } if (isTTY) { console.log(info('Caching account information...'))
Fix edge case where `--token` was being ignored (#<I>) * Fix edge case where `--token` was being ignored * Fix logic
zeit_now-cli
train
js
38eb804d1350cc2505fdec82e94abaf715f9fb2a
diff --git a/cas-server-core/src/test/java/org/jasig/cas/CentralAuthenticationServiceImplTests.java b/cas-server-core/src/test/java/org/jasig/cas/CentralAuthenticationServiceImplTests.java index <HASH>..<HASH> 100644 --- a/cas-server-core/src/test/java/org/jasig/cas/CentralAuthenticationServiceImplTests.java +++ b/cas-server-core/src/test/java/org/jasig/cas/CentralAuthenticationServiceImplTests.java @@ -5,6 +5,7 @@ import org.jasig.cas.authentication.AuthenticationContext; import org.jasig.cas.authentication.AuthenticationException; import org.jasig.cas.authentication.Credential; import org.jasig.cas.authentication.MixedPrincipalException; +import org.jasig.cas.authentication.PrincipalException; import org.jasig.cas.authentication.TestUtils; import org.jasig.cas.authentication.UsernamePasswordCredential; import org.jasig.cas.authentication.principal.Service; @@ -114,7 +115,7 @@ public class CentralAuthenticationServiceImplTests extends AbstractCentralAuthen getCentralAuthenticationService().grantServiceTicket(ticketId.getId(), getService(), ctx); } - @Test(expected = UnauthorizedServiceForPrincipalException.class) + @Test(expected = PrincipalException.class) public void verifyGrantServiceTicketFailsAuthzRule() throws Exception { final AuthenticationContext ctx = TestUtils.getAuthenticationContext(getAuthenticationSystemSupport(), getService("TestServiceAttributeForAuthzFails"));
Merge branch 'master' into tgt-authZ # Conflicts: # gradle.properties
apereo_cas
train
java
e4754d2e9ce0c0c4ad9e19ea9777e3edb4b0c420
diff --git a/lib/extract/extractGradient.js b/lib/extract/extractGradient.js index <HASH>..<HASH> 100644 --- a/lib/extract/extractGradient.js +++ b/lib/extract/extractGradient.js @@ -15,20 +15,14 @@ export default function(props) { const stops = {}; Children.forEach(props.children, child => { - if (child.type === Stop) { - if (child.props.stopColor && child.props.offset) { - // convert percent to float. - let offset = percentToFloat(child.props.offset); + if (child.props.stopColor && child.props.offset) { + // convert percent to float. + let offset = percentToFloat(child.props.offset); - // add stop - //noinspection JSUnresolvedFunction - stops[offset] = Color(child.props.stopColor).alpha( - extractOpacity(child.props.stopOpacity) - ); - } - } else { - console.warn( - "`Gradient` elements only accept `Stop` elements as children" + // add stop + //noinspection JSUnresolvedFunction + stops[offset] = Color(child.props.stopColor).alpha( + extractOpacity(child.props.stopOpacity) ); } });
Remove 'child.type === Stop' check from extractGradient
react-native-community_react-native-svg
train
js
6df832f0acc78d203de1864ec277565d92d4a6dd
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -29,8 +29,7 @@ module.exports = function(options) { return through.obj(function(file, enc, callback) { if (file.isBuffer()) { - this.emit('error', new gutil.PluginError(PLUGIN_NAME, 'Buffers are not supported')); - return callback(null); + return callback('Buffers are not supported'); } var p = path.normalize(path.relative(file.cwd, file.path)); if (options.debug) gutil.log(gutil.colors.magenta('processing file: ') + p);
Just provide the error to the callback instead of a new PluginError
zhevron_gulp-deploy-git
train
js
e86793e4c6ba05109826dd326ba05b1198f8eefb
diff --git a/deployer/db/config/set.php b/deployer/db/config/set.php index <HASH>..<HASH> 100644 --- a/deployer/db/config/set.php +++ b/deployer/db/config/set.php @@ -101,7 +101,7 @@ set('bin/deployer', function () { $deployerVersionToUse = '5.0.3'; break; case 4: - $deployerVersionToUse = '4.3.0'; + $deployerVersionToUse = '4.3.1'; break; case 3: $deployerVersionToUse = '3.3.0';
[TASK] Insrease the required deployer version
sourcebroker_deployer-extended-database
train
php
e84301ac714201a52924b365ef8a056bf1f12082
diff --git a/acceptance/send_notification_to_email_test.go b/acceptance/send_notification_to_email_test.go index <HASH>..<HASH> 100644 --- a/acceptance/send_notification_to_email_test.go +++ b/acceptance/send_notification_to_email_test.go @@ -17,7 +17,7 @@ var _ = Describe("Send a notification to an email", func() { var templateID string var response support.NotifyResponse clientID := "notifications-sender" - clientToken := GetClientTokenFor(clientID, "uaa") + clientToken := GetClientTokenFor(clientID, "testzone1") client := support.NewClient(Servers.Notifications.URL()) By("registering a notifications", func() {
Test sending notification to email works with Identity Zones [#<I>]
cloudfoundry-incubator_notifications
train
go
2bfa6b814fcf76f85dfc6092a1afc3d0941e21d7
diff --git a/src/org/opencms/site/CmsSiteManagerImpl.java b/src/org/opencms/site/CmsSiteManagerImpl.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/site/CmsSiteManagerImpl.java +++ b/src/org/opencms/site/CmsSiteManagerImpl.java @@ -635,9 +635,9 @@ public final class CmsSiteManagerImpl implements I_CmsEventListener { siteroots.add(shared); } // all sites are compatible for root admins, skip unnecessary tests - boolean compatible = OpenCms.getRoleManager().hasRole(cms, CmsRole.ROOT_ADMIN); + boolean allCompatible = OpenCms.getRoleManager().hasRole(cms, CmsRole.ROOT_ADMIN); List<CmsResource> resources = Collections.emptyList(); - if (!compatible) { + if (!allCompatible) { try { resources = OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit(cms, ouFqn); } catch (CmsException e) { @@ -648,6 +648,7 @@ public final class CmsSiteManagerImpl implements I_CmsEventListener { Iterator<String> roots = siteroots.iterator(); while (roots.hasNext()) { String folder = roots.next(); + boolean compatible = allCompatible; if (!compatible) { Iterator<CmsResource> itResources = resources.iterator(); while (itResources.hasNext()) {
Fixed bug with visibility of sites in the site switcher.
alkacon_opencms-core
train
java
e5cfe0aa99887875e775fe9a3d794d34af322e93
diff --git a/lib/ffi_yajl/version.rb b/lib/ffi_yajl/version.rb index <HASH>..<HASH> 100644 --- a/lib/ffi_yajl/version.rb +++ b/lib/ffi_yajl/version.rb @@ -21,5 +21,5 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. module FFI_Yajl - VERSION = "2.0.0" + VERSION = "2.1.0" end
bumping version to <I>
chef_ffi-yajl
train
rb
d48836131e70582494ca051beb70fd6096c1553d
diff --git a/src/Extensions/ElementalAreasExtension.php b/src/Extensions/ElementalAreasExtension.php index <HASH>..<HASH> 100644 --- a/src/Extensions/ElementalAreasExtension.php +++ b/src/Extensions/ElementalAreasExtension.php @@ -273,14 +273,14 @@ class ElementalAreasExtension extends DataExtension } $ownerClass = get_class($this->owner); - $tableName = $this->owner->getSchema()->tableName($ownerClass); $elementalAreas = $this->owner->getElementalRelations(); $schema = $this->owner->getSchema(); // There is no inbuilt filter for null values $where = []; foreach ($elementalAreas as $areaName) { - $where[] = $schema->sqlColumnForField($ownerClass, $areaName . 'ID') . ' IS NULL'; + $queryDetails = $schema->sqlColumnForField($ownerClass, $areaName . 'ID'); + $where[] = $queryDetails . ' IS NULL OR ' . $queryDetails . ' = 0' ; } foreach ($ownerClass::get()->where(implode(' OR ', $where)) as $elementalObject) {
Added extra query condition to account for values equal to 0. Removed unused variable. Added extra query parameters
dnadesign_silverstripe-elemental
train
php
b91e6b3d02a038ee7035208b60b23f013f826cbf
diff --git a/flask_discoverer.py b/flask_discoverer.py index <HASH>..<HASH> 100644 --- a/flask_discoverer.py +++ b/flask_discoverer.py @@ -1,4 +1,4 @@ -from flask import current_app +from flask import current_app, Response import json DEFAULT_CONFIG = { @@ -51,7 +51,7 @@ class Discoverer(object): resources[rule.rule].update({key:f.view_class.__getattribute__(f.view_class,key)}) if hasattr(f,key): resources[rule.rule].update({key:f.__getattribute__(key)}) - return json.dumps(resources) + return Response(json.dumps(resources), mimetype='application/json') def advertise(*args,**kwargs): def decorator(f):
core: set mimtype='application/json' on /resources
adsabs_flask-discoverer
train
py
0938d5d6bd9993d3f19ac6797f27b1d5bb556179
diff --git a/src/test/java/com/ibm/disni/examples/SpdkProbe.java b/src/test/java/com/ibm/disni/examples/SpdkProbe.java index <HASH>..<HASH> 100644 --- a/src/test/java/com/ibm/disni/examples/SpdkProbe.java +++ b/src/test/java/com/ibm/disni/examples/SpdkProbe.java @@ -51,7 +51,7 @@ public class SpdkProbe { System.out.println(" Multi host = " + multipathIOCapabilities.hasMultiHost()); System.out.println(" SR-IOV = " + multipathIOCapabilities.hasSingleRootIOVirtualization()); - System.out.print("Maximum data transfer size = ") + System.out.print("Maximum data transfer size = "); if (data.getMaximumDataTransferSize() == 0) { System.out.println("unlimited"); } else {
nvmef: fix missing ;
zrlio_disni
train
java
6c542041f074beedfab75973a5c9a2ea576201f5
diff --git a/scripts/rollup/plugins/index.js b/scripts/rollup/plugins/index.js index <HASH>..<HASH> 100644 --- a/scripts/rollup/plugins/index.js +++ b/scripts/rollup/plugins/index.js @@ -11,7 +11,7 @@ module.exports = function(version, options) { aliasPlugin, nodeResolve({ extensions: ['.ts', '.js', '.json'], - jsnext: true + mainFields: ['module', 'main'] }), commonjs({ include: 'node_modules/**'
Replaced deprecated rollup node-resolve option.jsnext with mainfield setting
infernojs_inferno
train
js
630301fba781a6f0d9db05541af7bea186113727
diff --git a/test/unit/render.js b/test/unit/render.js index <HASH>..<HASH> 100644 --- a/test/unit/render.js +++ b/test/unit/render.js @@ -237,6 +237,23 @@ tests = [ } }, result: '<p>The population of the UK is 62.6 million.</p>' + }, + { + name: 'Responding to downstream changes', + template: '<p>Total: {{( total( numbers ) )}}</p>', + data: { + numbers: [ 1, 2, 3, 4 ], + total: function ( numbers ) { + return numbers.reduce( function ( prev, curr ) { + return prev + curr; + }); + } + }, + result: '<p>Total: 10</p>', + new_data: { + 'numbers[4]': 5 + }, + new_result: '<p>Total: 15</p>' } ];
added test of upstream keypath dependants
ractivejs_ractive
train
js
e3582255b8bf47e16cc493fbee4a44a7729d01d1
diff --git a/src/Lucid/QueryBuilder/proxyHandler.js b/src/Lucid/QueryBuilder/proxyHandler.js index <HASH>..<HASH> 100644 --- a/src/Lucid/QueryBuilder/proxyHandler.js +++ b/src/Lucid/QueryBuilder/proxyHandler.js @@ -65,7 +65,8 @@ proxyHandler.get = function (target, name) { proxyHandler.set = function (target, name, value) { if (notToTouch.indexOf(name) > -1) { target[name] = value - return + return true } target.modelQueryBuilder[name] = value + return true }
refactor(*): make it ready for node v6
adonisjs_adonis-lucid
train
js
c94d0cfff8bc96f7f5c36b94801ab135353c2410
diff --git a/indra/sources/indra_db_rest/query.py b/indra/sources/indra_db_rest/query.py index <HASH>..<HASH> 100644 --- a/indra/sources/indra_db_rest/query.py +++ b/indra/sources/indra_db_rest/query.py @@ -1,3 +1,8 @@ +__all__ = ['Query', 'And', 'Or', 'HasAgent', 'FromMeshIds', 'HasHash', + 'HasSources', 'HasOnlySource', 'HasReadings', 'HasDatabases', + 'HasType', 'HasNumAgents', 'HasNumEvidence', 'FromPapers', + 'EmptyQuery'] + from indra.sources.indra_db_rest.util import make_db_rest_request
Add __all__ to query file.
sorgerlab_indra
train
py
acb9d4b1df8a75da221982f86c34193a5470b6b8
diff --git a/jquery.maphilight.js b/jquery.maphilight.js index <HASH>..<HASH> 100755 --- a/jquery.maphilight.js +++ b/jquery.maphilight.js @@ -236,8 +236,7 @@ if(options.alwaysOn) { $(map).find('area[coords]').each(mouseover); } else { - $(map).find('area[coords]') - .trigger('alwaysOn.maphilight') + $(map).trigger('alwaysOn.maphilight').find('area[coords]') .bind('mouseover.maphilight', mouseover) .bind('mouseout.maphilight', function(e) { clear_canvas(canvas); }); }
Performance change alwaysOn event was firing for all areas, instead of just for the map
kemayo_maphilight
train
js
fa2aa9f54dc125e4d9a3546f99ec5bf3e1b50e4d
diff --git a/pandas/io/json/_normalize.py b/pandas/io/json/_normalize.py index <HASH>..<HASH> 100644 --- a/pandas/io/json/_normalize.py +++ b/pandas/io/json/_normalize.py @@ -159,11 +159,10 @@ def _json_normalize( Examples -------- - >>> from pandas.io.json import json_normalize >>> data = [{'id': 1, 'name': {'first': 'Coleen', 'last': 'Volk'}}, ... {'name': {'given': 'Mose', 'family': 'Regner'}}, ... {'id': 2, 'name': 'Faye Raker'}] - >>> json_normalize(data) + >>> pandas.json_normalize(data) id name name.family name.first name.given name.last 0 1.0 NaN NaN Coleen NaN Volk 1 NaN NaN Regner NaN Mose NaN
Update documentation to use recommended library (#<I>)
pandas-dev_pandas
train
py
79cbe0e8dd2e38dd755b8d4e32ae43fee22b81ba
diff --git a/application/init.php b/application/init.php index <HASH>..<HASH> 100755 --- a/application/init.php +++ b/application/init.php @@ -34,6 +34,7 @@ if ( set_include_path( realpath(APPLICATION_PATH.'/../library') + . PATH_SEPARATOR . realpath(GARP_APPLICATION_PATH.'/../library') . PATH_SEPARATOR . '.' ); @@ -44,6 +45,7 @@ if ( set_include_path( '.' . PATH_SEPARATOR . BASE_PATH . '/library' + . PATH_SEPARATOR . realpath(GARP_APPLICATION_PATH.'/../library') . PATH_SEPARATOR . get_include_path() ); @@ -60,7 +62,7 @@ if (!defined('GARP_VERSION')) { } -require 'Garp/Loader.php'; +require GARP_APPLICATION_PATH . '/../library/Garp/Loader.php'; /** * Set up class loading. @@ -72,6 +74,10 @@ $classLoader = Garp_Loader::getInstance(array( 'path' => realpath(APPLICATION_PATH.'/../library') ), array( + 'namespace' => 'Garp', + 'path' => realpath(GARP_APPLICATION_PATH.'/../library') + ), + array( 'namespace' => 'Model', 'path' => APPLICATION_PATH.'/modules/default/models/', 'ignore' => 'Model_'
Removed Garp from library. Save a symlink, save the world.
grrr-amsterdam_garp3
train
php
e74a9f9eea4fd2dee7fb2e65c95c713d11f4cdcc
diff --git a/activesupport/lib/active_support/testing/deprecation.rb b/activesupport/lib/active_support/testing/deprecation.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/testing/deprecation.rb +++ b/activesupport/lib/active_support/testing/deprecation.rb @@ -19,18 +19,17 @@ module ActiveSupport result end - private - def collect_deprecations - old_behavior = ActiveSupport::Deprecation.behavior - deprecations = [] - ActiveSupport::Deprecation.behavior = Proc.new do |message, callstack| - deprecations << message - end - result = yield - [result, deprecations] - ensure - ActiveSupport::Deprecation.behavior = old_behavior + def collect_deprecations + old_behavior = ActiveSupport::Deprecation.behavior + deprecations = [] + ActiveSupport::Deprecation.behavior = Proc.new do |message, callstack| + deprecations << message end + result = yield + [result, deprecations] + ensure + ActiveSupport::Deprecation.behavior = old_behavior + end end end end
make `collect_deprecations` available. There are circumstances where the capabilities of `assert_deprecated` and `assert_not_deprecated` are not enough. For example if a ccertain call-path raises two deprecations but should only raise a single one. This module is still :nodoc and intented for internal use. /cc @rafaelfranca
rails_rails
train
rb
e8d29748f0888c0659447d9a448fe4eee8d62428
diff --git a/classes/Pods.php b/classes/Pods.php index <HASH>..<HASH> 100644 --- a/classes/Pods.php +++ b/classes/Pods.php @@ -118,6 +118,16 @@ class Pods { public $datatype_id; + public $page_template; + + public $body_classes; + + public $meta; + + public $meta_properties; + + public $meta_extra; + /** * Constructor - Pods Framework core *
Added properties that will be used on the global $pods object
pods-framework_pods
train
php
bcba99e7d2b3937fdc28828e0f390aed1abae912
diff --git a/metrics.go b/metrics.go index <HASH>..<HASH> 100644 --- a/metrics.go +++ b/metrics.go @@ -242,7 +242,7 @@ func (m *metrics) getPayload() MetricsData { return metricsData } -func (m metrics) getClientData() ClientData { +func (m *metrics) getClientData() ClientData { return ClientData{ m.options.appName, m.options.instanceId, @@ -253,7 +253,7 @@ func (m metrics) getClientData() ClientData { } } -func (m metrics) getMetricsData() MetricsData { +func (m *metrics) getMetricsData() MetricsData { return MetricsData{ m.options.appName, m.options.instanceId,
metrics: use pointer receiver for all Because the metrics struct contains a lock, linting complains when passing by value.
Unleash_unleash-client-go
train
go
2ebac44fa71c146df3b79801d0141c33fba8b2f0
diff --git a/src/components/organisms/Footer.js b/src/components/organisms/Footer.js index <HASH>..<HASH> 100644 --- a/src/components/organisms/Footer.js +++ b/src/components/organisms/Footer.js @@ -1,7 +1,7 @@ import React from 'react' import FooterLinks from '../molecules/FooterLinks' import SocialLinks from '../molecules/SocialLinks' -import stateSeal from '../../../node_modules/@massds/mayflower/images/stateseal.png' +import stateSeal from '@massds/mayflower/images/stateseal.png' /** * Scaffolds out Mayflower footer pattern: @organisms/by-template/footer
Removing relative reference in import statement
massgov_mayflower
train
js
297efd04320ca55cbe5fc5a00ec0fbeb309c2cfb
diff --git a/zones/requests/fetch.js b/zones/requests/fetch.js index <HASH>..<HASH> 100644 --- a/zones/requests/fetch.js +++ b/zones/requests/fetch.js @@ -1,6 +1,7 @@ var assert = require("assert"); var https = require("https"); var nodeFetch = require("node-fetch"); +var PassThrough = require("stream").PassThrough; var resolveUrl = require("../../lib/util/resolve_url"); var TextDecoder = require("text-encoding").TextDecoder; var webStreams = require("node-web-streams"); @@ -35,7 +36,8 @@ module.exports = function(request){ // Convert the Node.js Readable stream to a WHATWG stream. response._readableBody = resp.body; - response.body = toWebReadableStream(resp.body); + var body = resp.body.pipe(new PassThrough()); + response.body = toWebReadableStream(body); response.json = resp.json.bind(resp); response.text = resp.text.bind(resp); return response;
Clone the Node readable stream 'body' Clonining the Node readable 'body' stream prevents it from being paused permanently when converted into a web readable. Fixes #<I>
donejs_done-ssr
train
js
eef5d89a92dd7dde9acf9fc063a54e1fe729a89b
diff --git a/test/validation-regression.rb b/test/validation-regression.rb index <HASH>..<HASH> 100644 --- a/test/validation-regression.rb +++ b/test/validation-regression.rb @@ -84,7 +84,7 @@ class ValidationRegressionTest < MiniTest::Test repeated_cv = RepeatedCrossValidation.create model repeated_cv.crossvalidations.each do |cv| assert cv.r_squared > 0.34, "R^2 (#{cv.r_squared}) should be larger than 0.034" - assert_operator cv.accuracy, :>, 0.7, "model accuracy < 0.7, this may happen by chance due to an unfavorable training/test set split" + assert cv.rmse < 0.5, "RMSE (#{cv.rmse}) should be smaller than 0.5" end end
fixed wrong accuracy assertion to rmse
opentox_lazar
train
rb
9bf301d63ded72f2a49c0b91682ea8c1c02e2171
diff --git a/src/HttpMasterWorker.js b/src/HttpMasterWorker.js index <HASH>..<HASH> 100644 --- a/src/HttpMasterWorker.js +++ b/src/HttpMasterWorker.js @@ -57,7 +57,7 @@ function loadKeysforConfigEntry(config, callback) { var SNImatchers = {}; if (config.ssl.SNI) { for (key in config.ssl.SNI) { - SNImatchers[key] = new RegExp(regexpQuote(key).replace(/^\\\*\\\./g, '^([^.]+\\.)?'), 'i'); // domain names are case insensitive + SNImatchers[key] = new RegExp('^' + regexpQuote(key).replace(/^\\\*\\\./g, '^([^.]+\\.)?') + '$', 'i'); // domain names are case insensitive } var sniCallback = function(hostname, cb) { hostname = punycode.toUnicode(hostname); @@ -318,9 +318,6 @@ function handleConfig(config, configHandled) { } self.logNotice('Start successful'); - // TODO - //dropPrivileges(); - self.servers = results.filter(function(server) { return !!server; });
Fix SNI hostname matching Where sub.domain1.com was available along with sub2.domain.com there was a possibility to give bad SNI certificate for sub2.domain.com
virtkick_http-master
train
js
ebecd11b2820fac5d921654c29a918c14147abe2
diff --git a/test/Psy/Test/CodeCleanerTest.php b/test/Psy/Test/CodeCleanerTest.php index <HASH>..<HASH> 100644 --- a/test/Psy/Test/CodeCleanerTest.php +++ b/test/Psy/Test/CodeCleanerTest.php @@ -61,7 +61,7 @@ class CodeCleanerTest extends \PHPUnit_Framework_TestCase public function unclosedStatementsProvider() { - return array( + $stmts = array( array(array('echo "'), true), array(array('echo \''), true), array(array('if (1) {'), true), @@ -73,10 +73,17 @@ class CodeCleanerTest extends \PHPUnit_Framework_TestCase array(array("\$content = <<<EOS\n"), true), array(array("\$content = <<<'EOS'\n"), true), - array(array('/* unclosed comment'), true), - array(array('/** unclosed comment'), true), - array(array('// closed comment'), false), + array(array('// closed comment'), false), ); + + // For some reason, HHVM doesn't consider unclosed comments an + // unexpected end of string? + if (!defined('HHVM_VERSION')) { + $stmts[] = array(array('/* unclosed comment'), true); + $stmts[] = array(array('/** unclosed comment'), true); + } + + return $stmts; } /**
Fix unclosed comment tests on HHVM.
bobthecow_psysh
train
php
3040676a3b7cf7abf051754c7ec073f07b744a80
diff --git a/upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go b/upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go index <HASH>..<HASH> 100644 --- a/upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go +++ b/upup/pkg/fi/cloudup/awstasks/autoscalinggroup.go @@ -176,6 +176,14 @@ func (_ *AutoscalingGroup) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *Autos request.MaxSize = e.MaxSize changes.MaxSize = nil } + if changes.Subnets != nil { + var subnetIDs []string + for _, s := range e.Subnets { + subnetIDs = append(subnetIDs, *s.ID) + } + request.VPCZoneIdentifier = aws.String(strings.Join(subnetIDs, ",")) + changes.Subnets = nil + } empty := &AutoscalingGroup{} if !reflect.DeepEqual(empty, changes) {
upup: enable subnet changes on ASG For kube-up upgrade
kubernetes_kops
train
go
f19a283ad5c145262f0bf0a9353522b27d4d5154
diff --git a/lib/polipus.rb b/lib/polipus.rb index <HASH>..<HASH> 100644 --- a/lib/polipus.rb +++ b/lib/polipus.rb @@ -361,8 +361,7 @@ module Polipus # It extracts URLs from the page def links_for page page.domain_aliases = domain_aliases - links = @focus_crawl_block.nil? ? page.links : @focus_crawl_block.call(page) - links + @focus_crawl_block.nil? ? page.links : @focus_crawl_block.call(page) end def page_expired? page
Assignment to local variable unnecessary in #links_for
taganaka_polipus
train
rb
78a8707eec4c5a6c90567d83080501388b75e1d8
diff --git a/lib/View/Controllers/Save.php b/lib/View/Controllers/Save.php index <HASH>..<HASH> 100644 --- a/lib/View/Controllers/Save.php +++ b/lib/View/Controllers/Save.php @@ -54,7 +54,11 @@ class Save implements ControllerInterface public function read(ServerRequestInterface $request) { - if (strpos($request->getHeader('content-type'), 'application/json') === false) { + $header = $request->getHeader('content-type'); + if (is_array($header)) { + $header = array_shift($header); + } + if (strpos($header, 'application/json') === false) { throw new InvalidRequestException('MCM save operation requires an application/json content type'); } $body = $request->getBody();
Fixed an issue when the header is provided as an array
magium_configuration-manager
train
php
b64867d88fde45af00bc97befa2e5e3c11bbbff0
diff --git a/raiden_mps/raiden_mps/webui/js/main.js b/raiden_mps/raiden_mps/webui/js/main.js index <HASH>..<HASH> 100644 --- a/raiden_mps/raiden_mps/webui/js/main.js +++ b/raiden_mps/raiden_mps/webui/js/main.js @@ -169,7 +169,11 @@ $.getJSON("js/parameters.json", (json) => { let cnt = 20; // wait up to 20*200ms for web3 and call ready() const pollingId = setInterval(() => { - if (cnt < 0 || window.web3) { + if (Cookies.get("RDN-Insufficient-Confirmations")) { + clearInterval(pollingId); + $("body").html('<h1>Waiting confirmations...</h1>'); + setTimeout(() => location.reload(), 5000); + } else if (cnt < 0 || window.web3) { clearInterval(pollingId); pageReady(json); } else {
Retry if RDN-Insufficient-Confirmations cookie is present
raiden-network_microraiden
train
js
0c59c7b3e824e60ad005c5b2301df50de1f28bd6
diff --git a/config/nightwatch.conf.js b/config/nightwatch.conf.js index <HASH>..<HASH> 100644 --- a/config/nightwatch.conf.js +++ b/config/nightwatch.conf.js @@ -2,12 +2,12 @@ const path = require('path') module.exports = { - src_folders: path.resolve('test/specs/'), - globals_path: path.resolve('test/globals.js'), - output_folder: path.resolve('test/reports'), + src_folders: path.resolve('tests/specs/'), + globals_path: path.resolve('tests/globals.js'), + output_folder: path.resolve('tests/reports'), custom_commands_path: [path.resolve('node_modules/nightwatch-accessibility/commands')], custom_assertions_path: [path.resolve('node_modules/nightwatch-accessibility/assertions')], - page_objects_path: path.resolve('test/page-objects'), + page_objects_path: path.resolve('tests/page-objects'), selenium: { start_process: false, },
fix(nighwatch): Update path to /tests in config file
telus_tds-core
train
js
d6cb76f693f3cb0d10626a275f516968fe6de817
diff --git a/refactor/adapters/mqtt/mqtt_test.go b/refactor/adapters/mqtt/mqtt_test.go index <HASH>..<HASH> 100644 --- a/refactor/adapters/mqtt/mqtt_test.go +++ b/refactor/adapters/mqtt/mqtt_test.go @@ -144,8 +144,8 @@ func TestMQTTSend(t *testing.T) { checkResponses(t, test.WantResponse, resp) // Clean - aclient.Disconnect(0) - sclient.Disconnect(0) + aclient.Disconnect(250) + sclient.Disconnect(250) <-time.After(time.Millisecond * 50) } }
[refactor] Add small delay for disconnecting mqtt client
TheThingsNetwork_ttn
train
go
cbaa39665684505d7c40209d3973b9d1406b8bf1
diff --git a/expandedsingles/services/ExpandedSinglesService.php b/expandedsingles/services/ExpandedSinglesService.php index <HASH>..<HASH> 100644 --- a/expandedsingles/services/ExpandedSinglesService.php +++ b/expandedsingles/services/ExpandedSinglesService.php @@ -33,6 +33,7 @@ class ExpandedSinglesService extends BaseApplicationComponent // Create list of Singles foreach ($singleSections as $single) { $criteria = craft()->elements->getCriteria(ElementType::Entry); + $criteria->locale = craft()->i18n->getPrimarySiteLocale()->id; $criteria->status = null; $criteria->sectionId = $single->id; $entry = $criteria->first();
Fix to work with multi-locales
verbb_expanded-singles
train
php
d0cdbcbc2c1f115637128a4335d39ad898e6965a
diff --git a/spec/lib/stretcher_search_results_spec.rb b/spec/lib/stretcher_search_results_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/stretcher_search_results_spec.rb +++ b/spec/lib/stretcher_search_results_spec.rb @@ -66,10 +66,12 @@ describe Stretcher::SearchResults do } it 'returns a plain hash for raw_plain' do + sleep 1 search_result.raw_plain.should be_instance_of(::Hash) end it 'returns a hashie mash for raw' do + sleep 1 search_result.raw.should be_instance_of(Hashie::Mash) end end
Try even more delays to help travis out
stretcher_stretcher
train
rb
5aa05e2483274058920cc40b6ee844e77e00fb63
diff --git a/simple-concat.js b/simple-concat.js index <HASH>..<HASH> 100644 --- a/simple-concat.js +++ b/simple-concat.js @@ -11,6 +11,8 @@ module.exports = CachingWriter.extend({ enforceSingleInputTree: true, init: function() { + this.description = 'SourcemapConcat'; + if (!this.separator) { this.separator = '\n'; }
Give `description`. Without this the slow tree printout simply labels this as `Class` (from the CoreObject constructor function).
ef4_broccoli-sourcemap-concat
train
js
5e4a1ac56d75f8b46ee068df9b6eebaa07fdca45
diff --git a/src/angularJwt/services/jwt.js b/src/angularJwt/services/jwt.js index <HASH>..<HASH> 100644 --- a/src/angularJwt/services/jwt.js +++ b/src/angularJwt/services/jwt.js @@ -1,5 +1,5 @@ angular.module('angular-jwt.jwt', []) - .service('jwtHelper', function() { + .service('jwtHelper', function($window) { this.urlBase64Decode = function(str) { var output = str.replace(/-/g, '+').replace(/_/g, '/'); @@ -11,7 +11,7 @@ throw 'Illegal base64url string!'; } } - return decodeURIComponent(escape(window.atob(output))); //polifyll https://github.com/davidchambers/Base64.js + return $window.decodeURIComponent(escape($window.atob(output))); //polyfill https://github.com/davidchambers/Base64.js } @@ -27,12 +27,11 @@ throw new Error('Cannot decode the token'); } - return JSON.parse(decoded); + return angular.fromJson.parse(decoded); } this.getTokenExpirationDate = function(token) { - var decoded; - decoded = this.decodeToken(token); + var decoded = this.decodeToken(token); if(typeof decoded.exp === "undefined") { return null;
Typo fix and cleanup Using $window so dependencies can be mocked for testing. Fixed a typo Using angular.fromJson for mocking purposes as well
auth0_angular-jwt
train
js
4325826de3555b6a1cceb52ba62d90a2ac755eb5
diff --git a/lib/wechat/message.rb b/lib/wechat/message.rb index <HASH>..<HASH> 100644 --- a/lib/wechat/message.rb +++ b/lib/wechat/message.rb @@ -69,8 +69,8 @@ module Wechat end end - def to(userid) - update(ToUserName: userid) + def to(openid_or_userid) + update(ToUserName: openid_or_userid) end def agent_id(agentid)
Still possible openid as 'to' is shared between public account and enterprise account.
Eric-Guo_wechat
train
rb
1dac3027cddf810b767020ae73aa4c3abfa857d9
diff --git a/src/Rocketeer/Services/Environment/Modules/ApplicationPathfinder.php b/src/Rocketeer/Services/Environment/Modules/ApplicationPathfinder.php index <HASH>..<HASH> 100644 --- a/src/Rocketeer/Services/Environment/Modules/ApplicationPathfinder.php +++ b/src/Rocketeer/Services/Environment/Modules/ApplicationPathfinder.php @@ -47,7 +47,7 @@ class ApplicationPathfinder extends AbstractPathfinderModule */ public function getConfigurationPath() { - return $this->getRocketeerPath().DS.'config'; + return $this->modulable->unifyLocalSlashes($this->getRocketeerPath().'/config'); } /** @@ -55,7 +55,7 @@ class ApplicationPathfinder extends AbstractPathfinderModule */ public function getLogsPath() { - return $this->getRocketeerPath().DS.'logs'; + return $this->modulable->unifyLocalSlashes($this->getRocketeerPath().'/logs'); } /** @@ -67,7 +67,7 @@ class ApplicationPathfinder extends AbstractPathfinderModule { $namespace = ucfirst($this->config->get('application_name')); - return $this->getRocketeerPath().DS.$namespace; + return $this->modulable->unifyLocalSlashes($this->getRocketeerPath().'/'.$namespace); } /**
Ensure slashes are unified in paths
rocketeers_rocketeer
train
php
56279dec119b019a6cf90e0f7ad92ca72a9f0694
diff --git a/optimizely/project_config.py b/optimizely/project_config.py index <HASH>..<HASH> 100644 --- a/optimizely/project_config.py +++ b/optimizely/project_config.py @@ -116,11 +116,11 @@ class ProjectConfig(object): self.forced_variation_map = {} @staticmethod - def _generate_key_map(list, key, entity_class): + def _generate_key_map(entity_list, key, entity_class): """ Helper method to generate map from key to entity object for given list of dicts. Args: - list: List consisting of dict. + entity_list: List consisting of dict. key: Key in each dict which will be key in the map. entity_class: Class representing the entity. @@ -129,7 +129,7 @@ class ProjectConfig(object): """ key_map = {} - for obj in list: + for obj in entity_list: key_map[obj[key]] = entity_class(**obj) return key_map
Move away from using built-in name (#<I>)
optimizely_python-sdk
train
py