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 |
|---|---|---|---|---|---|
b9c41e368dc1e1a5a893acce6eb38106ad0bedc9 | diff --git a/src/org/opencms/ui/apps/scheduler/CmsScheduledJobsAppConfig.java b/src/org/opencms/ui/apps/scheduler/CmsScheduledJobsAppConfig.java
index <HASH>..<HASH> 100644
--- a/src/org/opencms/ui/apps/scheduler/CmsScheduledJobsAppConfig.java
+++ b/src/org/opencms/ui/apps/scheduler/CmsScheduledJobsAppConfig.java
@@ -66,6 +66,7 @@ public class CmsScheduledJobsAppConfig extends A_CmsWorkplaceAppConfiguration {
public void initUI(I_CmsAppUIContext context) {
context.setAppContent(new CmsJobMainView(context));
+ context.showInfoArea(false);
} | Hid info area in scheduler app. | alkacon_opencms-core | train | java |
6f9250553ca49824fd190202110227d034938cf7 | diff --git a/Gulpfile.js b/Gulpfile.js
index <HASH>..<HASH> 100644
--- a/Gulpfile.js
+++ b/Gulpfile.js
@@ -9,7 +9,7 @@ const outputWrapper = `(function(global){%output%\nconst erste = this.$jscompDef
function compile() {
const options = {
compilation_level: 'ADVANCED_OPTIMIZATIONS',
- externs: './src/externs.js',
+ externs: './dist/externs.js',
warning_level: 'VERBOSE',
language_in: 'ECMASCRIPT7',
assume_function_wrapper: true,
@@ -35,7 +35,7 @@ function compile() {
.pipe(gulp.dest('dist'));
}
-gulp.task('clean', () => del(['dist/*']));
+gulp.task('clean', () => del(['dist/*', '!dist/externs.js']));
gulp.task('compile', compile);
gulp.task('watch', () => watch('./src/**/*.js', compile)); | Fix build
This makes sure to look for externs.js in the dist folder, and cleans
the dist folder accordingly | dashersw_erste | train | js |
bab41ab7b68efc3645b919b4740979dced026036 | diff --git a/grade/report/grader/module.js b/grade/report/grader/module.js
index <HASH>..<HASH> 100644
--- a/grade/report/grader/module.js
+++ b/grade/report/grader/module.js
@@ -275,7 +275,7 @@ M.gradereport_grader.classes.report.prototype.update_feedback = function(userid,
M.gradereport_grader.classes.ajax = function(report, cfg) {
this.report = report;
this.courseid = cfg.courseid || null;
- this.feedbacktrunclength = cfg.courseid || null;
+ this.feedbacktrunclength = cfg.feedbacktrunclength || null;
this.studentsperpage = cfg.studentsperpage || null;
this.showquickfeedback = cfg.showquickfeedback || false;
this.scales = cfg.scales || null; | gradebook MDL-<I> commented out a bunch of code that should be ok to be deleted. | moodle_moodle | train | js |
34096e8e2301c1cda6dc2fc889920727e3c94cd6 | diff --git a/lib/soca/plugins/macro.rb b/lib/soca/plugins/macro.rb
index <HASH>..<HASH> 100644
--- a/lib/soca/plugins/macro.rb
+++ b/lib/soca/plugins/macro.rb
@@ -18,7 +18,7 @@ module Soca
else
res += "#{line}\n"
end
- end
+ end.strip
end
end
end | Macro should play nice with built-in reduce functions | quirkey_soca | train | rb |
2903da27dc9215b1befc2f9e293a467cf2de0b07 | diff --git a/validator/sawtooth_validator/journal/chain.py b/validator/sawtooth_validator/journal/chain.py
index <HASH>..<HASH> 100644
--- a/validator/sawtooth_validator/journal/chain.py
+++ b/validator/sawtooth_validator/journal/chain.py
@@ -484,6 +484,21 @@ class BlockValidator(object):
# 4) Evaluate the 2 chains to see if the new chain should be
# committed
+ LOGGER.info(
+ "Comparing current chain head '%s' against new block '%s'",
+ self._chain_head, self._new_block)
+ for i in range(max(len(new_chain), len(cur_chain))):
+ cur = new = num = "-"
+ if i < len(cur_chain):
+ cur = cur_chain[i].header_signature[:8]
+ num = cur_chain[i].block_num
+ if i < len(new_chain):
+ new = new_chain[i].header_signature[:8]
+ num = new_chain[i].block_num
+ LOGGER.info(
+ "Fork comparison at height %s is between %s and %s",
+ num, cur, new)
+
commit_new_chain = self._test_commit_new_chain()
# 5) Consensus to compute batch sets (only if we are switching). | Improve validator fork resolution logging
Adds an INFO level message which logs the heads of the forks being
compared.
Also adds INFO level messages to print the blocks being compared at each
height. | hyperledger_sawtooth-core | train | py |
5942cef6f2a92860387e83dd268445a688c63da0 | diff --git a/src/WebServiceProvider.php b/src/WebServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/WebServiceProvider.php
+++ b/src/WebServiceProvider.php
@@ -311,6 +311,16 @@ class WebServiceProvider extends AbstractSeatPlugin
'timeout' => 900, // 15 minutes
],
],
+ 'production' => [
+ 'seat-workers' => [
+ 'connection' => 'redis',
+ 'queue' => ['high', 'medium', 'low', 'default'],
+ 'balance' => $balancing_mode,
+ 'processes' => (int) env(self::QUEUE_BALANCING_WORKERS, 4),
+ 'tries' => 1,
+ 'timeout' => 900, // 15 minutes
+ ],
+ ],
];
// Set the environment configuration. | Adding production environment to horizon config | eveseat_web | train | php |
453f69263f67abbeeee0e085c17faf6e1fc2d8db | diff --git a/grade/report/singleview/index.php b/grade/report/singleview/index.php
index <HASH>..<HASH> 100644
--- a/grade/report/singleview/index.php
+++ b/grade/report/singleview/index.php
@@ -40,6 +40,11 @@ $itemtype = optional_param('item', $defaulttype, PARAM_TEXT);
$page = optional_param('page', 0, PARAM_INT);
$perpage = optional_param('perpage', 100, PARAM_INT);
+if ($itemid < 1){
+ $itemid = $userid;
+ $itemtype = $defaulttype;
+}
+
$courseparams = array('id' => $courseid);
$PAGE->set_url(new moodle_url('/grade/report/singleview/index.php', $courseparams));
$PAGE->set_pagelayout('incourse'); | MDL-<I> singleview: Prevent errors when no itemid was selected | moodle_moodle | train | php |
60ed58ad8ccfbbb719ad01a011e018dd7254f5f9 | diff --git a/src/molecule/dependency/ansible_galaxy/base.py b/src/molecule/dependency/ansible_galaxy/base.py
index <HASH>..<HASH> 100644
--- a/src/molecule/dependency/ansible_galaxy/base.py
+++ b/src/molecule/dependency/ansible_galaxy/base.py
@@ -113,11 +113,11 @@ class AnsibleGalaxyBase(base.Base):
)
def execute(self):
- super().execute()
if not self.enabled:
msg = "Skipping, dependency is disabled."
LOG.warning(msg)
return
+ super().execute()
if not self._has_requirements_file():
msg = "Skipping, missing the requirements file." | Restore option to disable galaxy dependency check (#<I>) | ansible_molecule | train | py |
684475ffbe25f388cb023fa7db73655d67fb41df | diff --git a/src/arcrest/manageorg/_content.py b/src/arcrest/manageorg/_content.py
index <HASH>..<HASH> 100644
--- a/src/arcrest/manageorg/_content.py
+++ b/src/arcrest/manageorg/_content.py
@@ -1604,7 +1604,7 @@ class UserItem(BaseAGOLClass):
params[key] = dictItem[key]
if data is not None:
files['file'] = data
- if os.path.isfile(metadata):
+ if metadata and os.path.isfile(metadata):
files['metadata'] = metadata
url = "%s/update" % self.root
res = self._post(url=url, | Added check if item metadata is included before checking for file | Esri_ArcREST | train | py |
acf85a5992da637ecc8b8b3c284c84001b57f70f | diff --git a/core/phantomas.js b/core/phantomas.js
index <HASH>..<HASH> 100644
--- a/core/phantomas.js
+++ b/core/phantomas.js
@@ -534,7 +534,15 @@ phantomas.prototype = {
this.emitInternal('init'); // @desc page has been initialized, scripts can be injected
},
- onLoadStarted: function() {
+ onLoadStarted: function(url, isFrame) {
+ if (this.onLoadStartedEmitted) {
+ return;
+ }
+
+ // onLoadStarted is called for the page and each iframe
+ // tigger "loadStarted" event just once
+ this.onLoadStartedEmitted = true;
+
this.log('Page loading started');
this.emitInternal('loadStarted'); // @desc page loading has started
}, | onLoadStarted: trigger just once | macbre_phantomas | train | js |
361f2835c9991aaa5574cd94786ecc23cedeb334 | diff --git a/validator.js b/validator.js
index <HASH>..<HASH> 100644
--- a/validator.js
+++ b/validator.js
@@ -484,11 +484,11 @@
validator.escape = function (str) {
return (str.replace(/&/g, '&')
- .replace(/"/g, '"')
- .replace(/'/g, ''')
- .replace(/</g, '<')
- .replace(/>/g, '>')
- .replace(/\//g, '/'));
+ .replace(/"/g, '"')
+ .replace(/'/g, ''')
+ .replace(/</g, '<')
+ .replace(/>/g, '>')
+ .replace(/\//g, '/'));
};
validator.stripLow = function (str, keep_new_lines) { | Minor fix to indentation in escape method | chriso_validator.js | train | js |
ed6910322bb4850f67a233a8bd7c8127ee7e0589 | diff --git a/pyqode/python/modes/code_completion.py b/pyqode/python/modes/code_completion.py
index <HASH>..<HASH> 100644
--- a/pyqode/python/modes/code_completion.py
+++ b/pyqode/python/modes/code_completion.py
@@ -219,8 +219,10 @@ class JediCompletionProvider(CompletionProvider):
try:
definition = completion.follow_definition()[0]
type = definition.type
- except IndexError:
- pass # no definition
+ except (IndexError, AttributeError):
+ # no definition
+ # AttributeError is raised for GlobalNamespace
+ pass
desc = completion.full_name
icon = iconFromType(name, type)
retVal.append(Completion(name, icon=icon, tooltip=desc)) | Fix no completion on global namespace
follow_definition raise attribute error on global namespace. I am
not sure if this is a bug in jedi, since follow_definition should not
be used there. | pyQode_pyqode.python | train | py |
a83a0d5d30da59343451fee52db54c29cb0139a5 | diff --git a/api/models/Permission.js b/api/models/Permission.js
index <HASH>..<HASH> 100644
--- a/api/models/Permission.js
+++ b/api/models/Permission.js
@@ -5,7 +5,6 @@
* The actions a Role is granted on a particular Model and its attributes
*/
module.exports = {
- autoCreatedBy: false,
description: [
'Defines a particular `action` that a `Role` can perform on a `Model`.', | fix for error: column permission.createdBy does not exist
sails-permissions initializes some permissions objects with fixture data,
which includes createdBy fields. It also sets the permissions model
'autoCreatedBy' to false for some reason. Hence the error.
I just deleted the 'autoCreatedBy: false' config in the permission model.
It starts up with no errors now, but I'm not sure if that was set
to false for a reason. The tests all still pass. | trailsjs_sails-permissions | train | js |
bfe31266e69a7e94ff7559c3b6978e93d8ba5ee0 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -61,13 +61,13 @@ setup(
setup_requires = [
'hgtools',
'nose',
+ 'nose-timer',
'sphinx',
'sphinxcontrib-fulltoc',
],
tests_require = [
'coverage',
- 'nose-timer',
],
) | #<I>: moved nose-timer to setup_requires | biocommons_hgvs | train | py |
7a559acc8decaa0deaba4cc28c274471f0f001bb | diff --git a/src/asciiRegex.js b/src/asciiRegex.js
index <HASH>..<HASH> 100644
--- a/src/asciiRegex.js
+++ b/src/asciiRegex.js
@@ -20,7 +20,7 @@ const edgeCases = ["http", "https"].join("|");
// - Allow characters included in normal aliases (to check later cases like :s and :smile:)
export default function() {
return new RegExp(
- `(${edgeCases})?(${names})((?!(${edgeCases}))[a-z0-9_-]+:)?`,
+ `(${edgeCases})?(${names})((?!(${edgeCases}))[a-z0-9_\\-\\+]+:)?`,
"g"
);
} | Correct escaped dash and missing + char. | tommoor_react-emoji-render | train | js |
4e3ca66b6d2d4d1ca47e3c6e492b73c199507ab6 | diff --git a/cli/cli.go b/cli/cli.go
index <HASH>..<HASH> 100644
--- a/cli/cli.go
+++ b/cli/cli.go
@@ -12,7 +12,7 @@ import (
const name = "base58"
-const version = "0.0.1"
+const version = "0.0.2"
const (
exitCodeOK = iota | bump up version to <I> | itchyny_base58-go | train | go |
b444d7d5076f7f15c501e00f17622e754c7fe688 | diff --git a/images/oci/exporter.go b/images/oci/exporter.go
index <HASH>..<HASH> 100644
--- a/images/oci/exporter.go
+++ b/images/oci/exporter.go
@@ -41,7 +41,7 @@ type V1Exporter struct {
AllPlatforms bool
}
-// V1ExporterOpt allows to set additional options to a newly V1Exporter
+// V1ExporterOpt allows the caller to set additional options to a new V1Exporter
type V1ExporterOpt func(c *V1Exporter) error
// DefaultV1Exporter return a default V1Exporter pointer
@@ -91,11 +91,7 @@ func (oe *V1Exporter) Export(ctx context.Context, store content.Provider, desc o
if !oe.AllPlatforms {
// get local default platform to fetch image manifest
- p, err := platforms.Parse(platforms.DefaultString())
- if err != nil {
- return errors.Wrapf(err, "invalid platform %s", platforms.DefaultString())
- }
- childrenHandler = images.FilterPlatforms(childrenHandler, platforms.Any(p))
+ childrenHandler = images.FilterPlatforms(childrenHandler, platforms.Any(platforms.DefaultSpec()))
}
handlers := images.Handlers( | Handle additional cleanups from prior PR
Update comment and streamline getting the default platform spec | containerd_containerd | train | go |
d125b4eca2b9099a80ef0796abdfe110b09a2955 | diff --git a/src/DocsGenerator.php b/src/DocsGenerator.php
index <HASH>..<HASH> 100644
--- a/src/DocsGenerator.php
+++ b/src/DocsGenerator.php
@@ -180,6 +180,15 @@ class DocsGenerator
if (!empty($classData['methods'])) {
usort($classData['methods'], function($data1, $data2) {
+ if ((int) $data1['isPublic'] . (int) $data1['isProtected'] . (int) $data1['isPrivate'] !== (int) $data2['isPublic'] . (int) $data2['isProtected'] . (int) $data2['isPrivate']) {
+ if ($data1['isPublic']) {
+ return -1;
+ }
+ if ($data1['isPrivate']) {
+ return 1;
+ }
+ return 1;
+ }
return strcmp($data1['name'], $data2['name']);
});
$methodsOutput = ''; | Added methods sorting by public, protected and private. | ivopetkov_docs-generator | train | php |
e8011df1b939f4365a826e442364a6714b4daf2b | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -294,9 +294,13 @@ const mochaPlugin = require('serverless-mocha-plugin');
const wrapper = mochaPlugin.lambdaWrapper;
const expect = mochaPlugin.chai.expect;
-wrapper.init(mod);
-
describe('${funcName}', () => {
+ before(function (done) {
+ wrapper.init(mod);
+
+ done()
+ })
+
it('implement tests here', (done) => {
wrapper.run({}, (err, response) => {
done('no tests implemented'); | Wrapper.init should be done in before method | nordcloud_serverless-mocha-plugin | train | js |
e006ebb056e0e12bcc88edfb8eb9e47fd6136622 | diff --git a/lib/Doctrine/Node/NestedSet.php b/lib/Doctrine/Node/NestedSet.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/Node/NestedSet.php
+++ b/lib/Doctrine/Node/NestedSet.php
@@ -209,10 +209,11 @@ class Doctrine_Node_NestedSet extends Doctrine_Node implements Doctrine_Node_Int
$q = $this->record->getTable()->createQuery();
$componentName = $this->record->getTable()->getComponentName();
- $ancestors = $q->where("$componentName.lft < ? AND $componentName.rgt > ?", array($this->getLeftValue(), $this->getRightValue()))
- ->orderBy("$componentName.lft asc")
- ->execute();
-
+ $q = $q->where("$componentName.lft < ? AND $componentName.rgt > ?", array($this->getLeftValue(), $this->getRightValue()))
+ ->orderBy("$componentName.lft asc");
+ $q = $this->record->getTable()->getTree()->returnQueryWithRootId($q, $this->getRootValue());
+ $ancestors = $q->execute();
+
return $ancestors;
} | Added missing multiple root support to Doctrine_Node_NestedSet::getAncestors(). | doctrine_annotations | train | php |
ec09437e38cc58b7f29f0068c548050503dae05f | diff --git a/go/coredns/plugin/ztndns/pfconfig.go b/go/coredns/plugin/ztndns/pfconfig.go
index <HASH>..<HASH> 100644
--- a/go/coredns/plugin/ztndns/pfconfig.go
+++ b/go/coredns/plugin/ztndns/pfconfig.go
@@ -5,6 +5,7 @@ import (
"regexp"
"github.com/inverse-inc/packetfence/go/log"
+ "github.com/inverse-inc/packetfence/go/remoteclients"
"github.com/inverse-inc/packetfence/go/timedlock"
"github.com/inverse-inc/packetfence/go/pfconfigdriver"
@@ -50,7 +51,8 @@ func (ztn *ztndns) HostIPMAP(ctx context.Context) error {
rgx, _ := regexp.Compile(hostname + ".*")
HostIpmap := &HostIPMap{}
HostIpmap.ComputerName = rgx
- HostIpmap.Ip = RemoteClient{ID: ID}.IPAddress()
+ rc := remoteclients.RemoteClient{ID: id}
+ HostIpmap.Ip = rc.IPAddress()
ztn.HostIP[i] = HostIpmap
i++
} | adjust ztndns middleware | inverse-inc_packetfence | train | go |
6e8725e721bbf85993707c1d14696780c8f7b3eb | diff --git a/pmxbot/botbase.py b/pmxbot/botbase.py
index <HASH>..<HASH> 100644
--- a/pmxbot/botbase.py
+++ b/pmxbot/botbase.py
@@ -111,6 +111,10 @@ class LoggingCommandBot(irc.bot.SingleServerIRCBot):
if not isinstance(when, datetime.time):
raise ValueError("when must be datetime, date, or time")
daily = datetime.timedelta(days=1)
+ # convert when to the next datetime matching this time
+ when = datetime.datetime.combine(datetime.date.today(), when)
+ if when < datetime.datetime.now():
+ when += daily
cmd = irc.client.PeriodicCommandFixedDelay.at_time(
when, daily, self.background_runner, arguments)
self.c._schedule_command(cmd) | Fix issue where DelayedCommands require datetime instances | yougov_pmxbot | train | py |
124aaebaf710b5c71a688c12ab2391bb36970d7b | diff --git a/sources/freeproxylists.js b/sources/freeproxylists.js
index <HASH>..<HASH> 100644
--- a/sources/freeproxylists.js
+++ b/sources/freeproxylists.js
@@ -19,6 +19,8 @@ var unoffocialCountryNames = {
module.exports = {
+ homeUrl: baseUrl,
+
getProxies: function(options, cb) {
getListUrls(function(error, listUrls) { | Added 'homeUrl' | chill117_proxy-lists | train | js |
f6db7ae74900e0dbf39553ebd531b23c31d07db0 | diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py
index <HASH>..<HASH> 100644
--- a/src/_pytest/pytester.py
+++ b/src/_pytest/pytester.py
@@ -904,13 +904,13 @@ class Pytester:
self._monkeypatch.syspath_prepend(str(path))
- def mkdir(self, name: str) -> Path:
+ def mkdir(self, name: Union[str, "os.PathLike[str]"]) -> Path:
"""Create a new (sub)directory."""
p = self.path / name
p.mkdir()
return p
- def mkpydir(self, name: str) -> Path:
+ def mkpydir(self, name: Union[str, "os.PathLike[str]"]) -> Path:
"""Create a new python package.
This creates a (sub)directory with an empty ``__init__.py`` file so it | Let mkdir() and mkpydir() receive PathLike names
These pytester utility methods were annotated to only receive `str`
names, but they naturally support os.PathLike values, as well.
This makes writing some pytester calls a little nicer, such as when
creating a directory based on a `.joinpath()` call. We previously needed
to cast that intermediate value to a `str`. | pytest-dev_pytest | train | py |
7f51ce60213669bd70e5dc3ca5f2be132758c255 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -32,7 +32,7 @@ setup(
scripts=['workbench/server/workbench_server', 'workbench_apps/workbench_cli/workbench'],
tests_require=['tox'],
install_requires=['cython', 'distorm3', 'elasticsearch', 'funcsigs', 'flask', 'filemagic',
- 'ipython', 'lz4', 'mock', 'numpy', 'pandas', 'pefile',
+ 'ipython==5.3.0', 'lz4', 'mock', 'numpy', 'pandas', 'pefile',
'py2neo==1.6.4', 'pymongo', 'pytest', 'rekall==1.0.3', 'requests',
'ssdeep==2.9-0.3', 'urllib3', 'yara', 'zerorpc', 'cython'],
license='MIT', | pin the version of ipython | SuperCowPowers_workbench | train | py |
398e8b27453f5445134c5b83734fa88f4764e06f | diff --git a/Engine/Base.php b/Engine/Base.php
index <HASH>..<HASH> 100644
--- a/Engine/Base.php
+++ b/Engine/Base.php
@@ -3,6 +3,7 @@ namespace Colibri\Application\Engine;
use Colibri\Base\PropertyAccess;
+use Colibri\Database\AbstractDb;
use Colibri\Database\Concrete\MySQL;
use Colibri\Database\Db;
use Colibri\Config\Config;
@@ -51,11 +52,10 @@ class Base extends PropertyAccess implements IEngine
}
}
- Object::$useMemcache =
- ObjectCollection::$useMemcache =
+ AbstractDb::$useMemcacheForMetadata =
$config['useCache']
;
-
+
Object::$debug =
MySQL::$monitorQueries =
$config['debug'] | fix useCache, all dates from db converts into Carbon | PHPColibri_framework | train | php |
017614d98510bc2e6b5b7b78ac08b4de7e2ec4de | diff --git a/packages/react-ui-testing/react-selenium-testing.js b/packages/react-ui-testing/react-selenium-testing.js
index <HASH>..<HASH> 100644
--- a/packages/react-ui-testing/react-selenium-testing.js
+++ b/packages/react-ui-testing/react-selenium-testing.js
@@ -470,11 +470,15 @@ function fillPropsForDomElementRecursive(attrContainer, instance) {
}
function fillPropsForDomElement(attrContainer, instance) {
- const instanceProps = instance._currentElement && instance._currentElement.props;
const componentName = getComponentName(instance);
if (componentName) {
appendToSet(attrContainer, 'data-comp-name', componentName);
}
+ const key = instance._currentElement && instance._currentElement.key;
+ if (key) {
+ appendToSet(attrContainer, 'data-key', key);
+ }
+ const instanceProps = instance._currentElement && instance._currentElement.props;
if (instanceProps) {
if (instanceProps['data-tid']) {
appendToSet(attrContainer, 'data-tid', instanceProps['data-tid']); | feat(react-ui-testing): prop key renders to html attribute | skbkontur_retail-ui | train | js |
e8babbc98955dd952e3e4ae2a48c8da612dd362e | diff --git a/src/Mapper/Relation/ManyToManyRelation.php b/src/Mapper/Relation/ManyToManyRelation.php
index <HASH>..<HASH> 100644
--- a/src/Mapper/Relation/ManyToManyRelation.php
+++ b/src/Mapper/Relation/ManyToManyRelation.php
@@ -81,13 +81,16 @@ class ManyToManyRelation extends OneToManyRelation
}
$id = $this->getProperty($ref, $this->targetMapper->getIdentifierName());
- if($id) {
- $intersectionEntity = $this->getMapper()->getPrototype();
- $this->setProperty($intersectionEntity, $this->getRefName(), $refValue);
- $this->setProperty($intersectionEntity, $this->targetRefName, $id);
-
- $affectedRows += $this->getMapper()->create($intersectionEntity);
+ if(!$id) {
+ $this->targetMapper->create($ref);
+ $id = $this->getProperty($ref, $this->targetMapper->getIdentifierName());
}
+
+ $intersectionEntity = $this->getMapper()->getPrototype();
+ $this->setProperty($intersectionEntity, $this->getRefName(), $refValue);
+ $this->setProperty($intersectionEntity, $this->targetRefName, $id);
+
+ $affectedRows += $this->getMapper()->create($intersectionEntity);
}
}
else { | the many to many relation can create the target ref if it detects it is newly added | dotkernel_dot-mapper | train | php |
17c066a27dfedd941ad4a678f21b585eda04bf58 | diff --git a/src/config.js b/src/config.js
index <HASH>..<HASH> 100644
--- a/src/config.js
+++ b/src/config.js
@@ -36,8 +36,6 @@ if(args.hot && !args.build) {
plugins.unshift(new webpack.HotModuleReplacementPlugin());
}
-console.log(entries, plugins);
-
function readUserBabelrc() {
try {
return json5.parse(fs.readFileSync(path.resolve(process.cwd(), '.babelrc'), 'utf-8')); | i should be more careful with my console.logs | dat2_react-dev-server | train | js |
af7e3b1bf904d55a2ab4f2caa1fcce574528a7fd | diff --git a/tests/Controllers/WebhookControllerTest.php b/tests/Controllers/WebhookControllerTest.php
index <HASH>..<HASH> 100644
--- a/tests/Controllers/WebhookControllerTest.php
+++ b/tests/Controllers/WebhookControllerTest.php
@@ -83,6 +83,32 @@ class WebhookControllerTest extends TestCase
$controller = new WebhookController($config);
$controller->receive($request);
}
+
+ public function test_receive_request_is_empty()
+ {
+ $config = m::mock(Repository::class);
+ $config
+ ->shouldReceive('get')
+ ->with('fb-messenger.handlers')
+ ->andReturn([DefaultHandler::class])
+ ->shouldReceive('get')
+ ->with('fb-messenger.app_token')
+ ->shouldReceive('get')
+ ->with('fb-messenger.postbacks')
+ ->andReturn([])
+ ->shouldReceive('get')
+ ->with('fb-messenger.auto_typing')
+ ->andReturn(false);
+
+ $request = m::mock(Request::class)
+ ->shouldReceive('input')
+ ->with('entry.0.messaging')
+ ->andReturnNull()
+ ->getMock();
+
+ $controller = new WebhookController($config);
+ $controller->receive($request);
+ }
}
class HandlerNotExtendsBaseHandlerStub | test: Added test request is empty | CasperLaiTW_laravel-fb-messenger | train | php |
721fd800be0dab51c594bf956e0188a78a8a7a70 | diff --git a/python/mxnet/callback.py b/python/mxnet/callback.py
index <HASH>..<HASH> 100644
--- a/python/mxnet/callback.py
+++ b/python/mxnet/callback.py
@@ -8,22 +8,26 @@ import logging
import time
from .model import save_checkpoint
-def do_checkpoint(prefix):
+def do_checkpoint(prefix, period=1):
"""Callback to checkpoint the model to prefix every epoch.
Parameters
----------
prefix : str
The file prefix to checkpoint to
+ period : int
+ How many epochs to wait before checkpointing. Default is 1.
Returns
-------
callback : function
The callback function that can be passed as iter_end_callback to fit.
"""
+ period = int(max(1, period))
def _callback(iter_no, sym, arg, aux):
"""The checkpoint function."""
- save_checkpoint(prefix, iter_no + 1, sym, arg, aux)
+ if (iter_no + 1) % period == 0:
+ save_checkpoint(prefix, iter_no + 1, sym, arg, aux)
return _callback | Add ability to checkpoint at lower rates (#<I>) | apache_incubator-mxnet | train | py |
48fe769d2c9f9094e459f066e474457b6c92540a | diff --git a/js/angular/app.js b/js/angular/app.js
index <HASH>..<HASH> 100644
--- a/js/angular/app.js
+++ b/js/angular/app.js
@@ -4,7 +4,6 @@
angular.module('application', [
'ui.router',
'ngAnimate',
- 'ngSVGAttributes',
//foundation
'foundation',
@@ -21,22 +20,16 @@
$urlProvider.otherwise('/');
$locationProvider.html5Mode({
- enabled:true,
+ enabled: false,
requireBase: false
});
+
+ $locationProvider.hashPrefix('!');
}
- run.$inject = ['$rootScope', '$location', '$compile'];
- function run($rootScope, $location, $compile) {
+ function run() {
FastClick.attach(document.body);
-
- if ($location.$$html5) {
- $rootScope.$on('$zfIconicInjected', function(event, injectedElem) {
- var angElem = angular.element(injectedElem);
- $compile(angElem.contents())(angElem.scope());
- });
- }
}
-
+
})(); | Clean up to app.js file for FA build. | zurb_foundation-apps | train | js |
5754ad589f1b1cbc07b8347b3cb0996d802331bb | diff --git a/telethon/hints.py b/telethon/hints.py
index <HASH>..<HASH> 100644
--- a/telethon/hints.py
+++ b/telethon/hints.py
@@ -1,5 +1,4 @@
import datetime
-import io
import typing
from . import helpers
@@ -35,6 +34,8 @@ TotalList = helpers.TotalList
DateLike = typing.Optional[typing.Union[float, datetime.datetime, datetime.date, datetime.timedelta]]
+# Note: we can't use `io.BytesIO` directly due to a bug in
+# Python 3.5.2's `typing`: https://github.com/python/typing/issues/266
LocalPath = str
ExternalUrl = str
BotFileID = str
@@ -43,7 +44,7 @@ FileLike = typing.Union[
ExternalUrl,
BotFileID,
bytes,
- io.IOBase,
+ typing.BinaryIO,
types.TypeMessageMedia,
types.TypeInputFile,
types.TypeInputFileLocation
@@ -52,7 +53,7 @@ FileLike = typing.Union[
OutFileLike = typing.Union[
str,
typing.Type[bytes],
- io.IOBase
+ typing.BinaryIO
]
MessageLike = typing.Union[str, types.Message] | Fix type hints for Python <I> (#<I>) | LonamiWebs_Telethon | train | py |
8f6f56c8dbec31966a8553d81dde711cee029569 | diff --git a/lib/bump.rb b/lib/bump.rb
index <HASH>..<HASH> 100644
--- a/lib/bump.rb
+++ b/lib/bump.rb
@@ -90,7 +90,7 @@ module Bump
def self.replace(file, old, new)
content = File.read(file)
- File.open(file, "w"){|f| f.write(content.gsub(old, new)) }
+ File.open(file, "w"){|f| f.write(content.sub(old, new)) }
end
def self.current_info
diff --git a/spec/bump_spec.rb b/spec/bump_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/bump_spec.rb
+++ b/spec/bump_spec.rb
@@ -106,6 +106,21 @@ describe Bump do
bump("patch").should include("4.2.11")
read(gemspec).should include('s.version = "4.2.11"')
end
+
+ it "should not bump multiple versions" do
+ version = '"4.2.3"'
+ write gemspec, <<-RUBY
+ Gem::Specification.new do |s|
+ s.name = 'fixture'
+ s.version = #{version}
+ s.summary = 'Fixture gem'
+ s.runtime_dependency 'rake', #{version}
+ end
+ RUBY
+ bump("patch").should include("4.2.4")
+ read(gemspec).should include('s.version = "4.2.4"')
+ read(gemspec).should include("'rake', #{version}")
+ end
end
context ".version in gemspec within the initializer" do | do not replace multiple versions if they have the same version | gregorym_bump | train | rb,rb |
40341bbb2f601d30fcf2fa2d1945f36d0e73e21f | diff --git a/src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php b/src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php
+++ b/src/Symfony/Component/Form/Extension/Core/Type/MoneyType.php
@@ -20,7 +20,7 @@ use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class MoneyType extends AbstractType
{
- private static $patterns = array();
+ protected static $patterns = array();
/**
* {@inheritdoc} | Changed MoneyType::$patterns visibility. | symfony_symfony | train | php |
2f117a86bd6a9d0f3902d71d66138eb78d713a2e | diff --git a/library.js b/library.js
index <HASH>..<HASH> 100644
--- a/library.js
+++ b/library.js
@@ -63,4 +63,11 @@ exports.deepFreeze = function deepFreeze(obj) {
});
return obj;
+};
+
+// The minimum is inclusive and the maximum is exclusive.
+exports.random = function random(min, max) {
+ min = Math.ceil(min);
+ max = Math.floor(max);
+ return Math.floor(Math.random() * (max - min)) + min;
};
\ No newline at end of file | Add Library.random()
Changes to be committed:
modified: library.js | kixxauth_kixx | train | js |
21bc5a0ebe5d1332225daa3355d6f5c8e30cdd18 | diff --git a/pyqode/core/widgets/tabs.py b/pyqode/core/widgets/tabs.py
index <HASH>..<HASH> 100644
--- a/pyqode/core/widgets/tabs.py
+++ b/pyqode/core/widgets/tabs.py
@@ -213,7 +213,7 @@ class TabWidget(QTabWidget):
self.setTabText(self.currentIndex(), code_edit._tab_name)
ext = os.path.splitext(path)[1]
old_ext = os.path.splitext(old_path)[1]
- if ext != old_ext:
+ if ext != old_ext or not old_path:
icon = QtWidgets.QFileIconProvider().icon(
QtCore.QFileInfo(code_edit.file.path))
self.setTabIcon(self.currentIndex(), icon) | Fix icon update in case of first save of a new file | pyQode_pyqode.core | train | py |
7a984e7b7650cf37ea9b5a71ebc1a1a3ea7b7542 | diff --git a/src/Client.php b/src/Client.php
index <HASH>..<HASH> 100644
--- a/src/Client.php
+++ b/src/Client.php
@@ -433,7 +433,7 @@ class Client implements ClientInterface
$class = 'Predis\Pipeline\Pipeline';
}
- /*
+ /**
* @var ClientContextInterface
*/
$pipeline = new $class($this); | Fix wrong phpdoc.
Thanks @Aliance for spotting this oversight. | imcj_predis | train | php |
f3af41c4e112332caad5c7511fbe2ba3141d522d | diff --git a/setuptools_odoo/core.py b/setuptools_odoo/core.py
index <HASH>..<HASH> 100644
--- a/setuptools_odoo/core.py
+++ b/setuptools_odoo/core.py
@@ -20,7 +20,7 @@ ODOO_VERSION_INFO = {
'odoo_dep': 'openerp>=7.0a,<8.0a',
'base_addons': base_addons.openerp7,
'addon_dep_version': '>=7.0a,<8.0a',
- 'pkg_name_pfx': 'odoo-addon-',
+ 'pkg_name_pfx': 'openerp-addon-',
},
'8.0': {
'odoo_dep': 'odoo>=8.0a,<9.0a', | [IMP] name openerp 7 addons as openerp-addon-addon_name instead of odoo-addon-addon_name | acsone_setuptools-odoo | train | py |
618cdaa15425dc75a959deeecdabe62a7444c67b | diff --git a/src/base/ItemsCursorMixin.js b/src/base/ItemsCursorMixin.js
index <HASH>..<HASH> 100644
--- a/src/base/ItemsCursorMixin.js
+++ b/src/base/ItemsCursorMixin.js
@@ -89,7 +89,9 @@ export default function ItemsCursorMixin(Base) {
super[goPrevious]();
}
const { previousItemIndex } = this[state];
- return previousItemIndex < 0 ? false : moveToIndex(this, previousItemIndex);
+ return previousItemIndex < 0
+ ? false
+ : moveToIndex(this, previousItemIndex);
}
/**
@@ -148,7 +150,7 @@ export default function ItemsCursorMixin(Base) {
// For now, force the index to be within bounds. If items array is
// null or empty, this will be -1 (no selection).
newIndex = count - 1;
- } else if (currentIndexPending !== null) {
+ } else if (changed.items && currentIndexPending !== null) {
if (currentIndexPending < count) {
// The items array has increased in size to the point where a pending
// index can be applied and then discarded. | Refine the condition under which we apply a pending current index. | elix_elix | train | js |
e75807054a676b03f20bc9688c1c4b415e978e9f | diff --git a/dedupe/core.py b/dedupe/core.py
index <HASH>..<HASH> 100644
--- a/dedupe/core.py
+++ b/dedupe/core.py
@@ -183,25 +183,6 @@ def scoreDuplicates(ids, records, id_type, data_model, threshold=None):
return scored_pairs
-def blockedPairsConstrained(blocks) :
- for block in blocks :
- base, target = block
- block_pairs = itertools.product(base.items(), target.items())
-
- for pair in block_pairs :
- yield dict(pair)
-
-
-
-
-def blockedPairs(blocks) :
- for block in blocks :
-
- block_pairs = itertools.combinations(block.items(), 2)
-
- for pair in block_pairs :
- yield dict(pair)
-
def split(iterable):
it = iter(iterable)
q = [collections.deque([x]) for x in it.next()] | moved blockedPairs to api.py | dedupeio_dedupe | train | py |
c0f9e40566227aec56e476e2881867504c6e3837 | diff --git a/lib/grapevine/version.rb b/lib/grapevine/version.rb
index <HASH>..<HASH> 100644
--- a/lib/grapevine/version.rb
+++ b/lib/grapevine/version.rb
@@ -1,3 +1,3 @@
module Grapevine
- VERSION = "0.0.1"
+ VERSION = "0.1.0"
end | moves to version <I> now it is possible to create the basic layout to start working | diablourbano_grapevine | train | rb |
5fbc89f3c6cf304a36583f0830c7284eec2634dc | diff --git a/src/Psy/Configuration.php b/src/Psy/Configuration.php
index <HASH>..<HASH> 100644
--- a/src/Psy/Configuration.php
+++ b/src/Psy/Configuration.php
@@ -1076,7 +1076,7 @@ class Configuration
public function getPresenter()
{
if (!isset($this->presenter)) {
- $this->presenter = new Presenter($this->getOutput()->getFormatter(), $this->getForceArrayIndexes());
+ $this->presenter = new Presenter($this->getOutput()->getFormatter(), $this->forceArrayIndexes());
}
return $this->presenter;
@@ -1281,7 +1281,7 @@ class Configuration
*
* @return bool
*/
- public function getForceArrayIndexes()
+ public function forceArrayIndexes()
{
return $this->forceArrayIndexes;
} | Be consistent with boolean getter methods | bobthecow_psysh | train | php |
d844624cd3e23d0d19c3332f5168b071c60f408c | diff --git a/src/js/components/Layer/LayerContainer.js b/src/js/components/Layer/LayerContainer.js
index <HASH>..<HASH> 100644
--- a/src/js/components/Layer/LayerContainer.js
+++ b/src/js/components/Layer/LayerContainer.js
@@ -108,7 +108,7 @@ class LayerContainer extends Component {
tabIndex='-1'
ref={this.layerRef}
>
- <StyledOverlay onClick={onClickOutside} theme={theme} />
+ <StyledOverlay onClick={onClickOutside} responsive={responsive} theme={theme} />
{content}
</StyledLayer>
);
diff --git a/src/js/components/Layer/StyledLayer.js b/src/js/components/Layer/StyledLayer.js
index <HASH>..<HASH> 100644
--- a/src/js/components/Layer/StyledLayer.js
+++ b/src/js/components/Layer/StyledLayer.js
@@ -48,7 +48,7 @@ export const StyledLayer = styled.div`
`;
export const StyledOverlay = styled.div`
- ${lapAndUp('position: absolute;')}
+ ${props => (props.responsive ? lapAndUp('position: absolute;') : 'position: absolute;')}
top: 0px;
left: 0px;
right: 0px; | fix overlay being removed when responsive is false on v2 layer (#<I>)
* fix overlay being removed when responsive is false on v2 layer
* pass responsive attribute to StyledOverlay for applying layer positioning | grommet_grommet | train | js,js |
fc6349f850460d254b830cd0113033f731f9cd6a | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ import sys
from setuptools import setup, find_packages
from setuptools.command.install import install
-VERSION = '0.2.0rc4'
+VERSION = '0.2.0rc6'
class VerifyVersionCommand(install):
"""Custom command to verify that the git tag matches our version""" | Bump the RC version to <I>rc6 | vertexproject_synapse | train | py |
54e6955823fdd596f7d7184f9bd86dc04c914cd9 | diff --git a/lib/jekyll-redirect-from/redirector.rb b/lib/jekyll-redirect-from/redirector.rb
index <HASH>..<HASH> 100644
--- a/lib/jekyll-redirect-from/redirector.rb
+++ b/lib/jekyll-redirect-from/redirector.rb
@@ -13,7 +13,7 @@ module JekyllRedirectFrom
list.each do |item|
if has_alt_urls?(item)
alt_urls(item).each do |alt_url|
- redirect_page = RedirectPage.new(site, site.source, "", "index.html")
+ redirect_page = RedirectPage.new(site, site.source, "", "redirect.html")
redirect_page.data['permalink'] = alt_url
redirect_page.data['sitemap'] = false
redirect_page.generate_redirect_content(redirect_url(site, item)) | Rename index.html to redirect.html to give more useful profile info. | jekyll_jekyll-redirect-from | train | rb |
1a7b3e04919a45aa03985be87424709161bb0bde | diff --git a/lib/Models/GeoJsonCatalogItem.js b/lib/Models/GeoJsonCatalogItem.js
index <HASH>..<HASH> 100644
--- a/lib/Models/GeoJsonCatalogItem.js
+++ b/lib/Models/GeoJsonCatalogItem.js
@@ -530,7 +530,8 @@ function loadGeoJson(geoJsonItem) {
options.fill = defaultColor(style.fill, (geoJsonItem.name || "") + " fill");
if (defined(style["stroke-opacity"])) {
- options.stroke.alpha = parseFloat(style["stroke-opacity"]);
+ options.polygonStroke.alpha = parseFloat(style["stroke-opacity"]);
+ options.polylineStroke.alpha = parseFloat(style["stroke-opacity"]);
}
if (defined(style["fill-opacity"])) {
options.fill.alpha = parseFloat(style["fill-opacity"]); | Fix crash when using stroke-opacity with GeoJSON | TerriaJS_terriajs | train | js |
52d26cd57dfaa8fb291e1b4b7369d132432b8cbc | diff --git a/src/Menu/MenuBuilder.php b/src/Menu/MenuBuilder.php
index <HASH>..<HASH> 100644
--- a/src/Menu/MenuBuilder.php
+++ b/src/Menu/MenuBuilder.php
@@ -3,8 +3,8 @@
namespace Bolt\Menu;
use Bolt\Translation\Translator as Trans;
-use GuzzleHttp\Url;
use Silex\Application;
+use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
class MenuBuilder
@@ -182,6 +182,8 @@ class MenuBuilder
),
['event' => 'config']
);
+ } catch (MethodNotAllowedException $e) {
+ // Route is probably a GET and we're currently in a POST
}
return $item; | Catch MethodNotAllowedException in menu builder
This can be tirggerd when then route is only allowed a GET and the
request is a POST | bolt_bolt | train | php |
62d74ed8d07164efa466aabbb431e2137a086785 | diff --git a/src/main/java/com/aquaticinformatics/aquarius/sdk/timeseries/AquariusClient.java b/src/main/java/com/aquaticinformatics/aquarius/sdk/timeseries/AquariusClient.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/aquaticinformatics/aquarius/sdk/timeseries/AquariusClient.java
+++ b/src/main/java/com/aquaticinformatics/aquarius/sdk/timeseries/AquariusClient.java
@@ -75,7 +75,7 @@ public class AquariusClient implements AutoCloseable {
}
}
- @Route(Path="/version2", Verbs="GET")
+ @Route(Path="/version", Verbs="GET")
private class GetVersion implements IReturn<VersionResponse> {
public Object getResponseType() { return VersionResponse.class; } | PF-<I> Fixed a bug in the REST route for getting the AQTS server version | AquaticInformatics_aquarius-sdk-java | train | java |
136bae60ab5444cae00c6f326267a9c0a50523da | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -32,7 +32,7 @@ module.exports = function(grunt) {
process: src => src.replace(/\${VERSION}/g, version)
},
src: ['build/boot-transpiled.js'],
- dest: 'build/boot.js'
+ dest: 'build/tabris/boot.js'
},
typings: {
src: [
@@ -121,7 +121,8 @@ module.exports = function(grunt) {
}
},
uglify_boot: {
- cmd: 'node node_modules/uglify-es/bin/uglifyjs --mangle --compress -o build/boot.min.js build/boot.js'
+ cmd: 'node node_modules/uglify-es/bin/uglifyjs --mangle --compress ' +
+ '-o build/tabris/boot.min.js build/tabris/boot.js'
}
}
}); | Include boot.js in tabris module
Including the boot.js and boot.min.js in the tabris module allows
the build to automatically include the correct boot.js version in
the built app.
Change-Id: Idea6dca9b1ae<I>a<I>defee<I>b5e<I>bd1c8bcb9 | eclipsesource_tabris-js | train | js |
55235ecf080293e0858ef0a59f38bab57e8a0396 | diff --git a/icon_font_to_png/icon_font_downloader.py b/icon_font_to_png/icon_font_downloader.py
index <HASH>..<HASH> 100644
--- a/icon_font_to_png/icon_font_downloader.py
+++ b/icon_font_to_png/icon_font_downloader.py
@@ -102,10 +102,10 @@ class OcticonsDownloader(IconFontDownloader):
Project page:
https://octicons.github.com/
"""
- css_url = ('https://raw.githubusercontent.com/github/'
- 'octicons/master/octicons/octicons.css')
- ttf_url = ('https://raw.githubusercontent.com/github/'
- 'octicons/master/octicons/octicons.ttf')
+ css_url = ('https://raw.githubusercontent.com/primer/'
+ 'octicons/master/build/font/octicons.css')
+ ttf_url = ('https://raw.githubusercontent.com/primer/'
+ 'octicons/master/build/font/octicons.ttf')
def get_latest_version_number(self):
return self._get_latest_tag_from_github( | Octicons changed their GitHub owner | Pythonity_icon-font-to-png | train | py |
c8be6cc65124773c28c83d3881e468e2c0ddd137 | diff --git a/aeron-archiver/src/test/java/io/aeron/archiver/ReplaySessionTest.java b/aeron-archiver/src/test/java/io/aeron/archiver/ReplaySessionTest.java
index <HASH>..<HASH> 100644
--- a/aeron-archiver/src/test/java/io/aeron/archiver/ReplaySessionTest.java
+++ b/aeron-archiver/src/test/java/io/aeron/archiver/ReplaySessionTest.java
@@ -48,7 +48,7 @@ public class ReplaySessionTest
private static final int MTU_LENGTH = 4096;
private static final long TIME = 0;
private static final int REPLAY_SESSION_ID = 0;
- public static final int FRAME_LENGTH = 1024;
+ private static final int FRAME_LENGTH = 1024;
private File archiveDir;
private int messageCounter = 0; | [Java] constant should be private | real-logic_aeron | train | java |
53b7a4470bbda43570587e0f82c1edc245c6b5bf | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,4 @@
-from distutils.core import setup
+from setuptools import setup
import os | Favor setuptools over distutils for additional setup.py features | mschwager_fierce | train | py |
c6e0289d0d05847d25e2636e7ca6175e6b95cb4c | diff --git a/src/lib/CollectStore.js b/src/lib/CollectStore.js
index <HASH>..<HASH> 100644
--- a/src/lib/CollectStore.js
+++ b/src/lib/CollectStore.js
@@ -1,4 +1,5 @@
/* global cozy */
+import DateFns from 'date-fns'
import * as accounts from './accounts'
import * as konnectors from './konnectors'
import * as jobs from './jobs'
@@ -56,12 +57,12 @@ export default class CollectStore {
}
// Populate the store
- fetchInitialData (domain) {
+ fetchInitialData (domain, ignoreJobsAfterInSeconds) {
return Promise.all([
this.fetchAllAccounts(),
this.fetchInstalledKonnectors(),
this.fetchKonnectorResults(),
- this.fetchKonnectorUnfinishedJobs(domain)
+ this.fetchKonnectorUnfinishedJobs(domain, ignoreJobsAfterInSeconds)
])
}
@@ -267,8 +268,9 @@ export default class CollectStore {
})
}
- fetchKonnectorUnfinishedJobs (domain) {
- return jobs.findQueuedOrRunning(cozy.client)
+ fetchKonnectorUnfinishedJobs (domain, ignoreAfterInSeconds) {
+ const limitDate = DateFns.subSeconds(new Date(), ignoreAfterInSeconds)
+ return jobs.findQueuedOrRunning(cozy.client, limitDate)
.then(jobs => {
jobs.forEach(job => {
this.updateUnfinishedJob(job) | feat: use limit date for jobs in CollectStore ✨ | cozy_cozy-home | train | js |
38b908a497b1c15a7cb3e4fa5f2f5ac967a4fdd0 | diff --git a/config/module.config.php b/config/module.config.php
index <HASH>..<HASH> 100644
--- a/config/module.config.php
+++ b/config/module.config.php
@@ -10,6 +10,7 @@ $config = array(
'product' => 'Catalog\Controller\ProductController',
'category' => 'Catalog\Controller\CategoryController',
'catalogcart' => 'Catalog\Controller\CartController',
+ 'checkout' => 'Catalog\Controller\CheckoutController',
'catalogmanager' => 'Catalog\Controller\CatalogManagerController',
'manage-category' => 'Catalog\Controller\ManageCategoryController',
diff --git a/config/module.config.routes.php b/config/module.config.routes.php
index <HASH>..<HASH> 100644
--- a/config/module.config.routes.php
+++ b/config/module.config.routes.php
@@ -91,6 +91,17 @@ return array(
),
),
),
+ 'checkout' => array(
+ 'type' => 'Literal',
+ 'priority' => 1000,
+ 'options' => array(
+ 'route' => '/checkout',
+ 'defaults' => array(
+ 'controller' => 'checkout',
+ 'action' => 'index',
+ ),
+ ),
+ ),
'catalogmanager' => array(
'type' => 'Segment',
'priority' => 1000, | fix image paths in cart css | speckcommerce_SpeckCatalog | train | php,php |
aebc3dbbd7f4f5fbd39827ce61b9b577f31f5989 | diff --git a/lxd/storage/quota/projectquota.go b/lxd/storage/quota/projectquota.go
index <HASH>..<HASH> 100644
--- a/lxd/storage/quota/projectquota.go
+++ b/lxd/storage/quota/projectquota.go
@@ -22,6 +22,7 @@ import (
#include <fcntl.h>
#include <stdint.h>
#include <stdlib.h>
+#include <unistd.h>
#ifndef FS_XFLAG_PROJINHERIT
struct fsxattr {
@@ -120,6 +121,7 @@ int quota_set_path(char *path, uint32_t id) {
ret = ioctl(fd, FS_IOC_FSGETXATTR, &attr);
if (ret < 0) {
+ close(fd);
return -1;
}
@@ -128,9 +130,11 @@ int quota_set_path(char *path, uint32_t id) {
ret = ioctl(fd, FS_IOC_FSSETXATTR, &attr);
if (ret < 0) {
+ close(fd);
return -1;
}
+ close(fd);
return 0;
}
@@ -145,9 +149,11 @@ int32_t quota_get_path(char *path) {
ret = ioctl(fd, FS_IOC_FSGETXATTR, &attr);
if (ret < 0) {
+ close(fd);
return -1;
}
+ close(fd);
return attr.fsx_projid;
} | lxd/storage/quota/projectquota: Fixes leaking file handles in quota_set_path and quota_get_path | lxc_lxd | train | go |
daae67dfc47736818a55aa9c67fa83aa45d6979a | diff --git a/lib/has_face/validator.rb b/lib/has_face/validator.rb
index <HASH>..<HASH> 100644
--- a/lib/has_face/validator.rb
+++ b/lib/has_face/validator.rb
@@ -33,7 +33,7 @@ module HasFace
tags = response.try(:[], 'photos').try(:first).try(:[], 'tags')
record.errors.add(attr_name, :no_face) if tags.blank?
- rescue RestClient::Exception => error
+ rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT, RestClient::Exception => error
return handle_request_error(error)
end
diff --git a/lib/has_face/version.rb b/lib/has_face/version.rb
index <HASH>..<HASH> 100644
--- a/lib/has_face/version.rb
+++ b/lib/has_face/version.rb
@@ -1,3 +1,3 @@
module HasFace
- VERSION = "0.0.2"
+ VERSION = "0.0.3"
end | Catch more connection errors bump to <I> | mariovisic_has_face | train | rb,rb |
e18fb54d657e6f955eca3260eed354fd23992e6f | diff --git a/code/pages/MediaPage.php b/code/pages/MediaPage.php
index <HASH>..<HASH> 100644
--- a/code/pages/MediaPage.php
+++ b/code/pages/MediaPage.php
@@ -363,8 +363,8 @@ class MediaPage extends SiteTree {
public function Link($action = null) {
$parent = $this->getParent();
- if (!$parent) {
- return '';
+ if(!$parent) {
+ return null;
}
$date = ($parent->URLFormatting !== '-') ? $this->dbObject('Date')->Format($parent->URLFormatting) : '';
$link = $parent->Link() . "{$date}{$this->URLSegment}/";
@@ -381,8 +381,8 @@ class MediaPage extends SiteTree {
public function AbsoluteLink($action = null) {
$parent = $this->getParent();
- if (!$parent) {
- return '';
+ if(!$parent) {
+ return null;
}
$date = ($parent->URLFormatting !== '-') ? $this->dbObject('Date')->Format($parent->URLFormatting) : '';
$link = $parent->AbsoluteLink() . "{$date}{$this->URLSegment}/"; | Updating some minor class definitions. | nglasl_silverstripe-mediawesome | train | php |
1abcbbfac6e9b5ec94cff99bbb6488027c792b63 | diff --git a/library/CM/FormField/GeoPoint.php b/library/CM/FormField/GeoPoint.php
index <HASH>..<HASH> 100755
--- a/library/CM/FormField/GeoPoint.php
+++ b/library/CM/FormField/GeoPoint.php
@@ -32,9 +32,11 @@ class CM_FormField_GeoPoint extends CM_FormField_Abstract {
public function prepare(array $params) {
/** @var CM_Geo_Point $value */
$value = $this->getValue();
+ $latitude = $value ? $value->getLatitude() : null;
+ $longitude = $value ? $value->getLongitude() : null;
- $this->setTplParam('latitude', $value->getLatitude());
- $this->setTplParam('longitude', $value->getLongitude());
+ $this->setTplParam('latitude', $latitude);
+ $this->setTplParam('longitude', $longitude);
}
public function isEmpty($userInput) { | Make sure geopoint works with empty value | cargomedia_cm | train | php |
861c6b1d053ae99b6fd6f747f4ea5b77d57895da | diff --git a/build_config.php b/build_config.php
index <HASH>..<HASH> 100644
--- a/build_config.php
+++ b/build_config.php
@@ -2,7 +2,7 @@
$buildConfig = array (
'major' => 2,
'minor' => 9,
- 'build' => 55,
+ 'build' => 56,
'shopgate_library_path' => '',
'plugin_name' => 'library',
'display_name' => 'Shopgate Library 2.9.x',
diff --git a/classes/core.php b/classes/core.php
index <HASH>..<HASH> 100644
--- a/classes/core.php
+++ b/classes/core.php
@@ -24,7 +24,7 @@
###################################################################################
# define constants
###################################################################################
-define("SHOPGATE_LIBRARY_VERSION", "2.9.55");
+define("SHOPGATE_LIBRARY_VERSION", "2.9.56");
define('SHOPGATE_LIBRARY_ENCODING' , 'UTF-8');
define('SHOPGATE_BASE_DIR', realpath(dirname(__FILE__).'/../')); | Increased Shopgate Library <I>.x to version <I>. | shopgate_cart-integration-sdk | train | php,php |
1243a202c9943075f4c7bfca417926a0915e0585 | diff --git a/backend/scrapers/classes/parsers/ellucianBaseParser.js b/backend/scrapers/classes/parsers/ellucianBaseParser.js
index <HASH>..<HASH> 100644
--- a/backend/scrapers/classes/parsers/ellucianBaseParser.js
+++ b/backend/scrapers/classes/parsers/ellucianBaseParser.js
@@ -1,15 +1,13 @@
/*
- * This file is part of Search NEU and licensed under AGPL3.
- * See the license file in the root folder for details.
+ * This file is part of Search NEU and licensed under AGPL3.
+ * See the license file in the root folder for details.
*/
-
+
import URI from 'urijs';
import macros from '../../../macros';
import BaseParser from './baseParser';
class EllucianBaseParser extends BaseParser.BaseParser {
-
-
constructor() {
super();
this.requiredInBody = ['Ellucian', '<LINK REL="stylesheet" HREF="/css/web_defaultapp.css" TYPE="text/css">'];
@@ -196,7 +194,6 @@ class EllucianBaseParser extends BaseParser.BaseParser {
macros.error('Given url does not contain a split from', url);
return null;
}
-
} | Fixed eslint issues in ellucian base parser | ryanhugh_searchneu | train | js |
b3a5fd6bb485ee9820db54155dc122fc5a615fe6 | diff --git a/lib/genevalidator/validation_maker_qi.rb b/lib/genevalidator/validation_maker_qi.rb
index <HASH>..<HASH> 100644
--- a/lib/genevalidator/validation_maker_qi.rb
+++ b/lib/genevalidator/validation_maker_qi.rb
@@ -25,8 +25,9 @@ module GeneValidator
end
def explain
- "#{@splice_sites}% of splice sites are confirmed by EST/mRNA-seq" \
- " alignment and #{@exons}% of exons match an EST/mRNA-seq alignment."
+ "#{@exons}% of exons match an EST/mRNA-seq alignment and" \
+ " #{@splice_sites}% of splice sites are confirmed by EST/mRNA-seq" \
+ " alignment."
end
def conclude | reverse the explanation to fit the default print | wurmlab_genevalidator | train | rb |
3d9310055f364cf3fa97f663287c596920d6e7e5 | diff --git a/lib/git/objects/util.py b/lib/git/objects/util.py
index <HASH>..<HASH> 100644
--- a/lib/git/objects/util.py
+++ b/lib/git/objects/util.py
@@ -60,7 +60,7 @@ def get_user_id():
""":return: string identifying the currently active system user as name@node
:note: user can be set with the 'USER' environment variable, usually set on windows"""
ukn = 'UNKNOWN'
- username = os.environ.get('USER', ukn)
+ username = os.environ.get('USER', os.environ.get('USERNAME', ukn))
if username == ukn and hasattr(os, 'getlogin'):
username = os.getlogin()
# END get username from login | util.get_user_id(): Will try a windows environment variable as well, the method now yields good results on all tested platforms | gitpython-developers_GitPython | train | py |
0e7deddf7c300599a22df783261cd90d165abf4d | diff --git a/rw/routing.py b/rw/routing.py
index <HASH>..<HASH> 100644
--- a/rw/routing.py
+++ b/rw/routing.py
@@ -20,7 +20,7 @@ from tornado import stack_context
_rule_re = re.compile(r'''
(?P<static>[^<]*) # static rule data
<
- (?P<variable>[a-zA-Z][a-zA-Z0-9_]*) # variable name
+ (?P<variable>[a-zA-Z_][a-zA-Z0-9_]*) # variable name
(?:
\: # variable delimiter
(?P<converter>[a-zA-Z_][a-zA-Z0-9_]*) # converter name | allow _ as first char in var names | FlorianLudwig_rueckenwind | train | py |
36cc0a245eb6b3a2f7d5c1d72cac7a5a073e314b | diff --git a/lib/twittbot/botpart.rb b/lib/twittbot/botpart.rb
index <HASH>..<HASH> 100644
--- a/lib/twittbot/botpart.rb
+++ b/lib/twittbot/botpart.rb
@@ -23,6 +23,7 @@ module Twittbot
# * :retweet
# * :favorite
# * :friend_list
+ # * :direct_message (i.e. not command DMs, see {cmd} for that)
def on(name, *args, &block)
$bot[:callbacks][name] ||= {
args: args,
@@ -66,5 +67,24 @@ module Twittbot
$bot[:client]
end
alias bot client
+
+ # Defines a new direct message command.
+ # @param name [Symbol] The name of the command. Can only contain alphanumerical characters.
+ # The recommended maximum length is 4 characters.
+ # @param options [Hash] A customizable set of options.
+ # @option options [Boolean] :admin (true) Require admin status for this command.
+ def cmd(name, options = {}, &block)
+ raise "Command already exists: #{name}" if $bot[:commands].include? name
+ raise "Command name does not contain only alphanumerical characters" unless name.to_s.match /\A[A-Za-z0-9]+\z/
+
+ opts = {
+ admin: true
+ }.merge(options)
+
+ $bot[:commands][name] ||= {
+ admin: opts[:admin],
+ block: block
+ }
+ end
end
end
\ No newline at end of file | added new botpart method for commands via DMs | nilsding_twittbot | train | rb |
10aeae681f18c72aa6f0d2b232123676f70127a8 | diff --git a/grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/BinaryGrailsPlugin.java b/grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/BinaryGrailsPlugin.java
index <HASH>..<HASH> 100644
--- a/grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/BinaryGrailsPlugin.java
+++ b/grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/BinaryGrailsPlugin.java
@@ -257,6 +257,14 @@ public class BinaryGrailsPlugin extends DefaultGrailsPlugin {
* @return The view class which is a subclass of GroovyPage
*/
public Class resolveView(String viewName) {
+
+ // this is a workaround for GRAILS-9234; in that scenario the viewName will be
+ // "/WEB-INF/grails-app/views/plugins/plugin9234-0.1/junk/_book.gsp" with the
+ // extra "/plugins/plugin9234-0.1". I'm not sure if that's needed elsewhere, so
+ // removing it here for the lookup
+ String extraPath = "/plugins/" + getName() + '-' + getVersion() + '/';
+ viewName = viewName.replace(extraPath, "/");
+
return precompiledViewMap.get(viewName);
}
} | GRAILS-<I> removed extra "/plugins/pluginname-pluginversion/" string that was keeping templates from plugins from resolving | grails_grails-core | train | java |
bfdb0d15155f62d5a4372ed60e35b104dc93cce0 | diff --git a/code/libraries/koowa/filter/json.php b/code/libraries/koowa/filter/json.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/filter/json.php
+++ b/code/libraries/koowa/filter/json.php
@@ -55,7 +55,7 @@ class KFilterJson extends KFilterAbstract
$result = null;
if(is_a($value, 'KConfig')) {
- $value = $value->toArray();
+ $value = (string)$value;
}
if(is_string($value)) { | Force config object to string to render it as json | joomlatools_joomlatools-framework | train | php |
0951e75c859e05508b0f2b2306acf963a863d5f9 | diff --git a/bridge/slack/slack.go b/bridge/slack/slack.go
index <HASH>..<HASH> 100644
--- a/bridge/slack/slack.go
+++ b/bridge/slack/slack.go
@@ -498,7 +498,8 @@ func (b *Bslack) prepareMessageOptions(msg *config.Message) []slack.MsgOption {
var attachments []slack.Attachment
// add a callback ID so we can see we created it
- attachments = append(attachments, slack.Attachment{CallbackID: "matterbridge_" + b.uuid})
+ const zeroWidthSpace = "\u200b"
+ attachments = append(attachments, slack.Attachment{CallbackID: "matterbridge_" + b.uuid, Fallback: zeroWidthSpace})
// add file attachments
attachments = append(attachments, b.createAttach(msg.Extra)...)
// add slack attachments (from another slack bridge) | Fix #<I>: messages sent to Slack being synced back (#<I>)
This is a regression from <URL> | 42wim_matterbridge | train | go |
96c06c5eb668b55a277487426fb12762b08e10f1 | diff --git a/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/event/EventLogger.java b/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/event/EventLogger.java
index <HASH>..<HASH> 100644
--- a/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/event/EventLogger.java
+++ b/aeron-driver/src/main/java/uk/co/real_logic/aeron/driver/event/EventLogger.java
@@ -158,10 +158,7 @@ public class EventLogger
final MutableDirectBuffer encodedBuffer = ENCODING_BUFFER.get();
final int encodedLength = EventEncoder.encode(encodedBuffer, ex);
- while (!ringBuffer.write(EXCEPTION.id(), encodedBuffer, 0, encodedLength))
- {
- Thread.yield();
- }
+ ringBuffer.write(EXCEPTION.id(), encodedBuffer, 0, encodedLength);
}
else
{ | [Java] Don't keep retrying to log exceptions when the buffer is full. | real-logic_aeron | train | java |
c49e37870671676933bb275ede8d5a58d7ce1bf4 | diff --git a/lib/Github/HttpClient/Plugin/PathPrepend.php b/lib/Github/HttpClient/Plugin/PathPrepend.php
index <HASH>..<HASH> 100644
--- a/lib/Github/HttpClient/Plugin/PathPrepend.php
+++ b/lib/Github/HttpClient/Plugin/PathPrepend.php
@@ -28,7 +28,9 @@ class PathPrepend implements Plugin
public function handleRequest(RequestInterface $request, callable $next, callable $first)
{
$currentPath = $request->getUri()->getPath();
- $uri = $request->getUri()->withPath($this->path.$currentPath);
+ if (strpos($currentPath, $this->path) !== 0) {
+ $uri = $request->getUri()->withPath($this->path.$currentPath);
+ }
$request = $request->withUri($uri); | Do not prepend api/vX/ to the path if it already starts that way, e.g. pagination next URLs | KnpLabs_php-github-api | train | php |
7fb94920904d422a0dc06b77e45ac1ed9f037750 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -22,6 +22,13 @@ function compile(cmdLine, options) {
return new rsvp.Promise(function(resolve, reject) {
exec(cmdLine, options, function(err, stdout, stderr) {
if (err) {
+ // Provide a robust error message in case of failure.
+ // compass sends errors to sdtout, so it's important to include that
+ err.message = "[broccoli-compass] failed while executing compass command line\n" +
+ "[broccoli-compass] Working directory:\n" + options.cwd + "\n" +
+ "[broccoli-compass] Executed:\n" + cmdLine + "\n" +
+ "[broccoli-compass] stdout:\n" + stdout + "\n" +
+ "[broccoli-compass] stderr:\n" + stderr + "\n";
reject(err);
}
resolve();
@@ -152,7 +159,7 @@ CompassCompiler.prototype.updateCache = function (srcDir, destDir) {
if (options.ignoreErrors === false) {
throw err;
} else {
- console.log('[broccoli-compass] Error: ', msg + '\narguments: `' + cmdLine + '`');
+ console.log(msg);
}
});
}; | Useful error messages from compass are emitted on stdout. This commit augments the error messasge with the stdout output as well as the working directory and the compass command line executed. | g13013_broccoli-compass | train | js |
c1f90f6baa06e3b12dfaec21b1fd9cef73202f95 | diff --git a/src/test/grails/util/GrailsUtilTests.java b/src/test/grails/util/GrailsUtilTests.java
index <HASH>..<HASH> 100644
--- a/src/test/grails/util/GrailsUtilTests.java
+++ b/src/test/grails/util/GrailsUtilTests.java
@@ -53,7 +53,7 @@ public class GrailsUtilTests extends TestCase {
}
public void testGrailsVersion() {
- assertEquals("1.2-M4", GrailsUtil.getGrailsVersion());
+ assertEquals("1.2-SNAPSHOT", GrailsUtil.getGrailsVersion());
}
protected void tearDown() throws Exception { | Fixed test failure related to version change. | grails_grails-core | train | java |
170a713519b90da2525c1522ae7ee8fa139bca0a | diff --git a/blueflood-http/src/test/java/com/rackspacecloud/blueflood/inputs/handlers/TestIndexHandler.java b/blueflood-http/src/test/java/com/rackspacecloud/blueflood/inputs/handlers/TestIndexHandler.java
index <HASH>..<HASH> 100644
--- a/blueflood-http/src/test/java/com/rackspacecloud/blueflood/inputs/handlers/TestIndexHandler.java
+++ b/blueflood-http/src/test/java/com/rackspacecloud/blueflood/inputs/handlers/TestIndexHandler.java
@@ -18,6 +18,7 @@ public class TestIndexHandler {
String searchResultsJson = HttpMetricsIndexHandler.getSerializedJSON(results);
Assert.assertFalse("[]".equals(searchResultsJson));
+ Assert.assertTrue(searchResultsJson.contains("unit"));
}
@Test | Adding a check to see if units are indexed when they are ought to be | rackerlabs_blueflood | train | java |
2da24b38a71f36b8f38e7738431d2291efa77d6c | diff --git a/dvc/system.py b/dvc/system.py
index <HASH>..<HASH> 100644
--- a/dvc/system.py
+++ b/dvc/system.py
@@ -127,6 +127,11 @@ class System(object):
from ctypes import c_void_p, c_wchar_p, Structure, WinError, POINTER
from ctypes.wintypes import DWORD, HANDLE, BOOL
+ # NOTE: use this flag to open symlink itself and not the target
+ # See https://docs.microsoft.com/en-us/windows/desktop/api/
+ # fileapi/nf-fileapi-createfilew#symbolic-link-behavior
+ FILE_FLAG_OPEN_REPARSE_POINT = 0x00200000
+
FILE_FLAG_BACKUP_SEMANTICS = 0x02000000
FILE_SHARE_READ = 0x00000001
OPEN_EXISTING = 3
@@ -147,7 +152,7 @@ class System(object):
("nFileIndexHigh", DWORD),
("nFileIndexLow", DWORD)]
- flags = FILE_FLAG_BACKUP_SEMANTICS
+ flags = FILE_FLAG_BACKUP_SEMANTICS & FILE_FLAG_OPEN_REPARSE_POINT
func = ctypes.windll.kernel32.CreateFileW
func.argtypes = [c_wchar_p, | windows: don't follow symlink | iterative_dvc | train | py |
bc01dc54fe356569210c43141f0b74390520cfb3 | diff --git a/src/RangeBase.php b/src/RangeBase.php
index <HASH>..<HASH> 100644
--- a/src/RangeBase.php
+++ b/src/RangeBase.php
@@ -10,8 +10,10 @@ abstract class RangeBase
/** @var BlockBase */
protected $block;
+ /** @return IPv4Address|IPv6Address */
abstract public function getAddress();
+ /** @return IPv4Block|IPv6Block */
abstract public function getBlock();
public function __toString(): string
@@ -27,6 +29,6 @@ abstract class RangeBase
throw new \ErrorException("unexpected error returned from FromBinary() constructor");
}
- return sprintf('%s%s', $result->unwrap(), $this->block);
+ return sprintf('%s%s', $result->unwrap(), (string) $this->block);
}
} | Fix psalm errors added in latest version | dxw_cidr | train | php |
149d203b0ab21c5c1b34b108dcaaf1417f4bf513 | diff --git a/logging/logging.go b/logging/logging.go
index <HASH>..<HASH> 100644
--- a/logging/logging.go
+++ b/logging/logging.go
@@ -82,11 +82,11 @@ func (logger *logging) SetName(name string) {
logger.Name = name
}
-func (logger *logging) GetLevel() int {
- return int(logger.Level)
+func (logger *logging) GetLevel() Level {
+ return logger.Level
}
-func (logger *logging) SetLevel(level int) {
+func (logger *logging) SetLevel(level Level) {
logger.Level = Level(level)
} | fix missing changes from int to Level | ccding_go-logging | train | go |
3a4f09276d48b0217259a66dc93d0f05395c8e4a | diff --git a/qtmodern/windows.py b/qtmodern/windows.py
index <HASH>..<HASH> 100644
--- a/qtmodern/windows.py
+++ b/qtmodern/windows.py
@@ -146,8 +146,10 @@ class ModernWindow(QWidget):
def closeEvent(self, event):
if not self._w:
- return True
- event.setAccepted(self._w.close())
+ event.accept()
+ else:
+ self._w.close()
+ event.setAccepted(self._w.isHidden())
def setWindowTitle(self, title):
""" Set window title. | Setting the ModernWindow to accept closeEvent based on child window | gmarull_qtmodern | train | py |
0d8fb82a3b80bfa2719debeaee1d7aa5c11126e0 | diff --git a/spec/eo_time_spec.rb b/spec/eo_time_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/eo_time_spec.rb
+++ b/spec/eo_time_spec.rb
@@ -60,13 +60,10 @@ describe EtOrbi::EoTime do
t = Time.local(2007, 11, 1, 15, 25, 0)
ot = EtOrbi::EoTime.new(t, 'America/Los_Angeles')
-p t
-p t.to_i
expect(ot.seconds).to eq(t.to_i)
expect(ot.seconds.to_i).to eq(1193912700)
expect(ot.zone.name).to eq('America/Los_Angeles')
-# expect(ot.iso8601).to eq('xxx')
end
end | Remove debug output from eo_time_spec.rb | floraison_et-orbi | train | rb |
56f2c6a3b238d4e0ab8643e7cb68650fc875159c | diff --git a/lib/forms/AdminForm.js b/lib/forms/AdminForm.js
index <HASH>..<HASH> 100644
--- a/lib/forms/AdminForm.js
+++ b/lib/forms/AdminForm.js
@@ -29,7 +29,7 @@ function AdminForm() {
}
AdminForm.prototype.init = function (options, Model, instance, data) {
this.model = Model;
- this.exclude = _.extend(FORM_EXCLUDE_FIELDS, options.exclude);
+ this.exclude = FORM_EXCLUDE_FIELDS.concat(options.exclude || []);
this.instance = instance || new Model();
this.data = data;
this.fields = null; | don't override exclude fields | node4good_formage | train | js |
da1e367f4abac85d929def8483301d146b02c57a | diff --git a/MAVProxy/tools/MAVExplorer.py b/MAVProxy/tools/MAVExplorer.py
index <HASH>..<HASH> 100755
--- a/MAVProxy/tools/MAVExplorer.py
+++ b/MAVProxy/tools/MAVExplorer.py
@@ -569,6 +569,7 @@ subsystems = {
26 : "FAILSAFE_SENSORS",
27 : "FAILSAFE_LEAK",
28 : "PILOT_INPUT",
+ 29 : "FAILSAFE_VIBE",
}
error_codes = { # not used yet | MAVExplorer: add FAILSAFE_VIBE to ardupilot subsystems list | ArduPilot_MAVProxy | train | py |
22c8e90d3afe1ba8003c000bc2f0c2ae7b68b44a | diff --git a/face/geomajas-face-gwt/client/src/main/java/org/geomajas/gwt/client/gfx/painter/VectorTilePainter.java b/face/geomajas-face-gwt/client/src/main/java/org/geomajas/gwt/client/gfx/painter/VectorTilePainter.java
index <HASH>..<HASH> 100644
--- a/face/geomajas-face-gwt/client/src/main/java/org/geomajas/gwt/client/gfx/painter/VectorTilePainter.java
+++ b/face/geomajas-face-gwt/client/src/main/java/org/geomajas/gwt/client/gfx/painter/VectorTilePainter.java
@@ -88,7 +88,8 @@ public class VectorTilePainter implements Painter {
}
private void drawImage(PaintableGroup group, VectorTile tile, ContentHolder holder, MapContext context) {
- context.getRasterContext().drawImage(group, tile.getCode().toString(),
+ context.getRasterContext().drawGroup(group, holder);
+ context.getRasterContext().drawImage(holder, tile.getCode().toString(),
holder.getContent(), getPanBounds(tile), OPAQUE_PICTURE_STYLE);
} | GWT-<I>: tiles of previous zoom level were not correctly deleted. The content holder group was deleted but it was not drawn in the first place. | geomajas_geomajas-project-client-gwt2 | train | java |
9c1936507eaf9e9310c4748739228c23dfe86668 | diff --git a/ext/readline_line_buffer/extconf.rb b/ext/readline_line_buffer/extconf.rb
index <HASH>..<HASH> 100644
--- a/ext/readline_line_buffer/extconf.rb
+++ b/ext/readline_line_buffer/extconf.rb
@@ -9,6 +9,7 @@ end
if RUBY_VERSION < '1.9.2'
dir_config("readline")
+ have_library('readline')
if !have_header('readline/readline.h')
puts "Bond was built without readline. To use it with readline: gem install bond" +
" -- --with-readline-dir=/path/to/readline" | fix install for rubinius, closes gh-6 | cldwalker_bond | train | rb |
9f010a255bb04c7708c27ce13fe27d595348a29e | diff --git a/pyvista/core/objects.py b/pyvista/core/objects.py
index <HASH>..<HASH> 100644
--- a/pyvista/core/objects.py
+++ b/pyvista/core/objects.py
@@ -459,3 +459,12 @@ class Texture(vtk.vtkTexture):
def plot(self, *args, **kwargs):
"""Plot the texture as image data by itself"""
return self.to_image().plot(*args, **kwargs)
+
+
+ @property
+ def repeat(self):
+ return self.GetRepeat()
+
+ @repeat.setter
+ def repeat(self, flag):
+ self.SetRepeat(flag) | Add repeat setter to Texture class | vtkiorg_vtki | train | py |
1d3d872faee64a120dc0dd149d1f742a26f9fbe1 | diff --git a/src/main/java/cz/vutbr/web/css/NetworkProcessor.java b/src/main/java/cz/vutbr/web/css/NetworkProcessor.java
index <HASH>..<HASH> 100644
--- a/src/main/java/cz/vutbr/web/css/NetworkProcessor.java
+++ b/src/main/java/cz/vutbr/web/css/NetworkProcessor.java
@@ -21,7 +21,7 @@ public interface NetworkProcessor
*
* @param url Resource URL.
* @return input stream that reads resource contents
- * @throws IOException
+ * @throws IOException when the stream cannot be obtained for any reason
*/
public InputStream fetch(URL url) throws IOException; | Updated comment in NetworkProcessor | radkovo_jStyleParser | train | java |
de04f0c980b26d9e30bcf040c1a13c57a5580c82 | diff --git a/src/Core/DataSource/Filesystem/AttributeParser.php b/src/Core/DataSource/Filesystem/AttributeParser.php
index <HASH>..<HASH> 100644
--- a/src/Core/DataSource/Filesystem/AttributeParser.php
+++ b/src/Core/DataSource/Filesystem/AttributeParser.php
@@ -29,7 +29,7 @@ class AttributeParser
private $config;
private $type;
- private $pattern = '/^-{3}\s?(\w*)\r?\n(.*)\r?\n?-{3}\r?\n(.*)/isU';
+ private $pattern = '/^-{3}\r?\n(.*)\r?\n?-{3}\r?\n(.*)/isU';
/**
* Constructor.
@@ -95,7 +95,7 @@ class AttributeParser
$found = preg_match($this->pattern, $value, $matches);
if (1 === $found) {
- return $this->getAttributesFromString($matches[2]);
+ return $this->getAttributesFromString($matches[1]);
}
return []; | Deleted unused parts of pattern. Related with bug #<I> | spress_spress | train | php |
9e1f942e3355f2a8df90c939251549711bc29737 | diff --git a/core/lib/generators/refinery/dummy/dummy_generator.rb b/core/lib/generators/refinery/dummy/dummy_generator.rb
index <HASH>..<HASH> 100644
--- a/core/lib/generators/refinery/dummy/dummy_generator.rb
+++ b/core/lib/generators/refinery/dummy/dummy_generator.rb
@@ -14,7 +14,7 @@ module Refinery
end
PASSTHROUGH_OPTIONS = [
- :skip_active_record, :skip_javascript, :database, :javascript, :quiet, :pretend, :force, :skip
+ :skip_active_record, :skip_javascript, :skip_action_cable, :database, :javascript, :quiet, :pretend, :force, :skip
]
def generate_test_dummy
@@ -22,6 +22,7 @@ module Refinery
opts[:database] = 'sqlite3' if opts[:database].blank?
opts[:force] = true
opts[:skip_bundle] = true
+ opts[:skip_action_cable] = true
invoke Rails::Generators::AppGenerator, [ File.expand_path(dummy_path, destination_root) ], opts
end | We should skip actioncable while generating a dummy app
Actioncable isn't used in any case. For now I've decided to
not include this in a dummy app. Otherwise we'll get an
actioncable error. | refinery_refinerycms | train | rb |
f06d6990c46f01d3827083f41b1408a0b08b363e | diff --git a/test/client/docs_test.rb b/test/client/docs_test.rb
index <HASH>..<HASH> 100644
--- a/test/client/docs_test.rb
+++ b/test/client/docs_test.rb
@@ -13,7 +13,7 @@ describe Elastomer::Client::Docs do
:doc1 => {
:_source => { :enabled => true }, :_all => { :enabled => false },
:properties => {
- :title => { :type => "string", :analyzer => "standard" },
+ :title => { :type => "string", :analyzer => "standard", :term_vector => "with_positions_offsets" },
:author => { :type => "string", :index => "not_analyzed" }
}
}, | Mappings must be the same
If two document types in the same index share the same field name, then those
two fields must have the exact same mappings. Adjusting this test to conform to
this new reality. | github_elastomer-client | train | rb |
103bd7e5d984a63a57b359f5633c6d1f695cc5be | diff --git a/isso/tests/test_comments.py b/isso/tests/test_comments.py
index <HASH>..<HASH> 100644
--- a/isso/tests/test_comments.py
+++ b/isso/tests/test_comments.py
@@ -472,6 +472,17 @@ class TestComments(unittest.TestCase):
self.assertEqual(
rv["text"], '<p>This is <strong>mark</strong><em>down</em></p>')
+ def testTitleNull(self):
+ # Thread title set to `null` in API request
+ # Javascript `null` equals Python `None`
+ self.post('/new?uri=%2Fpath%2F',
+ data=json.dumps({'text': 'Spam', 'title': None}))
+
+ thread = self.app.db.threads.get(1)
+ # Expect server to attempt to parse uri to extract title
+ # utils.parse cannot parse fake /path/, so default="Untitled."
+ self.assertEqual(thread.get('title'), "Untitled.")
+
def testLatestOk(self):
# load some comments in a mix of posts
saved = [] | tests: comments: Test payload title=null | posativ_isso | train | py |
93fb8a8d2537aef444fc764002edc4913bbcdd21 | diff --git a/lib/thin_man/ajax_helper.rb b/lib/thin_man/ajax_helper.rb
index <HASH>..<HASH> 100644
--- a/lib/thin_man/ajax_helper.rb
+++ b/lib/thin_man/ajax_helper.rb
@@ -76,8 +76,8 @@ module ThinMan
data_attrs
end
- def dom_target(resource)
- '#' + dom_id(resource)
+ def dom_target(resource, label = nil)
+ '#' + dom_id(resource, label)
end
end
end
diff --git a/lib/thin_man/version.rb b/lib/thin_man/version.rb
index <HASH>..<HASH> 100644
--- a/lib/thin_man/version.rb
+++ b/lib/thin_man/version.rb
@@ -1,3 +1,3 @@
module ThinMan
- VERSION = "0.12.1"
+ VERSION = "0.12.2"
end | add label option to dom_target method | edraut_thin-man | train | rb,rb |
a522175211afc79cbff4c6436699df1f8517434c | diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go
index <HASH>..<HASH> 100644
--- a/test/integration/start_stop_delete_test.go
+++ b/test/integration/start_stop_delete_test.go
@@ -62,8 +62,6 @@ func TestStartStop(t *testing.T) {
}},
{"containerd", constants.DefaultKubernetesVersion, []string{
"--container-runtime=containerd",
- "--docker-opt",
- "containerd=/var/run/containerd/containerd.sock",
"--apiserver-port=8444",
}},
{"crio", "v1.15.7", []string{ | fix test containerd test for docker driver | kubernetes_minikube | train | go |
f5b80a59549b2b4103537efa8b3049cca8a42f3a | diff --git a/lib/fastlane/runner.rb b/lib/fastlane/runner.rb
index <HASH>..<HASH> 100644
--- a/lib/fastlane/runner.rb
+++ b/lib/fastlane/runner.rb
@@ -5,7 +5,7 @@ module Fastlane
key = key.to_sym
Helper.log.info "Driving the lane '#{key}'".green
Actions.lane_context[Actions::SharedValues::LANE_NAME] = key
- ENV["FASTLANE_LANE_NAME"] = key
+ ENV["FASTLANE_LANE_NAME"] = key.to_s
return_val = nil | Saved lane name as string environment variable | fastlane_fastlane | train | rb |
f5a47f220813b896f6046bd21bf43804f70f13a5 | diff --git a/src/AsyncTestCase.php b/src/AsyncTestCase.php
index <HASH>..<HASH> 100644
--- a/src/AsyncTestCase.php
+++ b/src/AsyncTestCase.php
@@ -24,6 +24,12 @@ abstract class AsyncTestCase extends PHPUnitTestCase
/** @var int Minimum runtime in milliseconds. */
private $minimumRuntime = 0;
+ /** @var string Temporary storage for actual test name. */
+ private $realTestName;
+
+ /** @var bool */
+ private $setUpInvoked = false;
+
final protected function runTest()
{
parent::setName('runAsyncTest'); | Also declare trait properties in AsyncTestCase
Stops undefined warnings in PhpStorm. | amphp_phpunit-util | train | php |
5658a9451fc6ae061af5a6231c370dc2944e7e63 | diff --git a/Branch-SDK/src/main/java/io/branch/referral/Branch.java b/Branch-SDK/src/main/java/io/branch/referral/Branch.java
index <HASH>..<HASH> 100644
--- a/Branch-SDK/src/main/java/io/branch/referral/Branch.java
+++ b/Branch-SDK/src/main/java/io/branch/referral/Branch.java
@@ -3079,7 +3079,7 @@ public class Branch implements BranchViewHandler.IBranchViewEvents, SystemObserv
Activity activity = branch.getCurrentActivity();
Intent intent = activity != null ? activity.getIntent() : null;
- if (activity != null && ActivityCompat.getReferrer(activity) != null) {
+ if (activity != null && intent != null && ActivityCompat.getReferrer(activity) != null) {
PrefHelper.getInstance(activity).setInitialReferrer(ActivityCompat.getReferrer(activity).toString());
} | [INTENG-<I>] Handled NPE
At some instance when getReferrer is being triggered incase if intent is null it lead to NPE, hence have added a null check. | BranchMetrics_android-branch-deep-linking | train | java |
bbdd9e7debeabcb2be7b4868ed487e8cc4770015 | diff --git a/lib/faml/compiler.rb b/lib/faml/compiler.rb
index <HASH>..<HASH> 100644
--- a/lib/faml/compiler.rb
+++ b/lib/faml/compiler.rb
@@ -47,8 +47,8 @@ module Faml
# Taken from the original haml code
re = %r{<(#{options[:preserve].map(&Regexp.method(:escape)).join('|')})([^>]*)>(.*?)(<\/\1>)}im
input.to_s.gsub(re) do |s|
- s =~ re # Can't rely on $1, etc. existing since Rails' SafeBuffer#gsub is incompatible
- "<#{$1}#{$2}>#{Helpers.preserve($3)}</#{$1}>"
+ m = s.match(re) # Can't rely on $1, etc. existing since Rails' SafeBuffer#gsub is incompatible
+ "<#{m[1]}#{m[2]}>#{Helpers.preserve(m[3])}</#{m[1]}>"
end
end | Avoid the use of Perl-style backrefs | eagletmt_faml | train | rb |
35e20167346c2b0bd7e8e126db2bf4d3671c174f | diff --git a/salt/modules/win_network.py b/salt/modules/win_network.py
index <HASH>..<HASH> 100644
--- a/salt/modules/win_network.py
+++ b/salt/modules/win_network.py
@@ -91,7 +91,7 @@ def traceroute(host):
cmd = 'tracert {0}'.format(salt.utils.network.sanitize_host(host))
lines = __salt__['cmd.run'](cmd).splitlines()
for line in lines:
- if not ' ' in line:
+ if ' ' not in line:
continue
if line.startswith('Trac'):
continue | Fix PEP8 E<I> - test for membership should be "not in" | saltstack_salt | train | py |
bad75233ae44f2e1bc6d84e635215928b3e53fd3 | diff --git a/spyder/widgets/figurebrowser.py b/spyder/widgets/figurebrowser.py
index <HASH>..<HASH> 100644
--- a/spyder/widgets/figurebrowser.py
+++ b/spyder/widgets/figurebrowser.py
@@ -128,13 +128,11 @@ class FigureBrowser(QWidget):
for widget in toolbar:
self.tools_layout.addWidget(widget)
self.tools_layout.addStretch()
- self.tools_layout.addWidget(self.options_button)
+ self.setup_options_button()
layout = create_plugin_layout(self.tools_layout, main_widget)
self.setLayout(layout)
- self.setup_options_button()
-
def setup_toolbar(self):
"""Setup the toolbar"""
savefig_btn = create_toolbutton(
@@ -219,6 +217,7 @@ class FigureBrowser(QWidget):
self.actions = [self.mute_inline_action, self.show_plot_outline_action]
def setup_options_button(self):
+ """Add the cog menu button to the toolbar."""
if not self.options_button:
self.options_button = create_toolbutton(
self, text=_('Options'), icon=ima.icon('tooloptions')) | Fix setup_options_button in setup and docstring | spyder-ide_spyder | train | py |
4dc6a54fcfaf593ab35f26486ca8e229f7a09415 | diff --git a/spec/json/jwe_spec.rb b/spec/json/jwe_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/json/jwe_spec.rb
+++ b/spec/json/jwe_spec.rb
@@ -54,9 +54,11 @@ describe JSON::JWE do
end
end
- context 'when plaintext given' do
- let(:plain_text) { 'Hello World' }
- let(:jwe) { JSON::JWE.new plain_text }
+ context 'when Hash given' do
+ let(:input) do
+ {foo: :bar}
+ end
+ let(:jwe) { JSON::JWE.new input }
context 'when alg=RSA1_5' do
let(:key) { public_key }
@@ -100,9 +102,8 @@ describe JSON::JWE do
end
context 'when jwt given' do
- let(:plain_text) { jwt.to_s }
- let(:jwt) { JSON::JWT.new(foo: :bar) }
- let(:jwe) { JSON::JWE.new jwt }
+ let(:input) { JSON::JWT.new(foo: :bar) }
+ let(:jwe) { JSON::JWE.new input }
context 'when alg=RSA-OAEP' do
let(:key) { public_key } | JWE#encypt! spec passes | nov_json-jwt | train | rb |
4fdb02f33c7d38535984c1dad7a58346b0a08c5b | diff --git a/views/js/uiForm.js b/views/js/uiForm.js
index <HASH>..<HASH> 100644
--- a/views/js/uiForm.js
+++ b/views/js/uiForm.js
@@ -34,7 +34,7 @@ define([
var self = this;
this.counter = 0;
this.initFormPattern = new RegExp(['search', 'authoring', 'Import', 'Export', 'IO', 'preview'].join('|'));
- this.initGenerisFormPattern = new RegExp(['add', 'edit', 'mode'].join('|'), 'i');
+ this.initGenerisFormPattern = new RegExp(['add', 'edit', 'mode', 'PropertiesAuthoring'].join('|'), 'i');
this.initTranslationFormPattern = /translate/;
this.initNav();
@@ -325,7 +325,6 @@ define([
return $wantedPanel;
}());
-
$.ajax({
type: "GET",
url: tabUrl,
@@ -369,7 +368,7 @@ define([
e.preventDefault();
property.add($("#id").val(), helpers._url('addClassProperty', 'PropertiesAuthoring', 'tao'));
});
-
+
$(".property-mode").off('click').on('click', function () {
var $btn = $(this),
mode = 'simple'; | Ensure uiForm js is included on PropertiesAuthoring | oat-sa_tao-core | train | js |
5720b145f473a6b38b97c1574b5dcf52a9beef11 | diff --git a/app/Tree.php b/app/Tree.php
index <HASH>..<HASH> 100644
--- a/app/Tree.php
+++ b/app/Tree.php
@@ -564,7 +564,6 @@ class Tree {
$tree->setPreference('SURNAME_TRADITION', 'paternal');
break;
}
- $tree->setPreference('THEME_DIR', 'webtrees');
$tree->setPreference('THUMBNAIL_WIDTH', '100');
$tree->setPreference('USE_RIN', '0');
$tree->setPreference('USE_SILHOUETTE', '1'); | New trees should take the site default theme | fisharebest_webtrees | train | php |
a50765ae7928a150075c13c904622092af7a8b3d | diff --git a/WiredPanels.js b/WiredPanels.js
index <HASH>..<HASH> 100644
--- a/WiredPanels.js
+++ b/WiredPanels.js
@@ -1,6 +1,5 @@
/* jslint node: true, esnext: true */
/* global document, window */
-
'use strict';
const colaLayout = require('webcola').Layout;
@@ -233,7 +232,7 @@ module.exports.prototype.deleteElements = function (trash) {
};
module.exports.prototype.handleKeyboard = function (event) {
- if (this.svg.parentNode.querySelector(':hover') == null || event.ctrlKey)
+ if (this.svg.parentNode.querySelector('svg:hover') == null || event.ctrlKey)
return;
event.stopPropagation();
event.preventDefault();
@@ -391,6 +390,7 @@ module.exports.prototype.syncPanel = function (panel) {
panel.rect.setAttribute('rx', this.config.panelCornerRadius);
panel.rect.setAttribute('ry', this.config.panelCornerRadius);
+ panel.panel = panel;
this.setHandlers('panels', panel.rect, panel);
panel.rect.onmouseover = colaLayout.mouseOver.bind(colaLayout, panel);
panel.rect.onmouseout = colaLayout.mouseOut.bind(colaLayout, panel); | Fixed mouse over detection in some browsers
Added panel back reference to top socket | Symatem_WiredPanels | train | js |
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.