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
|
---|---|---|---|---|---|
642694b9a1d0b07469f197b0b2e658203794ae90 | diff --git a/web/concrete/models/file_list.php b/web/concrete/models/file_list.php
index <HASH>..<HASH> 100644
--- a/web/concrete/models/file_list.php
+++ b/web/concrete/models/file_list.php
@@ -128,6 +128,12 @@ class FileList extends DatabaseItemList {
}
}
}
+
+ // add FileSetFiles if we had a file set filter but
+ // couldn't add it because it has been removed
+ if ($i == 0 && count($this->filteredFileSetIDs)>0) {
+ $this->addToQuery("inner join FileSetFiles fsfl on 1=2");
+ }
} | add FileSetFiles even, if the fileset couldn't be found. The orderBy methods would raise some exceptions otherwise.
Former-commit-id: 8f<I>a<I>f<I>aa5d<I>b1b5a<I>f7b<I>f<I>ef8 | concrete5_concrete5 | train | php |
83f95a38f7ba902de613be4d0a9388a62fbdcb99 | diff --git a/seaworthy/definitions.py b/seaworthy/definitions.py
index <HASH>..<HASH> 100644
--- a/seaworthy/definitions.py
+++ b/seaworthy/definitions.py
@@ -201,11 +201,16 @@ class ContainerDefinition(_DefinitionBase):
self.inner().reload()
return self.inner().status
- def create_and_start(self, helper=None, **kwargs):
+ def create_and_start(self, fetch_image=True, helper=None, **kwargs):
"""
Create the container and start it, waiting for the expected log lines.
+
+ :param fetch_image:
+ Whether to try pull the image if it's not found. The behaviour here
+ is similar to ``docker run`` and this parameter defaults to
+ ``True``.
"""
- self.create(helper=helper, **kwargs)
+ self.create(fetch_image=fetch_image, helper=helper, **kwargs)
self.helper.start(self._inner) | Default fetch_image=True for create_and_start | praekeltfoundation_seaworthy | train | py |
ec220a1ab946de73186b8ec0d2dc72e1851ea774 | diff --git a/core/handler/manager_server.go b/core/handler/manager_server.go
index <HASH>..<HASH> 100644
--- a/core/handler/manager_server.go
+++ b/core/handler/manager_server.go
@@ -458,6 +458,9 @@ func (h *handlerManager) SetApplication(ctx context.Context, in *pb.Application)
app.CustomConverter = in.Converter
app.CustomValidator = in.Validator
app.CustomEncoder = in.Encoder
+ if app.CustomDecoder != "" || app.CustomConverter != "" || app.CustomValidator != "" || app.CustomEncoder != "" {
+ app.PayloadFormat = application.PayloadFormatCustom
+ }
err = h.handler.applications.Set(app)
if err != nil { | Set to custom when (an old) client does not provide the format | TheThingsNetwork_ttn | train | go |
f0613d00293acc98c933b5f4e99c7b44aceeb404 | diff --git a/telluric/collections.py b/telluric/collections.py
index <HASH>..<HASH> 100644
--- a/telluric/collections.py
+++ b/telluric/collections.py
@@ -371,6 +371,9 @@ class FeatureCollection(BaseCollection):
return self.__class__(self._results[index])
return self._results[index]
+ def __repr__(self):
+ return str(list(self))
+
@property
def crs(self):
# Get the CRS from the first feature | Add friendlier representation of FeatureCollection objects | satellogic_telluric | train | py |
0bc45963da845ced69ff33d271f638f9aae1893c | diff --git a/moto/xray/mock_client.py b/moto/xray/mock_client.py
index <HASH>..<HASH> 100644
--- a/moto/xray/mock_client.py
+++ b/moto/xray/mock_client.py
@@ -46,10 +46,10 @@ class MockXrayClient:
if not f:
return self
- def wrapped_f():
+ def wrapped_f(*args, **kwargs):
self.start()
try:
- f()
+ f(*args, **kwargs)
finally:
self.stop() | Update xray client to forward args (#<I>) | spulec_moto | train | py |
1e1d52d06ba41c3cb3c1829d2ed010367bfeddb2 | diff --git a/ros_buildfarm/pulp.py b/ros_buildfarm/pulp.py
index <HASH>..<HASH> 100644
--- a/ros_buildfarm/pulp.py
+++ b/ros_buildfarm/pulp.py
@@ -53,6 +53,12 @@ class PulpPageIterator:
self._iter = iter(self._page.results)
def __iter__(self):
+ # Make sure we're at the beginning
+ if self._page.previous:
+ self._offset = 0
+ self._next_page()
+ else:
+ self._iter = iter(self._page.results)
return self
def __len__(self): | Support multiple iter(...) invocations on pulp iterator (#<I>)
This isn't currently causing any issues, but while debugging another
problem and reading documentation on iterators in Python, I found that
this should be supported. | ros-infrastructure_ros_buildfarm | train | py |
ea5125bdc5702f6a9f281d033d16cde6999bdf52 | diff --git a/kipeto-common/src/main/java/de/ecclesia/kipeto/common/util/CountingInputStream.java b/kipeto-common/src/main/java/de/ecclesia/kipeto/common/util/CountingInputStream.java
index <HASH>..<HASH> 100644
--- a/kipeto-common/src/main/java/de/ecclesia/kipeto/common/util/CountingInputStream.java
+++ b/kipeto-common/src/main/java/de/ecclesia/kipeto/common/util/CountingInputStream.java
@@ -71,6 +71,12 @@ public class CountingInputStream extends FilterInputStream {
return this.count;
}
+ @Override
+ public void close() throws IOException {
+ updateCount(-1);
+ super.close();
+ }
+
private void updateCount(int read) {
if (read == -1) {
ByteTransferEvent event = new ByteTransferEvent(count, count - countAtLastEvent, threshold, true); | Fix wrong byte count due to ommitting event on close | ecclesia_kipeto | train | java |
dc2f8c2302d320165039e0ff2c10216926e868c0 | diff --git a/library/Phrozn/Site/DefaultSite.php b/library/Phrozn/Site/DefaultSite.php
index <HASH>..<HASH> 100644
--- a/library/Phrozn/Site/DefaultSite.php
+++ b/library/Phrozn/Site/DefaultSite.php
@@ -63,10 +63,15 @@ class DefaultSite
$inputFile = str_replace(getcwd(), '.', $view->getInputFile());
$outputFile = str_replace(getcwd(), '.', $view->getOutputFile());
try {
- $view->compile($vars);
- $this->getOutputter()
- ->stdout('%b' . $inputFile . '%n parsed')
- ->stdout('%b' . $outputFile . '%n written');
+ if ($view->getParam('page.skip', false)) {
+ $this->getOutputter()
+ ->stdout('%b' . $inputFile . '%n %rSKIPPED%n');
+ } else {
+ $view->compile($vars);
+ $this->getOutputter()
+ ->stdout('%b' . $inputFile . '%n parsed')
+ ->stdout('%b' . $outputFile . '%n written');
+ }
} catch (\Exception $e) {
$this->getOutputter()
->stderr($inputFile . ': ' . $e->getMessage()); | Fixes #<I>: skip option in FM is recognized | Pawka_phrozn | train | php |
59214ada90dbc25b9d602c401789f655f65d56fb | diff --git a/salt/cloud/clouds/openstack.py b/salt/cloud/clouds/openstack.py
index <HASH>..<HASH> 100644
--- a/salt/cloud/clouds/openstack.py
+++ b/salt/cloud/clouds/openstack.py
@@ -424,7 +424,10 @@ def list_nodes_full(conn=None, call=None):
ret[node.name]['public_ips'] = _get_ips(node, 'public')
ret[node.name]['floating_ips'] = _get_ips(node, 'floating')
ret[node.name]['fixed_ips'] = _get_ips(node, 'fixed')
- ret[node.name]['image'] = node.image.name
+ if isinstance(node.image, six.string_types):
+ ret[node.name]['image'] = node.image
+ else:
+ ret[node.name]['image'] = getattr(conn.get_image(node.image.id), 'name', node.image.id)
return ret
@@ -483,7 +486,7 @@ def show_instance(name, conn=None, call=None):
if isinstance(node.image, six.string_types):
ret['image'] = node.image
else:
- ret['image'] = conn.get_image(node.image.id).name
+ ret['image'] = getattr(conn.get_image(node.image.id), 'name', node.image.id)
return ret | Fallback to image id if we don't have an image name | saltstack_salt | train | py |
45890ac20cda8d0769a3443f7393ca8270273cc9 | diff --git a/vectortile/Bbox.py b/vectortile/Bbox.py
index <HASH>..<HASH> 100644
--- a/vectortile/Bbox.py
+++ b/vectortile/Bbox.py
@@ -13,7 +13,9 @@ class Bbox(object):
def __str__(self):
def f(v):
- return "{:.5f}".format(v)
+ # Format v as javascript toString():
+ if (v == 0.0): return "0"
+ return str(v).rstrip("0").rstrip(".")
# left,bottom,right,top - all according to openlayers :)
return "%s,%s,%s,%s" % (f(self.lonmin), f(self.latmin), f(self.lonmax), f(self.latmax)) | Bugfix to work the same as the client code | SkyTruth_vectortile | train | py |
fa455d342b0f2d9aab28d937bf0af9f7df892967 | diff --git a/pharen.php b/pharen.php
index <HASH>..<HASH> 100644
--- a/pharen.php
+++ b/pharen.php
@@ -1099,10 +1099,14 @@ class NamespaceNode extends KeywordCallNode{
public function compile_statement(){
array_unshift($this->children, Null);
$this->children[1]->value = "namespace";
- RootNode::$raw_ns = $this->children[2]->value;
- RootNode::$ns = $this->children[2]->compile();
- RootNode::$ns_string = parent::compile_statement();
- return "";
+ if(empty(RootNode::$raw_ns)){
+ RootNode::$raw_ns = $this->children[2]->value;
+ RootNode::$ns = $this->children[2]->compile();
+ RootNode::$ns_string = parent::compile_statement();
+ return "";
+ }else{
+ return parent::compile_statement();
+ }
}
public function compile(){ | Place namespace statement inline instead of at the beginning of the script if a ns is already present. | Scriptor_pharen | train | php |
b1eb41e6688be6af37f8a5cff0a98382c3ee8d94 | diff --git a/isochrones/starmodel.py b/isochrones/starmodel.py
index <HASH>..<HASH> 100644
--- a/isochrones/starmodel.py
+++ b/isochrones/starmodel.py
@@ -1367,7 +1367,7 @@ class BasicStarModel(StarModel):
try:
val, unc = v
if not (np.isnan(val) or np.isnan(unc)):
- self.kwargs[k] = v
+ self.kwargs[k] = (np.float64(val), np.float64(unc))
except TypeError:
logger.warning('kwarg {}={} ignored!'.format(k, v))
@@ -1392,6 +1392,10 @@ class BasicStarModel(StarModel):
'AV': AVPrior().bounds,
'eep': self._priors['eep'].bounds}
+ # Reset bounds to match IC bounds. Likely different from default priors.
+ for par in ['mass', 'feh', 'age']:
+ self.bounds(par)
+
if maxAV is not None:
self.set_bounds(AV=(0, maxAV)) | address issue <I> (dtypes and initial prior) | timothydmorton_isochrones | train | py |
cd8bcd8fed4c8ec193570bb1ede1b471709a1c35 | diff --git a/modules/casper.js b/modules/casper.js
index <HASH>..<HASH> 100644
--- a/modules/casper.js
+++ b/modules/casper.js
@@ -44,7 +44,7 @@ var f = utils.format;
var defaultUserAgent = phantom.defaultPageSettings.userAgent
- .replace('PhantomJS', f("CasperJS/%s", phantom.casperVersion) + '+Phantomjs');
+ .replace(/(PhantomJS|SlimerJS)/, f("CasperJS/%s", phantom.casperVersion) + '+$&');
exports.create = function create(options) {
"use strict"; | Refs #<I>: creation of default UA should take care about SlimerJS | casperjs_casperjs | train | js |
033e6dbcbc735101164a7fa4c789e6704a6ee15a | diff --git a/aldryn_apphooks_config/models.py b/aldryn_apphooks_config/models.py
index <HASH>..<HASH> 100644
--- a/aldryn_apphooks_config/models.py
+++ b/aldryn_apphooks_config/models.py
@@ -15,6 +15,8 @@ class AppHookConfig(models.Model):
namespace = models.CharField(max_length=100)
app_data = AppDataField()
+ cmsapp = None
+
class Meta:
verbose_name = _(u'app-hook config')
verbose_name_plural = _(u'app-hook configs')
@@ -27,4 +29,7 @@ class AppHookConfig(models.Model):
super(AppHookConfig, self).save(*args, **kwargs)
def __str__(self):
- return _(u'%s / %s') % (self.type, self.namespace)
\ No newline at end of file
+ if self.cmsapp:
+ return _(u'%s / %s') % (self.cmsapp.name, self.namespace)
+ else:
+ return _(u'%s / %s') % (self.type, self.namespace)
\ No newline at end of file | Change the str representation of AppHookConfig by using the related CMSApp name instead of the type | divio_aldryn-apphooks-config | train | py |
e61fcbde87822767077f14681a7db03e1fabfeab | diff --git a/lib/swagger-express/index.js b/lib/swagger-express/index.js
index <HASH>..<HASH> 100644
--- a/lib/swagger-express/index.js
+++ b/lib/swagger-express/index.js
@@ -296,7 +296,8 @@ exports.init = function (app, opt) {
resource = resources[match[1]];
if (!resource) {
- return res.send(404);
+ //detect if it's express 4.x or 3.5.x
+ return (res.sendStatus ? res.sendStatus(404) : res.send(404));
}
result.resourcePath = resource.resourcePath; | fix Express 4 warning
express deprecated res.send(status): Use res.sendStatus(status) instead node_modules/swagger-express/lib/swagger-express/index.js:<I>:<I>
This module is still supporting express <I>.x, so for the time being, there is some quick check if the sendStatus method is defined | Surnet_swagger-jsdoc | train | js |
4cfa9b32e810d0a4c8a5f6810092fb48c0db887c | diff --git a/config/protractor-ci.conf.js b/config/protractor-ci.conf.js
index <HASH>..<HASH> 100644
--- a/config/protractor-ci.conf.js
+++ b/config/protractor-ci.conf.js
@@ -6,6 +6,7 @@ exports.config = {
capabilities: {
browserName: 'chrome',
version: '',
- platform: 'ANY'
- },
+ platform: 'ANY',
+ name: process.env.TRAVIS_BUILD_NUMBER
+ }
};
\ No newline at end of file | added travis ci build number as 'name' in protractor config (for saucelabs) | danmindru_angular-boilerplate-study | train | js |
453bd898a06a0d461b7888a88649eab55a817408 | diff --git a/simuvex/s_state.py b/simuvex/s_state.py
index <HASH>..<HASH> 100644
--- a/simuvex/s_state.py
+++ b/simuvex/s_state.py
@@ -462,7 +462,7 @@ class SimState(ana.Storable): # pylint: disable=R0904
# plugins
for p in self.plugins:
- if p == 'solver_engine':
+ if p in ('solver_engine', 'unicorn'):
continue
plugin_state_widened = widened.plugins[p].widen([_.plugins[p] for _ in others])
if plugin_state_widened: | A hack to avoid widening solver_engine and unicorn plugins. | angr_angr | train | py |
19cca56cd82bbc81d61e60f3059dac5870054090 | diff --git a/lib/cli/app.js b/lib/cli/app.js
index <HASH>..<HASH> 100644
--- a/lib/cli/app.js
+++ b/lib/cli/app.js
@@ -81,7 +81,7 @@ function waitForNumbersFromInput(ctx) {
inStream.on("data", function(chunk) {
var chunkStr = chunk.toString("utf8");
var sanitizedStr = removeLeadingAndTrailingNewLines(convertWindowsNewLinesToUnix(chunkStr));
- var newNumbers = sanitizedStr.split(os.EOL);
+ var newNumbers = sanitizedStr.split("\n");
processNewNumbers(ctx, newNumbers);
});
@@ -125,7 +125,7 @@ function endOutput(ctx) {
}
function convertWindowsNewLinesToUnix(str) {
- return str.replace(/\r\n/g, "\n");
+ return str.replace(/\r/g, "");
}
function removeLeadingAndTrailingNewLines(str) { | Support data from stdin containing Windows line endings | brettmclean_number-converter | train | js |
265afc63e7bb4c12ef7c1bc187575d4461f313c7 | diff --git a/src/matreshka.js b/src/matreshka.js
index <HASH>..<HASH> 100644
--- a/src/matreshka.js
+++ b/src/matreshka.js
@@ -1200,7 +1200,7 @@ MK.extend( MK, {
classp: function( className ) {
var not = !className.indexOf( '!' );
if( not ) {
- className.replace( '!', '' );
+ className = className.replace( '!', '' );
}
return {
setValue: function( v ) { | fixed bug in MK.classp | matreshkajs_matreshka | train | js |
aa9ddca1ec266b2bc226057b510744020c8e50d6 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -32,7 +32,7 @@ install_requires = [
'readlike==0.1.2',
'requests>=2.6.0,<3', # uses semantic versioning (after 2.6)
'ReParser==1.4.3',
- 'protobuf>=3.1.0,<=3.6.1',
+ 'protobuf>=3.1.0,<=3.7.0',
'urwid==1.3.1',
'MechanicalSoup==0.6.0',
] | Allow usage of protobuf <I> | tdryer_hangups | train | py |
29c169145582c2e204eac0360006a4e881e847d8 | diff --git a/test/MutableCreationOptionsAwareTraitTest.php b/test/MutableCreationOptionsAwareTraitTest.php
index <HASH>..<HASH> 100644
--- a/test/MutableCreationOptionsAwareTraitTest.php
+++ b/test/MutableCreationOptionsAwareTraitTest.php
@@ -11,6 +11,10 @@ namespace ZendTest\ServiceManager;
use PHPUnit_Framework_TestCase as TestCase;
+/**
+ * @requires PHP 5.4
+ * @group Zend_ServiceManager
+ * /
class MutableCreationOptionsAwareTraitTest extends TestCase
{
protected $stub; | Update MutableCreationOptionsAwareTraitTest.php
added requires annotation | mxc-commons_mxc-servicemanager | train | php |
6202afa1d34f35d016d4477ba22d6bc9a119ca06 | diff --git a/src/CoreBundle/Test/XliffValidatorTestCase.php b/src/CoreBundle/Test/XliffValidatorTestCase.php
index <HASH>..<HASH> 100644
--- a/src/CoreBundle/Test/XliffValidatorTestCase.php
+++ b/src/CoreBundle/Test/XliffValidatorTestCase.php
@@ -44,6 +44,12 @@ abstract class XliffValidatorTestCase extends TestCase
if (\count($this->errors) > 0) {
$this->fail(sprintf('Unable to parse xliff files: %s', implode(', ', $this->errors)));
}
+
+ $this->assertCount(
+ 0,
+ $this->errors,
+ sprintf('Unable to parse xliff files: %s', implode(', ', $this->errors))
+ );
}
/** | fix risky tests
an alternative could be to use @doesNotPerformAssertions annotation
on this testcase but this one is more straight forward. | sonata-project_SonataCoreBundle | train | php |
1f51b9e71a51ae1ce1a3147056e1224e6abf369a | diff --git a/src/pybel/io/nodelink.py b/src/pybel/io/nodelink.py
index <HASH>..<HASH> 100644
--- a/src/pybel/io/nodelink.py
+++ b/src/pybel/io/nodelink.py
@@ -37,7 +37,7 @@ def to_json(graph):
graph_json_dict = node_link_data(graph)
graph_json_dict['graph'][GRAPH_ANNOTATION_LIST] = {
k: list(sorted(v))
- for k, v in graph_json_dict['graph'].get(GRAPH_ANNOTATION_LIST, {}).items()
+ for k, v in graph_json_dict['graph'][GRAPH_ANNOTATION_LIST].items()
}
return graph_json_dict | Remove default getter
Since the new init function ensures that this dictionary is at least
present, it should be more strict in how it gets it | pybel_pybel | train | py |
4c174cfdb32da78ea860ca9182cea77a092f5597 | diff --git a/test/specs/Conformance-test.js b/test/specs/Conformance-test.js
index <HASH>..<HASH> 100644
--- a/test/specs/Conformance-test.js
+++ b/test/specs/Conformance-test.js
@@ -17,7 +17,7 @@ describe('Conformance', () => {
describe(constructorName, () => {
it('extends Component', () => {
- expect(Component.prototype).to.eql(React.Component.prototype)
+ expect(Component.prototype).to.deep.equal(React.Component.prototype)
})
it(`constructor name matches filename "${constructorName}"`, () => { | refactor(Conformance-test): use readable deep.equal assertion | Semantic-Org_Semantic-UI-React | train | js |
a97f4bc5001b944221b6b6ea862bf3772b52760a | diff --git a/gulp/util/paths.js b/gulp/util/paths.js
index <HASH>..<HASH> 100644
--- a/gulp/util/paths.js
+++ b/gulp/util/paths.js
@@ -88,6 +88,7 @@ if(fs.existsSync(paths.activeCaptureConfigPath)){
} : paths.ci;
}
-paths.compareReportURL = 'http://localhost:' + paths.portNumber + '/compare/';
+paths.domainUrl = argv.domainUrl ? (argv.domainUrl + ':') : 'http://localhost:';
+paths.compareReportURL = paths.domainUrl + paths.portNumber + '/compare/';
module.exports = paths; | support config opening report domain url | garris_BackstopJS | train | js |
eeaea0cf8d0e4df3425ee19cc9f800fdc73bee80 | diff --git a/aiohttp/__init__.py b/aiohttp/__init__.py
index <HASH>..<HASH> 100644
--- a/aiohttp/__init__.py
+++ b/aiohttp/__init__.py
@@ -1,4 +1,4 @@
-__version__ = "3.8.0a6"
+__version__ = "3.8.0a7"
from typing import Tuple | Bump to <I>a7 | aio-libs_aiohttp | train | py |
1da584308d59b9029549804a7feaa4818ea0e289 | diff --git a/manager/state/raft/raft.go b/manager/state/raft/raft.go
index <HASH>..<HASH> 100644
--- a/manager/state/raft/raft.go
+++ b/manager/state/raft/raft.go
@@ -1206,12 +1206,28 @@ func (n *Node) applyRemoveNode(cc raftpb.ConfChange) (err error) {
// If the node from where the remove is issued is
// a follower and the leader steps down, Campaign
// to be the leader.
- if cc.NodeID == n.Leader() {
+
+ if cc.NodeID == n.Leader() && !n.IsLeader() {
if err = n.Campaign(n.Ctx); err != nil {
return err
}
}
+ if cc.NodeID == n.Config.ID {
+ // wait the commit ack to be sent before closing connection
+ n.asyncTasks.Wait()
+
+ // if there are only 2 nodes in the cluster, and leader is leaving
+ // before closing the connection, leader has to ensure that follower gets
+ // noticed about this raft conf change commit. Otherwise, follower would
+ // assume there are still 2 nodes in the cluster and won't get elected
+ // into the leader by acquiring the majority (2 nodes)
+
+ // while n.asyncTasks.Wait() could be helpful in this case
+ // it's the best-effort strategy, because this send could be fail due to some errors (such as time limit exceeds)
+ // TODO(Runshen Zhu): use leadership transfer to solve this case, after vendoring raft 3.0+
+ }
+
return n.cluster.RemoveMember(cc.NodeID)
} | wait the raft conf change commit ack to be sent | docker_swarmkit | train | go |
477d1afa4cf171baee8c9a8d7bb6f3e9daad2d85 | diff --git a/coconut/root.py b/coconut/root.py
index <HASH>..<HASH> 100644
--- a/coconut/root.py
+++ b/coconut/root.py
@@ -84,6 +84,8 @@ class range(object):
return _coconut.repr(self._xrange)[1:]
def __reduce_ex__(self, protocol):
return (self.__class__, self._xrange.__reduce_ex__(protocol)[1])
+from collections.abc import Sequence as _coconut_Sequence
+_coconut_Sequence.register(range)
class int(_coconut_int):
__slots__ = ()
__doc__ = _coconut_int.__doc__ | Makes range a Sequence in Python 2 | evhub_coconut | train | py |
332aa32a053c87d4b976cdbe3d3974c19a14c56e | diff --git a/examples/simple/webpack.config.js b/examples/simple/webpack.config.js
index <HASH>..<HASH> 100644
--- a/examples/simple/webpack.config.js
+++ b/examples/simple/webpack.config.js
@@ -6,14 +6,13 @@ module.exports = {
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, use: { loader: 'babel-loader' } },
- { test: /\.css$/, loader: 'style-loader!css-loader' },
+ { test: /\.css$/, use: [{ loader: 'style-loader' }, { loader: 'css-loader' }] },
{ test: /\.html$/, use: { loader: 'html-loader' } }
],
},
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html',
- filename: './index.html'
})
],
resolve: { | Fix the format of the style rule in webpack config and remove the filename in html plugin | marmelab_react-admin | train | js |
b24afb9f1674fb58c8a1a77f3309e396a405bcb5 | diff --git a/src/main/java/com/blade/mvc/http/HttpResponse.java b/src/main/java/com/blade/mvc/http/HttpResponse.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/blade/mvc/http/HttpResponse.java
+++ b/src/main/java/com/blade/mvc/http/HttpResponse.java
@@ -87,6 +87,7 @@ public class HttpResponse implements Response {
}
nettyCookie.setPath(cookie.path());
nettyCookie.setHttpOnly(cookie.httpOnly());
+ nettyCookie.setSecure(cookie.secure());
this.cookies.add(nettyCookie);
return this;
}
diff --git a/src/main/java/com/blade/server/netty/SessionHandler.java b/src/main/java/com/blade/server/netty/SessionHandler.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/blade/server/netty/SessionHandler.java
+++ b/src/main/java/com/blade/server/netty/SessionHandler.java
@@ -63,6 +63,7 @@ public class SessionHandler {
cookie.name(sessionKey);
cookie.value(sessionId);
cookie.httpOnly(true);
+ cookie.secure(request.isSecure());
Session session = ReflectKit.newInstance(blade.sessionType());
session.id(sessionId); | :lock: session cookie security obtain | lets-blade_blade | train | java,java |
3d04beb436bb6191de1ace08658ab8e0fc7f4cbe | diff --git a/test/mocker/rtm.spec.js b/test/mocker/rtm.spec.js
index <HASH>..<HASH> 100644
--- a/test/mocker/rtm.spec.js
+++ b/test/mocker/rtm.spec.js
@@ -256,6 +256,7 @@ describe('mocker: rtm', function () {
return rtm.stopServer(token)
.then(() => {
expect(wsServerMock.close).to.have.been.called
+ expect(serverMock.close).to.have.been.called
})
})
@@ -274,6 +275,7 @@ describe('mocker: rtm', function () {
return rtm.stopServer('notreal')
.then(() => {
expect(wsServerMock.close).not.to.have.been.called
+ expect(serverMock.close).to.have.been.called
})
}) | adds assertions for closing server connection | Skellington-Closet_slack-mock | train | js |
647a2f642502ca357a00f3e596dd62a5e04aff32 | diff --git a/lib/deliver/options.rb b/lib/deliver/options.rb
index <HASH>..<HASH> 100644
--- a/lib/deliver/options.rb
+++ b/lib/deliver/options.rb
@@ -60,6 +60,10 @@ module Deliver
short_option: '-w',
description: "Path to the folder containing the screenshots",
optional: true),
+ FastlaneCore::ConfigItem.new(key: :skip_upload,
+ description: "Skip uploading an ipa or pkg to iTunes Connect",
+ is_string: false,
+ default_value: false),
FastlaneCore::ConfigItem.new(key: :skip_screenshots,
description: "Don't upload the screenhsots",
is_string: false,
diff --git a/lib/deliver/runner.rb b/lib/deliver/runner.rb
index <HASH>..<HASH> 100644
--- a/lib/deliver/runner.rb
+++ b/lib/deliver/runner.rb
@@ -19,7 +19,11 @@ module Deliver
def run
verify_version if options[:app_version].to_s.length > 0
upload_metadata
- upload_binary if options[:ipa] || options[:pkg]
+
+ has_binary = options[:ipa] || options[:pkg]
+ if !options[:skip_upload] && has_binary
+ upload_binary
+ end
Helper.log.info "Finished the upload to iTunes Connect".green | Option to skip uploading a binary (useful if you use pilot for that, but want to use deliver to submit screenshots) | fastlane_fastlane | train | rb,rb |
625a3fcfd69a88f4881acb9b6b6b07636822ec7a | diff --git a/conductor/src/main/java/com/bluelinelabs/conductor/changehandler/FadeChangeHandler.java b/conductor/src/main/java/com/bluelinelabs/conductor/changehandler/FadeChangeHandler.java
index <HASH>..<HASH> 100644
--- a/conductor/src/main/java/com/bluelinelabs/conductor/changehandler/FadeChangeHandler.java
+++ b/conductor/src/main/java/com/bluelinelabs/conductor/changehandler/FadeChangeHandler.java
@@ -37,7 +37,7 @@ public class FadeChangeHandler extends AnimatorChangeHandler {
animator.play(ObjectAnimator.ofFloat(to, View.ALPHA, start, 1));
}
- if (from != null && removesFromViewOnPush()) {
+ if (from != null && (!isPush || removesFromViewOnPush())) {
animator.play(ObjectAnimator.ofFloat(from, View.ALPHA, 0));
} | Fixes fade change handler animation when popping and removesFromViewOnPush is false | bluelinelabs_Conductor | train | java |
4fb102e4be973609f6e356387072a30f9b2cff36 | diff --git a/tests/test_octodns_manager.py b/tests/test_octodns_manager.py
index <HASH>..<HASH> 100644
--- a/tests/test_octodns_manager.py
+++ b/tests/test_octodns_manager.py
@@ -310,8 +310,7 @@ class TestManager(TestCase):
pass
# This should be ok, we'll fall back to not passing it
- manager._populate_and_plan('unit.tests.', None, False,
- [NoLenient()], [])
+ manager._populate_and_plan('unit.tests.', [NoLenient()], [])
class NoZone(SimpleProvider):
@@ -320,8 +319,7 @@ class TestManager(TestCase):
# This will blow up, we don't fallback for source
with self.assertRaises(TypeError):
- manager._populate_and_plan('unit.tests.', None, False,
- [NoZone()], [])
+ manager._populate_and_plan('unit.tests.', [NoZone()], [])
def test_alias_zones(self):
with TemporaryDirectory() as tmpdir: | Fixes tests related to _populate_and_plan() | github_octodns | train | py |
f1d988d1bbf13e8a175054e2fe489531d92d67f7 | diff --git a/lib/ruby_units/unit_definitions/standard.rb b/lib/ruby_units/unit_definitions/standard.rb
index <HASH>..<HASH> 100644
--- a/lib/ruby_units/unit_definitions/standard.rb
+++ b/lib/ruby_units/unit_definitions/standard.rb
@@ -104,7 +104,7 @@ end
avagadro_constant = RubyUnits::Unit.new('6.02214129e23 1/mol')
RubyUnits::Unit.define('AMU') do |amu|
- amu.definition = RubyUnits::Unit.new('12 kg/mol') / (12 * avagadro_constant)
+ amu.definition = RubyUnits::Unit.new('0.012 kg/mol') / (12 * avagadro_constant)
amu.aliases = %w{u AMU amu}
end | Fix 'amu' definition
'amu' is defined as <I> kg/mol / (<I> * Avogadro) | olbrich_ruby-units | train | rb |
1702f5c5476912cb7af905512a7c44537d1c8c7d | diff --git a/src/resources/views/profile/view.blade.php b/src/resources/views/profile/view.blade.php
index <HASH>..<HASH> 100644
--- a/src/resources/views/profile/view.blade.php
+++ b/src/resources/views/profile/view.blade.php
@@ -433,6 +433,17 @@
{!! img('character', $character->id, 64, ['class' => 'img-circle eve-icon small-icon']) !!}
{{ $character->name }}
+ @if ($character->refresh_token )
+ <button data-toggle="tooltip" title="" class="btn btn-xs btn-link" data-original-title="Valid Token">
+ <i class="fa fa-check text-success"></i>
+ </button>
+ @else
+ <button data-toggle="tooltip" title="" class="btn btn-xs btn-link" data-original-title="Invalid Token"
+ aria-describedby="tooltip257244">
+ <i class="fa fa-exclamation-triangle text-danger"></i>
+ </button>
+ @endif
+
</li>
@endforeach | Add token status linked characters (#<I>) | eveseat_web | train | php |
3e001d6c227111b78ac358bb1f0238734a78822a | diff --git a/bin/samp-server-cli.py b/bin/samp-server-cli.py
index <HASH>..<HASH> 100755
--- a/bin/samp-server-cli.py
+++ b/bin/samp-server-cli.py
@@ -29,6 +29,7 @@ import itertools
import os
import platform
import random
+import shutil
import string
import subprocess
import sys
@@ -66,6 +67,9 @@ def parse_options(args):
help='override server startup command (path to server executable '
'by default)')
+ argument('-C', '--config', dest='config', metavar='filename',
+ help='use existing server.cfg file')
+
argument('-D', '--debug', dest='debug',
nargs=argparse.REMAINDER,
help='run server under debugger')
@@ -335,10 +339,15 @@ def main(argv):
elif is_windows():
command = ['ollydbg'] + debug + command
+ config = options.pop('config')
+ if config is not None:
+ shutil.copy(os.path.join(workdir, config),
+ os.path.join(workdir, 'server.cfg'))
+
no_config = options.pop('no_config')
no_launch = options.pop('no_launch')
- if not no_config:
+ if not no_config and not config:
server_cfg = os.path.join(workdir, 'server.cfg')
write_config(server_cfg, options) | Add --config option
The new -C or --config option allows you to use an existing server.cfg
file as opposed to generating a new one. This is convenient if you
frequently switch between different configurations and you don't want
to type all the command line arguments over and over again. | Zeex_samp-server-cli | train | py |
64c2840db0cccd77d0af26813176e55ed38cff69 | diff --git a/plugin.js b/plugin.js
index <HASH>..<HASH> 100644
--- a/plugin.js
+++ b/plugin.js
@@ -123,7 +123,7 @@ class WasmPackPlugin {
_makeEmpty() {
try {
- fs.mkdirSync(this.outDir)
+ fs.mkdirSync(this.outDir, {recursive: true})
} catch (e) {
if (e.code !== 'EEXIST') {
throw e | Recursively create output directory
Creates parent dirs of output directory if necessary. This makes the behavior consistent with the
rest of Webpack (for example, the `output.path` config setting creates parent dirs as needed). | wasm-tool_wasm-pack-plugin | train | js |
4d6668db78038b88f51297a0caeb3d06c758213b | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -89,8 +89,6 @@ function _extractData(html, sortOrder, forceInEvent) {
}
function _submitRecord(recordData) {
- // TODO: remove this in production
- var baseUrl = 'https://tonlyyi6fp3k.runscope.net';
var options = { form: { 'editReason': recordData } };
return request.postAsync(baseUrl + '/record/saveRecordManual', options) | - tested and ready for wide usage | vladimyr_qtimecards | train | js |
13472c2854c90a79b058422fd5cee92246562743 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -238,6 +238,9 @@ function findPrototype(items, ancestors) {
function findSelf(items, ancestors) {
for (var i = ancestors.length - 1; i >= 0; i--) {
+ var forward = i && ancestors[i - 1].forward
+ if (forward) return fromPath(items, forward)
+
var ancestor = ancestors[i], found
if (ancestor.type == "ClassDeclaration")
return deref(items, ancestor.id.name) | Also support forwarding in findSelf | marijnh_getdocs | train | js |
395ced24e2718103341e9a8d61ebf6aab5ae2911 | diff --git a/lib/fluent/plugin/out_google_cloud.rb b/lib/fluent/plugin/out_google_cloud.rb
index <HASH>..<HASH> 100644
--- a/lib/fluent/plugin/out_google_cloud.rb
+++ b/lib/fluent/plugin/out_google_cloud.rb
@@ -26,7 +26,7 @@ module Fluent
Fluent::Plugin.register_output('google_cloud', self)
PLUGIN_NAME = 'Fluentd Google Cloud Logging plugin'
- PLUGIN_VERSION = '0.4.16'
+ PLUGIN_VERSION = '0.4.15'
# Constants for service names.
APPENGINE_SERVICE = 'appengine.googleapis.com' | Revert version to <I> | GoogleCloudPlatform_fluent-plugin-google-cloud | train | rb |
8eb41a8951b36767e9903195b49ceeaf37b46c98 | diff --git a/odl/sets/domain.py b/odl/sets/domain.py
index <HASH>..<HASH> 100644
--- a/odl/sets/domain.py
+++ b/odl/sets/domain.py
@@ -204,12 +204,12 @@ class IntervalProd(Set):
other set and this interval product.
Default: 0.0
"""
- if not (hasattr(other, 'min') and hasattr(other, 'max')):
- raise TypeError('cannot test {!r} without `min()` and `max()`'
- 'methods.'.format(other))
-
- return (self.contains(other.min(), tol) and
- self.contains(other.max(), tol))
+ try:
+ return (self.contains(other.min(), tol) and
+ self.contains(other.max(), tol))
+ except AttributeError:
+ raise AttributeError('cannot test {!r} without `min()` and `max()`'
+ 'methods.'.format(other))
# Additional property-like methods
def measure(self, dim=None): | Replace hasattr check for min and max with try..except | odlgroup_odl | train | py |
fbdece2762d13e63739aceb2ee7a0a642f506b97 | diff --git a/coreos-cloudinit.go b/coreos-cloudinit.go
index <HASH>..<HASH> 100644
--- a/coreos-cloudinit.go
+++ b/coreos-cloudinit.go
@@ -55,8 +55,8 @@ func main() {
os.Exit(0)
}
- if convertNetconf != "" && sources.configDrive == "" && !sources.metadataService {
- fmt.Println("-convert-netconf flag requires -from-configdrive or -from-metadata-service")
+ if convertNetconf != "" && sources.configDrive == "" {
+ fmt.Println("-convert-netconf flag requires -from-configdrive")
os.Exit(1)
} | coreos-cloudinit: restrict convert-netconf to configdrive | coreos_coreos-cloudinit | train | go |
60aa7584702c9e31640e244217c8f4fd5bf2512e | diff --git a/spyder/plugins/plots/widgets/figurebrowser.py b/spyder/plugins/plots/widgets/figurebrowser.py
index <HASH>..<HASH> 100644
--- a/spyder/plugins/plots/widgets/figurebrowser.py
+++ b/spyder/plugins/plots/widgets/figurebrowser.py
@@ -497,10 +497,13 @@ class FigureViewer(QScrollArea):
# Scale the image to fit figviewer size while respect the ratio
else:
size = self.size()
- scrollbar_width = self.verticalScrollBar().sizeHint().width()
- width = size.width() - scrollbar_width
- scrollbar_height = self.horizontalScrollBar().sizeHint().height()
- height = size.height() - scrollbar_height
+ style = self.style()
+ width = (size.width() -
+ style.pixelMetric(QStyle.PM_LayoutLeftMargin) -
+ style.pixelMetric(QStyle.PM_LayoutRightMargin))
+ height = (size.height() -
+ style.pixelMetric(QStyle.PM_LayoutTopMargin) -
+ style.pixelMetric(QStyle.PM_LayoutBottomMargin))
if (fwidth / fheight) > (width / height):
new_width = int(width)
new_height = int(width / fwidth * fheight) | Rework how scaled img size is calculated
It doesn't make sense to use the scroll bar width here. It is more
logical to use pixel metrics related to margins instead. | spyder-ide_spyder | train | py |
dbd776042e754b0e70ac98401fc50239e05cd254 | diff --git a/ledcontroller/__init__.py b/ledcontroller/__init__.py
index <HASH>..<HASH> 100644
--- a/ledcontroller/__init__.py
+++ b/ledcontroller/__init__.py
@@ -42,7 +42,7 @@ class LedController(object):
"warmer": (b"\x3e",),
"cooler": (b"\x3f",),
"brightness_up": (b"\x3c",),
- "brightness_down": (b"\x34"),
+ "brightness_down": (b"\x34",),
}
WHITE_GROUP_X_ON = [(b"\x38",), (b"\x3d",), (b"\x37",), (b"\x32",)] | Bugfix: missing , from brightness_up command. | ojarva_python-ledcontroller | train | py |
0741f2cee9cef9b210c01cdbecad7757720d80fe | diff --git a/Adafruit_DHT/Test.py b/Adafruit_DHT/Test.py
index <HASH>..<HASH> 100644
--- a/Adafruit_DHT/Test.py
+++ b/Adafruit_DHT/Test.py
@@ -19,7 +19,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from . import common
-import .Test_Driver as driver
+from . import Test_Driver as driver
def read(sensor, pin):
# Get a reading from C driver code. | Fix #<I> by fixing test import line. | adafruit_Adafruit_Python_DHT | train | py |
a8d62877e919f905a934ed79551bd8ae97c5f41f | diff --git a/src/jamesiarmes/PhpEws/Client.php b/src/jamesiarmes/PhpEws/Client.php
index <HASH>..<HASH> 100644
--- a/src/jamesiarmes/PhpEws/Client.php
+++ b/src/jamesiarmes/PhpEws/Client.php
@@ -667,6 +667,22 @@ class Client
}
/**
+ * Finds messages that meet the specified criteria.
+ *
+ * @since Exchange 2010
+ *
+ * @param \jamesiarmes\PhpEws\Request\FindMessageTrackingReportRequestType $request
+ * @return \jamesiarmes\PhpEws\Response\FindMessageTrackingReportResponseMessageType
+ */
+ public function FindMessageTrackingReport($request)
+ {
+ $this->initializeSoapClient();
+ $response = $this->soap->{__FUNCTION__}($request);
+
+ return $this->processResponse($response);
+ }
+
+ /**
* Function Description
*
* @param \jamesiarmes\PhpEws\Request\GetAttachmentType $request | Added FindMessageTrackingReport operation. | jamesiarmes_php-ews | train | php |
044f205f326043a0aa487b75b076203050bd3540 | diff --git a/src/satellitelink.py b/src/satellitelink.py
index <HASH>..<HASH> 100644
--- a/src/satellitelink.py
+++ b/src/satellitelink.py
@@ -49,6 +49,8 @@ class SatelliteLink(Item):
def create_connexion(self):
self.uri = "PYROLOC://"+self.address+":"+str(self.port)+"/ForArbiter"
self.con = Pyro.core.getProxyForURI(self.uri)
+ #Ok, set timeout to 5 sec
+ self.con._setTimeout(5)
def put_conf(self, conf): | Add a timeout for satellite and scheduler connexions. Sets to 5 seconds. | Alignak-monitoring_alignak | train | py |
8d03bc1f3ac82a392268b6454e8874ec56c6cd20 | diff --git a/src/main/java/org/zeroturnaround/zip/FileUtil.java b/src/main/java/org/zeroturnaround/zip/FileUtil.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/zeroturnaround/zip/FileUtil.java
+++ b/src/main/java/org/zeroturnaround/zip/FileUtil.java
@@ -15,6 +15,7 @@
*/
package org.zeroturnaround.zip;
+import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
@@ -42,7 +43,7 @@ final class FileUtil {
public static void copy(File file, OutputStream out) throws IOException {
FileInputStream in = new FileInputStream(file);
try {
- IOUtils.copy(in, out);
+ IOUtils.copy(new BufferedInputStream(in), out);
}
finally {
IOUtils.closeQuietly(in); | Fixed a bit ZipUtil.pack() performance. | zeroturnaround_zt-zip | train | java |
88741ade517a5f185b76b8678d8f4b0c3a76a6a3 | diff --git a/Configuration/TCA/Overrides/be_users.php b/Configuration/TCA/Overrides/be_users.php
index <HASH>..<HASH> 100644
--- a/Configuration/TCA/Overrides/be_users.php
+++ b/Configuration/TCA/Overrides/be_users.php
@@ -48,14 +48,14 @@ $beUsersSiteFcn = function() {
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns( 'be_users', [
- 'siteid' => [
- 'label' => 'LLL:EXT:aimeos/Resources/Private/Language/admin.xlf:be_users_site.title',
- 'config' => [
- 'type' => 'select',
- 'renderType' => 'selectSingle',
+ 'siteid' => [
+ 'label' => 'LLL:EXT:aimeos/Resources/Private/Language/admin.xlf:be_users_site.title',
+ 'config' => [
+ 'type' => 'select',
+ 'renderType' => 'selectSingle',
'items' => $beUsersSiteFcn(),
- ]
- ]
+ ]
+ ]
] );
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes( 'be_users', 'siteid', '', 'after:password' ); | Scrutinizer Auto-Fixes (#<I>)
This commit consists of patches automatically generated for this project on <URL> | aimeos_aimeos-typo3 | train | php |
7a070f644899905ee96a3312abc879d097e509d8 | diff --git a/cnxarchive/tests/test_to_html.py b/cnxarchive/tests/test_to_html.py
index <HASH>..<HASH> 100644
--- a/cnxarchive/tests/test_to_html.py
+++ b/cnxarchive/tests/test_to_html.py
@@ -159,7 +159,7 @@ class ToHtmlTestCase(unittest.TestCase):
message_dict = dict(values)
self.assertIsNotNone(message_dict[ident])
self.assertEqual(message_dict[ident],
- u"Failed to parse QName 'md:tit47:', " \
+ u"While attempting to transform the content we ran into an error: Failed to parse QName 'md:tit47:', " \
"line 11, column 12")
def test_module_transform_of_references(self): | put new error message in the test, as well | openstax_cnx-archive | train | py |
ce6f8dac055b8c6ad2429c2c0b880817f3f9291c | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -33,18 +33,18 @@ function initialize(options) {
var payload = {
report: {
uuid: makeUuid(),
- timestamp: (new Date()).getTime(),
+ timestamp: (new Date()).getTime() / 1000,
lang: "nodejs",
langVersion: process.version,
attributes: {
"process.age": Math.floor(process.uptime() * 1000),
"uname.machine": process.arch,
"uname.sysname": process.platform,
- "error.name": err.name,
+ "classifiers": err.name,
"error.message": err.message,
- "mem.rss": mem.rss,
- "mem.heap.total": mem.heapTotal,
- "mem.heap.used": mem.heapUsed,
+ "vm.rss.size": mem.rss / 1024,
+ "gc.heap.total": mem.heapTotal,
+ "gc.heap.used": mem.heapUsed
},
env: process.env,
}, | index: normalize with ptrace.
We may blow these out into different columns or instead normalize
all of ptrace statistics into these units.
The format field in attribute will allow us to make this switch easily
when we want to. | backtrace-labs_backtrace-node | train | js |
d1227a6aac55efd4827afbcc3fd1d240bd4087d5 | diff --git a/src/js/Form.js b/src/js/Form.js
index <HASH>..<HASH> 100755
--- a/src/js/Form.js
+++ b/src/js/Form.js
@@ -824,12 +824,6 @@ define( [ 'enketo-js/FormModel', 'enketo-js/widgets', 'jquery', 'enketo-js/plugi
$form.find( 'select' ).each( function() {
that.setSelect( $( this ) );
} );
- // quick fix for labels and legends that do not contain a span.active without other class
- $form.find( 'legend span.active:not(.or-hint, .or-constraint-msg), label span.active:not(.or-hint, .or-constraint-msg)' ).each( function() {
- if ( $( this ).text().trim().length === 0 ) {
- $( this ).text( '[MISSING TRANSLATION]' );
- }
- } );
$form.trigger( 'changelanguage' );
}, | removed the [MISSING TRANSLATION] feature, as it does not play nicely with image option-labels and the the new icon radio buttons, <URL> | enketo_enketo-core | train | js |
1e3db9e857e6c1851c56bd038267f819e2dfc499 | diff --git a/views/cypress/tests/test.spec.js b/views/cypress/tests/test.spec.js
index <HASH>..<HASH> 100644
--- a/views/cypress/tests/test.spec.js
+++ b/views/cypress/tests/test.spec.js
@@ -91,4 +91,14 @@ describe('Tests', () => {
);
});
});
+
+ after(() => {
+ cy.deleteClassFromRoot(
+ selectors.root,
+ selectors.assetClassForm,
+ selectors.deleteClass,
+ selectors.deleteConfirm,
+ classMovedName
+ );
+ });
}); | chore: add hook for delete moved class | oat-sa_extension-tao-test | train | js |
315330884d6e086a1af380e57b4db511b8c2e71a | diff --git a/test/specs/getDirectoryContents.spec.js b/test/specs/getDirectoryContents.spec.js
index <HASH>..<HASH> 100644
--- a/test/specs/getDirectoryContents.spec.js
+++ b/test/specs/getDirectoryContents.spec.js
@@ -60,8 +60,8 @@ describe("getDirectoryContents", function() {
it("returns only expected results when using trailing slash", function() {
return this.client.getDirectoryContents("/webdav/").then(function(contents) {
- const items = contents.map(item => item.filename).join(",");
- expect(items).to.equal("/webdav/server");
+ const items = contents.map(item => item.filename);
+ expect(items).to.deep.equal(["/webdav/server"]);
});
}); | Update getDirectoryContents test | perry-mitchell_webdav-client | train | js |
931dbc3144b6a6bbf92cef43c597cab9c32de011 | diff --git a/django_unixdatetimefield/__init__.py b/django_unixdatetimefield/__init__.py
index <HASH>..<HASH> 100644
--- a/django_unixdatetimefield/__init__.py
+++ b/django_unixdatetimefield/__init__.py
@@ -1,3 +1,3 @@
from .fields import UnixDateTimeField
-__version__ = '0.1.3'
+__version__ = '0.1.4'
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ import setuptools
setuptools.setup(
name='django-unixdatetimefield',
- version='0.1.3',
+ version='0.1.4',
author='Niklas Andersson',
author_email='nandersson900@gmail.com',
description='UnixDateTimeField in Django', | bumped version to <I> for new release | Niklas9_django-unixdatetimefield | train | py,py |
d0636df06218fd83e70cac33740164bb9b9a72a1 | diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -648,8 +648,7 @@ run = function(params, opts) {
}
runTests({path: dir, type: testOption, name: testName});
} else {
- testName = testOption;
- runTests({path: fwTestsRoot, type: 'fw', name: testName});
+ utils.warn("Without arguments, this command no runs mojito's unit tests", usage, true);
}
};
@@ -851,12 +850,7 @@ usage = 'Options: -c --coverage Instruments code under test and prints ' +
'To test a mojit:\n' +
' mojito test mojit ./path/to/mojit/directory\n' +
'To test a Mojito app:\n' +
- ' mojito test app ./path/to/mojito/app/directory\n' +
- 'To test the Mojito Framework:\n' +
- ' mojito test\n' +
- ' \n' +
- 'NOTE: You cannot generate test coverage for a Mojito application,' +
- ' only individual mojits.';
+ ' mojito test app ./path/to/mojito/app/directory\n';
/**
*/ | - disable running mojito's unit tests
- remove incorrect note about -c and mojito apps
see b<I>b<I>b4b0c4cf<I>a<I>fe4f4b<I>e7 | YahooArchive_mojito-cli-test | train | js |
ebc837077adc83c0dbff9b5cfbf2774d459aa119 | diff --git a/src/python/turicreate/toolkits/object_detector/_tf_image_augmenter.py b/src/python/turicreate/toolkits/object_detector/_tf_image_augmenter.py
index <HASH>..<HASH> 100644
--- a/src/python/turicreate/toolkits/object_detector/_tf_image_augmenter.py
+++ b/src/python/turicreate/toolkits/object_detector/_tf_image_augmenter.py
@@ -74,13 +74,11 @@ def color_augmenter(
image = tf.image.adjust_brightness(image, brightness_delta)
# Apply the random adjustment to contrast.
- log_sat = np.log(max_saturation)
- saturation_delta = interpolate(random_alpha_tf[1], -log_sat, log_sat)
+ saturation_delta = interpolate(random_alpha_tf[1], 1/max_saturation, max_saturation)
image = tf.image.adjust_saturation(image, saturation_delta)
# Apply random adjustment to saturation.
- log_con = np.log(max_contrast)
- contrast_delta = interpolate(random_alpha_tf[2], -log_con, log_con)
+ contrast_delta = interpolate(random_alpha_tf[2], 1/max_contrast, max_contrast)
image = tf.image.adjust_contrast(image, contrast_delta)
image = tf.clip_by_value(image, 0, 1) | Fix color augmentation in TensorFlow object detection (#<I>) | apple_turicreate | train | py |
2138eb00792498ca8729857a7989aa65b969f206 | diff --git a/src/Phinx/Db/Table/Index.php b/src/Phinx/Db/Table/Index.php
index <HASH>..<HASH> 100644
--- a/src/Phinx/Db/Table/Index.php
+++ b/src/Phinx/Db/Table/Index.php
@@ -128,7 +128,7 @@ class Index
// handle $options['unique']
if (strtolower($option) == self::UNIQUE) {
- $this->setType(self::UNIQUE);
+ if( (bool)$value ) $this->setType(self::UNIQUE);
continue;
} | Unique Index Bug Fix
The UNIQUE index option would always set an index type to UNIQUE whether true or false:
Either
'unique' => true
or
'unique' => false
would both result in the index being UNIQUE. This fixes that.
Unique indexes option only had one setting,
This fixes that, allowing you to set a unique index option as FALSE or TRUE. | cakephp_phinx | train | php |
1e2554d1485af3cff1e5b55c31fe50d9ea280716 | diff --git a/gruntfile.js b/gruntfile.js
index <HASH>..<HASH> 100644
--- a/gruntfile.js
+++ b/gruntfile.js
@@ -62,6 +62,7 @@ module.exports = function(grunt) {
output: {
preamble: '/*! ExcelJS <%= grunt.template.today("dd-mm-yyyy") %> */\n',
},
+ ascii_only: true
},
dist: {
files: { | Fixed #<I>
Fixed [BUG] Invalid regular expression: /^[ -퟿-�ð€€-ô¿¿]$/: Range out of order in character class.
This was due to terser wrongly converting characters in string literals.
Ref: <URL> | exceljs_exceljs | train | js |
37b2df25bffafdc777023c668af97147d477f8be | diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php b/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Controller/Controller.php
@@ -138,6 +138,16 @@ class Controller extends ContainerAware
}
/**
+ * Shortcut to return the request service.
+ *
+ * @return Symfony\Component\HttpFoundation\Request
+ */
+ public function getRequest()
+ {
+ return $this->get('request');
+ }
+
+ /**
* Shortcut to return the Doctrine Registry class
*
* @return Symfony\Bundle\DoctrineBundle\Registry | [FrameworkBundle] Introduced a new Controller::getRequest() method to get the Request service from a controller. | symfony_symfony | train | php |
2db4bb7276746b88256a97697e8df199bbdd5849 | diff --git a/packages/veritone-widgets/src/shared/widget.js b/packages/veritone-widgets/src/shared/widget.js
index <HASH>..<HASH> 100644
--- a/packages/veritone-widgets/src/shared/widget.js
+++ b/packages/veritone-widgets/src/shared/widget.js
@@ -1,4 +1,4 @@
-import { forEach } from 'lodash';
+import { forOwn } from 'lodash';
import VeritoneApp from './VeritoneApp';
export default function widget(Component) {
@@ -21,24 +21,15 @@ export default function widget(Component) {
}
set ref(val) {
- this._ref = val;
-
// allow access of ref properties on the widget itself
// (should only be used by consumers to call component's API)
- forEach(val, (value, key) => {
- Object.defineProperty(this, key, { value });
+ forOwn(val, (value, key) => {
+ try {
+ Object.defineProperty(this, key, { value });
+ } catch (e) { /* */ }
});
-
- console.log(this);
-
- // todo: go through and defineProperty getters for each of
- // the ref's ownProps
}
- // get id() {
- // return this._id;
- // }
-
get Component() {
return Component;
} | cleanup unused properties. use forOwn to be a little safer | veritone_veritone-sdk | train | js |
d8139efd6d467b1b8a61d24f47863afd7d10c695 | diff --git a/getgauge/impl_loader.py b/getgauge/impl_loader.py
index <HASH>..<HASH> 100644
--- a/getgauge/impl_loader.py
+++ b/getgauge/impl_loader.py
@@ -55,7 +55,6 @@ def _import_impl(step_impl_dir):
def _import_file(file_path):
rel_path = os.path.normpath(file_path.replace(project_root + os.path.sep, ''))
try:
- py_compile.compile(file_path)
importlib.import_module(os.path.splitext(rel_path.replace(os.path.sep, '.'))[0])
except:
print('Exception occurred while loading step implementations from file: {}.'.format(rel_path)) | Not compiling source files explicitly. | getgauge_gauge-python | train | py |
8f16b5a91e72fb9f00937c6f5a1577941ef98fa5 | diff --git a/src/util.js b/src/util.js
index <HASH>..<HASH> 100644
--- a/src/util.js
+++ b/src/util.js
@@ -169,7 +169,7 @@ export function markdown(string) {
return markdownBlock(string)
.replace(/^\s*<p>/, '')
.replace(/<\/p>\s*$/, '')
- ;
+ ;
}
}
@@ -238,7 +238,7 @@ export function errorInlineHtml(message, { block } = {}) {
if (block) {
html = `<p>${html}</p>`;
}
- return html;
+ return safe(html);
}
/** | Mark HTML error message as safe for VDO. | sapegin_fledermaus | train | js |
dd49cf0f818d8643931408c67522aa15d200e3b6 | diff --git a/go/systests/team_invite_test.go b/go/systests/team_invite_test.go
index <HASH>..<HASH> 100644
--- a/go/systests/team_invite_test.go
+++ b/go/systests/team_invite_test.go
@@ -374,14 +374,13 @@ func TestImpTeamWithMultipleRooters(t *testing.T) {
toSeqno := keybase1.Seqno(2)
var found bool
- for i := 0; i < 10; i++ {
+ for i := 0; (i < 10) && !found; i++ {
select {
case arg := <-alice.notifications.changeCh:
t.Logf("membership change received: %+v", arg)
if (arg.TeamID.Eq(team1) || arg.TeamID.Eq(team2)) && arg.Changes.MembershipChanged && !arg.Changes.KeyRotated && !arg.Changes.Renamed && arg.LatestSeqno == toSeqno {
t.Logf("change matched with %q", arg.TeamID)
found = true
- break
}
case <-time.After(1 * time.Second):
} | Fix break (#<I>) | keybase_client | train | go |
15375c94cd8095280e7be60236dcf0314c12943f | diff --git a/server/container_create_linux.go b/server/container_create_linux.go
index <HASH>..<HASH> 100644
--- a/server/container_create_linux.go
+++ b/server/container_create_linux.go
@@ -1102,7 +1102,7 @@ func setupSystemd(mounts []rspec.Mount, g generate.Generator) {
Destination: dest,
Type: "tmpfs",
Source: "tmpfs",
- Options: append(options, "tmpcopyup", "size=65536k"),
+ Options: append(options, "tmpcopyup"),
}
g.AddMount(tmpfsMnt)
} | Don't limit the size on /run for systemd based containers
We had a customer incident where they ran out of space on /run.
If you don't specify size, it will be still limited to <I>% or memory
available in the cgroup the container is running in. If the cgroup is
unlimited then the /run will be limited to <I>% of the total memory
on the system. | cri-o_cri-o | train | go |
b5f96d4b4120bb1e09c23ac32baf21a14da4a71d | diff --git a/bytebuffer.go b/bytebuffer.go
index <HASH>..<HASH> 100644
--- a/bytebuffer.go
+++ b/bytebuffer.go
@@ -13,6 +13,10 @@ import (
// Use AcquireByteBuffer for obtaining an empty byte buffer.
//
// Deprecated: use github.com/valyala/bytebufferpool instead.
+//
+// WARNING: This type is going to be removed on 2018-10-01!!!
+// See https://github.com/valyala/fasthttp/pull/415 for more infomation.
+//
type ByteBuffer bytebufferpool.ByteBuffer
// Write implements io.Writer - it appends p to ByteBuffer.B | WARNING: fasthttp.ByteBuffer will be removed! | valyala_fasthttp | train | go |
2b61376baf191a82f9774dcb9f51abd03edb1eba | diff --git a/scss/functions/core.py b/scss/functions/core.py
index <HASH>..<HASH> 100644
--- a/scss/functions/core.py
+++ b/scss/functions/core.py
@@ -203,7 +203,7 @@ def alpha(color):
@register('hue', 1)
def hue(color):
h, s, l = color.hsl
- return Number(h * 100, "deg")
+ return Number(h * 360, "deg")
@register('saturation', 1) | That's not how you calculate hue... | Kronuz_pyScss | train | py |
0562575f06503e0cc69b125e5762afa1cfe1826f | diff --git a/importmagic/index.py b/importmagic/index.py
index <HASH>..<HASH> 100644
--- a/importmagic/index.py
+++ b/importmagic/index.py
@@ -280,7 +280,7 @@ class SymbolIndex(object):
def add(self, name, score):
current_score = self._tree.get(name, 0.0)
- if score > current_score:
+ if isinstance(current_score, float) and score > current_score:
self._tree[name] = score
@contextmanager | Fix SymbolIndex.add() on Python 3.
On Python 3, SymbolIndex and float instances cannot be compared. | alecthomas_importmagic | train | py |
a349df8d84313db914d37ccf3b5add61d631c78c | diff --git a/azurerm/internal/services/keyvault/tests/resource_arm_key_vault_test.go b/azurerm/internal/services/keyvault/tests/resource_arm_key_vault_test.go
index <HASH>..<HASH> 100644
--- a/azurerm/internal/services/keyvault/tests/resource_arm_key_vault_test.go
+++ b/azurerm/internal/services/keyvault/tests/resource_arm_key_vault_test.go
@@ -374,7 +374,6 @@ func TestAccAzureRMKeyVault_softDeleteRecoveryDisabled(t *testing.T) {
Config: testAccAzureRMKeyVault_softDeleteRecoveryDisabled(data),
ExpectError: regexp.MustCompile("An existing soft-deleted Key Vault exists with the Name"),
},
- data.ImportStep(),
},
})
}
@@ -470,7 +469,7 @@ func TestAccAzureRMKeyVault_purgeProtectionAttemptToDisable(t *testing.T) {
data.ImportStep(),
{
Config: testAccAzureRMKeyVault_purgeProtection(data, false),
- ExpectError: regexp.MustCompile("TODO"), // TODO: correct error message
+ ExpectError: regexp.MustCompile("once Purge Protection has been Enabled it's not possible to disable it"),
},
},
}) | r/key_vault: fixing up the tests | terraform-providers_terraform-provider-azurerm | train | go |
43099a2b6373d670b6e7cf0aa3f6b45020efd0be | diff --git a/salt/modules/nspawn.py b/salt/modules/nspawn.py
index <HASH>..<HASH> 100644
--- a/salt/modules/nspawn.py
+++ b/salt/modules/nspawn.py
@@ -1318,7 +1318,7 @@ def _pull_image(pull_type, image, name, **kwargs):
bad_kwargs = [x for x in kwargs
if not x.startswith('__')
- or x not in valid_kwargs]
+ and x not in valid_kwargs]
if bad_kwargs:
_invalid_kwargs(*bad_kwargs, **kwargs) | nspawn.py: Fix bad keyword assignment
Currently every keyword for _pull_image is considered a bad keyword.
```
% salt node nspawn.pull_tar url bar
ERROR executing 'nspawn.pull_tar': The following invalid keyword arguments were passed: verify=False.
``` | saltstack_salt | train | py |
5f26d1c8b86d102b41d917a3e7abd5d781c3766e | diff --git a/lib/setup.php b/lib/setup.php
index <HASH>..<HASH> 100644
--- a/lib/setup.php
+++ b/lib/setup.php
@@ -111,7 +111,7 @@ if (!empty($CFG->behat_dataroot) && !empty($CFG->behat_prefix) && file_exists($C
$CFG->behat_dataroot = realpath($CFG->behat_dataroot);
- $switchcompletely = isset($CFG->behat_switchcompletely) && php_sapi_name() !== 'cli';
+ $switchcompletely = !empty($CFG->behat_switchcompletely) && php_sapi_name() !== 'cli';
$builtinserver = php_sapi_name() === 'cli-server';
$behatrunning = defined('BEHAT_RUNNING');
$testenvironmentrequested = $switchcompletely || $builtinserver || $behatrunning; | MDL-<I> behat: Don't switch completely if switchcompletely is false | moodle_moodle | train | php |
80b7bcf7362887fffd39c308b838f45cae0f648d | diff --git a/spec/lib/nickel_spec.rb b/spec/lib/nickel_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/nickel_spec.rb
+++ b/spec/lib/nickel_spec.rb
@@ -2210,5 +2210,38 @@ describe Nickel do
end
end
end
+
+ context "when the query is 'job search apply at virgin intergalactic'" do
+ let(:query) { 'job search apply at virgin intergalactic' }
+
+ describe '#message' do
+ it "is 'job search apply at virgin intergalactic'" do
+ expect(n.message).to eq 'job search apply at virgin intergalactic'
+ end
+ end
+
+ describe '#occurrences' do
+ it 'is an empty array' do
+ expect(n.occurrences).to be_empty
+ end
+ end
+ end
+
+ context "when the query is 'job search - apply at virgin intergalactic'", :broken do
+ let(:query) { 'job search - apply at virgin intergalactic' }
+
+ describe '#message' do
+ it "is 'job search - apply at virgin intergalactic'" do
+ expect(n.message).to eq 'job search - apply at virgin intergalactic'
+ end
+ end
+
+ describe '#occurrences' do
+ it 'is an empty array' do
+ # returns every day from today
+ expect(n.occurrences).to be_empty
+ end
+ end
+ end
end
end | Added a test for non-date related text that happens to include a dash | iainbeeston_nickel | train | rb |
7990f5c8698acdb14bbeef6341e7618e55317d8c | diff --git a/tests/I18n/generate_factory.php b/tests/I18n/generate_factory.php
index <HASH>..<HASH> 100644
--- a/tests/I18n/generate_factory.php
+++ b/tests/I18n/generate_factory.php
@@ -53,12 +53,12 @@ call_user_func(function() use ($args) {
{
die('Too few arguments'.$tokens['usage']);
}
- $source_file = realpath(__DIR__.'/'.$args[1]);
+ $source_file = realpath($args[1]);
if ( ! $source_file)
{
die('File "'.$args[1].'" not found'.$tokens['usage']);
}
- $rules_dir = realpath(__DIR__.'/'.$args[2]);
+ $rules_dir = realpath($args[2]);
if ( ! $rules_dir)
{
die('"'.$args[1].'" is not a directory'.$tokens['usage']); | Factory generator may be run from any dir | czukowski_I18n_Plural | train | php |
1c98db3dbb70edfd2054a6ff611a5c5452e2ade2 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -309,12 +309,11 @@ function getTemplateUrl(templateName, templateBody, region, callback) {
if (err && err.code !== 'AccessDenied') return callback(err);
// AccessDenied error messages still contain what we need
- else if (err) userData = { Arn: /(arn:.+?) /.exec(err.message)[1] };
+ var acct = err ? /(arn:.+?) /.exec(err.message)[1] :
+ userData.User.Arn.split(':')[4];
var bucket = [
- 'cfn-config-templates',
- userData.Arn.split(':')[4],
- region
+ 'cfn-config-templates', acct, region
].join('-');
s3.createBucket({Bucket: bucket}, function(err, data) { | Fix case where user does have permission to getUser. | mapbox_cfn-config | train | js |
762acdb176d9fac8073a54db2d87d26792e27b18 | diff --git a/lib/t/stream.rb b/lib/t/stream.rb
index <HASH>..<HASH> 100644
--- a/lib/t/stream.rb
+++ b/lib/t/stream.rb
@@ -26,10 +26,7 @@ module T
print_status(status)
end
end
- Signal.trap("TERM") do
- client.stop
- shutdown
- end
+ until_term
client.sample
end
@@ -38,10 +35,7 @@ module T
client.on_timeline_status do |status|
say(status.text.gsub("\n", ''), [:bold, :green, :on_black])
end
- Signal.trap("TERM") do
- client.stop
- shutdown
- end
+ until_term
client.sample
end
@@ -62,10 +56,7 @@ module T
print_status(status)
end
end
- Signal.trap("TERM") do
- client.stop
- shutdown
- end
+ until_term
client.track(keywords)
end
@@ -85,10 +76,7 @@ module T
print_status(status)
end
end
- Signal.trap("TERM") do
- client.stop
- shutdown
- end
+ until_term
client.userstream
end
@@ -106,10 +94,7 @@ module T
print_status(status)
end
end
- Signal.trap("TERM") do
- client.stop
- shutdown
- end
+ until_term
client.follow(screen_names)
end
@@ -126,5 +111,12 @@ module T
)
end
+ def until_term
+ Signal.trap("TERM") do
+ client.stop
+ shutdown
+ end
+ end
+
end
end | Factor until_term into a common method | sferik_t | train | rb |
6c51dc8fd63e3ad19f69e36f31ef71ea39ca355c | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -72,11 +72,11 @@ class FetchPatchelfCommand(Command):
('force', 'f', 'force download'),
]
- patchelf_name = 'patchelf-0.9'
+ patchelf_name = 'patchelf-0.10'
patchelf_url = ('https://nixos.org/releases/patchelf/{0}/{0}.tar.gz'
.format(patchelf_name))
- sha256_hash = ('f2aa40a6148cb3b0ca807a1bf836b081' +
- '793e55ec9e5540a5356d800132be7e0a')
+ sha256_hash = ('b2deabce05c34ce98558c0efb965f209' +
+ 'de592197b2c88e930298d740ead09019')
def initialize_options(self):
self.download_dir = None | Update to patchelf <I> | jimporter_patchelf-wrapper | train | py |
1c5d9a57253577874302b47a472cc592260ef634 | diff --git a/lib/checks/navigation/region.js b/lib/checks/navigation/region.js
index <HASH>..<HASH> 100644
--- a/lib/checks/navigation/region.js
+++ b/lib/checks/navigation/region.js
@@ -16,7 +16,7 @@ function checkRegion(n) {
if (isLandmark(n)) { return null; }
if (isSkipLink(n)) { return getViolatingChildren(n); }
if (kslib.dom.isVisible(n, true) &&
- (kslib.text.visible(n, true, true) || kslib.dom.hasVisualContent(n))) { return n; }
+ (kslib.text.visible(n, true, true) || kslib.dom.isVisualContent(n))) { return n; }
return getViolatingChildren(n);
} | Fix name of function after renaming | dequelabs_axe-core | train | js |
11cf099b81a2836db5e2ddf3e4422dc5f95bb221 | diff --git a/Wappalyzer.py b/Wappalyzer.py
index <HASH>..<HASH> 100644
--- a/Wappalyzer.py
+++ b/Wappalyzer.py
@@ -63,7 +63,7 @@ class WebPage(object):
url : str
verify: bool
"""
- response = requests.get(url, verify=verify)
+ response = requests.get(url, verify=verify, timeout=2.5)
return cls.new_from_response(response)
@classmethod | Add timeout for the purpose of everyone's sanity | chorsley_python-Wappalyzer | train | py |
4446f7b0817f344dddf5142799a4bd1438c3a9ae | diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -682,7 +682,8 @@ var CodeMirror = (function() {
setSelection(selFrom, selTo, updateLine(sel.from.line), updateLine(sel.to.line));
// Make sure the scroll-size div has the correct height.
- code.style.height = (doc.height * textHeight() + 2 * paddingTop()) + "px";
+ if (scroller.clientHeight)
+ code.style.height = (doc.height * textHeight() + 2 * paddingTop()) + "px";
}
function replaceRange(code, from, to) {
@@ -875,7 +876,8 @@ var CodeMirror = (function() {
showingFrom = from; showingTo = to;
displayOffset = heightAtLine(doc, from);
mover.style.top = (displayOffset * th) + "px";
- code.style.height = (doc.height * th + 2 * paddingTop()) + "px";
+ if (scroller.clientHeight)
+ code.style.height = (doc.height * th + 2 * paddingTop()) + "px";
// Since this is all rather error prone, it is honoured with the
// only assertion in the whole file. | Don't set a height on the code DIV when hidden
It will mess with further size computation. | codemirror_CodeMirror | train | js |
9f815ef829b66de3519fea6c0b8d4708eb9472d4 | diff --git a/staert_test.go b/staert_test.go
index <HASH>..<HASH> 100644
--- a/staert_test.go
+++ b/staert_test.go
@@ -1213,7 +1213,7 @@ func TestRunFleagVersion2CommandCallVersion(t *testing.T) {
versionConfig := &VersionConfig{"0.1"}
args := []string{
- "--toto", //no effect
+ // "--toto", //it now has effet
"version", //call Command
"-v2.2beta",
} | fix test (#<I>) | containous_staert | train | go |
0edef3332289a7cbe54b58084b967907d1086d29 | diff --git a/core/Auth.php b/core/Auth.php
index <HASH>..<HASH> 100644
--- a/core/Auth.php
+++ b/core/Auth.php
@@ -12,10 +12,12 @@ namespace Piwik;
use Exception;
/**
- * Base for authentication implementations. Plugins that provide Auth implementations
- * must provide a class that implements this interface. Additionally, an instance
- * of that class must be set in the {@link \Piwik\Registry} class with the 'auth'
- * key during the [Request.initAuthenticationObject](http://developer.piwik.org/api-reference/events#requestinitauthenticationobject)
+ * Base interface for authentication implementations.
+ *
+ * Plugins that provide Auth implementations must provide a class that implements
+ * this interface. Additionally, an instance of that class must be set in the
+ * {@link \Piwik\Registry} class with the 'auth' key during the
+ * [Request.initAuthenticationObject](http://developer.piwik.org/api-reference/events#requestinitauthenticationobject)
* event.
*
* Authentication implementations must support authentication via username and | Tweaking Auth docs some more. | matomo-org_matomo | train | php |
66eda584ee75e87b1cd90dad81c1d71e54f20ab9 | diff --git a/lib/Timeline/AbstractTimeline.php b/lib/Timeline/AbstractTimeline.php
index <HASH>..<HASH> 100644
--- a/lib/Timeline/AbstractTimeline.php
+++ b/lib/Timeline/AbstractTimeline.php
@@ -70,7 +70,9 @@ abstract class AbstractTimeline implements TimelineInterface
}
/**
- * @param Version $version
+ * Returns true if the operatin is forced, or if the direction is the opposite to the state of the migration.
+ *
+ * @param Version $version
* @param Options $options
*
* @return bool
@@ -78,8 +80,7 @@ abstract class AbstractTimeline implements TimelineInterface
protected function shouldMigrate(Version $version, Options $options)
{
return $options->isForced()
- || ($options->isDirectionUp() && !$version->isMigrated())
- || ($options->isDirectionDown() && $version->isMigrated());
+ || ($options->isDirectionUp() xor $version->isMigrated()); // direction is opposite to state
}
/** | Simplified condition for shouldMigrate() | baleen_migrations | train | php |
00fdbd66aef6cc79df22c21a81006882275c1c13 | diff --git a/dpxdt/client/capture.js b/dpxdt/client/capture.js
index <HASH>..<HASH> 100644
--- a/dpxdt/client/capture.js
+++ b/dpxdt/client/capture.js
@@ -168,7 +168,7 @@ page.doDepictedScreenshots = function() {
console.log('Taking the screenshot!');
page.render(outputPath);
phantom.exit(0);
- }, 10000);
+ }, 1000);
};
// Screenshot | Change the timeout for taking a screenshot to 1 from <I> seconds | bslatkin_dpxdt | train | js |
3b7094cf8de05638fc6b14b9f69748ad5a943950 | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -9,7 +9,7 @@ var nsp = require('gulp-nsp');
var plumber = require('gulp-plumber');
gulp.task('static', function () {
- return gulp.src('**/*.js')
+ return gulp.src('generators/**/*.js')
.pipe(excludeGitignore())
.pipe(eslint())
.pipe(eslint.format()) | Scope `gulp static` to source code only
`**/*.js` includes `node_modules`. Wasted time | types__generator-typings | train | js |
4b7a396b9b224a792cd189c477587a88c5430dfe | diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
index <HASH>..<HASH> 100644
--- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
+++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
@@ -1260,7 +1260,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
shutdownDone.checkIfSuccessOrWait();
}
catch (NoResponseException e) {
- LOGGER.log(Level.WARNING, "NoResponseException", e);
+ LOGGER.log(Level.WARNING, "shutdownDone was not marked as successful by the writer thread", e);
}
}
@@ -1406,6 +1406,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
LOGGER.log(Level.FINE, "Ignoring Exception in writePackets()", e);
}
} finally {
+ LOGGER.fine("Reporting shutdownDone success in writer thread");
shutdownDone.reportSuccess();
}
} | Improve logging wrt XMPPTCPConnection.shutdownDone | igniterealtime_Smack | train | java |
59ba27068b524bdbfe60dd74762e28acd709caea | diff --git a/docker/models/images.py b/docker/models/images.py
index <HASH>..<HASH> 100644
--- a/docker/models/images.py
+++ b/docker/models/images.py
@@ -169,14 +169,15 @@ class ImageCollection(Collection):
events = list(json_stream(resp))
if not events:
return BuildError('Unknown')
- event = events[-1]
- if 'stream' in event:
- match = re.search(r'(Successfully built |sha256:)([0-9a-f]+)',
- event.get('stream', ''))
- if match:
- image_id = match.group(2)
- return self.get(image_id)
+ for event in events:
+ if 'stream' in event:
+ match = re.search(r'(Successfully built |sha256:)([0-9a-f]+)',
+ event.get('stream', ''))
+ if match:
+ image_id = match.group(2)
+ return self.get(image_id)
+ event = events[-1]
raise BuildError(event.get('error') or event)
def get(self, name): | Handle multiple success messages during image building. | docker_docker-py | train | py |
c506d9887b1804061b297f5fd4d24254a256a284 | diff --git a/service/index.js b/service/index.js
index <HASH>..<HASH> 100644
--- a/service/index.js
+++ b/service/index.js
@@ -65,7 +65,10 @@ app.use((req, res, next) => {
app.use(require('./routes/api.js'));
app.use(require('./routes/meta.js'));
-app.use('/test', require('./routes/test.js'));
+
+if (!process.env.SKIP_TESTS) {
+ app.use('/test', require('./routes/test.js'));
+}
if (process.env.RUM_MYSQL_DSN) {
app.use(require('./routes/rum.js')); | Add option to skip mounting tests (#<I>) | Financial-Times_polyfill-service | train | js |
996230ed0ebd40144e91f2db2b087d7022ab6c1f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -113,7 +113,7 @@ setup(
name="merchant",
version=get_version(),
description="A Django app that provides helpers for multiple pluggable payment backends.",
- long_description=read("README"),
+ long_description=read("README.md"),
author="Agiliq Solutions",
author_email="hello@agiliq.com",
license="BSD", | Fix the setup.py for the readme that was recently changed | agiliq_merchant | train | py |
f2563e87420353bc20e6a52dd321708d249b07d4 | diff --git a/emma2/msm/analysis/api.py b/emma2/msm/analysis/api.py
index <HASH>..<HASH> 100644
--- a/emma2/msm/analysis/api.py
+++ b/emma2/msm/analysis/api.py
@@ -318,19 +318,25 @@ def expected_counts(p0, T, N):
Parameters
----------
- p0 : numpy array, shape=(n,)
- Starting (probability) vector of the chain, numpy.sum(p)=1.0.
- T : numpy array, shape=(n,n)
- Transition matrix for the chain. T\geq 0, numpy.sum(T,axis=1)=(1,...,1)
+ p0 : (M,) ndarray
+ Starting (probability) vector of the chain.
+ T : (M, M) ndarray or sparse matrix
+ Transition matrix of the chain.
N : int
Number of steps for chain.
Returns
--------
- EC : numpy array, shape=(n,n)
- Expected value for transition counts after a propagation of n steps.
+ EC : (M, M) ndarray or sparse matrix
+ Expected value for transition counts after N steps.
"""
+ if issparse(T):
+ raise TypeError("Not implmented for sparse matrices")
+ elif isdense(T):
+ raise TypeError("Not implmented for dense matrices")
+ else:
+ _type_not_supported
# TODO: ben: Implement in Python directly
def expected_counts_stationary(P, N, mu=None): | Updated docstring for function expected_counts | markovmodel_PyEMMA | train | py |
41cbedf476f4488b2e658d3ad02b2dc929c9c474 | diff --git a/Malmo/samples/Python_examples/patchwork_quilt.py b/Malmo/samples/Python_examples/patchwork_quilt.py
index <HASH>..<HASH> 100755
--- a/Malmo/samples/Python_examples/patchwork_quilt.py
+++ b/Malmo/samples/Python_examples/patchwork_quilt.py
@@ -130,8 +130,6 @@ for iRepeat in range(num_reps):
# Create a mission:
my_mission = MalmoPython.MissionSpec(GetMissionXML(iRepeat, xorg, yorg, zorg, iRepeat), True)
- # Give the recording a destination filename:
- my_mission_record.setDestination(recordingsDirectory + "//" + "Quilt_" + str(iRepeat) + ".tgz")
max_retries = 3
for retry in range(max_retries):
try: | Refactoring error in patchwork test | Microsoft_malmo | train | py |
fcadd3cfa25c6261bdd8c903659b519540059536 | diff --git a/fabrik/ext/wpcli.py b/fabrik/ext/wpcli.py
index <HASH>..<HASH> 100644
--- a/fabrik/ext/wpcli.py
+++ b/fabrik/ext/wpcli.py
@@ -5,11 +5,11 @@ fabrik.ext.wpcli
------------------
A wp-cli extension that contains the following tasks:
- sync_remote_to_local
- - Replace your remote db with your local
+Params:
+ local_wp_dir
- sync_remote_to_local:force=yes
- - Same as above but mute the 'are you sure' prompt
+Commands:
+ sync_remote_to_local
"""
import time
@@ -27,6 +27,13 @@ from fabrik.utils.elocal import elocal
@task
def sync_remote_to_local(force="no"):
+ """
+ Replace your remote db with your local
+
+ Example:
+ sync_remote_to_local:force=yes
+ """
+
assert "local_wp_dir" in env, "Missing local_wp_dir in env"
if force != "yes": | Updated wp-cli docs | Frojd_Fabrik | train | py |
6f0c8d5f4cc9061748a4e73a890ffd621a2f4cc0 | diff --git a/transaction.go b/transaction.go
index <HASH>..<HASH> 100644
--- a/transaction.go
+++ b/transaction.go
@@ -28,8 +28,8 @@ func (tx *Tx) Query(sql string, params ...interface{}) (*stdsql.Rows, error) {
timer := log.Timer()
result, err := tx.Client.Query(sql, params...)
timer.End("Run SQL query.", logger.Attrs{
- "tx": tx.Id,
- "sql": sql,
+ tx.IdKey: tx.Id,
+ "sql": sql,
})
return result, err
} | Use transaction id key in the query call | azer_crud | train | go |
24b0789dfacffd38fc16724ea1b2b8a14b49b29d | diff --git a/lib/documents.js b/lib/documents.js
index <HASH>..<HASH> 100644
--- a/lib/documents.js
+++ b/lib/documents.js
@@ -11,7 +11,8 @@ function Paragraph(children, properties) {
type: "paragraph",
children: children,
styleName: properties.styleName || null,
- numbering: properties.numbering || null
+ numbering: properties.numbering || null,
+ alignment: properties.alignment || null
};
}
@@ -22,8 +23,7 @@ function Run(children, properties) {
children: children,
styleName: properties.styleName || null,
isBold: properties.isBold,
- isItalic: properties.isItalic,
- alignment: properties.alignment || null
+ isItalic: properties.isItalic
};
} | Fixing initialization of "alignment" to paragraphs from runs | mwilliamson_mammoth.js | train | js |
c4e69c11f7a4eab3ba0b5337e0b523332c0e72c8 | diff --git a/pygsp/__init__.py b/pygsp/__init__.py
index <HASH>..<HASH> 100644
--- a/pygsp/__init__.py
+++ b/pygsp/__init__.py
@@ -41,3 +41,11 @@ except AttributeError:
__version__ = '0.5.1'
__release_date__ = '2017-12-15'
+
+
+def test(): # pragma: no cover
+ """Run the test suite."""
+ import unittest
+ # Lazy as it might be slow and require additional dependencies.
+ from pygsp.tests import suite
+ unittest.TextTestRunner(verbosity=2).run(suite) | tests: add back a test runner function
Allow users and packagers to run the tests after installation with pg.test(). | epfl-lts2_pygsp | train | py |
bec032d706cfa9cffb14fc3ea55d68d32254fc6e | diff --git a/lib/capybara/queries/selector_query.rb b/lib/capybara/queries/selector_query.rb
index <HASH>..<HASH> 100644
--- a/lib/capybara/queries/selector_query.rb
+++ b/lib/capybara/queries/selector_query.rb
@@ -73,7 +73,7 @@ module Capybara
end
end
- res &&= @filter_block.call(node) unless @filter_block.nil?
+ res &&= Capybara.using_wait_time(0){ @filter_block.call(node)} unless @filter_block.nil?
res
end | default filter blocks to wait time of 0 | teamcapybara_capybara | train | rb |
ff35eeb9dd62c325a85519beb0207a7d7ec90e24 | diff --git a/gifi/feature.py b/gifi/feature.py
index <HASH>..<HASH> 100644
--- a/gifi/feature.py
+++ b/gifi/feature.py
@@ -75,7 +75,7 @@ def _publish(message=None):
config = configuration(repo)
_push_working_branch(config, repo)
if config.publish_with_pull_request:
- git_hub.request(repo, message)
+ gifi.git_hub.request(repo, message)
def _push_working_branch(config, repo): | Prefix gith_hub with gifi | kokosing_git-gifi | train | py |
31b45cf5f8dd90ae0f6cffe1e20b6e782ba072f1 | diff --git a/fastlane/lib/fastlane/actions/notarize.rb b/fastlane/lib/fastlane/actions/notarize.rb
index <HASH>..<HASH> 100644
--- a/fastlane/lib/fastlane/actions/notarize.rb
+++ b/fastlane/lib/fastlane/actions/notarize.rb
@@ -72,13 +72,23 @@ module Fastlane
UI.message('Querying request status')
+ # As of July 2020, the request UUID might not be available for polling yet which returns an error code
+ # This is now handled with the error_callback (which prevents an error from being raised)
+ # Catching this error allows for polling to continue until the notarization is complete
+ error = false
notarization_info_response = Actions.sh(
"xcrun altool --notarization-info #{notarization_request_id} -u #{apple_id_account.user} -p @env:FL_NOTARIZE_PASSWORD --output-format xml",
- log: verbose
+ log: verbose,
+ error_callback: lambda { |msg|
+ error = true
+ UI.error("Error polling for notarization info: #{msg}")
+ }
)
- notarization_info_plist = Plist.parse_xml(notarization_info_response)
- notarization_info = notarization_info_plist['notarization-info']
+ unless error
+ notarization_info_plist = Plist.parse_xml(notarization_info_response)
+ notarization_info = notarization_info_plist['notarization-info']
+ end
end
log_url = notarization_info['LogFileURL'] | [actions] add retry to notarize when request uuid isn't ready (#<I>) | fastlane_fastlane | train | rb |
9cc41dfd6d7fc0b3451c628bf48c6d1b731a0bc5 | diff --git a/question/format/xml/format.php b/question/format/xml/format.php
index <HASH>..<HASH> 100755
--- a/question/format/xml/format.php
+++ b/question/format/xml/format.php
@@ -974,7 +974,7 @@ class qformat_xml extends qformat_default {
case MULTIANSWER:
$a_count=1;
foreach($question->options->questions as $question) {
- $thispattern = addslashes("{#".$a_count."}"); // TODO: fix this addslashes
+ $thispattern = preg_quote("{#".$a_count."}"); //TODO: is this really necessary?
$thisreplace = $question->questiontext;
$expout=preg_replace("~$thispattern~", $thisreplace, $expout );
$a_count++; | MDL-<I> replacing forbidden addslashes with something that is most probably completely useless | moodle_moodle | train | php |
568a7d90467c91d7a5b8597ba5e9389d62640e07 | diff --git a/exchanges/poloniex.js b/exchanges/poloniex.js
index <HASH>..<HASH> 100644
--- a/exchanges/poloniex.js
+++ b/exchanges/poloniex.js
@@ -127,9 +127,10 @@ Trader.prototype.getTrades = function(since, callback, descending) {
result = _.map(result, function(trade) {
return {
+ tid: trade.tradeID,
+ amount: +trade.amount,
date: moment.utc(trade.date).format('X'),
- price: trade.rate,
- tid: trade.tradeID
+ price: +trade.rate
};
}); | relay trade amount at poloniex, fix #<I> | askmike_gekko | train | js |