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
|
---|---|---|---|---|---|
03e871b7f28de8bcf34162e8bc89e117f1a99de3 | diff --git a/src/single-spa-react.js b/src/single-spa-react.js
index <HASH>..<HASH> 100644
--- a/src/single-spa-react.js
+++ b/src/single-spa-react.js
@@ -157,10 +157,11 @@ function chooseDomElementGetter(opts, props) {
}
function defaultDomElementGetter(props) {
- const htmlId = `single-spa-application:${props.appName || props.name}`
- if (!htmlId) {
+ const appName = props.appName || props.name
+ if (!appName) {
throw Error(`single-spa-react was not given an application name as a prop, so it can't make a unique dom element container for the react application`)
}
+ const htmlId = `single-spa-application:${appName}`
return function defaultDomEl() {
let domElement = document.getElementById(htmlId) | Fix check to ensure an application name is given as a prop (#<I>) | CanopyTax_single-spa-react | train | js |
8c767f59207bdae1a6c090212952fcea07f78523 | diff --git a/TYPO3.Flow/Classes/Security/Authentication/Controller/AuthenticationController.php b/TYPO3.Flow/Classes/Security/Authentication/Controller/AuthenticationController.php
index <HASH>..<HASH> 100755
--- a/TYPO3.Flow/Classes/Security/Authentication/Controller/AuthenticationController.php
+++ b/TYPO3.Flow/Classes/Security/Authentication/Controller/AuthenticationController.php
@@ -30,7 +30,7 @@ namespace F3\FLOW3\Security\Authentication\Controller;
*/
class AuthenticationController extends \F3\FLOW3\MVC\Controller\ActionController {
- /**
+ /**
* The authentication manager
* @var \F3\FLOW3\Security\Authentication\ManagerInterface
*/ | [~TASK] FLOW3 (Security): Fixed a comment.
Original-Commit-Hash: 9d1dd7c<I>a<I>d3d<I>ad<I>a<I>eadc<I> | neos_flow-development-collection | train | php |
d4e5de834aeaee536df0ffd998be1f1660eee2d1 | diff --git a/lib/node_modules/@stdlib/math/base/dist/normal/pdf/examples/index.js b/lib/node_modules/@stdlib/math/base/dist/normal/pdf/examples/index.js
index <HASH>..<HASH> 100644
--- a/lib/node_modules/@stdlib/math/base/dist/normal/pdf/examples/index.js
+++ b/lib/node_modules/@stdlib/math/base/dist/normal/pdf/examples/index.js
@@ -2,9 +2,9 @@
var pdf = require( './../lib' );
-var x;
-var mu;
var sigma;
+var mu;
+var x;
var v;
var i; | Reorder vars according to length | stdlib-js_stdlib | train | js |
a2345c53199a03d691fedc9ca5417a2ecdf023f7 | diff --git a/spec/db.spec.js b/spec/db.spec.js
index <HASH>..<HASH> 100644
--- a/spec/db.spec.js
+++ b/spec/db.spec.js
@@ -807,6 +807,24 @@ describe('db', () => {
});
});
}
+
+ if (dbClient === 'postgresql') {
+ describe('EXPLAIN', () => {
+ it('should execute a single query', async () => {
+ const results = await dbConn.executeQuery('explain select * from users');
+
+ expect(results).to.have.length(1);
+ const [result] = results;
+
+ expect(result).to.have.property('command').to.eql('EXPLAIN');
+ expect(result).to.have.property('rows').to.have.length.above(0);
+ expect(result).to.have.deep.property('fields').to.have.length(1);
+ expect(result).to.have.deep.property('fields[0].name').to.eql('QUERY PLAN');
+ expect(result).to.have.property('affectedRows').to.eql(undefined);
+ expect(result).to.have.property('rowCount').to.eql(undefined);
+ });
+ });
+ }
});
});
}); | Add test for PG EXPLAIN command | falcon-client_falcon-core | train | js |
9f13c4966392dec8b5daef2581b61933bda55d36 | diff --git a/tests/test_pages.py b/tests/test_pages.py
index <HASH>..<HASH> 100644
--- a/tests/test_pages.py
+++ b/tests/test_pages.py
@@ -335,7 +335,6 @@ def test_repeat(graph, outpdf):
graph.save(outpdf)
[email protected](__libqpdf_version__ < '10.3.2', reason="qpdf issue 514")
def test_add_twice_without_copy_foreign(graph, outpdf):
out = Pdf.new()
out.pages.append(graph.pages[0])
@@ -349,7 +348,6 @@ def test_repr_pagelist(fourpages):
assert '4' in repr(fourpages.pages)
[email protected](__libqpdf_version__ < '10.3.2', reason="qpdf issue 514")
def test_foreign_copied_pages_are_true_copies(graph, outpdf):
out = Pdf.new()
for _ in range(4): | Drop some now-unsupported qpdf version xfail tags | pikepdf_pikepdf | train | py |
7fef685e2cf68a4172bad077614277b82ffafa15 | diff --git a/tethne/readers/scopus.py b/tethne/readers/scopus.py
index <HASH>..<HASH> 100644
--- a/tethne/readers/scopus.py
+++ b/tethne/readers/scopus.py
@@ -232,13 +232,15 @@ def _handle_affiliations(affiliationsdata, aulast, auinit):
institutions[aname] = [', '.join([inst, nation])]
except IndexError: # Blank record part (stray delimiter).
pass
- authors = [ ' '.join(a) for a in zip(aulast, auinit) ]
+
+ # inst_list should be a list of lists, ordered by aulast/auinit.
+ authors = [ ' '.join(a) for a in zip(aulast, auinit) ] # To use as keys.
inst_list = []
for au in authors:
- if au in institutions:
+ if au in institutions: # Data available.
inst_list.append(institutions[au])
else:
- inst_list.append([])
+ inst_list.append([]) # No data for that author.
return inst_list | handled case where there are no affiliations in a Scopus record | diging_tethne | train | py |
530613a239b830d0eb4389333b1741a7999765a4 | diff --git a/analysis/token_filters/stop_tokens_filter/stop_tokens_filter.go b/analysis/token_filters/stop_tokens_filter/stop_tokens_filter.go
index <HASH>..<HASH> 100644
--- a/analysis/token_filters/stop_tokens_filter/stop_tokens_filter.go
+++ b/analysis/token_filters/stop_tokens_filter/stop_tokens_filter.go
@@ -32,8 +32,7 @@ func (f *StopTokensFilter) Filter(input analysis.TokenStream) analysis.TokenStre
rv := make(analysis.TokenStream, 0, len(input))
for _, token := range input {
- tokenTerm := string(token.Term)
- _, isStopToken := f.stopTokens[tokenTerm]
+ _, isStopToken := f.stopTokens[string(token.Term)]
if !isStopToken {
rv = append(rv, token)
} | rewrite map access to take advantage of optimization | blevesearch_bleve-mapping-ui | train | go |
a4e66a7c4e617b1882fda82c4c5a307157c7c56c | diff --git a/lib/excon/response.rb b/lib/excon/response.rb
index <HASH>..<HASH> 100644
--- a/lib/excon/response.rb
+++ b/lib/excon/response.rb
@@ -22,6 +22,12 @@ module Excon
def status
@data[:status]
end
+ def reason_phrase=(new_reason_phrase)
+ @data[:reason_phrase] = new_reason_phrase
+ end
+ def reason_phrase
+ @data[:reason_phrase]
+ end
def remote_ip=(new_remote_ip)
@data[:remote_ip] = new_remote_ip
end
@@ -37,13 +43,16 @@ module Excon
def self.parse(socket, datum)
# this will discard any trailing lines from the previous response if any.
- until status = socket.readline[9,11].to_i
- end
+ begin
+ full_status = socket.readline[9..-1]
+ end until status = full_status.to_i
+ reason_phrase = full_status.sub("#{status} ", "").chomp
datum[:response] = {
:body => '',
:headers => Excon::Headers.new,
- :status => status
+ :status => status,
+ :reason_phrase => reason_phrase
}
unix_proxy = datum[:proxy] ? datum[:proxy][:scheme] == UNIX : false | Parses the reason phrase from the response | excon_excon | train | rb |
3ff707c3b325ab4273b11ece6ba134c0856c1f7a | diff --git a/host/pydaq/HL/data_fifo.py b/host/pydaq/HL/data_fifo.py
index <HASH>..<HASH> 100644
--- a/host/pydaq/HL/data_fifo.py
+++ b/host/pydaq/HL/data_fifo.py
@@ -10,6 +10,7 @@
#
from HL.HardwareLayer import HardwareLayer
+import numpy as np
class data_fifo(HardwareLayer):
@@ -30,7 +31,9 @@ class data_fifo(HardwareLayer):
def get_data(self, size='all'):
if(size == 'all'):
size = self.get_size()
- return self._intf.read(self._conf['base_data_addr'], size * 2)
-
+
+ data = self._intf.read(self._conf['base_data_addr'], (size - (size % 2)) * 2)
+ return np.fromstring(data.tostring(), dtype=np.dtype('>i4'))
+
def get_error_count(self):
return self._intf.read(self._conf['base_addr'] + 4, 1)[0] | ENH: data take formating with numpy | SiLab-Bonn_basil | train | py |
37cb0aa466ba9153216bc38504383688c3402637 | diff --git a/src/docker.js b/src/docker.js
index <HASH>..<HASH> 100644
--- a/src/docker.js
+++ b/src/docker.js
@@ -907,7 +907,7 @@ Docker.prototype.languages = {
multiLine: [ /<%--/, /--%>/ ],
pygment: "html"// .gsp is grails server pages in pygments, html is close enough.
},
- sass: {
+ styl: {
extensions: [ 'styl' ], // .styl isn't supported by pygments, sass is close enough.
comment: '//', multiLine: [ /\/\*/, /\*\// ],
pygment: "sass"// .styl isn't supported by pygments, sass is close enough. | .styl extension no longer overwrites .sass | jbt_docker | train | js |
33aeb1a60e98f2425b52a2675c1dd472d7a307b1 | diff --git a/Godeps/_workspace/src/k8s.io/kubernetes/pkg/kubelet/kubelet.go b/Godeps/_workspace/src/k8s.io/kubernetes/pkg/kubelet/kubelet.go
index <HASH>..<HASH> 100644
--- a/Godeps/_workspace/src/k8s.io/kubernetes/pkg/kubelet/kubelet.go
+++ b/Godeps/_workspace/src/k8s.io/kubernetes/pkg/kubelet/kubelet.go
@@ -405,7 +405,7 @@ func NewMainKubelet(
imageBackOff,
serializeImagePulls,
enableCustomMetrics,
- hairpinMode == componentconfig.HairpinVeth,
+ klet.hairpinMode == componentconfig.HairpinVeth,
containerRuntimeOptions...,
)
case "rkt": | UPSTREAM: <I>: Fix hairpin mode | openshift_origin | train | go |
6c9fc6b480818b6c1d3ca52e78d5a48395c09206 | diff --git a/src/Stagehand/TestRunner/Runner/PHPUnitRunner/TestDox/Stream.php b/src/Stagehand/TestRunner/Runner/PHPUnitRunner/TestDox/Stream.php
index <HASH>..<HASH> 100644
--- a/src/Stagehand/TestRunner/Runner/PHPUnitRunner/TestDox/Stream.php
+++ b/src/Stagehand/TestRunner/Runner/PHPUnitRunner/TestDox/Stream.php
@@ -86,10 +86,10 @@ class Stagehand_TestRunner_Runner_PHPUnitRunner_TestDox_Stream
* @param string $path
* @param string $mode
* @param integer $options
- * @param string $opened_path
+ * @param string &$opened_path
* @return boolean
*/
- public function stream_open($path, $mode, $options, $opened_path)
+ public function stream_open($path, $mode, $options, &$opened_path)
{
return true;
} | Fixed the signature of stream_open(). | piece_stagehand-testrunner | train | php |
746117d2a35d56e440e4037c6c84e4a02f67aca4 | diff --git a/gwpy/timeseries/tests/test_timeseries.py b/gwpy/timeseries/tests/test_timeseries.py
index <HASH>..<HASH> 100644
--- a/gwpy/timeseries/tests/test_timeseries.py
+++ b/gwpy/timeseries/tests/test_timeseries.py
@@ -20,6 +20,7 @@
"""
import os.path
+import warnings
from itertools import (chain, product)
from unittest import mock
@@ -346,13 +347,14 @@ class TestTimeSeries(_TestTimeSeriesBase):
@SKIP_LALFRAME
def test_read_gwf_scaled_lalframe(self):
- with pytest.warns(None) as record:
+ with warnings.catch_warnings():
+ warnings.simplefilter("error")
data = self.TEST_CLASS.read(
utils.TEST_GWF_FILE,
"L1:LDAS-STRAIN",
format="gwf.lalframe",
)
- assert not record.list # no warning
+
with pytest.warns(UserWarning):
data2 = self.TEST_CLASS.read(
utils.TEST_GWF_FILE, | gwpy.timeseries: update use of pytest.warns(None)
use warnings.catch_warnings instead | gwpy_gwpy | train | py |
44ca136f793604eb6cf8b5b39a5d3023637582d2 | diff --git a/salt/cloud/clouds/parallels.py b/salt/cloud/clouds/parallels.py
index <HASH>..<HASH> 100644
--- a/salt/cloud/clouds/parallels.py
+++ b/salt/cloud/clouds/parallels.py
@@ -289,7 +289,7 @@ def create(vm_):
vm_['name'], exc.message
),
# Show the traceback if the debug logging level is enabled
- exc_info=log.isEnabledFor(logging.DEBUG)
+ exc_info_on_loglevel=logging.DEBUG
)
return False | Use `exc_info_on_loglevel` instead of `exc_info` | saltstack_salt | train | py |
100abb4a30ca9b2d3160663bd03b4355de5d0852 | diff --git a/routing/result_interpretation_test.go b/routing/result_interpretation_test.go
index <HASH>..<HASH> 100644
--- a/routing/result_interpretation_test.go
+++ b/routing/result_interpretation_test.go
@@ -349,6 +349,23 @@ var resultTestCases = []resultTestCase{
nodeFailure: nil,
},
},
+
+ // Test a channel disabled failure from the final hop in two hops. Only the
+ // disabled channel should be penalized for any amount.
+ {
+ name: "two hop channel disabled",
+ route: &routeTwoHop,
+ failureSrcIdx: 1,
+ failure: &lnwire.FailChannelDisabled{},
+
+ expectedResult: &interpretedResult{
+ pairResults: map[DirectedNodePair]pairResult{
+ getTestPair(1, 2): failPairResult(0),
+ getTestPair(2, 1): failPairResult(0),
+ },
+ policyFailure: getPolicyFailure(1, 2),
+ },
+ },
}
// TestResultInterpretation executes a list of test cases that test the result | routing: add test case for result interpretation of Channel Disabled failure | lightningnetwork_lnd | train | go |
4dba25dea80500fc5c5425e8969ecc4b71a68f61 | diff --git a/lib/gemsmith/authenticators/ruby_gems.rb b/lib/gemsmith/authenticators/ruby_gems.rb
index <HASH>..<HASH> 100644
--- a/lib/gemsmith/authenticators/ruby_gems.rb
+++ b/lib/gemsmith/authenticators/ruby_gems.rb
@@ -2,6 +2,7 @@
require "net/http"
require "uri"
+require "openssl"
module Gemsmith
module Authenticators | Fixed OpenSSL requirement.
- OpenSSL wasn't being explicitly required as it was assumed (implicitly). | bkuhlmann_gemsmith | train | rb |
fd535f10b3189fa46d1b72c64841da187128dc2c | diff --git a/Dropbox/OAuth/Consumer/ConsumerAbstract.php b/Dropbox/OAuth/Consumer/ConsumerAbstract.php
index <HASH>..<HASH> 100644
--- a/Dropbox/OAuth/Consumer/ConsumerAbstract.php
+++ b/Dropbox/OAuth/Consumer/ConsumerAbstract.php
@@ -114,7 +114,7 @@ abstract class ConsumerAbstract
$params['oauth_signature'] = $signature;
// Build the signed request URL
- $query = '?' . http_build_query($params,'','&');
+ $query = '?' . http_build_query($params, '', '&');
return array(
'url' => $url . $call . $query,
'postfields' => $params, | Separated function arguments with single space character | BenExile_Dropbox | train | php |
b9769bd9d155c732011878b945ad5b5e1eb4a2fe | diff --git a/lib/Thelia/Controller/Admin/CategoryController.php b/lib/Thelia/Controller/Admin/CategoryController.php
index <HASH>..<HASH> 100644
--- a/lib/Thelia/Controller/Admin/CategoryController.php
+++ b/lib/Thelia/Controller/Admin/CategoryController.php
@@ -132,7 +132,7 @@ class CategoryController extends AbstractSeoCrudController
'chapo' => $object->getChapo(),
'description' => $object->getDescription(),
'postscriptum' => $object->getPostscriptum(),
- 'visible' => $object->getVisible() ? true : false,
+ 'visible' => $object->getVisible(),
'parent' => $object->getParent(),
'default_template_id' => $object->getDefaultTemplateId()
);
diff --git a/lib/Thelia/Form/CategoryCreationForm.php b/lib/Thelia/Form/CategoryCreationForm.php
index <HASH>..<HASH> 100644
--- a/lib/Thelia/Form/CategoryCreationForm.php
+++ b/lib/Thelia/Form/CategoryCreationForm.php
@@ -51,7 +51,7 @@ class CategoryCreationForm extends BaseForm
)
->add(
'visible',
- 'checkbox',
+ 'integer', // Should be checkbox, but this is not API compatible, see #1199
[
'required' => false,
'label' => $this->translator->trans('This category is online') | Compensate issue #<I> | thelia_core | train | php,php |
56552ac3daa995778c6c28a45cd3516c75836565 | diff --git a/resource_aws_codecommit_trigger.go b/resource_aws_codecommit_trigger.go
index <HASH>..<HASH> 100644
--- a/resource_aws_codecommit_trigger.go
+++ b/resource_aws_codecommit_trigger.go
@@ -143,7 +143,7 @@ func expandAwsCodeCommitTriggers(configured []interface{}) []*codecommit.Reposit
Name: aws.String(data["name"].(string)),
}
- branches := make([]*string, len(data["events"].([]interface{})))
+ branches := make([]*string, len(data["branches"].([]interface{})))
for i, vv := range data["branches"].([]interface{}) {
str := vv.(string)
branches[i] = aws.String(str) | fix typo that causes serialization to fail when events is non-empty (#<I>) | terraform-providers_terraform-provider-aws | train | go |
5794e33245e95145824d4bf7ed70ca60389f9ba5 | diff --git a/master/buildbot/process/botmaster.py b/master/buildbot/process/botmaster.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/process/botmaster.py
+++ b/master/buildbot/process/botmaster.py
@@ -299,7 +299,8 @@ class BotMaster(config.ReconfigurableServiceMixin, service.MultiService):
@param buildername: the name of the builder
"""
- self.brd.maybeStartBuildsOn([buildername])
+ d = self.brd.maybeStartBuildsOn([buildername])
+ d.addErrback(log.err)
def maybeStartBuildsForSlave(self, slave_name):
"""
@@ -309,14 +310,16 @@ class BotMaster(config.ReconfigurableServiceMixin, service.MultiService):
@param slave_name: the name of the slave
"""
builders = self.getBuildersForSlave(slave_name)
- self.brd.maybeStartBuildsOn([ b.name for b in builders ])
+ d = self.brd.maybeStartBuildsOn([ b.name for b in builders ])
+ d.addErrback(log.err)
def maybeStartBuildsForAllBuilders(self):
"""
Call this when something suggests that this would be a good time to start some
builds, but nothing more specific.
"""
- self.brd.maybeStartBuildsOn(self.builderNames)
+ d = self.brd.maybeStartBuildsOn(self.builderNames)
+ d.addErrback(log.err)
class BuildRequestDistributor(service.Service):
""" | handle (unlikely) errbacks from maybeStartBuildsOn | buildbot_buildbot | train | py |
7dd2b04343cf935df8703e37fe82b82476c42c19 | diff --git a/core/server/lib/members/index.js b/core/server/lib/members/index.js
index <HASH>..<HASH> 100644
--- a/core/server/lib/members/index.js
+++ b/core/server/lib/members/index.js
@@ -140,7 +140,7 @@ module.exports = function MembersApi({
}).catch(handleError(401, res));
});
- apiRouter.post('/signout', getData(), ssoOriginCheck, (req, res) => {
+ apiRouter.post('/signout', getData(), (req, res) => {
res.writeHead(200, {
'Set-Cookie': removeCookie()
}); | Removed ssoOriginCheck from signout endpoint (#<I>)
no-issue
the ssoOriginCheck exists to ensure that we only allow signin/signup to
be called from the specified auth page, this is a very minor security
feature in that it forces signins to go via the page you've designated.
signout however does not need this protection as the call to signout
completely bypasses any UI (this is the same for the call to /token) | TryGhost_Ghost | train | js |
bb104e16876b70a96536264fafe35aaf0357dac9 | diff --git a/pcapkit/corekit/infoclass.py b/pcapkit/corekit/infoclass.py
index <HASH>..<HASH> 100644
--- a/pcapkit/corekit/infoclass.py
+++ b/pcapkit/corekit/infoclass.py
@@ -75,10 +75,23 @@ class Info(collections.abc.Mapping):
args_ = [] # type: list[str]
dict_ = [] # type: list[str]
- for key in cls.__annotations__:
- args_.append(key)
- dict_.append(f'{key}={key}')
- print(args_, dict_)
+ for cls_ in cls.mro():
+ # NOTE: We skip the ``Info`` class itself, to avoid superclass
+ # type annotations being considered.
+ if cls_ is Info:
+ break
+
+ # NOTE: We iterate in reversed order to ensure that the type
+ # annotations of the superclasses are considered first.
+ for key in reversed(cls_.__annotations__):
+ args_.append(key)
+ dict_.append(f'{key}={key}')
+
+ # NOTE: We reverse the two lists such that the order of the
+ # arguments is the same as the order of the type annotations, i.e.,
+ # from the most base class to the most derived class.
+ args_.reverse()
+ dict_.reverse()
# NOTE: The following code is to make the ``__init__`` method work.
# It is inspired from the :func:`dataclasses._create_fn` function. | revised Info class implementation (generate __init__ for derived class with base class's annotations) | JarryShaw_PyPCAPKit | train | py |
aeb2dd578c28119924f0b1a198cad2c9d78ddc72 | diff --git a/src/Monolog/Handler/PushoverHandler.php b/src/Monolog/Handler/PushoverHandler.php
index <HASH>..<HASH> 100644
--- a/src/Monolog/Handler/PushoverHandler.php
+++ b/src/Monolog/Handler/PushoverHandler.php
@@ -75,10 +75,10 @@ class PushoverHandler extends SocketHandler
'timestamp' => $timestamp
);
- if( $record['level'] >= $this->highPriorityLevel && $record['level'] < $this->emergencyLevel ) {
- $dataArray['priority'] = 1;
- } else if ( $record['level'] >= $this->emergencyLevel ) {
+ if( $record['level'] >= $this->emergencyLevel ) {
$dataArray['priority'] = 2;
+ } else if ( $record['level'] >= $this->highPriorityLevel ) {
+ $dataArray['priority'] = 1;
}
return http_build_query($dataArray); | Update PushoverHandler.php
simplifying the priority level setting if condition following stof suggestion | Seldaek_monolog | train | php |
4595729cbbe599df4ea0778cdb954f2d3fe9fc8f | diff --git a/packages/babel-cli/src/babel/util.js b/packages/babel-cli/src/babel/util.js
index <HASH>..<HASH> 100644
--- a/packages/babel-cli/src/babel/util.js
+++ b/packages/babel-cli/src/babel/util.js
@@ -11,7 +11,7 @@ export function chmod(src, dest) {
export function readdirFilter(filename) {
return readdir(filename).filter(function (filename) {
- return babel.util.isCompilableExtension(filename);
+ return isCompilableExtension(filename);
});
} | fix issue as a result of refactor (#<I>) | babel_babel | train | js |
41a364259ba1a06cb1a063df4247f4c6fc2e4cff | diff --git a/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/SpaceItemWriter.java b/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/SpaceItemWriter.java
index <HASH>..<HASH> 100644
--- a/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/SpaceItemWriter.java
+++ b/snapshot-service-impl/src/main/java/org/duracloud/snapshot/service/impl/SpaceItemWriter.java
@@ -132,6 +132,7 @@ public class SpaceItemWriter extends StepExecutionSupport implements ItemWriter<
}
protected void deleteDatabase(){
+ closeDatabase();
this.dbFile.delete();
} | Ensures database is closed before a delete is attempted. | duracloud_snapshot | train | java |
cfc8236954db1b913c2e640e184edd6eb9e2d978 | diff --git a/lib/collection/request-auth/awsv4.js b/lib/collection/request-auth/awsv4.js
index <HASH>..<HASH> 100644
--- a/lib/collection/request-auth/awsv4.js
+++ b/lib/collection/request-auth/awsv4.js
@@ -55,7 +55,7 @@ module.exports = {
secretAccessKey: params.secretKey,
sessionToken: params.sessionToken || undefined
},
- host: request.url.getHost(),
+ host: request.url.getRemote(),
path: request.url.getPathWithQuery(),
service: params.service || params.serviceName || 'execute-api', // AWS API Gateway is the default service.
region: params.region || 'us-east-1', | Fix awsv4 auth which was not taking port before signing the request | postmanlabs_postman-collection | train | js |
38c5b5cb6dc7e0af784eb233d4dcbef0fc8844eb | diff --git a/src/server/SwServer.php b/src/server/SwServer.php
index <HASH>..<HASH> 100644
--- a/src/server/SwServer.php
+++ b/src/server/SwServer.php
@@ -47,6 +47,14 @@ class SwServer extends Server
public $asDaemon = false;
/**
+ * The dispatch mode for swoole, defaults to 3 for http server.
+ *
+ * @var int
+ * @see https://wiki.swoole.com/wiki/page/277.html
+ */
+ public $dispatchMode = 3;
+
+ /**
* Specifies the path where logs should be stored in.
*
* @var string
@@ -67,6 +75,7 @@ class SwServer extends Server
$config['max_request'] = $this->maxRequests;
$config['daemonize'] = $this->asDaemon;
+ $config['dispatch_mode'] = $this->dispatchMode;
if ($this->numWorkers) {
$config['worker_num'] = $this->numWorkers; | Added support to tune swoole's dispatch_mode | bixuehujin_blink | train | php |
b32a34c52fe42cabb09837a6033829a5b84d5266 | diff --git a/backbone.js b/backbone.js
index <HASH>..<HASH> 100644
--- a/backbone.js
+++ b/backbone.js
@@ -806,6 +806,8 @@
if (this._wantsPushState && !this._hasPushState && !atRoot) {
this.fragment = this.getFragment(null, true);
window.location.replace(this.options.root + '#' + this.fragment);
+ // Return immediately as browser will do redirect to new url
+ return true;
} else if (this._wantsPushState && this._hasPushState && atRoot && loc.hash) {
this.fragment = loc.hash.replace(hashStrip, '');
window.history.replaceState({}, document.title, loc.protocol + '//' + loc.host + this.options.root + this.fragment); | do not call loadUrl when redirecting to hash based URL on non-push state browser | jashkenas_backbone | train | js |
a5e65601698a43fefc0006bdb05b10ec506800b6 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -88,7 +88,12 @@ def _build_metadata():
requires[key] = []
if os.path.exists(srcfile(filename)):
with open(srcfile(filename), 'r') as handle:
- requires[key] = [i.strip() for i in handle if i.strip() and not i.startswith('#')]
+ for line in handle:
+ line = line.strip()
+ if line and not line.startswith('#'):
+ if line.startswith('-e'):
+ line = line.split()[1].split('#egg=')[1]
+ requires[key].append(line)
if 'pytest' not in requires['test']:
requires['test'].append('pytest') | :arrow_upper_right: support for '-e' requirements (map to egg name) | jhermann_rituals | train | py |
f888eb1b2bb43952ad46a09bd32b7be7980e8cc8 | diff --git a/plugin/plugin.go b/plugin/plugin.go
index <HASH>..<HASH> 100644
--- a/plugin/plugin.go
+++ b/plugin/plugin.go
@@ -28,8 +28,14 @@ type PluginMetadata struct {
Commands []Command
}
+type Usage struct {
+ Usage string
+ Options map[string]string
+}
+
type Command struct {
- Name string
- Alias string
- HelpText string
+ Name string
+ Alias string
+ HelpText string
+ UsageDetails Usage //Detail usage to be displayed in `cf help <cmd>`
} | Plugin usage/option model, for use in help
[#<I>] | cloudfoundry_cli | train | go |
2dfcddf1bd80d8b237b14cc9aab79e882785b420 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,3 +1,10 @@
+unless ENV['CI']
+ require 'simplecov'
+ SimpleCov.start do
+ add_filter 'spec'
+ end
+end
+
require 'vatsim'
require 'webmock/rspec'
@@ -6,3 +13,4 @@ RSpec.configure do |config|
config.run_all_when_everything_filtered = true
config.filter_run :focus
end
+
diff --git a/spec/vatsim_spec.rb b/spec/vatsim_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/vatsim_spec.rb
+++ b/spec/vatsim_spec.rb
@@ -1,6 +1,3 @@
-require 'simplecov'
-SimpleCov.start
-
require 'spec_helper'
describe Vatsim::VERSION do | Don't run simplecov in continuous integration build | tdawe_vatsim | train | rb,rb |
1354733c6e48cf00d7a5c2d3e191bc04f196c71f | diff --git a/lib/dragonfly/analysis/file_command_analyser.rb b/lib/dragonfly/analysis/file_command_analyser.rb
index <HASH>..<HASH> 100644
--- a/lib/dragonfly/analysis/file_command_analyser.rb
+++ b/lib/dragonfly/analysis/file_command_analyser.rb
@@ -10,7 +10,7 @@ module Dragonfly
configurable_attr :num_bytes_to_check, 255
def mime_type(temp_object)
- if use_filesystem
+ content_type = if use_filesystem
`#{file_command} -b --mime '#{temp_object.path}'`
else
IO.popen("#{file_command} -b --mime -", 'r+') do |io|
@@ -23,6 +23,7 @@ module Dragonfly
io.read
end
end.split(';').first
+ content_type.strip if content_type
end
end | Strip file command mime_type value because some versions of file command were appending a line-break | markevans_dragonfly | train | rb |
6e6b3f816ffc2c13e5a64bcc46476e4851243bb1 | diff --git a/src/debianbts.py b/src/debianbts.py
index <HASH>..<HASH> 100644
--- a/src/debianbts.py
+++ b/src/debianbts.py
@@ -47,7 +47,7 @@ BTS_URL = 'https://bugs.debian.org/'
# Max number of bugs to send in a single get_status request
BATCH_SIZE = 500
-soap_client = SoapClient(location=URL, namespace=NS, trace=True, soap_ns='soap')
+soap_client = SoapClient(location=URL, namespace=NS, soap_ns='soap')
def _get_http_proxy():
"""Returns an HTTP proxy URL formatted for consumption by SOAPpy. | removed pysimplesoap debug | venthur_python-debianbts | train | py |
9dfa9e8e663157bab6af317961eda98e84e2c391 | diff --git a/src/controllers/controller.doughnut.js b/src/controllers/controller.doughnut.js
index <HASH>..<HASH> 100644
--- a/src/controllers/controller.doughnut.js
+++ b/src/controllers/controller.doughnut.js
@@ -88,7 +88,7 @@
update: function(reset) {
- this.chart.outerRadius = (helpers.min([this.chart.chart.width, this.chart.chart.height]) - this.chart.options.elements.arc.borderWidth / 2) / 2;
+ this.chart.outerRadius = (helpers.min([this.chart.chart.width, this.chart.chart.height]) / 2) - this.chart.options.elements.arc.borderWidth / 2;
this.chart.innerRadius = this.chart.options.cutoutPercentage ? (this.chart.outerRadius / 100) * (this.chart.options.cutoutPercentage) : 1;
this.chart.radiusLength = (this.chart.outerRadius - this.chart.innerRadius) / this.chart.data.datasets.length; | Fix the outerRadius calculation with respect to the border width. Previously the border width was divided by 2 twice rather than once. | chartjs_Chart.js | train | js |
050a699fe797eaaf686d5f7e8cad09377964c449 | diff --git a/Factory/DiscountablePriceFactory.php b/Factory/DiscountablePriceFactory.php
index <HASH>..<HASH> 100755
--- a/Factory/DiscountablePriceFactory.php
+++ b/Factory/DiscountablePriceFactory.php
@@ -22,8 +22,6 @@ use WellCommerce\Bundle\DoctrineBundle\Factory\AbstractEntityFactory;
*/
final class DiscountablePriceFactory extends AbstractEntityFactory
{
- protected $supportsInterface = DiscountablePriceInterface::class;
-
public function create() : DiscountablePriceInterface
{
/** @var $price DiscountablePriceInterface */
diff --git a/Factory/PriceFactory.php b/Factory/PriceFactory.php
index <HASH>..<HASH> 100755
--- a/Factory/PriceFactory.php
+++ b/Factory/PriceFactory.php
@@ -17,8 +17,6 @@ use WellCommerce\Bundle\DoctrineBundle\Factory\AbstractEntityFactory;
final class PriceFactory extends AbstractEntityFactory
{
- protected $supportsInterface = PriceInterface::class;
-
public function create() : PriceInterface
{
/** @var $price PriceInterface */ | Removed deprecations in factories | WellCommerce_WishlistBundle | train | php,php |
14697391095ba211e53a22c648ad691c4eeebd67 | diff --git a/{{cookiecutter.project_slug}}/config/settings/test.py b/{{cookiecutter.project_slug}}/config/settings/test.py
index <HASH>..<HASH> 100644
--- a/{{cookiecutter.project_slug}}/config/settings/test.py
+++ b/{{cookiecutter.project_slug}}/config/settings/test.py
@@ -48,10 +48,6 @@ TEMPLATES[0]["OPTIONS"]["loaders"] = [ # noqa F405
# ------------------------------------------------------------------------------
# https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
EMAIL_BACKEND = "django.core.mail.backends.locmem.EmailBackend"
-# https://docs.djangoproject.com/en/dev/ref/settings/#email-host
-EMAIL_HOST = "localhost"
-# https://docs.djangoproject.com/en/dev/ref/settings/#email-port
-EMAIL_PORT = 1025
# Your stuff...
# ------------------------------------------------------------------------------ | Remove EMAIL_HOST & EMAIL_PORT with locmem backend
These settings should not be required since Django never connects to an
external component when sending email. Instead it's stored in memory.
<URL> | pydanny_cookiecutter-django | train | py |
4b40abec7201c7baa957dddd0ca8b43f8c1cc8eb | diff --git a/state/state_test.go b/state/state_test.go
index <HASH>..<HASH> 100644
--- a/state/state_test.go
+++ b/state/state_test.go
@@ -5,6 +5,7 @@ package state_test
import (
"fmt"
+ "sort"
"strconv"
"strings"
"time"
@@ -1250,11 +1251,16 @@ func (s *StateSuite) TestAllServices(c *gc.C) {
c.Assert(err, gc.IsNil)
services, err = s.State.AllServices()
c.Assert(err, gc.IsNil)
- c.Assert(len(services), gc.Equals, 2)
+ c.Assert(services, gc.HasLen, 2)
// Check the returned service, order is defined by sorted keys.
- c.Assert(services[0].Name(), gc.Equals, "wordpress")
- c.Assert(services[1].Name(), gc.Equals, "mysql")
+ names := make([]string, len(services))
+ for i, svc := range services {
+ names[i] = svc.Name()
+ }
+ sort.Strings(names)
+ c.Assert(names[0], gc.Equals, "mysql")
+ c.Assert(names[1], gc.Equals, "wordpress")
}
var inferEndpointsTests = []struct { | Tweak a test that assumed sort order. | juju_juju | train | go |
0170597b306854c7c9af6467a87497a6c43862da | diff --git a/src/style_manager/view/PropertySliderView.js b/src/style_manager/view/PropertySliderView.js
index <HASH>..<HASH> 100644
--- a/src/style_manager/view/PropertySliderView.js
+++ b/src/style_manager/view/PropertySliderView.js
@@ -46,7 +46,7 @@ module.exports = Property.extend({
},
setValue(value) {
- this.getSliderEl().value = parseInt(value, 10);
+ this.getSliderEl().value = parseFloat(value);
this.inputInst.setValue(value, { silent: 1 });
}, | Use parseFloat in setValue with Slider property. Fixes #<I> | artf_grapesjs | train | js |
2d94f2ce9cdee69846f86c2538efb12f22a862dc | diff --git a/coconut/compiler/compiler.py b/coconut/compiler/compiler.py
index <HASH>..<HASH> 100644
--- a/coconut/compiler/compiler.py
+++ b/coconut/compiler/compiler.py
@@ -1005,10 +1005,8 @@ class Compiler(object):
err_line, err_index = self.reformat(err.line, err.col-1)
raise CoconutParseError(None, err_line, err_index, self.adjust(err.lineno))
except RuntimeError as err:
- logger.verbose = True
if logger.verbose:
logger.print_exc()
- logger.verbose = False
raise CoconutException(str(err)
+ " (try again with --recursion-limit greater than the current "
+ str(sys.getrecursionlimit()) + ")")
diff --git a/coconut/constants.py b/coconut/constants.py
index <HASH>..<HASH> 100644
--- a/coconut/constants.py
+++ b/coconut/constants.py
@@ -26,7 +26,7 @@ from pyparsing import alphanums
# COMPILER CONSTANTS:
#-----------------------------------------------------------------------------------------------------------------------
-minimum_recursion_limit = 200
+minimum_recursion_limit = 300
from zlib import crc32 as checksum # used for generating __coconut_hash__
hash_prefix = "# __coconut_hash__ = " | Increases minimum recursion limit | evhub_coconut | train | py,py |
91332f724c1e59a14240fab99c9f47fe69d8201b | diff --git a/lib/tokyo_metro/factory/seed/static/railway_line/info.rb b/lib/tokyo_metro/factory/seed/static/railway_line/info.rb
index <HASH>..<HASH> 100644
--- a/lib/tokyo_metro/factory/seed/static/railway_line/info.rb
+++ b/lib/tokyo_metro/factory/seed/static/railway_line/info.rb
@@ -47,8 +47,6 @@ class TokyoMetro::Factory::Seed::Static::RailwayLine::Info < TokyoMetro::Factory
[
:same_as ,
- :name_ja_normal , :name_ja_with_operator_name_precise , :name_ja_with_operator_name ,
- :name_en_normal , :name_en_with_operator_name_precise , :name_en_with_operator_name ,
:index_in_operator , :start_on , :end_on # , :twitter_widget_id , :twitter_account_name
].each do | key_name |
h[ key_name ] = @info.send( key_name ) | <I>_<I> Update - TokyoMetro::Factory::Seed::Static::RailwayLine::Info | osorubeki-fujita_odpt_tokyo_metro | train | rb |
a284a2f1fd3eb263148fe35b4a6a5da987fcfacd | diff --git a/code/DebugBar.php b/code/DebugBar.php
index <HASH>..<HASH> 100644
--- a/code/DebugBar.php
+++ b/code/DebugBar.php
@@ -25,7 +25,7 @@ class DebugBar extends Object
if (!Director::isDev()
|| !class_exists('DebugBar\\StandardDebugBar')
|| Director::is_cli() // Don't run in CLI mode
- || strpos($_REQUEST['url'], 'dev/build') !== 0 // Don't run on dev build
+ || strpos($_REQUEST['url'], 'dev/build') === 0 // Don't run on dev build
) {
self::$debugbar = false; // No need to check again
return; | I made a terrible typo
It should either equal exactly 0, or be false. It was checked the wrong way around. | lekoala_silverstripe-debugbar | train | php |
8f4d55666e5eccc1ffad5210e0125fc245061b7a | diff --git a/tests/runtests.py b/tests/runtests.py
index <HASH>..<HASH> 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -516,6 +516,13 @@ class SaltTestsuiteParser(SaltCoverageTestingParser):
default=False,
help='Run scheduler integration tests'
)
+ self.test_selection_group.add_option(
+ '--logging',
+ dest='logging',
+ action='store_true',
+ default=False,
+ help='Run logging integration tests'
+ )
def validate_options(self):
if self.options.cloud_provider or self.options.external_api: | Updaitng runtests.py for logging tests. | saltstack_salt | train | py |
6b940b39ff8d4c7c3a4189dc8a04e26ff3209e97 | diff --git a/gwpy/segments/flag.py b/gwpy/segments/flag.py
index <HASH>..<HASH> 100644
--- a/gwpy/segments/flag.py
+++ b/gwpy/segments/flag.py
@@ -1022,11 +1022,7 @@ class DataQualityDict(OrderedDict):
if kwargs.keys():
raise TypeError("DataQualityDict.query_segdb has no keyword "
"argument '%s'" % list(kwargs.keys()[0]))
- # parse flags
- if isinstance(flags, string_types):
- flags = flags.split(',')
- else:
- flags = flags
+
# process query
from glue.segmentdb import (segmentdb_utils as segdb_utils,
query_engine as segdb_engine) | segments.flag: removed unnecessary clause | gwpy_gwpy | train | py |
a6b6d91957dc3869c6676306a5bc2e3683ef23aa | diff --git a/config/Common.php b/config/Common.php
index <HASH>..<HASH> 100644
--- a/config/Common.php
+++ b/config/Common.php
@@ -8,9 +8,6 @@ class Common extends Config
{
public function define(Container $di)
{
- ini_set('error_reporting', E_ALL);
- ini_set('display_errors', true);
-
$di->set('logger', $di->lazyNew('Psr\Log\NullLogger'));
}
} | remove ini-set from kernel, place at project level later. thanks @harikt | auraphp_Aura.Project_Kernel | train | php |
b0d115431ec71cbfe95a9a9fdd4d90b8eef73410 | diff --git a/tests/AltoRouterTest.php b/tests/AltoRouterTest.php
index <HASH>..<HASH> 100644
--- a/tests/AltoRouterTest.php
+++ b/tests/AltoRouterTest.php
@@ -273,6 +273,20 @@ class AltoRouterTest extends PHPUnit_Framework_TestCase
), $this->router->match('/foo/test/do?param=value', 'GET'));
}
+
+ public function testMatchWithNonRegex() {
+ $this->router->map('GET','/about-us', 'PagesController#about', 'about_us');
+
+ $this->assertEquals(array(
+ 'target' => 'PagesController#about',
+ 'params' => array(),
+ 'name' => 'about_us'
+ ), $this->router->match('/about-us', 'GET'));
+
+ $this->assertFalse($this->router->match('/about-us', 'POST'));
+ $this->assertFalse($this->router->match('/about', 'GET'));
+ $this->assertFalse($this->router->match('/about-us-again', 'GET'));
+ }
public function testMatchWithFixedParamValues()
{ | Add tests for non-regex routes, see #<I> | dannyvankooten_AltoRouter | train | php |
2c39604bfaf4b1b5f2586bc0a5984cca1ec361ae | diff --git a/auto_ml/utils.py b/auto_ml/utils.py
index <HASH>..<HASH> 100644
--- a/auto_ml/utils.py
+++ b/auto_ml/utils.py
@@ -4,6 +4,9 @@ import os
from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split
+from sklearn.pipeline import Pipeline
+from sklearn.utils.metaestimators import if_delegate_has_method
+
import pandas as pd
@@ -137,3 +140,28 @@ def drop_missing_y_vals(df, y, output_column=None):
return df, y
+
+class ExtendedPipeline(Pipeline):
+
+ def __init__(self, steps):
+ super(self.__class__, self).__init__(steps)
+
+
+ @if_delegate_has_method(delegate='_final_estimator')
+ def predict_uncertainty(self, X):
+ Xt = X
+ for name, transform in self.steps[:-1]:
+ if transform is not None:
+ Xt = transform.transform(Xt)
+ return self.steps[-1][-1].predict_uncertainty(Xt)
+
+
+ @if_delegate_has_method(delegate='_final_estimator')
+ def score_uncertainty(self, X):
+ Xt = X
+ for name, transform in self.steps[:-1]:
+ if transform is not None:
+ Xt = transform.transform(Xt)
+ return self.steps[-1][-1].score_uncertainty(Xt)
+
+ | extends sklearn's Pipeline to handle our own custom functions, particularly predict_uncertainty | ClimbsRocks_auto_ml | train | py |
509d906456b896bec5e45757140855ba64bbb263 | diff --git a/holoviews/plotting/bokeh/widgets.py b/holoviews/plotting/bokeh/widgets.py
index <HASH>..<HASH> 100644
--- a/holoviews/plotting/bokeh/widgets.py
+++ b/holoviews/plotting/bokeh/widgets.py
@@ -22,7 +22,7 @@ class BokehServerWidgets(param.Parameterized):
"""
BokehServerWidgets create bokeh widgets corresponding to all the
key dimensions found on a BokehPlot instance. It currently supports
- to types of widgets sliders (which may be discrete or continuous)
+ two types of widgets: sliders (which may be discrete or continuous),
and dropdown widgets letting you select non-numeric values.
""" | fix typo (#<I>) | pyviz_holoviews | train | py |
5c000987c834177753d612884b4f6b4884469235 | diff --git a/enabler/src/com/openxc/enabler/SettingsActivity.java b/enabler/src/com/openxc/enabler/SettingsActivity.java
index <HASH>..<HASH> 100644
--- a/enabler/src/com/openxc/enabler/SettingsActivity.java
+++ b/enabler/src/com/openxc/enabler/SettingsActivity.java
@@ -88,6 +88,10 @@ public class SettingsActivity extends PreferenceActivity {
findPreference(getString(R.string.network_host_key)),
findPreference(getString(R.string.network_port_key)),
findPreference(getString(R.string.network_checkbox_key)));
+
+ initializeTracePreferences(
+ findPreference(getString(R.string.trace_source_checkbox_key)),
+ findPreference(getString(R.string.trace_source_file_key)));
} else if(action.equals(OUTPUT_PREFERENCE)) {
addPreferencesFromResource(R.xml.output_preferences);
} else if(action.equals(ABOUT_PREFERENCE)) { | Make sure trace source preferences are initialized in legacy layout.
Fixed #<I>. | openxc_openxc-android | train | java |
65a7c8cadcabd42dd81336dec21e15b516128648 | diff --git a/lib/backup.go b/lib/backup.go
index <HASH>..<HASH> 100644
--- a/lib/backup.go
+++ b/lib/backup.go
@@ -6,17 +6,6 @@ import (
"strings"
)
-// BackupSchedule represents a scheduled backup on a server
-// see: server/backup_set_schedule, server/backup_get_schedule
-type BackupSchedule struct {
- Enabled bool `json:"enabled"`
- CronType string `json:"cron_type"`
- NextScheduledTimeUtc string `json:"next_scheduled_time_utc"`
- Hour int `json:"hour"`
- Dow int `json:"dow"`
- Dom int `json:"dom"`
-}
-
// Backup of a virtual machine
type Backup struct {
ID string `json:"BACKUPID"`
@@ -35,7 +24,7 @@ func (s backups) Less(i, j int) bool {
}
// GetBackups retrieves a list of all backups on Vultr account
-func (c *Client) GetBackups(id string, backupid string) (backupList []BackupSchedule, err error) {
+func (c *Client) GetBackups(id string, backupid string) (backups []Backup, err error) {
var backupMap map[string]Backup
values := url.Values{
"SUBID": {id}, | remove backupschedule struct, change return type of GetBackups | JamesClonk_vultr | train | go |
8117878cf6fad2fdf53477d6178a0f9289081098 | diff --git a/spec/govuk_message_queue_consumer/heartbeat_processor_spec.rb b/spec/govuk_message_queue_consumer/heartbeat_processor_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/govuk_message_queue_consumer/heartbeat_processor_spec.rb
+++ b/spec/govuk_message_queue_consumer/heartbeat_processor_spec.rb
@@ -8,25 +8,29 @@ describe GovukMessageQueueConsumer::HeartbeatProcessor do
context "when receiving heartbeat message" do
it "doesn't call the next processor" do
- expect(subject.process(heartbeat_message)).to be_falsy
+ processor = described_class.new
+ expect(processor.process(heartbeat_message)).to be_falsy
end
it "acks the message" do
expect(heartbeat_message).to receive(:ack)
- subject.process(heartbeat_message)
+ processor = described_class.new
+ processor.process(heartbeat_message)
end
end
context "when receiving a content message" do
it "calls the next processor" do
- expect(subject.process(standard_message)).to be_truthy
+ processor = described_class.new
+ expect(processor.process(standard_message)).to be_truthy
end
it "doesn't ack the message" do
expect(standard_message).not_to receive(:ack)
- subject.process(standard_message)
+ processor = described_class.new
+ processor.process(standard_message)
end
end
end | Resolve RSpec/NamedSubject violations
This changes the use of subject to be variables defined from the class. | alphagov_govuk_message_queue_consumer | train | rb |
342ff40e94991f730421c8bf219f79b29e35f9f9 | diff --git a/demo/input.js b/demo/input.js
index <HASH>..<HASH> 100644
--- a/demo/input.js
+++ b/demo/input.js
@@ -201,6 +201,9 @@ shakaDemo.DatalistInput = class extends shakaDemo.TextInput {
// This manually updates the suggestions, so that they will show up.
awesomplete.evaluate();
});
+ this.input_.addEventListener('awesomplete-selectcomplete', () => {
+ onChange(this.input_);
+ });
}
}; | Fix datalist inputs in demo.
It turns out that, if you selected an element from the suggestions,
it was not firing the onChange event. This was causing the robustness
controls to not actually do anything, in most cases.
Issue #<I>
Change-Id: I<I>d<I>f<I>feb<I>f5a<I>eadfb8b<I>f7c<I>c | google_shaka-player | train | js |
ce9d6830fc8d4cea845a7937605565bc7b6bdf0e | diff --git a/jarn/mkrelease/configparser.py b/jarn/mkrelease/configparser.py
index <HASH>..<HASH> 100644
--- a/jarn/mkrelease/configparser.py
+++ b/jarn/mkrelease/configparser.py
@@ -89,24 +89,24 @@ class ConfigParser(SafeConfigParser, object):
return value.split()
def to_single(self, value):
- v = self.single_value(value)
+ v = self._single_value(value)
return v
def to_boolean(self, value):
- v = self.single_value(value).lower()
+ v = self._single_value(value).lower()
if v not in self._boolean_states:
raise ValueError('Not a boolean: %s' % value)
return self._boolean_states[v]
def to_int(self, value):
- v = self.single_value(value)
+ v = self._single_value(value)
return int(v)
def to_float(self, value):
- v = self.single_value(value)
+ v = self._single_value(value)
return float(v)
- def single_value(self, value):
+ def _single_value(self, value):
v = value.strip()
if len(v.split()) > 1:
raise MultipleValueError('Multiple values not allowed: %s' % value) | Make single_value private; we are covered by to_single. | Jarn_jarn.mkrelease | train | py |
e9226d2be3207ed861b3d7fa2541b2e49896d10b | diff --git a/mailer/engine.py b/mailer/engine.py
index <HASH>..<HASH> 100644
--- a/mailer/engine.py
+++ b/mailer/engine.py
@@ -6,15 +6,7 @@ from mailer.lockfile import FileLock, AlreadyLocked, LockTimeout
from socket import error as socket_error
from django.conf import settings
-try:
- # Django 1.2
- from django.core.mail import get_connection
-except ImportError:
- # ImportError: cannot import name get_connection
- from django.core.mail import SMTPConnection
-
- def get_connection(backend=None, fail_silently=False, **kwds):
- return SMTPConnection(fail_silently=fail_silently)
+from django.core.mail import get_connection
from mailer.models import Message, MessageLog
diff --git a/mailer/models.py b/mailer/models.py
index <HASH>..<HASH> 100644
--- a/mailer/models.py
+++ b/mailer/models.py
@@ -184,12 +184,7 @@ class DontSendEntryManager(models.Manager):
is the given address on the don't send list?
"""
queryset = self.filter(to_address__iexact=address)
- try:
- # Django 1.2
- return queryset.exists()
- except AttributeError:
- # AttributeError: 'QuerySet' object has no attribute 'exists'
- return bool(queryset.count())
+ return queryset.exists()
class DontSendEntry(models.Model): | Remove code for compatibility with Django < <I>
Django >= <I> is required so it's dead code anyways. | pinax_django-mailer | train | py,py |
c5e598ca556a9fb8fbb31051612f5f275cfae711 | diff --git a/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OStorageLocal.java b/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OStorageLocal.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OStorageLocal.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OStorageLocal.java
@@ -155,7 +155,7 @@ public class OStorageLocal extends OStorageEmbedded {
// CLOSE AND REOPEN TO BE SURE ALL THE FILE SEGMENTS ARE
// OPENED
dataSegments[i].close();
- dataSegments[i] = new ODataLocal(this, dataConfig, pos);
+ dataSegments[i] = new ODataLocal(this, dataConfig, i);
dataSegments[i].open();
} else
dataSegments[pos].open(); | Patch by Sylvain Spinelli about fixing storage problem. | orientechnologies_orientdb | train | java |
076a92a3a104a34c462f2b787f2a748aa940faa5 | diff --git a/bika/lims/browser/js/bika.lims.analysisrequest.add_by_col.js b/bika/lims/browser/js/bika.lims.analysisrequest.add_by_col.js
index <HASH>..<HASH> 100644
--- a/bika/lims/browser/js/bika.lims.analysisrequest.add_by_col.js
+++ b/bika/lims/browser/js/bika.lims.analysisrequest.add_by_col.js
@@ -2552,7 +2552,7 @@ function AnalysisRequestAddByCol() {
function form_submit() {
$("[name='save_button']").click(
function (event) {
- $(this).attr('disabled','disabled');
+ $('input[name="save_button"]').prop('disabled', true);
event.preventDefault();
set_state_from_form_values();
var request_data = {
@@ -2590,6 +2590,7 @@ function AnalysisRequestAddByCol() {
}
msg = msg + e + data.errors[error] + "<br/>"
}
+ $('input[name="save_button"]').prop('disabled', false);
window.bika.lims.portalMessage(msg)
window.scroll(0, 0)
} | Enabled button if saving fails in AR view. | senaite_senaite.core | train | js |
851e1d4fd8d37bfdb94bb4bf0593bb3e46079b9e | diff --git a/qutepart/syntaxhlighter.py b/qutepart/syntaxhlighter.py
index <HASH>..<HASH> 100644
--- a/qutepart/syntaxhlighter.py
+++ b/qutepart/syntaxhlighter.py
@@ -4,7 +4,7 @@ Uses syntax module for doing the job
import time
-from PyQt4.QtCore import QObject, QTimer
+from PyQt4.QtCore import QObject, QTimer, Qt
from PyQt4.QtGui import QApplication, QBrush, QColor, QFont, \
QTextBlockUserData, QTextCharFormat, QTextLayout
@@ -174,8 +174,16 @@ class SyntaxHighlighter(QObject):
return None # Do not apply default format. Performance optimization
qtFormat = QTextCharFormat()
- qtFormat.setForeground(QBrush(QColor(format.color)))
- qtFormat.setBackground(QBrush(QColor(format.background)))
+
+ foregroundColor = QColor(format.color)
+ backgroundColor = QColor(format.background)
+
+ if foregroundColor != Qt.black:
+ qtFormat.setForeground(foregroundColor)
+
+ if backgroundColor != Qt.white:
+ qtFormat.setBackground(backgroundColor)
+
qtFormat.setFontItalic(format.italic)
qtFormat.setFontWeight(QFont.Bold if format.bold else QFont.Normal)
qtFormat.setFontUnderline(format.underline) | highlighting: do not draw white background and black foreground | andreikop_qutepart | train | py |
6fc10c62a690c2dca45e380eacf5b0898280623b | diff --git a/lib/supply/client.rb b/lib/supply/client.rb
index <HASH>..<HASH> 100644
--- a/lib/supply/client.rb
+++ b/lib/supply/client.rb
@@ -22,6 +22,10 @@ module Supply
# instanciate a client given the supplied configuration
def self.make_from_config
+ unless Supply.config[:json_key] || (Supply.config[:key] && Supply.config[:issuer])
+ UI.user_error! "Missing auth credentials: You must specify either 'json_key' or 'key' and 'issuer'"
+ end
+
return Client.new(path_to_key: Supply.config[:key],
issuer: Supply.config[:issuer],
path_to_service_account_json: Supply.config[:json_key]) | Add better error messaging around missing auth credentials | fastlane_fastlane | train | rb |
3b6f27272a0d14918d802ab35ec096fdfaa035cf | diff --git a/tests/settings.py b/tests/settings.py
index <HASH>..<HASH> 100644
--- a/tests/settings.py
+++ b/tests/settings.py
@@ -17,7 +17,7 @@ USE_I18N = False
USE_L10N = False
USE_TZ = True
-SECRET_KEY = 'nt56v8)moa)37ta5z7dd=if-@y#k@l7+t8lct*c8m730lpd=so'
+SECRET_KEY = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
INSTALLED_APPS = (
'django.contrib.auth', | Use an obviously fake secret key
Avoids giving any illusion that the secret key is a real secret. | django-auth-ldap_django-auth-ldap | train | py |
1223355fe6f76542b41d2b25d0ce7fd33cb3e9a1 | diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java
index <HASH>..<HASH> 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/json-shade/java/org/springframework/boot/configurationprocessor/json/JSONArray.java
@@ -65,8 +65,8 @@ public class JSONArray {
public JSONArray(Collection copyFrom) {
this();
if (copyFrom != null) {
- for (Object value : copyFrom) {
- put(JSONObject.wrap(value));
+ for (Iterator it = copyFrom.iterator(); it.hasNext();) {
+ put(JSONObject.wrap(it.next()));
}
}
} | Polish "Simplify code by using for-each loop"
Closes gh-<I> | spring-projects_spring-boot | train | java |
630febb0da13d81f300f1a1dbd51b0c8ad16a4e7 | diff --git a/client/extensions/woocommerce/woocommerce-services/views/shipping-label/label-item.js b/client/extensions/woocommerce/woocommerce-services/views/shipping-label/label-item.js
index <HASH>..<HASH> 100644
--- a/client/extensions/woocommerce/woocommerce-services/views/shipping-label/label-item.js
+++ b/client/extensions/woocommerce/woocommerce-services/views/shipping-label/label-item.js
@@ -134,7 +134,7 @@ class LabelItem extends Component {
currency={ currency }
labelId={ labelId }
/>
- <ReprintDialog siteId={ siteId } orderId={ orderId } { ...label } />
+ <ReprintDialog siteId={ siteId } orderId={ orderId } labelId={ labelId } />
</span>
) }
</p> | Store: Pass only needed props to DetailsDialog
The label object that was being passed before had
a key property, and it was causing a duplicate
key error in React. | Automattic_wp-calypso | train | js |
38a32b7a1d6d06efe1e00d7408265d9d6e39a7fb | diff --git a/mot/cl_routines/sampling/metropolis_hastings.py b/mot/cl_routines/sampling/metropolis_hastings.py
index <HASH>..<HASH> 100644
--- a/mot/cl_routines/sampling/metropolis_hastings.py
+++ b/mot/cl_routines/sampling/metropolis_hastings.py
@@ -174,8 +174,8 @@ class _MHWorker(Worker):
event = cl.enqueue_map_buffer(self._cl_run_context.queue, samples_buf,
cl.map_flags.READ, 0,
- [nmr_problems, self._samples.shape[1]], self._samples.dtype,
- order="C", wait_for=[kernel_event], is_blocking=False)[1]
+ [nmr_problems, self._samples.shape[1], self._samples.shape[2]],
+ self._samples.dtype, order="C", wait_for=[kernel_event], is_blocking=False)[1]
return [event]
def _get_kernel_source(self): | Small update to the correct logging position of the sampling log file. Bug fix to memory mapping MH sampling. | cbclab_MOT | train | py |
9acdb7a45bdd9906d584de8b4e762c1acde8bab4 | diff --git a/spec/shared_stripe_examples/charge_examples.rb b/spec/shared_stripe_examples/charge_examples.rb
index <HASH>..<HASH> 100644
--- a/spec/shared_stripe_examples/charge_examples.rb
+++ b/spec/shared_stripe_examples/charge_examples.rb
@@ -291,7 +291,8 @@ shared_examples 'Charge API' do
object: 'card',
number: '4242424242424242',
exp_month: 12,
- exp_year: 2024
+ exp_year: 2024,
+ cvc: 123
}
)
12.times do
diff --git a/spec/shared_stripe_examples/customer_examples.rb b/spec/shared_stripe_examples/customer_examples.rb
index <HASH>..<HASH> 100644
--- a/spec/shared_stripe_examples/customer_examples.rb
+++ b/spec/shared_stripe_examples/customer_examples.rb
@@ -43,7 +43,8 @@ shared_examples 'Customer API' do
object: 'card',
number: '4242424242424242',
exp_month: 12,
- exp_year: 2024
+ exp_year: 2024,
+ cvc: 123
},
email: '[email protected]') | Updated to include cvc since is stated as usually required in the API | rebelidealist_stripe-ruby-mock | train | rb,rb |
8a897f0ff2c7dfdfc0b66f05e5f8d490502f1d16 | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -227,7 +227,7 @@ gulp.task('watch', function() {
gulp.watch([path.source + 'scripts/**/*'], ['jshint', 'scripts']);
gulp.watch([path.source + 'fonts/**/*'], ['fonts']);
gulp.watch([path.source + 'images/**/*'], ['images']);
- gulp.watch(['bower.json'], ['build']);
+ gulp.watch(['bower.json', 'assets/manifest.json'], ['build']);
gulp.watch('**/*.php', function() {
browserSync.reload();
}); | Watch manifest.json
Working on a project, when I want to modify manifest.json it helps the workflow if I don't need to run `gulp` every time I make a change. | roots_sage | train | js |
89894a42f66f00dbba2d94501406b68cd30a2640 | diff --git a/ginga/rv/plugins/Pick.py b/ginga/rv/plugins/Pick.py
index <HASH>..<HASH> 100644
--- a/ginga/rv/plugins/Pick.py
+++ b/ginga/rv/plugins/Pick.py
@@ -553,8 +553,7 @@ class Pick(GingaPlugin.LocalPlugin):
ci.set_desired_size(width, height)
- ciw = Viewers.GingaScrolledViewerWidget(viewer=ci)
- ciw.scroll_bars(horizontal='on', vertical='on')
+ ciw = Viewers.GingaViewerWidget(viewer=ci)
ciw.resize(width, height)
nb.add_widget(ciw, title="Contour") | Fix for strange window size in Pick tabs under Gtk back end | ejeschke_ginga | train | py |
10c7cf29424b6c230ae9df14de41656e97ea85c8 | diff --git a/target/file.go b/target/file.go
index <HASH>..<HASH> 100644
--- a/target/file.go
+++ b/target/file.go
@@ -42,7 +42,7 @@ func writeToDisk(translated string, r io.Reader) (err error) {
ospath := filepath.FromSlash(path)
if ospath != "" {
- err = os.MkdirAll(ospath, 0764) // rwx, rw, r
+ err = os.MkdirAll(ospath, 0777) // rwx, rw, r
if err != nil {
panic(err)
} | Create directories in publishdir with mode <I>.
The previous permissions (<I>), were unusable (directories must
be executable) when generating files for use by another uid. The
Right Thing™ is to use mode <I>. The OS will subtract the process
umask (usually <I>) to the for the final permissions. | gohugoio_hugo | train | go |
7ca29c35e90fe57d0f5f72a3c3d5de0070543aca | diff --git a/core/pluginconfig_test.go b/core/pluginconfig_test.go
index <HASH>..<HASH> 100644
--- a/core/pluginconfig_test.go
+++ b/core/pluginconfig_test.go
@@ -19,7 +19,7 @@ import (
"testing"
)
-// returns a bogusPluginType
+// returns a mockPluginType
func getMockPluginConfig() PluginConfig {
return NewPluginConfig("mockPluginType")
} | Renamed a word in comments | trivago_gollum | train | go |
13d086b8097f3cf1d2f323509ea66813833557c3 | diff --git a/test/runner/runner.go b/test/runner/runner.go
index <HASH>..<HASH> 100644
--- a/test/runner/runner.go
+++ b/test/runner/runner.go
@@ -308,6 +308,9 @@ func needsBuild(event Event) bool {
if e, ok := event.(*PullRequestEvent); ok && e.Action == "closed" {
return false
}
+ if e, ok := event.(*PushEvent); ok && e.Deleted {
+ return false
+ }
return true
}
diff --git a/test/runner/types.go b/test/runner/types.go
index <HASH>..<HASH> 100644
--- a/test/runner/types.go
+++ b/test/runner/types.go
@@ -13,6 +13,7 @@ type PushEvent struct {
Ref string `json:"ref"`
After string `json:"after"`
Before string `json:"before"`
+ Deleted bool `json:"deleted"`
Commits []*Commit `json:"commits"`
HeadCommit *Commit `json:"head_commit"`
Repository *Repository `json:"repository"` | test: Ignore branch delete events | flynn_flynn | train | go,go |
aaab955a9320b5ccc9e2d5f08cc82471849dbdce | diff --git a/examples/plotting/server/abstractrender.py b/examples/plotting/server/abstractrender.py
index <HASH>..<HASH> 100644
--- a/examples/plotting/server/abstractrender.py
+++ b/examples/plotting/server/abstractrender.py
@@ -16,7 +16,7 @@ https://github.com/ContinuumIO/ArrayManagement
"""
-output_server("abstractrendering")
+output_server("abstractrender")
source = ServerDataSource(data_url="/defaultuser/AAPL.hdf5", owner_username="defaultuser")
plot = square('volume','close',color='#FF00FF',source=source) | Modified output name (again...silly me, did it wrong last time) | bokeh_bokeh | train | py |
c79acdfa6d8cd739dbe587fadd1ce2b809b59cba | diff --git a/src/main/java/nl/hsac/fitnesse/fixture/slim/FileFixture.java b/src/main/java/nl/hsac/fitnesse/fixture/slim/FileFixture.java
index <HASH>..<HASH> 100644
--- a/src/main/java/nl/hsac/fitnesse/fixture/slim/FileFixture.java
+++ b/src/main/java/nl/hsac/fitnesse/fixture/slim/FileFixture.java
@@ -122,13 +122,7 @@ public class FileFixture extends SlimFixtureWithMap {
}
private String cleanupPath(String fullPath) {
- String clean;
- if ("\\".equals(File.separator)) {
- clean = fullPath.replace("/", File.separator);
- } else {
- clean = fullPath.replace("\\", File.separator);
- }
- return clean;
+ return FilenameUtils.separatorsToSystem(fullPath);
}
protected String linkToFile(File f) { | Use standard method to make file separators uniform | fhoeben_hsac-fitnesse-fixtures | train | java |
3dafb5a3840053420d850e1ccb249efc980af94e | diff --git a/src/Illuminate/Notifications/resources/views/email.blade.php b/src/Illuminate/Notifications/resources/views/email.blade.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Notifications/resources/views/email.blade.php
+++ b/src/Illuminate/Notifications/resources/views/email.blade.php
@@ -43,7 +43,8 @@
@if (! empty($salutation))
{{ $salutation }}
@else
-@lang('Regards'),<br>{{ config('app.name') }}
+@lang('Regards'),<br>
+{{ config('app.name') }}
@endif
{{-- Subcopy --}} | Add line break for plain text mails
This change adds a manual line break in addition to the existing HTML-only `<br>`. Before this change the text was `Regards,Laravel`. | laravel_framework | train | php |
f2979588ef798b945a472a7a7f1d967c35a01466 | diff --git a/Bundle/CoreBundle/Form/WidgetType.php b/Bundle/CoreBundle/Form/WidgetType.php
index <HASH>..<HASH> 100644
--- a/Bundle/CoreBundle/Form/WidgetType.php
+++ b/Bundle/CoreBundle/Form/WidgetType.php
@@ -123,7 +123,6 @@ class WidgetType extends AbstractType
$options = $this->options;
$form
- ->add('slot', 'hidden')
->add('fields', 'widget_fields', array(
'label' => 'widget.form.fields.label',
'namespace' => $options['namespace'], | [VICMS-<I>] refactor widget theme | Victoire_victoire | train | php |
b5b873803d1b3e8623296cbdfd01ade48d5370f9 | diff --git a/ezinfo.php b/ezinfo.php
index <HASH>..<HASH> 100755
--- a/ezinfo.php
+++ b/ezinfo.php
@@ -27,7 +27,7 @@ class eZSIInfo
static function info()
{
return array( 'name' => "eZ SI",
- 'version' => '1.1-dev',
+ 'version' => '1.2-dev',
'copyright' => "Copyright (C) 1999-2009 eZ systems AS",
'license' => "GNU General Public License v2.0"
); | - changed version nr: we are at <I>-dev
git-svn-id: <URL> | ezsystems_ezsi | train | php |
edd289fc0186aa7e79c8727bf9380f84f40e174e | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100755
--- a/index.js
+++ b/index.js
@@ -482,7 +482,7 @@ if (require.main === module) {
prepare: 0,
events: 0,
media: 0,
- users: 0,
+ user: 0,
submit: 0,
total: 0,
};
@@ -504,7 +504,7 @@ if (require.main === module) {
timestamps.prepare = 0;
timestamps.events = 0;
timestamps.media = 0;
- timestamps.users = 0;
+ timestamps.user = 0;
timestamps.submit = 0;
timestamps.total = 0;
} else { | Bugfix user timestamp logging typo | exokitxr_exokit | train | js |
e88d0c5f0e54630a99eeb74b0e9fe0c3bd58608f | diff --git a/lib/utils/openBrowser.js b/lib/utils/openBrowser.js
index <HASH>..<HASH> 100644
--- a/lib/utils/openBrowser.js
+++ b/lib/utils/openBrowser.js
@@ -20,15 +20,15 @@ function displayManualOpenMessage(url, err) {
}
module.exports = function openBrowser(url) {
- let browser = process.env.BROWSER;
- if (browser === 'none' || isDockerContainer()) {
- return BbPromise.resolve(displayManualOpenMessage(url));
- }
- if (process.platform === 'darwin' && browser === 'open') {
- browser = undefined;
- }
- const options = { wait: false, app: browser };
- return opn(url, options).catch(err => displayManualOpenMessage(url, err));
+ return BbPromise.try(() => {
+ let browser = process.env.BROWSER;
+ if (browser === 'none' || isDockerContainer()) return displayManualOpenMessage(url);
+ if (process.platform === 'darwin' && browser === 'open') {
+ browser = undefined;
+ }
+ const options = { wait: false, app: browser };
+ return opn(url, options).catch(err => displayManualOpenMessage(url, err));
+ });
};
/* eslint-enable no-console */ | refactor: Ensure async function format | serverless_serverless | train | js |
0848d9469f72c9141dbfa58f9859dc3cbd3eaaaa | diff --git a/toml/toml_test.go b/toml/toml_test.go
index <HASH>..<HASH> 100644
--- a/toml/toml_test.go
+++ b/toml/toml_test.go
@@ -1,7 +1,6 @@
package toml_test
import (
- "reflect"
"testing"
"github.com/influxdb/influxdb/toml"
@@ -19,14 +18,10 @@ func TestSize_UnmarshalText_MB(t *testing.T) {
// Ensure that gigabyte sizes can be parsed.
func TestSize_UnmarshalText_GB(t *testing.T) {
- if typ := reflect.TypeOf(0); typ.Size() != 8 {
- t.Skip("large gigabyte parsing on 64-bit arch only")
- }
-
var s toml.Size
- if err := s.UnmarshalText([]byte("10g")); err != nil {
+ if err := s.UnmarshalText([]byte("2g")); err != nil {
t.Fatalf("unexpected error: %s", err)
- } else if s != 10*(1<<30) {
+ } else if s != 2147483648 {
t.Fatalf("unexpected size: %d", s)
}
} | A gigabyte parsing testing only requires 2GB
Fixes issue #<I>. | influxdata_influxdb | train | go |
05bdff36f62a5428b264dfed0170978fa2007d13 | diff --git a/src/Repo/Def/Entity.php b/src/Repo/Def/Entity.php
index <HASH>..<HASH> 100644
--- a/src/Repo/Def/Entity.php
+++ b/src/Repo/Def/Entity.php
@@ -76,7 +76,7 @@ class Entity
/** @inheritdoc */
public function delete($where)
{
- $result = $this->_repoGeneric->delete($this->_entityName, $where);
+ $result = $this->_repoGeneric->deleteEntity($this->_entityName, $where);
return $result;
} | MOBI-<I> - Group prices for warehouses | praxigento_mobi_mod_core | train | php |
07ce79f87dd43280ba8f9699a74e8695d6235517 | diff --git a/spec/amee-data-abstraction/calculation_set_spec.rb b/spec/amee-data-abstraction/calculation_set_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/amee-data-abstraction/calculation_set_spec.rb
+++ b/spec/amee-data-abstraction/calculation_set_spec.rb
@@ -86,6 +86,16 @@ describe CalculationSet do
set = CalculationSet.find('transport')
end
+ it "should only call load_set once for the same set" do
+ CalculationSet.sets[:transport].should be_nil
+ CalculationSet.sets.count.should == 0
+ set_a = CalculationSet.find('transport')
+ CalculationSet.sets.count.should == 1
+ set_b = CalculationSet.find('transport')
+ CalculationSet.sets.count.should == 1
+ set_a.should be(set_b)
+ end
+
it "should not call load_set if set exists in class hash" do
CalculationSet.sets[:transport].should be_nil
set = CalculationSet.find('transport') | Made double-load test more explicit during AC-<I> | AMEE_amee-data-abstraction | train | rb |
6ebb8bf0e9c56b6a2d446614b18e113c33eb0cb9 | diff --git a/utils.js b/utils.js
index <HASH>..<HASH> 100644
--- a/utils.js
+++ b/utils.js
@@ -40,7 +40,7 @@ Utils.makePathAbsolute = function(p) {
*/
Utils.isIndexFile = function(file) {
- return /index[^\/]*$/.test(file.name);
+ return /^index[^\/]*$/i.test(file.name);
} | Utils#isIndexFile: forces "index" to be at beginning, allows case insensitivity | shippjs_shipp-server | train | js |
de61fe485476102c106eb455d0c5e1f36fbf07df | diff --git a/src/sharding/ShardingManager.js b/src/sharding/ShardingManager.js
index <HASH>..<HASH> 100644
--- a/src/sharding/ShardingManager.js
+++ b/src/sharding/ShardingManager.js
@@ -301,12 +301,12 @@ class ShardingManager extends EventEmitter {
/**
* Kills all running shards and respawns them.
* @param {MultipleShardRespawnOptions} [options] Options for respawning shards
- * @returns {Promise<Collection<string, Shard>>}
+ * @returns {Promise<Collection<number, Shard>>}
*/
async respawnAll({ shardDelay = 5_000, respawnDelay = 500, timeout = 30_000 } = {}) {
let s = 0;
for (const shard of this.shards.values()) {
- const promises = [shard.respawn({ respawnDelay, timeout })];
+ const promises = [shard.respawn({ delay: respawnDelay, timeout })];
if (++s < this.shards.size && shardDelay > 0) promises.push(sleep(shardDelay));
await Promise.all(promises); // eslint-disable-line no-await-in-loop
} | fix(ShardingManager): fix respawnAll not passing delay correctly (#<I>) | discordjs_discord.js | train | js |
408018bdde6cca1a9cc2f294ed9b4c84dc76e3b1 | diff --git a/spec/semipublic/query_spec.rb b/spec/semipublic/query_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/semipublic/query_spec.rb
+++ b/spec/semipublic/query_spec.rb
@@ -47,6 +47,7 @@ describe DataMapper::Query do
end
end
+ # TODO: make one valid spec for each type of option
describe 'with valid options' do
before do
@return = @query = DataMapper::Query.new(@repository, @model, @options)
@@ -55,8 +56,6 @@ describe DataMapper::Query do
it 'should return a Query' do
@return.should be_kind_of(DataMapper::Query)
end
-
- it 'should have specs to make sure each option was set as expected'
end
describe 'with an invalid repository' do
@@ -75,6 +74,7 @@ describe DataMapper::Query do
end
end
+ # TODO: make one invalid spec for each type of option and failure scenario
describe 'with invalid options' do
it 'should raise an exception' do
lambda { | Added TODO notes for Query specs | datamapper_dm-core | train | rb |
949ac1d49b281a125ec0cb668e7bfb2922f1779e | diff --git a/dp_tornado/helper/aws/s3.py b/dp_tornado/helper/aws/s3.py
index <HASH>..<HASH> 100644
--- a/dp_tornado/helper/aws/s3.py
+++ b/dp_tornado/helper/aws/s3.py
@@ -169,20 +169,24 @@ class S3Helper(dpHelper):
fields['success_action_status'] = '201'
conditions.append({'success_action_status': '201'})
-
if acl:
conditions.append({'acl': acl})
if max_content_length:
conditions.append(["content-length-range", 0, max_content_length])
- return s3.generate_presigned_post(
+ payload = s3.generate_presigned_post(
Bucket=bucket_name,
Key=key,
Fields=fields,
Conditions=conditions,
ExpiresIn=expires_in)
+ return {
+ 'action': payload['url'],
+ 'fields': [{'name': k, 'value': v} for k, v in payload['fields'].items()]
+ }
+
def generate_url_with_filename(self,
aws_access_key_id,
aws_secret_access_key, | return payload as old fashioned boto. | why2pac_dp-tornado | train | py |
db6812089f97257b949f8c62d11baac224cbf962 | diff --git a/src/samples/java/ex/SEO_Sample.java b/src/samples/java/ex/SEO_Sample.java
index <HASH>..<HASH> 100644
--- a/src/samples/java/ex/SEO_Sample.java
+++ b/src/samples/java/ex/SEO_Sample.java
@@ -64,6 +64,29 @@ public class SEO_Sample {
System.out.println("Not a SEO");
}
}
+ }
+
+ class FNIssue266 {
+
+ public void testStoredResult() {
+ boolean c1 = aComedy("Baz");
+ if (aComedy("Baf") && c1) {
+ System.out.println("Booyah");
+ }
+ }
+
+ public boolean aComedy(String input) {
+ String result = "foo";
+ while ((result.length() > 0) || result.startsWith(input)) {
+ if (Math.random() > 0.5) {
+ result += "bar";
+ } else {
+ result = result.substring(1);
+ }
+ }
+
+ return (result.length() > 10) && (result.length() < 20);
+ }
}
} | attempt to add a FN seo example as seen by #<I> | mebigfatguy_fb-contrib | train | java |
4b631943ecadf7e89397b68bee577d9eb4f2080c | diff --git a/stl/__about__.py b/stl/__about__.py
index <HASH>..<HASH> 100644
--- a/stl/__about__.py
+++ b/stl/__about__.py
@@ -1,6 +1,6 @@
__package_name__ = 'numpy-stl'
__import_name__ = 'stl'
-__version__ = '1.8.0'
+__version__ = '1.9.0'
__author__ = 'Rick van Hattem'
__author_email__ = '[email protected]'
__description__ = ''' | Bumping to version <I> | WoLpH_numpy-stl | train | py |
f0debeb024e69a3d42dcd7a85e870aa4589b2ca8 | diff --git a/js/jquery.mapael.js b/js/jquery.mapael.js
index <HASH>..<HASH> 100644
--- a/js/jquery.mapael.js
+++ b/js/jquery.mapael.js
@@ -936,7 +936,7 @@
sliceAttrs[i] = $.extend(
{}
- , (legendType == "plot") ? options.map["defaultPlot"].attrs : options.map["defaultArea"].attrs
+ , (legendType == "plot") ? options.map.defaultPlot.attrs : options.map.defaultArea.attrs
, legendOptions.slices[i].attrs
, legendOptions.slices[i].legendSpecificAttrs
); | JSHint: use dot notation
Fix two issues: `['xxx'] is better written in dot notation.` | neveldo_jQuery-Mapael | train | js |
244552614700139ddfd2080d53504a1963070734 | diff --git a/src/core/Core.js b/src/core/Core.js
index <HASH>..<HASH> 100644
--- a/src/core/Core.js
+++ b/src/core/Core.js
@@ -11,6 +11,8 @@ export default class {
// Dictates in what order different plugin types are ran:
this.types = [ 'presetter', 'selecter', 'uploader' ];
+ this.type = 'core';
+
// Container for different types of plugins
this.plugins = {};
}
diff --git a/src/plugins/Dropbox.js b/src/plugins/Dropbox.js
index <HASH>..<HASH> 100644
--- a/src/plugins/Dropbox.js
+++ b/src/plugins/Dropbox.js
@@ -3,6 +3,7 @@ import request from 'superagent';
class DropboxPlugin {
constructor() {
this.name = 'DropboxPlugin';
+ this.type = 'selecter';
this.authenticate = this.authenticate.bind(this);
this.connect = this.connect.bind(this);
this.render = this.render.bind(this);
diff --git a/src/plugins/TransloaditPlugin.js b/src/plugins/TransloaditPlugin.js
index <HASH>..<HASH> 100644
--- a/src/plugins/TransloaditPlugin.js
+++ b/src/plugins/TransloaditPlugin.js
@@ -5,6 +5,7 @@ export default class TransloaditPlugin {
constructor(core, opts) {
this.core = core;
this.opts = opts;
+ this.type = 'none';
this.name = this.constructor.name;
} | Give all our our classes a type | transloadit_uppy | train | js,js,js |
981907c596c0cf0f70f696d1b0af6c5499f90928 | diff --git a/javascript-i18n-library.js b/javascript-i18n-library.js
index <HASH>..<HASH> 100644
--- a/javascript-i18n-library.js
+++ b/javascript-i18n-library.js
@@ -127,7 +127,7 @@
case 'CHF':
return 'CHF';
default:
- return 'NO CURRENCY';
+ return '¤';
}
}; | feat(Currency): Use a default symbol when no currency matches instead of a long string to be more consistent with the other symbols | iadvize_javascript-i18n-library | train | js |
7c75fbe4b94fe7f93a788abdc651da0f241e36d7 | diff --git a/closure/goog/dom/dataset.js b/closure/goog/dom/dataset.js
index <HASH>..<HASH> 100644
--- a/closure/goog/dom/dataset.js
+++ b/closure/goog/dom/dataset.js
@@ -97,7 +97,7 @@ goog.dom.dataset.remove = function(element, key) {
if (goog.dom.dataset.ALLOWED_ && element.dataset) {
// In strict mode Safari will trigger an error when trying to delete a
// property which does not exist.
- if (element.dataset.hasOwnProperty(key)) {
+ if (goog.dom.dataset.has(element, key)) {
delete element.dataset[key];
}
} else { | Use has function to check if there's already a data attribute instead of hasOwnProperty.
RELNOTES: Fix goog.dom.dataset.remove for Safari in strict mode. Different version not using hasOwnProperty.
-------------
Created by MOE: <URL> | google_closure-library | train | js |
ceef1b3f41b9143ce89a35f04130b57b2675c5bc | diff --git a/lib/strongholds.js b/lib/strongholds.js
index <HASH>..<HASH> 100644
--- a/lib/strongholds.js
+++ b/lib/strongholds.js
@@ -251,6 +251,8 @@ module.exports.coreRewards = {
[C.RESOURCE_BIOMASS]: [C.RESOURCE_CELL, C.RESOURCE_PHLEGM, C.RESOURCE_TISSUE, C.RESOURCE_MUSCLE, C.RESOURCE_ORGANOID, C.RESOURCE_ORGANISM],
[C.RESOURCE_MIST]: [C.RESOURCE_CONDENSATE, C.RESOURCE_CONCENTRATE, C.RESOURCE_EXTRACT, C.RESOURCE_SPIRIT, C.RESOURCE_EMANATION, C.RESOURCE_ESSENCE]
};
+module.exports.coreAmounts = [0, 1000, 16000, 60000, 400000, 3000000];
+module.exports.coreDensities = [10, 220, 1400, 5100, 14000, 31500];
module.exports.containerRewards = {
[C.RESOURCE_UTRIUM_BAR]: 5,
@@ -266,3 +268,5 @@ module.exports.containerRewards = {
[C.RESOURCE_CRYSTAL]: 15,
[C.RESOURCE_LIQUID]: 30
};
+module.exports.containerAmounts = [0, 500, 4000, 10000, 50000, 360000];
+ | ♻ extracted more rewards contants into common | screeps_common | train | js |
af194d6c31978a05d567b7b8365a7c3430ffbdd9 | diff --git a/hazelcast/src/main/java/com/hazelcast/map/proxy/MapProxySupport.java b/hazelcast/src/main/java/com/hazelcast/map/proxy/MapProxySupport.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/main/java/com/hazelcast/map/proxy/MapProxySupport.java
+++ b/hazelcast/src/main/java/com/hazelcast/map/proxy/MapProxySupport.java
@@ -810,7 +810,9 @@ abstract class MapProxySupport extends AbstractDistributedObject<MapService> imp
}
}
- //todo: dead code??
+ /**
+ * {@link IMap#executeOnEntries(EntryProcessor)}
+ */
public Map executeOnEntries(EntryProcessor entryProcessor) {
Map result = new HashMap();
try {
@@ -834,7 +836,9 @@ abstract class MapProxySupport extends AbstractDistributedObject<MapService> imp
return result;
}
- //todo: dead code??
+ /**
+ * {@link IMap#executeOnEntries(EntryProcessor, Predicate)}
+ */
public Map executeOnEntries(EntryProcessor entryProcessor, Predicate predicate) {
Map result = new HashMap();
try { | removed unnecessary todos, added links to interface methods | hazelcast_hazelcast | train | java |
f4bfe8e65d7c3d25e3b4db393082b49ff07a6bd0 | diff --git a/lib/DataSift/Historic.php b/lib/DataSift/Historic.php
index <HASH>..<HASH> 100644
--- a/lib/DataSift/Historic.php
+++ b/lib/DataSift/Historic.php
@@ -141,11 +141,6 @@ class DataSift_Historic
protected $_progress = 0;
/**
- * @var array Historics data volume information.
- */
- protected $_volume_info = false;
-
- /**
* @var boolean Set to true if the Historics query has been deleted.
*/
protected $_deleted = false;
@@ -330,11 +325,6 @@ class DataSift_Historic
}
$this->_sample = $data['sample'];
- if (!isset($data['volume_info'])) {
- throw new DataSift_Exception_APIError('No volume info in the response');
- }
- $this->_volume_info = $data['volume_info'];
-
if ($this->_status == 'deleted') {
$this->_deleted = true;
} | Removed check for now deprecated Historics volume_info response field | datasift_datasift-php | train | php |
926e6a1937a02d894ad358887a097902f48656ef | diff --git a/indra/assemblers/cx/hub_layout.py b/indra/assemblers/cx/hub_layout.py
index <HASH>..<HASH> 100644
--- a/indra/assemblers/cx/hub_layout.py
+++ b/indra/assemblers/cx/hub_layout.py
@@ -56,8 +56,12 @@ def classify_nodes(graph, hub):
node_classes = {}
for node_id, stats in node_stats.items():
up = max(set(stats['up']), key=stats['up'].count)
- edge_type = max(set(stats['interaction']),
- key=stats['interaction'].count)
+ # Special case: if up is not 0 then we should exclude complexes
+ # from the edge_type states so that we don't end up with
+ # (-1, complex, ...) or (1, complex, ...) as the node class
+ interactions = [i for i in stats['interaction'] if
+ not (up != 0 and i == 'complex')]
+ edge_type = max(set(interactions), key=interactions.count)
node_type = graph.nodes[node_id]['type']
node_classes[node_id] = (up, edge_type, node_type)
return node_classes | Fix bug in CX hub layout node classification | sorgerlab_indra | train | py |
0a5a633d2027d86e09f6e6b29bbe4890cc425a02 | diff --git a/jax/numpy/lax_numpy.py b/jax/numpy/lax_numpy.py
index <HASH>..<HASH> 100644
--- a/jax/numpy/lax_numpy.py
+++ b/jax/numpy/lax_numpy.py
@@ -1710,9 +1710,9 @@ def cross(a, b, axisa=-1, axisb=-1, axisc=-1, axis=None):
return a[..., 0] * b[..., 1] - a[..., 1] * b[..., 0]
if a_shape[-1] == 2:
- a = concatenate((a, zeros(a_shape[:-1])[..., None]), axis=-1)
+ a = concatenate((a, zeros(a_shape[:-1] + (1,), dtype=a.dtype)), axis=-1)
elif b_shape[-1] == 2:
- b = concatenate((b, zeros(b_shape[:-1])[..., None]), axis=-1)
+ b = concatenate((b, zeros(b_shape[:-1] + (1,), dtype=b.dtype)), axis=-1)
a0 = a[..., 0]
a1 = a[..., 1] | Fix dtypes in cross product | tensorflow_probability | train | py |
0ba505ca0248a64f71522b99faa421199b3dc369 | diff --git a/packages/@vue/cli-plugin-eslint/index.js b/packages/@vue/cli-plugin-eslint/index.js
index <HASH>..<HASH> 100644
--- a/packages/@vue/cli-plugin-eslint/index.js
+++ b/packages/@vue/cli-plugin-eslint/index.js
@@ -53,7 +53,10 @@ module.exports = (api, options) => {
emitWarning: allWarnings,
// only emit errors in production mode.
emitError: allErrors,
- eslintPath: path.dirname(resolveModule('eslint/package.json', cwd)),
+ eslintPath: path.dirname(
+ resolveModule('eslint/package.json', cwd) ||
+ resolveModule('eslint/package.json', __dirname)
+ ),
formatter: loadModule('eslint/lib/formatters/codeframe', cwd, true)
})
}) | fix: fix eslint path resolution in `vue serve` (#<I>)
fixes #<I> | vuejs_vue-cli | train | js |
ecbe5defc4a3c9baadd6d6d7715755d4d6dfdc2f | diff --git a/saltcloud/clouds/joyent.py b/saltcloud/clouds/joyent.py
index <HASH>..<HASH> 100644
--- a/saltcloud/clouds/joyent.py
+++ b/saltcloud/clouds/joyent.py
@@ -125,7 +125,9 @@ def get_configured_provider():
Return the first configured instance.
'''
return config.is_provider_configured(
- __opts__, 'joyent', ('user', 'password')
+ __opts__,
+ __active_profile_name__ or 'joyent',
+ ('user', 'password')
)
@@ -942,13 +944,9 @@ def query2(action=None, command=None, args=None, method='GET', location=None,
if command:
path += '/{0}'.format(command)
- #log.debug("PATH: {2}\nCredentials: {0}/{1}".format(user, password, path))
log.debug('User: {0!r} on PATH: {1}'.format(user, path))
-
auth_key = base64.b64encode('{0}:{1}'.format(user, password))
- log.debug("Data: {0}".format(data))
-
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json', | Joyent is now aware of the `__active_profile_name__` context variable. Refs #<I> | saltstack_salt | train | py |
e17953348440c71f0364eb9c7ccf8474c8c7d3b2 | diff --git a/app/models/metasploit_data_models/automatic_exploitation/match.rb b/app/models/metasploit_data_models/automatic_exploitation/match.rb
index <HASH>..<HASH> 100644
--- a/app/models/metasploit_data_models/automatic_exploitation/match.rb
+++ b/app/models/metasploit_data_models/automatic_exploitation/match.rb
@@ -26,13 +26,16 @@ class MetasploitDataModels::AutomaticExploitation::Match < ActiveRecord::Base
primary_key: :fullname
# Scope a match to a MetasploitDataModels::AutomaticExploitation::Run
- scope :by_run_id,
- ->(run_id){
+ scope :by_run_and_vuln,
+ ->(run,vuln){
joins(
MetasploitDataModels::AutomaticExploitation::Match.join_association(:match_set),
MetasploitDataModels::AutomaticExploitation::MatchSet.join_association(:runs)
).where(
- MetasploitDataModels::AutomaticExploitation::Run[:id].eq(run_id)
+ MetasploitDataModels::AutomaticExploitation::Run[:id].eq(run.id)
+ ).where(
+ MetasploitDataModels::AutomaticExploitation::Match[:matchable_id].eq(vuln.id),
+ MetasploitDataModels::AutomaticExploitation::Match[:matchable_type].eq("Mdm::Vuln")
)
} | Narrow down match scope to run and vuln
MSP-<I> | rapid7_metasploit_data_models | train | rb |
54bc9b8ad93039288bb3ad23030df1f76506250a | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -9,8 +9,10 @@ setup_info = {
'maintainer_email': __author__.split(' - ')[1],
'author': __author__.split(' - ')[0],
'author_email': __author__.split(' - ')[1],
- 'url': 'http://{0}'.format(__author__.split('@')[1]),
+ 'url': 'https://github.com/nap/jaro-winkler-distance',
'license': 'http://www.apache.org/licenses/',
+ 'summary': 'Find the Jaro Winkler Distance which indicates the similarity score between two Strings',
+ 'platform': ['linux'],
'packages': find_packages(),
'classifiers': [
'Development Status :: 5 - Production/Stable', | Added information in setup.py | nap_jaro-winkler-distance | train | py |
e51bf59dae91c34de94dcea47c3418d1b4a7eca5 | diff --git a/code/objects/helpers/AuthorHelper.php b/code/objects/helpers/AuthorHelper.php
index <HASH>..<HASH> 100644
--- a/code/objects/helpers/AuthorHelper.php
+++ b/code/objects/helpers/AuthorHelper.php
@@ -33,7 +33,7 @@ class AuthorHelper extends DataObject
}
}
$this->OriginalName = implode(' ', $nameParts);
- if (!$this->URLSegment && !AuthorHelper::get()->filter(array('OriginalName' => $this->OriginalName))) {
+ if (!$this->URLSegment && !AuthorHelper::get()->filter(array('OriginalName' => $this->OriginalName))->Count()) {
$this->URLSegment = singleton('SiteTree')->generateURLSegment($this->OriginalName);
}
} | Author URLSegment not updated
The Auhtor URLSegment field is not updated during onBeforeWrite.
The test failed on the value returned by AuthorHelper::get()->filter(array('OriginalName' => $this->OriginalName)).
Changind it by AuthorHelper::get()->filter(array('OriginalName' => $this->OriginalName))->Count() solved the probem. | Firesphere_silverstripe-newsmodule | train | php |
2c4bdb3120df98953c52ed087f6a692f385be231 | diff --git a/py3status/modules/spotify.py b/py3status/modules/spotify.py
index <HASH>..<HASH> 100644
--- a/py3status/modules/spotify.py
+++ b/py3status/modules/spotify.py
@@ -2,13 +2,10 @@
"""
This module displays the current "artist - title" playing in Spotify.
-Last modified: 2015-03-26
+Last modified: 2015-03-31
Author: Pierre Guilbert <[email protected]>
-License: GNU GPL http://www.gnu.org/licenses/gpl.html
-
-You could conf it in your i3status.conf like so:
-
+i3status.conf example:
spotify {
format = "{title} by {artist} -> {time}"
@@ -34,7 +31,7 @@ class Py3status:
"""
# available configuration parameters
cache_timeout = 0
- format = "{title}: {album} : {artist} : {time}"
+ format = "{artist} : {title}"
def getText(self):
""" | removing licence gpl: replacing default format by a simpler one | ultrabug_py3status | train | py |
796005809ada091b2520b0ee6ccde752380897e3 | diff --git a/test/test.chatroom.js b/test/test.chatroom.js
index <HASH>..<HASH> 100644
--- a/test/test.chatroom.js
+++ b/test/test.chatroom.js
@@ -68,20 +68,6 @@ describe( 'Chatroom Test', function() {
} );
} );
- it( 'Query all chatrooms: should return OK', function( done ) {
- rongSDK.chatroom.queryAll( function( err, resultText ) {
- should.not.exists( err );
- var result = JSON.parse( resultText );
- result.code.should.equal( 200 );
- var found = _.findWhere( result.chatRooms, { chrmId : chatroomIDs[0] } );
- found.should.not.be.undefined;
- found.should.have.property( 'chrmId', chatroomIDs[0] );
- done();
- } );
- } );
-
} );
-
-
-} );
\ No newline at end of file
+} ); | Remove the testing on chatroom.queryAll method, since this API is no longer provided. | rongcloud_server-sdk-nodejs | train | js |
80bde16d1cd9464e0f1b90ddc157143a244c82a7 | diff --git a/app/controllers/monologue/admin/posts_controller.rb b/app/controllers/monologue/admin/posts_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/monologue/admin/posts_controller.rb
+++ b/app/controllers/monologue/admin/posts_controller.rb
@@ -3,7 +3,8 @@ class Monologue::Admin::PostsController < Monologue::Admin::BaseController
before_filter :load_post, only: [:edit, :update]
def index
- @posts = Monologue::Post.default
+ @page = params[:page].nil? ? 1 : params[:page]
+ @posts = Monologue::Post.listing_page(@page)
end
def new | adds use of new method for paginated post listing in admin | jipiboily_monologue | train | rb |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.