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
1fcb638b391afe253d990afd5a6fa52221a14b8a
diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index <HASH>..<HASH> 100755 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -1324,7 +1324,7 @@ abstract class Model implements ArrayAccess, ArrayableInterface, JsonableInterfa { return $this->newQuery(false); } - + /** * Determine if the model instance has been soft-deleted. * @@ -1763,12 +1763,14 @@ abstract class Model implements ArrayAccess, ArrayableInterface, JsonableInterfa */ protected function getAccessibleAttributes() { + $attributes = array_merge(array_fill_keys($this->getMutatedAttributes(), null), $this->attributes); + if (count($this->visible) > 0) { - return array_intersect_key($this->attributes, array_flip($this->visible)); + return array_intersect_key($attributes, array_flip($this->visible)); } - return array_diff_key($this->attributes, array_flip($this->hidden)); + return array_diff_key($attributes, array_flip($this->hidden)); } /**
Allow $model->visible to declare custom accessors
laravel_framework
train
php
44558d53533d0ca22c8191dddae0d2769f00982d
diff --git a/cmd.js b/cmd.js index <HASH>..<HASH> 100755 --- a/cmd.js +++ b/cmd.js @@ -108,8 +108,8 @@ if (process.env.DEBUG) { } var VLC_ARGS = process.env.DEBUG - ? '-q --video-on-top --play-and-exit' - : '--video-on-top --play-and-exit --extraintf=http:logger --verbose=2 --file-logging --logfile=vlc-log.txt' + ? '-q --play-and-exit' + : '--play-and-exit --extraintf=http:logger --verbose=2 --file-logging --logfile=vlc-log.txt' var MPLAYER_EXEC = 'mplayer -ontop -really-quiet -noidx -loop 0' var MPV_EXEC = 'mpv --ontop --really-quiet --loop=no' var OMX_EXEC = 'omxplayer -r -o ' + (typeof argv.omx === 'string')
VLC should not open on top (fix #<I>)
webtorrent_webtorrent-cli
train
js
9daa9a781b3e29e2ece3405c1ec826a7deabdc2f
diff --git a/tool/tsh/tsh.go b/tool/tsh/tsh.go index <HASH>..<HASH> 100644 --- a/tool/tsh/tsh.go +++ b/tool/tsh/tsh.go @@ -578,10 +578,15 @@ func onListNodes(cf *CLIConf) { if err != nil { utils.FatalError(err) } + + // Get list of all nodes in backend and sort by "Node Name". nodes, err := tc.ListNodes(context.TODO()) if err != nil { utils.FatalError(err) } + sort.Slice(nodes, func(i, j int) bool { + return nodes[i].GetHostname() < nodes[j].GetHostname() + }) switch cf.Verbose { // In verbose mode, print everything on a single line and include the Node
Sort nodes by "Node Name" in tsh ls.
gravitational_teleport
train
go
d6558b33ba5739ce857e2dce532b51ea4ca149a7
diff --git a/www/include/minify/groupsConfig.php b/www/include/minify/groupsConfig.php index <HASH>..<HASH> 100644 --- a/www/include/minify/groupsConfig.php +++ b/www/include/minify/groupsConfig.php @@ -86,6 +86,8 @@ $groups = array( , '//prod/page0.js' , '//prod/jquery.WorkZone.js' , '//prod/jquery.Alerts.js' + , '//include/jslibs/pixastic.custom.js' + , '//prod/ThumbExtractor.js' , '//prod/publicator.js' , '//prod/jquery.order.js' , '//include/jslibs/jquery.sprintf.1.0.3.js'
add pixastic and thumbExtractor to prod application
alchemy-fr_Phraseanet
train
php
2843006e63bac137c65023ea0f0218176709fbab
diff --git a/aiodocker/docker.py b/aiodocker/docker.py index <HASH>..<HASH> 100644 --- a/aiodocker/docker.py +++ b/aiodocker/docker.py @@ -124,8 +124,12 @@ class Docker: if (response.status // 100) in [4, 5]: what = await response.read() + content_type = response.headers.get('content-type','') response.close() - raise DockerError(response.status, json.loads(what.decode('utf8'))) + if content_type == 'application/json': + raise DockerError(response.status, json.loads(what.decode('utf8'))) + else: + raise DockerError(response.status, what.decode('utf8')) return response
fix query with content-type check!
aio-libs_aiodocker
train
py
e7420b8d3524547f3f7416b139189b5f295b17f1
diff --git a/resources/views/form/switchfield.blade.php b/resources/views/form/switchfield.blade.php index <HASH>..<HASH> 100644 --- a/resources/views/form/switchfield.blade.php +++ b/resources/views/form/switchfield.blade.php @@ -7,7 +7,7 @@ @include('admin::form.error') <input type="checkbox" class="{{$class}} la_checkbox" {{ old($column, $value) == 'on' ? 'checked' : '' }} {!! $attributes !!} /> - <input type="hidden" class="{{$class}}" name="{{$name}}" class="" value="{{ old($column, $value) }}" /> + <input type="hidden" class="{{$class}}" name="{{$name}}" value="{{ old($column, $value) }}" /> @include('admin::form.help-block')
Unnecessary class attribute for hidden field
z-song_laravel-admin
train
php
10688d8400330884e84fda114088afa0378af8b0
diff --git a/src/article/metadata/MetadataPackage.js b/src/article/metadata/MetadataPackage.js index <HASH>..<HASH> 100644 --- a/src/article/metadata/MetadataPackage.js +++ b/src/article/metadata/MetadataPackage.js @@ -60,6 +60,7 @@ export default { config.addComponent('article-record', ArticleRecordEditor) config.addComponent('bibr', BibliographicEntryEditor) config.addComponent('subject', TranslatableEntryEditor) + config.addComponent('keyword', TranslatableEntryEditor) config.addToolPanel('toolbar', [ {
Use translatable editor for keywords.
substance_texture
train
js
57027c675da228b7cb53cb0628368e654e0ca768
diff --git a/docs/conf.py b/docs/conf.py index <HASH>..<HASH> 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -34,8 +34,8 @@ extensions = [ 'sphinx.ext.pngmath', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', - 'matplotlib.sphinxext.ipython_console_highlighting', - 'matplotlib.sphinxext.ipython_directive'] + 'ipython.sphinxext.ipython_console_highlighting', + 'ipython.sphinxext.ipython_directive'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates']
Using extensions packaged with IPython.
abakan-zz_napi
train
py
e3bd4690e03a2771d236b2fd193926d02f3e0761
diff --git a/lib/pagelib.php b/lib/pagelib.php index <HASH>..<HASH> 100644 --- a/lib/pagelib.php +++ b/lib/pagelib.php @@ -573,7 +573,6 @@ class moodle_page { * state. This is our last change to initialise things. */ protected function starting_output() { - global $CFG; if (!$this->_course) { global $SITE; $this->set_course($SITE);
blocklib: MDL-<I> move the check for whether the right database tables exist - and we no longer need this global.
moodle_moodle
train
php
93a80bf71582e368a969bd1f398589a4e77670b1
diff --git a/salt/client/ssh/__init__.py b/salt/client/ssh/__init__.py index <HASH>..<HASH> 100644 --- a/salt/client/ssh/__init__.py +++ b/salt/client/ssh/__init__.py @@ -247,6 +247,7 @@ class SSH(object): que = multiprocessing.Queue() running = {} target_iter = self.targets.__iter__() + returned = set() rets = set() init = False while True: @@ -272,12 +273,15 @@ class SSH(object): ret = {} try: ret = que.get(False) + if 'id' in ret: + returned.add(ret['id']) except Exception: pass for host in running: - if not running[host]['thread'].is_alive(): - running[host]['thread'].join() - rets.add(host) + if host in returned: + if not running[host]['thread'].is_alive(): + running[host]['thread'].join() + rets.add(host) for host in rets: if host in running: running.pop(host)
fix race condition where return value is omitted
saltstack_salt
train
py
7903697c36bbd79e729695e3ca35e24f7674a5bb
diff --git a/transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java b/transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java index <HASH>..<HASH> 100644 --- a/transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java +++ b/transport/src/main/java/io/netty/channel/ChannelOutboundBuffer.java @@ -30,7 +30,6 @@ import io.netty.util.internal.logging.InternalLoggerFactory; import java.nio.ByteBuffer; import java.nio.channels.ClosedChannelException; -import java.util.Arrays; import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; /** @@ -208,7 +207,9 @@ public final class ChannelOutboundBuffer { for (int i = 0; i < unflushedCount; i ++) { flushed[tail] = unflushed[i]; + unflushed[i] = null; flushedPromises[tail] = unflushedPromises[i]; + unflushedPromises[i] = null; flushedPendingSizes[tail] = unflushedPendingSizes[i]; flushedProgresses[tail] = 0; flushedTotals[tail] = unflushedTotals[i]; @@ -225,8 +226,6 @@ public final class ChannelOutboundBuffer { } } - Arrays.fill(unflushed, 0, unflushedCount, null); - Arrays.fill(unflushedPromises, 0, unflushedCount, null); this.unflushedCount = 0; this.tail = tail;
Remove Arrays.fill(..., null) .. because we can just set each element to null while looping
netty_netty
train
java
660652e6a1ca7d3d6214abcc79c41afe2c52ab52
diff --git a/metrics-core/src/main/java/com/yammer/metrics/core/Metered.java b/metrics-core/src/main/java/com/yammer/metrics/core/Metered.java index <HASH>..<HASH> 100644 --- a/metrics-core/src/main/java/com/yammer/metrics/core/Metered.java +++ b/metrics-core/src/main/java/com/yammer/metrics/core/Metered.java @@ -2,6 +2,9 @@ package com.yammer.metrics.core; import java.util.concurrent.TimeUnit; +/** + * An object which maintains mean and exponentially-weighted rate. + */ public interface Metered extends Metric { /** * Returns the meter's rate unit.
Fix javadocs for Metered.
dropwizard_metrics
train
java
5c12c91ce190d914cb5db4815a4e03c3532dd48b
diff --git a/lib/methods/platform.py b/lib/methods/platform.py index <HASH>..<HASH> 100644 --- a/lib/methods/platform.py +++ b/lib/methods/platform.py @@ -2,8 +2,12 @@ from base import BaseMethod from fabric.api import * from fabric.colors import green, red from lib import configuration +from drush import DrushMethod + + import copy + class PlatformMethod(BaseMethod): @staticmethod @@ -14,6 +18,10 @@ class PlatformMethod(BaseMethod): def getOverrides(): return 'drush' + def __init__(self, name, factory): + self.shadowed_drush = DrushMethod('drush8', factory) + BaseMethod.__init__(self, name, factory) + def run_install(self, config, **kwargs): local('curl -sS https://platform.sh/cli/installer | php'); print green('platform.sh client installed successfully.') @@ -30,4 +38,7 @@ class PlatformMethod(BaseMethod): def deploy(self, config, **kwargs): local('git push platform %s' % config['branch']) + def drush(self, config, **kwargs): + self.shadowed_drush.drush(config, **kwargs) +
FIx platform.sh integration, allow drush commands
factorial-io_fabalicious
train
py
55769c4dec87d97cb2ace3176fe5be54689a2c67
diff --git a/src/main/com/mongodb/OutMessage.java b/src/main/com/mongodb/OutMessage.java index <HASH>..<HASH> 100644 --- a/src/main/com/mongodb/OutMessage.java +++ b/src/main/com/mongodb/OutMessage.java @@ -120,9 +120,10 @@ class OutMessage extends BasicBSONEncoder { } void doneWithMessage(){ - if ( _buffer != null && _mongo != null ) + if ( _buffer != null && _mongo != null ) { _buffer.reset(); _mongo._bufferPool.done( _buffer ); + } _buffer = null; _mongo = null;
Added missing braces to conditional
mongodb_mongo-java-driver
train
java
5b7dcab32ec5b56dab6168d179b5149446578bea
diff --git a/src/sap.m/src/sap/m/ListBase.js b/src/sap.m/src/sap/m/ListBase.js index <HASH>..<HASH> 100644 --- a/src/sap.m/src/sap/m/ListBase.js +++ b/src/sap.m/src/sap/m/ListBase.js @@ -541,9 +541,6 @@ function( // announce accessibility details at the initial focus ListBase.prototype.bAnnounceDetails = true; - // determines whether range selection and select all feature should be enabled for MultiSelect mode - ListBase.prototype.bPreventMassSelection = false; - ListBase.getInvisibleText = function() { if (!this.oInvisibleText) { this.oInvisibleText = new InvisibleText().toStatic();
[INTERNAL] ListBase: Updating Listbase by removing outdated property Previously bPreventMassSelection was used to prevent mass selection. Currently the range selection is allowed in clearAll mode of the multiSelectMode property but selectAll method is disabled for clearAll mode. Change-Id: I<I>e<I>c<I>cf<I>a<I>f7abf4df<I>dca<I>
SAP_openui5
train
js
5b1f98e843eb57f5960d30f1c8a87baa8c50c0fc
diff --git a/test/test-generator-base.js b/test/test-generator-base.js index <HASH>..<HASH> 100644 --- a/test/test-generator-base.js +++ b/test/test-generator-base.js @@ -63,7 +63,8 @@ describe('Generator Base', () => { }); it('returns an up-to-date state', () => { assert.deepEqual( - BaseGenerator.prototype.getExistingEntities()[0] + BaseGenerator.prototype.getExistingEntities() + .find(it => it.name === 'Region') .definition.fields[1], { fieldName: 'regionDesc', fieldType: 'String' } );
Fix test not to rely on order of entities
jhipster_generator-jhipster
train
js
41b710db471dbf84fcd590e181d567b930e5a3d2
diff --git a/src/nwmatcher.js b/src/nwmatcher.js index <HASH>..<HASH> 100644 --- a/src/nwmatcher.js +++ b/src/nwmatcher.js @@ -828,7 +828,7 @@ NW.Dom = (function(global) { } // caching enabled ? - if (cachingEnabled && !cachingPaused && from.nodeType == 9 || !isDisconnected(from, root)) { + if (cachingEnabled && !cachingPaused && (from.nodeType == 9 || !isDisconnected(from, root))) { snap = base.snapshot; // valid base context storage if (snap && !snap.isExpired) {
fixed bug with IE where the engine was checking elements against the document using .contains()
dperini_nwmatcher
train
js
69495701632e5f3f218c1a8db4d862ea7d7c2257
diff --git a/lib/fb_graph_rails/fb_action_controller_extension.rb b/lib/fb_graph_rails/fb_action_controller_extension.rb index <HASH>..<HASH> 100644 --- a/lib/fb_graph_rails/fb_action_controller_extension.rb +++ b/lib/fb_graph_rails/fb_action_controller_extension.rb @@ -18,7 +18,9 @@ module FbGraphRails::FbActionControllerExtension authenticate self.class.fb_model.identify(auth.user) return true else - return redirect_to auth.authorize_uri(self.class.fb_canvas_url).html_safe + url = auth.authorize_uri(self.class.fb_canvas_url).html_safe + return render :inline => "<script>top.location.href = '#{url}';</script>" + end end end
Using JS to redirect to FBs OAuth Page as documented
zickzackv_fb_graph_rails
train
rb
673e9f37e768c8e1cfa8455b099dc5cc66cc53ac
diff --git a/test/andpush_test.rb b/test/andpush_test.rb index <HASH>..<HASH> 100644 --- a/test/andpush_test.rb +++ b/test/andpush_test.rb @@ -8,6 +8,7 @@ class AndpushTest < Minitest::Test client = Andpush.build(server_key) json = { to: device_token, + dry_run: true, notification: { title: "Update", body: "Your weekly summary is ready"
Do not actually push notifiactions in test
yuki24_andpush
train
rb
f3c2049874cff86a38105e0f63013c728913d065
diff --git a/tests/settings.py b/tests/settings.py index <HASH>..<HASH> 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -24,6 +24,15 @@ INSTALLED_APPS = ( 'pgallery', ) +MIDDLEWARE_CLASSES = ( + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +) + SECRET_KEY = 'notreallyasecret' MEDIA_ROOT = project_path('media')
Added MIDDLEWARE_CLASSES to test settings for Django <I>+ compatibility.
zsiciarz_django-pgallery
train
py
bee07496c39686377529de5a8dabd60dabbd6a55
diff --git a/src/Underscore.php b/src/Underscore.php index <HASH>..<HASH> 100644 --- a/src/Underscore.php +++ b/src/Underscore.php @@ -102,7 +102,7 @@ class Underscore public static function mixin(array $functions) { foreach ($functions as $name => $function) { - static::$registry->alias($name, $function); + static::getRegistry()->alias($name, $function); } }
Ensure $registry is initialized
Im0rtality_Underscore
train
php
e3a72e9a3dcf7a9797f879ed9a75e8ef740a63c1
diff --git a/examples/RDS_VPC.py b/examples/RDS_VPC.py index <HASH>..<HASH> 100644 --- a/examples/RDS_VPC.py +++ b/examples/RDS_VPC.py @@ -107,7 +107,7 @@ mydb = t.add_resource(DBInstance( EngineVersion="5.5", MasterUsername=Ref(dbuser), MasterUserPassword=Ref(dbpassword), - DBSubnetGroupName=Ref(myvpcsecuritygroup), + DBSubnetGroupName=Ref(mydbsubnetgroup), VPCSecurityGroups=[Ref(myvpcsecuritygroup)], ))
Use subnet group for param, not vpc securitygroup
cloudtools_troposphere
train
py
6de81a7de381a761d23383b9a3fba992beccfcfd
diff --git a/lib/deployml/rake/tasks.rb b/lib/deployml/rake/tasks.rb index <HASH>..<HASH> 100644 --- a/lib/deployml/rake/tasks.rb +++ b/lib/deployml/rake/tasks.rb @@ -12,6 +12,18 @@ namespace :deploy do @project.remote_sh args.command end + desc 'Executes a rake task on the deploy server' + task :task, [:name] => :project do |t,args| + @project.remote_task args.name + end + + desc 'Starts a SSH session with the deploy server' + task :ssh => :project do + puts "Starting an SSH session with #{@project.dest_uri.host} ..." + + @project.ssh + end + desc 'Synches the project' task :sync => :project do puts "Syncing project from #{@project.source_uri} ..." @@ -83,11 +95,4 @@ namespace :deploy do puts "Project deployed." end - - desc 'Starts a SSH session with the deploy server' - task :ssh => :project do - puts "Starting an SSH session with #{@project.dest_uri.host} ..." - - @project.ssh - end end
Added the deploy:task task, for running tasks on the deploy server.
postmodern_deployml
train
rb
aedfef7be13cf7c7815a345e51bb57de04eddc8f
diff --git a/bin/hydra.js b/bin/hydra.js index <HASH>..<HASH> 100755 --- a/bin/hydra.js +++ b/bin/hydra.js @@ -52,9 +52,21 @@ hydraConfig.plugins.forEach(function(pluginDef) { pluginObject.name = pluginDef.name; hydra.registerPluginObject(pluginObject); - console.log("Registering hydra plugin " + - pluginObject.name + " (" + pluginObject.heads.length + - " heads)"); + var featureMessages = []; + if (typeof pluginObject.heads === 'object') { + featureMessages.push(pluginObject.heads.length + " head(s)"); + } + if (typeof pluginObject.tests === 'object') { + var testCount = 0; + for (var test in pluginObject.tests) { + if (pluginObject.tests.hasOwnProperty(test)) { + testCount++; + } + } + featureMessages.push(testCount + " test(s)"); + } + console.log("Registering hydra plugin " + pluginObject.name + " (" + + featureMessages.join(", ") + ")"); }); var app = module.exports = express.createServer(express.logger());
Show plugin number of tests (not only heads)
robohydra_robohydra
train
js
3b677b3caed073de15e0ba88c0ab5e766f02e071
diff --git a/NavigationReact/sample/native/web/SceneNavigator.js b/NavigationReact/sample/native/web/SceneNavigator.js index <HASH>..<HASH> 100644 --- a/NavigationReact/sample/native/web/SceneNavigator.js +++ b/NavigationReact/sample/native/web/SceneNavigator.js @@ -23,10 +23,10 @@ class SceneNavigator extends Component{ render() { var {state, data, url, crumbs} = this.props.stateNavigator.stateContext; var {styleStart, styleMiddle, styleEnd} = this.props; - var scenes = crumbs.concat({state, data, url, show: true}).map((sceneContext, i) => { + var scenes = crumbs.concat({state, data, url, show: true}).map((sceneContext) => { var {state, data, url, show} = sceneContext; return ( - <Motion key={i} defaultStyle={(state.styleStart || styleStart)(data)} + <Motion key={url} defaultStyle={(state.styleStart || styleStart)(data)} style={(state.styleEnd || styleEnd)(!!show, data)}> {(interpolatingStyle) => <div style={(state.styleMiddle || styleMiddle)(interpolatingStyle, !!show, data)}>
Restored url as key because same url can't repeat Because the crumbs appear in the url the same url can't appear more than once
grahammendick_navigation
train
js
dd876ae501f9ec51e7af059cfb7deece2fb7270e
diff --git a/sources/EngineWorks/DBAL/Pager.php b/sources/EngineWorks/DBAL/Pager.php index <HASH>..<HASH> 100644 --- a/sources/EngineWorks/DBAL/Pager.php +++ b/sources/EngineWorks/DBAL/Pager.php @@ -242,7 +242,7 @@ class Pager if (false === $value) { throw new \RuntimeException("Unable to query the record count using a subquery: $query"); } - return $value; + return (int) $value; } /** @@ -255,7 +255,7 @@ class Pager if (false === $value) { throw new \RuntimeException("Unable to query the record count using a query: $query"); } - return $value; + return (int) $value; } /**
getTotalRecordsBySelectCount and getTotalRecordsByQueryCount cast the return value to integer
eclipxe13_engineworks-dbal
train
php
5c1b990ad16e0cf6b540f6c114f4529fd1ef2574
diff --git a/server/webapp/WEB-INF/rails.new/app/helpers/application_helper.rb b/server/webapp/WEB-INF/rails.new/app/helpers/application_helper.rb index <HASH>..<HASH> 100644 --- a/server/webapp/WEB-INF/rails.new/app/helpers/application_helper.rb +++ b/server/webapp/WEB-INF/rails.new/app/helpers/application_helper.rb @@ -549,9 +549,9 @@ module ApplicationHelper end def first_plugin_which_supports_vsm_analytics - default_plugin_info_finder.allPluginInfos(PluginConstants.ANALYTICS_EXTENSION).each do |combined_plugin_info| + default_plugin_info_finder.allPluginInfos(PluginConstants.ANALYTICS_EXTENSION).find do |combined_plugin_info| extension_info = combined_plugin_info.extensionFor(PluginConstants.ANALYTICS_EXTENSION) - return extension_info if extension_info.getCapabilities().supportsVSMAnalytics() + extension_info if extension_info.getCapabilities().supportsVSMAnalytics() end end
Use a proper find method instead of a `each` with return
gocd_gocd
train
rb
55e30740624b64a88cd19e8ea4dbd474853e2a76
diff --git a/bundles/org.eclipse.orion.client.editor/web/orion/textview/textView.js b/bundles/org.eclipse.orion.client.editor/web/orion/textview/textView.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.editor/web/orion/textview/textView.js +++ b/bundles/org.eclipse.orion.client.editor/web/orion/textview/textView.js @@ -2745,6 +2745,7 @@ define("orion/textview/textView", ['orion/textview/textModel', 'orion/textview/k pixel = Math.min(Math.max(0, pixel), verticalMaximum - clientHeight); this._scrollView(0, pixel - verticalScrollOffset); } + return true; }, _doSelectAll: function (args) { var model = this._model;
Bug <I> - [MAC] Typing Home on editor moves caret
eclipse_orion.client
train
js
a915d56fb2c80b69bc2a25f0078bf072b71862ba
diff --git a/functional/FunctionalTest.java b/functional/FunctionalTest.java index <HASH>..<HASH> 100644 --- a/functional/FunctionalTest.java +++ b/functional/FunctionalTest.java @@ -3848,6 +3848,7 @@ public class FunctionalTest { Map<String, String> env = pb.environment(); env.put("MINIO_ROOT_USER", "minio"); env.put("MINIO_ROOT_PASSWORD", "minio123"); + env.put("MINIO_CI_CD", "1"); env.put("MINIO_KMS_KES_ENDPOINT", "https://play.min.io:7373"); env.put("MINIO_KMS_KES_KEY_FILE", "play.min.io.kes.root.key"); env.put("MINIO_KMS_KES_CERT_FILE", "play.min.io.kes.root.cert");
add MINIO_CI_CD=1 environment value (#<I>)
minio_minio-java
train
java
0caa5cc5fa8098ef8270109db03205ad40d8f873
diff --git a/pkg/testing/integration/program.go b/pkg/testing/integration/program.go index <HASH>..<HASH> 100644 --- a/pkg/testing/integration/program.go +++ b/pkg/testing/integration/program.go @@ -161,7 +161,9 @@ func (opts *ProgramTestOptions) GetDebugLogLevel() int { return opts.DebugLogLevel } if du := os.Getenv("PULUMI_TEST_DEBUG_LOG_LEVEL"); du != "" { - if n, _ := strconv.Atoi(du); n > 0 { + if n, e := strconv.Atoi(du); e != nil { + panic(e) + } else if n > 0 { return n } }
Making linter happy. (#<I>)
pulumi_pulumi
train
go
af9505ffa24da7eb2e77bec0400de5dfb50ca0fd
diff --git a/builtin/providers/aws/resource_aws_key_pair.go b/builtin/providers/aws/resource_aws_key_pair.go index <HASH>..<HASH> 100644 --- a/builtin/providers/aws/resource_aws_key_pair.go +++ b/builtin/providers/aws/resource_aws_key_pair.go @@ -75,8 +75,10 @@ func resourceAwsKeyPairCreate(d *schema.ResourceData, meta interface{}) error { keyName = v.(string) } else if v, ok := d.GetOk("key_name_prefix"); ok { keyName = resource.PrefixedUniqueId(v.(string)) + d.Set("key_name", keyName) } else { keyName = resource.UniqueId() + d.Set("key_name", keyName) } publicKey := d.Get("public_key").(string)
aws_key_pair: Ensure key_name attribute is set Ensure that the `key_name` attribute is available to `aws_key_pair` resource dependents, even when the attribute is not specifically set (i.e., when `key_name_prefix` or automatic naming is performed). Fixes #<I>.
hashicorp_terraform
train
go
9dbc34f06c4864e43d831b6a6766e1cae3cc3840
diff --git a/python/phonenumbers/__init__.py b/python/phonenumbers/__init__.py index <HASH>..<HASH> 100644 --- a/python/phonenumbers/__init__.py +++ b/python/phonenumbers/__init__.py @@ -139,7 +139,7 @@ from .phonenumbermatcher import PhoneNumberMatch, PhoneNumberMatcher, Leniency # Version number is taken from the upstream libphonenumber version # together with an indication of the version of the Python-specific code. -__version__ = "8.3.1" +__version__ = "8.3.2" __all__ = ['PhoneNumber', 'CountryCodeSource', 'FrozenPhoneNumber', 'REGION_CODE_FOR_NON_GEO_ENTITY', 'NumberFormat', 'PhoneNumberDesc', 'PhoneMetadata',
Prep for <I> release
daviddrysdale_python-phonenumbers
train
py
c47fb40c3a3f74e443ca2722eb161f2f2fe180b6
diff --git a/lib/mochawesome.js b/lib/mochawesome.js index <HASH>..<HASH> 100755 --- a/lib/mochawesome.js +++ b/lib/mochawesome.js @@ -240,14 +240,15 @@ function cleanSuite (suite) { */ function cleanTest (test) { - var code = '', + var code = test.fn ? test.fn.toString() : test.body, err = test.err ? _.pick( test.err, ['name', 'message', 'stack'] ) : test.err; - if(test.fn){ - code = cleanCode(test.fn.toString()); + + if (code) { + code = cleanCode(code); code = Highlight.fixMarkup(Highlight.highlightAuto(code).value); } - if(err && err.stack){ + if (err && err.stack) { err.stack = Highlight.fixMarkup(Highlight.highlightAuto(err.stack).value); }
look for code block in test.body for mocha <I>
adamgruber_mochawesome
train
js
5f0ec9128fba517087d069ab7475fc3043d2fc6b
diff --git a/scripts/getBuildData.js b/scripts/getBuildData.js index <HASH>..<HASH> 100644 --- a/scripts/getBuildData.js +++ b/scripts/getBuildData.js @@ -4,7 +4,7 @@ module.exports = (isCompiled = false) => { let buildData = ''; if (git.branch() !== 'master') { - buildData += '\n'; + buildData += ''; if (isCompiled) { buildData += ` @@ -22,5 +22,5 @@ module.exports = (isCompiled = false) => { } } - return buildData.replace(/\n/, '').replace(/^ +/gm, ' '); + return buildData.replace(/^ +/gm, ' '); };
refactor: Remove superfluous newline
nostalgic-css_NES.css
train
js
8a67402b5aa3a636abad216cdde48d2224e63ce3
diff --git a/lib/contracts/decorators.rb b/lib/contracts/decorators.rb index <HASH>..<HASH> 100644 --- a/lib/contracts/decorators.rb +++ b/lib/contracts/decorators.rb @@ -5,6 +5,12 @@ module Contracts class << klass attr_accessor :decorated_methods + + def self.owner_class + ObjectSpace.each_object(self).find do |klass| + klass.singleton_class == self + end + end end end @@ -140,6 +146,10 @@ Here's why: Suppose you have this code: end def decorate(klass, *args) + if self < Object.singleton_class + return self.owner_class.decorate(klass, *args) + end + @decorators ||= [] @decorators << [klass, args] end diff --git a/spec/contracts_spec.rb b/spec/contracts_spec.rb index <HASH>..<HASH> 100644 --- a/spec/contracts_spec.rb +++ b/spec/contracts_spec.rb @@ -55,7 +55,7 @@ RSpec.describe "Contracts:" do it "should fail with proper error when there is contract violation" do expect { SingletonClassExample.hoge(3) - }.to raise_error(ContractError, /Expected: String.*Actual: 3/) + }.to raise_error(ContractError, /Expected: String/) end end
singleton class usage :: add support for eigenclasses
egonSchiele_contracts.ruby
train
rb,rb
3ede89b8e295d59b5290863330f5149f8542eb81
diff --git a/lib/appium/AppiumRunner.js b/lib/appium/AppiumRunner.js index <HASH>..<HASH> 100644 --- a/lib/appium/AppiumRunner.js +++ b/lib/appium/AppiumRunner.js @@ -56,7 +56,7 @@ function AppiumRunner(options) { } function getAppiumServerPath() { - return path.resolve(process.cwd(), 'cordova-paramedic/node_modules/appium/build/lib/main.js'); + return path.resolve(__dirname, '../../node_modules/appium/build/lib/main.js'); } function getFullAppPath(appPath) { @@ -199,8 +199,9 @@ function killProcess(procObj, killSignal, callback) { } function installAppiumServer() { - logger.normal('paramedic-appium: Installing Appium server...'); - shell.pushd(path.join(__dirname, '../..')); + var installPath = path.join(__dirname, '../..'); + logger.normal('paramedic-appium: Installing Appium server to ' + installPath); + shell.pushd(installPath); return execPromise('npm install appium').then(function () { shell.popd(); });
CB-<I> Run Appium tests from any directory
ratson_cordova-testbed
train
js
adfc53a605c5c157f2656a1b18a60331135bb3c3
diff --git a/optaplanner-examples/src/main/java/org/optaplanner/examples/tsp/domain/Visit.java b/optaplanner-examples/src/main/java/org/optaplanner/examples/tsp/domain/Visit.java index <HASH>..<HASH> 100644 --- a/optaplanner-examples/src/main/java/org/optaplanner/examples/tsp/domain/Visit.java +++ b/optaplanner-examples/src/main/java/org/optaplanner/examples/tsp/domain/Visit.java @@ -21,8 +21,9 @@ import org.optaplanner.core.api.domain.entity.PlanningEntity; import org.optaplanner.core.api.domain.variable.PlanningVariable; import org.optaplanner.examples.common.domain.AbstractPersistable; import org.optaplanner.examples.tsp.domain.solver.DomicileDistanceVisitDifficultyWeightFactory; +import org.optaplanner.examples.tsp.domain.solver.LatitudeVisitDifficultyComparator; -@PlanningEntity(difficultyWeightFactoryClass = DomicileDistanceVisitDifficultyWeightFactory.class) +@PlanningEntity(difficultyComparatorClass = LatitudeVisitDifficultyComparator.class) @XStreamAlias("Visit") public class Visit extends AbstractPersistable implements Standstill {
tsp: switch back to LatitudeVisitDifficultyComparator for FFD by default
kiegroup_optaplanner
train
java
549763db63b004b3c0dc2a7c87c7077e2216046a
diff --git a/js/core/Component.js b/js/core/Component.js index <HASH>..<HASH> 100644 --- a/js/core/Component.js +++ b/js/core/Component.js @@ -250,7 +250,9 @@ define(["require", "js/core/Element", "js/core/TextElement", "js/core/Bindable", if (_.indexOf(addedDescriptors, child.$descriptor) === -1) { children.push(child); - addedDescriptors.push(child.$descriptor); + if(child.$descriptor){ + addedDescriptors.push(child.$descriptor); + } } } } @@ -344,7 +346,7 @@ define(["require", "js/core/Element", "js/core/TextElement", "js/core/Bindable", if(this.$unitializedChildren){ var ret = []; while(this.$unitializedChildren.length){ - ret.push(this.$unitializedChildren.pop()); + ret.push(this.$unitializedChildren.shift()); } return ret; }
fixed adding of children with no descriptor
rappid_rAppid.js
train
js
d1dfa0cefbe670ea10999bce8cf99379724ce373
diff --git a/ntfy/backends/pushover.py b/ntfy/backends/pushover.py index <HASH>..<HASH> 100644 --- a/ntfy/backends/pushover.py +++ b/ntfy/backends/pushover.py @@ -1,10 +1,10 @@ import requests -def notify(title, message, api_token, user_key, device=None, **kwargs): +def notify(title, message, user_key, + api_token='aUnsraBiEZVsmrG89AZp47K3S2dX2a', device=None, **kwargs): """ Required config keys: - * 'api_token' * 'user_key' """
include default pushover key No need for user to set up their own pushover app.
dschep_ntfy
train
py
739a236b360181a3a5e5c7db379abeef7e72f75d
diff --git a/plugins/PrivacyManager/DoNotTrackHeaderChecker.php b/plugins/PrivacyManager/DoNotTrackHeaderChecker.php index <HASH>..<HASH> 100644 --- a/plugins/PrivacyManager/DoNotTrackHeaderChecker.php +++ b/plugins/PrivacyManager/DoNotTrackHeaderChecker.php @@ -49,8 +49,10 @@ class DoNotTrackHeaderChecker // this is an optional supplement to the site's tracking status resource at: // /.well-known/dnt - // per Tracking Preference Expression (draft) - Common::sendHeader('Tk: 1'); + // per Tracking Preference Expression + + //Tracking Perference Expression has been updated to require Tk: N rather than Tk: 1 + Common::sendHeader('Tk: N'); } }
Fix for issue <I> (#<I>) Fix for issue <I> - Tk should equal N not 1
matomo-org_matomo
train
php
27e7823cfe682a749b07b8ca747d13c9ab929fd5
diff --git a/src/test/com/twitter/elephantbird/pig/load/TestErrorsInInput.java b/src/test/com/twitter/elephantbird/pig/load/TestErrorsInInput.java index <HASH>..<HASH> 100644 --- a/src/test/com/twitter/elephantbird/pig/load/TestErrorsInInput.java +++ b/src/test/com/twitter/elephantbird/pig/load/TestErrorsInInput.java @@ -115,6 +115,10 @@ public class TestErrorsInInput { public void TestErrorTolerance() throws Exception { // test configurable error tolerance in EB record reader. + if (pigServer == null) { + return; + } + // initialize String testDir = System.getProperty("test.build.data") + "/TestErrorTolerance";
skip test if there is no lzo configured
twitter_elephant-bird
train
java
c5fa8994da644448c3f3bca1a4ebd417a08f7e6d
diff --git a/src/Build.php b/src/Build.php index <HASH>..<HASH> 100644 --- a/src/Build.php +++ b/src/Build.php @@ -1,5 +1,7 @@ <?php +declare(strict_types=1); + namespace ReallySimpleJWT; use ReallySimpleJWT\TokenAbstract; diff --git a/tests/BuildTest.php b/tests/BuildTest.php index <HASH>..<HASH> 100644 --- a/tests/BuildTest.php +++ b/tests/BuildTest.php @@ -83,6 +83,8 @@ class BuildTest extends TestCase { $build = new Build(new Validate); - $this->assertSame('127.0.0.1', $build->setIssuer('127.0.0.1')->getPayload()['iss']); + $build->setIssuer('127.0.0.1'); + + $this->assertSame($build->getPayload()['iss'], '127.0.0.1'); } }
Added set issuer method and tests to build class.
RobDWaller_ReallySimpleJWT
train
php,php
e0216f210aa0d9bda5ceb5aad8a91ea2a103a631
diff --git a/test/interactive/interactive_init.rb b/test/interactive/interactive_init.rb index <HASH>..<HASH> 100644 --- a/test/interactive/interactive_init.rb +++ b/test/interactive/interactive_init.rb @@ -1,3 +1,4 @@ +ENV['LOG_TAGS'] ||= '_untagged,consumer' ENV['LOG_LEVEL'] ||= 'info' require_relative '../test_init'
Log tags are set by interactive init
eventide-project_consumer-event-store
train
rb
7146f5b601a4d2e2fe6d5ba82b5200834e50c806
diff --git a/modules/custom/wxt_core/src/Commands/Hooks.php b/modules/custom/wxt_core/src/Commands/Hooks.php index <HASH>..<HASH> 100644 --- a/modules/custom/wxt_core/src/Commands/Hooks.php +++ b/modules/custom/wxt_core/src/Commands/Hooks.php @@ -58,7 +58,9 @@ class Hooks extends DrushCommands { * @hook pre-command updatedb */ public function preUpdate() { + \Drupal::state()->set('system.maintenance_mode', TRUE); drupal_flush_all_caches(); + \Drupal::state()->set('system.maintenance_mode', FALSE); } /**
Issue #<I>: Flushing caches during preUpdate hook should set maintenance mode
drupalwxt_wxt
train
php
b5c061a41f751ff98f2261d92a2d806a43c980e6
diff --git a/core/lib/refinery/helpers/image_helper.rb b/core/lib/refinery/helpers/image_helper.rb index <HASH>..<HASH> 100644 --- a/core/lib/refinery/helpers/image_helper.rb +++ b/core/lib/refinery/helpers/image_helper.rb @@ -28,10 +28,18 @@ module Refinery # call rails' image tag function with default alt tag. # if any other options were supplied these are merged in and can replace the defaults. # if the geomtry is nil, then we know the image height and width already. + # detect nil geometry or cropping presence which is where we can guess the dimensions + unless geometry.nil? or !(split_geometry = geometry.to_s.split('#')).many? or !(split_geometry = split_geometry.first.split('x')).many? + image_width, image_height = split_geometry.first.split('x') + else + image_with = nil + image_height = nil + end + image_tag(image.thumbnail(geometry).url, { :alt => image.respond_to?(:title) ? image.title : image.image_name, - :width => (image.image_width if geometry.nil?), - :height => (image.image_height if geometry.nil?) + :width => image_width, + :height => image_height }.merge(options)) end end
Automagically insert image width and height dimensions if the developer is cropping their image because we can work those out.
refinery_refinerycms
train
rb
709ddfedfd31eea43bf8f683db5b09a28d293700
diff --git a/lib/httparty/logger/logger.rb b/lib/httparty/logger/logger.rb index <HASH>..<HASH> 100644 --- a/lib/httparty/logger/logger.rb +++ b/lib/httparty/logger/logger.rb @@ -5,7 +5,7 @@ module HTTParty module Logger def self.build(logger, level, formatter) level ||= :info - format ||= :apache + formatter ||= :apache case formatter when :curl
Initialize formatter if not given by caller same way as level
jnunemaker_httparty
train
rb
91e0c91d7c6ead882bee1fa500a5085f94716718
diff --git a/lib/active_admin/views/index_as_block.rb b/lib/active_admin/views/index_as_block.rb index <HASH>..<HASH> 100644 --- a/lib/active_admin/views/index_as_block.rb +++ b/lib/active_admin/views/index_as_block.rb @@ -21,7 +21,7 @@ module ActiveAdmin def build(page_presenter, collection) add_class "index" - resource_selection_toggle_panel + resource_selection_toggle_panel if active_admin_config.batch_actions.any? collection.each do |obj| instance_exec(obj, &page_presenter.block) end diff --git a/lib/active_admin/views/index_as_grid.rb b/lib/active_admin/views/index_as_grid.rb index <HASH>..<HASH> 100644 --- a/lib/active_admin/views/index_as_grid.rb +++ b/lib/active_admin/views/index_as_grid.rb @@ -37,7 +37,7 @@ module ActiveAdmin protected def build_table - resource_selection_toggle_panel + resource_selection_toggle_panel if active_admin_config.batch_actions.any? table :class => "index_grid" do collection.in_groups_of(number_of_columns).each do |group| build_row(group)
Only show the batch action panel if there are batch actions. Fixes #<I>
activeadmin_activeadmin
train
rb,rb
37cb93d1506c95cc474487bd8abcffdfae8d0e48
diff --git a/test/extended/router/shard/shard.go b/test/extended/router/shard/shard.go index <HASH>..<HASH> 100644 --- a/test/extended/router/shard/shard.go +++ b/test/extended/router/shard/shard.go @@ -29,8 +29,6 @@ var ingressControllerNonDefaultAvailableConditions = []operatorv1.OperatorCondit {Type: operatorv1.IngressControllerAvailableConditionType, Status: operatorv1.ConditionTrue}, {Type: operatorv1.LoadBalancerManagedIngressConditionType, Status: operatorv1.ConditionTrue}, {Type: operatorv1.LoadBalancerReadyIngressConditionType, Status: operatorv1.ConditionTrue}, - {Type: operatorv1.DNSManagedIngressConditionType, Status: operatorv1.ConditionTrue}, - {Type: operatorv1.DNSReadyIngressConditionType, Status: operatorv1.ConditionTrue}, {Type: "Admitted", Status: operatorv1.ConditionTrue}, }
extended/test/router: omit DNS managed conditions for shards When standing up a new router shard omit the DNS managed conditions. The remainder of the tests that spin up new shards go on to assert that host names can be resolved so these conditions are not necessary and will, in general, avoid tests failing on UPI platforms that don't manage DNS. Fixes: <URL>
openshift_origin
train
go
1651988144c13c39d351eba57b69ef3206961cf1
diff --git a/samples/amt.rb b/samples/amt.rb index <HASH>..<HASH> 100644 --- a/samples/amt.rb +++ b/samples/amt.rb @@ -57,7 +57,7 @@ def sol_stop client instance.RequestStateChange(32768) when 32771 # SOL and IDE-R are enabled - instance.RequestStateChange(32769,nil,0) + instance.RequestStateChange(32769) when 32768 # SOL and IDE-R are disabled when 32769
amt.rb: only pass one arg to RequestStateChange
kkaempf_ruby-wbem
train
rb
3820c12b81502f27ecf1f0caef00f5acadca086c
diff --git a/plugin/requirejs.js b/plugin/requirejs.js index <HASH>..<HASH> 100644 --- a/plugin/requirejs.js +++ b/plugin/requirejs.js @@ -19,7 +19,7 @@ function resolveName(name, data) { var excl = name.indexOf("!"); - if (excl > -1) name = name.slice(excl + 1); + if (excl > -1) name = name.slice(0, excl); var opts = data.options; var hasExt = /\.js$/.test(name);
[requirejs plugin] Change (half-assed) handling of
ternjs_tern
train
js
10cd038ddf21237e24a5e853104a578bfca097dc
diff --git a/autopep8.py b/autopep8.py index <HASH>..<HASH> 100755 --- a/autopep8.py +++ b/autopep8.py @@ -4363,7 +4363,12 @@ def main(argv=None, apply_config=True): assert len(args.files) == 1 assert not args.recursive - ret = fix_multiple_files(args.files, args, sys.stdout) + results = fix_multiple_files(args.files, args, sys.stdout) + if args.diff: + ret = any([len(ret) != 0 for ret in results]) + else: + # with in-place option + ret = any([ret is not None for ret in results]) if args.exit_code and ret: return EXIT_CODE_EXISTS_DIFF except KeyboardInterrupt:
fix incompatible exit code with --jobs=0 and --exit-code
hhatto_autopep8
train
py
2b8d1fd6d66006e4cb62db9fd392dd358c867c5c
diff --git a/src/com/google/javascript/jscomp/WhitelistWarningsGuard.java b/src/com/google/javascript/jscomp/WhitelistWarningsGuard.java index <HASH>..<HASH> 100644 --- a/src/com/google/javascript/jscomp/WhitelistWarningsGuard.java +++ b/src/com/google/javascript/jscomp/WhitelistWarningsGuard.java @@ -256,7 +256,7 @@ public class WhitelistWarningsGuard extends WarningsGuard { out.append( "# This is a list of legacy warnings that have yet to be fixed.\n"); - if (productName != null && !productName.isEmpty()) { + if (productName != null && !productName.isEmpty() && !warnings.isEmpty()) { out.append("# Please find some time and fix at least one of them " + "and it will be the happiest day for " + productName + ".\n"); }
Skip some text in the whitelist if the whitelist doesn't contain any warnings. This is helpful when the whitelist is part of a larger set of warnings. ------------- Created by MOE: <URL>
google_closure-compiler
train
java
85c44012ffd14e247d64d8d4821b5bc07d63e140
diff --git a/lib/rest-core/client/flurry.rb b/lib/rest-core/client/flurry.rb index <HASH>..<HASH> 100644 --- a/lib/rest-core/client/flurry.rb +++ b/lib/rest-core/client/flurry.rb @@ -101,7 +101,7 @@ module RestCore::Flurry::Client private def calculate_query_and_opts query, opts days = opts[:days] || (opts[:weeks] && opts[:weeks] * 7) || - (opts[:months] && opts[:months] * 30) + (opts[:months] && opts[:months] * 30) || 7 startDate = query[:startDate] || (Time.now + 86400 - 86400*days). strftime('%Y-%m-%d')
flurry.rb: by default, query only for 1 week
godfat_rest-more
train
rb
d84fa36f5df51096b31856f6dc5543743009f653
diff --git a/storops/unity/enums.py b/storops/unity/enums.py index <HASH>..<HASH> 100644 --- a/storops/unity/enums.py +++ b/storops/unity/enums.py @@ -537,6 +537,7 @@ class SFPSpeedValuesEnum(UnityEnum): _10GbPS = (10000, '10GbPS') _12GbPS = (12000, '12GbPS') _16GbPS = (16000, '16GbPS') + _25GbPS = (25000, '25GbPS') _32GbPS = (32000, '32GbPS') _40GbPS = (40000, '40GbPS') _100GbPS = (100000, '100GbPS') @@ -585,6 +586,7 @@ class EPSpeedValuesEnum(UnityEnum): _100MbPS = (100, '100MbPS') _1GbPS = (1000, '1GbPS') _10GbPS = (10000, '10GbPS') + _25GbPS = (25000, '25GbPS') _40GbPS = (40000, '40GbPS') _100GbPS = (100000, '100GbPS') _1TbPS = (1000000, '1TbPS')
Unity: fix enums issue (#<I>)
emc-openstack_storops
train
py
2b4a6a1fbf69d98062f433ab690e55db316abb02
diff --git a/benchexec/tools/two_ls.py b/benchexec/tools/two_ls.py index <HASH>..<HASH> 100644 --- a/benchexec/tools/two_ls.py +++ b/benchexec/tools/two_ls.py @@ -50,7 +50,7 @@ class Tool(benchexec.tools.template.BaseTool2): elif returncode == 0: status = result.RESULT_TRUE_PROP elif returncode == 10: - if len(run.output) > 0: + if run.output: result_str = run.output[-1].strip() if result_str == "FALSE(valid-memtrack)": status = result.RESULT_FALSE_MEMTRACK
updated two_ls: replaced length check on run.output
sosy-lab_benchexec
train
py
54f9a6ff77a1a0af6639ced5acfd32c195d03db0
diff --git a/dusty/cli/__init__.py b/dusty/cli/__init__.py index <HASH>..<HASH> 100644 --- a/dusty/cli/__init__.py +++ b/dusty/cli/__init__.py @@ -84,7 +84,7 @@ def _run_command(sock, command): data = sock.recv(65535) timer.cancel() if data: - stripped = data.decode('utf-8').replace(constants.SOCKET_ACK, '').replace(constants.SOCKET_TERMINATOR, '').replace(constants.SOCKET_ERROR_TERMINATOR, '') + stripped = data.replace(constants.SOCKET_ACK, '').replace(constants.SOCKET_TERMINATOR, '').replace(constants.SOCKET_ERROR_TERMINATOR, '') sys.stdout.write(stripped) if data.endswith(constants.SOCKET_TERMINATOR): break
Remove extraneous utf-8 decode in CLI socket recv
gamechanger_dusty
train
py
f804b410ef3a0db0510f46e96aa05c681c4ac5e2
diff --git a/core/BaseView.core.php b/core/BaseView.core.php index <HASH>..<HASH> 100644 --- a/core/BaseView.core.php +++ b/core/BaseView.core.php @@ -77,6 +77,15 @@ class BaseView { }//construct + /** + * Allow the page to be printed by echoing + * the Template object. + */ + public function __toString(){ + $this->printPage(); + }//toString + + /** * @return html
added magic __toString() method to enable echoing the view
discophp_framework
train
php
16639aafdcb308f57e7a022142bcf366f0b2cc24
diff --git a/openquake/engine/db/models.py b/openquake/engine/db/models.py index <HASH>..<HASH> 100644 --- a/openquake/engine/db/models.py +++ b/openquake/engine/db/models.py @@ -94,7 +94,7 @@ LOSS_TYPES = ["structural", "nonstructural", "occupants", "contents"] #: relative tolerance to consider two risk outputs (almost) equal -RISK_RTOL = 0.10 +RISK_RTOL = 0.15 #: absolute tolerance to consider two risk outputs (almost) equal
increased the tolerance to <I>% Former-commit-id: d<I>e<I>c<I>b4ea<I>cead3dde4fe<I>b<I>c1
gem_oq-engine
train
py
6c22d837ef8d6d68b25f16887af37608e22219f0
diff --git a/src/main/java/com/atomist/rug/spi/ExportFunction.java b/src/main/java/com/atomist/rug/spi/ExportFunction.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/atomist/rug/spi/ExportFunction.java +++ b/src/main/java/com/atomist/rug/spi/ExportFunction.java @@ -8,7 +8,6 @@ import java.lang.annotation.*; */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) -@Inherited public @interface ExportFunction { boolean readOnly();
Removed Inherited annotation on ExportFunction
atomist-attic_rug
train
java
d327642299b5ecda2c81870c94ce4b275adb1386
diff --git a/src/ox_modules/module-web.js b/src/ox_modules/module-web.js index <HASH>..<HASH> 100644 --- a/src/ox_modules/module-web.js +++ b/src/ox_modules/module-web.js @@ -217,7 +217,11 @@ export default class WebModule extends WebDriverModule { // maximize browser window try { this.driver.maximizeWindow(); - this.driver.setTimeout({ 'implicit': this.waitForTimeout }); + this.driver.setTimeout({ 'implicit': this.waitForTimeout }); + + if (this.options && this.options.reopenSession !== false) { // true or false if explisitly set. true on null or undefined. + this.driver.reloadSession(); + } } catch (err) { throw new OxError(errHelper.errorCode.UNKNOWN_ERROR, err.message, util.inspect(err)); }
CBS-<I> "Re-open session on each iteration" doesn't work
oxygenhq_oxygen
train
js
c4666f5039da71337f4ff572212fe7bc7e286058
diff --git a/lib/discordrb/bot.rb b/lib/discordrb/bot.rb index <HASH>..<HASH> 100644 --- a/lib/discordrb/bot.rb +++ b/lib/discordrb/bot.rb @@ -78,8 +78,8 @@ module Discordrb end when "MESSAGE_CREATE" message = Message.new(data) - - # TODO: Call event handlers + event = MessageEvent.new(message) + raise_event(event) end end
Raise an event upon receiving a message
meew0_discordrb
train
rb
1917de1058d4d73fbef094d2efb66da32424c7e8
diff --git a/planet/clients/data.py b/planet/clients/data.py index <HASH>..<HASH> 100644 --- a/planet/clients/data.py +++ b/planet/clients/data.py @@ -70,9 +70,6 @@ class DataClient(): def _searches_url(self): return f'{self._base_url}{SEARCHES_PATH}' - def _stats_url(self): - return f'{self._base_url}{STATS_PATH}' - def _request(self, url, method, data=None, params=None, json=None): return Request(url, method=method, data=data, params=params, json=json) @@ -210,7 +207,7 @@ class DataClient(): raise exceptions.ClientError( f'{interval} must be one of {STATS_INTERVAL}') - url = self._stats_url() + url = f'{self._base_url}{STATS_PATH}' request_json = { 'interval': interval, 'filter': search_filter,
refactor small fcn
planetlabs_planet-client-python
train
py
e957e451adae05a841b7089585148b95654760de
diff --git a/salt/client/api.py b/salt/client/api.py index <HASH>..<HASH> 100644 --- a/salt/client/api.py +++ b/salt/client/api.py @@ -273,7 +273,7 @@ class APIClient(object): raise EauthAuthenticationError( "Authentication failed with {0}.".format(repr(ex))) - if not 'token' in tokenage: + if 'token' not in tokenage: raise EauthAuthenticationError("Authentication failed with provided credentials.") # Grab eauth config for the current backend for the current user
Fix PEP8 E<I> - test for membership should be "not in"
saltstack_salt
train
py
be3d529767c6daa2a2d30ecff8e7488c1df73960
diff --git a/text/text.go b/text/text.go index <HASH>..<HASH> 100644 --- a/text/text.go +++ b/text/text.go @@ -174,9 +174,8 @@ func getGlyphImages(face font.Face, runes []rune) []*glyphImage { d.Dot = fixed.Point26_6{fixed.I(x) - b.Min.X, -b.Min.Y} d.DrawString(string(r)) - img, _ := ebiten.NewImageFromImage(rgba, ebiten.FilterDefault) g := &glyphImage{ - image: img, + image: nil, x: x, y: 0, width: w, @@ -190,6 +189,11 @@ func getGlyphImages(face font.Face, runes []rune) []*glyphImage { x += w } + + img, _ := ebiten.NewImageFromImage(rgba, ebiten.FilterDefault) + for i := range neededGlyphs { + imgs[i].image = img + } } return imgs }
text: Bug fix: one image should be used for multiple glyphs (#<I>)
hajimehoshi_ebiten
train
go
1e03c2d8c1134026bf762e9c5f704f5c8539db99
diff --git a/src/Core/Application.php b/src/Core/Application.php index <HASH>..<HASH> 100644 --- a/src/Core/Application.php +++ b/src/Core/Application.php @@ -17,7 +17,14 @@ class Application extends \Tsugi\Silex\Application { $this['tsugi']->output->buffer = false; $P7 = strpos(phpversion(), '7') === 0; - if ( !$P7 ) return false; + + // Some controllers work in PHP 5 + if ( !$P7 ) { + \Tsugi\Controllers\Login::routes($this); + \Tsugi\Controllers\Logout::routes($this); + \Koseu\Controllers\Courses::routes($this); + return false; + } $this->error(function (NotFoundHttpException $e, Request $request, $code) { global $CFG, $LAUNCH, $OUTPUT, $USER, $CONTEXT, $LINK, $RESULT;
Add a few routes for PHP 5
tsugiproject_koseu-php
train
php
48953297137470c14ca084ec3fe8809ed3505b99
diff --git a/spec/unit/node/environment.rb b/spec/unit/node/environment.rb index <HASH>..<HASH> 100755 --- a/spec/unit/node/environment.rb +++ b/spec/unit/node/environment.rb @@ -171,7 +171,7 @@ describe Puppet::Node::Environment do env.expects(:modulepath).returns %w{/a} Dir.expects(:entries).with("/a").returns %w{foo} - env.modules.each {|mod| mod.environment.should == "testing" } + env.modules.each {|mod| mod.environment.should == env } end it "should cache the module list" do
Fix for #<I> (test not checking for what it really wanted)
puppetlabs_puppet
train
rb
80a13b2b3b201384610714a1ee6c977eecff4206
diff --git a/pygc/__init__.py b/pygc/__init__.py index <HASH>..<HASH> 100644 --- a/pygc/__init__.py +++ b/pygc/__init__.py @@ -1,4 +1,4 @@ -__version__ = '0.2' +__version__ = '0.3-dev' from pygc.gc import great_circle from pygc.gc import great_distance
Bump to <I>-dev
axiom-data-science_pygc
train
py
bedf3c82a55b4b67eed93f686cb17e82f7ab19cd
diff --git a/redis/lock.py b/redis/lock.py index <HASH>..<HASH> 100644 --- a/redis/lock.py +++ b/redis/lock.py @@ -77,7 +77,6 @@ class Lock: self, redis, name: str, - *, timeout: Optional[Number] = None, sleep: Number = 0.1, blocking: bool = True, diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( long_description_content_type="text/markdown", keywords=["Redis", "key-value store", "database"], license="MIT", - version="4.3.2", + version="4.3.3", packages=find_packages( include=[ "redis",
Fix Lock crash, and versioning <I> (#<I>) * fix lock * <I>
andymccurdy_redis-py
train
py,py
cd3c9588ac6a6a408351dfa1aff8d6ab2a7362f5
diff --git a/edit_osx.go b/edit_osx.go index <HASH>..<HASH> 100644 --- a/edit_osx.go +++ b/edit_osx.go @@ -8,7 +8,7 @@ import ( "time" ) -const charInvervalMs = 50 +const charInvervalMs = 20 /* EditField is a single-line text edit contol. Edit field consumes some keyboard
smoother delay for more natural keyboard entry
VladimirMarkelov_clui
train
go
bc75b1ac96b5c675aa27397250c5c02b1e0e46a7
diff --git a/packages/ember-viewstates/lib/view_state.js b/packages/ember-viewstates/lib/view_state.js index <HASH>..<HASH> 100644 --- a/packages/ember-viewstates/lib/view_state.js +++ b/packages/ember-viewstates/lib/view_state.js @@ -243,7 +243,8 @@ var get = Ember.get, set = Ember.set; `view` that references the `Ember.View` object that was interacted with. **/ -Ember.ViewState = Ember.State.extend({ +Ember.ViewState = Ember.State.extend( +/** @scope Ember.ViewState.prototype */ { isViewState: true, enter: function(stateManager) {
Add @scope so properties are picked up by JsDoc
emberjs_ember.js
train
js
2d427b1d86285b41799a725953954dc23fca66b5
diff --git a/tests/test_bootstrap_sampler.py b/tests/test_bootstrap_sampler.py index <HASH>..<HASH> 100644 --- a/tests/test_bootstrap_sampler.py +++ b/tests/test_bootstrap_sampler.py @@ -246,7 +246,6 @@ class SamplerTests(unittest.TestCase): func, bad_resampled_obs_ids, fake_orig_obs_ids) - return None def test_create_bootstrap_dataframe(self):
Completed initial test suite for bootstrap_samplyer.py
timothyb0912_pylogit
train
py
d41556a2f33fb5eafbbb4f8f8ecdb44c5e8b41e9
diff --git a/lib/Form/Basic.php b/lib/Form/Basic.php index <HASH>..<HASH> 100644 --- a/lib/Form/Basic.php +++ b/lib/Form/Basic.php @@ -242,7 +242,7 @@ class Form_Basic extends View implements ArrayAccess { function addSeparator($class='',$attr=array()){ if(!isset($this->template_chunks['form_separator']))return $this->add('View')->addClass($class); $c = clone $this->template_chunks['form_separator']; - $c->trySet('fieldset_class','atk-cell'); + $c->trySet('fieldset_class','atk-cell '.$class); $this->template->trySet('fieldset_class','atk-cell'); $this->template->trySet('form_class','atk-cells atk-cells-gutter-large'); @@ -251,7 +251,7 @@ class Form_Basic extends View implements ArrayAccess { $c->appendHTML('fieldset_attributes',' '.$k.'="'.$v.'"'); } } - + return $this->add('Html')->set($c->render()); }
if you use $this->addSeperetor('any-class') inside the form the class 'any-class' goes nowhere. This fix set provided class to fieldset_class of Form
atk4_atk4
train
php
95dc9302fb6cd6b35d70effffc5149b516484e54
diff --git a/db/jobs.go b/db/jobs.go index <HASH>..<HASH> 100644 --- a/db/jobs.go +++ b/db/jobs.go @@ -79,7 +79,7 @@ type JobFilter struct { ExactMatch bool } -func (f *JobFilter) Query(driver string) (string, []interface{}, error) { +func (f *JobFilter) Query() (string, []interface{}, error) { wheres := []string{"1"} args := []interface{}{}
Remove 'driver' reference We don't support multiple drivers any more
starkandwayne_shield
train
go
88d19b7d558cb0168bbc49f1494fdb14d52fb2cc
diff --git a/phy/utils/_misc.py b/phy/utils/_misc.py index <HASH>..<HASH> 100644 --- a/phy/utils/_misc.py +++ b/phy/utils/_misc.py @@ -103,13 +103,17 @@ def _show_shortcuts(shortcuts, name=''): def _git_version(): + curdir = os.getcwd() filedir, _ = op.split(__file__) + os.chdir(filedir) try: fnull = open(os.devnull, 'w') version = ('-git-' + subprocess.check_output( - ['git', '-C', filedir, 'describe', '--abbrev=8', '--dirty', + ['git', 'describe', '--abbrev=8', '--dirty', '--always', '--tags'], stderr=fnull).strip().decode('ascii')) return version except (OSError, subprocess.CalledProcessError): return "" + finally: + os.chdir(curdir)
Reverted commit <I>b<I> to support git pre-<I>
kwikteam_phy
train
py
2c4c3309a1fe2538ee714e65072748c70bea135b
diff --git a/tests/integration/test.basics.js b/tests/integration/test.basics.js index <HASH>..<HASH> 100644 --- a/tests/integration/test.basics.js +++ b/tests/integration/test.basics.js @@ -80,6 +80,15 @@ adapters.forEach(function (adapter) { }); }); + it('Get invalid id', function () { + var db = new PouchDB(dbs.name); + return db.get(1234).then(function() { + throw 'show not be here'; + }).catch(function(err) { + should.exist(err); + }); + }); + it('Add a doc with a promise', function (done) { var db = new PouchDB(dbs.name); db.post({test: 'somestuff'}).then(function (info) {
(#<I>) - Add tets for invalid id in get
pouchdb_pouchdb
train
js
5bc5dd697065c448b9dd5e06e52cc29965bcaacd
diff --git a/crabpy/tests/gateway/test_crab.py b/crabpy/tests/gateway/test_crab.py index <HASH>..<HASH> 100644 --- a/crabpy/tests/gateway/test_crab.py +++ b/crabpy/tests/gateway/test_crab.py @@ -785,7 +785,7 @@ class StraatTests(unittest.TestCase): def test_wegobjecten(self): crab = CrabGateway( - crab_factory + crab_factory() ) s = Straat(1, 'Acacialaan', 1, 3) s.set_gateway(crab)
added missing () which was causing failing tests
OnroerendErfgoed_crabpy
train
py
342daccc0e06595c7dde969bc21c28c8bf9434f1
diff --git a/goatools/anno/extensions/factory.py b/goatools/anno/extensions/factory.py index <HASH>..<HASH> 100755 --- a/goatools/anno/extensions/factory.py +++ b/goatools/anno/extensions/factory.py @@ -1,6 +1,7 @@ """Annotation Extension for relational expressions. https://link.springer.com/protocol/10.1007/978-1-4939-3743-1_17 + http://wiki.geneontology.org/index.php/Annotation_Extension Correlated function associations between genes and GOs containing contextual information. @@ -18,7 +19,7 @@ import sys from goatools.anno.extensions.extensions import AnnotationExtensions from goatools.anno.extensions.extension import AnnotationExtension -__copyright__ = "Copyright (C) 2016-2019, DV Klopfenstein, H Tang. All rights reserved." +__copyright__ = "Copyright (C) 2016-present, DV Klopfenstein, H Tang. All rights reserved." __author__ = "DV Klopfenstein" @@ -44,4 +45,4 @@ def get_extensions(extstr): return AnnotationExtensions(exts) -# Copyright (C) 2016-2019, DV Klopfenstein, H Tang. All rights reserved." +# Copyright (C) 2016-present, DV Klopfenstein, H Tang. All rights reserved."
Added comment: link to annotation extension documentation
tanghaibao_goatools
train
py
4f1d0f6b7e5718d629795b94ac12616241791334
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -291,7 +291,7 @@ module ActiveRecord # Remove the index named by_branch_party in the accounts table. # remove_index :accounts, :name => :by_branch_party def remove_index(table_name, options = {}) - execute "DROP INDEX #{quote_column_name(index_name(table_name, options))} ON #{table_name}" + execute "DROP INDEX #{quote_column_name(index_name(table_name, options))} ON #{quote_table_name(table_name)}" end def index_name(table_name, options) #:nodoc:
remove_index now uses quote_table_name() [#<I> state:resolved]
rails_rails
train
rb
e35669e1bf35ecdd24373d644734b199763e1625
diff --git a/lib/rfd.rb b/lib/rfd.rb index <HASH>..<HASH> 100644 --- a/lib/rfd.rb +++ b/lib/rfd.rb @@ -424,7 +424,8 @@ module Rfd FileUtils.touch File.join(current_dir, filename) else Zip::File.open(current_zip.path) do |zip| - zip.file.open(filename, 'w') {|_f| } + # zip.file.open(filename, 'w') {|_f| } #HAXX this code creates an unneeded temporary file + zip.instance_variable_get(:@entry_set) << Zip::Entry.new(current_zip.path, filename) end end ls
Ugly hack aiming #touch in a .zip file not to create an unneeded temporary file
amatsuda_rfd
train
rb
14230e80819156c590cc83b36bff8e3ab885e043
diff --git a/language/fr_FR.interface.php b/language/fr_FR.interface.php index <HASH>..<HASH> 100644 --- a/language/fr_FR.interface.php +++ b/language/fr_FR.interface.php @@ -573,7 +573,7 @@ return [ // tinymce 'tr_meliscore_tinymce_file_manager' => 'File Manager', 'tr_meliscore_tinymce_insert_edit_link_toolbar_button_title' => 'Insérer/modifier un lien', - 'tr_meliscore_tinymce_insert_edit_link_dialog_title' => 'Insérer/modifier le lien', + 'tr_meliscore_tinymce_insert_edit_link_dialog_title' => 'Insérer/modifier un lien', // Microservice 'tr_meliscore_microservice' => 'Microservice',
fixed issue on add tree view button not appearing on other language used
melisplatform_melis-core
train
php
3255178dc663980e1bc4270ce4adc9b14ef465b2
diff --git a/pelix/rsa/providers/distribution/xmlrpc.py b/pelix/rsa/providers/distribution/xmlrpc.py index <HASH>..<HASH> 100644 --- a/pelix/rsa/providers/distribution/xmlrpc.py +++ b/pelix/rsa/providers/distribution/xmlrpc.py @@ -285,7 +285,7 @@ class XmlRpcImportContainer(ImportContainer): xmlrpc.client.ServerProxy """ - class XmlRpcProxy: + class XmlRpcProxy(object): def __init__(self, get_remoteservice_id): self._url = get_remoteservice_id[0][1] self._rsid = str(get_remoteservice_id[1]) @@ -296,7 +296,8 @@ class XmlRpcImportContainer(ImportContainer): "{0}.{1}".format(self._rsid, name), ) - # create instance of XmlRpcProxy and pass in remoteservice id: ((ns,cid),get_remoteservice_id) + # create instance of XmlRpcProxy and pass in remoteservice id: + # ((ns,cid),get_remoteservice_id) return XmlRpcProxy(endpoint_description.get_remoteservice_id())
XML-RPC proxy inherits from object() Fixes tests on Python <I>
tcalmant_ipopo
train
py
180fe0e9036c3dd00662fbeedde4209af065870b
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -49,5 +49,6 @@ setup( tests_require=['coverage', 'nose'], install_requires=['pyserial'], package_dir={'kiss': 'kiss'}, + packages=['kiss'], zip_safe=False )
adding packages param to setup.py.
Syncleus_apex-aprs
train
py
392c5fcc15c1dace509876e6f180580f135b79cc
diff --git a/lib/sprinkle/installers/installer.rb b/lib/sprinkle/installers/installer.rb index <HASH>..<HASH> 100644 --- a/lib/sprinkle/installers/installer.rb +++ b/lib/sprinkle/installers/installer.rb @@ -3,9 +3,9 @@ module Sprinkle class Installer attr_accessor :delivery, :package, :options - def initialize(package, &block) + def initialize(package, options = {}, &block) @package = package - @options = {} + @options = options self.instance_eval(&block) if block end
Add support for arbitrary options to be passed to an installer during initialization, in addition to being within blocks
sprinkle-tool_sprinkle
train
rb
e6a73b4b29ace4cc3377098087fd1358ad94343a
diff --git a/spyder/plugins/editor.py b/spyder/plugins/editor.py index <HASH>..<HASH> 100644 --- a/spyder/plugins/editor.py +++ b/spyder/plugins/editor.py @@ -2202,8 +2202,8 @@ class Editor(SpyderPluginWidget): @Slot(bool) def toggle_show_blanks(self, checked): - editor = self.get_current_editor() - editor.set_blanks_enabled(checked) + for editorstack in self.editorstacks: + editorstack.set_blanks_enabled(checked) @Slot(bool) def toggle_show_indent_guides(self, checked):
Fix error show blanks spaces only applied to curret editor.
spyder-ide_spyder
train
py
5bacc59e23ec472c0eca1875a7c36928ea541a4b
diff --git a/tests/linalg_test.py b/tests/linalg_test.py index <HASH>..<HASH> 100644 --- a/tests/linalg_test.py +++ b/tests/linalg_test.py @@ -324,7 +324,7 @@ class ScipyLinalgTest(jtu.JaxTestCase): self.skipTest("No LU implementation available") a = rng(shape, dtype) - jtu.check_grads(jsp.linalg.lu, (a,), 2, rtol=1e-3) + jtu.check_grads(jsp.linalg.lu, (a,), 2, rtol=1e-2) # TODO(phawkins): enable when there is an LU implementation for GPU/TPU.
Relax tolerance of LuGrad test to make it pass in jax_enable_x<I> mode.
tensorflow_probability
train
py
79be11e03b7c1aef1886f7c9c30c788c21f755eb
diff --git a/primus.js b/primus.js index <HASH>..<HASH> 100644 --- a/primus.js +++ b/primus.js @@ -120,7 +120,7 @@ function Primus(url, options) { }; // - // + // Create our reconnection instance. // primus.recovery = new Recovery(options.reconnect);
[minor] Added missing comment
primus_primus
train
js
b965b4353d2e2623b6733b502fa9909bc025d916
diff --git a/functions/post-formats.php b/functions/post-formats.php index <HASH>..<HASH> 100644 --- a/functions/post-formats.php +++ b/functions/post-formats.php @@ -319,7 +319,7 @@ function hybrid_image_content( $content ) { preg_match( '/<img.*?>/', $content, $matches ); if ( empty( $matches ) && current_theme_supports( 'get-the-image' ) ) - $content = get_the_image( array( 'link_to_post' => false, 'echo' => false ) ); + $content = get_the_image( array( 'meta_key' => false, 'size' => 'large', 'link_to_post' => false, 'echo' => false ) ) . $content; elseif ( empty( $matches ) ) $content = get_the_post_format_image() . $content;
Make sure to call the 'large' size image and don't use the 'meta_key' argument. Also, return the original post content.
justintadlock_hybrid-core
train
php
4b79d3e791d6e2c72f2734a0636b77a364262652
diff --git a/lib/mic.js b/lib/mic.js index <HASH>..<HASH> 100644 --- a/lib/mic.js +++ b/lib/mic.js @@ -56,7 +56,7 @@ var mic = function mic(options) { '-t', fileType, '-'], audioProcessOptions) } else { - audioProcess = spawn('arecord', ['-c', channels, '-r', rate, '-f', + audioProcess = spawn('arecord', ['-t', fileType, '-c', channels, '-r', rate, '-f', format, '-D', device], audioProcessOptions); }
added fileType parameter to arecord Added the fileType option (already defaults to raw) as a parameter that gets passed to the spawned `arecord` process. This resolves the issues noted in <URL>, meaning that `arecord` will run indefinitely. For any given fileType the user supplies, the expected behavior is that `arecord` will run until it has processed the maximum file size amount of data for that given type. More info on arecord is available here: <URL>
ashishbajaj99_mic
train
js
258f08e7f0d4e113103fef1f027e9628b8c8af8e
diff --git a/src/WordpressClient.php b/src/WordpressClient.php index <HASH>..<HASH> 100644 --- a/src/WordpressClient.php +++ b/src/WordpressClient.php @@ -772,6 +772,8 @@ class WordpressClient curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $this->_request); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); + $curl_version = curl_version(); + curl_setopt($ch, CURLOPT_USERAGENT, 'curl/' . $curl_version['version']); if ($this->_proxyConfig != false) { if (isset($this->_proxyConfig['proxy_ip']))
Added User-Agent header to cURL request Added User-Agent header to cURL request as WordPress.com blogs now require this to be set before accepting an XML-RPC request.
letrunghieu_wordpress-xmlrpc-client
train
php
97b6f4628095fd6c46ddf087f9d32324c382809a
diff --git a/webmagic-core/src/main/java/us/codecraft/webmagic/Page.java b/webmagic-core/src/main/java/us/codecraft/webmagic/Page.java index <HASH>..<HASH> 100644 --- a/webmagic-core/src/main/java/us/codecraft/webmagic/Page.java +++ b/webmagic-core/src/main/java/us/codecraft/webmagic/Page.java @@ -94,7 +94,7 @@ public class Page { synchronized (targetRequests) { for (String s : requests) { if (StringUtils.isBlank(s) || s.equals("#") || s.startsWith("javascript:")) { - break; + continue; } s = UrlUtils.canonicalizeUrl(s, url.toString()); targetRequests.add(new Request(s));
Bugfix: break loop in addTargetRequests #<I>
code4craft_webmagic
train
java
a5b228b58170eeb2819c92049708c4ed83bff8d7
diff --git a/resolwe/flow/executors/logger.py b/resolwe/flow/executors/logger.py index <HASH>..<HASH> 100644 --- a/resolwe/flow/executors/logger.py +++ b/resolwe/flow/executors/logger.py @@ -26,6 +26,10 @@ class JSONFormatter(logging.Formatter): # Exception and Traceback cannot be serialized. data['exc_info'] = None + # Ensure logging message is instantiated to a string (it could a BraceMessage instance + # which is not JSON serializable). + data['msg'] = str(data['msg']) + return json.dumps(data)
Ensure logging messages in JSONFormater are instatiated to strings
genialis_resolwe
train
py
b93ca8d020a96272a4391e274c0759cbed8c5679
diff --git a/scruffy/config.py b/scruffy/config.py index <HASH>..<HASH> 100644 --- a/scruffy/config.py +++ b/scruffy/config.py @@ -80,9 +80,6 @@ class ConfigNode(object): def __le__(self, other): return self._get_value() <= other - def __le__(self, other): - return self._get_value() <= other - def __eq__(self, other): return self._get_value() == other diff --git a/scruffy/env.py b/scruffy/env.py index <HASH>..<HASH> 100644 --- a/scruffy/env.py +++ b/scruffy/env.py @@ -16,7 +16,7 @@ from six import string_types from .file import Directory from .plugin import PluginManager -from .config import ConfigNode, Config, ConfigEnv, ConfigApplicator +from .config import ConfigNode, Config, ConfigEnv, ConfigApplicator, ConfigFile class Environment(object):
while we're at it, fix a couple bugs the linter caught
snare_scruffy
train
py,py
133f7ae04ff3eec250fb2eb27406bf9ed493ba19
diff --git a/conftest.py b/conftest.py index <HASH>..<HASH> 100644 --- a/conftest.py +++ b/conftest.py @@ -42,7 +42,7 @@ def session_fixture(): raise yield import shutil - shutil.rmtree(tempfile.tempdir) + shutil.rmtree(tempfile.tempdir, ignore_errors=True) def pytest_collection_modifyitems(session, config, items):
[conftest] ignore errors during tidying up.
markovmodel_PyEMMA
train
py
91a37233428054436bb9e3052f0c424f052bf611
diff --git a/spec/unit/part_spec.rb b/spec/unit/part_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/part_spec.rb +++ b/spec/unit/part_spec.rb @@ -62,15 +62,4 @@ RSpec.describe Dry::View::Part do expect { part.farewell }.to raise_error(NoMethodError) end end - - def itself_with(**overrides) - described_class.new( - { - name: part._name, - value: part._value, - renderer: part._renderer, - context: part._context, - }.merge(overrides) - ) - end end
Remove unused spec helper method
dry-rb_dry-view
train
rb
517480e63dc450b870a2208bbcafe6bac14bfd98
diff --git a/pyoko/db/base.py b/pyoko/db/base.py index <HASH>..<HASH> 100644 --- a/pyoko/db/base.py +++ b/pyoko/db/base.py @@ -277,6 +277,9 @@ class DBObjects(object): 'BUCKET': self.index_name, 'TIME': round(time.time() - t1, 5)}) if self._cfg['rtype'] == ReturnType.Model: + if not self._riak_cache[0].exists: + raise ObjectDoesNotExist("%s %s" % (self.index_name, + self._riak_cache[0].key)) return self._make_model(self._riak_cache[0].data, self._riak_cache[0]) elif self._cfg['rtype'] == ReturnType.Object:
raise cleaner errors when referenced object does not exists
zetaops_pyoko
train
py
42c171147b890aedd38f064d7c1ec15069d0a04c
diff --git a/core/Plugin/Manager.php b/core/Plugin/Manager.php index <HASH>..<HASH> 100644 --- a/core/Plugin/Manager.php +++ b/core/Plugin/Manager.php @@ -67,7 +67,6 @@ class Manager extends Singleton 'DBStats', 'DevicesDetection', // 'Events', - 'TreemapVisualization', // should be moved to marketplace ); public function getCorePluginsDisabledByDefault()
Removing Treemap from core plugins disabled by default
matomo-org_matomo
train
php
d0d7baebf33ac4fb25f57a7f856e6e5515f65b6d
diff --git a/lang/fr/forum.php b/lang/fr/forum.php index <HASH>..<HASH> 100644 --- a/lang/fr/forum.php +++ b/lang/fr/forum.php @@ -94,6 +94,7 @@ $string['nownotsubscribed'] = 'Les messages du forum $string['nowsubscribed'] = 'Les messages du forum � $a->forum � seront envoy�s � $a->name.'; $string['numposts'] = '$a messages'; $string['olderdiscussions'] = 'Discussions ant�rieures'; +$string['oldertopics'] = 'Sujets ant�rieurs'; $string['openmode0'] = 'Aucune discussion, aucune r�ponse'; $string['openmode1'] = 'Aucune discussion, mais les r�ponses sont autoris�es'; $string['openmode2'] = 'Discussions et r�ponses';
New string for 'recent news' block
moodle_moodle
train
php
292ead33ad297a23978020bd37ff54600225e9bc
diff --git a/bulbs/videos/api.py b/bulbs/videos/api.py index <HASH>..<HASH> 100644 --- a/bulbs/videos/api.py +++ b/bulbs/videos/api.py @@ -50,7 +50,7 @@ class VideoViewSet(viewsets.ModelViewSet): video.name = request.POST.get('name') try: - s3_path = os.path.join(settings.VIDEO_ENCODING['bucket'], settings.VIDEO_ENCODING['directory'], video.pk) + s3_path = os.path.join(settings.VIDEO_ENCODING['bucket'], settings.VIDEO_ENCODING['directory'], str(video.pk)) except KeyError: raise ImproperlyConfigured("Video encoding settings aren't defined.")
Fixing encode endpoint (I hope)
theonion_django-bulbs
train
py
db9ef08a8da60fe28b64bfa0136e7549d526f24d
diff --git a/actionview/test/template/digestor_test.rb b/actionview/test/template/digestor_test.rb index <HASH>..<HASH> 100644 --- a/actionview/test/template/digestor_test.rb +++ b/actionview/test/template/digestor_test.rb @@ -17,8 +17,7 @@ class FixtureFinder < ActionView::LookupContext FIXTURES_DIR = "#{File.dirname(__FILE__)}/../fixtures/digestor" def initialize(details = {}) - prefixes = [FixtureFinder::FIXTURES_DIR] - super(ActionView::PathSet.new(['digestor']), details, prefixes) + super(ActionView::PathSet.new(['digestor']), details, []) end end
the lookup context looks in the cwd, so prefix isn't necessary
rails_rails
train
rb
5886a9ad10e360a0c582c8883e282436d9077b27
diff --git a/ibis/backends/pandas/client.py b/ibis/backends/pandas/client.py index <HASH>..<HASH> 100644 --- a/ibis/backends/pandas/client.py +++ b/ibis/backends/pandas/client.py @@ -1,10 +1,13 @@ """The pandas client implementation.""" +from collections.abc import Mapping, Sequence + import numpy as np import pandas as pd import toolz from pandas.api.types import CategoricalDtype, DatetimeTZDtype +import ibis.common.exceptions as com import ibis.expr.datatypes as dt import ibis.expr.operations as ops import ibis.expr.schema as sch @@ -139,9 +142,16 @@ def _infer_pandas_series_contents(s: pd.Series) -> dt.DataType: if inferred_dtype == 'mixed': # We need to inspect an element to determine the Ibis dtype value = s.iloc[0] - if isinstance(value, (np.ndarray, list, pd.Series)): + if isinstance(value, (np.ndarray, pd.Series, Sequence)): # Defer to individual `infer` functions for these return dt.infer(value) + elif isinstance(value, Mapping): + try: + return dt.infer(value) + except com.IbisTypeError: + return dt.Struct.from_tuples( + (k, dt.infer(v)) for k, v in value.items() + ) else: return dt.dtype('binary') else:
fix(pandas): fix struct inference from dict in the pandas backend
ibis-project_ibis
train
py