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
5a77a43816a53b33d5be132843638b3223fb290f
diff --git a/packages/ember-metal/lib/platform.js b/packages/ember-metal/lib/platform.js index <HASH>..<HASH> 100644 --- a/packages/ember-metal/lib/platform.js +++ b/packages/ember-metal/lib/platform.js @@ -183,6 +183,7 @@ if (!(Object.create && !Object.create(null).hasOwnProperty)) { return object; }; + create.isSimulated = true; } else { create = Object.create; }
[BUGFIX]fix Object.create sham for IE8 The `isSimulated` check was removed in 2fde5b7ee<I>be<I>c<I>bba<I>b0dcf<I>ba. The `isSimulated` check is used internally by Ember for things like Ember.keys(Object.keys) polyfill. Github link: <URL>
emberjs_ember.js
train
js
fcb5154b0b5ab363abbece7dce29cc2e68610a35
diff --git a/transformers/engine.io/client.js b/transformers/engine.io/client.js index <HASH>..<HASH> 100644 --- a/transformers/engine.io/client.js +++ b/transformers/engine.io/client.js @@ -47,6 +47,13 @@ module.exports = function client() { // Binary support in Engine.IO breaks a shit things. Turn it off for now. // forceBase64: true, + + // + // Force timestamps on every single connection. Engine.IO only does this + // for polling by default, but WebSockets require an explicit `true` + // boolean. + // + timestampRequests: true, path: this.pathname, transports: !primus.AVOID_WEBSOCKETS ? ['polling', 'websocket'] @@ -54,7 +61,7 @@ module.exports = function client() { })); // - // Nuke a growing memory leak as engine.io pushes instances in to an exposed + // Nuke a growing memory leak as Engine.IO pushes instances in to an exposed // `sockets` array. // if (factory.sockets && factory.sockets.length) {
[fix] Force timestamped requests for engine.io
primus_primus
train
js
d5c248c52a838026b7158dc91f8657ee7b3edf9b
diff --git a/acceptance/tests/resource/file/symbolic_modes.rb b/acceptance/tests/resource/file/symbolic_modes.rb index <HASH>..<HASH> 100644 --- a/acceptance/tests/resource/file/symbolic_modes.rb +++ b/acceptance/tests/resource/file/symbolic_modes.rb @@ -1,5 +1,8 @@ test_name "file resource: symbolic modes" confine :except, :platform => /^eos-/ # See ARISTA-37 +confine :except, :platform => /^solaris-10/ +confine :except, :platform => /^windows/ +confine :to, {}, hosts.select { |host| ! host[:roles].include?('master') } require 'puppet/acceptance/temp_file_utils' extend Puppet::Acceptance::TempFileUtils @@ -176,14 +179,6 @@ end # permissions locked while a program is accessing that file. # agents.each do |agent| - if agent['platform'].include?('windows') - Log.warn("Pending: this does not currently work on Windows") - next - end - if agent['platform'] =~ /solaris-10/ - Log.warn("Pending: this does not currently work on Solaris 10") - next - end is_solaris = agent['platform'].include?('solaris') on(agent, puppet("resource user symuser ensure=present"))
(PUP-<I>) Acceptance - no master in symbolic_modes This commit confines hosts eligible to be included in the execution of the `resource/file/symbolic_modes` test. It removes the master from the hosts list. It also moves the logic to exclude windows and solaris-<I> from the body of the test and places them as confine statements at the beginning.
puppetlabs_puppet
train
rb
ca9d8e9b4a04e06c1d501f67f89a70697d3310b8
diff --git a/digsandpaper/elasticsearch_mapping/generate.py b/digsandpaper/elasticsearch_mapping/generate.py index <HASH>..<HASH> 100644 --- a/digsandpaper/elasticsearch_mapping/generate.py +++ b/digsandpaper/elasticsearch_mapping/generate.py @@ -58,7 +58,12 @@ def generate(default_mapping, semantic_types, data_type = "string" knowledge_graph[semantic_type] = kg_to_copy semantic_type_props = {"high_confidence_keys": {"type": data_type, - "index": "not_analyzed"}} + "index": "not_analyzed"}, + "key_count": {"index": "no", + "type": "long"}, + "provenance_count": {"index": "no", + "type": "long"}, + } if data_type in elasticsearch_numeric_types: semantic_type_props["high_confidence_keys"]["ignore_malformed"] = True root_props[semantic_type] = {"properties": semantic_type_props}
Don't index key_count and provenance_count
usc-isi-i2_dig-sandpaper
train
py
565d073197a0bc5e2a8583588c18362f6c70cea9
diff --git a/src/ORMServiceProvider.php b/src/ORMServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/ORMServiceProvider.php +++ b/src/ORMServiceProvider.php @@ -15,7 +15,7 @@ class ORMServiceProvider extends ServiceProvider { $this->publishes([ __DIR__ . '/../config/orm.php' => config_path('orm.php'), - ], 'mongo'); + ], 'orm'); } /**
updated srvice provider tag
OpenResourceManager_client-laravel
train
php
44120f22b4920a0dd45df6d35c848b09a3d0e919
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -32,7 +32,9 @@ function buildProblemFilePath() { function buildOnFinishedHandler(problemFilePath, callback) { return function() { - fs.unlink(problemFilePath); + ['.mzn', '.fzn', '.ozn'].forEach(function(ending) { + fs.unlink(problemFilePath.replace('.mzn', ending)); + }); callback.apply(null, arguments); }; }
Clean up all temporary files on failure The solver creates some temporary files that should be deleted after any execution, including timeouts.
dp28_minizinc-solver
train
js
11e36aa4750e3ba3f404c1adb673ba7d3b732bc4
diff --git a/lib/jsduck/doc/ast.rb b/lib/jsduck/doc/ast.rb index <HASH>..<HASH> 100644 --- a/lib/jsduck/doc/ast.rb +++ b/lib/jsduck/doc/ast.rb @@ -95,7 +95,6 @@ module JsDuck def create_css_mixin(docs, doc_map) return add_shared({ :tagname => :css_mixin, - :name => detect_name(:css_mixin, doc_map), :doc => detect_doc(:css_mixin, doc_map), }, doc_map) end
Remove CSS mixin name detection from DocAst. There is no @tag for CSS Mixins, and therefore no way to define a mixin name inside documentation - it can only be derived from code.
senchalabs_jsduck
train
rb
d2f7bfeec151201af5eb9a418576a25c382b3793
diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -94,7 +94,7 @@ describe("JSKOS JSON Schemas", () => { let errorText = !result ? `${type} ${object.uri} did not validate: - ${validate[type].errors.reduce((t, c) => `${t}-${c.message}\n`, "")}` + ${validate[type].errors.reduce((t, c) => `${t}- ${c.dataPath} ${c.message}\n`, "")}` : (expected ? "" : `${type} ${object.uri} passed even though it shouldn't.`) assert.equal(result, expected, errorText) }
Show data path for validation errors Note: The tests currently fail because examples/jskos/mapping-ddc-gnd.json does not conform to the JSKOS specification.
gbv_jskos-tools
train
js
db513239f4874108a1c3b27fe8d5dcc0fd9d51e3
diff --git a/medoo.php b/medoo.php index <HASH>..<HASH> 100644 --- a/medoo.php +++ b/medoo.php @@ -815,7 +815,7 @@ class medoo return $this->exec('UPDATE "' . $table . '" SET ' . $replace_query . $this->where_clause($where)); } - public function get($table, $columns, $where = null) + public function get($table, $join = null, $column = null, $where = null) { if (!isset($where)) { @@ -824,7 +824,7 @@ class medoo $where['LIMIT'] = 1; - $data = $this->select($table, $columns, $where); + $data = $this->query($this->select_context($table, $join, $column, $where))->fetchAll(PDO::FETCH_ASSOC); return isset($data[0]) ? $data[0] : false; }
[feature] Add table joining support for get API
catfan_Medoo
train
php
f838af3876b76b051377cd027cf648c5a7781461
diff --git a/tests/DatabaseTest.php b/tests/DatabaseTest.php index <HASH>..<HASH> 100644 --- a/tests/DatabaseTest.php +++ b/tests/DatabaseTest.php @@ -226,6 +226,14 @@ class DatabaseTest extends \PHPUnit_Extensions_Database_TestCase $this->assertTrue(false, 'Unknown exception'); } $this->assertEmpty($badLangTest, 'Url should be empty, because of unexisting language'); + + $urlManager = Yii::$app->urlManager; + $this->assertEquals('/site/login', $urlManager->createUrl(['site/login'])); + $this->assertEquals('/en/site/test', $urlManager->createUrl(['site/test'])); + $urlManager->includeRoutes = ['site/included', 'site/another']; + $this->assertEquals('/site/test', $urlManager->createUrl(['site/test'])); + $this->assertEquals('/en/site/included', $urlManager->createUrl(['site/included'])); + $urlManager->includeRoutes = []; } /**
Test excludeRoutes + includeRoutes
DevGroup-ru_yii2-multilingual
train
php
0b1cba8474eeb704230fe86f70a7f0b5ac6bd440
diff --git a/pkg/action/upgrade.go b/pkg/action/upgrade.go index <HASH>..<HASH> 100644 --- a/pkg/action/upgrade.go +++ b/pkg/action/upgrade.go @@ -233,6 +233,13 @@ func (u *Upgrade) prepareUpgrade(name string, chart *chart.Chart, vals map[strin func (u *Upgrade) performUpgrade(originalRelease, upgradedRelease *release.Release) (*release.Release, error) { current, err := u.cfg.KubeClient.Build(bytes.NewBufferString(originalRelease.Manifest), false) if err != nil { + // Checking for removed Kubernetes API error so can provide a more informative error message to the user + // Ref: https://github.com/helm/helm/issues/7219 + if strings.Contains(err.Error(), "unable to recognize \"\": no matches for kind") { + return upgradedRelease, errors.Wrap(err, "current release manifest contains removed kubernetes api(s) for this "+ + "kubernetes version and it is therefore unable to build the kubernetes "+ + "objects for performing the diff. error from kubernetes") + } return upgradedRelease, errors.Wrap(err, "unable to build kubernetes objects from current release manifest") } target, err := u.cfg.KubeClient.Build(bytes.NewBufferString(upgradedRelease.Manifest), !u.DisableOpenAPIValidation)
Add an improved user error message for removed k8s apis The error message returned from Kubernetes when APIs are removed is not very informative. This PR adds additional information to the user. It covers the current release manifest APIs. Partial #<I>
helm_helm
train
go
a431255a4692b304bbdf9f09235dc5a20746b9bd
diff --git a/src/ExprBuilder.php b/src/ExprBuilder.php index <HASH>..<HASH> 100644 --- a/src/ExprBuilder.php +++ b/src/ExprBuilder.php @@ -21,7 +21,7 @@ class ExprBuilder implements ExpressionInterface /** * @param mixed $wrappedExpression */ - public function __construct($wrappedExpression) + public function __construct($wrappedExpression = null) { $this->wrappedExpression = Expr::normalizeExpression($wrappedExpression); } diff --git a/tests/Unit/QueryBuilderTest.php b/tests/Unit/QueryBuilderTest.php index <HASH>..<HASH> 100644 --- a/tests/Unit/QueryBuilderTest.php +++ b/tests/Unit/QueryBuilderTest.php @@ -284,4 +284,14 @@ class QueryBuilderTest extends \PHPUnit_Framework_TestCase static::assertSame('SELECT p.user_id, SUM(p.price) FROM price_list AS p GROUP BY p.user_id', $qb->buildSQL()); } + + public function testAliasedSum() + { + $qb = $this->createQb(); + + $exampleTable = $qb->from('example'); + $qb->addSelect($exampleTable->column('points')->sum()->alias('points')); + + static::assertSame('SELECT SUM(example.points) AS points FROM example', $qb->buildSQL()); + } } \ No newline at end of file
added test for aliasing expression
phuria_under-query
train
php,php
6a16354365bfe14d4ad87118b1ed20bee1dfdbad
diff --git a/spec/lib/pwwka/error_handlers/chain_spec.rb b/spec/lib/pwwka/error_handlers/chain_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/pwwka/error_handlers/chain_spec.rb +++ b/spec/lib/pwwka/error_handlers/chain_spec.rb @@ -19,24 +19,14 @@ describe Pwwka::ErrorHandlers::Chain do it "does not run subsequent error handlers" do expect(good_error_handler_klass).to_not receive(:new) - expect { - chain.handle_error(double,double,double,double,double,double.as_null_object) - }.to raise_error(SystemExit) - end - - it "aborts the process" do - expect { - chain.handle_error(double,double,double,double,double,double.as_null_object) - }.to raise_error(SystemExit) + chain.handle_error(double,double,double,double,double,double.as_null_object) end it "logs exceptions that occur in the error handling chain" do - expect(chain.logger).to receive(:send).with(any_args).exactly(2).times + allow(chain.logger).to receive(:send).with(any_args) expect(chain.logger).to receive(:send).with(:fatal, /aborting due to unhandled exception/) - expect { - chain.handle_error(double,double,double,double,double,double.as_null_object) - }.to raise_error(SystemExit) + chain.handle_error(double,double,double,double,double,double.as_null_object) end end end
Update Chain unit specs to handle halting the error handling chain instead of aborting the process
stitchfix_pwwka
train
rb
99f658c9ac2af9d8abb2112a81ec80c9bb4595d8
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,7 +1,9 @@ module.exports = { Headers: require('./Headers'), Message: require('./Message'), + RequestLine: require('./RequestLine'), HttpRequest: require('./HttpRequest'), + StatusLine: require('./StatusLine'), HttpResponse: require('./HttpResponse'), formatHeaderName: require('./formatHeaderName'), foldHeaderLine: require('./foldHeaderLine')
Expose RequestLine and StatusLine on the exported object.
papandreou_messy
train
js
19b9ac31f6321948d3c18ea0b94a9a1a052323f7
diff --git a/src/client/ui/controls.js b/src/client/ui/controls.js index <HASH>..<HASH> 100644 --- a/src/client/ui/controls.js +++ b/src/client/ui/controls.js @@ -148,7 +148,7 @@ export default class StorybookControls extends React.Component { textAlign: 'center', borderRadius: '2px', padding: '5px', - cursor: 'default', + cursor: 'pointer', margin: 0, }; @@ -168,10 +168,18 @@ export default class StorybookControls extends React.Component { left: '20px', }; + const linkStyle = { + textDecoration: 'none', + }; + + const linkTarget = 'https://github.com/kadirahq/react-storybook'; + return ( <div style={mainStyle}> <div style={h1WrapStyle}> - <h3 style={h1Style}>React Storybook</h3> + <a style={linkStyle} href={linkTarget} target="_blank"> + <h3 style={h1Style}>React Storybook</h3> + </a> </div> <div style={filterTextWrapStyle}> <TextFilter
Link React Storybooks Menu to the Repo (#<I>) * add repo link * variable changes
storybooks_storybook
train
js
bce6d1f313713543a38e33b0ef9e01b5abc056f7
diff --git a/ext_emconf.php b/ext_emconf.php index <HASH>..<HASH> 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -16,7 +16,7 @@ $EM_CONF[$_EXTKEY] = array( 'modify_tables' => '', 'clearCacheOnLoad' => 1, 'lockType' => '', - 'version' => '3.0.2', + 'version' => '3.1.0dev', 'constraints' => array( 'depends' => array( 'typo3' => '8.7.0-8.7.99',
set version to <I>dev
Gernott_mask
train
php
8fc1b74bf23390d0c0cbb9990351f93c6830feca
diff --git a/ImageCacheProvider.js b/ImageCacheProvider.js index <HASH>..<HASH> 100644 --- a/ImageCacheProvider.js +++ b/ImageCacheProvider.js @@ -14,6 +14,7 @@ const SHA1 = require("crypto-js/sha1"); const URL = require('url-parse'); const defaultHeaders = {}; +const defaultImageTypes = ['png', 'jpeg', 'jpg', 'gif', 'bmp', 'tiff', 'tif']; const defaultResolveHeaders = _.constant(defaultHeaders); const defaultOptions = { @@ -50,8 +51,8 @@ function generateCacheKey(url, options) { const filePath = pathParts.join('/'); const parts = fileName.split('.'); - // TODO - try to figure out the file type or let the user provide it, for now use jpg as default - const type = parts.length > 1 ? parts.pop() : 'jpg'; + const fileType = parts.length > 1 ? _.toLower(parts.pop()) : ''; + const type = defaultImageTypes.includes(fileType) ? fileType : 'jpg'; const cacheable = filePath + fileName + type + getQueryForCacheKey(parsedUrl, options.useQueryParamsInCacheKey); return SHA1(cacheable) + '.' + type;
Filter image types Make clear that the file type is an compatible image type.
kfiroo_react-native-cached-image
train
js
aadaeecb47bc4a0766acc3d6cf50834e41ca9076
diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index <HASH>..<HASH> 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -59,12 +59,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.8.3'; - const VERSION_ID = 20803; + const VERSION = '2.8.4-DEV'; + const VERSION_ID = 20804; const MAJOR_VERSION = 2; const MINOR_VERSION = 8; - const RELEASE_VERSION = 3; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = 4; + const EXTRA_VERSION = 'DEV'; const END_OF_MAINTENANCE = '11/2018'; const END_OF_LIFE = '11/2019';
bumped Symfony version to <I>
symfony_symfony
train
php
15ed1ebddb2bd3f4aeb7abc28b2fcdb6f14717c6
diff --git a/src/resources/views/logger/partials/activity-table.blade.php b/src/resources/views/logger/partials/activity-table.blade.php index <HASH>..<HASH> 100644 --- a/src/resources/views/logger/partials/activity-table.blade.php +++ b/src/resources/views/logger/partials/activity-table.blade.php @@ -68,7 +68,13 @@ if (Request::is('activity/cleared')) { <tr @if($drilldownStatus && $hoverable) class="clickable-row" data-href="{{$prependUrl . $activity->id}}" data-toggle="tooltip" title="{{trans('LaravelLogger::laravel-logger.tooltips.viewRecord')}}" @endif > <td> <small> - {{ $activity->id }} + @if($hoverable) + {{ $activity->id }} + @else + <a href="{{$prependUrl . $activity->id}}"> + {{ $activity->id }} + </a> + @endif </small> </td> <td>
Allow user to navigate inside the View Record Details page
jeremykenedy_laravel-logger
train
php
a9f8a372d388f143462d5d7296ad8d7225104afc
diff --git a/tests/unit/modules/test_zcbuildout.py b/tests/unit/modules/test_zcbuildout.py index <HASH>..<HASH> 100644 --- a/tests/unit/modules/test_zcbuildout.py +++ b/tests/unit/modules/test_zcbuildout.py @@ -78,7 +78,7 @@ class Base(TestCase, LoaderModuleMockMixin): [salt.utils.path.which_bin(KNOWN_VIRTUALENV_BINARY_NAMES), cls.ppy_st] ) subprocess.check_call( - [os.path.join(cls.bin_st, "pip"), "install", "-U", "setuptools"] + [os.path.join(cls.bin_st, "pip"), "install", "-U", "setuptools<50.0.0"] ) # distribute has been merged back in to setuptools as of v0.7. So, no # need to upgrade distribute, but this seems to be the only way to get
Only upgrade to `setuptools<<I>` since the test requires `easy_install`
saltstack_salt
train
py
022e15706bc596358288a9c74d0ba3de68c2612a
diff --git a/src/Event/Base/EventDispatcher.php b/src/Event/Base/EventDispatcher.php index <HASH>..<HASH> 100644 --- a/src/Event/Base/EventDispatcher.php +++ b/src/Event/Base/EventDispatcher.php @@ -443,6 +443,8 @@ class EventDispatcher implements EventDispatcherInterface case is_array($eventListener): $data = get_class($eventListener[0]) . '::' . $eventListener[1]; break; + default: + break; } $this->_loggerInstance->makeLog([
missing default statement Details of additions/deletions below: -------------------------------------------------------------- Modified: Event/Base/EventDispatcher.php -- Updated -- _logEvent added missing default statement
bluetree-service_event
train
php
040d984fcf27c14dd6c758ed9296d85d7ece5fe5
diff --git a/host/basil/utils/SimSiLibUsb.py b/host/basil/utils/SimSiLibUsb.py index <HASH>..<HASH> 100644 --- a/host/basil/utils/SimSiLibUsb.py +++ b/host/basil/utils/SimSiLibUsb.py @@ -79,8 +79,9 @@ class SiUSBDevice(object): raise NotImplementedError("To be implemented.") def WriteI2C(self, address, data): - raise NotImplementedError("To be implemented.") + print 'SiUSBDevice:WriteI2C', address, data #raise NotImplementedError("To be implemented.") - def ReadI2C(address, size): - raise NotImplementedError("To be implemented.") + def ReadI2C(self, address, size): + print 'SiUSBDevice:ReadI2C' #raise NotImplementedError("To be implemented.") + return array.array('B', range(size)) \ No newline at end of file
BUG: Fix I2C Sim
SiLab-Bonn_basil
train
py
2c9578ad58fb947489589a73044b411861ace6d1
diff --git a/container/docker/engine.py b/container/docker/engine.py index <HASH>..<HASH> 100644 --- a/container/docker/engine.py +++ b/container/docker/engine.py @@ -98,7 +98,7 @@ class Engine(BaseEngine): COMPOSE_WHITELIST = ( 'links', 'depends_on', 'cap_add', 'cap_drop', 'command', 'devices', - 'dns', 'dns_opt', 'tmpfs', 'entrypoint', 'external_links', 'labels', + 'dns', 'dns_opt', 'tmpfs', 'entrypoint', 'environment', 'external_links', 'labels', 'links', 'logging', 'log_opt', 'networks', 'network_mode', 'pids_limit', 'ports', 'security_opt', 'stop_grace_period', 'stop_signal', 'sysctls', 'ulimits', 'userns_mode', 'volumes',
Adds 'environment' to COMPOSE_WHITELIST (#<I>)
ansible_ansible-container
train
py
f61d62647a34c87330a93613d4fae742512bb085
diff --git a/cmd/minikube/cmd/start.go b/cmd/minikube/cmd/start.go index <HASH>..<HASH> 100644 --- a/cmd/minikube/cmd/start.go +++ b/cmd/minikube/cmd/start.go @@ -859,8 +859,8 @@ func validateDriverVersion(vmDriver string) { cmd := exec.Command("docker-machine-driver-kvm2", "version") output, err := cmd.Output() - // we don't want to fail if an error was returned, libmachine has a nice message for the user if - // the driver isn't present + // we don't want to fail if an error was returned, + // libmachine has a nice message for the user if the driver isn't present if err != nil { console.Warning("Error checking driver version: %v", err) return @@ -868,6 +868,7 @@ func validateDriverVersion(vmDriver string) { v := extractVMDriverVersion(string(output)) + // if the driver doesn't have return any version, it is really old, we force a upgrade. if len(v) == 0 { exit.WithCode(exit.Failure, "Please upgrade the 'docker-machine-driver-kvm2'.") }
Add comment about kvm2 force upgrade
kubernetes_minikube
train
go
d5ddd79efa63551050f1b802892b87e09cf969c7
diff --git a/revisionloader.py b/revisionloader.py index <HASH>..<HASH> 100644 --- a/revisionloader.py +++ b/revisionloader.py @@ -92,7 +92,11 @@ class RevisionLoader(object): #w = self.repo.weave_store.get_weave_or_empty(ie.file_id, tx) #if ie.revision in w: # continue - # Try another way ... + # Try another way, realising that this assumes that the + # version is not already there. In the general case, + # a shared repository might already have the revision but + # we arguably don't need that check when importing from + # a foreign system. if ie.revision != revision_id: continue text_parents = []
improve explanation of faster check in revisionloader
jelmer_python-fastimport
train
py
c0ae8e641850d4570da484d50dd6e0a00db7c02f
diff --git a/lib/Skeleton/Transaction/Transaction.php b/lib/Skeleton/Transaction/Transaction.php index <HASH>..<HASH> 100644 --- a/lib/Skeleton/Transaction/Transaction.php +++ b/lib/Skeleton/Transaction/Transaction.php @@ -244,6 +244,7 @@ abstract class Transaction { if (!$this->recurring) { $this->completed = true; } + $this->retry_attempt = 0; $this->save(); }
Reset retry_attempt if completed
tigron_skeleton-transaction
train
php
42c4908a3f76bde2093ae6e0e1d6a078976ff526
diff --git a/fermipy/jobs/target_plotting.py b/fermipy/jobs/target_plotting.py index <HASH>..<HASH> 100644 --- a/fermipy/jobs/target_plotting.py +++ b/fermipy/jobs/target_plotting.py @@ -9,6 +9,7 @@ paralleize that analysis. """ from __future__ import absolute_import, division, print_function +from os.path import splitext from fermipy.utils import init_matplotlib_backend, load_yaml @@ -42,14 +43,21 @@ class PlotCastro(Link): def run_analysis(self, argv): """Run this analysis""" args = self._parser.parse_args(argv) - castro_data = CastroData.create_from_sedfile(args.infile) + + exttype = splitext(args.infile)[-1] + if exttype in ['.fits', '.npy']: + castro_data = CastroData.create_from_sedfile(args.infile) + elif exttype in ['.yaml']: + castro_data = CastroData.create_from_yamlfile(args.infile) + else: + raise ValueError("Can not read file type %s for SED" % extype) + ylims = [1e-8, 1e-5] plot = plotCastro(castro_data, ylims) if args.outfile: plot[0].savefig(args.outfile) - return None - return plot + class PlotCastro_SG(ScatterGather):
Allow reading in yaml file SED in fermipy-plot-sed
fermiPy_fermipy
train
py
6f842a870a4b93823a31b18a371d162ca2b0e697
diff --git a/src/extensions/cookie/bootstrap-table-cookie.js b/src/extensions/cookie/bootstrap-table-cookie.js index <HASH>..<HASH> 100644 --- a/src/extensions/cookie/bootstrap-table-cookie.js +++ b/src/extensions/cookie/bootstrap-table-cookie.js @@ -373,16 +373,13 @@ $.BootstrapTable = class extends $.BootstrapTable { _toggleColumn (...args) { super._toggleColumn(...args) + UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(this.getVisibleColumns())) + } - const visibleColumns = [] - - for (const column of this.columns) { - if (column.visible) { - visibleColumns.push(column.field) - } - } + _toggleAllColumns (...args) { + super._toggleAllColumns(...args) - UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(visibleColumns)) + UtilsCookie.setCookie(this, UtilsCookie.cookieIds.columns, JSON.stringify(this.getVisibleColumns())) } selectPage (page) {
Adding cookie support for toggle all columns options
wenzhixin_bootstrap-table
train
js
72a0515429597a71ee57d62b684f720c886f0297
diff --git a/src/models/log.js b/src/models/log.js index <HASH>..<HASH> 100644 --- a/src/models/log.js +++ b/src/models/log.js @@ -101,6 +101,7 @@ async function displayLogs ({ appAddonId, until, since, filter, deploymentId }) async function watchDeploymentAndDisplayLogs ({ ownerId, appId, deploymentId, commitId, knownDeployments, quiet, follow }) { + Logger.println('Waiting for deployment to start...'); const deployment = await waitForDeploymentStart({ ownerId, appId, deploymentId, commitId, knownDeployments }); Logger.println(colors.bold.blue(`Deployment started (${deployment.uuid})`));
deploy/restart: add "waiting for deployment to start..." message
CleverCloud_clever-tools
train
js
b9538aad1d188e3c2dfa4758f05677218822895d
diff --git a/app/assets/javascripts/jquery/active_scaffold.js b/app/assets/javascripts/jquery/active_scaffold.js index <HASH>..<HASH> 100644 --- a/app/assets/javascripts/jquery/active_scaffold.js +++ b/app/assets/javascripts/jquery/active_scaffold.js @@ -148,7 +148,7 @@ $(document).ready(function() { return true; } else return false; }); - $('input.update_form, textarea.update_form, select.update_form').live('change', function(event) { + $('input.update_form:not(.recordselect), textarea.update_form, select.update_form').live('change', function(event) { var element = $(this); var value = element.is("input:checkbox:not(:checked)") ? null : element.val(); ActiveScaffold.update_column(element, element.attr('data-update_url'), element.attr('data-update_send_form'), element.attr('id'), value);
fix recordselect with update_form, it wasn't working after typing to search
activescaffold_active_scaffold
train
js
30f60cf9d53ba5385560df1195d1d550de9f7dbb
diff --git a/gulp/util/karma.conf.js b/gulp/util/karma.conf.js index <HASH>..<HASH> 100644 --- a/gulp/util/karma.conf.js +++ b/gulp/util/karma.conf.js @@ -10,7 +10,7 @@ module.exports = function(config) { // list of files / patterns to load in the browser files: [ 'node_modules/chai/chai.js', - 'dist/pixi.dev.js', + 'bin/pixi.js', 'test/lib/**/*.js', 'test/unit/**/*.js', // 'test/functional/**/*.js',
change karma path to pixi build gulp build pixi to bin/pixi.js
pixijs_pixi.js
train
js
31c7be0bed73008bb6b43fc60c23711455d66614
diff --git a/cache.go b/cache.go index <HASH>..<HASH> 100644 --- a/cache.go +++ b/cache.go @@ -26,7 +26,11 @@ func (item Item) expired(now time.Time) bool { // Returns true if the item has expired. func (item Item) Expired() bool { - return item.expired(time.Now()) + // "Inlining" of expired + if item.Expiration == emptyTime { + return false + } + return item.Expiration.Before(time.Now()) } const ( @@ -108,9 +112,14 @@ func (c *cache) Replace(k string, x interface{}, d time.Duration) error { // whether the key was found. func (c *cache) Get(k string) (interface{}, bool) { c.mu.RLock() - x, found := c.get(k) + // "Inlining" of get + item, found := c.items[k] + if !found || item.Expired() { + c.mu.RUnlock() + return nil, false + } c.mu.RUnlock() - return x, found + return item.Object, found } func (c *cache) get(k string) (interface{}, bool) {
'Inline' Get and Expired
patrickmn_go-cache
train
go
6df7622ccb92ff9385898cac70f465efa72d7a11
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ from setuptools import setup setup(name='virtualbmc', - version='0.0.2', + version='0.0.3', description=('Create virtual BMCs for controlling virtual instances ' 'via IPMI'), url='http://github.com/umago/virtualbmc',
Bump the version of the project to <I>
umago_virtualbmc
train
py
ee377bf7672e0e7e42b8f8dedbc8f7cc44e2a057
diff --git a/lib/assets/CacheManifest.js b/lib/assets/CacheManifest.js index <HASH>..<HASH> 100644 --- a/lib/assets/CacheManifest.js +++ b/lib/assets/CacheManifest.js @@ -2,6 +2,7 @@ var util = require('util'), _ = require('underscore'), errors = require('../errors'), extendWithGettersAndSetters = require('../util/extendWithGettersAndSetters'), + AssetGraph = require('../AssetGraph'), Text = require('./Text'); function CacheManifest(config) {
CacheManifest: Fixed parsing of existing cache manifest. This was actually covered by a test, but the accidentally global var 'AssetGraph' that was fixed in <I>c<I> prevented the test from failing. What are the odds?
assetgraph_assetgraph
train
js
4d65ec2de4d924fba720afb0bb97d708fc7fece6
diff --git a/intranet/utils/html.py b/intranet/utils/html.py index <HASH>..<HASH> 100644 --- a/intranet/utils/html.py +++ b/intranet/utils/html.py @@ -69,4 +69,6 @@ def safe_fcps_emerg_html(text: str, base_url: str) -> str: return attrs - return bleach.linkify(bleach.clean(text, tags=ALLOWED_TAGS, attributes=ALLOWED_ATTRIBUTES, styles=ALLOWED_STYLES), [translate_link_attr]) + return bleach.linkify( + bleach.clean(text, strip=True, tags=ALLOWED_TAGS, attributes=ALLOWED_ATTRIBUTES, styles=ALLOWED_STYLES), [translate_link_attr] + )
fix(emerg): strip bad tags in FCPS emergency announcements
tjcsl_ion
train
py
11e2234b58fb9b1518722f9a2a44a78ab75db20b
diff --git a/Template/Controller.php b/Template/Controller.php index <HASH>..<HASH> 100644 --- a/Template/Controller.php +++ b/Template/Controller.php @@ -21,7 +21,7 @@ abstract class Controller if( file_exists( $this->get_script_path() ) ) { ob_start(); - include_once( $this->get_script_path() ); + include( $this->get_script_path() ); $rendered_image = ob_get_clean(); } else
Include once? I dont think so...
askupasoftware_amarkal
train
php
866171c322fec2292e0b184b166f65ba57c89238
diff --git a/lib/poise_languages/command/mixin.rb b/lib/poise_languages/command/mixin.rb index <HASH>..<HASH> 100644 --- a/lib/poise_languages/command/mixin.rb +++ b/lib/poise_languages/command/mixin.rb @@ -136,9 +136,10 @@ module PoiseLanguages end # Create the method to inherit settings from another resource. - private define_method(:"#{name}_from_parent") { |resource| + define_method(:"#{name}_from_parent") do |resource| language_command_runtime_from_parent(name, resource) - } + end + private :"#{name}_from_parent" end # @api private @@ -205,13 +206,15 @@ module PoiseLanguages # @param name [Symbol] Language name. # @return [void] def language_command_mixin(name) - private define_method(:"#{name}_shell_out") { |*command_args| + define_method(:"#{name}_shell_out") do |*command_args| language_command_shell_out(name, *command_args) - } + end + private :"#{name}_shell_out" - private define_method(:"#{name}_shell_out!") { |*command_args| + define_method(:"#{name}_shell_out!") do |*command_args| language_command_shell_out!(name, *command_args) - } + end + private :"#{name}_shell_out!" end # @api private
My cute trick doesn't work on Ruby <I> :-( Reported in <URL>
poise_poise-languages
train
rb
fc986afbab42626e51ea8800ef622ef5d4a7a4a6
diff --git a/para-server/src/main/java/com/erudika/para/search/LuceneUtils.java b/para-server/src/main/java/com/erudika/para/search/LuceneUtils.java index <HASH>..<HASH> 100644 --- a/para-server/src/main/java/com/erudika/para/search/LuceneUtils.java +++ b/para-server/src/main/java/com/erudika/para/search/LuceneUtils.java @@ -228,7 +228,14 @@ public final class LuceneUtils { NOT_ANALYZED_FIELDS.add("token"); // these fields are not indexed - IGNORED_FIELDS = new String[]{"validationConstraints", "resourcePermissions"}; + IGNORED_FIELDS = new String[] { + "settings", // App + "datatypes", // App + "deviceState", // Thing + "deviceMetadata", // Thing + "resourcePermissions", // App + "validationConstraints" // App + }; } private LuceneUtils() { }
added more fields to be ignored when indexing
Erudika_para
train
java
d3aa071efc85507341cf65dd61414a734654f50a
diff --git a/sos/presets/redhat/__init__.py b/sos/presets/redhat/__init__.py index <HASH>..<HASH> 100644 --- a/sos/presets/redhat/__init__.py +++ b/sos/presets/redhat/__init__.py @@ -36,10 +36,15 @@ RHOSP_OPTS = SoSOptions(plugopts=[ RHOCP = "ocp" RHOCP_DESC = "OpenShift Container Platform by Red Hat" -RHOCP_OPTS = SoSOptions(all_logs=True, verify=True, plugopts=[ - 'networking.timeout=600', - 'networking.ethtool_namespaces=False', - 'networking.namespaces=200']) +RHOCP_OPTS = SoSOptions( + verify=True, skip_plugins=['cgroups'], container_runtime='crio', + no_report=True, log_size=100, + plugopts=[ + 'crio.timeout=600', + 'networking.timeout=600', + 'networking.ethtool_namespaces=False', + 'networking.namespaces=200' + ]) RH_CFME = "cfme" RH_CFME_DESC = "Red Hat CloudForms"
[presets] Adjust OCP preset options Adjust the options used by the 'ocp' preset to better reflect the current collection needs and approach. This includes disabling the `cgroups` plugin due to the large amount of mostly irrelevant data captured due to the high number of containers present on OCP nodes, ensuring the `--container-runtime` option is set to `crio` to align container-based collections, disabling HTML report generation and increasing the base log size rather than blindly enabling all-logs.
sosreport_sos
train
py
0fa5e887795b4cd4fd1250e48980898ac12033f2
diff --git a/lib/fastlane/actions/actions_helper.rb b/lib/fastlane/actions/actions_helper.rb index <HASH>..<HASH> 100644 --- a/lib/fastlane/actions/actions_helper.rb +++ b/lib/fastlane/actions/actions_helper.rb @@ -1,3 +1,5 @@ +require 'pty' + module Fastlane module Actions # Execute a shell command @@ -7,10 +9,17 @@ module Fastlane results = [] commands.each do |command| - Helper.log.info ["[SHELL]", command.yellow].join(': ') + Helper.log.info ["[SHELL COMMAND]", command.yellow].join(': ') unless Helper.is_test? - results << `#{command}` + + PTY.spawn(command) do |stdin, stdout, pid| + stdin.each do |line| + Helper.log.info ["[SHELL OUTPUT]", line.strip].join(': ') + results << line + end + end + else results << command # only when running tests end
Added live output of shell command results
fastlane_fastlane
train
rb
1bf96e2388c5e5c9974557b36409cc70658e2d10
diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index <HASH>..<HASH> 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2308,5 +2308,19 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2017080700.01); } + if ($oldversion < 2017082200.00) { + $plugins = ['radius', 'fc', 'nntp', 'pam', 'pop3', 'imap']; + + foreach ($plugins as $plugin) { + // Check to see if the plugin exists on disk. + // If it does not, remove the config for it. + if (!file_exists($CFG->dirroot . "/auth/{$plugin}/auth.php")) { + // Clean config. + unset_all_config_for_plugin("auth_{$plugin}"); + } + } + upgrade_main_savepoint(true, 2017082200.00); + } + return true; } diff --git a/version.php b/version.php index <HASH>..<HASH> 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2017081700.00; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2017082200.00; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes.
MDL-<I> auth: Remove config for old plugins Note: (<EMAIL>) Amended slightly from original to update versions.
moodle_moodle
train
php,php
a8097d6ddae5222cfd2c47cfbe626ef0b6aaca48
diff --git a/lib/dml/simpletest/testdml.php b/lib/dml/simpletest/testdml.php index <HASH>..<HASH> 100644 --- a/lib/dml/simpletest/testdml.php +++ b/lib/dml/simpletest/testdml.php @@ -1267,6 +1267,7 @@ class dml_test extends UnitTestCase { } // test get_records passing non-existing table + // with params try { $records = $DB->get_records('xxxx', array('id' => 0)); $this->fail('An Exception is missing, expected due to query against non-existing table'); @@ -1274,6 +1275,14 @@ class dml_test extends UnitTestCase { $this->assertTrue($e instanceof dml_exception); $this->assertEqual($e->errorcode, 'ddltablenotexist'); } + // and without params + try { + $records = $DB->get_records('xxxx', array()); + $this->fail('An Exception is missing, expected due to query against non-existing table'); + } catch (exception $e) { + $this->assertTrue($e instanceof dml_exception); + $this->assertEqual($e->errorcode, 'ddltablenotexist'); + } // test get_records passing non-existing column try {
MDL-<I> dml - one more test behavior without params
moodle_moodle
train
php
4017547c2cdc52fe586a1357fb6a189a26a28219
diff --git a/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/eslint.js b/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/eslint.js index <HASH>..<HASH> 100644 --- a/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/eslint.js +++ b/bundles/org.eclipse.orion.client.javascript/web/eslint/lib/eslint.js @@ -200,7 +200,7 @@ module.exports = (function() { var api = Object.create(new EventEmitter()), messages = [], - commentsAttached = false, + commentsAttached = true, currentText = null, currentConfig = null, currentTokens = null, @@ -224,7 +224,7 @@ module.exports = (function() { * problem that ESLint identified just like any other. */ try { - return esprima.parse(text, { loc: true, range: true, raw: true, tokens: true, comment: true }); + return esprima.parse(text, { loc: true, range: true, raw: true, tokens: true, comment: true, attachComment:true }); } catch (ex) { messages.push({ @@ -251,7 +251,7 @@ module.exports = (function() { api.reset = function() { this.removeAllListeners(); messages = []; - commentsAttached = false; + commentsAttached = true; currentConfig = null; currentText = null; currentTokens = null;
Bug <I> - ESLint re-attaches comments to AST
eclipse_orion.client
train
js
c37967cf4bba13493c174a7305497b9af29fd8fb
diff --git a/src/Controller/LogController.php b/src/Controller/LogController.php index <HASH>..<HASH> 100644 --- a/src/Controller/LogController.php +++ b/src/Controller/LogController.php @@ -552,6 +552,14 @@ class LogController extends AbstractActionController 'log_date_added' => strftime($melisTranslation->getDateFormatByLocate($locale), strtotime($log->log_date_added)) ); + if (strpos($melisTool->escapeHtml($translator->translate($log->log_message)), '[itemId]')) { + $rowData['log_message'] = str_replace( + '[itemId]', + $melisTool->escapeHtml($log->log_item_id), + $melisTool->escapeHtml($translator->translate($log->log_message)) + ); + } + array_push($tableData, $rowData); }
can now add the item ID in the log message that has been translated
melisplatform_melis-core
train
php
e40e2ee46cf3e8d9260e93b6bec0f2e8ed504f0a
diff --git a/dynamic_raw_id/static/dynamic_raw_id/js/dynamic_raw_id.js b/dynamic_raw_id/static/dynamic_raw_id/js/dynamic_raw_id.js index <HASH>..<HASH> 100644 --- a/dynamic_raw_id/static/dynamic_raw_id/js/dynamic_raw_id.js +++ b/dynamic_raw_id/static/dynamic_raw_id/js/dynamic_raw_id.js @@ -21,7 +21,8 @@ function dismissRelatedLookupPopup(win, chosenId) { app = element.next("a").attr("data-app"), model = element.next("a").attr("data-model"), value = element.val(), - MOUNT_URL = window.DYNAMIC_RAW_ID_MOUNT_URL || "/admin/dynamic_raw_id", + ADMIN_URL = window.DYNAMIC_RAW_ID_MOUNT_URL || "/admin/", + MOUNT_URL = ADMIN_URL + "dynamic_raw_id", admin_url_parts = window.location.pathname.split("/").slice(1, 4); var url = MOUNT_URL;
Update dynamic_raw_id.js to support custom admin url (#<I>) * Update dynamic_raw_id.js Update MOUNT_URL to work with custom admin urls * Update dynamic_raw_id.js * Update dynamic_raw_id.js
lincolnloop_django-dynamic-raw-id
train
js
b1d63491560ffc739fe50989d968ca38fbb5f766
diff --git a/luigi/contrib/external_program.py b/luigi/contrib/external_program.py index <HASH>..<HASH> 100644 --- a/luigi/contrib/external_program.py +++ b/luigi/contrib/external_program.py @@ -1,3 +1,18 @@ +""" +Template tasks for running external programs as luigi tasks. + +This module is primarily intended for when you need to call a single external +program, and it's enough to specify program arguments and environment +variables. + +If you need to run multiple commands, chain them together or pipe output +from one command to the next, you're probably better off using something like +`plumbum`_, and wrapping plumbum commands in normal luigi +:py:class:`~luigi.task.Task` s. + +.. _plumbum: https://plumbum.readthedocs.org/ +""" + import logging import os import signal
external_program: Add module-level docs Mention that plumbum may be a better alternative, if you need more advanced shell-like features when executing external programs.
spotify_luigi
train
py
277eb057336bd8a7f7bd0aa9fee28dd85c25616c
diff --git a/actionpack/test/abstract/layouts_test.rb b/actionpack/test/abstract/layouts_test.rb index <HASH>..<HASH> 100644 --- a/actionpack/test/abstract/layouts_test.rb +++ b/actionpack/test/abstract/layouts_test.rb @@ -87,18 +87,6 @@ module AbstractControllerTests end end - class WithSymbolReturningString < Base - layout :no_hello - - def index - render :template => ActionView::Template::Text.new("Hello missing symbol!") - end - private - def no_hello - nil - end - end - class WithSymbolReturningNil < Base layout :nilz
class WithSymbolReturningString is not used anywhere in the test. Secondly it seemed from the method that the intent was to test a case where layout was declared in a symbol and the method named mention in layout returns nil. That case is already covered with class class WithSymbolReturningNil . Also the case of SymbolReturningString is covered with the class WithSymbol.
rails_rails
train
rb
c2537e363c67a70c7ec453c7e4f67f2fb872727e
diff --git a/gulpfile.js b/gulpfile.js index <HASH>..<HASH> 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -27,7 +27,6 @@ gulp.task('script', function() { builtins: null, insertGlobals: false, detectGlobals: false, - standalone: 'Should', fullPaths: false }) .bundle();
Expose previous window.Should property manually
shouldjs_should.js
train
js
96741e1f0b1d11382643de0c95240044685bb46d
diff --git a/src/ol/format/wktformat.js b/src/ol/format/wktformat.js index <HASH>..<HASH> 100644 --- a/src/ol/format/wktformat.js +++ b/src/ol/format/wktformat.js @@ -495,15 +495,15 @@ ol.format.WKT.Lexer.prototype.readNumber_ = function() { do { if (c == '.') { decimal = true; - } else if (goog.isDef(c) && c.toLowerCase() == 'e') { + } else if (c == 'e' || c == 'E') { scientificNotation = true; } c = this.nextChar_(); } while ( this.isNumeric_(c, decimal) || - // once c is defined we may have a scientific number indicated by 'e' - // but only if we haven't detected a scientific number before - !scientificNotation && goog.isDef(c) && c.toLowerCase() == 'e' || + // if we haven't detected a scientific number before, 'e' or 'E' + // hint that we should continue to read + !scientificNotation && (c == 'e' || c == 'E') || // once we know that we have a scientific number, both '-' and '+' // are allowed scientificNotation && (c == '-' || c == '+')
Simplify detection of scientific notation This change allows us to remove some avoidable function calls (specifically to goog.isDef(c) and c.toLowerCase()). Additionally, the new check is simpler to read.
openlayers_openlayers
train
js
6b4b3ed29b1fb6225d29fd85ce9193421f69521d
diff --git a/lib/View/Button.php b/lib/View/Button.php index <HASH>..<HASH> 100644 --- a/lib/View/Button.php +++ b/lib/View/Button.php @@ -88,7 +88,7 @@ class View_Button extends View_HtmlElement { // {{{ Obsolete /** @obsolete */ function setAction($js=null,$page=null){ - throw $this->exception('setAction is not obsolete. use onClick or redirect method'); + throw $this->exception('setAction() is now obsolete. use onClick() or redirect() method'); return $this; }
View_Button: typo in comment
atk4_atk4
train
php
010667ba089bdaf672a39a410033ff15e3ce7522
diff --git a/actionpack/lib/action_controller/metal/conditional_get.rb b/actionpack/lib/action_controller/metal/conditional_get.rb index <HASH>..<HASH> 100644 --- a/actionpack/lib/action_controller/metal/conditional_get.rb +++ b/actionpack/lib/action_controller/metal/conditional_get.rb @@ -66,7 +66,7 @@ module ActionController # # You can also pass an object that responds to +maximum+, such as a # collection of active records. In this case +last_modified+ will be set by - # calling +maximum(:updated_at)+ on the collection (the timestamp of the + # calling <tt>maximum(:updated_at)</tt> on the collection (the timestamp of the # most recently updated record) and the +etag+ by passing the object itself. # # def index
[ci skip] Fix <tt> in doc
rails_rails
train
rb
cecc36dc36b515abe86415121000b97ece8a3dfb
diff --git a/openquake/calculators/classical.py b/openquake/calculators/classical.py index <HASH>..<HASH> 100644 --- a/openquake/calculators/classical.py +++ b/openquake/calculators/classical.py @@ -132,6 +132,7 @@ class ClassicalCalculator(base.HazardCalculator): ires = parallel.Starmap( self.core_task.__func__, iterargs, self.monitor() ).submit_all() + self.csm.sources_by_trt.clear() # save memory self.nsites = [] acc = ires.reduce(self.agg_dicts, self.zerodict()) if not self.nsites:
Saved memory in classical [skip hazardlib][demos]
gem_oq-engine
train
py
5db9833861825d43558b9a456b309be2c165bd25
diff --git a/lib/bel/version.rb b/lib/bel/version.rb index <HASH>..<HASH> 100644 --- a/lib/bel/version.rb +++ b/lib/bel/version.rb @@ -1,3 +1,3 @@ module BEL - VERSION = '0.4.0.beta.9' + VERSION = '0.4.0.beta.10' end
bumped version to beta<I>
OpenBEL_bel.rb
train
rb
f018f28604f00638773ad56a4c5ff0caabc2d522
diff --git a/Lib/ufo2fdk/outlineOTF.py b/Lib/ufo2fdk/outlineOTF.py index <HASH>..<HASH> 100644 --- a/Lib/ufo2fdk/outlineOTF.py +++ b/Lib/ufo2fdk/outlineOTF.py @@ -187,8 +187,8 @@ class OutlineOTFCompiler(object): head.checkSumAdjustment = 0 head.tableVersion = 1.0 versionMajor = getAttrWithFallback(font.info, "versionMajor") - versionMinor = getAttrWithFallback(font.info, "versionMinor") * .001 - head.fontRevision = versionMajor + versionMinor + versionMinor = getAttrWithFallback(font.info, "versionMinor") + head.fontRevision = float("%d.%d" % (versionMajor, versionMinor)) head.magicNumber = 0x5F0F3CF5 # upm head.unitsPerEm = getAttrWithFallback(font.info, "unitsPerEm")
Don't make assumptions about version minor value. In outlineOTF.py, there is code which assumes the minor version number will be less than <I>, which probably is not a safe assumption.
googlefonts_ufo2ft
train
py
46a8d9baa5df6e9b84ae814805b64dfc687ca07f
diff --git a/napi/__init__.py b/napi/__init__.py index <HASH>..<HASH> 100644 --- a/napi/__init__.py +++ b/napi/__init__.py @@ -44,12 +44,17 @@ class String(str): nsource = String(open(os.path.join(imp.find_module('napi')[1], 'functions.py')).read()) + +def register_magic(): + + from .magics import NapiMagics + ip = get_ipython() + if ip is not None: + ip.register_magics(NapiMagics(ip)) + try: from IPython import get_ipython except ImportError: pass else: - from .magics import NapiMagics - ip = get_ipython() - if ip is not None: - ip.register_magics(NapiMagics(ip)) \ No newline at end of file + register_magic() \ No newline at end of file
Added register_magic function.
abakan-zz_napi
train
py
639a3e0b32bfdd6012b0484e0343e51af5d0c81d
diff --git a/tests/unit/modules/drac_test.py b/tests/unit/modules/drac_test.py index <HASH>..<HASH> 100644 --- a/tests/unit/modules/drac_test.py +++ b/tests/unit/modules/drac_test.py @@ -98,7 +98,7 @@ class DracTestCase(TestCase): mock = MagicMock(return_value={'retcode': 0, 'stdout': 'cfgUserAdminUserName=value'}) with patch.dict(drac.__salt__, {'cmd.run_all': mock}): - self.assertEqual(drac.list_users(), {'value': {'index': 11}}) + self.assertEqual(drac.list_users(), {'value': {'index': 17}}) def test_delete_user(self): '''
Updated Unit test from <I> to <I>, to support <I> Dell DRAC user entries.
saltstack_salt
train
py
bdeab99ca2db7873df5ef655bd2932ca36e52b27
diff --git a/lib/webspicy/tester.rb b/lib/webspicy/tester.rb index <HASH>..<HASH> 100644 --- a/lib/webspicy/tester.rb +++ b/lib/webspicy/tester.rb @@ -15,12 +15,12 @@ module Webspicy scope.each_example(service) do |test_case| describe test_case.description do - before(:each) do + before(:all) do client.before(test_case, service, resource) end subject do - client.call(test_case, service, resource) + @invocation ||= client.call(test_case, service, resource) end it 'can be invoked successfuly' do @@ -50,12 +50,12 @@ module Webspicy scope.each_counterexamples(service) do |test_case| describe test_case.description do - before(:each) do + before(:all) do client.before(test_case, service, resource) end subject do - client.call(test_case, service, resource) + @invocation ||= client.call(test_case, service, resource) end it 'can be invoked successfuly' do
Do not re-invoke the web service at each step. These are fake test steps, just aimed at having good description of the various assertions. Invoking the web service each time is much much too slow.
enspirit_webspicy
train
rb
8d26d2fec39036f18d9b8411b3d901e9de232a1b
diff --git a/lib/locomotive/steam/middlewares/renderer.rb b/lib/locomotive/steam/middlewares/renderer.rb index <HASH>..<HASH> 100644 --- a/lib/locomotive/steam/middlewares/renderer.rb +++ b/lib/locomotive/steam/middlewares/renderer.rb @@ -113,6 +113,7 @@ module Locomotive::Steam 'referer' => request.referer, 'url' => request.url, 'user_agent' => request.user_agent, + 'host' => request.host_with_port } end
host variable was missing from <I>.x
locomotivecms_steam
train
rb
64fdf66d283fabd3343dce6ab10209bf270b5c29
diff --git a/TYPO3.Flow/Tests/Unit/Utility/Unicode/TextIteratorTest.php b/TYPO3.Flow/Tests/Unit/Utility/Unicode/TextIteratorTest.php index <HASH>..<HASH> 100644 --- a/TYPO3.Flow/Tests/Unit/Utility/Unicode/TextIteratorTest.php +++ b/TYPO3.Flow/Tests/Unit/Utility/Unicode/TextIteratorTest.php @@ -22,8 +22,6 @@ namespace F3\FLOW3\Utility\Unicode; * The TYPO3 project - inspiring people to share! * * */ -require_once 'PHPUnit/Framework.php'; - /** * Testcase for the TextIterator port *
[~TASK] FLOW3: Remove PHPUnit/Framework inclusion Relates to: #<I> Change-Id: I<I>c<I>e<I>b<I>a<I>db3e<I>f<I>e6efac<I>c3fbe<I> Original-Commit-Hash: a6b<I>bea<I>ec<I>a8edeb3f5a3bb6b<I>
neos_flow-development-collection
train
php
a512ac86c624ec64382b72e5ce3f0ad4f8499f2f
diff --git a/test/ModalSpec.js b/test/ModalSpec.js index <HASH>..<HASH> 100644 --- a/test/ModalSpec.js +++ b/test/ModalSpec.js @@ -84,6 +84,15 @@ describe('<Modal />', () => { it('open on prop change', () => { testModal.setProps({ open: true }); expect(modalStub).to.have.callCount(5); + expect(modalStub.firstCall.args[0]).to.deep.equal({ 'one': 1 }); + expect(modalStub.lastCall.args).to.deep.equal([ 'open' ]); + }); + + it('closes on prop change', () => { + testModal.setProps({ open: false }); + expect(modalStub).to.have.callCount(5); + expect(modalStub.firstCall.args[0]).to.deep.equal({ 'one': 1 }); + expect(modalStub.lastCall.args).to.deep.equal([ 'close' ]); }); });
added test to verify closing via props
react-materialize_react-materialize
train
js
4bd96b6c5a13b74e484149b4431bc81393f41351
diff --git a/tests/test_gvg.py b/tests/test_gvg.py index <HASH>..<HASH> 100644 --- a/tests/test_gvg.py +++ b/tests/test_gvg.py @@ -475,6 +475,18 @@ def test_implosion(): assert game.player2.field.contains("GVG_045t") +def test_implosion_commanding_shout(): + game = prepare_game() + wisp = game.player1.give(WISP) + wisp.play() + shout = game.player1.give("NEW1_036") + shout.play() + implosion = game.player1.give("GVG_045") + implosion.play(target=wisp) + assert not wisp.dead + assert len(game.player1.field) in (3, 4, 5) + + def test_iron_juggernaut(): game = prepare_empty_game() game.player2.discard_hand()
Add a test for Imp-losion + Commanding Shout Closes #<I>
jleclanche_fireplace
train
py
54e729d909087c1fada2e70c60b0c09b4fc0ae63
diff --git a/packages/perspective-viewer-d3fc/src/js/chartConfig.js b/packages/perspective-viewer-d3fc/src/js/chartConfig.js index <HASH>..<HASH> 100644 --- a/packages/perspective-viewer-d3fc/src/js/chartConfig.js +++ b/packages/perspective-viewer-d3fc/src/js/chartConfig.js @@ -120,7 +120,6 @@ export function configureMultiSvg(isSplitBy, gridlines, barSeries, dataset, colo ); } - const containerRect = container.getBoundingClientRect(); const tooltipDiv = d3 .select(container) .append("div") @@ -139,6 +138,7 @@ export function configureMultiSvg(isSplitBy, gridlines, barSeries, dataset, colo d3.select(this) .on("mouseover", () => { // Bounding rect x and y not supported by edge or IE + const containerRect = container.getBoundingClientRect(); const barRect = this.getBoundingClientRect(); const left = barRect.x + barRect.width / 2 - containerRect.x; const top = barRect.y - containerRect.y;
Moved containerRect instantiation to fix div position on toggle config
finos_perspective
train
js
71ca5e57b415c71795dc9cb3dadaf492e70c6d92
diff --git a/shared/src/main/java/com/couchbase/lite/Replicator.java b/shared/src/main/java/com/couchbase/lite/Replicator.java index <HASH>..<HASH> 100644 --- a/shared/src/main/java/com/couchbase/lite/Replicator.java +++ b/shared/src/main/java/com/couchbase/lite/Replicator.java @@ -353,7 +353,12 @@ public final class Replicator extends NetworkReachabilityListener { } } + /** + * Reset checkpoint + */ public void resetCheckpoint() { + if (this.c4ReplStatus.getActivityLevel() != kC4Stopped) + throw new IllegalStateException("Replicator is not stopped. Resetting checkpoint is only allowed when the replicator is in the stopped state."); config.setResetCheckpoint(true); }
Fixed #<I> - <I>: throw InvalidOperationException in case of failing to call resetCheckpoint() - (#<I>)
couchbase_couchbase-lite-android
train
java
1b7ee36680e24a183035c96767971e61c390cd33
diff --git a/src/ol/renderer/dom/domtilelayerrenderer.js b/src/ol/renderer/dom/domtilelayerrenderer.js index <HASH>..<HASH> 100644 --- a/src/ol/renderer/dom/domtilelayerrenderer.js +++ b/src/ol/renderer/dom/domtilelayerrenderer.js @@ -115,7 +115,7 @@ ol.renderer.dom.TileLayer.prototype.renderFrame = tilesToDrawByZ, getTileIfLoaded); var allTilesLoaded = true; - var tile, tileState, x, y; + var childTileRange, fullyLoaded, tile, tileState, x, y; for (x = tileRange.minX; x <= tileRange.maxX; ++x) { for (y = tileRange.minY; y <= tileRange.maxY; ++y) { @@ -130,7 +130,14 @@ ol.renderer.dom.TileLayer.prototype.renderFrame = } allTilesLoaded = false; - tileGrid.forEachTileCoordParentTileRange(tile.tileCoord, findLoadedTiles); + fullyLoaded = tileGrid.forEachTileCoordParentTileRange( + tile.tileCoord, findLoadedTiles); + if (!fullyLoaded) { + childTileRange = tileGrid.getTileCoordChildTileRange(tile.tileCoord); + if (!goog.isNull(childTileRange)) { + findLoadedTiles(z + 1, childTileRange); + } + } }
Use high resolution tiles in DOM renderer
openlayers_openlayers
train
js
5218ea65ecc129201a130c0f52903822824f1aed
diff --git a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php +++ b/src/Illuminate/Foundation/Testing/Concerns/InteractsWithAuthentication.php @@ -82,6 +82,8 @@ trait InteractsWithAuthentication { $expected = $this->app->make('auth')->guard($guard)->user(); + $this->assertNotNull($expected, 'The current user is not authenticated.'); + $this->assertInstanceOf( get_class($expected), $user, 'The currently authenticated user is not who was expected'
Ensure user is logged before expecting user instance type. (#<I>) * Ensure user is logged. Check the user is logged before expecting instance type. * Update InteractsWithAuthentication.php
laravel_framework
train
php
ac715ca5f196a969bb36a6a080b21eb20265e20b
diff --git a/packages/react-router/modules/Switch.js b/packages/react-router/modules/Switch.js index <HASH>..<HASH> 100644 --- a/packages/react-router/modules/Switch.js +++ b/packages/react-router/modules/Switch.js @@ -37,11 +37,12 @@ class Switch extends React.Component { componentWillReceiveProps(nextProps) { warning( !(nextProps.location && !this.props.location), - 'You cannot change from an uncontrolled to controlled Switch. You passed in a `location` prop on a re-render when initially there was none.' + '<Switch> elements should not change from controlled to uncontrolled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.' ) + warning( !(!nextProps.location && this.props.location), - 'You cannot change from a controlled to an uncontrolled Switch. You passed in a `location` prop initially but on a re-render there was none.' + '<Switch> elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.' ) }
Use warning messages more similar to React
ReactTraining_react-router
train
js
3ec987b0d07a13897f3b67f67de743f263c6f3f4
diff --git a/rdfunit-model/src/main/java/org/aksw/rdfunit/vocabulary/SHACL.java b/rdfunit-model/src/main/java/org/aksw/rdfunit/vocabulary/SHACL.java index <HASH>..<HASH> 100644 --- a/rdfunit-model/src/main/java/org/aksw/rdfunit/vocabulary/SHACL.java +++ b/rdfunit-model/src/main/java/org/aksw/rdfunit/vocabulary/SHACL.java @@ -92,6 +92,9 @@ public final class SHACL { public static final Property uniqueLang = property("uniqueLang"); public static final Property valueShape = property("valueShape"); + public static final Property and = property("and"); + public static final Property or = property("or"); + public static final Property not = property("not");
add sh:and, sh:or and sh:not properties in SHACL vocab
AKSW_RDFUnit
train
java
37820d5fce063c3694ed530221bf4a6fe78c7783
diff --git a/src/test/java/uk/org/okapibarcode/backend/SymbolTest.java b/src/test/java/uk/org/okapibarcode/backend/SymbolTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/uk/org/okapibarcode/backend/SymbolTest.java +++ b/src/test/java/uk/org/okapibarcode/backend/SymbolTest.java @@ -313,7 +313,7 @@ public class SymbolTest { } else { return new UPCEReader(); } - } else if (symbol instanceof DataBarExpanded && Character.isDigit(symbol.getContent().charAt(0))) { + } else if (symbol instanceof DataBarExpanded && symbol.getDataType() == DataType.GS1) { return new RSSExpandedReader(); } else if (symbol instanceof DataBar14 && !((DataBar14) symbol).getLinkageFlag()) { return new RSS14Reader();
DataBar Expanded: allow non-GS1 content, even though it's not recommended (and is not the default for this symbol type)
woo-j_OkapiBarcode
train
java
6a086f5218a03a55e9d0bd63e3db1fcd08c489b1
diff --git a/moco-core/src/main/java/com/github/dreamhead/moco/util/Jsons.java b/moco-core/src/main/java/com/github/dreamhead/moco/util/Jsons.java index <HASH>..<HASH> 100644 --- a/moco-core/src/main/java/com/github/dreamhead/moco/util/Jsons.java +++ b/moco-core/src/main/java/com/github/dreamhead/moco/util/Jsons.java @@ -30,7 +30,7 @@ import static com.google.common.collect.ImmutableList.toImmutableList; import static java.lang.String.format; public final class Jsons { - private static final Logger logger = LoggerFactory.getLogger(Jsons.class); + private static Logger logger = LoggerFactory.getLogger(Jsons.class); private static final TypeFactory DEFAULT_FACTORY = TypeFactory.defaultInstance(); private static final ObjectMapper DEFAULT_MAPPER = new ObjectMapper();
removed unused final from jsons
dreamhead_moco
train
java
1ab154fd928abcfdeb78b84d6a8d3e86bcfaeb19
diff --git a/agents/builtin/mysql/mysql_test.go b/agents/builtin/mysql/mysql_test.go index <HASH>..<HASH> 100644 --- a/agents/builtin/mysql/mysql_test.go +++ b/agents/builtin/mysql/mysql_test.go @@ -289,7 +289,7 @@ func TestMySQL(t *testing.T) { require.Len(t, buckets, 1) actual := buckets[0] - assert.InDelta(t, 0.1, actual.MQueryTimeSum, 0.05) + assert.InDelta(t, 0.1, actual.MQueryTimeSum, 0.09) expected := &qanpb.MetricsBucket{ Fingerprint: "SELECT `sleep` (?)", DSchema: "world", @@ -324,8 +324,8 @@ func TestMySQL(t *testing.T) { require.Len(t, buckets, 1) actual := buckets[0] - assert.InDelta(t, 0, actual.MQueryTimeSum, 0.05) - assert.InDelta(t, 0, actual.MLockTimeSum, 0.05) + assert.InDelta(t, 0, actual.MQueryTimeSum, 0.09) + assert.InDelta(t, 0, actual.MLockTimeSum, 0.09) expected := &qanpb.MetricsBucket{ Fingerprint: "SELECT * FROM `city`", DSchema: "world",
Fix tests on (slow) Travis CI.
percona_pmm
train
go
d589636d6f4f684021ad9d0d8fd3ee8269987894
diff --git a/cmd/juju/commands/synctools.go b/cmd/juju/commands/synctools.go index <HASH>..<HASH> 100644 --- a/cmd/juju/commands/synctools.go +++ b/cmd/juju/commands/synctools.go @@ -50,8 +50,8 @@ var _ cmd.Command = (*syncToolsCommand)(nil) const synctoolsDoc = ` This copies the Juju agent software from the official agent binaries store -(located at https://streams.canonical.com/juju) into a model. -It is generally done when the model is without Internet access. +(located at https://streams.canonical.com/juju) into the controller. +It is generally done when the controller is without Internet access. Instead of the above site, a local directory can be specified as source. The online store will, of course, need to be contacted at some point to get @@ -63,14 +63,14 @@ Examples: juju sync-agent-binaries --debug --source=/home/ubuntu/sync-agent-binaries See also: - upgrade-model + upgrade-controller ` func (c *syncToolsCommand) Info() *cmd.Info { return jujucmd.Info(&cmd.Info{ Name: "sync-agent-binaries", - Purpose: "Copy agent binaries from the official agent store into a local model.", + Purpose: "Copy agent binaries from the official agent store into a local controller.", Doc: synctoolsDoc, Aliases: []string{"sync-tools"}, })
fix lp:<I>, replace mention of model with controller
juju_juju
train
go
72b51ef875ea80fc1761e7d83e0eae2fe2e07508
diff --git a/test/unit/result_test.rb b/test/unit/result_test.rb index <HASH>..<HASH> 100644 --- a/test/unit/result_test.rb +++ b/test/unit/result_test.rb @@ -37,7 +37,7 @@ class ResultTest < GeocoderTestCase def test_result_accepts_reverse_coords_in_reasonable_range_for_madison_square_garden Geocoder::Lookup.street_services.each do |l| next unless File.exist?(File.join("test", "fixtures", "#{l.to_s}_madison_square_garden")) - next if [:bing, :esri, :geocoder_ca, :google_places_search, :geocoder_us, :geoportail_lu].include? l # Reverse fixture does not match forward + next if [:bing, :esri, :geocoder_ca, :google_places_search, :geoportail_lu].include? l # Reverse fixture does not match forward Geocoder.configure(:lookup => l) set_api_key!(l) result = Geocoder.search([40.750354, -73.993371]).first
Remove reference to :geocoder_us lookup. (should have been part of fc9dc2e<I>c0ce1e<I>e4e<I>ff5f5d4c5b<I>ae<I>)
alexreisner_geocoder
train
rb
da68c0c2211e10cb16288704165d3e24cfcadd72
diff --git a/www/setup.py b/www/setup.py index <HASH>..<HASH> 100644 --- a/www/setup.py +++ b/www/setup.py @@ -113,7 +113,7 @@ bower_json = { "angular": ANGULAR_TAG, "angular-animate": ANGULAR_TAG, "angular-bootstrap": "~0.6.0", - "angular-ui-router": "~0.2.0", + "angular-ui-router": "0.2.7", "restangular": "latest", "lodash": "latest", "html5shiv": "~3.6.2",
Ticket #<I> `grunt prod` no longer works.. - Force to use angular-ui-router <I> - angular-ui-router <I> (which was released yesterday) breaks the build.
buildbot_buildbot
train
py
43e13d30ef962f67d536daef02b0240143977561
diff --git a/src/u.js b/src/u.js index <HASH>..<HASH> 100644 --- a/src/u.js +++ b/src/u.js @@ -747,6 +747,21 @@ /** + * prfx method + * get prefixed version of css properties + * @param {string} a - css property + * @param {undefined} b,c,d - placeholder variables + * @return {string} prefixed css property + */ + u.prfx = function prfx(a,b,c,d){ + for (d?d=b.toUpperCase():b=4;!d&&b--;d=(d=d.replace(/-(.)/g,prfx)) in (new Image).style&&d) { + d=[['Moz-','Webkit-','Ms-','O-'][b]]+a; + } + return d; + }, + + + /** * stop method * preventDefaut * @param {object} e - event
add prfx() method to get prefixed css property
iamso_u.js
train
js
cd75afe050ec8effa47f2674f31e5888b658ed85
diff --git a/couriers/australia_post/index.js b/couriers/australia_post/index.js index <HASH>..<HASH> 100644 --- a/couriers/australia_post/index.js +++ b/couriers/australia_post/index.js @@ -7,6 +7,14 @@ function valid(connote) { if (typeof connote != "string") { return false; } + + connote = connote.trim().toUpperCase(); + + // handle 14 character couriers please + if (connote.length === 14 && connote.indexOf("CP") === 0) { + return false; + } + return [10, 14, 18, 21, 39].indexOf(connote.length) != -1; } diff --git a/couriers/australia_post/index.test.js b/couriers/australia_post/index.test.js index <HASH>..<HASH> 100644 --- a/couriers/australia_post/index.test.js +++ b/couriers/australia_post/index.test.js @@ -16,6 +16,7 @@ describe("Australia Post", () => { describe("with an invalid connote", () => { test("returns false", () => { + expect(australia_post.valid("CP000000000000")).toBe(false); // 14 Couriers Please expect(australia_post.valid("12345")).toBe(false); expect(australia_post.valid("")).toBe(false); expect(australia_post.valid(null)).toBe(false);
Return false if a couriers please connote Australia Post and Couriers Please both have <I> digit connotes however Couriers Please prepends theirs with 'CP'
robzolkos_courier_finder
train
js,js
b0c6785afc443d51babea2d8643b4c92fa8a0922
diff --git a/framework/yii/data/Pagination.php b/framework/yii/data/Pagination.php index <HASH>..<HASH> 100644 --- a/framework/yii/data/Pagination.php +++ b/framework/yii/data/Pagination.php @@ -48,7 +48,7 @@ use yii\base\Object; * } * * // display pagination - * LinkPager::widget(array( + * echo LinkPager::widget(array( * 'pagination' => $pages, * )); * ~~~
Add echo into docs for link pager I'm not sure if echo should be mentioned, but without the echo before the LinkPager::widget() the user would see nothing.
yiisoft_yii2-debug
train
php
0ed6c76de51b9fabafa630e8918e793b69d782af
diff --git a/gcs/bucket.go b/gcs/bucket.go index <HASH>..<HASH> 100644 --- a/gcs/bucket.go +++ b/gcs/bucket.go @@ -79,7 +79,7 @@ type Bucket interface { ctx context.Context, req *CopyObjectRequest) (*Object, error) - // Compose zero or more source objects into a single destination object by + // Compose one or more source objects into a single destination object by // concatenating. Any existing generation of the destination name will be // overwritten. // diff --git a/gcs/requests.go b/gcs/requests.go index <HASH>..<HASH> 100644 --- a/gcs/requests.go +++ b/gcs/requests.go @@ -86,7 +86,7 @@ const MaxSourcesPerComposeRequest = 32 // Cf. https://cloud.google.com/storage/docs/composite-objects#_Count const MaxComponentCount = 1024 -// A request to compose multiple objects into a single composite object. +// A request to compose one or more objects into a single composite object. type ComposeObjectsRequest struct { // The name of the destination composite object. DstName string @@ -99,7 +99,7 @@ type ComposeObjectsRequest struct { // MaxComponentCount. DstGenerationPrecondition *int64 - // The source objects from which to compose. + // The source objects from which to compose. This must be non-empty. Sources []ComposeSource }
Fixed the ComposeObjects description. The text "zero or more" was never correct. Previously "two or more" would have been correct, but since Google-internal bug <I> was fixed, now it's "one ore more".
jacobsa_gcloud
train
go,go
ca0f2292ec8127dc463a5b26426737334ed3c0bf
diff --git a/lib/bolt/version.rb b/lib/bolt/version.rb index <HASH>..<HASH> 100644 --- a/lib/bolt/version.rb +++ b/lib/bolt/version.rb @@ -1,3 +1,3 @@ module Bolt - VERSION = '0.0.3'.freeze + VERSION = '0.0.4'.freeze end
(GEM) update bolt version to <I>
puppetlabs_bolt
train
rb
39657d3f6b64204688d60d84b9c764bb582ad2b6
diff --git a/lib/ronin/ui/command_line/command.rb b/lib/ronin/ui/command_line/command.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/ui/command_line/command.rb +++ b/lib/ronin/ui/command_line/command.rb @@ -35,7 +35,7 @@ module Ronin # Creates a new Command object. # def initialize(&block) - @name = $0 + @name = File.basename($0) Options.new(@name) do |opts| define_options(opts)
Use the File.basename of $0 for the command name.
ronin-ruby_ronin
train
rb
59605db5230bc4fff4570a4c8df160505c793962
diff --git a/EntityContext.js b/EntityContext.js index <HASH>..<HASH> 100644 --- a/EntityContext.js +++ b/EntityContext.js @@ -301,7 +301,7 @@ JEFRi.EntityComparator = function(a, b){ { //Need a setter var callback = function(){}; definition.Constructor.prototype['set' + field] = function(entity) { - var id = entity.id(); + var id = entity[relationship.to.property](); if( !(id === this[relationship.from.property]())) { //Changing this[field] = entity;
Moved Availibities to FieldRep from Users
DavidSouther_JEFRi
train
js
e568ef1a39f83475398418674c76871f27e4d92d
diff --git a/src/rez/bind/rez.py b/src/rez/bind/rez.py index <HASH>..<HASH> 100644 --- a/src/rez/bind/rez.py +++ b/src/rez/bind/rez.py @@ -31,7 +31,7 @@ def bind(path, version_range=None, opts=None, parser=None): with make_package("rez", path, make_root=make_root) as pkg: pkg.version = version pkg.commands = commands - pkg.requires = ["python-2.6+<3"] + pkg.requires = ["python-2.7+<4"] pkg.variants = [system.variant] return pkg.installed_variants
expand rez-binds requirement range
nerdvegas_rez
train
py
cadf436ccd2e0f0af6b95eed5e8bb81fbf572394
diff --git a/lib/chef/provider/aws_key_pair.rb b/lib/chef/provider/aws_key_pair.rb index <HASH>..<HASH> 100644 --- a/lib/chef/provider/aws_key_pair.rb +++ b/lib/chef/provider/aws_key_pair.rb @@ -176,7 +176,7 @@ class Chef::Provider::AwsKeyPair < Chef::Provider::AwsProvider @current_resource = Chef::Resource::AwsKeyPair.new(new_resource.name, run_context) current_key_pair = ec2.key_pairs[new_resource.name] - if current_key_pair + if current_key_pair && current_key_pair.exists? @current_fingerprint = current_key_pair ? current_key_pair.fingerprint : nil else current_resource.action :delete
Make sure the EC2 ssh key exists upstream
chef_chef-provisioning-aws
train
rb
a276665d572d8568d25b7ac014f24cf20aec3f94
diff --git a/lib/espn_rb/headline_response.rb b/lib/espn_rb/headline_response.rb index <HASH>..<HASH> 100644 --- a/lib/espn_rb/headline_response.rb +++ b/lib/espn_rb/headline_response.rb @@ -12,13 +12,7 @@ class HeadlineResponse # define each so that Enumerable methods work properly. def each &block - @responses.each do |response| - if block_given? - block.call response - else - yield response - end - end + @responses.each &block end # Allows the user to specify which HeadlineItem they'd like to work with via it's index in the @responses array
Simplify HeadlineResponse#each.
rondale-sc_EspnRb
train
rb
efa345022e30de827274f208b4eccdae341eb125
diff --git a/src/Uri.php b/src/Uri.php index <HASH>..<HASH> 100644 --- a/src/Uri.php +++ b/src/Uri.php @@ -78,8 +78,8 @@ class Uri extends LaminasUri $path = $data['path'] . (isset($data['query']) ? '?' . $data['query'] : ''); $frag = isset($data['fragment']) ? '#' . $data['fragment'] : ''; - if ($absolute || (isset($data['scheme']) && $data['scheme'] !== $curr['scheme'])) { - return $data['scheme'] . '://' . $host . $path . $frag; + if ($absolute || (isset($data['scheme']) && $data['scheme'] !== ($curr['scheme'] ?? null))) { + return (isset($data['scheme']) ? $data['scheme'] . ':' : '') . '//' . $host . $path . $frag; } if ((isset($data['host']) && $data['host'] !== $curr['host']) || (isset($data['port']) && $data['port'] !== $curr['port'])
fixed linkTo method in edge cases with no schema
vakata_http
train
php
12a696cbe5fa822415b61e0d422f8d32a7a42992
diff --git a/src/ActivitylogServiceProvider.php b/src/ActivitylogServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/ActivitylogServiceProvider.php +++ b/src/ActivitylogServiceProvider.php @@ -43,9 +43,7 @@ class ActivitylogServiceProvider extends ServiceProvider public static function determineActivityModel(): string { - $activityModel = config('laravel-activitylog.activity_model') !== null ? - config('laravel-activitylog.activity_model') : - Activity::class; + $activityModel = config('laravel-activitylog.activity_model') ?? Activity::class; if (! is_a($activityModel, Activity::class, true)) { throw InvalidConfiguration::modelIsNotValid($activityModel);
Using Null coalescing operator (#<I>) Using null coalescing operator instead of ternary operator.
spatie_laravel-activitylog
train
php
83a9ee6b00def704b96b9bde56e031a318ff037c
diff --git a/template/View.php b/template/View.php index <HASH>..<HASH> 100644 --- a/template/View.php +++ b/template/View.php @@ -382,11 +382,15 @@ class View extends \lithium\core\Object { $_renderer = $this->_renderer; $_loader = $this->_loader; $filters = $this->outputFilters; - $params = compact('step', 'params', 'options') + array('data' => $data + $filters); + $params = compact('step', 'params', 'options') + array( + 'data' => $data + $filters, + 'loader' => $_loader, + 'renderer' => $_renderer + ); - $filter = function($self, $params) use (&$_renderer, &$_loader) { - $template = $_loader->template($params['step']['path'], $params['params']); - return $_renderer->render($template, $params['data'], $params['options']); + $filter = function($self, $params) { + $template = $params['loader']->template($params['step']['path'], $params['params']); + return $params['renderer']->render($template, $params['data'], $params['options']); }; $result = $this->_filter(__METHOD__, $params, $filter);
Make view step filter pass renderer & template in param instead of use
UnionOfRAD_lithium
train
php
c3b0d2592fb3ae1d30c8012959925cb46357d149
diff --git a/lib/rabl/builder.rb b/lib/rabl/builder.rb index <HASH>..<HASH> 100644 --- a/lib/rabl/builder.rb +++ b/lib/rabl/builder.rb @@ -106,7 +106,8 @@ module Rabl # data_name(@user => :person) => :person # data_name(@users) => :user def data_name(data) - return data.values.first if data.is_a?(Hash) + return data.values.first if data.is_a?(Hash) # @user => :user + data = @_object.send(data) if data.is_a?(Symbol) # :address @options[:engine].model_name(data) end
Adds support for determining type for data symbols
nesquena_rabl
train
rb
68849c082a751163ae7362f42a5fb6f7c4b74e87
diff --git a/admin/configvars.php b/admin/configvars.php index <HASH>..<HASH> 100644 --- a/admin/configvars.php +++ b/admin/configvars.php @@ -218,16 +218,17 @@ class configvarrss extends configvar { } $timenow = time(); $timeformat = get_string('strftimedaytime'); + $timeformat = substr($timeformat, 1); for ($tz = -26; $tz <= 26; $tz++) { $zone = (float)$tz/2.0; $usertime = $timenow + ($tz * 1800); if ($tz == 0) { - $timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT)"; + $timezones["$zone"] = gmdate($timeformat, $usertime)." (GMT)"; } else if ($tz < 0) { - $timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT$zone)"; + $timezones["$zone"] = gmdate($timeformat, $usertime)." (GMT$zone)"; } else { - $timezones["$zone"] = gmstrftime($timeformat, $usertime)." (GMT+$zone)"; + $timezones["$zone"] = gmdate($timeformat, $usertime)." (GMT+$zone)"; } }
Patching with a metahack to handle our date-format-string compatibility hack.
moodle_moodle
train
php
9384459015b37e1671aebadc4b8c25dc9e1e033f
diff --git a/google-http-client/src/main/java/com/google/api/client/util/escape/PercentEscaper.java b/google-http-client/src/main/java/com/google/api/client/util/escape/PercentEscaper.java index <HASH>..<HASH> 100644 --- a/google-http-client/src/main/java/com/google/api/client/util/escape/PercentEscaper.java +++ b/google-http-client/src/main/java/com/google/api/client/util/escape/PercentEscaper.java @@ -65,10 +65,10 @@ public class PercentEscaper extends UnicodeEscaper { public static final String SAFEPATHCHARS_URLENCODER = "-_.!~*'()@:$&,;=+"; /** - * Contains the save characters plus all reserved characters. This happens to be the safe path - * characters plus those characters which are reserved for URI segments, namely '+', '/', and '?'. + * Contains the safe characters plus all reserved characters. This happens to be the safe path + * characters plus those characters which are reserved for URI segments, namely '/' and '?'. */ - public static final String SAFE_PLUS_RESERVED_CHARS_URLENCODER = SAFEPATHCHARS_URLENCODER + "+/?"; + public static final String SAFE_PLUS_RESERVED_CHARS_URLENCODER = SAFEPATHCHARS_URLENCODER + "/?"; /** * A string of characters that do not need to be encoded when used in URI user info part, as
fix: include '+' in SAFEPATHCHARS_URLENCODER (#<I>)
googleapis_google-http-java-client
train
java
38a144fdeae69b325bb65e3c1d777881a5feef8e
diff --git a/tests/test_contentsmanager.py b/tests/test_contentsmanager.py index <HASH>..<HASH> 100644 --- a/tests/test_contentsmanager.py +++ b/tests/test_contentsmanager.py @@ -767,6 +767,7 @@ def test_global_pairing_allows_to_save_other_file_types(nb_file, tmpdir): compare_notebooks(nb, nb2) +@skip_if_dict_is_not_ordered @pytest.mark.parametrize('nb_file', list_notebooks('R')) def test_python_kernel_preserves_R_files(nb_file, tmpdir): """Opening a R file with a Jupyter server that has no R kernel should not modify the file"""
Skip test when dict is not ordered
mwouts_jupytext
train
py
34868921444bedb350181898bbfe9ca83f314745
diff --git a/src/Models/Permission.php b/src/Models/Permission.php index <HASH>..<HASH> 100644 --- a/src/Models/Permission.php +++ b/src/Models/Permission.php @@ -105,7 +105,7 @@ class Permission extends Model implements PermissionContract $permission = static::getPermissions()->where('name', $name)->where('guard_name', $guardName)->first(); if (! $permission) { - return static::create(['guard_name' => $guardName, 'name' => $name]); + return static::create(['name' => $name, 'guard_name' => $guardName]); } return $permission;
Update Permission.php Just switched the elements around for consistency with other parts of the code
spatie_laravel-permission
train
php
5e6028a4603f227c1ab17d68017726688f073409
diff --git a/spec/helper.rb b/spec/helper.rb index <HASH>..<HASH> 100644 --- a/spec/helper.rb +++ b/spec/helper.rb @@ -1,9 +1,5 @@ +# encoding: utf-8 require 'simplecov' -# HACK - couldn't get tests to run without this, simple cov barfed with the following error: -# .../simplecov-0.5.4/lib/simplecov/source_file.rb:157:in `block in process_skipped_lines!': invalid byte sequence in US-ASCII #(ArgumentError) -# I intend to find a better solution before making the pull request -Encoding.default_external = Encoding::UTF_8 -Encoding.default_internal = Encoding::UTF_8 SimpleCov.start require 'twitter'
removing encoding hack on specs helper
sferik_twitter
train
rb
922da100992d315fdcded05583c568813fa6dcd4
diff --git a/webapi/webapi.go b/webapi/webapi.go index <HASH>..<HASH> 100644 --- a/webapi/webapi.go +++ b/webapi/webapi.go @@ -83,7 +83,7 @@ func serveResults(w http.ResponseWriter, r *http.Request) { URL: url, Concurrency: 5, TotalRequests: 1000, - RequestTimeout: time.Duration(7), + RequestTimeout: time.Duration(5 * time.Second), Regions: []string{"us-east-1"}, }
7 nanoseconds is just too small of a timeout
goadapp_goad
train
go
917bcb6ff3f411e59f6c85325d1140f48897dea6
diff --git a/asap.js b/asap.js index <HASH>..<HASH> 100644 --- a/asap.js +++ b/asap.js @@ -1,7 +1,6 @@ "use strict"; var rawAsap = require("./raw"); -var domain = require("domain"); var freeTasks = []; /** @@ -23,7 +22,7 @@ function asap(task) { rawTask = new RawTask(); } rawTask.task = task; - rawTask.domain = domain.active; + rawTask.domain = process.domain; rawAsap(rawTask); }
Remove dependency on domain in asap Per @rkatic. Thanks.
kriskowal_asap
train
js
d7cb9b7c55205a64a0964afb007f0808236b9a4e
diff --git a/salt/utils/schedule.py b/salt/utils/schedule.py index <HASH>..<HASH> 100644 --- a/salt/utils/schedule.py +++ b/salt/utils/schedule.py @@ -305,9 +305,9 @@ class Schedule(object): else: func = None if func not in self.functions: - log.info( + log.warn( 'Invalid function: {0} in job {1}. Ignoring.'.format( - job, func + func, job ) ) continue
A missing schedule function should be a "warn" rather than "info". Fix the ordering of the fields in the message format.
saltstack_salt
train
py
49c98cca8781a05e95a40ef1b030fd04b790fded
diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index <HASH>..<HASH> 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -3560,6 +3560,9 @@ public class SessionCreateParams extends ApiRequestParams { } public enum PaymentMethodType implements ApiRequestParams.EnumParam { + @SerializedName("alipay") + ALIPAY("alipay"), + @SerializedName("bacs_debit") BACS_DEBIT("bacs_debit"),
Codegen for openapi cfb1c<I>
stripe_stripe-java
train
java
e6336eac04aae9ec3e9cc2b2c9c5dc4e4279a84e
diff --git a/vendor/seahorse/lib/seahorse/client/configuration.rb b/vendor/seahorse/lib/seahorse/client/configuration.rb index <HASH>..<HASH> 100644 --- a/vendor/seahorse/lib/seahorse/client/configuration.rb +++ b/vendor/seahorse/lib/seahorse/client/configuration.rb @@ -54,7 +54,7 @@ module Seahorse # @api private Defaults = Class.new(Array) do def each(&block) - reverse.each(&block) + reverse.to_a.each(&block) end end
Don't blow the stack on JRuby The Defaults class was making an assumption about the return value of Array#reverse that doesn't hold up on JRuby nor will it on Ruby <I> once that comes out. Calling to_a after reverse ensures we have an actual Array object so we don't recursively call the overridden each method until things blow up.
aws_aws-sdk-ruby
train
rb
6f9cd593a7c8e4e4168da0ecf485cdc11d15e703
diff --git a/ghost/admin/app/components/gh-post-settings-menu/email.js b/ghost/admin/app/components/gh-post-settings-menu/email.js index <HASH>..<HASH> 100644 --- a/ghost/admin/app/components/gh-post-settings-menu/email.js +++ b/ghost/admin/app/components/gh-post-settings-menu/email.js @@ -125,6 +125,7 @@ export default Component.extend({ if (email.status === 'failed') { throw new EmailFailedError(email.error); } + pollTimeout += RETRY_EMAIL_POLL_LENGTH; } }
🐛 Fixed retry email not timing out on poll no refs Fixes a small bug in email retry logic meant we never timeout on polling for email retry while listening for the email status to see if it failed or submitted.
TryGhost_Ghost
train
js
580054138e57e58d7172592fd6931d2ce472048f
diff --git a/spec/features/payments_spec.rb b/spec/features/payments_spec.rb index <HASH>..<HASH> 100644 --- a/spec/features/payments_spec.rb +++ b/spec/features/payments_spec.rb @@ -37,11 +37,15 @@ feature 'Payments' do expect(page).to have_content 'Successful transaction' end - scenario 'Fails to complete a transaction with an invalid credit card', js: true do - fill_in 'card_number', with: '4111111111111112' - click_button 'Submit' - - expect(page).to have_content 'Declined: One or more fields in the request contains invalid data' - end + # TODO: this test is currently failing because it depends on cookies being set, and the way + # the tests are running right now, we end up on a different server for the /confirm page, so the + # cookies aren't there + # scenario 'Fails to complete a transaction with an invalid credit card', js: true do + # page.driver.browser.set_cookie("auth_token=#{auth_token_value}") + # fill_in 'card_number', with: '4111111111111112' + # click_button 'Submit' + # + # expect(page).to have_content 'Declined: One or more fields in the request contains invalid data' + # end end end
for now, comment out test for a failed transaction (see TODO comment)
promptworks_cybersourcery
train
rb
e7b91119543bc446e6926dc8d2fa52b6969a541f
diff --git a/lib/flt/support.rb b/lib/flt/support.rb index <HASH>..<HASH> 100644 --- a/lib/flt/support.rb +++ b/lib/flt/support.rb @@ -681,7 +681,7 @@ module Flt while i>=0 digits[i] += 1 if digits[i] == base - digits[i] == 0 + digits[i] = 0 else break end
Fix bug in Reader#adjusted_digits: round up was incorrect.
jgoizueta_flt
train
rb