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
3c1e8f3d754871598e5f6a0b0a4f61d63c9d97f6
diff --git a/eZ/Publish/Core/Persistence/Legacy/Content/ObjectState/Handler.php b/eZ/Publish/Core/Persistence/Legacy/Content/ObjectState/Handler.php index <HASH>..<HASH> 100644 --- a/eZ/Publish/Core/Persistence/Legacy/Content/ObjectState/Handler.php +++ b/eZ/Publish/Core/Persistence/Legacy/Content/ObjectState/Handler.php @@ -244,7 +244,7 @@ class Handler implements BaseObjectStateHandler asort( $newPriorityList ); $this->objectStateGateway->reorderPriorities( $currentPriorityList, $newPriorityList ); - $this->objectStateGateway->updateObjectStateLinks( $stateId, key( $currentPriorityList ) ); + $this->objectStateGateway->updateObjectStateLinks( $stateId, key( $newPriorityList ) ); } /**
Assign to correct state in delete method for object state handler
ezsystems_ezpublish-kernel
train
php
9ad7eb29c8ad9ee750ba35a8570725fe07aaebb7
diff --git a/tools/specification-importer/index.js b/tools/specification-importer/index.js index <HASH>..<HASH> 100644 --- a/tools/specification-importer/index.js +++ b/tools/specification-importer/index.js @@ -81,7 +81,7 @@ var main = function() { }).then(function(spec) { if (args.docs) { return generateVBusSpecificationDocs(spec); - } else { + } else if (!args.nop) { return generateVBusSpecificationData(spec); } }).then(function(output) {
Allow `--nop` command line option for spec importer tool.
danielwippermann_resol-vbus
train
js
84f81069d2354e707e8a4ab6a643c2c520aa3264
diff --git a/flask_oauthlib/client.py b/flask_oauthlib/client.py index <HASH>..<HASH> 100644 --- a/flask_oauthlib/client.py +++ b/flask_oauthlib/client.py @@ -557,7 +557,8 @@ class OAuthRemoteApp(object): ) resp, content = self.http_request( - uri, headers, to_bytes(data, self.encoding) + uri, headers, to_bytes(data, self.encoding), + method=self.access_token_method ) data = parse_response(resp, content) if resp.code not in (200, 201):
Fix issue where a different method was used for signing OauthV1 requests than the method used to request them.
lepture_flask-oauthlib
train
py
8521b4c877f32d0f4918ec303a3a3537e88759cb
diff --git a/test/rails/excludes/postgresql/ActiveRecord/PostgresqlConnectionTest.rb b/test/rails/excludes/postgresql/ActiveRecord/PostgresqlConnectionTest.rb index <HASH>..<HASH> 100644 --- a/test/rails/excludes/postgresql/ActiveRecord/PostgresqlConnectionTest.rb +++ b/test/rails/excludes/postgresql/ActiveRecord/PostgresqlConnectionTest.rb @@ -1 +1,2 @@ exclude :test_connection_options, 'Connection options not supported' +exclude :test_table_alias_length_logs_name, 'We reuse max identifer length for this so no query is made to be logged for the rails test'
[postgres] Ignore rails test for correct sql name logging that fails because of a different implementation
jruby_activerecord-jdbc-adapter
train
rb
7c12ac75b4c9b9f31e82d9459326a0064480848b
diff --git a/Resources/public/js/comments.js b/Resources/public/js/comments.js index <HASH>..<HASH> 100644 --- a/Resources/public/js/comments.js +++ b/Resources/public/js/comments.js @@ -293,7 +293,7 @@ $(function () { * Add event listeners to tinymce after tinymce is loaded */ var tinymceInit = function () { - if (tinymce.activeEditor == undefined) { + if (typeof tinymce == 'undefined' || tinymce.activeEditor == undefined || tinymce.activeEditor.formatter == undefined) { return; } clearInterval(waitForTiny);
Fixed the comment.js for "new" tinymce version
integratedfordevelopers_integrated-comment-bundle
train
js
dd70a3f3252aa3940dbf4b138ea8441d9dc35422
diff --git a/patroni/ha.py b/patroni/ha.py index <HASH>..<HASH> 100644 --- a/patroni/ha.py +++ b/patroni/ha.py @@ -276,7 +276,9 @@ class Ha(object): self.touch_member() self.dcs.reset_cluster() sleep(2) # Give a time to somebody to promote - self.recover() + cluster = self.dcs.get_cluster() + node_to_follow = self._get_node_to_follow(cluster) + self.state_handler.follow(node_to_follow, cluster.leader, True) else: self.state_handler.follow(None, None)
BUGFIX: demote is already running in a thread It should not call `recover` but `state_handler.follow` directly (like it is already done in the `clone`). Otherwise it tries to create a new thread and all async functionality became borken...
zalando_patroni
train
py
45f7bc2e1c0355ecf9d91c101fc782a61aef2b34
diff --git a/lib/pronto/runner.rb b/lib/pronto/runner.rb index <HASH>..<HASH> 100644 --- a/lib/pronto/runner.rb +++ b/lib/pronto/runner.rb @@ -13,8 +13,17 @@ module Pronto file = Tempfile.new(blob.oid) file.write(blob.text) - file.close - file + + begin + if block_given? + file.flush + yield(file) + else + file + end + ensure + file.close unless file.closed? + end end end end
Add ability for create_tempfile do deal with a block
prontolabs_pronto
train
rb
a87beebd9d24892a2d069f75e723693de68278a8
diff --git a/munigeo/api.py b/munigeo/api.py index <HASH>..<HASH> 100644 --- a/munigeo/api.py +++ b/munigeo/api.py @@ -413,6 +413,15 @@ class AddressViewSet(GeoModelAPIView, viewsets.ReadOnlyModelViewSet): raise ParseError("municipality with ID '%s' not found" % ocd_id) queryset = queryset.filter(street__municipality=muni) + elif 'municipality_name' in filters: + val = filters['municipality_name'].lower() + args = {} + args['name_%s__iexact' % self.lang_code] = val + try: + muni = Municipality.objects.get(**args) + except Municipality.DoesNotExist: + raise ParseError("municipality with name '%s' not found" % val) + queryset = queryset.filter(street__municipality=muni) number = filters.get('number', None) if number is not None:
Enable filtering streets by municipality name. Makes it easier to query different language versions of streets.
City-of-Helsinki_django-munigeo
train
py
4803ab3514a090a3ee063d07f557045b49b5bb49
diff --git a/gomusicbrainz.go b/gomusicbrainz.go index <HASH>..<HASH> 100644 --- a/gomusicbrainz.go +++ b/gomusicbrainz.go @@ -107,7 +107,7 @@ type WS2Client struct { userAgentHeader string } -func (c *WS2Client) getReqeust(data interface{}, params url.Values, endpoint string) error { +func (c *WS2Client) getRequest(data interface{}, params url.Values, endpoint string) error { client := &http.Client{} @@ -152,7 +152,7 @@ func (c *WS2Client) searchRequest(endpoint string, result interface{}, searchTer "offset": {intParamToString(offset)}, } - if err := c.getReqeust(result, params, endpoint); err != nil { + if err := c.getRequest(result, params, endpoint); err != nil { return err } @@ -175,7 +175,7 @@ func (c *WS2Client) Lookup(entity MBLookupEntity, inc ...string) error { return errors.New("can't perform lookup without ID.") } - return c.getReqeust(entity.lookupResult(), encodeInc(inc), + return c.getRequest(entity.lookupResult(), encodeInc(inc), path.Join( entity.apiEndpoint(), string(entity.Id()),
Method name typo (non-public) getReqeust -> getRequest Purely cosmetic
michiwend_gomusicbrainz
train
go
966bc0bfcde34e414ff4cf0b64437d6f2671b35c
diff --git a/lib/Segment/QueueConsumer.php b/lib/Segment/QueueConsumer.php index <HASH>..<HASH> 100644 --- a/lib/Segment/QueueConsumer.php +++ b/lib/Segment/QueueConsumer.php @@ -203,4 +203,4 @@ abstract class Segment_QueueConsumer extends Segment_Consumer { "sentAt" => date("c"), ); } -} +} \ No newline at end of file
Trying to force circleci to build
segmentio_analytics-php
train
php
0d4705c76acf7f2ab1d181456d73badfbf7cd6e8
diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php index <HASH>..<HASH> 100644 --- a/mod/lesson/locallib.php +++ b/mod/lesson/locallib.php @@ -1519,6 +1519,9 @@ class lesson extends lesson_base { $found = true; } else if ($page->qtype == LESSON_PAGE_ENDOFCLUSTER) { $exitjump = $DB->get_field("lesson_answers", "jumpto", array("pageid" => $page->id, "lessonid" => $this->properties->id)); + if ($exitjump == LESSON_NEXTPAGE) { + $exitjump = $lessonpages[$page->id]->nextpageid; + } break; } }
MDL-<I> mod_lesson: Error in Lesson Cluster for Unseen Questions
moodle_moodle
train
php
e906f81dac75a7a77ee5e30219bb18b5ce903544
diff --git a/dask_kubernetes/core.py b/dask_kubernetes/core.py index <HASH>..<HASH> 100644 --- a/dask_kubernetes/core.py +++ b/dask_kubernetes/core.py @@ -395,7 +395,12 @@ class KubeCluster(Cluster): self.namespace, kubernetes.client.V1DeleteOptions() ) - logger.info('Deleted pod: %s', pod.metadata.name) + pod_info = pod.metadata.name + if pod.status.reason: + pod_info += ' [{}]'.format(pod.status.reason) + if pod.status.message: + pod_info += ' {}'.format(pod.status.message) + logger.info('Deleted pod: %s', pod_info) except kubernetes.client.rest.ApiException as e: # If a pod has already been removed, just ignore the error if e.status != 404:
Log status.{reason,message} when deleting pod (if present)
dask_dask-kubernetes
train
py
333ad77169ada92a08353230182f801f6e8d03c4
diff --git a/spec/nio/selectables_spec.rb b/spec/nio/selectables_spec.rb index <HASH>..<HASH> 100644 --- a/spec/nio/selectables_spec.rb +++ b/spec/nio/selectables_spec.rb @@ -90,6 +90,11 @@ describe "NIO selectables" do end let :unwritable_subject do + # Getting sporadic build failures for rbx on Travis ;( + if defined?(RUBY_ENGINE) and RUBY_ENGINE == "rbx" and ENV['CI'] + pending "rbx fails sporadically on this spec" + end + server = TCPServer.new("localhost", tcp_port + 3) sock = TCPSocket.open("localhost", tcp_port + 3) peer = server.accept
Disable unwritable TCPSocket spec on Travis/rbx
socketry_nio4r
train
rb
8614cf52bea3431ae90b710366673dc4274eda41
diff --git a/Lib/fontParts/base/contour.py b/Lib/fontParts/base/contour.py index <HASH>..<HASH> 100644 --- a/Lib/fontParts/base/contour.py +++ b/Lib/fontParts/base/contour.py @@ -547,12 +547,12 @@ class BaseContour(BaseObject, TransformationMixin, DeprecatedContour): def _get_bPoints(self): bPoints = [] - for segment in self.segments: - if segment.type not in ("move", "line", "curve"): - raise FontPartsError("A %s point can not be converted to a bPoint." % segment.type) + for point in self.points: + if point.type not in ("move", "line", "curve"): + continue bPoint = self.bPointClass() bPoint.contour = self - bPoint._setPoint(segment.onCurve) + bPoint._setPoint(point) bPoints.append(bPoint) return tuple(bPoints)
get bPoints by looping over the point and select the oncurve points only, this preserves the correct order of bPoints
robotools_fontParts
train
py
3da3f294abac5c9b04c2df98fac5c798d5480a07
diff --git a/lib/procedure-call.js b/lib/procedure-call.js index <HASH>..<HASH> 100644 --- a/lib/procedure-call.js +++ b/lib/procedure-call.js @@ -18,7 +18,7 @@ module.exports = function BuildProcedureCall(service, procedure, encodedArgument argumentCounter++; return arg; }); - var call = proto.root().ProcedureCall.create({service, procedure, arguments: args}); - var errMsg = proto.root().ProcedureCall.verify(call); + let call = proto.ProcedureCall.create({service, procedure, arguments: args}); + //var errMsg = proto.root().ProcedureCall.verify(call); return call; }; \ No newline at end of file diff --git a/test/api/stream/stream-throttle.integration.js b/test/api/stream/stream-throttle.integration.js index <HASH>..<HASH> 100644 --- a/test/api/stream/stream-throttle.integration.js +++ b/test/api/stream/stream-throttle.integration.js @@ -63,7 +63,8 @@ function clientConnectionOpen() { } function getClientIdComplete(response) { - let id = getFirstResult(response).toString('base64'); + let firstResult = getFirstResult(response); + let id = firstResult.toString('base64'); client.connectToStreamServer(id); client.stream.on('open', streamOpen); client.stream.on('error', streamError);
Simplifying procedure-call construction.
eXigentCoder_krpc-node
train
js,js
b0ad35d4294cd754128bca556ee34cf611981b6a
diff --git a/src/joint.dia.element.js b/src/joint.dia.element.js index <HASH>..<HASH> 100644 --- a/src/joint.dia.element.js +++ b/src/joint.dia.element.js @@ -771,7 +771,17 @@ joint.dia.ElementView = joint.dia.CellView.extend({ if (!_.isUndefined(yAlignment) || !_.isUndefined(xAlignment)) { - var velBBox = vel.bbox(false, this.paper.viewport); + var velBBox = vel.bbox(true /* without transformations */); + // Componsate the size with the bounding box origin offset. + velBBox.height += velBBox.y; + velBBox.width += velBBox.x; + velBBox.x = velBBox.y = 0; + + if (scalable) { + scale = scale || scalable.scale(); + velBBox.width *= scale.sx; + velBBox.height *= scale.sy; + } // `y-alignment` when set to `middle` causes centering of the subelement around its new y coordinate. // `y-alignment` when set to `bottom` uses the y coordinate as referenced to the bottom of the bbox.
dia.ElementView: improve y-alignment and x-alignment positioning (compensate for the bbox origin offset) (#<I>)
clientIO_joint
train
js
7aa4cef9714eb8b1515818d9f9409dcb20a5648d
diff --git a/src/zephyrus/application/View.php b/src/zephyrus/application/View.php index <HASH>..<HASH> 100644 --- a/src/zephyrus/application/View.php +++ b/src/zephyrus/application/View.php @@ -55,14 +55,15 @@ class View private function buildPug() { $options = [ - 'cache' => Configuration::getConfiguration('pug', 'cache'), 'basedir' => ROOT_DIR . '/public', - 'expressionLanguage' => 'js', - $options['upToDateCheck'] = false + 'expressionLanguage' => 'js' ]; if (Configuration::getApplicationConfiguration('env') == "dev") { $options['upToDateCheck'] = true; $options['prettyprint'] = true; + } else { + $options['upToDateCheck'] = false; + $options['cache'] = Configuration::getConfiguration('pug', 'cache'); } $this->pug = new Pug($options); $this->assignPugSharedArguments();
Updated the view class to disable caching in dev environment
dadajuice_zephyrus
train
php
119b35b38c20774345648d72e203d67b7d498240
diff --git a/lang/en_utf8/feedback.php b/lang/en_utf8/feedback.php index <HASH>..<HASH> 100644 --- a/lang/en_utf8/feedback.php +++ b/lang/en_utf8/feedback.php @@ -67,6 +67,7 @@ $string['feedback:edititems'] = 'Edit items'; $string['feedback:mapcourse'] = 'Map courses to global feedbacks'; $string['feedback:receivemail'] = 'Receive email notification'; $string['feedback:view'] = 'View a feedback'; +$string['feedback:viewanalysepage'] = 'View the analysepage after submit'; $string['feedback:viewreports'] = 'View reports'; $string['feedback_is_not_open'] = 'The feedback is not open'; $string['feedback_options'] = 'Feedback options';
MDL-<I> Show analysis to students setting in Feedback module does not provide enough contol over who see feedback
moodle_moodle
train
php
5ec500b277891645e1a8596c494367bff19e38a4
diff --git a/util.py b/util.py index <HASH>..<HASH> 100644 --- a/util.py +++ b/util.py @@ -551,6 +551,7 @@ def integrate(base, x, dvardx, coord_index, base_at_start=True): if True, assumes base corresponds to the value of var before the first index of ''' + pass def d_x(data, axis, boundary='forward-backward'):
added pass to a function in util.py
atmos-python_atmos
train
py
95dec299861ab9cab9282cde308c002bbd0250f6
diff --git a/symphony/lib/toolkit/class.sectionmanager.php b/symphony/lib/toolkit/class.sectionmanager.php index <HASH>..<HASH> 100755 --- a/symphony/lib/toolkit/class.sectionmanager.php +++ b/symphony/lib/toolkit/class.sectionmanager.php @@ -2,7 +2,7 @@ include_once(TOOLKIT . '/class.section.php'); - Class SectionManager{ + Class SectionManager extends Manager{ var $_Parent; var $Database; @@ -24,7 +24,13 @@ public function fetch($id=NULL, $order='ASC', $sortfield='name'){ if($id && is_numeric($id)) $returnSingle = true; - + + if(!is_array(self::$_pool)) $this->flush(); + + if($returnSingle && isset(self::$_pool[$id])){ + return self::$_pool[$id]; + } + $sql = "SELECT `s`.*, count(`e`.`id`) as `entry_count` FROM `tbl_sections` AS `s` @@ -46,6 +52,8 @@ $obj->set($name, $value); } + self::$_pool[$obj->get('id')] = $obj; + $ret[] = $obj; }
SectionManager now extends Manager allowing it to maintain a pool of resolved sections
symphonycms_symphony-2
train
php
0e8d6b861a6ad5f9d03d16e5d10802282abe7a75
diff --git a/spec/fixtures/etc/chef/client.rb b/spec/fixtures/etc/chef/client.rb index <HASH>..<HASH> 100644 --- a/spec/fixtures/etc/chef/client.rb +++ b/spec/fixtures/etc/chef/client.rb @@ -4,6 +4,5 @@ ssl_verify_mode :verify_none file_cache_path "/var/cache/chef" file_backup_path "/var/lib/chef/backup" pid_file "/var/run/chef/client.pid" -os "FakeOS" environment "production"
Not required. Provided by the os ohai plugin
digital-science_baton
train
rb
1d4008abc6ded5255c3b894f9250c2336632d72a
diff --git a/jsonfield/fields.py b/jsonfield/fields.py index <HASH>..<HASH> 100644 --- a/jsonfield/fields.py +++ b/jsonfield/fields.py @@ -2,7 +2,11 @@ import copy from django.db import models from django.core.serializers.json import DjangoJSONEncoder from django.utils.translation import ugettext_lazy as _ -from django.utils import six + +try: + from django.utils import six +except ImportError: + import six try: import json
Update fields.py try to import django.utils.six else fallback if present to six
dmkoch_django-jsonfield
train
py
48ddb9219e5ee28b318fcf792ffa81ced2e7f1ce
diff --git a/Classes/TYPO3/SingleSignOn/Client/Security/SingleSignOnProvider.php b/Classes/TYPO3/SingleSignOn/Client/Security/SingleSignOnProvider.php index <HASH>..<HASH> 100644 --- a/Classes/TYPO3/SingleSignOn/Client/Security/SingleSignOnProvider.php +++ b/Classes/TYPO3/SingleSignOn/Client/Security/SingleSignOnProvider.php @@ -48,6 +48,7 @@ class SingleSignOnProvider extends \TYPO3\Flow\Security\Authentication\Provider\ * * @param \TYPO3\Flow\Security\Authentication\TokenInterface $authenticationToken The token to be authenticated * @return void + * @Flow\Session(autoStart=true) */ public function authenticate(\TYPO3\Flow\Security\Authentication\TokenInterface $authenticationToken) { if (!$authenticationToken instanceof SingleSignOnToken) {
[BUGFIX] Fix problem with no session before callback Change-Id: I2ec<I>a<I>a<I>c<I>e<I>a2f3ef<I>a6
Flowpack_Flowpack.SingleSignOn.Client
train
php
9451e90790c69f71175a307813d3599c6f79958a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ setup( # Versions should comply with PEP440. For a discussion on single-sourcing # the version across setup.py and the project code, see # https://packaging.python.org/en/latest/single_source_version.html - version='0.9.0', + version='0.9.1', description='bunq Python SDK', long_description=long_description,
bump the version up to <I>
bunq_sdk_python
train
py
094ced7d242906fd4c8e156671f9b2215a9dd692
diff --git a/niworkflows/utils/bids.py b/niworkflows/utils/bids.py index <HASH>..<HASH> 100644 --- a/niworkflows/utils/bids.py +++ b/niworkflows/utils/bids.py @@ -69,7 +69,7 @@ def collect_participants(bids_dir, participant_label=None, strict=False, ... str(datadir / 'ds114'), participant_label=['02', '14'], ... strict=True, bids_validate=False) # doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): - fmriprep.utils.bids.BIDSError: + BIDSError: ... """
fix: remove leftover in migration from fMRIPrep [skip ci] I'm skipping ci because I made sure tests pass locally.
poldracklab_niworkflows
train
py
f17bcf3afe492d2b5a103017693656ccb186ec86
diff --git a/tests/multimaster/minion/test_event.py b/tests/multimaster/minion/test_event.py index <HASH>..<HASH> 100644 --- a/tests/multimaster/minion/test_event.py +++ b/tests/multimaster/minion/test_event.py @@ -13,7 +13,7 @@ import salt.modules.iptables HAS_IPTABLES = salt.modules.iptables.__virtual__() -@destructiveTest +#@destructiveTest @skip_if_not_root @skipIf(not HAS_IPTABLES, 'iptables command is not available') class TestHandleEvents(MultimasterModuleCase, ShellTestCase, AdaptedConfigurationTestCaseMixin): @@ -49,7 +49,8 @@ class TestHandleEvents(MultimasterModuleCase, ShellTestCase, AdaptedConfiguratio master_tgt=1, timeout=60, ) - self.assertTrue(res) + self.assertTrue(res, 'Minion is not responding to the second master after the first ' \ + 'one has gone. Check #50814 for details.') finally: # Remove the firewall rule taking master online back. # Since minion could be not responsive now use `salt-call --local` for this.
Improved assertion error diagnostic for master down test.
saltstack_salt
train
py
641ddd9bb21e685f8411e64a480d18bf00ce8408
diff --git a/src/de/timroes/axmlrpc/serializer/ArraySerializer.java b/src/de/timroes/axmlrpc/serializer/ArraySerializer.java index <HASH>..<HASH> 100644 --- a/src/de/timroes/axmlrpc/serializer/ArraySerializer.java +++ b/src/de/timroes/axmlrpc/serializer/ArraySerializer.java @@ -34,19 +34,20 @@ public class ArraySerializer implements Serializer { value = XMLUtil.getOnlyChildElement(data.getChildNodes().item(i).getChildNodes()); + if(value == null) + continue; + // Strip only whitespace text elements and comments if((value.getNodeType() == Node.TEXT_NODE && value.getNodeValue().trim().length() <= 0) || value.getNodeType() == Node.COMMENT_NODE) continue; - if(value.getNodeType() != Node.ELEMENT_NODE - || !ARRAY_VALUE.equals(value.getNodeName())) { + if(value.getNodeType() != Node.ELEMENT_NODE) { throw new XMLRPCException("An array can only contain value tags."); } - list.add(SerializerHandler.getDefault().deserialize( - XMLUtil.getOnlyChildElement(value.getChildNodes()))); + list.add(SerializerHandler.getDefault().deserialize(value)); }
Fixed bug in handling arrays as return values
gturri_aXMLRPC
train
java
28940ff86143412a2987b0dd2f1710479d84a1df
diff --git a/sqlx_test.go b/sqlx_test.go index <HASH>..<HASH> 100644 --- a/sqlx_test.go +++ b/sqlx_test.go @@ -1150,13 +1150,13 @@ func TestEmbeddedLiterals(t *testing.T) { RunWithSchema(schema, t, func(db *DB, t *testing.T) { type t1 struct { - K string + K *string } type t2 struct { Inline struct { F string } - K string + K *string } db.MustExec(db.Rebind("INSERT INTO x (k) VALUES (?), (?), (?);"), "one", "two", "three") @@ -1166,7 +1166,7 @@ func TestEmbeddedLiterals(t *testing.T) { if err != nil { t.Error(err) } - if target.K != "one" { + if *target.K != "one" { t.Error("Expected target.K to be `one`, got ", target.K) } @@ -1175,7 +1175,7 @@ func TestEmbeddedLiterals(t *testing.T) { if err != nil { t.Error(err) } - if target2.K != "one" { + if *target2.K != "one" { t.Errorf("Expected target2.K to be `one`, got `%v`", target2.K) }
use *string instead of string, still passes (RawMessage fails but because of value test, not name missing)
jmoiron_sqlx
train
go
4a925d813beb0d19b3907043a373a53ffdfd9291
diff --git a/lib/hako/schedulers/ecs_elb_v2.rb b/lib/hako/schedulers/ecs_elb_v2.rb index <HASH>..<HASH> 100644 --- a/lib/hako/schedulers/ecs_elb_v2.rb +++ b/lib/hako/schedulers/ecs_elb_v2.rb @@ -238,7 +238,7 @@ module Hako # @return [String] def target_group_name - @elb_v2_config.fetch('target_group_name', "hako-#{@app_id}") + @elb_v2_config.fetch('target_group_name', elb_name) end # @return [Hash]
Use elb_name as default target group name.
eagletmt_hako
train
rb
e3623a71fa599842e9f4937058b534da7a11ea15
diff --git a/ffpyplayer/__init__.py b/ffpyplayer/__init__.py index <HASH>..<HASH> 100644 --- a/ffpyplayer/__init__.py +++ b/ffpyplayer/__init__.py @@ -1,6 +1,6 @@ __all__ = ('version', ) -version = '2.0.0' +version = '2.1-dev' # The ffmpeg src git version tested with. Nov, 18, 2013 _ffmpeg_git = '1f7b7d54471711b89f8a64bef1c6636b6aa08c12'
Bump to <I>.
matham_ffpyplayer
train
py
b4e578753b61c644d6128bb1692a17c75fddd8a4
diff --git a/src/sap.ui.core/src/sap/ui/core/Control.js b/src/sap.ui.core/src/sap/ui/core/Control.js index <HASH>..<HASH> 100644 --- a/src/sap.ui.core/src/sap/ui/core/Control.js +++ b/src/sap.ui.core/src/sap/ui/core/Control.js @@ -89,7 +89,7 @@ sap.ui.define([ * Whether the control is currently in blocked state. * * @deprecated since version 1.69 The blocked property is deprecated. - * There is <b>no accessibility</b> support for this property. + * There is no accessibility support for this property. * Blocked controls should not be used inside Controls, which rely on keyboard navigation, e.g. List controls. */ "blocked" : {type: "boolean", defaultValue: false},
[INTERNAL][FIX] core.Control: blocked property docu fix Somehow the <b> tags inside a deprecated block are ignored by the JSDoc generation. Sadly the most important part of the documentation is missing now. Change-Id: I<I>f<I>ff<I>db4ce<I>fb<I>e6fb2b<I>ce7f6
SAP_openui5
train
js
7d4cfa3b474279acfe5f0da9a1c20938493b1e83
diff --git a/src/transformers/models/prophetnet/modeling_prophetnet.py b/src/transformers/models/prophetnet/modeling_prophetnet.py index <HASH>..<HASH> 100644 --- a/src/transformers/models/prophetnet/modeling_prophetnet.py +++ b/src/transformers/models/prophetnet/modeling_prophetnet.py @@ -1687,7 +1687,9 @@ class ProphetNetDecoder(ProphetNetPreTrainedModel): batch_size, seq_length = hidden_states.shape[:2] # get causal mask - causal_mask = hidden_states.new(seq_length, seq_length).float().fill_(-float("inf")) + causal_mask = torch.full( + (seq_length, seq_length), -float("inf"), dtype=hidden_states.dtype, device=hidden_states.device + ) causal_mask = torch.triu(causal_mask, 1) extended_causal_mask = causal_mask[:seq_length, :seq_length][None, :, :].expand( (batch_size,) + causal_mask.shape
Rewrite ProphetNet to adapt converting ONNX friendly (#<I>) * Rewrite * [ONNX] rewrite
huggingface_pytorch-pretrained-BERT
train
py
e6825b9c91b1ad905245b38d6f93535a8034d155
diff --git a/server/cmd_selected.go b/server/cmd_selected.go index <HASH>..<HASH> 100644 --- a/server/cmd_selected.go +++ b/server/cmd_selected.go @@ -278,7 +278,8 @@ type Uid struct { } func (cmd *Uid) Handle(conn *Conn) error { - hdlr, err := conn.Server.getCommandHandler(cmd.Cmd.Command()) + inner := cmd.Cmd.Command() + hdlr, err := conn.Server.getCommandHandler(inner) if err != nil { return err } @@ -288,5 +289,12 @@ func (cmd *Uid) Handle(conn *Conn) error { return errors.New("Command unsupported with UID") } - return uidHdlr.UidHandle(conn) + if err := uidHdlr.UidHandle(conn); err != nil { + return err + } + + return ErrStatusResp(&common.StatusResp{ + Type: common.StatusOk, + Info: "UID " + inner.Name + " completed", + }) }
server: make UID * commands return a better OK response info
emersion_go-imap
train
go
80d22a5f3499f510b2dc5d9d116d9669e28fa3f6
diff --git a/msrestazure/tools.py b/msrestazure/tools.py index <HASH>..<HASH> 100644 --- a/msrestazure/tools.py +++ b/msrestazure/tools.py @@ -44,7 +44,6 @@ def register_rp_hook(r, *args, **kwargs): url_prefix = _extract_subscription_url(r.request.url) _register_rp(session, url_prefix, rp_name) return session.send(r.request) - return r def _check_rp_not_registered_err(response): try:
Requests hooks does not return if nothing to do
Azure_msrestazure-for-python
train
py
af5d8310697ed3274a4a014a3c9da88029c0f1b7
diff --git a/core/src/main/java/hudson/slaves/NodeProvisioner.java b/core/src/main/java/hudson/slaves/NodeProvisioner.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/slaves/NodeProvisioner.java +++ b/core/src/main/java/hudson/slaves/NodeProvisioner.java @@ -346,10 +346,6 @@ public class NodeProvisioner { */ private final Label label; /** - * The number of items in the queue requiring this {@link #label}. - */ - private final int queueLengthSnapshot; - /** * The planned capacity for this {@link #label}. */ private final int plannedCapacitySnapshot;
fixed COMPILATION ERROR - queueLengthSnapshot never used.
jenkinsci_jenkins
train
java
333defd6b6e88696f6c1005e613ae80a9072cad7
diff --git a/elasticsearch_dsl/search.py b/elasticsearch_dsl/search.py index <HASH>..<HASH> 100644 --- a/elasticsearch_dsl/search.py +++ b/elasticsearch_dsl/search.py @@ -605,7 +605,8 @@ class Search(Request): return es.count( index=self._index, doc_type=self._doc_type, - body=d + body=d, + **self._params )['count'] def execute(self, ignore_cache=False):
Params should be passed into count as well Fixes #<I>
elastic_elasticsearch-dsl-py
train
py
706ce0507afb70e4f5a8edd34bbfdad5b8b2d892
diff --git a/doc/conf.py b/doc/conf.py index <HASH>..<HASH> 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -65,9 +65,9 @@ author = 'Pachyderm' # built documents. # # The short X.Y version. -version = '1.8.4' +version = '1.8.5' # The full version, including alpha/beta/rc tags. -release = '1.8.4' +release = '1.8.5' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/src/client/version/client.go b/src/client/version/client.go index <HASH>..<HASH> 100644 --- a/src/client/version/client.go +++ b/src/client/version/client.go @@ -12,7 +12,7 @@ const ( // MinorVersion is the current minor version for pachyderm. MinorVersion = 8 // MicroVersion is the patch number for pachyderm. - MicroVersion = 4 + MicroVersion = 5 ) var (
Increment version for <I> point release
pachyderm_pachyderm
train
py,go
c0e2686fe7763fba3815378cf63d99b13d8435eb
diff --git a/test/ViewModels/AnimationViewModelSpec.js b/test/ViewModels/AnimationViewModelSpec.js index <HASH>..<HASH> 100644 --- a/test/ViewModels/AnimationViewModelSpec.js +++ b/test/ViewModels/AnimationViewModelSpec.js @@ -17,7 +17,8 @@ describe('AnimationViewModel', function() { terria: terria }); animationVm.timeline = { - zoomTo: jasmine.createSpy('zoomTo') + zoomTo: jasmine.createSpy('zoomTo'), + resize: jasmine.createSpy('resize') // this gets triggered in saucelabs for some reason. }; });
Added timeline.resize method to timeline mock to appease saucelabs.
TerriaJS_terriajs
train
js
12088f22d6da444c6827ca3f201eca81495d5a8c
diff --git a/kopeme-junit/src/main/java/de/dagere/kopeme/junit/testrunner/PerformanceMethodStatement.java b/kopeme-junit/src/main/java/de/dagere/kopeme/junit/testrunner/PerformanceMethodStatement.java index <HASH>..<HASH> 100644 --- a/kopeme-junit/src/main/java/de/dagere/kopeme/junit/testrunner/PerformanceMethodStatement.java +++ b/kopeme-junit/src/main/java/de/dagere/kopeme/junit/testrunner/PerformanceMethodStatement.java @@ -177,7 +177,6 @@ public class PerformanceMethodStatement extends KoPeMeBasicStatement { LOG.debug("Exiting thread."); throw new InterruptedException("Test was interrupted and eventually timed out."); } - Thread.sleep(1); // To let other threads "breath" } LOG.debug("Executions: " + (execution - 1)); tr.setRealExecutions(execution - 1);
Remove unneccessary sleep
DaGeRe_KoPeMe
train
java
352e0e24b052376f2399323736759e2866a05022
diff --git a/tasks/html2js.js b/tasks/html2js.js index <HASH>..<HASH> 100644 --- a/tasks/html2js.js +++ b/tasks/html2js.js @@ -170,6 +170,13 @@ module.exports = function(grunt) { } var modules = filePaths.map(function(filepath) { + + var moduleName = normalizePath(path.relative(options.base, filepath)); + if (grunt.util.kindOf(options.rename) === 'function') { + moduleName = options.rename(moduleName); + } + moduleNames.push("'" + moduleName + "'"); + var compiled; if (options.watch && (compiled = fileCache[filepath])) { @@ -177,11 +184,6 @@ module.exports = function(grunt) { return compiled; } - var moduleName = normalizePath(path.relative(options.base, filepath)); - if (grunt.util.kindOf(options.rename) === 'function') { - moduleName = options.rename(moduleName); - } - moduleNames.push("'" + moduleName + "'"); if (options.target === 'js') { compiled = compileTemplate(moduleName, filepath, options); } else if (options.target === 'coffee') {
Watch Feature: fix bug - ModuleNames still need to be generated and pushed even if file contents are cached
rquadling_grunt-html2js
train
js
3df8fce3498c840fcd214f9ed1f4ae55b439ae8a
diff --git a/lib/review/pdfmaker.rb b/lib/review/pdfmaker.rb index <HASH>..<HASH> 100644 --- a/lib/review/pdfmaker.rb +++ b/lib/review/pdfmaker.rb @@ -154,12 +154,6 @@ module ReVIEW end end - # version 4.0 compatibility - if @config['image_scale2width'] - warn 'image_scale2width parameter is moved to under pdfmaker section' - @config['pdfmaker']['image_scale2width'] = @config['image_scale2width'] - end - begin generate_pdf rescue ApplicationError => e
revert image_scale2width warning, part of #<I>
kmuto_review
train
rb
5ff9db68a892544c4619f9aa1d843e3ceceb4851
diff --git a/src/Roave/DeveloperTools/Inspection/AggregateInspection.php b/src/Roave/DeveloperTools/Inspection/AggregateInspection.php index <HASH>..<HASH> 100644 --- a/src/Roave/DeveloperTools/Inspection/AggregateInspection.php +++ b/src/Roave/DeveloperTools/Inspection/AggregateInspection.php @@ -18,6 +18,8 @@ namespace Roave\DeveloperTools\Inspection; +use Zend\Stdlib\ArrayUtils; + /** * An inspection that contains multiple other inspections */ @@ -32,7 +34,13 @@ class AggregateInspection implements InspectionInterface * @param InspectionInterface[] $inspections */ public function __construct($inspections) { - $this->inspections = $inspections; + // note: this iteration is only builtin to ensure type-safety + $this->inspections = array_values(array_map( + function (InspectionInterface $inspection) { + return $inspection; + }, + ArrayUtils::iteratorToArray($inspections) + )); } /**
Ensuring type-safety of collected inspections in the aggregate inspection
Roave_RoaveDeveloperTools
train
php
481aecc8628da9fa6c954795942e877a2669dd6a
diff --git a/spec/mactag/config_spec.rb b/spec/mactag/config_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mactag/config_spec.rb +++ b/spec/mactag/config_spec.rb @@ -26,7 +26,17 @@ describe Mactag::Config do it 'should be configurable' do Mactag.configure do |config| config.should == Mactag::Config + + config.binary = 'binary {INPUT} {OUTPUT}' + config.tags_file = 'tags_file' + config.rvm = false + config.gem_home = 'gem_home' end + + Mactag::Config.binary.should == 'binary {INPUT} {OUTPUT}' + Mactag::Config.tags_file.should == 'tags_file' + Mactag::Config.rvm.should == false + Mactag::Config.gem_home.should == 'gem_home' end it "requires '{INPUT}' and '{OUTPUT}' in binary string" do
Make sure config can be changed.
rejeep_mactag
train
rb
317ce7190e4f48ef1a0d58db22d4345647b6070b
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,7 @@ var plugins = require('gulp-load-plugins')(); var config = elixir.config; var name = 'postcss'; -elixir.extend(name, function(src, options) { +elixir.extend('postcss', function(src, options) { options = _.extend({ output: 'public/css',
Resolve PhpStorm "Unresolved Javascript Function" Hey, I know that writing the name of the elixir task twice may be redundant but this allows for PhpSorm to find the function and therefore avoid it from telling that the function was unresolved. Thanks :)
tureki_laravel-elixir-postcss
train
js
8aba9967d4d0f147a60645a4cee75e2b25da8d80
diff --git a/editconfig_gedcom.php b/editconfig_gedcom.php index <HASH>..<HASH> 100644 --- a/editconfig_gedcom.php +++ b/editconfig_gedcom.php @@ -658,12 +658,12 @@ print_header(i18n::translate('GEDCOM configuration')); </tr> <tr> <td class="descriptionbox nowrap"> - <?php echo i18n::translate('Extend privacy to dead people'), help_link('KEEP_ALIVE'); ?> + <?php /* I18N: ... [who were] born in the last XX years or died in the last YY years */ echo i18n::translate('Extend privacy to dead people'), help_link('KEEP_ALIVE'); ?> </td> <td class="optionbox"> <?php echo - /* I18N: 'Extend privacy to dead people' ... */ + /* I18N: Extend privacy to dead people [who were] ... */ i18n::translate( 'born in the last %1$s years or died in the last %2$s years', '<input type="text" name="KEEP_ALIVE_YEARS_BIRTH" value="'.get_gedcom_setting(WT_GED_ID, 'KEEP_ALIVE_YEARS_BIRTH').'" size="5" />',
#<I> - Plural or Singular - "born in the last %1$s years or died in the last %2$s years"
fisharebest_webtrees
train
php
38c5e32eb2eb5767eae8931fde33b4594147d125
diff --git a/neutrino.go b/neutrino.go index <HASH>..<HASH> 100644 --- a/neutrino.go +++ b/neutrino.go @@ -1175,7 +1175,7 @@ func (s *ChainService) handleUpdatePeerHeights(state *peerState, umsg updatePeer // handleAddPeerMsg deals with adding new peers. It is invoked from the // peerHandler goroutine. func (s *ChainService) handleAddPeerMsg(state *peerState, sp *ServerPeer) bool { - if sp == nil { + if sp == nil || !sp.Connected() { return false }
neutrino: prevent adding peers if already disconnected This addresses an issue where the server ends up tracking a peer that has been disconnected due to it processing a peer's `done` message before its `add` message.
lightninglabs_neutrino
train
go
425b90cfa920c2c8d4da9d10f9e30fbbe71b811e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ with open(path.join(here, 'README.md'), encoding='utf-8') as f: setup( name='stmcli', - version='1.2.0', + version='1.2.1', description='The unofficial STM CLI client.', long_description=long_description, url='https://github.com/stmcli/stmcli', @@ -21,7 +21,6 @@ setup( license='MIT', scripts=['bin/stmcli'], classifiers=[ - 'Development Status :: Working', 'Intended Audience :: End Users/Desktop', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3',
Incremented to <I>
stmcli_stmcli
train
py
a1eb42811b667ac7adeb7c67ef02aea4b0a10c5a
diff --git a/selene/tools.py b/selene/tools.py index <HASH>..<HASH> 100644 --- a/selene/tools.py +++ b/selene/tools.py @@ -7,11 +7,25 @@ def set_driver(driver): def get_driver(): - return config.driver - - -def visit(relative_url): - get_driver().get(config.app_host + relative_url) + return config.drive + + +def visit(absolute_or_relative_url): + """ + Loads a web page in the current browser session. + :param absolute_or_relative_url: + an absolute url to web page in case of config.app_host is not specified, + otherwise - relative url correspondingly + + :Usage: + visit('http://mydomain.com/subpage1') + visit('http://mydomain.com/subpage2') + # OR + config.app_host = 'http://mydomain.com' + visit('/subpage1') + visit('/subpage2') + """ + get_driver().get(config.app_host + absolute_or_relative_url) def s(css_selector_or_locator):
added docstring for tools.visit
yashaka_selene
train
py
c40dde75af812fc24755f098f685e25282283564
diff --git a/winrm/transport.py b/winrm/transport.py index <HASH>..<HASH> 100644 --- a/winrm/transport.py +++ b/winrm/transport.py @@ -105,7 +105,7 @@ class Transport(object): else: if not self.username: raise InvalidCredentialsError("auth method %s requires a username" % self.auth_method) - if not self.password: + if self.password is None: raise InvalidCredentialsError("auth method %s requires a password" % self.auth_method) self.session = None
allow blank passwords for ntlm/basic auth
diyan_pywinrm
train
py
bc56bb7d923903611379d2b69ab9eed54708bd08
diff --git a/go/test/endtoend/vtgate/queries/normalize/normalize_test.go b/go/test/endtoend/vtgate/queries/normalize/normalize_test.go index <HASH>..<HASH> 100644 --- a/go/test/endtoend/vtgate/queries/normalize/normalize_test.go +++ b/go/test/endtoend/vtgate/queries/normalize/normalize_test.go @@ -46,7 +46,7 @@ func TestNormalizeAllFields(t *testing.T) { assert.Equal(t, 1, len(qr.Rows), "wrong number of table rows, expected 1 but had %d. Results: %v", len(qr.Rows), qr.Rows) // Now need to figure out the best way to check the normalized query in the planner cache... - results, err := getPlanCache(fmt.Sprintf("%s:%d", clusterInstance.Hostname, clusterInstance.VtgateProcess.Port)) + results, err := getPlanCache(fmt.Sprintf("%s:%d", vtParams.Host, clusterInstance.VtgateProcess.Port)) require.Nil(t, err) found := false for _, record := range results {
Use vtparams instead of clusterInstance in TestNormalizeAllFields (#<I>)
vitessio_vitess
train
go
99cab40694a0a23e3f67625d09a811f26f091b2b
diff --git a/apps/base.py b/apps/base.py index <HASH>..<HASH> 100644 --- a/apps/base.py +++ b/apps/base.py @@ -1502,7 +1502,6 @@ def _waitpid(pid, interval=None, timeout=None): while 1: if pid_exists(pid): delay = check_timeout(delay) - logging.debug(delay) else: return else: @@ -1523,7 +1522,7 @@ def _waitpid(pid, interval=None, timeout=None): return os.WEXITSTATUS(status) else: # should never happen - raise RuntimeError("unknown process exit status") + raise RuntimeError("unknown process exit status") def waitpid(args):
[apps] base._waitpid() fix code indentation
tanghaibao_jcvi
train
py
f6afd06d3c86e32f00e8bd7e5175e60b9aeaaca2
diff --git a/experiments/fields/bd1xx.py b/experiments/fields/bd1xx.py index <HASH>..<HASH> 100644 --- a/experiments/fields/bd1xx.py +++ b/experiments/fields/bd1xx.py @@ -135,7 +135,6 @@ def date_started(self, key, value): @experiments.over('accelerator', '^693') -@utils.for_each_value def accelerator(self, key, value): """Field code.""" return value.get('a')
dojson: fix accelerator rule in experiments
inspirehep_inspire-dojson
train
py
7b146e264d7b8c9a581b6ad5a19f6ff2342a86f3
diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index <HASH>..<HASH> 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -648,11 +648,10 @@ module Sinatra status, header, body = @response.finish - # Never produce a body on HEAD requests. Do retain the Content-Length - # unless it's "0", in which case we assume it was calculated erroneously - # for a manual HEAD response and remove it entirely. + # On HEAD requests, if the Content-Length is "0", assume + # it was calculated erroneously for a manual HEAD response + # and remove it entirely. if @env['REQUEST_METHOD'] == 'HEAD' - body = [] header.delete('Content-Length') if header['Content-Length'] == '0' end @@ -1266,6 +1265,7 @@ module Sinatra builder = Rack::Builder.new builder.use Rack::MethodOverride if method_override? builder.use ShowExceptions if show_exceptions? + builder.use Rack::Head setup_logging builder setup_sessions builder middleware.each { |c,a,b| builder.use(c, *a, &b) }
Leave HEAD method logic to Rack::Head
sinatra_sinatra
train
rb
a4b57753443fcb65f3c4042c551e083975d9537b
diff --git a/guiconfig.py b/guiconfig.py index <HASH>..<HASH> 100755 --- a/guiconfig.py +++ b/guiconfig.py @@ -2119,7 +2119,10 @@ def _defaults_info(sc): if not sc.defaults: return "" - s = "Defaults:\n" + s = "Default" + if len(sc.defaults) > 1: + s += "s" + s += ":\n" for val, cond in sc.orig_defaults: s += " - " diff --git a/menuconfig.py b/menuconfig.py index <HASH>..<HASH> 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -2639,7 +2639,10 @@ def _defaults_info(sc): if not sc.defaults: return "" - s = "Defaults:\n" + s = "Default" + if len(sc.defaults) > 1: + s += "s" + s += ":\n" for val, cond in sc.orig_defaults: s += " - "
menuconfig/guiconfig: Print 'default:' with no 's' if there's just one Most common case, and makes the symbol info read better.
ulfalizer_Kconfiglib
train
py,py
5488f5e592fbccfd319917f1ca19459262250392
diff --git a/src/converters/date.js b/src/converters/date.js index <HASH>..<HASH> 100644 --- a/src/converters/date.js +++ b/src/converters/date.js @@ -3,7 +3,7 @@ import { isNil } from "lodash"; export default function(value) { if(!isNil(value) && value !== "") { - let temp = Moment.unix(value).utc(); + let temp = Moment.unix(value); if(temp.isValid()) { value = temp.clone().format("MMM D, YYYY"); }
remove utc from date converter
AlchemyAlcove_FormFormatters
train
js
a3cff23054dbea77bc8b6061387f94b4b0c38dcb
diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index <HASH>..<HASH> 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -154,9 +154,8 @@ module Sinatra stat = File.stat(path) last_modified stat.mtime - content_type mime_type(opts[:type]) || - opts[:type] || - mime_type(File.extname(path)) || + content_type opts[:type] || + File.extname(path) || response['Content-Type'] || 'application/octet-stream'
No need to double call #mime_type
sinatra_sinatra
train
rb
685b01638de098cee7db6db47b8178877b9c3171
diff --git a/web/concrete/libraries/controller.php b/web/concrete/libraries/controller.php index <HASH>..<HASH> 100644 --- a/web/concrete/libraries/controller.php +++ b/web/concrete/libraries/controller.php @@ -405,19 +405,6 @@ class Controller { * @return Page */ public function getCollectionObject() {return $this->c;} - - /** - * Get the current controllers url, first checking to see if this controller has a collection object - * @return string url - * @author Scott Conrad <scott.conrads@gmail.com> - */ - public function getCollectionURL(){ - $nh = Loader::helper('navigation'); - $nh instanceof NavigationHelper; - if(is_object($this->c) && $this->c instanceOf Page){ - return $nh->getCollectionURL($this->c); - } - } /** * Gets the current view for the controller (typically the page's handle) * @return string $view
wonder how that one made a comeback? Former-commit-id: <I>ca<I>daacea<I>d<I>bd<I>e<I>c<I>a<I>e<I>
concrete5_concrete5
train
php
efada83dceb7d3e60a9e97e39fdb0f71b07e5a0d
diff --git a/source/net/fortuna/ical4j/filter/PeriodRule.java b/source/net/fortuna/ical4j/filter/PeriodRule.java index <HASH>..<HASH> 100644 --- a/source/net/fortuna/ical4j/filter/PeriodRule.java +++ b/source/net/fortuna/ical4j/filter/PeriodRule.java @@ -126,7 +126,7 @@ public class PeriodRule extends ComponentRule { if (start != null && duration != null) { Date startPlusDuration = duration.getDuration().getTime( start.getDate()); - if (period.includes(startPlusDuration)) { + if (period.includes(startPlusDuration, Period.INCLUSIVE_END)) { debug(startPlusDuration, "duration"); return true; }
Check duration inclusion in period exclusive of period start (so that duration of one day is not included in periods starting at <I>:<I>am the following day)
ical4j_ical4j
train
java
fdb9b6210cdb36e7cc12982f21e53bafbe57f2c8
diff --git a/instabot/api/api.py b/instabot/api/api.py index <HASH>..<HASH> 100644 --- a/instabot/api/api.py +++ b/instabot/api/api.py @@ -634,8 +634,8 @@ class API(object): ) return self.send_request(url) - def search_username(self, username_name): - url = 'users/{}/usernameinfo/'.format(username_name) + def search_username(self, username): + url = 'users/{username}/usernameinfo/'.format(username=username) return self.send_request(url) def search_tags(self, query):
Rename 'username_name' into 'username'
instagrambot_instabot
train
py
a71adb59e86719afd7efecd9701de99cec26e183
diff --git a/minify.js b/minify.js index <HASH>..<HASH> 100644 --- a/minify.js +++ b/minify.js @@ -377,7 +377,8 @@ function isFileChanged(pFileName, pFileData, pLastFile_b){ if(!Hashes) try { /* try to read file with hashes */ - Hashes = require('hashes.json'); + console.log('trying to read hashes.json'); + Hashes = require(process.cwd()+'/hashes'); for(var lFileName in Hashes) /* if founded row with file name * saving hash @@ -387,6 +388,7 @@ function isFileChanged(pFileName, pFileData, pLastFile_b){ break; } }catch(pError) { + console.log('hashes.json was not readed. '); Hashes={}; } /* create md5 hash of file data */ @@ -401,7 +403,7 @@ function isFileChanged(pFileName, pFileData, pLastFile_b){ }else{ Hashes[pFileName] = lFileHash; if(pLastFile_b) - fs.writeFile('hashes.json', JSON.stringify(Hashes), fileWrited(pLastFile_b)); + fs.writeFile('./hashes.json', JSON.stringify(Hashes), fileWrited(pLastFile_b)); return true; }
fixed bug reading hashes.json
coderaiser_minify
train
js
d6a3647af27a6b5c6767e36ea84d5d79778244f1
diff --git a/zxbparser.py b/zxbparser.py index <HASH>..<HASH> 100755 --- a/zxbparser.py +++ b/zxbparser.py @@ -603,12 +603,6 @@ def p_bound_list_bound(p): def p_bound(p): ''' bound : expr ''' - if not is_number(p[1]): - syntax_error(p.lexer.lineno, - 'Array bound must be a constant expression.') - p[0] = None - return - p[0] = make_bound(make_number(OPTIONS.array_base.value, lineno=p.lineno(1)), p[1], p.lexer.lineno) @@ -616,10 +610,6 @@ def p_bound(p): def p_bound_to_bound(p): ''' bound : expr TO expr ''' - if not is_number(p[1], p[3]): - syntax_error(p.lineno(2), 'Array bound must be a constant expression.') - p[0] = None - p[0] = make_bound(p[1], p[3], p.lineno(2))
Redundant code. Check is now done in the make_bound sentence.
boriel_zxbasic
train
py
95b0e94f69dd4a4e7539fec66838c6dbe14ffcaf
diff --git a/lib/beaker-pe/version.rb b/lib/beaker-pe/version.rb index <HASH>..<HASH> 100644 --- a/lib/beaker-pe/version.rb +++ b/lib/beaker-pe/version.rb @@ -3,7 +3,7 @@ module Beaker module PE module Version - STRING = '1.12.0' + STRING = '1.12.1' end end
(GEM) update beaker-pe version to <I>
puppetlabs_beaker-pe
train
rb
347fc51976d3bc7aa8471455f3589bf99eb1cf46
diff --git a/test/runner.js b/test/runner.js index <HASH>..<HASH> 100644 --- a/test/runner.js +++ b/test/runner.js @@ -55,7 +55,7 @@ function topic_sort(a, b) return parseInt(a.substr(1), 10) - parseInt(b.substr(1), 10); } -var timeout = 4 * 60; +var timeout = 5 * 60; module.exports = function (type, connect_and_accept) {
Increate test timeout for travis
davedoesdev_mqlobber
train
js
055ed8d8dea85acbdfa356e1ebce8ccad5777e73
diff --git a/keanu-project/src/main/java/io/improbable/keanu/plating/PlateBuilder.java b/keanu-project/src/main/java/io/improbable/keanu/plating/PlateBuilder.java index <HASH>..<HASH> 100644 --- a/keanu-project/src/main/java/io/improbable/keanu/plating/PlateBuilder.java +++ b/keanu-project/src/main/java/io/improbable/keanu/plating/PlateBuilder.java @@ -37,6 +37,7 @@ public class PlateBuilder<T> { * Build plates from current factory settings * * @return Collection of all created plates + * @throws VertexLabelException which can occur e.g. if the labels don't marry up in the transition mapping */ Plates build(); }
reinstated javadoc @throws info
improbable-research_keanu
train
java
602ec7f66c3866ca8044ed4ff2cf9f22f9243822
diff --git a/test/unittest_inference.py b/test/unittest_inference.py index <HASH>..<HASH> 100644 --- a/test/unittest_inference.py +++ b/test/unittest_inference.py @@ -17,7 +17,7 @@ # with logilab-astng. If not, see <http://www.gnu.org/licenses/>. """tests for the astng inference capabilities """ -from os.path import join +from os.path import join, dirname, abspath import sys from StringIO import StringIO from logilab.common.testlib import TestCase, unittest_main @@ -923,8 +923,8 @@ def f(x): # self.failIf(astng.absolute_import_activated()) # infered = get_name_node(astng, 'unittest_lookup').infer().next() # self.assertIsInstance(infered, nodes.Module) - data = 'from __future__ import absolute_import; import unittest_lookup; print unittest_lookup' - astng = builder.file_build(join('regrtest_data', 'absimport.py'), 'absimport') + fname = join(abspath(dirname(__file__)), 'regrtest_data', 'absimport.py') + astng = builder.file_build(fname, 'absimport') self.failUnless(astng.absolute_import_activated(), True) infered = get_name_node(astng, 'import_package_subpackage_module').infer().next() # failed to import since absolute_import is activated
make test executable as a script
PyCQA_astroid
train
py
dcf6905f098f2ff0b86900f2f5fdb75ed8150282
diff --git a/go/mysql/replication_position.go b/go/mysql/replication_position.go index <HASH>..<HASH> 100644 --- a/go/mysql/replication_position.go +++ b/go/mysql/replication_position.go @@ -68,10 +68,17 @@ func (rp Position) Equal(other Position) bool { // AtLeast returns true if this position is equal to or after another. func (rp Position) AtLeast(other Position) bool { + // The underlying call to the Contains method of the GTIDSet interface + // does not guarantee handling the nil cases correctly. + // So, we have to do nil case handling here if other.GTIDSet == nil { + // If the other GTIDSet is nil, then it is contained + // in all possible GTIDSets, even nil ones. return true } if rp.GTIDSet == nil { + // Here rp GTIDSet is nil but the other GTIDSet isn't. + // So it is not contained in the rp GTIDSet. return false } return rp.GTIDSet.Contains(other.GTIDSet)
docs: added comments explaining the functioning of the AtLeast function
vitessio_vitess
train
go
6b07894ebfaa774656e820b4972a9b8c1c238393
diff --git a/ninja-core/src/main/java/ninja/Result.java b/ninja-core/src/main/java/ninja/Result.java index <HASH>..<HASH> 100644 --- a/ninja-core/src/main/java/ninja/Result.java +++ b/ninja-core/src/main/java/ninja/Result.java @@ -141,15 +141,35 @@ public class Result { return this; } + /** + * => Convenience methods moved to + * Results.redirect()... + * and + * Results.redirectTemporary()... + * @return + */ + @Deprecated public Result redirect(String url) { return addHeader(LOCATION, url); } + /** + * => Convenience methods moved to + * Results.html()... + * @return + */ + @Deprecated public Result html() { contentType = TEXT_HTML; return this; } + /** + * => Convenience methods moved to + * Results.json()... + * @return + */ + @Deprecated public Result json() { contentType = APPLICATON_JSON; return this;
Some deprecated stuff moved to Results.
ninjaframework_ninja
train
java
69a8891683ae1e69ded8699b1c539300be6addf2
diff --git a/src/Http/Middleware/GenerateAdminMenu.php b/src/Http/Middleware/GenerateAdminMenu.php index <HASH>..<HASH> 100644 --- a/src/Http/Middleware/GenerateAdminMenu.php +++ b/src/Http/Middleware/GenerateAdminMenu.php @@ -106,18 +106,12 @@ class GenerateAdminMenu $menu->add('Logout', route('administrator.logout'))->icon('power-off'); })->filter(function ($item) { - $permissions = $item->data('permission'); + $permissions = (array) $item->data('permission'); if (! $permissions) { return true; } - foreach ((array) $permissions as $permission) { - if (currentUser()->can($permission)) { - return true; - } - } - - return false; + return currentUser()->canAtLeast($permissions); }); }
Use canAtLeast to check permission.
yajra_cms-core
train
php
1aaeb69a239768ae4133090ba2f305ab5c62593b
diff --git a/openquake/logs.py b/openquake/logs.py index <HASH>..<HASH> 100644 --- a/openquake/logs.py +++ b/openquake/logs.py @@ -118,6 +118,11 @@ class AMQPHandler(logging.Handler): # pylint: disable=R0902 by using the normal `%(job_key)s` Python syntax. """ # pylint: disable=W0105 + LEVELNAMES = { + 'WARNING': 'WARN', + 'CRITICAL': 'FATAL', + } + # pylint: disable=R0913 def __init__(self, host="localhost:5672", username="guest", password="guest", virtual_host="/", @@ -166,11 +171,14 @@ class AMQPHandler(logging.Handler): # pylint: disable=R0902 exc_info=record.exc_info, func=record.funcName) # the documentation says that formatters use .args; in reality - # the reach directly into __dict__ + # they reach directly into __dict__ for key, value in self.MDC.items(): if key not in new_record.__dict__: new_record.__dict__[key] = value + new_record.__dict__['loglevel'] = \ + self.LEVELNAMES.get(new_record.levelname, new_record.levelname) + return new_record def emit(self, record):
Add a levelname Python logging key that is consistent with Java level names.
gem_oq-engine
train
py
d217312b6cdfa1c44d453c762873d908e88d79f9
diff --git a/panflute/base.py b/panflute/base.py index <HASH>..<HASH> 100644 --- a/panflute/base.py +++ b/panflute/base.py @@ -13,6 +13,9 @@ from itertools import chain from .containers import ListContainer, DictContainer from .utils import check_type, encode_dict # check_group +import sys +py2 = sys.version_info[0] == 2 + # --------------------------- # Meta Classes # --------------------------- @@ -79,8 +82,12 @@ class Element(object): # --------------------------- def _set_ica(self, identifier, classes, attributes): - self.identifier = check_type(identifier, str) - self.classes = [check_type(cl, str) for cl in classes] + if not py2: + self.identifier = check_type(identifier, str) + self.classes = [check_type(cl, str) for cl in classes] + else: + self.identifier = check_type(identifier, unicode) + self.classes = [check_type(cl, unicode) for cl in classes] self.attributes = OrderedDict(attributes) def _ica_to_json(self):
base.py: check_type as unicode instead of str in py2
sergiocorreia_panflute
train
py
f67a6d12a8d54d85c290df8164328f28eb068ba2
diff --git a/lib/Model.php b/lib/Model.php index <HASH>..<HASH> 100644 --- a/lib/Model.php +++ b/lib/Model.php @@ -307,6 +307,14 @@ class Model extends AbstractModel implements ArrayAccess,Iterator { $this->hook('afterLoad'); return $this; } + function tryLoadBy($field,$cond=undefined,$value=undefined){ + if($this->loaded())$this->unload(); + $this->hook('beforeLoadBy',array($field,$cond,$value)); + if(!$this->loaded())$this->controller->tryLoadBy($this,$field,$cond,$value); + if(!$this->loaded())return $this; + $this->hook('afterLoad'); + return $this; + } function loadBy($field,$cond=undefined,$value=undefined){ if($this->loaded())$this->unload(); $this->hook('beforeLoadBy',array($field,$cond,$value));
Update lib/Model.php introduce tryLoadBy in Model (was set in controllers only and wasn't directly available from Model).
atk4_atk4
train
php
8340eab38da4d27a21b46bea4d1daa484179801f
diff --git a/src/resolvers/__tests__/updateById-test.js b/src/resolvers/__tests__/updateById-test.js index <HASH>..<HASH> 100644 --- a/src/resolvers/__tests__/updateById-test.js +++ b/src/resolvers/__tests__/updateById-test.js @@ -238,6 +238,7 @@ describe('updateById() ->', () => { it('should have all fields optional in record', () => { const resolver = updateById(UserModel, UserTC); + expect(resolver.getArgITC('record').getFieldTypeName('_id')).toBe('MongoID!'); expect(resolver.getArgITC('record').getFieldTypeName('name')).toBe('String'); expect(resolver.getArgITC('record').getFieldTypeName('age')).toBe('Float'); });
test: add missing test case for updateById resolver
graphql-compose_graphql-compose-mongoose
train
js
ac4edd1a1a35ef357c1e017e146c0b85480b64a5
diff --git a/wlog_test.go b/wlog_test.go index <HASH>..<HASH> 100644 --- a/wlog_test.go +++ b/wlog_test.go @@ -21,21 +21,25 @@ func TestNew(t *testing.T) { } } -func ExampleNew() { - basic := New(os.Stdin, os.Stdout, os.Stdout) - basic.Info("Info message") - basic.Output("Output message") - basic.Running("Running message") - basic.Success("Success message") - basic.Error("Error message") - basic.Warn("Warning message") +func Example() { + var ui UI + ui = New(os.Stdin, os.Stdout, os.Stdout) + ui = AddPrefix("", "", Check, "", Cross, "!", "~", ui) + ui = AddConcurrent(ui) + + ui.Info("Info message") + ui.Output("Output message") + ui.Running("Running message") + ui.Success("Success message") + ui.Error("Error message") + ui.Warn("Warning message") // Output: // Info message // Output message - // Running message - // Success message - // Error message - // Warning message + // ~ Running message + // ✓ Success message + // ✗ Error message + // ! Warning message } func TestAddColor(t *testing.T) {
Added prefix and concurrent to example test
dixonwille_wlog
train
go
3ddfd6cfe7f4f4125d3272f41e254c0fa949d322
diff --git a/python/ccxt/base/exchange.py b/python/ccxt/base/exchange.py index <HASH>..<HASH> 100644 --- a/python/ccxt/base/exchange.py +++ b/python/ccxt/base/exchange.py @@ -467,11 +467,13 @@ class Exchange(object): else: cls.define_rest_api(value, method_name, paths + [key]) - def throttle(self): + def throttle(self, cost=None): now = float(self.milliseconds()) elapsed = now - self.lastRestRequestTimestamp - if elapsed < self.rateLimit: - delay = self.rateLimit - elapsed + cost = 1 if cost is None else cost + sleep_time = self.rateLimit * cost + if elapsed < sleep_time: + delay = sleep_time - elapsed time.sleep(delay / 1000.0) def fetch2(self, path, api='public', method='GET', params={}, headers=None, body=None):
add costs to synchronous python throttler
ccxt_ccxt
train
py
572b1c2db9931495b0010d806e4b067efb0a564b
diff --git a/pkg/controller/service/service_controller.go b/pkg/controller/service/service_controller.go index <HASH>..<HASH> 100644 --- a/pkg/controller/service/service_controller.go +++ b/pkg/controller/service/service_controller.go @@ -115,7 +115,6 @@ func New( broadcaster.StartLogging(glog.Infof) broadcaster.StartRecordingToSink(&v1core.EventSinkImpl{Interface: v1core.New(kubeClient.Core().RESTClient()).Events("")}) recorder := broadcaster.NewRecorder(scheme.Scheme, v1.EventSource{Component: "service-controller"}) - broadcaster.StartLogging(glog.Infof) if kubeClient != nil && kubeClient.Core().RESTClient().GetRateLimiter() != nil { metrics.RegisterMetricAndTrackRateLimiterUsage("service_controller", kubeClient.Core().RESTClient().GetRateLimiter())
Remove redundant call to StartLogging in service_controller. Fixes #<I>
kubernetes_kubernetes
train
go
dae48711b237ebf1e18828ee65380eca2e2e15d9
diff --git a/lib/proto/file.js b/lib/proto/file.js index <HASH>..<HASH> 100644 --- a/lib/proto/file.js +++ b/lib/proto/file.js @@ -3,14 +3,14 @@ const fs = require('fs'); const LinkCheckResult = require('../LinkCheckResult'); const path = require('path'); -const process = require('process'); +const processModule = require('process'); const url = require('url'); module.exports = { check: function (link, baseUrl, callback) { let filepath = url.parse(link, false, true).path || ''; if (!path.isAbsolute(filepath)) { - const basepath = url.parse(baseUrl, false, true).path || process.cwd(); + const basepath = url.parse(baseUrl, false, true).path || processModule.cwd(); filepath = path.resolve(basepath, filepath); }
fix for interoperatibility with atom and electron based applications
tcort_link-check
train
js
07e8625558dd59f76aa1d1df865f7a73f87b81e3
diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index <HASH>..<HASH> 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -129,7 +129,7 @@ class Chip: if self.detector.check_dt_compatible_value("rockchip,rk3308"): return chips.RK3308 - + if self.detector.check_dt_compatible_value("rockchip,rk3288"): return chips.RK3288 diff --git a/adafruit_platformdetect/constants/boards.py b/adafruit_platformdetect/constants/boards.py index <HASH>..<HASH> 100644 --- a/adafruit_platformdetect/constants/boards.py +++ b/adafruit_platformdetect/constants/boards.py @@ -348,9 +348,7 @@ _ONION_OMEGA_BOARD_IDS = ( _PINE64_DEV_IDS = (PINE64, PINEBOOK, PINEPHONE) # ASUS Tinker Board -_ASUS_TINKER_BOARD_DEV_IDS = ( -ASUS_TINKER_BOARD -) +_ASUS_TINKER_BOARD_DEV_IDS = ASUS_TINKER_BOARD # UDOO _UDOO_BOARD_IDS = {UDOO_BOLT_V8: ("SC40-2000-0000-C0|C",)}
Black formatting updating chip.py and boards.py to be Black formatted
adafruit_Adafruit_Python_PlatformDetect
train
py,py
b88c0f579aabf4d32e8b6c2e3d861506e0f9a8f1
diff --git a/lib/sinatra/base.rb b/lib/sinatra/base.rb index <HASH>..<HASH> 100644 --- a/lib/sinatra/base.rb +++ b/lib/sinatra/base.rb @@ -635,7 +635,14 @@ module Sinatra # when no file is specified. def use_in_file_templates!(file=nil) file ||= caller_files.first - if data = ::IO.read(file).split('__END__')[1] + + begin + data = ::IO.read(file).split('__END__')[1] + rescue + data = nil + end + + if data data.gsub!(/\r\n/, "\n") template = nil data.each_line do |line| diff --git a/test/templates_test.rb b/test/templates_test.rb index <HASH>..<HASH> 100644 --- a/test/templates_test.rb +++ b/test/templates_test.rb @@ -75,6 +75,16 @@ class TemplatesTest < Test::Unit::TestCase assert_equal "this is foo\n\n", @app.templates[:foo] assert_equal "X\n= yield\nX\n", @app.templates[:layout] end + + test 'use_in_file_templates simply ignores IO errors' do + assert_nothing_raised { + mock_app { + use_in_file_templates!('/foo/bar') + } + } + + assert @app.templates.empty? + end end __END__
Fixed an uncought exception when run on the Google App Engine infrastructure.
sinatra_sinatra
train
rb,rb
e2705fb5301cff13a62dfd5dddc5df0c642094b7
diff --git a/src/passes/KawaseBlurPass.js b/src/passes/KawaseBlurPass.js index <HASH>..<HASH> 100644 --- a/src/passes/KawaseBlurPass.js +++ b/src/passes/KawaseBlurPass.js @@ -70,6 +70,7 @@ export class KawaseBlurPass extends Pass { * devices and screen resolutions. * * @type {Resizer} + * @deprecated Use getResolution() instead. */ this.resolution = new Resizer(this, width, height, resolutionScale); @@ -114,6 +115,18 @@ export class KawaseBlurPass extends Pass { } /** + * Returns the resolution settings. + * + * @return {Resolution} The resolution. + */ + + getResolution() { + + return this.resolution; + + } + + /** * The current width of the internal render targets. * * @type {Number}
Deprecate resolution Replaced by getResolution().
vanruesc_postprocessing
train
js
962505ad0187137ecd496971199474cbd21725bc
diff --git a/pkg/controller/persistentvolume/controller_test.go b/pkg/controller/persistentvolume/controller_test.go index <HASH>..<HASH> 100644 --- a/pkg/controller/persistentvolume/controller_test.go +++ b/pkg/controller/persistentvolume/controller_test.go @@ -111,8 +111,12 @@ func TestControllerSync(t *testing.T) { defer ctrl.Stop() go ctrl.Run() - // Wait for the controller to pass initial sync. - for !ctrl.volumeController.HasSynced() || !ctrl.claimController.HasSynced() { + // Wait for the controller to pass initial sync and fill its caches. + for !ctrl.volumeController.HasSynced() || + !ctrl.claimController.HasSynced() || + len(ctrl.claims.ListKeys()) < len(test.initialClaims) || + len(ctrl.volumes.store.ListKeys()) < len(test.initialVolumes) { + time.Sleep(10 * time.Millisecond) } glog.V(4).Infof("controller synced, starting test")
Wait for all volumes/claims to get synced in unit test. Controller.HasSynced() returns true when all initial claims/volumes were sent to appropriate goroutines, not when the goroutine has actually processed them.
kubernetes_kubernetes
train
go
c9124121b2122cf0509208c4bf8a25aba4005003
diff --git a/library/Customizer/Sections/Typography.php b/library/Customizer/Sections/Typography.php index <HASH>..<HASH> 100644 --- a/library/Customizer/Sections/Typography.php +++ b/library/Customizer/Sections/Typography.php @@ -25,15 +25,13 @@ class Typography 'label' => $args['label'] ?? esc_html__(ucfirst($key), 'municipio'), // does not get translated 'section' => self::SECTION_ID, 'priority' => 10, - // 'transport' => 'auto', // TODO: Auto does not work as expected (ignores property argument in output) 'choices' => [ 'fonts' => [ - 'google' => [ 'popularity', 30 ], + 'google' => [ 'popularity', 200 ], ], ], 'default' => $args['default'] ?? [], 'output' => $args['output'] ?? [] - ]); } }
Load up to <I> fonts i typhography
helsingborg-stad_Municipio
train
php
93e7a5c3d166d713bc6775fb2a2334d745db1a03
diff --git a/lib/rails_semantic_logger/version.rb b/lib/rails_semantic_logger/version.rb index <HASH>..<HASH> 100644 --- a/lib/rails_semantic_logger/version.rb +++ b/lib/rails_semantic_logger/version.rb @@ -1,3 +1,3 @@ module RailsSemanticLogger #:nodoc - VERSION = "1.6.0" + VERSION = "1.6.1" end
New gem including Rails config fix
rocketjob_rails_semantic_logger
train
rb
ea06d2fea3a86e1610c06ee6512f87d29b0c9dc7
diff --git a/src/vistir/compat.py b/src/vistir/compat.py index <HASH>..<HASH> 100644 --- a/src/vistir/compat.py +++ b/src/vistir/compat.py @@ -325,7 +325,7 @@ def fs_encode(path): if path is None: raise TypeError("expected a valid path to encode") if isinstance(path, six.text_type): - if six.PY3: + if six.PY2: return b"".join( ( _byte(ord(c) - 0xDC00) @@ -351,7 +351,7 @@ def fs_decode(path): if path is None: raise TypeError("expected a valid path to decode") if isinstance(path, six.binary_type): - if six.PY3: + if six.PY2: from array import array indexes = _invalid_utf8_indexes(array(str("B"), path))
Use the correct approach for bytes on python 2 and 3
sarugaku_vistir
train
py
b31ffb74b3d240a21c7e4661d9e562ab9a322615
diff --git a/lib/rest-ftp-daemon/job.rb b/lib/rest-ftp-daemon/job.rb index <HASH>..<HASH> 100644 --- a/lib/rest-ftp-daemon/job.rb +++ b/lib/rest-ftp-daemon/job.rb @@ -385,6 +385,7 @@ module RestFtpDaemon def newstatus name @status = name + worker_is_still_active end def flag_default name, default @@ -595,6 +596,8 @@ module RestFtpDaemon newstatus JOB_STATUS_UPLOADING @ftp.putbinaryfile(source_filename, target_real, @chunk_size) do |block| + # Update the worker activity marker + worker_is_still_active # Update job status after this block transfer ftp_transfer_block block @@ -673,6 +676,10 @@ module RestFtpDaemon 8*total.to_f / (Time.now - last_timestamp) end + def worker_is_still_active + Thread.current.thread_variable_set :updted_at, Time.now + end + def oops event, exception, error = nil, include_backtrace = false # Log this error error = exception.class if error.nil?
Job: added a worker_is_still_active mechanism to touch worker updated_at regularly
bmedici_rest-ftp-daemon
train
rb
538dd177dcdfad7753ccbbf9f85298393fc60e05
diff --git a/lib/jellyfish/multi_actions.rb b/lib/jellyfish/multi_actions.rb index <HASH>..<HASH> 100644 --- a/lib/jellyfish/multi_actions.rb +++ b/lib/jellyfish/multi_actions.rb @@ -9,9 +9,8 @@ module Jellyfish def call env @env = env - acts = dispatch catch(:halt){ - acts.inject(nil){ |_, route_block| block_call(*route_block) } + dispatch.inject(nil){ |_, route_block| block_call(*route_block) } } || block_call(nil, Identity) # respond the default if halted end
multi_actions.rb: we don't need that acts now
godfat_jellyfish
train
rb
7daaf6080d2a7c93bb9a5521016ca5f7294bc3a4
diff --git a/annis-utilsgui/src/main/resources/annis/gui/visualizers/partitur/PartiturVisualizer.js b/annis-utilsgui/src/main/resources/annis/gui/visualizers/partitur/PartiturVisualizer.js index <HASH>..<HASH> 100644 --- a/annis-utilsgui/src/main/resources/annis/gui/visualizers/partitur/PartiturVisualizer.js +++ b/annis-utilsgui/src/main/resources/annis/gui/visualizers/partitur/PartiturVisualizer.js @@ -80,6 +80,8 @@ function toggleAnnotation(element, isOver) { }); } + $("td[time]").bind("hover").css("cursor", "pointer"); + /** * iterate over all media vis and call seekAndPlay()-function. The ids of the media vis are saved in a * global array mediaIDs.
added cursor pointer for table cells with time attribute
korpling_ANNIS
train
js
3953e5342bbf2bbd0f64d7be1316705bb465b3ae
diff --git a/packages/vaex-core/setup.py b/packages/vaex-core/setup.py index <HASH>..<HASH> 100644 --- a/packages/vaex-core/setup.py +++ b/packages/vaex-core/setup.py @@ -50,7 +50,7 @@ setup(name=name+'-core', install_requires=install_requires_core, license=license, package_data={'vaex': ['test/files/*.fits', 'test/files/*.vot', 'test/files/*.hdf5']}, - packages=['vaex', 'vaex.core', 'vaex.file', 'vaex.test', 'vaex.ext'], + packages=['vaex', 'vaex.core', 'vaex.file', 'vaex.test', 'vaex.ext', 'vaex.misc'], ext_modules=[extension_vaexfast], zip_safe=False, entry_points={
vaex-core: include vaex.misc subpackage
vaexio_vaex
train
py
203beb78860b5e646723a765a6817c412c20a8d9
diff --git a/src/sap.ui.mdc/src/sap/ui/mdc/table/Column.js b/src/sap.ui.mdc/src/sap/ui/mdc/table/Column.js index <HASH>..<HASH> 100644 --- a/src/sap.ui.mdc/src/sap/ui/mdc/table/Column.js +++ b/src/sap.ui.mdc/src/sap/ui/mdc/table/Column.js @@ -102,7 +102,7 @@ sap.ui.define([ this.setProperty("dataProperties", aDataProperties); if (!this.getDataProperty()) { - this.setProperty("dataProperty", aDataProperties[0]); + this.setProperty("dataProperty", this.getDataProperties()[0]); } Log.error("The property 'dataProperties' is deprecated, please use the property 'dataProperty' instead", this);
[INTERNAL] Column: fix setter for dataProperties Incorrect value was set to the getDataProperty via the dataProperties, which is now fixed. Change-Id: I<I>d0dd1ae<I>d7e<I>cc2e<I>fedc4d9d3afb4
SAP_openui5
train
js
51812b8cf6795a3e3869f9640c55f3a066fdf259
diff --git a/src/transform/bindWindowWithoutExports.js b/src/transform/bindWindowWithoutExports.js index <HASH>..<HASH> 100644 --- a/src/transform/bindWindowWithoutExports.js +++ b/src/transform/bindWindowWithoutExports.js @@ -2,10 +2,12 @@ import { shimRequire } from './constant'; export default function bindWindowWithoutExports() { + // if a module doesn't need anything to be exported, it is likely, that it exports itself properly + // therefore it is not a good idea to override the module here, however we need to still disable require, return { - header: `\n(function webpackShim(define) {\n\n`, - footer: `\n\n}).call(global, undefined);\n`, + header: `\n(function webpackShim(module, define, require) {\n\n`, + footer: `\n\n}).call(global, module, undefined, undefined);\n`, } }
fixing invalid require statements - fixes problems with libraries that contain requires that cannot be resolved but include proper export statements
zinserjan_shim-loader
train
js
607cd29901a9f7e6424f99d6ec084f40c19bbfa0
diff --git a/DataFixtures/ORM/LoadOrdersData.php b/DataFixtures/ORM/LoadOrdersData.php index <HASH>..<HASH> 100644 --- a/DataFixtures/ORM/LoadOrdersData.php +++ b/DataFixtures/ORM/LoadOrdersData.php @@ -71,6 +71,7 @@ class LoadOrdersData extends DataFixture $this->createPayment($order); } + $order->setCreatedAt($this->faker->dateTimeThisDecade); $this->setReference('Sylius.Order-'.$i, $order); $manager->persist($order);
Add code to report type - wip.
Sylius_SyliusFixturesBundle
train
php
0ecc6294513f9519f6752f86c75c2f31d9cd492b
diff --git a/test/peer-to-peer-load-balance.js b/test/peer-to-peer-load-balance.js index <HASH>..<HASH> 100644 --- a/test/peer-to-peer-load-balance.js +++ b/test/peer-to-peer-load-balance.js @@ -161,8 +161,8 @@ allocCluster.test('p2p requests from 40 -> 40 with minConnections', { mean: [45, 55], max: 120, p75: [55, 70], - p95: 95, - variance: 450 + p95: 100, + variance: 500 }); cassert.report(assert, 'expected request distribution to be ok');
test: change numeric values to reduce flaps on travis
uber_tchannel-node
train
js
fb88cc72d4b6c1da074807f0d39019b3980ad355
diff --git a/app/controllers/lentil/photographers_controller.rb b/app/controllers/lentil/photographers_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/lentil/photographers_controller.rb +++ b/app/controllers/lentil/photographers_controller.rb @@ -1,7 +1,7 @@ module Lentil class PhotographersController < Lentil::ApplicationController def index - @photographers = User.joins(:images).where("state = 1").group(:id).order(:user_name) + @photographers = User.joins(:images).where("state = 1").group('lentil_users.id').order(:user_name) @title = "Photographers" end
be specific about grouping by lentil_users.id
NCSU-Libraries_lentil
train
rb
db7ce89b446e06375eac8a6ff3854f93d4e29109
diff --git a/pymc/distributions.py b/pymc/distributions.py index <HASH>..<HASH> 100755 --- a/pymc/distributions.py +++ b/pymc/distributions.py @@ -180,7 +180,7 @@ def new_dist_class(*new_class_args): else: arg_dict_out[k] = args[i] except: - raise ValueError('Too many positional arguments provided. Arguments for class ' + self.__class__.__name__ + ' are: ' + str(all_args_needed)) + raise ValueError('Too many positional arguments provided. Arguments for class ' + self.__class__.__name__ + ' are: ' + str(args_needed)) # Sort keyword arguments
FIX: all_args_needed does not exist, renamed to args_needed.
pymc-devs_pymc
train
py
a9c6064ddc9d0074998b5def5d8e0d348594333b
diff --git a/src/Infrastructure/Expression/ExpressionService.php b/src/Infrastructure/Expression/ExpressionService.php index <HASH>..<HASH> 100644 --- a/src/Infrastructure/Expression/ExpressionService.php +++ b/src/Infrastructure/Expression/ExpressionService.php @@ -22,16 +22,14 @@ class ExpressionService implements ExpressionServiceInterface protected function registerExtensions(ExpressionLanguage $expression_language) { // @see http://symfony.com/doc/current/components/expression_language/syntax.html - /* $this->expression_language->register( - 'is_even_hour', - function($str) { - return sprintf('date("H")%2==0'); + 'match_event', + function($event, $pattern) { + return sprintf('(!!preg_match("%1$s", "%2$s"))', $pattern, $event->getType()); }, - function ($arguments) { - return date("H")%2==0; + function ($args, $event, $pattern) { + return !!preg_match("~$pattern~", $event->getType()); } ); - */ } }
add expr for event-matching to expression-service
honeybee_honeybee
train
php
3feb754553d34c59619b2d98c5d28b6c55ae5e11
diff --git a/src/screens.js b/src/screens.js index <HASH>..<HASH> 100644 --- a/src/screens.js +++ b/src/screens.js @@ -42,7 +42,7 @@ export class Screen extends React.Component { // https://github.com/react-navigation/react-navigation/issues/4886 /* eslint-disable no-unused-vars */ - const { active, ...props } = this.props; + const { active, onComponentRef, ...props } = this.props; return <Animated.View {...props} ref={this.setRef} />; } else {
Filter out onComponentRef to avoid passing it to the fallback View component
kmagiera_react-native-screens
train
js
49a48ced892410a27281f186bd1d52abccd04ce7
diff --git a/lib/Cake/Model/Datasource/Database/Sqlserver.php b/lib/Cake/Model/Datasource/Database/Sqlserver.php index <HASH>..<HASH> 100644 --- a/lib/Cake/Model/Datasource/Database/Sqlserver.php +++ b/lib/Cake/Model/Datasource/Database/Sqlserver.php @@ -174,7 +174,7 @@ class Sqlserver extends DboSource { if ($cache !== null) { return $cache; } - $result = $this->_execute("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'"); + $result = $this->_execute("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES"); if (!$result) { $result->closeCursor();
Don't restrict to BASE_TABLE. This allows Views, and custom table types to be connected to models in SqlServer. Fixes #<I>
cakephp_cakephp
train
php
e126b8efd49cccd70c88ec32a5860e33ac848fda
diff --git a/lib/epub/publication/package/manifest.rb b/lib/epub/publication/package/manifest.rb index <HASH>..<HASH> 100644 --- a/lib/epub/publication/package/manifest.rb +++ b/lib/epub/publication/package/manifest.rb @@ -61,7 +61,7 @@ module EPUB def read rootfile = Addressable::URI.parse(manifest.package.book.ocf.container.rootfile.full_path) Zip::Archive.open(manifest.package.book.epub_file) {|zip| - path = rootfile + href.request_uri + path = Addressable::URI.unescape(rootfile + href.request_uri) zip.fopen(path.to_s).read } end
unescape zip paths as urls
KitaitiMakoto_epub-parser
train
rb
467cacbf914473a9602581aea68558a4332a2de7
diff --git a/packages/ember-runtime/lib/system/core_object.js b/packages/ember-runtime/lib/system/core_object.js index <HASH>..<HASH> 100644 --- a/packages/ember-runtime/lib/system/core_object.js +++ b/packages/ember-runtime/lib/system/core_object.js @@ -74,10 +74,10 @@ function makeCtor() { throw new Ember.Error("Ember.Object.create only accepts objects."); } - var keyNames = []; - if (properties) { - keyNames = Ember.keys(properties); - } + if (!properties) { continue; } + + var keyNames = Ember.keys(properties); + for (var j = 0, ll = keyNames.length; j < ll; j++) { var keyName = keyNames[j]; if (!properties.hasOwnProperty(keyName)) { continue; }
short-circuit inner loop if no properties are present.
emberjs_ember.js
train
js
a4debb583c0435d437cf83cf5614a18b9e328db8
diff --git a/src/tuwien/auto/calimero/mgmt/LocalDeviceManagement.java b/src/tuwien/auto/calimero/mgmt/LocalDeviceManagement.java index <HASH>..<HASH> 100644 --- a/src/tuwien/auto/calimero/mgmt/LocalDeviceManagement.java +++ b/src/tuwien/auto/calimero/mgmt/LocalDeviceManagement.java @@ -264,12 +264,9 @@ abstract class LocalDeviceManagement implements PropertyAdapter send(new CEMIDevMgmt(CEMIDevMgmt.MC_PROPREAD_REQ, DEVICE_OBJECT, 1, PropertyAccess.PID.IO_LIST, 1, objects), KNXnetIPConnection.WAIT_FOR_CON); final byte[] ret = findFrame(CEMIDevMgmt.MC_PROPREAD_CON); - int lastObjType = -1; for (int i = 0; i < objects; ++i) { final int objType = (ret[2 * i] & 0xff) << 8 | ret[2 * i + 1] & 0xff; - if (objType != lastObjType) - interfaceObjects.add(new Pair(i, objType)); - lastObjType = objType; + interfaceObjects.add(new Pair(i, objType)); } }
Allow multiple object instances of an interface object
calimero-project_calimero-core
train
java
46afa3782eb1a6cad2f1c53f0c66a71df0c170c8
diff --git a/kerncraft/machinemodel.py b/kerncraft/machinemodel.py index <HASH>..<HASH> 100755 --- a/kerncraft/machinemodel.py +++ b/kerncraft/machinemodel.py @@ -55,7 +55,7 @@ CHANGES_SINCE = OrderedDict([ Replaced 'micro-architecture' and 'micro-architecture modeller' with 'in-core model' ordered map, which allows multiple model tools to be supported by a single machine file. The first entry is used by default. - + Also added stats to benchmark measurements for (manual) validation of model parameters. """), @@ -302,7 +302,7 @@ class MachineModel(object): benchmarks['kernels'][kernel]['fastest bench kernel'] is None: mem_level = 'L1' fastest_kernel = find_fastest_bench_kernel( - get_available_bench_kernels(prefix=kernel, excludes=['_mem', '_sp']), + get_available_bench_kernels(prefix=kernel, excludes=['_mem', '_sp', '_nt']), total_size=int(float( benchmarks['measurements'][mem_level][1]['total size'][0]) / 1000), threads_per_core=1,
added _nt to bench kernel blacklist
RRZE-HPC_kerncraft
train
py