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
88b85c9761b0334208606fecdb2ceff507c375ed
diff --git a/src/Executor/ExecutionResult.php b/src/Executor/ExecutionResult.php index <HASH>..<HASH> 100644 --- a/src/Executor/ExecutionResult.php +++ b/src/Executor/ExecutionResult.php @@ -54,13 +54,13 @@ class ExecutionResult implements \JsonSerializable { $result = []; - if (null !== $this->data) { - $result['data'] = $this->data; - } - if (!empty($this->errors)) { $result['errors'] = array_map($this->errorFormatter, $this->errors); } + + if (null !== $this->data) { + $result['data'] = $this->data; + } if (!empty($this->extensions)) { $result['extensions'] = (array) $this->extensions;
Make 'errors' top property in response array
webonyx_graphql-php
train
php
29281b5104e58468ab35bb95ee3626a8741cb8cb
diff --git a/lib/gn_crossmap/resolver.rb b/lib/gn_crossmap/resolver.rb index <HASH>..<HASH> 100644 --- a/lib/gn_crossmap/resolver.rb +++ b/lib/gn_crossmap/resolver.rb @@ -52,7 +52,7 @@ module GnCrossmap names.split("\n").each do |name| begin res = RestClient.post(URL, data: name, data_source_ids: @ds_id) - @processor.process(res) + @processor.process(res, @current_data) rescue RestClient::Exception => e GnCrossmap.logger.error("Resolver broke on '#{name}': #{e.message}") next
fix #<I> bug, breaking in single name mode
GlobalNamesArchitecture_gn_crossmap
train
rb
ae5a9c1f167435f8718803d4b0cc167003e036a5
diff --git a/test/assets/values/rulesFile.js b/test/assets/values/rulesFile.js index <HASH>..<HASH> 100644 --- a/test/assets/values/rulesFile.js +++ b/test/assets/values/rulesFile.js @@ -1 +1,3 @@ -rules.push('rf1.w2.org file://{test.json}'); \ No newline at end of file +if (isLocalAddress()) { + rules.push('rf1.w2.org file://{test.json}'); +}
test: isLocalAddress
avwo_whistle
train
js
39041ad08de58149a0974b25c4d29728aa050baf
diff --git a/test/position/bk-test.js b/test/position/bk-test.js index <HASH>..<HASH> 100644 --- a/test/position/bk-test.js +++ b/test/position/bk-test.js @@ -159,6 +159,28 @@ describe("position/bk", function() { }); }); + it("aligns correctly even regardless of node name / insertion order", function() { + // This test ensures that we're actually properly sorting nodes by + // position when searching for candidates. Many of these tests previously + // passed because the node insertion order matched the order of the nodes + // in the layering. + g.setNode("b", { rank: 0, order: 1 }); + g.setNode("c", { rank: 1, order: 0 }); + g.setNode("z", { rank: 0, order: 0 }); + g.setEdge("z", "c"); + g.setEdge("b", "c"); + + var layering = buildLayerMatrix(g), + conflicts = {}; + + var result = verticalAlignment(g, layering, conflicts, g.predecessors.bind(g)); + expect(result).to.eql({ + root: { z: "z", b: "b", c: "z" }, + align: { z: "c", b: "b", c: "z" } + }); + }); + + it("aligns with its right median when left is unavailable", function() { g.setNode("a", { rank: 0, order: 0 }); g.setNode("b", { rank: 0, order: 1 });
Add test for insertion-independence in verticalAlignment
dagrejs_dagre
train
js
803b58c1d8e543a528d181b26c24a584be6056c7
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -35,7 +35,7 @@ betterThanBefore.setups([ 'BREAKING CHANGE: The Change is huge.', ]) gitDummyCommit([':hammer:(ngOptions) make it faster', ' closes #1, #2']) - gitDummyCommit(':hammer:(ngOptions) bad commit') // Add rewind emoji + gitDummyCommit(':rewind:(ngOptions) bad commit') gitDummyCommit(':bug: oops') }, function () { @@ -63,17 +63,16 @@ betterThanBefore.setups([ 'BREAKING CHANGE: The Change is huge.', ]) gitDummyCommit([ - ':hammer: more tests', // Add test emoji + ':rotating_light: more tests', 'BREAKING CHANGE: The Change is huge.', ]) gitDummyCommit([ - ':hammer:(deps) bump', // Add package emoji + ':package: bump', 'BREAKING CHANGE: The Change is huge.', ]) }, function () { - // Add package emoji - gitDummyCommit([':gift:(deps) bump', 'BREAKING CHANGES: Also works :)']) + gitDummyCommit([':package: bump', 'BREAKING CHANGES: Also works :)']) }, function () { shell.exec('git tag v1.0.0')
:rotating_light: Use new commit emoji in tests
stormwarning_zazen-conventional-changelog
train
js
247eb32d971ac85868cf926cbe8bb27c7b0b0f54
diff --git a/gtkmvco/tests/autoconnect.py b/gtkmvco/tests/autoconnect.py index <HASH>..<HASH> 100644 --- a/gtkmvco/tests/autoconnect.py +++ b/gtkmvco/tests/autoconnect.py @@ -4,7 +4,7 @@ the program. This tests recognizing handlers by name instead of defining them in Glade. -TODO unittest, class attribute +TODO automate, class attribute """ import gtk
TESTS work around overly simple all.py
roboogle_gtkmvc3
train
py
8e7798a07a924ad3b6bf2ea48d88856a834ea187
diff --git a/ediblepickle.py b/ediblepickle.py index <HASH>..<HASH> 100644 --- a/ediblepickle.py +++ b/ediblepickle.py @@ -23,21 +23,19 @@ import time __author__ = 'pavan.mnssk@gmail.com' +# Unfinished feature. +# def _modification_time(cache_file): +# +# creation_time = os.path.getctime(cache_file) +# modification_time = os.path.getmtime(cache_file) +# +# print ' creation time', creation_time +# print 'modification time', modification_time +# +# diff = creation_time - modification_time +# +# print diff/60/60/24 -def _modification_time(cache_file): - - creation_time = os.path.getctime(cache_file) - modification_time = os.path.getmtime(cache_file) - - print ' creation time', creation_time - print 'modification time', modification_time - - diff = creation_time - modification_time - - print diff/60/60/24 - - -print _modification_time('/Users/pavan/swaroop.txt') def checkpoint(key=0, unpickler=pickle.load, pickler=pickle.dump, work_dir=gettempdir(), refresh=False):
commented some partially finished feature for the next version
mpavan_ediblepickle
train
py
4b836f1fd523344b25a40b30701b3c695c8dffdd
diff --git a/bcbio/variation/population.py b/bcbio/variation/population.py index <HASH>..<HASH> 100644 --- a/bcbio/variation/population.py +++ b/bcbio/variation/population.py @@ -72,7 +72,9 @@ def create_gemini_db(gemini_vcf, data, gemini_db=None, ped_file=None): # Apply custom resource specifications, allowing use of alternative annotation_dir resources = config_utils.get_resources("gemini", data["config"]) gemini_opts = " ".join([str(x) for x in resources["options"]]) if resources.get("options") else "" - cmd = ("{gemini} {gemini_opts} load {load_opts} -v {gemini_vcf} {eanns} --cores {num_cores} " + exports = utils.local_path_export() + cmd = ("{exports} {gemini} {gemini_opts} load {load_opts} " + "-v {gemini_vcf} {eanns} --cores {num_cores} " "--tempdir {tmpdir} {tx_gemini_db}") cmd = cmd.format(**locals()) do.run(cmd, "Create gemini database for %s" % gemini_vcf, data)
Ensure parallel GEMINI uses bcbio installed tools #<I>
bcbio_bcbio-nextgen
train
py
005d0da87c5a3cdff70054998a5f27ec0026116c
diff --git a/salt/states/group.py b/salt/states/group.py index <HASH>..<HASH> 100644 --- a/salt/states/group.py +++ b/salt/states/group.py @@ -1,10 +1,28 @@ ''' -State enforcement for groups +Group Management +================ + +The group module is used to create and manage unix group settings, groups +can be either present or absent: +.. code-block:: yaml + cheese: + group: + - present + - gid: 7648 ''' def present(name, gid=None): ''' Ensure that a group is present + + name + ~~~~ + The name of the group to manage + + gid + ~~~ + The group id to assign to the named group, if left empty then the next + available group id will be assigned ''' ret = {'name': name, 'changes': {}, @@ -48,6 +66,10 @@ def present(name, gid=None): def absent(name): ''' Ensure that the named group is absent + + name + ~~~~ + The name of the group to remove ''' ret = {'name': name, 'changes': {},
Add doctrings to group state
saltstack_salt
train
py
3cacaf5c4f3680dc70390ff11fd050816103651e
diff --git a/lib/fluent/plugin/out_forward.rb b/lib/fluent/plugin/out_forward.rb index <HASH>..<HASH> 100644 --- a/lib/fluent/plugin/out_forward.rb +++ b/lib/fluent/plugin/out_forward.rb @@ -1081,8 +1081,9 @@ module Fluent::Plugin end if block_given? + ret = nil begin - yield(sock) + ret = yield(sock) rescue @socket_cache.revoke if @keepalive raise @@ -1091,6 +1092,8 @@ module Fluent::Plugin ensure sock.close unless @keepalive end + + ret else sock end
Respect the response from block If keepalive, #connect always returns integer returned by L<I>
fluent_fluentd
train
rb
56c9183f4ec9d46c955684ed06865764344756c8
diff --git a/tests/test-rest-taxonomies-controller.php b/tests/test-rest-taxonomies-controller.php index <HASH>..<HASH> 100644 --- a/tests/test-rest-taxonomies-controller.php +++ b/tests/test-rest-taxonomies-controller.php @@ -59,7 +59,7 @@ class WP_Test_REST_Taxonomies_Controller extends WP_Test_REST_Controller_Testcas $response = $this->server->dispatch( $request ); $this->assertEquals( 200, $response->get_status() ); $data = $response->get_data(); - $this->assertEquals( json_encode( $data ), '{}' ); + $this->assertEquals( '{}', json_encode( $data ) ); } public function test_get_item() {
Reverse order of arguments in assertEquals call for consistency
WP-API_WP-API
train
php
8915c410cb8d6b177bfc772256741af75e87c783
diff --git a/src/wavesurfer.js b/src/wavesurfer.js index <HASH>..<HASH> 100644 --- a/src/wavesurfer.js +++ b/src/wavesurfer.js @@ -129,17 +129,16 @@ var WaveSurfer = { mark.remove(); } }); - - // Clear selection on canvas dble click - this.drawer.on('drag-clear', function(e) { - my.clearSelection(); - }); // Drag selection or marker events if (this.params.dragSelection) { this.drawer.on('drag', function (drag) { my.dragging = true; my.updateSelection(drag); + }); + // Clear selection on canvas dble click + this.drawer.on('drag-clear', function() { + my.clearSelection(); }); }
double click on marker handler to delete it
katspaugh_wavesurfer.js
train
js
41d175564bec26e4c3377a2fff75222be8ed3565
diff --git a/IndexedRedis/__init__.py b/IndexedRedis/__init__.py index <HASH>..<HASH> 100644 --- a/IndexedRedis/__init__.py +++ b/IndexedRedis/__init__.py @@ -21,6 +21,7 @@ from QueryableList import QueryableListObjs __all__ = ('INDEXED_REDIS_PREFIX', 'INDEXED_REDIS_VERSION', 'INDEXED_REDIS_VERSION_STR', 'IndexedRedisDelete', 'IndexedRedisHelper', 'IndexedRedisModel', 'IndexedRedisQuery', 'IndexedRedisSave', 'isIndexedRedisModel', 'setIndexedRedisEncoding', 'getIndexedRedisEncoding', 'InvalidModelException', + 'IRField', ) # Prefix that all IndexedRedis keys will contain, as to not conflict with other stuff.
Add IRField to __all__
kata198_indexedredis
train
py
ae5c3ab86a7468ef0f1ea94d23cfaa1a843f6253
diff --git a/lib/auth.strategies/google2.js b/lib/auth.strategies/google2.js index <HASH>..<HASH> 100644 --- a/lib/auth.strategies/google2.js +++ b/lib/auth.strategies/google2.js @@ -16,6 +16,7 @@ module.exports= function(options, server) { my._redirectUri= options.callback; my.scope= options.scope || "https://www.googleapis.com/auth/userinfo.profile"; my.accessType = options.accessType || null; + my.forceApproval = options.forceApproval || false; // Ensure we have the correct scopes to match what the consumer really wants. if( options.requestEmailPermission === true && my.scope.indexOf("auth/userinfo.email") == -1 ) { @@ -104,6 +105,9 @@ module.exports= function(options, server) { // support offline access as per https://developers.google.com/accounts/docs/OAuth2WebServer#offline if(my.accessType !== null) urlParams.access_type = my.accessType; // access_type=offline + // force displaying the approval prompt to the user. In such a case, a refresh_token will be regenerated. + if (my.forceApproval) + urlParams.approval_prompt = 'force'; var redirectUrl= my._oAuth.getAuthorizeUrl(urlParams); self.redirect(response, redirectUrl, callback); }
allow forcing the display of the OAuth approval screen as per <URL>, is to force the user to re-approve the app. This commit adds the optional "forceApproval" option. If present and is true, it will trigger the display of the approval prompt to the user.
ciaranj_connect-auth
train
js
72be0a72f40ce0cec6b40bff16fe69a5a4fa44ef
diff --git a/src/Engines/DatabaseEngine.php b/src/Engines/DatabaseEngine.php index <HASH>..<HASH> 100644 --- a/src/Engines/DatabaseEngine.php +++ b/src/Engines/DatabaseEngine.php @@ -107,7 +107,7 @@ class DatabaseEngine extends Engine implements PaginatesEloquentModels { return $this->buildSearchQuery($builder) ->when(! is_null($page) && ! is_null($perPage), function ($query) use ($page, $perPage) { - return $query->forPage($page, $perPage); + $query->forPage($page, $perPage); }) ->when(! $this->getFullTextColumns($builder), function ($query) use ($builder) { $query->orderBy($builder->model->getKeyName(), 'desc');
Remove redundant 'return' key like for all 'when' methods for database engine (#<I>)
laravel_scout
train
php
27c17c45fb673d642f7e6f30a91ba115579ad37a
diff --git a/tests/Keboola/StorageApi/EventsTest.php b/tests/Keboola/StorageApi/EventsTest.php index <HASH>..<HASH> 100644 --- a/tests/Keboola/StorageApi/EventsTest.php +++ b/tests/Keboola/StorageApi/EventsTest.php @@ -124,12 +124,15 @@ class Keboola_StorageApi_EventsTest extends StorageApiTestCase { $id = $this->_client->createEvent($event); + sleep(2); // wait for ES refresh $tries = 0; while (true) { try { $this->_client->getEvent($id); return $id; - } catch(\Keboola\StorageApi\ClientException $e) {} + } catch(\Keboola\StorageApi\ClientException $e) { + echo 'Event not found: ' . $id . PHP_EOL; + } if ($tries > 4) { throw new \Exception('Max tries exceeded.'); }
tests: events test more stable, wait for elasticsearch refresh
keboola_storage-api-php-client
train
php
83dc2a6437887182490912d58872e74edd6ba055
diff --git a/ocLazyLoad.js b/ocLazyLoad.js index <HASH>..<HASH> 100644 --- a/ocLazyLoad.js +++ b/ocLazyLoad.js @@ -155,7 +155,7 @@ return { link: function(scope, element, attr) { var childScope; - var onloadExp = attr.onload || ''; + var onloadExp = scope.$eval(attr.ocLazyLoad).onload || ''; /** * Destroy the current scope of this element and empty the html
Fix the bug on the onload expression
ocombe_ocLazyLoad
train
js
9b7a6ac3ba79a03954d7ad8e731409c86258a932
diff --git a/lib/rake_compiler_dock/docker_check.rb b/lib/rake_compiler_dock/docker_check.rb index <HASH>..<HASH> 100644 --- a/lib/rake_compiler_dock/docker_check.rb +++ b/lib/rake_compiler_dock/docker_check.rb @@ -70,12 +70,17 @@ module RakeCompilerDock @doma_version_status == 0 && @doma_version_text =~ /version/ end + def add_env_options(options, names) + names.each do |name| + if (v=ENV[name]) && !v.empty? + options << ["--engine-env", "#{name}=#{ENV[name]}"] + end + end + options + end + def doma_create - options = [ - "--engine-env", "ftp_proxy=#{ENV['ftp_proxy']}", - "--engine-env", "http_proxy=#{ENV['http_proxy']}", - "--engine-env", "https_proxy=#{ENV['https_proxy']}", - ] + options = add_env_options([], %w[ftp_proxy http_proxy https_proxy]) @doma_create_text, @doma_create_status = run("docker-machine create --driver virtualbox #{options.join(" ")} #{machine_name}", cmd: :visible, output: :visible) end
Only pass proxy vars through to docker, if they are set.
rake-compiler_rake-compiler-dock
train
rb
37e8cb73da9ab856eaf9dd640352ae1f22b2c41c
diff --git a/codegen/src/main/java/io/sundr/codegen/functions/ClassTo.java b/codegen/src/main/java/io/sundr/codegen/functions/ClassTo.java index <HASH>..<HASH> 100644 --- a/codegen/src/main/java/io/sundr/codegen/functions/ClassTo.java +++ b/codegen/src/main/java/io/sundr/codegen/functions/ClassTo.java @@ -266,7 +266,10 @@ public class ClassTo { final Object value = method.invoke(annotation, (Object[]) null); parameters.put(name, value); } catch (IllegalAccessException | InvocationTargetException e) { - System.out.printf("Couldn't retrieve '%s' parameter value for %s%n", name, annotationType.getName()); + //Let's not pollute output with internal jdk stuff. + if (!annotationType.getName().startsWith("jdk.")) { + System.out.printf("Couldn't retrieve '%s' parameter value for %s%n", name, annotationType.getName()); + } } } annotationRef = new AnnotationRefBuilder(annotationRef).withParameters(parameters).build();
chore: hide output related to processing internal jdk types
sundrio_sundrio
train
java
43cd4491e03e83319d67c92bc6abd4ab8fd4dbc5
diff --git a/version.go b/version.go index <HASH>..<HASH> 100644 --- a/version.go +++ b/version.go @@ -23,7 +23,7 @@ import ( ) // Version is the FDK version -const Version = "0.0.10" +const Version = "0.0.11" var versionHeader = fmt.Sprintf("fdk-go/%s", Version) var runtimeHeader = fmt.Sprintf("go/%s", strings.TrimLeft(runtime.Version(), "go"))
Releasing version <I>
fnproject_fdk-go
train
go
af6aebf976615a64b624f556a3d31ac1c2bcb710
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -21,10 +21,7 @@ module.exports = function () { list.players = [] list.update = browser.update.bind(browser) - list.destroy = function () { - browser.stop() - bonjour.destroy() - } + list.destroy = bonjour.destroy.bind(bonjour) return list }
No need to stop the Bonjour browser when it's destroyed
watson_airplayer
train
js
72ed1ae0c3d526a9fc5c765b2bf5f4737aab163c
diff --git a/view/frontend/web/js/view/payment/utilities.js b/view/frontend/web/js/view/payment/utilities.js index <HASH>..<HASH> 100755 --- a/view/frontend/web/js/view/payment/utilities.js +++ b/view/frontend/web/js/view/payment/utilities.js @@ -68,17 +68,21 @@ define( * @return {mixed} The billing address. */ getCustomerName: function (obj = false) { - var billingAddress = Quote.billingAddress(), + var billingAddress = Quote.billingAddress(); + if (billingAddress) { name = { - first_name: billingAddress.firstname, - last_name: billingAddress.lastname - }; + first_name: billingAddress.firstname, + last_name: billingAddress.lastname + }; + + if (!obj) { + name = name.first_name + ' ' + name.last_name + } - if (!obj) { - name = name.first_name + ' ' + name.last_name + return name; } - return name; + return null; }, /**
Fixed a js error with card payments when shipping is disabled
checkout_checkout-magento2-plugin
train
js
89dc3b88d1f8e878a08e485ee8f1eaf0e918abae
diff --git a/public/app/features/dashboard/timeSrv.js b/public/app/features/dashboard/timeSrv.js index <HASH>..<HASH> 100644 --- a/public/app/features/dashboard/timeSrv.js +++ b/public/app/features/dashboard/timeSrv.js @@ -13,7 +13,7 @@ define([ module.service('timeSrv', function($rootScope, $timeout, $routeParams, timer) { var self = this; - $rootScope.onAppEvent('zoom-out', function(e, factor) { self.zoomOut(factor); }, $rootScope); + $rootScope.$on('zoom-out', function(e, factor) { self.zoomOut(factor); }); this.init = function(dashboard) { timer.cancel_all();
fix(test): fixed failing test caused by recent change
grafana_grafana
train
js
2c15de01cb1d4482fce18e1278b6ff7e4bd094ff
diff --git a/api/src/main/java/org/jfrog/artifactory/client/RepositoryHandle.java b/api/src/main/java/org/jfrog/artifactory/client/RepositoryHandle.java index <HASH>..<HASH> 100644 --- a/api/src/main/java/org/jfrog/artifactory/client/RepositoryHandle.java +++ b/api/src/main/java/org/jfrog/artifactory/client/RepositoryHandle.java @@ -5,6 +5,7 @@ import org.jfrog.artifactory.client.model.ItemPermission; import org.jfrog.artifactory.client.model.ReplicationStatus; import org.jfrog.artifactory.client.model.Repository; import java.io.File; +import java.io.IOException; import java.io.InputStream; import java.util.Set; @@ -39,7 +40,7 @@ public interface RepositoryHandle { Replications getReplications(); - boolean isFolder(String path); + boolean isFolder(String path) throws IOException; boolean exists(); }
Fix #<I>: add throws clause for checked exception RepositoryHandle#isFolder throws checked IOException without declaring, resulting in a compile error when the client code tries to handle it.
jfrog_artifactory-client-java
train
java
d51c29b5346ee8174f428a1f5af852ceb82b4006
diff --git a/lib/post_data.js b/lib/post_data.js index <HASH>..<HASH> 100644 --- a/lib/post_data.js +++ b/lib/post_data.js @@ -139,7 +139,7 @@ MattermostDataPostHandler.prototype.postData = function(data) { attachment = { room: recipient, - content.attachments ? content.attachments : content, + attachments: content.attachments ? content.attachments : content, text: i === 0 ? pretext + split_message.pretext : null }; robot.emit('slack-attachment', attachment);
Updated code for button attachment Modified the code for button attachments
StackStorm_hubot-stackstorm
train
js
068bb667bd0e1e46ef9af771039a60dbfa52f9fa
diff --git a/geomdl/visualization/VisPlotly.py b/geomdl/visualization/VisPlotly.py index <HASH>..<HASH> 100644 --- a/geomdl/visualization/VisPlotly.py +++ b/geomdl/visualization/VisPlotly.py @@ -320,21 +320,22 @@ class VisSurface(Abstract.VisAbstractSurf): # Plot evaluated points if plot['type'] == 'evalpts': + vertices = plot['ptsarr'][0] triangles = plot['ptsarr'][1] - pts = [] - for tri in triangles: - pts += tri.vertices_raw + pts = [v.data for v in vertices] + tri = [t.vertex_ids_zero for t in triangles] pts = np.array(pts, dtype=self._config.dtype) - figure = graph_objs.Scatter3d( + tri = np.array(tri, dtype=self._config.dtype) + figure = graph_objs.Mesh3d( x=pts[:, 0], y=pts[:, 1], z=pts[:, 2], name=plot['name'], - mode='lines', - line=dict( - color=plot['color'], - width=self._config.line_width - ), + i=tri[:, 0], + j=tri[:, 1], + k=tri[:, 2], + color=plot['color'], + opacity=0.75, ) plot_data.append(figure)
Plotly surface vis module now uses triangulated mesh plots
orbingol_NURBS-Python
train
py
d687cfc6eaece3580bcffb8da26e2127c3aab33b
diff --git a/pac4j-core/src/main/java/org/pac4j/core/profile/ProfileHelper.java b/pac4j-core/src/main/java/org/pac4j/core/profile/ProfileHelper.java index <HASH>..<HASH> 100644 --- a/pac4j-core/src/main/java/org/pac4j/core/profile/ProfileHelper.java +++ b/pac4j-core/src/main/java/org/pac4j/core/profile/ProfileHelper.java @@ -64,12 +64,12 @@ public final class ProfileHelper { logger.info("Building user profile based on typedId {}", typedId); try { - if (!typedId.contains("#")) { + if (!typedId.contains(UserProfile.SEPARATOR)) { final String completeName = determineProfileClassByName("HttpProfile"); return buildUserProfileByClassCompleteName(typedId, attributes, completeName); } - final String[] values = typedId.split("#"); + final String[] values = typedId.split(UserProfile.SEPARATOR); final String className = values[0]; final String completeName = determineProfileClassByName(className);
Merge branch 'master' into generic-jwts # Conflicts: # pac4j-jwt/src/main/java/org/pac4j/jwt/credentials/authenticator/JwtAuthenticator.java
pac4j_pac4j
train
java
4de79ed7143330400dc07992931ea101f72af9db
diff --git a/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java b/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java index <HASH>..<HASH> 100644 --- a/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java +++ b/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableSession.java @@ -639,8 +639,8 @@ public class BigtableSession implements Closeable { String host, BigtableOptions options, ClientInterceptor... interceptors) throws SSLException { LOG.info("Creating new channel for %s", host); - if (LOG.getLog().isDebugEnabled()) { - LOG.debug(Throwables.getStackTraceAsString(new Throwable())); + if (LOG.getLog().isTraceEnabled()) { + LOG.trace(Throwables.getStackTraceAsString(new Throwable())); } // Ideally, this should be ManagedChannelBuilder.forAddress(...) rather than an explicit
Changed Throwable logs to debug level to reduce unwanted logs in build (#<I>)
googleapis_cloud-bigtable-client
train
java
3862c3799c8d135c9bca3f8d373cb764ba0b13e4
diff --git a/rundeckapp/src/java/com/dtolabs/rundeck/RunServer.java b/rundeckapp/src/java/com/dtolabs/rundeck/RunServer.java index <HASH>..<HASH> 100644 --- a/rundeckapp/src/java/com/dtolabs/rundeck/RunServer.java +++ b/rundeckapp/src/java/com/dtolabs/rundeck/RunServer.java @@ -114,6 +114,7 @@ public class RunServer { */ private void configureJAASRealms(final Server server) { final JAASUserRealm realm = new JAASUserRealm(); + realm.setCallbackHandlerClass("org.mortbay.jetty.plus.jaas.callback.DefaultCallbackHandler"); realm.setName(REALM_NAME); realm.setLoginModuleName(loginmodulename); server.addUserRealm(realm);
set callbackHandlerClass for JAASUserRealm to quell warning [#<I> state:resolved]
rundeck_rundeck
train
java
6560427bdec23e26b67f74c2574ccdbf5833beba
diff --git a/src/Visitor/ElasticsearchVisitor.php b/src/Visitor/ElasticsearchVisitor.php index <HASH>..<HASH> 100644 --- a/src/Visitor/ElasticsearchVisitor.php +++ b/src/Visitor/ElasticsearchVisitor.php @@ -220,8 +220,20 @@ class ElasticsearchVisitor implements Visitor ]); }); + $this->setOperator('=', function ($a, $b) use ($must) { + return $must([ + 'term' => [ + $a => $b, + ] + ]); + }); + $this->setOperator('not', $mustNot); + $this->setOperator('match_all', function() { + return ['match_all' => []]; + }); + $this->setOperator('>', function ($a, $b) use ($range) { return $range($a, $b, 'gt'); });
Add = and match_all operators for elasticsearch
K-Phoen_rulerz
train
php
efd000f94d5d5f0e2fac97e232b47b5d5906eaa5
diff --git a/swampyer/__init__.py b/swampyer/__init__.py index <HASH>..<HASH> 100644 --- a/swampyer/__init__.py +++ b/swampyer/__init__.py @@ -167,7 +167,7 @@ class WAMPClient(threading.Thread): # so we ensure we use http or https appropriately depending on the # ws or wss protocol if m and m.group(1).lower() == 'wss': - origin_port = ':'+m.group(3) if m.group(3) else '' + origin_port = ':'+m.group(4) if m.group(4) else '' options['origin'] = u'https://{}{}'.format(m.group(2),origin_port) # Attempt connection once unless it's autoreconnect in which
fix origin url in ssl options when port is specified
zabertech_python-swampyer
train
py
89102ca80ca6ab20919a55bfd10d9c389112dcb3
diff --git a/parquet-column/src/main/java/org/apache/parquet/internal/column/columnindex/ColumnIndexBuilder.java b/parquet-column/src/main/java/org/apache/parquet/internal/column/columnindex/ColumnIndexBuilder.java index <HASH>..<HASH> 100644 --- a/parquet-column/src/main/java/org/apache/parquet/internal/column/columnindex/ColumnIndexBuilder.java +++ b/parquet-column/src/main/java/org/apache/parquet/internal/column/columnindex/ColumnIndexBuilder.java @@ -167,7 +167,7 @@ public abstract class ColumnIndexBuilder { @Override public String toString() { try (Formatter formatter = new Formatter()) { - formatter.format("Boudary order: %s\n", boundaryOrder); + formatter.format("Boundary order: %s\n", boundaryOrder); String minMaxPart = " %-" + MAX_VALUE_LENGTH_FOR_TOSTRING + "s %-" + MAX_VALUE_LENGTH_FOR_TOSTRING + "s\n"; formatter.format("%-10s %20s" + minMaxPart, "", "null count", "min", "max"); String format = "page-%-5d %20s" + minMaxPart;
PARQUET-<I>: Fix typo in ColumnIndexBase toString (#<I>)
apache_parquet-mr
train
java
e00e5351154da4db1f03562bbac690fad87826a3
diff --git a/examples/server.py b/examples/server.py index <HASH>..<HASH> 100644 --- a/examples/server.py +++ b/examples/server.py @@ -139,7 +139,9 @@ class ServerHandler(BaseHTTPRequestHandler): identity, trust_root = \ self.server.openid.getAuthenticationData(self.query) - identity_ok = self.user and identity == self.server.base_url + self.user + identity_ok = (self.user and identity == \ + self.server.base_url + self.user) + # check all three important parts if identity_ok: key = (identity, trust_root)
[project @ shorten a long line]
openid_python-openid
train
py
bcf7279f17fe23c1841099a5878d733aeb3afcf7
diff --git a/test/unit/mirror_data_test.rb b/test/unit/mirror_data_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/mirror_data_test.rb +++ b/test/unit/mirror_data_test.rb @@ -197,6 +197,18 @@ class MirrorDataTest < Test::Unit::TestCase OfflineMirror::MirrorData.new(@offline_group, "FOO BAR BLAH").load_upwards_data end end + + offline_test "cannot use load_upwards_data in offline mode" do + assert_raise OfflineMirror::PluginError do + OfflineMirror::MirrorData.new(@offline_group, "FOO BAR BLAH").load_upwards_data + end + end + + online_test "cannot use load_downwards_data in online mode" do + assert_raise OfflineMirror::PluginError do + OfflineMirror::MirrorData.new(@offline_group, "FOO BAR BLAH").load_downwards_data + end + end cross_test "can insert and update group data using an up mirror file" do mirror_data = "" @@ -355,10 +367,6 @@ class MirrorDataTest < Test::Unit::TestCase # TODO Implement end - online_test "cannot use an 'initial' up mirror file to delete online records" do - # TODO Implement - end - cross_test "cannot affect group records using a non-initial down mirror file" do # TODO Implement end
Testing that MirrorData::load_* methods only usable in correct app mode
DavidMikeSimon_offroad
train
rb
99ce455c35b37dab22a5b22da2dfeb72cfb771e5
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -2,11 +2,11 @@ var isInteger = require('is-integer') -module.exports = function parseIntStrict (int) { - if (typeof int === 'number') { - return isInteger(int) ? int : undefined +module.exports = function parseIntStrict (integer) { + if (typeof integer === 'number') { + return isInteger(integer) ? integer : undefined } - if (typeof int === 'string') { - return /^\d+$/.test(int) ? parseInt(int, 10) : undefined + if (typeof integer === 'string') { + return /^\d+$/.test(integer) ? parseInt(integer, 10) : undefined } }
Replace "int" variable name with "integer" Some compilers break because int is a reserved (unused) word in JS Closes #1, Closes #2
bendrucker_parse-int
train
js
ea76ee82eba1700e1143022050b368460fc9cd7f
diff --git a/tests/test_bcrypt.py b/tests/test_bcrypt.py index <HASH>..<HASH> 100644 --- a/tests/test_bcrypt.py +++ b/tests/test_bcrypt.py @@ -400,7 +400,9 @@ def test_checkpw_extra_data(): b"\x43\x66\x6c\x9b\x09\xef\x33\xed\x8c\x27\xe8\xe8\xf3\xe2\xd8\xe6" ]]) def test_kdf(rounds, password, salt, expected): - derived = bcrypt.kdf(password, salt, len(expected), rounds) + derived = bcrypt.kdf( + password, salt, len(expected), rounds, ignore_few_rounds=True + ) assert derived == expected
Don't emit warnings here, there's no point (#<I>) * Don't emit warnings here, there's no point * whoops here
pyca_bcrypt
train
py
55560347ecee181fdba9a486f58658ea0606a173
diff --git a/bignumber.js b/bignumber.js index <HASH>..<HASH> 100644 --- a/bignumber.js +++ b/bignumber.js @@ -12,7 +12,7 @@ */ - var BigNumber, parseNumeric, + var BigNumber, isNumeric = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, mathceil = Math.ceil, mathfloor = Math.floor, @@ -39,7 +39,7 @@ * Create and return a BigNumber constructor. */ function constructorFactory(configObj) { - var div, + var div, parseNumeric, // id tracks the caller function, so its name can be included in error messages. id = 0,
Bugfix: parseNumeric declared in outer scope
MikeMcl_bignumber.js
train
js
8b70e4c783fd3c858cee075906ca714af594eabf
diff --git a/src/main/java/com/googlecode/lanterna/gui2/SeparateTextGUIThread.java b/src/main/java/com/googlecode/lanterna/gui2/SeparateTextGUIThread.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/googlecode/lanterna/gui2/SeparateTextGUIThread.java +++ b/src/main/java/com/googlecode/lanterna/gui2/SeparateTextGUIThread.java @@ -120,6 +120,12 @@ public class SeparateTextGUIThread extends AbstractTextGUIThread implements Asyn } catch(EOFException e) { stop(); + if (textGUI instanceof WindowBasedTextGUI) { + // Close all windows on EOF + for (Window window: ((WindowBasedTextGUI) textGUI).getWindows()) { + window.close(); + } + } break; //Break out quickly from the main loop } catch(IOException e) {
When you get EOF, always close all windows
mabe02_lanterna
train
java
8254290907a59b6c2526da46378a8319b19c51c9
diff --git a/src/DatePicker.php b/src/DatePicker.php index <HASH>..<HASH> 100644 --- a/src/DatePicker.php +++ b/src/DatePicker.php @@ -131,6 +131,6 @@ class DatePicker extends InputWidget } } - return $value; + return Html::encode($value); } }
Prevent XSS in DatePicker
webtoolsnz_yii2-widgets
train
php
c0b628d081281d7b0c95052c1da4dadfbeaf5955
diff --git a/astrobase/varbase/signals.py b/astrobase/varbase/signals.py index <HASH>..<HASH> 100644 --- a/astrobase/varbase/signals.py +++ b/astrobase/varbase/signals.py @@ -166,7 +166,7 @@ def prewhiten_magseries(times, mags, errs, wmags = wmags + median_mag # prepare the returndict - returndict = {'wtimes':wtimes, # these are in phase order + returndict = {'wtimes':wtimes, # these are in the new time order 'wphase':wphase, 'wmags':wmags, 'werrs':werrs, @@ -175,7 +175,7 @@ def prewhiten_magseries(times, mags, errs, # make the fit plot if required - if plotfit and isinstance(plotfit, str) or isinstance(plotfit, strio): + if plotfit and (isinstance(plotfit, str) or isinstance(plotfit, strio)): if plotfitphasedlconly: plt.figure(figsize=(10,4.8))
varbase.signals: fixes for GH PR #<I> and #<I>
waqasbhatti_astrobase
train
py
e0ed549006a25523b4fdbb3df3e289544114527b
diff --git a/python/ray/tests/test_k8s_operator_examples.py b/python/ray/tests/test_k8s_operator_examples.py index <HASH>..<HASH> 100644 --- a/python/ray/tests/test_k8s_operator_examples.py +++ b/python/ray/tests/test_k8s_operator_examples.py @@ -72,7 +72,7 @@ def wait_for_job(job_pod): except subprocess.CalledProcessError as e: print(">>>Failed to check job logs.") print(e.output.decode()) - raise e + return False success = "success" in out.lower() if success: print(">>>Job submission succeeded.")
return False, don't raise (#<I>)
ray-project_ray
train
py
c6e041c7dfc4b97645e97f8ffeee8fe636563774
diff --git a/tests/Test/StorageApiTestCase.php b/tests/Test/StorageApiTestCase.php index <HASH>..<HASH> 100644 --- a/tests/Test/StorageApiTestCase.php +++ b/tests/Test/StorageApiTestCase.php @@ -107,7 +107,7 @@ class StorageApiTestCase extends \PHPUnit_Framework_TestCase public function backends() { return array( -// array('mysql'), + array('mysql'), array('redshift'), ); }
fix: mysql backend returned to tests
keboola_storage-api-php-client
train
php
5a8cd1c259e0c48d5d8304eafa760b138c5c9735
diff --git a/buildSrc/src/main/groovy/org/mockito/release/comparison/ZipComparator.java b/buildSrc/src/main/groovy/org/mockito/release/comparison/ZipComparator.java index <HASH>..<HASH> 100644 --- a/buildSrc/src/main/groovy/org/mockito/release/comparison/ZipComparator.java +++ b/buildSrc/src/main/groovy/org/mockito/release/comparison/ZipComparator.java @@ -12,7 +12,7 @@ class ZipComparator { private Closure<File> file2; ZipComparator setPair(Closure<File> file1, Closure<File> file2) { - notNull(file1, "source jar file to compare", file2, "source jar file to compare"); + notNull(file1, "zip/jar file to compare", file2, "zip/jar file to compare"); this.file1 = file1; this.file2 = file2; return this; @@ -21,7 +21,7 @@ class ZipComparator { Result compareFiles() { final File file1 = this.file1.call(); final File file2 = this.file2.call(); - notNull(file1, "source jar file to compare", file2, "source jar file to compare"); + notNull(file1, "zip/jar file to compare", file2, "zip/jar file to compare"); FileHasher hasher = new FileHasher(); final byte[] hash1 = hasher.hash(file1);
Updated error message in zip comparator
mockito_mockito
train
java
6b5c30ce6bf33e323a2721a70f41d924b3ed58b0
diff --git a/lib/template-generator.js b/lib/template-generator.js index <HASH>..<HASH> 100644 --- a/lib/template-generator.js +++ b/lib/template-generator.js @@ -363,7 +363,7 @@ module.exports.generateTemplate = function generateTemplate(results, isMultiOn) if (isMultiOn && isOutputDirKnown()) { const outputPath = getOutputPath(currWorkingDir); - buildScriptsAndStyleFiles(outputPath()); + buildScriptsAndStyleFiles(outputPath); } // Iterate over results to get totals
fix(assets): wrong var
mportuga_eslint-detailed-reporter
train
js
6b358ea6afa6797923bd932365a71e4f7eb3909d
diff --git a/spec/unit/mongoid/fields_spec.rb b/spec/unit/mongoid/fields_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/mongoid/fields_spec.rb +++ b/spec/unit/mongoid/fields_spec.rb @@ -4,7 +4,7 @@ describe Mongoid::Fields do describe ".defaults" do - it "returns a hash of all the default values" do + it "returns an array of all the default values" do Game.defaults.should eq([ "high_score", "score" ]) end end
Test should reflect defaults is an array. Closes #<I>.
mongodb_mongoid
train
rb
6195a75f4bcefcab8be6d3d398957c2dd7e62862
diff --git a/tests/integration/components/sl-modal-test.js b/tests/integration/components/sl-modal-test.js index <HASH>..<HASH> 100755 --- a/tests/integration/components/sl-modal-test.js +++ b/tests/integration/components/sl-modal-test.js @@ -246,8 +246,6 @@ test( 'Backdrop is shown by default', function( assert ) { }); test( 'Fade class is present when animated is set to true', function( assert ) { - this.render( template ); - this.render( hbs` {{#sl-modal animated=true}} {{sl-modal-header title="Simple Example"}} @@ -266,8 +264,6 @@ test( 'Fade class is present when animated is set to true', function( assert ) { }); test( 'Fade class is absent when animated is set to false', function( assert ) { - this.render( template ); - this.render( hbs` {{#sl-modal animated=false}} {{sl-modal-header title="Simple Example"}} @@ -288,8 +284,6 @@ test( 'Fade class is absent when animated is set to false', function( assert ) { test( 'ariaDescribedBy attribute binding', function( assert ) { const describedBy = 'targetId'; - this.render( template ); - this.set( 'ariaDescribedBy', describedBy ); this.render( hbs`
Closes softlayer/sl-ember-components#<I>
softlayer_sl-ember-components
train
js
0654dbb366f5e3fca82e84ccee18add9898c31b0
diff --git a/src/php/randomhost/Image/Image.php b/src/php/randomhost/Image/Image.php index <HASH>..<HASH> 100644 --- a/src/php/randomhost/Image/Image.php +++ b/src/php/randomhost/Image/Image.php @@ -53,6 +53,13 @@ class Image const MERGE_SCALE_DST = 2; /** + * Merge images using the destination image size, do not upscale + * + * @var int + */ + const MERGE_SCALE_DST_NO_UPSCALE = 3; + + /** * Image resource identifier * * @var resource @@ -321,7 +328,7 @@ class Image // determine re-sampling strategy switch ($strategy) { - // merge using the destination image dimensions + // merge using the destination image dimensions case self::MERGE_SCALE_DST: $dstWidth = $this->width; @@ -329,7 +336,22 @@ class Image break; - // merge using the source image dimensions + // merge using the destination image dimensions, do not upscale + case self::MERGE_SCALE_DST_NO_UPSCALE: + + $dstWidth = $this->width; + if ($dstWidth > $srcImage->width) { + $dstWidth = $srcImage->width; + } + + $dstHeight = $this->height; + if ($dstHeight > $srcImage->height) { + $dstHeight = $srcImage->height; + } + + break; + + // merge using the source image dimensions case self::MERGE_SCALE_SRC: default:
add option for merging without upscaling
randomhost_image
train
php
ff44fb2e4ba15b9e39a05fd1976584b1b6bcfbef
diff --git a/www/src/py_dom.js b/www/src/py_dom.js index <HASH>..<HASH> 100644 --- a/www/src/py_dom.js +++ b/www/src/py_dom.js @@ -995,7 +995,6 @@ DOMNode.__str__ = DOMNode.__repr__ = function(self){ items.push(attrs[i].name + '="' + self.getAttributeNS(null, attrs[i].name) + '"') } - attrs_str = " " + items.join(" ") } var proto = Object.getPrototypeOf(self) @@ -1005,7 +1004,8 @@ DOMNode.__str__ = DOMNode.__repr__ = function(self){ var proto_str = proto.constructor.toString() name = proto_str.substring(8, proto_str.length - 1) } - return "<" + name + attrs_str + ">" + items.splice(0, 0, name) + return "<" + items.join(" ") + ">" } var res = "<DOMNode object type '" return res + $NodeTypes[self.nodeType] + "' name '" +
Minor improvement in __str__ of DOMNode (cf. issue #<I>)
brython-dev_brython
train
js
5309374a2ff66057dcd8c8405ea760025f604828
diff --git a/openquake/export/__init__.py b/openquake/export/__init__.py index <HASH>..<HASH> 100644 --- a/openquake/export/__init__.py +++ b/openquake/export/__init__.py @@ -15,3 +15,8 @@ """This package contains functionality for querying and exporting calculation results""" + + +from openquake.export import risk + +__all__ = (risk.__name__,)
added risk to export Former-commit-id: dd<I>d<I>a5fa<I>ee<I>ee8e<I>be0a5dc<I>bdc6c9
gem_oq-engine
train
py
8b5863227b56421d338ac1c1cbf46564fe60dbe5
diff --git a/pusherclient/connection.py b/pusherclient/connection.py index <HASH>..<HASH> 100755 --- a/pusherclient/connection.py +++ b/pusherclient/connection.py @@ -221,15 +221,10 @@ class Connection(Thread): self.reconnect() def _connect_handler(self, data): - parsed = json.loads(data) - - self.socket_id = parsed['socket_id'] - + self.socket_id = data['socket_id'] self.state = "connected" def _failed_handler(self, data): - parsed = json.loads(data) - self.state = "failed" def _ping_handler(self, data):
Don't try to double json dump connection handled events
ekulyk_PythonPusherClient
train
py
68e7ab257a99eaf8976ec5c70e526aae71903f43
diff --git a/addok/shell.py b/addok/shell.py index <HASH>..<HASH> 100644 --- a/addok/shell.py +++ b/addok/shell.py @@ -390,9 +390,9 @@ class Cmd(cmd.Cmd): if not doc: return self.error('id "{}" not found'.format(_id)) for field in config.FIELDS: - key = field['key'].encode() + key = field['key'] if key in doc: - self._print_field_index_details(doc[key].decode(), _id) + self._print_field_index_details(doc[key], _id) def do_BESTSCORE(self, word): """Return document linked to word with higher score.
Do not encode/decode anymore in INDEX shell command
addok_addok
train
py
94f32f57c037b194c78417b0fc5a7f248a2c07cb
diff --git a/src/main/java/net/kuujo/vertigo/DefaultVertigo.java b/src/main/java/net/kuujo/vertigo/DefaultVertigo.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/kuujo/vertigo/DefaultVertigo.java +++ b/src/main/java/net/kuujo/vertigo/DefaultVertigo.java @@ -54,6 +54,11 @@ public class DefaultVertigo implements Vertigo { } @Override + public Network createNetwork(String address) { + return new Network(address); + } + + @Override public BasicFeeder createFeeder() { return new DefaultBasicFeeder(vertx, container, context); } diff --git a/src/main/java/net/kuujo/vertigo/Vertigo.java b/src/main/java/net/kuujo/vertigo/Vertigo.java index <HASH>..<HASH> 100644 --- a/src/main/java/net/kuujo/vertigo/Vertigo.java +++ b/src/main/java/net/kuujo/vertigo/Vertigo.java @@ -41,6 +41,16 @@ public interface Vertigo { public void setContext(WorkerContext context); /** + * Creates a network. + * + * @param address + * The network address. + * @return + * A new network instance. + */ + public Network createNetwork(String address); + + /** * Creates a feeder. * * @return
Add createNetwork() method to Vertigo interface.
kuujo_vertigo
train
java,java
8f7468ff3a8bb8f28cf35ad935146449d1c57d98
diff --git a/lib/gir_ffi/arg_helper.rb b/lib/gir_ffi/arg_helper.rb index <HASH>..<HASH> 100644 --- a/lib/gir_ffi/arg_helper.rb +++ b/lib/gir_ffi/arg_helper.rb @@ -153,12 +153,15 @@ module GirFFI end setup_type_outptr_handler_for SIMPLE_G_TYPES - setup_type_outptr_handler_for :pointer def self.gboolean_outptr gboolean_pointer.put_int 0, 0 end + def self.pointer_outptr + pointer_pointer.put_pointer 0, nil + end + def self.utf8_outptr pointer_outptr end
Special-case pointer_outptr, since JRuby doesn't accept 0 as a pointer.
mvz_gir_ffi
train
rb
52d953814b8ab60b084605400e7f0a7b1d9ac147
diff --git a/tweepy/parsers.py b/tweepy/parsers.py index <HASH>..<HASH> 100644 --- a/tweepy/parsers.py +++ b/tweepy/parsers.py @@ -30,7 +30,7 @@ class JSONParser(Parser): except Exception, e: raise TweepError('Failed to parse JSON payload: %s' % e) - if payload_list and isinstance(json, dict): + if isinstance(json, dict) and 'previous_cursor' in json and 'next_cursor' in json: cursors = json['previous_cursor'], json['next_cursor'] return json, cursors else:
Fix API.search() by patching a bug in parsers.
tweepy_tweepy
train
py
e55c82cab5acca1293ecd24e91a4ed25a812c9cd
diff --git a/webpack/config.js b/webpack/config.js index <HASH>..<HASH> 100644 --- a/webpack/config.js +++ b/webpack/config.js @@ -18,6 +18,7 @@ module.exports = env => { }), new HtmlWebpackPlugin({ template: 'src/index.html', + excludeChunks: ['polyfills'], minify: { removeComments: true, collapseWhitespace: true, @@ -49,9 +50,6 @@ module.exports = env => { if (isProd) { plugins = [...plugins, - // new webpack.optimize.CommonsChunkPlugin({ - // name: 'common' - // }), new webpack.optimize.UglifyJsPlugin({ compress: { screw_ie8: true,
exclude polyfills chunk so its not loaded twice
kambi-sportsbook-widgets_widget-build-tools
train
js
69269cab371cd4ad3b5ad3fe89a5853081e65529
diff --git a/src/Validator.php b/src/Validator.php index <HASH>..<HASH> 100644 --- a/src/Validator.php +++ b/src/Validator.php @@ -43,6 +43,11 @@ class Validator return $this->validateEmptyValue($widget); } + // Validate multiple files if input is an array (could be the case e.g. when terminal42/contao-mp_forms extension is used) + if (is_array($input)) { + return $this->validateMultipleFiles($widget, array_filter($input)); + } + // Single file if (false === strpos($input, ',')) { return $this->validateSingleFile($widget, $input);
Fix a potential problem with extensions such as terminal<I>/contao-mp_forms which may pass an array instead of string to widget validator
terminal42_contao-fineuploader
train
php
093330906957b17a0cf93ec25d31c63f44fb2fb3
diff --git a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php b/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php +++ b/src/Illuminate/Database/Eloquent/Concerns/HasRelationships.php @@ -682,7 +682,7 @@ trait HasRelationships */ public function touches($relation) { - return in_array($relation, $this->touches); + return in_array($relation, $this->getTouchedRelations()); } /** @@ -692,7 +692,7 @@ trait HasRelationships */ public function touchOwners() { - foreach ($this->touches as $relation) { + foreach ($this->getTouchedRelations() as $relation) { $this->$relation()->touch(); if ($this->$relation instanceof self) {
use getTouchedRelations when touching owners (#<I>) This allows overriding getTouchedRelations
laravel_framework
train
php
aa17277adfea69390350f6e94ed64dde91b813e5
diff --git a/modules/openidProvider/lib/Server.php b/modules/openidProvider/lib/Server.php index <HASH>..<HASH> 100644 --- a/modules/openidProvider/lib/Server.php +++ b/modules/openidProvider/lib/Server.php @@ -73,7 +73,6 @@ class sspmod_openidProvider_Server { $this->authSource = new SimpleSAML_Auth_Simple($config->getString('auth')); $this->usernameAttribute = $config->getString('username_attribute'); - $this->delegationPrefix = $config->getString('delegation_prefix'); SimpleSAML_Utilities::maskErrors(E_WARNING | E_STRICT); try {
openidProvider: Remove delegation_prefix option which is unused.
simplesamlphp_saml2
train
php
0eeea36deeff63ece83dbcc2ee37a28b96645542
diff --git a/raven/contrib/celery/__init__.py b/raven/contrib/celery/__init__.py index <HASH>..<HASH> 100644 --- a/raven/contrib/celery/__init__.py +++ b/raven/contrib/celery/__init__.py @@ -33,10 +33,7 @@ class CeleryClient(CeleryMixin, Client): class CeleryFilter(logging.Filter): def filter(self, record): # Context is fixed in Celery 3.x so use internal flag ignstead - keep_record = getattr(record, 'internal', - record.funcName != '_log_error') - - return keep_record + return getattr(record, 'internal', record.funcName != '_log_error') def register_signal(client):
Just make it return in CeleryFilter
getsentry_raven-python
train
py
a19023b3127d9753cc7eb57eead155fd4d2bc5a9
diff --git a/classes/Kohana/Jam/Meta.php b/classes/Kohana/Jam/Meta.php index <HASH>..<HASH> 100755 --- a/classes/Kohana/Jam/Meta.php +++ b/classes/Kohana/Jam/Meta.php @@ -350,7 +350,7 @@ abstract class Kohana_Jam_Meta { if (is_array($value)) { // Set key's value - $this->{'_'.$key} += $value; + $this->{'_'.$key} = array_merge($this->{'_'.$key}, $value); } return $this;
Correctly merge behaviors when overriding in STI models
OpenBuildings_jam
train
php
0c329cbe2281b47dd35349c8a360dfdcfc85f31d
diff --git a/tryp/list.py b/tryp/list.py index <HASH>..<HASH> 100644 --- a/tryp/list.py +++ b/tryp/list.py @@ -33,6 +33,12 @@ class List(typing.List[A], Generic[A], Implicits, implicits=True): def __init__(self, *elements): typing.List.__init__(self, elements) + def __getitem__(self, arg): + if isinstance(arg, slice): + return List.wrap(super().__getitem__(arg)) + else: + return super().__getitem__(arg) + @staticmethod def wrap(l: Iterable[B]) -> 'List[B]': return List(*l)
List.__getitem__ that rewraps slices
tek_amino
train
py
b3ea8a3bd1805e6336e7311c5f4c22fd8d486ca2
diff --git a/resolwe/flow/executors/docker/run.py b/resolwe/flow/executors/docker/run.py index <HASH>..<HASH> 100644 --- a/resolwe/flow/executors/docker/run.py +++ b/resolwe/flow/executors/docker/run.py @@ -201,6 +201,7 @@ class FlowExecutor(LocalFlowExecutor): # (https://github.com/PyCQA/pylint/issues/1469). self.proc = await subprocess.create_subprocess_exec( # pylint: disable=no-member *shlex.split(docker_command), + limit=4 * (2 ** 20), # 4MB buffer size for line buffering stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
Increase stdout buffer size in the Docker executor
genialis_resolwe
train
py
d60d4a347b96f3771e8cdfb4ab7a3c2d579dbc74
diff --git a/conn_test.go b/conn_test.go index <HASH>..<HASH> 100644 --- a/conn_test.go +++ b/conn_test.go @@ -570,6 +570,7 @@ func TestQueryTimeoutClose(t *testing.T) { } func TestExecPanic(t *testing.T) { + t.Skip("test can cause unrelated failures, skipping until it can be fixed.") srv := NewTestServer(t, defaultProto) defer srv.Stop()
skip the exec test as it is flaky once the issue is fixed
gocql_gocql
train
go
52531ce2126e04c58c9b2047606215d1df89e291
diff --git a/spyder_kernels/customize/spydercustomize.py b/spyder_kernels/customize/spydercustomize.py index <HASH>..<HASH> 100644 --- a/spyder_kernels/customize/spydercustomize.py +++ b/spyder_kernels/customize/spydercustomize.py @@ -715,10 +715,12 @@ builtins.cell_count = cell_count # ============================================================================= -# Restoring original PYTHONPATH +# Extend sys.path with paths that come from Spyder # ============================================================================= -try: - os.environ['PYTHONPATH'] = os.environ['OLD_PYTHONPATH'] - del os.environ['OLD_PYTHONPATH'] -except KeyError: - pass +def set_spyder_pythonpath(): + pypath = os.environ.get('SPY_PYTHONPATH') + if pypath: + pathlist = pypath.split(os.pathsep) + sys.path.extend(pathlist) + +set_spyder_pythonpath()
Extend sys.path with paths that come from Spyder Note: See how SPY_PYTHONPATH is declared in Spyder's kernelspec
spyder-ide_spyder-kernels
train
py
956acd42ad3b363154be6638a29a6c38723c4cfe
diff --git a/wallace/models.py b/wallace/models.py index <HASH>..<HASH> 100644 --- a/wallace/models.py +++ b/wallace/models.py @@ -812,10 +812,17 @@ class Network(Base): return all_transformations else: return [t for t in all_transformations if t.node.status == node_status] + + def latest_transmission_recipient(self, status="alive"): + """ + Get the node of the given status that most recently received a transmission. + + status can be "all", "alive" (default), "dead" or "failed". + """ received_transmissions = reversed(self.transmissions(state="received")) return next( (t.destination for t in received_transmissions - if (t.destination.status != "failed")), + if (t.destination.status == status)), None) def vectors(self, status="alive"):
Network: bulk up latest_transmission_recipient
berkeley-cocosci_Wallace
train
py
668894f14fee92e7490755488a088f45b490139c
diff --git a/index.php b/index.php index <HASH>..<HASH> 100644 --- a/index.php +++ b/index.php @@ -312,6 +312,7 @@ $access = accessType( $uri, eZSys::indexFile() ); $access = changeAccess( $access ); eZDebugSetting::writeDebug( 'kernel-siteaccess', $access, 'current siteaccess' ); +$GLOBALS['eZCurrentAccess'] =& $access; $check = eZHandlePreChecks( $siteBasics ); include_once( 'kernel/common/i18n.php' );
- Current siteaccess is set as global variable. git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/trunk@<I> a<I>eee8c-daba-<I>-acae-fa<I>f<I>
ezsystems_ezpublish-legacy
train
php
758038d6e39d9585d11085510a3b2a79013b7532
diff --git a/lib/Widget/Db.php b/lib/Widget/Db.php index <HASH>..<HASH> 100644 --- a/lib/Widget/Db.php +++ b/lib/Widget/Db.php @@ -195,11 +195,11 @@ class Db extends Base protected $global = false; /** - * The last executed SQL query + * All executed SQL queries * - * @var string + * @var array */ - protected $lastSql; + protected $queries = array(); /** * Constructor @@ -469,7 +469,7 @@ class Db extends Base public function query($sql, $params = array(), $types = array(), $returnRows = false) { $this->connect(); - $this->lastSql = $sql; + $this->queries[] = $sql; if ($this->beforeQuery) { call_user_func_array($this->beforeQuery, array($sql, $params, $types, $this)); } @@ -804,7 +804,17 @@ class Db extends Base */ public function getLastSql() { - return $this->lastSql; + return end($this->queries); + } + + /** + * Returns all executed SQL queries + * + * @return array + */ + public function getQueries() + { + return $this->queries; } /**
added getQueries for db widget
twinh_wei
train
php
0f10b325230d3ec9e556d56b21e21b6cb939afb4
diff --git a/spec/unit/validations_spec.rb b/spec/unit/validations_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/validations_spec.rb +++ b/spec/unit/validations_spec.rb @@ -27,7 +27,7 @@ describe "Validations" do doc = @document.new doc.password = 'foobar' doc.password_confirmation = 'foobar1' - doc.should have_error_on(:password).or(:password_confirmation) + doc.should have_error_on(:password).or(have_error_on(:password_confirmation)) doc.password_confirmation = 'foobar' doc.should_not have_error_on(:password) @@ -320,7 +320,7 @@ describe "Validations" do doc = @embedded_doc.new doc.password = 'foobar' doc.password_confirmation = 'foobar1' - doc.should have_error_on(:password).or(:password_confirmation) + doc.should have_error_on(:password).or(have_error_on(:password_confirmation)) doc.password_confirmation = 'foobar' doc.should_not have_error_on(:password) end
Fixing failing tests for rails 4
mongomapper_mongomapper
train
rb
26be19769aaf89041eab7008fcb948678f3baf33
diff --git a/tasks/jasmine.js b/tasks/jasmine.js index <HASH>..<HASH> 100644 --- a/tasks/jasmine.js +++ b/tasks/jasmine.js @@ -199,6 +199,13 @@ module.exports = function(grunt) { grunt.log.warn(error.stack); }); + page.on('console', (msg) => { + thisRun.cleanConsole = false; + if (options.display === 'full') { + grunt.log.writeln('\n' + chalk.yellow('log: ' + msg.text())); + } + }); + await page.exposeFunction('jasmine.jasmineStarted', function() { grunt.verbose.writeln('Jasmine Runner Starting...'); thisRun.startTime = (new Date()).getTime();
Pass through console output from puppeteer
gruntjs_grunt-contrib-jasmine
train
js
01d183fc30fe169245ee1614ccf21ab0cd3ecb54
diff --git a/statsd/connection.py b/statsd/connection.py index <HASH>..<HASH> 100644 --- a/statsd/connection.py +++ b/statsd/connection.py @@ -54,8 +54,10 @@ class Connection(object): for stat, value in sampled_data.iteritems(): send_data = '%s:%s' % (stat, value) self.udp_sock.sendto(send_data, (self._host, self._port)) + return True except Exception, e: self.logger.exception('unexpected error %r while sending data', e) + return False def __repr__(self): return '<%s[%s:%d] P(%.1f)>' % (
Although we are not failing hard with all graphite calls, we should at least be able to know if the call was successful or not
WoLpH_python-statsd
train
py
93f6fe91adca53f3dcfa324a6a2a716dd53457af
diff --git a/Document.php b/Document.php index <HASH>..<HASH> 100644 --- a/Document.php +++ b/Document.php @@ -23,12 +23,12 @@ class Document implements DocumentInterface /** * @var IRI The document's IRI */ - private $iri = null; + protected $iri = null; /** * @var GraphInterface The default graph */ - private $defaultGraph = null; + protected $defaultGraph = null; /** * @var array An associative array holding all named graphs in the document
Set visibility of Document::$iri and Document::$defaultGraph to protected
lanthaler_JsonLD
train
php
cda35d763ac96496bdd34de350aaf611aa5fb075
diff --git a/lib/jade-pug/system-compiler.rb b/lib/jade-pug/system-compiler.rb index <HASH>..<HASH> 100644 --- a/lib/jade-pug/system-compiler.rb +++ b/lib/jade-pug/system-compiler.rb @@ -34,7 +34,7 @@ module JadePug # Checks if executable exists in $PATH. # # The method of check is described in this Stack Overflow answer: - # {https://stackoverflow.com/a/3931779/2369428} + # {https://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script} # # @raise {Jade::ExecutableError, Pug::ExecutableError} # If no executable found in the system. @@ -42,7 +42,7 @@ module JadePug def check_executable! return if @executable_checked - stdout, stderr, exit_status = Open3.capture3("type", executable) + stdout, stderr, exit_status = Open3.capture3("which", executable) if exit_status.success? @executable_checked = true
Use "which" to test presence of executable
yivo_pug-ruby
train
rb
3cafaac9b2a4993d0a7173047dc3c12e17de235f
diff --git a/packages/mendel-config/config.js b/packages/mendel-config/config.js index <HASH>..<HASH> 100644 --- a/packages/mendel-config/config.js +++ b/packages/mendel-config/config.js @@ -49,7 +49,7 @@ module.exports = function(config) { bundle.outfile = bundle.outfile || bundleName + '.js'; return bundle; - }); + }).filter(Boolean); // single bundles and fallback if (config.outfile) {
Allow disabling of bundles per environment Bundles that evaluate to "falsy" values will not be included in the config. This toghether with environment support allows disabling bundle per environment: ```.mendelrc bundles: main: entries: [ 'main.js' ] main_with_instrumentation: entries: [ 'instrument.js', 'main.js' ] env: development: bundles: main_with_instrumentation: false ```
yahoo_mendel
train
js
34826ca90e2e85b61e37a798cac1703d25d2c587
diff --git a/spec/punit/on_spec.rb b/spec/punit/on_spec.rb index <HASH>..<HASH> 100644 --- a/spec/punit/on_spec.rb +++ b/spec/punit/on_spec.rb @@ -84,7 +84,24 @@ describe 'Flor punit' do expect(r['vars']['l']).to eq(%w[ in red-zero out red-one ]) end - it 'traps multiple signals' + it 'traps multiple signals' do + + r = @unit.launch( + %q{ + set l [] + push l 'in' + on [ 'red' 'blue' ] + push l sig + signal 'red' + signal 'green' + signal 'blue' + push l 'out' + }, + wait: true) + + expect(r['point']).to eq('terminated') + expect(r['vars']['l']).to eq(%w[ in red out blue ]) + end end end
Add spec for "on" and array of signal names
floraison_flor
train
rb
ecd633f6135aef8cb9fd3c45dfdb5cd04f8acc81
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ setup( 'matplotlib', ], extras_require={ - ':python_version<="3.4"': ['typing'], + ':python_version<="3.4"': ['typing', 'pandas<0.21.0'], 'dev': [ 'coverage', 'mypy',
Restrict pandas version in Python <I>
satellogic_telluric
train
py
d5372698e112ecc156c7763a9108ea2a975af898
diff --git a/src/components/fieldComponents/ArrayContainer.js b/src/components/fieldComponents/ArrayContainer.js index <HASH>..<HASH> 100644 --- a/src/components/fieldComponents/ArrayContainer.js +++ b/src/components/fieldComponents/ArrayContainer.js @@ -81,7 +81,7 @@ class ArrayContainer extends Component { return ( <div className="add-bar"> <span> - <GlyphButton glyph="plus" text={text} bsSize="small" onClick={ this.handleAdd }/> + <GlyphButton glyph="plus" text={text} bsSize="small" onClick={this.handleAdd}/> </span> </div> );
Start es6-refactor: - Minimal diffs.
redux-autoform_redux-autoform
train
js
8d5fc90f10366375c91f12a4b03f1f3abbbd43d9
diff --git a/shared/common-adapters/safe-area-view.native.js b/shared/common-adapters/safe-area-view.native.js index <HASH>..<HASH> 100644 --- a/shared/common-adapters/safe-area-view.native.js +++ b/shared/common-adapters/safe-area-view.native.js @@ -1,6 +1,6 @@ // @flow import * as React from 'react' -import {SafeAreaView, View} from 'react-native' +import {SafeAreaView, View, StatusBar} from 'react-native' import * as Styles from '../styles' // Android doesn't have an implementation for SafeAreaView, so add a special case for handling the top of the screen @@ -19,8 +19,8 @@ const styles = Styles.styleSheetCreate({ androidTopSafeArea: { backgroundColor: Styles.globalColors.white, flexShrink: 0, - minHeight: 25, - paddingTop: 25, + minHeight: StatusBar.currentHeight, + paddingTop: StatusBar.currentHeight, }, topSafeArea: {backgroundColor: Styles.globalColors.white, flexGrow: 0}, })
cherry pick notch fix into master (#<I>)
keybase_client
train
js
51bd5a5c4c55bf6227af386cb097e5d771ffc34a
diff --git a/spec/unit/persistence/active_record_persistence_spec.rb b/spec/unit/persistence/active_record_persistence_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/persistence/active_record_persistence_spec.rb +++ b/spec/unit/persistence/active_record_persistence_spec.rb @@ -257,6 +257,7 @@ describe "instance methods" do end +unless ActiveRecord.version.to_s >= '4.2' # won't work with Rails >= 4.2 describe "direct state column access" do it "accepts false states" do f = FalseState.create! @@ -266,6 +267,7 @@ describe "direct state column access" do }.to_not raise_error end end +end describe 'subclasses' do it "should have the same states as its parent class" do
this won't work with Rails >= <I>
aasm_aasm
train
rb
71b81f4adbffd539a4737379b3c6407a0bb31c4a
diff --git a/environs/maas/environ.go b/environs/maas/environ.go index <HASH>..<HASH> 100644 --- a/environs/maas/environ.go +++ b/environs/maas/environ.go @@ -384,7 +384,8 @@ func (environ *maasEnviron) obtainNode(machineId string, stateInfo *state.Info, // StartInstance is specified in the Environ interface. func (environ *maasEnviron) StartInstance(machineID, machineNonce string, series string, cons constraints.Value, stateInfo *state.Info, apiInfo *api.Info) (environs.Instance, error) { - // TODO: Support series. It was added to the interface after we implemented. + // TODO: Support series and constraints. They were added to the + // interface after we implemented. flags := environs.HighestVersion | environs.CompatVersion var err error tools, err := environs.FindTools(environ, version.Current, flags)
Review suggestion: note that we don't support constraints yet either.
juju_juju
train
go
2db12fe9fb735454a807121b19169b3894073c7d
diff --git a/Drop-In/src/main/java/com/braintreepayments/api/BraintreePaymentActivity.java b/Drop-In/src/main/java/com/braintreepayments/api/BraintreePaymentActivity.java index <HASH>..<HASH> 100644 --- a/Drop-In/src/main/java/com/braintreepayments/api/BraintreePaymentActivity.java +++ b/Drop-In/src/main/java/com/braintreepayments/api/BraintreePaymentActivity.java @@ -205,6 +205,7 @@ public class BraintreePaymentActivity extends Activity implements resultCode, data); } else if (resultCode != RESULT_OK) { showAddPaymentMethodView(); + mAddPaymentMethodViewController.endSubmit(); } }
Enable back button after a failure is returned
braintree_braintree_android
train
java
b93e7e8773c585ce6b5fb761591b6c12ba039ac9
diff --git a/devices.js b/devices.js index <HASH>..<HASH> 100755 --- a/devices.js +++ b/devices.js @@ -1367,7 +1367,7 @@ const devices = [ meta: {configureKey: 1, multiEndpoint: true}, configure: async (device, coordinatorEndpoint) => { await bind(device.getEndpoint(1), coordinatorEndpoint, ['genOnOff']); - await bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']); + if (device.getEndpoint(2)) await bind(device.getEndpoint(2), coordinatorEndpoint, ['genOnOff']); }, endpoint: (device) => { // Endpoint selection is made in tuya_switch_state
Fix configure failing for TS<I>_switch_2_gang. #<I>
Koenkk_zigbee-shepherd-converters
train
js
d03043b9c01a8c62790966079b5e6055e29fd6b8
diff --git a/lib/cacheable_flash.rb b/lib/cacheable_flash.rb index <HASH>..<HASH> 100644 --- a/lib/cacheable_flash.rb +++ b/lib/cacheable_flash.rb @@ -2,7 +2,7 @@ require 'json' require 'stackable_flash' module CacheableFlash - if defined?(Rails) && ::Rails::VERSION::MAJOR >= 3 + if defined?(Rails) && (::Rails::VERSION::MAJOR == 3 || ::Rails.VERSION::MAJOR > 3) require 'cacheable_flash/middleware' # Since rails 3.0 doesn't have engine support
Fix to sharply greater than version three
pboling_cacheable-flash
train
rb
5e5cb5780d98eccdac4ac562cdd86e55c2d06886
diff --git a/lib/graphql/models/definition_helpers/associations.rb b/lib/graphql/models/definition_helpers/associations.rb index <HASH>..<HASH> 100644 --- a/lib/graphql/models/definition_helpers/associations.rb +++ b/lib/graphql/models/definition_helpers/associations.rb @@ -41,7 +41,7 @@ module GraphQL graph_types = valid_types.map { |t| GraphQL::Models.get_graphql_type(t) }.compact GraphQL::UnionType.define do - name "#{model_type.name}#{reflection.foreign_type.classify}" + name "#{model_type.name.demodulize}#{reflection.foreign_type.classify}" description "Objects that can be used as #{reflection.foreign_type.titleize.downcase} on #{model_type.name.titleize.downcase}" possible_types graph_types end
Use `name.demodulize` for model_type (#<I>) As name can consist `::` and it fails with GraphQL introspection query.
goco-inc_graphql-activerecord
train
rb
c6bc5566273b105921beb3bff3d93c64450cbaee
diff --git a/src/Controller/DblistItemsController.php b/src/Controller/DblistItemsController.php index <HASH>..<HASH> 100644 --- a/src/Controller/DblistItemsController.php +++ b/src/Controller/DblistItemsController.php @@ -118,6 +118,7 @@ class DblistItemsController extends AppController $moveActions = ['up', 'down']; if (!in_array($action, $moveActions)) { $this->Flash->error(__d('CsvMigrations', 'Unknown move action.')); + return $this->redirect($this->referer()); } $node = $this->DblistItems->get($id);
Fixed CS (task #<I>)
QoboLtd_cakephp-csv-migrations
train
php
d1e27594eac45e0517ec258368e0f56d5d102773
diff --git a/lib/russian_roulette/core.rb b/lib/russian_roulette/core.rb index <HASH>..<HASH> 100644 --- a/lib/russian_roulette/core.rb +++ b/lib/russian_roulette/core.rb @@ -1,7 +1,7 @@ module RussianRoulette class Core def initialize(talkers) - @talkers = talkers + @talkers = talkers.dup @talkers.shuffle! end diff --git a/spec/russian_roulette/core_spec.rb b/spec/russian_roulette/core_spec.rb index <HASH>..<HASH> 100644 --- a/spec/russian_roulette/core_spec.rb +++ b/spec/russian_roulette/core_spec.rb @@ -7,7 +7,7 @@ describe RussianRoulette::Core do context 'talks has not been finished' do let(:talkers) { ['小栗虫太郎', '夢野久作', '塔晶夫'] } - it { is_expected.to be } + it { is_expected.to match Regexp.union(talkers) } end context 'talks has been finished' do
affect an argument object is bad design :bomb:
koic_azuma
train
rb,rb
fa7b5d86e6346d3bdafd5afc250de8e40ea0520c
diff --git a/pkg/registry/core/service/storage/rest.go b/pkg/registry/core/service/storage/rest.go index <HASH>..<HASH> 100644 --- a/pkg/registry/core/service/storage/rest.go +++ b/pkg/registry/core/service/storage/rest.go @@ -882,12 +882,6 @@ func isMatchingPreferDualStackClusterIPFields(oldService, service *api.Service) return false } - if oldService.Spec.Type != api.ServiceTypeClusterIP && - oldService.Spec.Type != api.ServiceTypeNodePort && - oldService.Spec.Type != api.ServiceTypeLoadBalancer { - return false - } - // both must be of IPFamilyPolicy==PreferDualStack if service.Spec.IPFamilyPolicy != nil && *(service.Spec.IPFamilyPolicy) != api.IPFamilyPolicyPreferDualStack { return false
remove duplicate validation on services The rest api for services was validating that, on updates, both the old and new service have the same type. That guarantees that the type is going to be the same after that, thus we don't need to validate the service type on the old and the new service.
kubernetes_kubernetes
train
go
cf09b3b9a08e8db291414eb9bd2c31137b20d455
diff --git a/master/buildbot/status/mail.py b/master/buildbot/status/mail.py index <HASH>..<HASH> 100644 --- a/master/buildbot/status/mail.py +++ b/master/buildbot/status/mail.py @@ -258,7 +258,8 @@ class MailNotifier(base.StatusReceiverMultiService): assert isinstance(extraRecipients, (list, tuple)) for r in extraRecipients: assert isinstance(r, str) - assert VALID_EMAIL.search(r) # require full email addresses, not User names + # require full email addresses, not User names + assert VALID_EMAIL.search(r), "%s is not a valid email" % r self.extraRecipients = extraRecipients self.sendToInterestedUsers = sendToInterestedUsers self.fromaddr = fromaddr
mail status: display invalid emails on logs Helps debug why assertion on them fails.
buildbot_buildbot
train
py
56f730906c1a7d43b5061e881cec7b6ddd90bb5e
diff --git a/lib/poise_languages/utils/which.rb b/lib/poise_languages/utils/which.rb index <HASH>..<HASH> 100644 --- a/lib/poise_languages/utils/which.rb +++ b/lib/poise_languages/utils/which.rb @@ -33,7 +33,7 @@ module PoiseLanguages # @return [String, false] def which(cmd, extra_path: %w{/bin /usr/bin /sbin /usr/sbin}, path: nil) # If it was already absolute, just return that. - return cmd if cmd =~ /^(\/|(\w:)\\)/ + return cmd if cmd =~ /^(\/|([a-z]:)\\)/i # Allow passing something other than the real env var. path ||= ENV['PATH'] # Based on Chef::Mixin::Which#which
Be slightly less lazy because @rmg made me feel bad :)
poise_poise-languages
train
rb
d3ba23e582293235b81ef552249b228744716abc
diff --git a/core/src/main/java/io/undertow/UndertowMessages.java b/core/src/main/java/io/undertow/UndertowMessages.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/io/undertow/UndertowMessages.java +++ b/core/src/main/java/io/undertow/UndertowMessages.java @@ -605,6 +605,6 @@ public interface UndertowMessages { @Message(id = 194, value = "Character decoding failed. Parameter with name [%s] has been ignored. Note: further occurrences of Parameter errors will be logged at DEBUG level.") String failedToDecodeParameterName(String parameter, @Cause Exception e); - @Message(id = 195, value = "Session with id %s already exists") + @Message(id = 196, value = "Session with id %s already exists") IllegalStateException sessionWithIdAlreadyExists(String sessionID); }
Change message ID due to conflict with <I> branch
undertow-io_undertow
train
java
4ef9a617ef51846410bf6a62c62f8da7a1f5e366
diff --git a/mot/optimize/__init__.py b/mot/optimize/__init__.py index <HASH>..<HASH> 100644 --- a/mot/optimize/__init__.py +++ b/mot/optimize/__init__.py @@ -118,7 +118,7 @@ def get_minimizer_options(method): elif method == 'Subplex': return {'patience': 10, 'patience_nmsimplex': 100, - 'alpha': 1.0, 'beta': 0.5, 'gamma': 2.0, 'delta': 0.5, 'scale': 1.0, 'psi': 0.001, 'omega': 0.01, + 'alpha': 1.0, 'beta': 0.5, 'gamma': 2.0, 'delta': 0.5, 'scale': 1.0, 'psi': 0.0001, 'omega': 0.01, 'adaptive_scales': True, 'min_subspace_length': 'auto', 'max_subspace_length': 'auto'}
Improved the default settings of the Subplex optimizer
cbclab_MOT
train
py
d87459756e368b4c61a35808078373a58fcadc5a
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index <HASH>..<HASH> 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -3659,7 +3659,7 @@ class Cmd(cmd.Cmd): # Check if all commands ran if commands_run < len(history): warning = "Command {} triggered a stop and ended transcript generation early".format(commands_run) - self.perror(ansi.style_warning(warning)) + self.perror(ansi.style_warning(warning), apply_style=False) # finally, we can write the transcript out to the file try: @@ -3748,6 +3748,13 @@ class Cmd(cmd.Cmd): self.perror("'{}' is not an ASCII or UTF-8 encoded text file".format(expanded_path)) return + if expanded_path.endswith('.py') or expanded_path.endswith('.pyc'): + self.perror(ansi.style_warning("'{}' appears to be a Python file".format(expanded_path)), + apply_style=False) + selection = self.select('Yes No', 'Continue to try to run it as a text file script? ') + if selection != 'Yes': + return + try: # Read all lines of the script with open(expanded_path, encoding='utf-8') as target:
Print warning if a user tries to run a *.py file with run_script and ask them if they want to continue
python-cmd2_cmd2
train
py
7c7be1d45a658a9ab3e01601356671faed030e31
diff --git a/public/js/bumble.js b/public/js/bumble.js index <HASH>..<HASH> 100644 --- a/public/js/bumble.js +++ b/public/js/bumble.js @@ -114,10 +114,10 @@ $(document).on('click', function(e) { BooleanField Toggles */ -elem = document.querySelector('._switch'); +var elems = Array.prototype.slice.call(document.querySelectorAll('._switch')); -init = new Switchery(elem, { - secondaryColor: "#DB5554" +elems.forEach(function(html) { + var switchery = new Switchery(html, {secondaryColor: "#DB5554"}); });
Update Switchery to show multiple on a page
monarkee_bumble
train
js
946811bfd8e8cf3c4f490413035d474720e93f4f
diff --git a/pyes/highlight.py b/pyes/highlight.py index <HASH>..<HASH> 100644 --- a/pyes/highlight.py +++ b/pyes/highlight.py @@ -19,7 +19,7 @@ class HighLighter: data = {} if fragment_size: data['fragment_size'] = fragment_size - if number_of_fragments: + if number_of_fragments is not None: data['number_of_fragments'] = number_of_fragments self.fields[name] = data
Added possibility to not specify the number_of_fragments in highlight. thx to Univ
aparo_pyes
train
py
b1ab05c84fe76266c4cd82c9f75570f391f6787b
diff --git a/server/rpc_string_parser.php b/server/rpc_string_parser.php index <HASH>..<HASH> 100644 --- a/server/rpc_string_parser.php +++ b/server/rpc_string_parser.php @@ -117,9 +117,7 @@ class rpc_string_parser $pos++; $argstring = substr($token, $pos, $length - $pos - 1); - $unescaped = str_replace( - ["%28", "%29", "%3F", "%23", "%5C"], - ["(", ")", "?", "#", "\\"], $argstring); + $unescaped = rawurldecode($argstring); $args = json_decode("[$unescaped]"); if ($args === null && strlen($unescaped) > 0) diff --git a/subsystem/api.js b/subsystem/api.js index <HASH>..<HASH> 100644 --- a/subsystem/api.js +++ b/subsystem/api.js @@ -151,7 +151,7 @@ phoxy._.api = return str.replace(regexp, function(matched) { - return escape(escape(matched)); + return escape(matched); }); }
Using single urlencode to masking special symbols
phoxy_phoxy
train
php,js
c5cc29fcf8366b9447d78a13e3b9d57cb53ae4e8
diff --git a/src/python/pants/core/goals/binary.py b/src/python/pants/core/goals/binary.py index <HASH>..<HASH> 100644 --- a/src/python/pants/core/goals/binary.py +++ b/src/python/pants/core/goals/binary.py @@ -24,7 +24,6 @@ class BinaryFieldSet(FieldSet, metaclass=ABCMeta): """The fields necessary to create a binary from a target.""" -@union @dataclass(frozen=True) class CreatedBinary: digest: Digest
Remove unused union marker. (#<I>) # Delete this line to force CI to run Clippy and the Rust tests. [ci skip-rust-tests] # Delete this line to force CI to run the JVM tests. [ci skip-jvm-tests]
pantsbuild_pants
train
py
fc05ae76e50c566b61b5ac6f4838dff2eba044a8
diff --git a/lib/commands/start.js b/lib/commands/start.js index <HASH>..<HASH> 100644 --- a/lib/commands/start.js +++ b/lib/commands/start.js @@ -17,7 +17,7 @@ module.exports = function(containers, options, logger) { var container = containers[name] container.daemon = true - start(container, [], { recreate: true }, function(err) { + start(container, [], startOptions, function(err) { if (err) { fail(err) } else {
Propagate start options when “containers.startAll” is set
mnylen_pig
train
js
3ababcfa09ea1ad82a37c6814900e3506a13bf18
diff --git a/bot/api/domain.py b/bot/api/domain.py index <HASH>..<HASH> 100644 --- a/bot/api/domain.py +++ b/bot/api/domain.py @@ -119,19 +119,19 @@ class VideoNote(Message): class Audio(CaptionableMessage): @staticmethod def create_audio(file_id): - return Voice(_type=Audio, audio=file_id) + return Audio(_type=Audio, audio=file_id) class Video(CaptionableMessage): @staticmethod def create_video(file_id): - return Voice(_type=Video, video=file_id) + return Video(_type=Video, video=file_id) class Location(Message): @staticmethod def create_location(latitude, longitude): - return VideoNote(_type=Location, latitude=latitude, longitude=longitude) + return Location(_type=Location, latitude=latitude, longitude=longitude) class MessageEntityParser:
Fix typos in object instantiation
alvarogzp_telegram-bot-framework
train
py
6c189afb85b92f2f7c761da65ad7297862d8e607
diff --git a/spec/header/ike_spec.rb b/spec/header/ike_spec.rb index <HASH>..<HASH> 100644 --- a/spec/header/ike_spec.rb +++ b/spec/header/ike_spec.rb @@ -107,8 +107,7 @@ module PacketGen end it 'is parsed when first 32-bit word in UDP (port 4500) body is null' do - udp.add('IKE', non_esp_marker: 0) - udp.udp.sport = udp.udp.dport = 4500 + udp.add('NonESPMarker').add('IKE') str = udp.to_s pkt = Packet.parse(str) expect(pkt.is? 'UDP').to be(true)
Fix 'Header::IKE (parsing) is parsed when first <I>-bit word in UDP (port <I>) body is null' spec
sdaubert_packetgen
train
rb
8b02f9429b385314b6bce3153d373dff4acb5668
diff --git a/lib/accumulate-variable-arguments.js b/lib/accumulate-variable-arguments.js index <HASH>..<HASH> 100644 --- a/lib/accumulate-variable-arguments.js +++ b/lib/accumulate-variable-arguments.js @@ -2,6 +2,18 @@ var clone_array = require('./clone-array'); +/* + +Purry implementation for variable-parameter-count-functions + +Currying is not supported because a target parameter count is not defined. +Partial left/between/right application is supported. Two arrays stock arguments +respective to either side. When the function is executed the stocked arguments +are merged and applied to the wrapped function. Merging entails filling left stock +holes with right stock arguments. Any remaining right-stock arguments are simply +appending to the left-stock. +*/ + module.exports = function accumulate_variable_arguments(f, _stock_left, _is_stock_left_holey, _stock_right, _is_stock_right_holey, _l_stock_i_min, _r_stock_i_min){ return function(){ var arguments_count = arguments.length;
Add introduction to accumulate-variable-arguments
jasonkuhrt_purry
train
js
91479407e1e0dd85ab80af8a022a7fbace58df96
diff --git a/asks/request_object.py b/asks/request_object.py index <HASH>..<HASH> 100644 --- a/asks/request_object.py +++ b/asks/request_object.py @@ -670,7 +670,7 @@ class RequestProcessor: if response_obj.status_code == 401: if not self.auth.auth_attempted: self.history_objects.append(response_obj) - r = await self.make_request() + _, r = await self.make_request() self.auth.auth_attempted = False return r else:
Fix improper unwrapping of make_request results
theelous3_asks
train
py