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
797d028a2abc085761ac47c1532eb7bffcc3c159
diff --git a/lib/rvc/modules/vm.rb b/lib/rvc/modules/vm.rb index <HASH>..<HASH> 100644 --- a/lib/rvc/modules/vm.rb +++ b/lib/rvc/modules/vm.rb @@ -88,9 +88,10 @@ def wait_for_shutdown vms, opts end end return if all_off - sleep [opts[:delay], finish_time - Time.now].min + sleep_time = [opts[:delay], finish_time - Time.now].min + sleep sleep_time if sleep_time > 0 end - puts "WARNING: At least one VM did not shut down!" + err "At least one VM did not shut down!" end
Fixed issue with potential negative sleep value on timeout
vmware_rvc
train
rb
fe2314a08e158937efce130afee2b0259b4e521e
diff --git a/core/Email.php b/core/Email.php index <HASH>..<HASH> 100755 --- a/core/Email.php +++ b/core/Email.php @@ -808,7 +808,7 @@ class Email_BounceHandler extends Controller { if(!$duplicateBounce) { $record = new Email_BounceRecord(); - $member = DataObject::get_one( 'Member', "`Email`='$email'" ); + $member = DataObject::get_one( 'Member', "`Email`='$SQL_email'" ); if( $member ) $record->MemberID = $member->ID;
Add SQL_ prefix in place it was missing. (merge from gsoc branch, r<I>) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@<I> <I>b<I>ca-7a2a-<I>-9d3b-<I>d<I>a<I>a9
silverstripe_silverstripe-framework
train
php
7093b0ce391c7368b322c60439e4407a40f84a91
diff --git a/website/siteConfig.js b/website/siteConfig.js index <HASH>..<HASH> 100644 --- a/website/siteConfig.js +++ b/website/siteConfig.js @@ -87,8 +87,8 @@ const users = [ }, { caption: 'Notable', - image: 'https://raw.githubusercontent.com/notable/notable/master/resources/icon/icon.png', - infoLink: 'https://github.com/notable/notable', + image: 'https://notable.md/static/images/logo_app.png', + infoLink: 'https://notable.md', }, { caption: 'Observable',
Notable: update (#<I>) * Added “Notable” to the list of users * Added missing trailing comma * alphabetize the new entry * Notable: updated icon and website url
KaTeX_KaTeX
train
js
ccd248eb82acd4f7037ffca4238eae603994eb62
diff --git a/kitnirc/client.py b/kitnirc/client.py index <HASH>..<HASH> 100644 --- a/kitnirc/client.py +++ b/kitnirc/client.py @@ -338,7 +338,7 @@ class Client(object): if isinstance(incoming, User): self.msg(user, message) else: - self.msg(incoming, "%s: %s" % (user, message)) + self.msg(incoming, "%s: %s" % (user.nick, message)) def notice(self, target, message): """Send a NOTICE to a user or channel."""
Use a user's nick when hilighting, not the hostmask
ayust_kitnirc
train
py
e2c279ba936591587a1321d7c702b9b25365236f
diff --git a/servers/servertcp.js b/servers/servertcp.js index <HASH>..<HASH> 100644 --- a/servers/servertcp.js +++ b/servers/servertcp.js @@ -322,7 +322,7 @@ function _handleReadMultipleRegisters(requestBuffer, vector, unitID, callback) { if(vector.getMultipleHoldingRegisters.length===4){ vector.getMultipleHoldingRegisters(address,length,unitID,function(err,values){ - if(values.length!=length){ + if(!err && values.length!=length){ var error=new Error("Requested address length and response length do not match"); callback(error); throw error; @@ -436,7 +436,7 @@ function _handleReadInputRegisters(requestBuffer, vector, unitID, callback) { if(vector.getMultipleInputRegisters.length===4){ vector.getMultipleInputRegisters(address,length,unitID,function(err,values){ - if(values.length!=length){ + if(!err && values.length!=length){ var error=new Error("Requested address length and response length do not match"); callback(error); throw error;
length of register values is not compared with requested resisters if error is sent in callback
yaacov_node-modbus-serial
train
js
64ef69f5f2c00bad3964f8324f3b5323f674ca42
diff --git a/library/SimplePie/Cache/MySQL.php b/library/SimplePie/Cache/MySQL.php index <HASH>..<HASH> 100644 --- a/library/SimplePie/Cache/MySQL.php +++ b/library/SimplePie/Cache/MySQL.php @@ -96,7 +96,22 @@ class SimplePie_Cache_MySQL extends SimplePie_Cache_DB 'prefix' => '', ), ); - $this->options = array_merge($this->options, SimplePie_Cache::parse_URL($location)); + $parsed = SimplePie_Cache::parse_URL($location); + + foreach( $parsed as $key => $value ) + { + if( is_array($value) ) + { + foreach( $value as $array_key => $array_value ) + { + $this->options[$key][$array_key] = $array_value; + } + } + else + { + $this->options[$key] = $value; + } + } // Path is prefixed with a "/" $this->options['dbname'] = substr($this->options['path'], 1);
Fixed URI Parse Merge with Options in MySQL Class (currently inside constructor)
simplepie_simplepie
train
php
4926614fc1201bee08d6b0d973431472ba32e86b
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -22,6 +22,12 @@ test('kind-error:', function () { test.throws(fixture, /Call KindError.*/) done() }) + test('should composed error object be instanceof Error', function (done) { + var err = new KindError() + + test.equal(err instanceof Error, true) + done() + }) test('should have proper name and dont have stack by default', function (done) { var err = new KindError()
test: composed error is instanceof Error
tunnckoCore_kind-error
train
js
02c2ca3375fa8a7f848d139aa7f3d28593d84615
diff --git a/argresolver/resolver.py b/argresolver/resolver.py index <HASH>..<HASH> 100644 --- a/argresolver/resolver.py +++ b/argresolver/resolver.py @@ -254,7 +254,8 @@ class EnvironmentResolver(Resolver): if prefix is not None: lookup = prefix.upper() + '_' + lookup newval = os.environ.get(lookup, Missing) - if newval is Missing: - self.logger.info("Cannot resolve argument '{}' of {}. Try to set environment variable '{}'".format( + hasdefault = defaults.get(name, Missing) is not Missing + if newval is Missing and not hasdefault: + self.logger.warn("Cannot resolve argument '{}' of {}. Try to set environment variable '{}'".format( name, cls, lookup)) return newval
Supresses logging warning when default is present
HazardDede_argresolver
train
py
301166b8d61d39f29a614bb56a22c02a9f76a1c0
diff --git a/avatar/util.py b/avatar/util.py index <HASH>..<HASH> 100644 --- a/avatar/util.py +++ b/avatar/util.py @@ -8,8 +8,8 @@ def get_default_avatar_url(): base_url = getattr(settings, 'STATIC_URL', None) if not base_url: base_url = getattr(settings, 'MEDIA_URL', '') - # Don't use base_url if the default avatar url starts with http:// - if AVATAR_DEFAULT_URL.startswith('http://'): + # Don't use base_url if the default avatar url starts with http:// of https:// + if AVATAR_DEFAULT_URL.startswith('http://') or AVATAR_DEFAULT_URL.startswith('https://'): return AVATAR_DEFAULT_URL # We'll be nice and make sure there are no duplicated forward slashes ends = base_url.endswith('/')
The default avatar URL could also start with https.
GeoNode_geonode-avatar
train
py
979b5517ab81a992241dd947187a9b84fb6ffb54
diff --git a/lib/gakubuchi/template.rb b/lib/gakubuchi/template.rb index <HASH>..<HASH> 100644 --- a/lib/gakubuchi/template.rb +++ b/lib/gakubuchi/template.rb @@ -68,7 +68,8 @@ module Gakubuchi def extract_extname(path) extname = path.extname - extname.empty? ? extname : "#{extract_extname(path.basename(extname))}#{extname}" + extname.empty? || extname == ".html" ? + extname : "#{extract_extname(path.basename(extname))}#{extname}" end end end
Fix unexpected extname of localized templates
yasaichi_gakubuchi
train
rb
f54f375d66193a027d999f976f2126a922c4b7a9
diff --git a/pkg/clustermesh/config_test.go b/pkg/clustermesh/config_test.go index <HASH>..<HASH> 100644 --- a/pkg/clustermesh/config_test.go +++ b/pkg/clustermesh/config_test.go @@ -55,6 +55,9 @@ func expectNotExist(c *C, cm *ClusterMesh, name string) { func (s *ClusterMeshTestSuite) TestWatchConfigDirectory(c *C) { skipKvstoreConnection = true + defer func() { + skipKvstoreConnection = false + }() dir, err := ioutil.TempDir("", "multicluster") c.Assert(err, IsNil)
clustermesh: Undo skipKvstoreConnection in unit test Failure to undo the global variable can lead to follow-up unit tests failing that require kvstore interactions. Fixes: <I>b<I>b<I>d ("Inter cluster connectivity (ClusterMesh)")
cilium_cilium
train
go
d26d3bdf55981d30735a2daf0d90cac2ab11bad7
diff --git a/spec/dummy/app/assets/javascripts/remote_posts.js b/spec/dummy/app/assets/javascripts/remote_posts.js index <HASH>..<HASH> 100644 --- a/spec/dummy/app/assets/javascripts/remote_posts.js +++ b/spec/dummy/app/assets/javascripts/remote_posts.js @@ -2,13 +2,12 @@ $(function(){ var form = $('#new-remote-post'); if(form.length > 0) { + form.hide(); - Bootsy.areas[0].editor.on('load', function(){ - form.hide(); - }); + $('a[href="#new-remote-post"]').on('click', function(e){ + form.toggle(); - $('a[href="#new-remote-post"]').on('click', function(){ - form.show(); + e.preventDefault(); }); } });
Fix remote post form on the Dummy app.
volmer_bootsy
train
js
30452c9ad49933a1389fc9a41349d064a886fbf0
diff --git a/lib/generators/decorator/templates/decorator.rb b/lib/generators/decorator/templates/decorator.rb index <HASH>..<HASH> 100644 --- a/lib/generators/decorator/templates/decorator.rb +++ b/lib/generators/decorator/templates/decorator.rb @@ -27,7 +27,7 @@ class <%= class_name %>Decorator < <%= parent_class_name %> # generated by ActiveRecord: # # def created_at - # h.content_tag :span, time.strftime("%a %m/%d/%y"), + # h.content_tag :span, attributes["created_at"].strftime("%a %m/%d/%y"), # :class => 'timestamp' # end end
update comment in generator. You'd get an infinite loop with the current one
drapergem_draper
train
rb
013c700264c12c98a18130aa6f60a875869a61f5
diff --git a/test/wiredup_test.js b/test/wiredup_test.js index <HASH>..<HASH> 100644 --- a/test/wiredup_test.js +++ b/test/wiredup_test.js @@ -261,6 +261,7 @@ exports.wiredep = { test.equal(typeof returnedObject.css, 'object'); test.equal(typeof returnedObject.less, 'object'); test.equal(typeof returnedObject.scss, 'object'); + test.equal(typeof returnedObject.packages, 'object'); test.done(); }
Added test for commit bf<I>d<I>f<I>decdb2c<I>d<I>.
taptapship_wiredep
train
js
f9ecdff04493383ede86550624d30d5a21fcb04a
diff --git a/public/js/editors/panel.js b/public/js/editors/panel.js index <HASH>..<HASH> 100644 --- a/public/js/editors/panel.js +++ b/public/js/editors/panel.js @@ -1,7 +1,8 @@ /*globals $, CodeMirror, jsbin, jshintEnabled, RSVP */ var $document = $(document), - $source = $('#source'); + $source = $('#source'), + userResizeable = !$('html').hasClass('layout'); var editorModes = { html: 'htmlmixed', @@ -266,7 +267,7 @@ Panel.prototype = { // update the splitter - but do it on the next tick // required to allow the splitter to see it's visible first setTimeout(function () { - if (panel.splitter.length) { + if (userResizeable) { if (x !== undefined) { panel.splitter.trigger('init', x); } else { @@ -486,8 +487,8 @@ Panel.prototype = { $source[0].style.paddingLeft = '1px'; setTimeout(function () { $source[0].style.paddingLeft = '0'; - }, 0) - }, 0) + }, 0); + }, 0); } });
Fixed switching back to resizable The issue was that there's no splitter on the HTML panel, so it was skipping some key code.
jsbin_jsbin
train
js
343d73b1687aa46c44715e5b03f30992e282f5e3
diff --git a/addon/validated-buffer.js b/addon/validated-buffer.js index <HASH>..<HASH> 100644 --- a/addon/validated-buffer.js +++ b/addon/validated-buffer.js @@ -1,11 +1,7 @@ import EmberValidations from 'ember-validations'; import BufferedProxy from 'ember-buffered-proxy/proxy'; -export default function validatedBuffer(object, classBody, container) { - if (container) { - object.set('container', container); - } - +export default function validatedBuffer(object, classBody) { var Buffer = BufferedProxy.extend(EmberValidations.Mixin, classBody); return Buffer.create({
require the object to have a container property
simplabs_ember-validated-form-buffer
train
js
587254040530ec0dd55cffb8b0f3b0e38ec1d505
diff --git a/core/src/main/java/pl/project13/core/log/MessageFormatter.java b/core/src/main/java/pl/project13/core/log/MessageFormatter.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/pl/project13/core/log/MessageFormatter.java +++ b/core/src/main/java/pl/project13/core/log/MessageFormatter.java @@ -261,19 +261,11 @@ public final class MessageFormatter { return false; } char potentialEscape = messagePattern.charAt(delimeterStartIndex - 1); - if (potentialEscape == ESCAPE_CHAR) { - return true; - } else { - return false; - } + return (potentialEscape == ESCAPE_CHAR); } static boolean isDoubleEscaped(String messagePattern, int delimeterStartIndex) { - if (delimeterStartIndex >= 2 && messagePattern.charAt(delimeterStartIndex - 2) == ESCAPE_CHAR) { - return true; - } else { - return false; - } + return (delimeterStartIndex >= 2 && messagePattern.charAt(delimeterStartIndex - 2) == ESCAPE_CHAR); } // special treatment of array values was suggested by 'lizongbo'
Return of boolean expression should not be wrapped into an if-the-else statement
git-commit-id_maven-git-commit-id-plugin
train
java
dfe3f045d669fab8a16e474590cf671bb025ece7
diff --git a/lib/sidekiq_unique_jobs/version.rb b/lib/sidekiq_unique_jobs/version.rb index <HASH>..<HASH> 100644 --- a/lib/sidekiq_unique_jobs/version.rb +++ b/lib/sidekiq_unique_jobs/version.rb @@ -3,5 +3,5 @@ module SidekiqUniqueJobs # # @return [String] the current SidekiqUniqueJobs version - VERSION = "7.1.21" + VERSION = "7.1.22" end
Bump sidekiq-unique-jobs to <I>
mhenrixon_sidekiq-unique-jobs
train
rb
dd746bd23255d97185f199bb185c4952a7604562
diff --git a/lib/dnsimple/client/certificates.rb b/lib/dnsimple/client/certificates.rb index <HASH>..<HASH> 100644 --- a/lib/dnsimple/client/certificates.rb +++ b/lib/dnsimple/client/certificates.rb @@ -2,19 +2,19 @@ module Dnsimple class Client module Certificates - # Lists the certificates in the account. + # Lists the certificates associated to the domain. # - # @see https://developer.dnsimple.com/v2/certificates/#list + # @see https://developer.dnsimple.com/v2/domains/certificates/#list # @see #all_certificates # # @example List certificates in the first page - # client.certificates.list(1010) + # client.certificates.list(1010, "example.com") # # @example List certificates, provide a specific page - # client.certificates.list(1010, page: 2) + # client.certificates.list(1010, "example.com", page: 2) # # @example List certificates, provide a sorting policy - # client.certificates.list(1010, sort: "email:asc") + # client.certificates.list(1010, "example.com", sort: "email:asc") # # @param [Fixnum] account_id the account ID # @param [#to_s] domain_name the domain name
Correct documentation link and include domain name in params. Closes GH-<I>.
dnsimple_dnsimple-ruby
train
rb
6923bb9e9c90c29fe561a27d17246e4070cc3113
diff --git a/src/js/core/core.js b/src/js/core/core.js index <HASH>..<HASH> 100644 --- a/src/js/core/core.js +++ b/src/js/core/core.js @@ -85,6 +85,8 @@ var modules = {}; + var isBrowser = (typeof window != UNDEFINED && typeof document != UNDEFINED); + var util = { isHostMethod: isHostMethod, isHostObject: isHostObject, @@ -99,6 +101,7 @@ var api = { version: "%%build:version%%", initialized: false, + isBrowser: isBrowser, supported: true, util: util, features: {}, @@ -118,7 +121,7 @@ } function alertOrLog(msg, shouldAlert) { - if (shouldAlert) { + if (isBrowser && shouldAlert) { window.alert(msg); } else { consoleLog(msg); @@ -174,7 +177,7 @@ } // Test whether we're in a browser and bail out if not - if (typeof window == UNDEFINED || typeof document == UNDEFINED) { + if (!isBrowser) { fail("Rangy can only run in a browser"); return; }
Another fix for running outside a browser
timdown_rangy
train
js
7cb5c0bba405635fdb6a88a107472410b7d9ba46
diff --git a/tests/test_cookiecutter_generation.py b/tests/test_cookiecutter_generation.py index <HASH>..<HASH> 100644 --- a/tests/test_cookiecutter_generation.py +++ b/tests/test_cookiecutter_generation.py @@ -15,7 +15,7 @@ RE_OBJ = re.compile(PATTERN) def context(): return { 'project_name': 'My Test Project', - 'repo_name': 'my_test_project', + 'project_slug': 'my_test_project', 'author_name': 'Test Author', 'email': 'test@example.com', 'description': 'A short description of the project.',
Update test fixture to use project_slug, not repo_name
pydanny_cookiecutter-django
train
py
4af0f0262ec119fd2a6049b236bba97314b2976e
diff --git a/lib/jekyll/renderer.rb b/lib/jekyll/renderer.rb index <HASH>..<HASH> 100644 --- a/lib/jekyll/renderer.rb +++ b/lib/jekyll/renderer.rb @@ -5,11 +5,10 @@ module Jekyll attr_reader :document, :site attr_writer :layouts, :payload - def initialize(site, document, site_payload = nil, layouts: nil) + def initialize(site, document, site_payload = nil) @site = site @document = document @payload = site_payload - @layouts = layouts end # Fetches the payload used in Liquid rendering.
Remove layouts named param from Renderer#initialize
jekyll_jekyll
train
rb
275b26a4dfa0907adfeea8d159299624aa80eaab
diff --git a/lib/core/manager.rb b/lib/core/manager.rb index <HASH>..<HASH> 100644 --- a/lib/core/manager.rb +++ b/lib/core/manager.rb @@ -303,7 +303,11 @@ class Manager existing_instance = get(type, name) if existing_instance - existing_instance.import(config.export) + config.export.each do |property_name, value| + unless [ :meta ].include?(property_name) + existing_instance[property_name] = value + end + end existing_instance.normalize(true) logger.info("Using existing instance of #{type}, #{name}")
Fixing the reload mechanism in the plugin manager.
coralnexus_nucleon
train
rb
6a4641c773ffed9d47c34f36ac8d789ad9772e53
diff --git a/tests/dummy/config/deprecation-workflow.js b/tests/dummy/config/deprecation-workflow.js index <HASH>..<HASH> 100644 --- a/tests/dummy/config/deprecation-workflow.js +++ b/tests/dummy/config/deprecation-workflow.js @@ -5,5 +5,7 @@ window.deprecationWorkflow.config = { workflow: [ { handler: "silence", matchId: "ember-cli-page-object.old-collection-api"}, { handler: "silence", matchId: "ember-component.send-action"}, + { handler: "silence", matchId: "events.inherited-function-listeners"}, + { handler: "silence", matchId: "ember-polyfills.deprecate-merge"}, ] };
Ignore some new deprecations
ilios_common
train
js
2e9da0e6f2db464e811b35bfe6f5f1aa9cec513e
diff --git a/pygerrit/client.py b/pygerrit/client.py index <HASH>..<HASH> 100644 --- a/pygerrit/client.py +++ b/pygerrit/client.py @@ -76,10 +76,9 @@ class GerritClient(object): data = decoder.decode(line) except ValueError, err: raise GerritError("Query returned invalid data: %s", err) - if "type" in data: - if data["type"] == "error": - raise GerritError("Query error: %s" % data["message"]) - else: + if "type" in data and data["type"] == "error": + raise GerritError("Query error: %s" % data["message"]) + elif "project" in data: results.append(Change(data)) return results
Only add query result lines to returned data Only add JSON lines in the results if they contain "project". Otherwise the "rowCount" line, and anything else, will be included in the results as an empty Change object. Change-Id: Ia4de4ed<I>c8f5ba<I>f5e<I>dd<I>ff<I>b<I>b<I>
dpursehouse_pygerrit2
train
py
7defafd3b101511a31846ec4ab181f5f4e7c9826
diff --git a/use_generic_stat.go b/use_generic_stat.go index <HASH>..<HASH> 100644 --- a/use_generic_stat.go +++ b/use_generic_stat.go @@ -3,3 +3,8 @@ package times const hasPlatformSpecificStat = false + +// do not use, only here to prevent "undefined" method error. +func platformSpecficStat(name string) (Timespec, error) { + return nil, nil +}
fixed undefined platformSpecificStat for non-windows builds
djherbis_times
train
go
0b7a9155f880dd3a07e1668602432703446d5ac0
diff --git a/devices.js b/devices.js index <HASH>..<HASH> 100755 --- a/devices.js +++ b/devices.js @@ -10151,7 +10151,7 @@ const devices = [ exposes: [e.lock(), e.battery()], }, { - zigbeeModel: ['YRD256 TSDB'], + zigbeeModel: ['YRD256 TSDB', 'YRD256L TSDB'], model: 'YRD256HA20BP', vendor: 'Yale', description: 'Assure lock SL',
Adds variant of yale<I> lock (YRD<I>HA<I>BP) (#<I>)
Koenkk_zigbee-shepherd-converters
train
js
df519397e8a57273ce76b8c06cd6e2aa7e84d23d
diff --git a/pkg/bpfdebug/drop.go b/pkg/bpfdebug/drop.go index <HASH>..<HASH> 100644 --- a/pkg/bpfdebug/drop.go +++ b/pkg/bpfdebug/drop.go @@ -81,7 +81,7 @@ func dropReason(reason uint8) string { return fmt.Sprintf("%d", reason) } -// DumpInfo https://techcrunch.com/2017/07/12/soundshroud/ +// DumpInfo prints a summary of the drop messages. func (n *DropNotify) DumpInfo(data []byte) { fmt.Printf("xx drop (%s) to endpoint %d, identity %d->%d: %s\n", dropReason(n.SubType), n.DstID, n.SrcLabel, n.DstLabel,
pkg/bpfdebug: fix errant c/p in DumpInfo func desc Replace typo with comment that describes what DumpInfo function does.
cilium_cilium
train
go
b210404e032f5b7172c1cc985cf44da8919c7b34
diff --git a/addon/controllers/detail-edit-form.js b/addon/controllers/detail-edit-form.js index <HASH>..<HASH> 100644 --- a/addon/controllers/detail-edit-form.js +++ b/addon/controllers/detail-edit-form.js @@ -198,7 +198,11 @@ export default EditFormController.extend({ flexberryDetailInteractionService.set('modelCurrentNotSaved', modelCurrentAgregator); } - this.transitionToRoute(modelAgregatorRoute); + if (modelAgregatorRoute.indexOf('.new') > 0 && modelCurrentAgregator.get('id')) { + modelAgregatorRoute = modelAgregatorRoute.slice(0, -4); + } + + this.transitionToRoute(modelAgregatorRoute, modelCurrentAgregator); } else { this._super.apply(this, arguments); }
Fix detail-edit-form controller transition to edit form
Flexberry_ember-flexberry
train
js
bd73aeecb2a2b5534ca334798e4831c13b6ee940
diff --git a/satpy/modifiers/angles.py b/satpy/modifiers/angles.py index <HASH>..<HASH> 100644 --- a/satpy/modifiers/angles.py +++ b/satpy/modifiers/angles.py @@ -251,9 +251,8 @@ def get_angles(data_arr: xr.DataArray) -> tuple[xr.DataArray, xr.DataArray, xr.D Args: data_arr: DataArray to get angles for. Information extracted from this object are ``.attrs["area"]``,``.attrs["start_time"]``, and - ``.attrs["orbital_parameters"]`` or the available - ``.attrs["satellite_longitude"]``, ``.attrs["satellite_latitude"]``, - and ``.attrs["satellite_altitude"]``. + ``.attrs["orbital_parameters"]``. See :func:`satpy.utils.get_satpos` + and :ref:`dataset_metadata` for more information. Additionally, the dask array chunk size is used when generating new arrays. The actual data of the object is not used.
Remove satellite_<lat/lon/alt> doc since deprecated
pytroll_satpy
train
py
63201cd275e9683e0902b6c46a52090eaa3275f7
diff --git a/shared/actions/provision.js b/shared/actions/provision.js index <HASH>..<HASH> 100644 --- a/shared/actions/provision.js +++ b/shared/actions/provision.js @@ -365,16 +365,23 @@ class ProvisioningManager { } this._stashedResponse = null this._stashedResponseKey = null - // clear errors and nav to root always - return Saga.sequentially([ - Saga.put(ProvisionGen.createProvisionError({error: new HiddenString('')})), - Saga.put( - RouteTreeGen.createNavigateTo({ - parentPath: [], - path: doingDeviceAdd ? devicesRoot : [Tabs.loginTab], - }) - ), - ]) + + // clear errors always, and nav to root if we actually canceled something + return Saga.sequentially( + [ + Saga.put(ProvisionGen.createProvisionError({error: new HiddenString('')})), + ...(response + ? [ + Saga.put( + RouteTreeGen.createNavigateTo({ + parentPath: [], + path: doingDeviceAdd ? devicesRoot : [Tabs.loginTab], + }) + ), + ] + : []), + ].filter(Boolean) + ) } } }
dont nav if we didn't actually cancel anything (#<I>)
keybase_client
train
js
cae4c83f4e08b3cb77b601ab2f75dda8dfe36cef
diff --git a/sparklingpandas/__init__.py b/sparklingpandas/__init__.py index <HASH>..<HASH> 100644 --- a/sparklingpandas/__init__.py +++ b/sparklingpandas/__init__.py @@ -56,7 +56,7 @@ if 'IS_TEST' not in os.environ and "JARS" not in os.environ: try: jar = filter(lambda path: os.path.exists(path), jars)[0] except IndexError: - raise IOError("Failed to find jars " + str(jar)) + raise IOError("Failed to find jars.") os.environ["JARS"] = jar os.environ["PYSPARK_SUBMIT_ARGS"] = ("--jars %s --driver-class-path %s" + " pyspark-shell") % (jar, jar)
Fix error message to not rely on the variable we failed to define.
sparklingpandas_sparklingpandas
train
py
0a9f271658a7c3a60986469b52a6bab1d92f985b
diff --git a/capture/genBitmaps.js b/capture/genBitmaps.js index <HASH>..<HASH> 100644 --- a/capture/genBitmaps.js +++ b/capture/genBitmaps.js @@ -123,6 +123,10 @@ function processScenario (casper, scenario, scenarioOrVariantLabel, scenarioLabe casper.each(viewports, function (casper, vp, viewportIndex) { this.then(function () { + var onBeforeScript = scenario.onBeforeScript || config.onBeforeScript; + if (onBeforeScript) { + require(getScriptPath(onBeforeScript))(casper, scenario, vp, isReference); + } this.viewport(vp.width || vp.viewport.width, vp.height || vp.viewport.height); }); @@ -131,11 +135,6 @@ function processScenario (casper, scenario, scenarioOrVariantLabel, scenarioLabe url = scenario.referenceUrl; } - var onBeforeScript = scenario.onBeforeScript || config.onBeforeScript; - if (onBeforeScript) { - require(getScriptPath(onBeforeScript))(casper, scenario, vp, isReference); - } - this.thenOpen(url, function () { casper.waitFor( function () { // test
Add cookies to bitmaps after each scenario has run (#<I>) This is awesome -- thanks Shane!!!
garris_BackstopJS
train
js
afeebd15512f58726a7709aeb364e46651ab35e8
diff --git a/pwkit/environments/casa/spwglue.py b/pwkit/environments/casa/spwglue.py index <HASH>..<HASH> 100644 --- a/pwkit/environments/casa/spwglue.py +++ b/pwkit/environments/casa/spwglue.py @@ -183,7 +183,7 @@ class Config (ParseKeywords): # empty - column should be empty (ndim = -1) _spw_match_cols = frozenset ('MEAS_FREQ_REF FLAG_ROW FREQ_GROUP FREQ_GROUP_NAME ' 'IF_CONV_CHAIN NET_SIDEBAND BBC_NO'.split ()) -_spw_first_cols = frozenset ('REF_FREQUENCY NAME'.split ()) +_spw_first_cols = frozenset ('DOPPLER_ID REF_FREQUENCY NAME'.split ()) _spw_scsum_cols = frozenset ('NUM_CHAN TOTAL_BANDWIDTH'.split ()) _spw_concat_cols = frozenset ('CHAN_FREQ CHAN_WIDTH EFFECTIVE_BW RESOLUTION'.split ()) _spw_empty_cols = frozenset ('ASSOC_SPW_ID ASSOC_NATURE'.split ())
pwkit/environments/casa/spwglue.py: handle importvla datasets
pkgw_pwkit
train
py
f39e6fe61a0f30bcd05bb2100ef4541a24a423a7
diff --git a/nodeconductor/core/views.py b/nodeconductor/core/views.py index <HASH>..<HASH> 100644 --- a/nodeconductor/core/views.py +++ b/nodeconductor/core/views.py @@ -280,9 +280,9 @@ class ActionsViewSet(viewsets.ModelViewSet): # check if action is allowed if self.action in getattr(self, 'disabled_actions', []): raise exceptions.MethodNotAllowed(method=request.method) - self.validate_object_action(self.get_object(), self.action) + self.validate_object_action(self.action) - def validate_object_action(self, obj, action_name): + def validate_object_action(self, action_name, obj=None): """ Execute validation for actions that are related to particular object """ action_method = getattr(self, action_name) if not getattr(action_method, 'detail', False) and action_name not in ('update', 'partial_update', 'destroy'): @@ -291,7 +291,7 @@ class ActionsViewSet(viewsets.ModelViewSet): return validators = getattr(self, action_name + '_validators', []) for validator in validators: - validator(obj) + validator(obj or self.get_object()) class ReadOnlyActionsViewSet(ActionsViewSet):
Fix validate_object_action method call - wal-<I>
opennode_waldur-core
train
py
d8997a68ae7f6bdc52c44681b93e90bf5e8294ac
diff --git a/test-app/runtime/src/main/java/com/tns/Runtime.java b/test-app/runtime/src/main/java/com/tns/Runtime.java index <HASH>..<HASH> 100644 --- a/test-app/runtime/src/main/java/com/tns/Runtime.java +++ b/test-app/runtime/src/main/java/com/tns/Runtime.java @@ -284,7 +284,7 @@ public class Runtime { ex.printStackTrace(ps); try { - content = baos.toString("US-ASCII"); + content = baos.toString("UTF-8"); if (ex instanceof NativeScriptException) { content = getStackTraceOnly(content); content = ((NativeScriptException) ex).getIncomingStackTrace() + content;
Remove usage of ASCII encoding
NativeScript_android-runtime
train
java
dba2cbd0ee630dc95dffa71309b4ffc6060462b5
diff --git a/lib/middleman/version.rb b/lib/middleman/version.rb index <HASH>..<HASH> 100644 --- a/lib/middleman/version.rb +++ b/lib/middleman/version.rb @@ -4,7 +4,7 @@ require "rubygems" module Middleman # Current Version # @return [String] - VERSION = "3.0.0.alpha.4" + VERSION = "3.0.0.alpha.5" # Parsed version for RubyGems # @private
final <I> alpha, hopefully
middleman_middleman
train
rb
c4198b5e751383523bcc1f616a237354efd1b593
diff --git a/src/Response/Api/BaseResponse.php b/src/Response/Api/BaseResponse.php index <HASH>..<HASH> 100644 --- a/src/Response/Api/BaseResponse.php +++ b/src/Response/Api/BaseResponse.php @@ -10,6 +10,7 @@ namespace ZEROSPAM\Framework\SDK\Response\Api; use Carbon\Carbon; use ZEROSPAM\Framework\SDK\Response\Api\Helper\RateLimitedTrait; +use ZEROSPAM\Framework\SDK\Utils\Contracts\Arrayable; use ZEROSPAM\Framework\SDK\Utils\Str; /** @@ -20,7 +21,7 @@ use ZEROSPAM\Framework\SDK\Utils\Str; * * @package ZEROSPAM\Framework\SDK\Response\Api */ -abstract class BaseResponse implements IRateLimitedResponse +abstract class BaseResponse implements IRateLimitedResponse, Arrayable { use RateLimitedTrait; @@ -139,4 +140,14 @@ abstract class BaseResponse implements IRateLimitedResponse { return $this->get($name); } + + /** + * Return the object as Array. + * + * @return array + */ + public function toArray(): array + { + return $this->data; + } }
perf(Response): Makes response arrayable
zerospam_sdk-framework
train
php
49e5103920e75a149d02c7d487496c8c79154a6c
diff --git a/lib/go/thrift/framed_transport.go b/lib/go/thrift/framed_transport.go index <HASH>..<HASH> 100644 --- a/lib/go/thrift/framed_transport.go +++ b/lib/go/thrift/framed_transport.go @@ -141,11 +141,13 @@ func (p *TFramedTransport) Flush() error { binary.BigEndian.PutUint32(buf, uint32(size)) _, err := p.transport.Write(buf) if err != nil { + p.buf.Truncate(0) return NewTTransportExceptionFromError(err) } if size > 0 { if n, err := p.buf.WriteTo(p.transport); err != nil { print("Error while flushing write buffer of size ", size, " to transport, only wrote ", n, " bytes: ", err.Error(), "\n") + p.buf.Truncate(0) return NewTTransportExceptionFromError(err) } }
THRIFT-<I> Golang TFramedTransport's writeBuffer increases if writes to transport failed Client: Go
limingxinleo_thrift
train
go
8b4036feca85463fe8098b1f6c52af7b425ec13c
diff --git a/lib/devise/controllers/helpers.rb b/lib/devise/controllers/helpers.rb index <HASH>..<HASH> 100644 --- a/lib/devise/controllers/helpers.rb +++ b/lib/devise/controllers/helpers.rb @@ -97,15 +97,17 @@ module Devise end # Render a view for the specified scope. Turned off by default. - def render_with_scope(action) + # Accepts just :controller as option. + def render_with_scope(action, options={}) +  controller_name = options.delete(:controller) || self.controller_name if Devise.scoped_views begin render :template => "#{controller_name}/#{devise_mapping.as}/#{action}" rescue ActionView::MissingTemplate - render action + render action, :controller => controller_name end else - render action + render action, :controller => controller_name end end
Allow :controller to be given to render_with_scope.
plataformatec_devise
train
rb
465a60b3e722c668c8223f82a59ffd5ce269ab59
diff --git a/lib/lol/client.rb b/lib/lol/client.rb index <HASH>..<HASH> 100644 --- a/lib/lol/client.rb +++ b/lib/lol/client.rb @@ -53,6 +53,10 @@ module Lol @static_request ||= StaticRequest.new(api_key, region, cache_store) end + def lol_status + @lol_status ||= LolStatusRequest.new(region, cache_store) + end + # Initializes a Lol::Client # @param api_key [String] # @param options [Hash] diff --git a/spec/lol/client_spec.rb b/spec/lol/client_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lol/client_spec.rb +++ b/spec/lol/client_spec.rb @@ -155,6 +155,12 @@ describe Client do end end + describe '#lol_status' do + it 'return an instance of LolStatusRequest' do + expect(subject.lol_status).to be_a(LolStatusRequest) + end + end + describe "#api_key" do it "returns an api key" do expect(subject.api_key).to eq("foo")
Add lol_status_request to client
mikamai_ruby-lol
train
rb,rb
4ea149e502aab0871e156945015dd60d1810e33e
diff --git a/src/Commands/ShowCommand.php b/src/Commands/ShowCommand.php index <HASH>..<HASH> 100644 --- a/src/Commands/ShowCommand.php +++ b/src/Commands/ShowCommand.php @@ -103,13 +103,20 @@ class ShowCommand extends Command } } - // Now that we collected all values that matches the keyword argument - // in a close match, we collect the values for the rest of the - // languages for the found keys to complete the table view. + // Now that we collected all existing values, we are going to + // fill the missing ones with emptiness indicators to + // balance the table structure & alert developers. foreach ($output as $key => $values) { + $original = []; + foreach ($allLanguages as $languageKey) { - $output[$key][$languageKey] = $values[$languageKey] ?? '<bg=red> MISSING </>'; + $original[$languageKey] = $values[$languageKey] ?? '<bg=red> MISSING </>'; } + + // Sort the language values based on language name + ksort($original); + + $output[$key] = array_merge(['key' => $key], $original); } return array_values($output);
insure console table presents lines in correct order
themsaid_laravel-langman
train
php
48c64d48f2e788b2eaf9ae1c4e09b22c0a61cac7
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ classifiers = ['Development Status :: 3 - Alpha', 'Operating System :: OS Independent'] required = ['numpy>=1.7.1', 'scipy>=0.12.0', 'matplotlib>=1.2.1', - 'Theano>=0.6.1dev'] + 'Theano==0.6.0rc5'] if __name__ == "__main__": ## Current release of Theano does not support python 3, so need
Updated Theano dependency to <I>rc5.
pymc-devs_pymc
train
py
626d54a812e33d9fb43bd3caec8d1296733f6afc
diff --git a/lib/jekyll/converters/markdown.rb b/lib/jekyll/converters/markdown.rb index <HASH>..<HASH> 100644 --- a/lib/jekyll/converters/markdown.rb +++ b/lib/jekyll/converters/markdown.rb @@ -20,7 +20,7 @@ module Jekyll else $stderr.puts "Invalid Markdown processor: #{@config['markdown']}" $stderr.puts " Valid options are [ maruku | rdiscount | kramdown | redcarpet ]" - raise FatalException.new("Invalid Markdown process: #{@config['markdown']}") + raise FatalException, "Invalid Markdown process: #{@config['markdown']}" end @setup = true end
New is implied by `raise`, 2nd is the message.
jekyll_jekyll
train
rb
33a841de4c6f7de6347b17574dc16d2a87d844da
diff --git a/src/Html5FileUploadViewBridge.js b/src/Html5FileUploadViewBridge.js index <HASH>..<HASH> 100644 --- a/src/Html5FileUploadViewBridge.js +++ b/src/Html5FileUploadViewBridge.js @@ -1,8 +1,8 @@ window.rhubarb.vb.create("Html5FileUploadViewBridge", function(parent){ return { - onReady: function () { - parent.onReady.call(this); + attachEvents: function () { + parent.attachEvents.call(this); if (this.supportsHtml5Uploads()) { this.originalFileInput = this.viewNode.querySelector("input[type=file]");
Fix to support reRender of hosting parent
RhubarbPHP_Module.Leaf.Html5Upload
train
js
8c3fadf15ec183e5ce8c63739850d543617e4357
diff --git a/tests/integration/states/file.py b/tests/integration/states/file.py index <HASH>..<HASH> 100644 --- a/tests/integration/states/file.py +++ b/tests/integration/states/file.py @@ -413,7 +413,7 @@ class FileTest(integration.ModuleCase): fp.write(src) ret = self.run_state('file.patch', name=src_file, - source='salt://{}.patch'.format(patch_name), + source='salt://{0}.patch'.format(patch_name), hash='md5=f0ef7081e1539ac00ef5b761b4fb01b3', ) return src_file, ret @@ -427,7 +427,7 @@ class FileTest(integration.ModuleCase): def test_patch_hash_mismatch(self): src_file, ret = self.do_patch('hello_dolly') result = self.state_result(ret, raw=True) - msg = 'File {} hash mismatch after patch was applied'.format(src_file) + msg = 'File {0} hash mismatch after patch was applied'.format(src_file) self.assertEqual(result['comment'], msg) self.assertEqual(result['result'], False)
Fix python <I> compat issue in tests
saltstack_salt
train
py
1edd53f1167c889c604647861c455879afb37069
diff --git a/bcbio/pipeline/rnaseq.py b/bcbio/pipeline/rnaseq.py index <HASH>..<HASH> 100644 --- a/bcbio/pipeline/rnaseq.py +++ b/bcbio/pipeline/rnaseq.py @@ -49,9 +49,10 @@ def quantitate_expression_noparallel(samples, run_parallel): """ run transcript quantitation for algorithms that don't run in parallel """ + data = samples[0][0] samples = run_parallel("run_express", samples) samples = run_parallel("run_dexseq", samples) - if "sailfish" in dd.get_expression_caller(samples[0]): + if "sailfish" in dd.get_expression_caller(data): samples = run_parallel("run_sailfish", samples) return samples
Look up expression_caller in the dictionary properly.
bcbio_bcbio-nextgen
train
py
c3f74f3b525e7186916ce897ad41b22f56f434cd
diff --git a/lib/page/format-properties/format-properties.unit.spec.js b/lib/page/format-properties/format-properties.unit.spec.js index <HASH>..<HASH> 100644 --- a/lib/page/format-properties/format-properties.unit.spec.js +++ b/lib/page/format-properties/format-properties.unit.spec.js @@ -11,9 +11,6 @@ const formatProperties = proxyquire('./format-properties', { const userData = (input) => { return { - getUserData: () => input, - getUserParams: () => ({}), - getAllData: () => ({}), getScopedUserData: (params = {}) => { const param = Object.assign({ x: 'param_value'
Remove unnecessary methods from mocked userData object passed to formatProperties tests
ministryofjustice_fb-runner-node
train
js
e386a5b09fd14a1f125face981fa426803b8a96d
diff --git a/openquake/engine/engine.py b/openquake/engine/engine.py index <HASH>..<HASH> 100644 --- a/openquake/engine/engine.py +++ b/openquake/engine/engine.py @@ -146,6 +146,8 @@ def expose_outputs(dstore, owner=getpass.getuser(), status='complete'): if oq.conditional_loss_poes: # expose loss_maps outputs if 'loss_curves-stats' in dstore: dskeys.add('loss_maps-stats') + if len(dstore['csm_info/sg_data']) == 1: # do not export a single group + dskeys.remove('sourcegroups') if 'all_loss_ratios' in dskeys: dskeys.remove('all_loss_ratios') # export only specific IDs if 'ruptures' in dskeys and 'scenario' in calcmode:
Do not export sourcegroups if there is only one of them [skip hazardlib][demos] Former-commit-id: e<I>eeeb7fabd<I>c<I>bb<I>e<I>
gem_oq-engine
train
py
86ad5c67d247d976bf7c3b04e9fadcf33d8df4f3
diff --git a/tasks/ant_sfdc.js b/tasks/ant_sfdc.js index <HASH>..<HASH> 100644 --- a/tasks/ant_sfdc.js +++ b/tasks/ant_sfdc.js @@ -85,11 +85,10 @@ module.exports = function(grunt) { args.push(task); grunt.log.debug('ANT CMD: ant ' + args.join(' ')); grunt.log.writeln('Starting ANT ' + task + '...'); - grunt.util.spawn({ + var ant = grunt.util.spawn({ cmd: 'ant', args: args }, function(error, result, code) { - grunt.log.debug(String(result.stdout)); if(error) { grunt.log.error(error); } else { @@ -97,6 +96,12 @@ module.exports = function(grunt) { } done(error, result); }); + ant.stdout.on('data', function(data) { + grunt.log.write(data); + }); + ant.stderr.on('data', function(data) { + grunt.log.error(data); + }); } function buildPackageXml(pkg, version) {
Log ant output to grunt as it's generated Log ant's stdout and stderr output to grunt as it's generated. This allows long deploys to proceed on Travis CI, which kills builds with no output for <I> minutes.
kevinohara80_grunt-ant-sfdc
train
js
3af5bf882488dc13bc4466a7ca099fdd496dc3bb
diff --git a/faq-bundle/contao/dca/tl_faq_category.php b/faq-bundle/contao/dca/tl_faq_category.php index <HASH>..<HASH> 100644 --- a/faq-bundle/contao/dca/tl_faq_category.php +++ b/faq-bundle/contao/dca/tl_faq_category.php @@ -68,16 +68,14 @@ $GLOBALS['TL_DCA']['tl_faq_category'] = array ( 'label' => &$GLOBALS['TL_LANG']['tl_faq_category']['edit'], 'href' => 'table=tl_faq', - 'icon' => 'edit.gif', - 'attributes' => 'class="contextmenu"' + 'icon' => 'edit.gif' ), 'editheader' => array ( 'label' => &$GLOBALS['TL_LANG']['tl_faq_category']['editheader'], 'href' => 'act=edit', 'icon' => 'header.gif', - 'button_callback' => array('tl_faq_category', 'editHeader'), - 'attributes' => 'class="edit-header"' + 'button_callback' => array('tl_faq_category', 'editHeader') ), 'copy' => array (
[Faq] `[Alt] + [Shift] + click` elements to edit their header data
contao_contao
train
php
9c9afbc00bc88bee4f4a578a0dd626476ee49f56
diff --git a/landsat/utils.py b/landsat/utils.py index <HASH>..<HASH> 100644 --- a/landsat/utils.py +++ b/landsat/utils.py @@ -149,7 +149,11 @@ def convert_to_integer_list(value): """ convert a comma separate string to a list where all values are integers """ if value and isinstance(value, str): - new_list = re.findall('[0-9]', value) + if ',' in value: + value = re.sub('[^0-9,]', '', value) + new_list = value.split(',') + else: + new_list = re.findall('[0-9]', value) return new_list if new_list else None else: return value
handle comma for double digit bands
developmentseed_landsat-util
train
py
734960eacf5aa6202301c800f42108740f8490a5
diff --git a/paypal/pro/forms.py b/paypal/pro/forms.py index <HASH>..<HASH> 100644 --- a/paypal/pro/forms.py +++ b/paypal/pro/forms.py @@ -12,13 +12,13 @@ from paypal.utils import warn_untested class PaymentForm(forms.Form): """Form used to process direct payments.""" - firstname = forms.CharField(255, label=_("First Name")) - lastname = forms.CharField(255, label=_("Last Name")) - street = forms.CharField(255, label=_("Street Address")) - city = forms.CharField(255, label=_("City")) - state = forms.CharField(255, label=_("State")) + firstname = forms.CharField(max_length=255, label=_("First Name")) + lastname = forms.CharField(max_length=255, label=_("Last Name")) + street = forms.CharField(max_length=255, label=_("Street Address")) + city = forms.CharField(max_length=255, label=_("City")) + state = forms.CharField(max_length=255, label=_("State")) countrycode = CountryField(label=_("Country"), initial="US") - zip = forms.CharField(32, label=_("Postal / Zip Code")) + zip = forms.CharField(max_length=32, label=_("Postal / Zip Code")) acct = CreditCardField(label=_("Credit Card Number")) expdate = CreditCardExpiryField(label=_("Expiration Date")) cvv2 = CreditCardCVV2Field(label=_("Card Security Code"))
Fixed a Django <I> incompatiblity
spookylukey_django-paypal
train
py
5a3f220a16433d8120ec38df7e3ad42737d4e6be
diff --git a/app/lib/ServerNodes.java b/app/lib/ServerNodes.java index <HASH>..<HASH> 100644 --- a/app/lib/ServerNodes.java +++ b/app/lib/ServerNodes.java @@ -44,7 +44,7 @@ public class ServerNodes { configuredNodes.put(configuredNode, configuredNode); } - log.info("Creating ServerNodes with initial nodes {}", configuredNodes.keySet()); + log.debug("Creating ServerNodes with initial nodes {}", configuredNodes.keySet()); // resolve the configured nodes: // we only know a transport address where we can reach them, but we don't know any node ids yet. // thus we do not know anything about them, and cannot even match them to node information coming
lower log level to not scare users :)
Graylog2_graylog2-server
train
java
47c7fdbc2eaf669d89a14b10b4ee81044e90f95b
diff --git a/lib/hemp/version.rb b/lib/hemp/version.rb index <HASH>..<HASH> 100644 --- a/lib/hemp/version.rb +++ b/lib/hemp/version.rb @@ -1,3 +1,3 @@ module Hemp - VERSION = "0.1.0" + VERSION = "1.0.0".freeze end
Changed version information and pushed to Rubygems
0duaht_hemp-web-framework
train
rb
7f849e409fedd04439e8dadfda81fb9c1701c573
diff --git a/base/src/main/java/uk/ac/ebi/atlas/utils/ColourGradient.java b/base/src/main/java/uk/ac/ebi/atlas/utils/ColourGradient.java index <HASH>..<HASH> 100644 --- a/base/src/main/java/uk/ac/ebi/atlas/utils/ColourGradient.java +++ b/base/src/main/java/uk/ac/ebi/atlas/utils/ColourGradient.java @@ -7,7 +7,9 @@ import java.awt.Color; public class ColourGradient { public static String getGradientColour(double value, double min, double max, String lowValueColourString, String highValueColourString) { - Preconditions.checkArgument(value >= min && value <= max); + Preconditions.checkArgument( + value >= 0.0 && value >= min && value <= max || + value < 0 && value <= min && value >= max); Color lowValueColour = getColour(lowValueColourString); Color highValueColour = getColour(highValueColourString);
Fix checking if value is within min and max
ebi-gene-expression-group_atlas
train
java
acaa2b131ce7557438a522daf19dd713038125d4
diff --git a/lib/ProMotion/classes/Screen.rb b/lib/ProMotion/classes/Screen.rb index <HASH>..<HASH> 100644 --- a/lib/ProMotion/classes/Screen.rb +++ b/lib/ProMotion/classes/Screen.rb @@ -11,6 +11,13 @@ module ProMotion def view return self.view_controller.view end + + def set_attributes(element, args = {}) + args.each do |k, v| + element.k = v if element.respond_to? "#{k}=" + end + element + end end module ScreenNavigation
Added a little helper for setting view element properties easily (set_attributes)
infinitered_ProMotion
train
rb
cb89fea087704bd7cbde2d64e2e21426af401be4
diff --git a/nmea.js b/nmea.js index <HASH>..<HASH> 100644 --- a/nmea.js +++ b/nmea.js @@ -91,7 +91,7 @@ exports.parsers = { // $GPGSV,3,1,12, 05,58,322,36, 02,55,032,, 26,50,173,, 04,31,085, var numRecords = (fields.length - 4) / 4, sats = []; - for (var i=1; i < numRecords; i++) { + for (var i=0; i < numRecords; i++) { var offset = i * 4 + 4; sats.push({id: fields[offset], elevationDeg: +fields[offset+1],
Catch the first satellite id in GSV
jamesp_node-nmea
train
js
2e99e65abb5fa0a2c2f51767dbb5d5c0fba65edd
diff --git a/src/LearnositySdk/Utils/Uuid.php b/src/LearnositySdk/Utils/Uuid.php index <HASH>..<HASH> 100644 --- a/src/LearnositySdk/Utils/Uuid.php +++ b/src/LearnositySdk/Utils/Uuid.php @@ -2,6 +2,7 @@ namespace LearnositySdk\Utils; +// Loads PHP5 polyfill for random_bytes(). See self::uuidv4() declaration for more. require_once __DIR__ . '/../../../vendor/paragonie/random_compat/lib/random.php'; // Thanks to Andrew Moore http://www.php.net/manual/en/function.uniqid.php#94959 @@ -20,8 +21,11 @@ class Uuid case 'v5': return self::v5($namespace, $name); break; + case 'uuidv4': + return self::uuidv4($namespace, $name); + break; default: - return self::v4(); + return self::uuidv4(); break; } }
Fixed issue where uuidv4() wasn't being called
Learnosity_learnosity-sdk-php
train
php
e78942332ca6d17bf186e84e600e11ca0068a112
diff --git a/lib/geocoder/lookups/google.rb b/lib/geocoder/lookups/google.rb index <HASH>..<HASH> 100644 --- a/lib/geocoder/lookups/google.rb +++ b/lib/geocoder/lookups/google.rb @@ -40,6 +40,12 @@ module Geocoder::Lookup unless (bounds = query.options[:bounds]).nil? params[:bounds] = bounds.map{ |point| "%f,%f" % point }.join('|') end + unless (region = query.options[:region]).nil? + params[:region] = region + end + unless (components = query.options[:components]).nil? + params[:components] = components + end params end
pass region and components to google geocode query url
alexreisner_geocoder
train
rb
74c26480fcbfa5620a9a9f195bd14d3d257ee968
diff --git a/src/support/forge/api/Import.php b/src/support/forge/api/Import.php index <HASH>..<HASH> 100644 --- a/src/support/forge/api/Import.php +++ b/src/support/forge/api/Import.php @@ -498,7 +498,7 @@ class Import extract($item); $row = []; $row[] = $apiName . "(" . (empty($operation['parameters']) ? '' : 'array') . ")"; - $row[] = " \[{$operation['httpMethod']}\] {$operation['uri']} "; + $row[] = " \[{$operation['httpMethod']}\] /{$operation['uri']} "; $row[] = implode("<br/>", array_keys($operation['parameters'])); $row[] = $this->sanitizeDescription($api['request']['description']); $row[] = '';
[doc] Add / before enpoints
sudiptochoudhury_php-api-client-forge
train
php
bb4282b09c4a07b7c88177e656968f94228f5e40
diff --git a/napalm_logs/listener_proc.py b/napalm_logs/listener_proc.py index <HASH>..<HASH> 100644 --- a/napalm_logs/listener_proc.py +++ b/napalm_logs/listener_proc.py @@ -52,6 +52,8 @@ class NapalmLogsListenerProc(NapalmLogsProc): Setup the transport. ''' listener_class = get_listener(self._listener_type) + self.address = self.listener_opts.pop('address', self.address) + self.port = self.listener_opts.pop('port', self.port) self.listener = listener_class(self.address, self.port, **self.listener_opts)
Fix #<I>: Use the most specific address and port options for the listener
napalm-automation_napalm-logs
train
py
a80cd25e8eb7f8b5d89af26cdcd62a5bbe44d65c
diff --git a/airflow/providers/amazon/aws/hooks/s3.py b/airflow/providers/amazon/aws/hooks/s3.py index <HASH>..<HASH> 100644 --- a/airflow/providers/amazon/aws/hooks/s3.py +++ b/airflow/providers/amazon/aws/hooks/s3.py @@ -514,6 +514,7 @@ class S3Hook(AwsBaseHook): bytes_data = string_data.encode(encoding) file_obj = io.BytesIO(bytes_data) self._upload_file_obj(file_obj, key, bucket_name, replace, encrypt, acl_policy) + file_obj.close() @provide_bucket_name @unify_bucket_name_and_key @@ -548,6 +549,7 @@ class S3Hook(AwsBaseHook): """ file_obj = io.BytesIO(bytes_data) self._upload_file_obj(file_obj, key, bucket_name, replace, encrypt, acl_policy) + file_obj.close() @provide_bucket_name @unify_bucket_name_and_key
Close/Flush byte stream in s3 hook load_string and load_bytes (#<I>)
apache_airflow
train
py
ca1e2462211e63084d56e0882573048fa80a9b27
diff --git a/state/watcher.go b/state/watcher.go index <HASH>..<HASH> 100644 --- a/state/watcher.go +++ b/state/watcher.go @@ -1703,7 +1703,7 @@ func (w *machineInterfacesWatcher) Changes() <-chan struct{} { return w.out } -// initial retrieves the currently know interfaces and stores +// initial retrieves the currently known interfaces and stores // them together with their activation. func (w *machineInterfacesWatcher) initial() (map[bson.ObjectId]bool, error) { known := make(map[bson.ObjectId]bool)
Quickly fixed one typo of the last PR. ;)
juju_juju
train
go
2f67f978c77d872a68a9974edbe7ed74b69ad392
diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/settings.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/settings.py index <HASH>..<HASH> 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/settings.py +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/settings.py @@ -313,7 +313,7 @@ if DEBUG: TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', - ), + ) else: TEMPLATE_LOADERS = ( ('django.template.loaders.cached.Loader', (
a comma to much - is no more.
pydanny_cookiecutter-django
train
py
e7e7553902458cb65f533918225d780d98f0d04a
diff --git a/cobra/core/model.py b/cobra/core/model.py index <HASH>..<HASH> 100644 --- a/cobra/core/model.py +++ b/cobra/core/model.py @@ -644,7 +644,7 @@ class Model(Object): def objective(self, value): if isinstance(value, sympy.Basic): value = self.solver.interface.Objective(value, sloppy=False) - if not isinstance(value, (dict, self.solver.interface.Objective)): + if not isinstance(value, (dict, optlang.interface.Objective)): value = {rxn: 1 for rxn in self.reactions.get_by_any(value)} set_objective(self, value, additive=False) diff --git a/cobra/util/solver.py b/cobra/util/solver.py index <HASH>..<HASH> 100644 --- a/cobra/util/solver.py +++ b/cobra/util/solver.py @@ -137,7 +137,7 @@ def set_objective(model, value, additive=False): {reaction.forward_variable: coef, reaction.reverse_variable: -coef}) - elif isinstance(value, (sympy.Basic, model.solver.interface.Objective)): + elif isinstance(value, (sympy.Basic, optlang.interface.Objective)): if isinstance(value, sympy.Basic): value = interface.Objective( value, direction=model.solver.objective.direction,
Fix instance checking for Objective (#<I>)
opencobra_cobrapy
train
py,py
b608a570b35f54ba0cc922b46632a4359adc0f1b
diff --git a/lib/ReactViews/Map/Panels/SharePanel/BuildShareLink.js b/lib/ReactViews/Map/Panels/SharePanel/BuildShareLink.js index <HASH>..<HASH> 100644 --- a/lib/ReactViews/Map/Panels/SharePanel/BuildShareLink.js +++ b/lib/ReactViews/Map/Panels/SharePanel/BuildShareLink.js @@ -199,7 +199,7 @@ function addViewSettings(viewState, initSources) { viewerMode: viewerMode, currentTime: time, sharedFromExplorerPanel: viewState.explorerPanelIsVisible, - previewedItemId: defined(viewState.previewedItem) && viewState.previewedItem.id + previewedItemId: defined(viewState.previewedItem) && (viewState.previewedItem.id || viewState.previewedItem.uniqueId) }; if (terria.showSplitter) { terriaSettings.showSplitter = terria.showSplitter;
Fix bug on CatalogGroups without ID Pre-mobx working around model behaviour in ui instead of in model
TerriaJS_terriajs
train
js
a6c775764300139a6899d06e926e1ac6a21e1a00
diff --git a/packages/ember-extension-support/lib/data_adapter.js b/packages/ember-extension-support/lib/data_adapter.js index <HASH>..<HASH> 100644 --- a/packages/ember-extension-support/lib/data_adapter.js +++ b/packages/ember-extension-support/lib/data_adapter.js @@ -302,9 +302,7 @@ export default EmberObject.extend({ addArrayObserver(records, this, observer); - function release() { - removeArrayObserver(records, this, observer); - } + let release = () => removeArrayObserver(records, this, observer); return release; },
Bind the watchModelTypes's release function to `this` so it correctly removes the array observers
emberjs_ember.js
train
js
e8f54de83736a4b78760309c6bcd1405690c0d66
diff --git a/spec/controllers/deal_redemptions/admin/redemptions_controller_spec.rb b/spec/controllers/deal_redemptions/admin/redemptions_controller_spec.rb index <HASH>..<HASH> 100644 --- a/spec/controllers/deal_redemptions/admin/redemptions_controller_spec.rb +++ b/spec/controllers/deal_redemptions/admin/redemptions_controller_spec.rb @@ -45,18 +45,25 @@ module DealRedemptions FactoryGirl.create(:redeem_transaction_3)] end - describe "GET index" do + describe "GET #index" do it "assigns all transactions as @transactions" do get :index, {}, valid_session expect(assigns(:transactions)).to eq(@transaction) end end - describe "GET show" do - it "assigns the requested transaction as @transaction" do + describe "GET #show" do + before(:each) do get :show, {:id => @transaction[0].id}, valid_session + end + + it "assigns the requested transaction as @transaction" do expect(assigns(:transaction)).to eq(@transaction[0]) end + + it "assigns redemption to @redemption to display user info" do + expect(assigns(:redemption)).to eq(@transaction[0].redemption[0]) + end end end
test to make sure redemption is assigned a instance variable in the controller
iamcutler_deal-redemptions
train
rb
a534e9b907d44b2b79eaa4e2aa6a9351436f64ee
diff --git a/lib/ffi-gobject/value.rb b/lib/ffi-gobject/value.rb index <HASH>..<HASH> 100644 --- a/lib/ffi-gobject/value.rb +++ b/lib/ffi-gobject/value.rb @@ -18,11 +18,13 @@ module GObject def self.make_finalizer(struct, gtype) proc do ptr = struct.to_ptr - ptr.autorelease = false - unless struct[:g_type] == TYPE_INVALID - GObject::Lib.g_value_unset ptr + if ptr.autorelease? + ptr.autorelease = false + unless struct[:g_type] == TYPE_INVALID + GObject::Lib.g_value_unset ptr + end + GObject.boxed_free gtype, ptr end - GObject.boxed_free gtype, ptr end end @@ -111,6 +113,12 @@ module GObject end end + def self.copy_value_to_pointer(value, pointer, offset = 0) + super(value, pointer, offset).tap do |result| + value.to_ptr.autorelease = false if value + end + end + private def set_ruby_value(val)
Do not free GObject::Value that has been copied
mvz_gir_ffi
train
rb
573b487c2bb23f0d94f0ba8de09a71e95ea8ddd5
diff --git a/core/src/main/java/org/bitcoinj/kits/WalletAppKit.java b/core/src/main/java/org/bitcoinj/kits/WalletAppKit.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/bitcoinj/kits/WalletAppKit.java +++ b/core/src/main/java/org/bitcoinj/kits/WalletAppKit.java @@ -131,7 +131,8 @@ public class WalletAppKit extends AbstractIdleService { /** * If you want to learn about the sync process, you can provide a listener here. For instance, a - * {@link DownloadListener} is a good choice. + * {@link DownloadListener} is a good choice. This has no effect unless setBlockingStartup(false) has been called + * too, due to some missing implementation code. */ public WalletAppKit setDownloadListener(PeerEventListener listener) { this.downloadListener = listener;
WAK: add note in javadoc about missing feature.
bitcoinj_bitcoinj
train
java
088586cedabe737866bf5beda0fddf5799138265
diff --git a/biomart/dataset.py b/biomart/dataset.py index <HASH>..<HASH> 100644 --- a/biomart/dataset.py +++ b/biomart/dataset.py @@ -110,7 +110,8 @@ class BiomartDataset(object): dataset_filter = self.filters.get(filter_name, None) if not dataset_filter: - self.show_filters() + if self.verbose: + self.show_filters() raise biomart.BiomartException("The filter '%s' does not exist." % filter_name) if len(dataset_filter.accepted_values) > 0 and filter_value not in dataset_filter.accepted_values: @@ -130,12 +131,14 @@ class BiomartDataset(object): for attribute_name in attributes: if attribute_name not in self.attributes.keys(): - self.show_attributes() + if self.verbose: + self.show_attributes() raise biomart.BiomartException("The attribute '%s' does not exist." % attribute_name) # selected attributes must belong to the same attribute page. if len(set([self.attributes[a].attribute_page for a in attributes])) > 1: - self.show_attributes() + if self.verbose: + self.show_attributes() raise biomart.BiomartException("You must use attributes that belong to the same attribute page.") # filters and attributes looks ok, start building the XML query
be less verbose if not asked
sebriois_biomart
train
py
8079e62ea9c427153be19080493944a2b8a760f9
diff --git a/templates/api/services/protocols/bearer.js b/templates/api/services/protocols/bearer.js index <HASH>..<HASH> 100644 --- a/templates/api/services/protocols/bearer.js +++ b/templates/api/services/protocols/bearer.js @@ -13,7 +13,7 @@ exports.authorize = function(token, done) { Passport.findOne({ accessToken: token }, function(err, passport) { if (err) { return done(err); } if (!passport) { return done(null, false); } - User.findById(passport.user, function(err, user) { + User.findOneById(passport.user, function(err, user) { if (err) { return done(err); } if (!user) { return done(null, false); } return done(null, user, { scope: 'all' });
In sails <I> findById returns and array In sails <I> `findById` returns and array. One might expect to be able to access the user model by `req.user` instead of `req.user[0]`
kasperisager_sails-generate-auth
train
js
586342447bd5d912a5582a7e998905566397fd0d
diff --git a/lib/select.js b/lib/select.js index <HASH>..<HASH> 100644 --- a/lib/select.js +++ b/lib/select.js @@ -85,20 +85,15 @@ var selectors = { op = operators[op]; return function(el) { var attr; - switch (key) { - case 'for': - attr = el.htmlFor; - break; - case 'class': - attr = el.className; - break; - case 'href': - attr = el.getAttribute('href', 2); - break; - default: - attr = el[key] != null ? el[key] : el.getAttribute(key); - break; - } + if (key == 'for') + attr = el.htmlFor; + else if (key == 'class') + attr = el.className; + else if (key == 'href') + attr = el.getAttribute('href', 2); + else + attr = key in el ? el[key] : el.getAttribute(key); + return attr != null && op(attr + '', val); }; },
Replaced unoptimized switched by if/else
fgnass_domino
train
js
7313b818a1f823e25ac000a56869631eeedc62ee
diff --git a/lib/omnibus/cli/base.rb b/lib/omnibus/cli/base.rb index <HASH>..<HASH> 100644 --- a/lib/omnibus/cli/base.rb +++ b/lib/omnibus/cli/base.rb @@ -94,7 +94,7 @@ module Omnibus aliases: '-l', type: :string, enum: %w(fatal error warn info debug), - lazy_default: 'warn' + lazy_default: 'info' class_option :override, desc: 'Override one or more Omnibus config options', aliases: '-o',
Use :info as the default log level
chef_omnibus
train
rb
5bfa35ab81e09820c191d20fd8cda44bc64068c7
diff --git a/client/servers/manager.go b/client/servers/manager.go index <HASH>..<HASH> 100644 --- a/client/servers/manager.go +++ b/client/servers/manager.go @@ -204,7 +204,7 @@ func (m *Manager) SetServers(servers Servers) bool { // Determine if they are equal equal := m.serversAreEqual(servers) - // If server list is equal don't change the list and return immediatly + // If server list is equal don't change the list and return immediately // This prevents unnecessary shuffling of a failed server that was moved to the // bottom of the list if equal { diff --git a/client/servers/manager_test.go b/client/servers/manager_test.go index <HASH>..<HASH> 100644 --- a/client/servers/manager_test.go +++ b/client/servers/manager_test.go @@ -74,6 +74,11 @@ func TestServers_SetServers(t *testing.T) { require.False(m.SetServers([]*servers.Server{s1, s2})) after := m.GetServers() require.Equal(before, after) + + // Send a shuffled list, verify original order doesn't change + require.False(m.SetServers([]*servers.Server{s2, s1})) + afterShuffledInput := m.GetServers() + require.Equal(after, afterShuffledInput) } func TestServers_FindServer(t *testing.T) {
fix typo and add one more test scenario
hashicorp_nomad
train
go,go
6f919e4229c8a3445f2f8f6aa61416e09e943351
diff --git a/lib/python/vdm/static/js/vdm.ui.js b/lib/python/vdm/static/js/vdm.ui.js index <HASH>..<HASH> 100755 --- a/lib/python/vdm/static/js/vdm.ui.js +++ b/lib/python/vdm/static/js/vdm.ui.js @@ -1796,10 +1796,10 @@ var loadPage = function() { id: VdmUI.getCurrentDbCookie() } } - else if (item == "partition-detection"){ + else if (item == "partitionDetection"){ deploymentInfo = { data:{ - partitionDetection:{ + "partition-detection":{ enabled: clusterObjects.txtPartitionDetection.text()=="Off"?false:true }
VDM-<I>: fixed issue with enable/disable partition detection
VoltDB_voltdb
train
js
3e324ff220e74a82fd5e801a1c6e3b35dac119a4
diff --git a/tutorials/ot-info-for-taxon-name.py b/tutorials/ot-info-for-taxon-name.py index <HASH>..<HASH> 100755 --- a/tutorials/ot-info-for-taxon-name.py +++ b/tutorials/ot-info-for-taxon-name.py @@ -1,6 +1,7 @@ #!/usr/bin/env python -'''Simple command-line tool that wraps the taxonomic name matching service - which is described at https://github.com/OpenTreeOfLife/opentree/wiki/Open-Tree-of-Life-APIs#match_names +'''Simple command-line tool that combines the actions +of the ot-tnrs-match-names.py, ot-taxon-info.py, and ot-taxon-subtree.py +scripts ''' import pprint import sys @@ -41,6 +42,7 @@ def fetch_and_write_taxon_info(id_list, include_anc, list_tips, output): wrap_response=True) write_taxon_info(info, include_anc, output) + def write_taxon_info(taxon, include_anc, output): '''Writes out data from `taxon` to the `output` stream to demonstrate the attributes of a taxon object.
corrected doc string to reflect current behavior
OpenTreeOfLife_peyotl
train
py
267785621bc2f26d4c76f7be2ae9e7b16cfe658d
diff --git a/qiime_tools/util.py b/qiime_tools/util.py index <HASH>..<HASH> 100644 --- a/qiime_tools/util.py +++ b/qiime_tools/util.py @@ -124,7 +124,7 @@ def parse_taxonomy_table(idtaxFNH): idtax = OrderedDict() with file_handle(idtaxFNH) as idtxF: for line in idtxF: - ID, tax = line.strip().split('\t') + ID, tax = line.strip().split('\t')[:2] idtax[ID] = tax return idtax
Restores accidental reversion of commit <I>c<I> introduced by commit <I>d6a<I>.
smdabdoub_phylotoast
train
py
0a1b2b4f78454089f8604e880e45541ef013661f
diff --git a/lib/fixture_builder.rb b/lib/fixture_builder.rb index <HASH>..<HASH> 100755 --- a/lib/fixture_builder.rb +++ b/lib/fixture_builder.rb @@ -14,6 +14,8 @@ module FixtureBuilder class Configuration attr_accessor :select_sql, :delete_sql, :skip_tables, :files_to_check, :record_name_fields, :fixture_builder_file, :after_build + SCHEMA_FILES = ['db/schema.rb', 'db/development_structure.sql', 'db/test_structure.sql', 'db/production_structure.sql'] + def initialize @custom_names = {} @file_hashes = file_hashes @@ -40,7 +42,14 @@ module FixtureBuilder end def files_to_check - @files_to_check ||= %w{ db/schema.rb } + @files_to_check ||= schema_definition_files + end + + def schema_definition_files + Dir['db/*'].inject([]) do |result, file| + result << file if SCHEMA_FILES.include?(file) + result + end end def files_to_check=(files)
When using database utilities not covered by schema.rb someone may choose to use sql. FixtureBuilder crapped out because it was hard coded to check for schema.rb. This patch adds other default schema files and only appends them to the check list if they exist.
rdy_fixture_builder
train
rb
b86e9c3e8b137db4713d3a4bc34fff21731346fe
diff --git a/internal/cli/ui.go b/internal/cli/ui.go index <HASH>..<HASH> 100644 --- a/internal/cli/ui.go +++ b/internal/cli/ui.go @@ -28,9 +28,10 @@ func (c *UICommand) Run(args []string) int { return 1 } - if c.basis.Local() { - c.basis.UI().Output("Vagrant must be configured in server mode to access the UI", terminal.WithWarningStyle()) - } + // TODO(spox): comment this out until local configuration is updated + // if c.client.Local() { + // c.client.UI().Output("Vagrant must be configured in server mode to access the UI", terminal.WithWarningStyle()) + // } // Get our API client client := c.basis.Client()
Temporarily disable local check in client UI setup
hashicorp_vagrant
train
go
8f795c83f07377e8bb4426c0f65802a627dc87f9
diff --git a/controller/frontend/src/Controller/Frontend/Product/Standard.php b/controller/frontend/src/Controller/Frontend/Product/Standard.php index <HASH>..<HASH> 100644 --- a/controller/frontend/src/Controller/Frontend/Product/Standard.php +++ b/controller/frontend/src/Controller/Frontend/Product/Standard.php @@ -351,7 +351,11 @@ class Standard */ protected function getCatalogIdsFromTree( \Aimeos\MShop\Catalog\Item\Iface $item ) { - $list = array( $item->getId() ); + $list = []; + + if( $item->getStatus() > 0 ) { + $list[] = $item->getId(); + } foreach( $item->getChildren() as $child ) { $list = array_merge( $list, $this->getCatalogIdsFromTree( $child ) );
Aggregate only products from active categories
aimeos_ai-controller-frontend
train
php
b96ae69ed5139084e62cca0f5644d0e9eb972146
diff --git a/cf/api/strategy/domains.go b/cf/api/strategy/domains.go index <HASH>..<HASH> 100644 --- a/cf/api/strategy/domains.go +++ b/cf/api/strategy/domains.go @@ -51,10 +51,23 @@ func (s domainsEndpointStrategy) DeleteSharedDomainURL(guid string) string { return buildURL(v2("domains", guid), params{recursive: true}) } -type separatedDomainsEndpointStrategy struct { - domainsEndpointStrategy +type separatedDomainsEndpointStrategy struct{} + +func (s separatedDomainsEndpointStrategy) DomainURL(name string) string { + return buildURL(v2("shared_domains"), params{ + q: map[string]string{"name": name}, + }) +} + +func (s separatedDomainsEndpointStrategy) OrgDomainsURL(orgGuid string) string { + return v2("organizations", orgGuid, "private_domains") } +func (s separatedDomainsEndpointStrategy) OrgDomainURL(orgGuid, name string) string { + return buildURL(s.OrgDomainsURL(orgGuid), params{ + q: map[string]string{"name": name}, + }) +} func (s separatedDomainsEndpointStrategy) PrivateDomainsURL() string { return v2("private_domains") }
Stop using deprecated endpoints for domains. [Fixes #<I>]
cloudfoundry_cli
train
go
ed3b3ee5ca452a5f68e2b0d0358014160aa59947
diff --git a/bencode/misc.go b/bencode/misc.go index <HASH>..<HASH> 100644 --- a/bencode/misc.go +++ b/bencode/misc.go @@ -6,16 +6,10 @@ import ( ) // Wow Go is retarded. -var marshalerType = reflect.TypeOf(func() *Marshaler { - var m Marshaler - return &m -}()).Elem() - -// Wow Go is retarded. -var unmarshalerType = reflect.TypeOf(func() *Unmarshaler { - var i Unmarshaler - return &i -}()).Elem() +var ( + marshalerType = reflect.TypeOf((*Marshaler)(nil)).Elem() + unmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem() +) func bytesAsString(b []byte) string { return *(*string)(unsafe.Pointer(&b))
bencode: simplify getting `marshalerType` and `unmarshalerType` (#<I>)
anacrolix_torrent
train
go
4b076cdcb82a10541430545e331668818a23a17a
diff --git a/salt/master.py b/salt/master.py index <HASH>..<HASH> 100644 --- a/salt/master.py +++ b/salt/master.py @@ -413,7 +413,8 @@ class AESFuncs(object): pub_path = os.path.join(self.opts['pki_dir'], 'minions', id_) with open(pub_path, 'r') as fp_: minion_pub = fp_.read() - tmp_pub = tempfile.mktemp() + fd_, tmp_pub = tempfile.mkstemp() + fd_.close() with open(tmp_pub, 'w+') as fp_: fp_.write(minion_pub) pub = RSA.load_pub_key(tmp_pub)
clean up tempfile commit in master.py
saltstack_salt
train
py
94eb2bbd947b288916adc4ae9764d66a340d55f9
diff --git a/allauth/app_settings.py b/allauth/app_settings.py index <HASH>..<HASH> 100644 --- a/allauth/app_settings.py +++ b/allauth/app_settings.py @@ -11,21 +11,24 @@ def check_context_processors(): ctx_present = False if django.VERSION < (1, 8,): + setting = "settings.TEMPLATE_CONTEXT_PROCESSORS" if allauth_ctx in settings.TEMPLATE_CONTEXT_PROCESSORS: ctx_present = True else: - for engine in template.engines.templates.values(): + for name, engine in template.engines.templates.items(): if allauth_ctx in engine.get('OPTIONS', {})\ .get('context_processors', []): ctx_present = True - break + else: + setting = "settings.TEMPLATES['{}']['OPTIONS']['context_processors']" + setting = setting.format(name) if not ctx_present: excmsg = ("socialaccount context processor " - "not found in settings.TEMPLATE_CONTEXT_PROCESSORS." + "not found in {}. " "See settings.py instructions here: " - "https://github.com/pennersr/django-allauth#installation") - raise ImproperlyConfigured(excmsg) + "http://django-allauth.readthedocs.org/en/latest/installation.html") + raise ImproperlyConfigured(excmsg.format(setting)) if SOCIALACCOUNT_ENABLED:
Fixed up outdated error message in context processors check. Changed the URL to be more relevant and print the correct setting based on the django version.
pennersr_django-allauth
train
py
2bd36e3108b02e16389b70d730e5a60096a11c48
diff --git a/ayrton/__init__.py b/ayrton/__init__.py index <HASH>..<HASH> 100755 --- a/ayrton/__init__.py +++ b/ayrton/__init__.py @@ -47,6 +47,8 @@ class CommandWrapper (sh.Command): # if _out or _err are not provided, connect them to the original ones if not '_out' in kwargs: kwargs['_out']= sys.stdout.buffer + if not '_err' in kwargs: + kwargs['_err']= sys.stderr.buffer return super ().__call__ (*args, **kwargs)
+ stderr to stderr by default too.
StyXman_ayrton
train
py
5bf9d8d8d9dc11938b4657eac6b2e4a45cd60cb2
diff --git a/server.js b/server.js index <HASH>..<HASH> 100644 --- a/server.js +++ b/server.js @@ -48,10 +48,6 @@ app.use(function(req, res, next){ next(); } }); -<<<<<<< HEAD - -======= ->>>>>>> c69e2987859e0cdf6e22027ff8118c9a955f34c0 app.all('*', function(req, res, next) { res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Headers', 'X-Requested-With');
[CHORE] Cleaning merge commit garbage
ripple_ripple-rest
train
js
ae465d86e7c4d9bc68ca4484c75803b05cf550fc
diff --git a/src/Behavior/EAV/Entity.php b/src/Behavior/EAV/Entity.php index <HASH>..<HASH> 100644 --- a/src/Behavior/EAV/Entity.php +++ b/src/Behavior/EAV/Entity.php @@ -14,7 +14,6 @@ namespace Indigo\Doctrine\Behavior\EAV; use Doctrine\Common\Collections\Selectable; use Doctrine\Common\Collections\Criteria; use Doctrine\ORM\Mapping as ORM; -use Indigo\Doctrine\Field; /** * Use this trait to implement Entity part of EAV behavior on entities @@ -23,8 +22,6 @@ use Indigo\Doctrine\Field; */ trait Entity { - use Field\Id; - /** * @var Selectable */
Removes id from EAV entity
indigophp_doctrine-extensions
train
php
84f250581074b75a1e507c48ed28160556ddcd86
diff --git a/lib/poise/helpers/resource_subclass.rb b/lib/poise/helpers/resource_subclass.rb index <HASH>..<HASH> 100644 --- a/lib/poise/helpers/resource_subclass.rb +++ b/lib/poise/helpers/resource_subclass.rb @@ -57,6 +57,7 @@ module Poise else subclass_resource_equivalents << superclass_resource_name end + subclass_resource_equivalents.uniq! end # An array of names for the resources this class is equivalent to for
Uniq the equivalents in case this is called more than once.
poise_poise
train
rb
e9e22d1ff4ffc69d72d16a3a823353bad02bdce8
diff --git a/src/main/java/com/treasure_data/client/HttpConnectionImpl.java b/src/main/java/com/treasure_data/client/HttpConnectionImpl.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/treasure_data/client/HttpConnectionImpl.java +++ b/src/main/java/com/treasure_data/client/HttpConnectionImpl.java @@ -73,6 +73,7 @@ public class HttpConnectionImpl { postReadTimeout = Integer.parseInt(props.getProperty( Config.TD_CLIENT_POSTMETHOD_READ_TIMEOUT, Config.TD_CLIENT_POSTMETHOD_READ_TIMEOUT_DEFAULTVALUE)); + this.props = props; } private void setRequestAuthHeader(Request<?> request, HttpURLConnection conn) throws IOException { @@ -371,7 +372,6 @@ public class HttpConnectionImpl { } // system properties - Properties props = System.getProperties(); String host = props.getProperty( Config.TD_API_SERVER_HOST, Config.TD_API_SERVER_HOST_DEFAULTVALUE); int port = Integer.parseInt(props.getProperty(
changed HttpConnectionImpl class -- fixed bug: 'props' field in the class is never accessed
treasure-data_td-client-java
train
java
205e4690a3b36c4f5782f97e5eda52b563e7b97a
diff --git a/pyqode/core/managers/file.py b/pyqode/core/managers/file.py index <HASH>..<HASH> 100644 --- a/pyqode/core/managers/file.py +++ b/pyqode/core/managers/file.py @@ -167,7 +167,7 @@ class FileManager(Manager): content, self.get_mimetype(path), self.encoding) self.editor.setDocumentTitle(self.editor.file.name) self.opening = False - QtCore.QTimer.singleShot(1, self._restore_cached_pos) + self._restore_cached_pos() def _restore_cached_pos(self): pos = Cache().get_cursor_position(self.path) diff --git a/pyqode/core/modes/checker.py b/pyqode/core/modes/checker.py index <HASH>..<HASH> 100644 --- a/pyqode/core/modes/checker.py +++ b/pyqode/core/modes/checker.py @@ -241,7 +241,10 @@ class CheckerMode(Mode, QtCore.QObject): usd = message.block.userData() try: if usd and usd.messages: - usd.messages.remove(message) + try: + usd.messages.remove(message) + except ValueError: + pass except AttributeError: pass self._messages.remove(message)
Do not use a timer for jumping to the cached cursor position. The difference is that the cursor won't be centered (if centerOnScroll was true). This fix a bug with goto definition in other files in pyqode.python
pyQode_pyqode.core
train
py,py
ed95c05c14381e64404f1135763fcc9b65317b96
diff --git a/lib/Doctrine/DBAL/Migrations/Finder/RecursiveRegexFinder.php b/lib/Doctrine/DBAL/Migrations/Finder/RecursiveRegexFinder.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/DBAL/Migrations/Finder/RecursiveRegexFinder.php +++ b/lib/Doctrine/DBAL/Migrations/Finder/RecursiveRegexFinder.php @@ -71,6 +71,8 @@ final class RecursiveRegexFinder extends AbstractFinder implements MigrationDeep foreach ($iteratorFilesMatch as $file) { $files[] = $file[0]; } + + sort($files); return $files; }
RecursiveDirectoryIterator don't obtain some order of the file list. RecursiveDirectoryIterator shouldn't return a sorted list and haven't to do it be direct. But migration script logic requires sorted list of the Version*.php files for correct working.
doctrine_migrations
train
php
0903ea3dd8192e5f7eeb6f6a7011ec1d8ca4d487
diff --git a/docker/utils/utils.py b/docker/utils/utils.py index <HASH>..<HASH> 100644 --- a/docker/utils/utils.py +++ b/docker/utils/utils.py @@ -57,9 +57,10 @@ def compare_version(v1, v2): def ping(url): try: res = requests.get(url) - return res.status >= 400 except Exception: return False + else: + return res.status_code >= 400 def _convert_port_binding(binding):
replace status with status_code as defined by requests API Move this statement in `else` clause to make sure the try except block doesn't catch coding errors.
docker_docker-py
train
py
47c322e1288ec9a6bfe78af1393f017ccfbe5e07
diff --git a/src/lity.js b/src/lity.js index <HASH>..<HASH> 100644 --- a/src/lity.js +++ b/src/lity.js @@ -269,6 +269,8 @@ } function init(handler, content, options, el) { + _ready = $.Deferred(); + _instanceCount++; globalToggle(); @@ -342,7 +344,6 @@ } if (content) { - _ready = $.Deferred(); $.when(close()).done($.proxy(init, null, handler, content, options, el)); } @@ -402,6 +403,7 @@ var options = el.data('lity-options') || el.data('lity'); if (open(target, options, el)) { + el.blur(); event.preventDefault(); } }
Fix weird lightbox state when hitting enter triggering click on still focused anchor element
jsor_lity
train
js
57f200ab356c4b019a488ff8dc041e90d2a28cd5
diff --git a/spec/rackstash/logger_spec.rb b/spec/rackstash/logger_spec.rb index <HASH>..<HASH> 100644 --- a/spec/rackstash/logger_spec.rb +++ b/spec/rackstash/logger_spec.rb @@ -203,8 +203,8 @@ describe Rackstash::Logger do end it 'implements the same method signature as the Buffer' do - expect(Rackstash::Buffer.instance_method(:tag).arity) - .to eql logger.method(:tag).arity + expect(Rackstash::Buffer.instance_method(:tag).parameters) + .to eql logger.method(:tag).parameters end end
Check that Logger#tag implements the same interface as Buffer#tag
meineerde_rackstash
train
rb
00780d4f592d0e3b3d771c056dd5ef2d8be420f8
diff --git a/models/DEV_DB.js b/models/DEV_DB.js index <HASH>..<HASH> 100644 --- a/models/DEV_DB.js +++ b/models/DEV_DB.js @@ -75,7 +75,7 @@ jsh.App[modelid] = new (function(){ }; this.getFormElement = function(){ - return jsh.$root('.xformcontainer.xelem'+model.class); + return jsh.$root('.xformcontainer.xelem'+xmodel.class); } this.oninit = function(xmodel) {
JSH-<I> Refactoring js
apHarmony_jsharmony-factory
train
js
f5accb5a2175f3ba095a40c3587fc5b9604f7756
diff --git a/wonambi/ioeeg/bci2000.py b/wonambi/ioeeg/bci2000.py index <HASH>..<HASH> 100644 --- a/wonambi/ioeeg/bci2000.py +++ b/wonambi/ioeeg/bci2000.py @@ -238,7 +238,7 @@ def _read_header(filename): hdr[section] = {} # defaultdict(dict) continue - if row == '': + if row.strip() == '': continue elif section == 'StateVector': @@ -247,6 +247,13 @@ def _read_header(filename): else: group = match('(?P<subsection>[\w:%]*) (?P<format>\w*) (?P<key>\w*)= (?P<value>.*) // ', row) + + if group is None: + group = match('(?P<subsection>[\w:%]*) (?P<format>\w*) (?P<key>\w*)= (?P<value>.*)', row) # For Group without comment + if group is None: + print("Cannot parse row:",row) + continue + onerow = group.groupdict() values = onerow['value'].split(' ')
Reading header elements without comments is now possible. Unparsable elements do not break the programm.
wonambi-python_wonambi
train
py
efe96a6a1b3d87a30e2b8bbe98925fff18a374ed
diff --git a/pmxbot/dictlib.py b/pmxbot/dictlib.py index <HASH>..<HASH> 100644 --- a/pmxbot/dictlib.py +++ b/pmxbot/dictlib.py @@ -8,5 +8,5 @@ class ConfigDict(ItemsAsAttributes, dict): return cls(yaml.load(f)) def to_yaml(self, filename): - with open(filename, 'wb') as f: + with open(filename, 'w') as f: yaml.dump(self, f)
Can't open in binary mode anymore (Python 3 requires writing yaml as text)
yougov_pmxbot
train
py
21d389cceaace3272dede54aa8f92f2429d92e00
diff --git a/test/unit/selector.js b/test/unit/selector.js index <HASH>..<HASH> 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -1,7 +1,7 @@ module("selector"); test("element", function() { - expect(19); + expect(18); QUnit.reset(); ok( jQuery("*").size() >= 30, "Select all" ); @@ -27,7 +27,6 @@ test("element", function() { ok( jQuery("#lengthtest input").length, '&lt;input name="length"&gt; cannot be found under IE, see #945' ); // Check for unique-ness and sort order - same( jQuery("*, *").get(), jQuery("*").get(), "Check for duplicates: *, *" ); same( jQuery("p, div p").get(), jQuery("p").get(), "Check for duplicates: p, div p" ); t( "Checking sort order", "h2, h1", ["qunit-header", "qunit-banner", "qunit-userAgent"] );
Testing *, * was unnecessary - especially in slower browsers.
jquery_jquery
train
js