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
71647b9a672c54b84dd5b6b0d9f13f5ba246a6c4
diff --git a/lib/gym/options.rb b/lib/gym/options.rb index <HASH>..<HASH> 100644 --- a/lib/gym/options.rb +++ b/lib/gym/options.rb @@ -122,6 +122,11 @@ module Gym conflict_block: proc do |value| UI.user_error!("'#{value.key}' must be false to use 'export_options'") end), + FastlaneCore::ConfigItem.new(key: :just_export, + env_name: "GYM_JUST_EXPORT", + description: "Just export ipa from archive_path. Do not build again. Default false", + is_string: false, + optional: true), # Very optional FastlaneCore::ConfigItem.new(key: :build_path, diff --git a/lib/gym/runner.rb b/lib/gym/runner.rb index <HASH>..<HASH> 100644 --- a/lib/gym/runner.rb +++ b/lib/gym/runner.rb @@ -9,7 +9,9 @@ module Gym def run clear_old_files - build_app + if !Gym.config[:just_export] + build_app + end verify_archive FileUtils.mkdir_p(Gym.config[:output_directory])
adding option to just export ipa from archive_path
fastlane_fastlane
train
rb,rb
5d829d203c467d764d2fa08da828e7b42d0301fd
diff --git a/src/com/caverock/androidsvg/SVGImageView.java b/src/com/caverock/androidsvg/SVGImageView.java index <HASH>..<HASH> 100644 --- a/src/com/caverock/androidsvg/SVGImageView.java +++ b/src/com/caverock/androidsvg/SVGImageView.java @@ -76,6 +76,9 @@ public class SVGImageView extends ImageView private void init(AttributeSet attrs, int defStyle) { + if (isInEditMode()) + return; + TypedArray a = getContext().getTheme() .obtainStyledAttributes(attrs, R.styleable.SVGImageView, defStyle, 0); try
Don't perform SVGImageView initialisation if View is in edit mode.
BigBadaboom_androidsvg
train
java
d31318f3166c7ef4bd98508d031248c1bc7fec01
diff --git a/src/Provider.php b/src/Provider.php index <HASH>..<HASH> 100644 --- a/src/Provider.php +++ b/src/Provider.php @@ -619,7 +619,7 @@ class Provider ); } }, - function () use ($metadataPrefix) { + function () use (&$metadataPrefix) { if (!isset($this->params['metadataPrefix'])) { throw new BadArgumentException("Missing required argument metadataPrefix"); }
Set $metadataPrefix in getRecordListParams() Since the value is set in a closure, it must be passed by reference
picturae_OaiPmh
train
php
c8d98d4b550672501c9eb3bf851c934b97144e78
diff --git a/leveldb/external_test.go b/leveldb/external_test.go index <HASH>..<HASH> 100644 --- a/leveldb/external_test.go +++ b/leveldb/external_test.go @@ -36,7 +36,7 @@ var _ = testutil.Defer(func() { testutil.DoDBTesting(&t) db.TestClose() done <- true - }, 9.0) + }, 20.0) }) Describe("read test", func() {
leveldb: Increase 'write test' timeout to <I> secs
syndtr_goleveldb
train
go
f41bcc8854fb841c582733b8af24125320ae39c4
diff --git a/packages/ws/src/Ws/Services/ExtService.php b/packages/ws/src/Ws/Services/ExtService.php index <HASH>..<HASH> 100644 --- a/packages/ws/src/Ws/Services/ExtService.php +++ b/packages/ws/src/Ws/Services/ExtService.php @@ -51,13 +51,14 @@ class ExtService extends BaseSunat private function processResponse($status) { - $code = intval($status->statusCode); + $originCode = $status->statusCode; + $code = intval($originCode); $result = new StatusResult(); - $result->setCode($code); + $result->setCode($originCode); if ($this->isPending($code)) { - $result->setError($this->getCustomError($code)); + $result->setError($this->getCustomError($originCode)); return $result; } @@ -73,7 +74,7 @@ class ExtService extends BaseSunat } if ($this->isExceptionCode($code)) { - $this->loadErrorByCode($result, $code); + $this->loadErrorByCode($result, $originCode); } return $result;
Preserve original code in getStatus
giansalex_greenter
train
php
4759544f7e03bf1f8c895eb857be7b159c20249b
diff --git a/eth_account/hdaccount/__init__.py b/eth_account/hdaccount/__init__.py index <HASH>..<HASH> 100644 --- a/eth_account/hdaccount/__init__.py +++ b/eth_account/hdaccount/__init__.py @@ -13,5 +13,9 @@ def derive_ethereum_key(seed: bytes, account_index: int=0): def seed_from_mnemonic(words: str, passphrase="") -> bytes: - Mnemonic.detect_language(words) + lang = Mnemonic.detect_language(words) + if not Mnemonic(lang).is_mnemonic_valid(words): + raise ValueError( + f"Provided words: '{words}', are not a valid BIP39 mnemonic phrase!" + ) return Mnemonic.to_seed(words, passphrase)
bug: Do proper check of seed words before deriving key
ethereum_eth-account
train
py
a164cdfe16e7e1acff0c355c00c186c4dae0a8d3
diff --git a/lib/fluent/plugin/out_google_cloud.rb b/lib/fluent/plugin/out_google_cloud.rb index <HASH>..<HASH> 100644 --- a/lib/fluent/plugin/out_google_cloud.rb +++ b/lib/fluent/plugin/out_google_cloud.rb @@ -1236,8 +1236,10 @@ module Fluent {} rescue StandardError => e - @log.error "Failed to set monitored resource labels for #{type}: ", - error: e + if [Platform::GCE, Platform::EC2].include?(@platform) + @log.error "Failed to set monitored resource labels for #{type}: ", + error: e + end {} end
Mute 'Failed to set monitored resource labels for gce_instance' error for GKE On-Prem. (#<I>)
GoogleCloudPlatform_fluent-plugin-google-cloud
train
rb
482c7be239cfd5efc02061b7b2ac34325f04fe50
diff --git a/tests/test_pydocstyle.py b/tests/test_pydocstyle.py index <HASH>..<HASH> 100644 --- a/tests/test_pydocstyle.py +++ b/tests/test_pydocstyle.py @@ -7,6 +7,7 @@ registry = violations.ErrorRegistry _disabled_checks = [ 'D202', # No blank lines allowed after function docstring + 'D205', # 1 blank line required between summary line and description ]
disable D<I> in pylint (#<I>)
tensorlayer_tensorlayer
train
py
97c1ffdb1925c6476881d1c32fb4eb9684c13a0e
diff --git a/proso/release.py b/proso/release.py index <HASH>..<HASH> 100644 --- a/proso/release.py +++ b/proso/release.py @@ -1 +1 @@ -VERSION = '3.3.0' +VERSION = '3.4.0.dev'
start working on <I>.dev
adaptive-learning_proso-apps
train
py
281ec271188d3ae254c9d4700d9bba76074e4553
diff --git a/server/api.go b/server/api.go index <HASH>..<HASH> 100644 --- a/server/api.go +++ b/server/api.go @@ -86,13 +86,12 @@ func (d dexAPI) UpdateClient(ctx context.Context, req *api.UpdateClientReq) (*ap } err := d.s.UpdateClient(req.Id, func(old storage.Client) (storage.Client, error) { - if req.RedirectUris != nil && len(req.RedirectUris) > 0 { + if req.RedirectUris != nil { old.RedirectURIs = req.RedirectUris } - if req.TrustedPeers != nil && len(req.TrustedPeers) > 0 { + if req.TrustedPeers != nil { old.TrustedPeers = req.TrustedPeers } - old.Public = req.Public if req.Name != "" { old.Name = req.Name }
Update also to a list of empty redirect URIs and Peers
dexidp_dex
train
go
d8317c04baeaff39f65e3aa8e1ab6e46f27780df
diff --git a/src/MarkerClusterGroup.js b/src/MarkerClusterGroup.js index <HASH>..<HASH> 100644 --- a/src/MarkerClusterGroup.js +++ b/src/MarkerClusterGroup.js @@ -134,7 +134,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ //If we have already clustered we'll need to add this one to a cluster - newCluster = this._topClusterLevel._recursivelyAddLayer(layer, this._topClusterLevel._zoom); + newCluster = this._topClusterLevel._recursivelyAddLayer(layer, this._topClusterLevel._zoom - 1); this._animationAddLayer(layer, newCluster); @@ -210,7 +210,7 @@ L.MarkerClusterGroup = L.FeatureGroup.extend({ //otherwise, look through all of the markers we haven't managed to cluster and see if we should form a cluster with them if (!used) { - var newCluster = this._clusterOne(unclustered, point, hasChildClusters); + var newCluster = this._clusterOne(unclustered, point); if (newCluster) { newCluster._haveGeneratedChildClusters = hasChildClusters; newCluster._projCenter = this._map.project(newCluster.getLatLng(), zoom);
Pass the right zoom level in so that clustering happens at the right scale
Leaflet_Leaflet.markercluster
train
js
1e4c78a39ec1acb2db3251621f4323fa0a6d7839
diff --git a/src/main/resources/META-INF/resources/primefaces/keyfilter/1-keyfilter.js b/src/main/resources/META-INF/resources/primefaces/keyfilter/1-keyfilter.js index <HASH>..<HASH> 100644 --- a/src/main/resources/META-INF/resources/primefaces/keyfilter/1-keyfilter.js +++ b/src/main/resources/META-INF/resources/primefaces/keyfilter/1-keyfilter.js @@ -47,6 +47,11 @@ PrimeFaces.widget.KeyFilter = PrimeFaces.widget.BaseWidget.extend({ } else if (this.cfg.mask) { input.keyfilter($.fn.keyfilter.defaults.masks[this.cfg.mask]); } + + //disable drop + input.on('drop', function(e) { + e.preventDefault(); + }); if (cfg.preventPaste) { //disable paste
Fix #<I>: Keyfilter prevent drag and drop. (#<I>) * Fix #<I>: Keyfilter prevent drag and drop. * Fix #<I>: Keyfilter prevent drag and drop.
primefaces_primefaces
train
js
330f7f42ef9a0b8be095e91be0cdcf8733723ebc
diff --git a/openquake/risklib/asset.py b/openquake/risklib/asset.py index <HASH>..<HASH> 100644 --- a/openquake/risklib/asset.py +++ b/openquake/risklib/asset.py @@ -658,12 +658,9 @@ def build_asset_array(assets_by_site, tagnames=()): elif field in tagnames: value = asset.tagidxs[tagi[field]] else: - try: - name, lt = field.split('-') - except ValueError: # no - in field - name, lt = 'value', field - # the line below retrieve one of `deductibles` or - # `insurance_limits` ("s" suffix) + name, lt = field.split('-') + # the line below retrieve `.values`, `.deductibles` or + # `.insurance_limits` dictionaries value = getattr(asset, name + 's')[lt] record[field] = value return assetcol, ' '.join(occupancy_periods)
Small cleanup in build_asset_array
gem_oq-engine
train
py
d353eb2b4b284db094cabcbe3a990d0bb2f82a4d
diff --git a/saltapi/netapi/rest_cherrypy.py b/saltapi/netapi/rest_cherrypy.py index <HASH>..<HASH> 100644 --- a/saltapi/netapi/rest_cherrypy.py +++ b/saltapi/netapi/rest_cherrypy.py @@ -65,11 +65,10 @@ class LowDataAdapter(object): @cherrypy.tools.json_out() def GET(self): - # FIXME: how to pass a compound command via lowdata? - lowdata = [ - {'client': 'local', 'tgt': '*', 'fun': 'grains.items'}, - {'client': 'local', 'tgt': '*', 'fun': 'sys.list_functions'}, - ] + lowdata = [{'client': 'local', 'tgt': '*', + 'fun': ['grains.items', 'sys.list_functions'], + 'arg': [[], []], + }] return self.exec_lowdata(lowdata) @cherrypy.tools.json_out()
Change root URL command to issue a compound command
saltstack_salt
train
py
b7363bfc91739163573be91b0d4918203cea848c
diff --git a/distribution/src/test/java/com/orientechnologies/distribution/integration/OIntegrationTestTemplate.java b/distribution/src/test/java/com/orientechnologies/distribution/integration/OIntegrationTestTemplate.java index <HASH>..<HASH> 100644 --- a/distribution/src/test/java/com/orientechnologies/distribution/integration/OIntegrationTestTemplate.java +++ b/distribution/src/test/java/com/orientechnologies/distribution/integration/OIntegrationTestTemplate.java @@ -28,7 +28,7 @@ public abstract class OIntegrationTestTemplate { if (firstTime) { System.out.println("Waiting for OrientDB to startup"); - TimeUnit.SECONDS.sleep(5); + TimeUnit.SECONDS.sleep(1000); firstTime = false; }
Incremented timeout for Integration tests
orientechnologies_orientdb
train
java
ab43dbf7fded1b8995fd158fdfd9392bd4eae605
diff --git a/lib/ProMotion/helpers/motion-table/1st/sectioned_table.rb b/lib/ProMotion/helpers/motion-table/1st/sectioned_table.rb index <HASH>..<HASH> 100644 --- a/lib/ProMotion/helpers/motion-table/1st/sectioned_table.rb +++ b/lib/ProMotion/helpers/motion-table/1st/sectioned_table.rb @@ -101,7 +101,7 @@ module ProMotion::MotionTable expectedArguments = self.method(action).arity if expectedArguments == 0 self.send(action) - elsif expectedArguments == 1 + elsif expectedArguments == 1 || expectedArguments == -1 self.send(action, arguments) else MotionTable::Console.log("MotionTable warning: #{action} expects #{expectedArguments} arguments. Maximum number of required arguments for an action is 1.", withColor: MotionTable::Console::RED_COLOR)
Finally accounted for -1 arguments.
infinitered_ProMotion
train
rb
75f6c8c0bc11cb5f0b514474da9fdf0f45cda66c
diff --git a/lib/commander/runner.rb b/lib/commander/runner.rb index <HASH>..<HASH> 100644 --- a/lib/commander/runner.rb +++ b/lib/commander/runner.rb @@ -66,7 +66,7 @@ module Commander # program :help, 'Copyright', '2008 TJ Holowaychuk' # program :help, 'Anything', 'You want' # program :int_message 'Bye bye!' - # + # # # Get data # program :name # => 'Commander' # @@ -86,7 +86,7 @@ module Commander @program[:help][args.first] = args[1] else @program[key] = *args unless args.empty? - @program[key] if args.empty? + @program[key] end end
Misc refactorings to #program
commander-rb_commander
train
rb
f4237fc7db1a20deeb9dcc7a23af93a52b96fef9
diff --git a/DependencyInjection/RomaricDrigonOrchestraExtension.php b/DependencyInjection/RomaricDrigonOrchestraExtension.php index <HASH>..<HASH> 100644 --- a/DependencyInjection/RomaricDrigonOrchestraExtension.php +++ b/DependencyInjection/RomaricDrigonOrchestraExtension.php @@ -28,7 +28,13 @@ class RomaricDrigonOrchestraExtension extends Extension $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); + // Register services $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.xml'); + + // We must also add our bundle to Assetic configuration + $asseticBundle = $container->getParameter('assetic.bundles'); + $asseticBundle[] = 'RomaricDrigonOrchestraBundle'; + $container->setParameter('assetic.bundles', $asseticBundle); } }
Enabled Assetic for our bundle
romaricdrigon_OrchestraBundle
train
php
ccdbf76f4c2c0fc248f96430c270a0035e242595
diff --git a/packages/webiny-app-cms/src/editor/plugins/elementSettings/align/HorizontalAlignAction.js b/packages/webiny-app-cms/src/editor/plugins/elementSettings/align/HorizontalAlignAction.js index <HASH>..<HASH> 100644 --- a/packages/webiny-app-cms/src/editor/plugins/elementSettings/align/HorizontalAlignAction.js +++ b/packages/webiny-app-cms/src/editor/plugins/elementSettings/align/HorizontalAlignAction.js @@ -47,7 +47,9 @@ export default compose( options: { alignments } = defaultOptions }) => { return () => { - const types = Object.keys(icons).filter(key => alignments.includes(key)); + const types = Object.keys(icons).filter(key => + alignments ? alignments.includes(key) : true + ); const nextAlign = types[types.indexOf(align) + 1] || "left";
Fix horizontal align when alignment options are not defined.
Webiny_webiny-js
train
js
91648e4be3b5cf4771ccfecefaeed36a51af3193
diff --git a/packages/cozy-client/src/cli/index.js b/packages/cozy-client/src/cli/index.js index <HASH>..<HASH> 100644 --- a/packages/cozy-client/src/cli/index.js +++ b/packages/cozy-client/src/cli/index.js @@ -192,4 +192,22 @@ const createClientInteractive = (clientOptions, serverOpts) => { }) } +const main = async () => { + const client = await createClientInteractive({ + scope: ['io.cozy.files'], + uri: 'http://cozy.tools:8080', + oauth: { + softwareID: 'io.cozy.client.cli' + } + }) + console.log(client.toJSON()) +} + +if (require.main === module) { + main().catch(e => { + console.error(e) + process.exit(1) + }) +} + export { createClientInteractive }
feat: Add test CLI for createClientInteractive
cozy_cozy-client
train
js
d10e9330a06fc5469aa61a28e7fcf76d0a01db37
diff --git a/src/Torann/GeoIP/GeoIP.php b/src/Torann/GeoIP/GeoIP.php index <HASH>..<HASH> 100644 --- a/src/Torann/GeoIP/GeoIP.php +++ b/src/Torann/GeoIP/GeoIP.php @@ -113,8 +113,10 @@ class GeoIP { private function find( $ip = null ) { // Check Session - if ( $ip === null && $position = $this->session->get('geoip-location') ) { - if($position['ip'] === $this->remote_ip) { + if ( $ip === null && $position = $this->session->get('geoip-location') ) + { + // TODO: Remove default check on 2/28/14 + if(isset($position['default']) && $position['ip'] === $this->remote_ip) { return $position; } }
Position object in the session causes bugs, this fixes it. Remove on 2/<I>/<I>
Torann_laravel-geoip
train
php
def4c5b58c046a66e166666791afb97be5c10d2b
diff --git a/examples/01_empty_window.rb b/examples/01_empty_window.rb index <HASH>..<HASH> 100644 --- a/examples/01_empty_window.rb +++ b/examples/01_empty_window.rb @@ -3,10 +3,10 @@ # http://library.gnome.org/devel/gtk-tutorial/2.90/c39.html # $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib') -require 'girffi/builder' +require 'girffi' -GirFFI::Builder.build_module 'GObject' -GirFFI::Builder.build_module 'Gtk' +GirFFI.setup :GObject +GirFFI.setup :Gtk GirFFI::Builder.build_class 'Gtk', 'Window' (my_len, my_args) = Gtk.init ARGV.length + 1, [$0, *ARGV] diff --git a/lib/girffi.rb b/lib/girffi.rb index <HASH>..<HASH> 100644 --- a/lib/girffi.rb +++ b/lib/girffi.rb @@ -32,5 +32,11 @@ module GirFFI end # module GirFfi require 'girffi/irepository' +require 'girffi/builder' +module GirFFI + def self.setup modul + GirFFI::Builder.build_module modul.to_s + end +end # EOF
Provide a GirFFI#setup method to setup the namespaces.
mvz_gir_ffi
train
rb,rb
e0ad7b55839a296269f6c520910f1163a4157cf6
diff --git a/src/Saxulum/DoctrineMongoDb/Provider/DoctrineMongoDbProvider.php b/src/Saxulum/DoctrineMongoDb/Provider/DoctrineMongoDbProvider.php index <HASH>..<HASH> 100644 --- a/src/Saxulum/DoctrineMongoDb/Provider/DoctrineMongoDbProvider.php +++ b/src/Saxulum/DoctrineMongoDb/Provider/DoctrineMongoDbProvider.php @@ -15,7 +15,8 @@ class DoctrineMongoDbProvider implements ServiceProviderInterface { $container['mongodb.default_options'] = array( 'server' => 'mongodb://localhost:27017', - 'options' => array() + 'options' => array(), + 'driver.options' => array() /** @link http://www.php.net/manual/en/mongoclient.construct.php */ ); @@ -58,7 +59,7 @@ class DoctrineMongoDbProvider implements ServiceProviderInterface } $mongodbs[$name] = function () use ($options, $config, $manager) { - return new Connection($options['server'], $options['options'], $config, $manager); + return new Connection($options['server'], $options['options'], $config, $manager, $options['driver.options'] ?: array()); }; }
feat(): Optionally allow the specification of driver options
saxulum_saxulum-doctrine-mongodb-provider
train
php
b95c76f084fe5b16c10bda5ec2922c892de50621
diff --git a/closure/goog/graphics/canvaselement.js b/closure/goog/graphics/canvaselement.js index <HASH>..<HASH> 100644 --- a/closure/goog/graphics/canvaselement.js +++ b/closure/goog/graphics/canvaselement.js @@ -626,7 +626,8 @@ goog.graphics.CanvasTextElement.prototype.updateText_ = function() { if (this.x1_ == this.x2_) { // Special case vertical text this.innerElement_.innerHTML = - goog.array.map(this.text_.split(''), goog.string.htmlEscape). + goog.array.map(this.text_.split(''), + function(entry) { return goog.string.htmlEscape(entry); }). join('<br>'); } else { this.innerElement_.innerHTML = goog.string.htmlEscape(this.text_);
Don't pass the extra parameters of goog.array.map callback to the htmlEscape function. R=chrishenry DELTA=2 (1 added, 0 deleted, 1 changed) Revision created by MOE tool push_codebase. MOE_MIGRATION=<I> git-svn-id: <URL>
google_closure-library
train
js
239a9c97c1848c633e5d2d526e738926fc387b59
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -16,14 +16,18 @@ { if ( this.doneFn && this.processes === 1 && this.queue.length === 0 ) { - this.doneFn() + this.doneFn( this.errors.length !== 0 ? this.errors : null, this.results ) } } - function nextQueue() + function nextQueue( err, result ) { this.processes-- + typeof err !== 'undefined' && this.errors.push( err ) + + typeof result !== 'undefined' && this.results.push( result ) + processQueue.call( this ) } @@ -59,6 +63,10 @@ this.queue = [] this.doneFn = null + + this.errors = [] + + this.results = [] } Queue.prototype.add = function ( fn )
pass errors and results to done callback
kvonflotow_nbqueue
train
js
10085fc3de0d78fade7275134c57addd66020f66
diff --git a/src/Artistas/PagSeguroConfig.php b/src/Artistas/PagSeguroConfig.php index <HASH>..<HASH> 100644 --- a/src/Artistas/PagSeguroConfig.php +++ b/src/Artistas/PagSeguroConfig.php @@ -2,7 +2,6 @@ namespace Artistas\PagSeguro; -use Illuminate\Config\Repository as Config; use Illuminate\Log\Writer as Log; use Illuminate\Session\SessionManager as Session; use Illuminate\Validation\Factory as Validator; diff --git a/src/Artistas/routes.php b/src/Artistas/routes.php index <HASH>..<HASH> 100644 --- a/src/Artistas/routes.php +++ b/src/Artistas/routes.php @@ -10,4 +10,4 @@ Route::get('/pagseguro/session/reset', function () { Route::get('/pagseguro/javascript', function () { return file_get_contents(\PagSeguro::getUrl()['javascript']); -}); \ No newline at end of file +});
Applied fixes from StyleCI (#<I>)
artistas_laravel-pagseguro
train
php,php
8adaa670a50881d90031c28041528043ada9dab6
diff --git a/tests/FluentDOMStyleTest.php b/tests/FluentDOMStyleTest.php index <HASH>..<HASH> 100644 --- a/tests/FluentDOMStyleTest.php +++ b/tests/FluentDOMStyleTest.php @@ -54,6 +54,12 @@ class FluentDOMStyleTest extends PHPUnit_Framework_TestCase { $this->assertTrue($items instanceof FluentDOMStyle); $this->assertEquals(NULL, $items->css('text-align')); } + + function testCSSReadOnTextNodes() { + $items = FluentDOMStyle(self::HTML)->find('//div')->children()->andSelf(); + $this->assertTrue(count($items) > 3); + $this->assertEquals('left', $items->css('text-align')); + } function testCSSWriteWithString() { $items = FluentDOMStyle(self::HTML)->find('//div');
FluentDOMStyleTest: - added: test for reading on a list that includes text nodes
ThomasWeinert_FluentDOM
train
php
f8d4fc560ea32316dc2ee1956fcc1e2b7635c18f
diff --git a/leaflet.photon.js b/leaflet.photon.js index <HASH>..<HASH> 100644 --- a/leaflet.photon.js +++ b/leaflet.photon.js @@ -225,6 +225,7 @@ L.Control.Photon = L.Control.extend({ detailsContainer = L.DomUtil.create('small', '', el), details = []; title.innerHTML = feature.properties.name; + details.push(this.formatType(feature)); if (feature.properties.city && feature.properties.city !== feature.properties.name) { details.push(feature.properties.city); } @@ -236,6 +237,14 @@ L.Control.Photon = L.Control.extend({ return (this.options.formatResult || this._formatResult).call(this, feature, el); }, + formatType: function (feature) { + return (this.options.formatType || this._formatType).call(this, feature); + }, + + _formatType: function (feature) { + return feature.properties.osm_value; + }, + createResult: function (feature) { var el = L.DomUtil.create('li', '', this.resultsContainer); this.formatResult(feature, el);
First shot in displaying OSM type in results (overridable)
komoot_leaflet.photon
train
js
1e937fcdd134332f325c87ee872c8b81e4c06830
diff --git a/umap/umap_.py b/umap/umap_.py index <HASH>..<HASH> 100644 --- a/umap/umap_.py +++ b/umap/umap_.py @@ -2,6 +2,7 @@ # # License: BSD 3 clause from __future__ import print_function +from past.builtins import basestring from warnings import warn import time @@ -1501,10 +1502,19 @@ class UMAP(BaseEstimator): "target_n_neighbors must be greater than 2" ) if not isinstance(self.n_components, int): + if isinstance(self.n_components, basestring): + raise ValueError( + "n_components must be an int" + ) + if self.n_components % 1 != 0: + raise ValueError("n_components must be a whole number") try: + # this will convert other types of int (eg. numpy int64) to Python int self.n_components = int(self.n_components) except ValueError: - raise ValueError("n_components must be an int") + raise ValueError( + "n_components must be an int" + ) if self.n_components < 1: raise ValueError( "n_components must be greater than 0"
make sure to raise errors if n_components is string or float
lmcinnes_umap
train
py
20b9aad3df183622744852d4b7663bfd7beac175
diff --git a/invenio_base/app.py b/invenio_base/app.py index <HASH>..<HASH> 100644 --- a/invenio_base/app.py +++ b/invenio_base/app.py @@ -34,6 +34,7 @@ import click import pkg_resources from flask import Flask from flask.cli import FlaskGroup +from flask.helpers import get_debug_flag from .cmd import instance @@ -157,7 +158,7 @@ def create_cli(create_app=None): info.create_app = None app = info.load_app() else: - app = create_app(debug=getattr(info, 'debug', False)) + app = create_app(debug=get_debug_flag()) return app @click.group(cls=FlaskGroup, create_app=create_cli_app) @@ -165,7 +166,7 @@ def create_cli(create_app=None): """Command Line Interface for Invenio.""" pass - # Add command for startin new Invenio instances. + # Add command for starting new Invenio instances. cli.add_command(instance) return cli
app: debug state initialization fix * Fixes issue with Flask not setting app.debug until after the application creation, causing e.g. template auto-reloading or Flask-DebugToolbar to not be correctly initialized.
inveniosoftware_invenio-base
train
py
ca6c8b6aca059bc6668cfb89fa7971a02b1fe8aa
diff --git a/src/deep-security/lib/Token.js b/src/deep-security/lib/Token.js index <HASH>..<HASH> 100644 --- a/src/deep-security/lib/Token.js +++ b/src/deep-security/lib/Token.js @@ -490,7 +490,7 @@ export class Token { * @returns {AWS.CognitoIdentityCredentials} */ get credentials() { - if (!this._credentials) { + if (!this.validCredentials(this._credentials)) { this._credentials = this._createCognitoIdentityCredentials(); }
# Fix lambda requests CORS issue
MitocGroup_deep-framework
train
js
cc18740e9348c78762a9f95c973e4381bcaae8bc
diff --git a/lxd/api_cluster.go b/lxd/api_cluster.go index <HASH>..<HASH> 100644 --- a/lxd/api_cluster.go +++ b/lxd/api_cluster.go @@ -1204,7 +1204,7 @@ func clusterNodesPost(d *Daemon, r *http.Request) response.Response { return response.InternalError(err) } - d.State().Events.SendLifecycle(projectParam(r), lifecycle.ClusterTokenCreated.Event("", op.Requestor(), nil)) + d.State().Events.SendLifecycle(projectParam(r), lifecycle.ClusterTokenCreated.Event("members", op.Requestor(), nil)) return operations.OperationResponse(op) }
lxd/api/cluster: use 'members' as name for ClusterTokenCreated lifecycle event
lxc_lxd
train
go
71f4383d18a3980bf70c9848b1d7156a4eaaba0b
diff --git a/lib/jekyll/regenerator.rb b/lib/jekyll/regenerator.rb index <HASH>..<HASH> 100644 --- a/lib/jekyll/regenerator.rb +++ b/lib/jekyll/regenerator.rb @@ -130,7 +130,9 @@ module Jekyll # # Returns nothing. def write_metadata - File.binwrite(metadata_file, Marshal.dump(metadata)) + unless disabled? + File.binwrite(metadata_file, Marshal.dump(metadata)) + end end # Produce the absolute path of the metadata file diff --git a/test/test_regenerator.rb b/test/test_regenerator.rb index <HASH>..<HASH> 100644 --- a/test/test_regenerator.rb +++ b/test/test_regenerator.rb @@ -305,4 +305,23 @@ class TestRegenerator < JekyllUnitTest assert @regenerator.modified?(@path) end end + + context "when incremental regen is disabled" do + setup do + FileUtils.rm_rf(source_dir(".jekyll-metadata")) + @site = Site.new(Jekyll.configuration({ + "source" => source_dir, + "destination" => dest_dir, + "incremental" => false + })) + + @site.process + @path = @site.in_source_dir(@site.pages.first.path) + @regenerator = @site.regenerator + end + + should "not create .jekyll-metadata" do + refute File.file?(source_dir(".jekyll-metadata")) + end + end end
Fix #<I>: Make sure that .jekyll-metadata is not generated when not needed.
jekyll_jekyll
train
rb,rb
801ab9020763543b789b9af0efa8127e0db0ec54
diff --git a/locator-init/src/main/java/org/talend/esb/locator/server/init/internal/RootNodeInitializer.java b/locator-init/src/main/java/org/talend/esb/locator/server/init/internal/RootNodeInitializer.java index <HASH>..<HASH> 100644 --- a/locator-init/src/main/java/org/talend/esb/locator/server/init/internal/RootNodeInitializer.java +++ b/locator-init/src/main/java/org/talend/esb/locator/server/init/internal/RootNodeInitializer.java @@ -73,8 +73,8 @@ public class RootNodeInitializer implements Watcher { try { zk = new ZooKeeper(locatorEndpoints, 5000, this); } catch (IOException e) { - if (LOG.isLoggable(Level.SEVERE)) { - LOG.log(Level.SEVERE, "Failed to create ZooKeeper client", e); + if (LOG.isLoggable(Level.INFO)) { + LOG.log(Level.INFO, "Failed to create ZooKeeper client", e); } } }
Downgrade message level from error to info.
Talend_tesb-rt-se
train
java
ea0d6b83ce6f7ccd97f4e8165fe52af0c4b1fc1a
diff --git a/lib/did_you_mean/tree_spell_checker.rb b/lib/did_you_mean/tree_spell_checker.rb index <HASH>..<HASH> 100644 --- a/lib/did_you_mean/tree_spell_checker.rb +++ b/lib/did_you_mean/tree_spell_checker.rb @@ -4,7 +4,7 @@ module DidYouMean # spell checker for a dictionary that has a tree # structure, see doc/tree_spell_checker_api.md class TreeSpellChecker - attr_reader :dictionary, :dimensions, :separator, :augment + attr_reader :dictionary, :separator, :augment def initialize(dictionary:, separator: '/', augment: nil) @dictionary = dictionary
✂️ 'warning: method redefined; discarding old dimensions'
yuki24_did_you_mean
train
rb
2083eee7f7dd12caf9871f803c319e6510d9b6aa
diff --git a/salt/utils/process.py b/salt/utils/process.py index <HASH>..<HASH> 100644 --- a/salt/utils/process.py +++ b/salt/utils/process.py @@ -223,9 +223,15 @@ class ThreadPool(object): while True: # 1s timeout so that if the parent dies this thread will die within 1s try: - func, args, kwargs = self._job_queue.get(timeout=1) - self._job_queue.task_done() # Mark the task as done once we get it - except queue.Empty: + try: + func, args, kwargs = self._job_queue.get(timeout=1) + self._job_queue.task_done() # Mark the task as done once we get it + except queue.Empty: + continue + except AttributeError: + # During shutdown, `queue` may not have an `Empty` atttribute. Thusly, + # we have to catch a possible exception from our exception handler in + # order to avoid an unclean shutdown. Le sigh. continue try: log.debug('ThreadPool executing func: {0} with args:{1}'
Catch a possible error on shutdown Catches a condition where our exception handler might itself raise an exception on shutdown.
saltstack_salt
train
py
872de8a89bd1d6956aed039d77cf690b5b8d4de1
diff --git a/holoviews/plotting/bokeh/element.py b/holoviews/plotting/bokeh/element.py index <HASH>..<HASH> 100644 --- a/holoviews/plotting/bokeh/element.py +++ b/holoviews/plotting/bokeh/element.py @@ -2033,8 +2033,8 @@ class OverlayPlot(GenericOverlayPlot, LegendPlot): hover_renderers = [] if hover.renderers == 'auto' else hover.renderers renderers = tool_renderers + hover_renderers tool.renderers = list(util.unique_iterator(renderers)) - if 'hover' not in self.handles: - self.handles['hover'] = tool + if 'hover' not in self.handles: + self.handles['hover'] = tool def _get_factors(self, overlay, ranges):
Fixed bug in bokeh HoverTool lookup (#<I>)
pyviz_holoviews
train
py
f45912b07bd92e6709215f7279b061676d76efa1
diff --git a/colorful/__init__.py b/colorful/__init__.py index <HASH>..<HASH> 100644 --- a/colorful/__init__.py +++ b/colorful/__init__.py @@ -4,6 +4,6 @@ from django.utils import version __all__ = ['VERSION', '__version__'] -VERSION = (1, 2, 1, 'alpha', 0) +VERSION = (1, 3, 0, 'final', 0) __version__ = version.get_version(VERSION)
Bumped version number to <I>.
charettes_django-colorful
train
py
b9d4bb86dbabb35aa47fef79aac4015b07e4e063
diff --git a/pymc/distributions/continuous.py b/pymc/distributions/continuous.py index <HASH>..<HASH> 100644 --- a/pymc/distributions/continuous.py +++ b/pymc/distributions/continuous.py @@ -1532,6 +1532,7 @@ class Laplace(Continuous): \frac{1}{2b} \exp \left\{ - \frac{|x - \mu|}{b} \right\} .. plot:: + :context: close-figs import matplotlib.pyplot as plt import numpy as np @@ -1557,9 +1558,9 @@ class Laplace(Continuous): Parameters ---------- - mu: float + mu : tensor_like of float Location parameter. - b: float + b : tensor_like of float Scale parameter (b > 0). """ rv_op = laplace @@ -1585,7 +1586,7 @@ class Laplace(Continuous): Parameters ---------- - value: numeric or np.ndarray or aesara.tensor + value : tensor_like of float Value(s) for which log CDF is calculated. If the log CDF for multiple values are desired the values must be provided in a numpy array or Aesara tensor.
Update pymc.Laplace docsting (#<I>) * fixed pymc.Laplace docsting * fixed pymc.Laplace docsting
pymc-devs_pymc
train
py
f4a46e935b01fb21308feb757ffd5c66e880ce0d
diff --git a/haproxy/datadog_checks/haproxy/haproxy.py b/haproxy/datadog_checks/haproxy/haproxy.py index <HASH>..<HASH> 100644 --- a/haproxy/datadog_checks/haproxy/haproxy.py +++ b/haproxy/datadog_checks/haproxy/haproxy.py @@ -237,6 +237,9 @@ class HAProxy(AgentCheck): custom_tags = [] if custom_tags is None else custom_tags active_tag = [] if active_tag is None else active_tag + # First initialize here so that it is defined whether or not we enter the for loop + line_tags = list(custom_tags) + # Skip the first line, go backwards to set back_or_front for line in data[:0:-1]: if not line.strip():
Fix error in case of empty stat info (#<I>)
DataDog_integrations-core
train
py
3a5299eb58e7e2ff735be5e78a799faf8fd1a064
diff --git a/src/extensions/renderer/canvas/drawing-redraw.js b/src/extensions/renderer/canvas/drawing-redraw.js index <HASH>..<HASH> 100644 --- a/src/extensions/renderer/canvas/drawing-redraw.js +++ b/src/extensions/renderer/canvas/drawing-redraw.js @@ -482,7 +482,7 @@ CRp.render = function( options ){ } var extent = cy.extent(); - var vpManip = (r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming || r.hoverData.draggingEles); + var vpManip = (r.pinching || r.hoverData.dragging || r.swipePanning || r.data.wheelZooming || r.hoverData.draggingEles || r.cy.animated()); var hideEdges = r.hideEdgesOnViewport && vpManip; var needMbClear = [];
Include the animated viewport case for `hideEdgesOnViewport ` Ref : Hide edges on viewport animation #<I>
cytoscape_cytoscape.js
train
js
627c0aa6431ad67c6575851b85630856eb5448d8
diff --git a/modules/system/classes/CombineAssets.php b/modules/system/classes/CombineAssets.php index <HASH>..<HASH> 100644 --- a/modules/system/classes/CombineAssets.php +++ b/modules/system/classes/CombineAssets.php @@ -140,7 +140,7 @@ class CombineAssets * Minification filters */ if ($this->useMinify) { - $this->registerFilter('js', new \Assetic\Filter\JSMinFilter); + $this->registerFilter('js', new \Assetic\Filter\JSqueezeFilter); $this->registerFilter(['css', 'less', 'scss'], new \October\Rain\Parse\Assetic\StylesheetMinify); }
Replaced JSMin with JSqueeze
octobercms_october
train
php
164222b6fe53e01fbcda84595e1e596535a837a9
diff --git a/spring-jdbc-oracle/src/main/java/com/github/ferstl/spring/jdbc/oracle/OracleJdbcTemplate.java b/spring-jdbc-oracle/src/main/java/com/github/ferstl/spring/jdbc/oracle/OracleJdbcTemplate.java index <HASH>..<HASH> 100644 --- a/spring-jdbc-oracle/src/main/java/com/github/ferstl/spring/jdbc/oracle/OracleJdbcTemplate.java +++ b/spring-jdbc-oracle/src/main/java/com/github/ferstl/spring/jdbc/oracle/OracleJdbcTemplate.java @@ -32,7 +32,10 @@ import org.springframework.jdbc.core.ParameterizedPreparedStatementSetter; * are processed as a whole, so it is not possible to find out the number of updated rows for each individual statement * in a batch. For example, if the batch size is set to 5 and a batch update containing 7 statements * (each of which updates exactly one row) is executed, the result will be {@code [0, 0, 0, 0, 5, 0, 2]}. + * + * @deprecated as of 12c the Oracle JDBC driver supports JDBC update batching and the proprietary API is deprecated */ +@Deprecated public class OracleJdbcTemplate extends JdbcTemplate { private final int sendBatchSize;
Deprecate OracleJdbcTemplate As of <I>c the Oracle JDBC driver supports JDBC update batching and the proprietary API is deprecated therefore OracleJdbcTemplate should be deprecated as well.
ferstl_spring-jdbc-oracle
train
java
6383be6b2a1ccc103a0b257550ea98df4d3cfe67
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -6,8 +6,7 @@ var eslintFilter = filter('**/*.js', { restore: true }); stagedFiles() .pipe(eslintFilter) - .pipe(eslint({ - useEslintrc: true - })) + .pipe(eslint()) .pipe(eslint.format()) - .pipe(eslint.failAfterError()); + .pipe(eslint.failAfterError()) + .pipe(eslintFilter.restore);
Removed useEslintrc option since it's true by default
okonet_lint-staged
train
js
868c8e1c5b0a940b1179582603bb67167bead2d2
diff --git a/scapy/base_classes.py b/scapy/base_classes.py index <HASH>..<HASH> 100644 --- a/scapy/base_classes.py +++ b/scapy/base_classes.py @@ -14,6 +14,7 @@ Generators and packet meta classes. import re,random,socket import config import error +import types class Gen(object): def __iter__(self): @@ -36,7 +37,9 @@ class SetGen(Gen): while j <= i[1]: yield j j += 1 - elif isinstance(i, Gen) and (self._iterpacket or not isinstance(i,BasePacket)): + elif (isinstance(i, Gen) and + (self._iterpacket or not isinstance(i,BasePacket))) or ( + isinstance(i, (xrange, types.GeneratorType))): for j in i: yield j else:
Accept generators and xrange objects as field values
secdev_scapy
train
py
de85b201951938aad691db20ab77098be2a0b587
diff --git a/wptools/core.py b/wptools/core.py index <HASH>..<HASH> 100644 --- a/wptools/core.py +++ b/wptools/core.py @@ -248,7 +248,7 @@ class WPTools: https://www.wikidata.org/w/api.php?action=help&modules=wbgetentities """ if not self.wikibase: - print("instance needs a wikibase") + print("instance needs a wikibase", file=sys.stderr) return if self._skip_get('get_wikidata'): return @@ -315,7 +315,7 @@ class WPTools: # NOTE: json.dumps and pprint show unicode literals print(header, file=sys.stderr) - print("{") + print("{", file=sys.stderr) for item in sorted(data): - print(" %s: %s" % (item, data[item])) - print("}") + print(" %s: %s" % (item, data[item]), file=sys.stderr) + print("}", file=sys.stderr)
print only to stderr in core
siznax_wptools
train
py
68f4ee7ff2b7e6392d962569df1b97afe9206829
diff --git a/javascript/libjoynr-js/src/main/js/joynr/capabilities/CapabilitiesStore.js b/javascript/libjoynr-js/src/main/js/joynr/capabilities/CapabilitiesStore.js index <HASH>..<HASH> 100644 --- a/javascript/libjoynr-js/src/main/js/joynr/capabilities/CapabilitiesStore.js +++ b/javascript/libjoynr-js/src/main/js/joynr/capabilities/CapabilitiesStore.js @@ -227,7 +227,7 @@ define( */ var checkAge = function checkAge(discoveryEntry, maxAge) { var registrationTime = registeredCapabilitiesTime[hashCode(discoveryEntry)]; - if (registrationTime === undefined || maxAge === undefined) { + if (registrationTime === undefined || maxAge === undefined || maxAge < 0) { return true; } return (Date.now() - registrationTime <= maxAge);
[JS] CapabilitiesStore.checkAge ignores negative max ages This way, the age of capabilities can be ignored Change-Id: I0e4cee<I>e<I>fdb<I>b6f5a<I>c0bc<I>bfa6b1
bmwcarit_joynr
train
js
7d82c4a44024a763d511d98a29e7f1196fde4dca
diff --git a/jOOX/src/main/java/org/joox/Impl.java b/jOOX/src/main/java/org/joox/Impl.java index <HASH>..<HASH> 100644 --- a/jOOX/src/main/java/org/joox/Impl.java +++ b/jOOX/src/main/java/org/joox/Impl.java @@ -1884,6 +1884,7 @@ class Impl implements Match { return write(new OutputStreamWriter(stream)); } + @SuppressWarnings("resource") @Override public final Match write(File file) throws IOException { return write(new FileOutputStream(file));
The resource is always closed, in another method
jOOQ_jOOX
train
java
24e7eb4a241ddada18fb6ef391129d4e3699e52f
diff --git a/scripts/compile-tsc.js b/scripts/compile-tsc.js index <HASH>..<HASH> 100644 --- a/scripts/compile-tsc.js +++ b/scripts/compile-tsc.js @@ -1,3 +1,5 @@ +/* eslint-disable no-console */ +// tslint:disable:no-console const fs = require('fs'); const path = require('path'); const shell = require('shelljs');
Fix lint by allowing console in build-tsc.js
storybooks_storybook
train
js
cea6ebda5b86b226595d26920b12685eb339f71f
diff --git a/src/Symfony/Component/Security/Core/Security.php b/src/Symfony/Component/Security/Core/Security.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Security/Core/Security.php +++ b/src/Symfony/Component/Security/Core/Security.php @@ -13,6 +13,7 @@ namespace Symfony\Component\Security\Core; use Psr\Container\ContainerInterface; use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; +use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; use Symfony\Component\Security\Core\User\UserInterface; /** @@ -20,7 +21,7 @@ use Symfony\Component\Security\Core\User\UserInterface; * * @final */ -class Security +class Security implements AuthorizationCheckerInterface { const ACCESS_DENIED_ERROR = '_security.403_error'; const AUTHENTICATION_ERROR = '_security.last_error';
[Security] class Security implements AuthorizationCheckerInterface The class has the method of AuthorizationCheckerInterface already.
symfony_symfony
train
php
d621c79d82820bfb3561b419ed3364e37b242036
diff --git a/src/integration/helpers/to_map.go b/src/integration/helpers/to_map.go index <HASH>..<HASH> 100644 --- a/src/integration/helpers/to_map.go +++ b/src/integration/helpers/to_map.go @@ -1,14 +1,13 @@ package helpers -import ( - influxdb "github.com/influxdb/influxdb-go" -) +import "common" -func ToMap(series *influxdb.Series) []map[string]interface{} { - points := make([]map[string]interface{}, 0, len(series.Points)) - for _, p := range series.Points { +func ToMap(series common.ApiSeries) []map[string]interface{} { + seriesPoints := series.GetPoints() + points := make([]map[string]interface{}, 0, len(seriesPoints)) + for _, p := range seriesPoints { point := map[string]interface{}{} - for idx, column := range series.Columns { + for idx, column := range series.GetColumns() { point[column] = p[idx] } points = append(points, point)
make ToMap work with any ApiSeries
influxdata_influxdb
train
go
b3100800e68228ce7b84b32aac97e0e4ec08bb45
diff --git a/public/vendor/aperture-slider/aperture-slider.js b/public/vendor/aperture-slider/aperture-slider.js index <HASH>..<HASH> 100644 --- a/public/vendor/aperture-slider/aperture-slider.js +++ b/public/vendor/aperture-slider/aperture-slider.js @@ -157,7 +157,7 @@ var ApertureSlider = function (apertureDiv, frameCount, width, minHeight) { /** * slide to next frame * - * @param {Function} callBack [optional] is called when sliding is complete + * @param {Function} [callBack] is called when sliding is complete */ me.goForward = function (callBack) { if (currentFrame < frameCount) { @@ -168,7 +168,7 @@ var ApertureSlider = function (apertureDiv, frameCount, width, minHeight) { /** * Slide to last frame * - * @param {Function} callBack [optional] is called when sliding is complete + * @param {Function} [callBack] is called when sliding is complete */ me.goBack = function (callBack) { if (currentFrame != 1) {
facator block ui in apps
reliv_Rcm
train
js
e785e8dc5f250b52df0e8d9a4906d2ff63858c4d
diff --git a/src/Mautic/Form.php b/src/Mautic/Form.php index <HASH>..<HASH> 100644 --- a/src/Mautic/Form.php +++ b/src/Mautic/Form.php @@ -170,6 +170,7 @@ class Form if ($contactIp = $contact->getIp()) { $request['header'][] = "X-Forwarded-For: $contactIp"; + $request['header'][] = "Client-Ip: $contactIp"; } if ($sessionId = $contact->getSessionId()) {
fix(client IP): Add additional header in form request - Add a new header Client-Ip: w.x.y.z while submitting the form
escopecz_mautic-form-submit
train
php
49c319c1233657c37c78d9f7bb3ce446ff59283a
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -13,9 +13,16 @@ function get(url) { if (url.length <= 0 || typeof url !== 'string') { throw Error("A valid URL is required"); } + + var options = { + hostname: url, + agent: false, + rejectUnauthorized: false, + ciphers: "ALL", + }; return new Promise(function (resolve, reject) { - var req = https.get({hostname: url, agent: false, rejectUnauthorized: false}, function (res) { + var req = https.get(options, function (res) { var certificate = res.socket.getPeerCertificate(); if(isEmpty(certificate) || certificate === null) { reject({message: 'The website did not provide a certificate'});
sets ciphers: "ALL" on https request
johncrisostomo_get-ssl-certificate
train
js
8e30d88abe492cda44b8b0378c4e80dd4b22387c
diff --git a/src/trace-plugin-interface.js b/src/trace-plugin-interface.js index <HASH>..<HASH> 100644 --- a/src/trace-plugin-interface.js +++ b/src/trace-plugin-interface.js @@ -249,7 +249,8 @@ function createRootSpan_(api, options, skipFrames) { incomingTraceContext = api.agent_.parseContextFromHeader(options.traceContext); } incomingTraceContext = incomingTraceContext || {}; - if (options.url && !api.agent_.shouldTrace(options.url, incomingTraceContext.options)) { + if (!api.agent_.shouldTrace(options.url || '', + incomingTraceContext.options)) { return null; } var rootContext = api.agent_.createRootSpanData(options.name,
Bugfix for creating root spans through plugin API (#<I>) PR-URL: #<I>
keymetrics_trassingue
train
js
01d9f5c43165154e09b92d9a42273e7ab83ead82
diff --git a/lib/buffer_concat_polyfill.js b/lib/buffer_concat_polyfill.js index <HASH>..<HASH> 100644 --- a/lib/buffer_concat_polyfill.js +++ b/lib/buffer_concat_polyfill.js @@ -17,10 +17,10 @@ function polyfill(list, totalLength) { i = 0; // @see http://nodejs.org/api/buffer.html#buffer_class_method_buffer_concat_list_totallength - if (list.length === 0 || size === 0) { - return new Buffer(0); - } else if (list.length === 1) { + if (list.length === 1) { return list[0]; + } else if (list.length === 0 || size === 0) { + return new Buffer(0); } else { result = new Buffer(size);
fix buffer concat polyfill for the case when the list contains one zero length buffer
nodules_asker
train
js
71adb34fe3625de29f6470ca07dc2347dd80fd05
diff --git a/lib/setup.js b/lib/setup.js index <HASH>..<HASH> 100644 --- a/lib/setup.js +++ b/lib/setup.js @@ -174,6 +174,8 @@ function lessPlugins (opts) { logger.fatal(err, 'could not find the requested Less plugin, ' + e.name); process.exit(-1); } + + return e; }); }
add missing return during plugin option setup Issue: ENYO-<I> Enyo-DCO-<I>-
enyojs_enyo-dev
train
js
1c5fba3069fe50f234d133b694f09e1a5d60bad6
diff --git a/coaster/__init__.py b/coaster/__init__.py index <HASH>..<HASH> 100644 --- a/coaster/__init__.py +++ b/coaster/__init__.py @@ -354,7 +354,7 @@ def sanitize_html(value, valid_tags=VALID_TAGS): newoutput = soup.renderContents() if oldoutput == newoutput: break - warn("This method is deprecated. Please use the bleach library", DeprecationWarning) + warn("This function is deprecated. Please use the bleach library", DeprecationWarning) return unicode(newoutput, 'utf-8')
It's a function, not a method
hasgeek_coaster
train
py
ce91c5f254219e196533da5d7652ea6c5e43488d
diff --git a/src/org/opencms/importexport/A_CmsImport.java b/src/org/opencms/importexport/A_CmsImport.java index <HASH>..<HASH> 100644 --- a/src/org/opencms/importexport/A_CmsImport.java +++ b/src/org/opencms/importexport/A_CmsImport.java @@ -880,7 +880,7 @@ public abstract class A_CmsImport implements I_CmsImport { List<Element> groupNodes; List<String> userGroups; Element currentElement, currentGroup; - Map<String, Object> userInfo = new HashMap<String, Object>(); + Map<String, Object> userInfo = null; String name, description, flags, password, firstname, lastname, email, address, pwd, infoNode, defaultGroup; // try to get the import resource //getImportResource(); @@ -918,7 +918,10 @@ public abstract class A_CmsImport implements I_CmsImport { } catch (ClassNotFoundException cnfex) { m_report.println(cnfex); } - + // in case the user info could not be parsed create a new map + if (userInfo == null) { + userInfo = new HashMap<String, Object>(); + } // get the groups of the user and put them into the list groupNodes = currentElement.selectNodes("*/" + A_CmsImport.N_GROUPNAME); userGroups = new ArrayList<String>();
Fixing null pointer issue during user import.
alkacon_opencms-core
train
java
5f579869a1e90ee59f6b0e0de183be50adbc05c4
diff --git a/linshareapi/admin/ldapconnections.py b/linshareapi/admin/ldapconnections.py index <HASH>..<HASH> 100644 --- a/linshareapi/admin/ldapconnections.py +++ b/linshareapi/admin/ldapconnections.py @@ -133,6 +133,6 @@ class LdapConnections2(LdapConnections): rbu.add_field('uuid') rbu.add_field('label', required=True) rbu.add_field('providerUrl', required=True) - rbu.add_field('securityPrincipal', "principal") - rbu.add_field('securityCredentials', "credential") + rbu.add_field('securityPrincipal', "principal", extended=True) + rbu.add_field('securityCredentials', "credential", extended=True) return rbu
Mark some ldap fields as extented.
fred49_linshare-api
train
py
3c8e299a0064f42f79a42b8c07b03f55d82f5d2c
diff --git a/allennlp/commands/predict.py b/allennlp/commands/predict.py index <HASH>..<HASH> 100644 --- a/allennlp/commands/predict.py +++ b/allennlp/commands/predict.py @@ -56,7 +56,8 @@ DEFAULT_PREDICTORS = { 'bidaf': 'machine-comprehension', 'simple_tagger': 'sentence-tagger', 'crf_tagger': 'sentence-tagger', - 'coref': 'coreference-resolution' + 'coref': 'coreference-resolution', + 'constituency_parser': 'constituency-parser', }
fix predictor issue for constituency parser (#<I>) * fix predictor issue for constituency parser * matt
allenai_allennlp
train
py
24035ff9b5117d7410ae329080deb11fec9cccd5
diff --git a/store/store.go b/store/store.go index <HASH>..<HASH> 100644 --- a/store/store.go +++ b/store/store.go @@ -99,6 +99,7 @@ type statsToken struct { } // statsKey returns the compound statistics identifier that represents key. +// If write is true, the identifier will be created if necessary. // Identifiers have a form similar to "ab:c:def:", where each section is a // base-32 number that represents the respective word in key. This form // allows efficiently indexing and searching for prefixes, while detaching
Add comment about write parameter, as mentioned by Rog.
juju_juju
train
go
80b6b0a1078b1692ac5cfaa0eeb790bdca7552d9
diff --git a/lib/restforce/concerns/streaming.rb b/lib/restforce/concerns/streaming.rb index <HASH>..<HASH> 100644 --- a/lib/restforce/concerns/streaming.rb +++ b/lib/restforce/concerns/streaming.rb @@ -8,11 +8,8 @@ module Restforce # # Returns a Faye::Subscription def subscribe(channels, options = {}, &block) - topics = Array(channels).map do |channel| - replay_handlers[channel] = options[:replay] - "/topic/#{channel}" - end - faye.subscribe topics, &block + Array(channels).each { |channel| replay_handlers[channel] = options[:replay] } + faye.subscribe Array(channels).map { |channel| "/topic/#{channel}" }, &block end # Public: Faye client to use for subscribing to PushTopics
Register handlers and convert to topics in 2 steps
restforce_restforce
train
rb
8bd7519b5709c0fe8837eb46bf1b03e8b49552b3
diff --git a/client/cli/common/assignment.py b/client/cli/common/assignment.py index <HASH>..<HASH> 100644 --- a/client/cli/common/assignment.py +++ b/client/cli/common/assignment.py @@ -166,7 +166,7 @@ class Assignment(core.Serializable): print() def _find_files(self, pattern): - return glob.glob(pattern) + return sorted(glob.glob(pattern)) def _import_module(self, module): return importlib.import_module(module)
Load tests in sorted order
okpy_ok-client
train
py
9766f0152b3174ceb4a572dc71fb9e7cd129cdd4
diff --git a/safemysql.class.php b/safemysql.class.php index <HASH>..<HASH> 100644 --- a/safemysql.class.php +++ b/safemysql.class.php @@ -470,23 +470,28 @@ class SafeMySQL private function escapeInt($value) { - if (is_float($value)) - { - $value = number_format($value, 0, '.', ''); // may lose precision on big numbers - } - elseif(is_numeric($value)) + if ($value === NULL) { - $value = $value; + return 'NULL'; } - else + if(!is_numeric($value)) { $this->error("Integer (?i) placeholder expects numeric value, ".gettype($value)." given"); + return FALSE; } - return " ".$value; // to avoid double munus collision (one from query + one from value = comment --) + if (is_float($value)) + { + $value = number_format($value, 0, '.', ''); // may lose precision on big numbers + } + return $value; } private function escapeString($value) { + if ($value === NULL) + { + return 'NULL'; + } return "'".mysqli_real_escape_string($this->conn,$value)."'"; }
Added NULL translation as suggested in issue #<I> I changed my mind and made added literal translation from PHP's NULL into Mysql's NULL when processing placeholders.
colshrapnel_safemysql
train
php
0ea0d86de436c6192dc58894ed619f4e2d1ef4e1
diff --git a/builtin/providers/google/resource_compute_target_pool.go b/builtin/providers/google/resource_compute_target_pool.go index <HASH>..<HASH> 100644 --- a/builtin/providers/google/resource_compute_target_pool.go +++ b/builtin/providers/google/resource_compute_target_pool.go @@ -82,6 +82,7 @@ func resourceComputeTargetPool() *schema.Resource { Type: schema.TypeString, Optional: true, ForceNew: true, + Default: "NONE", }, }, }
Change google_compute_target_pool's session_affinity field default to NONE. (#<I>)
hashicorp_terraform
train
go
b2d890a1e03d4c01be1be0075251da8915257e7d
diff --git a/src/main/java/io/fabric8/maven/docker/service/QueryService.java b/src/main/java/io/fabric8/maven/docker/service/QueryService.java index <HASH>..<HASH> 100644 --- a/src/main/java/io/fabric8/maven/docker/service/QueryService.java +++ b/src/main/java/io/fabric8/maven/docker/service/QueryService.java @@ -169,18 +169,4 @@ public class QueryService { public boolean hasImage(String name) throws DockerAccessException { return docker.hasImage(name); } - - /** - * Check whether an image needs to be pulled. - * - * @param mode the auto pull mode coming from the configuration - * @param imageName name of the image to check - * @param always whether to a alwaysPull mode would be active or is always ignored - * @param previouslyPulled cache holding all previously pulled images - * @return true if the image needs to be pulled, false otherwise - * - * @throws DockerAccessException - * @throws MojoExecutionException - */ - }
chore: Removed bogus comment
fabric8io_docker-maven-plugin
train
java
6e397b5e1025265c4f8b9d1b030cfbfa47dfe223
diff --git a/src/Providers/ArtisanServiceProvider.php b/src/Providers/ArtisanServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/Providers/ArtisanServiceProvider.php +++ b/src/Providers/ArtisanServiceProvider.php @@ -10,10 +10,10 @@ use Illuminate\Console\Scheduling\ScheduleRunCommand; use Cortex\Foundation\Console\Commands\JobMakeCommand; use Cortex\Foundation\Console\Commands\MailMakeCommand; use Cortex\Foundation\Console\Commands\RuleMakeCommand; +use Cortex\Foundation\Console\Commands\EventListCommand; use Cortex\Foundation\Console\Commands\EventMakeCommand; use Cortex\Foundation\Console\Commands\ModelMakeCommand; use Illuminate\Console\Scheduling\ScheduleFinishCommand; -use Cortex\Foundation\Console\Commands\EventListCommand; use Cortex\Foundation\Console\Commands\ConfigMakeCommand; use Cortex\Foundation\Console\Commands\ModuleMakeCommand; use Cortex\Foundation\Console\Commands\PolicyMakeCommand;
Apply fixes from StyleCI (#<I>)
rinvex_cortex-foundation
train
php
225ff1d9b1d65380ed0858a49caecc0066d56dc0
diff --git a/catalogue/src/main/java/org/project/openbaton/catalogue/mano/descriptor/VirtualDeploymentUnit.java b/catalogue/src/main/java/org/project/openbaton/catalogue/mano/descriptor/VirtualDeploymentUnit.java index <HASH>..<HASH> 100644 --- a/catalogue/src/main/java/org/project/openbaton/catalogue/mano/descriptor/VirtualDeploymentUnit.java +++ b/catalogue/src/main/java/org/project/openbaton/catalogue/mano/descriptor/VirtualDeploymentUnit.java @@ -80,10 +80,10 @@ public class VirtualDeploymentUnit implements Serializable { /** * Contains information that is distinct for each VNFC created based on this VDU. */ - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true) private Set<VNFComponent> vnfc; - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, orphanRemoval = true) private Set<VNFCInstance> vnfc_instance; /**
added orphanRemoval do VNFCs and VNFCIs
openbaton_openbaton-client
train
java
a6640b8150068b3f28f7f2fa0ac5f6b14baa654d
diff --git a/org.kevoree.modeling.microframework/src/test/java/org/kevoree/modeling/memory/storage/impl/OffHeapMemoryStorageTest.java b/org.kevoree.modeling.microframework/src/test/java/org/kevoree/modeling/memory/storage/impl/OffHeapMemoryStorageTest.java index <HASH>..<HASH> 100644 --- a/org.kevoree.modeling.microframework/src/test/java/org/kevoree/modeling/memory/storage/impl/OffHeapMemoryStorageTest.java +++ b/org.kevoree.modeling.microframework/src/test/java/org/kevoree/modeling/memory/storage/impl/OffHeapMemoryStorageTest.java @@ -60,6 +60,9 @@ public class OffHeapMemoryStorageTest { // KMemoryChunk KMemoryChunk chunk = new OffHeapMemoryChunk(); + storage.putAndReplace(0, 0, 0, chunk); + KMemoryChunk retrievedChunk = (KMemoryChunk) storage.get(0, 0, 0); + Assert.assertNotNull(retrievedChunk); } }
* first tests of offheap memory storage
datathings_greycat
train
java
e490056b614274ca2aa335d1052027d30d57ecc8
diff --git a/lib/specials.js b/lib/specials.js index <HASH>..<HASH> 100644 --- a/lib/specials.js +++ b/lib/specials.js @@ -9,6 +9,7 @@ const intended = [ 'HTTPS', 'JSX', 'DNS', + 'URL', 'now.sh' ]
Add URL as special word (#<I>)
zeit_title
train
js
67521917c4216b76e4659a4c4b80e64f6f4de70c
diff --git a/salt/utils/minions.py b/salt/utils/minions.py index <HASH>..<HASH> 100644 --- a/salt/utils/minions.py +++ b/salt/utils/minions.py @@ -652,6 +652,8 @@ class CkMinions(object): v_minions = self._expand_matching(valid) if minions is None: minions = set(self.check_minions(expr, expr_form)) + else: + minions = set(minions) d_bool = not bool(minions.difference(v_minions)) if len(v_minions) == len(minions) and d_bool: return True
Create a set from the minion list
saltstack_salt
train
py
f973a7430c89b641e4546f37d3b4079de5083a3f
diff --git a/.gitignore b/.gitignore index <HASH>..<HASH> 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ spec/reports test/tmp test/version_tmp tmp +.idea/ diff --git a/lib/words_counted/counter.rb b/lib/words_counted/counter.rb index <HASH>..<HASH> 100644 --- a/lib/words_counted/counter.rb +++ b/lib/words_counted/counter.rb @@ -62,7 +62,7 @@ module WordsCounted private def highest_ranking(entries) - entries.group_by { |_, value| value }.sort.last.last + entries.empty? ? [] : entries.group_by { |_, value| value }.sort.last.last end def sort_by_descending_value(entries) diff --git a/spec/words_counted/counter_spec.rb b/spec/words_counted/counter_spec.rb index <HASH>..<HASH> 100644 --- a/spec/words_counted/counter_spec.rb +++ b/spec/words_counted/counter_spec.rb @@ -134,6 +134,11 @@ module WordsCounted counter = Counter.new("Orange orange Apple apple banana") expect(counter.most_occurring_words).to eq([["orange", 2],["apple", 2]]) end + + it "returns empty array when input is empty string" do + counter = Counter.new("") + expect(counter.most_occurring_words).to eq([]) + end end describe 'word_lengths' do
Added check to see if entries are empty in highest_ranking. Test case also written.
abitdodgy_words_counted
train
gitignore,rb,rb
9777ec07a1783b58e3db5fba95ec7d5ae1c28e9f
diff --git a/tag.go b/tag.go index <HASH>..<HASH> 100644 --- a/tag.go +++ b/tag.go @@ -211,12 +211,6 @@ func (t *Tag) SetGenre(genre string) { // Save writes tag to the file. func (t *Tag) Save() error { - // Form new frames - frames := t.formAllFrames() - - // Form size of new frames - framesSize := util.FormSize(int64(len(frames))) - // Create a temp file for mp3 file, which will contain new tag newFile, err := ioutil.TempFile("", "") if err != nil { @@ -226,6 +220,12 @@ func (t *Tag) Save() error { // Make sure we clean up the temp file if it's still around defer os.Remove(newFile.Name()) + // Form new frames + frames := t.formAllFrames() + + // Form size of new frames + framesSize := util.FormSize(int64(len(frames))) + // Write to new file new tag header if _, err = newFile.Write(formTagHeader(framesSize, t.version)); err != nil { return err
Make small refactoring in tag.go
bogem_id3v2
train
go
33828903bdaf14d23ae04a710ce8c2f5840fff43
diff --git a/client/html/templates/catalog/filter/body-default.php b/client/html/templates/catalog/filter/body-default.php index <HASH>..<HASH> 100644 --- a/client/html/templates/catalog/filter/body-default.php +++ b/client/html/templates/catalog/filter/body-default.php @@ -80,7 +80,7 @@ $listConfig = $this->config( 'client/html/catalog/lists/url/config', array() ); $listParams = array(); $params = $this->param(); -foreach( array( 'f_catid', 'f_name', 'f_sort' ) as $name ) { +foreach( array( 'f_sort' ) as $name ) { if( isset( $params[$name] ) ) { $listParams[$name] = $params[$name]; } }
Allow searching over all products in catalog list
aimeos_ai-client-html
train
php
54d26ba3b9dfe088d75aee51386a8a4fa707d277
diff --git a/ripozo_sqlalchemy_tests/unit/common.py b/ripozo_sqlalchemy_tests/unit/common.py index <HASH>..<HASH> 100644 --- a/ripozo_sqlalchemy_tests/unit/common.py +++ b/ripozo_sqlalchemy_tests/unit/common.py @@ -198,4 +198,4 @@ class CommonTest(TestBase): for model in models: if model.id == id: self.assertResponseEqualsModel(model, Manager(self.session_handler), r) - break \ No newline at end of file + break
Just a dumb end of file line.
vertical-knowledge_ripozo-sqlalchemy
train
py
6916d02d83aece8b7e9dea8222cff4cd3de94edd
diff --git a/marshmallow/utils.py b/marshmallow/utils.py index <HASH>..<HASH> 100755 --- a/marshmallow/utils.py +++ b/marshmallow/utils.py @@ -32,7 +32,7 @@ class _Missing(object): __nonzero__ = __bool__ # PY2 compat def __repr__(self): - return '<marshmallow.marshalling.missing>' + return '<marshmallow.missing>' # Singleton value that indicates that a field's value is missing from input
Fix repr for `missing`
marshmallow-code_marshmallow
train
py
e22240865c540856dc257bbb039c0a8020eea4cd
diff --git a/src/validators.js b/src/validators.js index <HASH>..<HASH> 100644 --- a/src/validators.js +++ b/src/validators.js @@ -51,10 +51,15 @@ export const testFactory = { const { type } = entry if (type instanceof Schema) { - return (value, validationType) => value ? - (typeof value == 'object' ? - type.validateType(value, validationType) : true ) - : false + return (value, validationType) => { + if (value) { + if (typeof value == 'object') + return type.validateType(value, validationType) + else + return validationType == 'error' + } else + return false + } } else if (Array.isArray(type)) { const schema = type[0]
Pass tests by not complaining on warning type
dgonz64_redux-form-auto
train
js
02b04dea0a76bba76c6746da0c63799a2e70ec6d
diff --git a/ipyrad/core/assembly.py b/ipyrad/core/assembly.py index <HASH>..<HASH> 100644 --- a/ipyrad/core/assembly.py +++ b/ipyrad/core/assembly.py @@ -308,7 +308,7 @@ class Assembly(object): self.barcodes = {} for key, value in backup.items(): key = "".join([ - i.replace(i, "_") if i in BADCHARS else i for i in key + i.replace(i, "_") if i in BADCHARS else i for i in str(key) ]) self.barcodes[key] = value
Allow sample names to be integers. wtf, how did this never come up before?
dereneaton_ipyrad
train
py
cca3a579d35ebbdb9abdce0b07fcc7ec0f727329
diff --git a/spec/unit/azure_server_create_spec.rb b/spec/unit/azure_server_create_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/azure_server_create_spec.rb +++ b/spec/unit/azure_server_create_spec.rb @@ -269,6 +269,7 @@ describe Chef::Knife::AzureServerCreate do #Temp directory for certificate path and \n for domain name and certificate passphrase dir = Dir.mktmpdir + expect(@server_instance.connection.certificates).to receive(:create_ssl_certificate).with(Chef::Config[:knife][:azure_dns_name]).and_call_original allow(STDIN).to receive(:gets).and_return(dir,"\n") @server_instance.run
checking for number of arguments in create_ssl_certificate method
chef_knife-azure
train
rb
0337ca97a06b0ec415f0f0173c444adb099c1beb
diff --git a/lib/linter.js b/lib/linter.js index <HASH>..<HASH> 100644 --- a/lib/linter.js +++ b/lib/linter.js @@ -40,6 +40,13 @@ module.exports = function (cwd, args, text) { .readFileSync(path.resolve(cwd, unquote(files[0])).trim()) .toString(); } - report = cwdDeps.prettier.format(text, currentOptions); + try { + report = cwdDeps.prettier.format(text, currentOptions); + } catch (err) { + if (!currentOptions.fallback) { + throw err; + } + report = text; + } return report; };
Add `--fallback` option This makes it so that if formatting fails, the input is returned.
josephfrazier_prettier_d
train
js
6afe3ae1927594b15253b50790a3749cebc29258
diff --git a/src/nouns.js b/src/nouns.js index <HASH>..<HASH> 100644 --- a/src/nouns.js +++ b/src/nouns.js @@ -340,7 +340,6 @@ module.exports = [ "harbor", "harmony", "hat", - "hate", "head", "health", "heat",
Remove the word "hate" Some project names are generated as 'white-hate' or 'black-hate' and that's offensive
aceakash_project-name-generator
train
js
43f3f5d999e1cc90dc94007f31321a29a77e6e1c
diff --git a/orpsoc/simulator/simulator.py b/orpsoc/simulator/simulator.py index <HASH>..<HASH> 100644 --- a/orpsoc/simulator/simulator.py +++ b/orpsoc/simulator/simulator.py @@ -52,8 +52,13 @@ class Simulator(object): def configure(self): logger.debug('configure() *Entered*') if os.path.exists(self.sim_root): - shutil.rmtree(self.sim_root) - os.makedirs(self.sim_root) + for f in os.listdir(self.sim_root): + if os.path.isdir(os.path.join(self.sim_root, f)): + shutil.rmtree(os.path.join(self.sim_root, f)) + else: + os.remove(os.path.join(self.sim_root, f)) + else: + os.makedirs(self.sim_root) for name in self.cores: print("Preparing " + name)
simulator.py: Clean build directory instead of removing it
olofk_fusesoc
train
py
39c2d721455ec40482ab9201a13ced434cd5e783
diff --git a/websocket.go b/websocket.go index <HASH>..<HASH> 100644 --- a/websocket.go +++ b/websocket.go @@ -2,6 +2,7 @@ package mqtt import ( "crypto/tls" + "fmt" "io" "net" "net/http" @@ -44,8 +45,11 @@ func NewWebsocket(host string, tlsc *tls.Config, timeout time.Duration, requestH WriteBufferSize: options.WriteBufferSize, } - ws, _, err := dialer.Dial(host, requestHeader) + ws, resp, err := dialer.Dial(host, requestHeader) + if resp != nil { + WARN.Println(CLI, fmt.Sprintf("Websocket handshake failure. StatusCode: %d. Body: %s", resp.StatusCode, resp.Body)) + } if err != nil { return nil, err }
Log response info duriung websocket handshake failure
eclipse_paho.mqtt.golang
train
go
3454319be2ebde8481aa0804a801f4d07de705b5
diff --git a/capability/enum.go b/capability/enum.go index <HASH>..<HASH> 100644 --- a/capability/enum.go +++ b/capability/enum.go @@ -304,9 +304,9 @@ const ( // Allow taking of leases on files CAP_LEASE Cap = 28 - CAP_AUDIT_WRITE = 29 + CAP_AUDIT_WRITE Cap = 29 CAP_AUDIT_CONTROL Cap = 30 - CAP_SETFCAP = 31 + CAP_SETFCAP Cap = 31 // Override MAC access. // The base kernel enforces no MAC policy.
capability: fix: some CAP_* constants type not defined
syndtr_gocapability
train
go
23aecb4f2b0e489d458cf1fc5ed7934f9996002f
diff --git a/lib/models/__tests__/page.js b/lib/models/__tests__/page.js index <HASH>..<HASH> 100644 --- a/lib/models/__tests__/page.js +++ b/lib/models/__tests__/page.js @@ -20,7 +20,7 @@ describe('Page', function() { }) }); - expect(page.toText()).toBe('---\nhello: world\n---\nHello World'); + expect(page.toText()).toBe('---\nhello: world\n---\n\nHello World'); }); }); }); diff --git a/lib/models/page.js b/lib/models/page.js index <HASH>..<HASH> 100644 --- a/lib/models/page.js +++ b/lib/models/page.js @@ -44,7 +44,7 @@ Page.prototype.toText = function() { return content; } - var frontMatter = '---\n' + yaml.safeDump(attrs.toJS(), { skipInvalid: true }) + '---\n'; + var frontMatter = '---\n' + yaml.safeDump(attrs.toJS(), { skipInvalid: true }) + '---\n\n'; return (frontMatter + content); };
Improve output of page to text with frontmatter
GitbookIO_gitbook
train
js,js
c64d7fc7a1c308596c5b655aca8fdb3551332a71
diff --git a/openquake/risk/classical_psha_based.py b/openquake/risk/classical_psha_based.py index <HASH>..<HASH> 100644 --- a/openquake/risk/classical_psha_based.py +++ b/openquake/risk/classical_psha_based.py @@ -29,7 +29,7 @@ from numpy import subtract, mean from openquake import shapes from openquake.risk.common import loop, collect -from openquake.utils.general import Memoize +from openquake.utils.general import MemoizeMutable STEPS_PER_INTERVAL = 5 @@ -97,7 +97,7 @@ def _generate_loss_ratios(vuln_function): return _split_loss_ratios(loss_ratios) -@Memoize +@MemoizeMutable def _compute_lrem(vuln_function, distribution=None): """Compute the LREM (Loss Ratio Exceedance Matrix).
after testing a bit, it's better to maintain MemoizeMutable, it's faster Former-commit-id: ec<I>ecfe7f0c3e<I>dbfa<I>ae<I>b<I>
gem_oq-engine
train
py
13d5a83feb2ffa96a68124cfe40e323f442ea37f
diff --git a/spec/mangopay/payin_bankwire_external_instruction_spec.rb b/spec/mangopay/payin_bankwire_external_instruction_spec.rb index <HASH>..<HASH> 100644 --- a/spec/mangopay/payin_bankwire_external_instruction_spec.rb +++ b/spec/mangopay/payin_bankwire_external_instruction_spec.rb @@ -14,8 +14,8 @@ describe MangoPay::PayIn::BankWire::ExternalInstruction, type: :feature do MangoPay.configure do |c| c.preproduction = true c.client_id = 'sdk-unit-tests' - c.root_url = 'https://api-test.mangopay.com' - c.client_apiKey = '9RMGpwVUwFLK0SurxObJ2yaadDcO0zeKFKxWmthjB93SQjFzy0' + c.root_url = 'https://api-sandbox.mangopay.com' + c.client_apiKey = 'cqFfFrWfCcb7UadHNxx2C9Lo6Djw8ZduLi7J9USTmu8bhxxpju' c.http_timeout = 10000 end
Make tests pointing on Sandbox again
Mangopay_mangopay2-ruby-sdk
train
rb
0cd6019d869c7d16380805abf5ab71fb7c620a65
diff --git a/d1_client_cli/src/d1_client_cli/impl/session.py b/d1_client_cli/src/d1_client_cli/impl/session.py index <HASH>..<HASH> 100755 --- a/d1_client_cli/src/d1_client_cli/impl/session.py +++ b/d1_client_cli/src/d1_client_cli/impl/session.py @@ -132,7 +132,7 @@ variable_defaults_map = { VERBOSE_NAME: True, EDITOR_NAME: u'notepad' if platform.system() == 'Windows' else 'nano', CN_URL_NAME: d1_common.const.URL_DATAONE_ROOT, - MN_URL_NAME: d1_common.const.DEFAULT_MN_HOST, + MN_URL_NAME: d1_common.const.DEFAULT_MN_BASEURL, START_NAME: 0, COUNT_NAME: d1_common.const.MAX_LISTOBJECTS, ANONYMOUS_NAME: True,
Fixed issue caused by overwriting DEFAULT_MN_HOST.
DataONEorg_d1_python
train
py
d710fd47d65c29ce337594585ce8cadae8fd9ce1
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,6 +1,7 @@ var fs = require('fs'), Handlebars = require('handlebars'), _ = require('lodash'), + url = require('url'), defaultsDeep = _.partialRight(_.merge, function deep(value, other) { return _.merge(value, other, deep); }), @@ -22,6 +23,7 @@ function plugin(options) { output: 'sitemap.xml', modifiedProperty: 'modified', urlProperty: 'path', + hostname: '', entryTemplate: templatesDir + '/entry.xml', sitemapTemplate: templatesDir + '/sitemap.xml', defaults: { @@ -52,7 +54,7 @@ function plugin(options) { data.sitemap = data.sitemap || {}; entry = _.defaults({ - loc: resolve(data, options.urlProperty), + loc: url.resolve(options.hostname, resolve(data, options.urlProperty)), lastmod: resolve(data, options.modifiedProperty), changefreq: data.sitemap.changefreq, priority: data.sitemap.priority
Add option for hostname There was no ability to provide a canonical hostname within the site map.
ExtraHop_metalsmith-sitemap
train
js
bf027fef333d7f1468aa06a10bd22a1bb0eecace
diff --git a/ui.go b/ui.go index <HASH>..<HASH> 100644 --- a/ui.go +++ b/ui.go @@ -72,16 +72,16 @@ func startUI(width, height, scale int, title string) error { x := (videoMode.Width - width*scale) / 2 y := (videoMode.Height - height*scale) / 3 + ch := make(chan struct{}) window := currentUI.window + window.SetFramebufferSizeCallback(func(w *glfw.Window, width, height int) { + close(ch) + }) window.SetSize(width*scale, height*scale) window.SetTitle(title) window.SetPosition(x, y) window.Show() - ch := make(chan struct{}) - window.SetFramebufferSizeCallback(func(w *glfw.Window, width, height int) { - close(ch) - }) for { done := false glfw.PollEvents()
Bug fix: SetFramebufferSizeCallback can be called immediately
hajimehoshi_ebiten
train
go
bd0b466e993f28dbe574cbc7d620bceef942f6eb
diff --git a/dtool_create/dataset.py b/dtool_create/dataset.py index <HASH>..<HASH> 100644 --- a/dtool_create/dataset.py +++ b/dtool_create/dataset.py @@ -309,6 +309,23 @@ def freeze(proto_dataset_uri): uri=proto_dataset_uri, config_path=CONFIG_PATH ) + + num_items = len(list(proto_dataset._identifiers())) + limit = 1000 + if num_items > limit: + click.secho("Too many items ({} > {}) in proto dataset".format(num_items, limit), fg="red") + click.secho("1. Consider splitting the dataset into more fine grained datasets") + click.secho("2. Consider packaging small files using tar") + sys.exit(45) + + handles = [h for h in proto_dataset._storage_broker.iter_item_handles()] + for h in handles: + if h.find("\n") != -1: + click.secho("Item with new line in name in dataset ({})".format(h), fg="red") + click.secho("1. Consider renaming the item") + click.secho("2. Consider removing the item") + sys.exit(46) + with click.progressbar(length=len(list(proto_dataset._identifiers())), label="Generating manifest") as progressbar: proto_dataset.freeze(progressbar=progressbar)
Add spike sanity checking to freeze
jic-dtool_dtool-create
train
py
589a6a77409305ec506afd6a47155d6a3e8f4d92
diff --git a/cloudmutex.go b/cloudmutex.go index <HASH>..<HASH> 100644 --- a/cloudmutex.go +++ b/cloudmutex.go @@ -19,10 +19,10 @@ type cloudmutex struct { // TimedLock will wait up to duruation d for l.Lock() to succeed. func TimedLock(l sync.Locker, d time.Duration) error { - done := make(chan bool, 1) + done := make(chan struct{}, 1) go func() { l.Lock() - done <- true + done <- struct{}{} }() select { case <-done: @@ -34,10 +34,10 @@ func TimedLock(l sync.Locker, d time.Duration) error { // TimedUnlock will wait up to duruation d for l.Unlock() to succeed. func TimedUnlock(l sync.Locker, d time.Duration) error { - done := make(chan bool, 1) + done := make(chan struct{}, 1) go func() { l.Unlock() - done <- true + done <- struct{}{} }() select { case <-done:
improve perf by passing empty struct instead of a bool across channel
marcacohen_gcslock
train
go
23383cef851a1e9635779e5867a53d03d33885fa
diff --git a/src/geshi.php b/src/geshi.php index <HASH>..<HASH> 100644 --- a/src/geshi.php +++ b/src/geshi.php @@ -2015,7 +2015,7 @@ class GeSHi { } // Other whitespace // BenBE: Fix to reduce the number of replacements to be done - $result = str_replace("\n ", "\n&nbsp;", $result); + $result = preg_replace('/^ /m', '&nbsp;', $result); $result = str_replace(' ', ' &nbsp;', $result); if ($this->line_numbers == GESHI_NO_LINE_NUMBERS) {
fix: #<I>: wrong indentation of first line
GeSHi_geshi-1.0
train
php
d6e8d2415c897a871e0e95ec2af25185400245fc
diff --git a/c7n/output.py b/c7n/output.py index <HASH>..<HASH> 100644 --- a/c7n/output.py +++ b/c7n/output.py @@ -227,11 +227,15 @@ class SystemStats(DeltaStats): snapshot['num_ctx_switches_involuntary']) = self.process.num_ctx_switches() # io counters ( not available on osx) if getattr(self.process, 'io_counters', None): - io = self.process.io_counters() - for counter in ( - 'read_count', 'write_count', - 'write_bytes', 'read_bytes'): - snapshot[counter] = getattr(io, counter) + try: + io = self.process.io_counters() + for counter in ( + 'read_count', 'write_count', + 'write_bytes', 'read_bytes'): + snapshot[counter] = getattr(io, counter) + except NotImplementedError: + # some old kernels and Windows Linux Subsystem throw this + pass # memory counters mem = self.process.memory_info() for counter in (
psutil fix (#<I>)
cloud-custodian_cloud-custodian
train
py
3c832b4e995487813bdb31eb533947f69460fe62
diff --git a/packages/core-js/modules/web.url.js b/packages/core-js/modules/web.url.js index <HASH>..<HASH> 100644 --- a/packages/core-js/modules/web.url.js +++ b/packages/core-js/modules/web.url.js @@ -31,7 +31,7 @@ var INVALID_HOST = 'Invalid host'; var INVALID_PORT = 'Invalid port'; var ALPHA = /[A-Za-z]/; -var ALPHANUMERIC = /[\d+\-.A-Za-z]/; +var ALPHANUMERIC = /[\d+.A-Za-z\-]/; var DIGIT = /\d/; var HEX_START = /^(0x|0X)/; var OCT = /^[0-7]+$/;
chore: Make unicorn/regex-shorthand happy
zloirock_core-js
train
js
40c9a051c1e50e02f95b98e3cdba0bf40059bdd8
diff --git a/src/main/java/gwt/material/design/addins/client/autocomplete/MaterialAutoComplete.java b/src/main/java/gwt/material/design/addins/client/autocomplete/MaterialAutoComplete.java index <HASH>..<HASH> 100644 --- a/src/main/java/gwt/material/design/addins/client/autocomplete/MaterialAutoComplete.java +++ b/src/main/java/gwt/material/design/addins/client/autocomplete/MaterialAutoComplete.java @@ -450,15 +450,14 @@ public class MaterialAutoComplete extends AbstractValueWidget<List<? extends Sug return; } List<Suggestion> list = new ArrayList<>(itemValues.size()); - lblPlaceholder.addStyleName(CssName.ACTIVE); for (String value : itemValues) { Suggestion suggestion = new gwt.material.design.client.base.Suggestion(value, value); list.add(suggestion); } + setValue(list, fireEvents); if (itemValues.size() > 0) { lblPlaceholder.addStyleName(CssName.ACTIVE); } - setValue(list, fireEvents); } /**
Fix autocompete bug preventing it from becoming active when value is added from code.
GwtMaterialDesign_gwt-material-addins
train
java
3146e0a1904e92e48fefdbc5e1d2ccf6deb9d63b
diff --git a/pycons3rt/cons3rtutil.py b/pycons3rt/cons3rtutil.py index <HASH>..<HASH> 100644 --- a/pycons3rt/cons3rtutil.py +++ b/pycons3rt/cons3rtutil.py @@ -301,7 +301,7 @@ class Cons3rtUtil(object): else: log.info('Email: {e}'.format(e=email)) - command_string = '-createuser {u} -email {e} -firstname Admin -lastname User'.format(u=user, e=email) + command_string = '-requestuser {u} -email {e} -firstname Admin -lastname User'.format(u=user, e=email) self.run_security_admin_command(command_string) # Create a random password
Updated the run_security_admin call from -creatuser to -requestuser
cons3rt_pycons3rt
train
py
ebb9690f8930a936fb2cc6c5ba19b70061c9bc94
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -12,10 +12,6 @@ setup(name='hawkrest', include_package_data=True, classifiers=[ 'Framework :: Django', - 'Framework :: Django :: 1.8', - 'Framework :: Django :: 1.9', - 'Framework :: Django :: 1.10', - 'Framework :: Django :: 1.11', 'Intended Audience :: Developers', 'Natural Language :: English', 'Operating System :: OS Independent',
Removed PyPI identifiers because the PyPI API said they were invalid. *shrug*
kumar303_hawkrest
train
py
dcf9d770593fb83da546cde72999ae9cefe0aa54
diff --git a/cytomine/models/software.py b/cytomine/models/software.py index <HASH>..<HASH> 100755 --- a/cytomine/models/software.py +++ b/cytomine/models/software.py @@ -116,6 +116,10 @@ class SoftwareParameterCollection(Collection): self._allowed_filters = ["software"] self.set_parameters(parameters) + @property + def callback_identifier(self): + return "software_parameter" + class SoftwareParameterConstraint(Model): def __init__(self, parameter_constraint_id=None, software_parameter_id=None, value=None, **attributes): @@ -136,6 +140,10 @@ class SoftwareParameterConstraintCollection(Collection): self._allowed_filters = ["softwareparameter"] self.set_parameters(parameters) + @property + def callback_identifier(self): + return "software_parameter_constraint" + _HUMAN_READABLE_JOB_STATUS = { 0: "NOT_LAUNCH", @@ -342,3 +350,8 @@ class ProcessingServerCollection(Collection): super(ProcessingServerCollection, self).__init__(ProcessingServer, filters, max, offset) self._allowed_filters = [None] self.set_parameters(parameters) + + @property + def callback_identifier(self): + return "processing_server" +
override url for collection too
cytomine_Cytomine-python-client
train
py