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
7c58b9ee84b6ae8b06cee480e20b5eda059b44ea
diff --git a/src/Entity/Testing/AbstractEntityTest.php b/src/Entity/Testing/AbstractEntityTest.php index <HASH>..<HASH> 100644 --- a/src/Entity/Testing/AbstractEntityTest.php +++ b/src/Entity/Testing/AbstractEntityTest.php @@ -197,7 +197,7 @@ abstract class AbstractEntityTest extends TestCase implements EntityTestInterfac $dto->$method(); } if (0 === $this->getCount()) { - self::markTestSkipped('No assertable getters in this Entity'); + self::assertTrue(true); } return $entity;
cant skip a test that is being depended on
edmondscommerce_doctrine-static-meta
train
php
d4ba4a7dba944be338c7843c7977b2c7b9294708
diff --git a/lib/fluent/plugin/output.rb b/lib/fluent/plugin/output.rb index <HASH>..<HASH> 100644 --- a/lib/fluent/plugin/output.rb +++ b/lib/fluent/plugin/output.rb @@ -1264,7 +1264,7 @@ module Fluent current_clock = Fluent::Clock.now interval = state.next_clock - current_clock - if state.next_clock <= current_clock && (!@retry || @retry_mutex.synchronize{ @retry.next_time } <= Time.now) + if state.next_clock <= current_clock && @retry_mutex.synchronize { @retry ? @retry.next_time <= Time.now : true } try_flush # next_flush_time uses flush_thread_interval or flush_thread_burst_interval (or retrying)
Fix race condition of retry state in flush thread This is simple solution but performance is bit decreased. The better solution is changing retry mechanizm but it makes the code complicated. This is feature task.
fluent_fluentd
train
rb
05cb09964f93ff18e842b9ff37b58e5688644bf8
diff --git a/libkbfs/disk_block_cache.go b/libkbfs/disk_block_cache.go index <HASH>..<HASH> 100644 --- a/libkbfs/disk_block_cache.go +++ b/libkbfs/disk_block_cache.go @@ -288,9 +288,14 @@ func (cache *DiskBlockCacheStandard) compactCachesLocked(ctx context.Context) { metaDb := cache.metaDb tlfDb := cache.tlfDb go func() { + cache.log.CDebugf(ctx, "+ Disk cache compaction starting.") + cache.log.CDebugf(ctx, "Compacting metadata db.") metaDb.CompactRange(util.Range{}) + cache.log.CDebugf(ctx, "Compacting TLF db.") tlfDb.CompactRange(util.Range{}) + cache.log.CDebugf(ctx, "Compacting block db.") blockDb.CompactRange(util.Range{}) + cache.log.CDebugf(ctx, "- Disk cache compaction complete.") // Give back the sentinel. cache.compactCh <- struct{}{} }()
disk_block_cache: Log all steps of disk block cache compaction.
keybase_client
train
go
0c452a6af886f2b722c3e68e59e287aa82bf8048
diff --git a/lib/Serverless.js b/lib/Serverless.js index <HASH>..<HASH> 100644 --- a/lib/Serverless.js +++ b/lib/Serverless.js @@ -80,7 +80,11 @@ class Serverless { return BbPromise.resolve(); } - // populate variables after --help, otherwise help may fail to print (https://github.com/serverless/serverless/issues/2041) + // make sure the command exists before doing anything else + this.pluginManager.validateCommand(this.processedInput.commands); + + // populate variables after --help, otherwise help may fail to print + // (https://github.com/serverless/serverless/issues/2041) this.variables.populateService(this.pluginManager.cliOptions); // trigger the plugin lifecycle when there's something which should be processed diff --git a/lib/classes/PluginManager.js b/lib/classes/PluginManager.js index <HASH>..<HASH> 100644 --- a/lib/classes/PluginManager.js +++ b/lib/classes/PluginManager.js @@ -150,6 +150,10 @@ class PluginManager { return BbPromise.reduce(hooks, (__, hook) => hook(), null); } + validateCommand(commandsArray) { + this.getCommand(commandsArray); + } + validateOptions(command) { _.forEach(command.options, (value, key) => { if (value.required && (this.cliOptions[key] === true || !(this.cliOptions[key]))) {
fix Verify that a command is valid before trying to populate variables
serverless_serverless
train
js,js
aebda33642614b5e3387556a1cb48058fd377de7
diff --git a/src/android/BranchSDK.java b/src/android/BranchSDK.java index <HASH>..<HASH> 100644 --- a/src/android/BranchSDK.java +++ b/src/android/BranchSDK.java @@ -246,7 +246,7 @@ public class BranchSDK extends CordovaPlugin result.put("data", installParams); - this.callbackContext.success(installParams); + this.callbackContext.success(result); }
[FIX] getFirstReferringParams not returning JSON object.
BranchMetrics_cordova-ionic-phonegap-branch-deep-linking
train
java
97adcfb723366d82d57e87b49da48c2e4b2b9d66
diff --git a/app/extensions/Redirector/extension.php b/app/extensions/Redirector/extension.php index <HASH>..<HASH> 100644 --- a/app/extensions/Redirector/extension.php +++ b/app/extensions/Redirector/extension.php @@ -91,7 +91,7 @@ class Extension extends BaseExtension public function initializeConfiguration() { // Get the routing.yml configuration - $this->routes = $this->app->config->get('routing'); + $this->routes = $this->app['config']->get('routing'); // Set the configuration defaults $config = array( @@ -270,7 +270,7 @@ class Extension extends BaseExtension // Merge global variables with those defined by the user $self->variables = array_merge($self->variables, array( - 'admin_path' => $app->config->get('general/branding/path'), + 'admin_path' => $app['config']->get('general/branding/path'), )); // Replace variables with actual data foreach ($self->variables as $variable => $data) {
Refactored out two 'old style' `$app->config` statements.
bolt_bolt
train
php
cd45f832d3854310c5d1a1c4f1a345f206a2f8ed
diff --git a/src/Jobs/Entity/Job.php b/src/Jobs/Entity/Job.php index <HASH>..<HASH> 100644 --- a/src/Jobs/Entity/Job.php +++ b/src/Jobs/Entity/Job.php @@ -17,7 +17,7 @@ use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM; /** * The job model * - * @ODM\Document(collection="jobs", repositoryClass="Jobs\Repository\Job") + * @ODM\Document(collection="jobs") */ class Job extends AbstractIdentifiableEntity implements JobInterface {
[Jobs] Refactor job repository and entities to make it work with new RepositoryService (references gh-<I>)
yawik_jobs
train
php
ce4086de41e72a6cba5a31117a7e9d91895fee49
diff --git a/spec/models/audit_rails/audit_spec.rb b/spec/models/audit_rails/audit_spec.rb index <HASH>..<HASH> 100644 --- a/spec/models/audit_rails/audit_spec.rb +++ b/spec/models/audit_rails/audit_spec.rb @@ -55,11 +55,11 @@ describe AuditRails::Audit do john = "John Smith" fake = "Fake User" audit = 3.times{ - AuditRails::Audit.create!(:action => action = "Visit", :user_name => john) - AuditRails::Audit.create!(:action => action = "login", :user_name => fake) + AuditRails::Audit.create!(:action => action = "visit", :user_name => john, :controller => 'home') + AuditRails::Audit.create!(:action => action = "login", :user_name => fake, :controller => 'session') } - AuditRails::Audit.analysis_by_page_views.should == {'login' => 3, 'Visit' => 3} + AuditRails::Audit.analysis_by_page_views.should == {['session', 'login'] => 3, ['home','visit'] => 3} end end
Fixed failing spec for controller-action name
gouravtiwari_audit_rails
train
rb
5ebc2783b845d29f33e62f897228e2fca86745eb
diff --git a/framework/directives/progress.js b/framework/directives/progress.js index <HASH>..<HASH> 100755 --- a/framework/directives/progress.js +++ b/framework/directives/progress.js @@ -6,6 +6,7 @@ * @description * [en]A material design progress component. Can be displayed both as a linear or circular progress indicator.[/en] * [ja]マテリアルデザインのprgoressコンポーネントです。linearもしくはcircularなプログレスインジケータを表示できます。[/ja] + * @codepen VvVaZv * @example * <ons-progress * type="circular"
docs(ons-progress): Add CodePen sample.
OnsenUI_OnsenUI
train
js
9434541090d41caf6ac6ca2030ca8653a65ef74b
diff --git a/src/_pytest/fixtures.py b/src/_pytest/fixtures.py index <HASH>..<HASH> 100644 --- a/src/_pytest/fixtures.py +++ b/src/_pytest/fixtures.py @@ -1021,6 +1021,7 @@ def fixture(scope="function", params=None, autouse=False, ids=None, name=None): :arg params: an optional list of parameters which will cause multiple invocations of the fixture function and all of the tests using it. + The current parameter is available in ``request.param``. :arg autouse: if True, the fixture func is activated for all tests that can see it. If False (the default) then an explicit
doc: mention that pytest.fixture's param is in request.param
pytest-dev_pytest
train
py
cf5489ad2e043b64f050fb9846ece654cb250571
diff --git a/bugwarrior/services/github.py b/bugwarrior/services/github.py index <HASH>..<HASH> 100644 --- a/bugwarrior/services/github.py +++ b/bugwarrior/services/github.py @@ -241,18 +241,18 @@ class GithubService(IssueService): self.get_owned_repo_issues(user + "/" + repo['name']) ) issues.update(self.get_directly_assigned_issues()) - log.name(self.target).debug(" Found {0} issues total.", len(issues)) + log.name(self.target).debug(" Found {0} issues.", len(issues)) issues = filter(self.include, issues.values()) - log.name(self.target).debug(" Pruned down to {0} issues", len(issues)) + log.name(self.target).debug(" Pruned down to {0} issues.", len(issues)) # Next, get all the pull requests (and don't prune by default) repos = filter(self.filter_repos_for_prs, all_repos) requests = sum([self._reqs(user + "/" + r['name']) for r in repos], []) - log.name(self.target).debug(" Found {0} pull requests", len(requests)) + log.name(self.target).debug(" Found {0} pull requests.", len(requests)) if self.filter_pull_requests: requests = filter(self.include, requests) log.name(self.target).debug( - " Pruned down to {0} pull requests", + " Pruned down to {0} pull requests.", len(requests) )
Cleaning up log messages to be slightly more consistent.
ralphbean_bugwarrior
train
py
e74df9db1b7b69d763161108f85b3fbe90c1a774
diff --git a/mpldatacursor.py b/mpldatacursor.py index <HASH>..<HASH> 100644 --- a/mpldatacursor.py +++ b/mpldatacursor.py @@ -237,13 +237,17 @@ class DataCursor(object): if event.artist in self.annotations.values(): return + ax = event.artist.axes # Get the pre-created annotation box for the axes or create a new one. if self.display != 'multiple': - annotation = self.annotations[event.artist.axes] + annotation = self.annotations[ax] + elif event.mouseevent in self.annotations: + # Avoid creating multiple datacursors for the same click event + # when several artists are selected. + annotation = self.annotations[event.mouseevent] else: - annotation = self.annotate(event.artist.axes, - **self._annotation_kwargs) - self.annotations[event.artist.axes] = annotation + annotation = self.annotate(ax, **self._annotation_kwargs) + self.annotations[event.mouseevent] = annotation if self.display == 'single': # Hide any other annotation boxes...
Fixed bug when multiple artists are selected with display="multiple".
joferkington_mpldatacursor
train
py
c644873c99c7b5ac4ba3810e14ffa2659a280d93
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/commands.js b/bundles/org.eclipse.orion.client.ui/web/orion/commands.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.ui/web/orion/commands.js +++ b/bundles/org.eclipse.orion.client.ui/web/orion/commands.js @@ -220,7 +220,7 @@ define([ } else { processKey(evt); } - }; + } function CommandsProxy() { this._init(); @@ -649,7 +649,7 @@ define([ node.classList.add("dropdownMenuItem"); //$NON-NLS-0$ if (addCheck) { var check = document.createElement("span"); //$NON-NLS-0$ - check.classList.add("check"); + check.classList.add("check"); //$NON-NLS-0$ check.appendChild(document.createTextNode(choice.checked ? "\u25CF" : "")); //$NON-NLS-1$ //$NON-NLS-0$ node.appendChild(check); }
cleanup warnings in commands.js
eclipse_orion.client
train
js
7c5f143c9d92dccc7cab6198829283456fe44a0c
diff --git a/salesforce/backend/introspection.py b/salesforce/backend/introspection.py index <HASH>..<HASH> 100644 --- a/salesforce/backend/introspection.py +++ b/salesforce/backend/introspection.py @@ -218,6 +218,7 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): if params['max_len'] > field['length']: field['length'] = params['max_len'] del params['max_len'] + optional_kw = {'collation': None} if DJANGO_32_PLUS else {} # We prefer "length" over "byteLength" for "internal_size". # (because strings have usually: byteLength == 3 * length) result.append(FieldInfo( # type:ignore[call-arg] # problem with a conditional type @@ -229,7 +230,9 @@ class DatabaseIntrospection(BaseDatabaseIntrospection): field['scale'], # scale, field['nillable'], # null_ok, params.get('default'), # default - params, + # 'collation' paramater is used only in Django >= 3.2. It is before 'params', but we pass it by **kw + params=params, + **optional_kw )) return result
Fix introspection with Django <I>
django-salesforce_django-salesforce
train
py
43218be8f19cb042b40c1c016d66f271c145def7
diff --git a/tests/runnerTest.js b/tests/runnerTest.js index <HASH>..<HASH> 100644 --- a/tests/runnerTest.js +++ b/tests/runnerTest.js @@ -388,6 +388,34 @@ describe('Runner process', function () { }]); }); }); + + describe('check test cases can be run through runner', function () { + var TestCase = require('../src/testCase'); + it('should be possible to run a TestCase', function(done) { + var called = false; + var Case2 = TestCase.extend({ + run: function (remote, desired, cb) { + called = true; + cb(); + } + }); + + run({ + skipCapabilitiesCheck: true, + browsers: [{ + browserName: "chrome", + version: 'latest' + }], + after: function (err) { + assert.equal(err.message, 'Errors where catched for this run.'); + done(); + } + }, + [ + new Case2() + ]); + }); + }); }); function setupConsoleResponse(statuscode) {
Add test to show that TestCase are not run through runner.
themouette_selenium-grid
train
js
2b41d1ab700987215a47f18729abbce59f45aab3
diff --git a/lib/SetupJelix16.php b/lib/SetupJelix16.php index <HASH>..<HASH> 100644 --- a/lib/SetupJelix16.php +++ b/lib/SetupJelix16.php @@ -32,7 +32,16 @@ class SetupJelix16 { $configDir = $this->parameters->getVarConfigDir(); // open the configuration file - $iniFileName = $this->parameters->getConfigFileName(); + // during upgrade of composer-module-setup, it seems Composer load some classes + // of the previous version (here ModuleSetup + JelixParameters), and load + // other classes (here SetupJelix16) after the upgrade. so API is not the one we expected. + // so we should check if the new method getConfigFileName is here + if (method_exists($this->parameters, 'getConfigFileName')) { + $iniFileName = $this->parameters->getConfigFileName(); + } + else { + $iniFileName = 'localconfig.ini.php'; + } if (!$iniFileName) { $iniFileName = 'localconfig.ini.php'; }
SetupJelix<I>: fix error during composer install about missing method During the upgrade of composer-module-setup, some classes of the previous version are already loaded and then may not contain new feature or new api, expected by the classes loaded after the source update. This why we add errors like Call to undefined method Jelix\ComposerPlugin\JelixParameters::getConfigFileName() during composer install/update.
jelix_composer-module-setup
train
php
abe2632b5da3a31f45b2e66efdcd1e0e5b3fd151
diff --git a/src/Model/NewsCategoryModel.php b/src/Model/NewsCategoryModel.php index <HASH>..<HASH> 100644 --- a/src/Model/NewsCategoryModel.php +++ b/src/Model/NewsCategoryModel.php @@ -144,7 +144,7 @@ WHERE {$relation['reference_field']} IN (SELECT id FROM tl_news WHERE pid IN (". // Determine the alias condition if (is_numeric($idOrAlias)) { $columns[] = "$t.id=?"; - $values[] = $idOrAlias; + $values[] = (int) $idOrAlias; } else { if (MultilingualHelper::isActive()) { $columns[] = '(t1.alias=? OR t2.alias=?)'; @@ -152,7 +152,7 @@ WHERE {$relation['reference_field']} IN (SELECT id FROM tl_news WHERE pid IN (". $values[] = $idOrAlias; } else { $columns[] = "$t.alias=?"; - $values[] = (int) $idOrAlias; + $values[] = $idOrAlias; } }
cast to int on correct variable …
codefog_contao-news_categories
train
php
bf9753c0f6cb8befbe6307c53d673ae588b2bd69
diff --git a/openpnm/geometry/StickAndBall2D.py b/openpnm/geometry/StickAndBall2D.py index <HASH>..<HASH> 100644 --- a/openpnm/geometry/StickAndBall2D.py +++ b/openpnm/geometry/StickAndBall2D.py @@ -175,7 +175,7 @@ class StickAndBall2D(GenericGeometry): self.add_model(propname='pore.seed', model=mods.misc.random, element='pore', - num_range=[0.5, 0.5], + num_range=[0.2, 0.7], seed=None) self.add_model(propname='pore.max_size',
Correct num_range of pore.seed model in 2D to be same as 3D class
PMEAL_OpenPNM
train
py
eee5c1fb595d0ffcbd462850e3de46fc3b6ffda2
diff --git a/public/js/core/tabExpander.js b/public/js/core/tabExpander.js index <HASH>..<HASH> 100644 --- a/public/js/core/tabExpander.js +++ b/public/js/core/tabExpander.js @@ -80,7 +80,7 @@ var tabExpander = (function($, window){ var tabContainerWidthPx = totalHeaderWidthPx - ( leftMenuWidthPx + rightMenuWidthPx ); // tabContainerWidthPercent = 99 - ( leftMenuWidthPercent + rightMenuWidthPercent); // tabContainerWidthPercent = 100.5 - ( leftMenuWidthPercent + rightMenuWidthPercent); - tabContainerWidthPercent = 113.8 - ( leftMenuWidthPercent + rightMenuWidthPercent); + tabContainerWidthPercent = 113.5 - ( leftMenuWidthPercent + rightMenuWidthPercent); // <ul> navUlContainer = 1;
revision 2 on fixed issue: <I>
melisplatform_melis-core
train
js
c9b8bc6b5412b0a3ad08556e2a6fa655bb53efb7
diff --git a/builder/osc/bsusurrogate/builder_acc_test.go b/builder/osc/bsusurrogate/builder_acc_test.go index <HASH>..<HASH> 100644 --- a/builder/osc/bsusurrogate/builder_acc_test.go +++ b/builder/osc/bsusurrogate/builder_acc_test.go @@ -39,8 +39,7 @@ const testBuilderAccBasic = ` "device_name" : "/dev/xvdf", "delete_on_vm_deletion" : false, "volume_size" : 10, - "iops": 300, - "no_device": 0 + "iops": 300 } ], "omi_root_device":{
fix: typo in bsusurrogate acc test
hashicorp_packer
train
go
5b25ca8e078c101b02c6686fc37090467f1d4067
diff --git a/modules/logging.js b/modules/logging.js index <HASH>..<HASH> 100644 --- a/modules/logging.js +++ b/modules/logging.js @@ -11,7 +11,7 @@ module.exports = { initMaster: function(config) { var logStream = process.stdout; - if(config.logging) + if(config.logging && config.logging.logFile) logStream = fs.createWriteStream(config.logging.logFile, {'flags': 'a'}); process.on('msg:log', function(data) {
Fix running logging without logFile.
virtkick_http-master
train
js
f16cc5e9df0526b260e93587251e926b62a9e35e
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ See https://github.com/eandersson/amqp-storm for more information. """ setup(name='AMQP-Storm', - version='1.0.4', + version='1.0.5', description='Thread-safe Python AMQP Client Library based on pamqp.', long_description=long_description, author='Erik Olof Gunnar Andersson',
Bumping to <I> on pypi.
eandersson_amqpstorm
train
py
759ff8124465675c87ec8e5f3db3148daef6958c
diff --git a/service/src/main/java/org/ops4j/pax/wicket/internal/injection/AbstractProxyTargetLocator.java b/service/src/main/java/org/ops4j/pax/wicket/internal/injection/AbstractProxyTargetLocator.java index <HASH>..<HASH> 100644 --- a/service/src/main/java/org/ops4j/pax/wicket/internal/injection/AbstractProxyTargetLocator.java +++ b/service/src/main/java/org/ops4j/pax/wicket/internal/injection/AbstractProxyTargetLocator.java @@ -67,8 +67,8 @@ public abstract class AbstractProxyTargetLocator<Container> implements IProxyTar throw new IllegalStateException("not possible", e); } if (references == null || references.length == 0) { - throw new IllegalStateException(String.format("Found %s service references for %s; this is not OK...", - references.length, bundleContext.getBundle().getSymbolicName())); + throw new IllegalStateException(String.format("Found zero service references for %s; this is not OK...", + bundleContext.getBundle().getSymbolicName())); } try { Thread.currentThread().setContextClassLoader(parent.getClassLoader());
[PAXWICKET-<I>] NPE during bean resolvement failure handling This one was an especially pitty one since the NPE was thrown during the creation of the error message hiding the real problem. Many
ops4j_org.ops4j.pax.wicket
train
java
587c2151e1cc1749b0adad60be5a903ec76236a9
diff --git a/lib/lesshint.js b/lib/lesshint.js index <HASH>..<HASH> 100644 --- a/lib/lesshint.js +++ b/lib/lesshint.js @@ -133,7 +133,7 @@ Lesshint.prototype.getReporter = function (reporter) { var reporterPath; // Nothing defined, just fall back to our simple default - if (!reporter) { + if (!reporter || reporter === 'default') { reporterPath = path.resolve(__dirname, './reporters/default'); return require(reporterPath);
Allowed for 'default' reporter as explicit fallback (#<I>) Fixes #<I>.
lesshint_lesshint
train
js
db3ee9ee8931e51af7158114b9d02bf93d1a7811
diff --git a/leveldb/storage/file_storage_unix.go b/leveldb/storage/file_storage_unix.go index <HASH>..<HASH> 100644 --- a/leveldb/storage/file_storage_unix.go +++ b/leveldb/storage/file_storage_unix.go @@ -67,9 +67,14 @@ func isErrInvalid(err error) bool { if err == os.ErrInvalid { return true } + // Go < 1.8 if syserr, ok := err.(*os.SyscallError); ok && syserr.Err == syscall.EINVAL { return true } + // Go >= 1.8 returns *os.PathError instead + if patherr, ok := err.(*os.PathError); ok && patherr.Err == syscall.EINVAL { + return true + } return false }
leveldb/storage: catch EINVAL on go >= <I> too (#<I>) In go <I>, various functions were updated to return PathError instead. This includes `os.File Sync()`. For reference, the upstream commit which made this change is <URL>
syndtr_goleveldb
train
go
729244922cb9d3d7662da4a75e0cb6320ecfb202
diff --git a/src/server/pps/server/api_server.go b/src/server/pps/server/api_server.go index <HASH>..<HASH> 100644 --- a/src/server/pps/server/api_server.go +++ b/src/server/pps/server/api_server.go @@ -757,6 +757,8 @@ func (a *apiServer) CreatePipeline(ctx context.Context, request *ppsclient.Creat return nil, fmt.Errorf("pipeline %v already exists", request.Pipeline.Name) } + setDefaultPipelineInputMethod(request.Inputs) + if request.Pipeline == nil { return nil, fmt.Errorf("pachyderm.ppsclient.pipelineserver: request.Pipeline cannot be nil") }
Didn't mean to remove this line
pachyderm_pachyderm
train
go
21c153912929adca0309be7b006942a8a8179121
diff --git a/config.js b/config.js index <HASH>..<HASH> 100644 --- a/config.js +++ b/config.js @@ -160,6 +160,7 @@ module.exports = { comments: /^!|@preserve|@license|@cc_on/i } }, + sourcemaps: true, folders: ['js', 'ts'], ignoreList: [] }, diff --git a/pumps/uglify.js b/pumps/uglify.js index <HASH>..<HASH> 100644 --- a/pumps/uglify.js +++ b/pumps/uglify.js @@ -7,7 +7,7 @@ module.exports = { return [ config.uglify.sourcemaps ? sourcemaps.init() : noop(), uglify(config.uglify.options), - config.uglify.sourcemaps ? sourcemaps.write() : noop() + config.uglify.sourcemaps ? sourcemaps.write('./') : noop() ]; } }; \ No newline at end of file
write js maps to js build directory by default
biotope_biotope-build
train
js,js
a8b0f3febb084209becab1ee8d91f40cf382536c
diff --git a/src/js/build-html.js b/src/js/build-html.js index <HASH>..<HASH> 100644 --- a/src/js/build-html.js +++ b/src/js/build-html.js @@ -145,7 +145,7 @@ module.exports = function(options) { && document.querySelector(options.tocSelector) !== null && headings.length > 0) { some.call(headings, function(heading, i) { - if (heading.offsetTop > top + options.headingsOffset) { + if (heading.offsetTop > top + options.headingsOffset + 1) { // Don't allow negative index value. var index = (i === 0) ? i : i - 1; topHeader = headings[index];
Make current section highlighted instead of previous (#<I>) When I go directly to a link, it highlights the link before the one I am visiting. I put some console.log() statements in and it looks like it's some sub-pixel rounding problem? I experience the issue on my own site and also the official tocbot docs page, in both chromium and firefox (on linux). This patch fixes the issue for my site in both browsers.
tscanlin_tocbot
train
js
6584bc207aae82173db2c48825c956f4f6a0e203
diff --git a/src/SleepingOwl/Models/Traits/ModelWithImageOrFileFieldsTrait.php b/src/SleepingOwl/Models/Traits/ModelWithImageOrFileFieldsTrait.php index <HASH>..<HASH> 100644 --- a/src/SleepingOwl/Models/Traits/ModelWithImageOrFileFieldsTrait.php +++ b/src/SleepingOwl/Models/Traits/ModelWithImageOrFileFieldsTrait.php @@ -243,7 +243,7 @@ trait ModelWithImageOrFileFieldsTrait } } } - if (preg_match('/get(?<field>[a-zA-Z]+)Attribute/', $method, $attr)) + if (preg_match('/get(?<field>[a-zA-Z0-9]+)Attribute/', $method, $attr)) { $fields = [Str::lower($attr['field']), Str::camel($attr['field']), Str::snake($attr['field'])]; foreach ($fields as $field)
Fix: file fields were not working for field names containing numbers
sleeping-owl_admin
train
php
ed68598c3a48d8259874070bcdfc0a593c55b75d
diff --git a/tests/integration/pybaseball/test_statcast_batter.py b/tests/integration/pybaseball/test_statcast_batter.py index <HASH>..<HASH> 100644 --- a/tests/integration/pybaseball/test_statcast_batter.py +++ b/tests/integration/pybaseball/test_statcast_batter.py @@ -4,13 +4,13 @@ from pybaseball.statcast_batter import statcast_batter, statcast_batter_exitvelo def test_statcast_batter_exitvelo_barrels() -> None: - result: pd.DataFrame = statcast_batter_exitvelo_barrels(2019) + result: pd.DataFrame = statcast_batter_exitvelo_barrels(2019, 250) assert result is not None assert not result.empty assert len(result.columns) == 19 - assert len(result) == 135 + assert len(result) == 175 def test_statcast_batter() -> None:
Fix statcast exitvelo tests, and use our own qualifier (#<I>)
jldbc_pybaseball
train
py
2c5a5e78ba2c589c40f2ee4643dfca9d1c722bd7
diff --git a/packages/uikit-workshop/src/scripts/components/pl-nav/pl-nav.js b/packages/uikit-workshop/src/scripts/components/pl-nav/pl-nav.js index <HASH>..<HASH> 100644 --- a/packages/uikit-workshop/src/scripts/components/pl-nav/pl-nav.js +++ b/packages/uikit-workshop/src/scripts/components/pl-nav/pl-nav.js @@ -212,7 +212,8 @@ class Nav extends BaseComponent { if ( e.target.closest('.pl-c-nav') === null && e.target.closest('.pl-js-nav-trigger') === null && - e.target.closest('svg') === null + e.target.closest('svg') === null && + e.target.closest('pl-toggle-layout') === null ) { self.cleanupActiveNav(); }
fix: don't auto-close nav when clicking on a nav toggle
bolt-design-system_bolt
train
js
15fd27967b0432da76d7ff6027419b397f3da22e
diff --git a/lib/service.js b/lib/service.js index <HASH>..<HASH> 100644 --- a/lib/service.js +++ b/lib/service.js @@ -1914,6 +1914,15 @@ var entityNamespace = utils.namespaceFromProperties(props); return new root.AlertGroup(this.service, props.name, entityNamespace); }, + + /** + * Suppress removing alerts via the fired alerts endpoint. + * + * @method splunkjs.Service.FiredAlerts + */ + remove: function() { + throw new Error("To remove an alert, remove the saved search with the same name."); + }, /** * Constructor for `splunkjs.Service.FiredAlerts`. @@ -1932,6 +1941,7 @@ this._super(service, this.path(), namespace); this.instantiateEntity = utils.bind(this, this.instantiateEntity); + this.remove = utils.bind(this, this.remove); } });
Suppress remove for firedAlerts
splunk_splunk-sdk-javascript
train
js
f1f4a60d2b5d5c8f279769a950f377d77fdd3855
diff --git a/wulaphp/router/DefaultDispatcher.php b/wulaphp/router/DefaultDispatcher.php index <HASH>..<HASH> 100644 --- a/wulaphp/router/DefaultDispatcher.php +++ b/wulaphp/router/DefaultDispatcher.php @@ -33,7 +33,7 @@ class DefaultDispatcher implements IURLDispatcher { public function dispatch($url, $router, $parsedInfo) { //检测请求是否合法 $strict_mode = @constant('URL_STRICT_MODE'); - if (($strict_mode || is_null($strict_mode)) && substr($router->requestURI, -1, 1) == '/') { + if (($strict_mode || is_null($strict_mode)) && $router->requestURI != '/' && substr($router->requestURI, -1, 1) == '/') { return null; }
Fix "/" url cannot route bug
ninggf_wulaphp
train
php
dc54322328156d3e22bb4dfbeec5ca9a8c40a718
diff --git a/aiida_codtools/cli/misc/cif_import.py b/aiida_codtools/cli/misc/cif_import.py index <HASH>..<HASH> 100644 --- a/aiida_codtools/cli/misc/cif_import.py +++ b/aiida_codtools/cli/misc/cif_import.py @@ -43,7 +43,7 @@ from aiida.utils.cli import options help='Optional API url for the database' ) @click.option( - '-a', '--importer-api-key', type=click.STRING, required=False, + '-k', '--importer-api-key', type=click.STRING, required=False, help='Optional API key for the database' ) @click.option(
Rename API key flag to -k for cif import launch script The -a flag should usually be reserved for something like --all
aiidateam_aiida-codtools
train
py
be7eae7d9f64b05a564a99207385be93502be9d4
diff --git a/lib/puppet/pops/validation/checker3_1.rb b/lib/puppet/pops/validation/checker3_1.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/pops/validation/checker3_1.rb +++ b/lib/puppet/pops/validation/checker3_1.rb @@ -260,15 +260,12 @@ class Puppet::Pops::Validation::Checker3_1 top(o.eContainer, o) end - # Asserts that value is a valid QualifiedName. No additional checking is made, objects that use - # a QualifiedName as a name should check the validity - this since a QualifiedName is used as a BARE WORD - # and then additional chars may be valid (like a hyphen). + # No checking takes place - all expressions using a QualifiedName need to check. This because the + # rules are slightly different depending on the container (A variable allows a numeric start, but not + # other names). This means that (if the lexer/parser so chooses) a QualifiedName + # can be anything when it represents a Bare Word and evaluates to a String. # def check_QualifiedName(o) - # Is this a valid qualified name? - if o.value !~ Puppet::Pops::Patterns::NAME - acceptor.accept(Issues::ILLEGAL_NAME, o, {:name=>o.value}) - end end # Checks that the value is a valid UpperCaseWord (a CLASSREF), and optionally if it contains a hypen.
(PUP-<I>) Make future parser accept $_private This removes validation of QualifiedName (they must be validated differently depending on where they appear). Variables were bit by this too restrictive validation rule.
puppetlabs_puppet
train
rb
7e924348c6ffdb4833d38731d845a9128359c39e
diff --git a/Neos.Neos/Classes/Controller/Module/Administration/UsersController.php b/Neos.Neos/Classes/Controller/Module/Administration/UsersController.php index <HASH>..<HASH> 100644 --- a/Neos.Neos/Classes/Controller/Module/Administration/UsersController.php +++ b/Neos.Neos/Classes/Controller/Module/Administration/UsersController.php @@ -402,7 +402,11 @@ class UsersController extends AbstractModuleController }); $roles = $this->userService->currentUserIsAdministrator() ? $this->policyService->getRoles() : $currentUserRoles; - sort($roles); + + usort($roles, static function (Role $a, Role $b) { + return strcmp($a->getName(), $b->getName()); + }); + return $roles; }
TASK: Correctly sort roles by name
neos_neos-development-collection
train
php
5af760691a9c4b06f0296fb5f0036fc129567323
diff --git a/slacker/__init__.py b/slacker/__init__.py index <HASH>..<HASH> 100644 --- a/slacker/__init__.py +++ b/slacker/__init__.py @@ -600,7 +600,7 @@ class Files(BaseAPI): } if file_: - if type(file_) in types.StringTypes: + if isinstance(file_, str): file_ = open(file_, 'rb') return self.post('files.upload', data=data, files={'file': file_}) else:
Replace `types.StringTypes` with `isinstance` As `types.StringTypes` is not available in Python 3+
os_slacker
train
py
62d30e05832db1fbb70013e33456b03c0c5d5a6a
diff --git a/examples/language-modeling/run_clm.py b/examples/language-modeling/run_clm.py index <HASH>..<HASH> 100644 --- a/examples/language-modeling/run_clm.py +++ b/examples/language-modeling/run_clm.py @@ -102,8 +102,8 @@ class DataTrainingArguments: default=None, metadata={"help": "An optional input evaluation data file to evaluate the perplexity on (a text file)."}, ) - block_size: int = field( - default=-1, + block_size: Optional[int] = field( + default=None, metadata={ "help": "Optional input sequence length after tokenization." "The training dataset will be truncated in block of this size for training." @@ -261,8 +261,14 @@ def main(): load_from_cache_file=not data_args.overwrite_cache, ) - if data_args.block_size <= 0: + if data_args.block_size is None: block_size = tokenizer.model_max_length + if block_size > 1024: + logger.warn( + f"The tokenizer picked seems to have a very large `model_max_length` ({tokenizer.model_max_length}). " + "Picking 1024 instead. You can change that default value by passing --block_size xxx." + ) + block_size = 1024 else: if data_args.block_size > tokenizer.model_max_length: logger.warn(
Small fix to the run clm script (#<I>)
huggingface_pytorch-pretrained-BERT
train
py
fa8f5644d6cff6e54442ea7bce949b0e7da97b4c
diff --git a/lib/extensions/mspec/mspec/runner/mspec.rb b/lib/extensions/mspec/mspec/runner/mspec.rb index <HASH>..<HASH> 100644 --- a/lib/extensions/mspec/mspec/runner/mspec.rb +++ b/lib/extensions/mspec/mspec/runner/mspec.rb @@ -6,6 +6,7 @@ module MSpec #RHO @count = 0 @exc_count = 0 + @exc_locations = [] #RHO @exit = nil @@ -43,6 +44,10 @@ module MSpec def self.count @count end + + def self.exc_locations + @exc_locations + end #RHO def self.describe(mod, options=nil, &block) @@ -63,6 +68,7 @@ module MSpec #RHO @count = 0 @exc_count = 0 + @exc_locations = [] #RHO STDOUT.puts RUBY_DESCRIPTION @@ -133,6 +139,7 @@ module MSpec #RHO puts "FAIL: #{current} - #{exc.message}\n" + (@backtrace ? exc.backtrace.join("\n") : "") + @exc_locations << { 'message' => exc.message, 'backtrace' => exc.backtrace } @exc_count+=1 #RHO
include fail locations info into mspec results
rhomobile_rhodes
train
rb
9cc57cadf8ae622041aea3f8abce860288bca04a
diff --git a/src/main/java/com/linuxense/javadbf/DBFWriter.java b/src/main/java/com/linuxense/javadbf/DBFWriter.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/linuxense/javadbf/DBFWriter.java +++ b/src/main/java/com/linuxense/javadbf/DBFWriter.java @@ -155,9 +155,12 @@ public class DBFWriter extends DBFBase implements java.io.Closeable { this.header.read(this.raf, charset); setCharset(this.header.getUsedCharset()); - /* position file pointer at the end of the raf */ + // position file pointer at the end of the raf // to ignore the END_OF_DATA byte at EoF - this.raf.seek(this.raf.length() - 1); + // only if there are records, + if (this.raf.length() > header.headerLength) { + this.raf.seek(this.raf.length() - 1); + } } catch (FileNotFoundException e) { throw new DBFException("Specified file is not found. " + e.getMessage(), e); } catch (IOException e) {
Fix bug writting in "Sync Mode" to files with only the header
albfernandez_javadbf
train
java
e0631d681091b35af6f0ec373762baf40af45a31
diff --git a/lib/active_record/connection_adapters/oracle_enhanced/database_statements.rb b/lib/active_record/connection_adapters/oracle_enhanced/database_statements.rb index <HASH>..<HASH> 100644 --- a/lib/active_record/connection_adapters/oracle_enhanced/database_statements.rb +++ b/lib/active_record/connection_adapters/oracle_enhanced/database_statements.rb @@ -76,12 +76,6 @@ module ActiveRecord select_values("SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY)", "EXPLAIN").join("\n") end - # Returns an array of arrays containing the field values. - # Order is the same as that returned by #columns. - def select_rows(sql, name = nil, binds = []) - exec_query(sql, name, binds).rows - end - # New method in ActiveRecord 3.1 # Will add RETURNING clause in case of trigger generated primary keys def sql_for_insert(sql, pk, id_value, sequence_name, binds)
Use Abstract `select_rows(arel, name = nil, binds = [])` Refer rails/rails#<I>
rsim_oracle-enhanced
train
rb
db1b30df5b2b6546734c3767fa37f8a378c41bbd
diff --git a/primus.js b/primus.js index <HASH>..<HASH> 100644 --- a/primus.js +++ b/primus.js @@ -458,7 +458,7 @@ Primus.prototype.initialise = function initialise(options) { } primus.latency = +new Date() - start; - primus.timers.clear('ping, pong'); + primus.timers.clear('ping', 'pong'); primus.heartbeat(); if (primus.buffer.length) {
[fix] Undo the broken clear.
primus_primus
train
js
b5f1b799ddfd684245ca6b86e474f17bd0ee8fb4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -136,7 +136,7 @@ _recommended = [ 'datashader', 'geopandas', 'gdal', 'libgdal', # TODO: doesn't gdal depend on libgdal? remove? - 'netcdf4', # TODO: currently needed for libgdal on defaults (but not c-f) + 'netcdf4 <1.4.0', # TODO: currently needed for libgdal on defaults (but not c-f) 'jupyter', 'matplotlib', 'pandas',
Pinned netcdf to avoid netcdftime errors
pyviz_geoviews
train
py
c01a07eddf64936d76fc06e44b1b4e9a1c107ee1
diff --git a/web/static/js/controllers/DeployWizard.js b/web/static/js/controllers/DeployWizard.js index <HASH>..<HASH> 100644 --- a/web/static/js/controllers/DeployWizard.js +++ b/web/static/js/controllers/DeployWizard.js @@ -153,7 +153,15 @@ function DeployWizard($scope, resourcesService) { }; $scope.wizard_finish = function() { + + closeModal = function(){ + $('#addApp').modal('hide'); + $("#deploy-save-button").removeAttr("disabled"); + resetStepPage(); + } + $("#deploy-save-button").toggleClass('active'); + $("#deploy-save-button").attr("disabled", "disabled"); nextClicked = true; if ($scope.steps[step].validate) { @@ -192,12 +200,8 @@ function DeployWizard($scope, resourcesService) { } }); - $('#addApp').modal('hide'); - resetStepPage(); - }, function(result){ - $('#addApp').modal('hide'); - resetStepPage(); - } + closeModal(); + }, closeModal ); }
refactor close modal and disable save button after it's clicked.
control-center_serviced
train
js
d4a975b59b4276dbda91c7d3e03a4123b377ee2e
diff --git a/lib/geos_extensions.rb b/lib/geos_extensions.rb index <HASH>..<HASH> 100644 --- a/lib/geos_extensions.rb +++ b/lib/geos_extensions.rb @@ -16,7 +16,7 @@ module Geos autoload :ActiveRecord, File.join(GEOS_EXTENSIONS_BASE, 'active_record_extensions') autoload :GoogleMaps, File.join(GEOS_EXTENSIONS_BASE, 'google_maps') - REGEXP_WKT = /^(?:SRID=([0-9]+);)?(\s*[PLMCG].+)/i + REGEXP_WKT = /^(?:SRID=(-?[0-9]+);)?(\s*[PLMCG].+)/i REGEXP_WKB_HEX = /^[A-Fa-f0-9\s]+$/ REGEXP_G_LAT_LNG_BOUNDS = /^ \(
Allow for negative SRIDs.
dark-panda_geos-extensions
train
rb
be87ff65b1e372476483fb577fb79ef261113d6b
diff --git a/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizerParameterizer.java b/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizerParameterizer.java index <HASH>..<HASH> 100644 --- a/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizerParameterizer.java +++ b/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizerParameterizer.java @@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.visualization; This file is part of ELKI: Environment for Developing KDD-Applications Supported by Index-Structures - Copyright (C) 2014 + Copyright (C) 2015 Ludwig-Maximilians-Universität München Lehr- und Forschungseinheit für Datenbanksysteme ELKI Development Team @@ -95,8 +95,6 @@ public class VisualizerParameterizer { * These are {@code *.properties} files in the package * {@link de.lmu.ifi.dbs.elki.visualization.style}. * </p> - * - * */ public static final OptionID STYLELIB_ID = new OptionID("visualizer.stylesheet", "Style properties file to use, included properties: classic, default, greyscale, neon, presentation, print");
Minimize changes here, too.
elki-project_elki
train
java
47d607082a8d8f3f33a41d1b5b224080ed0e6690
diff --git a/src/Adapter/Sqlite.php b/src/Adapter/Sqlite.php index <HASH>..<HASH> 100644 --- a/src/Adapter/Sqlite.php +++ b/src/Adapter/Sqlite.php @@ -22,7 +22,12 @@ class Sqlite extends DabbleAdapter $password = null, array $options = [] ) { - return parent::__construct("sqlite:$d", $n, $p, $o); + return parent::__construct( + "sqlite:$dsn", + $username, + $password, + $ooptions + ); } public function value($value, &$bind)
ehm, renamed
monomelodies_dabble
train
php
966de2e1a416dba63774eeda46130e388fd32017
diff --git a/lib/sunspot/queue/helpers.rb b/lib/sunspot/queue/helpers.rb index <HASH>..<HASH> 100644 --- a/lib/sunspot/queue/helpers.rb +++ b/lib/sunspot/queue/helpers.rb @@ -7,7 +7,7 @@ module Sunspot::Queue # Pop off the queueing proxy for the block if it's in place so we don't # requeue the same job multiple times. - if Sunspot.session.instance_of?(SessionProxy) + if Sunspot.session.is_a?(SessionProxy) proxy = Sunspot.session Sunspot.session = proxy.session end
Allow subclasses of Sunspot::Queue::SessionProxy in without_proxy helper To be able to customize the behaviour of the SessionProxy in your own application, you should be able to subclass it. This changes the without_proxy helper method to allow subclasses as well.
gaffneyc_sunspot-queue
train
rb
f2c85187731db79efdf2fee2cac9579ba5102399
diff --git a/spec/uploader/direct_url_spec.rb b/spec/uploader/direct_url_spec.rb index <HASH>..<HASH> 100644 --- a/spec/uploader/direct_url_spec.rb +++ b/spec/uploader/direct_url_spec.rb @@ -28,7 +28,7 @@ describe CarrierWaveDirect::Uploader::DirectUrl do end context "#key is set to '#{sample(:path_with_escaped_chars)}'" do - before { subject.key = escaped_path } + before { subject.key = sample(:path_with_escaped_chars) } it "should return the full url with '/#{sample(:path_with_escaped_chars)}' as the path" do direct_fog_url = CarrierWave::Storage::Fog::File.new(
Update for removal of let() helper
dwilkie_carrierwave_direct
train
rb
ed30ed79c205cd1fd9f763fefe3f8afa62e57b92
diff --git a/src/DebugBar/Resources/widgets.js b/src/DebugBar/Resources/widgets.js index <HASH>..<HASH> 100644 --- a/src/DebugBar/Resources/widgets.js +++ b/src/DebugBar/Resources/widgets.js @@ -48,7 +48,7 @@ if (typeof(PhpDebugBar) == 'undefined') { */ var highlight = PhpDebugBar.Widgets.highlight = function(code, lang) { if (typeof(code) === 'string') { - if (!hljs) { + if (typeof(hljs) === 'undefined') { return htmlize(code); } if (lang) { @@ -57,7 +57,7 @@ if (typeof(PhpDebugBar) == 'undefined') { return hljs.highlightAuto(code).value; } - if (hljs) { + if (typeof(hljs) === 'object') { code.each(function(i, e) { hljs.highlightBlock(e); }); } return code;
Check if hljs is defined Really fixes #<I> and #<I>
maximebf_php-debugbar
train
js
a56c9a95553316a88c040539fc722c46fdbad256
diff --git a/tests/db/fields_test.py b/tests/db/fields_test.py index <HASH>..<HASH> 100644 --- a/tests/db/fields_test.py +++ b/tests/db/fields_test.py @@ -162,3 +162,12 @@ class OqNullBooleanFieldTestCase(unittest.TestCase): for fc in false_cases: self.assertEqual(False, field.to_python(fc)) + + +class NullFloatFieldTestCase(unittest.TestCase): + + def test_get_prep_value_empty_str(self): + field = fields.NullFloatField() + self.assertIsNone(field.get_prep_value('')) + self.assertIsNone(field.get_prep_value(' ')) + self.assertIsNone(field.get_prep_value('\t'))
tests/db/fields_test: Added tests for NullFloatField.
gem_oq-engine
train
py
4ca27f48110ffe00aa99766d0c20e2ab75a75038
diff --git a/pyvista/utilities/reader.py b/pyvista/utilities/reader.py index <HASH>..<HASH> 100644 --- a/pyvista/utilities/reader.py +++ b/pyvista/utilities/reader.py @@ -1223,7 +1223,7 @@ class CGNSReader(BaseReader, PointCellDataSelection): """Return or set using an unsteady pattern. When set to ``True`` (default is ``False``), the reader will try to - determine to determine FlowSolution_t nodes to read with a pattern + determine FlowSolution_t nodes to read with a pattern matching This can be useful for unsteady solutions when FlowSolutionPointers are not reliable.
Fix typo (#<I>)
vtkiorg_vtki
train
py
f11ca4b16bd20e248c183570501a0885988427e1
diff --git a/app/Http/Controllers/SetupController.php b/app/Http/Controllers/SetupController.php index <HASH>..<HASH> 100644 --- a/app/Http/Controllers/SetupController.php +++ b/app/Http/Controllers/SetupController.php @@ -161,8 +161,21 @@ class SetupController extends AbstractBaseController return $this->step3DatabaseType($data); } - if ($data['dbtype'] === 'sqlite' && $data['dbname'] === '') { - $data['dbname'] ='webtrees'; + switch ($data['dbtype']) { + case 'sqlite': + $data['warnings'][] = I18N::translate('SQLite is only suitable for small sites, testing and evaluation.'); + if ($data['dbname'] === '') { + $data['dbname'] ='webtrees'; + } + break; + case 'pgsql': + $data['warnings'][] = I18N::translate('Support for PostgreSQL is experimental.\') . \' \' . I18N::translate(\'Please report any problems to the developers.'); + break; + + case 'sqlsvr': + $data['warnings'][] = I18N::translate('Support for SQL Server is experimental.') . ' ' . I18N::translate('Please report any problems to the developers.'); + break; + } return $this->viewResponse('setup/step-4-database-' . $data['dbtype'], $data);
Add warnings for PostgreSQL and SQL Server
fisharebest_webtrees
train
php
7520edee2ea3bc13f30c0beb943036116d547080
diff --git a/evergreen/core/utils.py b/evergreen/core/utils.py index <HASH>..<HASH> 100644 --- a/evergreen/core/utils.py +++ b/evergreen/core/utils.py @@ -54,7 +54,7 @@ class Result(object): if self._exc == self._value == Null: self._cond.wait() if self._exc != Null: - raise exc + raise self._exc assert self._value != Null return self._value finally:
Fixed raising exception in Result.get
saghul_evergreen
train
py
e8d7b5ae6d0c3d0c5f558ba038ea738d9955cd67
diff --git a/lib/instana/version.rb b/lib/instana/version.rb index <HASH>..<HASH> 100644 --- a/lib/instana/version.rb +++ b/lib/instana/version.rb @@ -1,4 +1,4 @@ module Instana - VERSION = "1.10.4" + VERSION = "1.10.5" VERSION_FULL = "instana-#{VERSION}" end
Bump gem version to <I>
instana_ruby-sensor
train
rb
a57eefa91f0fc407b2a7daf7989d285d6768207b
diff --git a/src/AbstractUri.php b/src/AbstractUri.php index <HASH>..<HASH> 100644 --- a/src/AbstractUri.php +++ b/src/AbstractUri.php @@ -290,7 +290,7 @@ abstract class AbstractUri implements UriInterface * * @since 1.0 */ - public function isSSL() + public function isSsl() { return $this->getScheme() == 'https' ? true : false; }
[codestyle] Fixed first letter casing in method names
joomla-framework_uri
train
php
3289c2e78cb1af4bf1d60e5f995c6eace0377161
diff --git a/recipe/laravel.php b/recipe/laravel.php index <HASH>..<HASH> 100644 --- a/recipe/laravel.php +++ b/recipe/laravel.php @@ -8,7 +8,13 @@ require_once __DIR__ . '/common.php'; // Laravel shared dirs -set('shared_dirs', ['storage']); +set('shared_dirs', [ + 'storage/app', + 'storage/framework/cache', + 'storage/framework/sessions', + 'storage/framework/views', + 'storage/framework/logs', +]); // Laravel 5 shared file set('shared_files', ['.env']);
Updated laravel shared dirs
deployphp_deployer
train
php
a59871a8c68427effb000471779be3aec74a91bc
diff --git a/IndexSchema.php b/IndexSchema.php index <HASH>..<HASH> 100644 --- a/IndexSchema.php +++ b/IndexSchema.php @@ -1,7 +1,7 @@ <?php /** * @link http://www.yiiframework.com/ - * @copyright Copyright &copy; 2008-2011 Yii Software LLC + * @copyright Copyright (c) 2008 Yii Software LLC * @license http://www.yiiframework.com/license/ */
fixed file PHPdoc issue #<I>
yiisoft_yii2-sphinx
train
php
accabbcbdfb6efed166666fb4d6ad562c77db461
diff --git a/app/controllers/para/admin/resources_controller.rb b/app/controllers/para/admin/resources_controller.rb index <HASH>..<HASH> 100644 --- a/app/controllers/para/admin/resources_controller.rb +++ b/app/controllers/para/admin/resources_controller.rb @@ -49,7 +49,7 @@ module Para def destroy resource.destroy flash_message(:success, resource) - redirect_to @component.path + redirect_to after_form_submit_path end def order diff --git a/lib/para/markup/resources_table.rb b/lib/para/markup/resources_table.rb index <HASH>..<HASH> 100644 --- a/lib/para/markup/resources_table.rb +++ b/lib/para/markup/resources_table.rb @@ -169,7 +169,7 @@ module Para end def delete_button(resource) - path = component.relation_path(resource) + path = component.relation_path(resource, return_to: view.request.fullpath) options = { method: :delete, @@ -178,7 +178,7 @@ module Para }, class: 'btn btn-sm btn-icon-danger btn-shadow hint--left', aria: { - label: ::I18n.t('para.shared.destroy') + label: ::I18n.t('para.shared.destroy') } }
make resource deletion return to the referer page instead of table index
para-cms_para
train
rb,rb
29d1a678c465a15ebd85c0f781bd214985cd15ad
diff --git a/Swat/SwatCascadeFlydown.php b/Swat/SwatCascadeFlydown.php index <HASH>..<HASH> 100644 --- a/Swat/SwatCascadeFlydown.php +++ b/Swat/SwatCascadeFlydown.php @@ -195,7 +195,7 @@ class SwatCascadeFlydown extends SwatFlydown protected function getParentValue() { return ($this->cascade_from instanceof SwatFlydown) ? - $this->cascade_from->value : 'null'; + $this->cascade_from->value : null; } // }}}
not sure what possesed me to return null as a string. This was only broken for one commit, and no releases. svn commit r<I>
silverorange_swat
train
php
df55c2b9b123e09d0c170a9b1204d3426e302e53
diff --git a/src/transformers/generation_logits_process.py b/src/transformers/generation_logits_process.py index <HASH>..<HASH> 100644 --- a/src/transformers/generation_logits_process.py +++ b/src/transformers/generation_logits_process.py @@ -354,7 +354,7 @@ class NoBadWordsLogitsProcessor(LogitsProcessor): The id of the `end-of-sequence` token. """ - def __init__(self, bad_words_ids: Iterable[Iterable[int]], eos_token_id: int): + def __init__(self, bad_words_ids: List[List[int]], eos_token_id: int): if not isinstance(bad_words_ids, List) or len(bad_words_ids) == 0: raise ValueError(f"`bad_words_ids` has to be a non-emtpy list, but is {bad_words_ids}.")
Update typing in generation_logits_process.py (#<I>) While `Iterable[Iterable[int]]` is a nicer annotation (it's covariant!), the defensive statements parsing out `bad_words_ids` in `__init__(...)` force the caller to pass in `List[List[int]]`. I've changed the annotation to make that clear.
huggingface_pytorch-pretrained-BERT
train
py
a965467ddab0c11ea17f5c296690268dcae2b4aa
diff --git a/test/test.load.js b/test/test.load.js index <HASH>..<HASH> 100644 --- a/test/test.load.js +++ b/test/test.load.js @@ -68,4 +68,14 @@ describe(".load([callback])", function () { it('should initially load in editor mode', function () { expect(editor.getElement('editorIframe').style.display).to.be('block'); }); + + it('should open preview mode if preview mode was the last mode it was on before unloading', function () { + editor.preview(); + expect(editor.getElement('editorIframe').style.display).to.be('none'); + expect(editor.getElement('previewerIframe').style.display).to.be('block'); + editor.unload(); + editor.load(); + expect(editor.getElement('editorIframe').style.display).to.be('none'); + expect(editor.getElement('previewerIframe').style.display).to.be('block'); + }); });
Ticket #<I> - Added test to make sure preview state is retained.
OscarGodson_EpicEditor
train
js
1695d2c49f75bdb848ee7d17247c2c71b908c7c3
diff --git a/library/src/net/simonvt/widget/MenuDrawer.java b/library/src/net/simonvt/widget/MenuDrawer.java index <HASH>..<HASH> 100644 --- a/library/src/net/simonvt/widget/MenuDrawer.java +++ b/library/src/net/simonvt/widget/MenuDrawer.java @@ -1060,6 +1060,7 @@ public abstract class MenuDrawer extends ViewGroup { switch (action) { case MotionEvent.ACTION_DOWN: { mLastMotionX = mInitialMotionX = ev.getX(); + mLastMotionY = ev.getY(); final boolean allowDrag = onDownAllowDrag(ev); if (allowDrag) {
Fix touch handling when the drawer is open.
SimonVT_android-menudrawer
train
java
377a7e811fe3a11094c8eb672c908ba1e63bc82c
diff --git a/javascript/extensible-search-suggestions.js b/javascript/extensible-search-suggestions.js index <HASH>..<HASH> 100644 --- a/javascript/extensible-search-suggestions.js +++ b/javascript/extensible-search-suggestions.js @@ -11,6 +11,10 @@ var search = $(this); var URL = search.parents('form').attr('action').replace('getForm', 'getSuggestions'); search.autocomplete({ + + // Enforce a minimum autocomplete length. + + minLength: 3, source: function(request, response) { $.get(URL, { term: request.term @@ -18,11 +22,7 @@ .success(function(data) { response(data); }); - }, - - // Enforce a minimum autocomplete length. - - minLength: 3 + } }); } });
Minor update to the suggestions javascript.
nglasl_silverstripe-extensible-search
train
js
fd226f2dc709689a212a00d051955a75630c64a7
diff --git a/txproductpages/tests/test_txproductpages.py b/txproductpages/tests/test_txproductpages.py index <HASH>..<HASH> 100644 --- a/txproductpages/tests/test_txproductpages.py +++ b/txproductpages/tests/test_txproductpages.py @@ -19,7 +19,7 @@ class _ReleaseTestResource(Resource): def _fixture(self, url): """ Return path to our static fixture file. """ - filename = url.replace('/pp-admin/api/v1', FIXTURES_DIR) + filename = url.replace('/pp/api/v6', FIXTURES_DIR) # If we need to represent this API endpoint as both a directory and a # file, check for a ".body" file. if os.path.isdir(filename):
tests: correct endpoint when loading fixtures When loading the fixture files, I was expecting the URL to be a very old URL scheme that I no longer use. Update the tests to use the latest URL pattern, so we load from the correct fixture file path.
ktdreyer_txproductpages
train
py
2edd68b8f1aeafbc40d2a2886c532c8b1e75ed5c
diff --git a/src/de/lmu/ifi/dbs/elki/math/statistics/distribution/GeneralizedLogisticDistribution.java b/src/de/lmu/ifi/dbs/elki/math/statistics/distribution/GeneralizedLogisticDistribution.java index <HASH>..<HASH> 100644 --- a/src/de/lmu/ifi/dbs/elki/math/statistics/distribution/GeneralizedLogisticDistribution.java +++ b/src/de/lmu/ifi/dbs/elki/math/statistics/distribution/GeneralizedLogisticDistribution.java @@ -25,11 +25,13 @@ package de.lmu.ifi.dbs.elki.math.statistics.distribution; import java.util.Random; /** - * Generalized logistic distribution. (Type I, skew-logistic distribution) + * Generalized logistic distribution. (Type I, Skew-logistic distribution) * * One of multiple ways of generalizing the logistic distribution. * - * {@code f(x) = shape * Math.exp(-x) / (1 + Math.exp(-x))**(shape+1)} + * {@code pdf(x) = shape * Math.exp(-x) / (1 + Math.exp(-x))**(shape+1)} + * + * {@code cdf(x) = Math.pow(1+Math.exp(-x), -shape)} * * Where {@code shape=1} yields the regular logistic distribution. *
also mention cdf, to avoid confusions.
elki-project_elki
train
java
9cbaed76e9299e39f962f294e577889ddab35fcc
diff --git a/molo/commenting/wagtail_hooks.py b/molo/commenting/wagtail_hooks.py index <HASH>..<HASH> 100644 --- a/molo/commenting/wagtail_hooks.py +++ b/molo/commenting/wagtail_hooks.py @@ -79,8 +79,8 @@ class MoloCommentsModelAdmin(ModelAdmin, MoloCommentAdmin): def content(self, obj, *args, **kwargs): if obj.content_object and obj.parent is None: return ( - '<a href="/admin/pages/{0}/edit/">{1}</a>' - .format(obj.content_object.pk, obj.content_object.title)) + '<a href="{0}" target="_blank">{1}</a>' + .format(obj.content_object.url, obj.content_object.title)) return content.allow_tags = True
changed article link to go to frontend page
praekeltfoundation_molo.commenting
train
py
4312cbfd9bf78d6d0fa3606e56d5182ac906032e
diff --git a/tests/test_parser.py b/tests/test_parser.py index <HASH>..<HASH> 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -247,6 +247,8 @@ class TestParse(unittest.TestCase): bad_blocks = ( "Group = name bob = uncle END_OBJECT", "GROUP= name = bob = uncle END_GROUP", + "OBJECT = L1 V = 123 END_OBJECT = bad", + "OBJECT = L1 OBJECT = L2 V = 123 END_OBJECT = bad END_OBJECT = L1" "", ) for b in bad_blocks:
test(test_parser.py): Added a nested set of agg blocks that should raise cleanly, but don't. Issue <I>.
planetarypy_pvl
train
py
e03576de96be13c578ec01c472266bbebdb9e95f
diff --git a/website/pages/en/index.js b/website/pages/en/index.js index <HASH>..<HASH> 100755 --- a/website/pages/en/index.js +++ b/website/pages/en/index.js @@ -299,7 +299,7 @@ const TryOut = props => { return ( <Container padding={['bottom', 'top']} - background="highlight" + background="dark" align={'center'} id="try"> <div className="productShowcaseSection paddingBottom"> diff --git a/website/siteConfig.js b/website/siteConfig.js index <HASH>..<HASH> 100644 --- a/website/siteConfig.js +++ b/website/siteConfig.js @@ -96,7 +96,7 @@ const siteConfig = { zIndex: 1000 }, - editUrl: 'https://github.com/JKHeadley/rest-hapi-docs/tree/master/docs/' + editUrl: 'https://github.com/JKHeadley/rest-hapi/tree/master/docs/' // You may provide arbitrary config keys to be used as needed by your // template. For example, if you need your repo's URL... // repoUrl: 'https://github.com/facebook/test-site',
- Fixed edit url - Changed try it out background
JKHeadley_rest-hapi
train
js,js
2f1ac453d170eace8c45c91300392d56429fb9dd
diff --git a/umap/spectral.py b/umap/spectral.py index <HASH>..<HASH> 100644 --- a/umap/spectral.py +++ b/umap/spectral.py @@ -84,8 +84,6 @@ def component_layout( for label in range(n_components): component_centroids[label] = data[component_labels == label].mean(axis=0) - print(metric) - if metric in SPECIAL_METRICS: distance_matrix = pairwise_special_metric( component_centroids, metric=metric
Remove unrequired print introduced while debugging #<I>
lmcinnes_umap
train
py
44e3675a98739e00ab581595a06e4a55e2dfa4c5
diff --git a/lib/directive_record/query/sql.rb b/lib/directive_record/query/sql.rb index <HASH>..<HASH> 100644 --- a/lib/directive_record/query/sql.rb +++ b/lib/directive_record/query/sql.rb @@ -196,12 +196,13 @@ SQL regexp, aliases = /^\S+/, options[:aliases].invert where, having = (options[:where] || []).partition do |statement| + !options[:aggregated].keys.include?(statement.strip.match(regexp).to_s) && statement.gsub(/((?<![\\])['"])((?:.(?!(?<![\\])\1))*.?)\1/, " ") .split(/\b(and|or)\b/i).reject{|sql| %w(and or).include? sql.downcase} .collect{|sql| sql = sql.strip; (sql[0] == "(" && sql[-1] == ")" ? sql[1..-1] : sql)} .all? do |sql| sql.match /(.*)\s*(=|<=>|>=|>|<=|<|<>|!=|is|like|rlike|regexp|in|between|not|sounds|soundex)(\b|\s|$)/i - path = $1.strip rescue binding.pry + path = $1.strip !(aliases[path] || path).match(/\b(count|sum|min|max|avg)\(/i) end end
So auto-applying aggregate method for paths within conditions
archan937_directiverecord
train
rb
4aebc9a8db5279eac03b22a9b5bac754a26b2370
diff --git a/bin/runImportViaApi.php b/bin/runImportViaApi.php index <HASH>..<HASH> 100755 --- a/bin/runImportViaApi.php +++ b/bin/runImportViaApi.php @@ -88,7 +88,7 @@ array_map(function ($contentFileName) { 'context' => ['website' => 'ru', 'locale' => 'de_DE'] ]); - $blockId = preg_replace('/.*\/|\.html$/im', '', $contentFileName); + $blockId = preg_replace('/.*\/|\.html$/i', '', $contentFileName); $contentBlockImportRequest = HttpRequest::fromParameters( HttpRequest::METHOD_PUT, HttpUrl::fromString('http://example.com/api/content_blocks/' . $blockId),
Issue #<I>: Remove another obsolete pattern modifier
lizards-and-pumpkins_catalog
train
php
8fbdf064d699a7496138896be8d7aea9ad36a1a7
diff --git a/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/PipelineGraphPublisher.java b/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/PipelineGraphPublisher.java index <HASH>..<HASH> 100644 --- a/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/PipelineGraphPublisher.java +++ b/jenkins-plugin/src/main/java/org/jenkinsci/plugins/pipeline/maven/publishers/PipelineGraphPublisher.java @@ -246,7 +246,10 @@ public class PipelineGraphPublisher extends MavenPublisher { return getClass().getName() + "[" + "disabled=" + isDisabled() + ", " + "scopes=" + getIncludedScopes() + ", " + - "versions={snapshot:" + isIncludeSnapshotVersions() + ", release:" + isIncludeReleaseVersions() + "}" + + "versions={snapshot:" + isIncludeSnapshotVersions() + ", release:" + isIncludeReleaseVersions() + "}, " + + "skipDownstreamTriggers=" + isSkipDownstreamTriggers() + ", " + + "lifecycleThreshold=" + getLifecycleThreshold() + ", " + + "ignoreUpstreamTriggers=" + isIgnoreUpstreamTriggers() + ']'; }
Fix toString of PipelineGraphPublisher
jenkinsci_pipeline-maven-plugin
train
java
7b160d3d618385cfd5e51174f58c8d54411530ef
diff --git a/core-bundle/src/Resources/contao/forms/FormTextField.php b/core-bundle/src/Resources/contao/forms/FormTextField.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/forms/FormTextField.php +++ b/core-bundle/src/Resources/contao/forms/FormTextField.php @@ -136,6 +136,12 @@ class FormTextField extends \Widget { case 'digit': $strType = 'number'; + + // Allow floats (see #7257) + if (!isset($this->arrAttributes['step'])) + { + $this->addAttribute('step', 'any'); + } break; case 'phone':
[Core] Allow floating point numbers in "number" input fields (see #<I>)
contao_contao
train
php
d45f018027de68710b50c7121f44eb9a3e180537
diff --git a/test/runner.js b/test/runner.js index <HASH>..<HASH> 100644 --- a/test/runner.js +++ b/test/runner.js @@ -6,7 +6,7 @@ var mochaBin = join(__dirname, '..', 'node_modules', '.bin', 'mocha'); var walker = walk.walk(__dirname + '/spec', {followLinks: false}); walker.on('file', function(root, stat, next) { var filepath = root + '/' + stat.name; - cp.spawn(mochaBin, [filepath], {stdio: 'inherit'}); + cp.spawnSync(mochaBin, [filepath], {stdio: 'inherit'}); next(); });
Mak mocha runner sync in order to preserve DB consistency during tests.
cargomedia_pulsar-rest-api
train
js
d5980d42828234d93861112dc5c91a45aeeead0a
diff --git a/grace/task.py b/grace/task.py index <HASH>..<HASH> 100644 --- a/grace/task.py +++ b/grace/task.py @@ -8,7 +8,7 @@ from update import Update from upload import Upload from lint import Lint import os -from error import UnknownCommandError, NoExectuableError +from error import UnknownCommandError, NoExectuableError, FolderNotFoundError import sys import time from watchdog.observers import Observer @@ -188,6 +188,14 @@ class Task(object): self.exec_upload() if self._test: + if not os.path.exists(os.path.join(os.getcwd(), 'test')): + print 'No tests to build found.' + return + else: + if not os.path.exists(os.path.join(os.getcwd(), 'test', 'tests')): + print 'No tests to build found.' + return + if self._test_cases is None: self._test_cases = self._config['test_cases']
Bugfix * fixed error when trying to run manage.py test without any tests available
mdiener_grace
train
py
380e24f9e7302ecab8a72a8850cab09a043a3550
diff --git a/test/apiProfileTest.js b/test/apiProfileTest.js index <HASH>..<HASH> 100644 --- a/test/apiProfileTest.js +++ b/test/apiProfileTest.js @@ -9,8 +9,10 @@ describe("h5.profile", function () { var h5 = new HaloAPI(process.env.HALOAPI_KEY); var promise; - // leniant 10 second timemout - this.timeout(10000); + // very leniant 30 second timemout + // shouldn't be required, but if rate limiting is a factor + // requests may take some time to be accepted + this.timeout(30000); describe(".spartanImage(player: string)", function () { var player = "Frankie";
Increase timeout for profile endpoints
azz_haloapi.js
train
js
7ff65c567450bff00fae39bd70a71ae8418e5381
diff --git a/core/src/main/java/hudson/PluginWrapper.java b/core/src/main/java/hudson/PluginWrapper.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/PluginWrapper.java +++ b/core/src/main/java/hudson/PluginWrapper.java @@ -54,6 +54,7 @@ import org.kohsuke.stapler.interceptor.RequirePOST; import java.util.Enumeration; import java.util.jar.JarFile; +import java.util.logging.Level; /** * Represents a Jenkins plug-in and associated control information @@ -372,7 +373,7 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject { * Terminates the plugin. */ public void stop() { - LOGGER.info("Stopping "+shortName); + LOGGER.log(Level.FINE, "Stopping {0}", shortName); try { getPlugin().stop(); } catch(Throwable t) {
Reducing message from stop() to FINE. Normally this is only printed during functional tests or during in-process restart. In neither case do we really want to see a log message (i.e. two lines of text) for each plugin in the system being stopped.
jenkinsci_jenkins
train
java
010d399383c9cb095aee9356bcb22f6059bc5557
diff --git a/msrest/serialization.py b/msrest/serialization.py index <HASH>..<HASH> 100644 --- a/msrest/serialization.py +++ b/msrest/serialization.py @@ -129,9 +129,11 @@ class Model(object): Remove the polymorphic key from the initial data. """ for subtype_key in cls.__dict__.get('_subtype_map', {}).keys(): - response_key = _decode_attribute_map_key(cls._attribute_map[subtype_key]['key']) - if response_key in response: - subtype_value = response.pop(response_key) + subtype_value = None + + rest_api_response_key = _decode_attribute_map_key(cls._attribute_map[subtype_key]['key']) + subtype_value = response.pop(rest_api_response_key, None) or response.pop(subtype_key, None) + if subtype_value: flatten_mapping_type = cls._flatten_subtype(subtype_key, objects) return objects[flatten_mapping_type[subtype_value]] return cls
Fix serialisation from dict with escape
Azure_msrest-for-python
train
py
7ba3e1705dbdd9cb04a49e7cddaf8ec7d8eb2841
diff --git a/pages/Login/components/ForgotPassword/style.js b/pages/Login/components/ForgotPassword/style.js index <HASH>..<HASH> 100644 --- a/pages/Login/components/ForgotPassword/style.js +++ b/pages/Login/components/ForgotPassword/style.js @@ -9,7 +9,9 @@ import { css } from 'glamor'; import colors from 'Styles/colors'; export default css({ + color: colors.shade6, + position: 'relative', display: 'inline-block', width: 'auto', - color: colors.shade6, + zIndex: '1', }).toString();
CON-<I> - fixed z-index for a password reminder link since it has negative margin top and is overlapped by a sibling
shopgate_pwa
train
js
08eea5cde3d6d4a4d4a8ae6aabf982a3cc168946
diff --git a/tests/MSSQLDatabaseQueryTest.php b/tests/MSSQLDatabaseQueryTest.php index <HASH>..<HASH> 100644 --- a/tests/MSSQLDatabaseQueryTest.php +++ b/tests/MSSQLDatabaseQueryTest.php @@ -9,7 +9,7 @@ class MSSQLDatabaseQueryTest extends SapphireTest { public function testDateValueFormatting() { $obj = $this->objFromFixture('MSSQLDatabaseQueryTestDataObject', 'test-data-1'); - $this->assertEquals('2012-01-01', $obj->TestDate, 'Date field value is formatted correctly (Y-m-d)'); + $this->assertEquals('2012-01-01', date('Y-m-d', strtotime($obj->TestDate)), 'Date field value is formatted correctly (Y-m-d)'); } public function testDatetimeValueFormatting() {
Ensure date test is Y-m-d
silverstripe_silverstripe-mssql
train
php
13e2fb735d92742ab91aa04d7a262f28b3099ca4
diff --git a/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php b/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php +++ b/src/Symfony/Component/Serializer/Normalizer/PropertyNormalizer.php @@ -102,7 +102,7 @@ class PropertyNormalizer extends AbstractObjectNormalizer do { foreach ($reflectionObject->getProperties() as $property) { - if (!$this->isAllowedAttribute($reflectionObject->getName(), $property->name)) { + if (!$this->isAllowedAttribute($reflectionObject->getName(), $property->name, $format, $context)) { continue; }
property normalizer should also pass format and context to isAllowedAttribute
symfony_symfony
train
php
30664296f859c1b2d6960d88f4f077971a80a3c3
diff --git a/Test/Generator/GeneratorTest.php b/Test/Generator/GeneratorTest.php index <HASH>..<HASH> 100644 --- a/Test/Generator/GeneratorTest.php +++ b/Test/Generator/GeneratorTest.php @@ -13,7 +13,9 @@ abstract class GeneratorTest extends \PHPUnit_Framework_TestCase public function setUp() { $this->setUpTemporalDirectory(); - define('DRUPAL_ROOT', getcwd()); + if (!defined('DRUPAL_ROOT')) { + define('DRUPAL_ROOT', getcwd()); + } } public function setUpTemporalDirectory()
Ask if DRUPAL_ROOT defined and define
hechoendrupal_drupal-console
train
php
35cd13d10efc30c54dc230fe5ffe61a9b0cb76a4
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker.java index <HASH>..<HASH> 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker.java @@ -183,7 +183,7 @@ public abstract class WebSocketServerHandshaker { p.replace(ctx.name(), "wsdecoder", newWebsocketDecoder()); encoderName = p.context(HttpResponseEncoder.class).name(); - p.addAfter(encoderName, "wsencoder", newWebSocketEncoder()); + p.addBefore(encoderName, "wsencoder", newWebSocketEncoder()); } channel.writeAndFlush(response).addListener(new ChannelFutureListener() { @Override
[#<I>] Correctly add the wsencoder before the httpencoder as the httpencoder also handle ByteBuf
netty_netty
train
java
63823d12a24c1b82e8ba22a01740ec05b91957a3
diff --git a/core/src/main/java/io/atomix/core/impl/CorePrimitiveRegistry.java b/core/src/main/java/io/atomix/core/impl/CorePrimitiveRegistry.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/io/atomix/core/impl/CorePrimitiveRegistry.java +++ b/core/src/main/java/io/atomix/core/impl/CorePrimitiveRegistry.java @@ -122,11 +122,11 @@ public class CorePrimitiveRegistry implements ManagedPrimitiveRegistry { "primitives", ConsistentMapType.instance(), partitionService.getSystemPartitionGroup()); - return new ConsistentMapProxy(proxy, this) - .connect() - .thenApply(map -> { + return proxy.connect() + .thenApply(v -> { + ConsistentMapProxy mapProxy = new ConsistentMapProxy(proxy, this); primitives = new TranscodingAsyncConsistentMap<>( - map, + mapProxy, key -> key, key -> key, value -> value != null ? SERIALIZER.encode(value) : null,
Ensure primitive registry is started prior to creating any distributed primitives.
atomix_atomix
train
java
067e9e04fde10245588f5d5eabb866c8c3d9942a
diff --git a/lib/puppet/face/man.rb b/lib/puppet/face/man.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/face/man.rb +++ b/lib/puppet/face/man.rb @@ -59,7 +59,13 @@ Puppet::Face.define(:man, '0.0.1') do # OK, if we have Ronn on the path we can delegate to it and override the # normal output process. Otherwise delegate to a pager on the raw text, # otherwise we finally just delegate to our parent. Oh, well. - ENV['LESS'] ||= 'FRSX' # emulate git... + + # These are the same options for less that git normally uses. + # -R : Pass through color control codes (allows display of colors) + # -X : Don't init/deinit terminal (leave display on screen on exit) + # -F : automatically exit if display fits entirely on one screen + # -S : don't wrap long lines + ENV['LESS'] ||= 'FRSX' ronn = Puppet::Util.which('ronn') pager = [ENV['MANPAGER'], ENV['PAGER'], 'less', 'most', 'more'].
(Maint) Clarify what the options to less are The comment for an assignment to the LESS environment variable didn't provide any insight into what was being done. This expands on the comment so that the reader can know a bit better what all of "random" letters mean.
puppetlabs_puppet
train
rb
aa78eed7b8780c7e5af16fc2cfe810a36e69303c
diff --git a/goopt.go b/goopt.go index <HASH>..<HASH> 100644 --- a/goopt.go +++ b/goopt.go @@ -11,6 +11,7 @@ import ( "path" "tabwriter" "strings" + "container/vector" ) var opts = make([]opt, 0, 100) @@ -253,11 +254,11 @@ func String(names []string, d string, help string) *string { // argname string The argument name of the strings that are appended (e.g. the val in --opt=val) // help string The help text (automatically Expand()ed) to display for this flag // Returns: -// []string This points to a string slice whose value is appended as this flag is changed -func Strings(names []string, d string, help string) []string { - s := make([]string,0,100) +// *vector.StringVector This points to a string vector whose value is appended as this flag is changed +func Strings(names []string, d string, help string) *vector.StringVector { + s := new(vector.StringVector) f := func(ss string) os.Error { - s = Append(s, ss) + s.Push(ss) return nil } ReqArg(names, d, help, f)
Changed String to be a vector.StringVector, because slice resizing doesn't affect the returned slice
droundy_goopt
train
go
6c4342653c9c55778aa1d2c56ee8ca28b9d40300
diff --git a/webbrowser.go b/webbrowser.go index <HASH>..<HASH> 100644 --- a/webbrowser.go +++ b/webbrowser.go @@ -98,13 +98,13 @@ func Open(s string) error { // No display, no need to open a browser. Lynx users **MAY** have // something to say about this. if os.Getenv("DISPLAY") == "" { - return errors.New(fmt.Printf("Tried to open %q on default webbrowser, no screen found.\n", url)) + return fmt.Errorf("Tried to open %q on default webbrowser, no screen found.\n", url)) } fallthrough case "darwin": // Check SSH env vars. if os.Getenv("SSH_CLIENT") != "" || os.Getenv("SSH_TTY") != "" { - return errors.New(fmt.Printf("Tried to open %q on default webbrowser, but you are running a shell session.\n", url)) + return fmt.Errorf("Tried to open %q on default webbrowser, but you are running a shell session.\n", url)) } }
fmt.Errorf is a real thing!
toqueteos_webbrowser
train
go
0e0f117f2b33b80c49122be922a9cd57f81fbbc4
diff --git a/tests/AllTests.php b/tests/AllTests.php index <HASH>..<HASH> 100755 --- a/tests/AllTests.php +++ b/tests/AllTests.php @@ -57,6 +57,7 @@ class AllTests $suite = new PHPUnit_Framework_TestSuite(); $suite->setName('SimplePie'); + $suite->addTestSuite('CacheTest'); $suite->addTestSuite('EncodingTest'); $suite->addTestSuite('IRITest'); $suite->addTestSuite('LocatorTest');
Add CacheTest to AllTests
simplepie_simplepie
train
php
15d4764185a5eba8cbb0f735a643d8879557c851
diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java index <HASH>..<HASH> 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java @@ -45,7 +45,7 @@ class JavaBeanBinder implements DataObjectBinder { @Override public <T> T bind(ConfigurationPropertyName name, Bindable<T> target, Context context, DataObjectPropertyBinder propertyBinder) { - boolean hasKnownBindableProperties = hasKnownBindableProperties(name, context); + boolean hasKnownBindableProperties = target.getValue() != null && hasKnownBindableProperties(name, context); Bean<T> bean = Bean.get(target, hasKnownBindableProperties); if (bean == null) { return null;
Avoid bindable properties check when target has null value See gh-<I>
spring-projects_spring-boot
train
java
168635fb6fca359016033e319a076bf0adb9268e
diff --git a/lib/setuplib.php b/lib/setuplib.php index <HASH>..<HASH> 100644 --- a/lib/setuplib.php +++ b/lib/setuplib.php @@ -366,7 +366,7 @@ function default_exception_handler($ex) { if (AJAX_SCRIPT) { // If we are in an AJAX script we don't want to use PREFERRED_RENDERER_TARGET. // Because we know we will want to use ajax format. - $renderer = $PAGE->get_renderer('core', null, 'ajax'); + $renderer = new core_renderer_ajax($PAGE, 'ajax'); } else { $renderer = $OUTPUT; }
MDL-<I> setuplib: safely construct the ajax renderer when needed
moodle_moodle
train
php
a31030e860fad2b90f9705635fe9dfad9a8539b2
diff --git a/spec/support/fixtures/nodes.rb b/spec/support/fixtures/nodes.rb index <HASH>..<HASH> 100644 --- a/spec/support/fixtures/nodes.rb +++ b/spec/support/fixtures/nodes.rb @@ -7,8 +7,8 @@ namespace :production do end end -node :vagrant do - node_config 'nodes/some_node.json' - ssh_config 'vagrant config' +node :vagrant do |n| + n.node_config 'nodes/some_node.json' + n.ssh_config 'vagrant config' end
update fixture to test both forms of DSL
substantial_knife_sous
train
rb
4688a8d2a6a5f8ff2c5c93160880a5d787d2b5d5
diff --git a/View/Widget/Widget/ChildLinksWidget.php b/View/Widget/Widget/ChildLinksWidget.php index <HASH>..<HASH> 100644 --- a/View/Widget/Widget/ChildLinksWidget.php +++ b/View/Widget/Widget/ChildLinksWidget.php @@ -80,7 +80,7 @@ class ChildLinksWidget extends AbstractWidget */ protected function createContent($entity, array $options, $property) { - $childClass = $this->entityResolver->resolve($options['child_entity']); + $childClass = $this->entityResolver->resolve($options['child']); $indexLink = $this->isGranted(Permission::VIEW, $childClass) && $this->adminRouter->exists($childClass, AdminRouter::TYPE_INDEX); @@ -141,7 +141,7 @@ class ChildLinksWidget extends AbstractWidget parent::configureOptions($resolver); $resolver - ->setRequired('child_entity') - ->setAllowedTypes('child_entity', 'string'); + ->setRequired('child') + ->setAllowedTypes('child', 'string'); } }
Refactor child links admin view widget.
DarvinStudio_DarvinAdminBundle
train
php
11f2b59cdca55cef561aca19110c7af8fe042a19
diff --git a/lib/ore/naming.rb b/lib/ore/naming.rb index <HASH>..<HASH> 100644 --- a/lib/ore/naming.rb +++ b/lib/ore/naming.rb @@ -58,6 +58,21 @@ module Ore end # + # Converts a camel-case name to an underscored file name. + # + # @param [String] name + # The name to underscore. + # + # @return [String] + # The underscored version of the name. + # + def underscore(name) + name.gsub(/[^A-Z][A-Z][^A-Z]/) { |cap| + cap[0,1] + '_' + cap[1..-1] + }.downcase + end + + # # Guesses the namespace directory within `lib/` for a project. # # @return [String] diff --git a/spec/naming_spec.rb b/spec/naming_spec.rb index <HASH>..<HASH> 100644 --- a/spec/naming_spec.rb +++ b/spec/naming_spec.rb @@ -8,6 +8,10 @@ describe Naming do obj end + it "should underscore camel case names" do + subject.underscore('FooBar').should == 'foo_bar' + end + it "should guess the module names from a project name" do subject.modules_of('foo-bar').should == ['Foo', 'Bar'] end
Added Naming#underscore.
ruby-ore_ore
train
rb,rb
b5a088ae63831c79775f22f5f6de1d2e958aba82
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,31 +1,22 @@ # encoding: utf-8 -from __future__ import print_function from setuptools import setup import sys # check availability of runtime dependencies -import argparse -parser = argparse.ArgumentParser() -parser.add_argument('-f', '--force', dest="force", - action="store_true", default=False) -args, sys.argv = parser.parse_known_args(sys.argv) -if not args.force: - try: - import dbus - import gobject - import pynotify - except ImportError: - err = sys.exc_info()[1] - print("Missing runtime dependency:", err) - print("Use --force if you want to continue anyway.") - sys.exit(1) +try: + import dbus + import gobject + import pynotify +except ImportError: + err = sys.exc_info()[1] + print("Missing runtime dependency: %s" % err) # read long_description from README.rst try: f = open('README.rst') long_description = f.read() f.close() -except: +except IOError: long_description = None setup(
Relax setup.py manual runtime depedendency enforcement Now, only a warning will be issued if runtime dependencies are unmet. The previous approach introduced unnecessary complexity and one additional setup dependency (argparse).
coldfix_udiskie
train
py
107263ef9f0982eaf3f9a304906f9bd9d9938a26
diff --git a/pkg/fileutil/purge_test.go b/pkg/fileutil/purge_test.go index <HASH>..<HASH> 100644 --- a/pkg/fileutil/purge_test.go +++ b/pkg/fileutil/purge_test.go @@ -45,7 +45,7 @@ func TestPurgeFile(t *testing.T) { if err != nil { t.Fatal(err) } - time.Sleep(2 * time.Millisecond) + time.Sleep(10 * time.Millisecond) } fnames, err := ReadDir(dir) if err != nil {
pkg/fileutil: fix TestPurgeFile It needs to wait longer for file to be detected and removed sometimes.
etcd-io_etcd
train
go
88bef949fc0f6c4c0651cb4c4f94c6b330d02bcf
diff --git a/core/src/main/java/smile/wavelet/Wavelet.java b/core/src/main/java/smile/wavelet/Wavelet.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/smile/wavelet/Wavelet.java +++ b/core/src/main/java/smile/wavelet/Wavelet.java @@ -55,20 +55,18 @@ public class Wavelet { * Constructor. Create a wavelet with given coefficients. */ public Wavelet(double[] coefficients) { - if (coefficients != null) { - ncof = coefficients.length; + ncof = coefficients.length; - ioff = joff = -(ncof >> 1); - // ioff = -2; joff = -ncof + 2; // Alternative centering, used by D4. + ioff = joff = -(ncof >> 1); + // ioff = -2; joff = -ncof + 2; // Alternative centering, used by D4. - cc = coefficients; + cc = coefficients; - double sig = -1.0; - cr = new double[ncof]; - for (int i = 0; i < ncof; i++) { - cr[ncof - 1 - i] = sig * cc[i]; - sig = -sig; - } + double sig = -1.0; + cr = new double[ncof]; + for (int i = 0; i < ncof; i++) { + cr[ncof - 1 - i] = sig * cc[i]; + sig = -sig; } }
coefficients cannot be null as HaarWavelet pass it now
haifengl_smile
train
java
33e990c8acce8db6f9ca1718d435aec1b62b0207
diff --git a/source/core/smarty/plugins/oxemosadapter.php b/source/core/smarty/plugins/oxemosadapter.php index <HASH>..<HASH> 100644 --- a/source/core/smarty/plugins/oxemosadapter.php +++ b/source/core/smarty/plugins/oxemosadapter.php @@ -421,7 +421,7 @@ class oxEmosAdapter extends oxSuperCfg } $oEmos->addEmosBasketPageArray( $aBasket ); break; - case 'oxwarticledetails': + case 'details': if ( $oProduct ) { //$oEmos->addContent( 'Shop/'.$this->_getEmosCatPath().'/'.strip_tags( $oProduct->oxarticles__oxtitle->value ) ); //$sPath = $this->_getDeepestCategoryPath( $oProduct );
Revert 3a7ea<I>, testGetCodeForDetails was failing.
OXID-eSales_oxideshop_ce
train
php
d58d488fbdc1070ac1a5226f17c3ff576c369592
diff --git a/pmagpy/data_model3.py b/pmagpy/data_model3.py index <HASH>..<HASH> 100644 --- a/pmagpy/data_model3.py +++ b/pmagpy/data_model3.py @@ -8,6 +8,8 @@ except ImportError: import pandas as pd from pmagpy import find_pmag_dir +DM = [] +CRIT_MAP = [] class DataModel(): @@ -18,8 +20,15 @@ class DataModel(): """ def __init__(self, offline=False): + global DM, CRIT_MAP self.offline = offline - self.dm, self.crit_map = self.get_data_model() + if not len(DM): + self.dm, self.crit_map = self.get_data_model() + DM = self.dm + CRIT_MAP = self.crit_map + else: + self.dm = DM + self.crit_map = CRIT_MAP def get_data_model(self):
use globals to prevent data model from being re-acquired each time, related to #<I>
PmagPy_PmagPy
train
py
85e309093a2967ec558a0304d30d80764f0b4c03
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -176,7 +176,7 @@ ECDSA.prototype.verify = function verify(message, signature, format = 'base64') const verify = crypto.createVerify('RSA-SHA256') // RSA works with EC keys, too verify.write(message) verify.end() - const key = this.isPrivate ? this.asPublicECDSA() : this + const key = this.isPrivate ? this.asPublic() : this const signatureBuffer = Buffer.from(signature, format) return verify.verify( key.toPEM(),
Update index.js There was a call being made to a asPublicECDSA method in verify which doesn't exist. asPublic was probably what was intended.
forevertz_ecdsa-secp256r1
train
js