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
ac3e0b3c8cb6abeb8a1fc444ab6522bb001c5663
diff --git a/lib/db/services.php b/lib/db/services.php index <HASH>..<HASH> 100644 --- a/lib/db/services.php +++ b/lib/db/services.php @@ -126,7 +126,7 @@ $functions = array( 'classpath' => 'user/externallib.php', 'description' => 'Get users by id.', 'type' => 'read', - 'capabilities'=> 'moodle/user:viewdetails', + 'capabilities'=> 'moodle/user:viewalldetails', ), 'moodle_user_delete_users' => array(
MDL-<I> fix capability name typo in the description of the web service function moodle_user_get_users_by_id
moodle_moodle
train
php
ca29ec3ade661da4130d51fe6f20b07bcbe8bdd5
diff --git a/tests/isArguments.unit.test.js b/tests/isArguments.unit.test.js index <HASH>..<HASH> 100644 --- a/tests/isArguments.unit.test.js +++ b/tests/isArguments.unit.test.js @@ -30,16 +30,11 @@ test(txt + 'return false if given anything else', function (t) { t.equal( isArguments( new Date() ), false ); t.equal( isArguments( new Error() ), false ); + t.equal( isArguments( new TypeError() ), false ); t.equal( isArguments( function () {} ), false ); t.equal( isArguments( new Function() ), false ); - t.equal( isArguments( Infinity ), false ); - - t.equal( isArguments( NaN ), false ); - - t.equal( isArguments( null ), false ); - t.equal( isArguments( 1234 ), false ); t.equal( isArguments( new Number() ), false ); @@ -52,6 +47,9 @@ test(txt + 'return false if given anything else', function (t) { t.equal( isArguments( 'string' ), false ); t.equal( isArguments( new String() ), false ); + t.equal( isArguments( Infinity ), false ); + t.equal( isArguments( NaN ), false ); + t.equal( isArguments( null ), false ); t.equal( isArguments( void 0 ), false ); t.end(); }); \ No newline at end of file
Modified unit test for backwards.isArguments
Omega3k_backwards.js
train
js
662ec104dfe7ccedbac6ea7a03f8e4b8f129a4f5
diff --git a/src/main/java/graphql/relay/Relay.java b/src/main/java/graphql/relay/Relay.java index <HASH>..<HASH> 100644 --- a/src/main/java/graphql/relay/Relay.java +++ b/src/main/java/graphql/relay/Relay.java @@ -212,6 +212,9 @@ public class Relay { public ResolvedGlobalId fromGlobalId(String globalId) { String[] split = Base64.fromBase64(globalId).split(":", 2); + if (split.length != 2) { + throw new IllegalArgumentException(String.format("expecting a valid global id, got %s", globalId)); + } return new ResolvedGlobalId(split[0], split[1]); } }
illegal global id should yield illegal argument exception
graphql-java_graphql-java
train
java
0d22648aef9ae75ecffad30ab34e10bc220a18d2
diff --git a/Tone/core/Emitter.js b/Tone/core/Emitter.js index <HASH>..<HASH> 100644 --- a/Tone/core/Emitter.js +++ b/Tone/core/Emitter.js @@ -114,7 +114,7 @@ define(["Tone/core/Tone"], function (Tone) { * @returns {Tone.Emitter} */ Tone.Emitter.mixin = function(object){ - var functions = ["on", "off", "emit"]; + var functions = ["on", "once", "off", "emit"]; object._events = {}; for (var i = 0; i < functions.length; i++){ var func = functions[i];
adding 'once' to mixin methods
Tonejs_Tone.js
train
js
7834f37f895e3ce0a38b5b7ef913d8d4ce02e217
diff --git a/src/helpers/reverse-publication-test.js b/src/helpers/reverse-publication-test.js index <HASH>..<HASH> 100644 --- a/src/helpers/reverse-publication-test.js +++ b/src/helpers/reverse-publication-test.js @@ -12,14 +12,6 @@ describe('reversePublication', function () { expect(actual).to.equal('/content/1.md') }) - it('applies the given path mapping', function () { - const publications = [ - { localPath: '/content/', publicPath: '/', publicExtension: '' } - ] - const actual = reversePublication('/1.md', publications) - expect(actual).to.equal('/content/1.md') - }) - it('adds leading slashes to the link', function () { const publications = [ { localPath: '/content/', publicPath: '/', publicExtension: '' }
Remove redundant test (#<I>)
Originate_text-runner
train
js
7a1deb341b8a9cef807269a1bbcc61207752ea2b
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -122,8 +122,11 @@ function sanitizeHtml(html, options) { result += ' ' + a; if (value.length) { // Values are ALREADY escaped, calling escapeHtml here - // results in double escapes - result += '="' + value + '"'; + // results in double escapes. + // However, a bug in the HTML parser allows you to use malformed + // markup to slip unescaped quotes through, so we strip them explicitly. + // @see https://github.com/punkave/sanitize-html/issues/19 + result += '="' + value.replace(/"/g, '&quot;') + '"'; } } });
Strip any unescaped double-quotes from output
punkave_sanitize-html
train
js
864403db8e953fe09cd1f8493b477c685cbeb136
diff --git a/src/main/java/org/jboss/pressgang/ccms/filter/builder/TopicFilterQueryBuilder.java b/src/main/java/org/jboss/pressgang/ccms/filter/builder/TopicFilterQueryBuilder.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jboss/pressgang/ccms/filter/builder/TopicFilterQueryBuilder.java +++ b/src/main/java/org/jboss/pressgang/ccms/filter/builder/TopicFilterQueryBuilder.java @@ -224,7 +224,7 @@ public class TopicFilterQueryBuilder extends BaseTopicFilterQueryBuilder<Topic> } } - if (matches / Constants.NUM_MIN_HASHES >= fixedThreshold) { + if ((float)matches / Constants.NUM_MIN_HASHES >= fixedThreshold) { matchingTopics.add(topic.getId()); } }
Added the ability to search for an equal min hash
pressgang-ccms_PressGangCCMSQuery
train
java
06003f531a2f67b5bd98c7705da14f04bcfa2bb2
diff --git a/test/test.py b/test/test.py index <HASH>..<HASH> 100755 --- a/test/test.py +++ b/test/test.py @@ -175,6 +175,7 @@ class TestTropoPython(unittest.TestCase): url = "/receive_recording.py" choices_obj = Choices("", terminator="#").json tropo.record(say="Tell us about yourself", url=url, + promptLogSecurity="suppree", choices=choices_obj) rendered = tropo.RenderJson() pretty_rendered = tropo.RenderJson(pretty=True) @@ -183,7 +184,7 @@ class TestTropoPython(unittest.TestCase): # print "test_record: %s" % tropo.RenderJson() rendered_obj = jsonlib.loads(rendered) - wanted_json = ' {"tropo": [{"record": {"url": "/receive_recording.py", "say": {"value": "Tell us about yourself"}, "choices": {"terminator": "#", "value": ""}}}]}' + wanted_json = ' {"tropo": [{"record": {"url": "/receive_recording.py", "promptLogSecurity": "suppree", "say": {"value": "Tell us about yourself"}, "choices": {"terminator": "#", "value": ""}}}]}' wanted_obj = jsonlib.loads(wanted_json) self.assertEqual(rendered_obj, wanted_obj)
Add unittest for improvement/TROPO-<I>-record
tropo_tropo-webapi-python
train
py
11404ecc4fdeffc87cbfac86e55b3868437f9398
diff --git a/fundamentals/mysql/convert_dictionary_to_mysql_table.py b/fundamentals/mysql/convert_dictionary_to_mysql_table.py index <HASH>..<HASH> 100644 --- a/fundamentals/mysql/convert_dictionary_to_mysql_table.py +++ b/fundamentals/mysql/convert_dictionary_to_mysql_table.py @@ -461,7 +461,7 @@ def convert_dictionary_to_mysql_table( dup = """%(dup)s `%(k)s`=%(v)s AND """ % locals() dup = dup[:-5] + ", dateLastModified, NOW())" else: - dup = dup[:-1] + ")" + dup = dup[:-1] # log.debug(myValues+" ------ POSTSTRIP") addValue = insertVerb + """ INTO `""" + dbTableName + \
testing moving updates to insert into list of dictionaries into database
thespacedoctor_fundamentals
train
py
dfd69be6ea17c09e5bab7dc7c8e673aea7cc76cf
diff --git a/will/settings.py b/will/settings.py index <HASH>..<HASH> 100644 --- a/will/settings.py +++ b/will/settings.py @@ -28,6 +28,10 @@ def import_settings(quiet=True): if "PLUGINS" in settings: settings["PLUGINS"] = settings["PLUGINS"].split(";") + if 'PLUGIN_BLACKLIST' in settings: + settings["PLUGIN_BLACKLIST"] = (settings["PLUGIN_BLACKLIST"].split(";") + if settings["PLUGIN_BLACKLIST"] else []) + # If HIPCHAT_SERVER is set, we need to change the USERNAME slightly # for XMPP to work. if "HIPCHAT_SERVER" in settings:
Allow setting of plugin list from WILL_PLUGIN_BLACKLIST environment variable
skoczen_will
train
py
7f0397e98cf775956d6c65582f03c5dcd1d18844
diff --git a/test/level2/html.js b/test/level2/html.js index <HASH>..<HASH> 100644 --- a/test/level2/html.js +++ b/test/level2/html.js @@ -2637,6 +2637,11 @@ exports.tests = { vcookie = doc.cookie; test.equal(vcookie, "key3=value3; key4=value4", "cookieLink"); + var ret = doc.cookie = null; + test.equal(ret, null, "cookieLink"); + test.equal(doc.cookie, vcookie, "cookieLink"); + + test.done(); },
Test that doc.cookie = null returns null and has no effect
jsdom_jsdom
train
js
b290cf9578eb98e09df101a164b421cc1fc06c88
diff --git a/driver/src/main/org/mongodb/impl/MongoCollectionImpl.java b/driver/src/main/org/mongodb/impl/MongoCollectionImpl.java index <HASH>..<HASH> 100644 --- a/driver/src/main/org/mongodb/impl/MongoCollectionImpl.java +++ b/driver/src/main/org/mongodb/impl/MongoCollectionImpl.java @@ -116,10 +116,10 @@ class MongoCollectionImpl<T> extends MongoCollectionBaseImpl<T> implements Mongo public UpdateResult save(final MongoSave<T> save) { Object id = serializer.getId(save.getDocument()); if (id == null) { - return insert(new MongoInsert<T>(save.getDocument())); + return insert(new MongoInsert<T>(save.getDocument()).writeConcern(save.getWriteConcern())); } else { - return replace(new MongoReplace<T>(new QueryFilterDocument("_id", id), save.getDocument()).isUpsert(true)); + return replace(new MongoReplace<T>(new QueryFilterDocument("_id", id), save.getDocument()).isUpsert(true).writeConcern(save.getWriteConcern())); } }
Propagating writeConcern in save
mongodb_mongo-java-driver
train
java
fc32f8924d3675de57c2ede2d479f2a631b06995
diff --git a/lib/quickbooks/service/base_service.rb b/lib/quickbooks/service/base_service.rb index <HASH>..<HASH> 100644 --- a/lib/quickbooks/service/base_service.rb +++ b/lib/quickbooks/service/base_service.rb @@ -242,12 +242,23 @@ module Quickbooks unless headers.has_key?('Content-Type') headers.merge!({'Content-Type' => HTTP_CONTENT_TYPE}) end - # log "------ New Request ------" - # log "METHOD = #{method}" - # log "RESOURCE = #{url}" - # log "BODY(#{body.class}) = #{body == nil ? "<NIL>" : body.inspect}" - # log "HEADERS = #{headers.inspect}" - response = @oauth.request(method, url, body, headers) + unless headers.has_key?('Accept') + headers.merge!({'Accept' => HTTP_ACCEPT}) + end + + log "METHOD = #{method}" + log "RESOURCE = #{url}" + log "BODY(#{body.class}) = #{body == nil ? "<NIL>" : body.inspect}" + log "HEADERS = #{headers.inspect}" + + response = case method + when :get + @oauth.get(url, headers) + when :post + @oauth.post(url, body, headers) + else + raise "Dont know how to perform that HTTP operation" + end check_response(response) end
be smarter about calling the correct HTTP verb
ruckus_quickbooks-ruby
train
rb
5eb0d5be8c8d16390279791778403a7f2b1c556d
diff --git a/lib/active_admin/view_helpers/filter_form_helper.rb b/lib/active_admin/view_helpers/filter_form_helper.rb index <HASH>..<HASH> 100644 --- a/lib/active_admin/view_helpers/filter_form_helper.rb +++ b/lib/active_admin/view_helpers/filter_form_helper.rb @@ -155,7 +155,7 @@ module ActiveAdmin end if reflection = reflection_for(method) - return :select if reflection.macro == :belongs_to && reflection.collection? + return :select if reflection.macro == :belongs_to && !reflection.options[:polymorphic] end end
Fix for specs. Filter forms shouldn't display polymorphic belongs_to
activeadmin_activeadmin
train
rb
5ee897889b77689dd7f2271f5cffd13e4dfada86
diff --git a/lib/collection/url.js b/lib/collection/url.js index <HASH>..<HASH> 100644 --- a/lib/collection/url.js +++ b/lib/collection/url.js @@ -91,8 +91,7 @@ _.extend(Url.prototype, /** @lends Url.prototype */ { /** * @type {PropertyList<QueryParam>} */ - query: query ? - new PropertyList(QueryParam, this, query) : new PropertyList(QueryParam, this, []), + query: new PropertyList(QueryParam, this, query || []), /** * @type {VariableList} */ @@ -207,8 +206,7 @@ _.extend(Url.prototype, /** @lends Url.prototype */ { */ getQueryString: function (options) { if (this.query.count()) { - return PropertyList.isPropertyList(this.query) ? - QueryParam.unparse(this.query.all(), options) : this.query.toString(); + return QueryParam.unparse(this.query.all(), options); } return ''; },
Fixed dead code and throwback logic in URL constructor and query param getter.
postmanlabs_postman-collection
train
js
85fa7ee01a34bb93a6b9534c35a8ae243a3fe72a
diff --git a/path.py b/path.py index <HASH>..<HASH> 100644 --- a/path.py +++ b/path.py @@ -1665,6 +1665,10 @@ class TempDir(Path): self.rmtree() +# For backwards compatibility. +tempdir = TempDir + + def _multi_permission_mask(mode): """ Support multiple, comma-separated Unix chmod symbolic modes.
Add tempdir name for backwards compatibility. tempdir is just an alias to TempDir.
jaraco_path.py
train
py
46bb04cec42c325f362d523a9643bbcac8233e49
diff --git a/lib/db.js b/lib/db.js index <HASH>..<HASH> 100644 --- a/lib/db.js +++ b/lib/db.js @@ -44,7 +44,7 @@ exports.db_setup = function(app, db, next) { if (typeof values != 'function') _sql = app.db.format(sql, values); console.log('SQL query:', _sql); - return _query(sql, values, callback); + return _query.call(this, sql, values, callback); }; } next();
small fix to mysql interface
defeo_was_framework
train
js
384cf58f5ee83aea8ff8dbd215645c2ac08c1a21
diff --git a/src/main/java/com/github/alexcojocaru/mojo/elasticsearch/ElasticSearchNode.java b/src/main/java/com/github/alexcojocaru/mojo/elasticsearch/ElasticSearchNode.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/github/alexcojocaru/mojo/elasticsearch/ElasticSearchNode.java +++ b/src/main/java/com/github/alexcojocaru/mojo/elasticsearch/ElasticSearchNode.java @@ -39,6 +39,7 @@ public class ElasticSearchNode .put("network.host", "127.0.0.1") .put("discovery.zen.ping.timeout", "3ms") .put("discovery.zen.ping.multicast.enabled", false) + .put("http.cors.enabled", true) .put(settings) .build();
enable HTTP CORS on the local node, to allow web plugins to talk to it see <URL>
alexcojocaru_elasticsearch-maven-plugin
train
java
f1d2dd485392b5727b7fddd23ea3a5f6ff27e8fc
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ setup( 'test': [ 'nose', 'flake8', - 'openfisca-country-template == 1.2.2', + 'openfisca-country-template >= 1.2.3rc0, <= 1.2.3', 'openfisca-extension-template == 1.1.0', ], },
Update requirement for openfisca-country-template
openfisca_openfisca-core
train
py
a42604eb6269feefeb18b3a3fc4947801d12836a
diff --git a/lib/raven/processor/sanitizedata.rb b/lib/raven/processor/sanitizedata.rb index <HASH>..<HASH> 100644 --- a/lib/raven/processor/sanitizedata.rb +++ b/lib/raven/processor/sanitizedata.rb @@ -37,7 +37,7 @@ module Raven end def fields_re - @fields_re ||= /(#{(DEFAULT_FIELDS + @sanitize_fields).join("|")})/i + @fields_re ||= /(#{(DEFAULT_FIELDS | @sanitize_fields).join("|")})/i end end end diff --git a/spec/raven/configuration_spec.rb b/spec/raven/configuration_spec.rb index <HASH>..<HASH> 100644 --- a/spec/raven/configuration_spec.rb +++ b/spec/raven/configuration_spec.rb @@ -130,4 +130,16 @@ describe Raven::Configuration do end end + context 'configuration for sanitize fields' do + it 'should union default sanitize fields with user-defined sanitize fields' do + fields = Raven::Processor::SanitizeData::DEFAULT_FIELDS | %w(test monkeybutt) + + subject.sanitize_fields = fields + client = Raven::Client.new(subject) + processor = Raven::Processor::SanitizeData.new(client) + + expect(processor.send(:fields_re)).to eq(/(#{fields.join('|')})/i) + end + end + end
union instead of concatenation, because duplicate fields
getsentry_raven-ruby
train
rb,rb
894e3716bb3b0c49dccb29e868fc82b974af128f
diff --git a/Lib/fontbakery/specifications/googlefonts.py b/Lib/fontbakery/specifications/googlefonts.py index <HASH>..<HASH> 100644 --- a/Lib/fontbakery/specifications/googlefonts.py +++ b/Lib/fontbakery/specifications/googlefonts.py @@ -2,8 +2,7 @@ from __future__ import absolute_import, print_function, unicode_literals from fontbakery.testrunner import ( - DEBUG - , INFO + INFO , WARN , ERROR , SKIP @@ -13,17 +12,16 @@ from fontbakery.testrunner import ( , Spec ) import os -from fontbakery.utils import assertExists from fontbakery.callable import condition, test from fontbakery.constants import( # TODO: priority levels are not yet part of the new runner/reporters. # How did we ever use this information? # Check priority levels: - TRIVIAL - , LOW - , NORMAL + CRITICAL , IMPORTANT - , CRITICAL +# , NORMAL +# , LOW +# , TRIVIAL , NAMEID_DESCRIPTION , NAMEID_LICENSE_DESCRIPTION
remove a few unused imports (issue #<I>)
googlefonts_fontbakery
train
py
36773db3c9d8bdacaf1b9e3f4c0da3dc4283acaa
diff --git a/src/createReduxForm.js b/src/createReduxForm.js index <HASH>..<HASH> 100755 --- a/src/createReduxForm.js +++ b/src/createReduxForm.js @@ -526,6 +526,18 @@ const createReduxForm = (structure: Structure<*, *>) => { ) } + componentDidMount() { + if (!isHotReloading()) { + this.initIfNeeded() + this.validateIfNeeded() + this.warnIfNeeded() + } + invariant( + this.props.shouldValidate, + 'shouldValidate() is deprecated and will be removed in v8.0.0. Use shouldWarn() or shouldError() instead.' + ) + } + componentWillUnmount() { const { destroyOnUnmount, destroy } = this.props if (destroyOnUnmount && !isHotReloading()) {
initialize in componentDidMount as well (#<I>) React <I> ensures a certain order of lifcecycles when replacing a component which causes redux-form to destroy the form, breaking it. This change, when used with `enableReinitialize`, causes the form to reinitialize correctly, preserving the form.
erikras_redux-form
train
js
8827dee084aa0a7d781ef9b0febed457fe3bc70a
diff --git a/api/client.go b/api/client.go index <HASH>..<HASH> 100644 --- a/api/client.go +++ b/api/client.go @@ -108,6 +108,7 @@ func (c *Client) isOkStatus(code int) bool { 411: false, 413: false, 415: false, + 423: false, 500: false, 503: false, } @@ -257,7 +258,7 @@ func (c *retryableHTTPClient) Do(req *request) (*http.Response, error) { } res, err := c.Client.Do(req.Request) - if res != nil && res.StatusCode != 503 { + if res != nil && res.StatusCode != 503 && res.StatusCode != 423 { return res, err } if res != nil && res.Body != nil {
Handling <I>-locked response
sacloud_libsacloud
train
go
23cef3d79ba2711cf4f2e18a9564760ce696c0af
diff --git a/hearthstone/entities.py b/hearthstone/entities.py index <HASH>..<HASH> 100644 --- a/hearthstone/entities.py +++ b/hearthstone/entities.py @@ -75,6 +75,8 @@ class Game(Entity): self.initial_entities.append(entity) def find_entity_by_id(self, id): + # int() for LazyPlayer mainly... + id = int(id) for entity in self.entities: if entity.id == id: return entity
entities: Always int-ify the argument to Game.find_entity_by_id()
HearthSim_python-hearthstone
train
py
7b537f225077f2c840bd73ad81b145674945b468
diff --git a/test/src/net/lshift/javax/xml/DocumentHelperTest.java b/test/src/net/lshift/javax/xml/DocumentHelperTest.java index <HASH>..<HASH> 100644 --- a/test/src/net/lshift/javax/xml/DocumentHelperTest.java +++ b/test/src/net/lshift/javax/xml/DocumentHelperTest.java @@ -13,7 +13,7 @@ public class DocumentHelperTest extends TestCase { public static void testXmlCopy() throws ParserConfigurationException, TransformerException { - String expected = "notthesame"; + String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><foo/>"; Element root = DocumentHelper.newDocumentRoot("foo"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); DocumentHelper.xmlCopy(root.getOwnerDocument(), baos);
bug <I>: test now works. However, it's not entirely reliable - correct code could fail this test.
lshift_jamume
train
java
d58d6d811f5e62d4e4aaeb0a056dc76a8c9132de
diff --git a/app/jobs/cangaroo/job.rb b/app/jobs/cangaroo/job.rb index <HASH>..<HASH> 100644 --- a/app/jobs/cangaroo/job.rb +++ b/app/jobs/cangaroo/job.rb @@ -7,6 +7,7 @@ module Cangaroo class_configuration :connection class_configuration :path, '' class_configuration :parameters, {} + class_configuration :process_response, true def perform(*) restart_flow(connection_request) @@ -31,6 +32,10 @@ module Cangaroo # if no json was returned, the response should be discarded return if response.blank? + unless self.process_response + return + end + PerformFlow.call( source_connection: destination_connection, json_body: response.to_json,
Adding option to stop reprocessing of jobs
nebulab_cangaroo
train
rb
8ca8523328ad4931a5d317b533994489cb52271c
diff --git a/packages/vx-shape/src/util/stackOrder.js b/packages/vx-shape/src/util/stackOrder.js index <HASH>..<HASH> 100644 --- a/packages/vx-shape/src/util/stackOrder.js +++ b/packages/vx-shape/src/util/stackOrder.js @@ -8,7 +8,7 @@ import { export const STACK_ORDERS = { ascending: stackOrderAscending, - descrending: stackOrderDescending, + descending: stackOrderDescending, insideout: stackOrderInsideOut, none: stackOrderNone, reverse: stackOrderReverse,
Typo in stack order enum descrending => descending
hshoff_vx
train
js
cc375835badb36848554ba547d333740e0e32831
diff --git a/src/Illuminate/Foundation/Channels/SmsChannel.php b/src/Illuminate/Foundation/Channels/SmsChannel.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Foundation/Channels/SmsChannel.php +++ b/src/Illuminate/Foundation/Channels/SmsChannel.php @@ -18,7 +18,7 @@ class SmsChannel public function send($notifiable, Notification $notification) { $message = collect($notification->toSms($notifiable)); - $sms = new EasySms(config('app.easysms')); + $sms = new EasySms(config('easysms')); if (! ($message->has('content') && $message->has('template') && $message->has('data') && $message->has('phone'))) { throw new GeneralException('短信消息实体必须带有 `content`, `template`, `data`, `phone` 字段。'); }
change sms configs.
larawos_framework
train
php
55ca788efef4e2a0c1b3ca7c1d0bf111662d94fb
diff --git a/etcdctl/ctlv3/ctl.go b/etcdctl/ctlv3/ctl.go index <HASH>..<HASH> 100644 --- a/etcdctl/ctlv3/ctl.go +++ b/etcdctl/ctlv3/ctl.go @@ -43,7 +43,7 @@ var ( ) func init() { - rootCmd.PersistentFlags().StringSliceVar(&globalFlags.Endpoints, "endpoints", []string{"127.0.0.1:2379", "127.0.0.1:22379", "127.0.0.1:32379"}, "gRPC endpoints") + rootCmd.PersistentFlags().StringSliceVar(&globalFlags.Endpoints, "endpoints", []string{"127.0.0.1:2379"}, "gRPC endpoints") rootCmd.PersistentFlags().StringVarP(&globalFlags.OutputFormat, "write-out", "w", "simple", "set the output format (simple, json, etc..)") rootCmd.PersistentFlags().BoolVar(&globalFlags.IsHex, "hex", false, "print byte strings as hex encoded strings")
etcdctl: only takes <I>:<I> as default endpoint
etcd-io_etcd
train
go
ba9d56d9c73873f1fea3d68c2f2bb231aee97e45
diff --git a/plugins/CoreVisualizations/Visualizations/Cloud.php b/plugins/CoreVisualizations/Visualizations/Cloud.php index <HASH>..<HASH> 100644 --- a/plugins/CoreVisualizations/Visualizations/Cloud.php +++ b/plugins/CoreVisualizations/Visualizations/Cloud.php @@ -49,7 +49,7 @@ class Cloud extends Visualization protected $wordsArray = array(); public $truncatingLimit = 50; - public function afterAllFilteresAreApplied(DataTableInterface $dataTable, Config $properties, Request $request) + public function afterAllFilteresAreApplied(DataTable $dataTable, Config $properties, Request $request) { if ($dataTable->getRowsCount() == 0) { return;
cloud works only with DataTable not with a map
matomo-org_matomo
train
php
35ea991b541f7d15865e30e02388941220e09db3
diff --git a/aeron-archive/src/test/java/io/aeron/archive/ArchiveTest.java b/aeron-archive/src/test/java/io/aeron/archive/ArchiveTest.java index <HASH>..<HASH> 100644 --- a/aeron-archive/src/test/java/io/aeron/archive/ArchiveTest.java +++ b/aeron-archive/src/test/java/io/aeron/archive/ArchiveTest.java @@ -73,25 +73,26 @@ public class ArchiveTest final AeronArchive archive = AeronArchive.connect(ctx); archiveClientQueue.add(archive); - archive.getRecordingPosition(0L); + final long position = archive.getRecordingPosition(0L); latch.countDown(); + + assertEquals(AeronArchive.NULL_POSITION, position); }); } latch.await(driver.archive().context().connectTimeoutNs() * 2, TimeUnit.NANOSECONDS); - assertThat(latch.getCount(), is(0L)); - } - finally - { - executor.shutdownNow(); - AeronArchive archiveClient; while (null != (archiveClient = archiveClientQueue.poll())) { archiveClient.close(); } + assertThat(latch.getCount(), is(0L)); + } + finally + { + executor.shutdownNow(); archiveCtx.deleteArchiveDirectory(); driverCtx.deleteAeronDirectory(); }
[Java] Test should shutdown client before driver to avoid stale data.
real-logic_aeron
train
java
c50be10f739b7b38070e89c40c0bbf9b16d589fe
diff --git a/examples/server/server.py b/examples/server/server.py index <HASH>..<HASH> 100644 --- a/examples/server/server.py +++ b/examples/server/server.py @@ -11,14 +11,13 @@ from aiortc import RTCPeerConnection, RTCSessionDescription from aiortc.mediastreams import (AudioFrame, AudioStreamTrack, VideoFrame, VideoStreamTrack) -PTIME = 0.02 ROOT = os.path.dirname(__file__) -async def pause(last): +async def pause(last, ptime): if last: now = time.time() - await asyncio.sleep(last + PTIME - now) + await asyncio.sleep(last + ptime - now) return time.time() @@ -28,7 +27,7 @@ class AudioFileTrack(AudioStreamTrack): self.reader = wave.Wave_read(path) async def recv(self): - self.last = await pause(self.last) + self.last = await pause(self.last, 0.02) return AudioFrame( channels=self.reader.getnchannels(), data=self.reader.readframes(160), @@ -47,7 +46,7 @@ class VideoDummyTrack(VideoStreamTrack): self.last = None async def recv(self): - self.last = await pause(self.last) + self.last = await pause(self.last, 0.04) self.counter += 1 if (self.counter % 100) < 50: return self.frame_green
[examples] reduce video frame rate
aiortc_aiortc
train
py
664e121b7e6e242b115f1d13a508364ee2021bc4
diff --git a/lib/offsite_payments/integrations/quickpay.rb b/lib/offsite_payments/integrations/quickpay.rb index <HASH>..<HASH> 100644 --- a/lib/offsite_payments/integrations/quickpay.rb +++ b/lib/offsite_payments/integrations/quickpay.rb @@ -5,7 +5,7 @@ module OffsitePayments #:nodoc: self.service_url = 'https://secure.quickpay.dk/form/' def self.notification(post, options = {}) - Notification.new(post) + Notification.new(post, options) end def self.return(post, options = {}) @@ -196,8 +196,6 @@ module OffsitePayments #:nodoc: Digest::MD5.hexdigest(generate_md5string) end - # Quickpay doesn't do acknowledgements of callback notifications - # Instead it uses and MD5 hash of all parameters def acknowledge(authcode = nil) generate_md5check == params['md5check'] end
Must check params with MD5secret from options.
activemerchant_offsite_payments
train
rb
0300fc1c31634afcd327484978b9b30eb6ba8838
diff --git a/cake/libs/view/media.php b/cake/libs/view/media.php index <HASH>..<HASH> 100644 --- a/cake/libs/view/media.php +++ b/cake/libs/view/media.php @@ -208,7 +208,11 @@ class MediaView extends View { $this->_output(); $this->_clearBuffer(); - while (!feof($handle) && $this->_isActive()) { + while (!feof($handle)) { + if (!$this->_isActive()) { + fclose($handle); + return false; + } set_time_limit(0); $buffer = fread($handle, $chunkSize); echo $buffer; @@ -253,7 +257,7 @@ class MediaView extends View { } /** - * Returns true if connectios is still active + * Returns true if connection is still active * @return boolean * @access protected */ diff --git a/cake/tests/cases/libs/view/media.test.php b/cake/tests/cases/libs/view/media.test.php index <HASH>..<HASH> 100644 --- a/cake/tests/cases/libs/view/media.test.php +++ b/cake/tests/cases/libs/view/media.test.php @@ -73,7 +73,7 @@ class TestMediaView extends MediaView { var $headers = array(); /** - * active property to mock the status of a remote conenction + * active property to mock the status of a remote connection * * @var boolean true * @access public
If connection is aborted, now MediaView returns false after stopping the transfer
cakephp_cakephp
train
php,php
eef1ebabd1c7d8e5689d20df5c6201d7560f5c17
diff --git a/src/HttpRouter.php b/src/HttpRouter.php index <HASH>..<HASH> 100644 --- a/src/HttpRouter.php +++ b/src/HttpRouter.php @@ -73,4 +73,4 @@ class HttpRouter implements HttpRouterInterface array("X-Reason" => "no module for path"), $request->closeConnection()); } } -} \ No newline at end of file +} diff --git a/src/HttpRouterInterface.php b/src/HttpRouterInterface.php index <HASH>..<HASH> 100644 --- a/src/HttpRouterInterface.php +++ b/src/HttpRouterInterface.php @@ -32,4 +32,4 @@ interface HttpRouterInterface * @throws HttpException */ public function handleClientRequest(StreamServerNodeInterface $client); -} \ No newline at end of file +}
Added \n to the last line of every file (to conform with POSIX: <URL>)
kiler129_CherryHttp
train
php,php
767f39717ca2cc03a6408bbd53fe037c6561c75d
diff --git a/internal/core/command/device.go b/internal/core/command/device.go index <HASH>..<HASH> 100644 --- a/internal/core/command/device.go +++ b/internal/core/command/device.go @@ -45,7 +45,7 @@ func commandByDeviceID(did string, cid string, b string, p bool) (string, int) { } } - if p && (d.AdminState == models.Locked) { + if d.AdminState == models.Locked { LoggingClient.Error(d.Name + " is in admin locked state") return "", http.StatusLocked
#<I> Return HTTP <I> LOCKED when issuing a GET command to a locked device
edgexfoundry_edgex-go
train
go
052f0449e7b938c881f814246096dc97cce86527
diff --git a/src/Process.php b/src/Process.php index <HASH>..<HASH> 100644 --- a/src/Process.php +++ b/src/Process.php @@ -45,8 +45,7 @@ class Process extends EventEmitter * @param string $cwd Current working directory or null to inherit * @param array $env Environment variables or null to inherit * @param array $options Options for proc_open() - * @throws LogicException On windows - * @throws RuntimeException When proc_open() is not installed + * @throws LogicException On windows or when proc_open() is not installed */ public function __construct($cmd, $cwd = null, array $env = null, array $options = array()) { @@ -55,7 +54,7 @@ class Process extends EventEmitter } if (!function_exists('proc_open')) { - throw new \RuntimeException('The Process class relies on proc_open(), which is not available on your PHP installation.'); + throw new \LogicException('The Process class relies on proc_open(), which is not available on your PHP installation.'); } $this->cmd = $cmd;
Throw LogicException when proc_open() is not installed
reactphp_child-process
train
php
dc887c57cf98c2063abfa555966802ca7eb80fc8
diff --git a/lib/dalli/client.rb b/lib/dalli/client.rb index <HASH>..<HASH> 100644 --- a/lib/dalli/client.rb +++ b/lib/dalli/client.rb @@ -108,7 +108,6 @@ module Dalli # - false if the value was changed by someone else. # - true if the value was successfully updated. def cas(key, ttl=nil, options=nil) - ttl = ttl_or_default(ttl) (value, cas) = perform(:cas, key) value = (!value || value == 'Not found') ? nil : value if value diff --git a/lib/dalli/server.rb b/lib/dalli/server.rb index <HASH>..<HASH> 100644 --- a/lib/dalli/server.rb +++ b/lib/dalli/server.rb @@ -486,7 +486,7 @@ module Dalli def sanitize_ttl(ttl) ttl_as_i = ttl.to_i return ttl_as_i if ttl_as_i <= MAX_ACCEPTABLE_EXPIRATION_INTERVAL - Dalli.logger.debug "Expiration interval (ttl_as_i) too long for Memcached, converting to an expiration timestamp" + Dalli.logger.debug "Expiration interval (#{ttl_as_i}) too long for Memcached, converting to an expiration timestamp" Time.now.to_i + ttl_as_i end
Fix a couple of minor errors in my last PR
petergoldstein_dalli
train
rb,rb
197b02e9c7044b51f9075a2a59fe7ef91d786cd3
diff --git a/escpos/impl/epson.py b/escpos/impl/epson.py index <HASH>..<HASH> 100644 --- a/escpos/impl/epson.py +++ b/escpos/impl/epson.py @@ -185,7 +185,7 @@ class GenericESCPOS(object): for char in bytearray(unicode_text, 'cp1251'): printer.device.write(chr(char)) """ - if 0 <= code_page <= 255: + if not 0 <= code_page <= 255: raise ValueError('Number between 0 and 255 expected.') self.device.write('\x1B\x74' + chr(code_page))
Impl: Epson: Fixed bad logic when testing code page validity.
base4sistemas_pyescpos
train
py
64e2bb1b89b8ee93ace6a800b0f05fe318be0d8d
diff --git a/AegeanTools/BANE.py b/AegeanTools/BANE.py index <HASH>..<HASH> 100755 --- a/AegeanTools/BANE.py +++ b/AegeanTools/BANE.py @@ -370,14 +370,14 @@ def filter_image(im_name, out_base, step_size=None, box_size=None, twopass=False Parameters ---------- - im_name : str or HDUList - Image to filter. Either a string filename or an astropy.io.fits.HDUList. + im_name : str + Image to filter. out_base : str The output filename base. Will be modified to make _bkg and _rms files. step_size : (int,int) Tuple of the x,y step size in pixels box_size : (int,int) - The size of the box in piexls + The size of the box in pixels twopass : bool Perform a second pass calculation to ensure that the noise is not contaminated by the background. Default = False
update docstring to be correct resolves #<I>
PaulHancock_Aegean
train
py
7c17fbce76580590cfbd2623f0193dd9cb2963ce
diff --git a/scriptblock.js b/scriptblock.js index <HASH>..<HASH> 100644 --- a/scriptblock.js +++ b/scriptblock.js @@ -33,6 +33,22 @@ ScriptblockPlugin.prototype.disable = function() { }; ScriptblockPlugin.prototype.interact = function(target) { - console.log(target); - // TODO: prompt for script, set at x,y,z + var x = target.voxel[0]; + var y = target.voxel[1]; + var z = target.voxel[2]; + + var bd = this.blockdata.get(x, y, z); + if (!bd) { + bd = {script: 'alert("Hello, voxel world!")'}; + } + + // interact (right-click) with top to set script, other sides to run + // TODO: run script when block takes damage instead (left-click) + if (target.side === 'top') { + bd.script = prompt("Script for block at ("+[x,y,z].join(",")+"): ", bd.script); + + this.blockdata.set(x, y, z, bd); + } else { + eval(bd.script); + } };
Set script in blockdata when interact with top, run when interact on other sides
voxel_voxel-scriptblock
train
js
eb32dd2da2605dd6d07b91bbf2ad4df662f1a1aa
diff --git a/source/application/models/oxorder.php b/source/application/models/oxorder.php index <HASH>..<HASH> 100644 --- a/source/application/models/oxorder.php +++ b/source/application/models/oxorder.php @@ -350,13 +350,13 @@ class oxOrder extends oxBase /** * Order article list setter * - * @param object $aOrderArticleList order article list + * @param oxOrderArticleList $oOrderArticleList * * @return null */ - public function setOrderArticleList( $aOrderArticleList ) + public function setOrderArticleList( $oOrderArticleList ) { - $this->_oArticles = $aOrderArticleList; + $this->_oArticles = $oOrderArticleList; } /**
Changed comment and variable name in setOrderArticleList() (cherry picked from commit <I>b8ff) (cherry picked from commit <I>a<I>c6)
OXID-eSales_oxideshop_ce
train
php
1340beaf6dc73930b1c89ec95d89d759d8701fef
diff --git a/pydoop/hdfs/core/bridged/hadoop.py b/pydoop/hdfs/core/bridged/hadoop.py index <HASH>..<HASH> 100644 --- a/pydoop/hdfs/core/bridged/hadoop.py +++ b/pydoop/hdfs/core/bridged/hadoop.py @@ -246,7 +246,7 @@ class CoreHdfsFs(CoreFsApi): else: boolean_overwrite = True if not blocksize: - blocksize = self._fs.getDefaultBlockSize(jpath) + blocksize = self.get_default_block_size() stream = self._fs.create( jpath, boolean_overwrite, buff_size, replication, blocksize )
defaultBlockSize in hadoop.open_file(..) is now obtained using hadoop.get_default_block_size() method
crs4_pydoop
train
py
5efc439231daa809612b062205b4148b50bc7ed1
diff --git a/backbone-firebase.js b/backbone-firebase.js index <HASH>..<HASH> 100644 --- a/backbone-firebase.js +++ b/backbone-firebase.js @@ -210,6 +210,9 @@ Backbone.Firebase.Collection = Backbone.Collection.extend({ add: function(models, options) { var parsed = this._parseModels(models); + options = options ? _.clone(options) : {}; + options.success = _.isFunction(options.success) ? options.success : function() {}; + for (var i = 0; i < parsed.length; i++) { var model = parsed[i]; this.firebase.ref().child(model.id).set(model, _.bind(options.success, model)); @@ -218,6 +221,9 @@ Backbone.Firebase.Collection = Backbone.Collection.extend({ remove: function(models, options) { var parsed = this._parseModels(models); + options = options ? _.clone(options) : {}; + options.success = _.isFunction(options.success) ? options.success : function() {}; + for (var i = 0; i < parsed.length; i++) { var model = parsed[i]; this.firebase.ref().child(model.id).set(null, _.bind(options.success, model));
check for the existence of options and options.success
googlearchive_backbonefire
train
js
cf02b7e65c29f862bf410702f56e8b2f9460b0bf
diff --git a/src/edu/jhu/hltcoe/model/dmv/DmvDepTreeGenerator.java b/src/edu/jhu/hltcoe/model/dmv/DmvDepTreeGenerator.java index <HASH>..<HASH> 100644 --- a/src/edu/jhu/hltcoe/model/dmv/DmvDepTreeGenerator.java +++ b/src/edu/jhu/hltcoe/model/dmv/DmvDepTreeGenerator.java @@ -34,7 +34,9 @@ public class DmvDepTreeGenerator { } private void recursivelyGenerate(ProjDepTreeNode parent) { - sampleChildren(parent, "l"); + if (!parent.isWall()) { + sampleChildren(parent, "l"); + } sampleChildren(parent, "r"); // Recurse on each child
Bug fix: generating to left of wall git-svn-id: svn+ssh://external.hltcoe.jhu.edu/home/hltcoe/mgormley/public/repos/dep_parse_filtered/trunk@<I> <I>f-cb4b-<I>-8b<I>-c<I>bcb<I>
mgormley_pacaya
train
java
df39fc864d75ee3155775933af589d2bac9c528b
diff --git a/src/RuleCollection.php b/src/RuleCollection.php index <HASH>..<HASH> 100644 --- a/src/RuleCollection.php +++ b/src/RuleCollection.php @@ -118,21 +118,26 @@ class RuleCollection public function __construct(RuleLocator $rule_locator) { $this->rule_locator = $rule_locator; + $this->init(); } - public function __invoke(&$data) + public function __invoke(&$subject) { - if ($this->values($data)) { + if ($this->values($subject)) { return true; } - $message = 'array'; - $e = new Exception\FilterFailed($message); + $e = new Exception\FilterFailed(get_class($this)); $e->setFilterMessages($this->getMessages()); - $e->setFilterSubject($data); + $e->setFilterSubject($subject); throw $e; } + protected function init() + { + // by default do nothing + } + /** * * Sets a single rule, encapsulated by a closure, for the rule.
add init() method for self-initialization if needed
auraphp_Aura.Filter
train
php
4687e30bdd8bf5dd19f0002cf4837cb42c78c618
diff --git a/pyroma/projectdata.py b/pyroma/projectdata.py index <HASH>..<HASH> 100644 --- a/pyroma/projectdata.py +++ b/pyroma/projectdata.py @@ -2,6 +2,7 @@ import os import re import sys +import logging from collections import defaultdict IMPORTS = re.compile('^import (.*)$|^from (.*?) import .*$', re.MULTILINE) @@ -118,8 +119,9 @@ def get_data(path): metadata = sm.get_data() del sys.modules['setup'] - except ImportError: + except ImportError as e: # Either there is no setup py, or it's broken. + logging.exception(e) metadata = {} # No data found
Print the exception when it can't find setup.py.
regebro_pyroma
train
py
0a33bfa1543ea0c3337b26649f566ca9be6b8c70
diff --git a/lib/premailer-rails3/hook.rb b/lib/premailer-rails3/hook.rb index <HASH>..<HASH> 100644 --- a/lib/premailer-rails3/hook.rb +++ b/lib/premailer-rails3/hook.rb @@ -6,6 +6,7 @@ module PremailerRails html_part = message.body ) premailer = Premailer.new(html_part.body.to_s) + plain_text = message.text_part.try(:body).try(:to_s) # reset the body and add two new bodies with appropriate types message.body = nil @@ -15,8 +16,9 @@ module PremailerRails body premailer.to_inline_css end + plain_text = premailer.to_plain_text if plain_text.blank? message.text_part do - body premailer.to_plain_text + body plain_text end end end
Do not override already rendered plain-text mail
fphilipe_premailer-rails
train
rb
d0c2b9c9d1d601188a5d1a4b87f0bdf2dd447adf
diff --git a/cake/tests/cases/libs/model/model_delete.test.php b/cake/tests/cases/libs/model/model_delete.test.php index <HASH>..<HASH> 100644 --- a/cake/tests/cases/libs/model/model_delete.test.php +++ b/cake/tests/cases/libs/model/model_delete.test.php @@ -44,7 +44,7 @@ class ModelDeleteTest extends BaseModelTest { array( 'id' => 3, 'syfile_id' => 3, - 'published' => 0, + 'published' => false, 'name' => 'Item 3', 'ItemsPortfolio' => array( 'id' => 3, @@ -54,7 +54,7 @@ class ModelDeleteTest extends BaseModelTest { array( 'id' => 4, 'syfile_id' => 4, - 'published' => 0, + 'published' => false, 'name' => 'Item 4', 'ItemsPortfolio' => array( 'id' => 4, @@ -64,7 +64,7 @@ class ModelDeleteTest extends BaseModelTest { array( 'id' => 5, 'syfile_id' => 5, - 'published' => 0, + 'published' => false, 'name' => 'Item 5', 'ItemsPortfolio' => array( 'id' => 5,
Fixing failing test caused by boolean type changes.
cakephp_cakephp
train
php
b82a6738e3fb2e43738c1f20093e7c5fceb3a830
diff --git a/add-commands.js b/add-commands.js index <HASH>..<HASH> 100644 --- a/add-commands.js +++ b/add-commands.js @@ -1,4 +1,4 @@ // this file is here so it's easy to register the commands -// `import 'cypress-testing-library/add-commands'` +// `import '@testing-library/cypress/add-commands'` // eslint-disable-next-line require('./dist/add-commands')
chore: update comment in add-commands (#<I>)
testing-library_cypress-testing-library
train
js
7e6c9eeb3888a70b95cb05edbef944e8cf949094
diff --git a/test/transports.browser.js b/test/transports.browser.js index <HASH>..<HASH> 100644 --- a/test/transports.browser.js +++ b/test/transports.browser.js @@ -168,7 +168,9 @@ describe('transports', () => { }) }) - it('many writes', (done) => { + it('many writes', function (done) { + this.timeout(10000) + nodeA.dialProtocol(peerB, '/echo/1.0.0', (err, conn) => { expect(err).to.not.exist()
test: increase timeout for many writes
libp2p_js-libp2p
train
js
2f713ac28c92c8f3f22330c3241b06dfc5e86a14
diff --git a/app/assets/javascripts/meurio_ui.js b/app/assets/javascripts/meurio_ui.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/meurio_ui.js +++ b/app/assets/javascripts/meurio_ui.js @@ -3,5 +3,10 @@ $(function(){ $('.meurio_header .meurio_apps').hover(function(e){ $('.other_apps').toggle(); e.stopPropagation(); return false; }); $('.meurio_header .icon-triangle-down').click(function(e){ $('.current_user_links').toggle(); e.stopPropagation(); return false; }); $(document).click(function(){ $('.current_user_links').hide(); }); - $("a.icon-warning").trigger("click"); + + // My Cities warning + if(localStorage.getItem("myCitiesWarning") == undefined){ + $("a.icon-warning").trigger("click"); + localStorage.setItem("myCitiesWarning", true); + } });
[#<I>] add local storage support for MC warning
nossas_meurio_ui
train
js
6abe245eee9c7a513ab4a9e97e9a10fdbf400167
diff --git a/src/Message/Helper/GenericHelper.php b/src/Message/Helper/GenericHelper.php index <HASH>..<HASH> 100644 --- a/src/Message/Helper/GenericHelper.php +++ b/src/Message/Helper/GenericHelper.php @@ -64,7 +64,7 @@ class GenericHelper extends AbstractHelper */ public function removeContentHeadersAndContent(ParentHeaderPart $part) { - foreach (static::$contentHeaders as $header) { + foreach (self::$contentHeaders as $header) { $part->removeHeader($header); } $part->detachContentStream(); @@ -88,7 +88,7 @@ class GenericHelper extends AbstractHelper } else { $this->copyHeader($from, $to, 'Content-Transfer-Encoding'); } - $rem = array_diff(static::$contentHeaders, [ 'Content-Type', 'Content-Transfer-Encoding']); + $rem = array_diff(self::$contentHeaders, [ 'Content-Type', 'Content-Transfer-Encoding']); foreach ($rem as $header) { $this->copyHeader($from, $to, $header); }
Use self:: instead of static:: for private member
zbateson_mail-mime-parser
train
php
d3d19ebb73fe3c1bf96e620df743189c1cefa092
diff --git a/scss/tests/test_files.py b/scss/tests/test_files.py index <HASH>..<HASH> 100644 --- a/scss/tests/test_files.py +++ b/scss/tests/test_files.py @@ -42,7 +42,7 @@ def test_pair_programmatic(scss_file_pair): scss.config.STATIC_ROOT = os.path.join(directory, 'static') try: - compiler = scss.Scss(scss_opts=dict(style='expanded'), search_paths=[include_dir]) + compiler = scss.Scss(scss_opts=dict(style='expanded'), search_paths=[include_dir, directory]) actual = compiler.compile(source) except Exception: if pytest_trigger is pytest.xfail:
Include the test directory in search path (to easily test bootstrap and others)
Kronuz_pyScss
train
py
f45ca96d807ab908bec9e8d3be9affed6983b913
diff --git a/pandas/tests/test_timeseries.py b/pandas/tests/test_timeseries.py index <HASH>..<HASH> 100644 --- a/pandas/tests/test_timeseries.py +++ b/pandas/tests/test_timeseries.py @@ -619,6 +619,17 @@ class TestLegacySupport(unittest.TestCase): for val in rng: self.assert_(val.time() == the_time) + def test_shift_multiple_of_same_base(self): + # GH #1063 + ts = Series(np.random.randn(5), + index=date_range('1/1/2000', periods=5, freq='H')) + + result = ts.shift(1, freq='4H') + + exp_index = ts.index + datetools.Hour(4) + + self.assert_(result.index.equals(exp_index)) + class TestDateRangeCompat(unittest.TestCase): def setUp(self):
TST: failing unit test for #<I>
pandas-dev_pandas
train
py
d63fe39bd7061c764a25d7a80ad76e872705ab29
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from distutils.core import setup setup( name='hapipy', - version='2.1.5', + version='2.1.6', description="A python wrapper around HubSpot's APIs", long_description = open('README.md').read(), author='Adrian Mott', @@ -15,6 +15,7 @@ setup( install_requires=[ 'nose==1.1.2', 'unittest2==0.5.1', - 'simplejson==2.2.1' + 'simplejson==2.2.1', + 'pycurl==7.19.0' ], )
Adding pycurl to setup.py.
HubSpot_hapipy
train
py
ee3ce020e2e69d9423a671c7fe1b150eba8246d2
diff --git a/tests/phpunit/unit/Controller/Backend/RecordsTest.php b/tests/phpunit/unit/Controller/Backend/RecordsTest.php index <HASH>..<HASH> 100644 --- a/tests/phpunit/unit/Controller/Backend/RecordsTest.php +++ b/tests/phpunit/unit/Controller/Backend/RecordsTest.php @@ -198,9 +198,10 @@ class RecordsTest extends ControllerUnitTest )); $response = $this->controller()->overview($this->getRequest(), 'pages'); $context = $response->getContext(); + $this->assertArrayHasKey('filter', $context['context']); $this->assertEquals('Lorem', $context['context']['filter'][0]); - $this->assertEquals('main', $context['context']['filter'][1]); + $this->assertEquals('main', $context['context']['filter']['chapters']); } public function testRelated()
[Tests] Handle change in array layout
bolt_bolt
train
php
f9d76b9b735244bae319fe641704bfe2c5e8a3f1
diff --git a/quark/compiler.py b/quark/compiler.py index <HASH>..<HASH> 100644 --- a/quark/compiler.py +++ b/quark/compiler.py @@ -723,7 +723,7 @@ class Reflector: return fields def meths(self, cls, cid, use_bindings): - if cls.package is None or cls.package.name.text in ("reflect", "concurrent", "behaviors", "builtin"): # XXX: is this still correct + if cls.package is None or cls.package.name.text in ("reflect", ): return [] methods = [] bindings = base_bindings(cls) @@ -859,7 +859,7 @@ class Reflector: self.clazz(cls, clsid, qual, self.qparams(texp), nparams, texp)) if not ucls: continue - if ucls.package and ucls.package.name.text in ("reflect", "concurrent", "behaviors", "builtin"): + if ucls.package and ucls.package.name.text in ("reflect", ): continue if ucls not in self.metadata: self.metadata[ucls] = OrderedDict()
Generate reflection metadata for all builtin.q except reflection
datawire_quark
train
py
73c0f1b936d599661ab248f9ac904ee21dafc968
diff --git a/redis/redis_test.go b/redis/redis_test.go index <HASH>..<HASH> 100644 --- a/redis/redis_test.go +++ b/redis/redis_test.go @@ -35,7 +35,8 @@ func TestAdd(t *testing.T) { func TestThreadSafeAdd(t *testing.T) { // Redis Add is not thread safe. If you run this, the test should fail because it never received - // ErrorFull. + // ErrorFull. It's not thread safe because we don't atomically check the state of the bucket and + // increment. t.Skip() flushDb() leakybucket.ThreadSafeAddTest(getLocalStorage())(t)
redis: explain why not thread safe
Clever_leakybucket
train
go
e5dab953bfe83cedd3c76f720e26b740b20af66f
diff --git a/scraper/gen_code_gov_json.py b/scraper/gen_code_gov_json.py index <HASH>..<HASH> 100755 --- a/scraper/gen_code_gov_json.py +++ b/scraper/gen_code_gov_json.py @@ -78,6 +78,8 @@ if __name__ == '__main__': parser.add_argument('--github-orgs', type=str, nargs='+', help='GitHub Organizations') parser.add_argument('--github-repos', type=str, nargs='+', help='GitHub Repositories') + parser.add_argument('--to-csv', action='store_true', help='Toggle output to CSV') + args = parser.parse_args() agency = args.agency @@ -103,6 +105,11 @@ if __name__ == '__main__': with open('code.json', 'w') as fp: fp.write(str_org_projects) + if args.to_csv: + with open('code.csv', 'w') as fp: + for project in code_json['projects']: + fp.write(to_doe_csv(project) + '\n') + logger.info('Agency: %s', agency) logger.info('Organization: %s', organization) logger.info('Number of Projects: %s', len(code_json['projects']))
Added flag for processing projects into a CSV file
LLNL_scraper
train
py
1988798c80a123572c3fa19873b3b028504575dc
diff --git a/pulsar/managers/util/drmaa/__init__.py b/pulsar/managers/util/drmaa/__init__.py index <HASH>..<HASH> 100644 --- a/pulsar/managers/util/drmaa/__init__.py +++ b/pulsar/managers/util/drmaa/__init__.py @@ -1,10 +1,14 @@ try: from drmaa import Session, JobControlAction +except OSError as e: + LOAD_ERROR_MESSAGE = "OSError - problem loading shared library [%s]." % e + Session = None except ImportError as e: + LOAD_ERROR_MESSAGE = "ImportError - problem importing library (`pip install drmaa` may fix this) [%s]." % e # Will not be able to use DRMAA Session = None -NO_DRMAA_MESSAGE = "Attempt to use DRMAA, but DRMAA Python library cannot be loaded." +NO_DRMAA_MESSAGE = "Attempt to use DRMAA, but DRMAA Python library cannot be loaded. " class DrmaaSessionFactory(object): @@ -16,8 +20,8 @@ class DrmaaSessionFactory(object): def get(self, **kwds): session_constructor = self.session_constructor - if not session_constructor: - raise Exception(NO_DRMAA_MESSAGE) + if session_constructor is None: + raise Exception(NO_DRMAA_MESSAGE + LOAD_ERROR_MESSAGE) return DrmaaSession(session_constructor(), **kwds)
Improve error message when drmaa cannot be loaded.
galaxyproject_pulsar
train
py
9622136cd4ec83820b273a3feb2f249b56064a81
diff --git a/ospd/ospd.py b/ospd/ospd.py index <HASH>..<HASH> 100644 --- a/ospd/ospd.py +++ b/ospd/ospd.py @@ -1187,7 +1187,7 @@ class OSPDaemon: logger.info("Received Ctrl-C shutting-down ...") def check_pending_scans(self): - for scan_id in list(self.scan_collection.ids_iterator()): + for scan_id in self.scan_collection.ids_iterator(): if self.get_scan_status(scan_id) == ScanStatus.PENDING: scan_target = self.scan_collection.scans_table[scan_id].get( 'target'
Don't cast the iterator to list
greenbone_ospd
train
py
529ca12be27ec557344818ab28cf95bc5f8e6290
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,8 +9,8 @@ exclude_patterns = ['_build'] project = u'Flask-Nav' copyright = u'2015, Marc Brinkmann' author = u'Marc Brinkmann' -version = '0.4' -release = '0.4.dev1' +version = '0.5' +release = '0.5.dev1' pygments_style = 'sphinx' html_theme = 'alabaster' diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ def read(fname): setup( name='flask-nav', - version='0.4.dev1', + version='0.5.dev1', description='Easily create navigation for Flask applications.', long_description=read('README.rst'), author='Marc Brinkmann',
Start developing version <I>.dev1 (after release of <I>)
mbr_flask-nav
train
py,py
fb3010f70d680aec669a6a849a7841047879c348
diff --git a/DBUtils/Tests/TestPooledDB.py b/DBUtils/Tests/TestPooledDB.py index <HASH>..<HASH> 100644 --- a/DBUtils/Tests/TestPooledDB.py +++ b/DBUtils/Tests/TestPooledDB.py @@ -19,8 +19,8 @@ import unittest sys.path.insert(1, '../..') # The TestSteadyDB module serves as a mock object for the DB-API 2 module: from DBUtils.Tests import TestSteadyDB as dbapi -from DBUtils.PooledDB import (PooledDB, SharedDBConnection, - InvalidConnection, TooManyConnections) +from DBUtils.PooledDB import PooledDB, SharedDBConnection, \ + InvalidConnection, TooManyConnections class TestPooledDB(unittest.TestCase):
Allow running test with Python <I> We will require modern Python in version <I> only.
Cito_DBUtils
train
py
46608d789dd43c8167128913eeefc34909412ee9
diff --git a/.travis.yml b/.travis.yml index <HASH>..<HASH> 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,6 @@ language: python: - "2.7" - "3.4" - - "3.5" - "3.6" before_install: diff --git a/tests/test_library.py b/tests/test_library.py index <HASH>..<HASH> 100644 --- a/tests/test_library.py +++ b/tests/test_library.py @@ -188,7 +188,7 @@ def test_library_and_section_search_for_movie(plex): # This started failing on more recent Plex Server builds @pytest.mark.xfail def test_search_with_apostrophe(plex): - show_title = "Marvel's Daredevil" + show_title = 'Marvel\'s Daredevil' result_root = plex.search(show_title) result_shows = plex.library.section('TV Shows').search(show_title) assert result_root diff --git a/tests/test_video.py b/tests/test_video.py index <HASH>..<HASH> 100644 --- a/tests/test_video.py +++ b/tests/test_video.py @@ -346,6 +346,8 @@ def test_video_Show_thumbUrl(show): assert '/thumb/' in show.thumbUrl +# Test seems to fail intermittently +@pytest.mark.xfail def test_video_Show_analyze(show): show = show.analyze()
Tweak two tests; Remove Python <I> testing since we cover both before and after already
pkkid_python-plexapi
train
yml,py,py
4836fe93a52edc3418710b148fb5c4c226be48e0
diff --git a/test/basic_tests.go b/test/basic_tests.go index <HASH>..<HASH> 100644 --- a/test/basic_tests.go +++ b/test/basic_tests.go @@ -126,13 +126,18 @@ func SubtestNotFounds(t *testing.T, ds dstore.Datastore) { switch err { case dstore.ErrNotFound: case nil: - t.Fatal("expected error getting size after delete") + t.Fatal("expected error getting size of not found key") default: - t.Fatal("wrong error getting size after delete: ", err) + t.Fatal("wrong error getting size of not found key", err) } if size != -1 { t.Fatal("expected missing size to be -1") } + + err = ds.Delete(badk) + if err != nil { + t.Fatal("error calling delete on not found key: ", err) + } } func SubtestLimit(t *testing.T, ds dstore.Datastore) {
Ensure that deletion of a non-existent key does not produce an error.
ipfs_go-datastore
train
go
95c3fb8b943b4a361ce9b75f02a994b55e09f051
diff --git a/lib/engineyard/model/instance.rb b/lib/engineyard/model/instance.rb index <HASH>..<HASH> 100644 --- a/lib/engineyard/model/instance.rb +++ b/lib/engineyard/model/instance.rb @@ -119,7 +119,7 @@ module EY framework_arg = ['--framework-env', environment.framework_env] - verbose_arg = verbose ? ['--verbose'] : [] + verbose_arg = (verbose || ENV['DEBUG']) ? ['--verbose'] : [] cmd = Escape.shell_command(start + deploy_args + framework_arg + instance_args + verbose_arg) puts cmd if verbose
Pass --verbose to eysd whenever DEBUG is set. [#<I> state:merged]
engineyard_engineyard
train
rb
db3435b19c2ff282e1e4700e1177c553347618df
diff --git a/impala/util.py b/impala/util.py index <HASH>..<HASH> 100644 --- a/impala/util.py +++ b/impala/util.py @@ -17,14 +17,11 @@ from __future__ import absolute_import import string import random -try: - import pandas as pd - - def as_pandas(cursor): - names = [metadata[0] for metadata in cursor.description] - return pd.DataFrame.from_records(cursor.fetchall(), columns=names) -except ImportError: - print "Failed to import pandas" + +def as_pandas(cursor): + from pandas import DataFrame + names = [metadata[0] for metadata in cursor.description] + return DataFrame.from_records(cursor.fetchall(), columns=names) def _random_id(prefix='', length=8):
[IMPYLA-<I>] Move pandas import into as_pandas In lieu of setting up logging, this should eliminate the annoying message about not being able to import pandas. Fixes #<I>.
cloudera_impyla
train
py
60e10e998fd7ee24ca9f2b4aa422db5657e3646d
diff --git a/visa.py b/visa.py index <HASH>..<HASH> 100644 --- a/visa.py +++ b/visa.py @@ -13,7 +13,7 @@ from __future__ import division, unicode_literals, print_function, absolute_import -from pyvisa import logger, __version__, log_to_screen +from pyvisa import logger, __version__, log_to_screen, constants from pyvisa.highlevel import ResourceManager from pyvisa.errors import (Error, VisaIOError, VisaIOWarning, VisaTypeError, UnknownHandler, OSNotSupported, InvalidBinaryFormat,
Added constants to visa.py
pyvisa_pyvisa
train
py
23c128e6ba47135134c317f42f1f42426eb9ae78
diff --git a/setuptools/tests/contexts.py b/setuptools/tests/contexts.py index <HASH>..<HASH> 100644 --- a/setuptools/tests/contexts.py +++ b/setuptools/tests/contexts.py @@ -83,3 +83,11 @@ def save_user_site_setting(): yield saved finally: site.ENABLE_USER_SITE = saved + + +@contextlib.contextmanager +def suppress_exceptions(*excs): + try: + yield + except excs: + pass diff --git a/setuptools/tests/test_test.py b/setuptools/tests/test_test.py index <HASH>..<HASH> 100644 --- a/setuptools/tests/test_test.py +++ b/setuptools/tests/test_test.py @@ -91,9 +91,6 @@ class TestTestTest: cmd.install_dir = site.USER_SITE cmd.user = 1 with contexts.quiet(): - try: + # The test runner calls sys.exit + with contexts.suppress_exceptions(SystemExit): cmd.run() - except SystemExit: - # The test runner calls sys.exit; suppress the exception - pass -
Suppress exceptions in a context for clarity, brevity, and reuse.
pypa_setuptools
train
py,py
1e72542164c0eb86abbb00964dfc4d7575c46352
diff --git a/configStore.js b/configStore.js index <HASH>..<HASH> 100644 --- a/configStore.js +++ b/configStore.js @@ -113,6 +113,7 @@ } function parse (config) { + config = config || {}; var parsed = {}; Object.keys(config).forEach(function (key) { @@ -152,4 +153,4 @@ } } -})(); \ No newline at end of file +})();
Make sure Object.keys arg is an object
andrewhayward_js-config-store
train
js
da05c595f9b422fc1797a1470da16862aa4fcc04
diff --git a/lib/multiblock/version.rb b/lib/multiblock/version.rb index <HASH>..<HASH> 100644 --- a/lib/multiblock/version.rb +++ b/lib/multiblock/version.rb @@ -1,3 +1,3 @@ module Multiblock - VERSION = "0.1.0" + VERSION = "0.2.0" end
Bumped version to <I>
szajbus_multiblock
train
rb
fb2366673b77d99c144ef9cda92af9b44acf00bb
diff --git a/test/tc_collections.rb b/test/tc_collections.rb index <HASH>..<HASH> 100644 --- a/test/tc_collections.rb +++ b/test/tc_collections.rb @@ -61,7 +61,7 @@ class Grep < Bud end def state - file_reader :text, '../examples/chap1/ulysses.txt' + file_reader :text, '../examples/chap2/ulysses.txt' table :matches, ['lineno', 'text'] end diff --git a/test/tc_wordcount.rb b/test/tc_wordcount.rb index <HASH>..<HASH> 100644 --- a/test/tc_wordcount.rb +++ b/test/tc_wordcount.rb @@ -11,7 +11,7 @@ class WordCount < Bud end def state - file_reader :text, '../examples/chap1/ulysses.txt' + file_reader :text, '../examples/chap2/ulysses.txt' table :words, ['lineno', 'wordno', 'word'] table :wc, ['word'], ['cnt'] table :wc2, ['word'], ['cnt']
fix refs to ulysses.txt
bloom-lang_bud
train
rb,rb
d848d0fb6324fe3adb8f2d7a4ad3b04d64ee7fba
diff --git a/web/src/test/java/uk/ac/ebi/atlas/solr/query/SpeciesLookupServiceIT.java b/web/src/test/java/uk/ac/ebi/atlas/solr/query/SpeciesLookupServiceIT.java index <HASH>..<HASH> 100644 --- a/web/src/test/java/uk/ac/ebi/atlas/solr/query/SpeciesLookupServiceIT.java +++ b/web/src/test/java/uk/ac/ebi/atlas/solr/query/SpeciesLookupServiceIT.java @@ -46,9 +46,9 @@ public class SpeciesLookupServiceIT { @Test public void interPro_singleSpeciesGeneSet() { - SpeciesLookupService.Result result = speciesLookupService.fetchSpeciesForGeneSet("IPR016938"); + SpeciesLookupService.Result result = speciesLookupService.fetchSpeciesForGeneSet("IPR016970"); assertThat(result.isMultiSpecies(), is(false)); - assertThat(result.firstSpecies(), is("schizosaccharomyces pombe")); + assertThat(result.firstSpecies(), is("arabidopsis thaliana")); } @Test
change example to match new solr index
ebi-gene-expression-group_atlas
train
java
66094201154dbdb09782e78f15840c8aeade4fc6
diff --git a/openstack_dashboard/api/rest/utils.py b/openstack_dashboard/api/rest/utils.py index <HASH>..<HASH> 100644 --- a/openstack_dashboard/api/rest/utils.py +++ b/openstack_dashboard/api/rest/utils.py @@ -146,6 +146,12 @@ def ajax(authenticated=True, data_required=False, return _wrapped return decorator +PARAM_MAPPING = { + 'None': None, + 'True': True, + 'False': False +} + def parse_filters_kwargs(request, client_keywords=None): """Extract REST filter parameters from the request GET args. @@ -158,10 +164,11 @@ def parse_filters_kwargs(request, client_keywords=None): kwargs = {} client_keywords = client_keywords or {} for param in request.GET: + param_value = PARAM_MAPPING.get(request.GET[param], request.GET[param]) if param in client_keywords: - kwargs[param] = request.GET[param] + kwargs[param] = param_value else: - filters[param] = request.GET[param] + filters[param] = param_value return filters, kwargs
Fix getting the images list in Admin->Images Do this by converting 'None' / 'True' / 'False' to their Python counterparts. Change-Id: Ifd<I>f<I>e7a<I>d<I>ee<I>fc9b<I>a Closes-Bug: #<I>
openstack_horizon
train
py
c7cc4192e4d0d90b4fead81c546c47f9b59a8d50
diff --git a/flask_appbuilder/tests/test_api.py b/flask_appbuilder/tests/test_api.py index <HASH>..<HASH> 100644 --- a/flask_appbuilder/tests/test_api.py +++ b/flask_appbuilder/tests/test_api.py @@ -287,6 +287,16 @@ class FlaskTestCase(unittest.TestCase): 'field_integer': MODEL1_DATA_SIZE - 1, 'field_string': "test{}".format(MODEL1_DATA_SIZE - 1) }) + # Test override + rv = client.get('api/v1/model1apiorder/?_o_=field_integer:asc') + data = json.loads(rv.data.decode('utf-8')) + eq_(data['result'][0], { + 'id': 1, + 'field_date': None, + 'field_float': 0.0, + 'field_integer': 0, + 'field_string': "test0" + }) def test_get_list_page(self): """
[tests] New, base_order property override
dpgaspar_Flask-AppBuilder
train
py
ff037aff431e04a68285277b635c3debb1df5954
diff --git a/lib/learn_open/opener.rb b/lib/learn_open/opener.rb index <HASH>..<HASH> 100644 --- a/lib/learn_open/opener.rb +++ b/lib/learn_open/opener.rb @@ -213,7 +213,7 @@ module LearnOpen File.write(file_path, 'Forking repository...') puts "Forking lesson..." - if !dot_learn || dot_learn[:github] != false + if !github_disabled? begin Timeout::timeout(15) do client.fork_repo(repo_name: repo_dir) @@ -262,7 +262,7 @@ module LearnOpen end end - if dot_learn && dot_learn[:github] == false + if github_disabled? ping_fork_completion end end @@ -404,12 +404,17 @@ module LearnOpen !!RUBY_PLATFORM.match(/darwin/) end + def github_disabled? + !dot_learn.nil? && dot_learn[:github] == false + end + def ide_environment? ENV['IDE_CONTAINER'] == "true" end def ide_git_wip_enabled? - return false if dot_learn && dot_learn[:github] == false + return false if github_disabled? + ENV['IDE_GIT_WIP'] == "true" end
Create Opener#github_disabled?
learn-co_learn-open
train
rb
a1b582ee48a00a3fa71f3209ed5c236cc40bab54
diff --git a/addon/components/weekly-calendar.js b/addon/components/weekly-calendar.js index <HASH>..<HASH> 100644 --- a/addon/components/weekly-calendar.js +++ b/addon/components/weekly-calendar.js @@ -9,11 +9,12 @@ export default class WeeklyCalendarComponent extends Component { @action scrollView(calendarElement, [earliestHour]) { - if (earliestHour === 24 || earliestHour < 2) { - return; - } // all of the hour elements are registered in the template as hour0, hour1, etc - const hourElement = this[`hour${earliestHour - 2}`]; + let hourElement = this.hour6; + + if (earliestHour < 24 && earliestHour > 2) { + hourElement = this[`hour${earliestHour - 2}`]; + } calendarElement.scrollTop = hourElement.offsetTop; }
Scroll to the middle of the day when there are no events.
ilios_common
train
js
34ab8cd0e855c9e9c32a083e8e6213e7a9a37b5a
diff --git a/lurklib/__init__.py b/lurklib/__init__.py index <HASH>..<HASH> 100755 --- a/lurklib/__init__.py +++ b/lurklib/__init__.py @@ -267,16 +267,22 @@ class IRC: set_by = self.from_ (segments [4]) elif self.find (data, '353'): - names = data.split() [5:] - names [0] = names [0] [1:] - names = tuple (names) + new_names = data.split() [5:].replace(':', '') + try: names.append = new_names + except NameError: names = new_names elif self.find (data, 'JOIN'): self.channels[data.split() [2] [1:]] = {} if self.hide_called_events == False: self.buffer.append (data) elif ncode in self.err_replies.keys(): self.exception (ncode) elif ncode == '366': break else: self.buffer.append (data) - + self.channels[channel]['USERS'] = {} + for name in names: + prefix = '' + if name[0] in self.priv_types: + prefix = name[0] + name = name[1:] + self.channels[channel]['USERS'][name] = prefix return ('JOIN', who, channel, topic, names, set_by, time_set) else: try:
Updated stream's SAJOIN detection to use the new caching system
jamieleshaw_lurklib
train
py
27b1447919502b4c594323850beee5ee21a33cf4
diff --git a/moco-core/src/main/java/com/github/dreamhead/moco/MocoVersion.java b/moco-core/src/main/java/com/github/dreamhead/moco/MocoVersion.java index <HASH>..<HASH> 100644 --- a/moco-core/src/main/java/com/github/dreamhead/moco/MocoVersion.java +++ b/moco-core/src/main/java/com/github/dreamhead/moco/MocoVersion.java @@ -1,7 +1,7 @@ package com.github.dreamhead.moco; public final class MocoVersion { - public static final String VERSION = "0.10.1"; + public static final String VERSION = "0.10.2"; private MocoVersion() {} }
bumped version to <I>
dreamhead_moco
train
java
260f251887355d601eec99513cbc1e6745235cbd
diff --git a/chess/syzygy.py b/chess/syzygy.py index <HASH>..<HASH> 100644 --- a/chess/syzygy.py +++ b/chess/syzygy.py @@ -1472,9 +1472,6 @@ class Tablebases(object): """ Manages a collection of tablebase files for probing. - Syzygy tables come in files like ``KQvKN.rtbw`` or ``KRBvK.rtbz``, one WDL - (*.rtbw*) and DTZ (*.rtbz*) file for each material composition. - If *max_fds* is not ``None``, will at most use *max_fds* open file descriptors at any given time. The least recently used tables are closed, if nescessary. @@ -1521,7 +1518,8 @@ class Tablebases(object): Loads tables from a directory. By default all available tables with the correct file names - (e.g. ``KQvKN.rtbw`` or ``KRBvK.rtbz``) are loaded. + (e.g. WDL files like ``KQvKN.rtbw`` and DTZ files like ``KRBvK.rtbz``) + are loaded. Returns the number of successfully openened and loaded tablebase files. """
Remove repetition in syzygy docs
niklasf_python-chess
train
py
d4799ec6295cd9978f21415e6f19cd5b9b9f4cb4
diff --git a/Kwf_js/Utils/HistoryState.js b/Kwf_js/Utils/HistoryState.js index <HASH>..<HASH> 100644 --- a/Kwf_js/Utils/HistoryState.js +++ b/Kwf_js/Utils/HistoryState.js @@ -55,6 +55,11 @@ Kwf.Utils.HistoryStateHash = function() { Ext.extend(Kwf.Utils.HistoryStateHash, Kwf.Utils.HistoryStateAbstract, { pushState: function(title, href) { if (this.disabled) return; + if (Ext.isIE6 || Ext.isIE7) { + //don't use history state at all, simply open the new url + location.href = href; + return; + } var prefix = location.protocol+'//'+location.host; if (href.substr(0, prefix.length) == prefix) {
don't use history state in IE6 and IE7 instead just change to the new url as it would be done without javascript so everything works but is not as nice
koala-framework_koala-framework
train
js
c41eab1bbb3d75dbb2cbafea9ed3b3cad2da4ad7
diff --git a/upload/admin/controller/setting/store.php b/upload/admin/controller/setting/store.php index <HASH>..<HASH> 100644 --- a/upload/admin/controller/setting/store.php +++ b/upload/admin/controller/setting/store.php @@ -85,7 +85,7 @@ class Store extends \Opencart\System\Engine\Controller { protected function getList() { if (isset($this->request->get['page'])) { - $page = $this->request->get['page']; + $page = (int)$this->request->get['page']; } else { $page = 1; }
Added integer on $page get request.
opencart_opencart
train
php
9f152aacf8427cbd20a70d52d633f8a6d624aff5
diff --git a/daemon/daemon.go b/daemon/daemon.go index <HASH>..<HASH> 100644 --- a/daemon/daemon.go +++ b/daemon/daemon.go @@ -272,6 +272,10 @@ func (daemon *Daemon) Destroy(container *Container) error { return err } + // Deregister the container before removing its directory, to avoid race conditions + daemon.idIndex.Delete(container.ID) + daemon.containers.Remove(element) + if err := daemon.driver.Remove(container.ID); err != nil { return fmt.Errorf("Driver %s failed to remove root filesystem %s: %s", daemon.driver, container.ID, err) } @@ -285,9 +289,6 @@ func (daemon *Daemon) Destroy(container *Container) error { utils.Debugf("Unable to remove container from link graph: %s", err) } - // Deregister the container before removing its directory, to avoid race conditions - daemon.idIndex.Delete(container.ID) - daemon.containers.Remove(element) if err := os.RemoveAll(container.root); err != nil { return fmt.Errorf("Unable to remove filesystem for %v: %v", container.ID, err) }
deregister containers before removing driver and containerGraph references This is required to address a race condition described in #<I>, where a container can be partially deleted -- for example, the root filesystem but not the init filesystem -- which makes it impossible to delete the container without re-adding the missing filesystems manually. This behavior has been witnessed when rebooting boxes that are configured to remove containers on shutdown in parallel with stopping the Docker daemon. Docker-DCO-<I>-
moby_moby
train
go
5339f781e004956fa46a196181a23606e2a6ed80
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -20,9 +20,9 @@ gulp.task('clean', (cb) => { // Styles gulp.task('styles', () => { - gulp.src('./src/styles/**/*.scss') - .pipe($.sass().on('error', $.sass.logError)) - .pipe(gulp.dest('./dist/css')); + return gulp.src('./src/styles/**/*.scss') + .pipe($.sass().on('error', $.sass.logError)) + .pipe(gulp.dest('./dist/css')); }); // browserify
Fix build process where the browser was reloaded before libsass compiled css
stellarterm_stellarterm
train
js
a246a2d839f6a43d491d862a53fa86bf3160ef0d
diff --git a/add_popover.py b/add_popover.py index <HASH>..<HASH> 100644 --- a/add_popover.py +++ b/add_popover.py @@ -79,11 +79,20 @@ class Add_Popover(Gtk.Window): widget.set_margin_bottom(margin) def on_addButton_clicked(self, button, addPopover): + print("test") if addPopover.get_visible(): addPopover.hide() else: + for i in range(0, len(self.data.transactionsMenu)): + self.addCategoryComboBoxText.remove(0) + + if self.addIncomeRadio.get_active() == True: + self.selected = "income" + elif self.addExpenseRadio.get_active() == True: + self.selected = "expense" + for i in range(0,len(self.data.transactionsMenu)): - if self.data.transactionsMenu[i][2] == "income": + if self.data.transactionsMenu[i][2] == self.selected: if self.data.transactionsMenu[i][1] != "Uncategorized": self.addCategoryComboBoxText.append_text(self.data.transactionsMenu[i][1]) addPopover.show_all()
Fixed category list in add popover when closing and repopening it.
mthxx_Budget
train
py
a32887e344b5ccafb6b9129c45537b13dabeb739
diff --git a/src/Graviton/SwaggerBundle/Command/SwaggerGenerateCommand.php b/src/Graviton/SwaggerBundle/Command/SwaggerGenerateCommand.php index <HASH>..<HASH> 100644 --- a/src/Graviton/SwaggerBundle/Command/SwaggerGenerateCommand.php +++ b/src/Graviton/SwaggerBundle/Command/SwaggerGenerateCommand.php @@ -121,14 +121,6 @@ class SwaggerGenerateCommand extends Command */ protected function execute(InputInterface $input, OutputInterface $output) { - /** - * somehow as the swagger spec generation digs deep in the utils/router stuff, - * somewhere Request is needed.. so we need to enter the request scope - * manually.. maybe there is another possibility for this? - */ - $this->container->enterScope('request'); - $this->container->set('request', new Request(), 'request'); - $this->filesystem->dumpFile( $this->rootDir.'/../app/cache/swagger.json', json_encode($this->apidoc->getSwaggerSpec())
there is no need anymore for this - swagger.json has no difference whether this is done or not - and it's deprecated stuff
libgraviton_graviton
train
php
5f89b532e12ef653ad2a5acc577bd5acdf5f8eb6
diff --git a/presto-druid/src/main/java/com/facebook/presto/druid/segment/V9SegmentIndexSource.java b/presto-druid/src/main/java/com/facebook/presto/druid/segment/V9SegmentIndexSource.java index <HASH>..<HASH> 100644 --- a/presto-druid/src/main/java/com/facebook/presto/druid/segment/V9SegmentIndexSource.java +++ b/presto-druid/src/main/java/com/facebook/presto/druid/segment/V9SegmentIndexSource.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Supplier; import com.google.common.collect.Streams; +import org.apache.druid.common.config.NullHandling; import org.apache.druid.common.utils.SerializerUtils; import org.apache.druid.jackson.DefaultObjectMapper; import org.apache.druid.java.util.common.Intervals; @@ -64,6 +65,7 @@ public class V9SegmentIndexSource public V9SegmentIndexSource(SegmentColumnSource segmentColumnSource) { this.segmentColumnSource = requireNonNull(segmentColumnSource, "segmentColumnSource is null"); + NullHandling.initializeForTests(); } @Override
Fix druid connector segment scan Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.joda.time.Interval
prestodb_presto
train
java
6f75fc7a14237a488dbbf4866cf788cfb407e2c0
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 @@ -33,8 +33,7 @@ module Devise # current_blogger :user # Preferably returns a User if one is signed in # def devise_group(group_name, opts={}) - opts[:contains].map! { |m| ":#{m}" } - mappings = "[#{ opts[:contains].join(',') }]" + mappings = "[#{ opts[:contains].map { |m| ":#{m}" }.join(',') }]" class_eval <<-METHODS, __FILE__, __LINE__ + 1 def authenticate_#{group_name}!(favourite=nil, opts={})
Do not mutate the receiving arguments
plataformatec_devise
train
rb
09c42b70a2b4d28618d55639c7d0bd37a2323b96
diff --git a/lib/auditor/recorder.rb b/lib/auditor/recorder.rb index <HASH>..<HASH> 100644 --- a/lib/auditor/recorder.rb +++ b/lib/auditor/recorder.rb @@ -22,7 +22,8 @@ module Auditor user = Auditor::User.current_user audit = Audit.new - audit.auditable = model + audit.auditable_id = model.id + audit.auditable_type = model.class.name audit.audited_changes = prepare_changes(model.changes) if changes_available?(action) audit.action = action audit.comment = @blk.call(model, user) if @blk
Fixed polymorphic relationship to return the auditable subclass. Setting the auditable object via audit.auditable = results in the parent class always being returned by the auditable relationship. Setting the audit.auditable_id and audit.auditable_type individually results in the relationship returning the correct subclass type.
kunklejr_auditor
train
rb
7c23b32de3d599488b5af20d709ae717d9bf62b6
diff --git a/cmd/syncthing/locations.go b/cmd/syncthing/locations.go index <HASH>..<HASH> 100644 --- a/cmd/syncthing/locations.go +++ b/cmd/syncthing/locations.go @@ -31,6 +31,7 @@ const ( locCsrfTokens = "csrfTokens" locPanicLog = "panicLog" locAuditLog = "auditLog" + locGUIAssets = "GUIAssets" locDefFolder = "defFolder" ) @@ -52,6 +53,7 @@ var locations = map[locationEnum]string{ locCsrfTokens: "${config}/csrftokens.txt", locPanicLog: "${config}/panic-${timestamp}.log", locAuditLog: "${config}/audit-${timestamp}.log", + locGUIAssets: "${config}/gui", locDefFolder: "${home}/Sync", } diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go index <HASH>..<HASH> 100644 --- a/cmd/syncthing/main.go +++ b/cmd/syncthing/main.go @@ -252,6 +252,10 @@ func main() { l.Fatalln(err) } + if guiAssets == "" { + guiAssets = locations[locGUIAssets] + } + if runtime.GOOS == "windows" { if logFile == "" { // Use the default log file location
Default GUI override dir If STGUIASSETS is not set, look for assets in $confdir/gui by default. Simplifies deploying overrides and stuff.
syncthing_syncthing
train
go,go
6767e93aec09b8eaf1f67311d6648c276a2c6cbe
diff --git a/git_code_debt/repo_parser.py b/git_code_debt/repo_parser.py index <HASH>..<HASH> 100644 --- a/git_code_debt/repo_parser.py +++ b/git_code_debt/repo_parser.py @@ -1,5 +1,4 @@ import contextlib -import shutil import subprocess import tempfile from typing import Generator @@ -31,17 +30,16 @@ class RepoParser: @contextlib.contextmanager def repo_checked_out(self) -> Generator[None, None, None]: assert not self.tempdir - self.tempdir = tempfile.mkdtemp(suffix='temp-repo') - try: - subprocess.check_call(( - 'git', 'clone', - '--no-checkout', '--quiet', '--shared', - self.git_repo, self.tempdir, - )) - yield - finally: - shutil.rmtree(self.tempdir) - self.tempdir = None + with tempfile.TemporaryDirectory(suffix='temp-repo') as self.tempdir: + try: + subprocess.check_call(( + 'git', 'clone', + '--no-checkout', '--quiet', '--shared', + self.git_repo, self.tempdir, + )) + yield + finally: + self.tempdir = None def get_commit(self, sha: str) -> Commit: output = cmd_output(
Use TemporaryDirectory instead of mkdtemp to fix permission issues on windows
asottile_git-code-debt
train
py
15d443762a9261cb65739b990eb84fe1064d16b2
diff --git a/src/main/java/org/casbin/jcasbin/util/Util.java b/src/main/java/org/casbin/jcasbin/util/Util.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/casbin/jcasbin/util/Util.java +++ b/src/main/java/org/casbin/jcasbin/util/Util.java @@ -232,7 +232,7 @@ public class Util { String[] records = null; if (s != null) { try { - CSVParser csvParser = CSVFormat.DEFAULT.parse(new StringReader(s)); + CSVParser csvParser = CSVFormat.DEFAULT.withEscape('\\').parse(new StringReader(s)); List<CSVRecord> csvRecords = csvParser.getRecords(); records = new String[csvRecords.get(0).size()]; for (int i = 0; i < csvRecords.get(0).size(); i++) {
feat: support escape character in policy rule (#<I>)
casbin_jcasbin
train
java
e478abac72d66be9cb22998073b3bd4484ae2395
diff --git a/test/k8sT/DatapathConfiguration.go b/test/k8sT/DatapathConfiguration.go index <HASH>..<HASH> 100644 --- a/test/k8sT/DatapathConfiguration.go +++ b/test/k8sT/DatapathConfiguration.go @@ -254,11 +254,10 @@ var _ = Describe("K8sDatapathConfig", func() { Expect(testPodConnectivityAcrossNodes(kubectl)).Should(BeTrue(), "Connectivity test between nodes failed") }) - It("Check vxlan connectivity with per endpoint routes", func() { - Skip("Encapsulation mode is not supported with per-endpoint routes") - + It("Check vxlan connectivity with per-endpoint routes", func() { deploymentManager.DeployCilium(map[string]string{ - "global.autoDirectNodeRoutes": "true", + "global.tunnel": "vxlan", + "global.endpointRoutes.enabled": "true", }, DeployCiliumOptionsAndDNS) Expect(testPodConnectivityAcrossNodes(kubectl)).Should(BeTrue(), "Connectivity test between nodes failed")
test: Test for vxlan + per-endpoint routes <I>a<I> ("datapath: Support enable-endpoint-routes with encapsulation") enabled combining per-endpoint routes with vxlan encapsulation. This commit adds a test for that setup.
cilium_cilium
train
go
061ed63648fd112c8965c756dc20b7ae930872bf
diff --git a/lib/observable/on/index.js b/lib/observable/on/index.js index <HASH>..<HASH> 100644 --- a/lib/observable/on/index.js +++ b/lib/observable/on/index.js @@ -28,7 +28,7 @@ exports.define = { set.on[type] = {} context = this._context if (context) { - observable = this.resolveContextSet(set, false, context, true) + observable = this.resolveContext(set, false, context, true) } else { this.set(set, false) }
use resolveContext instead of resolvecontextSet
vigour-io_vjs
train
js
a563f013d4929afae66abf6866c35958f2302cdf
diff --git a/activesupport/test/multibyte_conformance_test.rb b/activesupport/test/multibyte_conformance_test.rb index <HASH>..<HASH> 100644 --- a/activesupport/test/multibyte_conformance_test.rb +++ b/activesupport/test/multibyte_conformance_test.rb @@ -10,7 +10,6 @@ require 'tmpdir' class Downloader def self.download(from, to) unless File.exist?(to) - $stderr.puts "Downloading #{from} to #{to}" unless File.exist?(File.dirname(to)) system "mkdir -p #{File.dirname(to)}" end
Silence the output downloading a file This output isn't used anywhere for assertions so we can simply remove it. The introducing commit was f<I>d<I>.
rails_rails
train
rb
000423843c2e56880d478fbc5d7a078f9c565cfc
diff --git a/structr-ui/src/main/java/org/structr/web/property/ContentPathProperty.java b/structr-ui/src/main/java/org/structr/web/property/ContentPathProperty.java index <HASH>..<HASH> 100644 --- a/structr-ui/src/main/java/org/structr/web/property/ContentPathProperty.java +++ b/structr-ui/src/main/java/org/structr/web/property/ContentPathProperty.java @@ -69,7 +69,7 @@ public class ContentPathProperty extends AbstractReadOnlyProperty<String> { containerPath = obj.getProperty(GraphObject.id); } - while (parentContainer != null) { + while (parentContainer != null && !parentContainer.equals(obj)) { containerPath = parentContainer.getName().concat("/").concat(containerPath); parentContainer = parentContainer.getParent();
Fix: Adds condition to prevent possible infinite loop for content container parent attribute.
structr_structr
train
java
ab926239d8a10f86a7df5cc67a0bd59e2d30d364
diff --git a/lib/stream.js b/lib/stream.js index <HASH>..<HASH> 100644 --- a/lib/stream.js +++ b/lib/stream.js @@ -22,6 +22,7 @@ util.inherits(ReadableStream, Readable); ReadableStream.prototype._setCursor = function(cursor) { if (cursor instanceof Cursor === false) { this.emit('error', new Error('Cannot create a stream on a single value.')); + this.push(null); return this; } this._cursor = cursor; @@ -86,6 +87,7 @@ ReadableStream.prototype._fetchAndDecrement = function() { } else { self.emit('error', error); + self.push(null); } }); } @@ -138,6 +140,7 @@ ReadableStream.prototype._fetch = function() { } else { self.emit('error', error); + self.push(null); } }); }
Close the stream if an error is emitted since we can't recover frm it
neumino_rethinkdbdash
train
js
8c3392f058029d28c637fa07e8e1fc2af23b902c
diff --git a/packages/babel-types/src/index.js b/packages/babel-types/src/index.js index <HASH>..<HASH> 100644 --- a/packages/babel-types/src/index.js +++ b/packages/babel-types/src/index.js @@ -1,5 +1,4 @@ import toFastProperties from "to-fast-properties"; -import compact from "lodash/compact"; import loClone from "lodash/clone"; import uniq from "lodash/uniq"; @@ -398,7 +397,10 @@ export function inheritInnerComments(child: Object, parent: Object) { function _inheritComments(key, child, parent) { if (child && parent) { - child[key] = uniq(compact([].concat(child[key], parent[key]))); + child[key] = uniq( + [].concat(child[key], parent[key]) + .filter(Boolean) + ); } }
Remove uses of lodash/compact (#<I>)
babel_babel
train
js
0da519d91bd5a5800dcaa45f1719044f248b6068
diff --git a/gwpy/cli/cliproduct.py b/gwpy/cli/cliproduct.py index <HASH>..<HASH> 100644 --- a/gwpy/cli/cliproduct.py +++ b/gwpy/cli/cliproduct.py @@ -732,7 +732,8 @@ class CliProduct(object): self.plot_num += 1 def add_segs(self, args): - """ If requested add DQ segments""" + """ If requested add DQ segments + """ std_segments = [ '{ifo}:DMT-GRD_ISC_LOCK_NOMINAL:1', '{ifo}:DMT-DC_READOUT_LOCKED:1', @@ -764,14 +765,9 @@ class CliProduct(object): for segment in segments: seg_name = segment.replace('{ifo}', ifo) - try: - seg_data = DataQualityFlag. \ - query_dqsegdb(seg_name, start, end, - url='https://segments.ligo.org') - except: # noqa: E722 - seg_data = DataQualityFlag. \ - query_dqsegdb(seg_name, start, end, - url='https://segments-backup.ligo.org/') + seg_data = DataQualityFlag.query_dqsegdb( + seg_name, start, end) + self.plot.add_segments_bar(seg_data, label=seg_name)
cliproduct.py - remove bare except and segdb url. Format quotes on a doc string.
gwpy_gwpy
train
py