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
5d0490a4064f7d97f2bdcac12f5ccfacf6693307
diff --git a/test/docs-owner.js b/test/docs-owner.js index <HASH>..<HASH> 100644 --- a/test/docs-owner.js +++ b/test/docs-owner.js @@ -126,6 +126,7 @@ describe('Docs - Owner', () => { .get('/docs/pizzas/{0}/archived'.format(id)) .end((err, res) => { //TODO : res.should.have.status(200); + res.should.be.json; done(); }); });
Add owner role - lint fix
campsi_campsi-service-docs
train
js
888b76d8f54f8a4d08dedfb2057646baf8587526
diff --git a/scripts/release.js b/scripts/release.js index <HASH>..<HASH> 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -23,8 +23,8 @@ function checkBranch() { } function compareWithDevelop() { - return execa.shell('git diff --name-status develop master').then((result) => { - if (result.stdout !== 'master') { + return execa.shell('git rev-list --count master..develop').then((result) => { + if (result.stdout !== '0') { throw new Error(chalk.bold.red('master branch is not up-to-date with develop branch')); } });
fix(scripts/release): fix command [skip ci]
idiotWu_smooth-scrollbar
train
js
8beffc37ad5b2737b0d50c6c3fc9a79ded110f1f
diff --git a/features/support/test_daemons/redis.rb b/features/support/test_daemons/redis.rb index <HASH>..<HASH> 100644 --- a/features/support/test_daemons/redis.rb +++ b/features/support/test_daemons/redis.rb @@ -41,6 +41,7 @@ module TestDaemons def restart(delay=1) redis.shutdown sleep delay + raise "SHUTDOWN COMMAND FAILED" if running? `redis-server #{config_filename}` end @@ -51,6 +52,7 @@ module TestDaemons # sleep 1 # end daemon_controller.stop + raise "FAILED TO STOP redis server on port #{port}" if running? ensure cleanup end
fail earlier when redis shutdown doesn't work
xing_beetle
train
rb
e200b8a7ff53780124e08d2bdefde7587e52bfca
diff --git a/salt/utils/verify.py b/salt/utils/verify.py index <HASH>..<HASH> 100644 --- a/salt/utils/verify.py +++ b/salt/utils/verify.py @@ -429,3 +429,10 @@ def clean_path(root, path, subdir=False): if os.path.dirname(path) == os.path.normpath(root): return path return '' + + +def valid_id(id_): + ''' + Returns if the passed id is valid + ''' + return bool(clean_path('/etc/pki/salt/master', id_))
Add valid_id to verify that a minion id is valid
saltstack_salt
train
py
893c6cae07ef564cbdd2796589c449dd2ac87d21
diff --git a/context.go b/context.go index <HASH>..<HASH> 100644 --- a/context.go +++ b/context.go @@ -896,19 +896,20 @@ func (c *Context) SSEvent(name string, message interface{}) { }) } -// Stream sends a streaming response. -func (c *Context) Stream(step func(w io.Writer) bool) { +// Stream sends a streaming response and returns a boolean +// indicates "Is client disconnected in middle of stream" +func (c *Context) Stream(step func(w io.Writer) bool) bool { w := c.Writer clientGone := w.CloseNotify() for { select { case <-clientGone: - return + return true default: keepOpen := step(w) w.Flush() if !keepOpen { - return + return false } } }
Added stream flag indicates if client disconnected in middle of streaming (#<I>)
gin-gonic_gin
train
go
41c7100843cb700049907b9049558ba59e8e6fbb
diff --git a/src/RTC/binding.js b/src/RTC/binding.js index <HASH>..<HASH> 100644 --- a/src/RTC/binding.js +++ b/src/RTC/binding.js @@ -1,5 +1,5 @@ 'use strict'; const path = require('path'); -const bindings = require(path.join(__dirname, '..', 'native-bidings')); +const bindings = require(path.join(__dirname, '..', 'native-bindings')); module.exports = bindings.nativeRtc;
Bugfix RTC binding.js native-bindings require
exokitxr_exokit
train
js
a5f653687481db016c984f645203cb0661488f30
diff --git a/pghoard/object_storage/google.py b/pghoard/object_storage/google.py index <HASH>..<HASH> 100644 --- a/pghoard/object_storage/google.py +++ b/pghoard/object_storage/google.py @@ -78,7 +78,12 @@ class GoogleTransfer(BaseTransfer): def _metadata_for_key(self, key): req = self.gs_objects.get(bucket=self.bucket_name, object=key) - obj = req.execute() + try: + obj = req.execute() + except HttpError as ex: + if ex.resp["status"] == "404": + raise FileNotFoundFromStorageError(key) + raise return obj.get("metadata", {}) def list_path(self, key):
google: raise FileNotFoundFromStorageError for missing key metadata requests
aiven_pghoard
train
py
be20a8156c48b48e0768894d675a5bbb22eca86e
diff --git a/test/indexSpec.js b/test/indexSpec.js index <HASH>..<HASH> 100644 --- a/test/indexSpec.js +++ b/test/indexSpec.js @@ -203,7 +203,7 @@ describe("Type conversion in pgp.as", function () { q = pgp.as.format("", 1); expect(q.success).toBe(false); - expect(q.error).toBe("No variable found in query to replace with the value passed."); + expect(q.error).toBe("No variable found in the query to replace with the passed value."); q = pgp.as.format("$1", {}); expect(q.success).toBe(false);
fixing a test for the error message.
vitaly-t_pg-promise
train
js
a6a122b5aa329ebd365abdb63b6a26f81491d887
diff --git a/lib/draper/collection_decorator.rb b/lib/draper/collection_decorator.rb index <HASH>..<HASH> 100644 --- a/lib/draper/collection_decorator.rb +++ b/lib/draper/collection_decorator.rb @@ -66,12 +66,7 @@ module Draper true end - # Checks if a given decorator has been applied to the collection. - # - # @param [Class] decorator_class - def decorated_with?(decorator_class) - self.instance_of? decorator_class - end + alias_method :decorated_with?, :instance_of? def kind_of?(klass) decorated_collection.kind_of?(klass) || super
decorated_with? is just instance_of?
drapergem_draper
train
rb
185b7c4ef266e8fb0a0eb54f9d673910c5b96c02
diff --git a/tofu/data/_spectrafit2d.py b/tofu/data/_spectrafit2d.py index <HASH>..<HASH> 100644 --- a/tofu/data/_spectrafit2d.py +++ b/tofu/data/_spectrafit2d.py @@ -448,17 +448,17 @@ def get_x0_bounds(x01d=None, dlines=None, dindx=None, bck = np.zeros((dindx['bck'].size,)) for kk in dindx['ions'].keys(): # sigma - x[] = lamb0_delta + x[:] = lamb0_delta # dlamb - x[] = 0. + x[:] = 0. # amp - x[] = ampmean + x[:] = ampmean else: x0[dindx['bck']] = x01d[dindx['bck']] i0 = dindx['bck'].size for kk in dindx['ions'].keys(): - x0[] + x0[:] = None return x0 diff --git a/tofu/version.py b/tofu/version.py index <HASH>..<HASH> 100644 --- a/tofu/version.py +++ b/tofu/version.py @@ -1,2 +1,2 @@ # Do not edit, pipeline versioning governed by git tags! -__version__ = '1.4.1-258-g96f47b6' +__version__ = '1.4.1-259-gfea848c'
[Issue<I>] Saving before switching to Jack Hare's issue #<I>
ToFuProject_tofu
train
py,py
6f2f35ba9da1f1f59d875011908384cc2fd1df67
diff --git a/stomp-client-js/src/main/javascript/stomp.js b/stomp-client-js/src/main/javascript/stomp.js index <HASH>..<HASH> 100644 --- a/stomp-client-js/src/main/javascript/stomp.js +++ b/stomp-client-js/src/main/javascript/stomp.js @@ -809,7 +809,7 @@ Stomp.Transport.HTTP.prototype = { var timeoutHandle = setTimeout( function() { if ( request.readyState != 0 && request.readyState != 4 ) { request.abort(); - errorCallack(); + errorCallback(); } }, 5000 );
Fix typo in HTTP transport error handler
projectodd_stilts
train
js
6817741aa0cffc5de5ae6729d9589758febace06
diff --git a/scripts/constants.py b/scripts/constants.py index <HASH>..<HASH> 100644 --- a/scripts/constants.py +++ b/scripts/constants.py @@ -15,10 +15,10 @@ import sys # Kubernetes branch to get the OpenAPI spec from. -KUBERNETES_BRANCH = "release-1.19" +KUBERNETES_BRANCH = "release-1.20" # client version for packaging and releasing. -CLIENT_VERSION = "19.0.0-snapshot" +CLIENT_VERSION = "20.0.0-snapshot" # Name of the release package PACKAGE_NAME = "kubernetes"
update version constants for <I>-snapshot release
kubernetes-client_python
train
py
bb50c125aa63b6a905c10f67f2e135ec9cea9f05
diff --git a/lib/tangle/directed/acyclic/graph.rb b/lib/tangle/directed/acyclic/graph.rb index <HASH>..<HASH> 100644 --- a/lib/tangle/directed/acyclic/graph.rb +++ b/lib/tangle/directed/acyclic/graph.rb @@ -1,11 +1,22 @@ require 'tangle/directed/graph' +require 'tangle/directed/acyclic/partial_order' module Tangle module Directed module Acyclic - # # A directed acyclic graph class Graph < Tangle::Directed::Graph + # Return a topological ordering of a set of vertices, or all + # vertices in the graph. + def topological_ordering(*vertices) + vertices = if vertices.empty? + self.vertices + else + get_vertices(*vertices) unless vertices.empty? + end + PartialOrder[self, vertices].sort!.map(&:vertex) + end + protected def insert_edge(edge)
Add topological ordering to DAG Create a topological ordering of the vertices in a DAG by sorting them in their partial order.
notCalle_ruby-tangle
train
rb
a78bf72c55891a889ad5f3e6d8d2a014bde8c357
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -175,7 +175,7 @@ Dovehash.encode = function(scheme, pw, salt, enc) { hash.update(pw); if (salted) { hash.update(s); } - hd = hash.digest(); + hd = new Buffer(hash.digest('base64'), 'base64'); // console.log('encode', len, buf.length, s.length, hd.length); hd.copy(buf); if (salted) {
Fixed issue with old Node crypto lib not supporting returning Buffer for hash digests
vne_dovehash
train
js
7c375c95d5de66eab4e2ab08fedb1833110665c1
diff --git a/lib/watir/rails.rb b/lib/watir/rails.rb index <HASH>..<HASH> 100644 --- a/lib/watir/rails.rb +++ b/lib/watir/rails.rb @@ -25,9 +25,10 @@ module Watir # # @param [Integer] port port for the Rails up to run on. If omitted random port will be picked. def boot(port: nil) + @port = port || find_available_port + unless running? @middleware = Middleware.new(app) - @port = port || find_available_port @server_thread = Thread.new do server.call @middleware, @port
Set the @port before actually trying to see if an existing server is running
watir_watir-rails
train
rb
1eb52b0ca3899dbe59dc09e25778e0233ecdddc4
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -269,6 +269,7 @@ const VirtualList = Vue.component('virtual-list', { if (dataSource) { if (Object.prototype.hasOwnProperty.call(dataSource, dataKey)) { slots.push(h(Item, { + key: dataSource[dataKey], props: { index, tag: itemTag,
add key for rendering items it will increase speed of VNode-Dom comparison and patch for example for list of images when new slots added to the list only these images will requested (at this moment all <I> will be requested)
tangbc_vue-virtual-scroll-list
train
js
197a714c974e749f6d6d9bd3e4a28d9154eab30a
diff --git a/assets/js/directives/storage.js b/assets/js/directives/storage.js index <HASH>..<HASH> 100644 --- a/assets/js/directives/storage.js +++ b/assets/js/directives/storage.js @@ -84,6 +84,27 @@ zaa.directive('storageFileUpload', function() { } }); +/* +zaa.directive('storageImageUrl', function() { + return { + restrict : 'E', + scope : { + image : '@' + }, + controller : function($scope, $http) { + $http.get('admin/api-admin-storage/image-path', { params: { imageId : $scope.image } }).success(function(response) { + $scope.imagesrc = response.source; + $scope.fileId = response.file_id; + }).error(function(response) { + }) + }, + template : function() { + return '<div>{{imagesrc}} {{fileId}} </div>'; + } + } +}); +*/ + zaa.directive('storageImageUpload', function() { return { restrict : 'E',
added image-display directive (testing)
luyadev_luya-module-admin
train
js
5b1141fd23e08740df13f5f26574c3e3c2c8938b
diff --git a/tests/classes/libTest.php b/tests/classes/libTest.php index <HASH>..<HASH> 100644 --- a/tests/classes/libTest.php +++ b/tests/classes/libTest.php @@ -77,19 +77,6 @@ class libTest extends \PHPUnit_Framework_TestCase $this->assertEquals($expected, $result); } - /** - * @dataProvider trimTextDataProvider - */ - public function testTrimToHTML($html, $length, $nbsp, $hellip, $striptags, $expected) - { - if ($hellip) { - $ellipseStr = '…'; - } else { - $ellipseStr = ''; - } - $actual = Html::trimToHTML($html, $length, $ellipseStr, $striptags, $nbsp); - $this->assertEquals($expected, $actual); - } public static function getExtensionDataProvider() {
Removed tests for TrimToHTML
bolt_bolt
train
php
b695f3dd21db9aac3f704d263dc1e67b9bf71701
diff --git a/ipywebrtc/_version.py b/ipywebrtc/_version.py index <HASH>..<HASH> 100644 --- a/ipywebrtc/_version.py +++ b/ipywebrtc/_version.py @@ -1,6 +1,6 @@ __version_tuple__ = (0, 4, 2) -__version_tuple_js__ = (0, 4, 1) +__version_tuple_js__ = (0, 4, 2) __version__ = '0.4.2' -__version_js__ = '0.4.1' +__version_js__ = '0.4.2' version_info = __version_tuple__ # kept for backward compatibility
Release <I> of js
maartenbreddels_ipywebrtc
train
py
69fe253da001e01eeb372bc0f8b4c8892cc5c525
diff --git a/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocbookBuilder.java b/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocbookBuilder.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocbookBuilder.java +++ b/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/DocbookBuilder.java @@ -2154,14 +2154,14 @@ public class DocbookBuilder implements ShutdownAbleApp { try { if (brandFile.exists() && brandFile.isFile()) { final String file = FileUtilities.readFileContents(brandFile); - if (file != null) { + if (!file.isEmpty()) { files.put(getBookLocaleFolder() + fileName, file.getBytes("UTF-8")); } } else { final File commonBrandFile = new File(commonBrandDir + fileName); if (commonBrandFile.exists() && commonBrandFile.isFile()) { final String file = FileUtilities.readFileContents(commonBrandFile); - if (file != null) { + if (!file.isEmpty()) { files.put(getBookLocaleFolder() + fileName, file.getBytes("UTF-8")); } }
Fixed an issue where the parser was returning an Exception when it shouldn't have been. Removed some unneccesary null checks.
pressgang-ccms_PressGangCCMSBuilder
train
java
e4578b0a637523fdef9ebc4f474c3859d59a8c8c
diff --git a/src/RegistryPage.php b/src/RegistryPage.php index <HASH>..<HASH> 100644 --- a/src/RegistryPage.php +++ b/src/RegistryPage.php @@ -18,6 +18,8 @@ class RegistryPage extends Page { private static $description = 'Shows large series of data in a filterable, searchable, and paginated list'; + private static $table_name = 'RegistryPage'; + private static $db = [ 'DataClass' => 'Varchar(100)', 'PageLength' => 'Int',
FIX Add table_name config to help upgrading go smoothly
silverstripe_silverstripe-registry
train
php
d683b0039b95fd68d6e9b0286352cc18f6ee8008
diff --git a/lib/storey/duplicator.rb b/lib/storey/duplicator.rb index <HASH>..<HASH> 100644 --- a/lib/storey/duplicator.rb +++ b/lib/storey/duplicator.rb @@ -57,19 +57,33 @@ class Storey::Duplicator ::Storey.create_plain_schema self.target_schema end - source_schema_migrations = ::Storey.switch(self.source_schema) do - ActiveRecord::Migrator.get_all_versions - end - `psql #{switches}` + copy_source_schema_migrations + + ENV['PGPASSWORD'] = nil + end + + def copy_source_schema_migrations ::Storey.switch self.target_schema do source_schema_migrations.each do |version| - ActiveRecord::Base.connection.execute "INSERT INTO schema_migrations (version) VALUES ('#{version}');" + unless target_schema_migrations.include?(version) + ActiveRecord::Base.connection.execute "INSERT INTO schema_migrations (version) VALUES ('#{version}');" + end end end + end - ENV['PGPASSWORD'] = nil + def source_schema_migrations + ::Storey.switch(self.source_schema) do + ActiveRecord::Migrator.get_all_versions + end + end + + def target_schema_migrations + ::Storey.switch(self.target_schema) do + ActiveRecord::Migrator.get_all_versions + end end def replace_occurances
Only copy source schema migrations into duplicate schema if the schema migrations do not exist #9
ramontayag_storey
train
rb
8570732bcf977d05f5dd71fefd9775576e218fea
diff --git a/validator/tests/integration/test_genesis_util.py b/validator/tests/integration/test_genesis_util.py index <HASH>..<HASH> 100644 --- a/validator/tests/integration/test_genesis_util.py +++ b/validator/tests/integration/test_genesis_util.py @@ -30,6 +30,9 @@ from txnintegration.simcontroller import get_default_sim_controller LOGGER = logging.getLogger(__name__) +DISABLE_POET1_SGX = True \ + if os.environ.get("DISABLE_POET1_SGX", False) == "1" else False + class TestGenesisUtil(unittest.TestCase): def extend_genesis_util(self, ledger_type, pre_overrides, post_overrides): @@ -112,6 +115,7 @@ class TestGenesisUtil(unittest.TestCase): } self.extend_genesis_util('poet0', pre_dict, post_dict) + @unittest.skipIf(DISABLE_POET1_SGX, 'SGX currently behind simulator') def test_poet1_genesis(self): pre_dict = { 'GenesisLedger': False,
disable SGX integration tests for poet1 SGX implementation is behind the SGX simulator implementation. Introducing a environmental variable to permit SGX systems to temporarily bypass SGX integration tests for poet1, and then leveraging this variable in our only current integration test for poet1.
hyperledger_sawtooth-core
train
py
2df785ce42e00b834d3049c75d3d054dbcff54bf
diff --git a/lib/badfruit/Movies/movies.rb b/lib/badfruit/Movies/movies.rb index <HASH>..<HASH> 100644 --- a/lib/badfruit/Movies/movies.rb +++ b/lib/badfruit/Movies/movies.rb @@ -1,17 +1,23 @@ module BadFruit class Movies MAX_PAGE_LIMIT = 50 - + def initialize(badfruit) @badfruit = badfruit end - + #returns an array of movie objects from the given search result. def search_by_name(name, page_limit=1, page=1) if page_limit > 50 page_limit = MAX_PAGE_LIMIT #current limitation of the rotten tomatos API end - return @badfruit.parse_movies_array(JSON.parse(@badfruit.search_movies(name, page_limit, page))) + + results_json = @badfruit.search_movies(name, page_limit, page) + if results_json.nil? + return [] + else + return @badfruit.parse_movies_array(JSON.parse(results_json)) + end end # search by id
Fixes Movies#search_by_name when no results are found search_movies returns nil for no results. JSON#parse blows up when given a nil. This protects against that and returns an empty array for no results.
brianmichel_BadFruit
train
rb
e32965dbb13973f61ba1c0496c8136cc8c9273a2
diff --git a/api/common.go b/api/common.go index <HASH>..<HASH> 100644 --- a/api/common.go +++ b/api/common.go @@ -25,6 +25,8 @@ func ValidateHost(val string) (string, error) { //TODO remove, used on < 1.5 in getContainersJSON func displayablePorts(ports *engine.Table) string { result := []string{} + ports.SetKey("PublicPort") + ports.Sort() for _, port := range ports.Data { if port.Get("IP") == "" { result = append(result, fmt.Sprintf("%d/%s", port.GetInt("PublicPort"), port.Get("Type")))
In `docker ps`, sort by port instead of unsorted. Docker-DCO-<I>-
moby_moby
train
go
5f3875bfc47e0155a2d1b6a69d183dba58587ff8
diff --git a/country_converter/country_converter.py b/country_converter/country_converter.py index <HASH>..<HASH> 100755 --- a/country_converter/country_converter.py +++ b/country_converter/country_converter.py @@ -590,7 +590,7 @@ def _parse_arg(valid_classifications): parser.add_argument('names', help=('List of countries to convert ' '(space separated, country names consisting of ' - 'multiple words must be put in quotation marks). ' + 'multiple words must be put in quotation marks).' 'Possible classifications: ' + ', '.join(valid_classifications) + '; NB: long, official and short are provided '
fixed line length for passing pep8
konstantinstadler_country_converter
train
py
72b9420fce622e781201cf3d83429388859319bd
diff --git a/src/GcpExtensionChannel.php b/src/GcpExtensionChannel.php index <HASH>..<HASH> 100644 --- a/src/GcpExtensionChannel.php +++ b/src/GcpExtensionChannel.php @@ -199,11 +199,10 @@ class GcpExtensionChannel $shutdown = 0; foreach ($this->channel_refs as $channel_ref) { $state = $channel_ref->getRealChannel($this->credentials)->getConnectivityState($try_to_connect); - print_r($state); switch ($state) { case \Grpc\CHANNEL_READY: $ready += 1; - break; + break 2; case \Grpc\CHANNEL_FATAL_FAILURE: $shutdown += 1; break;
Remove print_r and break out of loop
GoogleCloudPlatform_grpc-gcp-php
train
php
56f6409b3d4001033301f4f4b0b81816c818a4fd
diff --git a/shoebot/gtkui.py b/shoebot/gtkui.py index <HASH>..<HASH> 100644 --- a/shoebot/gtkui.py +++ b/shoebot/gtkui.py @@ -27,8 +27,14 @@ class ShoebotDrawingArea(gtk.DrawingArea): self.connect("expose_event", self.expose) # get the bot object to display self.bot = bot - script_file = self.bot.inputscript - lines = open(script_file, 'r').readlines() + + script = self.bot.inputscript + # check if the script is a file or a string + import os.path + if os.path.exists(script): + lines = open(script, 'r').readlines() + else: + lines = script.splitlines() # make a dummy surface and context, otherwise scripts without draw() # and/or setup() will bork badly
fixed regression in my last changeset, sorry
shoebot_shoebot
train
py
4cbf12915469e55c46313dca587270d5862473d3
diff --git a/tangy-list.js b/tangy-list.js index <HASH>..<HASH> 100644 --- a/tangy-list.js +++ b/tangy-list.js @@ -75,6 +75,11 @@ export class TangyList extends PolymerElement { return html` <style include="tangy-common-styles"></style> <style include="tangy-element-styles"></style> + <style> + tangy-list-item { + width: 100% + } + </style> <sortable-list id="items" style="width:100%"> </sortable-list> <paper-button on-click="onClickNewItem" style="margin-left: 15px; background: var(--accent-color); color: var(--accent-text-color);" raised class="add-another"><iron-icon icon="add-circle"></iron-icon>ADD ANOTHER</paper-button>
Ensure that items in a tangy-list stack in rows not rows and columns
Tangerine-Community_tangy-form
train
js
29cae7725b886327cd4b8a476e495045becf866c
diff --git a/lib/workers/repository/onboarding/pr/pr-list.js b/lib/workers/repository/onboarding/pr/pr-list.js index <HASH>..<HASH> 100644 --- a/lib/workers/repository/onboarding/pr/pr-list.js +++ b/lib/workers/repository/onboarding/pr/pr-list.js @@ -42,7 +42,7 @@ function getPrList(config) { if (!upgrade.isPin) { prDesc += `from \`${upgrade.currentVersion}\` `; } - prDesc += `to \`${upgrade.newVersion}\``; + prDesc += `to \`${upgrade.newVersion || upgrade.newDigest}\``; prDesc += '\n'; } }
fix: show newDigest for docker digest pinning in onboarding PR
renovatebot_renovate
train
js
a3d55751deb13cd2e41f3e98475652b7ddc954ac
diff --git a/bootstrap3/forms.py b/bootstrap3/forms.py index <HASH>..<HASH> 100644 --- a/bootstrap3/forms.py +++ b/bootstrap3/forms.py @@ -150,15 +150,18 @@ def render_field(field, layout='', form_group_class=FORM_GROUP_CLASS, content='{field} {label}'.format(field=rendered_field, label=field.label), label_title=field.help_text ) + + # Wrap the rendered field + if wrapper: + rendered_field = wrapper.format(content=rendered_field) + # Add any help text and/or errors if layout != 'inline': help_text_and_errors = [field_help] + field_errors if help_text_and_errors: help_html = ' '.join([h for h in help_text_and_errors if h]) rendered_field += '<span class=help-block>{help}</span>'.format(help=help_html) - # Wrap the rendered field - if wrapper: - rendered_field = wrapper.format(content=rendered_field) + # Prepare label label = field.label if put_inside_label:
Render help text outside the input group
dyve_django-bootstrap3
train
py
822364dc36d0f275092787a9049a5129b330e097
diff --git a/src/jquery.lazyloadxt.js b/src/jquery.lazyloadxt.js index <HASH>..<HASH> 100644 --- a/src/jquery.lazyloadxt.js +++ b/src/jquery.lazyloadxt.js @@ -41,6 +41,7 @@ visibleOnly: true }, $window = $(window), + $document = $(document), $isFunction = $.isFunction, $extend = $.extend, $data = $.data || function (el, name) { @@ -279,7 +280,7 @@ /** * Initialization */ - $(document).ready(function () { + $document.ready(function () { triggerEvent('start', $window); $window @@ -287,6 +288,8 @@ .on(options.updateEvent, queueCheckLazyElements) .on(options.forceEvent, forceLoadAll); + $document.on(options.updateEvent, queueCheckLazyElements); + if (options.autoInit) { initLazyElements(); // standard initialization }
bind to both window and document (as scroll event doesn't bubble), fix issue #3
ressio_lazy-load-xt
train
js
449194eb4792af1963a8cbaf3e171060f81c54c2
diff --git a/client/driver/rkt.go b/client/driver/rkt.go index <HASH>..<HASH> 100644 --- a/client/driver/rkt.go +++ b/client/driver/rkt.go @@ -136,6 +136,9 @@ func (d *RktDriver) Validate(config map[string]interface{}) error { "debug": &fields.FieldSchema{ Type: fields.TypeBool, }, + "volumes": &fields.FieldSchema{ + Type: fields.TypeArray, + }, }, }
Fix rkt volumes I forgot to validate the volumes field!
hashicorp_nomad
train
go
eb6de9743b7177431b837939de515901c6c3bce0
diff --git a/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/iface/StaticPane.java b/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/iface/StaticPane.java index <HASH>..<HASH> 100644 --- a/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/iface/StaticPane.java +++ b/visual/javafx/src/main/java/org/openbase/jul/visual/javafx/iface/StaticPane.java @@ -57,10 +57,14 @@ public interface StaticPane extends DefaultInitializable { @Override default void init() throws InitializationException, InterruptedException { + + // simple init via fx Application thread. if (Platform.isFxApplicationThread()) { initContent(); + return; } + // invoke on fx application thread and wait until done. final SyncObject initSync = new SyncObject("StaticPaneInitSync"); synchronized (initSync) { Platform.runLater(() -> {
Static pane bugfix: avoid double initcontent call on fx application thread.
openbase_jul
train
java
72dfbadaa9d7c1cd8bae833b885b64e4f8495873
diff --git a/lib/manageiq/smartstate/version.rb b/lib/manageiq/smartstate/version.rb index <HASH>..<HASH> 100644 --- a/lib/manageiq/smartstate/version.rb +++ b/lib/manageiq/smartstate/version.rb @@ -1,5 +1,5 @@ module ManageIQ module Smartstate - VERSION = "0.5.5".freeze + VERSION = "0.5.6".freeze end end
Bump Gem to Version <I>
ManageIQ_manageiq-smartstate
train
rb
51c71aa1cbe84a28fd31a467ad8dfd2e26bb63a6
diff --git a/lib/svtplay_dl/error.py b/lib/svtplay_dl/error.py index <HASH>..<HASH> 100644 --- a/lib/svtplay_dl/error.py +++ b/lib/svtplay_dl/error.py @@ -7,4 +7,32 @@ class UIException(Exception): pass class ServiceError(Exception): - pass \ No newline at end of file + pass + +class NoRequestedProtocols(UIException): + """ + This excpetion is thrown when the service provides streams, + but not using any accepted protocol (as decided by + options.stream_prio). + """ + + def __init__(self, requested, found): + """ + The constructor takes two mandatory parameters, requested + and found. Both should be lists. requested is the protocols + we want and found is the protocols that can be used to + access the stream. + """ + self.requested = requested + self.found = found + + super(NoRequestedProtocols, self).__init__( + "None of the provided protocols (%s) are in " + "the current list of accepted protocols (%s)" % ( + self.found, self.requested + ) + ) + + def __repr__(self): + return "NoRequestedProtocols(requested=%s, found=%s)" % ( + self.requested, self.found)
error: New exception, NoRequestedProtocols This excpetion is thrown when the stream can't be accessed by any accepted protocol (as decided by options.stream_prio).
spaam_svtplay-dl
train
py
f1db00735ef4bd1a0a848d4a165b4a8e0dee84bc
diff --git a/tests/test_url_patterns.py b/tests/test_url_patterns.py index <HASH>..<HASH> 100644 --- a/tests/test_url_patterns.py +++ b/tests/test_url_patterns.py @@ -1,4 +1,4 @@ -from nose.tools import eq_ +from nose.tools import eq_, raises from unittest.mock import patch from circle_asset.circle_api import get_latest_build, get_artifact_list @@ -31,6 +31,12 @@ def test_get_latest_build_token(rq_get): build = get_latest_build(PROJECT_TOKENED, 'master') rq_get.assert_called_with('http://example.com/project/pony/bees/tree/master?limit=1&filter=successful&circle-token=eyes', headers={'Accept': 'application/json'}) +@raises(ValueError) +@patch('requests.get') +def test_get_latest_build_no_matching_builds(rq_get): + rq_get.configure_mock(return_value=FakeResponse([])) + get_latest_build(PROJECT, 'master') + @patch('requests.get') def test_get_artifacts_pattern(rq_get): rq_get.configure_mock(return_value=FakeResponse([{'pretty_path': '$CIRCLE_ARTIFACTS/bees', 'url': 'http://example.com/bees'}]))
Test error in case of no matching builds
prophile_circle-asset
train
py
fb584284efb08a72cfa7153f5131d0353bb0756b
diff --git a/lib/beetle/version.rb b/lib/beetle/version.rb index <HASH>..<HASH> 100644 --- a/lib/beetle/version.rb +++ b/lib/beetle/version.rb @@ -1,3 +1,3 @@ module Beetle - VERSION = "1.0.0" + VERSION = "1.0.1" end
bumped version to <I>
xing_beetle
train
rb
ea30f817942c9c5ee59bbd19b1c0fbcee8102844
diff --git a/salt/states/ldap.py b/salt/states/ldap.py index <HASH>..<HASH> 100644 --- a/salt/states/ldap.py +++ b/salt/states/ldap.py @@ -20,6 +20,7 @@ import logging from salt.ext import six from salt.utils.odict import OrderedDict from salt.utils.oset import OrderedSet +from salt.utils.stringutils import to_bytes log = logging.getLogger(__name__) @@ -484,7 +485,7 @@ def _update_entry(entry, status, directives): continue for attr, vals in six.iteritems(state): status["mentioned_attributes"].add(attr) - vals = _toset(vals) + vals = [to_bytes(val) for val in _toset(vals)] if directive == "default": if vals and (attr not in entry or not entry[attr]): entry[attr] = vals
Convert vals to bytes
saltstack_salt
train
py
eb08f13d9cb2b7d7c23fd5cd324fa6cab6bdabe8
diff --git a/wandb/sklearn/__init__.py b/wandb/sklearn/__init__.py index <HASH>..<HASH> 100644 --- a/wandb/sklearn/__init__.py +++ b/wandb/sklearn/__init__.py @@ -512,7 +512,7 @@ def plot_feature_importances(model=None, feature_names=None, indices = np.argsort(importances)[::-1] - if feature_names is None: + if feature_names == None: feature_names = indices else: feature_names = np.array(feature_names)[indices]
[WB-<I>] Fix sklearn (#<I>)
wandb_client
train
py
b2c22f1a3908aa6239d088cb509e69e874758043
diff --git a/stagemonitor-web/src/main/resources/stagemonitor/static/tabs/request-tab.js b/stagemonitor-web/src/main/resources/stagemonitor/static/tabs/request-tab.js index <HASH>..<HASH> 100644 --- a/stagemonitor-web/src/main/resources/stagemonitor/static/tabs/request-tab.js +++ b/stagemonitor-web/src/main/resources/stagemonitor/static/tabs/request-tab.js @@ -9,10 +9,11 @@ function renderRequestTab(requestTrace) { var $requestTab = $("#request-tab"); if (!stagemonitor.requestTrace) { $requestTab.hide(); - // show config tab as fallback + // show metrics tab as fallback if ($("#call-stack-tab").hasClass('active') || $requestTab.hasClass('active')) { - $("#config-tab").addClass('active'); - $("#stagemonitor-configuration").addClass('active'); + $("#metrics-tab").addClass('active'); + $("#stagemonitor-metrics").addClass('active'); + $("#metrics-tab").find("a").trigger('click'); } return; } else {
Show metrics tab if no request trace is set Previously the config tab was displayed then
stagemonitor_stagemonitor
train
js
c29b33d0a3c5cfb207f2602ea8375377ad986e88
diff --git a/lib/puppet/defaults.rb b/lib/puppet/defaults.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/defaults.rb +++ b/lib/puppet/defaults.rb @@ -59,11 +59,11 @@ module Puppet :priority => { :default => nil, :type => :priority, - :desc => "The scheduling priority of the process. Valid values are 'high',\n" + - "'normal', 'low', or 'idle', which are mapped to platform specific\n" + - "values. The priority can also be specified as an integer value and\n" + - "will be passed as is, e.g. -5. Puppet must be running as a privileged\n" + - "user in order to increase scheduling priority.", + :desc => "The scheduling priority of the process. Valid values are 'high', + 'normal', 'low', or 'idle', which are mapped to platform-specific + values. The priority can also be specified as an integer value and + will be passed as is, e.g. -5. Puppet must be running as a privileged + user in order to increase scheduling priority.", }, :trace => { :default => false,
Maint: Adjust formatting of "priority" setting description The \n" + ..." trick isn't really necessary, since we can strip whitespace and handle first-line underhang.
puppetlabs_puppet
train
rb
b572bb746b15c6c52d89ac76ca6109feb6c8cf95
diff --git a/Controller/Component/Auth/TokenAuthenticate.php b/Controller/Component/Auth/TokenAuthenticate.php index <HASH>..<HASH> 100644 --- a/Controller/Component/Auth/TokenAuthenticate.php +++ b/Controller/Component/Auth/TokenAuthenticate.php @@ -16,7 +16,7 @@ App::uses('BaseAuthenticate', 'Controller/Component/Auth'); * 'password' => 'password', * 'token' => 'public_key', * ), - * 'continue' => true + * 'continue' => true * ) * ) * }}}
Fixes docblock indentation.
FriendsOfCake_Authenticate
train
php
b0297a13dee0b56c4316b2568aab553aebb8cddf
diff --git a/src/frontend/org/voltdb/export/ExportManager.java b/src/frontend/org/voltdb/export/ExportManager.java index <HASH>..<HASH> 100644 --- a/src/frontend/org/voltdb/export/ExportManager.java +++ b/src/frontend/org/voltdb/export/ExportManager.java @@ -47,6 +47,7 @@ import org.voltdb.utils.LogKeys; import com.google_voltpatches.common.base.Preconditions; import com.google_voltpatches.common.base.Throwables; +import org.voltdb.utils.VoltFile; /** * Bridges the connection to an OLAP system and the buffers passed @@ -432,8 +433,10 @@ public class ExportManager if (generation.initializeGenerationFromDisk(conn, m_messenger)) { m_generations.put( generation.m_timestamp, generation); } else { - exportLog.error("Invalid export generation in overflow directory " + generationDirectory + - " this will have to be cleaned up manually."); + String list[] = generationDirectory.list(); + VoltFile.recursivelyDelete(generationDirectory); + exportLog.warn("Invalid export generation in overflow directory " + generationDirectory + + " this will be cleaned up. Number of files deleted: " + (list != null ? list.length : 0)); } } }
ENG-<I>: Delete unwanted unloadable generation.
VoltDB_voltdb
train
java
7cbe8c070506fb4c4c88610a7358e78e1d451d20
diff --git a/src/jquery.sidebar.js b/src/jquery.sidebar.js index <HASH>..<HASH> 100644 --- a/src/jquery.sidebar.js +++ b/src/jquery.sidebar.js @@ -122,13 +122,24 @@ } }); - // Close the sidebar - if (!settings.isClosed && settings.close) { + function closeWithNoAnimation() { self.trigger("sidebar:close", [{ speed: 0 }]); } + // Close the sidebar + if (!settings.isClosed && settings.close) { + closeWithNoAnimation(); + } + + $(window).on("resize", function () { + if (!settings.isClosed) { return; } + closeWithNoAnimation(); + }); + + self.data("sidebar", settings); + return self; };
Trigger the close event on window resize. This fixes #<I>. When the window is resized, if the sidebar is in the closed state, we trigger the sidebar:close event, so the sidebar will be closed. In previous versions, if the sidebar was having percentage sizes (height or/and width) it would appear on the window margin when the window would get resized. Also, we now store the settings object reference in the `sidebar` data (jQuery). This commit also fixes #<I>. :fire:
jillix_jQuery-sidebar
train
js
88d808735e768a7eb8a56e42a532d43dc75760cf
diff --git a/tests/test_config.php b/tests/test_config.php index <HASH>..<HASH> 100644 --- a/tests/test_config.php +++ b/tests/test_config.php @@ -51,4 +51,5 @@ $sSeleniumServerIp = "127.0.0.1"; // Browser name which will be used for testing. // Possible values: *iexplore, *iehta, *firefox, *chrome, *piiexplore, *pifirefox, *safari, *opera // make sure that path to browser executable is known for the system -$sBrowserName = '*firefox'; +$sBrowserName = 'firefox'; +
merging from <I>: Mink for test add oxidAdditionalFunctions to library (cherry picked from commit e<I>)
OXID-eSales_oxideshop_ce
train
php
53c0f41422bb8a5aa9ceb8089703d9456a666ab0
diff --git a/cmd/gosh/main.go b/cmd/gosh/main.go index <HASH>..<HASH> 100644 --- a/cmd/gosh/main.go +++ b/cmd/gosh/main.go @@ -55,7 +55,7 @@ func run(reader io.Reader, name string) error { return err } r := interp.Runner{ - File: prog, + Node: prog, Stdin: os.Stdin, Stdout: os.Stdout, Stderr: os.Stderr,
cmd/gosh: adapt to new interp field name
mvdan_sh
train
go
fbf076d422d54d23cd065fb1185e56c0409eef74
diff --git a/test/tc_zoneinfo_data_source.rb b/test/tc_zoneinfo_data_source.rb index <HASH>..<HASH> 100644 --- a/test/tc_zoneinfo_data_source.rb +++ b/test/tc_zoneinfo_data_source.rb @@ -399,7 +399,7 @@ class TCZoneinfoDataSource < Minitest::Test data_source.load_timezone_info('+VERSION') end - assert_match(/\W\+VERSION/, error.message) + assert_equal('Invalid identifier: +VERSION', error.message) end end
Verify that the failure is caused by ignoring the file. An error handling the content of the file will also result in an InvalidTimezoneIdentifier exception.
tzinfo_tzinfo
train
rb
4e2048ef914158f803a2d49ba541d783515ac833
diff --git a/classes/phing/tasks/ext/dbdeploy/DbDeployTask.php b/classes/phing/tasks/ext/dbdeploy/DbDeployTask.php index <HASH>..<HASH> 100755 --- a/classes/phing/tasks/ext/dbdeploy/DbDeployTask.php +++ b/classes/phing/tasks/ext/dbdeploy/DbDeployTask.php @@ -290,8 +290,14 @@ class DbDeployTask extends Task protected function getDeltasFilesArray() { $files = array(); + $baseDir = realpath($this->dir); $dh = opendir($baseDir); + + if ($dh === false) { + return $files; + } + $fileChangeNumberPrefix = ''; while (($file = readdir($dh)) !== false) { if (preg_match('[\d+]', $file, $fileChangeNumberPrefix)) {
Fixes #<I> - prevent infinite loop if dir does not exist
phingofficial_phing
train
php
012a0ea94b50a741b365a713c7ba33309d66b8dc
diff --git a/test/tests/events.js b/test/tests/events.js index <HASH>..<HASH> 100755 --- a/test/tests/events.js +++ b/test/tests/events.js @@ -354,7 +354,7 @@ define([ 'Ractive', '../vendor/Ractive-events-tap' ], function ( Ractive ) { t.equal( tapped, true ); }); - test( 'Pressing spacebar on a focused button results in a tap event', function ( t ) { + asyncTest( 'Pressing spacebar on a focused button results in a tap event', function ( t ) { var ractive, node, tapped; ractive = new Ractive({ @@ -376,7 +376,11 @@ define([ 'Ractive', '../vendor/Ractive-events-tap' ], function ( Ractive ) { node.focus(); t.equal( document.activeElement, node ); simulant.fire( node, 'keydown', { which: 32 }); - t.equal( tapped, true ); + + setTimeout( function () { + t.ok( tapped ); + start(); + }, 0 ); }); test( 'Calling ractive.off() without a keypath removes all handlers', function ( t ) {
made a test asynchronous to prevent unpredictable failure in Firefox
ractivejs_ractive
train
js
d064972c7a5ac3c3987c841c7d486ceef82090ec
diff --git a/tests/HtmlHeadingNormalizerTest.php b/tests/HtmlHeadingNormalizerTest.php index <HASH>..<HASH> 100644 --- a/tests/HtmlHeadingNormalizerTest.php +++ b/tests/HtmlHeadingNormalizerTest.php @@ -46,10 +46,9 @@ class HtmlHeadingNormalizerTest extends \PHPUnit_Framework_TestCase public function testDemoteHtmlDocument() { $inputHtml = $this->getTestFileContents('document.base1.html'); - $normalizedHtml = HtmlHeadingNormalizer::demote($inputHtml, 2); - + $demotedHtml = HtmlHeadingNormalizer::demote($inputHtml, 2); $expectedHtml = $this->getTestFileContents('document.base1.demote2.html'); - $this->assertHtmlStringEqualsHtmlString($expectedHtml, $normalizedHtml); + $this->assertHtmlStringEqualsHtmlString($expectedHtml, $demotedHtml); } }
Minor refactoring of tests.
vikpe_php-html-heading-normalizer
train
php
54745db2809c2fc97e27bd282c2f9818ba37a36c
diff --git a/server/src/main/java/org/jboss/as/server/NewMain.java b/server/src/main/java/org/jboss/as/server/NewMain.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/org/jboss/as/server/NewMain.java +++ b/server/src/main/java/org/jboss/as/server/NewMain.java @@ -82,9 +82,12 @@ public final class NewMain { System.exit(1); throw new IllegalStateException(); } - for (;;) try { + try { while (initialInput.read() != -1) {} - break; + } catch (IOException e) { + } + try { + initialInput.close(); } catch (IOException e) { } }
Updates to model and server factory was: c<I>f<I>a<I>c<I>e<I>bd0a<I>a<I>f
wildfly_wildfly-core
train
java
1aafe8a62e9559dfc7939c456ed9433353ae6ecf
diff --git a/src/Tokenly/XChainClient/Mock/MockBuilder.php b/src/Tokenly/XChainClient/Mock/MockBuilder.php index <HASH>..<HASH> 100644 --- a/src/Tokenly/XChainClient/Mock/MockBuilder.php +++ b/src/Tokenly/XChainClient/Mock/MockBuilder.php @@ -50,6 +50,19 @@ class MockBuilder $this->received_by_txid_map = []; } + public function importBalances($data) { + if (isset($data['balances'])) { $this->balances = $data['balances']; } + if (isset($data['balances_by_txid'])) { $this->balances_by_txid = $data['balances_by_txid']; } + if (isset($data['received_by_txid_map'])) { $this->received_by_txid_map = $data['received_by_txid_map']; } + } + public function exportBalances() { + return [ + 'balances' => $this->balances, + 'balances_by_txid' => $this->balances_by_txid, + 'received_by_txid_map' => $this->received_by_txid_map, + ]; + } + public function setOutputTransactionID($output_transaction_id) { $this->output_transaction_id = $output_transaction_id; }
add import and export mock balances methods
tokenly_xchain-client
train
php
ec3100b94bda8cc8d953bf81aaac15eaef0990f0
diff --git a/packages/core/src/plugins/input/chain.js b/packages/core/src/plugins/input/chain.js index <HASH>..<HASH> 100644 --- a/packages/core/src/plugins/input/chain.js +++ b/packages/core/src/plugins/input/chain.js @@ -49,11 +49,13 @@ class ChainParser { } else { return [] } - } else { + } else if (this.options.target === '@csl/list+object') { return this.data.map(this.options.generateGraph ? entry => applyGraph(entry, this.graph) : removeGraph ) + } else { + return this.data } } }
fix(core): fix post-processing with 'target' set
citation-js_citation-js
train
js
459142b3a7b7fa87e982e40019340a2cfe8a8909
diff --git a/lib/ast/node.rb b/lib/ast/node.rb index <HASH>..<HASH> 100644 --- a/lib/ast/node.rb +++ b/lib/ast/node.rb @@ -526,6 +526,11 @@ EOF end end + def resolve_all + @namespace = nil if @namespace == "_" + resolve.children(&:resolve_all) + end + def compile(g) prepare.bytecode(g) end
add Node#resolve_all, which will recursively resolve a node, replacing resolves to _ if possible
vito_atomy
train
rb
06e87ce85b3fedffd53f0409ecc6bb7b3be4a1d0
diff --git a/src/config/common.php b/src/config/common.php index <HASH>..<HASH> 100644 --- a/src/config/common.php +++ b/src/config/common.php @@ -32,7 +32,7 @@ $components = [ $singletons = [ \hiqdev\yii\DataMapper\query\FieldFactoryInterface::class => \hiqdev\yii\DataMapper\query\FieldFactory::class, \hiqdev\yii\DataMapper\components\ConnectionInterface::class => function ($container) { - return $container->get('db'); + return class_exists('Yii') ? \Yii::$app->get('db') : $container->get('db'); }, \hiqdev\yii\DataMapper\components\EntityManagerInterface::class => [ '__class' => \hiqdev\yii\DataMapper\components\EntityManager::class,
Fixed BC with Yii2 <I>
hiqdev_yii2-data-mapper
train
php
6f67720b5029a8c0f5b20ab439b47943a148bef1
diff --git a/integration-test/src/test/java/org/cloudfoundry/uaa/IdentityZonesTest.java b/integration-test/src/test/java/org/cloudfoundry/uaa/IdentityZonesTest.java index <HASH>..<HASH> 100644 --- a/integration-test/src/test/java/org/cloudfoundry/uaa/IdentityZonesTest.java +++ b/integration-test/src/test/java/org/cloudfoundry/uaa/IdentityZonesTest.java @@ -25,10 +25,12 @@ import org.cloudfoundry.uaa.identityzones.GetIdentityZoneResponse; import org.cloudfoundry.uaa.identityzones.ListIdentityZonesRequest; import org.cloudfoundry.uaa.identityzones.ListIdentityZonesResponse; import org.cloudfoundry.uaa.identityzones.UpdateIdentityZoneRequest; +import org.junit.Ignore; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; import reactor.core.publisher.Mono; +@Ignore("Until the UAA Out of Metaspace problem is solved") public final class IdentityZonesTest extends AbstractIntegrationTest { @Autowired
Ignore Identity Zone Integration Tests Currently, the UAA has a configuration problem that enables us to make it go Out of Memory Space nearly every time we run the IdentityZone tests. This change disables them until they sort that out.
cloudfoundry_cf-java-client
train
java
97747b446907b739193e014c2261a0cfb30e212a
diff --git a/lib/writeexcel/worksheet.rb b/lib/writeexcel/worksheet.rb index <HASH>..<HASH> 100644 --- a/lib/writeexcel/worksheet.rb +++ b/lib/writeexcel/worksheet.rb @@ -57,9 +57,6 @@ class Worksheet < BIFFWriter @using_tmpfile = true @fileclosed = false @offset = 0 - @xls_rowmax = RowMax - @xls_colmax = ColMax - @xls_strmax = StrMax @dim_rowmin = nil @dim_rowmax = nil @dim_colmin = nil @@ -5592,10 +5589,10 @@ class Worksheet < BIFFWriter # def check_dimensions(row, col, ignore_row = 0, ignore_col = 0) #:nodoc: return -2 unless row - return -2 if row >= @xls_rowmax + return -2 if row >= RowMax return -2 unless col - return -2 if col >= @xls_colmax + return -2 if col >= ColMax if ignore_row == 0 @dim_rowmin = row if !@dim_rowmin || (row < @dim_rowmin)
* Worksheet : Replace instance var which used once with Constant
cxn03651_writeexcel
train
rb
8956fca265fce150a3f70d4b2d70761e9372244c
diff --git a/app/controllers/pouchdb.js b/app/controllers/pouchdb.js index <HASH>..<HASH> 100644 --- a/app/controllers/pouchdb.js +++ b/app/controllers/pouchdb.js @@ -107,7 +107,10 @@ export default Ember.Controller.extend(PouchAdapterUtils, { var dbUrl = document.location.protocol+'//'+document.location.host+'/db/main'; new PouchDB(dbUrl, pouchOptions, function(err, db) { if (err) { - reject(err); + Ember.run.later(this, function() { + this.get('session').invalidate(); + }); + reject(err); } else { createPouchViews(db); this._gotServerMainDB(err, db);
Fixed issue when completely closing browser but session is still considered valid.
HospitalRun_hospitalrun-frontend
train
js
73ba82feaeab7f26832cfdf4db339ef33c34b551
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100755 --- a/lib/index.js +++ b/lib/index.js @@ -56,6 +56,12 @@ exports.executeSpecs = function(options) { it = function(desc, func, timeout) { return jasmine.getEnv().it(desc, func, timeout); } + beforeEach = function(func, timeout) { + return jasmine.getEnv().beforeEach(func, timeout); + } + afterEach = function(func, timeout) { + return jasmine.getEnv().afterEach(func, timeout); + } var colors = showColors || false, jasmineEnv = jasmine.getEnv();
Adding fixes for custom timeouts to beforeEach and afterEach.
juliemr_minijasminenode
train
js
c7879120d9a406071395d4f135ce0a0ca7bcd58e
diff --git a/daemon_linux_systemv.go b/daemon_linux_systemv.go index <HASH>..<HASH> 100644 --- a/daemon_linux_systemv.go +++ b/daemon_linux_systemv.go @@ -234,6 +234,8 @@ lockfile="/var/lock/subsys/$proc" stdoutlog="/var/log/$proc.log" stderrlog="/var/log/$proc.err" +mkdir -p /var/lock/subsys + [ -e /etc/sysconfig/$proc ] && . /etc/sysconfig/$proc start() {
Fix folder /var/lock/subsys does not exists in centos 6
takama_daemon
train
go
270e6d16166b8445ae127c499740ac005d93a687
diff --git a/Library/Operators/Comparison/ComparisonBaseOperator.php b/Library/Operators/Comparison/ComparisonBaseOperator.php index <HASH>..<HASH> 100644 --- a/Library/Operators/Comparison/ComparisonBaseOperator.php +++ b/Library/Operators/Comparison/ComparisonBaseOperator.php @@ -113,6 +113,11 @@ class ComparisonBaseOperator extends BaseOperator $condition = 'Z_TYPE_P(' . $variableVariable->getName() . ') ' . $operator . ' IS_LONG'; break; + case 'double': + case 'float': + $condition = 'Z_TYPE_P(' . $variableVariable->getName() . ') ' . $operator . ' IS_DOUBLE'; + break; + case 'boolean': case 'bool': $condition = 'Z_TYPE_P(' . $variableVariable->getName() . ') ' . $operator . ' IS_BOOL';
Added double type to optimizeTypeOf
phalcon_zephir
train
php
6db306df5177fd85a26b5a102864f7dad1e52163
diff --git a/src/main/java/de/btobastian/javacord/DiscordAPI.java b/src/main/java/de/btobastian/javacord/DiscordAPI.java index <HASH>..<HASH> 100644 --- a/src/main/java/de/btobastian/javacord/DiscordAPI.java +++ b/src/main/java/de/btobastian/javacord/DiscordAPI.java @@ -589,4 +589,10 @@ public interface DiscordAPI { */ public boolean isWaitingForServersOnStartup(); + /** + * Disconnects the bot. + * After disconnecting you should NOT use this instance again. + */ + public void disconnect(); + } diff --git a/src/main/java/de/btobastian/javacord/ImplDiscordAPI.java b/src/main/java/de/btobastian/javacord/ImplDiscordAPI.java index <HASH>..<HASH> 100644 --- a/src/main/java/de/btobastian/javacord/ImplDiscordAPI.java +++ b/src/main/java/de/btobastian/javacord/ImplDiscordAPI.java @@ -898,6 +898,13 @@ public class ImplDiscordAPI implements DiscordAPI { return waitForServersOnStartup; } + @Override + public void disconnect() { + if (socketAdapter != null) { + socketAdapter.getWebSocket().sendClose(1000); + } + } + /** * Gets a list with all unavailable servers. *
Added DiscordAPI#disconnect()
Javacord_Javacord
train
java,java
a95b278a3e19a8b43cb834826ee7f270c2ddcc2c
diff --git a/phypno/trans/filter.py b/phypno/trans/filter.py index <HASH>..<HASH> 100644 --- a/phypno/trans/filter.py +++ b/phypno/trans/filter.py @@ -1,4 +1,5 @@ from __future__ import division +from copy import deepcopy from logging import getLogger from scipy.signal import butter, filtfilt @@ -23,6 +24,8 @@ class Filter: ---------- b, a : numpy.ndarray filter values + info : dict + information about type, order, and cut-off of the filter. Notes ----- @@ -58,6 +61,15 @@ class Filter: if not btype: raise ValueError('You should specify at least low_cut or high_cut') + try: + freq = '-'.join([str(x) for x in Wn]) + except TypeError: + freq = str(Wn) + + self.info = {'order': order, + 'type': btype, + 'freq': freq} + lg.debug('order {0: 2}, Wn {1}, btype {2}'.format(order, str(Wn), btype)) b, a = butter(order, Wn, btype=btype) @@ -78,5 +90,6 @@ class Filter: filtered data """ - data.data = filtfilt(self.b, self.a, data.data) - return data + fdata = deepcopy(data) + fdata.data = filtfilt(self.b, self.a, data.data) + return fdata
add info about filter and use deepcopy, otherwise it changes the data
wonambi-python_wonambi
train
py
bc8996c04df8edaf58c0f103e2f0fa4a9c9caa43
diff --git a/lib/extensions/has_one.rb b/lib/extensions/has_one.rb index <HASH>..<HASH> 100644 --- a/lib/extensions/has_one.rb +++ b/lib/extensions/has_one.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true -begin - require 'active_record' - +if defined?(::ActiveRecord) ::ActiveRecord::Associations::Builder::HasOne.class_eval do # Based on # https://github.com/rails/rails/blob/master/activerecord/lib/active_record/associations/builder/collection_association.rb#L50 @@ -17,6 +15,4 @@ begin CODE end end -rescue LoadError - # active_record can't be loaded so we shouldn't try to monkey-patch it. end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,4 @@ +require 'active_record' require 'fast_jsonapi' require 'rspec-benchmark' require 'byebug'
fix ActiveRecord ConnectionNotEstablished when ActiveRecord isnt required in a project
Netflix_fast_jsonapi
train
rb,rb
8c33f0310d8a6105bead0d77ddbbc9b730a6f886
diff --git a/telepot/aio/loop.py b/telepot/aio/loop.py index <HASH>..<HASH> 100644 --- a/telepot/aio/loop.py +++ b/telepot/aio/loop.py @@ -34,7 +34,7 @@ class GetUpdatesLoop(object): offset = update['update_id'] + 1 except CancelledError: - raise + break except exception.BadHTTPResponse as e: traceback.print_exc() @@ -69,16 +69,20 @@ class MessageLoop(object): def __init__(self, bot, handle=None): self._bot = bot self._handle = _infer_handler_function(bot, handle) + self._task = None async def run_forever(self, *args, **kwargs): updatesloop = GetUpdatesLoop(self._bot, lambda update: self._handle(_extract_message(update)[1])) - self._bot.loop.create_task(updatesloop.run_forever(*args, **kwargs)) + self._task = self._bot.loop.create_task(updatesloop.run_forever(*args, **kwargs)) self._bot.scheduler.on_event(self._handle) + def cancel(self): + self._task.cancel() + class Webhook(object): def __init__(self, bot, handle=None):
Add an option to cancel MessageLoop. Currently there is no good way to stop MessageLoop once it is started. This commit adds 'cancel' method to MessageLoop that stops it.
AmanoTeam_amanobot
train
py
ed3738349a0abafe95df60debd360ab03ad68fcc
diff --git a/server-coreless/src/main/java/org/openqa/selenium/server/browserlaunchers/LauncherUtils.java b/server-coreless/src/main/java/org/openqa/selenium/server/browserlaunchers/LauncherUtils.java index <HASH>..<HASH> 100644 --- a/server-coreless/src/main/java/org/openqa/selenium/server/browserlaunchers/LauncherUtils.java +++ b/server-coreless/src/main/java/org/openqa/selenium/server/browserlaunchers/LauncherUtils.java @@ -299,7 +299,15 @@ public class LauncherUtils { // Disable "do you want to remember this password?" out.println("user_pref('signon.rememberSignons', false);"); - out.close(); + + // Disable any of the random self-updating crap + out.println("user_pref('app.update.auto', false);"); + out.println("user_pref('app.update.enabled', false);"); + out.println("user_pref('extensions.update.enabled', false);"); + out.println("user_pref('browser.search.update', false);"); + out.println("user_pref('browser.safebrowsing.enabled', false);"); + + out.close(); } static final Pattern JAVA_STYLE_UNC_URL = Pattern.compile("^file:////([^/]+/.*)$");
disable all the browser/plugin/safebrowser stuff that can invoke when initially launching the browser r<I>
SeleniumHQ_selenium
train
java
6a3a85562bf7e20ad4f416089c6e3d287b0f0555
diff --git a/tests/test_package.py b/tests/test_package.py index <HASH>..<HASH> 100644 --- a/tests/test_package.py +++ b/tests/test_package.py @@ -12,7 +12,7 @@ def package_factory(name, versions): class FetchPackageTestCase(TestCase): @requests_mock.mock() def test_fetch_packages(self, requests): - with open(os.path.dirname(os.path.realpath(__file__)) + "/data/Django.json") as f: + with open(os.path.dirname(os.path.realpath(__file__)) + "/data/django.json") as f: requests.get("https://pypi.python.org/pypi/Django/json", text=f.read()) package = fetch_package("Django")
make this work for case sensitive file systems
pyupio_pyup
train
py
b5951e7398df64c6022ff1ea18d3b9af23b4e7e0
diff --git a/iptables/iptables.go b/iptables/iptables.go index <HASH>..<HASH> 100644 --- a/iptables/iptables.go +++ b/iptables/iptables.go @@ -28,6 +28,7 @@ import ( // Adds the output of stderr to exec.ExitError type Error struct { exec.ExitError + cmd exec.Cmd msg string } @@ -36,7 +37,7 @@ func (e *Error) ExitStatus() int { } func (e *Error) Error() string { - return fmt.Sprintf("exit status %v: %v", e.ExitStatus(), e.msg) + return fmt.Sprintf("running %v: exit status %v: %v", e.cmd.Args, e.ExitStatus(), e.msg) } // Protocol to differentiate between IPv4 and IPv6 @@ -248,7 +249,7 @@ func (ipt *IPTables) runWithOutput(args []string, stdout io.Writer) error { } if err := cmd.Run(); err != nil { - return &Error{*(err.(*exec.ExitError)), stderr.String()} + return &Error{*(err.(*exec.ExitError)), cmd, stderr.String()} } return nil
Add command args to Error struct so they can be printed out, to improve debugging
coreos_go-iptables
train
go
cfca81a685f64d3c4891533ce5d3e509fb8e0d0c
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index <HASH>..<HASH> 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -12,15 +12,13 @@ else end DATA = YAML.load_file("#{File.dirname(__FILE__)}/test_data.yml") -IGNORE_LOGIN_REQUEST = true -IGNORE_LOGOUT_REQUEST = true VCR.configure do |c| c.cassette_library_dir = "spec/fixtures/vcr_cassettes" c.hook_into :webmock c.filter_sensitive_data("your_responsys_username") { CREDENTIALS["username"] } c.filter_sensitive_data("your_responsys_password") { CREDENTIALS["password"] } - c.default_cassette_options = { match_requests_on: [:host, :method, :uri, :body, :path] } + c.default_cassette_options = { match_requests_on: [:method, :uri, :body] } c.before_record do |c| c.request.headers = nil c.response.headers = nil
[CLEAN] Unused code, params in the spec_helper
dandemeyere_responsys-api
train
rb
4d6ade3d871713482d7f7dd58b0efc8852973010
diff --git a/lettuce_webdriver/css_selector_steps.py b/lettuce_webdriver/css_selector_steps.py index <HASH>..<HASH> 100644 --- a/lettuce_webdriver/css_selector_steps.py +++ b/lettuce_webdriver/css_selector_steps.py @@ -1,3 +1,5 @@ +import time + from lettuce import step from lettuce import world @@ -26,6 +28,8 @@ def load_script(browser, url): document.getElementsByTagName("head")[0].appendChild(script_tag); """, url) + time.sleep(1) + def find_elements_by_jquery(browser, selector): """Find HTML elements using jQuery-style selectors.
Wait for jQuery to load after injecting it
bbangert_lettuce_webdriver
train
py
2338d4a29972d9771ca520fc7514459f726f2b61
diff --git a/tasks/trimtrailingspaces.js b/tasks/trimtrailingspaces.js index <HASH>..<HASH> 100644 --- a/tasks/trimtrailingspaces.js +++ b/tasks/trimtrailingspaces.js @@ -61,7 +61,7 @@ module.exports = function trimtrailingspaces(grunt) { const content = grunt.file.read(src, fsOptions); const destination = getDestination(src, file.dest); - const trimmed = content.replace(/[ \f\t\v]*$/gm, ''); + const trimmed = content.replace(/[ \f\t\v]*$/gmu, ''); if (content !== trimmed) { grunt.log.ok('Needed trimming, file: ' + src);
Add u modified to regular expressions
paazmaya_grunt-trimtrailingspaces
train
js
fdc4f3f6a08bb1be5e65ab9adf21fb911ccc7380
diff --git a/spyder/utils/encoding.py b/spyder/utils/encoding.py index <HASH>..<HASH> 100644 --- a/spyder/utils/encoding.py +++ b/spyder/utils/encoding.py @@ -17,6 +17,7 @@ import locale import re import os import sys +import time import errno # Third-party imports @@ -240,12 +241,15 @@ def write(text, filename, encoding='utf-8', mode='wb'): # Needed to fix file permissions overwritting. # See spyder-ide/spyder#9381. try: - original_mode = os.stat(filename).st_mode + file_stat = os.stat(filename) + original_mode = file_stat.st_mode + creation = file_stat.st_atime except OSError: # Change to FileNotFoundError for PY3 # Creating a new file, emulate what os.open() does umask = os.umask(0) os.umask(umask) original_mode = 0o777 & ~umask + creation = time.time() try: with atomic_write(filename, overwrite=True, mode=mode) as textfile: @@ -257,6 +261,9 @@ def write(text, filename, encoding='utf-8', mode='wb'): with open(filename, mode) as textfile: textfile.write(text) os.chmod(filename, original_mode) + file_stat = os.stat(filename) + # Preserve creation timestamps + os.utime(filename, (creation, file_stat.st_mtime)) return encoding
Preserve creation time when performing an atomic_write
spyder-ide_spyder
train
py
ad3296fc4d6407f2e0d4aaf3074094a422252214
diff --git a/azkaban-common/src/main/java/azkaban/jobtype/JobTypeManager.java b/azkaban-common/src/main/java/azkaban/jobtype/JobTypeManager.java index <HASH>..<HASH> 100644 --- a/azkaban-common/src/main/java/azkaban/jobtype/JobTypeManager.java +++ b/azkaban-common/src/main/java/azkaban/jobtype/JobTypeManager.java @@ -309,6 +309,7 @@ public class JobTypeManager { } // each job type can have a different class loader + logger.info(String.format("Classpath for plugin[dir: %s, JobType: %s]: %s", pluginDir, jobTypeName, resources)); ClassLoader jobTypeLoader = new URLClassLoader(resources.toArray(new URL[resources.size()]), parentLoader);
Added logging for classpath information while loading plugins (#<I>) Adding a log statement to capture plugin details and the classpath which is used to create the classloader for loading plugins.
azkaban_azkaban
train
java
27de3f0076ff226260407d2fc64ed8fa1e24b9a4
diff --git a/lib/cron.js b/lib/cron.js index <HASH>..<HASH> 100755 --- a/lib/cron.js +++ b/lib/cron.js @@ -77,7 +77,7 @@ function CronPlugin() { } }); - si.add({role:self.name,cmd:'close'},function(args,cb){ + si.add({cmd:'close'},function(args,cb){ si.log('close cron jobs') for (var id in cronJobs) { var job = cronJobs[id]; diff --git a/test/cron.test.js b/test/cron.test.js index <HASH>..<HASH> 100755 --- a/test/cron.test.js +++ b/test/cron.test.js @@ -74,7 +74,7 @@ function doConfig(){ setTimeout(function(){ si.log('exit'); - si.act({role:'cron',cmd:'close'}, function(err, res){ + si.act({cmd:'close'}, function(err, res){ si.log('cron plugin closed') si.close(); assert(!err)
Close action do not have a role. Fixes #4
mirceaalexandru_seneca-cron
train
js,js
c81dd349bebef31ace1b9cc8b55b8709af582e9a
diff --git a/cpenv/api.py b/cpenv/api.py index <HASH>..<HASH> 100644 --- a/cpenv/api.py +++ b/cpenv/api.py @@ -573,7 +573,14 @@ def _init(): configured_repos = read_config('repos', {}) for name, config in configured_repos.items(): repo_cls = repos.registry[config.pop('type')] - add_repo(repo_cls(**config)) + try: + add_repo(repo_cls(**config)) + except Exception as e: + warnings.warn('Failed to create %s named %s\nError: %s' % ( + type(repo_cls).__name__, + config['name'], + str(e), + )) # Set _active_modules from CPENV_ACTIVE_MODULES unresolved = []
fix: _init failed when Repo construction raised
cpenv_cpenv
train
py
78d54959458d0e3bd88076fba4e1f35e083cc193
diff --git a/web/src/main/java/org/springframework/security/web/util/AntPathRequestMatcher.java b/web/src/main/java/org/springframework/security/web/util/AntPathRequestMatcher.java index <HASH>..<HASH> 100644 --- a/web/src/main/java/org/springframework/security/web/util/AntPathRequestMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/AntPathRequestMatcher.java @@ -133,6 +133,15 @@ public final class AntPathRequestMatcher implements RequestMatcher { } @Override + public int hashCode() { + int code = 31 ^ pattern.hashCode(); + if (httpMethod != null) { + code ^= httpMethod.hashCode(); + } + return code; + } + + @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("Ant [pattern='").append(pattern).append("'");
SEC-<I>: Add Burt's patch implementing hashcode method in AntPathRequestMatcher
spring-projects_spring-security
train
java
0add9248ede2cada31df6154c6cc6496f29a771e
diff --git a/src/Computed.js b/src/Computed.js index <HASH>..<HASH> 100644 --- a/src/Computed.js +++ b/src/Computed.js @@ -86,12 +86,10 @@ export class Computed { class ComputedFactory { constructor (paths, func) { if ( - !paths || - ( - !isObject(paths) && - typeof paths !== 'function' + !( + isObject(paths) || + typeof paths === 'function' ) || - !func || typeof func !== 'function' ) { throwError('You are not passing the correct arguments to the computed factory')
style(computed): simplify if clause for maintainability
cerebral_cerebral
train
js
450b3123e30d7920b2e7203a546483f06e9ad4d1
diff --git a/request.go b/request.go index <HASH>..<HASH> 100644 --- a/request.go +++ b/request.go @@ -14,6 +14,7 @@ import ( "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/versions" "github.com/docker/docker/client/transport/cancellable" + "github.com/pkg/errors" "golang.org/x/net/context" ) @@ -131,7 +132,8 @@ func (cli *Client) sendClientRequest(ctx context.Context, method, path string, q } } } - return serverResp, fmt.Errorf("An error occurred trying to connect: %v", err) + + return serverResp, errors.Wrap(err, "error during connect") } if resp != nil {
client: don't hide context errors Instead of reformatting error from the request action, we wrap it, allowing the cause to be recovered. This is important for consumers that need to be able to detect context errors, such as `Cancelled` and `DeadlineExceeded`.
docker_cli
train
go
c7ed91e3ef178d875a4e722a931506c1d4564f69
diff --git a/test/test_knod.rb b/test/test_knod.rb index <HASH>..<HASH> 100644 --- a/test/test_knod.rb +++ b/test/test_knod.rb @@ -79,6 +79,14 @@ class BaseTest < Minitest::Test File.join('.', path) end + def connection + Connection.new(base_uri) + end + + def base_uri + "http://#{host}:#{$port}" + end + def teardown FileUtils.remove_entry(local_path, true) end
[TEST] use connection in BaseTEst
moserrya_knod
train
rb
bf627b87565e8123425b5fa11c07f443ccf7b3d5
diff --git a/Security/TwoFactor/EventListener/InteractiveLoginListener.php b/Security/TwoFactor/EventListener/InteractiveLoginListener.php index <HASH>..<HASH> 100644 --- a/Security/TwoFactor/EventListener/InteractiveLoginListener.php +++ b/Security/TwoFactor/EventListener/InteractiveLoginListener.php @@ -53,7 +53,7 @@ class InteractiveLoginListener * @param mixed $token * @return boolean */ - public function isTokenSupported($token) + private function isTokenSupported($token) { $class = get_class($token); diff --git a/Security/TwoFactor/EventListener/RequestListener.php b/Security/TwoFactor/EventListener/RequestListener.php index <HASH>..<HASH> 100644 --- a/Security/TwoFactor/EventListener/RequestListener.php +++ b/Security/TwoFactor/EventListener/RequestListener.php @@ -67,7 +67,7 @@ class RequestListener * @param mixed $token * @return boolean */ - public function isTokenSupported($token) + private function isTokenSupported($token) { $class = get_class($token);
Made isTokenSupported method private
scheb_two-factor-bundle
train
php,php
084d854b5f97a0331f24d9e570ef938585f66754
diff --git a/ydcommon/__init__.py b/ydcommon/__init__.py index <HASH>..<HASH> 100644 --- a/ydcommon/__init__.py +++ b/ydcommon/__init__.py @@ -2,7 +2,7 @@ YD Technology common libraries """ -VERSION = (0, 1, 60) +VERSION = (0, 1, 61) __version__ = '.'.join((str(each) for each in VERSION[:4])) diff --git a/ydcommon/fab.py b/ydcommon/fab.py index <HASH>..<HASH> 100644 --- a/ydcommon/fab.py +++ b/ydcommon/fab.py @@ -204,6 +204,8 @@ def setup_server(clear_old=False, repo="github"): else: sudo(env.python + ' manage.py syncdb --migrate', user=env.remote_user) + sudo('cd config && ln -sf %s/logrotate.conf logrotate.conf' % (env.environment)) + # try installing npm # install npm modules # sudo('/bin/bash ./scripts/fab_build_bower_npm.sh ' + env.remote_user, user=env.remote_user, warn_only=True)
verson bump + support for local logrotate
ArabellaTech_ydcommon
train
py,py
ffb4e63cab8b6018472221bf834aa3a8f1841d31
diff --git a/nimblenet/neuralnet.py b/nimblenet/neuralnet.py index <HASH>..<HASH> 100644 --- a/nimblenet/neuralnet.py +++ b/nimblenet/neuralnet.py @@ -1,7 +1,7 @@ from activation_functions import softmax_function from cost_functions import softmax_neg_loss -from tools import add_bias +from tools import add_bias,confirm import numpy as np default_settings = { @@ -153,7 +153,11 @@ class NeuralNet: ratio = np.linalg.norm(analytic_gradient - numeric_gradient) / np.linalg.norm(analytic_gradient + numeric_gradient) if not ratio < 1e-6: - raise Exception( "The numeric gradient check failed! %g" % ratio ) + print "[gradient check] WARNING: The numeric gradient check failed! Analytical gradient differed by %g from the numerical." % ratio + if not confirm("[gradient check] Do you want to continue?"): + print "[gradient check] Exiting." + import sys + sys.exit(2) else: print "[gradient check] Passed!"
Minor: The gradient checking now present the user with a warning if it detect problems, rather than raising an exception.
jorgenkg_python-neural-network
train
py
0136b782f5a30f6467f5cb10355611281c132fa6
diff --git a/lib/thorium.rb b/lib/thorium.rb index <HASH>..<HASH> 100755 --- a/lib/thorium.rb +++ b/lib/thorium.rb @@ -48,7 +48,7 @@ module GitCLI def list require 'json' require 'pp' - gh_uname = "dzotokan"# ask("Enter Github username: ") + gh_uname = ask("Enter Github username: ") puts "\nFetching Github repositories (#{gh_uname})..." puts "------------------------------------------" @repos = get_gh_repos(gh_uname).each_with_index.map do |e, i|
Removing hardcoded username from git clone
danstn_thorium
train
rb
528fd1758068b2263a5ba7a745d7843dc80b366d
diff --git a/persister/whisper.go b/persister/whisper.go index <HASH>..<HASH> 100644 --- a/persister/whisper.go +++ b/persister/whisper.go @@ -376,8 +376,8 @@ func (p *Whisper) store(metric string) { if err != nil { p.logger.Error("failed to reopen whisper file after schema migration", zap.String("path", path), zap.Error(p.simplifyPathError(err))) p.popConfirm(metric) + return } - return } }
persister: fix incorrect error handling when online migration failed The return statement should only happen when persister fails to re-open the whisper file.
lomik_go-carbon
train
go
5bdcd959421366766903afb0f50d7489e955f0e6
diff --git a/src/management/JobsManager.js b/src/management/JobsManager.js index <HASH>..<HASH> 100644 --- a/src/management/JobsManager.js +++ b/src/management/JobsManager.js @@ -173,7 +173,6 @@ JobsManager.prototype.importUsers = function(data, cb) { var promise = options.tokenProvider.getAccessToken().then(function(access_token) { return axios .post(url, form, { headers: { ...headers, Authorization: `Bearer ${access_token}` } }) - .then(({ data }) => data) .catch(function(err) { if (!err.response) { return Promise.reject(err);
Update JobsManager.js Not needed on this call
auth0_node-auth0
train
js
da334b52eb8161f479a4827f1e1628e5d880bd5e
diff --git a/pyfritzhome/cli.py b/pyfritzhome/cli.py index <HASH>..<HASH> 100644 --- a/pyfritzhome/cli.py +++ b/pyfritzhome/cli.py @@ -63,12 +63,12 @@ def list_all(fritz, args): def device_name(fritz, args): """Command that prints the device name.""" - print(fritz.get_actor_name(args.ain)) + print(fritz.get_device_name(args.ain)) def device_presence(fritz, args): """Command that prints the device presence.""" - print(int(fritz.get_actor_present(args.ain))) + print(int(fritz.get_device_present(args.ain))) def device_statistic(fritz, args):
fix cli for getting name and presence
hthiery_python-fritzhome
train
py
5eacc4afc1d55714e45e2ceb891f930e0092c6f5
diff --git a/src/jquery.csv.js b/src/jquery.csv.js index <HASH>..<HASH> 100755 --- a/src/jquery.csv.js +++ b/src/jquery.csv.js @@ -56,7 +56,7 @@ RegExp.escape= function(s) { } else { var integer = parseInt(value); if(isNaN(integer)) { - return 0; + return null; } else { return integer; }
Minor correction to castToScalar. Properly returns null now.
mageddo_javascript-csv
train
js
9c92969743b4af6888a7efa914686dd84d850124
diff --git a/esteid/digidocservice/service.py b/esteid/digidocservice/service.py index <HASH>..<HASH> 100644 --- a/esteid/digidocservice/service.py +++ b/esteid/digidocservice/service.py @@ -157,7 +157,7 @@ class DigiDocService(object): 'ReturnCertData': get_optional_bool(return_cert_data), 'ReturnRevocationData': get_optional_bool(return_revocation_data), - }) + }, no_raise=True) # Update session code if response['Sesscode']: @@ -351,7 +351,7 @@ class DigiDocService(object): return response - def __invoke(self, command, params=None): + def __invoke(self, command, params=None, no_raise=False): params = params or {} if command not in self.SESSION_INIT_COMMANDS: @@ -368,6 +368,10 @@ class DigiDocService(object): elif response['Status'] == self.RESPONSE_STATUS_OK: return response + elif no_raise: + # Some service methods use the status field for other things (e.g. MobileAuthenticate) + return response + # This should usually not happen, hence the over-the-top raise Exception raise Exception(response)
Ensure MobileAuthenticate success does not get raised as an exception
thorgate_django-esteid
train
py
2a585d5de2dd01dcd7c3c311443ccccac78a60d2
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -121,9 +121,8 @@ class MyInstallLib(install_lib.install_lib): for directory in include_dirs: dest = join(self.install_dir, base, directory) if sys.version_info >= (3, 0): - exclude = set(('func_unknown_encoding.py', - 'func_invalid_encoded_data.py', - 'invalid_encoded_data.py')) + exclude = {'invalid_encoded_data*', + 'unknown_encoding*'} else: exclude = set() shutil.rmtree(dest, ignore_errors=True)
Update the list of exclusions from 2to3.
PyCQA_pylint
train
py
5028d263f73583721786e147efbc7f33a22667f7
diff --git a/ontobio/golr/golr_query.py b/ontobio/golr/golr_query.py index <HASH>..<HASH> 100644 --- a/ontobio/golr/golr_query.py +++ b/ontobio/golr/golr_query.py @@ -476,6 +476,7 @@ class GolrAssociationQuery(GolrAbstractQuery): rows=10, start=None, homology_type=None, + non_null_fields=[], **kwargs): """Fetch a set of association objects based on a query. @@ -527,6 +528,7 @@ class GolrAssociationQuery(GolrAbstractQuery): self.url = url # test if client explicitly passes a URL; do not override self.is_explicit_url = url is not None + self.non_null_fields=non_null_fields if self.facet_fields is None: self.facet_fields = [ @@ -833,6 +835,9 @@ class GolrAssociationQuery(GolrAbstractQuery): iterate = True rows = self.max_rows + for field in self.non_null_fields: + filter_queries.append(field + ":['' TO *]") + params = { 'q': qstr, 'fq': filter_queries,
Added non_null_fields to GolrAssociationQuery
biolink_ontobio
train
py
faa11bfcc1781d8708a3e7ae9effc8c905e921cc
diff --git a/lib/Thelia/Core/Template/Loop/Delivery.php b/lib/Thelia/Core/Template/Loop/Delivery.php index <HASH>..<HASH> 100644 --- a/lib/Thelia/Core/Template/Loop/Delivery.php +++ b/lib/Thelia/Core/Template/Loop/Delivery.php @@ -29,6 +29,7 @@ use Thelia\Exception\OrderException; use Thelia\Model\CountryQuery; use Thelia\Module\BaseModule; use Thelia\Module\DeliveryModuleInterface; +use Thelia\TaxEngine\TaxEngine; /** * Class Delivery @@ -59,7 +60,7 @@ class Delivery extends BaseSpecificModule throw new \InvalidArgumentException('Cannot found country id: `' . $countryId . '` in delivery loop'); } } else { - $country = CountryQuery::create()->findOneByByDefault(1); + $country = TaxEngine::getInstance($this->request->getSession())->getDeliveryCountry(); } foreach ($loopResult->getResultDataCollection() as $deliveryModule) {
use TaxEngine::getDeliveryCountry in delivery loop
thelia_core
train
php
0e6e87b72ac2feebb2ae7d24434a0043f2bca27b
diff --git a/lib/View.php b/lib/View.php index <HASH>..<HASH> 100644 --- a/lib/View.php +++ b/lib/View.php @@ -145,4 +145,28 @@ class View implements HasMetaData { \update_post_meta($this->getPost()->ID, $key, $value); } + + /** + * If a method doesn't exist on the View, delegate to the Post + * @param string $field property or method name + * @return mixed returned value + */ + public function __call($method_name, $args) + { + if (method_exists($this->getPost(), $method_name)) { + return call_user_func_array(array($this->getPost(), $method_name), $args); + } else { + return $this->__get($method_name); + } + } + + /** + * If a property or method doesn't exist on the View, delegate to the Post + * @param string $field property or method name + * @return mixed returned value + */ + public function __get($field) + { + return $this->getPost()->$field; + } }
Change View's magic function __get and __call so that if a method or property doesn't exist in the view, delegate to the View's post object
StoutLogic_understory
train
php
fa1b767df64ac1809c38ffeed1f0b9e86d3cf3fb
diff --git a/platform/pure.femto/backend.js b/platform/pure.femto/backend.js index <HASH>..<HASH> 100644 --- a/platform/pure.femto/backend.js +++ b/platform/pure.femto/backend.js @@ -14,6 +14,9 @@ exports.init = function(ctx) { ctx.width = nativeContext.width ctx.height = nativeContext.height nativeContext.on('resize', function(w, h) { + log("resizing context to " + w + 'x' + h) + ctx.system.resolutionWidth = w + ctx.system.resolutionHeight = h ctx.width = w ctx.height = h })
adding resolution width/height to resize handler
pureqml_qmlcore
train
js
a88e8e21583179d02eba4c72e3d144a5771ef7c9
diff --git a/pkg/registry/core/service/strategy.go b/pkg/registry/core/service/strategy.go index <HASH>..<HASH> 100644 --- a/pkg/registry/core/service/strategy.go +++ b/pkg/registry/core/service/strategy.go @@ -89,7 +89,7 @@ func (svcStrategy) Export(ctx genericapirequest.Context, obj runtime.Object, exa return nil } if t.Spec.ClusterIP != api.ClusterIPNone { - t.Spec.ClusterIP = "<unknown>" + t.Spec.ClusterIP = "" } if t.Spec.Type == api.ServiceTypeNodePort { for i := range t.Spec.Ports { diff --git a/pkg/registry/core/service/strategy_test.go b/pkg/registry/core/service/strategy_test.go index <HASH>..<HASH> 100644 --- a/pkg/registry/core/service/strategy_test.go +++ b/pkg/registry/core/service/strategy_test.go @@ -81,7 +81,7 @@ func TestExportService(t *testing.T) { Namespace: "bar", }, Spec: api.ServiceSpec{ - ClusterIP: "<unknown>", + ClusterIP: "", }, }, },
fix issue(#<I>)Invalid value error when creating service from exported config
kubernetes_kubernetes
train
go,go
ed435e240751c2c1e162ae689a1af66183ffd914
diff --git a/lems/run.py b/lems/run.py index <HASH>..<HASH> 100644 --- a/lems/run.py +++ b/lems/run.py @@ -41,12 +41,25 @@ def process_args(): return parser.parse_args() -def main(): +def run(file_path,include_dirs=[],dlems=False,nogui=False): + """ + Function for running from a script or shell. + """ + import argparse + args = argparse.Namespace() + args.lems_file = file_path + args.I = include_dirs + args.dlems = dlems + args.nogui = nogui + main(args=args) + +def main(args=None): """ Program entry point. """ - args = process_args() + if args is None: + args = process_args() print('Parsing and resolving model: '+args.lems_file) model = Model()
Added the ability to execute models from python scripts or interpreter without use of the pylems shell script
LEMS_pylems
train
py
be117c388892e59ba93c50fcc3d9823f6323829a
diff --git a/lib/veritas/algebra/projection.rb b/lib/veritas/algebra/projection.rb index <HASH>..<HASH> 100644 --- a/lib/veritas/algebra/projection.rb +++ b/lib/veritas/algebra/projection.rb @@ -71,7 +71,7 @@ module Veritas optimize_relation.wrap { |relation| new(relation) }.optimize end - memoize :header, :directions, :optimize + memoize :header, :directions, :predicate, :optimize module Methods def project(attributes)
Updated Projection#predicate to be memoized
dkubb_axiom
train
rb
70bceb628967edf05aaaf0d25a1c8b62c6501aad
diff --git a/bloop/dynamo_client.py b/bloop/dynamo_client.py index <HASH>..<HASH> 100644 --- a/bloop/dynamo_client.py +++ b/bloop/dynamo_client.py @@ -160,7 +160,7 @@ class DynamoClient(object): yield (table_name, item) # Bound ref to batch_get for retries - get_batch = functools.partial(self.client.call_with_retries, + get_batch = functools.partial(self.call_with_retries, self.client.batch_get_item) for request_batch in request_batches: @@ -234,7 +234,7 @@ class DynamoClient(object): request_batches = partition_batch_write_input(request) # Bound ref to batch_write for retries - write_batch = functools.partial(self.client.call_with_retries, + write_batch = functools.partial(self.call_with_retries, self.client.batch_write_item) for request_batch in request_batches:
call_with_retries is not part of dynamodb client
numberoverzero_bloop
train
py
4ec579f42abe9440e8fff33ece6832e0eb3f86bd
diff --git a/src/extensions/InvoiceExtension.php b/src/extensions/InvoiceExtension.php index <HASH>..<HASH> 100644 --- a/src/extensions/InvoiceExtension.php +++ b/src/extensions/InvoiceExtension.php @@ -4,8 +4,10 @@ namespace SilverCommerce\Checkout\Extensions; use SilverStripe\Core\Extension; use SilverStripe\Forms\FieldList; -use SilverStripe\Forms\GridField\GridFieldConfig_RecordViewer; +use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor; use SilverCommerce\OrdersAdmin\Forms\GridField\ReadOnlyGridField; +use SilverStripe\Forms\GridField\GridFieldDeleteAction; +use SilverStripe\Forms\GridField\GridFieldAddNewButton; class InvoiceExtension extends Extension { @@ -17,10 +19,14 @@ class InvoiceExtension extends Extension 'Root.Payments', ReadOnlyGridField::create( "Payments", - "", + null, $this->owner->Payments(), - $config = GridFieldConfig_RecordViewer::create() + $config = GridFieldConfig_RecordEditor::create() ) ); + + $config + ->removeComponentsByType(GridFieldAddNewButton::class) + ->removeComponentsByType(GridFieldDeleteAction::class); } } \ No newline at end of file
Allow more complex editing/viewing of records
silvercommerce_checkout
train
php
3489b036b1138b48c520d675bbe88079949d9275
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -7,6 +7,12 @@ Copyright © 2004-2009 Jason R. Coombs try: from distutils.command.build_py import build_py_2to3 as build_py + # exclude some fixers that break already compatible code + from lib2to3.refactor import get_fixers_from_package + fixers = get_fixers_from_package('lib2to3.fixes') + for skip_fixer in ['import']: + fixers.remove('lib2to3.fixes.fix_' + skip_fixer) + build_py.fixer_names = fixers except ImportError: from distutils.command.build_py import build_py
Added code to suppress a fixer that was causing trouble with absolute imports (see issue<I>)
jaraco_jaraco.util
train
py