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 |
|---|---|---|---|---|---|
3ca72eb7a3c380abf9ce88db40f1c23425208ed5 | diff --git a/mod/wiki/lib.php b/mod/wiki/lib.php
index <HASH>..<HASH> 100644
--- a/mod/wiki/lib.php
+++ b/mod/wiki/lib.php
@@ -438,7 +438,9 @@ function wiki_extend_navigation(navigation_node $navref, $course, $module, $cm)
return false;
}
- $gid = groups_get_activity_group($cm);
+ if (!$gid = groups_get_activity_group($cm)){
+ $gid = 0;
+ }
if (!$subwiki = wiki_get_subwiki_by_group($cm->instance, $gid, $userid)){
return null;
} else { | [MDL-<I>]
Fixing this problem. | moodle_moodle | train | php |
a6275ee1e827a9aa0ba860d48d7a9aed2e6165bf | diff --git a/rinoh/float.py b/rinoh/float.py
index <HASH>..<HASH> 100644
--- a/rinoh/float.py
+++ b/rinoh/float.py
@@ -55,6 +55,11 @@ class ImageBase(Flowable):
self.dpi = dpi
self.rotate = rotate
+ @property
+ def filename(self):
+ if isinstance(self.filename_or_file, str):
+ return self.filename_or_file
+
def initial_state(self, container):
return ImageState(self) | Image.filename: for use in selectors | brechtm_rinohtype | train | py |
cb768854933ad9b8afdeb4fb8da2feace72419a9 | diff --git a/src/server/pfs/cmds/cmds.go b/src/server/pfs/cmds/cmds.go
index <HASH>..<HASH> 100644
--- a/src/server/pfs/cmds/cmds.go
+++ b/src/server/pfs/cmds/cmds.go
@@ -804,6 +804,7 @@ func putFileHelper(client *client.APIClient, repo, commit, path, source string,
if source == "-" {
limiter.Acquire()
defer limiter.Release()
+ fmt.Println("Reading from STDIN:")
return putFile(os.Stdin)
}
// try parsing the filename as a url, if it is one do a PutFileURL | Print a message if you are putting file through STDIN | pachyderm_pachyderm | train | go |
f1e25c869beaa469ab244a325af33a6ec890609c | diff --git a/test/tabletmanager.py b/test/tabletmanager.py
index <HASH>..<HASH> 100755
--- a/test/tabletmanager.py
+++ b/test/tabletmanager.py
@@ -7,10 +7,6 @@ warnings.simplefilter("ignore")
import json
import logging
-import os
-import signal
-from subprocess import PIPE
-import threading
import time
import unittest
import urllib
@@ -21,7 +17,6 @@ import utils
import tablet
from mysql_flavor import mysql_flavor
from protocols_flavor import protocols_flavor
-from vtdb import dbexceptions
tablet_62344 = tablet.Tablet(62344)
tablet_62044 = tablet.Tablet(62044) | test: Remove unused imports from tabletmanager.py. | vitessio_vitess | train | py |
f418a0babdd4729b40cb86f953c9c4cd3b69cee6 | diff --git a/eventkit/models.py b/eventkit/models.py
index <HASH>..<HASH> 100644
--- a/eventkit/models.py
+++ b/eventkit/models.py
@@ -393,7 +393,7 @@ class AbstractEvent(PolymorphicMPTTModel, AbstractBaseModel):
# `starts` and `end_repeat` are exclusive and will not be included in
# the occurrences.
- if starts and end_repeat:
+ if starts:
missing = rruleset.between(starts, end_repeat)
return missing
return [] | Remove check for `end_repeat` existance as it should always be there. | ic-labs_django-icekit | train | py |
491e8a22c8e3a5041c2080266c043e9bc7cbc201 | diff --git a/lib/modules/crafity.Synchronizer.js b/lib/modules/crafity.Synchronizer.js
index <HASH>..<HASH> 100755
--- a/lib/modules/crafity.Synchronizer.js
+++ b/lib/modules/crafity.Synchronizer.js
@@ -88,15 +88,11 @@ function Synchronizer(finish) {
if (self.listeners("finished").length) {
onfinishCalled = true;
self.emit("finished", err);
- onfinishHandlers.forEach(function (onfinish) {
- onfinish.call(onfinish, err);
- });
}
} else {
try {
callback.apply(callback, arguments);
} catch (err) {
- if (finished) { return; }
finished = true;
lastError = err;
if (self.listeners("finished").length) {
@@ -118,7 +114,7 @@ function Synchronizer(finish) {
this.onfinish = function (finish) {
self.on("finished", finish);
-
+
if (lastError) {
finish(lastError, null);
} else if (finished && !handlerCount) { | Fixed an issue when the synchronizer finishes it stopped to early | Crafity_crafity-core | train | js |
7a9fc6dbd31be273176d034b787c90aeeac275b1 | diff --git a/internal/model/queue_test.go b/internal/model/queue_test.go
index <HASH>..<HASH> 100644
--- a/internal/model/queue_test.go
+++ b/internal/model/queue_test.go
@@ -191,7 +191,7 @@ func BenchmarkJobQueuePushPopDone10k(b *testing.B) {
for _, f := range files {
q.Push(f.Name)
}
- for range files {
+ for _ = range files {
n, _ := q.Pop()
q.Done(n)
} | Don't use Go <I> range syntax in queue_test.go, since the listed requirement is Go <I>. | syncthing_syncthing | train | go |
fbfdaa6923afd540b1e978e4e045d6a7c9794650 | diff --git a/lxd/firewall/drivers/drivers_xtables.go b/lxd/firewall/drivers/drivers_xtables.go
index <HASH>..<HASH> 100644
--- a/lxd/firewall/drivers/drivers_xtables.go
+++ b/lxd/firewall/drivers/drivers_xtables.go
@@ -418,7 +418,7 @@ func (d Xtables) InstanceClearProxyNAT(projectName string, instanceName string,
}
if len(errs) > 0 {
- return err
+ return fmt.Errorf("Failed to remove proxy NAT rules for %q: %v", deviceName, errs)
}
return nil | lxd/firewall/drivers/drivers/xtables: Improves proxy NAT rule removal errors | lxc_lxd | train | go |
ec4f45ffef452578fe6c2c34a8ae0688884f1c08 | diff --git a/great_expectations/data_context/data_context.py b/great_expectations/data_context/data_context.py
index <HASH>..<HASH> 100644
--- a/great_expectations/data_context/data_context.py
+++ b/great_expectations/data_context/data_context.py
@@ -682,6 +682,7 @@ class BaseDataContext(object):
raise ValueError(
"Unable to load datasource `%s` -- no configuration found or invalid configuration." % datasource_name
)
+ datasource_config = datasourceConfigSchema.load(datasource_config)
datasource = self._build_datasource_from_config(datasource_name, datasource_config)
self._datasources[datasource_name] = datasource
return datasource | Load datasource config before building datasource from config | great-expectations_great_expectations | train | py |
7cea8c37a0d8709d651407dc5c86a4a0091aa371 | diff --git a/lib/binding/collection.js b/lib/binding/collection.js
index <HASH>..<HASH> 100644
--- a/lib/binding/collection.js
+++ b/lib/binding/collection.js
@@ -19,6 +19,10 @@ function Collection() {
var removed = source.splice(idx, count);
this.length = source.length;
api.fire('changed', { removed: removed, removeIdx: idx });
+ },
+
+ get : function (idx) {
+ return source[idx];
}
};
diff --git a/lib/controls/itemsControl.js b/lib/controls/itemsControl.js
index <HASH>..<HASH> 100644
--- a/lib/controls/itemsControl.js
+++ b/lib/controls/itemsControl.js
@@ -55,8 +55,15 @@ function appendChildren(itemsControl) {
ensureCanAppendChildren(itemsControl);
var itemSource = itemsControl._itemSource;
- for (var i = 0; i < itemSource.length; ++i) {
- itemsControl._addItem(itemSource[i]);
+ var i;
+ if (typeof itemSource.get === 'function') {
+ for (i = 0; i < itemSource.length; ++i) {
+ itemsControl._addItem(itemSource.get(i));
+ }
+ } else {
+ for (i = 0; i < itemSource.length; ++i) {
+ itemsControl._addItem(itemSource[i]);
+ }
}
} | Dirty iteration over observable collection
Ideally it should be array like, but I don't want to kill garbage
collection | anvaka_vivasvg | train | js,js |
d6110f51d9cdc3811315963a1531c9e22203e575 | diff --git a/main/core/Manager/WorkspaceManager.php b/main/core/Manager/WorkspaceManager.php
index <HASH>..<HASH> 100644
--- a/main/core/Manager/WorkspaceManager.php
+++ b/main/core/Manager/WorkspaceManager.php
@@ -1487,6 +1487,15 @@ class WorkspaceManager
}
}
}
+
+ foreach ($copy->getChildren() as $child) {
+ foreach ($resourceNode->getChildren() as $sourceChild) {
+ if ($child->getName() === $sourceChild->getName()) {
+ $this->duplicateRights($sourceChild, $child, $workspaceRoles);
+ }
+ }
+ }
+
$this->om->flush();
} | [CoreBundle] Right handling for children in creation from model. (#<I>) | claroline_Distribution | train | php |
7a5d620bc747bcfb8133ee8cc07b898f1a4d2d45 | diff --git a/webpack.config.js b/webpack.config.js
index <HASH>..<HASH> 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -30,4 +30,7 @@ module.exports = {
}),
new ForkTsCheckerWebpackPlugin(),
],
-};
+ node: {
+ fs: 'empty'
+ }
+} | Do not try to include Node's fs module
This was caused by rdflib now `require`ing solid-auth-cli, which
Webpack then tried to bundle. Since that code path should never be
hit in production, we can safely exclude it from the bundle. | solid_solid-panes | train | js |
f6e9c564bfd2bc694187929608de45fcd261005c | diff --git a/lib/dredd_hooks/server.rb b/lib/dredd_hooks/server.rb
index <HASH>..<HASH> 100644
--- a/lib/dredd_hooks/server.rb
+++ b/lib/dredd_hooks/server.rb
@@ -49,10 +49,14 @@ module DreddHooks
transaction = events_handler.handle(event, transaction)
- response = {
- "uuid" => message['uuid'],
- "event" => event,
- "data" => transaction
+ response(message['uuid'], event, transaction)
+ end
+
+ def response(message_uuid, event, transaction)
+ {
+ uuid: message_uuid,
+ event: event,
+ data: transaction,
}.to_json
end | Minor refactor extract method Server#response | apiaryio_dredd-hooks-ruby | train | rb |
10b3a1b4e30edce6de583c44cb7d2185f33a8a1f | diff --git a/src/Saber.php b/src/Saber.php
index <HASH>..<HASH> 100644
--- a/src/Saber.php
+++ b/src/Saber.php
@@ -7,7 +7,6 @@
namespace Swlib;
-use Swlib\Http\BufferStream;
use Swlib\Http\ContentType;
use Swlib\Http\Exception\HttpExceptionMask;
use Swlib\Http\SwUploadFile;
@@ -19,6 +18,7 @@ use Swlib\Saber\ResponseMap;
use Swlib\Saber\WebSocket;
use Swlib\Util\DataParser;
use Swlib\Util\TypeDetector;
+use function Swlib\Http\stream_for;
class Saber
{
@@ -598,7 +598,7 @@ class Saber
} else {
$options['data'] = null;
}
- $buffer = $options['data'] ? new BufferStream((string)$options['data']) : null;
+ $buffer = $options['data'] ? stream_for((string)$options['data']) : null;
if (isset($buffer)) {
$request->withBody($buffer);
} | use stream_for instead of BufferStream | swlib_saber | train | php |
81c2ebaf6740a3a99fdc7b2fced140bb2069b91f | diff --git a/master/buildbot/steps/transfer.py b/master/buildbot/steps/transfer.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/steps/transfer.py
+++ b/master/buildbot/steps/transfer.py
@@ -95,6 +95,7 @@ class FileUpload(_TransferBuildStep, WorkerAPICompatMixin):
renderables = [
'masterdest',
'url',
+ 'urlText',
'workersrc',
] | FileUpload: make the urlText renderable
This change allows for making urlText to depend on properties of the
build. | buildbot_buildbot | train | py |
1c5c4320c0bcd7dc3d73bfa36f38349b08a8480f | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -271,7 +271,7 @@ module.exports = function(grunt) {
// http://twitter.github.com/bower/
grunt.registerTask('component', 'Build the FullCalendar component for the Bower package manager', [
- 'clean:build',
+ 'clean:component',
'submodules',
'uglify', // we want the minified JS in there
'copy:component',
@@ -306,11 +306,8 @@ module.exports = function(grunt) {
/* Clean Up Files
----------------------------------------------------------------------------------------------------*/
- config.clean.build = [
- 'build/out/*',
- 'build/component/*'
- ];
-
+ config.clean.build = 'build/out/*';
+ config.clean.component = 'build/component/*';
config.clean.dist = 'dist/*'; | when cleaning build files, don't clear component by default | fullcalendar_fullcalendar | train | js |
9c120a08f535bceea6ba3fe0f2dbf16a3ff0c6bc | diff --git a/src/User/User.php b/src/User/User.php
index <HASH>..<HASH> 100644
--- a/src/User/User.php
+++ b/src/User/User.php
@@ -540,6 +540,9 @@ class User extends \Hubzero\Database\Relational
// know what user is logged in
App::get('session')->set('user', App::get('user')->getInstance());
$this->guest = false;
+
+ $data = App::get('user')->getInstance()->toArray();
+ \Event::trigger('user.onUserLogin', array($data));
}
}
catch (Exception $e) | [feat] Adding login event trigger after JWT login | hubzero_framework | train | php |
08ec9da5dd34b89c28b8a75860c770271bf248e3 | diff --git a/src/components/LoginForm.js b/src/components/LoginForm.js
index <HASH>..<HASH> 100644
--- a/src/components/LoginForm.js
+++ b/src/components/LoginForm.js
@@ -41,7 +41,9 @@ class DefaultLoginForm extends React.Component {
var fields = null;
var socialProviders = null;
- if (data && data.form) {
+ if (err) {
+ fields = defaultFields;
+ } else if (data && data.form) {
fields = data.form.fields;
if (!this.props.hideSocial) {
data.accountStores.forEach((accountStore) => {
diff --git a/src/components/RegistrationForm.js b/src/components/RegistrationForm.js
index <HASH>..<HASH> 100644
--- a/src/components/RegistrationForm.js
+++ b/src/components/RegistrationForm.js
@@ -53,13 +53,13 @@ class DefaultRegistrationForm extends React.Component {
}
];
-
-
UserStore.getRegisterViewData((err, data) => {
var fields = null;
var socialProviders = null;
- if (data && data.form) {
+ if (err) {
+ fields = defaultFields;
+ } else if (data && data.form) {
fields = data.form.fields;
if (!this.props.hideSocial) {
data.accountStores.forEach((accountStore) => { | fix defaultFields fallback for the Login and Registration form | stormpath_stormpath-sdk-react | train | js,js |
add5b51dad27be3b53e280884177b038275ca580 | diff --git a/Lib/fontbakery/checkrunner.py b/Lib/fontbakery/checkrunner.py
index <HASH>..<HASH> 100644
--- a/Lib/fontbakery/checkrunner.py
+++ b/Lib/fontbakery/checkrunner.py
@@ -962,6 +962,21 @@ class Spec:
raise SetupError('Spec fails expected checks test:\n{}'.format(
'\n'.join(message)))
+ def is_numerical_id(checkid):
+ try:
+ int(checkid.split('/')[-1])
+ return True
+ except:
+ return False
+ numerical_check_ids = [c for c in registered_checks if is_numerical_id(c)]
+ if numerical_check_ids:
+ num = len(numerical_check_ids)
+ percentage = 100.0 * num / len(registered_checks)
+ print(f'\nThere still are {num} numerical check IDs. ({percentage:.2f}%)\n'
+ 'They should all be renamed to keyword-based IDs.\n'
+ 'See: https://github.com/googlefonts/fontbakery/issues/2238\n\n')
+ # assert(percentage == 0)
+
def resolve_alias(self, original_name):
name = original_name
seen = set() | computing how many numerical check IDs still remain to...
... be renamed into keyword-based IDs.
This will in the future become a hard-enforcement runtime self-test.
(issue #<I>) | googlefonts_fontbakery | train | py |
3b0bb535a30b958316df9549e3f308397555b4f2 | diff --git a/src/UserData/Extractor/ExtractorInterface.php b/src/UserData/Extractor/ExtractorInterface.php
index <HASH>..<HASH> 100644
--- a/src/UserData/Extractor/ExtractorInterface.php
+++ b/src/UserData/Extractor/ExtractorInterface.php
@@ -56,7 +56,7 @@ interface ExtractorInterface {
/**
* Get service id
*
- * @return string
+ * @return string String, like "google" or "facebook"
* @throws Exception
*/
public function getServiceId(); | Updated phpdoc for ExtractorInterface::getServiceId() | logical-and_php-oauth | train | php |
b490487bd97b796b9bc83b866c64530607114f14 | diff --git a/tests/test_ellipsoid.py b/tests/test_ellipsoid.py
index <HASH>..<HASH> 100644
--- a/tests/test_ellipsoid.py
+++ b/tests/test_ellipsoid.py
@@ -22,6 +22,7 @@ def test_sample():
for i in range(nsim):
R.append(mu.sample()[0])
R = np.array(R)
+ assert (all([mu.contains(_) for _ in R]))
# here I'm checking that all the points are uniformly distributed
# within each ellipsoid
@@ -60,7 +61,7 @@ def test_sample_q():
R.append(x)
break
R = np.array(R)
-
+ assert (all([mu.contains(_) for _ in R]))
# here I'm checking that all the points are uniformly distributed
# within each ellipsoid
for curc in [cen1, cen2]: | add additional ellipsoidal test | joshspeagle_dynesty | train | py |
a9129f33c27b475de703ebe3706c09ac769e7fd4 | diff --git a/lark/lexer.py b/lark/lexer.py
index <HASH>..<HASH> 100644
--- a/lark/lexer.py
+++ b/lark/lexer.py
@@ -157,12 +157,7 @@ class Token(str):
end_pos: int
def __new__(cls, type_, value, start_pos=None, line=None, column=None, end_line=None, end_column=None, end_pos=None):
- try:
- inst = super(Token, cls).__new__(cls, value)
- except UnicodeDecodeError:
- value = value.decode('latin1')
- inst = super(Token, cls).__new__(cls, value)
-
+ inst = super(Token, cls).__new__(cls, value)
inst.type = type_
inst.start_pos = start_pos
inst.value = value | Remove Py2-related unicode patch | lark-parser_lark | train | py |
0548ff7d5338efa6630d2961aaac557b7081bb3e | diff --git a/lib/action_kit_api/event.rb b/lib/action_kit_api/event.rb
index <HASH>..<HASH> 100644
--- a/lib/action_kit_api/event.rb
+++ b/lib/action_kit_api/event.rb
@@ -20,9 +20,6 @@ module ActionKitApi
@required_attrs = [:campaign_id, :creator_id]
@read_only_attrs = [:attendee_count, :host_is_confirmed, :is_full, :is_in_past, :is_open_for_signup, :status_summary]
- # Set us up some defaults
- args[:is_approved] ||= true
-
super
end
diff --git a/lib/action_kit_api/event_campaign.rb b/lib/action_kit_api/event_campaign.rb
index <HASH>..<HASH> 100644
--- a/lib/action_kit_api/event_campaign.rb
+++ b/lib/action_kit_api/event_campaign.rb
@@ -33,11 +33,6 @@ module ActionKitApi
(args[0]).merge!(:campaign_id => self.id)
event = ActionKitApi::Event.new(*args)
- event.save
-
- result = ActionKitApi.connection.call("EventSignup.create", {:event_id => event.id, :user_id => event.creator_id, :status => 'host'})
-
- event
end
# Uses public_search so is subject those limitations | Cleaned up event and event_campaign | Democracy-for-America_ActionKitApi | train | rb,rb |
5f25446d8f5fad8604d7c87bf4d0663d2fd6d134 | diff --git a/mode/rst/rst.js b/mode/rst/rst.js
index <HASH>..<HASH> 100644
--- a/mode/rst/rst.js
+++ b/mode/rst/rst.js
@@ -501,9 +501,9 @@ CodeMirror.defineMode('rst', function (config, options) {
rx_uri_protocol + rx_uri_domain + rx_uri_path
);
- var rx_strong = /^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*/;
- var rx_emphasis = /^\*[^\*\s](?:[^\*]*[^\*\s])?\*/;
- var rx_literal = /^``[^`\s](?:[^`]*[^`\s])``/;
+ var rx_strong = /^\*\*[^\*\s](?:[^\*]*[^\*\s])?\*\*(\s+|$)/;
+ var rx_emphasis = /^[^\*]\*[^\*\s](?:[^\*]*[^\*\s])?\*(\s+|$)/;
+ var rx_literal = /^``[^`\s](?:[^`]*[^`\s])``(\s+|$)/;
var rx_number = /^(?:[\d]+(?:[\.,]\d+)*)/;
var rx_positive = /^(?:\s\+[\d]+(?:[\.,]\d+)*)/; | [rst-mode] Fixed strong, emphasis & literal rST
rST does not allow mixing strong with simple emphasis, further it
requires the stars to have a preceding and trailing whitespaces. Same
for literal text; e.g.
**strong** is correct, but **strong* is not, or
*emphasis* is correct, but *emphasis** is not. | codemirror_CodeMirror | train | js |
193f05ceb1cdfb451f5494ecff05d7a1a54dd5cd | diff --git a/src/core/propertyTypes.js b/src/core/propertyTypes.js
index <HASH>..<HASH> 100644
--- a/src/core/propertyTypes.js
+++ b/src/core/propertyTypes.js
@@ -41,10 +41,9 @@ module.exports.registerPropertyType = registerPropertyType;
function arrayParse (value) {
if (Array.isArray(value)) { return value; }
- if (value === null || value.length === 0) { return []; }
- return value.split(',').map(function (str) {
- return str.trim();
- });
+ if (!value || typeof value !== 'string') { return []; }
+ return value.split(',').map(trim);
+ function trim (str) { return str.trim(); }
}
function arrayStringify (value) { | For you my friend? This one time. Next time cousin Borat pays a visit.. Borat Devops. | aframevr_aframe | train | js |
b6bd1f4d68c37d000dbaba47ffb48483d3513c6a | diff --git a/pandas/tseries/tests/test_timeseries.py b/pandas/tseries/tests/test_timeseries.py
index <HASH>..<HASH> 100644
--- a/pandas/tseries/tests/test_timeseries.py
+++ b/pandas/tseries/tests/test_timeseries.py
@@ -1014,13 +1014,13 @@ class TestTimeSeries(unittest.TestCase):
def test_constructor_int64_nocopy(self):
# #1624
- arr = np.arange(1000)
+ arr = np.arange(1000, dtype=np.int64)
index = DatetimeIndex(arr)
arr[50:100] = -1
self.assert_((index.asi8[50:100] == -1).all())
- arr = np.arange(1000)
+ arr = np.arange(1000, dtype=np.int64)
index = DatetimeIndex(arr, copy=True)
arr[50:100] = -1 | BUG: fix windows/<I>-bit builds | pandas-dev_pandas | train | py |
7f03276aa44157c3bc725d02e2a263f05e64d383 | diff --git a/lib/gdriveWrapper.js b/lib/gdriveWrapper.js
index <HASH>..<HASH> 100644
--- a/lib/gdriveWrapper.js
+++ b/lib/gdriveWrapper.js
@@ -211,7 +211,7 @@ gdriveWrapper.prototype.downloadNewFiles = function(gdriveDirectory, targetDirec
filesBeingDownloaded--;
checkGetNextFiles();
} catch (err) {
- complete(new Error(5, "Failed to append to existing file list"));
+ complete(new Error('Failed to append to existing file list'));
return;
}
} else { | Remove numbers from error creation
Looks like passing a number for the error is not supported
by default, remove | mhdawson_google-drive-wrapper | train | js |
3f93f7dab71d8ff67950999cc8fbbe86fc477894 | diff --git a/src/Core42/Model/DefaultModel.php b/src/Core42/Model/DefaultModel.php
index <HASH>..<HASH> 100644
--- a/src/Core42/Model/DefaultModel.php
+++ b/src/Core42/Model/DefaultModel.php
@@ -22,10 +22,11 @@ class DefaultModel extends AbstractModel
$variableName = lcfirst(substr($method, 3));
if (strncasecmp($method, "get", 3) === 0) {
- $return = $this->properties[$variableName];
+ $return = $this->get($variableName);
} elseif (strncasecmp($method, "set", 3) === 0) {
- $return = $this;
- $this->properties[$variableName] = $params[0];
+ $this->properties[$variableName] = $variableName;
+
+ $return = $this->set($variableName, $params[0]);
} else {
throw new \Exception("Method {$method} not found");
}
@@ -44,4 +45,25 @@ class DefaultModel extends AbstractModel
$this->$setter($value);
}
}
+
+ /**
+ * @param array $data
+ */
+ public function hydrate(array $data)
+ {
+ $this->exchangeArray($data);
+ }
+
+ /**
+ * @return array
+ */
+ public function extract()
+ {
+ $array = array();
+ foreach ($this->properties as $variableName) {
+ $array[$variableName] = $this->get($variableName);
+ }
+
+ return $array;
+ }
} | hydrate/extract feature for default model, added support for diff() | kiwi-suite_core42 | train | php |
ee6a3c59143907bbf70d64ebd76dc5d216811232 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -120,6 +120,7 @@ setup(
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
+ "Programming Language :: Python :: 3.7",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: System :: Systems Administration :: Authentication/Directory"],
ext_modules = [ | Claim support for Python <I> | mongodb-labs_winkerberos | train | py |
74d5bc0a3bc4707de7801e981fc1aa1e2b7d4803 | diff --git a/tests/ignite/engine/test_create_supervised.py b/tests/ignite/engine/test_create_supervised.py
index <HASH>..<HASH> 100644
--- a/tests/ignite/engine/test_create_supervised.py
+++ b/tests/ignite/engine/test_create_supervised.py
@@ -391,6 +391,7 @@ def test_create_supervised_trainer_amp_error(mock_torch_cuda_amp_module):
_test_create_supervised_trainer(amp_mode="amp", scaler=True)
+@pytest.mark.skipif(LooseVersion(torch.__version__) < LooseVersion("1.5.0"), reason="Skip if < 1.5.0")
def test_create_supervised_trainer_scaler_not_amp():
scaler = torch.cuda.amp.GradScaler(enabled=torch.cuda.is_available()) | Fix test_create_supervised on old PyTorch without amp (#<I>)
* Fix test_create_supervised on old PyTorch without amp
* move to torch <I> as minimal version | pytorch_ignite | train | py |
a44441e516b613dac54e3bd0af114eed833ae23c | diff --git a/wakeonlan.py b/wakeonlan.py
index <HASH>..<HASH> 100644
--- a/wakeonlan.py
+++ b/wakeonlan.py
@@ -108,8 +108,8 @@ if __name__ == "__main__":
elif i is len(args) - 1:
mac_address = args[i]
else:
- sys.exit(help_message)
+ sys.exit(help_message % args[0])
success = send_magic_packet(mac_address, ip_address=ip_address, port=port)
- print("Magic packet sent succesfully." if success else help_message)
+ print("Magic packet sent succesfully." if success else help_message % args[0]) | help message %s is now shown as args[0] | remcohaszing_pywakeonlan | train | py |
494e46621c578a0fc9ccec3e98afa89e828ed2b1 | diff --git a/log.go b/log.go
index <HASH>..<HASH> 100644
--- a/log.go
+++ b/log.go
@@ -70,6 +70,7 @@ func (j *JSONFormatter) Format(e *log.Entry) ([]byte, error) {
FileField: t.Loc(),
FunctionField: t.FuncName(),
})
+ new.Time = e.Time
new.Level = e.Level
new.Message = e.Message
e = new | JSONFormatter time fix
JSONFormatter was always showing "time":"<I>-<I>-<I>T<I>:<I>:<I>Z" | gravitational_trace | train | go |
be5b88bf84e102f397103e696383d6335fecdfcf | diff --git a/spec/github/api/callbacks_spec.rb b/spec/github/api/callbacks_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/github/api/callbacks_spec.rb
+++ b/spec/github/api/callbacks_spec.rb
@@ -28,14 +28,14 @@ end
describe Github::API, '#callbacks' do
it "retrieves only public api methods" do
- expect(ApiTest.request_methods.to_a).to eq([
+ expect(ApiTest.request_methods.to_a - [
'list',
'list_with_callback_apitest',
'list_without_callback_apitest',
'get',
'get_with_callback_apitest',
'get_without_callback_apitest'
- ])
+ ]).to be_empty
end
it "execute before callback" do | Fix spec result dependency for jruby. | piotrmurach_github | train | rb |
32739edb0782f7099ced558c2b74c5e13484f265 | diff --git a/salt/utils/iam.py b/salt/utils/iam.py
index <HASH>..<HASH> 100644
--- a/salt/utils/iam.py
+++ b/salt/utils/iam.py
@@ -13,7 +13,7 @@ import time
import requests
import pprint
from six.moves import range
-import six
+import salt.utils.six as six
log = logging.getLogger(__name__) | Replaced import six in file /salt/utils/iam.py | saltstack_salt | train | py |
b7fe6b2e99476bbeed2ba6cdf88466a49ff5fdaa | diff --git a/lib/veewee/provider/core/box/issh.rb b/lib/veewee/provider/core/box/issh.rb
index <HASH>..<HASH> 100644
--- a/lib/veewee/provider/core/box/issh.rb
+++ b/lib/veewee/provider/core/box/issh.rb
@@ -25,7 +25,7 @@ module Veewee
def ssh_commandline_options(options)
command_options = [
- "-q", #Suppress warning messages
+ #"-q", #Suppress warning messages
# "-T", #Pseudo-terminal will not be allocated because stdin is not a terminal.
"-p #{ssh_options[:port]}",
"-o UserKnownHostsFile=/dev/null", | remove the -q for ssh , to see warning and errors | jedi4ever_veewee | train | rb |
fa6718d02606852897c6c91cacf0f80c4d1a0243 | diff --git a/test/grpc_test.go b/test/grpc_test.go
index <HASH>..<HASH> 100644
--- a/test/grpc_test.go
+++ b/test/grpc_test.go
@@ -22,7 +22,8 @@ func TestGrpc(t *testing.T) {
}
defer g.Stop()
- ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
+ ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
+ defer cancel()
conn, err := grpc.DialContext(ctx, tcp, grpc.WithInsecure(), grpc.WithBlock())
if err != nil {
t.Fatalf("Expected no error but got: %s", err) | Fix grpc test vet warning (#<I>)
This fixes the vet warning: the cancel function returned by
context.WithTimeout should be called, not discarded, to avoid a context
leak. | coredns_coredns | train | go |
29e9951aba8c81d356c3d03a8e0530de84d8317a | diff --git a/bin/firenze.js b/bin/firenze.js
index <HASH>..<HASH> 100755
--- a/bin/firenze.js
+++ b/bin/firenze.js
@@ -16,6 +16,7 @@ if (command === 'migration') {
.command('list', 'List migrations')
.command('current', 'Show current migration version')
.command('run [name]', 'Run specific migration by name')
+ .command('runAll', 'Run all pending migrations')
.command('rollback [name]', 'Roll back specific migration by name')
.describe('db', 'Path to database file')
.describe('db-name', 'Name of database instance (if path exports multiple named instances)')
@@ -102,6 +103,17 @@ if (command === 'migration') {
.finally(function () {
db.close();
});
+ } else if (subCommand === 'runAll') {
+ migration.runAll()
+ .then(function () {
+ console.log('Successfully ran all migrations.');
+ })
+ .catch(function (error) {
+ console.log(chalk.bgRed('Error:') + ' ' + error);
+ })
+ .finally(function () {
+ db.close();
+ });
} else if (subCommand === 'rollback') {
if (typeof argv._[2] === 'undefined') {
console.log(chalk.bgRed('Error:') + ' No name given'); | migrations: run all pending migrations via CLI. | fahad19_firenze | train | js |
d09c71b688e618c5af438138363b501ea7171dfa | diff --git a/cmd/syncthing/memsize_solaris.go b/cmd/syncthing/memsize_solaris.go
index <HASH>..<HASH> 100644
--- a/cmd/syncthing/memsize_solaris.go
+++ b/cmd/syncthing/memsize_solaris.go
@@ -1,3 +1,5 @@
+// +build solaris
+
package main
import ( | Avoid build error in Go<I> | syncthing_syncthing | train | go |
3785ca836628f0a0c7fd78913021344e3553e05c | diff --git a/src/draw/handler/Draw.Circle.js b/src/draw/handler/Draw.Circle.js
index <HASH>..<HASH> 100644
--- a/src/draw/handler/Draw.Circle.js
+++ b/src/draw/handler/Draw.Circle.js
@@ -15,7 +15,7 @@ L.Draw.Circle = L.Draw.SimpleShape.extend({
clickable: true
},
showRadius: true,
- metric: true, // Whether to use the metric meaurement system or imperial
+ metric: true, // Whether to use the metric measurement system or imperial
feet: true // When not metric, use feet instead of yards for display
},
diff --git a/src/draw/handler/Draw.Polyline.js b/src/draw/handler/Draw.Polyline.js
index <HASH>..<HASH> 100644
--- a/src/draw/handler/Draw.Polyline.js
+++ b/src/draw/handler/Draw.Polyline.js
@@ -30,7 +30,7 @@ L.Draw.Polyline = L.Draw.Feature.extend({
fill: false,
clickable: true
},
- metric: true, // Whether to use the metric meaurement system or imperial
+ metric: true, // Whether to use the metric measurement system or imperial
feet: true, // When not metric, to use feet instead of yards for display.
showLength: true, // Whether to display distance in the tooltip
zIndexOffset: 2000 // This should be > than the highest z-index any map layers | [Typo] s/meaurement/measurement | Leaflet_Leaflet.draw | train | js,js |
19f9eaab95e7fe01ff59d05972cd1f680ce8b12e | diff --git a/elasticsearch/connection/base.py b/elasticsearch/connection/base.py
index <HASH>..<HASH> 100644
--- a/elasticsearch/connection/base.py
+++ b/elasticsearch/connection/base.py
@@ -42,7 +42,7 @@ class Connection(object):
return json.dumps(json.loads(data), sort_keys=True, indent=2, separators=(',', ': '))
except (ValueError, TypeError):
# non-json data or a bulk request
- return repr(data)
+ return data
logger.info(
'%s %s [status:%s request:%.3fs]', method, full_url, | Make sure bulk requests are logged correctly | elastic_elasticsearch-py | train | py |
e7450f2fef3dc7829227ca198910cd50023fcf46 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -43,7 +43,7 @@ app.conditional = function*(next) {
app.subdomainrouter=function * (next){
let origin = this.request.get("origin").replace("http://","").split(":")[0].split(".");
if(origin.length >=3 ){
- let reqo = thi.request.get("origin").replace(origin[0]+".","");
+ let reqo = this.request.get("origin").replace(origin[0]+".","");
if(app.routers[origin[0]]!==undefined && reqo===server.hostname){
let port = this.request.host.split(":")[1];
port = port ? ":"+port:""; | [ci skip] Fixed bug with production server | gerard2p_koaton | train | js |
cea3ec9f34e7c827ace0f4f76dd52e7394c6433a | diff --git a/packages/ember-runtime/lib/mixins/enumerable.js b/packages/ember-runtime/lib/mixins/enumerable.js
index <HASH>..<HASH> 100644
--- a/packages/ember-runtime/lib/mixins/enumerable.js
+++ b/packages/ember-runtime/lib/mixins/enumerable.js
@@ -285,7 +285,7 @@ export default Mixin.create({
@method getEach
@param {String} key name of the property
@return {Array} The mapped array.
- @private
+ @public
*/
getEach: aliasMethod('mapBy'), | [DOC Release] Mark Enumerable.getEach() as public
[ci skip] | emberjs_ember.js | train | js |
a4ef36df9de4d5b078874827f3949a1d8ae7b213 | diff --git a/lib/ffprobe.js b/lib/ffprobe.js
index <HASH>..<HASH> 100644
--- a/lib/ffprobe.js
+++ b/lib/ffprobe.js
@@ -11,7 +11,8 @@ function parseFfprobeOutput(out) {
var lines = out.split(/\r\n|\r|\n/);
var data = {
streams: [],
- format: {}
+ format: {},
+ chapters: []
};
function parseBlock(name) {
@@ -46,6 +47,9 @@ function parseFfprobeOutput(out) {
if (line.match(/^\[stream/i)) {
var stream = parseBlock('stream');
data.streams.push(stream);
+ } else if (line.match(/^\[chapter/i)) {
+ var chapter = parseBlock('chapter');
+ data.chapters.push(chapter);
} else if (line.toLowerCase() === '[format]') {
data.format = parseBlock('format');
}
@@ -105,6 +109,7 @@ module.exports = function(proto) {
break;
}
+
if (index === null) {
if (!this._currentInput) {
return callback(new Error('No input specified')); | ffprobe - parsing of chapters metadata | fluent-ffmpeg_node-fluent-ffmpeg | train | js |
e4057bc20b4b0826fc6078c74cec2e3d328475fa | diff --git a/wsgidav/http_authenticator.py b/wsgidav/http_authenticator.py
index <HASH>..<HASH> 100644
--- a/wsgidav/http_authenticator.py
+++ b/wsgidav/http_authenticator.py
@@ -217,6 +217,12 @@ class HTTPAuthenticator(BaseMiddleware):
elif authmethod == "basic" and self._acceptbasic:
return self.authBasicAuthRequest(environ, start_response)
+ # The requested auth method is not supported.
+ elif self._defaultdigest and self._acceptdigest:
+ return self.sendDigestAuthResponse(environ, start_response)
+ elif self._acceptbasic:
+ return self.sendBasicAuthResponse(environ, start_response)
+
util.log(
"HTTPAuthenticator: respond with 400 Bad request; Auth-Method: %s" % authmethod) | ISSUE <I>: Return <I> when auth method is not supported (#<I>)
Thanks. | mar10_wsgidav | train | py |
36290f9f8b2b27330445a1eefc32123c2b8fea0f | diff --git a/server/irc/channel.js b/server/irc/channel.js
index <HASH>..<HASH> 100644
--- a/server/irc/channel.js
+++ b/server/irc/channel.js
@@ -4,7 +4,9 @@ var util = require('util'),
var IrcChannel = function(irc_connection, name) {
this.irc_connection = irc_connection;
- this.name = name;
+
+ // Lowercase the channel name so we don't run into case-sensitive issues
+ this.name = name.toLowerCase();
this.members = [];
this.ban_list_buffer = []; | Channel case-sensitivity issues. Main cause of "Cannot call method 'clientEvent' of undefined" | prawnsalad_KiwiIRC | train | js |
33d848588c183ffab54a544a8cfb4e34da6bea3b | diff --git a/fusesoc/capi2/core.py b/fusesoc/capi2/core.py
index <HASH>..<HASH> 100644
--- a/fusesoc/capi2/core.py
+++ b/fusesoc/capi2/core.py
@@ -48,7 +48,7 @@ class String(str):
return t.expr
else:
return []
- word = Word(alphanums+':>.[]_-,=~/')
+ word = Word(alphanums+':<>.[]_-,=~/')
conditional = Forward()
conditional << (Optional("!")("negate") + word("cond") + Suppress('?') + Suppress('(') + OneOrMore(conditional ^ word)("expr") + Suppress(')')).setParseAction(cb_conditional)
#string = (function ^ word) | Allow < character in Word parsing.
This allows dependencies to include restrictions on less than a specific version | olofk_fusesoc | train | py |
db6e5ec398f773546e50260bfab11de1f6cba7a0 | diff --git a/test/getConfig.spec.js b/test/getConfig.spec.js
index <HASH>..<HASH> 100644
--- a/test/getConfig.spec.js
+++ b/test/getConfig.spec.js
@@ -74,8 +74,10 @@ afterAll(done => {
beforeEach(done => {
rimraf(outputFolder, () => {
- mkdirSync(outputFolder);
- done();
+ setTimeout(() => {
+ mkdirSync(outputFolder);
+ done();
+ }, 50);
});
}); | Odd test result on Travis, I suspect rimraf is calling the callback before it's really finished, it happened before | wildpeaks_package-webpack-config-web | train | js |
fe6ede2c87b057e9da520e2f5e155efa1a84b728 | diff --git a/lib/OpenLayers/Layer/WMS/Untiled.js b/lib/OpenLayers/Layer/WMS/Untiled.js
index <HASH>..<HASH> 100644
--- a/lib/OpenLayers/Layer/WMS/Untiled.js
+++ b/lib/OpenLayers/Layer/WMS/Untiled.js
@@ -107,8 +107,6 @@ OpenLayers.Layer.WMS.Untiled.prototype =
*/
moveTo:function(bounds, zoomChanged, minor) {
-
-
if (!minor) {
if (bounds == null) {
@@ -132,7 +130,7 @@ OpenLayers.Layer.WMS.Untiled.prototype =
// update div
var img = this.imgDiv;
- if (this.transparent) {
+ if (this.params.TRANSPARENT == 'true') {
OpenLayers.Util.modifyAlphaImageDiv(this.imgDiv,
null,
pos,
@@ -206,7 +204,7 @@ OpenLayers.Layer.WMS.Untiled.prototype =
var pos = this.map.getLayerPxFromViewPortPx(tl);
//create div
- if (this.transparent) {
+ if (this.params.TRANSPARENT == 'true') {
this.imgDiv = OpenLayers.Util.createAlphaImageDiv(null,
pos,
size, | check for transparency was not correct
git-svn-id: <URL> | openlayers_openlayers | train | js |
89b82ca2be0a718c43ff9ddb8f8a592274de2e96 | diff --git a/src/Models/MetadataTrait.php b/src/Models/MetadataTrait.php
index <HASH>..<HASH> 100644
--- a/src/Models/MetadataTrait.php
+++ b/src/Models/MetadataTrait.php
@@ -16,6 +16,7 @@ trait MetadataTrait
'integer' => EdmPrimitiveType::INT32,
'string' => EdmPrimitiveType::STRING,
'datetime' => EdmPrimitiveType::DATETIME,
+ 'float' => EdmPrimitiveType::SINGLE,
'decimal' => EdmPrimitiveType::DECIMAL,
'text' => EdmPrimitiveType::STRING,
'boolean' => EdmPrimitiveType::BOOLEAN, | added float to the type mapping (#<I>) | Algo-Web_POData-Laravel | train | php |
eff68c84c0faaf4b1af592a471eec19f8d443671 | diff --git a/test/Labrador/Test/Unit/RendererTest.php b/test/Labrador/Test/Unit/RendererTest.php
index <HASH>..<HASH> 100644
--- a/test/Labrador/Test/Unit/RendererTest.php
+++ b/test/Labrador/Test/Unit/RendererTest.php
@@ -29,9 +29,8 @@ class RendererTest extends UnitTestCase {
$renderer = $this->getRenderer();
$expected = <<<TEXT
partial
-
TEXT;
- $actual = $renderer->renderPartial('partial');
+ $actual = trim($renderer->renderPartial('partial'), PHP_EOL);
$this->assertSame($expected, $actual);
}
@@ -42,7 +41,7 @@ layout
foobar
TEXT;
- $actual = $renderer->renderPartial('layout', ['_content' => 'foobar']);
+ $actual = trim($renderer->renderPartial('layout', ['_content' => 'foobar']), PHP_EOL);
$this->assertSame($expected, $actual);
}
@@ -54,7 +53,7 @@ layout
partial
TEXT;
- $actual = $renderer->render('partial');
+ $actual = trim($renderer->render('partial'), PHP_EOL);
$this->assertSame($expected, $actual);
} | trimming up content on tests
some editors can be setup to automagically include blank lines and some
don’t. ultimately the presence of a new line at the end of the content
is of little consequence and shouldn’t impact the confidence of the
tests. | labrador-kennel_core | train | php |
7f4f8267e17ae7b4af2d3a59d89b7a0b49729fcd | diff --git a/test/resources/6_setup.js b/test/resources/6_setup.js
index <HASH>..<HASH> 100644
--- a/test/resources/6_setup.js
+++ b/test/resources/6_setup.js
@@ -27,7 +27,7 @@ describe('Resource:', function() {
});
});
- it.only('should generate the settings-file', function(done) {
+ it('should generate the settings-file', function(done) {
client.post('/setup/commit', function(err, req, res) {
assert.ifError(err);
assert.equal(res.statusCode, 201); | Oups! Run all the tests | shinuza_captain-core | train | js |
740b3c42e3175e0f588058cf905b7856ad087a0f | diff --git a/crispy_forms/tests/test_layout.py b/crispy_forms/tests/test_layout.py
index <HASH>..<HASH> 100644
--- a/crispy_forms/tests/test_layout.py
+++ b/crispy_forms/tests/test_layout.py
@@ -270,7 +270,6 @@ def test_column_has_css_classes(settings):
c = Context({'form': form, 'form_helper': form_helper})
html = template.render(c)
- print(html)
if settings.CRISPY_TEMPLATE_PACK == 'uni_form':
assert html.count('formColumn') == 1 | Remove print statement from test file. (#<I>) | django-crispy-forms_django-crispy-forms | train | py |
c756291f701296b36411ccdd639a965a302a5af8 | diff --git a/server/workflow/workflow_server.go b/server/workflow/workflow_server.go
index <HASH>..<HASH> 100644
--- a/server/workflow/workflow_server.go
+++ b/server/workflow/workflow_server.go
@@ -299,9 +299,6 @@ func (s *workflowServer) DeleteWorkflow(ctx context.Context, req *workflowpkg.Wo
if err != nil {
return nil, err
}
- if wf.Finalizers != nil && !req.Force {
- return nil, fmt.Errorf("%s has finalizer. Use argo delete --force to delete this workflow", wf.Name)
- }
if req.Force {
_, err := auth.GetWfClient(ctx).ArgoprojV1alpha1().Workflows(wf.Namespace).Patch(ctx, wf.Name, types.MergePatchType, []byte("{\"metadata\":{\"finalizers\":null}}"), metav1.PatchOptions{})
if err != nil { | fix: removed error check which prevented deleting successful artGC wfs. (#<I>)
fix: removed error check which prevented deleting successful artGC workflows | argoproj_argo | train | go |
510895aa2e44e783e2127319ac2b0469eb67649c | diff --git a/lib/semantic_logger/appender/syslog.rb b/lib/semantic_logger/appender/syslog.rb
index <HASH>..<HASH> 100644
--- a/lib/semantic_logger/appender/syslog.rb
+++ b/lib/semantic_logger/appender/syslog.rb
@@ -164,7 +164,8 @@ module SemanticLogger
def reopen
case @protocol
when :syslog
- ::Syslog.open(application, options, facility)
+ method = ::Syslog.opened? ? :reopen : :open
+ ::Syslog.send(method, application, options, facility)
when :tcp
# Use the local logger for @remote_syslog so errors with the remote logger can be recorded locally.
@tcp_client_options[:logger] = logger | Now syslog appender calls ::Syslog.reopen if it is already opened. | rocketjob_semantic_logger | train | rb |
e3fb4ae46a7c22df1fcf33889e7e0443e676a114 | diff --git a/test/Formatter/SignatureFormatterTest.php b/test/Formatter/SignatureFormatterTest.php
index <HASH>..<HASH> 100644
--- a/test/Formatter/SignatureFormatterTest.php
+++ b/test/Formatter/SignatureFormatterTest.php
@@ -13,6 +13,7 @@ namespace Psy\Test\Formatter;
use Psy\Formatter\SignatureFormatter;
use Psy\Reflection\ReflectionClassConstant;
+use Psy\Reflection\ReflectionConstant_;
class SignatureFormatterTest extends \PHPUnit\Framework\TestCase
{
@@ -68,6 +69,18 @@ class SignatureFormatterTest extends \PHPUnit\Framework\TestCase
new \ReflectionMethod('Psy\Test\Formatter\Fixtures\BoringTrait', 'boringMethod'),
'public function boringMethod($one = 1)',
],
+ [
+ new ReflectionConstant_('E_ERROR'),
+ 'define("E_ERROR", 1)',
+ ],
+ [
+ new ReflectionConstant_('PHP_VERSION'),
+ 'define("PHP_VERSION", "' . PHP_VERSION . '")',
+ ],
+ [
+ new ReflectionConstant_('__LINE__'),
+ 'define("__LINE__", null)', // @todo show this as `unknown` in red or something?
+ ],
];
} | Add test coverage for constant signature formatting. | bobthecow_psysh | train | php |
a33b7f02d55981a9b472829cb1721ee83e1d3e3b | diff --git a/tags_include.go b/tags_include.go
index <HASH>..<HASH> 100644
--- a/tags_include.go
+++ b/tags_include.go
@@ -1,6 +1,7 @@
package pongo2
import (
+ "errors"
"path/filepath"
)
@@ -40,6 +41,11 @@ func (node *tagIncludeNode) Execute(ctx *ExecutionContext) (string, error) {
if err != nil {
return "", err
}
+
+ if filename.String() == "" {
+ return "", errors.New("Filename for 'include'-tag evaluated to an empty string.")
+ }
+
// Get include-filename relative to the including-template directory
including_dir := filepath.Dir(ctx.template.name)
included_filename := filepath.Join(including_dir, filename.String()) | include-tag lazy filename validation added. | flosch_pongo2 | train | go |
d3cd3ba74b1ec1c68c283290d71f736314ae31f8 | diff --git a/contribs/src/main/java/com/netflix/conductor/contribs/AMQPModule.java b/contribs/src/main/java/com/netflix/conductor/contribs/AMQPModule.java
index <HASH>..<HASH> 100644
--- a/contribs/src/main/java/com/netflix/conductor/contribs/AMQPModule.java
+++ b/contribs/src/main/java/com/netflix/conductor/contribs/AMQPModule.java
@@ -55,7 +55,7 @@ public class AMQPModule extends AbstractModule {
}
@ProvidesIntoMap
- @StringMapKey("amqp")
+ @StringMapKey("amqp_queue")
@Singleton
@Named(EVENT_QUEUE_PROVIDERS_QUALIFIER)
public EventQueueProvider getAMQQueueEventQueueProvider(Configuration config) { | Fix issue in which a queue in an event-handler is defined as "amqp:..." and no events are consumed. (#<I>)
Rename StringMapKey for amqp queue from "amqp" to amqp_queue"
Issue: <URL> | Netflix_conductor | train | java |
1767b386f6652bf2e4ec804ebab8e057f3589d31 | diff --git a/commands.go b/commands.go
index <HASH>..<HASH> 100644
--- a/commands.go
+++ b/commands.go
@@ -730,11 +730,11 @@ func cmdEnv(c *cli.Context) {
switch userShell {
case "fish":
- fmt.Printf("%s\n\nset -x DOCKER_TLS_VERIFY 1;\nset -x DOCKER_CERT_PATH %q;\nset -x DOCKER_HOST %s;\n",
- usageHint, cfg.machineDir, dockerHost)
+ fmt.Printf("set -x DOCKER_TLS_VERIFY 1;\nset -x DOCKER_CERT_PATH %q;\nset -x DOCKER_HOST %s;\n\n%s\n",
+ cfg.machineDir, dockerHost, usageHint)
default:
- fmt.Printf("%s\nexport DOCKER_TLS_VERIFY=1\nexport DOCKER_CERT_PATH=%q\nexport DOCKER_HOST=%s\n",
- usageHint, cfg.machineDir, dockerHost)
+ fmt.Printf("export DOCKER_TLS_VERIFY=1\nexport DOCKER_CERT_PATH=%q\nexport DOCKER_HOST=%s\n\n%s\n",
+ cfg.machineDir, dockerHost, usageHint)
}
} | Moved env usage hint to end of output to avoid shell expansion issue | docker_machine | train | go |
e538dffa39292165023cfa6902fe805742ec68c9 | diff --git a/core/src/main/java/net/kuujo/vertigo/cluster/data/MapEvent.java b/core/src/main/java/net/kuujo/vertigo/cluster/data/MapEvent.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/net/kuujo/vertigo/cluster/data/MapEvent.java
+++ b/core/src/main/java/net/kuujo/vertigo/cluster/data/MapEvent.java
@@ -122,4 +122,27 @@ public class MapEvent<K, V> implements JsonSerializable {
return (V) value;
}
+ @Override
+ public int hashCode() {
+ int hashCode = 23;
+ hashCode = 37 * hashCode + type.hashCode();
+ hashCode = 37 * hashCode + key.hashCode();
+ hashCode = 37 * hashCode + value.hashCode();
+ return hashCode;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("MapEvent(%s)[%s:%s]", type, key, value);
+ }
+
+ @Override
+ public boolean equals(Object object) {
+ if (!(object instanceof MapEvent)) {
+ return false;
+ }
+ MapEvent<?, ?> event = (MapEvent<?, ?>) object;
+ return event.type.equals(type) && event.key.equals(key) && event.value.equals(value);
+ }
+
} | Add hash support to MapEvent. | kuujo_vertigo | train | java |
5486c2f64d31132d5bce0e160e92473a549a52e6 | diff --git a/URLNormalizer.php b/URLNormalizer.php
index <HASH>..<HASH> 100644
--- a/URLNormalizer.php
+++ b/URLNormalizer.php
@@ -105,7 +105,12 @@ class URLNormalizer {
$fragment = '#' . $this->fragment;
}
- return $this->scheme . $this->host . $this->port . $this->user . $this->pass . $this->path . $query . $fragment;
+ $port = '';
+ if ( $this->port ) {
+ $port = ':' . $this->port;
+ }
+
+ return $this->scheme . $this->host . $port . $this->user . $this->pass . $this->path . $query . $fragment;
}
/**
diff --git a/URLNormalizerTest.php b/URLNormalizerTest.php
index <HASH>..<HASH> 100644
--- a/URLNormalizerTest.php
+++ b/URLNormalizerTest.php
@@ -130,4 +130,11 @@ class URLNormalizerTest extends PHPUnit_Framework_TestCase
$this->fixture->setUrl( $url );
$this->assertEquals( $url, $this->fixture->normalize() );
}
+
+ public function testPortNumbersArePreserved() {
+ $url = 'http://example.com:81/index.html';
+
+ $this->fixture->setUrl( $url );
+ $this->assertEquals( $url, $this->fixture->normalize() );
+ }
} | Port numbers are now correctly preserved after normalisation | glenscott_url-normalizer | train | php,php |
8bc264317f37ba674f97c05a71a2be8ec71801cb | diff --git a/lib/sass/script/string.rb b/lib/sass/script/string.rb
index <HASH>..<HASH> 100644
--- a/lib/sass/script/string.rb
+++ b/lib/sass/script/string.rb
@@ -46,6 +46,8 @@ module Sass::Script
if type == :identifier
if context == :equals && Sass::SCSS::RX.escape_ident(self.value).include?(?\\)
return "unquote(#{Sass::Script::String.new(self.value, :string).to_sass})"
+ elsif context == :equals && self.value.size == 0
+ return "\"\""
end
return self.value
end | [SCSS] Handle empty strings in variable assigment when converting to scss. | sass_ruby-sass | train | rb |
e22b6306d9615595c0be393a1956877d5ca4cbf7 | diff --git a/src/Drupal/Driver/Cores/Drupal6.php b/src/Drupal/Driver/Cores/Drupal6.php
index <HASH>..<HASH> 100644
--- a/src/Drupal/Driver/Cores/Drupal6.php
+++ b/src/Drupal/Driver/Cores/Drupal6.php
@@ -29,8 +29,10 @@ class Drupal6 implements CoreInterface {
}
// Bootstrap Drupal.
+ $current_path = getcwd();
chdir(DRUPAL_ROOT);
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+ chdir($current_path);
}
/**
diff --git a/src/Drupal/Driver/Cores/Drupal8.php b/src/Drupal/Driver/Cores/Drupal8.php
index <HASH>..<HASH> 100644
--- a/src/Drupal/Driver/Cores/Drupal8.php
+++ b/src/Drupal/Driver/Cores/Drupal8.php
@@ -29,8 +29,10 @@ class Drupal8 implements CoreInterface {
}
// Bootstrap Drupal.
+ $current_path = getcwd();
chdir(DRUPAL_ROOT);
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
+ chdir($current_path);
}
/** | Follow-up to issue #<I>. | jhedstrom_DrupalDriver | train | php,php |
b8ed88022f3137201a3295ea5d6bdc7934b6feca | diff --git a/src/components/radioButton/demoMultiColumn/script.js b/src/components/radioButton/demoMultiColumn/script.js
index <HASH>..<HASH> 100644
--- a/src/components/radioButton/demoMultiColumn/script.js
+++ b/src/components/radioButton/demoMultiColumn/script.js
@@ -5,13 +5,13 @@ angular
self.contacts = [{
'id': 1,
- 'fullName': 'Maria Guadalupe',
+ 'fullName': 'María Guadalupe',
'lastName': 'Guadalupe',
'title': "CEO, Found"
}, {
'id': 2,
- 'fullName': 'Gabriel García Marquéz',
- 'lastName': 'Marquéz',
+ 'fullName': 'Gabriel García Márquez',
+ 'lastName': 'Márquez',
'title': "VP Sales & Marketing"
}, {
'id': 3, | docs(radiobutton): correct two misspellings on demo (#<I>) | angular_material | train | js |
386a8c1b070daa9238b5cec8babac796bf42b063 | diff --git a/lib/travis/cli/console.rb b/lib/travis/cli/console.rb
index <HASH>..<HASH> 100644
--- a/lib/travis/cli/console.rb
+++ b/lib/travis/cli/console.rb
@@ -23,7 +23,9 @@ module Travis
require 'pry'
true
rescue LoadError
- $stderr.puts 'You need to install pry to use Travis CLI console.'
+ $stderr.puts 'You need to install pry to use Travis CLI console. Try'
+ $stderr.puts
+ $stderr.puts '$ (sudo) gem install pry'
false
end
end | Add message about how to install Pry (#<I>) | travis-ci_travis.rb | train | rb |
9344e63a47a1553f0353e7b63c7d5056da8c6105 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ def read(fname):
setup(
name="qds_sdk",
- version="1.9.0",
+ version="unreleased",
author="Qubole",
author_email="dev@qubole.com",
description=("Python SDK for coding to the Qubole Data Service API"), | fix: usr: setup.py should indicate unreleased branch as version==unreleased
when using qds-sdk as a dependency - pip and setuptools look at the
version in setup() to find the stable version. if this does not match
with the one specified by install_requires then pip/setuptools fail and
install the stable version instead | qubole_qds-sdk-py | train | py |
153ab4aa092746edd54cbe6d802c6bbee833bfb8 | diff --git a/docs/source/conf.py b/docs/source/conf.py
index <HASH>..<HASH> 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -166,11 +166,11 @@ napoleon_use_rtype = False
add_module_names = False
-html_context = {
- 'css_files': [
- '_static/rtd_overrides.css', # overrides for wide tables in RTD theme
- ],
-}
+# html_context = {
+# 'css_files': [
+# '_static/rtd_overrides.css', # overrides for wide tables in RTD theme
+# ],
+# }
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the | DOC hm, this seems to break rtfd | TeamHG-Memex_eli5 | train | py |
9cbb6d2b20a8e3352bedd791fafe3c58f8bef328 | diff --git a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
@@ -174,14 +174,9 @@ module ActiveRecord
options.assert_valid_keys :requires_new, :joinable
last_transaction_joinable = @transaction_joinable
- if options.has_key?(:joinable)
- @transaction_joinable = options[:joinable]
- else
- @transaction_joinable = true
- end
- requires_new = options[:requires_new] || !last_transaction_joinable
-
- transaction_open = false
+ @transaction_joinable = options.fetch(:joinable, true)
+ requires_new = options[:requires_new] || !last_transaction_joinable
+ transaction_open = false
begin
if requires_new || open_transactions == 0 | use Hash#fetch to eliminate conditional | rails_rails | train | rb |
ce6921cce19661161bca3f67f51013f801411eb2 | diff --git a/src/foremast/elb/format_listeners.py b/src/foremast/elb/format_listeners.py
index <HASH>..<HASH> 100644
--- a/src/foremast/elb/format_listeners.py
+++ b/src/foremast/elb/format_listeners.py
@@ -134,6 +134,7 @@ def format_cert_name(env='', account='', region='', certificate=None):
Args:
env (str): Account environment name
account (str): Account number for ARN
+ region (str): AWS Region.
certificate (str): Name of SSL certificate
Returns:
@@ -165,6 +166,7 @@ def generate_custom_cert_name(env='', region='', account='', certificate=None):
Args:
env (str): Account environment name
+ region (str): AWS Region.
account (str): Account number for ARN.
certificate (str): Name of SSL certificate.
diff --git a/tests/elb/test_elb.py b/tests/elb/test_elb.py
index <HASH>..<HASH> 100644
--- a/tests/elb/test_elb.py
+++ b/tests/elb/test_elb.py
@@ -17,8 +17,6 @@
import json
from unittest import mock
-import io
-
from foremast.elb import SpinnakerELB
from foremast.elb.format_listeners import format_cert_name, format_listeners
from foremast.elb.splay_health import splay_health | Fixed docstrings and unneeded imports | foremast_foremast | train | py,py |
b19da6e777020aba3a1e641e4a9bccfc41f7caef | diff --git a/lib/bakeware/app_builder.rb b/lib/bakeware/app_builder.rb
index <HASH>..<HASH> 100755
--- a/lib/bakeware/app_builder.rb
+++ b/lib/bakeware/app_builder.rb
@@ -99,6 +99,7 @@ module Bakeware
copy_file 'asset_sync', 'config/initializers/asset_sync.rb'
copy_file 'timeout', 'config/initializers/timeout.rb'
copy_file 'Procfile', 'Procfile'
+ concat_file 'import_scss_styles', 'app/assets/stylesheets/application.css.scss'
inject_into_file 'Procfile', "worker: env QUEUE=* bundle exec rake resque:work",
:after => "\n"
replace_in_file 'Procfile',
@@ -136,7 +137,6 @@ module Bakeware
copy_file 'app/assets/stylesheets/application.css',
'app/assets/stylesheets/application.css.scss'
remove_file 'app/assets/stylesheets/application.css'
- concat_file 'import_scss_styles', 'app/assets/stylesheets/application.css.scss'
create_file 'app/assets/stylesheets/_screen.scss'
end | compass import no longer gets included unless meaty is switched on | courtsimas_bakeware | train | rb |
a84eaaf5b4429ea4ae41f1629a8d733fb0beb1bf | diff --git a/liquibase-core/src/main/java/liquibase/integration/spring/SpringLiquibase.java b/liquibase-core/src/main/java/liquibase/integration/spring/SpringLiquibase.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/main/java/liquibase/integration/spring/SpringLiquibase.java
+++ b/liquibase-core/src/main/java/liquibase/integration/spring/SpringLiquibase.java
@@ -72,14 +72,26 @@ import org.springframework.core.io.ResourceLoader;
* @author Rob Schoening
*/
public class SpringLiquibase implements InitializingBean, BeanNameAware, ResourceLoaderAware {
+
+ private boolean dropFirst = false;
+
+ public boolean isDropFirst() {
+ return dropFirst;
+ }
+
+ public void setDropFirst(boolean dropFirst) {
+ this.dropFirst = dropFirst;
+ }
+
+
public class SpringResourceOpener implements ResourceAccessor {
private String parentFile;
+
public SpringResourceOpener(String parentFile) {
this.parentFile = parentFile;
}
-
public InputStream getResourceAsStream(String file) throws IOException {
try {
Resource resource = getResource(file);
@@ -252,6 +264,10 @@ public class SpringLiquibase implements InitializingBean, BeanNameAware, Resourc
}
}
+ if (isDropFirst()) {
+ liquibase.dropAll();
+ }
+
return liquibase;
} | CORE-<I>
Add "dropFirst" property to the SpringLiquibase | liquibase_liquibase | train | java |
3cc41006c685822d9046a7c70d0db2fd723e30eb | diff --git a/lib/registry.js b/lib/registry.js
index <HASH>..<HASH> 100644
--- a/lib/registry.js
+++ b/lib/registry.js
@@ -41,7 +41,7 @@ exports.value = function (hive, key, valueName, callback) {
key = Array.isArray(key) ? key.join('\\') : key
- const result = registry.enumerateValues(hive, key)
+ const result = registry.enumerateValuesSafe(hive, key)
const expectedName = valueName || ''
const fqk = [shortHive || hive, key].join('\\')
@@ -63,7 +63,7 @@ exports.values = function (hive, key, callback) {
hive = SHORT_HIVES.get(hive)
}
- const result = registry.enumerateValues(hive, key)
+ const result = registry.enumerateValuesSafe(hive, key)
const obj = {}
for (const item of result) { | Avoid errors if the registry is not readable (#<I>)
Previously this could happen if the user did not have access
to the given hive or key. | vweevers_win-detect-browsers | train | js |
c825f26f83c67e5bcdbd02379115dd711f65645f | diff --git a/salt/modules/file.py b/salt/modules/file.py
index <HASH>..<HASH> 100644
--- a/salt/modules/file.py
+++ b/salt/modules/file.py
@@ -1896,7 +1896,7 @@ def get_selinux_context(path):
try:
ret = re.search('\w+:\w+:\w+:\w+', out).group(0)
except AttributeError:
- ret = "No selinux context information is available for {0}".format(path)
+ ret = 'No selinux context information is available for {0}'.format(path)
return ret | Modified string to use single quotes - looks like this is the convention? | saltstack_salt | train | py |
3d705ff160c64c45768a3b0bebebb70872e4f6d9 | diff --git a/spec/nrser/tree/leaves_spec.rb b/spec/nrser/tree/leaves_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/nrser/tree/leaves_spec.rb
+++ b/spec/nrser/tree/leaves_spec.rb
@@ -5,8 +5,17 @@ describe "NRSER.leaves" do
it_behaves_like "function",
mapping: {
+ # flat hash
[{a: 1, b: 2}] => {[:a] => 1, [:b] => 2},
+ # flat array
+ [ [:a, :b, :c] ] => {
+ [0] => :a,
+ [1] => :b,
+ [2] => :c,
+ },
+
+ # Nested, all hashes
[{
a: {
x: 'ex', | More NRSER.leaves tests | nrser_nrser.rb | train | rb |
c835682d9a554d5be1f2b3d002f50faad07d1f77 | diff --git a/includes/class-freemius.php b/includes/class-freemius.php
index <HASH>..<HASH> 100644
--- a/includes/class-freemius.php
+++ b/includes/class-freemius.php
@@ -10361,7 +10361,8 @@
$plan_title = $this->_site->plan->title;
}
- $deactivation_step = version_compare( $this->version, '1.2.2', '>' ) ?
+ // @since 1.2.1.5 The free version is auto deactivated.
+ $deactivation_step = version_compare( $this->version, '1.2.1.5', '>=' ) ?
( '<li>' . __fs( 'deactivate-free-version', $this->_slug ) . '.</li>' ) :
''; | [auto-deactivation] Since we already have themes deployed with the beta version of the themes SDK that is tagged with <I>, if we release the new SDK with <I>, it can conflict with the themes version. Therefore, changed the version to <I>. | Freemius_wordpress-sdk | train | php |
cc48d5a9c1b98901a30e8ddc403b2ebab3d847c6 | diff --git a/src/services/olHelpers.js b/src/services/olHelpers.js
index <HASH>..<HASH> 100644
--- a/src/services/olHelpers.js
+++ b/src/services/olHelpers.js
@@ -152,6 +152,25 @@ angular.module('openlayers-directive').factory('olHelpers', function($q, $log, $
var oSource;
switch (source.type) {
+ case 'MapBox':
+ if (!source.mapId || !source.accessToken) {
+ $log.error('[AngularJS - Openlayers] - MapBox layer requires the map id and the access token');
+ return;
+ }
+ var url = 'http://api.tiles.mapbox.com/v4/' + source.mapId + '/{z}/{x}/{y}.png?access_token=' +
+ source.accessToken;
+
+ var pixelRatio = window.goog.dom.getPixelRatio();
+
+ if (pixelRatio > 1) {
+ url = url.replace('.png', '@2x.png');
+ }
+
+ oSource = new ol.source.XYZ({
+ url: url,
+ tilePixelRatio: pixelRatio > 1 ? 2 : 1
+ });
+ break;
case 'ImageWMS':
if (!source.url || !source.params) {
$log.error('[AngularJS - Openlayers] - ImageWMS Layer needs ' + | Added MapBox as tile source type; Using high DPI tile set if pixelRatio > 1 | tombatossals_angular-openlayers-directive | train | js |
f7cacae1cf29349f12743ce2f12e55b356297ae9 | diff --git a/km3pipe/io/__init__.py b/km3pipe/io/__init__.py
index <HASH>..<HASH> 100644
--- a/km3pipe/io/__init__.py
+++ b/km3pipe/io/__init__.py
@@ -67,14 +67,17 @@ def GenericPump(filenames, use_jppy=False, name="GenericPump", **kwargs):
return io[extension](filenames=filenames, name=name, **kwargs)
-def df_to_h5(df, filename, tabname, filemode='a', where='/', complevel=5,):
+def df_to_h5(df, filename, where, filemode='a', complevel=5,):
"""Write pandas dataframes with proper columns.
The main 2 ways pandas writes dataframes suck bigly.
"""
+ loc, tabname = os.path.split(where)
+ if loc == '':
+ loc = '/'
with tb.open_file(filename, filemode) as h5:
- filt = tb.Filters(complevel=complevel, shuffle=True)
- h5.create_table(where, tabname, obj=df.to_records(index=False),
+ filt = tb.Filters(complevel=complevel, shuffle=True, fletcher32=True)
+ h5.create_table(loc, tabname, obj=df.to_records(index=False),
filters=filt) | simplify df_to_h5 signature | tamasgal_km3pipe | train | py |
b944c3a56652436fe535b520013f964cc3505c3e | diff --git a/tests/__init.test.js b/tests/__init.test.js
index <HASH>..<HASH> 100644
--- a/tests/__init.test.js
+++ b/tests/__init.test.js
@@ -9,7 +9,8 @@ navigator.getVRDisplays = function () {
var resolvePromise = Promise.resolve();
var mockVRDisplay = {
requestPresent: resolvePromise,
- exitPresent: resolvePromise
+ exitPresent: resolvePromise,
+ requestAnimationFrame: function () { return 1; }
};
return Promise.resolve([mockVRDisplay]);
};
diff --git a/tests/core/a-entity.test.js b/tests/core/a-entity.test.js
index <HASH>..<HASH> 100644
--- a/tests/core/a-entity.test.js
+++ b/tests/core/a-entity.test.js
@@ -418,11 +418,13 @@ suite('a-entity', function () {
});
test('removes itself from scene parent', function (done) {
+ var count;
var el = this.el;
var parentEl = el.parentNode;
+ count = parentEl.object3D.children.length;
parentEl.removeChild(el);
process.nextTick(function () {
- assert.equal(parentEl.object3D.children.length, 3);
+ assert.equal(parentEl.object3D.children.length, count - 1);
done();
});
}); | fix tests from vreffect bump | aframevr_aframe | train | js,js |
42525ffbdcb21d4ea47ad3a9b1457bf9ab47ff60 | diff --git a/components/menu/__tests__/index.test.js b/components/menu/__tests__/index.test.js
index <HASH>..<HASH> 100644
--- a/components/menu/__tests__/index.test.js
+++ b/components/menu/__tests__/index.test.js
@@ -940,14 +940,16 @@ describe('Menu', () => {
it('should support ref', async () => {
const ref = React.createRef();
- const wrapper = mount(
+ const { container } = render(
<Menu ref={ref}>
<SubMenu key="sub1" title="Navigation One">
<Menu.Item key="1">Option 1</Menu.Item>
</SubMenu>
</Menu>,
);
- expect(ref.current?.menu?.list).toBe(wrapper.find('ul').first().getDOMNode());
+ expect(ref.current?.menu?.list).toBe(container.querySelector('ul'));
+ ref.current?.focus();
+ expect(document.activeElement).toBe(container.querySelector('ul'));
});
it('expandIcon', () => { | test: add menu focus test (#<I>) | ant-design_ant-design | train | js |
536df035f2ba0cb390ab4022f62caa3dd0667388 | diff --git a/test/unit/exception_handling/log_error_stub_test.rb b/test/unit/exception_handling/log_error_stub_test.rb
index <HASH>..<HASH> 100644
--- a/test/unit/exception_handling/log_error_stub_test.rb
+++ b/test/unit/exception_handling/log_error_stub_test.rb
@@ -41,7 +41,7 @@ module ExceptionHandling
assert_equal exception_pattern, exception_whitelist[0][0]
begin
ExceptionHandling.log_error("This is a test error")
- rescue Exception
+ rescue StandardError
flunk # Shouldn't raise an error in this case
end
end
@@ -53,7 +53,7 @@ module ExceptionHandling
assert_equal exception_pattern, exception_whitelist[0][0]
begin
ExceptionHandling.log_error("This is a test error")
- rescue Exception
+ rescue StandardError
flunk # Shouldn't raise an error in this case
end
end
diff --git a/test/unit/exception_handling_test.rb b/test/unit/exception_handling_test.rb
index <HASH>..<HASH> 100644
--- a/test/unit/exception_handling_test.rb
+++ b/test/unit/exception_handling_test.rb
@@ -14,7 +14,7 @@ class ExceptionHandlingTest < ActiveSupport::TestCase
data[:user_details] = {}
data[:user_details][:username] = "CaryP"
data[:user_details][:organization] = "Invoca Engineering Dept."
- rescue Exception
+ rescue StandardError
# don't let these out!
end | TECH-<I>-Upgrade Ruby 2 4: fix exception class | Invoca_exception_handling | train | rb,rb |
802c803494c43bcf701f7a654c87628c768d9556 | diff --git a/servlet/src/main/java/io/undertow/servlet/spec/AsyncContextImpl.java b/servlet/src/main/java/io/undertow/servlet/spec/AsyncContextImpl.java
index <HASH>..<HASH> 100644
--- a/servlet/src/main/java/io/undertow/servlet/spec/AsyncContextImpl.java
+++ b/servlet/src/main/java/io/undertow/servlet/spec/AsyncContextImpl.java
@@ -195,6 +195,9 @@ public class AsyncContextImpl implements AsyncContext {
Connectors.executeRootHandler(new HttpHandler() {
@Override
public void handleRequest(final HttpServerExchange exchange) throws Exception {
+ ServletRequestContext src = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY);
+ src.setServletRequest(servletRequest);
+ src.setServletResponse(servletResponse);
servletDispatcher.dispatchToPath(exchange, pathInfo, DispatcherType.ASYNC);
}
}, exchange); | UNDERTOW-<I> Make sure async dispatch happens with current requst/response | undertow-io_undertow | train | java |
ca9c7cb5ed530905c649699356c99f2c6ead5d7e | diff --git a/spyderlib/widgets/varexp/utils.py b/spyderlib/widgets/varexp/utils.py
index <HASH>..<HASH> 100644
--- a/spyderlib/widgets/varexp/utils.py
+++ b/spyderlib/widgets/varexp/utils.py
@@ -5,7 +5,7 @@
# (see spyderlib/__init__.py for details)
"""
-Utilities for the Dictionary Editor Widget and Dialog based on Qt
+Utilities for the Collections editor widget and dialog
"""
from __future__ import print_function | Variable Explorer: Improve another docstring | spyder-ide_spyder | train | py |
831cf10ea0cf55ae6e8104fe528737441bb1bdc1 | diff --git a/intranet/utils/helpers.py b/intranet/utils/helpers.py
index <HASH>..<HASH> 100644
--- a/intranet/utils/helpers.py
+++ b/intranet/utils/helpers.py
@@ -66,7 +66,7 @@ def get_current_commit_long_hash(workdir):
def get_current_commit_info():
- cmd = ["git", "show", "-s", "--format=Commit %h\n%ad", "HEAD"]
+ cmd = ["git", "show", "-s", "--format='Commit %h\n%ad'", "HEAD"]
return subprocess.check_output(cmd, universal_newlines=True).strip() | fix(utils): fix current commit info invocation | tjcsl_ion | train | py |
8ced86b3b1e21581d3c83c5e2c3970ad231f9205 | diff --git a/src/TwigBridge/View/Environment.php b/src/TwigBridge/View/Environment.php
index <HASH>..<HASH> 100644
--- a/src/TwigBridge/View/Environment.php
+++ b/src/TwigBridge/View/Environment.php
@@ -20,7 +20,7 @@ class Environment extends \Illuminate\View\Environment
public function make($view, $data = array(), $mergeData = array())
{
$path = $this->finder->find($view);
- $data = array_merge($data, $mergeData);
+ $data = array_merge($mergeData, $this->parseData($data));
return new View($this, $this->getEngineFromPath($path), $view, $path, $data);
} | Updated Environment class to reflect changes in Laravel. | rcrowe_TwigBridge | train | php |
33e08981ad0aca87fb5dc3e92265241611c83d91 | diff --git a/queryx_test.go b/queryx_test.go
index <HASH>..<HASH> 100644
--- a/queryx_test.go
+++ b/queryx_test.go
@@ -5,8 +5,10 @@
package gocqlx
import (
+ "reflect"
"testing"
+ "github.com/gocql/gocql"
"github.com/google/go-cmp/cmp"
)
@@ -149,3 +151,25 @@ func TestQueryxBindMap(t *testing.T) {
}
})
}
+
+func TestQyeryxAllWrapped(t *testing.T) {
+ var (
+ gocqlQueryPtr = reflect.TypeOf((*gocql.Query)(nil))
+ queryxPtr = reflect.TypeOf((*Queryx)(nil))
+ )
+
+ for i := 0; i < gocqlQueryPtr.NumMethod(); i++ {
+ m, ok := queryxPtr.MethodByName(gocqlQueryPtr.Method(i).Name)
+ if !ok {
+ t.Fatalf("Queryx missing method %s", gocqlQueryPtr.Method(i).Name)
+ }
+
+ t.Log(m.Name)
+
+ for j := 0; j < m.Type.NumOut(); j++ {
+ if m.Type.Out(j) == gocqlQueryPtr {
+ t.Errorf("Queryx method %s not wrapped", m.Name)
+ }
+ }
+ }
+} | queryx: Add test to check that all methods are wrapped | scylladb_gocqlx | train | go |
4d1171df0e6393826866cf66a5371a0cadd6b44f | diff --git a/compliance_checker/cf/util.py b/compliance_checker/cf/util.py
index <HASH>..<HASH> 100644
--- a/compliance_checker/cf/util.py
+++ b/compliance_checker/cf/util.py
@@ -2,10 +2,10 @@ import os
import os.path
import itertools
from lxml import etree
-#try:
-from udunitspy import Unit, UdunitsError, Converter
-#except ImportError:
- #pass #disabled as CF is not working and udunits won't install on centos/rhel yet
+try:
+ from udunitspy import Unit, UdunitsError, Converter
+except ImportError:
+ pass #disabled as CF is not working and udunits won't install on centos/rhel yet
from netCDF4 import Dimension, Variable
from pkgutil import get_data
diff --git a/compliance_checker/suite.py b/compliance_checker/suite.py
index <HASH>..<HASH> 100644
--- a/compliance_checker/suite.py
+++ b/compliance_checker/suite.py
@@ -31,6 +31,7 @@ class CheckSuite(object):
if isinstance(val, list):
return [fix_return_value(v, check_method.im_func.func_name) for v in val]
+
return [fix_return_value(val, check_method.im_func.func_name)]
def _get_valid_checkers(self, ds, checker_names): | Reverted Minor changes in suite.py and util.py | ioos_compliance-checker | train | py,py |
3894ec683ccb3861aa74111c7e1dd309234b7f88 | diff --git a/mithril.js b/mithril.js
index <HASH>..<HASH> 100644
--- a/mithril.js
+++ b/mithril.js
@@ -557,6 +557,7 @@ var m = (function app(window, undefined) {
var controller = function() {
return (component.controller || noop).apply(this, args) || this;
};
+ controller.prototype = component.controller.prototype
var view = function(ctrl) {
if (arguments.length > 1) args = args.concat([].slice.call(arguments, 1));
return component.view.apply(component, args ? [ctrl].concat(args) : [ctrl]); | make controller inherit from prototype if in m.component | MithrilJS_mithril.js | train | js |
6b35dbf2ad356d780192423b2d1d901d1a78eee3 | diff --git a/test/app.js b/test/app.js
index <HASH>..<HASH> 100644
--- a/test/app.js
+++ b/test/app.js
@@ -484,3 +484,22 @@ test('edge-case 1', function *(t) {
}
]);
});
+test('edge-case 2', function *(t) {
+ yield makeTest(t, {trim: true, case: true}, [
+ { handler: { url: '/?a&b', method: 'GET', headers: {} },
+ match : [
+ { url: '/?a=1&b=2', method: 'GET', headers: {}, args: ['1', '2'] },
+ ]
+ }, {
+ handler: { url: '/?a&c', method: 'GET', headers: {} },
+ match : [
+ { url: '/?a=1&c=3', method: 'GET', headers: {}, args: ['1', '3'] },
+ ]
+ }, {
+ catch : { url: '404', method: 'GET', headers: {} },
+ match : [
+ { url: '/?a=1', method: 'GET', headers: {}, args: [/Not Found/] },
+ ]
+ }
+ ]);
+}); | add extra edge-case test for nested queries | Thhethssmuz_nnn | train | js |
33aa42e9db679870c79cef41a551e9977d5a3b8e | diff --git a/sherlock/transient_classifier.py b/sherlock/transient_classifier.py
index <HASH>..<HASH> 100644
--- a/sherlock/transient_classifier.py
+++ b/sherlock/transient_classifier.py
@@ -1329,6 +1329,8 @@ class transient_classifier():
# start_time = time.time()
# print "COLLECTING TRANSIENTS WITH NO ANNOTATIONS"
+ sd
+
if updatePeakMagnitudes:
sqlQuery = u"""
SELECT * from sherlock_crossmatches cm, sherlock_classifications cl where rank =1 and cl.transient_object_id=cm.transient_object_id | fixing memory issue with query that updates the annotations | thespacedoctor_sherlock | train | py |
094bdad6d0ad55c8a7f8397cd2c7618c718288b6 | diff --git a/lib/log4jruby/logger_for_class.rb b/lib/log4jruby/logger_for_class.rb
index <HASH>..<HASH> 100644
--- a/lib/log4jruby/logger_for_class.rb
+++ b/lib/log4jruby/logger_for_class.rb
@@ -9,6 +9,14 @@ module Log4jruby
def klass.logger
@logger ||= Logger.get(name)
end
+
+ def klass.logger=(logger)
+ @logger = logger
+ end
+
+ def klass.set_logger(name, options = {})
+ @logger = Logger.get(name, options)
+ end
end
def logger | Added logger = and set_logger(name, options) | lenny_log4jruby | train | rb |
8e71ed6a4148e541ae0d6b6bb08359236ede6332 | diff --git a/pkg/models/fundingoffer/fundingoffer.go b/pkg/models/fundingoffer/fundingoffer.go
index <HASH>..<HASH> 100644
--- a/pkg/models/fundingoffer/fundingoffer.go
+++ b/pkg/models/fundingoffer/fundingoffer.go
@@ -124,6 +124,15 @@ func FromRaw(raw []interface{}) (o *Offer, err error) {
return
}
+func CancelFromRaw(raw []interface{}) (Cancel, error) {
+ o, err := FromRaw(raw)
+ if err != nil {
+ return Cancel{}, err
+ }
+
+ return Cancel(*o), nil
+}
+
func SnapshotFromRaw(raw []interface{}) (snap *Snapshot, err error) {
if len(raw) == 0 {
return snap, fmt.Errorf("data slice too short for offer: %#v", raw) | ability to explicitly decode raw data to funding offer Cancel structure | bitfinexcom_bitfinex-api-go | train | go |
a9612e92c079ad7c54fdbe487c4cdbfaf1ffb2b2 | diff --git a/llvmlite/binding/targets.py b/llvmlite/binding/targets.py
index <HASH>..<HASH> 100644
--- a/llvmlite/binding/targets.py
+++ b/llvmlite/binding/targets.py
@@ -152,7 +152,8 @@ class TargetData(ffi.ObjectRef):
RELOC = frozenset(['default', 'static', 'pic', 'dynamicnopic'])
-CODEMODEL = frozenset(['default', 'small', 'kernel', 'medium', 'large'])
+CODEMODEL = frozenset(['default', 'defaultjit', 'small', 'kernel', 'medium',
+ 'large'])
class Target(ffi.ObjectRef): | Add missing code model to those accepted.
As title. | numba_llvmlite | train | py |
d8bac8e7df7eaa2dcd91a5387994f9b16422a3da | diff --git a/lib/dnsimple/client.rb b/lib/dnsimple/client.rb
index <HASH>..<HASH> 100644
--- a/lib/dnsimple/client.rb
+++ b/lib/dnsimple/client.rb
@@ -173,7 +173,7 @@ module Dnsimple
elsif access_token
options[:headers][HEADER_AUTHORIZATION] = "Bearer #{access_token}"
else
- raise Error, 'A password, domain API token or OAuth access token is required for all API requests.'
+ raise Error, 'A password, domain API token or access token is required for all API requests.'
end
options
diff --git a/spec/dnsimple/client_spec.rb b/spec/dnsimple/client_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/dnsimple/client_spec.rb
+++ b/spec/dnsimple/client_spec.rb
@@ -59,7 +59,7 @@ describe Dnsimple::Client do
expect {
subject.execute(:get, "test", {})
- }.to raise_error(Dnsimple::Error, "A password, domain API token or OAuth access token is required for all API requests.")
+ }.to raise_error(Dnsimple::Error, "A password, domain API token or access token is required for all API requests.")
end
end | Remove specific mention to Oauth from the message
OAuth token occurrences were renamed to access token. | dnsimple_dnsimple-ruby | train | rb,rb |
b67ec724e6359abda23ae822f843c782bc5de2fd | diff --git a/lib/sidekiq_unique_jobs/version.rb b/lib/sidekiq_unique_jobs/version.rb
index <HASH>..<HASH> 100644
--- a/lib/sidekiq_unique_jobs/version.rb
+++ b/lib/sidekiq_unique_jobs/version.rb
@@ -3,5 +3,5 @@
module SidekiqUniqueJobs
#
# @return [String] the current SidekiqUniqueJobs version
- VERSION = "7.1.26"
+ VERSION = "7.1.27"
end | Bump sidekiq-unique-jobs to <I> | mhenrixon_sidekiq-unique-jobs | train | rb |
816b6e1c76af4ff0c00ab5b06dd8b3e55c97a965 | diff --git a/erizo_controller/erizoClient/src/Stream.js b/erizo_controller/erizoClient/src/Stream.js
index <HASH>..<HASH> 100644
--- a/erizo_controller/erizoClient/src/Stream.js
+++ b/erizo_controller/erizoClient/src/Stream.js
@@ -247,10 +247,15 @@ Erizo.Stream = function (spec) {
return;
if (that.pc){
that.checkOptions(config, true);
- if(that.room.p2p){
- for (var index in that.pc){
- that.pc[index].updateSpec(config, callback);
+ if (that.local){
+ if(that.room.p2p){
+ for (var index in that.pc){
+ that.pc[index].updateSpec(config, callback);
+ }
+ }else{
+ that.pc.updateSpec(config, callback);
}
+
}else{
that.pc.updateSpec(config, callback);
} | Wont apply p2p updateConfiguration to remote streams | lynckia_licode | train | js |
4cf93edb5dbefb95bdf78a374d364137a6f003f4 | diff --git a/pycbc/waveform/spa_tmplt.py b/pycbc/waveform/spa_tmplt.py
index <HASH>..<HASH> 100644
--- a/pycbc/waveform/spa_tmplt.py
+++ b/pycbc/waveform/spa_tmplt.py
@@ -139,12 +139,12 @@ def spa_distance(psd, mass1, mass2, lower_frequency_cutoff, snr=8):
""" Return the distance at a given snr (default=8) of the SPA TaylorF2
template.
"""
- kend = spa_tmplt_end(mass1=mass1, mass2=mass2) / psd.delta_f
+ kend = int(spa_tmplt_end(mass1=mass1, mass2=mass2) / psd.delta_f)
norm1 = spa_tmplt_norm(psd, len(psd), psd.delta_f, lower_frequency_cutoff)
norm2 = (spa_amplitude_factor(mass1=mass1, mass2=mass2)) ** 2.0
if kend >= len(psd):
- kend = len(psd) - 1
+ kend = len(psd) - 2
return sqrt(norm1[kend] * norm2) / snr
@schemed("pycbc.waveform.spa_tmplt_") | fixes to spa for python3 (#<I>)
* fixes to spa for python3
* fixes | gwastro_pycbc | train | py |
43175f0167fc0aba7b8bf64abb9626f54de963bc | diff --git a/agent/engine/common_test.go b/agent/engine/common_test.go
index <HASH>..<HASH> 100644
--- a/agent/engine/common_test.go
+++ b/agent/engine/common_test.go
@@ -184,11 +184,7 @@ func addTaskToEngine(t *testing.T,
createStartEventsReported sync.WaitGroup) {
// steadyStateCheckWait is used to force the test to wait until the steady-state check
// has been invoked at least once
- steadyStateVerify := make(chan time.Time, 1)
mockTime.EXPECT().Now().Return(time.Now()).AnyTimes()
- gomock.InOrder(
- mockTime.EXPECT().After(steadyStateTaskVerifyInterval).Return(steadyStateVerify).AnyTimes(),
- )
err := taskEngine.Init(ctx)
assert.NoError(t, err) | engine: remove mock validations for time.After() | aws_amazon-ecs-agent | train | go |
63dfd1a23ae6d8b50a4cf2efa8ee481d6a29adc8 | diff --git a/salt/cloud/clouds/joyent.py b/salt/cloud/clouds/joyent.py
index <HASH>..<HASH> 100644
--- a/salt/cloud/clouds/joyent.py
+++ b/salt/cloud/clouds/joyent.py
@@ -107,6 +107,8 @@ VALID_RESPONSE_CODES = [
http_client.NO_CONTENT
]
+DEFAULT_NETWORKS = ['Joyent-SDC-Public']
+
# Only load in this module if the Joyent configurations are in place
def __virtual__():
@@ -281,7 +283,7 @@ def create(vm_):
salt.utils.cloud.check_name(vm_['name'], 'a-zA-Z0-9-.')
kwargs = {
'name': vm_['name'],
- 'networks': vm_['networks'],
+ 'networks': vm_.get('networks', DEFAULT_NETWORKS),
'image': get_image(vm_),
'size': get_size(vm_),
'location': vm_.get('location', DEFAULT_LOCATION) | Added safer .get method to vm_ 'networks' dictionary | saltstack_salt | train | py |
1827499c2e834072c488c5ec7b1e67eccde8e4ea | diff --git a/src/Select/partials/SelectInputFieldSize.js b/src/Select/partials/SelectInputFieldSize.js
index <HASH>..<HASH> 100644
--- a/src/Select/partials/SelectInputFieldSize.js
+++ b/src/Select/partials/SelectInputFieldSize.js
@@ -1,7 +1,7 @@
import styled from 'styled-components'
import SelectInputField from './SelectInputField';
-export default SelectInputField.withComponent('div').extend`
+export default styled(SelectInputField.withComponent('div'))`
position: absolute;
top: 0px;
left: 0px; | Remove use of extend API
To prevent warning
`Warning: The "extend" API will be removed in the upcoming <I> release. Use styled(StyledComponent) instead. You can find more information here: <URL> | agutoli_react-styled-select | train | js |
c4c3e74abae8a4466522d2a7f33aedba35bb00d0 | diff --git a/intake/source/cache.py b/intake/source/cache.py
index <HASH>..<HASH> 100644
--- a/intake/source/cache.py
+++ b/intake/source/cache.py
@@ -60,12 +60,12 @@ class BaseCache(object):
"""
self._driver = driver
self._spec = spec
- cd = cache_dir or spec.get('cache_dir', conf['cache_dir'])
+ cd = cache_dir or conf['cache_dir']
if cd == 'catdir':
if catdir is None:
raise TypeError('cache_dir="catdir" only allowed when loaded'
'from a catalog file.')
- cd = catdir
+ cd = os.path.join(catdir, 'intake_cache')
self._cache_dir = cd
self._storage_options = storage_options | Don't allow cachedir in spec, only config | intake_intake | train | py |
21f6c44b054511e1d49f2814be1a101d8b3ceabb | diff --git a/lib/filterlib.php b/lib/filterlib.php
index <HASH>..<HASH> 100644
--- a/lib/filterlib.php
+++ b/lib/filterlib.php
@@ -199,4 +199,30 @@ function filter_phrases ($text, $link_array, $ignoretagsopen=NULL, $ignoretagscl
}
+
+
+function filter_remove_duplicates($linkarray) {
+
+ $concepts = array(); // keep a record of concepts as we cycle through
+ $lconcepts = array(); // a lower case version for case insensitive
+
+ $cleanlinks = array();
+
+ foreach ($linkarray as $key=>$filterobject) {
+ if ($filterobject->casesensitive) {
+ $exists = in_array($filterobject->phrase, $concepts);
+ } else {
+ $exists = in_array(strtolower($filterobject->phrase), $lconcepts);
+ }
+
+ if (!$exists) {
+ $cleanlinks[] = $filterobject;
+ $concepts[] = $filterobject->phrase;
+ $lconcepts[] = strtolower($filterobject->phrase);
+ }
+ }
+
+ return $cleanlinks;
+}
+
?> | New function to remove duplicate entries from an array of filterobjects | moodle_moodle | train | php |
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.