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
0a0ae007136dc9245377e009741f0c838e2b1590
diff --git a/libraries/mako/Assets.php b/libraries/mako/Assets.php index <HASH>..<HASH> 100644 --- a/libraries/mako/Assets.php +++ b/libraries/mako/Assets.php @@ -97,7 +97,7 @@ class Assets $source = '[mako:assets]' . $source; } - if(substr($source, -4) === '.css') + if(pathinfo(parse_url($source, PHP_URL_PATH), PATHINFO_EXTENSION) === 'css') { !isset($attributes['media']) && $attributes['media'] = 'all';
Fixed bug in Assets::add
mako-framework_framework
train
php
e874d6285cc30988ab968fdd188aa6d50711facc
diff --git a/spikewidgets/widgets/basewidget.py b/spikewidgets/widgets/basewidget.py index <HASH>..<HASH> 100644 --- a/spikewidgets/widgets/basewidget.py +++ b/spikewidgets/widgets/basewidget.py @@ -28,7 +28,7 @@ class BaseWidget: class BaseMultiWidget: def __init__(self, figure=None, ax=None): - if figure is None and ax is None: + if (figure is None) and (ax is None): self.figure = plt.figure() self.ax = self.figure.add_subplot(111) elif ax is None:
Hmm, did I forget this?
SpikeInterface_spikewidgets
train
py
0cf60f045e6e08293e3c97fad473bfff0b43a336
diff --git a/src/Controller/AuthAutocompleteController.php b/src/Controller/AuthAutocompleteController.php index <HASH>..<HASH> 100644 --- a/src/Controller/AuthAutocompleteController.php +++ b/src/Controller/AuthAutocompleteController.php @@ -177,7 +177,7 @@ class AuthAutocompleteController extends ControllerBase implements ContainerInje return new JsonResponse($cached->data); } if ($this->currentUser->isAnonymous() && !$is_internal) { - sleep(5); + sleep(1); } switch ($auth_type) {
Only sleep for one second for anonymous. We should really make this more robust. Like allowing same domain AJAX calls to bypass this entirely
esmero_webform_strawberryfield
train
php
1e55232e6e212d1f85d2ab0fdd150f21fe119173
diff --git a/includes/class-github-updater.php b/includes/class-github-updater.php index <HASH>..<HASH> 100644 --- a/includes/class-github-updater.php +++ b/includes/class-github-updater.php @@ -385,7 +385,7 @@ class GitHub_Updater { $this->$type->forks = 0; $this->$type->open_issues = 0; $this->$type->score = 0; - $this->$type->requires_wp_version = '3.0'; + $this->$type->requires_wp_version = '0.0.0'; $this->$type->requires_php_version = '5.2.3'; }
set WP min requirement to 0
afragen_github-updater
train
php
053813a47b43d11fb348160c9ca285e980f592f4
diff --git a/src/main/java/org/gitlab4j/api/ProjectApi.java b/src/main/java/org/gitlab4j/api/ProjectApi.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/gitlab4j/api/ProjectApi.java +++ b/src/main/java/org/gitlab4j/api/ProjectApi.java @@ -1917,7 +1917,7 @@ public class ProjectApi extends AbstractApi implements Constants { * @throws GitLabApiException if any exception occurs */ public Pager<Snippet> getSnippets(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException { - return (new Pager<Snippet>(this, Snippet.class, itemsPerPage, null, "projects", projectIdOrPath, "snippets")); + return (new Pager<Snippet>(this, Snippet.class, itemsPerPage, null, "projects", getProjectIdOrPath(projectIdOrPath), "snippets")); } /**
Fixed getSnippets() so it properly works with all project specifiers.
gmessner_gitlab4j-api
train
java
751b8def11796e8e5a5b735f24a1a3755b2b9e55
diff --git a/src/Network/Socket.php b/src/Network/Socket.php index <HASH>..<HASH> 100644 --- a/src/Network/Socket.php +++ b/src/Network/Socket.php @@ -204,7 +204,7 @@ class Socket } } if (empty($this->_config['context']['ssl']['cafile'])) { - $dir = dirname(__DIR__); + $dir = dirname(dirname(__DIR__)); $this->_config['context']['ssl']['cafile'] = $dir . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'cacert.pem'; }
Fix path to cafile.pem.
cakephp_cakephp
train
php
b6c6d28d2c9f29c6c97564700c4847748300d323
diff --git a/activesupport/lib/active_support/core_ext/module/concerning.rb b/activesupport/lib/active_support/core_ext/module/concerning.rb index <HASH>..<HASH> 100644 --- a/activesupport/lib/active_support/core_ext/module/concerning.rb +++ b/activesupport/lib/active_support/core_ext/module/concerning.rb @@ -30,7 +30,6 @@ class Module # has_many :events # # before_create :track_creation - # after_destroy :track_deletion # # private # def track_creation @@ -52,7 +51,6 @@ class Module # included do # has_many :events # before_create :track_creation - # after_destroy :track_deletion # end # # private @@ -90,7 +88,6 @@ class Module # included do # has_many :events # before_create :track_creation - # after_destroy :track_deletion # end # # private
Remove undefined `track_deletion` callback [ci skip]
rails_rails
train
rb
3d82f4e2b06268a03671f62e9e51c96b57a08cde
diff --git a/library/CM/Class/Abstract.php b/library/CM/Class/Abstract.php index <HASH>..<HASH> 100644 --- a/library/CM/Class/Abstract.php +++ b/library/CM/Class/Abstract.php @@ -43,12 +43,10 @@ abstract class CM_Class_Abstract { protected static function _getConfig() { static $cacheEnabled = null; if (null === $cacheEnabled) { - $config = CM_Config::get(); - $cacheEnabled = $config->CM_Class_Abstract->configCacheEnabled; + $cacheEnabled = CM_Config::get()->CM_Class_Abstract->configCacheEnabled; } - $className = get_called_class(); - $cacheKey = CM_CacheConst::Config . '_className:' . $className; - if (false === ($result = CM_CacheLocal::get($cacheKey)) || !$cacheEnabled) { + $cacheKey = CM_CacheConst::Config . '_className:' . get_called_class(); + if (!$cacheEnabled || false === ($result = CM_CacheLocal::get($cacheKey))) { $result = self::_getConfigRaw(); CM_CacheLocal::set($cacheKey, $result); }
Review request - Put cheap condition first - Removed unnecessary helper variables
cargomedia_cm
train
php
89fc7248e8d0a2ba5a7f8ce300b5519e9c6570da
diff --git a/core/src/main/java/cucumber/runtime/Runtime.java b/core/src/main/java/cucumber/runtime/Runtime.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/cucumber/runtime/Runtime.java +++ b/core/src/main/java/cucumber/runtime/Runtime.java @@ -86,12 +86,12 @@ public class Runtime { } public Runtime(ResourceLoader resourceLoader, ClassLoader classLoader, Collection<? extends Backend> backends, - RuntimeOptions runtimeOptions, RuntimeGlue optionalGlue) { + RuntimeOptions runtimeOptions, Glue optionalGlue) { this(resourceLoader, classLoader, backends, runtimeOptions, TimeService.SYSTEM, optionalGlue); } public Runtime(ResourceLoader resourceLoader, ClassLoader classLoader, Collection<? extends Backend> backends, - RuntimeOptions runtimeOptions, TimeService stopWatch, RuntimeGlue optionalGlue) { + RuntimeOptions runtimeOptions, TimeService stopWatch, Glue optionalGlue) { if (backends.isEmpty()) { throw new CucumberException("No backends were found. Please make sure you have a backend module on your CLASSPATH."); }
Change constructor parameter type to interface There is a Glue interface and RuntimeGlue class which implements it. It would be better that the Runtime constructors use the Glue interface as the optionalGlue parameter rather than the RuntimeGlue class. (See Effective Java #<I>).
cucumber_cucumber-jvm
train
java
7909ea60bf5d79c04d90dd8095943f1dbca53ff1
diff --git a/tests/greppy/lib/helper/controller/data-gridTests.js b/tests/greppy/lib/helper/controller/data-gridTests.js index <HASH>..<HASH> 100644 --- a/tests/greppy/lib/helper/controller/data-gridTests.js +++ b/tests/greppy/lib/helper/controller/data-gridTests.js @@ -92,7 +92,21 @@ describe('Data-Grid', function() { describe('buildSqlCriteria', function() { - + it('should build sql criteria for searching', function() { + + var reqMockup = { + query: {} + }; + + var result = dg.buildSqlCriteria(reqMockup, {}, {}); + + result.view.should.equal('index'); + result.limit.should.equal(25); + result.offset.should.equal(0); + result.page.should.equal(1); + result.pageSizes.should.eql([10, 25, 50, 100]); + result.where.should.equal('(deleted_at IS NULL)'); + }); }); });
[Tests] Added test for data-grid.
Jack12816_greppy
train
js
7097af73bfe4ec647c6e9c61af6531c4183ffbe7
diff --git a/pyGenClean/run_data_clean_up.py b/pyGenClean/run_data_clean_up.py index <HASH>..<HASH> 100755 --- a/pyGenClean/run_data_clean_up.py +++ b/pyGenClean/run_data_clean_up.py @@ -1090,6 +1090,7 @@ def run_plate_bias(in_prefix, in_type, out_prefix, base_dir, options): table_label=table_label, nb_col=len(table[1]), col_alignments="rrlrrrl", + text_size="scriptsize", header_data=zip(table[0], [1 for i in table[0]]), tabular_data=sorted( table[1:],
Change text size for plate bias longtable to save space
lemieuxl_pyGenClean
train
py
4a09d679f3b66e380e270b7bddcb3bc45d10b883
diff --git a/lib/nucleon/action/cloud/machines.rb b/lib/nucleon/action/cloud/machines.rb index <HASH>..<HASH> 100644 --- a/lib/nucleon/action/cloud/machines.rb +++ b/lib/nucleon/action/cloud/machines.rb @@ -36,17 +36,15 @@ class Machines < CORL.plugin_class(:nucleon, :cloud_action) def execute super do |local_node| - info('corl.actions.machines.start') - ensure_network do if node = network.test_node(settings[:node_provider]) if machine_types = node.machine_types machine_types.each do |machine_type| - info(node.render_machine_type(machine_type), { :prefix => false, :i18n => false }) + prefixed_message(:info, ' ', node.render_machine_type(machine_type), { :i18n => false, :prefix => false }) end myself.result = machine_types - success('corl.actions.machines.results', { :machines => machine_types.length }) if machine_types.length > 1 + success('results', { :machines => machine_types.length }) if machine_types.length > 1 else myself.status = code.machine_load_failure end
Updating the localization information for the cloud machines action provider.
coralnexus_corl
train
rb
877e5962f7d6b0e2444f108569c7d1264db5423f
diff --git a/pandas/version.py b/pandas/version.py index <HASH>..<HASH> 100644 --- a/pandas/version.py +++ b/pandas/version.py @@ -1,3 +1 @@ -from datetime import datetime - version = '0.4.0' diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100755 --- a/setup.py +++ b/setup.py @@ -117,8 +117,8 @@ CLASSIFIERS = [ MAJOR = 0 MINOR = 4 -MICRO = 0 -ISRELEASED = True +MICRO = 1 +ISRELEASED = False VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO) FULLVERSION = VERSION
RLS: update to <I>dev
pandas-dev_pandas
train
py,py
2b46535eba0b57dc50ef61810e685afbf4bba107
diff --git a/src/main/java/com/contentful/java/cma/ModuleWebhooks.java b/src/main/java/com/contentful/java/cma/ModuleWebhooks.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/contentful/java/cma/ModuleWebhooks.java +++ b/src/main/java/com/contentful/java/cma/ModuleWebhooks.java @@ -168,14 +168,9 @@ public class ModuleWebhooks extends AbsModule<ServiceWebhooks> { public CMAWebhook update(CMAWebhook webhook) { assertNotNull(webhook, "webhook"); - Integer version = webhook.getVersion(); - String spaceId = webhook.getSpaceId(); - String webhookId = webhook.getId(); - - assertNotNull(version, "version"); - assertNotNull(spaceId, "spaceId"); - assertNotNull(webhookId, "webookId"); - assertNotNull(webhook, "webook"); + final String webhookId = getResourceIdOrThrow(webhook, "webhook"); + final String spaceId = getSpaceIdOrThrow(webhook, "webhook"); + final Integer version = getVersionOrThrow(webhook, "webhook"); return service.update(version, spaceId, webhookId, webhook).toBlocking().first(); }
fix: summarise doubled assertions.
contentful_contentful-management.java
train
java
723b1c13588634acfd20422b6d0acefc2246b9fa
diff --git a/src/main/java/com/tulskiy/keymaster/windows/KeyMap.java b/src/main/java/com/tulskiy/keymaster/windows/KeyMap.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/tulskiy/keymaster/windows/KeyMap.java +++ b/src/main/java/com/tulskiy/keymaster/windows/KeyMap.java @@ -44,6 +44,7 @@ public class KeyMap { put(VK_MINUS, 0xBD); put(VK_SLASH, 0xBF); put(VK_SEMICOLON, 0xBA); + put(VK_PRINTSCREEN, 0x2C); }}; public static int getCode(HotKey hotKey) {
[windows] fixed issue #9: PRINTSCREEN key does not work
tulskiy_jkeymaster
train
java
b4619aba72ba5d7d2647d8bcdab6fb99164022fe
diff --git a/lib/datalib.php b/lib/datalib.php index <HASH>..<HASH> 100644 --- a/lib/datalib.php +++ b/lib/datalib.php @@ -1587,7 +1587,7 @@ function get_course_mods($courseid) { FROM {$CFG->prefix}modules m, {$CFG->prefix}course_modules cm WHERE cm.course = ".intval($courseid)." - AND cm.module = m.id "); + AND cm.module = m.id AND m.visible = 1"); // no disabled mods }
MDL-<I> disabled mods are not returned from get_course_mods() anymore, the results are used in scheduled backup and other parts that do not expect disabled mods; merged from MOODLE_<I>_STABLE
moodle_moodle
train
php
e06c012c62c8d304381d4cdce835e0a932b204d5
diff --git a/registration/file_content.go b/registration/file_content.go index <HASH>..<HASH> 100644 --- a/registration/file_content.go +++ b/registration/file_content.go @@ -40,7 +40,7 @@ func (fc *FileContent) Init(c *choria.Config, logger *logrus.Entry) { fc.dataFile = c.Choria.FileContentRegistrationData fc.log = logger.WithFields(logrus.Fields{"registration": "file_content", "source": fc.dataFile}) - fc.log.Infof("Configured File Content Registration with source %s", fc.dataFile) + fc.log.Infof("Configured File Content Registration with source '%s' and target '%s'", fc.dataFile, c.Choria.FileContentRegistrationTarget) } // Start stats a publishing loop diff --git a/server/registration/registration.go b/server/registration/registration.go index <HASH>..<HASH> 100644 --- a/server/registration/registration.go +++ b/server/registration/registration.go @@ -140,6 +140,7 @@ func (reg *Manager) publish(rmsg *data.RegistrationItem) { msg.SetProtocolVersion(protocol.RequestV1) msg.SetReplyTo("dev.null") + msg.CustomTarget = rmsg.Destination err = reg.connector.Publish(msg) if err != nil {
(misc) also set the agent for the messages being published
choria-io_go-choria
train
go,go
d55ed53137498a96a629795e1d1159cdef31eb6e
diff --git a/src/com/opera/core/systems/OperaDriver.java b/src/com/opera/core/systems/OperaDriver.java index <HASH>..<HASH> 100644 --- a/src/com/opera/core/systems/OperaDriver.java +++ b/src/com/opera/core/systems/OperaDriver.java @@ -1427,12 +1427,4 @@ public class OperaDriver extends RemoteWebDriver implements TakesScreenshot { } - /** - * @deprecated - */ - @Deprecated - public OperaRunner getRunner() { - return runner; - } - } \ No newline at end of file
Removed deprecated method OperaDriver.getRunner()
operasoftware_operaprestodriver
train
java
04f82ea63868b7beb01e1c9645e3fdfbb0d93788
diff --git a/cwltool/load_tool.py b/cwltool/load_tool.py index <HASH>..<HASH> 100644 --- a/cwltool/load_tool.py +++ b/cwltool/load_tool.py @@ -286,7 +286,7 @@ def resolve_and_validate_document(loadingContext, if cwlVersion == "v1.0": _add_blank_ids(workflowobj) - processobj, metadata = document_loader.resolve_all(workflowobj, uri) + processobj, metadata = document_loader.resolve_all(workflowobj, fileuri) if loadingContext.metadata: metadata = loadingContext.metadata if not isinstance(processobj, (CommentedMap, CommentedSeq)):
I take it back, clearly base_url should be fileuri.
common-workflow-language_cwltool
train
py
bc4c37f53c6103bb4f82e4d8cfbd203c5363a791
diff --git a/source/application/hooks/transforms/index.js b/source/application/hooks/transforms/index.js index <HASH>..<HASH> 100644 --- a/source/application/hooks/transforms/index.js +++ b/source/application/hooks/transforms/index.js @@ -105,7 +105,7 @@ export default { const [name, factory] = entry; return { ...registry, - [name]: factory(application) + [name]: (factory.default ? factory.default : factory)(application) }; }, {});
fix(application/hooks/transforms): Fixes es6 compatible exports for factory functions
patternplate-archive_patternplate-server
train
js
09c92f82983efdd648219f4e0ab020958632d17c
diff --git a/gcs/gcsfake/bucket.go b/gcs/gcsfake/bucket.go index <HASH>..<HASH> 100644 --- a/gcs/gcsfake/bucket.go +++ b/gcs/gcsfake/bucket.go @@ -326,6 +326,27 @@ func (b *bucket) CreateObject( } // LOCKS_EXCLUDED(b.mu) +func (b *bucket) StatObject( + ctx context.Context, + req *gcs.StatObjectRequest) (o *storage.Object, err error) { + b.mu.RLock() + defer b.mu.RUnlock() + + // Does the object exist? + index := b.objects.find(req.Name) + if index == len(b.objects) { + err = gcs.ErrNotFound + return + } + + // Make a copy to avoid handing back internal state. + var objCopy storage.Object = b.objects[index].entry + o = &objCopy + + return +} + +// LOCKS_EXCLUDED(b.mu) func (b *bucket) UpdateObject( ctx context.Context, req *gcs.UpdateObjectRequest) (o *storage.Object, err error) {
Implemented StatObject for the fake.
jacobsa_gcloud
train
go
e6d79cd647d8084ba487a98df40b8c22d738c6a8
diff --git a/PyPtt/version.py b/PyPtt/version.py index <HASH>..<HASH> 100644 --- a/PyPtt/version.py +++ b/PyPtt/version.py @@ -1,3 +1,3 @@ -V = '0.9.7' +V = '0.9.8'
Adjust version, start to develop get_mail api
Truth0906_PTTLibrary
train
py
e3a5905b97317cd7c2d298199963b3f84453b889
diff --git a/server/src/main/java/io/atomix/copycat/server/state/FollowerAppender.java b/server/src/main/java/io/atomix/copycat/server/state/FollowerAppender.java index <HASH>..<HASH> 100644 --- a/server/src/main/java/io/atomix/copycat/server/state/FollowerAppender.java +++ b/server/src/main/java/io/atomix/copycat/server/state/FollowerAppender.java @@ -61,7 +61,7 @@ final class FollowerAppender extends AbstractAppender { } // If no AppendRequest is already being sent, send an AppendRequest. else if (canAppend(member) && hasMoreEntries(member)) { - sendAppendRequest(member, buildAppendRequest(member, context.getCommitIndex())); + sendAppendRequest(member, buildAppendRequest(member, Math.min(context.getCommitIndex(), context.getLog().lastIndex()))); } }
Prevent IndexOutOfBoundsException when follower replicates with commitIndex greater than its log's last index.
atomix_copycat
train
java
afb7a4a3e92fa8f93365cce2602e7286289b2a1b
diff --git a/app/models/concerns/foreman_remote_execution/taxonomy_extensions.rb b/app/models/concerns/foreman_remote_execution/taxonomy_extensions.rb index <HASH>..<HASH> 100644 --- a/app/models/concerns/foreman_remote_execution/taxonomy_extensions.rb +++ b/app/models/concerns/foreman_remote_execution/taxonomy_extensions.rb @@ -10,7 +10,8 @@ module ForemanRemoteExecution # the default templates, remove after it's fixed in upstream # (https://github.com/theforeman/foreman/pull/4890) and gets # into a 1.17 release - skip_callback :create, :after, :assign_default_templates, :raise => false + skip_options = Rails::VERSION::MAJOR < 5 ? {} : { :raise => false } + skip_callback :create, :after, :assign_default_templates, skip_options before_create :assign_default_templates end end
Refs #<I> - raise => false only for Rails 5 (#<I>) Rails 4 doesn't raise any issue when callback is not found and it doesn't even know the raise option. Due to this, it considers the additional option being a sign of need for re-definition of the original callback, instead of just making it as skipped. This patch sets the `raise => false` only for Rails 5, where it's needed.
theforeman_foreman_remote_execution
train
rb
6d46c71749668e51fcab1eeb8068e24b75e163e5
diff --git a/lib/et-orbi.rb b/lib/et-orbi.rb index <HASH>..<HASH> 100644 --- a/lib/et-orbi.rb +++ b/lib/et-orbi.rb @@ -343,7 +343,7 @@ module EtOrbi false - rescue TZInfo::AmbiguousTime => e + rescue TZInfo::AmbiguousTime true end
Silence Ruby warning in EoTime#ambiguous?
floraison_et-orbi
train
rb
aa32c8730d75331129bd3766306d55897e1487e7
diff --git a/test/runner.js b/test/runner.js index <HASH>..<HASH> 100644 --- a/test/runner.js +++ b/test/runner.js @@ -13,14 +13,28 @@ exec('find -E '+__dirname+' -regex ".+/test-.+\.js"', function(err, stdout) { return !!file; }); + var errors = 0; + tests.forEach(function(file) { var relative = file.substr(__dirname.length+1); console.log('node test/'+relative); - require(file); + try { + require(file); + } catch (e) { + console.log('\n' + e + '\n'); + errors++; + } }); var duration = +new Date - start; console.log(''); - console.log('Executed ' + tests.length + ' tests in '+duration+' ms'); + console.log( + 'Executed ' + tests.length + ' tests with ' + errors + ' errors ' + + 'in '+duration+' ms' + ); + + if (errors) { + process.exit(1); + } })
Hack: Show all failing tests This needs to be done nicer eventually
felixge_node-fake
train
js
a764632dd2fa71e9e81fbe7bae85daaf393bbd2c
diff --git a/lib/github_changelog_generator/fetcher.rb b/lib/github_changelog_generator/fetcher.rb index <HASH>..<HASH> 100644 --- a/lib/github_changelog_generator/fetcher.rb +++ b/lib/github_changelog_generator/fetcher.rb @@ -220,7 +220,7 @@ Make sure, that you push tags to remote repo via 'git push --tags'" # Fetch commit for specified event # @return [Hash] def fetch_commit(event) - @github.git_data.commits.get @options[:user], @options[:project], event['commit_id'] + @github.git_data.commits.get @options[:user], @options[:project], event[:commit_id] end end end
reverting the old fetcher where I changed to string
github-changelog-generator_github-changelog-generator
train
rb
bf6b42a040a2f0461e5ab855496a5a457d3f0c71
diff --git a/lib/User.js b/lib/User.js index <HASH>..<HASH> 100644 --- a/lib/User.js +++ b/lib/User.js @@ -150,7 +150,7 @@ class User extends Requestable { * @return {Promise} - the promise for the http request */ follow(username, cb) { - return this._request('PUT', `/user/following/${this.__user}`, null, cb); + return this._request('PUT', `/user/following/${username}`, null, cb); } /** @@ -161,7 +161,7 @@ class User extends Requestable { * @return {Promise} - the promise for the http request */ unfollow(username, cb) { - return this._request('DELETE', `/user/following/${this.__user}`, null, cb); + return this._request('DELETE', `/user/following/${username}`, null, cb); } /**
Use username arg for follow and unfollow requests.
github-tools_github
train
js
43c5c5fc21ab4f96b19a4671b3b46f81eb889d2a
diff --git a/schema/brain/queries/reads.py b/schema/brain/queries/reads.py index <HASH>..<HASH> 100644 --- a/schema/brain/queries/reads.py +++ b/schema/brain/queries/reads.py @@ -190,7 +190,7 @@ def get_jobs(plugin_name, :param conn: <connection> or <NoneType> :return: <generator> yields <dict> """ - job_cur = jobs_cursor(plugin_name).run(conn) + job_cur = _jobs_cursor(plugin_name).run(conn) for job in job_cur: if verify_job and not verify(job, Job()): continue #to the next job... warn?
some how this underline got removed and tests still passed
ramrod-project_database-brain
train
py
600dbb40f34e936be732ed9d5b121a9d38088d7e
diff --git a/ui/js/models/repository.js b/ui/js/models/repository.js index <HASH>..<HASH> 100644 --- a/ui/js/models/repository.js +++ b/ui/js/models/repository.js @@ -147,7 +147,7 @@ treeherder.factory('ThRepositoryModel', [ }); } else { if (options.name) { - setCurrent(name); + setCurrent(options.name); } } };
Bug <I> - Fix loading additional results
mozilla_treeherder
train
js
e7d4c3a880a59e1228e204f4a3aa41b3c7fdca2a
diff --git a/src/class.js b/src/class.js index <HASH>..<HASH> 100644 --- a/src/class.js +++ b/src/class.js @@ -1,4 +1,4 @@ -/*jshint evil:true, -W021 */ +/*jshint evil:true */ define( [ @@ -49,7 +49,15 @@ define( } }); - function createClass (options, init) { + var createClass = new Function.Abstract("createClass") + .overload("function?", createNoOptions) + .overload("object,function?", create); + + function createNoOptions (init) { + return create({}, init); + } + + function create (options, init) { var forcingNew = false, hasInit = type.is("function", init), name = options.name; @@ -85,8 +93,8 @@ define( eval("Constructor = "+ Constructor +";"); } - if (options.extends) { - Constructor.extend(options.extends); + if (options["extends"]) { + Constructor.extend(options["extends"]); } if (options.mixins) { @@ -96,13 +104,6 @@ define( return Constructor; } - // W021: jshint - createClass = createClass.overload("function?", createClassNoOptions); - - function createClassNoOptions (init) { - return createClass({}, init); - } - return createClass; } );
fixing reserved work reference options.extends, reordering the overloads for performance, refactoring for clarity, adding Abstract implementation
bob-gray_solv
train
js
29e15fd3fd7427fa7c0486a1d588ae82398ff5b5
diff --git a/lib/resource/index.js b/lib/resource/index.js index <HASH>..<HASH> 100644 --- a/lib/resource/index.js +++ b/lib/resource/index.js @@ -163,6 +163,12 @@ Resource = new Class({ var _fields = clone( this.constructor.parent.fields || EMPTY_OBJECT ); _fields = merge( _fields, this.fields ); + var pkattr = this.options.pk + + if( !_fields['id'] ){ + _fields[ 'id' ] = {type:'field', attribute:pkattr} + } + Object .keys( _fields ) .forEach(function( key ){ diff --git a/lib/resource/mongoose.js b/lib/resource/mongoose.js index <HASH>..<HASH> 100644 --- a/lib/resource/mongoose.js +++ b/lib/resource/mongoose.js @@ -55,7 +55,7 @@ module.exports = MongoResource = new Class({ var instance; this.parent( 'constructor', options ); - joi.assert(this.options.queryset, joi.required(),'querset is required') + joi.assert(this.options.queryset, joi.required(),'tastypie.resource: querset is required') instance = new this.options.queryset; this.options.objectTpl = this.options.objectTpl || instance.model;
auto add an id field if one doesn't exist data isn't surfaced if a field isn't defined
node-tastypie_tastypie
train
js,js
f25ac28542a8ad1e160e8eb01f794576789a791b
diff --git a/lib/cxxproject/extensions/rake_ext.rb b/lib/cxxproject/extensions/rake_ext.rb index <HASH>..<HASH> 100644 --- a/lib/cxxproject/extensions/rake_ext.rb +++ b/lib/cxxproject/extensions/rake_ext.rb @@ -103,19 +103,17 @@ module Rake end end end + if prereq.failure + @failure = true + end } end + end define_method(:execute) do |arg| - # check if a prereq has failed - @prerequisites.each { |n| - prereq = application[n, @scope] - if prereq.failure - @failure = true - end - } - break if @failure # if yes, this task cannot be run + + break if @failure # check if a prereq has failed begin execute_org.bind(self).call(arg)
Bugfix: errors in prereqs of unneeded tasks, e.g. multitask, were ignored
marcmo_cxxproject
train
rb
c5a093829880904588d3a460f96c2dc2e5341cb0
diff --git a/nupic/regions/SPRegion.py b/nupic/regions/SPRegion.py index <HASH>..<HASH> 100644 --- a/nupic/regions/SPRegion.py +++ b/nupic/regions/SPRegion.py @@ -646,10 +646,17 @@ class SPRegion(PyRegion): learn=self.learningMode, infer=self.inferenceMode, computeAnomaly=self.anomalyMode) - else: + else: inputVector = numpy.array(rfInput[0]).astype('uint32') outputVector = numpy.zeros(self._sfdr.getNumColumns()).astype('uint32') - self._sfdr.compute(inputVector, self.learningMode, outputVector) + + # Switch to using a random SP if learning mode is off and the SP hasn't + # learned anything yet. + if (not self.learningMode) and (self._sfdr.getIterationLearnNum() == 0): + self._sfdr.compute(inputVector, self.learningMode, outputVector, False) + else: + self._sfdr.compute(inputVector, self.learningMode, outputVector) + self._spatialPoolerOutput[:] = outputVector[:] # Direct logging of SP outputs if requested
Switch to random SP in SPRegion Switch to random SP in SPRegion when no learning has occurred. Fixes #<I>
numenta_nupic
train
py
03ac011cd172e497b173d045844915a4b6fb5907
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ cffi_modules = [ install_requires = [ 'aioice>=0.6.9,<0.7.0', 'attrs', - 'av>=0.5.3,<7.0.0', + 'av>=6.0.0,<7.0.0', 'cffi>=1.0.0', 'crcmod', 'cryptography>=2.2',
[package] require PyAV >= <I>
aiortc_aiortc
train
py
7bdeac37002d47c32a0314e06c1e0e5e92af3b36
diff --git a/src/FlexClient.php b/src/FlexClient.php index <HASH>..<HASH> 100644 --- a/src/FlexClient.php +++ b/src/FlexClient.php @@ -45,15 +45,14 @@ class FlexClient { $resolver->setDefaults([ 'base_uri' => 'https://api.flightstats.com/flex', - 'version' => 'v2', 'protocol' => 'rest', 'format' => 'json', 'use_http_errors' => true, ]); $resolver->setRequired([ - 'application_id', - 'application_key', + 'appId', + 'appKey', ]); } @@ -72,4 +71,15 @@ class FlexClient return $this->client; } + + /** + * Get a veriable from the config. + * + * @param string $name The name of the variable to get + * @return mixed The value of the config variable + */ + public function getConfig($name) + { + return $this->config[$name]; + } }
Added a method to get a variable from the config, changed the auth keys to be the same as the API used and removed the version from the base client
willemo_flightstats
train
php
1bbd890c5a3797dddd5febe5b1021edde11f8dc6
diff --git a/lib/m.rb b/lib/m.rb index <HASH>..<HASH> 100644 --- a/lib/m.rb +++ b/lib/m.rb @@ -138,7 +138,8 @@ module M require "rake/testtask" Rake::TestTask.new(:m_custom) do |t| t.libs << 'test' - t.pattern = "#{@file}/*test*.rb" + t.libs << 'spec' + t.test_files = FileList["#{@file}/*test*.rb", "#{@file}/*spec*.rb"] end # Invoke the rake task and exit, hopefully it'll work! Rake::Task['m_custom'].invoke
Add 'spec' to the custom Rake::TestTask so it can run either the spec or test directory.
qrush_m
train
rb
ca8379d938b56693e8b7244386c0b878746c02c5
diff --git a/guacamole/src/main/webapp/app/login/controllers/loginController.js b/guacamole/src/main/webapp/app/login/controllers/loginController.js index <HASH>..<HASH> 100644 --- a/guacamole/src/main/webapp/app/login/controllers/loginController.js +++ b/guacamole/src/main/webapp/app/login/controllers/loginController.js @@ -26,6 +26,7 @@ angular.module('login').controller('loginController', ['$scope', '$injector', // Required services var $location = $injector.get("$location"); var authenticationService = $injector.get("authenticationService"); + var userPageService = $injector.get('userPageService'); /** * Whether an error occurred during login. @@ -52,7 +53,10 @@ angular.module('login').controller('loginController', ['$scope', '$injector', // Redirect to main view upon success .success(function success(data, status, headers, config) { - $location.path('/'); + userPageService.getHomePage() + .then(function homePageRetrieved(homePage) { + $location.url(homePage.url); + }); }) // Reset and focus password upon failure
GUAC-<I>: Query home page directly when logging in. Do not rely on redirect from '/'.
glyptodon_guacamole-client
train
js
e45830be869a051dcbb6e65f2bc47005e31c2939
diff --git a/scripts/rollup-build.js b/scripts/rollup-build.js index <HASH>..<HASH> 100644 --- a/scripts/rollup-build.js +++ b/scripts/rollup-build.js @@ -16,7 +16,7 @@ export default [ filesize(), ], output: { - format: 'es', + format: 'esm', file: 'dist/vue-socket.io-ext.esm.js', }, },
fix(build): replace `es` with `esm`
probil_vue-socket.io-extended
train
js
ef889f4cab5691871029a42db7e17fb32ece1d58
diff --git a/vagrant_box_defaults.rb b/vagrant_box_defaults.rb index <HASH>..<HASH> 100644 --- a/vagrant_box_defaults.rb +++ b/vagrant_box_defaults.rb @@ -5,4 +5,4 @@ Vagrant.require_version ">= 2.2.0" $SERVER_BOX = "cilium/ubuntu-dev" $SERVER_VERSION= "157" $NETNEXT_SERVER_BOX= "cilium/ubuntu-next" -$NETNEXT_SERVER_VERSION= "23" +$NETNEXT_SERVER_VERSION= "30"
Bump cilium/ubuntu-next version to <I> The VM image has kernel <I>-rc5+ with disabled overlayfs overlap check which prevents Docker from running on it.
cilium_cilium
train
rb
551ba2460dc8ac9b00400d214b214c9f280eb1f9
diff --git a/pyontutils/ttlfmt.py b/pyontutils/ttlfmt.py index <HASH>..<HASH> 100755 --- a/pyontutils/ttlfmt.py +++ b/pyontutils/ttlfmt.py @@ -76,6 +76,7 @@ def parse(source, format_guess, outpath, graph=None): if args['--format']: format_guess = args['--format'] for format in (format_guess, *(f for f in formats if f != format_guess)): + # TODO we don't need to reset just saved parsed streams to the point where they fail? if type(source) == TextIOWrapper: # stdin can't reset src = source.read() source = StringIO(src)
ttlfmt note about possibility of more efficient streaming parser to check for the file type
tgbugs_pyontutils
train
py
c92f56b9c19f985c77fc68790db0da7da851e44b
diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -34,7 +34,7 @@ class ServiceProvider extends ViewServiceProvider public function register() { // Register the package configuration with the loader. - $this->app['config']->package('rcrowe/twigbridge', __DIR__.'/Config'); + $this->app['config']->package('rcrowe/twigbridge', __DIR__.'/config'); } /**
Match case in service provider to config directory
rcrowe_TwigBridge
train
php
1fe4491941f2bd4c4935cb55a37c8ee3770f2a8f
diff --git a/spec/controllers/shortened_urls_controller_spec.rb b/spec/controllers/shortened_urls_controller_spec.rb index <HASH>..<HASH> 100644 --- a/spec/controllers/shortened_urls_controller_spec.rb +++ b/spec/controllers/shortened_urls_controller_spec.rb @@ -138,13 +138,17 @@ describe Shortener::ShortenedUrlsController, type: :controller do Shortener.charset = ("a".."z").to_a + ("A".."Z").to_a + (0..9).to_a + ["-", "_"] end + after do + Shortener.charset = :alphanum + end + context 'key with valid characters' do let(:key) { "cust-Key_123" } let(:custom_url) { Shortener::ShortenedUrl.generate(Faker::Internet.url, custom_key: key) } it 'allows if in custom charset' do expect(custom_url.unique_key).to eq key - end - end + end + end end context 'expired code' do
Reset charset after spec has run This side effect caused other specs to occasionally fail.
jpmcgrath_shortener
train
rb
054c49e8f7e9bfa30070ba7dc0bb6c828bb7cad9
diff --git a/pliers/extractors/audio.py b/pliers/extractors/audio.py index <HASH>..<HASH> 100644 --- a/pliers/extractors/audio.py +++ b/pliers/extractors/audio.py @@ -85,7 +85,8 @@ class STFTAudioExtractor(AudioExtractor): for i, fb in enumerate(self.freq_bins): start, stop = fb values[:, i] = data[:, start:stop].mean(1) - values = np.nan_to_num(values) + values[np.isnan(values)] = 0. + values[np.isinf(values)] = 0. return ExtractorResult(values, stim, self, features=features, onsets=index, durations=self.hop_size)
replace infs with 0 instead of largest possible float
tyarkoni_pliers
train
py
7f1d19febb57d9e4e341c9d20a87af948d0f5040
diff --git a/server/webapp/WEB-INF/rails.new/app/assets/javascripts/plugin-endpoint.js b/server/webapp/WEB-INF/rails.new/app/assets/javascripts/plugin-endpoint.js index <HASH>..<HASH> 100644 --- a/server/webapp/WEB-INF/rails.new/app/assets/javascripts/plugin-endpoint.js +++ b/server/webapp/WEB-INF/rails.new/app/assets/javascripts/plugin-endpoint.js @@ -1,4 +1,4 @@ -(function(_) { +(function() { "use strict"; // these are intentionally private variables, hidden via closure @@ -58,9 +58,13 @@ }, /** define an api, i.e. a set of handlers for one or more keys */ define: function addMany(api) { - _.assign(handlers, api); // or use _.extend() ? + for (var i = 0, keys = Object.keys(api), len = keys.length; i < len; ++i) { + if ("function" === typeof api[keys[i]]) { + handlers[keys[i]] = api[keys[i]]; + } + } }, send: send }; -})(_); +})();
Remove all external library dependencies from plugin-endpoint.js Making this a standalone script makes it simpler for plugins to import.
gocd_gocd
train
js
12a07d700458408debe457ac91bd30a10b61c3f4
diff --git a/store/mockstore/mockcopr/executor_test.go b/store/mockstore/mockcopr/executor_test.go index <HASH>..<HASH> 100644 --- a/store/mockstore/mockcopr/executor_test.go +++ b/store/mockstore/mockcopr/executor_test.go @@ -28,7 +28,6 @@ import ( "github.com/pingcap/tidb/store/mockstore/mockstorage" "github.com/pingcap/tidb/tablecodec" "github.com/pingcap/tidb/util/testkit" - "github.com/tikv/client-go/v2/mockstore/mocktikv" "github.com/tikv/client-go/v2/oracle" "github.com/tikv/client-go/v2/testutils" "github.com/tikv/client-go/v2/tikv" @@ -114,7 +113,7 @@ func (s *testExecutorSuite) TestResolvedLargeTxnLocks(c *C) { // And check the large txn is still alive. pairs = s.mvccStore.Scan([]byte("primary"), nil, 1, tso, kvrpcpb.IsolationLevel_SI, nil) c.Assert(pairs, HasLen, 1) - _, ok := errors.Cause(pairs[0].Err).(*mocktikv.ErrLocked) + _, ok := errors.Cause(pairs[0].Err).(*testutils.ErrLocked) c.Assert(ok, IsTrue) }
test: cleanup mocktikv usage (#<I>)
pingcap_tidb
train
go
87bafe350fae3d9753567e0cf2495952c7ad4945
diff --git a/package/yapsy/PluginManager.py b/package/yapsy/PluginManager.py index <HASH>..<HASH> 100644 --- a/package/yapsy/PluginManager.py +++ b/package/yapsy/PluginManager.py @@ -458,7 +458,7 @@ class PluginManager(object): if "__init__" in os.path.basename(candidate_filepath): sys.path.remove(plugin_info.path) # now try to find and initialise the first subclass of the correct plugin interface - for element in candidate_globals.itervalues(): + for element in sorted(candidate_globals.values()): current_category = None plugin_info_reference = None for category_name in self.categories_interfaces:
Ensure a deterministic search order when looking for a subclass to initialize
benhoff_pluginmanager
train
py
32f9de6d2fafc8bd27083a0054dcdab02bf14f6c
diff --git a/src/main/org/openscience/cdk/tools/LoggingTool.java b/src/main/org/openscience/cdk/tools/LoggingTool.java index <HASH>..<HASH> 100644 --- a/src/main/org/openscience/cdk/tools/LoggingTool.java +++ b/src/main/org/openscience/cdk/tools/LoggingTool.java @@ -105,6 +105,7 @@ public class LoggingTool implements ILoggingTool { * Constructs a LoggingTool which produces log lines without any special * indication which class the message originates from. */ + @TestMethod("testLoggingTool") public LoggingTool() { this(LoggingTool.class); } @@ -115,6 +116,7 @@ public class LoggingTool implements ILoggingTool { * * @param object Object from which the log messages originate */ + @TestMethod("testLoggingTool_Object") public LoggingTool(Object object) { this(object.getClass()); } @@ -125,6 +127,7 @@ public class LoggingTool implements ILoggingTool { * * @param classInst Class from which the log messages originate */ + @TestMethod("testLoggingTool_Class") public LoggingTool(Class<?> classInst) { LoggingTool.logger = this; stackLength = DEFAULT_STACK_LENGTH;
Added missing @TestMethod annotation for LoggingTool
cdk_cdk
train
java
fa79c384895c946693d3dc27ba72104167a74519
diff --git a/js/bcex.js b/js/bcex.js index <HASH>..<HASH> 100644 --- a/js/bcex.js +++ b/js/bcex.js @@ -78,11 +78,11 @@ module.exports = class bcex extends Exchange { 'other': 0.05 / 100, }, 'deposit': {}, - }, - 'exceptions': { + }, + }, + 'exceptions': { '该币不存在,非法操作': ExchangeError, // { code: 1, msg: "该币不存在,非法操作" } - returned when a required symbol parameter is missing in the request (also, maybe on other types of errors as well) '公钥不合法': AuthenticationError, // { code: 1, msg: '公钥不合法' } - wrong public key - }, }, }); }
exceptions definition fixed this item was wrongly defined as a child of "fees".
ccxt_ccxt
train
js
c33009ae3a307c943c32405f93bdadd6c4f8ed6b
diff --git a/src/S3/StreamWrapper.php b/src/S3/StreamWrapper.php index <HASH>..<HASH> 100644 --- a/src/S3/StreamWrapper.php +++ b/src/S3/StreamWrapper.php @@ -94,6 +94,8 @@ class StreamWrapper /** @var string The opened protocol (e.g., "s3") */ private $protocol = 's3'; + private $isFlushed = false; + /** * Register the 's3://' stream wrapper * @@ -127,12 +129,16 @@ class StreamWrapper public function stream_close() { + if ($this->body->getSize() === 0 && !($this->isFlushed)) { + $this->stream_flush(); + } $this->body = $this->cache = null; } public function stream_open($path, $mode, $options, &$opened_path) { $this->initProtocol($path); + $this->isFlushed = false; $this->params = $this->getBucketKey($path); $this->mode = rtrim($mode, 'bt'); @@ -156,6 +162,7 @@ class StreamWrapper public function stream_flush() { + $this->isFlushed = true; if ($this->mode == 'r') { return false; }
Modify S3 Stream Wrapper to work with PHP 7+ for empty file uploads
aws_aws-sdk-php
train
php
6f4704a447756d6a17c617afe1a9b54d629c79ac
diff --git a/airflow/www/views.py b/airflow/www/views.py index <HASH>..<HASH> 100644 --- a/airflow/www/views.py +++ b/airflow/www/views.py @@ -511,6 +511,7 @@ class Airflow(BaseView): LastDagRun = ( session.query(DagRun.dag_id, sqla.func.max(DagRun.execution_date).label('execution_date')) + .filter(DagRun.state != State.RUNNING) .group_by(DagRun.dag_id) .subquery('last_dag_run') )
[AIRFLOW-<I>] Fix double task_stats count if a DagRun is active Closes #<I> from dgies/master
apache_airflow
train
py
b232236423252994884ade6fb89fcf90e63fe5d1
diff --git a/src/request_handlers/request_handler.js b/src/request_handlers/request_handler.js index <HASH>..<HASH> 100644 --- a/src/request_handlers/request_handler.js +++ b/src/request_handlers/request_handler.js @@ -1,7 +1,7 @@ /* This file is part of the GhostDriver project from Neustar inc. -Copyright (c) 2012, Ivan De Marino <ivan.de.marino@gmail.com> - Neustar inc. +Copyright (c) 2012, Ivan De Marino <ivan.de.marino@gmail.com> - Neustar inc. and other authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/src/request_handlers/webelement_request_handler.js b/src/request_handlers/webelement_request_handler.js index <HASH>..<HASH> 100644 --- a/src/request_handlers/webelement_request_handler.js +++ b/src/request_handlers/webelement_request_handler.js @@ -1,7 +1,7 @@ /* This file is part of the GhostDriver project from Neustar inc. -Copyright (c) 2012, Ivan De Marino <ivan.de.marino@gmail.com> - Neustar inc. +Copyright (c) 2012, Ivan De Marino <ivan.de.marino@gmail.com> - Neustar inc. and other authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification,
Updated copyright messages to include other authors.
detro_ghostdriver
train
js,js
a5ed0f1ffc520314bee6cb2a5b58dfb8d0d6e536
diff --git a/src/Fadion/Rule/Rule.php b/src/Fadion/Rule/Rule.php index <HASH>..<HASH> 100644 --- a/src/Fadion/Rule/Rule.php +++ b/src/Fadion/Rule/Rule.php @@ -827,7 +827,7 @@ class Rule */ public function __call($name, $args) { - $rule = $name; + $rule = snake_case($name); if (count($args)) {
Custom rules method can be either camel or snake case
fadion_Rule
train
php
30a5b300155f06fdb425cb7adec4fc6937e44fb2
diff --git a/client/state/ui/actions/set-sites.js b/client/state/ui/actions/set-sites.js index <HASH>..<HASH> 100644 --- a/client/state/ui/actions/set-sites.js +++ b/client/state/ui/actions/set-sites.js @@ -3,8 +3,6 @@ */ import { SELECTED_SITE_SET } from 'state/action-types'; -import 'state/data-layer/wpcom/sites/jitm'; - /** * Returns an action object to be used in signalling that a site has been set * as selected.
State: Remove JITM data layer from UI actions (#<I>)
Automattic_wp-calypso
train
js
aee94331dddaf60de79f0de6ceb9568bd7462e62
diff --git a/cmd/gb-vendor/fetch.go b/cmd/gb-vendor/fetch.go index <HASH>..<HASH> 100644 --- a/cmd/gb-vendor/fetch.go +++ b/cmd/gb-vendor/fetch.go @@ -23,7 +23,7 @@ var ( revision string tag string - + noRecurse bool // Container variable to house the value of the no-recurse flag. recurse bool // should we fetch recursively @@ -140,7 +140,7 @@ func fetch(ctx *gb.Context, path string, recurse bool) error { {filepath.Join(runtime.GOROOT(), "src"), ""}, {filepath.Join(ctx.Projectdir(), "src"), ""}, } - m, err := vendor.ReadManifest(filepath.Join("vendor", "manifest")) + m, err := vendor.ReadManifest(manifestFile(ctx)) if err != nil { return err }
cmd/gb-vendor: always use the correct path to vendor/manifest Fixes #<I> If `gb vendor fetch` was executed in a directory that wasn't the project root, the path to the manifest file would be wrong so a blank manifest would be loaded. This meant that the dep you just fetched, appeared to be not present.
constabulary_gb
train
go
89e9d7fe3bb041cd69ae33564c01a5ab81bf85f6
diff --git a/command/execute_command.go b/command/execute_command.go index <HASH>..<HASH> 100644 --- a/command/execute_command.go +++ b/command/execute_command.go @@ -21,7 +21,7 @@ func NewExecuteCommand(stmt string) *ExecuteCommand { // The name of the ExecuteCommand in the log. func (c *ExecuteCommand) CommandName() string { - return "write" + return "execute" } // Apply executes an sqlite statement.
Rename "write" command as "execute"
rqlite_rqlite
train
go
d342ebac2e87085f2da31eaa1f1c88e0049cdc6f
diff --git a/test/messageStream.js b/test/messageStream.js index <HASH>..<HASH> 100644 --- a/test/messageStream.js +++ b/test/messageStream.js @@ -7,7 +7,7 @@ describe('.messageStream', function() { var s = client.messageStream('g.V()'); s.on('data', function(message) { - message.status.code.should.eql(200); + message.status.code.should.be.within(200, 206); message.result.data.should.be.an('array'); });
Fix .messageStream() test was failing due to Gremlin protocol changes
jbmusso_gremlin-javascript
train
js
1f2b8c9098db1bd3c0b58d20227733fde073aa42
diff --git a/lib/dpl/provider/sds.rb b/lib/dpl/provider/sds.rb index <HASH>..<HASH> 100644 --- a/lib/dpl/provider/sds.rb +++ b/lib/dpl/provider/sds.rb @@ -2,14 +2,9 @@ require 'json' module DPL class Provider - class SDS < Provider - requires 'aws-sdk' - - def needs_key? - false - end - + class SDS < S3 def push_app + super end end end
have SDS provider inherit from S3
travis-ci_dpl
train
rb
befa3540186fa65f6f34a75d1a09676b05c5482e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read() setup( name='django-core', - version='1.1.1-dev', + version='1.2.0', description='A core set of tools for django applications.', long_description=README, author='Troy Grosfield',
version bump for <I> release.
InfoAgeTech_django-core
train
py
3ddacd9fc153dcf7226e6c050e2daf89064a2b90
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -8,14 +8,14 @@ var webpack = require('webpack-stream'); // var browserify = require('./support/browserify.js'); gulp.task('build-webpack', function() { - return gulp.src('lib/*.js') - .pipe(babel()) + return gulp.src('lib/*.js') .pipe(webpack({ entry: './lib/index.js', output: { filename: 'socket.io.js', }, })) + .pipe(babel()) .pipe(gulp.dest('./')); });
Swap the order of babel and webpack
tsjing_socket.io-client
train
js
58d0b27bb1b40ff76cc0044ddc29847b7ba71dee
diff --git a/src/Bundle.js b/src/Bundle.js index <HASH>..<HASH> 100644 --- a/src/Bundle.js +++ b/src/Bundle.js @@ -394,12 +394,12 @@ export default class Bundle { return declaration.source === source; }); - const declaration = module.imports[ name ].specifier.parent; + const declaration = module.imports[ name ] && module.imports[ name ].specifier.parent; module.error({ code: 'CANNOT_IMPORT_SELF', message: `A module cannot import itself` - }, declaration.start ); + }, (declaration && declaration.start) ); } module.resolvedIds[ source ] = resolvedId;
fix cannot-import-self check, add sanity check for both the module without name member and the declaration.start property.
rollup_rollup
train
js
56a6d8f9c158def1eabe0653294f776bd559f509
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -154,7 +154,9 @@ function assignPathComponents(basePath, result) { var url = urlParse(basePath); result.host = url.host; result.basePath = url.path; - result.schemes = [url.protocol.substr(0, url.protocol.length - 1)]; + if (url.protocol) { + result.schemes = [url.protocol.substr(0, url.protocol.length - 1)]; + } } /*
The field schemes is an optional field. Avoid errors if the protocol is missing
apigee-127_swagger-converter
train
js
bdf4e53134358de528ab4e8e49f03d255e46ab78
diff --git a/src/Blendable/Blendable.php b/src/Blendable/Blendable.php index <HASH>..<HASH> 100644 --- a/src/Blendable/Blendable.php +++ b/src/Blendable/Blendable.php @@ -381,12 +381,10 @@ abstract class Blendable implements BlendableInterface } elseif ($type == 'revert') { - $this->seedRelated($type); - $data = [ 'columns' => false, 'primaryKeyHistory' => [], - 'related' => $this->related_data + 'related' => [] ]; if ($this->isDebug()) {
Fix seedToArray remove call to seedRelated on non existing xPDO Object
LippertComponents_Blend
train
php
221a99471d84cc166871e9151ac7f4c0122344d5
diff --git a/holoviews/plotting/mpl/heatmap.py b/holoviews/plotting/mpl/heatmap.py index <HASH>..<HASH> 100644 --- a/holoviews/plotting/mpl/heatmap.py +++ b/holoviews/plotting/mpl/heatmap.py @@ -187,6 +187,8 @@ class HeatMapPlot(HeatMapMixin, QuadMeshPlot): style['annotations'] = self._annotate_values(element.gridded, xvals, yvals) vdim = element.vdims[0] self._norm_kwargs(element, ranges, style, vdim) + if 'vmin' in style: + style['clim'] = style.pop('vmin'), style.pop('vmax') return (xvals, yvals, data), style, {'xticks': xticks, 'yticks': yticks}
Fix vmin/vmax deprecation on matplotlib HeatMapPlot (#<I>)
pyviz_holoviews
train
py
ec083083ce9c7990f9c156c400555fc98e2cf2ca
diff --git a/packer/new_stuff.go b/packer/new_stuff.go index <HASH>..<HASH> 100644 --- a/packer/new_stuff.go +++ b/packer/new_stuff.go @@ -4,7 +4,7 @@ import "github.com/hashicorp/hcl/v2" type GetBuildsOptions struct { // Get builds except the ones that match with except and with only the ones - // that match with. When those are empty everything matches. + // that match with Only. When those are empty everything matches. Except, Only []string }
Update new_stuff.go
hashicorp_packer
train
go
e9b02840708226e5cf49a75364f7e273ef8f020e
diff --git a/railties/lib/test_help.rb b/railties/lib/test_help.rb index <HASH>..<HASH> 100644 --- a/railties/lib/test_help.rb +++ b/railties/lib/test_help.rb @@ -1,4 +1,4 @@ -require 'application' +require_dependency 'application' # Make double-sure the RAILS_ENV is set to test, # so fixtures are loaded to the right database
be sure to require_dependency on 'application', so that dependency loading is honored correctly git-svn-id: <URL>
rails_rails
train
rb
d59deb15edb5112843ddd2b2affaf2f6c4088aa8
diff --git a/src/heywood/manager.py b/src/heywood/manager.py index <HASH>..<HASH> 100644 --- a/src/heywood/manager.py +++ b/src/heywood/manager.py @@ -22,6 +22,9 @@ def log(color_no, name, message): tag = '%8s' % name print color_on + stamp + tag + ' | ' + color_off + message +def parse_command(cmd): + return os.path.expandvars(cmd).split() + class BaseProcess(object): 'I keep track of one child.' @@ -61,7 +64,7 @@ class BaseProcess(object): os.setsid() def spawn(self): - self.process = Popen(self.command.split(), + self.process = Popen(parse_command(self.command), stdin=dev_null, stdout=PIPE, stderr=STDOUT, preexec_fn=self.set_process_group) self.eof = False
Turns out we do want some shell-like parsing.
doptio_heywood
train
py
941b42e477af0cee24c4d7dd6924295151e9feed
diff --git a/Classes/Controller/AbstractController.php b/Classes/Controller/AbstractController.php index <HASH>..<HASH> 100644 --- a/Classes/Controller/AbstractController.php +++ b/Classes/Controller/AbstractController.php @@ -161,9 +161,15 @@ abstract class AbstractController $client->setView( $this->getContext()->getView() ); $client->process(); - $this->response->addAdditionalHeaderData( (string) $client->getHeader() ); + $pageType = ''; + if( $GLOBALS['TYPO3_REQUEST'] instanceof \Psr\Http\Message\ServerRequestInterface + && empty( $GLOBALS['TYPO3_REQUEST']->getAttribute( 'routing' ) ) === false ) + { + $pageType = (string) $GLOBALS['TYPO3_REQUEST']->getAttribute( 'routing' )->getPageType(); + } - return $client->getBody(); + $this->response->addAdditionalHeaderData( (string) $client->getHeader( $pageType ) ); + return $client->getBody( $pageType ); }
Take the page type into account for caching (#<I>)
aimeos_aimeos-typo3
train
php
48549f9a45474696595460e70ccfab36e2986092
diff --git a/release_util/__init__.py b/release_util/__init__.py index <HASH>..<HASH> 100644 --- a/release_util/__init__.py +++ b/release_util/__init__.py @@ -2,4 +2,4 @@ a collection of Django management commands used for analyzing and manipulating migrations. """ -__version__ = '1.1.0' # pragma: no cover +__version__ = '1.1.1' # pragma: no cover
chore: bump edx-django-release-util version
edx_edx-django-release-util
train
py
92e6652dbf0e2d4897981ef088f9f140b018cac9
diff --git a/formatter.go b/formatter.go index <HASH>..<HASH> 100644 --- a/formatter.go +++ b/formatter.go @@ -78,6 +78,9 @@ type TextFormatter struct { // system that already adds timestamps. DisableTimestamp bool + // Disable the conversion of the log levels to uppercase + DisableUppercase bool + // Enable logging the full timestamp when a TTY is attached instead of just // the time passed since beginning of execution. FullTimestamp bool @@ -222,9 +225,13 @@ func (f *TextFormatter) printColored(b *bytes.Buffer, entry *logrus.Entry, keys } if entry.Level != logrus.WarnLevel { - levelText = strings.ToUpper(entry.Level.String()) + levelText = entry.Level.String() } else { - levelText = "WARN" + levelText = "warn" + } + + if !f.DisableUppercase { + levelText = strings.ToUpper(levelText) } level := levelColor(fmt.Sprintf("%5s", levelText))
Optionally disable the uppercasing of log levels
x-cray_logrus-prefixed-formatter
train
go
e5353dc1b1238530291e66f987436ac582098dbb
diff --git a/cassandra/cluster.py b/cassandra/cluster.py index <HASH>..<HASH> 100644 --- a/cassandra/cluster.py +++ b/cassandra/cluster.py @@ -2107,6 +2107,8 @@ class _Scheduler(object): def refresh_schema_and_set_result(keyspace, table, usertype, control_conn, response_future): try: + log.debug("Refreshing schema in response to schema change. Keyspace: %s; Table: %s, Type: %s", + keyspace, table, usertype) control_conn._refresh_schema(response_future._connection, keyspace, table, usertype) except Exception: log.exception("Exception refreshing schema in response to schema change:")
Log when refreshing schema due to schema change
datastax_python-driver
train
py
536b9f442af3cb867d1e02c26c11d1c786532615
diff --git a/sftpman/cli.py b/sftpman/cli.py index <HASH>..<HASH> 100644 --- a/sftpman/cli.py +++ b/sftpman/cli.py @@ -32,7 +32,8 @@ class SftpCli(object): --port={port to connect to} [default: 22] --user={username to authenticate with} [default: current user] --mount_opts={comma separated list of sshfs options} [optional] - `sshfs --help` tells you what's available + Example: --mount_opts="follow_symlinks, workaround=rename, big_writes" + `sshfs --help` tells you what sshfs options are available --mount_point={remote path to mount} --ssh_key={path to the ssh key to use for authentication} --cmd_before_mount={command to run before mounting} [default: /bin/true]
Added --mount_opts example to add command.
spantaleev_sftpman
train
py
dc83f34443d4556849899cf850319f17c6af8fb1
diff --git a/core-bundle/tests/Framework/ContaoFrameworkTest.php b/core-bundle/tests/Framework/ContaoFrameworkTest.php index <HASH>..<HASH> 100644 --- a/core-bundle/tests/Framework/ContaoFrameworkTest.php +++ b/core-bundle/tests/Framework/ContaoFrameworkTest.php @@ -465,7 +465,7 @@ class ContaoFrameworkTest extends TestCase /** * Tests initializing the framework with an incomplete installation on the install route. * - * @var string $route + * @param string $route * * @runInSeparateProcess * @dataProvider getInstallRoutes
[Core] Fix a phpDoc comment.
contao_contao
train
php
8560627b8cc50118074bd5edd6622c9aa35f9a1f
diff --git a/libexec/eue/features/support/shinken.rb b/libexec/eue/features/support/shinken.rb index <HASH>..<HASH> 100644 --- a/libexec/eue/features/support/shinken.rb +++ b/libexec/eue/features/support/shinken.rb @@ -141,7 +141,7 @@ module Eue fsgrid.open(screenshot_file, "w") do |f| f.write image end - #File.delete(screenshot) + File.delete(screenshot) return screenshot_file end
Fix delete screenshot after saving in mongodb gridfs
Alignak-monitoring_alignak
train
rb
b79edf9111f63f8d718e06236c77c08e64dd164b
diff --git a/contrib/ruby_event_store-flipper/spec/enable_spec.rb b/contrib/ruby_event_store-flipper/spec/enable_spec.rb index <HASH>..<HASH> 100644 --- a/contrib/ruby_event_store-flipper/spec/enable_spec.rb +++ b/contrib/ruby_event_store-flipper/spec/enable_spec.rb @@ -25,6 +25,19 @@ module RubyEventStore )).in_stream("FeatureToggle$foo_bar") end + specify "adding toggle when already added" do + event_store = RubyEventStore::Client.new(repository: RubyEventStore::InMemoryRepository.new) + flipper = ::Flipper.new(::Flipper::Adapters::Memory.new, instrumenter: ActiveSupport::Notifications) + Flipper.enable(event_store) + flipper.add(:foo_bar) + + flipper.add(:foo_bar) + + expect(event_store).to have_published(an_event(Flipper::Events::ToggleAdded).with_data( + feature_name: "foo_bar", + )).in_stream("FeatureToggle$foo_bar") + end + specify "removing toggle" do event_store = RubyEventStore::Client.new(repository: RubyEventStore::InMemoryRepository.new) flipper = ::Flipper.new(::Flipper::Adapters::Memory.new, instrumenter: ActiveSupport::Notifications)
Add when adding toggle which is already added
RailsEventStore_rails_event_store
train
rb
ff4db3cdc8d5a8cbc64bfee2cbabf0a045e0e75e
diff --git a/views/js/qtiCreator/renderers/Math.js b/views/js/qtiCreator/renderers/Math.js index <HASH>..<HASH> 100755 --- a/views/js/qtiCreator/renderers/Math.js +++ b/views/js/qtiCreator/renderers/Math.js @@ -26,11 +26,20 @@ define([ var CreatorMath = _.clone(Renderer); + /** + * This could be extracted as a helper if generic support is needed for non-editable element rendering + * Here, we simply check that the math element is not nested inside a hottext element + * @param {Element} element + */ + function isEditable(element) { + var parent = element.parent(); + return ! Element.isA(parent, 'hottext'); + } + CreatorMath.render = function(math, options){ //initial rendering: - var parent = math.parent(); - if (! Element.isA(parent, 'hottext')) { // todo: improve this and make it work for Gapmatch? + if (isEditable(math)) { Renderer.render(math); Widget.build(
created helper function for math widget renderer
oat-sa_extension-tao-itemqti
train
js
c28f0313a96be4f4095f542ba2a9524c129c88f7
diff --git a/luigi_td/__init__.py b/luigi_td/__init__.py index <HASH>..<HASH> 100644 --- a/luigi_td/__init__.py +++ b/luigi_td/__init__.py @@ -14,13 +14,13 @@ __all__ = [ 'ResultProxy', # config 'Config', - 'get_config' + 'get_config', # task 'DatabaseTask', 'TableTask', 'Query', # targets.result - 'ResultTarget' + 'ResultTarget', # targets.s3 'S3ResultTarget', # targets.tableau
Fix variable names in __all__
treasure-data_luigi-td
train
py
d0bf3808e22453855a2e4b3f489b4fab4e698bb9
diff --git a/lib/xcake/generator/project.rb b/lib/xcake/generator/project.rb index <HASH>..<HASH> 100644 --- a/lib/xcake/generator/project.rb +++ b/lib/xcake/generator/project.rb @@ -19,7 +19,6 @@ module Xcake end def visit_target(target) - generator = Target.new generator.visit(target) end
Reducing spcaing.
igor-makarov_xcake
train
rb
bba2bcea29643ef30a189c701c33bd54452df2a5
diff --git a/aston/tracefile/agilent_uv.py b/aston/tracefile/agilent_uv.py index <HASH>..<HASH> 100644 --- a/aston/tracefile/agilent_uv.py +++ b/aston/tracefile/agilent_uv.py @@ -9,7 +9,18 @@ from aston.tracefile import TraceFile def string_read(f): - return f.read(struct.unpack('>B', f.read(1))[0]).decode('ascii').strip() + """modified string read method which works with our UV files""" + # todo figure out why there is a null character between every value + # - check if this is true across all cases + # - if so, does this affect the interpretation of intensity values + # it's not pretty, but it works + read_len = struct.unpack( # determine length to read + '>B', f.read(1) + )[0] + out = f.read( # read values, decode, and strip + 2 * read_len - 1 + ).decode('ascii').strip() + return out.replace('\x00', '') class AgilentMWD(TraceFile):
modified string read to work with our UV files.
bovee_Aston
train
py
177b36c888ac13f920a1ed6c19471e889b9a9b67
diff --git a/code/plugins/system/joomlatools/joomlatools.php b/code/plugins/system/joomlatools/joomlatools.php index <HASH>..<HASH> 100644 --- a/code/plugins/system/joomlatools/joomlatools.php +++ b/code/plugins/system/joomlatools/joomlatools.php @@ -233,6 +233,21 @@ class PlgSystemJoomlatools extends JPlugin } /** + * Proxy onError event in lieu of a working exception handler mechanism in Joomla 4 + * + * Joomla 4 catches every exception in CMSApplication::execute and converts into an internal event + * + * @see: https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/Application/CMSApplication.php#L296 + * @return void + */ + public function onError($exception) + { + if ($exception instanceof \Throwable) { + $this->_proxyEvent('onException', ['exception' => $exception]); + } + } + + /** * Proxy onBeforeRender * * @return void
Proxy onError event in lieu of a working exception handler mechanism in Joomla 4 Joomla 4 catches every exception in CMSApplication::execute and converts into an internal event. See: <URL>
joomlatools_joomlatools-framework
train
php
47379d4a2e9fcb608518635903603b8b38527fcb
diff --git a/src/Module.php b/src/Module.php index <HASH>..<HASH> 100644 --- a/src/Module.php +++ b/src/Module.php @@ -156,7 +156,7 @@ class Module extends \yii\base\Module { $data = array_merge([ 'merchant' => $merchant, - 'description' => Yii::$app->request->getServerName() . ' deposit: ' . $this->username, + 'description' => Yii::$app->request->getHostName() . ' deposit: ' . $this->username, 'transactionId' => uniqid(), ], $data);
Updated Module to use hostname instead of servername For the case when web server is configured for multiple domains, the description must contain real domain name that was requested.
hiqdev_yii2-merchant
train
php
6b0fc575672dd225a0131cbbca2be89f1b532b92
diff --git a/js/lib/ext.core.TemplateHandler.js b/js/lib/ext.core.TemplateHandler.js index <HASH>..<HASH> 100644 --- a/js/lib/ext.core.TemplateHandler.js +++ b/js/lib/ext.core.TemplateHandler.js @@ -64,10 +64,15 @@ TemplateHandler.prototype.encapsulateExpansionHTML = function(token, expansion) tok.setAttribute('about', about); }); - // Transfer tsr to the first token + // Transfer the tsr. The first token gets the full width, the following + // tokens zero width. var tokenTsr = token.dataAttribs ? token.dataAttribs.tsr : null; if (tokenTsr) { toks[0].dataAttribs.tsr = tokenTsr; + var endTsr = [tokenTsr[1],tokenTsr[1]]; + for (var i = 1; i < toks.length; i++) { + toks[i].dataAttribs.tsr = endTsr; + } } return toks;
Set end tsr on wrapper tokens "<gallery></gallery>" gets wrapped in a DOMFragment. This fix ensures that DSR is accurately computed for it when there is more than 1 wrapper token. Change-Id: Ie<I>bdb<I>c7e<I>aa<I>a<I>b
wikimedia_parsoid
train
js
caa1dd755090f2ec72b922dbabf3b6e86513fc96
diff --git a/tests/unit/modules/test_network.py b/tests/unit/modules/test_network.py index <HASH>..<HASH> 100644 --- a/tests/unit/modules/test_network.py +++ b/tests/unit/modules/test_network.py @@ -33,7 +33,7 @@ class NetworkTestCase(TestCase, LoaderModuleMockMixin): opts, whitelist=["network", "path", "platform", "stringutils"] ) return { - network: {"__utils__": utils,}, + network: {"__utils__": utils}, } def test_wol_bad_mac(self):
Fix pylint errors introduced by black
saltstack_salt
train
py
8642abbdeda77c067de9281d13c395f4432e011c
diff --git a/src/XBase/Table.php b/src/XBase/Table.php index <HASH>..<HASH> 100644 --- a/src/XBase/Table.php +++ b/src/XBase/Table.php @@ -97,7 +97,7 @@ class Table $bytepos += $column->getLength(); if (!$this->avaliableColumns || ($this->avaliableColumns && in_array($column->name, $this->avaliableColumns))) { - $this->columns[$column->getName()] = $column; + $this->addColumn($column); $j++; } } @@ -192,6 +192,21 @@ class Table return $this->record; } + public function addColumn($column) + { + $name = $nameBase = $column->getName(); + $index = 0; + + while (isset($this->columns[$name])) + { + $name = $nameBase . ++$index; + } + + $column->name = $name; + + $this->columns[$name] = $column; + } + public function getColumns() { return $this->columns;
Add support for multiple columns having same name Inspired by LibreOffice: first column has original name, all other columns with same name has 1-based index appended.
luads_php-xbase
train
php
b0c3b0e61145d7170a94b17d334298a3ac153035
diff --git a/lxd/db/network_forwards.go b/lxd/db/network_forwards.go index <HASH>..<HASH> 100644 --- a/lxd/db/network_forwards.go +++ b/lxd/db/network_forwards.go @@ -203,14 +203,12 @@ func (c *Cluster) GetNetworkForward(networkID int64, memberSpecific bool, listen var rowCount int err = tx.tx.QueryRow(q.String(), args...).Scan(&forwardID, &forward.ListenAddress, &forward.Description, &forward.Location, &portsJSON, &rowCount) - if err != nil { - return err - } - if rowCount <= 0 || errors.Is(err, sql.ErrNoRows) { return api.StatusErrorf(http.StatusNotFound, "Network forward not found") - } else if rowCount != 1 { + } else if rowCount > 1 { return api.StatusErrorf(http.StatusConflict, "Network forward found on more than one cluster member. Please target a specific member") + } else if err != nil { + return err } err = networkForwardConfig(tx, forwardID, &forward)
lxd/db/network/forwards: Fix error handling in GetNetworkForward
lxc_lxd
train
go
0544d7d6d3fc926d91c5d3087877bf0efb18c2ca
diff --git a/lib/reek/errors/incomprehensible_source_error.rb b/lib/reek/errors/incomprehensible_source_error.rb index <HASH>..<HASH> 100644 --- a/lib/reek/errors/incomprehensible_source_error.rb +++ b/lib/reek/errors/incomprehensible_source_error.rb @@ -17,8 +17,8 @@ module Reek It would be great if you could report this back to the Reek team by opening a corresponding issue at https://github.com/troessner/reek/issues. - Please make sure to include the source in question, the Reek version and the - original exception below. + Please make sure to include the source in question, the Reek version, + and this entire error message, including the original exception below. Exception message:
Instruct people to paste the full error message This will ensure the name of the source file being part of the bug report, so we will at least know that even if the reporter does not include the source itself.
troessner_reek
train
rb
24c40b976438d53780d86b63f1459debc30d5210
diff --git a/lib/bx/seq/core.py b/lib/bx/seq/core.py index <HASH>..<HASH> 100644 --- a/lib/bx/seq/core.py +++ b/lib/bx/seq/core.py @@ -16,7 +16,10 @@ def seq_file (file, format=None, revcomp=False, name="", gap=None): if (format == "fasta"): return fasta.FastaFile (file, revcomp=revcomp, name=name, gap=gap) elif (format == "nib"): return nib.NibFile (file, revcomp=revcomp, name=name, gap=gap) elif (format == "qdna"): return qdna.QdnaFile (file, revcomp=revcomp, name=name, gap=gap) - else: raise "Unknown sequence format %s" % format + else: + if (format == None): format = "" + else: format = " " + format + raise "Unknown sequence format%s in %s" % (format,file.name) def seq_reader (file, format=None, revcomp=False, name="", gap=None):
improved reporting of unrecognized sequence file formats
bxlab_bx-python
train
py
81ba7a77c81e71cfdb674bf82cc11ba60d9d6492
diff --git a/lib/nexmo.rb b/lib/nexmo.rb index <HASH>..<HASH> 100644 --- a/lib/nexmo.rb +++ b/lib/nexmo.rb @@ -107,6 +107,10 @@ module Nexmo @json = options.fetch(:json) { JSON } end + def respond_to_missing?(name, include_private = false) + @http_response.respond_to?(name) + end + def method_missing(name, *args, &block) @http_response.send(name, *args, &block) end diff --git a/spec/nexmo_spec.rb b/spec/nexmo_spec.rb index <HASH>..<HASH> 100644 --- a/spec/nexmo_spec.rb +++ b/spec/nexmo_spec.rb @@ -161,6 +161,7 @@ describe 'Nexmo::Response' do it 'delegates to the underlying http response' do @http_response.expects(:code).returns('200') + @response.must_respond_to(:code) @response.code.must_equal('200') end
Add Nexmo::Response#respond_to_missing? method
Nexmo_nexmo-ruby
train
rb,rb
be79dcbda005baa5c01990ee6209b9fc329b70dc
diff --git a/lib/rules/radix.js b/lib/rules/radix.js index <HASH>..<HASH> 100644 --- a/lib/rules/radix.js +++ b/lib/rules/radix.js @@ -18,7 +18,7 @@ module.exports = function(context) { if (node.callee.name === "parseInt") { - if (node.arguments.length === 1) { + if (node.arguments.length < 2) { context.report(node, "Missing radix parameter."); } else { diff --git a/tests/lib/rules/radix.js b/tests/lib/rules/radix.js index <HASH>..<HASH> 100644 --- a/tests/lib/rules/radix.js +++ b/tests/lib/rules/radix.js @@ -18,6 +18,13 @@ eslintTester.addRuleTest("lib/rules/radix", { invalid: [ { + code: "parseInt();", + errors: [{ + message: "Missing radix parameter.", + type: "CallExpression" + }] + }, + { code: "parseInt(\"10\");", errors: [{ message: "Missing radix parameter.",
Fix: radix rule should warn (not throw error) when parseInt() is called without arguments (fixes #<I>)
eslint_eslint
train
js,js
c71d64dddc24d64d524f06f98e6afcb49dfede60
diff --git a/languagetool-gui-commons/src/main/java/org/languagetool/gui/ConfigurationDialog.java b/languagetool-gui-commons/src/main/java/org/languagetool/gui/ConfigurationDialog.java index <HASH>..<HASH> 100644 --- a/languagetool-gui-commons/src/main/java/org/languagetool/gui/ConfigurationDialog.java +++ b/languagetool-gui-commons/src/main/java/org/languagetool/gui/ConfigurationDialog.java @@ -253,6 +253,8 @@ public class ConfigurationDialog implements ActionListener { cons.gridx = 0; cons.gridy = 0; + cons.weightx = 10.0f; + cons.weighty = 0.0f; cons.fill = GridBagConstraints.NONE; cons.anchor = GridBagConstraints.NORTHWEST; cons.gridy++; @@ -280,6 +282,10 @@ public class ConfigurationDialog implements ActionListener { jPane.add(extra, cons); } + cons.gridy++; + cons.fill = GridBagConstraints.BOTH; + cons.weighty = 1.0f; + jPane.add(new JPanel(), cons); tabpane.addTab(messages.getString("guiGeneral"), jPane); jPane = new JPanel();
tab content should stay at northwest when dialog is bigger that the content
languagetool-org_languagetool
train
java
6d74ce1015c154b6456b08b89a7d616a70f6ee5f
diff --git a/build/build.py b/build/build.py index <HASH>..<HASH> 100755 --- a/build/build.py +++ b/build/build.py @@ -1070,6 +1070,7 @@ class Release(): '--strip-debug', '--no-header-files', '--no-man-pages', '--compress=2', '--output', self.vnuImageDir, '--module-path', vnuJar, + '--add-modules', 'jdk.crypto.ec', '--add-modules', 'vnu']) self.checkRuntimeImage() os.chdir(distDir)
Add jdk.crypto.ec module to runtime-image build This change causes the build of the Java runtime images to include jdk.crypto.ec as module. Otherwise, without this change, the runtime images cannot be used to check many (or most) HTTPS web documents Fixes <URL>
validator_validator
train
py
f4848175b88e8aa14395c2510591f9c150aceac6
diff --git a/tests/LaraCartTest.php b/tests/LaraCartTest.php index <HASH>..<HASH> 100644 --- a/tests/LaraCartTest.php +++ b/tests/LaraCartTest.php @@ -53,7 +53,7 @@ class LaraCartTest extends Orchestra\Testbench\TestCase public function testFormatMoney() { $this->assertEquals('$25.00', $this->laracart->formatMoney('25.00')); - $this->assertEquals('USD25.00', $this->laracart->formatMoney('25.00', null, true)); + $this->assertEquals('USD 25.00', $this->laracart->formatMoney('25.00', null, true)); $this->assertEquals('25.00', $this->laracart->formatMoney('25.00', null, null, false)); $this->assertEquals('$25.56', $this->laracart->formatMoney('25.555'));
revert removing space, stuipd mac
lukepolo_laracart
train
php
d9bd2901d58a15685af0bf827f029dabbcdb9775
diff --git a/TheCannon/cannon/continuum_normalization.py b/TheCannon/cannon/continuum_normalization.py index <HASH>..<HASH> 100644 --- a/TheCannon/cannon/continuum_normalization.py +++ b/TheCannon/cannon/continuum_normalization.py @@ -5,6 +5,9 @@ import scipy.optimize as opt """ Performs continuum normalization on Cannon input spectra. """ +LARGE = 100. +SMALL = 1. / LARGE + # Thank you Morgan for this... def partial_func(func, *args, **kwargs): @@ -82,6 +85,10 @@ def cont_norm(fluxes, ivars, contmask, deg=3): cont[element] = cont_func(element, popt, L=L) norm_fluxes[jj,:] = flux/cont norm_ivars[jj,:] = cont**2 * ivar + # avoid having ivar = 0, which will throw error later + bad = (ivar < SMALL) + flux_norm[bad] = 1. + ivar[bad] = SMALL return norm_fluxes, norm_ivars
make bad ivars small instead of 0
annayqho_TheCannon
train
py
9b4d3ec17fe4cef05634bbd438347930513fd93c
diff --git a/test/test-utils-parse-params.js b/test/test-utils-parse-params.js index <HASH>..<HASH> 100644 --- a/test/test-utils-parse-params.js +++ b/test/test-utils-parse-params.js @@ -7,6 +7,22 @@ var path = require('path'), var group = path.basename(__filename, '.js') + '/'; [ + { source: 'video/ogg', + expected: ['video/ogg'], + what: 'No parameters' + }, + { source: 'video/ogg;', + expected: ['video/ogg'], + what: 'No parameters (with separator)' + }, + { source: 'video/ogg; ', + expected: ['video/ogg'], + what: 'No parameters (with separator followed by whitespace)' + }, + { source: ';video/ogg', + expected: ['', 'video/ogg'], + what: 'Empty parameter' + }, { source: 'text/plain; encoding=utf8', expected: ['text/plain', ['encoding', 'utf8']], what: 'Unquoted'
test: add more parseParams tests
mscdex_busboy
train
js
8439143b7f9f22297a3c4d79bacfd7b7a0292b4a
diff --git a/ibis/backends/impala/tests/test_client.py b/ibis/backends/impala/tests/test_client.py index <HASH>..<HASH> 100644 --- a/ibis/backends/impala/tests/test_client.py +++ b/ibis/backends/impala/tests/test_client.py @@ -211,10 +211,11 @@ def test_verbose_log_queries(con, test_data_db): with config.option_context('verbose_log', queries.append): con.table('tpch_orders', database=test_data_db) - assert len(queries) == 1 - (query,) = queries + # we can't make assertions about the length of queries, since the Python GC + # could've collected a temporary pandas table any time between construction + # of `queries` and the assertion expected = f'DESCRIBE {test_data_db}.`tpch_orders`' - assert query == expected + assert expected in queries def test_sql_query_limits(con, test_data_db):
test: fix incorrect assumption about GC in impala test (#<I>)
ibis-project_ibis
train
py
bde0c6448f1112790b4e27ff39682b35ba320cc9
diff --git a/src/DateTime.php b/src/DateTime.php index <HASH>..<HASH> 100644 --- a/src/DateTime.php +++ b/src/DateTime.php @@ -39,6 +39,15 @@ class DateTime implements \Serializable, \JsonSerializable /** + * @inheritdoc + */ + public function __clone() + { + $this->wrapped = clone $this->wrapped; + } + + + /** * @param string $time * @param DateTimeZone|null $timezone * diff --git a/tests/DateTimeTest.php b/tests/DateTimeTest.php index <HASH>..<HASH> 100644 --- a/tests/DateTimeTest.php +++ b/tests/DateTimeTest.php @@ -312,4 +312,18 @@ class DateTimeTest extends \PHPUnit_Framework_TestCase self::assertSame('2015-09-14T00:00:00+00:00', $date->format('c')); } + + + /** + * @covers ::__clone + */ + public function testClonesDoNotShareSameWrappedDateTime() + { + $a = DateTime::create('2016-01-01T00:00:00Z'); + $b = clone $a; + $b = $b->add('P1Y'); + + self::assertSame('2017-01-01T00:00:00+00:00', $b->format('c')); + self::assertSame('2016-01-01T00:00:00+00:00', $a->format('c'), 'Instance has been mutated.'); + } }
Ensure wrapped \DateTime is cloned to retain immutability
krixon_datetime
train
php,php
685bcdde1c73706bcb5d58c20170d47754f54fa7
diff --git a/bin/nscale-kernel.js b/bin/nscale-kernel.js index <HASH>..<HASH> 100755 --- a/bin/nscale-kernel.js +++ b/bin/nscale-kernel.js @@ -29,9 +29,16 @@ config.test = opts.test; var pidFile = path.join(config.kernel.root, 'data', '.nscale-kernel'); var kernel = new Kernel(config, function(err) { - if (err) { throw err; } + if (err) { + // this is needed to get out of the nodegit promise + // context + process.nextTick(function () { + throw err; + }); + return + } kernel.start(); - + fs.writeFile(pidFile, process.pid, function(err) { if (err) { throw err; } }); @@ -47,4 +54,4 @@ signals.forEach(function(signal) { process.on(signal, function() { kernel.stop(); }); -}); \ No newline at end of file +});
Always throw and don't get catched into the promise mess.
nearform_nscale-kernel
train
js
5ad8d8606c550f4bd80fb08f112e9502d5d44322
diff --git a/tidyextractors/base_extractor.py b/tidyextractors/base_extractor.py index <HASH>..<HASH> 100644 --- a/tidyextractors/base_extractor.py +++ b/tidyextractors/base_extractor.py @@ -24,6 +24,7 @@ import petl as etl import numpy as np import pandas as pd import itertools as it +import progress_bar class BaseExtractor(object): @@ -320,4 +321,4 @@ class BaseExtractor(object): if drop_collections is True: df_out = self._drop_collections(df_out) - return df_out \ No newline at end of file + return df_out
Added progress bar import, ran tests.
networks-lab_tidyextractors
train
py
afe50e44d38c1708ff0db183e722639dbff24d92
diff --git a/src/TripSegment/index.js b/src/TripSegment/index.js index <HASH>..<HASH> 100644 --- a/src/TripSegment/index.js +++ b/src/TripSegment/index.js @@ -121,7 +121,8 @@ const Chevrons = ({ expanded }: ExpandedType) => ( const StyledTripSegmentOverview = styled.div` display: flex; - flex: 0 1 calc(100% - 96px); + flex: 0 1 auto; + width: calc(100% - 96px); min-width: 0; ${StyledText} { line-height: 1.2; @@ -137,6 +138,8 @@ const StyledTripSegmentCarrier = styled.div` align-items: center; position: absolute; ${right}: ${({ theme }) => `-${theme.orbit.spaceXSmall}`}; + top: 0; + height: 100%; `; StyledTripSegmentCarrier.defaultProps = {
FIX: TripSegment in IE (#<I>)
kiwicom_orbit-components
train
js
7e8abd988aa89559cf1648622e61bb2f8fd6cb9b
diff --git a/identify/extensions.py b/identify/extensions.py index <HASH>..<HASH> 100644 --- a/identify/extensions.py +++ b/identify/extensions.py @@ -183,6 +183,7 @@ EXTENSIONS = { 'txsprofile': {'text', 'ini', 'txsprofile'}, 'txt': {'text', 'plain-text'}, 'v': {'text', 'verilog'}, + 'vb': {'text', 'vb'}, 'vbproj': {'text', 'xml', 'vbproj'}, 'vcxproj': {'text', 'xml', 'vcxproj'}, 'vdx': {'text', 'vdx'},
Add vb to EXTENSIONS
chriskuehl_identify
train
py