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
395abd064855176ed83d6ee621a7cff6394245ea
diff --git a/validation/time_series/time_series.py b/validation/time_series/time_series.py index <HASH>..<HASH> 100644 --- a/validation/time_series/time_series.py +++ b/validation/time_series/time_series.py @@ -182,7 +182,7 @@ class Test(AbstractTest): MaxSurfaceSpeed=ExtractTSData(MaxSurfaceSpeed,line,7) MaxBasalSpeed=ExtractTSData(MaxBasalSpeed,line,7) - #Third: generate time series plots, including minimal statistics, + #Third: generate time series plots and minimal statistics #for each diagnostic. WritePlot(Area,'Area',CISM2time,pd) AreaStats=Area.describe()
Some additional unsaved changes missed on last commit.
LIVVkit_LIVVkit
train
py
3554748c9e353387f0d9dfbfb8366ab8f8cbb611
diff --git a/src/BaseClient.php b/src/BaseClient.php index <HASH>..<HASH> 100644 --- a/src/BaseClient.php +++ b/src/BaseClient.php @@ -75,6 +75,10 @@ class BaseClient extends GuzzleClient $data = array_replace_recursive($data, $config['description_override']); } + if ( ! isset($data['baseUri'])) { + throw new \Exception('A baseUri is required.', 1488211973); + } + return new Description($data); }
Communicate that a baseUri is required.
silinternational_idp-id-broker-php-client
train
php
e751920152a65b3897a93567729ed0243e9f1f4c
diff --git a/src/sap.m/src/sap/m/UploadCollection.js b/src/sap.m/src/sap/m/UploadCollection.js index <HASH>..<HASH> 100644 --- a/src/sap.m/src/sap/m/UploadCollection.js +++ b/src/sap.m/src/sap/m/UploadCollection.js @@ -1636,9 +1636,7 @@ sap.ui.define([ UploadCollection.prototype._refreshFileUploaderParams = function (oItem) { this._getFileUploader().removeAllAggregation("headerParameters", true); - this.removeAllAggregation("headerParameters", true); this._getFileUploader().removeAllAggregation("parameters", true); - this.removeAllAggregation("parameters", true); // Params this.getParameters().forEach(function (oParam) {
[FIX] sap.m.UploadCollection - Header params were not propagated correctly Change-Id: I<I>c7c7c0fcce<I>bc<I>a0f<I> BCP: <I>
SAP_openui5
train
js
f648b5534511fcf630a017c8c1717101ca90931b
diff --git a/codenerix/__init__.py b/codenerix/__init__.py index <HASH>..<HASH> 100644 --- a/codenerix/__init__.py +++ b/codenerix/__init__.py @@ -1,4 +1,4 @@ -__version__ = "1.1.11" +__version__ = "1.1.12" __authors__ = [ 'Juan Miguel Taboada Godoy <juanmi@juanmitaboada.com>',
Resolved an intermittent bug that prevented views with form_ngcontrollers to work properly
codenerix_django-codenerix
train
py
50e632fcfd513e91b8f2fe3ab6f54aa35a28ea87
diff --git a/base.php b/base.php index <HASH>..<HASH> 100644 --- a/base.php +++ b/base.php @@ -2042,7 +2042,9 @@ class View extends Prefab { //! Template file $view, //! post-rendering handler - $trigger; + $trigger, + //! Nesting level + $level=0; /** * Encode characters to equivalent HTML entities @@ -2078,11 +2080,11 @@ class View extends Prefab { * @param $hive array **/ protected function sandbox(array $hive=NULL) { + $this->level++; $fw=Base::instance(); if (!$hive) $hive=$fw->hive(); - if (!$fw->exists('RENDERING',$rendering)) { - $fw->set('RENDERING', true); + if ($this->level<2) { if ($fw->get('ESCAPE')) $hive=$this->esc($hive); if (isset($hive['ALIASES'])) @@ -2093,7 +2095,7 @@ class View extends Prefab { unset($hive); ob_start(); require($this->view); - Base::instance()->clear('RENDERING'); + $this->level--; return ob_get_clean(); }
Bugfix: prevent multiple encoding in nested views/templates
bcosca_fatfree-core
train
php
71ad88563f318f65c860f3f1c72cfe167267c18d
diff --git a/test/addons/unpacked-addon/test/test-main.js b/test/addons/unpacked-addon/test/test-main.js index <HASH>..<HASH> 100644 --- a/test/addons/unpacked-addon/test/test-main.js +++ b/test/addons/unpacked-addon/test/test-main.js @@ -7,18 +7,18 @@ const self = require("sdk/self"); const url = require("sdk/url"); const { getAddonByID } = require("sdk/addon/manager"); -exports["test self.packed"] = function (assert) { +exports["test self.packed"] = (assert) => { assert.ok(!self.packed, "require('sdk/self').packed is correct"); } -exports["test url.toFilename"] = function (assert) { +exports["test url.toFilename"] = (assert) => { assert.ok(/.*main\.js$/.test(url.toFilename(module.uri)), "url.toFilename() on resource: URIs should work"); } exports["test Addon is unpacked"] = function*(assert) { let addon = yield getAddonByID(self.id); - assert.ok(addon.unpacked, "the addon is unpacked"); + assert.equal(addon.getResourceURI("").scheme, "file", "the addon is unpacked"); } -require("sdk/test").run(module); +require("sdk/test").run(exports);
Issue #<I> updating the unpacked test add-on
mozilla-jetpack_jpm
train
js
e3ea9ec12a5658ee98f9fc595047532091f07725
diff --git a/test/class_refinement_test.rb b/test/class_refinement_test.rb index <HASH>..<HASH> 100644 --- a/test/class_refinement_test.rb +++ b/test/class_refinement_test.rb @@ -104,4 +104,16 @@ describe Casting, '.delegating' do jim.greet } end + + it 'sets instances to respond_to? class delegate methods' do + jim = ClassDelegatingPerson.new('Jim') + + refute jim.respond_to?(:greet) + + Casting.delegating(ClassDelegatingPerson => ClassGreeter) do + assert jim.respond_to?(:greet) + end + + refute jim.respond_to?(:greet) + end end \ No newline at end of file
test that instances of class delegates respond to delegated methods
saturnflyer_casting
train
rb
cf44dc16818646b1e3716d5257a728007f5c5666
diff --git a/cassiopeia/datastores/ddragon.py b/cassiopeia/datastores/ddragon.py index <HASH>..<HASH> 100644 --- a/cassiopeia/datastores/ddragon.py +++ b/cassiopeia/datastores/ddragon.py @@ -377,7 +377,12 @@ class DDragon(DataSource): find = "name", query["name"] else: raise RuntimeError("Impossible!") - rune = find_matching_attribute(runes["data"].values(), *find) + if isinstance(runes["data"], list): + rune = find_matching_attribute(runes["data"], *find) + elif isinstance(runes["data"], dict): + rune = find_matching_attribute(runes["data"].values(), *find) + else: + raise ValueError("The runes data from DDragon came back in an unexpected format. Please report this on Github!") if rune is None: raise NotFoundError rune["region"] = query["platform"].region.value
bugfix for loading runes from ddragon
meraki-analytics_cassiopeia
train
py
d75f1335479969db036cf39dd627fdb96e6ad09f
diff --git a/orb/core/database.py b/orb/core/database.py index <HASH>..<HASH> 100644 --- a/orb/core/database.py +++ b/orb/core/database.py @@ -279,8 +279,10 @@ class Database(object): all_models.sort(cmp=lambda x,y: cmp(x.schema(), y.schema())) tables = [model for model in all_models if issubclass(model, orb.Table) and + not model.schema().testFlags(orb.Schema.Flags.Abstract) and (not models or model.schema().name() in models)] views = [model for model in all_models if issubclass(model, orb.View) and + not model.schema().testFlags(orb.Schema.Flags.Abstract) and (not models or model.schema().name() in models)] # initialize the database
ignoring abstract schemas for syncing
orb-framework_orb
train
py
7142956e9da7239d1ec5b828d59f65ae5c37ed1b
diff --git a/msm/action/add_action.py b/msm/action/add_action.py index <HASH>..<HASH> 100644 --- a/msm/action/add_action.py +++ b/msm/action/add_action.py @@ -4,6 +4,6 @@ from msm.util import log def execute(args): log.set_config(args) - file = file_manager.add_setting(args.file) + file = file_manager.add_setting(args.alias, args.file) repository.create(args.alias, file) log.restore_config() diff --git a/msm/file_manager.py b/msm/file_manager.py index <HASH>..<HASH> 100644 --- a/msm/file_manager.py +++ b/msm/file_manager.py @@ -15,8 +15,8 @@ def init(): return True -def add_setting(file_path): - file_name = os.path.split(file_path)[1] +def add_setting(alias, file_path): + file_name = alias + os.path.split(file_path)[1] dst_path = config.msm_path + file_name log.debug('Add {F} to {D}'.format(F=file_path, D=dst_path))
Add alias with prefix to the file name
Gunmer_maven-setting-administrator
train
py,py
5de0ec44b53ecc67b58519353b04c6381afc23ff
diff --git a/index.js b/index.js index <HASH>..<HASH> 100755 --- a/index.js +++ b/index.js @@ -25,7 +25,15 @@ function run() { console.error('Unable to parse your git URL'); process.exit(2); } - exec('curl "github-changelog-api.herokuapp.com/'+repoInfo[1]+'/'+repoInfo[2]+'"').to('CHANGELOG.md'); + var url = 'github-changelog-api.herokuapp.com/' + repoInfo[1] + '/' + repoInfo[2]; + exec('curl -X POST -s "' + url + '"'); + var newLog; + do { + exec('sleep 1'); + newLog = exec('curl "' + url + '"'); + } while (newLog.match(/^Working, try again.*/)); + // Now that the contents are valid, we can write this out to disk + newLog.to('CHANGELOG.md'); var changelog_was_updated = false; exec('git ls-files --exclude-standard --modified --others').split('\n').forEach(function (file) {
fix: properly works with heroku API (POST then GET)
shelljs_changelog
train
js
31d58c5cbbede6dc33d10feecd5277ccddb367e6
diff --git a/src/queue/delay.js b/src/queue/delay.js index <HASH>..<HASH> 100644 --- a/src/queue/delay.js +++ b/src/queue/delay.js @@ -5,7 +5,7 @@ define([ ], function( jQuery ) { // Based off of the plugin by Clint Helfers, with permission. -// http://blindsignals.com/index.php/2009/07/jquery-delay/ +// http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ jQuery.fn.delay = function( time, type ) { time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; type = type || "fx";
Change broken url to wayback one
jquery_jquery
train
js
99ca98eaea235d801af08af7953e0160229633f1
diff --git a/i3pystatus/openvpn.py b/i3pystatus/openvpn.py index <HASH>..<HASH> 100644 --- a/i3pystatus/openvpn.py +++ b/i3pystatus/openvpn.py @@ -18,8 +18,8 @@ class OpenVPN(IntervalModule): """ - colour_up = "#00ff00" - colour_down = "#FF0000" + color_up = "#00ff00" + color_down = "#FF0000" status_up = '▲' status_down = '▼' format = "{vpn_name} {status}" @@ -30,8 +30,8 @@ class OpenVPN(IntervalModule): settings = ( ("format", "Format string"), - ("colour_up", "VPN is up"), - ("colour_down", "VPN is down"), + ("color_up", "VPN is up"), + ("color_down", "VPN is down"), ("status_down", "Symbol to display when down"), ("status_up", "Symbol to display when up"), ("vpn_name", "Name of VPN"), @@ -46,10 +46,10 @@ class OpenVPN(IntervalModule): output = command_result.out.strip() if output == 'active': - color = self.colour_up + color = self.color_up status = self.status_up else: - color = self.colour_down + color = self.color_down status = self.status_down vpn_name = self.vpn_name
openvpn: Rename colour_up/colour_down to color_up/color_down
enkore_i3pystatus
train
py
3049a81c94e0088abef766e7f0f7e647e8bd6870
diff --git a/src/buttongroup.js b/src/buttongroup.js index <HASH>..<HASH> 100644 --- a/src/buttongroup.js +++ b/src/buttongroup.js @@ -70,11 +70,11 @@ $.ButtonGroup = function( options ) { // TODO What if there IS an options.group specified? if( !options.group ){ - this.label = $.makeNeutralElement( "label" ); + this.element.style.display = "inline-block"; + //this.label = $.makeNeutralElement( "label" ); //TODO: support labels for ButtonGroups //this.label.innerHTML = this.labelText; - this.element.style.display = "inline-block"; - this.element.appendChild( this.label ); + //this.element.appendChild( this.label ); for ( i = 0; i < buttons.length; i++ ) { this.element.appendChild( buttons[ i ].element ); }
Don't insert label element until this feature is fully implemented.
openseadragon_openseadragon
train
js
78a74fdeda647f8d4c9b04444c6d44f96b428063
diff --git a/docgen/src/main/java/com/google/errorprone/DocGenTool.java b/docgen/src/main/java/com/google/errorprone/DocGenTool.java index <HASH>..<HASH> 100644 --- a/docgen/src/main/java/com/google/errorprone/DocGenTool.java +++ b/docgen/src/main/java/com/google/errorprone/DocGenTool.java @@ -86,7 +86,7 @@ public final class DocGenTool { public static void main(String[] args) throws IOException { Options options = new Options(); - new JCommander(options, args); + JCommander unused = new JCommander(options, args); Path bugPatterns = Paths.get(options.bugPatterns); if (!Files.exists(bugPatterns)) {
Assign unused instance to an unused variable. (Alternatively, we could disable the check w/ an `XepOpt` --- thoughts?) PiperOrigin-RevId: <I>
google_error-prone
train
java
e74348ee30c4c7c8935d0a522db61b636d962715
diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DatabaseDriver.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DatabaseDriver.java index <HASH>..<HASH> 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DatabaseDriver.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jdbc/DatabaseDriver.java @@ -104,7 +104,7 @@ public enum DatabaseDriver { * @since 2.1.0 */ HANA("HDB", "com.sap.db.jdbc.Driver", "com.sap.db.jdbcext.XADataSourceSAP", - "SELECT 1 FROM DUMMY") { + "SELECT 1 FROM SYS.DUMMY") { @Override protected Collection<String> getUrlPrefixes() { return Collections.singleton("sap");
Fix HANA validation query This commit updates the validation query for HANA. It should use the fully qualified dummy table name (SYS.DUMMY) to avoid unexpected results if there is a local table named DUMMY. Closes gh-<I>
spring-projects_spring-boot
train
java
e54168e5ea33b9f77be3561672ed82a4ce73e47d
diff --git a/geomdl/utilities.py b/geomdl/utilities.py index <HASH>..<HASH> 100644 --- a/geomdl/utilities.py +++ b/geomdl/utilities.py @@ -636,17 +636,15 @@ def polygon_triangulate(tri_idx, *args): :return: list of Triangle objects :rtype: list """ - # Add first element to the end of the list (just to make list traversal easier) - vertices = list(args) - vertices.append(args[0]) - - # Generate triangles + # Initialize variables tidx = 0 triangles = [] - for idx in range(0, len(args), 2): + + # Generate triangles + for idx in range(1, len(args) - 1): tri = Triangle() tri.id = tri_idx + tidx - tri.add_vertex(vertices[idx], vertices[idx + 1], vertices[idx + 2]) + tri.add_vertex(args[0], args[idx], args[idx + 1]) triangles.append(tri) tidx += 1
Fix a logical error in polygon_triangulate
orbingol_NURBS-Python
train
py
1c6836dde16c43c7a6c88f2e79e28c4d1c761bda
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -145,6 +145,7 @@ module.exports = { var endpoint = api_url + '/' + api_version + '/' + config.bucket.slug + '/object-type/' + object.type_slug + searchParams + '&read_key=' + config.bucket.read_key; if (object.limit) endpoint += '&limit=' + object.limit; if (object.skip) endpoint += '&skip=' + object.skip; + if (object.sort) endpoint += '&sort=' + object.sort; if (object.locale) endpoint += '&locale=' + object.locale; fetch(endpoint) .then(function(response){
added sort in getObjectsBySearch
cosmicjs_cosmicjs-node
train
js
e3fd773314093c2323ab726ce2de8d016c0e6a21
diff --git a/Qt.py b/Qt.py index <HASH>..<HASH> 100644 --- a/Qt.py +++ b/Qt.py @@ -833,12 +833,6 @@ def _loadUi(uifile, baseinstance=None): return the newly created instance of the user interface. """ - # Not sure where this code came from. - # if hasattr(baseinstance, "layout") and baseinstance.layout(): - # message = ("QLayout: Attempting to add Layout to %s which " - # "already has a layout") - # raise RuntimeError(message % (baseinstance)) - if hasattr(Qt, "_uic"): return Qt._uic.loadUi(uifile, baseinstance)
Removing commented code. @mottosso confirmed it was unneeded. Must have been something I added at some point.
mottosso_Qt.py
train
py
773a0c7a9797e07a76b47b7ae32fa113eb699f36
diff --git a/tests/test_update_query.py b/tests/test_update_query.py index <HASH>..<HASH> 100644 --- a/tests/test_update_query.py +++ b/tests/test_update_query.py @@ -120,6 +120,10 @@ def test_with_query_list_int(): @pytest.mark.parametrize( "query,expected", [ + pytest.param({"a": []}, "?", id="empty list"), + pytest.param({"a": ()}, "?", id="empty tuple"), + pytest.param({"a": [1]}, "?a=1", id="single list"), + pytest.param({"a": (1,)}, "?a=1", id="single tuple"), pytest.param({"a": [1, 2]}, "?a=1&a=2", id="list"), pytest.param({"a": (1, 2)}, "?a=1&a=2", id="tuple"), pytest.param({"a[]": [1, 2]}, "?a[]=1&a[]=2", id="key with braces"),
Add tests for edge cases of quoting lists and tuples
aio-libs_yarl
train
py
bd93193205149dcacc8b0e29f75e9e78cd6e8082
diff --git a/can/bus.py b/can/bus.py index <HASH>..<HASH> 100644 --- a/can/bus.py +++ b/can/bus.py @@ -92,8 +92,7 @@ class BusABC(object): raise NotImplementedError("Trying to set_filters on unsupported bus") def flush_tx_buffer(self): - """Used for CAN interfaces which need to flush their transmit buffer. - + """Discard every message that may be queued in the output buffer(s). """ pass diff --git a/can/interfaces/kvaser/canlib.py b/can/interfaces/kvaser/canlib.py index <HASH>..<HASH> 100644 --- a/can/interfaces/kvaser/canlib.py +++ b/can/interfaces/kvaser/canlib.py @@ -411,8 +411,7 @@ class KvaserBus(BusABC): canSetAcceptanceFilter(handle, can_id, can_mask, ext) def flush_tx_buffer(self): - """ - Flushes the transmit buffer on the Kvaser + """ Wipeout the transmit buffer on the Kvaser. """ canIoCtl(self._write_handle, canstat.canIOCTL_FLUSH_TX_BUFFER, 0, 0)
Clarify docs about the meaning of flush_tx_buffer, closes #<I>
hardbyte_python-can
train
py,py
8b17c27444ef44a2c2b3b4226ddebcad0f81ea95
diff --git a/src/pinch-it.js b/src/pinch-it.js index <HASH>..<HASH> 100644 --- a/src/pinch-it.js +++ b/src/pinch-it.js @@ -47,7 +47,7 @@ const pinchIt = (targets: string, options: Object = {}) => { * @param { String } ease easing css property * @return { Void } */ - const scaleEl = (el, to: number, duration: number, ease: string): void => { + const scaleEl = (el: EventTarget, to: number, duration: number, ease: string): void => { const { transition, transform, hasScale3d } = prefixes; const { style } = el; // Base our new dimention on our prevous value minus our base value @@ -107,7 +107,7 @@ const pinchIt = (targets: string, options: Object = {}) => { if (!isWithin(scale, opts)) { const isLessThan = (scale < opts.minScale); lastScale = isLessThan ? opts.minScale : opts.maxScale; - scaleEl(e.target, lastScale, lastScale, opts.snapBackSpeed, opts.ease); + scaleEl(e.target, lastScale, opts.snapBackSpeed, opts.ease); } };
fixes params to scaleEl whre we lost bounche effect
houseofradon_pinchit
train
js
c1543b80e920948de7661f5b10e16699ce5433b1
diff --git a/backup/backup.php b/backup/backup.php index <HASH>..<HASH> 100644 --- a/backup/backup.php +++ b/backup/backup.php @@ -117,7 +117,9 @@ //Call the form, depending the step we are if (!$launch) { // if we're at the start, clear the cache of prefs - unset($SESSION->backupprefs[$course->id]); + if (isset($SESSION->backupprefs[$course->id])) { + unset($SESSION->backupprefs[$course->id]); + } include_once("backup_form.html"); } else if ($launch == "check") { include_once("backup_check.html");
Avoid one notice in backup. Bug <I>. (<URL>) Merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
123421004b9e14152cf0f86c13d347a9a529acfe
diff --git a/spec/tripod/repository_spec.rb b/spec/tripod/repository_spec.rb index <HASH>..<HASH> 100644 --- a/spec/tripod/repository_spec.rb +++ b/spec/tripod/repository_spec.rb @@ -30,7 +30,7 @@ describe Tripod::Repository do context 'graph_uri set on object' do it 'populates the object with triples, restricted to the graph_uri' do - Tripod::SparqlClient::Query.should_receive(:query).with(Person.all_triples_query(person.uri, graph_uri: person.graph_uri), 'application/n-triples, text/plain').and_call_original + Tripod::SparqlClient::Query.should_receive(:query).with(Person.all_triples_query(person.uri, graph_uri: person.graph_uri), Tripod.ntriples_header_str).and_call_original person.hydrate! person.repository.should_not be_empty end @@ -38,7 +38,7 @@ describe Tripod::Repository do context 'graph_uri not set on object' do it 'populates the object with triples, not to a graph' do - Tripod::SparqlClient::Query.should_receive(:query).with(Person.all_triples_query(person.uri), 'application/n-triples, text/plain').and_call_original + Tripod::SparqlClient::Query.should_receive(:query).with(Person.all_triples_query(person.uri), Tripod.ntriples_header_str).and_call_original graphless_resource.hydrate! graphless_resource.repository.should_not be_empty end
Update tests to use config option.
Swirrl_tripod
train
rb
172d3b2e04464bddd47bb8824667eb06c58b0eab
diff --git a/salt/modules/cmdmod.py b/salt/modules/cmdmod.py index <HASH>..<HASH> 100644 --- a/salt/modules/cmdmod.py +++ b/salt/modules/cmdmod.py @@ -446,7 +446,18 @@ def _run(cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE ).communicate(py_code.encode(__salt_system_encoding__)) - if env_encoded.count(marker_b) != 2: + marker_count = env_encoded.count(marker_b) + if marker_count == 0: + # Possibly PAM prevented the login + log.error( + 'Environment could not be retrieved for user \'%s\': ' + 'stderr=%r stdout=%r', + runas, env_encoded_err, env_encoded + ) + # Ensure that we get an empty env_runas dict below since we + # were not able to get the environment. + env_encoded = b'' + elif marker_count != 2: raise CommandExecutionError( 'Environment could not be retrieved for user \'{0}\'', info={'stderr': repr(env_encoded_err),
Allow cases where no marker was found to proceed without raising exception
saltstack_salt
train
py
988cfc6488778f45328462a17b5185ab7d3331ac
diff --git a/src/wyjc/testing/tests/RuntimeValidTests.java b/src/wyjc/testing/tests/RuntimeValidTests.java index <HASH>..<HASH> 100755 --- a/src/wyjc/testing/tests/RuntimeValidTests.java +++ b/src/wyjc/testing/tests/RuntimeValidTests.java @@ -257,6 +257,7 @@ public class RuntimeValidTests extends TestHarness { @Test public void RecursiveType_Valid_16_RuntimeTest() { runTest("RecursiveType_Valid_16"); } @Test public void RecursiveType_Valid_17_RuntimeTest() { runTest("RecursiveType_Valid_17"); } @Test public void RecursiveType_Valid_18_RuntimeTest() { runTest("RecursiveType_Valid_18"); } + @Ignore("Known Issue") @Test public void RecursiveType_Valid_19_RuntimeTest() { runTest("RecursiveType_Valid_19"); } @Test public void RecursiveType_Valid_20_RuntimeTest() { runTest("RecursiveType_Valid_20"); } @Test public void Remainder_Valid_1_RuntimeTest() { runTest("Remainder_Valid_1"); }
Ok, had to mark RecursiveType_Valid_<I> as ignore because it causes an infinite loop!!
Whiley_WhileyCompiler
train
java
413067adda5de0eb2bc9646c1ebcbba77899fc60
diff --git a/db/mongo/mapper.php b/db/mongo/mapper.php index <HASH>..<HASH> 100644 --- a/db/mongo/mapper.php +++ b/db/mongo/mapper.php @@ -114,20 +114,21 @@ class Mapper extends \DB\Cursor { $fw->stringify(array($fields,$filter,$options))).'.mongo', $result)) || !$ttl || $cached[0]+$ttl<microtime(TRUE)) { if ($options['group']) { + $grp=$this->collection->group( + $options['group']['keys'], + $options['group']['initial'], + $options['group']['reduce'], + array( + 'condition'=>$filter, + 'finalize'=>$options['group']['finalize'] + ) + ); $tmp=$this->db->selectcollection( $fw->get('HOST').'.'.$fw->get('BASE').'.'. uniqid(NULL,TRUE).'.tmp' ); $tmp->batchinsert( - $this->collection->group( - $options['group']['keys'], - $options['group']['initial'], - $options['group']['reduce'], - array( - 'condition'=>$filter, - 'finalize'=>$options['group']['finalize'] - ) - )['retval'], + $grp['retval'], array('safe'=>TRUE) ); $filter=array();
Made Mongo Mapper select fixes safe for php <I>
bcosca_fatfree-core
train
php
88d78723a575326cb2dca8dfba2159a6852ddbde
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ setup( # http://python-packaging.readthedocs.io/en/latest/command-line-scripts.html#the-console-scripts-entry-point entry_points = { 'console_scripts': [ - 'iota-cli=iota.bin.repl:main', + 'pyota-cli=iota.bin.repl:main', ], },
change REPL name to pyota-cli
iotaledger_iota.lib.py
train
py
e40ad18c6a624911f20656f53b079625c4117aa1
diff --git a/spec/dbi.rb b/spec/dbi.rb index <HASH>..<HASH> 100644 --- a/spec/dbi.rb +++ b/spec/dbi.rb @@ -18,7 +18,7 @@ describe 'DBI::DatabaseHandle#select_column' do null.should.be.nil should.raise( DBI::DataError ) do - $dbh.select_column( "SELECT name FROM authors WHERE FALSE" ) + $dbh.select_column( "SELECT name FROM authors WHERE 1+1 = 3" ) end end diff --git a/spec/model.rb b/spec/model.rb index <HASH>..<HASH> 100644 --- a/spec/model.rb +++ b/spec/model.rb @@ -442,7 +442,7 @@ describe 'A DBI::Model subclass' do posts[ 1 ].text.should.equal 'Third post.' posts[ 1 ].class.should.equal @m_post - no_posts = @m_post.s( "SELECT * FROM posts WHERE FALSE" ) + no_posts = @m_post.s( "SELECT * FROM posts WHERE 1+1 = 3" ) no_posts.should.not.be.nil no_posts.should.be.empty end @@ -471,7 +471,7 @@ describe 'A DBI::Model subclass' do post.author_id.should.equal 1 post.text.should.equal 'Third post.' - no_post = @m_post.s1( "SELECT * FROM posts WHERE FALSE" ) + no_post = @m_post.s1( "SELECT * FROM posts WHERE 1+1 = 3" ) no_post.should.be.nil end
Changed "WHERE FALSE" to "WHERE <I> = 3" so the query works also in SQLite.
Pistos_m4dbi
train
rb,rb
3779df416c9a20b7c5d3219516e19fe71f34a8ab
diff --git a/openquake/utils/db/__init__.py b/openquake/utils/db/__init__.py index <HASH>..<HASH> 100644 --- a/openquake/utils/db/__init__.py +++ b/openquake/utils/db/__init__.py @@ -0,0 +1,20 @@ +from sqlalchemy.databases import postgres +import geoalchemy + +# This allows us to reflect 'geometry' columns from PostGIS tables. +# This is slightly hack-ish, but it's either this or we have to declare +# columns with the appropriate type manually (yuck). +postgres.ischema_names['geometry'] = geoalchemy.Geometry + + + +def create_engine( + dbname, user, password='', host='localhost', engine='postgresql'): + """ + Function wrapper for :py:func:`sqlalchemy.create_engine` which helps + generate a db connection string. + """ + + conn_str = '%s://%s:%s@%s/%s' % (engine, user, password, host, dbname) + db = sqlalchemy.create_engine(conn_str) + return db
basic stuff to setup dbloader utils
gem_oq-engine
train
py
c0da2e87738735491f04600d172a4900fa014e8f
diff --git a/src/request/sign-swap/SignSwap.js b/src/request/sign-swap/SignSwap.js index <HASH>..<HASH> 100644 --- a/src/request/sign-swap/SignSwap.js +++ b/src/request/sign-swap/SignSwap.js @@ -255,7 +255,15 @@ class SignSwap { $rightLabel.textContent = I18n.translatePhrase('bitcoin'); } else if (request.redeem.type === 'EUR') { $rightIdenticon.innerHTML = TemplateTags.hasVars(0)`<img src="../../assets/icons/bank.svg"></img>`; - $rightLabel.textContent = request.redeem.bankLabel || I18n.translatePhrase('sign-swap-your-bank'); + + let label = request.redeem.bankLabel || I18n.translatePhrase('sign-swap-your-bank'); + + // Display IBAN as recipient label if available + if (request.redeem.settlement.type === 'sepa') { + label = request.redeem.settlement.recipient.iban; + } + + $rightLabel.textContent = label; } }
Display IBAN as recipient label if available
nimiq_keyguard-next
train
js
966757faa28cc536b1bca4856f1dc693ec0bd2ea
diff --git a/asv_bench/benchmarks/gil.py b/asv_bench/benchmarks/gil.py index <HASH>..<HASH> 100644 --- a/asv_bench/benchmarks/gil.py +++ b/asv_bench/benchmarks/gil.py @@ -37,7 +37,7 @@ except ImportError: return wrapper -from .pandas_vb_common import BaseIO # noqa: E402 isort:skip +from .pandas_vb_common import BaseIO # isort:skip class ParallelGroupbyMethods: diff --git a/asv_bench/benchmarks/offset.py b/asv_bench/benchmarks/offset.py index <HASH>..<HASH> 100644 --- a/asv_bench/benchmarks/offset.py +++ b/asv_bench/benchmarks/offset.py @@ -3,7 +3,7 @@ import warnings import pandas as pd try: - import pandas.tseries.holiday # noqa + import pandas.tseries.holiday except ImportError: pass
CLN: noqa removal (#<I>)
pandas-dev_pandas
train
py,py
8c7da3f9c480ec8171fba098d7a1c5ed971422ad
diff --git a/bingo/static/bingo/js/board_list.js b/bingo/static/bingo/js/board_list.js index <HASH>..<HASH> 100644 --- a/bingo/static/bingo/js/board_list.js +++ b/bingo/static/bingo/js/board_list.js @@ -1,10 +1,10 @@ $(document).ready(function(){ var imgs = $('img.thumbnail'); - imgs.bind('mouseover', function(){console.log(this.src);this.src = this.src.replace("voted", "marked")}); + imgs.bind('mouseover', function(){this.src = this.src.replace("voted", "marked")}); imgs.bind('mouseout', function(){this.src = this.src.replace("marked", "voted")}); }); $(document).ready(function(){ var imgs = $('img.thumbnail'); - imgs.bind('mouseover', function(){console.log(this.src);this.src = this.src.replace("voted", "marked")}); + imgs.bind('mouseover', function(){this.src = this.src.replace("voted", "marked")}); imgs.bind('mouseout', function(){this.src = this.src.replace("marked", "voted")}); });
removed console.log debugging for mouseover
allo-_django-bingo
train
js
cb60285b57066010eb439f4b70bc792a4f24e506
diff --git a/tests/lib/formatters/html.js b/tests/lib/formatters/html.js index <HASH>..<HASH> 100644 --- a/tests/lib/formatters/html.js +++ b/tests/lib/formatters/html.js @@ -329,28 +329,6 @@ describe("formatter:html", () => { }); }); - // // Formatter doesn't use source property - // /* - // describe("when passing a single message with no source", function() { - - // var code = [{ - // filePath: "foo.js", - // messages: [{ - // message: "Unexpected foo.", - // severity: 2, - // line: 5, - // column: 10, - // ruleId: "foo" - // }] - // }]; - - // it("should return a string in HTML format with 1 issue in 1 file", function() { - // var result = formatter(code); - // assert.strictEqual(parseHTML(result), ""); - // }); - // }); - // */ - describe("when passing a single message with no rule id or message", () => { const code = [{ filePath: "foo.js",
Chore: remove commented test for HTML formatter (#<I>) This commit removes a test that has been commented out for 2 years and doesn't appear to work.
eslint_eslint
train
js
73e715d92839de4d8bd89c7ad3366ed06a95020d
diff --git a/packages/theme-data/src/colorSchemes/darkBlue/unresolvedRoles.js b/packages/theme-data/src/colorSchemes/darkBlue/unresolvedRoles.js index <HASH>..<HASH> 100644 --- a/packages/theme-data/src/colorSchemes/darkBlue/unresolvedRoles.js +++ b/packages/theme-data/src/colorSchemes/darkBlue/unresolvedRoles.js @@ -28,7 +28,7 @@ import token from "./components/token"; import tooltip from "./components/tooltip"; import topNav from "./components/topNav"; import treeView from "./components/treeView"; -console.log(tile); + const darkBlueThemeConfig = extendTheme(baseTheme.unresolvedRoles, { ...mediumDensityTheme.unresolvedRoles, ...mapKeys(system.colorScheme, (key) => `colorScheme.${key}`),
refactor: removed console log from dark blue unresolved roles
Autodesk_hig
train
js
c7f49b38614bb47ee8e5992f3641a9c5f1111194
diff --git a/lib/Doctrine/DBAL/Migrations/Configuration/Configuration.php b/lib/Doctrine/DBAL/Migrations/Configuration/Configuration.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/DBAL/Migrations/Configuration/Configuration.php +++ b/lib/Doctrine/DBAL/Migrations/Configuration/Configuration.php @@ -188,7 +188,7 @@ class Configuration public function getDateTime($version) { $datetime = str_replace('Version', '', $version); - $datetime = \DateTime::createFromFormat('Ymdhis', $datetime); + $datetime = \DateTime::createFromFormat('YmdHis', $datetime); if ($datetime === false){ return ''; diff --git a/tests/Doctrine/DBAL/Migrations/Tests/ConfigurationTest.php b/tests/Doctrine/DBAL/Migrations/Tests/ConfigurationTest.php index <HASH>..<HASH> 100644 --- a/tests/Doctrine/DBAL/Migrations/Tests/ConfigurationTest.php +++ b/tests/Doctrine/DBAL/Migrations/Tests/ConfigurationTest.php @@ -197,6 +197,7 @@ class ConfigurationTest extends MigrationTestCase ['0000254Version', ''], ['0000254BaldlfqjdVersion', ''], ['20130101123545Version', '2013-01-01 12:35:45'], + ['20150202162811', '2015-02-02 04:28:11'] ]; } }
getDateTime does not understand <I>h format
doctrine_migrations
train
php,php
b4a0d74ab51636ddd436363dfd8dca101e59f9e1
diff --git a/GVRf/Framework/src/org/gearvrf/GVRSurfaceView.java b/GVRf/Framework/src/org/gearvrf/GVRSurfaceView.java index <HASH>..<HASH> 100644 --- a/GVRf/Framework/src/org/gearvrf/GVRSurfaceView.java +++ b/GVRf/Framework/src/org/gearvrf/GVRSurfaceView.java @@ -59,7 +59,7 @@ class GVRSurfaceView extends GLSurfaceView implements setEGLContextClientVersion(3); setPreserveEGLContextOnPause(true); setEGLContextFactory(new GVRContextFactory()); - setEGLConfigChooser(new GVRConfigChooser(8, 8, 8, 0, 0, 0)); + setEGLConfigChooser(new GVRConfigChooser(8, 8, 8, 8, 24, 8)); if (renderer != null) { renderer.setViewManager(viewManager); setRenderer(renderer);
Fix rendering problem. It was a config problem. We weren't asking for a depth buffer, so we weren't getting one. Fixed that :).
Samsung_GearVRf
train
java
75b276f408487db8fecc6eab7abd6126323a7efe
diff --git a/searx/engines/bing.py b/searx/engines/bing.py index <HASH>..<HASH> 100644 --- a/searx/engines/bing.py +++ b/searx/engines/bing.py @@ -16,7 +16,7 @@ from lxml import html from searx.engines.xpath import extract_text from searx.url_utils import urlencode -from searx.utils import match_language +from searx.utils import match_language, gen_useragent # engine dependent config categories = ['general'] @@ -43,6 +43,9 @@ def request(query, params): offset=offset) params['url'] = base_url + search_path + + params['headers']['User-Agent'] = gen_useragent('Windows NT 6.3; WOW64') + return params diff --git a/searx/utils.py b/searx/utils.py index <HASH>..<HASH> 100644 --- a/searx/utils.py +++ b/searx/utils.py @@ -57,9 +57,9 @@ blocked_tags = ('script', 'style') -def gen_useragent(): +def gen_useragent(os=None): # TODO - return ua.format(os=choice(ua_os), version=choice(ua_versions)) + return ua.format(os=os or choice(ua_os), version=choice(ua_versions)) def searx_useragent():
fix bing "garbage" results (issue #<I>)
asciimoo_searx
train
py,py
ed496c1f472f975ef22bd7f888b942413e7cbf57
diff --git a/source/CommonCode.php b/source/CommonCode.php index <HASH>..<HASH> 100644 --- a/source/CommonCode.php +++ b/source/CommonCode.php @@ -441,12 +441,13 @@ trait CommonCode ->ignoreUnreadableDirs(true) ->followLinks() ->in($sourcePath); + $sFiles = []; foreach ($iterator as $file) { - $sFiles[] = $file->getRealPath(); -// $targetFile = $targetPath . DIRECTORY_SEPARATOR . $file->getFilename(); -// $filesystem->rename($file->getRealPath(), $targetFile, $overwrite); + $relativePathFile = str_replace($sourcePath, '', $file->getRealPath()); + if (!file_exists($targetPath . $relativePathFile)) { + $sFiles[$relativePathFile] = $targetPath . $relativePathFile; + } } - // TODO: compare the file copied w. source and highlight any missmatch return $this->setArrayToJson($sFiles); }
in the function that moves the file now the checking if the action was performed is complete
danielgp_common-lib
train
php
1951b43491b69b2590f69bb2710e9e20145fdddf
diff --git a/client/controller/shared.js b/client/controller/shared.js index <HASH>..<HASH> 100644 --- a/client/controller/shared.js +++ b/client/controller/shared.js @@ -86,7 +86,7 @@ export function loadSectionCSS( context, next ) { } loadCSS( cssUrl, ( err, newLink ) => { - if ( currentLink ) { + if ( currentLink && currentLink.parentElement ) { currentLink.parentElement.removeChild( currentLink ); } @@ -109,7 +109,7 @@ export function setUpLocale( context, next ) { } else if ( currentUser ) { context.lang = currentUser.localeSlug; } else { - context.lang = context.lang || config( 'i18n_default_locale_slug' ); + context.lang = config( 'i18n_default_locale_slug' ); } context.store.dispatch( setLocale( context.lang ) );
Make sure the previous link element is still in the page before removing it
Automattic_wp-calypso
train
js
d28d894e7d7a210eb55a8e34894cd40cee0bdc0d
diff --git a/phing/tasks/GuzzleSubSplitTask.php b/phing/tasks/GuzzleSubSplitTask.php index <HASH>..<HASH> 100644 --- a/phing/tasks/GuzzleSubSplitTask.php +++ b/phing/tasks/GuzzleSubSplitTask.php @@ -226,7 +226,7 @@ class GuzzleSubSplitTask extends GitBaseTask $cmd = $this->client->getCommand('subsplit'); $cmd->addArgument('update'); try { - $output = $cmd->execute(); + $cmd->execute(); } catch (Exception $e) { throw new BuildException('git subsplit update failed'. $e); }
Removed unused output variable from the split task
guzzle_guzzle3
train
php
688dcadd4b6eacb372bf6c76d12431389121e19b
diff --git a/tests/Fixer/FunctionNotation/PhpdocToReturnTypeFixerTest.php b/tests/Fixer/FunctionNotation/PhpdocToReturnTypeFixerTest.php index <HASH>..<HASH> 100644 --- a/tests/Fixer/FunctionNotation/PhpdocToReturnTypeFixerTest.php +++ b/tests/Fixer/FunctionNotation/PhpdocToReturnTypeFixerTest.php @@ -31,7 +31,7 @@ final class PhpdocToReturnTypeFixerTest extends AbstractFixerTestCase * * @dataProvider provideFixCases */ - public function testFix($expected, $input = null, $versionSpecificFix = null, $config = null) + public function testFix($expected, $input = null, $versionSpecificFix = null, array $config = []) { if ( (null !== $input && \PHP_VERSION_ID < 70000) @@ -40,9 +40,8 @@ final class PhpdocToReturnTypeFixerTest extends AbstractFixerTestCase $expected = $input; $input = null; } - if (null !== $config) { - $this->fixer->configure($config); - } + + $this->fixer->configure($config); $this->doTest($expected, $input); }
DX: cleanup testing with fixer config
FriendsOfPHP_PHP-CS-Fixer
train
php
36e678daf3c9d619f6e6013a33d59104f61e291a
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -12,8 +12,8 @@ test_requirements = [ setup( name='adb_android', - version='0.5.0', - description="Enables android adb in your python script", + version='1.0.0', + description="Enable android adb in your python script", long_description='This python package is a wrapper for standard android adb\ implementation. It allows you to execute android adb commands in your \ python script.', @@ -29,7 +29,6 @@ setup( license="GNU", keywords='adb, android', classifiers=[ - 'Development Status :: 4 - Beta', 'Programming Language :: Python :: 2.7', 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', 'Topic :: Software Development :: Testing',
Increase package version to <I> Change-Id: I8f5b3ec5a1a1f<I>a0c0a<I>ff<I>bb<I>f<I>fb
vmalyi_adb_android
train
py
ee14aab8c381c057c4c692c3c1feb3b71ea24a42
diff --git a/server/server.js b/server/server.js index <HASH>..<HASH> 100644 --- a/server/server.js +++ b/server/server.js @@ -43,7 +43,8 @@ global.constants = { }, loggly: { subdomain: 'stimulant', // https://stimulant.loggly.com/dashboards - inputToken: 'b8eeee6e-12f4-4f2f-b6b4-62f087ad795e' + inputToken: 'b8eeee6e-12f4-4f2f-b6b4-62f087ad795e', + json: true }, mail: { host: 'smtp.gmail.com', @@ -198,9 +199,11 @@ winston.info('Server started.'); /* Content Updater Update from non-web location + Don't shut down app while downloading to temp App Updater Update from non-web location + Don't shut down app while downloading to temp Logger Log app events
loggly should use json
stimulant_ampm
train
js
aefdda9c43618dc42e379791533d65a2ae459987
diff --git a/repo/fsrepo/component/datastore.go b/repo/fsrepo/component/datastore.go index <HASH>..<HASH> 100644 --- a/repo/fsrepo/component/datastore.go +++ b/repo/fsrepo/component/datastore.go @@ -3,7 +3,6 @@ package component import ( "errors" "path" - "path/filepath" "sync" datastore "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore" @@ -39,9 +38,6 @@ func init() { func InitDatastoreComponent(dspath string, conf *config.Config) error { // The actual datastore contents are initialized lazily when Opened. // During Init, we merely check that the directory is writeable. - if !filepath.IsAbs(dspath) { - return debugerror.New("datastore filepath must be absolute") // during initialization (this isn't persisted) - } p := path.Join(dspath, DefaultDataStoreDirectory) if err := dir.Writable(p); err != nil { return debugerror.Errorf("datastore: %s", err)
fix(fsrepo) don't enforce absolute path in datastore component we only actually care that it isn't tidle'd ~
ipfs_go-ipfs
train
go
d71604b8427f6e68e0d8d0a0e1178f80638e8844
diff --git a/lib/serf/downloader.js b/lib/serf/downloader.js index <HASH>..<HASH> 100644 --- a/lib/serf/downloader.js +++ b/lib/serf/downloader.js @@ -8,6 +8,7 @@ var Download = require('download'), fs = require('fs'), + os = require('os'), Q = require('q'); var ConsoleLogger = require('../console-logger').ConsoleLogger;
Load required library. "os" is automatically loaded in the interactive node console but it have to be loaded manually in scripts.
droonga_express-droonga
train
js
8e611cfd9fbd2cccd95b2f312f778ccf0d3218c8
diff --git a/torchvision/models/detection/rpn.py b/torchvision/models/detection/rpn.py index <HASH>..<HASH> 100644 --- a/torchvision/models/detection/rpn.py +++ b/torchvision/models/detection/rpn.py @@ -160,8 +160,8 @@ class AnchorGenerator(nn.Module): grid_sizes = list([feature_map.shape[-2:] for feature_map in feature_maps]) image_size = image_list.tensors.shape[-2:] dtype, device = feature_maps[0].dtype, feature_maps[0].device - strides = [[torch.tensor(image_size[0] / g[0], dtype=torch.int64, device=device), - torch.tensor(image_size[1] / g[1], dtype=torch.int64, device=device)] for g in grid_sizes] + strides = [[torch.tensor(image_size[0] // g[0], dtype=torch.int64, device=device), + torch.tensor(image_size[1] // g[1], dtype=torch.int64, device=device)] for g in grid_sizes] self.set_cell_anchors(dtype, device) anchors_over_all_feature_maps = self.cached_grid_anchors(grid_sizes, strides) anchors = torch.jit.annotate(List[List[torch.Tensor]], [])
Updates integer division to use floor division operator (#<I>) Integer division using the div operator is deprecated and will throw a RuntimeError in PyTorch <I> (and on PyTorch Master very soon). Running a test build with a recent Torchvision commit and integer division using div ('/') disabled revealed this integer division. I'll re-run the tests once this is fixed in case it's masking additional issues.
pytorch_vision
train
py
e8eddb269ee72fdf92f1b4bdb4bcdef855d402d4
diff --git a/lib/runBlock.js b/lib/runBlock.js index <HASH>..<HASH> 100644 --- a/lib/runBlock.js +++ b/lib/runBlock.js @@ -1,7 +1,7 @@ const Buffer = require('safe-buffer').Buffer const async = require('async') const ethUtil = require('ethereumjs-util') -const Bloom = require('./bloom.js') +const Bloom = require('./bloom') const rlp = ethUtil.rlp const Trie = require('merkle-patricia-tree') const BN = ethUtil.BN diff --git a/lib/runTx.js b/lib/runTx.js index <HASH>..<HASH> 100644 --- a/lib/runTx.js +++ b/lib/runTx.js @@ -2,7 +2,7 @@ const Buffer = require('safe-buffer').Buffer const async = require('async') const utils = require('ethereumjs-util') const BN = utils.BN -const Bloom = require('./bloom.js') +const Bloom = require('./bloom') const Block = require('ethereumjs-block') const Account = require('ethereumjs-account') const StorageReader = require('./storageReader')
Fix bloom imports in runBlock and runTx
ethereumjs_ethereumjs-vm
train
js,js
809ca47bb1cf4a8ca27499f3b70c0da0b13b6fe5
diff --git a/staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr.go b/staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr.go index <HASH>..<HASH> 100644 --- a/staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr.go +++ b/staging/src/k8s.io/apimachinery/pkg/util/intstr/intstr.go @@ -131,6 +131,10 @@ func (IntOrString) OpenAPISchemaType() []string { return []string{"string"} } // the OpenAPI spec of this type. func (IntOrString) OpenAPISchemaFormat() string { return "int-or-string" } +// OpenAPIV3OneOfTypes is used by the kube-openapi generator when constructing +// the OpenAPI v3 spec of this type. +func (IntOrString) OpenAPIV3OneOfTypes() []string { return []string{"integer", "string"} } + func ValueOrDefault(intOrPercent *IntOrString, defaultValue IntOrString) *IntOrString { if intOrPercent == nil { return &defaultValue
oneOf types for IntOrString
kubernetes_kubernetes
train
go
43b67210b9fffda99155ac1f358b4c35211adbfd
diff --git a/stripe/src/main/java/com/stripe/android/util/StripeNetworkUtils.java b/stripe/src/main/java/com/stripe/android/util/StripeNetworkUtils.java index <HASH>..<HASH> 100644 --- a/stripe/src/main/java/com/stripe/android/util/StripeNetworkUtils.java +++ b/stripe/src/main/java/com/stripe/android/util/StripeNetworkUtils.java @@ -161,6 +161,7 @@ public class StripeNetworkUtils { removeNullParams(accountParams); tokenParams.put(Token.TYPE_BANK_ACCOUNT, accountParams); + addUidParams(provider, context, tokenParams); return tokenParams; }
adding muid/guid logging to bank token requests (#<I>) * adding muid-guid logging to bank tokens * moving method back to private
stripe_stripe-android
train
java
5d6f5d681bfb6d2da1f358367d46b22b2ceafda1
diff --git a/lib/zest.js b/lib/zest.js index <HASH>..<HASH> 100644 --- a/lib/zest.js +++ b/lib/zest.js @@ -238,7 +238,7 @@ var selectors = { }, ':nth-match': function(param) { var args = param.split(/\s*,\s*/) - , p = args.pop() + , p = args.shift() , test = compileGroup(args.join(',')); return nth(p, test); @@ -429,7 +429,7 @@ var rules = { combinator: /^(?: +([^ \w*]) +|( )+|([^ \w*]))(?! *$)/, attr: /^\[([\w-]+)(?:([^\w]?=)(inside))?\]/, pseudo: /^(:[\w-]+)(?:\((inside)\))?/, - inside: /(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|<[^"'>]*>|\\["'>]|[^"'>])+/ + inside: /(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|\\["'>]|[^"'>])+/ //inside: /(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|<[^"'>]*>|\\["'>]|[^"'<>]+)+/ };
clean inside rule, fix nth-match
chjj_zest
train
js
1c91b19a90212d5712a25b847d6036a062f7f4d3
diff --git a/spyder/plugins/ipythonconsole/widgets/shell.py b/spyder/plugins/ipythonconsole/widgets/shell.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/ipythonconsole/widgets/shell.py +++ b/spyder/plugins/ipythonconsole/widgets/shell.py @@ -173,6 +173,9 @@ class ShellWidget(NamepaceBrowserWidget, HelpWidget, DebuggingWidget, return self.shutting_down = True if shutdown_kernel: + if not self.kernel_manager: + return + self.interrupt_kernel() self.spyder_kernel_comm.close() self.kernel_manager.stop_restarter()
IPython console: Catch error when shutting down kernels and no kernel manager is available
spyder-ide_spyder
train
py
0748a3c9b451a254c0796a65a9816c15f04dae92
diff --git a/Vps/Component/Data.php b/Vps/Component/Data.php index <HASH>..<HASH> 100644 --- a/Vps/Component/Data.php +++ b/Vps/Component/Data.php @@ -253,7 +253,12 @@ class Vps_Component_Data foreach ($generators as $g) { if (!$g['static']) { $gen = Vps_Component_Generator_Abstract::getInstance($g['class'], $g['key']); - foreach ($gen->getChildData(null, clone $select) as $d) { + $s = clone $select; + if (!$noSubPages) { + //unset limit as we may have filter away results + $s->unsetPart('limitCount'); + } + foreach ($gen->getChildData(null, $s) as $d) { $add = true; if (!$noSubPages) { // sucht über unterseiten hinweg, wird hier erst im Nachhinein gehandelt, langsam $add = false;
don't use limit in generator as we limit after that fixes finding home in trl
koala-framework_koala-framework
train
php
2b419c88a5b59c6a0de99566680fed29e3e73bd6
diff --git a/src/main/java/com/couchbase/lite/replicator/PullerInternal.java b/src/main/java/com/couchbase/lite/replicator/PullerInternal.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/couchbase/lite/replicator/PullerInternal.java +++ b/src/main/java/com/couchbase/lite/replicator/PullerInternal.java @@ -122,7 +122,9 @@ public class PullerInternal extends ReplicationInternal implements ChangeTracker @Override protected void onBeforeScheduleRetry() { - // do nothing + // stop change tracker + if (changeTracker != null) + changeTracker.stop(); } public boolean isPull() {
Fixed #<I> - Pull replicator skipped documents to pull Pull replicator can not retry (in case of error occurs) if ChangeTracker received changes continuously in less than <I> sec because pull replicator cancel & reschedule retry whenever it enters IDLE state.
couchbase_couchbase-lite-java-core
train
java
6b2a00e947c6a79761cc7bb4e0e35e0b1d2a28a5
diff --git a/salt/cloud/__init__.py b/salt/cloud/__init__.py index <HASH>..<HASH> 100644 --- a/salt/cloud/__init__.py +++ b/salt/cloud/__init__.py @@ -228,7 +228,7 @@ class CloudClient(object): if a.get('provider', '')] if providers: _providers = opts.get('providers', {}) - for provider in six.iterkeys(_providers): + for provider in _providers.keys(): if provider not in providers: _providers.pop(provider) return opts
Avoid RunTimeError (dictionary changed size during iteration) with keys() Fixes #<I>
saltstack_salt
train
py
2790f3bc02c7ff9f5c2238e00d2aa2fee4dec3ff
diff --git a/graphene_django/views.py b/graphene_django/views.py index <HASH>..<HASH> 100644 --- a/graphene_django/views.py +++ b/graphene_django/views.py @@ -53,7 +53,7 @@ def instantiate_middleware(middlewares): class GraphQLView(View): - graphiql_version = '0.7.8' + graphiql_version = '0.10.2' graphiql_template = 'graphene/graphiql.html' schema = None
Updated graphiql version for new versions
graphql-python_graphene-django
train
py
bbccab0f3ca7277bdf7b292ba67ca644efd0cefe
diff --git a/src/NlpTools/Optimizers/GradientDescentOptimizer.php b/src/NlpTools/Optimizers/GradientDescentOptimizer.php index <HASH>..<HASH> 100644 --- a/src/NlpTools/Optimizers/GradientDescentOptimizer.php +++ b/src/NlpTools/Optimizers/GradientDescentOptimizer.php @@ -68,15 +68,16 @@ abstract class GradientDescentOptimizer implements FeatureBasedLinearOptimizerIn $optimized = false; $maxiter = $this->maxiter; $prec = $this->precision; + $step = $this->step; $l = array(); $this->initParameters($feature_array,$l); - while (!$optimized && $itercount++<$maxiter) { + while (!$optimized && $itercount++!=$maxiter) { //$start = microtime(true); $optimized = true; $this->prepareFprime($feature_array,$l); $this->Fprime($feature_array,$l); foreach ($this->fprime_vector as $i=>$fprime_i_val) { - $l[$i] -= $fprime_i_val; + $l[$i] -= $step*$fprime_i_val; if (abs($fprime_i_val) > $prec) { $optimized = false; }
Fix gradient descent optimizer to use the learning rate
angeloskath_php-nlp-tools
train
php
8ab6dfa175b64766f9c1c42624d1205007d21181
diff --git a/source/Mocka/ClassMock.php b/source/Mocka/ClassMock.php index <HASH>..<HASH> 100644 --- a/source/Mocka/ClassMock.php +++ b/source/Mocka/ClassMock.php @@ -177,8 +177,9 @@ class ClassMock { } $reflectionTrait = new \ReflectionClass('\\Mocka\\ClassTrait'); - return array_filter($methods, function (\ReflectionMethod $reflectionMethod) use ($reflectionTrait) { + $methods = array_filter($methods, function (\ReflectionMethod $reflectionMethod) use ($reflectionTrait) { return !$reflectionMethod->isPrivate() && !$reflectionMethod->isFinal() && !$reflectionTrait->hasMethod($reflectionMethod->getName()); }); + return $methods; } }
Be more specific what is returned/filtered
tomaszdurka_mocka
train
php
37f849ec4f207f402c8b208e7670af0c4060e827
diff --git a/nodeconductor/billing/backend/whmcs.py b/nodeconductor/billing/backend/whmcs.py index <HASH>..<HASH> 100644 --- a/nodeconductor/billing/backend/whmcs.py +++ b/nodeconductor/billing/backend/whmcs.py @@ -487,6 +487,7 @@ class WHMCSAPI(object): type='server', paytype='recurring', module='autorelease', + proratabilling=True, ) pid = response['pid']
Create whmcs products with pro-rata setting on - ITACLOUD-<I>
opennode_waldur-core
train
py
5880e57725d57e8a5940bc04329c963bf405ae77
diff --git a/lib/disney/disneyBuses.js b/lib/disney/disneyBuses.js index <HASH>..<HASH> 100644 --- a/lib/disney/disneyBuses.js +++ b/lib/disney/disneyBuses.js @@ -61,9 +61,9 @@ class DisneyLiveBusTimes extends EventEmitter { dest.arrivals.forEach((arrival) => { this.emit('busupdate', { from: name, - from_id: id, + from_id: Number(id), to: dest.name, - to_id: DisneyUtil.CleanID(dest.id), + to_id: Number(DisneyUtil.CleanID(dest.id)), atStop: arrival.atStop, atStopHuman: arrival.atStop_human, atDestination: arrival.atDestination, @@ -76,9 +76,9 @@ class DisneyLiveBusTimes extends EventEmitter { // emit event with boring "every 20 minutes" update this.emit('busupdate', { from: name, - from_id: id, + from_id: Number(id), to: dest.name, - to_id: DisneyUtil.CleanID(dest.id), + to_id: Number(DisneyUtil.CleanID(dest.id)), frequency: dest.frequency, frequencyHuman: dest.frequency_human, });
[~] Report IDs as numbers from the disneyBus test script
cubehouse_themeparks
train
js
cea30050560e1bf41043897dd3930e422028144f
diff --git a/src/Parse.js b/src/Parse.js index <HASH>..<HASH> 100644 --- a/src/Parse.js +++ b/src/Parse.js @@ -77,6 +77,9 @@ _html2canvas.Parse = function (images, options, cb) { for (i = 0, j = classes.length; i < j; i++) { classes[i] = classes[i].match(/(^[^:]*)/)[1]; } + + // remove empty values, if not could cause invalid selectors with querySelectorAll + classes = classes.filter(function (n) { return n }); } // Using the list of elements we know how pseudo el styles, create fake pseudo elements. @@ -1273,4 +1276,4 @@ _html2canvas.Parse = function (images, options, cb) { } } } -}; \ No newline at end of file +};
Fix invalid selector exception with empty class values After removing :before and :after pseudo selectors, a class name may be empty, causing an invalid selector string when joined. Remove empty elements before calling querySelectorAll.
niklasvh_html2canvas
train
js
57480316354618c2a987eece86e9f560e68dfe01
diff --git a/ryu/lib/ovs/db_client.py b/ryu/lib/ovs/db_client.py index <HASH>..<HASH> 100644 --- a/ryu/lib/ovs/db_client.py +++ b/ryu/lib/ovs/db_client.py @@ -17,11 +17,8 @@ import logging import os -import ryu.contrib -ryu.contrib.update_module_path() - -from ovs import (jsonrpc, - stream) +from ovs import jsonrpc +from ovs import stream from ovs import util as ovs_util from ovs.db import schema diff --git a/ryu/lib/ovs/vsctl.py b/ryu/lib/ovs/vsctl.py index <HASH>..<HASH> 100644 --- a/ryu/lib/ovs/vsctl.py +++ b/ryu/lib/ovs/vsctl.py @@ -25,15 +25,12 @@ import six import sys import weakref -import ryu.contrib -ryu.contrib.update_module_path() - import ovs.db.data import ovs.db.types import ovs.poller -from ovs import (jsonrpc, - ovsuuid, - stream) +from ovs import jsonrpc +from ovs import ovsuuid +from ovs import stream from ovs.db import idl from ryu.lib import hub
ovs: Revert ovs module path Because contrib.ovs has been removed, we no longer need to update the path for loading ovs module.
osrg_ryu
train
py,py
c65d0615d1688580fb340b072749622853cccb36
diff --git a/kconfiglib.py b/kconfiglib.py index <HASH>..<HASH> 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -3888,9 +3888,9 @@ def _finalize_choice(node): break # Each choice item of UNKNOWN type gets the type of the choice - for item in choice.syms: - if item.orig_type == UNKNOWN: - item.orig_type = choice.orig_type + for sym in choice.syms: + if sym.orig_type == UNKNOWN: + sym.orig_type = choice.orig_type def _finalize_tree(node): """
Use 'sym' instead of 'item' in choice-related loop Only symbols appear in choice.syms. Clearer.
ulfalizer_Kconfiglib
train
py
73714e535e9d7d4c9dcd52c75ce87135b6cd258a
diff --git a/generator/language.go b/generator/language.go index <HASH>..<HASH> 100644 --- a/generator/language.go +++ b/generator/language.go @@ -262,7 +262,7 @@ func GoLangOpts() *LanguageOpts { if err != nil { return "", err } - return strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(string(b), "}", ",}"), "[", "{"), "]", ",}"), nil + return strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(string(b), "}", ",}"), "[", "{"), "]", ",}"), "{,}", "{}"), nil } opts.BaseImportFunc = func(tgt string) string { diff --git a/generator/language_test.go b/generator/language_test.go index <HASH>..<HASH> 100644 --- a/generator/language_test.go +++ b/generator/language_test.go @@ -74,6 +74,11 @@ func TestGolang_SliceInitializer(t *testing.T) { B func() string }{A: "good", B: func() string { return "" }}) require.Error(t, err) + + a3 := []interface{}{} + res, err = goSliceInitializer(a3) + assert.NoError(t, err) + assert.Equal(t, `{}`, res) } func TestGolangInit(t *testing.T) {
generator: fix initialization of empty arrays
go-swagger_go-swagger
train
go,go
0e4bf39c5dd22bbcdd644c7427e4e3cf50bb26da
diff --git a/lib/geokit/geocoders/geocodio.rb b/lib/geokit/geocoders/geocodio.rb index <HASH>..<HASH> 100644 --- a/lib/geokit/geocoders/geocodio.rb +++ b/lib/geokit/geocoders/geocodio.rb @@ -28,7 +28,7 @@ module Geokit loc.all.push(create_new_loc(address)) end end - + loc.success = true loc end
Fixes geocoding with geocodio - sets success to true after parsing json response so that it no longer incorrectly returns a failed location
geokit_geokit
train
rb
61e58fffa13849ea435917bba5f13473e35430cb
diff --git a/lib/openstax/connect/version.rb b/lib/openstax/connect/version.rb index <HASH>..<HASH> 100644 --- a/lib/openstax/connect/version.rb +++ b/lib/openstax/connect/version.rb @@ -1,5 +1,5 @@ module OpenStax module Connect - VERSION = "0.0.1" + VERSION = "0.0.2.alpha" end end
going to <I>.alpha
openstax_connect-rails
train
rb
f9022cc503231d3c030685b0d460bcaa6a2cd5fc
diff --git a/spec/integration/plugin_spec.rb b/spec/integration/plugin_spec.rb index <HASH>..<HASH> 100644 --- a/spec/integration/plugin_spec.rb +++ b/spec/integration/plugin_spec.rb @@ -81,4 +81,21 @@ EOF expect(network_opts).to include(:ip => '10.20.1.2') end end + + context 'when destroying a machine' do + def current_ip(machine) + settings.pool_manager.with_pool_for(machine) {|p| p.address_for(machine)} + end + + it 'releases the allocated IP address' do + env = test_env.create_vagrant_env + test_machine = env.machine(:test1, :dummy) + + expect(current_ip(test_machine)).to eq('10.20.1.2') + + test_machine.action(:destroy) + + expect(current_ip(test_machine)).to be_nil + end + end end
Add integration tests for release action Test that destroying a machine results in an IP address being released from the pool.
oscar-stack_vagrant-auto_network
train
rb
1cb5cef6d20f8801b0195f8fe6d233c3c16f50a9
diff --git a/framework/src/play/src/main/java/play/mvc/Http.java b/framework/src/play/src/main/java/play/mvc/Http.java index <HASH>..<HASH> 100644 --- a/framework/src/play/src/main/java/play/mvc/Http.java +++ b/framework/src/play/src/main/java/play/mvc/Http.java @@ -1473,11 +1473,14 @@ public class Http { cookies.add(new Cookie(name, "", -86400, path, domain, secure, false)); } - // FIXME return a more convenient type? e.g. Map<String, Cookie> - public Iterable<Cookie> cookies() { + public Collection<Cookie> cookies() { return cookies; } + public Optional<Cookie> cookie(String name) { + return cookies.stream().filter(x -> { return x.name().equals(name); }).findFirst(); + } + } /**
Make it easier to get a cookie from a response
playframework_playframework
train
java
5e87725d6f0e7cf4c714a0b9dbfc4565f6013312
diff --git a/spec/lib/udongo/search/frontend_spec.rb b/spec/lib/udongo/search/frontend_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/udongo/search/frontend_spec.rb +++ b/spec/lib/udongo/search/frontend_spec.rb @@ -2,10 +2,11 @@ require 'rails_helper' describe Udongo::Search::Frontend do let(:klass) { described_class.to_s.underscore.to_sym } - subject { described_class.new('foo') } + let(:controller) { double(:controller, class_name: 'Frontend', locale: 'nl') } + subject { described_class.new('foo', controller: controller) } before(:each) do - module Udongo::Search::ResultObjects::Frontend + module Udongo::Search::ResultObjects::RSpec class Class < Udongo::Search::ResultObjects::Base end end
fix failing Udongo::Search::Frontend test due to the controller call in the search term save in #search
udongo_udongo
train
rb
163827c49ed2ac7817eed50c2ee49f9cb6a13278
diff --git a/pymbar/bar.py b/pymbar/bar.py index <HASH>..<HASH> 100644 --- a/pymbar/bar.py +++ b/pymbar/bar.py @@ -51,7 +51,7 @@ import math import numpy import numpy.linalg from pymbar.utils import _logsum, ParameterError, ConvergenceError, BoundsError -from pymbar.exponential_averaging import EXP +from pymbar.exp import EXP #============================================================================================= # Bennett acceptance ratio function to be zeroed to solve for BAR.
Fixed issue with EXP import.
choderalab_pymbar
train
py
e1275430be7c031ae95ae936dabb21987d464c12
diff --git a/test/generator_test.rb b/test/generator_test.rb index <HASH>..<HASH> 100644 --- a/test/generator_test.rb +++ b/test/generator_test.rb @@ -21,8 +21,11 @@ class GeneratorTest < Minitest::Test assert generator.word end + # Depending on your corpus and n-gram size, this is hard to guarantee, so we + # skip this test for now... def test_minimum_word_length - min_length = 5 + skip + min_length = 6 generator = get_generator(min_length: min_length) num_iterations.times do word = generator.word
skip min_length test because it can't be always guaranteed
exploration_markov_words
train
rb
9c2fd42cb48d917c2a48c4620c6824088b989d28
diff --git a/src/Storage/Collection/LazyCollection.php b/src/Storage/Collection/LazyCollection.php index <HASH>..<HASH> 100644 --- a/src/Storage/Collection/LazyCollection.php +++ b/src/Storage/Collection/LazyCollection.php @@ -33,7 +33,7 @@ class LazyCollection extends ArrayCollection $output = []; foreach ($this as $element) { $proxy = $element->getProxy(); - $output[] = spl_object_hash($proxy); + $output[] = $proxy->getContenttype() . '/' . $proxy->getSlug(); } return $output;
use ct and slug to reference relations
bolt_bolt
train
php
1cfb5274e8b8f3799332e2823ca98d01a7b79158
diff --git a/tests/IntegrationTest.php b/tests/IntegrationTest.php index <HASH>..<HASH> 100644 --- a/tests/IntegrationTest.php +++ b/tests/IntegrationTest.php @@ -32,6 +32,7 @@ class IntegrationTest extends \PHPUnit_Framework_TestCase /** * @medium + * @requires extension pcntl */ function test_timeout() {
Timeout test needs pcntl extension.
iakio_gntp-notify
train
php
598d1aaa73e184c9ba39dffa132338f6b0724e24
diff --git a/storm/__init__.py b/storm/__init__.py index <HASH>..<HASH> 100644 --- a/storm/__init__.py +++ b/storm/__init__.py @@ -69,7 +69,6 @@ class Storm(object): if order: config_data = sorted(config_data, key=itemgetter("host")) - return config_data def delete_all_entries(self): @@ -109,7 +108,6 @@ class Storm(object): options.update({ key: value, }) - return options def is_host_in(self, host): diff --git a/storm/__main__.py b/storm/__main__.py index <HASH>..<HASH> 100644 --- a/storm/__main__.py +++ b/storm/__main__.py @@ -18,6 +18,7 @@ from storm import web as _web from storm.kommandr import * from termcolor import colored +from types import ListType storm_ = Storm() @@ -166,8 +167,11 @@ def list(): extra = True if isinstance(value, collections.Sequence): - value = ",".join(value) - + if isinstance(value, ListType): + value = ",".join(value) + else: + value = value + result += "{0}={1} ".format(key, value) if extra: result = result[0:-1]
re #<I> fixing problem with custom options not displaying correctly
emre_storm
train
py,py
60abf9eb55c3906d57e317590a8abde9ce211fd7
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -8,7 +8,7 @@ module.exports = function (grunt) { // Configurable paths config: { lintFiles: [ - '**/*.js' + 'angular-bind-html-compile.js' ] }, jshint: {
Disabled jshint for minified version.
incuna_angular-bind-html-compile
train
js
0249242ee92034adf49ff12f7bee9b260fa9c8de
diff --git a/src/common/storage/storageclasses/editorstorage.js b/src/common/storage/storageclasses/editorstorage.js index <HASH>..<HASH> 100644 --- a/src/common/storage/storageclasses/editorstorage.js +++ b/src/common/storage/storageclasses/editorstorage.js @@ -377,7 +377,7 @@ define([ commitData = branch.getFirstCommit(false); webSocket.makeCommit(commitData, function (err, result) { if (err) { - throw new Error(err); + logger.error('makeCommit failed', err); } // This is for when e.g. a plugin makes a commit to the same branch as the diff --git a/test-karma/client/js/branchstatus.spec.js b/test-karma/client/js/branchstatus.spec.js index <HASH>..<HASH> 100644 --- a/test-karma/client/js/branchstatus.spec.js +++ b/test-karma/client/js/branchstatus.spec.js @@ -66,7 +66,11 @@ describe('branch status', function () { }); afterEach(function (done) { - client.deleteBranch(projectName, currentBranchName, currentBranchHash, done); + client.selectBranch('master', null, function (err) { + client.deleteBranch(projectName, currentBranchName, currentBranchHash, function (err2) { + done(err || err2); + }); + }); }); function createSelectBranch (branchName, callback) {
Switch back to master branch after tests. Former-commit-id: dae<I>aadc5a7d<I>ea<I>eb<I>a<I>c<I>b3
webgme_webgme-engine
train
js,js
4441a007f5e2d9be3a4412c5fe7b6ecdb3d532a5
diff --git a/kafka_consumer/check.py b/kafka_consumer/check.py index <HASH>..<HASH> 100644 --- a/kafka_consumer/check.py +++ b/kafka_consumer/check.py @@ -496,8 +496,6 @@ class KafkaCheck(AgentCheck): partitions = client.cluster.available_partitions_for_topic(topic) tps[topic] = tps[unicode(topic)].union(set(partitions)) - # TODO: find reliable way to decide what API version to use for - # OffsetFetchRequest. consumer_offsets = {} if coord_id is not None and coord_id >= 0: broker_ids = [coord_id]
[kafka_consumer] removing stale comment.
DataDog_integrations-core
train
py
65c8e548501ec3ce10a707327a14338d69647765
diff --git a/lib/rack/i18n_locale_switcher.rb b/lib/rack/i18n_locale_switcher.rb index <HASH>..<HASH> 100644 --- a/lib/rack/i18n_locale_switcher.rb +++ b/lib/rack/i18n_locale_switcher.rb @@ -20,7 +20,7 @@ module Rack private def is_available?(locale) - not locale.nil? and not locale.empty? and I18n.available_locales.include?(locale.to_sym) + not locale.to_s.empty? and I18n.available_locales.include?(locale.to_sym) end def extract_locale_from_params(request)
There is no .empty? method on nil in <I>
christoph-buente_rack-i18n_locale_switcher
train
rb
215d526e0d605e2f090da3c7b1ec66c990bec89c
diff --git a/python/ray/rllib/eval.py b/python/ray/rllib/eval.py index <HASH>..<HASH> 100644 --- a/python/ray/rllib/eval.py +++ b/python/ray/rllib/eval.py @@ -7,6 +7,7 @@ from __future__ import print_function import argparse import gym import json +import os import ray from ray.rllib.agent import get_agent_class @@ -42,11 +43,19 @@ parser.add_argument( help="Run evaluation of the agent forever.") parser.add_argument( "--config", default="{}", type=json.loads, - help="Algorithm-specific configuration (e.g. env, hyperparams), ") + help="Algorithm-specific configuration (e.g. env, hyperparams). " + "Surpresses loading of configuration from checkpoint.") if __name__ == "__main__": args = parser.parse_args() + if not args.config: + # Load configuration from file + config_dir = os.path.dirname(args.checkpoint) + config_path = os.path.join(config_dir, "params.json") + with open(config_path) as f: + args.config = json.load(f) + if not args.env: if not args.config.get("env"): parser.error("the following arguments are required: --env")
Load evaluation configuration from checkpoint (#<I>)
ray-project_ray
train
py
45423ee26d5df9a8926ffdf15544dbdfc780dfd6
diff --git a/admin/user/user_bulk_enrol.php b/admin/user/user_bulk_enrol.php index <HASH>..<HASH> 100644 --- a/admin/user/user_bulk_enrol.php +++ b/admin/user/user_bulk_enrol.php @@ -7,7 +7,7 @@ die('this needs to be rewritten to use new enrol framework, sorry'); //TODO: MD require_once('../../config.php'); require_once($CFG->libdir.'/adminlib.php'); -$processed = optional_param('processed', '', PARAM_CLEAN); +$processed = optional_param('processed', '', PARAM_BOOL); $sort = optional_param('sort', 'fullname', PARAM_ALPHA); //Sort by full name $dir = optional_param('dir', 'asc', PARAM_ALPHA); //Order to sort (ASC)
MDL-<I> fixed wrong PARAM_CLEAN
moodle_moodle
train
php
4b22803c01693845707337b804564bbb2fb7f9a5
diff --git a/gittar/__init__.py b/gittar/__init__.py index <HASH>..<HASH> 100644 --- a/gittar/__init__.py +++ b/gittar/__init__.py @@ -6,6 +6,7 @@ import os import stat import time from urlparse import urlparse +import sys from dateutil.tz import tzlocal from datetime import datetime @@ -93,6 +94,8 @@ def main(): for source_url in args.sources: src = SOURCES[source_url.scheme](source_url) + sys.stderr.write(source_url.geturl()) + sys.stderr.write('\n') tree = Tree() for path, mode, blob in src: @@ -102,6 +105,12 @@ def main(): # tree entry tree.add(path, mode, blob.id) + sys.stderr.write(path) + sys.stderr.write('\n') + + sys.stderr.write('\n') + + repo.object_store.add_object(tree) def get_user():
Write files to stderr.
mbr_gittar
train
py
1df96d434b20311bd36bef827151f4c3e0f5eaa1
diff --git a/tg_react/api/accounts/views.py b/tg_react/api/accounts/views.py index <HASH>..<HASH> 100644 --- a/tg_react/api/accounts/views.py +++ b/tg_react/api/accounts/views.py @@ -52,6 +52,16 @@ class UserDetails(generics.RetrieveUpdateAPIView): def get_object(self): return self.request.user + def update(self, request, *args, **kwargs): + partial = kwargs.pop('partial', False) + instance = self.get_object() + serializer = self.get_serializer(instance, data=request.data, partial=partial) + if serializer.is_valid(): + self.perform_update(serializer) + return Response(serializer.data) + else: + return Response({'errors': serializer.errors}, status=status.HTTP_400_BAD_REQUEST) + class AuthenticationView(APIView): class UnsafeSessionAuthentication(SessionAuthentication):
Errors were not returned in desired form
thorgate_tg-react
train
py
dc03028e5da40eb00bb43b00b9b554bff90b43fb
diff --git a/nodeup/pkg/model/kube_apiserver.go b/nodeup/pkg/model/kube_apiserver.go index <HASH>..<HASH> 100644 --- a/nodeup/pkg/model/kube_apiserver.go +++ b/nodeup/pkg/model/kube_apiserver.go @@ -296,10 +296,9 @@ func (b *KubeAPIServerBuilder) buildPod() (*v1.Pod, error) { kubeAPIServer.ServiceAccountSigningKeyFile = &s } } - - kubeAPIServer.ClientCAFile = filepath.Join(b.PathSrvKubernetes(), "ca.crt") - if b.Cluster.Spec.KubeAPIServer.ClientCAFile != "" { - kubeAPIServer.ClientCAFile = b.Cluster.Spec.KubeAPIServer.ClientCAFile + // If clientCAFile is not specified, set it to the default value ${PathSrvKubernetes}/ca.crt + if kubeAPIServer.ClientCAFile == "" { + kubeAPIServer.ClientCAFile = filepath.Join(b.PathSrvKubernetes(), "ca.crt") } kubeAPIServer.TLSCertFile = filepath.Join(b.PathSrvKubernetes(), "server.crt") kubeAPIServer.TLSPrivateKeyFile = filepath.Join(b.PathSrvKubernetes(), "server.key")
Update the logic to set kubeAPIServer.ClientCAFile
kubernetes_kops
train
go
c51679663fbee71ba04dbc10fe9914dddfc21b41
diff --git a/src/NamelessCoder/Gizzle/JsonDataMapper.php b/src/NamelessCoder/Gizzle/JsonDataMapper.php index <HASH>..<HASH> 100644 --- a/src/NamelessCoder/Gizzle/JsonDataMapper.php +++ b/src/NamelessCoder/Gizzle/JsonDataMapper.php @@ -42,7 +42,7 @@ abstract class JsonDataMapper { } elseif (NULL === $propertyClass) { $propertyValue = $propertyValue; } elseif ('DateTime' === $propertyClass) { - $propertyValue = new \DateTime($propertyValue); + $propertyValue = \DateTime::createFromFormat('U', $propertyValue); } elseif (FALSE === strpos($propertyClass, '[]')) { $propertyValue = new $propertyClass($propertyValue); } elseif (NULL !== $propertyClass) {
[BUGFIX] Create DateTimes using format U, not constructor Format of transmitted date times is unixtime, requiring construction using DateTime::createFromFormat('U', $value)
NamelessCoder_gizzle
train
php
b8ba148d386b0ff8936d4ac946e1f24404402b30
diff --git a/jlib-core/src/main/java/org/jlib/core/nullable/NullableUtility.java b/jlib-core/src/main/java/org/jlib/core/nullable/NullableUtility.java index <HASH>..<HASH> 100644 --- a/jlib-core/src/main/java/org/jlib/core/nullable/NullableUtility.java +++ b/jlib-core/src/main/java/org/jlib/core/nullable/NullableUtility.java @@ -32,10 +32,6 @@ import org.checkerframework.checker.nullness.qual.Nullable; */ public final class NullableUtility { - /** no visible constructor */ - private NullableUtility() { - } - /** * Compares the specified Objects for mutual equality. Two Objects {@code object1}, {@code object2} are considered * equal if {@code object1 == object2 == null} or {@code object1.equals(object2)}. @@ -85,4 +81,6 @@ public final class NullableUtility { object.hashCode() : 0; } + + private NullableUtility() {} }
NullableUtility: reordered
jlib-framework_jlib-operator
train
java
088a4a31801272f41f975b64d7401680b89f9142
diff --git a/gandi/cli/core/params.py b/gandi/cli/core/params.py index <HASH>..<HASH> 100644 --- a/gandi/cli/core/params.py +++ b/gandi/cli/core/params.py @@ -81,7 +81,8 @@ class DiskImageParamType(click.Choice): def __init__(self): """ Initialize choices list. """ gandi = GandiContextHelper() - choices = [item['label'] for item in gandi.image.list()] + choices = [item['label'] for item in gandi.image.list()] + \ + [item['name'] for item in gandi.disk.list()] self.choices = choices def convert(self, value, param, ctx):
add disks to the list of possible source images
Gandi_gandi.cli
train
py
52a1e795d844320376c273df68c2e8b26c16f6d0
diff --git a/src/functions/viewClassFactory.js b/src/functions/viewClassFactory.js index <HASH>..<HASH> 100644 --- a/src/functions/viewClassFactory.js +++ b/src/functions/viewClassFactory.js @@ -4,7 +4,7 @@ function viewClassFactory(ctor, defaultOptions) { return function(options) { - return new ctor(mixins({}, defaultOptions || {}, options || {})); + return new ctor(mixins({}, (typeof defaultOptions === 'function' ? defaultOptions() : defaultOptions) || {}, options || {})); } }
feat(viewClassFactory): default options could be a function returning options object This will enable use of lazy initialization of view options, i.e. shared singleton services
karfcz_kff
train
js
d73255d1acfd83ca65d3293a0d6a6c8f25c834f4
diff --git a/lib/py/src/transport/TSocket.py b/lib/py/src/transport/TSocket.py index <HASH>..<HASH> 100644 --- a/lib/py/src/transport/TSocket.py +++ b/lib/py/src/transport/TSocket.py @@ -94,7 +94,7 @@ class TSocket(TSocketBase): def flush(self): pass -class TServerSocket(TServerTransportBase, TSocketBase): +class TServerSocket(TSocketBase, TServerTransportBase): """Socket implementation of TServerTransport base.""" def __init__(self, port=9090, unix_socket=None):
THRIFT-<I>. python: Make TServerSocket.close() work properly Changing the order of inheritance makes "close" refer to the (correct) TSocketBase method, rather than the (stub) TServerTransportBase method. git-svn-id: <URL>
limingxinleo_thrift
train
py
1fcdd595fe739c94176fe12897b70c578c8f6042
diff --git a/lib/active_record_doctor/version.rb b/lib/active_record_doctor/version.rb index <HASH>..<HASH> 100644 --- a/lib/active_record_doctor/version.rb +++ b/lib/active_record_doctor/version.rb @@ -1,3 +1,3 @@ module ActiveRecordDoctor - VERSION = "0.0.1" + VERSION = "1.0.0" end
Bump the version number to <I>
gregnavis_active_record_doctor
train
rb
60eb4891013dfc5a00fbecd98a79999a365c0839
diff --git a/example/article/admin.py b/example/article/admin.py index <HASH>..<HASH> 100644 --- a/example/article/admin.py +++ b/example/article/admin.py @@ -1,14 +1,8 @@ from django.contrib import admin from django.forms import ModelForm +from django.utils.timezone import now from article.models import Article -# The timezone support was introduced in Django 1.4, fallback to standard library for 1.3. -try: - from django.utils.timezone import now -except ImportError: - from datetime import datetime - now = datetime.now - class ArticleAdminForm(ModelForm):
Remove old Django compatibility code
django-fluent_django-fluent-comments
train
py
2ffe33c1b3fcd7a833929356e47b653c4b00e9bf
diff --git a/dispatch/theme/widgets.py b/dispatch/theme/widgets.py index <HASH>..<HASH> 100644 --- a/dispatch/theme/widgets.py +++ b/dispatch/theme/widgets.py @@ -82,10 +82,9 @@ class Zone(object): zone.data = validated_data['data'] # Call widget before-save hook on nested widgets - for i in range(len(list(zone.data.keys()))): - current_key = zone.data.keys()[i] - if isinstance(zone.data[current_key], dict) and ('id' in zone.data[current_key].keys()) and ('data' in zone.data[current_key].keys()): - zone.data[current_key]['data'] = self.before_save(zone.data[current_key]['id'], zone.data[current_key]['data']) + for key in list(zone.data.keys()): + if isinstance(zone.data[key], dict) and ('id' in zone.data[key].keys()) and ('data' in zone.data[key].keys()): + zone.data[key]['data'] = self.before_save(zone.data[key]['id'], zone.data[key]['data']) # Call widget before-save hook zone.data = self.before_save(zone.widget_id, zone.data)
Clean up before-save hook for nested widgets
ubyssey_dispatch
train
py
9067301c1a60dde309219aac8adfda369f2aa58d
diff --git a/includes/os/class.SSH.inc.php b/includes/os/class.SSH.inc.php index <HASH>..<HASH> 100644 --- a/includes/os/class.SSH.inc.php +++ b/includes/os/class.SSH.inc.php @@ -471,7 +471,12 @@ class SSH extends GNU break; case 'GNU': case 'Linux': - parent::_uptime(); + if (CommonFunctions::executeProgram('cat', '/proc/uptime', $resulte, false) && ($resulte !== "")) { + $ar_buf = preg_split('/ /', $resulte); + $this->sys->setUptime(trim($ar_buf[0])); + } else { + parent::_uptime(); + } } }
cat /proc/uptime
phpsysinfo_phpsysinfo
train
php
a1968f03e7c57f69163459625ca168add4c4822c
diff --git a/flink-contrib/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBStateBackend.java b/flink-contrib/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBStateBackend.java index <HASH>..<HASH> 100644 --- a/flink-contrib/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBStateBackend.java +++ b/flink-contrib/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBStateBackend.java @@ -248,6 +248,7 @@ public class RocksDBStateBackend extends AbstractStateBackend { } else { dirs.add(f); } + testDir.delete(); } if (dirs.isEmpty()) {
[FLINK-<I>] Remove Testing Files in RocksDB Backend We create random files on initialization to check whether we can write to the data directory. These files are also removed now.
apache_flink
train
java
4679b142a22741094195bdb712b888350e6dc84e
diff --git a/datafs/core/data_file.py b/datafs/core/data_file.py index <HASH>..<HASH> 100644 --- a/datafs/core/data_file.py +++ b/datafs/core/data_file.py @@ -167,7 +167,6 @@ def open_file(authority, cache, update, service_path, latest_version_check, *arg fs_wrapper.setwritefs(write_fs) - try: f = fs_wrapper.open(service_path, *args, **kwargs) @@ -252,7 +251,7 @@ def get_local_path(authority, cache, update, service_path, latest_version_check) allow_recreate=True) - if use_cache and cache.fs.isfile(service_path): + if use_cache and cache.fs.isfile(service_path) and latest_version_check(cache.fs.getsyspath(service_path)): fs.utils.movefile(cache.fs, service_path, write_fs, service_path) elif fs_wrapper.isfile(service_path): @@ -272,6 +271,7 @@ def get_local_path(authority, cache, update, service_path, latest_version_check) else: raise OSError('Local file removed during execution. Archive not updated.') + finally: @@ -279,4 +279,4 @@ def get_local_path(authority, cache, update, service_path, latest_version_check) finally: - shutil.rmtree(tmp) \ No newline at end of file + shutil.rmtree(tmp)
cached get_local_file isn't updating on read
ClimateImpactLab_DataFS
train
py
0a4f7141f7f9a408abc01a415864c0b42b176770
diff --git a/glue/pipeline.py b/glue/pipeline.py index <HASH>..<HASH> 100644 --- a/glue/pipeline.py +++ b/glue/pipeline.py @@ -441,17 +441,11 @@ class CondorJob: subfile.write( 'arguments = "' ) for c in self.__options.keys(): if self.__options[c]: - if ' ' in self.__options[c] and '$(macro' not in self.__options[c]: - # option has space, add single quotes around it - self.__options[c] = ''.join([ "'", self.__options[c], "'" ]) subfile.write( ' --' + c + ' ' + self.__options[c] ) else: subfile.write( ' --' + c ) for c in self.__short_options.keys(): if self.__short_options[c]: - if ' ' in self.__short_options[c] and '$(macro' not in self.__short_options[c]: - # option has space, add single quotes around it - self.__short_options[c] = ''.join([ "'", self.__short_options[c], "'" ]) subfile.write( ' -' + c + ' ' + self.__short_options[c] ) else: subfile.write( ' -' + c )
Fix PR<I> partially revert <I>
gwastro_pycbc-glue
train
py
08c9427827083de8d376b5d78eb69bf2b0b99b1a
diff --git a/lib/usersRepository.js b/lib/usersRepository.js index <HASH>..<HASH> 100644 --- a/lib/usersRepository.js +++ b/lib/usersRepository.js @@ -43,7 +43,7 @@ module.exports = (reporter, admin) => { }) } - reporter.documentStore.collection('users').beforeInsertListeners.add('users', async (doc) => { + reporter.documentStore.collection('users').beforeInsertListeners.add('users', async (doc, req) => { if (!doc.username) { throw reporter.createError('username is required', { statusCode: 400 @@ -77,7 +77,7 @@ module.exports = (reporter, admin) => { doc.password = passwordHash.generate(doc.password) } - const users = await reporter.documentStore.collection('users').find({ username: doc.username }) + const users = await reporter.documentStore.collection('users').find({ username: doc.username }, req) if (users.length > 0) { throw reporter.createError('User already exists', {
fix not using req in the beforeInsertListeners that validates duplicated user this fix bug about can not insert duplicated user when doing full import-export and user is already on store and also on the export zip
jsreport_jsreport-authentication
train
js
80ef37e359bcd59bead17a93c118c06652c7ce74
diff --git a/tests/_support/Page/bill/Update.php b/tests/_support/Page/bill/Update.php index <HASH>..<HASH> 100644 --- a/tests/_support/Page/bill/Update.php +++ b/tests/_support/Page/bill/Update.php @@ -24,9 +24,9 @@ class Update extends Create $I = $this->tester; $I->click("//tr[@data-key=$billId]/td/div/button"); - $I->click('//a[contains(text(),\'Update\')]'); + $I->click("a[href='/finance/bill/update?id=$billId']"); - $I->seeInCurrentUrl('finance/bill/update?id'); + $I->seeInCurrentUrl('finance/bill/update?id=' . $billId); } /**
bill update refinement (#<I>) * asserts module was denied * bill update refinement
hiqdev_hipanel-module-finance
train
php
2fa09f8086f985b735a4629022ea6e8e9ea8def6
diff --git a/src/prompts/questions.js b/src/prompts/questions.js index <HASH>..<HASH> 100644 --- a/src/prompts/questions.js +++ b/src/prompts/questions.js @@ -80,5 +80,5 @@ export async function promptForVcsHostDetails(hosts, visibility, decisions) { ], decisions); const host = hosts[answers[questionNames.REPO_HOST]]; - return {...answers, ...host && await host.prompt()}; + return {...answers, ...host && await host.prompt({decisions})}; } diff --git a/test/unit/prompts/questions-test.js b/test/unit/prompts/questions-test.js index <HASH>..<HASH> 100644 --- a/test/unit/prompts/questions-test.js +++ b/test/unit/prompts/questions-test.js @@ -131,7 +131,7 @@ suite('project scaffolder prompts', () => { ); const answersWithHostChoice = {...answers, [questionNames.REPO_HOST]: host}; const hostAnswers = any.simpleObject(); - hostPrompt.returns(hostAnswers); + hostPrompt.withArgs({decisions}).returns(hostAnswers); conditionals.filterChoicesByVisibility.withArgs(hosts).returns(filteredHostChoices); prompts.prompt .withArgs([
feat(decisions): passed the decisions to the vcs-host scaffolder
travi_project-scaffolder
train
js,js
9a3feaa4a6d3691e3992a4c773c1ca7a48c6661f
diff --git a/spec/card_spec.rb b/spec/card_spec.rb index <HASH>..<HASH> 100644 --- a/spec/card_spec.rb +++ b/spec/card_spec.rb @@ -45,6 +45,16 @@ module Trello end end + context "updating" do + it "updating name does a put on the correct resource with the correct value" do + expected_new_name = "xxx" + expected_resource = "/card/#{@card.id}/name" + + Client.should_receive(:put).once.with expected_resource, :value => expected_new_name + @card.name = expected_new_name + end + end + context "fields" do it "gets its id" do @card.id.should_not be_nil diff --git a/spec/client_spec.rb b/spec/client_spec.rb index <HASH>..<HASH> 100644 --- a/spec/client_spec.rb +++ b/spec/client_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" include Trello -describe Client,"and how it handles authorization" do +describe Client, "and how it handles authorization" do before do fake_response = stub "A fake OK response" fake_response.stub(:code).and_return 200
[METRIC_CHASING] About updating cards, updating name does a put on the correct resource with the correct value
jeremytregunna_ruby-trello
train
rb,rb
4d312bbe0fd8c1def91f4d55b5ad6c1e6dd6f146
diff --git a/lib/moodlelib.php b/lib/moodlelib.php index <HASH>..<HASH> 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -614,17 +614,19 @@ function authenticate_user_login($username, $password) { } -function enrol_student($user, $course) { +function enrol_student($userid, $courseid) { /// Enrols a student in a given course global $db; - $record->userid = $user; - $record->course = $course; - $record->start = 0; - $record->end = 0; - $record->time = time(); - - return insert_record("user_students", $record); + if (!record_exists("user_students", "userid", $userid, "course", $courseid)) { + $student->userid = $userid; + $student->course = $courseid; + $student->start = 0; + $student->end = 0; + $student->time = time(); + return insert_record("user_students", $student); + } + return true; } function unenrol_student($user, $course=0) {
Don't enrol student if they are already enrolled.
moodle_moodle
train
php