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
8bf79a3155049c71b0183ffaf60f19f674d457d0
diff --git a/src/Panel.js b/src/Panel.js index <HASH>..<HASH> 100644 --- a/src/Panel.js +++ b/src/Panel.js @@ -149,7 +149,7 @@ class Panel extends React.Component { // Convert to array so we can re-use keys. React.Children.toArray(rawChildren).forEach(child => { - if (React.isValidElement(child) && child.props.fill) { + if (this.shouldRenderFill(child)) { maybeAddBody(); // Remove the child's unknown `fill` prop.
Refact Panel to use shouldRenderFill in renderBody function
react-bootstrap_react-bootstrap
train
js
28c0f8f5c1fb8c9d2993c89e1a4480b150b8ec12
diff --git a/tests/test_test.py b/tests/test_test.py index <HASH>..<HASH> 100644 --- a/tests/test_test.py +++ b/tests/test_test.py @@ -403,4 +403,4 @@ def test_multiple_cookies(): resp = client.get('/') assert resp.data == '[]' resp = client.get('/') - assert resp.data == "[('test1', u'foo,'), ('test2', u'bar')]" + assert resp.data == "[('test1', u'foo'), ('test2', u'bar')]" diff --git a/werkzeug/test.py b/werkzeug/test.py index <HASH>..<HASH> 100644 --- a/werkzeug/test.py +++ b/werkzeug/test.py @@ -152,7 +152,7 @@ class _TestCookieJar(CookieJar): for cookie in self: cvals.append('%s=%s' % (cookie.name, cookie.value)) if cvals: - environ['HTTP_COOKIE'] = ', '.join(cvals) + environ['HTTP_COOKIE'] = '; '.join(cvals) def extract_wsgi(self, environ, headers): """Extract the server's set-cookie headers as cookies into the
Fixed a typo that broke a test and multiple cookies in test client
pallets_werkzeug
train
py,py
47d163d465aa16873c01609983291a032a707a9f
diff --git a/kana2/attridict.py b/kana2/attridict.py index <HASH>..<HASH> 100644 --- a/kana2/attridict.py +++ b/kana2/attridict.py @@ -8,6 +8,8 @@ import functools from multiprocessing.pool import ThreadPool from typing import Tuple +from zenlog import log + from . import MAX_TOTAL_THREADS_SEMAPHORE @@ -46,7 +48,16 @@ class AttrIndexedDict(collections.UserDict, abc.ABC): if _threaded: pool = ThreadPool(processes=8) - pool.map(work, self.data.values()) + + try: + pool.map(work, self.data.values()) + except KeyboardInterrupt: + log.warn("CTRL-C caught, finishing current tasks...") + pool.terminate() + else: + pool.close() + + pool.join() return self for item in self.data.values():
Correctly handle CTRL-C in attridict threaded map
mirukan_lunafind
train
py
c81cf226590a37c503b269198d2e53b9fd85a1fd
diff --git a/src/java/com/threerings/parlor/game/GameManager.java b/src/java/com/threerings/parlor/game/GameManager.java index <HASH>..<HASH> 100644 --- a/src/java/com/threerings/parlor/game/GameManager.java +++ b/src/java/com/threerings/parlor/game/GameManager.java @@ -1,5 +1,5 @@ // -// $Id: GameManager.java,v 1.52 2002/10/27 23:54:32 shaper Exp $ +// $Id: GameManager.java,v 1.53 2002/11/02 01:20:59 shaper Exp $ package com.threerings.parlor.game; @@ -704,13 +704,21 @@ public class GameManager extends PlaceManager { BodyObject plobj = (BodyObject)caller; - // make a note of this player's oid + // get the user's player index int pidx = _gameobj.getPlayerIndex(plobj.username); if (pidx == -1) { - Log.warning("Received playerReady() from non-player? " + - "[caller=" + caller + "]."); + // only complain if this is not a party game, since it's + // perfectly normal to receive a player ready notification + // from a user entering a party game in which they're not yet + // a participant + if (!_gameconfig.isPartyGame()) { + Log.warning("Received playerReady() from non-player? " + + "[caller=" + caller + "]."); + } return; } + + // make a note of this player's oid _playerOids[pidx] = plobj.getOid(); // if everyone is now ready to go, get things underway
Don't complain about receiving playerReady() for non-players if the game is a party game. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1
threerings_narya
train
java
b8afe3052086547879ebf28d6e36207e0d370710
diff --git a/python/pyspark/rdd.py b/python/pyspark/rdd.py index <HASH>..<HASH> 100644 --- a/python/pyspark/rdd.py +++ b/python/pyspark/rdd.py @@ -29,6 +29,7 @@ from subprocess import Popen, PIPE from tempfile import NamedTemporaryFile from threading import Thread import warnings +from heapq import heappush, heappop, heappushpop from pyspark.serializers import NoOpSerializer, CartesianDeserializer, \ BatchedSerializer, CloudPickleSerializer, PairDeserializer, pack_long @@ -660,6 +661,30 @@ class RDD(object): m1[k] += v return m1 return self.mapPartitions(countPartition).reduce(mergeMaps) + + def top(self, num): + """ + Get the top N elements from a RDD. + + Note: It returns the list sorted in ascending order. + >>> sc.parallelize([10, 4, 2, 12, 3]).top(1) + [12] + >>> sc.parallelize([2, 3, 4, 5, 6]).cache().top(2) + [5, 6] + """ + def topIterator(iterator): + q = [] + for k in iterator: + if len(q) < num: + heappush(q, k) + else: + heappushpop(q, k) + yield q + + def merge(a, b): + return next(topIterator(a + b)) + + return sorted(self.mapPartitions(topIterator).reduce(merge)) def take(self, num): """
SPARK-<I> Added top in python.
apache_spark
train
py
e2fc31a648452fe2ba85ccea805347637cefc37c
diff --git a/scripts/test-contracts.js b/scripts/test-contracts.js index <HASH>..<HASH> 100644 --- a/scripts/test-contracts.js +++ b/scripts/test-contracts.js @@ -27,7 +27,7 @@ const start = async () => { runTests() // watch contracts - watch('./contracts/contracts', { recursive: true }, async (evt, name) => { + watch(['./contracts/contracts', './contracts/test'], { recursive: true }, async (evt, name) => { console.log('%s changed.', name) runTests() })
Watch contract test files and auto rerun contract tests on change.
OriginProtocol_origin-js
train
js
cddbc2cc1af5099294e71831bf256bc85bf5dfb9
diff --git a/src/actions.js b/src/actions.js index <HASH>..<HASH> 100644 --- a/src/actions.js +++ b/src/actions.js @@ -290,7 +290,7 @@ const initialize: Initialize = ( form: string, values: Object, keepDirty?: boolean | Object, - otherMeta?: Object = {} + otherMeta: Object = {} ): InitializeAction => { if (keepDirty instanceof Object) { otherMeta = keepDirty diff --git a/src/createField.js b/src/createField.js index <HASH>..<HASH> 100644 --- a/src/createField.js +++ b/src/createField.js @@ -71,8 +71,6 @@ const createField = (structure: Structure<*, *>) => { this.props._reduxForm.unregister(this.name) } - ref = React.createRef() - getRenderedComponent(): ?Component<*, *> { invariant( this.props.forwardRef,
refactor(createField): remove duplicated ref
erikras_redux-form
train
js,js
8c08a6ec9d50e73d8299e8881596f726cf385075
diff --git a/jenkins/test-history/gen_json.py b/jenkins/test-history/gen_json.py index <HASH>..<HASH> 100755 --- a/jenkins/test-history/gen_json.py +++ b/jenkins/test-history/gen_json.py @@ -193,7 +193,7 @@ def main(server, match): """Collect test info in matching jobs.""" print('Finding tests in jobs matching {} at server {}'.format( match, server)) - matcher = re.compile(match) + matcher = re.compile(match).match tests = get_tests(server, matcher) with open('tests.json', 'w') as buf: json.dump(tests, buf, sort_keys=True)
Fix test-history. RE objects aren't callable.
kubernetes_test-infra
train
py
88dc0cc59be06f19de1d74cadad0851178820619
diff --git a/core/src/main/java/org/infinispan/distribution/ConsistentHashHelper.java b/core/src/main/java/org/infinispan/distribution/ConsistentHashHelper.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/infinispan/distribution/ConsistentHashHelper.java +++ b/core/src/main/java/org/infinispan/distribution/ConsistentHashHelper.java @@ -4,6 +4,7 @@ import org.infinispan.config.Configuration; import org.infinispan.remoting.transport.Address; import org.infinispan.util.Util; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.LinkedList; @@ -17,7 +18,7 @@ import java.util.List; */ public class ConsistentHashHelper { - /** + /** * Returns a new consistent hash of the same type with the given address removed. * * @param ch consistent hash to start with @@ -30,7 +31,7 @@ public class ConsistentHashHelper { return removeAddressFromUnionConsistentHash((UnionConsistentHash) ch, toRemove, c); else { ConsistentHash newCH = (ConsistentHash) Util.getInstance(c.getConsistentHashClass()); - List<Address> caches = ch.getCaches(); + List<Address> caches = new ArrayList<Address>(ch.getCaches()); caches.remove(toRemove); newCH.setCaches(caches); return newCH;
migrated <I> to trunk
infinispan_infinispan
train
java
0205838f25116a60490607376477a5ce1c6e6c15
diff --git a/searx/search.py b/searx/search.py index <HASH>..<HASH> 100644 --- a/searx/search.py +++ b/searx/search.py @@ -118,7 +118,11 @@ def search_one_request(engine_name, query, request_params, result_container, tim if response: # parse the response response.search_params = request_params - search_results = engine.response(response) + try: + search_results = engine.response(response) + except: + logger.exception('engine crash: {0}'.format(engine.name)) + search_results = [] # add results for result in search_results: @@ -135,7 +139,6 @@ def search_one_request(engine_name, query, request_params, result_container, tim engine.stats['engine_time'] += time() - request_params['started'] engine.stats['engine_time_count'] += 1 - # return success
[enh] handle engine response crashes
asciimoo_searx
train
py
958ed0fd63d76d56c86632a7ca569caccbdb0867
diff --git a/lib/cieloz/requisicao_transacao.rb b/lib/cieloz/requisicao_transacao.rb index <HASH>..<HASH> 100644 --- a/lib/cieloz/requisicao_transacao.rb +++ b/lib/cieloz/requisicao_transacao.rb @@ -127,6 +127,7 @@ class Cieloz::RequisicaoTransacao < Cieloz::Base } validates :bandeira, inclusion: { in: BANDEIRAS_DEBITO }, if: "@produto == DEBITO" + validates :bandeira, inclusion: { in: Cieloz::Bandeiras::ALL }, if: "@produto == CREDITO" def attributes { diff --git a/test/unit/validations_test.rb b/test/unit/validations_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/validations_test.rb +++ b/test/unit/validations_test.rb @@ -116,7 +116,14 @@ describe Cieloz::RequisicaoTransacao::FormaPagamento do end end - it "validates credito" do + it "validates bandeiras for credito" do + all_flags.each { |flag| + subject.credito flag + must ensure_inclusion_of(:bandeira).in_array(all_flags) + } + end + + it "accepts payment for credito" do all_flags.each { |flag| subject.credito flag assert_equal subject.class::CREDITO, subject.produto
Validates bandeiras for credito operations
fabiolnm_cieloz
train
rb,rb
6fbb850328cc1f0dd9ad5c095bc41be3ca34cbaf
diff --git a/app/controllers/api/MetricsController.java b/app/controllers/api/MetricsController.java index <HASH>..<HASH> 100644 --- a/app/controllers/api/MetricsController.java +++ b/app/controllers/api/MetricsController.java @@ -101,7 +101,7 @@ public class MetricsController extends AuthenticatedController { clearSessionId.set(userAndSessionId[1]); } else if (command instanceof SubscribeMetricsUpdates) { final SubscribeMetricsUpdates metricsUpdates = (SubscribeMetricsUpdates) command; - Logger.info("Subscribed to metrics {} on node {}", + Logger.debug("Subscribed to metrics {} on node {}", metricsUpdates.metrics, MoreObjects.firstNonNull(metricsUpdates.nodeId, "ALL"));
Lowering severity of log message to prevent log spamming.
Graylog2_graylog2-server
train
java
b32cd67c73e37ce965cc03a839a9d33d365672b6
diff --git a/app/models/content_item.rb b/app/models/content_item.rb index <HASH>..<HASH> 100644 --- a/app/models/content_item.rb +++ b/app/models/content_item.rb @@ -33,7 +33,7 @@ class ContentItem < ApplicationRecord def publish_state sorted_field_items = field_items.select { |fi| fi.field.field_type_instance.is_a?(DateTimeFieldType) && !fi.field.metadata["state"].nil? }.sort_by{ |a| a.data["timestamp"] }.reverse - PublishStateService.new.perform(sorted_field_items, self) + PublishStateService.new.content_item_state(sorted_field_items, self) end def rss_url(base_url, slug_field_id) diff --git a/app/services/publish_state_service.rb b/app/services/publish_state_service.rb index <HASH>..<HASH> 100644 --- a/app/services/publish_state_service.rb +++ b/app/services/publish_state_service.rb @@ -1,5 +1,5 @@ -class PublishStateService < ApplicationController - def perform(sorted_field_items, content_item) +class PublishStateService < ApplicationService + def content_item_state(sorted_field_items, content_item) @sorted_field_items = sorted_field_items @content_item = content_item
refactor: necessary pub system renamings and refactors
cortex-cms_cortex
train
rb,rb
5dd209cc587eaed079ac85340b0a7dc7811f9401
diff --git a/src/main/java/org/minimalj/backend/db/DbSyntax.java b/src/main/java/org/minimalj/backend/db/DbSyntax.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/minimalj/backend/db/DbSyntax.java +++ b/src/main/java/org/minimalj/backend/db/DbSyntax.java @@ -43,15 +43,7 @@ public abstract class DbSyntax { throw new IllegalArgumentException(); } s.append(" NOT NULL"); -// if (idClass == Integer.class || idClass == Long.class) { -// addAutoIncrement(s); -// } } - -// to be supported again later -// protected void addAutoIncrement(StringBuilder s) { -// s.append(" AUTO_INCREMENT"); -// } /* * Only public for tests. If this method doesnt throw an IllegalArgumentException @@ -193,11 +185,6 @@ public abstract class DbSyntax { public static class DerbyDbSyntax extends DbSyntax { -// @Override -// protected void addAutoIncrement(StringBuilder s) { -// s.append(" GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1)"); -// } - @Override public void addColumnDefinition(StringBuilder s, PropertyInterface property) { Class<?> clazz = property.getClazz();
DbSyntax: removed comments about incrementing ids will never be used again
BrunoEberhard_minimal-j
train
java
b683cd48794a5bda657699d998b7f656da30874f
diff --git a/lib/smartcoin/version.rb b/lib/smartcoin/version.rb index <HASH>..<HASH> 100644 --- a/lib/smartcoin/version.rb +++ b/lib/smartcoin/version.rb @@ -1,3 +1,3 @@ module Smartcoin - VERSION = "0.1.3" + VERSION = "0.1.5" end
SmartCoin library version <I>
smartcoinpayments_smartcoin-ruby
train
rb
35d6c76a699912b042bc1a276cf952dc102ff59c
diff --git a/src/incremental-indexeddb-adapter.js b/src/incremental-indexeddb-adapter.js index <HASH>..<HASH> 100644 --- a/src/incremental-indexeddb-adapter.js +++ b/src/incremental-indexeddb-adapter.js @@ -820,7 +820,7 @@ // sort chunks in place to load data in the right order (ascending loki ids) // on both Safari and Chrome, we'll get chunks in order like this: 0, 1, 10, 100... chunks.sort(function(a, b) { - return a.index - b.index; + return (a.index || 0) - (b.index || 0); }); }
[IncrementalIDB] Fix critical regression with chunk ordering at load time
techfort_LokiJS
train
js
f713cce9f06eabe753db26268ee4886167c1243f
diff --git a/tasks/focus.js b/tasks/focus.js index <HASH>..<HASH> 100644 --- a/tasks/focus.js +++ b/tasks/focus.js @@ -15,6 +15,11 @@ module.exports = function(grunt) { var watchers = grunt.config.get('watch'), filter = new ObjectFilter(this.data); + if (typeof watchers !== 'object') { + grunt.fail.warn('watch config must be defined and be an object'); + return; + } + grunt.config.set('watch', filter.process(watchers)); grunt.task.run(['watch']); });
Fail grunt and warn if the watch config isn't present or not an object
joeytrapp_grunt-focus
train
js
06b5ef1c2bf0f19089f50c270a2a3d2ea8a0998d
diff --git a/src/api/on.js b/src/api/on.js index <HASH>..<HASH> 100644 --- a/src/api/on.js +++ b/src/api/on.js @@ -76,5 +76,37 @@ module.exports = db => (path, fn) => { let id = listenerId return function unsubscribe() { delete db.updates.fns[path][id] + + // Remove everything related to this path as no + // more listeners exist + if (Object.keys(db.updates.fns[path]).length === 0) { + db.updates.fns[path] = null + delete db.updates.fns[path] + db.updates.cache[path] = null + delete db.updates.cache[path] + + let triggers = db.updates.triggers + let key + let keys = Object.keys(triggers) + let l = keys.length + let i + let arr + + while (l--) { + key = keys[l] + arr = triggers[key] + i = arr.indexOf(path) + + if (i !== -1) { + arr.splice(i, 1) + } + + if (arr.length === 0) { + triggers[key] = null + delete triggers[key] + } + } + } + } }
Remove everything related to a listener instance if no more listener fns are present
jsonmvc_db
train
js
08097edc7849e1543d723a3c382536909b58aa4f
diff --git a/opts/secret.go b/opts/secret.go index <HASH>..<HASH> 100644 --- a/opts/secret.go +++ b/opts/secret.go @@ -4,7 +4,6 @@ import ( "encoding/csv" "fmt" "os" - "path/filepath" "strconv" "strings" @@ -53,10 +52,6 @@ func (o *SecretOpt) Set(value string) error { case "source", "src": options.SecretName = value case "target": - tDir, _ := filepath.Split(value) - if tDir != "" { - return fmt.Errorf("target must not be a path") - } options.File.Name = value case "uid": options.File.UID = value
support custom paths for secrets This adds support to specify custom container paths for secrets.
docker_cli
train
go
df70cf06f579820bbb8423b5731dd207ad6b6b01
diff --git a/src/Keyteq/Keymedia/API.php b/src/Keyteq/Keymedia/API.php index <HASH>..<HASH> 100644 --- a/src/Keyteq/Keymedia/API.php +++ b/src/Keyteq/Keymedia/API.php @@ -72,6 +72,18 @@ class API return $result; } + public function updateMedia($id, array $tags = array(), array $attributes = array()) + { + $tags = join(',', $tags); + $args = compact('tags', 'attributes'); + $payload = array_filter($args); + $resource = "media/{$id}"; + $response = $this->connector->postResource($resource, $payload); + $result = $this->mediaMapper->mapItem($response); + + return $result; + } + public function postMedia($file, $name, array $tags = array(), array $attributes = array()) { $args = compact('file', 'name', 'tags', 'attributes');
Add the method to repost tags/attributes on a media
KeyteqLabs_keymedia-php
train
php
ce24651b2d0935bff0f3fdb9192244b40af20bdf
diff --git a/qtpy/tests/test_qtsql.py b/qtpy/tests/test_qtsql.py index <HASH>..<HASH> 100644 --- a/qtpy/tests/test_qtsql.py +++ b/qtpy/tests/test_qtsql.py @@ -3,7 +3,7 @@ from __future__ import absolute_import import pytest from qtpy import QtSql -def test_qtsvg(): +def test_qtsql(): """Test the qtpy.QtSql namespace""" assert QtSql.QSqlDatabase is not None # assert QtSql.QSqlDriverCreator is not None
Rename test_qtsvg() to test_qtsql() in test_qtsql.py
spyder-ide_qtpy
train
py
60dbdabc657c84ef9f93b9086aa5b08395f7821e
diff --git a/packages/node_modules/@webex/internal-plugin-wdm/src/config.js b/packages/node_modules/@webex/internal-plugin-wdm/src/config.js index <HASH>..<HASH> 100644 --- a/packages/node_modules/@webex/internal-plugin-wdm/src/config.js +++ b/packages/node_modules/@webex/internal-plugin-wdm/src/config.js @@ -8,8 +8,10 @@ export default { device: { preDiscoveryServices: { wdmServiceUrl: process.env.WDM_SERVICE_URL || 'https://wdm-a.wbx2.com/wdm/api/v1', + u2cServiceUrl: process.env.U2C_SERVICE_URL || 'https://u2c.wbx2.com/u2c/api/v1', hydraServiceUrl: process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1', wdm: process.env.WDM_SERVICE_URL || 'https://wdm-a.wbx2.com/wdm/api/v1', + u2c: process.env.U2C_SERVICE_URL || 'https://u2c.wbx2.com/u2c/api/v1', hydra: process.env.HYDRA_SERVICE_URL || 'https://api.ciscospark.com/v1' }, defaults: {
refactor(internal-plugin-wdm): add u2c service url to config Add the u2c service url to the prediscovery services list in internal-plugin-wdm's config.js.
webex_spark-js-sdk
train
js
6513770b6853872d377ee8e51b592ff12d8daca8
diff --git a/glue/ligolw/lsctables.py b/glue/ligolw/lsctables.py index <HASH>..<HASH> 100644 --- a/glue/ligolw/lsctables.py +++ b/glue/ligolw/lsctables.py @@ -620,6 +620,8 @@ class SnglInspiralTable(table.Table): @param slide_num: the slide number to recover (contained in the event_id) """ slideTrigs = table.new_from_template(self) + if slide_num < 0: + slide_num = 5000 - slide_num for row in self: if ( (row.event_id % 1000000000) / 100000 ) == slide_num: slideTrigs.append(row)
handle the strange numbering convention for sngl_inspiral time slides
gwastro_pycbc-glue
train
py
62c2e46b45e46b11eafea1e54b641663e2ef85a5
diff --git a/spec/mandrill/sender_spec.rb b/spec/mandrill/sender_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mandrill/sender_spec.rb +++ b/spec/mandrill/sender_spec.rb @@ -104,7 +104,7 @@ describe MultiMail::Sender::Mandrill do end it 'rejects an invalid email' do - p service.deliver!(message_with_invalid_to) + expect { service.deliver!(message_with_invalid_to) }.to raise_error expect { service.deliver!(message_with_no_body) }.to raise_error end end diff --git a/spec/simple/sender_spec.rb b/spec/simple/sender_spec.rb index <HASH>..<HASH> 100644 --- a/spec/simple/sender_spec.rb +++ b/spec/simple/sender_spec.rb @@ -27,8 +27,8 @@ describe MultiMail::Sender::Simple do it 'should send email' do message.delivery_method :smtp, { :address => 'smtp.gmail.com', - :port => 25, - # :domain => 'smtp.gmail.com', + :port => 587, + :domain => 'smtp.gmail.com', :user_name => ENV['GMAIL_USERNAME'], :password => ENV['GMAIL_PASSWORD'], :authentication => 'plain',
trying again to resolve travis error
jpmckinney_multi_mail
train
rb,rb
aef72b7230ca38f6242510294953b7ecfae166fa
diff --git a/dataviews/plots.py b/dataviews/plots.py index <HASH>..<HASH> 100644 --- a/dataviews/plots.py +++ b/dataviews/plots.py @@ -1072,7 +1072,7 @@ class CoordinateGridPlot(OverlayPlot): w, h = self._get_dims(view) if view.type == SheetOverlay: data = view.last[-1].data if self.situate else view.last[-1].roi.data - opts = View.options.style(view).opts + opts = View.options.style(view.last[-1]).opts else: data = view.last.data if self.situate else view.last.roi.data opts = View.options.style(view).opts
Fixed style access in CoordinateGridPlot
pyviz_holoviews
train
py
2326f12d5aedffdfefa5ca5237f5d68c232e1066
diff --git a/client/jetpack-connect/user-type/index.js b/client/jetpack-connect/user-type/index.js index <HASH>..<HASH> 100644 --- a/client/jetpack-connect/user-type/index.js +++ b/client/jetpack-connect/user-type/index.js @@ -33,7 +33,7 @@ class JetpackUserType extends Component { return ( <MainWrapper isWide> - <div className="user-type__connect-step"> + <div className="user-type__connect-step jetpack-connect__step"> <FormattedHeader headerText={ translate( 'Are you setting up this site for yourself or someone else?' ) } />
Jetpack Connect: Fix colophon alignment on user type step (#<I>)
Automattic_wp-calypso
train
js
6fe55d80341035ad5d838945b047fd0f8b7f18a3
diff --git a/registration/auth_urls.py b/registration/auth_urls.py index <HASH>..<HASH> 100644 --- a/registration/auth_urls.py +++ b/registration/auth_urls.py @@ -37,16 +37,19 @@ urlpatterns = [ name='auth_logout'), url(r'^password/change/$', auth_views.password_change, + {'post_change_redirect': 'auth_password_change_done'}, name='auth_password_change'), url(r'^password/change/done/$', auth_views.password_change_done, name='auth_password_change_done'), url(r'^password/reset/$', auth_views.password_reset, + {'post_reset_redirect': 'auth_password_reset_done'}, name='auth_password_reset'), url(r'^password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/' r'(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', auth_views.password_reset_confirm, + {'post_reset_redirect': 'auth_password_reset_complete'}, name='auth_password_reset_confirm'), url(r'^password/reset/complete/$', auth_views.password_reset_complete,
Due to overriding the auth url names with auth_ prefix the post_redirects must also be overridden
ubernostrum_django-registration
train
py
e2028795f1a49c6c48d801587d83c74960c34e8a
diff --git a/go/systests/team_invite_test.go b/go/systests/team_invite_test.go index <HASH>..<HASH> 100644 --- a/go/systests/team_invite_test.go +++ b/go/systests/team_invite_test.go @@ -385,7 +385,6 @@ func TestImpTeamWithMultipleRooters(t *testing.T) { } func TestClearSocialInvitesOnAdd(t *testing.T) { - t.Skip() tt := newTeamTester(t) defer tt.cleanup()
Unskip test to see what happens
keybase_client
train
go
0a089f3d4e13f58e8da3439a4779c11c92c21114
diff --git a/test/integration/minibundle_production_mode_test.rb b/test/integration/minibundle_production_mode_test.rb index <HASH>..<HASH> 100644 --- a/test/integration/minibundle_production_mode_test.rb +++ b/test/integration/minibundle_production_mode_test.rb @@ -624,6 +624,7 @@ module Jekyll::Minibundle::Test assert_equal(org_mtime, file_mtime_of(expected_js_path)) assert_equal(1, get_minifier_cmd_count) + assert_equal("/js-root/#{JS_BUNDLE_DESTINATION_FINGERPRINT_PATH}", find_js_path_from_index) end end
Add assertion to ensure substition was correct
tkareine_jekyll-minibundle
train
rb
55fffb56e48c7fdd17b93671918972663bcea3da
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -1,17 +1,31 @@ #!/usr/bin/env python +import re try: from setuptools import setup except ImportError: from distutils.core import setup -version = '0.1' + +__version__ = '' +with open('helium/__about__.py', 'r') as fd: + reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]') + for line in fd: + m = reg.match(line) + if m: + __version__ = m.group(1) + break + +if not __version__: + raise RuntimeError('Cannot find version information') + +version = __version__ authors = 'Marc Nijdam' emails = '' packages = ['helium'] requires = [ "future>=0.15", - "requests==2.10.0", + "requests<2.11", "uritemplate>=0.6", "inflection>=0.3", ] @@ -26,5 +40,5 @@ setup( url='https://github.com/helium/helium-python', packages=packages, install_requires=requires, - license='MIT', + license='BSD', )
Feature/version (#<I>) * Update license * Extract version information from the library
helium_helium-python
train
py
69dd3afa80b1720f9e917b24d57a1e0ee2e2e113
diff --git a/lib/queue.js b/lib/queue.js index <HASH>..<HASH> 100644 --- a/lib/queue.js +++ b/lib/queue.js @@ -58,6 +58,6 @@ Queue.prototype.ensureIndex = function(){ //Ensures there's a reasonable index for the poling dequeue //Status is first b/c querying by status = queued should be very selective this.collection.ensureIndex({ status: 1, queue: 1, enqueued: 1 }, function(err){ - console.error(err); + if(err) console.error(err); }); }; \ No newline at end of file
Only log the error if there was one
scttnlsn_monq
train
js
ea5116f1045f6b851229f9f8a56b8adbe3933316
diff --git a/kie-api/src/main/java/org/kie/api/command/KieCommands.java b/kie-api/src/main/java/org/kie/api/command/KieCommands.java index <HASH>..<HASH> 100644 --- a/kie-api/src/main/java/org/kie/api/command/KieCommands.java +++ b/kie-api/src/main/java/org/kie/api/command/KieCommands.java @@ -116,5 +116,7 @@ public interface KieCommands { Command<FactHandle> fromExternalFactHandleCommand(String factHandleExternalForm); Command<FactHandle> fromExternalFactHandleCommand(String factHandleExternalForm, boolean disconnected); + + Command newAgendaGroupSetFocus(String name); }
allow to create an AgendaGroupSetFocusCommand from public api
kiegroup_drools
train
java
b764e2ed3edbc089c1fa51659ddab30b5091a6a5
diff --git a/salt/utils/validate/user.py b/salt/utils/validate/user.py index <HASH>..<HASH> 100644 --- a/salt/utils/validate/user.py +++ b/salt/utils/validate/user.py @@ -9,6 +9,8 @@ import logging log = logging.getLogger(__name__) +VALID_USERNAME= re.compile(r'[a-z_][a-z0-9_-]*[$]?', re.IGNORECASE) + def valid_username(user): ''' @@ -20,5 +22,4 @@ def valid_username(user): if len(user) > 32: return False - valid = re.compile(r'[a-z_][a-z0-9_-]*[$]?', re.IGNORECASE) - return valid.match(user) is not None + return VALID_USERNAME.match(user) is not None
Move re compilation to the module load
saltstack_salt
train
py
12e6b1b69d7d3378e894b735bae2655a9a13dcc1
diff --git a/tests/acceptance/course/competencies-test.js b/tests/acceptance/course/competencies-test.js index <HASH>..<HASH> 100644 --- a/tests/acceptance/course/competencies-test.js +++ b/tests/acceptance/course/competencies-test.js @@ -65,9 +65,10 @@ module('Acceptance | Course - Competencies', function(hooks) { this.user.update({ administeredSchools: [this.school] }); await page.visit({ courseId: 1, details: true, courseObjectiveDetails: true }); await page.objectives.current[1].manageParents(); - await page.objectiveParentManager.competencies[1].objectives[0].add(); - assert.ok(page.objectiveParentManager.competencies[0].objectives[0].notSelected); - assert.ok(page.objectiveParentManager.competencies[1].objectives[0].selected); + const m = page.objectives.manageObjectiveParents; + await m.competencies[1].objectives[0].add(); + assert.ok(m.competencies[0].objectives[0].notSelected); + assert.ok(m.competencies[1].objectives[0].selected); await page.objectives.save(); assert.equal(page.collapsedCompetencies.title, 'Competencies (2)');
Fix test to use new page object structure
ilios_common
train
js
36458ce89f4d6601103b4547972ad311b486959e
diff --git a/lib/fog/bluebox/models/compute/server.rb b/lib/fog/bluebox/models/compute/server.rb index <HASH>..<HASH> 100644 --- a/lib/fog/bluebox/models/compute/server.rb +++ b/lib/fog/bluebox/models/compute/server.rb @@ -57,7 +57,9 @@ module Fog end def public_ip_address - ips.first + if ip = ips.first + ip['address'] + end end def ready?
Fix bluebox's Server#public_ip_address This should be returning a String not a Hash.
fog_fog
train
rb
d400dc2677e59040c6a04a9b55613d4eacd4b506
diff --git a/lib/dnsync/recurring_zone_updater.rb b/lib/dnsync/recurring_zone_updater.rb index <HASH>..<HASH> 100644 --- a/lib/dnsync/recurring_zone_updater.rb +++ b/lib/dnsync/recurring_zone_updater.rb @@ -19,7 +19,8 @@ module Dnsync return self end - @running.value = true + @running.value = true + @last_updated_at.value = Time.now @thread.value = Thread.new do Thread.current.abort_on_exception = true
Give the system a chance to do the first update
papertrail_dnsync
train
rb
31a1f9f5ea1cab2095da38848310c32fe73870cb
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -220,7 +220,8 @@ setup( python_requires='>=3.5', setup_requires=[ 'setuptools_scm', # so that version will work - 'cffi>=1.9.1' # to build the leptonica module + 'cffi>=1.9.1', # to build the leptonica module + 'pytest-runner' # to enable python setup.py test ], use_scm_version={'version_scheme': 'post-release'}, cffi_modules=[
pytest-runner should be a setup requirement
jbarlow83_OCRmyPDF
train
py
432a945fc154ac9fa164833060fb29b9a30081f2
diff --git a/Kwf_js/User/Login/Dialog.js b/Kwf_js/User/Login/Dialog.js index <HASH>..<HASH> 100644 --- a/Kwf_js/User/Login/Dialog.js +++ b/Kwf_js/User/Login/Dialog.js @@ -3,7 +3,7 @@ Kwf.User.Login.Dialog = Ext.extend(Ext.Window, { initComponent: function() { - this.height = 255; + this.height = 275; this.width = 310; this.modal = true; this.title = trlKwf('Login');
increase login dialog height so given message is visible this message usually contains text like not enough permissions
koala-framework_koala-framework
train
js
e61c020385495f1cbeafa715c62192e595092ee1
diff --git a/lib/hyalite/version.rb b/lib/hyalite/version.rb index <HASH>..<HASH> 100644 --- a/lib/hyalite/version.rb +++ b/lib/hyalite/version.rb @@ -1,3 +1,3 @@ module Hyalite - VERSION = "0.2.8" + VERSION = "0.3.0" end
Bump hyalite to <I>
youchan_hyalite
train
rb
afb2e76037a5f36542c77e88ef8aef9f469b09f8
diff --git a/entry.go b/entry.go index <HASH>..<HASH> 100644 --- a/entry.go +++ b/entry.go @@ -63,11 +63,7 @@ func (e *Entry) WithError(err error) *Entry { file = parts[1] } - ctx = ctx.WithFields(Fields{ - "function": name, - "filename": file, - "line": line, - }) + ctx = ctx.WithField("source", fmt.Sprintf("%s: %s:%s", name, file, line)) } return ctx
change distinct frame fields to "source" anyone have a better name? something that would have fewer collisions would be nice
apex_log
train
go
895655cfcab0aa488336a364332f68f858e630a2
diff --git a/lib/aduki/version.rb b/lib/aduki/version.rb index <HASH>..<HASH> 100644 --- a/lib/aduki/version.rb +++ b/lib/aduki/version.rb @@ -1,3 +1,3 @@ module Aduki - VERSION = "0.0.1" + VERSION = "0.0.2" end
version: bump to <I>
conanite_aduki
train
rb
60f173f169f7f63ff5f298131ddf7e74df9f3732
diff --git a/sc2/sc2process.py b/sc2/sc2process.py index <HASH>..<HASH> 100644 --- a/sc2/sc2process.py +++ b/sc2/sc2process.py @@ -26,9 +26,16 @@ class kill_switch(object): p._clean() class SC2Process(object): - def __init__(self, fullscreen=False): + def __init__(self, host="127.0.0.1", port=None, fullscreen=False): + assert isinstance(host, str) + assert isinstance(port, int) or port is None + self._fullscreen = fullscreen - self._port = portpicker.pick_unused_port() + self._host = host + if port is None: + self._port = portpicker.pick_unused_port() + else: + self._port = port self._tmp_dir = tempfile.mkdtemp(prefix="SC2_") self._process = None self._ws = None @@ -56,12 +63,12 @@ class SC2Process(object): @property def ws_url(self): - return f"ws://127.0.0.1:{self._port}/sc2api" + return f"ws://{self._host}:{self._port}/sc2api" def _launch(self): return subprocess.Popen([ Paths.EXECUTABLE, - "-listen", "127.0.0.1", + "-listen", self._host, "-port", str(self._port), "-displayMode", "1" if self._fullscreen else "0", "-dataDir", Paths.BASE,
Allow custom hostname and port for sc2process websocket
Dentosal_python-sc2
train
py
002a5846c6fd945b95bc0fc42ead4b62f8466c99
diff --git a/lib/active_scaffold/data_structures/action_links.rb b/lib/active_scaffold/data_structures/action_links.rb index <HASH>..<HASH> 100644 --- a/lib/active_scaffold/data_structures/action_links.rb +++ b/lib/active_scaffold/data_structures/action_links.rb @@ -71,11 +71,9 @@ module ActiveScaffold::DataStructures end def delete(val) - @set.delete_if do |item| - if item.is_a?(ActiveScaffold::DataStructures::ActionLinks) - item.delete(val) - else - item.action == val.to_s + self.each do |link, set| + if link.action == val.to_s + set.delete_if {|item|item.action == val.to_s} end end end @@ -86,7 +84,7 @@ module ActiveScaffold::DataStructures if item.is_a?(ActiveScaffold::DataStructures::ActionLinks) item.each(type, &block) else - yield item + yield item, @set end } end
Bugfix: delete action_link did not work as expected
activescaffold_active_scaffold
train
rb
8fdd470cea1537cbb3af23b6c2017bab16f84120
diff --git a/lib/que/worker.rb b/lib/que/worker.rb index <HASH>..<HASH> 100644 --- a/lib/que/worker.rb +++ b/lib/que/worker.rb @@ -110,12 +110,6 @@ module Que # a worker, and make sure to wake up the wrangler when @wake_interval is # changed in Que.wake_interval= below. @wake_interval = 5 - @wrangler = Thread.new do - loop do - sleep *@wake_interval - wake! if @wake_interval - end - end class << self attr_reader :mode, :wake_interval @@ -136,6 +130,7 @@ module Que def worker_count=(count) set_mode(count > 0 ? :async : :off) set_worker_count(count) + wrangler # Make sure the wrangler thread has been instantiated. end def worker_count @@ -144,7 +139,7 @@ module Que def wake_interval=(interval) @wake_interval = interval - @wrangler.wakeup + wrangler.wakeup end def wake! @@ -157,6 +152,15 @@ module Que private + def wrangler + @wrangler ||= Thread.new do + loop do + sleep *@wake_interval + wake! if @wake_interval + end + end + end + def set_mode(mode) if mode != @mode Que.log :event => 'mode_change', :value => mode.to_s
Don't instantiate the wrangler thread until a worker_count is set, to work better with forking. Fixes #<I>.
chanks_que
train
rb
ab7fa8ea3c48b026c774df1f733f78d16e7998b9
diff --git a/Canvas.js b/Canvas.js index <HASH>..<HASH> 100644 --- a/Canvas.js +++ b/Canvas.js @@ -83,7 +83,7 @@ Canvas.prototype = { // For IE var w = this.canvas.width; this.canvas.width = 1; - canvas.width = w; + this.canvas.width = w; } }; \ No newline at end of file
Preliminary SliderControls working
nodeGame_nodegame-window
train
js
8f6e8d8801e2c5d1e98f4c33c2869f5363f6676b
diff --git a/lib/heroku/command/ps.rb b/lib/heroku/command/ps.rb index <HASH>..<HASH> 100644 --- a/lib/heroku/command/ps.rb +++ b/lib/heroku/command/ps.rb @@ -247,16 +247,16 @@ class Heroku::Command::Ps < Heroku::Command::Base alias_command "stop", "ps:stop" - # ps:resize DYNO1=1X|2X [DYNO2=1X|2X ...] + # ps:resize DYNO1=1X|2X|PX [DYNO2=1X|2X|PX ...] # # resize dynos to the given size # # Example: # - # $ heroku ps:resize web=2X worker=1X + # $ heroku ps:resize web=PX worker=2X # Resizing and restarting the specified dynos... done - # web dynos now 2X ($0.10/dyno-hour) - # worker dynos now 1X ($0.05/dyno-hour) + # web dynos now PX ($0.80/dyno-hour) + # worker dynos now 2X ($0.10/dyno-hour) # def resize app
update usage docs to mention PX dynos
heroku_legacy-cli
train
rb
43561dd645174d4315f5c84be96daf1393205c90
diff --git a/src/ui-scroll.js b/src/ui-scroll.js index <HASH>..<HASH> 100644 --- a/src/ui-scroll.js +++ b/src/ui-scroll.js @@ -8,7 +8,7 @@ angular.module('ui.scroll', []) .constant('JQLiteExtras', JQLiteExtras) .run(['JQLiteExtras', (JQLiteExtras) => { - !window.jQuery ? (new JQLiteExtras()).registerFor(angular.element) : null; + !(angular.element.fn && angular.element.fn.jquery) ? new JQLiteExtras().registerFor(angular.element) : null; ElementRoutines.addCSSRules(); }])
Looks like the source was not properly commited - changed ui-scroll
angular-ui_ui-scroll
train
js
4c98842412f58fc6f558d9159bb9e12dc31ab52d
diff --git a/lib/websession_webinterface.py b/lib/websession_webinterface.py index <HASH>..<HASH> 100644 --- a/lib/websession_webinterface.py +++ b/lib/websession_webinterface.py @@ -684,7 +684,7 @@ class WebInterfaceYourAccountPages(WebInterfaceDirectory): else: # Fake parameters for p_un & p_pw because SSO takes them from the environment (iden, args['p_un'], args['p_pw'], msgcode) = webuser.loginUser(req, '', '', CFG_EXTERNAL_AUTH_USING_SSO) - args['remember_me'] = True + args['remember_me'] = False if len(iden)>0: uid = webuser.update_Uid(req, args['p_un'], args['remember_me']) uid2 = webuser.getUid(req)
When using SSO the local session should be stored in a session cookie that expires when the browser is closed.
inveniosoftware_invenio-accounts
train
py
c6a1d70ecc6f5f2c0362706e668cb04c4232f5ef
diff --git a/vendor/k8s.io/kubernetes/test/e2e/common/host_path.go b/vendor/k8s.io/kubernetes/test/e2e/common/host_path.go index <HASH>..<HASH> 100644 --- a/vendor/k8s.io/kubernetes/test/e2e/common/host_path.go +++ b/vendor/k8s.io/kubernetes/test/e2e/common/host_path.go @@ -132,7 +132,6 @@ func mount(source *api.HostPathVolumeSource) []api.Volume { //TODO: To merge this with the emptyDir tests, we can make source a lambda. func testPodWithHostVol(path string, source *api.HostPathVolumeSource) *api.Pod { podName := "pod-host-path-test" - privileged := true return &api.Pod{ TypeMeta: unversioned.TypeMeta{ @@ -153,9 +152,6 @@ func testPodWithHostVol(path string, source *api.HostPathVolumeSource) *api.Pod MountPath: path, }, }, - SecurityContext: &api.SecurityContext{ - Privileged: &privileged, - }, }, { Name: containerName2, @@ -166,9 +162,6 @@ func testPodWithHostVol(path string, source *api.HostPathVolumeSource) *api.Pod MountPath: path, }, }, - SecurityContext: &api.SecurityContext{ - Privileged: &privileged, - }, }, }, RestartPolicy: api.RestartPolicyNever,
UPSTREAM: revert: eb<I>dffd1db<I>f8ea<I>defb<I>d0d9ebe: <I>: Use privileged containers for host path e2e tests
openshift_origin
train
go
9c8747d38eb593e330d3c310511605109e957b56
diff --git a/flink-streaming-java/src/test/java/org/apache/flink/streaming/util/HDFSCopyUtilitiesTest.java b/flink-streaming-java/src/test/java/org/apache/flink/streaming/util/HDFSCopyUtilitiesTest.java index <HASH>..<HASH> 100644 --- a/flink-streaming-java/src/test/java/org/apache/flink/streaming/util/HDFSCopyUtilitiesTest.java +++ b/flink-streaming-java/src/test/java/org/apache/flink/streaming/util/HDFSCopyUtilitiesTest.java @@ -62,7 +62,7 @@ public class HDFSCopyUtilitiesTest { HDFSCopyFromLocal.copyFromLocal( originalFile, - new Path(copyFile.getAbsolutePath()).toUri()); + new Path("file://" + copyFile.getAbsolutePath()).toUri()); try (DataInputStream in = new DataInputStream(new FileInputStream(copyFile))) { assertTrue(in.readUTF().equals("Hello there, 42!")); @@ -87,7 +87,7 @@ public class HDFSCopyUtilitiesTest { } HDFSCopyToLocal.copyToLocal( - new Path(originalFile.getAbsolutePath()).toUri(), + new Path("file://" + originalFile.getAbsolutePath()).toUri(), copyFile); try (DataInputStream in = new DataInputStream(new FileInputStream(copyFile))) {
[FLINK-<I>] [tests] Force HDFSCopyUtilitiesTest to use local file system This closes #<I>.
apache_flink
train
java
cbb973a96f0ed370a01aeea2376f4290043433c4
diff --git a/lib/yt/collections/reports.rb b/lib/yt/collections/reports.rb index <HASH>..<HASH> 100644 --- a/lib/yt/collections/reports.rb +++ b/lib/yt/collections/reports.rb @@ -188,6 +188,7 @@ module Yt params['end-date'] = @days_range.end params['metrics'] = @metrics.keys.join(',').to_s.camelize(:lower) params['dimensions'] = DIMENSIONS[@dimension][:name] unless @dimension == :range + params['include-historical-channel-data'] = 'true' params['max-results'] = 50 if @dimension.in? [:playlist, :video] params['max-results'] = 25 if @dimension.in? [:embedded_player_location, :related_video, :search_term, :referrer] if @dimension.in? [:video, :playlist, :embedded_player_location, :related_video, :search_term, :referrer]
Add 'include-historical-channel-data' parameter YouTube only gives back the data happened since the channel joined by default, if you manage a channel through a CMS. But with this parameter as true, it returns historical data (the data happened before the channel joined) also.
Fullscreen_yt
train
rb
93b11cf38330648e81ed86c10d6ee17639422703
diff --git a/pyang/plugins/flatten.py b/pyang/plugins/flatten.py index <HASH>..<HASH> 100644 --- a/pyang/plugins/flatten.py +++ b/pyang/plugins/flatten.py @@ -50,12 +50,14 @@ class FlattenPlugin(plugin.PyangPlugin): "--flatten-filter-permission", dest="flatten_filter_permission", help="Output filter to ro or rw.", + choices=["ro", "rw"], ), optparse.make_option( "--flatten-csv-dialect", dest="flatten_csv_dialect", default="excel", help="CSV dialect for output.", + choices=["excel", "excel-tab", "unix"], ), ] g = optparser.add_option_group("Flatten output specific options")
Restrict optparse filter choices
mbj4668_pyang
train
py
cd176794090af95ba5b2d1e659d7a6c678c1c87f
diff --git a/ford/graphmanager.py b/ford/graphmanager.py index <HASH>..<HASH> 100644 --- a/ford/graphmanager.py +++ b/ford/graphmanager.py @@ -75,7 +75,7 @@ class GraphManager(object): ford.graphs.set_graphs_parentdir(parentdir) def register(self,obj): - if obj.meta['graph'] == 'true': + if obj.meta['graph'].lower() == 'true': ford.graphs.FortranGraph.data.register(obj,type(obj)) self.graph_objs.append(obj)
Remove capitalization from graph option when checking whether a graph should be generated.
Fortran-FOSS-Programmers_ford
train
py
804ac0009548cdddebb571a899c718572be08406
diff --git a/packages/react-dev-utils/launchEditor.js b/packages/react-dev-utils/launchEditor.js index <HASH>..<HASH> 100644 --- a/packages/react-dev-utils/launchEditor.js +++ b/packages/react-dev-utils/launchEditor.js @@ -91,6 +91,8 @@ function getArgumentsForLineNumber(editor, fileName, lineNumber, workspace) { case 'webstorm64': case 'phpstorm': case 'phpstorm64': + case 'pycharm': + case 'pycharm64': return addWorkspaceToArgumentsIfExists( ['--line', lineNumber, fileName], workspace
Support PyCharm in launchEditor (#<I>) PyCharm has the same signature as WebStorm and PhpStorm `<editor> <projectPath> --line <number> <filePath>` so it can reuse the logic from those. <URL>
vcarl_create-react-app
train
js
8211707835e67e626567eb03b96666c359ab497f
diff --git a/vcs/backends/hg.py b/vcs/backends/hg.py index <HASH>..<HASH> 100644 --- a/vcs/backends/hg.py +++ b/vcs/backends/hg.py @@ -45,7 +45,7 @@ class MercurialRepository(BaseRepository): self.baseui = baseui or ui.ui() # We've set path and ui, now we can set repo itself self._set_repo(create) - self.last_change = self.get_last_change() + self.revisions = list(self.repo) self.changesets = {} @@ -96,7 +96,8 @@ class MercurialRepository(BaseRepository): undefined_contact = 'Unknown' return get_contact(self.repo.ui.config) or undefined_contact - def get_last_change(self): + @LazyProperty + def last_change(self): from mercurial.util import makedate return (self._get_mtime(self.repo.spath), makedate()[1])
cleared out MercurialRepository properties
codeinn_vcs
train
py
b9d3982a43809f10af31542f235bbe5b6cb0b22e
diff --git a/parse_this.py b/parse_this.py index <HASH>..<HASH> 100644 --- a/parse_this.py +++ b/parse_this.py @@ -155,7 +155,7 @@ def parse_this(func, types, args=None): convert the command line arguments args: a list of arguments to be parsed if None sys.argv is used """ - (func_args, _, keywords, defaults) = getargspec(func) + (func_args, _, __, defaults) = getargspec(func) types, func_args = _check_types(types, func_args, defaults) args_and_defaults = _get_args_and_defaults(func_args, defaults) parser = _get_arg_parser(func, types, args_and_defaults)
One more unused variable This time we use '__' to signify we're not using this var. FYI Landscape didn't find this one until I updated an unused var on the same line. Tests: python setup.py nosetests OK
bertrandvidal_parse_this
train
py
daa19ef44ce7eefd4d43cc69e354e83923302388
diff --git a/test/e2e/storage/volume_provisioning.go b/test/e2e/storage/volume_provisioning.go index <HASH>..<HASH> 100644 --- a/test/e2e/storage/volume_provisioning.go +++ b/test/e2e/storage/volume_provisioning.go @@ -1159,7 +1159,7 @@ func startGlusterDpServerPod(c clientset.Interface, ns string) *v1.Pod { Containers: []v1.Container{ { Name: "glusterdynamic-provisioner", - Image: "docker.io/humblec/glusterdynamic-provisioner:v1.0", + Image: "docker.io/gluster/glusterdynamic-provisioner:v1.0", Args: []string{ "-config=" + "/etc/heketi/heketi.json", },
Migrate the e2e provisioner container image to a different location.
kubernetes_kubernetes
train
go
5473cec6ac2c405064a76af08df1b33e612bd70e
diff --git a/discord/emoji.py b/discord/emoji.py index <HASH>..<HASH> 100644 --- a/discord/emoji.py +++ b/discord/emoji.py @@ -169,7 +169,8 @@ class Emoji: guild_id: :class:`int` The guild ID the emoji belongs to. user: Optional[:class:`User`] - The user that created the emoji. This can only be retrieved using :meth:`Guild.fetch_emoji`. + The user that created the emoji. This can only be retrieved using :meth:`Guild.fetch_emoji` and + having the :attr:`~Permissions.manage_emojis` permission. """ __slots__ = ('require_colons', 'animated', 'managed', 'id', 'name', '_roles', 'guild_id', '_state', 'user')
Added note to Emoji.user
Rapptz_discord.py
train
py
75d1571d86b8c6fb52493c85dc8aa651f844f07e
diff --git a/NTLM_SoapClient.php b/NTLM_SoapClient.php index <HASH>..<HASH> 100644 --- a/NTLM_SoapClient.php +++ b/NTLM_SoapClient.php @@ -93,16 +93,16 @@ class NTLM_SoapClient extends SoapClient { curl_setopt($handle, CURLOPT_POST , true); curl_setopt($handle, CURLOPT_POSTFIELDS , $data); - // Proxy auth - if (!empty($this->proxy_login)) { - curl_setopt($handle, CURLOPT_PROXYUSERPWD, $this->proxy_login . ':' . $this->proxy_password); - curl_setopt($handle, CURLOPT_PROXYAUTH , CURLAUTH_NTLM); - } - if ((!empty($this->proxy_host)) && (!empty($this->proxy_port))) { // Set proxy hostname:port curl_setopt($handle, CURLOPT_PROXY, $this->proxy_host . ':' . $this->proxy_port); curl_setopt($handle, CURLOPT_PROXYAUTH , CURLAUTH_NTLM); + + // Proxy auth enabled? + if (!empty($this->proxy_login)) { + curl_setopt($handle, CURLOPT_PROXYUSERPWD, $this->proxy_login . ':' . $this->proxy_password); + curl_setopt($handle, CURLOPT_PROXYAUTH , CURLAUTH_NTLM); + } } // Execute the request
First hostname/port than login/password
thybag_PHP-SharePoint-Lists-API
train
php
1a6b6dc9c20c9d076ccfa8923da2a931f5af096f
diff --git a/src/modules/copy-paste/index.js b/src/modules/copy-paste/index.js index <HASH>..<HASH> 100644 --- a/src/modules/copy-paste/index.js +++ b/src/modules/copy-paste/index.js @@ -101,7 +101,7 @@ module.exports = function(_grid) { setTimeout(function() { var tempDiv = document.createElement('div'); if (pasteHtml.match(/<meta name=ProgId content=Excel.Sheet>/)) { - pasteHtml = pasteHtml.replace(/[\n\r]/g, ''); + pasteHtml = pasteHtml.replace(/[\n\r]+ /g, ' ').replace(/[\n\r]+/g, ''); } tempDiv.innerHTML = pasteHtml; var table = tempDiv.querySelector('table');
include a case for two spaces after the line break that excel uses and remove one of the spaces
gridgrid_grid
train
js
2b409facbb1ecde5a7173c58f8cc964c617d63bd
diff --git a/src/Engine.js b/src/Engine.js index <HASH>..<HASH> 100644 --- a/src/Engine.js +++ b/src/Engine.js @@ -828,6 +828,15 @@ meta.Engine.prototype = }, + set cursor(value) { + meta.element.style.cursor = value; + }, + + get cursor() { + return meta.element.style.cursor; + }, + + // elementStyle: "padding:0; margin:0;", canvasStyle: "position:absolute; overflow:hidden; translateZ(0); " +
Added functionality to change cursor.
tenjou_meta2d
train
js
965dcabfd30e8d9f8709eccb074125e6cb05ea60
diff --git a/packages/icon/src/react/index.js b/packages/icon/src/react/index.js index <HASH>..<HASH> 100644 --- a/packages/icon/src/react/index.js +++ b/packages/icon/src/react/index.js @@ -17,8 +17,8 @@ export const sizes = { const styleSize = ({ size }) => ({ tiny: { - height: '12px', - width: '12px' + height: '16px', + width: '16px' }, small: { height: '24px',
fix(icon): adjust tiny/small sizes
pluralsight_design-system
train
js
1b9b1e94146ae1733cba3ed06844c09b7a780811
diff --git a/packages/cozy-client/src/Schema.js b/packages/cozy-client/src/Schema.js index <HASH>..<HASH> 100644 --- a/packages/cozy-client/src/Schema.js +++ b/packages/cozy-client/src/Schema.js @@ -63,7 +63,6 @@ class Schema { ...normalizeDoctypeSchema(obj) })) - this.byName = merge(this.byName || {}, keyBy(values, x => x.name)) this.byDoctype = merge(this.byDoctype || {}, keyBy(values, x => x.doctype)) }
style(client): Remove Schema.byName property, actually never used 🔥
cozy_cozy-client
train
js
bb8fea5d190e4d895f2225d87af1deb2c190bb2f
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ install_requires = [ "docutils>=0.14", "pymongo>=3.2.2", "PyYAML>=3.11", - "web.py>=0.40", + "web.py==0.40", "Jinja2 >= 2.10", "lti>=0.9.0", "oauth2>=1.9.0.post1",
Ensure web.py==<I> is always used for now
UCL-INGI_INGInious
train
py
51d014ff39e5ed9caf9ad9881217d4d57747c491
diff --git a/dallinger/command_line.py b/dallinger/command_line.py index <HASH>..<HASH> 100755 --- a/dallinger/command_line.py +++ b/dallinger/command_line.py @@ -779,7 +779,7 @@ def export(app, local): dump_path = dump_database(id) subprocess.call( - "pg_restore --verbose --clean -d dallinger " + + "pg_restore --verbose --no-owner --clean -d dallinger " + os.path.join("data", id, "data.dump"), shell=True)
Add -no-owner flag to dallinger/command_line.py (#<I>)
Dallinger_Dallinger
train
py
209a672efacaecfd97db09133249ad1c73487654
diff --git a/symphony/lib/toolkit/cryptography/class.pbkdf2.php b/symphony/lib/toolkit/cryptography/class.pbkdf2.php index <HASH>..<HASH> 100644 --- a/symphony/lib/toolkit/cryptography/class.pbkdf2.php +++ b/symphony/lib/toolkit/cryptography/class.pbkdf2.php @@ -114,6 +114,9 @@ class PBKDF2 extends Cryptography */ public static function compare($input, $hash, $isHash = false) { + if ($isHash) { + return hash_equals($hash, $input); + } $salt = self::extractSalt($hash); $iterations = self::extractIterations($hash); $keylength = strlen(base64_decode(self::extractHash($hash)));
Add failsafe against direct calls Picked from a<I>f8db8e9 Picked from <I>c<I>cebf
symphonycms_symphony-2
train
php
7ec8436afc458b67c5ea6b5c52455547faa5d734
diff --git a/src/resources/js/controllers.js b/src/resources/js/controllers.js index <HASH>..<HASH> 100644 --- a/src/resources/js/controllers.js +++ b/src/resources/js/controllers.js @@ -12,7 +12,9 @@ $scope.crud = $scope.$parent; $scope.init = function() { - $scope.crud.toggleUpdate($stateParams.id); + if (!$scope.crud.config.inline) { + $scope.crud.toggleUpdate($stateParams.id); + } } $scope.init(); @@ -48,7 +50,9 @@ $scope.switchTo = function(type) { if (type == 0 || type == 1) { - $state.go('default.route'); + if (!$scope.inline) { + $state.go('default.route'); + } } $scope.crudSwitchType = type; };
fixed issue where inline crud jumps on edit item #<I>
luyadev_luya-module-admin
train
js
129bc9c72e74a1c4bc866259aba7fe4a834f282d
diff --git a/src/serial/raw/from.js b/src/serial/raw/from.js index <HASH>..<HASH> 100644 --- a/src/serial/raw/from.js +++ b/src/serial/raw/from.js @@ -33,7 +33,7 @@ function _gpfSerialRawFrom (instance, raw, converter) { * @since 0.2.8 */ gpf.serial.fromRaw = function (instance, raw, converter) { - if ("function" === typeof instance) { + if (typeof instance === "function") { gpf.Error.invalidParameter(); } _gpfSerialRawFrom(instance, raw, converter);
!yoda style (#<I>)
ArnaudBuchholz_gpf-js
train
js
3707436f2fcc2fb857db0ac4d924f1f868ce98e5
diff --git a/nodeup/pkg/model/cloudconfig.go b/nodeup/pkg/model/cloudconfig.go index <HASH>..<HASH> 100644 --- a/nodeup/pkg/model/cloudconfig.go +++ b/nodeup/pkg/model/cloudconfig.go @@ -31,7 +31,9 @@ const CloudConfigFilePath = "/etc/kubernetes/cloud.config" // Required for vSphere CloudProvider const MinimumVersionForVMUUID = "1.5.3" -const VM_UUID_FILE_PATH = "/root/vm_uuid" + +// VM UUID is set by cloud-init +const VM_UUID_FILE_PATH = "/etc/vmware/vm_uuid" // CloudConfigBuilder creates the cloud configuration file type CloudConfigBuilder struct { diff --git a/upup/pkg/fi/cloudup/vspheretasks/cloud_init.go b/upup/pkg/fi/cloudup/vspheretasks/cloud_init.go index <HASH>..<HASH> 100644 --- a/upup/pkg/fi/cloudup/vspheretasks/cloud_init.go +++ b/upup/pkg/fi/cloudup/vspheretasks/cloud_init.go @@ -32,7 +32,7 @@ $DNS_SCRIPT - content: | $VM_UUID owner: root:root - path: /root/vm_uuid + path: /etc/vmware/vm_uuid permissions: "0644" - content: | $VOLUME_SCRIPT
Change vm_uuid location
kubernetes_kops
train
go,go
5ccd73b3bc2e936e92f053b797b183dc7f1210ac
diff --git a/sprd/manager/RaygunErrorTrackingManager.js b/sprd/manager/RaygunErrorTrackingManager.js index <HASH>..<HASH> 100644 --- a/sprd/manager/RaygunErrorTrackingManager.js +++ b/sprd/manager/RaygunErrorTrackingManager.js @@ -31,7 +31,8 @@ define(["sprd/manager/IErrorTrackingManager", "require"], function (IErrorTracki } Raygun.init(apiKey, { - allowInsecureSubmissions: true // IE8 + allowInsecureSubmissions: true, // IE8, + ignore3rdPartyErrors: true // This option removes nonsense 'Script Error's from your Raygun dashboard }).attach(); var version = self.$stage.$parameter.version;
ignoring script errors in raygun
spreadshirt_rAppid.js-sprd
train
js
5acc8a23716c9d7979c841e351bf2ac62af4138e
diff --git a/lib/tri/query/__init__.py b/lib/tri/query/__init__.py index <HASH>..<HASH> 100644 --- a/lib/tri/query/__init__.py +++ b/lib/tri/query/__init__.py @@ -423,7 +423,7 @@ class Query(object): stack.pop() result_q.append(t2) else: # pragma: no cover - break + break # pragma: no mutate stack.append((token, PRECEDENCE[token])) while stack: result_q.append(stack.pop()[0])
Avoid mutating a line that will cause an infinite loop if mutated
TriOptima_tri.query
train
py
7d7a4984dbb1ea8f692214c26cb36f68796676eb
diff --git a/python/src/cm_api/endpoints/services.py b/python/src/cm_api/endpoints/services.py index <HASH>..<HASH> 100644 --- a/python/src/cm_api/endpoints/services.py +++ b/python/src/cm_api/endpoints/services.py @@ -299,6 +299,17 @@ class ApiService(BaseApiObject): ) return self._cmd('hdfsEnableHa', data = json.dumps(args)) + def failover_hdfs(self, active_name, standby_name): + """ + Initiate a failover of an HDFS NameNode HA pair. + + @param active_name: name of active NameNode. + @param standby_name: name of stand-by NameNode. + @return: Reference to the submitted command. + """ + args = { ApiList.LIST_KEY : [ active_name, standby_name ] } + return self._cmd('hdfsFailover', data = json.dumps(args)) + def format_hdfs(self, *namenodes): """ Format NameNode instances of an HDFS service.
[API] Add HDFS failover command. A check for the validity of the HA pair was added to the command itself, and a whitelist for internal commands was added to the CommandPurpose test, so that exposing this command through the API requires less code.
cloudera_cm_api
train
py
86d59a134782afb089c2b7e221d8bb43c63c0ed6
diff --git a/core/src/main/java/hudson/org/apache/tools/tar/TarInputStream.java b/core/src/main/java/hudson/org/apache/tools/tar/TarInputStream.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/org/apache/tools/tar/TarInputStream.java +++ b/core/src/main/java/hudson/org/apache/tools/tar/TarInputStream.java @@ -326,8 +326,7 @@ public class TarInputStream extends FilterInputStream { } if (this.readBuf != null) { - int sz = (numToRead > this.readBuf.length) ? this.readBuf.length - : numToRead; + int sz = Math.min(numToRead, this.readBuf.length); System.arraycopy(this.readBuf, 0, buf, offset, sz);
Replace manual min/max calculation with Math#min
jenkinsci_jenkins
train
java
612ae0dc042729e66312a582dd01d7ba835a1018
diff --git a/lib/logsly/colors.rb b/lib/logsly/colors.rb index <HASH>..<HASH> 100644 --- a/lib/logsly/colors.rb +++ b/lib/logsly/colors.rb @@ -53,9 +53,9 @@ module Logsly @line_settings = [] end - def run_build + def run_build(*args) if !@been_built - self.instance_eval &@build + self.instance_exec(*args, &@build) @properties = properties.map{|p| self.send(p)} @method = self.method_name diff --git a/test/unit/colors_tests.rb b/test/unit/colors_tests.rb index <HASH>..<HASH> 100644 --- a/test/unit/colors_tests.rb +++ b/test/unit/colors_tests.rb @@ -7,7 +7,9 @@ class Logsly::Colors class BaseTests < Assert::Context desc "the Colors handler" setup do - @colors = Logsly::Colors.new('test_colors') {} + @colors = Logsly::Colors.new('test_colors') do |*args| + debug args.first + end end subject { @colors } @@ -29,6 +31,12 @@ class Logsly::Colors assert_same build_proc, out.build end + should "instance exec its build with args" do + assert_nil subject.debug + subject.run_build :white + assert_equal :white, subject.debug + end + should "know if its been built" do assert_not subject.been_built subject.run_build
run builds with args for Colors class
redding_logsly
train
rb,rb
686d02008097e9b6f13a72930938e5d31a45695d
diff --git a/lib/sear.js b/lib/sear.js index <HASH>..<HASH> 100644 --- a/lib/sear.js +++ b/lib/sear.js @@ -203,7 +203,7 @@ SearModule.prototype._optimizeAMDHeaders = function (toplevel, options) { if (node.args[1] && node.args[1].elements) { - var cbArgs = []; + var cbArgs; if (node.args[2] instanceof UglifyJS.AST_Function) { cbArgs = _.pluck(node.args[2].argnames, 'name'); } @@ -212,7 +212,12 @@ SearModule.prototype._optimizeAMDHeaders = function (toplevel, options) { var value = item.value; if (commonjsModules.indexOf(value) === -1) { defineMap[value] = item.value = defineMap[value] || "m" + (++self.sear._amdHeaderId); - return cbArgs[indx]; + if (!cbArgs) { + // Keep all deps if callback args could not be defined. Callback is a variable or other. + return true; + } else { + return cbArgs[indx]; + } } else { return true; }
Fix vendor amd defines if define callback is defined as a variable
Everyplay_sear
train
js
2147e444acafa969d6a43e7b32b4cd3fa908860b
diff --git a/maildump_runner/main.py b/maildump_runner/main.py index <HASH>..<HASH> 100644 --- a/maildump_runner/main.py +++ b/maildump_runner/main.py @@ -146,9 +146,13 @@ def main(): assets.auto_build = args.autobuild_assets app.config['MAILDUMP_HTPASSWD'] = None if args.htpasswd: - # passlib is broken on py39, so we keep the import local for now. + # passlib is broken on py39, hence the local import # https://foss.heptapod.net/python-libs/passlib/-/issues/115 - from passlib.apache import HtpasswdFile + try: + from passlib.apache import HtpasswdFile + except OSError: + print('Are you using Python 3.9? If yes, authentication is currently not available due to a bug.\n\n') + raise app.config['MAILDUMP_HTPASSWD'] = HtpasswdFile(args.htpasswd) app.config['MAILDUMP_NO_QUIT'] = args.no_quit
Be more verbose about broken passlib on py<I>
ThiefMaster_maildump
train
py
ab9c3c0e36059db58338ee5b8cd5e97d48b906df
diff --git a/src/routes.php b/src/routes.php index <HASH>..<HASH> 100644 --- a/src/routes.php +++ b/src/routes.php @@ -91,7 +91,7 @@ Route::group(compact('middleware', 'prefix', 'as', 'namespace'), function () { 'as' => 'getDelete', ]); - Route::get('/demo', 'DemoController@index'); + // Route::get('/demo', 'DemoController@index'); }); Route::group(compact('prefix', 'as', 'namespace'), function () {
DemoController shouldn't enabled by default
UniSharp_laravel-filemanager
train
php
368557fea27a0a80a101961385e5284d1186747b
diff --git a/lib/pointer.js b/lib/pointer.js index <HASH>..<HASH> 100644 --- a/lib/pointer.js +++ b/lib/pointer.js @@ -53,7 +53,7 @@ Pointer.methodCallSuffixForType = function(typeDef) { // no hard mapping, so try to use size var sz = FFI.sizeOf(typeDef), szMap = FFI.SIZE_TO_POINTER_METHOD_MAP[sz], - signed = (typeDef != "byte" || typeDef.substr(0, 1) == "u"); + signed = (typeDef != "byte" && typeDef != "size_t" && typeDef.substr(0, 1) != "u"); if (sz) { // XXX: This is kind of a shitty way to detect unsigned/signed
Fix the determination for whether a non-specific type is signed
node-ffi-napi_node-ffi-napi
train
js
712eca239b3e6f1fba7626e329c5bf08b6be80e1
diff --git a/spec/views/dbd_data_engine/data/new.html.haml_spec.rb b/spec/views/dbd_data_engine/data/new.html.haml_spec.rb index <HASH>..<HASH> 100644 --- a/spec/views/dbd_data_engine/data/new.html.haml_spec.rb +++ b/spec/views/dbd_data_engine/data/new.html.haml_spec.rb @@ -12,12 +12,12 @@ describe 'dbd_data_engine/data/new.html.haml' do #should_not raise_error end - it 'talks about predicate' do - rendered.should match(/predicate/i) + it 'has table header "predicate"' do + rendered.should have_xpath('.//table/tr/th', :text => 'predicate') end - it 'talks about object' do - rendered.should match(/object/i) + it 'has table header "object"' do + rendered.should have_xpath('.//table/tr/th', :text => 'object') end it 'has a drop down select box with predicates' do @@ -27,5 +27,9 @@ describe 'dbd_data_engine/data/new.html.haml' do it 'has a submit button' do rendered.should have_button('Submit') end + + it 'has a form that posts to /data/' do + rendered.should have_xpath('.//form[@action="/data"][@method="post"]', :text => 'predicate') + end end end
data/new has a form that posts to /data * from Berlin airport
petervandenabeele_dbd_data_engine
train
rb
d93623a8f8e35536631dc5d97428d9e57147cf27
diff --git a/astrocats/catalog/catdict.py b/astrocats/catalog/catdict.py index <HASH>..<HASH> 100644 --- a/astrocats/catalog/catdict.py +++ b/astrocats/catalog/catdict.py @@ -95,8 +95,9 @@ class CatDict(OrderedDict): if not key.check(kwargs[key]): # Have the parent log a warning if this is a required key warn = (key in self._req_keys) - raise CatDictError("Value for '{}' is invalid '{}'".format( - key.pretty(), kwargs[key]), warn=warn) + raise CatDictError( + "Value for '{}' is invalid '{}'".format( + key.pretty(), kwargs[key])) # Handle Special Cases # -------------------- @@ -118,8 +119,7 @@ class CatDict(OrderedDict): # elements should have been removed from `kwargs`. if not self._ALLOW_UNKNOWN_KEYS and len(kwargs): raise CatDictError( - "All permitted keys stored, remaining: '{}'".format(kwargs), - warn=True) + "All permitted keys stored, remaining: '{}'".format(kwargs)) # Make sure that currently stored values are valid self._check()
BUG: hot-fix... remove 'warn' feature for the moment.
astrocatalogs_astrocats
train
py
6a9e8ffe36f00d2e996d9ec001a89d7c8dbafee5
diff --git a/geomet/geopackage.py b/geomet/geopackage.py index <HASH>..<HASH> 100644 --- a/geomet/geopackage.py +++ b/geomet/geopackage.py @@ -108,7 +108,7 @@ def loads(string): Construct a GeoJSON `dict` from geopackage (string). This function strips the geopackage header from the - string and passes the WKB after it directly to the + string and passes the remaining WKB geometry to the `geomet.wkb.loads` function. The envelope, if present, is added to the GeoJSON as
clarify wording in geopackage docstrings
geomet_geomet
train
py
b3b82f2dd185b8c39763f02eb0b58a83eae6e9d2
diff --git a/src/edu/jhu/hltcoe/gridsearch/cpt/PseudocostVariableSelector.java b/src/edu/jhu/hltcoe/gridsearch/cpt/PseudocostVariableSelector.java index <HASH>..<HASH> 100644 --- a/src/edu/jhu/hltcoe/gridsearch/cpt/PseudocostVariableSelector.java +++ b/src/edu/jhu/hltcoe/gridsearch/cpt/PseudocostVariableSelector.java @@ -60,7 +60,7 @@ public class PseudocostVariableSelector extends AbstractScoringVariableSelector deltaSum[c][m][lu] += cDelta; numObserved[c][m][lu]++; - String name = node.getIdm().getName(c, m); + String name = idm.getName(c, m); log.trace(String.format("Probing: c=%d m=%d lu=%d name=%s diff=%f", c, m, lu, name, cDelta)); } }
Bug fix: NullPointerException because node wasn't active. 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
88edace22c6e09465cfa778bd61ecb2ae909049c
diff --git a/arguments/__init__.py b/arguments/__init__.py index <HASH>..<HASH> 100644 --- a/arguments/__init__.py +++ b/arguments/__init__.py @@ -510,6 +510,7 @@ class Arguments(object): raise options, positional_arguments = self.sort_arguments(arguments) + self._set_fields(positional_arguments, options) checking_commands = False
devenv Friday <I> April <I> (week:<I> day:<I>), <I>:<I>:<I>
erikdejonge_arguments
train
py
25546fd45bf97622b1dfbaf0b562ee8ed941c18f
diff --git a/google-apis-generator/lib/google/apis/generator/updater.rb b/google-apis-generator/lib/google/apis/generator/updater.rb index <HASH>..<HASH> 100644 --- a/google-apis-generator/lib/google/apis/generator/updater.rb +++ b/google-apis-generator/lib/google/apis/generator/updater.rb @@ -30,7 +30,7 @@ module Google version_content = changelog_content = nil generator_result.files.each do |path, content| full_path = File.join(base_dir, path) - old_content = File.binread(full_path) if File.readable?(full_path) + old_content = File.read(full_path) if File.readable?(full_path) if path == generator_result.version_path version_content = old_content || content elsif path == generator_result.changelog_path
fix(generator): Fix charset used in file comparison
googleapis_google-api-ruby-client
train
rb
b39dbdbb996f9a2a6b17f16684edbbbda2be036c
diff --git a/eventsourcing/tests/contrib_tests/paxos_tests/test_paxos_system.py b/eventsourcing/tests/contrib_tests/paxos_tests/test_paxos_system.py index <HASH>..<HASH> 100644 --- a/eventsourcing/tests/contrib_tests/paxos_tests/test_paxos_system.py +++ b/eventsourcing/tests/contrib_tests/paxos_tests/test_paxos_system.py @@ -60,7 +60,6 @@ class TestPaxosSystem(unittest.TestCase): self.assert_final_value(paxosprocess1, key3, value3) self.assert_final_value(paxosprocess2, key3, value3) print("Resolved paxos 3 with single thread in %ss" % ended3) - sleep(0.1) def test_multiprocessing(self): set_db_uri()
Removed sleep() from end of test.
johnbywater_eventsourcing
train
py
d6ed8403ee308febf7269c82b7b0f7332e4c905a
diff --git a/config/config.php b/config/config.php index <HASH>..<HASH> 100644 --- a/config/config.php +++ b/config/config.php @@ -201,7 +201,7 @@ return [ 'activators' => [ 'file' => [ 'class' => FileActivator::class, - 'statuses-file' => storage_path('modules_statuses.json'), + 'statuses-file' => storage_path('app/modules_statuses.json'), 'cache-key' => 'activator.installed', 'cache-lifetime' => 604800, ],
Change the fileactivator status file path
nWidart_laravel-modules
train
php
2e47565dd8d9b95800a7475ade1a4a71d3f371a6
diff --git a/tests/test-timber-function-wrapper.php b/tests/test-timber-function-wrapper.php index <HASH>..<HASH> 100644 --- a/tests/test-timber-function-wrapper.php +++ b/tests/test-timber-function-wrapper.php @@ -53,7 +53,7 @@ class TestTimberFunctionWrapper extends Timber_UnitTestCase { function testSoloFunction() { new TimberFunctionWrapper('my_boo'); $str = Timber::compile_string("{{ my_boo }}"); - $this->assertEquals('', trim($str)); + $this->assertEquals('bar!', trim($str)); } /* Sample function to test exception handling */ @@ -69,6 +69,5 @@ class TestTimberFunctionWrapper extends Timber_UnitTestCase { } function my_boo() { - echo 'bar!'; return 'bar!'; }
ref #<I> -- or is it?
timber_timber
train
php
693c02d0f5f86b30022cb0c6816d337da1b3f4dc
diff --git a/index.php b/index.php index <HASH>..<HASH> 100644 --- a/index.php +++ b/index.php @@ -2,6 +2,7 @@ // index.php - the front page. require("config.php"); + include("mod/reading/lib.php"); if (! $site = get_record("course", "category", 0)) { redirect("$CFG->wwwroot/admin/"); @@ -23,8 +24,16 @@ <LI><A TITLE="Available courses on this server" HREF="course/"><B>Courses</B></A><BR></LI> <LI><A TITLE="Site-level Forums" HREF="mod/discuss/index.php?id=<?=$site->id?>">Forums</A></LI> - <? include("mod/reading/lib.php"); - list_all_readings(); + <? + if ($readings = list_all_readings()) { + foreach ($readings as $reading) { + echo "<LI>$reading"; + } + } + + if ($USER->editing) { + echo "<P align=right><A HREF=\"$CFG->wwwroot/course/mod.php?id=$course->id&week=0&add=reading\">Add Reading</A>...</P>"; + } ?> <BR><BR>
Some changes to accomodate changes in the reading lib
moodle_moodle
train
php
e516ee1f26e1df9c07a90a5a54fddcdd21f2e6ae
diff --git a/pkg/cmd/client/kubecfg.go b/pkg/cmd/client/kubecfg.go index <HASH>..<HASH> 100644 --- a/pkg/cmd/client/kubecfg.go +++ b/pkg/cmd/client/kubecfg.go @@ -229,7 +229,7 @@ func (c *KubeConfig) Run() { "imageRepositoryMappings": {"ImageRepositoryMapping", client.RESTClient}, } - matchFound := c.executeConfigRequest(method, clients) || c.executeAPIRequest(method, clients) || c.executeControllerRequest(method, kubeClient) + matchFound := c.executeConfigRequest(method, clients) || c.executeControllerRequest(method, kubeClient) || c.executeAPIRequest(method, clients) if matchFound == false { glog.Fatalf("Unknown command %s", method) } @@ -381,7 +381,7 @@ func (c *KubeConfig) executeAPIRequest(method string, clients ClientMappings) bo func (c *KubeConfig) executeControllerRequest(method string, client *kubeclient.Client) bool { parseController := func() string { if len(c.Args) != 2 { - glog.Fatal("usage: kubecfg [OPTIONS] stop|rm|rollingupdate <controller>") + glog.Fatal("usage: kubecfg [OPTIONS] stop|rm|rollingupdate|run|resize <controller>") } return c.Arg(1) }
Fix problem with replicationController ops in kube command
openshift_origin
train
go
cbf132ed1f5537fed99c34592add8c116c062ef9
diff --git a/src/electronRendererEnhancer.js b/src/electronRendererEnhancer.js index <HASH>..<HASH> 100644 --- a/src/electronRendererEnhancer.js +++ b/src/electronRendererEnhancer.js @@ -69,8 +69,9 @@ export default function electronRendererEnhancer({ // Dispatches from other processes are forwarded using this ipc message ipcRenderer.on(`${globalName}-browser-dispatch`, (event, action) => { + action = JSON.parse(action); if (!synchronous || action.source !== currentSource) { - doDispatch(JSON.parse(action)); + doDispatch(action); } });
Fixes #<I>. Parse the action before it's referenced.
samiskin_redux-electron-store
train
js
327dc57e4a28198e3efb11f7fd263fefd83e08ac
diff --git a/services/chocolatey/chocolatey.service.js b/services/chocolatey/chocolatey.service.js index <HASH>..<HASH> 100644 --- a/services/chocolatey/chocolatey.service.js +++ b/services/chocolatey/chocolatey.service.js @@ -3,7 +3,7 @@ import { createServiceFamily } from '../nuget/nuget-v2-service-family.js' export default createServiceFamily({ defaultLabel: 'chocolatey', serviceBaseUrl: 'chocolatey', - apiBaseUrl: 'https://www.chocolatey.org/api/v2', + apiBaseUrl: 'https://community.chocolatey.org/api/v2', odataFormat: 'json', title: 'Chocolatey', examplePackageName: 'git',
Update Chocolatey API endpoint URL (#<I>) Old API endpoint 1. returns bogus redirects for some reason 2. is no longer the Chocolatey Community Repository Resolves #<I> See chocolatey/home#<I>
badges_shields
train
js
6c14afe2832616c28e781a489d575ea5f507dcc4
diff --git a/xwiki-rendering-transformations/xwiki-rendering-transformation-linkchecker/src/main/java/org/xwiki/rendering/internal/transformation/linkchecker/DefaultHTTPChecker.java b/xwiki-rendering-transformations/xwiki-rendering-transformation-linkchecker/src/main/java/org/xwiki/rendering/internal/transformation/linkchecker/DefaultHTTPChecker.java index <HASH>..<HASH> 100644 --- a/xwiki-rendering-transformations/xwiki-rendering-transformation-linkchecker/src/main/java/org/xwiki/rendering/internal/transformation/linkchecker/DefaultHTTPChecker.java +++ b/xwiki-rendering-transformations/xwiki-rendering-transformation-linkchecker/src/main/java/org/xwiki/rendering/internal/transformation/linkchecker/DefaultHTTPChecker.java @@ -50,6 +50,9 @@ public class DefaultHTTPChecker implements HTTPChecker, Initializable /** * The client to connect to the remote site using HTTP. + * <p/> + * Note: If one day we wish to configure timeouts, here's some good documentation about it: + * http://brian.olore.net/wp/2009/08/apache-httpclient-timeout/ */ private HttpClient httpClient;
[Misc] Added link to site with good documentation for commons httpclient timeout configuration
xwiki_xwiki-rendering
train
java
1ac65169e832a95d0a9cee64a4ce2177606c18f0
diff --git a/exa/cms/editors/tests/test_editor.py b/exa/cms/editors/tests/test_editor.py index <HASH>..<HASH> 100644 --- a/exa/cms/editors/tests/test_editor.py +++ b/exa/cms/editors/tests/test_editor.py @@ -9,7 +9,7 @@ related functions. """ import shutil import os, gzip, bz2 -from io import StringIO +from io import StringIO, open from uuid import uuid4 from exa._config import config from exa.tester import UnitTester
Overwrite py2 open with io.open
exa-analytics_exa
train
py
c6473729c39e27493ab13bcebca9f686c52bef2b
diff --git a/retext.py b/retext.py index <HASH>..<HASH> 100755 --- a/retext.py +++ b/retext.py @@ -40,9 +40,10 @@ def main(): sheetfile.open(QIODevice.ReadOnly) app.setStyleSheet(QTextStream(sheetfile).readAll()) sheetfile.close() - # A work-around for https://bugs.webkit.org/show_bug.cgi?id=114618 - webSettings = QWebSettings.globalSettings() - webSettings.setFontFamily(QWebSettings.FixedFont, 'monospace') + if webkit_available: + # A work-around for https://bugs.webkit.org/show_bug.cgi?id=114618 + webSettings = QWebSettings.globalSettings() + webSettings.setFontFamily(QWebSettings.FixedFont, 'monospace') window = ReTextWindow() window.show() fileNames = [QFileInfo(arg).canonicalFilePath() for arg in sys.argv[1:]]
Apply previous workaround only if webkit_available is True
retext-project_retext
train
py
071d47c282b0d9d273440f8a9a4b6388db6afce7
diff --git a/lib/htmlgrid/grid.rb b/lib/htmlgrid/grid.rb index <HASH>..<HASH> 100644 --- a/lib/htmlgrid/grid.rb +++ b/lib/htmlgrid/grid.rb @@ -22,7 +22,7 @@ # ywesee - intellectual capital connected, Winterthurerstrasse 52, CH-8006 Zuerich, Switzerland # htmlgrid@ywesee.com, www.ywesee.com/htmlgrid # -# HtmlGrid::Grid -- htmlgrid -- 21.02.2012 -- mhatakeyama@ywesee.com +# HtmlGrid::Grid -- htmlgrid -- 22.02.2012 -- mhatakeyama@ywesee.com # HtmlGrid::Grid -- htmlgrid -- 12.01.2010 -- hwyss@ywesee.com begin VERSION = '1.0.4' @@ -155,7 +155,7 @@ rescue LoadError html << field.to_html(cgi) span = field.colspan else - span.step(-1) + span -= 1 end } html
Fixed set_colspan method in grid.rb
zdavatz_htmlgrid
train
rb
1f5597bb0786cbf15f2dfbdbe66726a559b5b3cb
diff --git a/src/dataviews/dataview-model-base.js b/src/dataviews/dataview-model-base.js index <HASH>..<HASH> 100644 --- a/src/dataviews/dataview-model-base.js +++ b/src/dataviews/dataview-model-base.js @@ -60,11 +60,18 @@ module.exports = Model.extend({ // Retrigger an event when the filter changes if (this.filter) { - this.listenTo(this.filter, 'change', this._reloadMap); + this.listenTo(this.filter, 'change', this._onFilterChanged); } }, /** + * @private + */ + _onFilterChanged: function () { + this._reloadMap(); + }, + + /** * @protected */ _reloadMap: function () {
Leave _onFilterChange since used in another branch cc @alonsogarciapablo
CartoDB_carto.js
train
js
fbd68226491304f6fbbd3a8e15a29f3f2bee4d68
diff --git a/metrics/bigquery.py b/metrics/bigquery.py index <HASH>..<HASH> 100755 --- a/metrics/bigquery.py +++ b/metrics/bigquery.py @@ -151,6 +151,11 @@ def main(configs, project, bucket_path): """Loads metric config files and runs each metric.""" queryer = BigQuerier(project, bucket_path) + # authenticate as the given service account if our environment is providing one + if 'GOOGLE_APPLICATION_CREDENTIALS' in os.environ: + keyfile = os.environ['GOOGLE_APPLICATION_CREDENTIALS'] + check(['gcloud', 'auth', 'activate-service-account', f'--key-file={keyfile}']) + # the 'bq show' command is called as a hack to dodge the config prompts that bq presents # the first time it is run. A newline is passed to stdin to skip the prompt for default project # when the service account in use has access to multiple projects.
metrics: support workload identity moving the job that runs this from a bootstrap-based prowjob (which performs this gcloud auth check before invoking its arguments) to a decorated job (which leaves this responsibility to the command being invoked)
kubernetes_test-infra
train
py
9e46997159100e5e3d4c39145d5903da39da8d9c
diff --git a/core/src/main/java/org/bitcoinj/core/Message.java b/core/src/main/java/org/bitcoinj/core/Message.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/bitcoinj/core/Message.java +++ b/core/src/main/java/org/bitcoinj/core/Message.java @@ -68,7 +68,8 @@ public abstract class Message { protected Message(NetworkParameters params) { this.params = params; - serializer = params.getDefaultSerializer(); + this.protocolVersion = params.getProtocolVersionNum(NetworkParameters.ProtocolVersion.CURRENT); + this.serializer = params.getDefaultSerializer(); } protected Message(NetworkParameters params, byte[] payload, int offset, int protocolVersion) throws ProtocolException {
Message: Fix one constructor doesn't set the protocol version.
bitcoinj_bitcoinj
train
java
e5ea304b946d43fafbff7e2797cbdcec31a9dbf0
diff --git a/centinel/primitives/tls.py b/centinel/primitives/tls.py index <HASH>..<HASH> 100644 --- a/centinel/primitives/tls.py +++ b/centinel/primitives/tls.py @@ -18,14 +18,14 @@ def get_fingerprint(host, port=443, external=None, log_prefix=''): try: cert = ssl.get_server_certificate((host, port), - ssl_version=ssl.PROTOCOL_SSLv23) + ssl_version=ssl.PROTOCOL_TLSv1) # if this fails, there's a possibility that SSLv3 handshake was # attempted and rejected by the server. Use TLSv1 instead. except ssl.SSLError: # exception could also happen here try: cert = ssl.get_server_certificate((host, port), - ssl_version=ssl.PROTOCOL_TLSv1) + ssl_version=ssl.PROTOCOL_SSLv23) except Exception as exp: tls_error = str(exp) except Exception as exp:
try tlsv1 first
iclab_centinel
train
py
baef6a8e8fb320147b110cb9669abae58ea23f82
diff --git a/tests/test_server.py b/tests/test_server.py index <HASH>..<HASH> 100644 --- a/tests/test_server.py +++ b/tests/test_server.py @@ -35,15 +35,15 @@ class TestServer(object): assert_raises(StopIteration, next, server_data) def test_pickling(self): - # This tests fails at Travis, and does not fail locally. - # We skip it now in order to not block the development. - raise SkipTest - self.stream = cPickle.loads(cPickle.dumps(self.stream)) - server_data = self.stream.get_epoch_iterator() - expected_data = get_stream().get_epoch_iterator() - for _, s, e in zip(range(3), server_data, expected_data): - for data in zip(s, e): - assert_allclose(*data, rtol=1e-2) + try: + self.stream = cPickle.loads(cPickle.dumps(self.stream)) + server_data = self.stream.get_epoch_iterator() + expected_data = get_stream().get_epoch_iterator() + for _, s, e in zip(range(3), server_data, expected_data): + for data in zip(s, e): + assert_allclose(*data, rtol=1e-3) + except AssertionError as e: + raise SkipTest("Skip test_that failed with:".format(e)) assert_raises(StopIteration, next, server_data) def test_value_error_on_request(self):
Only skip if AssertionError is raised
mila-iqia_fuel
train
py