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
|
|---|---|---|---|---|---|
f7969b3845d675b70055e6f50f4687149f90103f
|
diff --git a/src/Selection.js b/src/Selection.js
index <HASH>..<HASH> 100644
--- a/src/Selection.js
+++ b/src/Selection.js
@@ -80,7 +80,7 @@ class Selection {
, collides, offsetData;
// Right clicks
- if (e.which === 3 || e.button === 2 || !isOverContainer(node, e.pageX, e.pageY))
+ if (e.which === 3 || e.button === 2 || !isOverContainer(node, e.clientX, e.clientY))
return;
if (!this.globalMouse && node && !contains(node, e.target)) {
|
[fixed] use client coords to get node during selection
|
intljusticemission_react-big-calendar
|
train
|
js
|
9c14a43df82dba21f3b015a40777046f40e842f0
|
diff --git a/tests/model/test_exif.py b/tests/model/test_exif.py
index <HASH>..<HASH> 100644
--- a/tests/model/test_exif.py
+++ b/tests/model/test_exif.py
@@ -37,7 +37,7 @@ class TestOcrdExif(TestCase):
self.assertEqual(exif.photometricInterpretation, '1')
def test_png2(self):
- exif = OcrdExif(Image.open(assets.path_to('scribo-test/data/OCR-D-IMG-BIN-SAUVOLA/OCR-D-IMG-orig_sauvola_png.jpg')))
+ exif = OcrdExif(Image.open(assets.path_to('scribo-test/data/OCR-D-IMG-BIN-SAUVOLA/OCR-D-SEG-PAGE-SAUVOLA-orig_tiff-BIN_sauvola.png')))
self.assertEqual(exif.width, 2097)
self.assertEqual(exif.height, 3062)
self.assertEqual(exif.xResolution, 1)
|
fix test regression from OCR-D/assets#<I>
|
OCR-D_core
|
train
|
py
|
30736ec76017e26369e00a56ad4578dc27ef008f
|
diff --git a/lib/passport/index.js b/lib/passport/index.js
index <HASH>..<HASH> 100644
--- a/lib/passport/index.js
+++ b/lib/passport/index.js
@@ -109,6 +109,15 @@ Passport.prototype.session = function() {
*
* Examples:
*
+ * passport.authenticate('local', { successRedirect: '/', failureRedirect: '/login' })(req, res);
+ *
+ * passport.authenticate('local', function(err, user) {
+ * if (!user) { return res.redirect('/login'); }
+ * res.end('Authenticated!');
+ * })(req, res);
+ *
+ * req.authenticate('basic', { session: false })(req, res);
+ *
* app.get('/auth/twitter', passport.authenticate('twitter'), function(req, res) {
* // request will be redirected to Twitter
* });
@@ -116,6 +125,9 @@ Passport.prototype.session = function() {
* res.json(req.user);
* });
*
+ * @param {String} strategy
+ * @param {Object} options
+ * @param {Function} callback
* @return {Function} middleware
* @api public
*/
|
Add additional examples to passport.authenticate().
|
jaredhanson_passport
|
train
|
js
|
7c7fd86a456581e578eb17000a1e445fe50bb7c0
|
diff --git a/src/main/resources/admin-ui/js/robe/ProfileManagement.js b/src/main/resources/admin-ui/js/robe/ProfileManagement.js
index <HASH>..<HASH> 100644
--- a/src/main/resources/admin-ui/js/robe/ProfileManagement.js
+++ b/src/main/resources/admin-ui/js/robe/ProfileManagement.js
@@ -31,6 +31,10 @@ function initializeProfileManagement() {
success: function (response) {
console.log(response);
showToast("success", "Profil bilgileriniz başarı ile güncellendi.");
+
+ /* LOGOUT */
+ $.cookie.destroy("MedyAuthToken");
+ location.reload();
},
error: function (jqXHR, textStatus, errorThrown) {
console.log(errorThrown);
|
ROBE-<I> cookie destroyed in client-side
|
robeio_robe
|
train
|
js
|
ae7486bc591fe9586d830b266b2faa148b719fda
|
diff --git a/inigo_suite_test.go b/inigo_suite_test.go
index <HASH>..<HASH> 100644
--- a/inigo_suite_test.go
+++ b/inigo_suite_test.go
@@ -269,13 +269,13 @@ func beforeSuite(encodedSharedContext []byte) {
context.SharedContext.NsyncListenerPath,
"-etcdCluster", strings.Join(context.EtcdRunner.NodeURLS(), ","),
"-natsAddresses", fmt.Sprintf("127.0.0.1:%d", context.NatsPort),
+ "-circuses", `{"`+context.RepStack+`":"some-lifecycle-bundle.tgz"}`,
+ "-repAddrRelativeToExecutor", fmt.Sprintf("127.0.0.1:%d", context.RepPort),
)
context.AppManagerRunner = app_manager_runner.New(
context.SharedContext.AppManagerPath,
context.EtcdRunner.NodeURLS(),
- map[string]string{context.RepStack: "some-lifecycle-bundle.tgz"},
- fmt.Sprintf("127.0.0.1:%d", context.RepPort),
)
context.FileServerRunner = fileserver_runner.New(
|
move circus/rep addr config to nsync
|
cloudfoundry_inigo
|
train
|
go
|
6b9025bf1584ea0a1dd1ad0f4fccdb604c86bec4
|
diff --git a/spec/unit/interface/face_collection_spec.rb b/spec/unit/interface/face_collection_spec.rb
index <HASH>..<HASH> 100755
--- a/spec/unit/interface/face_collection_spec.rb
+++ b/spec/unit/interface/face_collection_spec.rb
@@ -30,8 +30,8 @@ describe Puppet::Interface::FaceCollection do
after :all do
# Restore global state
- subject.instance_variable_set :@faces, @faces
- subject.instance_variable_set :@loaded, @faces_loaded
+ described_class.instance_variable_set :@faces, @faces
+ described_class.instance_variable_set :@loaded, @faces_loaded
$".delete_if { |path| path =~ /face\/.*\.rb$/ }
@required.each { |path| $".push path unless $".include? path }
Puppet::Util::Autoload.instance_variable_set(:@loaded, @loaded)
|
(PUP-<I>) Fix a use of 'subject' in an after hook
|
puppetlabs_puppet
|
train
|
rb
|
bf35f5b80578d1508fe29e8dffd998570eb633b7
|
diff --git a/src/Parser/BaseParser.php b/src/Parser/BaseParser.php
index <HASH>..<HASH> 100644
--- a/src/Parser/BaseParser.php
+++ b/src/Parser/BaseParser.php
@@ -1,10 +1,5 @@
<?php
-/**
- * @file
- * Contains \Hedron\Parser\BaseParser.
- */
-
namespace Hedron\Parser;
use EclipseGc\Plugin\PluginDefinitionInterface;
|
removing a non-essential file comment
|
HedronDev_hedron
|
train
|
php
|
6b0b3158ff5e10aa6212aa1f9f51b20da71d2a75
|
diff --git a/test/actions/nodesSpec.js b/test/actions/nodesSpec.js
index <HASH>..<HASH> 100644
--- a/test/actions/nodesSpec.js
+++ b/test/actions/nodesSpec.js
@@ -60,6 +60,7 @@ describe('Node actions with dependencies', () => {
x: 10,
y: 10,
},
+ properties: {},
},
},
pins: {
|
fix(tests): fix nodesSpec tests (missing new property "properties")
|
xodio_xod
|
train
|
js
|
fc269bed858399ff2a8c5fbb64829e5ca4be1019
|
diff --git a/Controller/Tool/RolesController.php b/Controller/Tool/RolesController.php
index <HASH>..<HASH> 100644
--- a/Controller/Tool/RolesController.php
+++ b/Controller/Tool/RolesController.php
@@ -401,8 +401,8 @@ class RolesController extends Controller
{
$this->checkAccess($workspace);
$this->roleManager->associateRolesToSubjects($users, $roles, true);
- $listCptNodes = $this->cptManager->getCompetenceByWorkspace($workspace);
- $this->cptManager->subscribeUserToCompetences($users, $listCptNodes);
+ //$listCptNodes = $this->cptManager->getCompetenceByWorkspace($workspace);
+ //$this->cptManager->subscribeUserToCompetences($users, $listCptNodes);
return new Response('success');
}
|
[CoreBundle] Commenting broken code.
|
claroline_Distribution
|
train
|
php
|
91b434ba3daba177c2a352150322e61d85ba0a3d
|
diff --git a/pandas/core/panel.py b/pandas/core/panel.py
index <HASH>..<HASH> 100644
--- a/pandas/core/panel.py
+++ b/pandas/core/panel.py
@@ -1930,16 +1930,20 @@ def _get_combined_index(frames, intersect=False):
if intersect:
combine = Index.intersection
+ copy = Index
+ unique = lambda x: x
else:
- combine = Index.union
+ combine = lambda a, b: np.concatenate((a, b))
+ copy = np.array
+ unique = lambda x: Index(np.unique(x))
for _, frame in frames.iteritems():
if index is None:
- index = frame.index
+ index = copy(frame.index)
elif index is not frame.index:
index = combine(index, frame.index)
- return index
+ return unique(index)
def pivot(index, columns, values):
"""
|
ENH: contrib perf optimization in panel homogenization routine
|
pandas-dev_pandas
|
train
|
py
|
ad7314f5b173476227f2933841a912e2c04c7c08
|
diff --git a/lib/octocatalog-diff/catalog.rb b/lib/octocatalog-diff/catalog.rb
index <HASH>..<HASH> 100644
--- a/lib/octocatalog-diff/catalog.rb
+++ b/lib/octocatalog-diff/catalog.rb
@@ -222,7 +222,7 @@ module OctocatalogDiff
else
source_file
end
- "(#{filename}:#{line_number})"
+ "(#{filename.sub(%r{^environments/production/}, '')}:#{line_number})"
end
# Private method: Format the missing references into human-readable text
|
Drop environments/production from the start of file names
|
github_octocatalog-diff
|
train
|
rb
|
2e2a840899d41fa62e067336d81209a616621c08
|
diff --git a/lib/web.route.handler.js b/lib/web.route.handler.js
index <HASH>..<HASH> 100644
--- a/lib/web.route.handler.js
+++ b/lib/web.route.handler.js
@@ -48,7 +48,7 @@ function convertUrlSegmentToRegex(segment) {
return '(' + pieces[1].substring(0, pieces[1].length - 1) + ')';
}
else if (pieces.length === 1) {
- return segment.substring(0, beginIdx) + '[a-zA-Z0-9\\-_~]+' + segment.substring(endIdx + 1);
+ return segment.substring(0, beginIdx) + '[^\\/]+' + segment.substring(endIdx + 1);
}
else {
throw new Error('Weird URL segment- don\'t know how to parse! ' + segment);
|
correctly allow more characters in url path parts for parsing
|
gethuman_pancakes
|
train
|
js
|
b7b95f7d16a4a4d87639f4edbd7636a56daa3ace
|
diff --git a/transfer/adapterbase.go b/transfer/adapterbase.go
index <HASH>..<HASH> 100644
--- a/transfer/adapterbase.go
+++ b/transfer/adapterbase.go
@@ -99,6 +99,7 @@ func (a *adapterBase) worker(workerNum int) {
if signalAuthOnResponse {
authCallback = func() {
a.authWait.Done()
+ signalAuthOnResponse = false
}
}
tracerx.Printf("xfer: adapter %q worker %d processing job for %q", a.Name(), workerNum, t.Object.Oid)
@@ -110,9 +111,6 @@ func (a *adapterBase) worker(workerNum int) {
a.outChan <- res
}
- // Only need to signal for auth once
- signalAuthOnResponse = false
-
tracerx.Printf("xfer: adapter %q worker %d finished job for %q", a.Name(), workerNum, t.Object.Oid)
}
// This will only happen if no jobs were submitted; just wake up all workers to finish
|
Fix retry; only confirm that auth signal done when auth func called
|
git-lfs_git-lfs
|
train
|
go
|
b1cff118c7626d44156bad7f8435346086b1b79e
|
diff --git a/lib/datalib.php b/lib/datalib.php
index <HASH>..<HASH> 100644
--- a/lib/datalib.php
+++ b/lib/datalib.php
@@ -698,6 +698,11 @@ function get_courses_wmanagers($categoryid=0, $sort="c.sortorder ASC", $fields=a
return array(); // no courses!
}
+ $CFG->coursemanager = trim($CFG->coursemanager);
+ if (empty($CFG->coursemanager)) {
+ return $courses;
+ }
+
$managerroles = split(',', $CFG->coursemanager);
$catctxids = '';
if (count($managerroles)) {
|
datalib:get_courses_wmanagers() handle empty $CFG->coursemanager more gracefully
Having no roles set as coursemanager is a valid setting.
get_courses_wmanagers() should not produce invalid SQL on it...
actually, it should not even try to get the course managers.
|
moodle_moodle
|
train
|
php
|
cd552961e3610b840d9198ac6c1f972a780495b2
|
diff --git a/structr-core/src/main/java/org/structr/core/graph/Tx.java b/structr-core/src/main/java/org/structr/core/graph/Tx.java
index <HASH>..<HASH> 100644
--- a/structr-core/src/main/java/org/structr/core/graph/Tx.java
+++ b/structr-core/src/main/java/org/structr/core/graph/Tx.java
@@ -46,7 +46,7 @@ public class Tx implements AutoCloseable {
}
public Tx(final SecurityContext securityContext, final StructrApp app, final boolean doValidation, final boolean doCallbacks) {
- this(securityContext, app, doValidation, doCallbacks, true);
+ this(securityContext, app, doValidation, doCallbacks, ((securityContext == null) ? true : securityContext.isDoTransactionNotifications()));
}
public Tx(final SecurityContext securityContext, final StructrApp app, final boolean doValidation, final boolean doCallbacks, final boolean doNotifications) {
|
use the transaction notification flag from securityContext by default
|
structr_structr
|
train
|
java
|
ee3b72ebb4ca355488bf06affda6b67ec913b7d7
|
diff --git a/src/WebPageInspector.php b/src/WebPageInspector.php
index <HASH>..<HASH> 100644
--- a/src/WebPageInspector.php
+++ b/src/WebPageInspector.php
@@ -7,10 +7,6 @@ use webignition\WebResourceInterfaces\WebPageInterface;
class WebPageInspector
{
- const CHARSET_GB2312 = 'GB2312';
- const CHARSET_BIG5 = 'BIG5';
- const CHARSET_UTF_8 = 'UTF-8';
-
/**
* @var WebPageInterface
*/
|
Remove WebPageInspector::CHARSET_* constants (#<I>)
|
webignition_web-page-inspector
|
train
|
php
|
df6b146ae66560777d797c0399dbf9b2db189e47
|
diff --git a/packages/feedback/src/FeedbackForm.js b/packages/feedback/src/FeedbackForm.js
index <HASH>..<HASH> 100644
--- a/packages/feedback/src/FeedbackForm.js
+++ b/packages/feedback/src/FeedbackForm.js
@@ -211,7 +211,6 @@ const FeedbackForm = ({
onClick={onClose}
color="secondary"
onKeyDown={({ keyCode }) => {
- console.log(keyCode);
if (keyCode === 13) {
onClose();
}
|
fix(feedback): removed console log
|
Availity_availity-react
|
train
|
js
|
465cf5be889fcfde0b8c77aaa3414cb43dbcff75
|
diff --git a/src/Sulu/Bundle/WebsocketBundle/Controller/FallbackController.php b/src/Sulu/Bundle/WebsocketBundle/Controller/FallbackController.php
index <HASH>..<HASH> 100644
--- a/src/Sulu/Bundle/WebsocketBundle/Controller/FallbackController.php
+++ b/src/Sulu/Bundle/WebsocketBundle/Controller/FallbackController.php
@@ -49,6 +49,12 @@ class FallbackController
$app->onMessage($connection, $message);
+ // clean output buffer if there is data in it
+ // happens if a twig error occurs
+ if (ob_get_length() > 0) {
+ ob_clean();
+ }
+
return new Response($connection->getData(), 200, array('Content-Type' => 'application/json'));
}
}
|
added ob_clean if outputbuffer is not empty
|
sulu_sulu
|
train
|
php
|
e2acfdb52d290f43393cb1da20003fac218b4cfc
|
diff --git a/Swat/SwatFrame.php b/Swat/SwatFrame.php
index <HASH>..<HASH> 100644
--- a/Swat/SwatFrame.php
+++ b/Swat/SwatFrame.php
@@ -28,6 +28,13 @@ class SwatFrame extends SwatContainer implements SwatTitleable
public $subtitle = null;
/**
+ * An optional string to separate subtitle from the title
+ *
+ * @var string
+ */
+ public $title_separator = ': ';
+
+ /**
* Gets the title of this frame
*
* Implements the {SwatTitleable::getTitle()} interface.
@@ -93,7 +100,7 @@ class SwatFrame extends SwatContainer implements SwatTitleable
$header_tag->open();
$header_tag->displayContent();
- echo ' ';
+ echo $this->title_separator;
$span_tag->display();
$header_tag->close();
}
|
Replace hardcoded space between title and subtitle with a public property named $title_seperator that defaults to ': '.
svn commit r<I>
|
silverorange_swat
|
train
|
php
|
3b1a0b9f16da2c30e405b983563c9c1483f61ec3
|
diff --git a/src/core/renderers/webgl/managers/FilterManager.js b/src/core/renderers/webgl/managers/FilterManager.js
index <HASH>..<HASH> 100644
--- a/src/core/renderers/webgl/managers/FilterManager.js
+++ b/src/core/renderers/webgl/managers/FilterManager.js
@@ -106,7 +106,7 @@ FilterManager.prototype.popFilter = function()
if(filters.length === 1)
{
- filters[0].apply(this, currentState.renderTarget, lastState.renderTarget, false);
+ filters[0].apply(this, currentState.renderTarget, lastState.renderTarget, true);
this.freePotRenderTarget(currentState.renderTarget);
}
else
|
Merged in dev conflict
# Conflicts:
# src/core/renderers/webgl/managers/FilterManager.js
|
pixijs_pixi.js
|
train
|
js
|
54fd3c8b068d8d841f2e6ad8538c2c3e2069df1a
|
diff --git a/lib/perobs/IndexTreeNode.rb b/lib/perobs/IndexTreeNode.rb
index <HASH>..<HASH> 100644
--- a/lib/perobs/IndexTreeNode.rb
+++ b/lib/perobs/IndexTreeNode.rb
@@ -190,8 +190,8 @@ module PEROBS
# Recursively check this node and all sub nodes. Compare the found
# ID/address pairs with the corresponding entry in the given FlatFile.
# @param flat_file [FlatFile]
- # @tree_level [Fixnum] Assumed level in the tree. Must correspond with
- # @nibble_idx
+ # @param tree_level [Fixnum] Assumed level in the tree. Must correspond
+ # with @nibble_idx
# @return [Boolean] true if no errors were found, false otherwise
def check(flat_file, tree_level)
if tree_level >= 16
diff --git a/lib/perobs/Store.rb b/lib/perobs/Store.rb
index <HASH>..<HASH> 100644
--- a/lib/perobs/Store.rb
+++ b/lib/perobs/Store.rb
@@ -160,7 +160,6 @@ module PEROBS
# Copy the store content into a new Store. The arguments are identical to
# Store.new().
- # @param data_base [String] the name of the database
# @param options [Hash] various options to affect the operation of the
def copy(dir, options = {})
# Make sure all objects are persisted.
|
Fix: Eliminate yardoc warnings.
|
scrapper_perobs
|
train
|
rb,rb
|
fa610e926620e74cdbedae0caa663aba719e8b7d
|
diff --git a/tests/Core/ModuleResolver/ResolverStackTest.php b/tests/Core/ModuleResolver/ResolverStackTest.php
index <HASH>..<HASH> 100644
--- a/tests/Core/ModuleResolver/ResolverStackTest.php
+++ b/tests/Core/ModuleResolver/ResolverStackTest.php
@@ -43,7 +43,7 @@ class ResolverStackTest extends PHPUnit_Framework_TestCase
$allResolvers = $property->getValue($stack);
$theResolver = array_shift($allResolvers);
- $this->assertInstanceOf('Slender\Interface\ModuleResolverInterface',$theResolver);
+ $this->assertInstanceOf('Slender\Interfaces\ModuleResolverInterface',$theResolver);
}
|
need to write tests for the tests i think...
|
alanpich_slender
|
train
|
php
|
17504863e5a041fabf23e03b2b7b1b961284fe2a
|
diff --git a/src/main/java/com/buschmais/jqassistant/plugin/maven3/api/scanner/MavenScope.java b/src/main/java/com/buschmais/jqassistant/plugin/maven3/api/scanner/MavenScope.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/buschmais/jqassistant/plugin/maven3/api/scanner/MavenScope.java
+++ b/src/main/java/com/buschmais/jqassistant/plugin/maven3/api/scanner/MavenScope.java
@@ -10,20 +10,20 @@ public enum MavenScope implements Scope {
PROJECT {
@Override
- public void create(ScannerContext context) {
+ public void onEnter(ScannerContext context) {
}
@Override
- public void destroy(ScannerContext context) {
+ public void onLeave(ScannerContext context) {
}
},
REPOSITORY {
@Override
- public void create(ScannerContext context) {
+ public void onEnter(ScannerContext context) {
}
@Override
- public void destroy(ScannerContext context) {
+ public void onLeave(ScannerContext context) {
}
};
|
Renamed methods in the Scope interface and added some JavaDoc.
|
buschmais_jqa-maven3-plugin
|
train
|
java
|
4c65772c4455404af65d988cd5e2873961598a59
|
diff --git a/lib/jekyll/utils.rb b/lib/jekyll/utils.rb
index <HASH>..<HASH> 100644
--- a/lib/jekyll/utils.rb
+++ b/lib/jekyll/utils.rb
@@ -6,7 +6,7 @@ module Jekyll
autoload :Ansi, "jekyll/utils/ansi"
# Constants for use in #slugify
- SLUGIFY_MODES = %w(raw default pretty urlsafe)
+ SLUGIFY_MODES = %w(raw default pretty ascii)
SLUGIFY_RAW_REGEXP = Regexp.new('\\s+').freeze
SLUGIFY_DEFAULT_REGEXP = Regexp.new('[^[:alnum:]]+').freeze
SLUGIFY_PRETTY_REGEXP = Regexp.new("[^[:alnum:]._~!$&'()+,;=@]+").freeze
|
One final "urlsafe" replaced with "ascii"
|
jekyll_jekyll
|
train
|
rb
|
9583427da1434c690a7a25a6526d3b2b8bfde315
|
diff --git a/backtrader/strategy.py b/backtrader/strategy.py
index <HASH>..<HASH> 100644
--- a/backtrader/strategy.py
+++ b/backtrader/strategy.py
@@ -497,11 +497,13 @@ class Strategy(with_metaclass(MetaStrategy, StrategyBase)):
size = abs(size or possize)
if possize > 0:
- return self.sell(data, size, price, exectype, valid,
+ return self.sell(data=data, size=size, price=price,
+ exectype=exectype, valid=valid,
tradeid=tradeid, **kwargs)
elif possize < 0:
- return self.buy(data, size, price, exectype, valid,
- tradeid=tradeid, **kwargs)
+ return self.sell(data=data, size=size, price=price,
+ exectype=exectype, valid=valid,
+ tradeid=tradeid, **kwargs)
return None
|
Correct method close of strategy by using kwargs which was not taking into account the existence of a plimit parameter in methods buy/sell and would pass the execution type as plimit
|
backtrader_backtrader
|
train
|
py
|
f73dcfe68fb621f868b7cde2eaf60c38509bf1cc
|
diff --git a/monitor/schedule_test.go b/monitor/schedule_test.go
index <HASH>..<HASH> 100644
--- a/monitor/schedule_test.go
+++ b/monitor/schedule_test.go
@@ -286,7 +286,7 @@ func agentSchedule(t *testing.T, td *testData, queue *mockQueue,
// Tick here on purpose, so that not all events are ignored because
// the offering's been deleted.
ticker.tick()
- queue.awaitCompletion(time.Second)
+ queue.awaitCompletion(time.Second * 5)
}
func clientSchedule(t *testing.T, td *testData, queue *mockQueue,
@@ -474,7 +474,7 @@ func clientSchedule(t *testing.T, td *testData, queue *mockQueue,
// Tick here on purpose, so that not all events are ignored because
// the offering's been deleted.
ticker.tick()
- queue.awaitCompletion(time.Second)
+ queue.awaitCompletion(time.Second * 5)
}
func commonSchedule(t *testing.T, td *testData, queue *mockQueue,
@@ -504,7 +504,7 @@ func commonSchedule(t *testing.T, td *testData, queue *mockQueue,
// Tick here on purpose, so that not all events are ignored because
// the offering's been deleted.
ticker.tick()
- queue.awaitCompletion(time.Second)
+ queue.awaitCompletion(time.Second * 5)
}
func scheduleTest(t *testing.T, td *testData, queue *mockQueue,
|
Increased timeout for `mockQueue.awaitCompletion`
|
Privatix_dappctrl
|
train
|
go
|
5438c6699dceae74228342dc0ff4ef05243f2b34
|
diff --git a/php/WP_CLI/Bootstrap/DefineProtectedCommands.php b/php/WP_CLI/Bootstrap/DefineProtectedCommands.php
index <HASH>..<HASH> 100644
--- a/php/WP_CLI/Bootstrap/DefineProtectedCommands.php
+++ b/php/WP_CLI/Bootstrap/DefineProtectedCommands.php
@@ -40,7 +40,7 @@ final class DefineProtectedCommands implements BootstrapStep {
private function get_protected_commands() {
return array(
'cli info',
- 'package',
+ 'package',
);
}
|
CS for php/WP_CLI/Bootstrap/*
Auto-fixing of sniffs no longer excluded.
See #<I>.
|
wp-cli_wp-cli
|
train
|
php
|
ec143ac3f813bedaf05360aeb6050db3ef36a821
|
diff --git a/promise/promise.py b/promise/promise.py
index <HASH>..<HASH> 100644
--- a/promise/promise.py
+++ b/promise/promise.py
@@ -818,7 +818,7 @@ class Promise(Generic[T]):
)
-_type_done_callbacks = WeakKeyDictionary() # type: Dict[type, bool]
+_type_done_callbacks = WeakKeyDictionary()
def is_future_like(_type):
|
Remove incorrect type annotation
mypy complained that WeakKeyDictionary is not a Dict[type, bool].
|
syrusakbary_promise
|
train
|
py
|
492b666266c9b67a695476ead616a06e1f92c0d0
|
diff --git a/src/werkzeug/middleware/shared_data.py b/src/werkzeug/middleware/shared_data.py
index <HASH>..<HASH> 100644
--- a/src/werkzeug/middleware/shared_data.py
+++ b/src/werkzeug/middleware/shared_data.py
@@ -35,7 +35,7 @@ class SharedDataMiddleware(object):
environments or simple server setups. Usage is quite simple::
import os
- from werkzeug.wsgi import SharedDataMiddleware
+ from werkzeug.middleware.shared_data import SharedDataMiddleware
app = SharedDataMiddleware(app, {
'/static': os.path.join(os.path.dirname(__file__), 'static')
|
Update documentation of SharedDataMiddleware
Let the doc of SharedDataMiddleware reflect its move to middleware.shared_data
|
pallets_werkzeug
|
train
|
py
|
907fe255a1eb1bc6b227a5beb6aa144a37d3e422
|
diff --git a/OpenPNM/Utilities/misc.py b/OpenPNM/Utilities/misc.py
index <HASH>..<HASH> 100644
--- a/OpenPNM/Utilities/misc.py
+++ b/OpenPNM/Utilities/misc.py
@@ -1,5 +1,5 @@
import scipy as _sp
-import time
+import time as _time
def iscoplanar(coords):
r'''
@@ -48,8 +48,8 @@ def tic():
Homemade version of matlab tic and toc function, tic starts or resets
the clock, toc reports the time since the last call of tic.
'''
- global startTime_for_tictoc
- startTime_for_tictoc = time.time()
+ global _startTime_for_tictoc
+ _startTime_for_tictoc = _time.time()
def toc(quiet=False):
r'''
@@ -62,8 +62,8 @@ def toc(quiet=False):
If False (default) then a message is output to the console. If True
the message is not displayed and the elapsed time is returned.
'''
- if 'startTime_for_tictoc' in globals():
- t = time.time() - startTime_for_tictoc
+ if '_startTime_for_tictoc' in globals():
+ t = _time.time() - _startTime_for_tictoc
if quiet == False:
print('Elapsed time in seconds: ', t)
else:
|
A few updates to misc
- it is important to import other modules preceded with an underscore, or else they pollute the namespace
Former-commit-id: <I>a5b<I>b<I>d8da6c4bac3d6c9a<I>ae
Former-commit-id: 8f<I>be5dd<I>caf<I>e<I>abefdc<I>a<I>bdaaf<I>d
|
PMEAL_OpenPNM
|
train
|
py
|
f045705aeaceeb80e4be8877ddb2a6435defc770
|
diff --git a/src/Commands/Import.php b/src/Commands/Import.php
index <HASH>..<HASH> 100644
--- a/src/Commands/Import.php
+++ b/src/Commands/Import.php
@@ -104,8 +104,11 @@ class Import extends Command
foreach ($users as $user) {
try {
+ // Get the users credentials array.
+ $credentials = $this->getUserCredentials($user);
+
// Import the user and retrieve it's model.
- $model = $this->getImporter()->run($user, $this->model());
+ $model = $this->getImporter()->run($user, $this->model(), $credentials);
$password = str_random();
@@ -225,6 +228,20 @@ class Import extends Command
}
/**
+ * Returns the specified users credentials array.
+ *
+ * @param User $user
+ *
+ * @return array
+ */
+ protected function getUserCredentials(User $user)
+ {
+ return [
+ $this->getResolver()->getEloquentUsername() => $user->getFirstAttribute($this->getResolver()->getLdapUsername())
+ ];
+ }
+
+ /**
* Saves the specified user with its model.
*
* @param User $user
|
Fixed retrieving the existing users model during import.
|
Adldap2_Adldap2-Laravel
|
train
|
php
|
21cf9e4a7214a97fa2c81c84cd970aac30311dda
|
diff --git a/lib/arel.rb b/lib/arel.rb
index <HASH>..<HASH> 100644
--- a/lib/arel.rb
+++ b/lib/arel.rb
@@ -1,5 +1,4 @@
require 'active_support/inflector'
-require 'active_support/core_ext/class/attribute_accessors'
require 'active_support/core_ext/module/delegation'
require 'active_support/core_ext/object/blank'
diff --git a/lib/arel/engines/sql/relations/table.rb b/lib/arel/engines/sql/relations/table.rb
index <HASH>..<HASH> 100644
--- a/lib/arel/engines/sql/relations/table.rb
+++ b/lib/arel/engines/sql/relations/table.rb
@@ -2,7 +2,16 @@ module Arel
class Table
include Relation, Recursion::BaseCase
- cattr_accessor :engine, :tables
+ @@engine = nil
+ @@tables = nil
+ class << self # FIXME: Do we really need these?
+ def engine; @@engine; end
+ def engine= e; @@engine = e; end
+
+ def tables; @@tables; end
+ def tables= e; @@tables = e; end
+ end
+
attr_reader :name, :engine, :table_alias, :options
def initialize(name, options = {})
|
removing cattr_accessor
|
rails_rails
|
train
|
rb,rb
|
ec5eeb82632f6f68208ddefa26f6903e00dee64d
|
diff --git a/backbone-formview.js b/backbone-formview.js
index <HASH>..<HASH> 100644
--- a/backbone-formview.js
+++ b/backbone-formview.js
@@ -1117,7 +1117,7 @@
} else {
$option = Backbone.$('<option>').text(val.display).attr('value', val.value);
if (this.isSelected(val.value)) {
- $option.attr('selected', 'selected');
+ $option.prop('selected', true);
}
$option.appendTo($wrapper);
}
@@ -1306,7 +1306,7 @@
CheckBoxView.__super__.initialize.call(this, options);
},
getValue: function () {
- if (this.$('input:checkbox').prop('checked')) {
+ if (this.$(this.elementType).prop('checked')) {
return this.checkedVal;
}
return this.unCheckedVal;
@@ -1326,7 +1326,7 @@
if (this.addId) { $input.attr({ id: id, name: id }); }
if (this.isSelected()) {
- $input.attr('checked', 'checked');
+ $input.prop('checked', true);
}
$label.append($input);
if (this.displayText) {
|
Change attr(selected) and attr(checked) calls to prop() calls, as they should be in newer versions of jQuery
|
1stdibs_backbone-base-and-form-view
|
train
|
js
|
2160285ae34158a66bdff872f7f6f5e68221108f
|
diff --git a/TYPO3.Neos/Classes/Routing/PageRoutePartHandler.php b/TYPO3.Neos/Classes/Routing/PageRoutePartHandler.php
index <HASH>..<HASH> 100644
--- a/TYPO3.Neos/Classes/Routing/PageRoutePartHandler.php
+++ b/TYPO3.Neos/Classes/Routing/PageRoutePartHandler.php
@@ -53,7 +53,7 @@ class PageRoutePartHandler extends \F3\FLOW3\MVC\Web\Routing\DynamicRoutePart {
/**
* Returns the current content context
- *
+ *
* @return \F3\TYPO3\Domain\Service\ContentContext
* @author Robert Lemke <robert@typo3.org>
*/
@@ -88,7 +88,7 @@ class PageRoutePartHandler extends \F3\FLOW3\MVC\Web\Routing\DynamicRoutePart {
return self::MATCHRESULT_NOSUCHPAGE;
}
$contentContext->setCurrentPage($page);
- $contentContext->setNodePath('/' . $value);
+ $contentContext->setNodePath('/' . $value);
$this->value = array('__identity' => $page->FLOW3_Persistence_Entity_UUID);
return TRUE;
}
|
[+BUGFIX] FLOW3: Removed object and cache configuration for missing DatesReader class, resolving exception #<I>.
[~TASK] TYPO3 (Routing): Whitespace fixes, no functional changes.
Original-Commit-Hash: <I>cce0ab<I>f<I>f<I>e<I>be<I>e<I>ad9d<I>
|
neos_neos-development-collection
|
train
|
php
|
e25816ccb980e6195d71260d5be0346bc31a09a6
|
diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -29,7 +29,7 @@ module.exports = function(grunt) {
uglify: {
options: {
mangle: true,
- compress: true
+ compress: {}
},
uglified_build: {
files: {
|
type of setting changed in grunt-contrib-uglify
|
pfirpfel_image-viewer
|
train
|
js
|
649243260d182f08164c6e4b175a0efbad4d5694
|
diff --git a/lib/adminlib.php b/lib/adminlib.php
index <HASH>..<HASH> 100644
--- a/lib/adminlib.php
+++ b/lib/adminlib.php
@@ -8438,7 +8438,7 @@ class admin_setting_configcolourpicker extends admin_setting {
$content .= html_writer::empty_tag('input', array('type'=>'button','id'=>$this->get_id().'_preview', 'value'=>get_string('preview'), 'class'=>'admin_colourpicker_preview'));
}
$content .= html_writer::end_tag('div');
- return format_admin_setting($this, $this->visiblename, $content, $this->description, false, '', $this->get_defaultsetting(), $query);
+ return format_admin_setting($this, $this->visiblename, $content, $this->description, true, '', $this->get_defaultsetting(), $query);
}
}
|
MDL-<I> admin: attached color label to input control
|
moodle_moodle
|
train
|
php
|
095610fc5e71b1b7e05f6eea399113dbb7bf2e45
|
diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -1793,9 +1793,9 @@
function resetInput(cm, user) {
var minimal, selected, doc = cm.doc;
- var range = doc.sel.primary();
- if (!range.empty()) {
+ if (cm.somethingSelected()) {
cm.display.prevInput = "";
+ var range = doc.sel.primary();
minimal = hasCopyEvent &&
(range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000);
var content = minimal ? "-" : selected || cm.getSelection();
|
Fix resetInput to not confuse readInput when prim sel is empty but secondary is not
Closes #<I>
Closes #<I>
Closes #<I>
|
codemirror_CodeMirror
|
train
|
js
|
f4cbccf16ede12c28adc529c1a495ccda5ced1d7
|
diff --git a/chef/lib/chef/cookbook_uploader.rb b/chef/lib/chef/cookbook_uploader.rb
index <HASH>..<HASH> 100644
--- a/chef/lib/chef/cookbook_uploader.rb
+++ b/chef/lib/chef/cookbook_uploader.rb
@@ -23,7 +23,7 @@ class Chef
# generate checksums of cookbook files and create a sandbox
checksum_files = cookbook.checksums
checksums = checksum_files.inject({}){|memo,elt| memo[elt.first]=nil ; memo}
- new_sandbox = rest.post_rest("/sandboxes", { :checksums => checksums })
+ new_sandbox = rest.post_rest("sandboxes", { :checksums => checksums })
Chef::Log.info("Uploading files")
# upload the new checksums and commit the sandbox
@@ -72,10 +72,8 @@ class Chef
raise
end
end
-
# files are uploaded, so save the manifest
cookbook.save
-
Chef::Log.info("Upload complete!")
end
@@ -99,4 +97,4 @@ class Chef
end
end
-end
\ No newline at end of file
+end
|
Prevent double '/' in HTTP call to sandboxes
|
chef_chef
|
train
|
rb
|
7b936cc0d741d9e84739648b3b023ab0fe8e9a3c
|
diff --git a/lib/chef/audit/reporter/automate.rb b/lib/chef/audit/reporter/automate.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/audit/reporter/automate.rb
+++ b/lib/chef/audit/reporter/automate.rb
@@ -88,14 +88,8 @@ class Chef
end
end
- # ***************************************************************************************
- # TODO: We could likely simplify/remove some of the extra logic we have here with a small
- # revamp of the Automate expected input.
- # ***************************************************************************************
-
def enriched_report(final_report)
- # Remove nil profiles if any
- final_report[:profiles].select! { |p| p }
+ final_report[:profiles].compact!
# Label this content as an inspec_report
final_report[:type] = "inspec_report"
|
Remove a misleading TODO and simplify some code.
|
chef_chef
|
train
|
rb
|
6678eba1b9b2f4fdc027a57e60918ccda6184f1e
|
diff --git a/odinweb/constants.py b/odinweb/constants.py
index <HASH>..<HASH> 100644
--- a/odinweb/constants.py
+++ b/odinweb/constants.py
@@ -60,3 +60,14 @@ class Type(str, enum.Enum):
Boolean = "boolean", bool, fields.BooleanField
# Array = "array", list, fields.ListField
# File = "file", str, fields.StringField
+
+
+PATH_STRING_RE = r'[-\w.~,!%]+'
+"""
+Regular expression for a "string" in a URL path.
+
+This includes all `Unreserved Characters <https://tools.ietf.org/html/rfc3986#section-2.3>`_
+from URL Syntax RFC as well as a selection of sub-delims from
+`Reserved Characters <https://tools.ietf.org/html/rfc3986#section-2.2>`_.
+
+"""
|
Added a path string regular expression to provide a good base point.
|
python-odin_odinweb
|
train
|
py
|
25b4378e30f7bbede476ef5fc859c98a17f14568
|
diff --git a/openquake/calculators/ebrisk.py b/openquake/calculators/ebrisk.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/ebrisk.py
+++ b/openquake/calculators/ebrisk.py
@@ -61,9 +61,10 @@ def _calc(computers, events, min_iml, rlzs_by_gsim, weights,
for c in computers:
with mon_haz:
gmfs.append(c.compute_all(min_iml, rlzs_by_gsim))
- gmftimes.append((c.rupture.ridx, mon_haz.dt))
+ gmftimes.append((c.rupture.ridx, len(c.sids), mon_haz.dt))
gmfs = numpy.concatenate(gmfs)
- gmftimes = numpy.array(gmftimes, [('ridx', U32), ('dt', F32)])
+ gmftimes = numpy.array(
+ gmftimes, [('ridx', U32), ('nsites', U16), ('dt', F32)])
for sid, haz in general.group_array(gmfs, 'sid').items():
gmf_nbytes += haz.nbytes
|
Stored the number of sites affected by each contributing ruptures
Former-commit-id: 4cc<I>fe8cc0e4a<I>aaf<I>eeab<I>cf4ced1a<I> [formerly be<I>cfba<I>b4fc1d<I>f<I>ef<I>d]
Former-commit-id: a<I>f<I>ede<I>d<I>d<I>e7e6
|
gem_oq-engine
|
train
|
py
|
0c964ee4a300dcd0af7f8c4d82c880a1ed9b335b
|
diff --git a/spec/support/kit/temp_dir.rb b/spec/support/kit/temp_dir.rb
index <HASH>..<HASH> 100644
--- a/spec/support/kit/temp_dir.rb
+++ b/spec/support/kit/temp_dir.rb
@@ -14,9 +14,10 @@ RSpec.configure do |config|
config.include RSpec::Kit::TempDirContext
config.before do |example|
- if example.metadata[:temp_dir]
- FileUtils.rm_rf(temp_dir) if File.exist?(temp_dir)
- FileUtils.mkdir_p(temp_dir)
- end
+ FileUtils.mkdir_p(temp_dir) if example.metadata[:temp_dir]
+ end
+
+ config.after do |example|
+ FileUtils.rm_rf(temp_dir) if example.metadata[:temp_dir]
end
end
|
Updated RSpec temp_dir clean to happen after test.
- Necessary to build new sub-directory structures within
the temp_dir without it being deleted with each before
block.
- Moves cleaning up of the temp_dir after each test.
|
bkuhlmann_milestoner
|
train
|
rb
|
8d8c47aa2704f6909b0202cf2a22f5c353b2a839
|
diff --git a/src/Check/Callback.php b/src/Check/Callback.php
index <HASH>..<HASH> 100644
--- a/src/Check/Callback.php
+++ b/src/Check/Callback.php
@@ -6,6 +6,13 @@ class Callback extends \Psecio\Validation\Check
{
public function execute($input)
{
- return false;
+ $addl = $this->get();
+ list($class, $method) = explode('::', $addl[0]);
+
+ if (!method_exists($class, $method)) {
+ throw new \InvalidArgumentException('Invalid callback: '.$method);
+ }
+ $call = $class.'::'.$method;
+ return $call($input);
}
}
|
making the Callback check work with a static class::method
|
psecio_validation
|
train
|
php
|
8d8d569633853ea02d9ead983e9baf0c03dc7d82
|
diff --git a/packages/ui-list/src/List/index.js b/packages/ui-list/src/List/index.js
index <HASH>..<HASH> 100644
--- a/packages/ui-list/src/List/index.js
+++ b/packages/ui-list/src/List/index.js
@@ -51,7 +51,7 @@ category: components
**/
@deprecated('8.0.0', {
variant: 'List with the isUnstyled boolean or InlineList',
- delimeter:
+ delimiter:
'with delimiter set to [pipe, slash, arrow] will only be available when using [InlineList] as of version 8.0.0.'
})
@testable()
|
chore(ui-list): fix typo
|
instructure_instructure-ui
|
train
|
js
|
0a21cee1565c459c1157f088e3c9fbf0e409b5df
|
diff --git a/src/victory-util/style.js b/src/victory-util/style.js
index <HASH>..<HASH> 100644
--- a/src/victory-util/style.js
+++ b/src/victory-util/style.js
@@ -54,6 +54,6 @@ export default {
blue: ["#002C61", "#004B8F", "#006BC9", "#3795E5", "#65B4F4"],
green: ["#354722", "#466631", "#649146", "#8AB25C", "#A9C97E"]
};
- return name ? scales[name] : scales.greyscale;
+ return name ? scales[name] : scales.grayscale;
}
};
|
Fix victory-util/style.js typo
Spelling of property 'grayscale' incrorrectly referenced as 'greyscale' in return statement of getColorScale function
|
FormidableLabs_victory
|
train
|
js
|
5d3ca7fc192e03cfed8cc353b6b013f99ac1927c
|
diff --git a/lib/contentful_redis/model_base.rb b/lib/contentful_redis/model_base.rb
index <HASH>..<HASH> 100644
--- a/lib/contentful_redis/model_base.rb
+++ b/lib/contentful_redis/model_base.rb
@@ -11,6 +11,8 @@ module ContentfulRedis
class ModelBase
class << self
def find(id, env = nil)
+ raise ContentfulRedis::Error::ArgumentError, 'Expected Contentful model ID' unless id.is_a?(String)
+
parameters = { 'sys.id': id, content_type: content_model }
new(ContentfulRedis::Request.new(space, parameters, :get, request_env(env)).call)
diff --git a/spec/contentful_redis/model_base_spec.rb b/spec/contentful_redis/model_base_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/contentful_redis/model_base_spec.rb
+++ b/spec/contentful_redis/model_base_spec.rb
@@ -257,5 +257,11 @@ RSpec.describe ContentfulRedis::ModelBase, contentful: true do
ContentfulRedis::ModelBase.find_by(error: '')
end.to raise_error ContentfulRedis::Error::ArgumentError
end
+
+ it 'raises a ArgumentError when #find is called without a string id' do
+ expect do
+ ContentfulRedis::ModelBase.find(id: 'xxxx')
+ end.to raise_error ContentfulRedis::Error::ArgumentError
+ end
end
end
|
fix-issue <I> cannot call find with a hash (#<I>)
|
DigitalNZ_contentful-redis
|
train
|
rb,rb
|
1563e5210a6d0388b504e878ad29aac7a2d1a5e3
|
diff --git a/bika/lims/browser/__init__.py b/bika/lims/browser/__init__.py
index <HASH>..<HASH> 100644
--- a/bika/lims/browser/__init__.py
+++ b/bika/lims/browser/__init__.py
@@ -65,12 +65,17 @@ def ulocalized_time(time, long_format=None, time_only=None, context=None,
time_str = _ut(time, long_format, time_only, context,
'bika', request)
except ValueError:
- # dividing by 1000 is necessary because your JavaScript returns
- # the timestamp in milliseconds, and ulocalized_time()
- # expects a timestamp in seconds.
- time = time/1000
- time_str = _ut(time, long_format, time_only, context,
- 'bika', request)
+ # TODO: Clean-up this mess
+ # Maybe the date was captured with js, which returns the timestamp
+ # in milliseconds, while ulocalized_time() expects a timestamp in
+ # seconds.
+ try:
+ time = time/1000
+ time_str = _ut(time, long_format, time_only, context,
+ 'bika', request)
+ except:
+ time_str = ''
+
return time_str
|
Additional try except. I know is ugly, but is just a temporary fix
|
senaite_senaite.core
|
train
|
py
|
ee04c6d9e65701ea26b1cd3e93e45939c9b8b5d6
|
diff --git a/decls/validator.js b/decls/validator.js
index <HASH>..<HASH> 100644
--- a/decls/validator.js
+++ b/decls/validator.js
@@ -3,6 +3,8 @@ declare type ValidatorDefinition = {
message?: string|Function // error message
}
+declare type ValidatorAsset = Function|ValidatorDefinition
+
declare type ValidationError = {
field: string,
validator: string,
diff --git a/src/asset.js b/src/asset.js
index <HASH>..<HASH> 100644
--- a/src/asset.js
+++ b/src/asset.js
@@ -30,8 +30,8 @@ export default function (Vue: GlobalAPI): void {
*/
function validator (
id: string,
- def?: Function | ValidatorDefinition
- ): Function | ValidatorDefinition | void {
+ def?: ValidatorAsset
+ ): ValidatorAsset|void {
if (def === undefined) {
return Vue.options['validators'][id]
} else {
|
:shirt: refactor(asset): update flowtype
|
kazupon_vue-validator
|
train
|
js,js
|
128c1942400a718114b7cca4350a7fa6dff4ee80
|
diff --git a/ca/django_ca/models.py b/ca/django_ca/models.py
index <HASH>..<HASH> 100644
--- a/ca/django_ca/models.py
+++ b/ca/django_ca/models.py
@@ -148,6 +148,14 @@ class X509CertMixin(models.Model):
return 'critical,%s' % value
return str(value)
+ def extensions_cryptography(self):
+ for ext in sorted(self.x509c.extensions, key=lambda e: e.oid._name):
+ name = ext.oid._name
+ if hasattr(self, name):
+ yield name, getattr(self, name)()
+ else:
+ yield name, ext.value
+
def distinguishedName(self):
return format_subject(self.subject)
distinguishedName.short_description = 'Distinguished Name'
|
add method to print all extensions of the certificate
|
mathiasertl_django-ca
|
train
|
py
|
3f850106539daba7ba263fc289245fbd9963ca63
|
diff --git a/lib/trim-slash.js b/lib/trim-slash.js
index <HASH>..<HASH> 100644
--- a/lib/trim-slash.js
+++ b/lib/trim-slash.js
@@ -14,12 +14,10 @@
* @ nosideeffects
*/
function trimSlash(string) {
- if (typeof string !== 'string') {
- return string;
- }
- if (string.length > 0 && string.charAt(string.length - 1) === '/') {
- return string.slice(0, string.length - 1);
+ if (typeof string === 'string' && string.endsWith('/')) {
+ return string.slice(0, -1);
}
+
return string;
}
|
style: clean up trimSlash
This code violates the ESLint unicorn/prefer-negative-index rule. Clean
it up and simplify a bit.
|
kevinoid_travis-status
|
train
|
js
|
0dac820b44abf2cb102d7829602ddc66014703de
|
diff --git a/salt/states/virt.py b/salt/states/virt.py
index <HASH>..<HASH> 100644
--- a/salt/states/virt.py
+++ b/salt/states/virt.py
@@ -15,11 +15,26 @@ from __future__ import absolute_import
# Import python libs
import os
+try:
+ import libvirt # pylint: disable=import-error
+ HAS_LIBVIRT = True
+except ImportError:
+ HAS_LIBVIRT = False
# Import salt libs
import salt.utils
+def __virtual__():
+ '''
+ Only if libvirt bindings for Python are installed.
+
+ :return:
+ '''
+
+ return HAS_LIBVIRT
+
+
def keys(name, basepath='/etc/pki'):
'''
Manage libvirt keys.
|
Add __virtual__ to check if libvirt is installed for the virt state
|
saltstack_salt
|
train
|
py
|
6b6298a2f3a07ba99d830c3e6ae91bc2bd094166
|
diff --git a/lazysignup/tests.py b/lazysignup/tests.py
index <HASH>..<HASH> 100644
--- a/lazysignup/tests.py
+++ b/lazysignup/tests.py
@@ -191,4 +191,14 @@ class LazyTestCase(TestCase):
def testGetConvert(self):
self.client.get('/lazy/')
response = self.client.get('/convert/')
- self.assertEqual(200, response.status_code)
\ No newline at end of file
+ self.assertEqual(200, response.status_code)
+
+ def testConversionKeepsSameUser(self):
+ self.client.get('/lazy/')
+ response = self.client.post('/convert/', {
+ 'username': 'demo',
+ 'password1': 'password',
+ 'password2': 'password',
+ })
+ self.assertEqual(1, len(User.objects.all()))
+
\ No newline at end of file
|
Extra test to check that the same user is maintained
|
danfairs_django-lazysignup
|
train
|
py
|
9b2c0028b5a624de5159de9b640728bd3b824145
|
diff --git a/molgenis-data-mapper/src/main/java/org/molgenis/data/algorithm/AlgorithmServiceImpl.java b/molgenis-data-mapper/src/main/java/org/molgenis/data/algorithm/AlgorithmServiceImpl.java
index <HASH>..<HASH> 100644
--- a/molgenis-data-mapper/src/main/java/org/molgenis/data/algorithm/AlgorithmServiceImpl.java
+++ b/molgenis-data-mapper/src/main/java/org/molgenis/data/algorithm/AlgorithmServiceImpl.java
@@ -80,9 +80,15 @@ public class AlgorithmServiceImpl implements AlgorithmService
{
return null;
}
- Object value = ScriptEvaluator.eval(algorithm, sourceEntity);
- return AlgorithmServiceImpl.convert(value, attributeMapping.getTargetAttributeMetaData().getDataType()
- .getEnumType());
+ try
+ {
+ Object value = ScriptEvaluator.eval(algorithm, sourceEntity);
+ return convert(value, attributeMapping.getTargetAttributeMetaData().getDataType().getEnumType());
+ }
+ catch (RuntimeException e)
+ {
+ return null;
+ }
}
private static Object convert(Object value, FieldTypeEnum targetDataType)
|
Catch exception if script eval fails while creating integrated dataset
|
molgenis_molgenis
|
train
|
java
|
d80e01a9c596c2a19fac3115923e994c11b2e8fb
|
diff --git a/gns3server/version.py b/gns3server/version.py
index <HASH>..<HASH> 100644
--- a/gns3server/version.py
+++ b/gns3server/version.py
@@ -23,7 +23,7 @@
# or negative for a release candidate or beta (after the base version
# number has been incremented)
-__version__ = "2.1.1"
+__version__ = "2.1.2dev1"
__version_info__ = (2, 1, 1, 0)
# If it's a git checkout try to add the commit
|
Development on <I>dev1
|
GNS3_gns3-server
|
train
|
py
|
a1d76cc1893a0630394d70a1abd004b143fb81ad
|
diff --git a/hydpy/core/timetools.py b/hydpy/core/timetools.py
index <HASH>..<HASH> 100644
--- a/hydpy/core/timetools.py
+++ b/hydpy/core/timetools.py
@@ -373,6 +373,10 @@ class Date(object):
self.datetime = date
elif isinstance(date, str):
self._initfromstr(date)
+ elif isinstance(date, TOY):
+ self.datetime = datetime.datetime(2000,
+ date.month, date.day, date.hour,
+ date.minute, date.second)
else:
raise TypeError('The supplied argument must be either an '
'instance of `datetime.datetime` or of `str`. '
|
Allow TOY objects as initialization arguments for class Date.
Note that the year is generally set to <I>, which is a leap year.
|
hydpy-dev_hydpy
|
train
|
py
|
c297c38e39fb3f2c181a5c30244db7746a99d230
|
diff --git a/lib/ronin/database/database.rb b/lib/ronin/database/database.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/database/database.rb
+++ b/lib/ronin/database/database.rb
@@ -46,7 +46,7 @@ module Ronin
# Default configuration of the database
DEFAULT_CONFIG = {
- :adapter => :sqlite3,
+ :adapter => 'sqlite3',
:database => File.join(Config::PATH,'database.sqlite3')
}
|
Make sure the :adapture option is a String for DM <I>.
|
ronin-ruby_ronin
|
train
|
rb
|
a3d22ee6fc2bd6173502008be7d55926a433f9e6
|
diff --git a/ipyrad/assemble/cluster_within.py b/ipyrad/assemble/cluster_within.py
index <HASH>..<HASH> 100644
--- a/ipyrad/assemble/cluster_within.py
+++ b/ipyrad/assemble/cluster_within.py
@@ -418,10 +418,10 @@ def build_clusters(data, sample):
LOGGER.info("exc indbld: %s %s", inserts, revseq)
seqslist.append("\n".join(seq))
- if count % 1000:
- clustfile.write("\n//\n//\n".join(seqslist)+"\n")
- seqslist = []
- count = 0
+ #if count % 1000:
+ # clustfile.write("\n//\n//\n".join(seqslist)+"\n")
+ # seqslist = []
+ # count = 0
## This will get skipped but the part below assumes there is already
## at least one seq in the file (prepends the // sep)
|
Reverting a change that broke cluster_within
|
dereneaton_ipyrad
|
train
|
py
|
e4fba52b33dd3a398e229128bf2269f79522c59f
|
diff --git a/lib/plugins/tag/img.js b/lib/plugins/tag/img.js
index <HASH>..<HASH> 100644
--- a/lib/plugins/tag/img.js
+++ b/lib/plugins/tag/img.js
@@ -37,14 +37,10 @@ module.exports = ctx => {
let src;
// Find image URL and class name
- for (let i = 0, len = args.length; i < len; i++) {
- const item = args[i];
-
+ while (args.length > 0) {
+ const item = args.shift();
if (rUrl.test(item) || item[0] === '/') {
src = makeUrl(item);
-
- // Delete image URL and class name from arguments
- args = args.slice(i + 1);
break;
} else {
classes.push(item);
|
Changed not to use Array#slice()
|
hexojs_hexo
|
train
|
js
|
8961f15644db6cc304392dab97c73706a7cbfbff
|
diff --git a/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ParentController.java b/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ParentController.java
index <HASH>..<HASH> 100644
--- a/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ParentController.java
+++ b/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ParentController.java
@@ -74,6 +74,7 @@ public abstract class ParentController<T extends ViewGroup> extends ViewControll
}
}
+ @CallSuper
void clearOptions() {
options = initialOptions.copy();
}
diff --git a/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/StackController.java b/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/StackController.java
index <HASH>..<HASH> 100644
--- a/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/StackController.java
+++ b/lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/StackController.java
@@ -42,6 +42,7 @@ public class StackController extends ParentController <StackLayout> {
@Override
void clearOptions() {
+ super.clearOptions();
stackLayout.clearOptions();
}
|
Require clearOptions to calls super
|
wix_react-native-navigation
|
train
|
java,java
|
0314967d81f1275be5995652aa38ca2e64f7b819
|
diff --git a/lib/dm-core/query/conditions/operation.rb b/lib/dm-core/query/conditions/operation.rb
index <HASH>..<HASH> 100644
--- a/lib/dm-core/query/conditions/operation.rb
+++ b/lib/dm-core/query/conditions/operation.rb
@@ -96,7 +96,7 @@ module DataMapper
# TODO: document
# @api semipublic
def <<(operand)
- unless operand.kind_of? Conditions::AbstractOperation or operand.kind_of? Conditions::AbstractComparison
+ unless operand.kind_of? Conditions::AbstractOperation or operand.kind_of? Conditions::AbstractComparison or operand.kind_of? Array
raise ArgumentError, "Operands must be a kind of DataMapper::Query::Conditions::AbstractOperation or DataMapper::Query::Conditions::AbstractComparison. This one was a #{operand.class}"
end
@operands << operand unless operand.nil?
|
Accommodating Arrays as operands
|
datamapper_dm-core
|
train
|
rb
|
2545a6fa636fafac5381ece0ff72a46de3220360
|
diff --git a/lib/gphoto2/camera.rb b/lib/gphoto2/camera.rb
index <HASH>..<HASH> 100644
--- a/lib/gphoto2/camera.rb
+++ b/lib/gphoto2/camera.rb
@@ -108,7 +108,7 @@ module GPhoto2
end
def [](key)
- config[key]
+ config[key.to_s]
end
def []=(key, value)
|
Allow config keys to be passed as symbols
|
zaeleus_ffi-gphoto2
|
train
|
rb
|
7163b3456dad79988553b8317ca5ed9426dcdafb
|
diff --git a/lib/mongoose/delete.js b/lib/mongoose/delete.js
index <HASH>..<HASH> 100644
--- a/lib/mongoose/delete.js
+++ b/lib/mongoose/delete.js
@@ -7,6 +7,7 @@ const async = require('async');
/**
+ * @module mongoose-rest-actions
* @name deletePlugin
* @function deletePlugin
* @description mongoose schema plugin to support http delete verb
@@ -25,6 +26,7 @@ const async = require('async');
* const app = express();
*
* ....
+ *
* app.delete('/users/:id', function(request, response, next){
*
* //obtain id
|
update delete jsdocs:
|
lykmapipo_mongoose-rest-actions
|
train
|
js
|
6443d950440b5abb3aa63d016eff0e5340f1ff3b
|
diff --git a/dist/canvas.js b/dist/canvas.js
index <HASH>..<HASH> 100644
--- a/dist/canvas.js
+++ b/dist/canvas.js
@@ -87,8 +87,8 @@ Canvas.drawFunction = {
var y = this.Y(obj.points[0].y);
var w = obj.points[1].x - obj.points[0].x;
var h = - (obj.points[1].y - obj.points[0].y); // 左下を原点として扱っているからマイナスしないと計算があわない
- this.canvas.strokeRect(x, y, w, h); // 上でX()、Y()している
- if (obj.style.fillColor !== null) this.canvas.fill();
+ if (obj.style.fillColor !== null) this.canvas.fillRect(x, y, w, h); // 上でそれぞれX()、Y()適用済み
+ else this.canvas.strokeRect(x, y, w, h);
},
Text: function(obj) {
this.canvas.textAlign = obj.style.align;
|
bugfix: fill Rect.
fill() isn’t needed for rect.
|
pandanoir_unitaryjs
|
train
|
js
|
b2cce386aeeb5292ef90fedb9fb9c7e09709e331
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ description = "Command line script that automatically searches for video subtitl
setup(
name = "ss",
- version = "1.2.0",
+ version = "1.1.0",
packages = [],
scripts = ['ss.py'],
entry_points = {'console_scripts' : ['ss = ss:Main']},
|
bumping version to <I>
|
nicoddemus_ss
|
train
|
py
|
0668063d7d362e296f7f3499b137c039d9280709
|
diff --git a/lib/motion/dealloc_logging.rb b/lib/motion/dealloc_logging.rb
index <HASH>..<HASH> 100644
--- a/lib/motion/dealloc_logging.rb
+++ b/lib/motion/dealloc_logging.rb
@@ -15,7 +15,7 @@ class RMX
end
def self.log_dealloc(object, verbose=false)
- LOG_DEALLOC_QUEUE.sync do
+ LOG_DEALLOC_QUEUE.async do
$rmx_log_deallocs.addObject(object)
end
if verbose || DEBUG_DEALLOC
|
need to use async with RM <I>, not sure exactly why yet
|
joenoon_rmx
|
train
|
rb
|
9b45778770862c2dc143060a71aaf9ee24a61c54
|
diff --git a/generators/Generator.py b/generators/Generator.py
index <HASH>..<HASH> 100644
--- a/generators/Generator.py
+++ b/generators/Generator.py
@@ -9,7 +9,7 @@ import os
import operator
import generators
-from generators import iterable, consume, itemgetter
+from generators import iterable, consume, itemgetter, rps
class OrderError(Exception):
pass
@@ -156,13 +156,15 @@ class Generator:
def next(self):
return next(self._iterable)
- def print(self, before='', use_repr=False):
+ def print(self, before='', use_repr=False, **print_options):
return Generator(self.side_task((
- lambda i:print('{}{}'.format(before, repr(i)))
+ lambda i:print('{}{}'.format(before, repr(i)), **print_options)
) if use_repr else (
- lambda i:print('{}{}'.format(before, i))
+ lambda i:print('{}{}'.format(before, i), **print_options)
)))
+ benchmark = rps
+
#def __slice__(self, s):
# raise NotImplementedError()
def __negative_slice__(self, s):
|
added easy benchmarking to the Generator class
|
CodyKochmann_generators
|
train
|
py
|
c40d0317c347e6f85637d23bf918434c02015e1a
|
diff --git a/scripts/init.js b/scripts/init.js
index <HASH>..<HASH> 100644
--- a/scripts/init.js
+++ b/scripts/init.js
@@ -149,13 +149,17 @@ module.exports = function(
console.log(chalk.cyan(` ${displayedCommand} start`));
console.log(' Starts the development server.');
console.log();
- console.log(chalk.cyan(` ${displayedCommand} run build`));
+ console.log(
+ chalk.cyan(` ${displayedCommand} ${useYarn ? '' : 'run '}build`)
+ );
console.log(' Bundles the app into static files for production.');
console.log();
console.log(chalk.cyan(` ${displayedCommand} test`));
console.log(' Starts the test runner.');
console.log();
- console.log(chalk.cyan(` ${displayedCommand} run eject`));
+ console.log(
+ chalk.cyan(` ${displayedCommand} ${useYarn ? '' : 'run '}eject`)
+ );
console.log(
' Removes this tool and copies build dependencies, configuration files'
);
|
Suggest "yarn build" rather than "yarn run build" (#<I>)
* Fix for issue #<I>: Suggested 'yarn build' versus 'yarn run build'
* remove 'run' from 'yarn test' command as well
* conditionally show 'run' if Yarn is not available
|
Pajn_tscomp
|
train
|
js
|
bc5bfeb479d5123ad3c9cfc8bf9636bb1535802e
|
diff --git a/lnwire/onion_error.go b/lnwire/onion_error.go
index <HASH>..<HASH> 100644
--- a/lnwire/onion_error.go
+++ b/lnwire/onion_error.go
@@ -663,7 +663,7 @@ func (f *FailFeeInsufficient) Code() FailCode {
//
// NOTE: Implements the error interface.
func (f FailFeeInsufficient) Error() string {
- return fmt.Sprintf("FeeInsufficient(fee=%v, update=%v", f.HtlcMsat,
+ return fmt.Sprintf("FeeInsufficient(htlc_amt==%v, update=%v", f.HtlcMsat,
spew.Sdump(f.Update))
}
|
lnwire: fix logging for FeeInsufficient, show amt not fee
Fixes #<I>.
|
lightningnetwork_lnd
|
train
|
go
|
4b2726e9feb0dbcaa07cf6dfe7d7bec3656d4ea0
|
diff --git a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphHistory.js b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphHistory.js
index <HASH>..<HASH> 100644
--- a/server/sonar-web/src/main/js/apps/projectActivity/components/GraphHistory.js
+++ b/server/sonar-web/src/main/js/apps/projectActivity/components/GraphHistory.js
@@ -64,6 +64,8 @@ export default class GraphHistory extends React.PureComponent {
formatValue = (tick /*: string | number */) =>
formatMeasure(tick, getShortType(this.props.metricsType));
+ formatTooltipValue = (tick /*: string | number */) => formatMeasure(tick, this.props.metricsType);
+
updateTooltip = (
selectedDate /*: ?Date */,
tooltipXPos /*: ?number */,
@@ -106,7 +108,7 @@ export default class GraphHistory extends React.PureComponent {
tooltipXPos != null &&
<GraphsTooltips
events={this.props.events}
- formatValue={this.formatValue}
+ formatValue={this.formatTooltipValue}
graph={graph}
graphWidth={width}
measuresHistory={this.props.measuresHistory}
|
Do not round numbers in project activity graph's tooltips
|
SonarSource_sonarqube
|
train
|
js
|
2166f9768eda31dcbaccff8714a44023a3243c3c
|
diff --git a/fastcore.py b/fastcore.py
index <HASH>..<HASH> 100644
--- a/fastcore.py
+++ b/fastcore.py
@@ -265,7 +265,7 @@ def fastcore_lp10_cplex(model, subset_k, subset_p, epsilon):
zs_names = []
for rxnid in subset_p:
zs_names.append('z_'+rxnid)
- prob.variables.add(names=zs_names, lb=[0]*len(zs_names), ub=[max_bound*scaling]*len(zs_names), obj=[1]*len(zs_names))
+ prob.variables.add(names=zs_names, lb=[0]*len(zs_names), ub=[cplex.infinity]*len(zs_names), obj=[1]*len(zs_names))
# Define constraints
for rxnid in subset_p:
@@ -366,7 +366,7 @@ def fastcc(model, epsilon):
return consistent_subset
def find_sparse_mode(model, core, additional, singleton, epsilon):
- '''Find the support of a sparse mode containing the the core subset.'''
+ '''Find the support of a sparse mode containing the core subset.'''
if len(core) == 0:
return set()
|
fastcore: Fix variable bounds in LP<I> cplex
|
zhanglab_psamm
|
train
|
py
|
6d45be5ba04ef6eb5046f704adc1c3690af17cc3
|
diff --git a/activemodel/lib/active_model/validations/confirmation.rb b/activemodel/lib/active_model/validations/confirmation.rb
index <HASH>..<HASH> 100644
--- a/activemodel/lib/active_model/validations/confirmation.rb
+++ b/activemodel/lib/active_model/validations/confirmation.rb
@@ -9,7 +9,7 @@ module ActiveModel
end
def validate_each(record, attribute, value)
- unless (confirmed = record.send("#{attribute}_confirmation")).nil?
+ unless (confirmed = record.public_send("#{attribute}_confirmation")).nil?
unless confirmation_value_equal?(record, attribute, value, confirmed)
human_attribute_name = record.class.human_attribute_name(attribute)
record.errors.add(:"#{attribute}_confirmation", :confirmation, **options.except(:case_sensitive).merge!(attribute: human_attribute_name))
|
*_confirmation is defined as a public method
|
rails_rails
|
train
|
rb
|
d315bc215ede0a2d78f34393be4549a68a579dd7
|
diff --git a/src/test/entry.test.js b/src/test/entry.test.js
index <HASH>..<HASH> 100644
--- a/src/test/entry.test.js
+++ b/src/test/entry.test.js
@@ -307,3 +307,26 @@ test('entry by duration with date', t => {
t.end()
})
+
+test('entry duration whitespace', t => {
+ let e
+ e = new Entry(userId, '1-2pm ate 4 hotdogs')
+ t.equal(e.createdFrom, 'calendar', 'used 1-2pm instead of 4 h')
+
+ e = new Entry(userId, '1-2pm ate 3 mini dougnuts')
+ t.equal(e.createdFrom, 'calendar', 'used 1-2pm instead of 3 m')
+
+ try {
+ e = new Entry(userId, '2:30-3:30 meeting')
+ } catch(err) {
+ t.equal(err.name, 'NoMeridiemError', 'threw error instead of using 30 m')
+ }
+
+ e = new Entry(userId, '9am-10 Researching SMS online S3 hosting options')
+ t.equal(e.createdFrom, 'calendar', 'used 9am-10 instead of 3 h')
+
+ e = new Entry(userId, '1:30-2:45pm 2 month planning meeting')
+ t.equal(e.createdFrom, 'calendar', 'used 1:30-2:45pm instead of 2 m')
+
+ t.end()
+})
|
Add tests with full entry parsing
|
tickbin_parser
|
train
|
js
|
133a831ab923aec1744862811b21177cc1672e65
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -80,7 +80,7 @@ setup(
"Programming Language :: Python :: 3.8",
],
keywords="api graphql protocol rest relay graphene",
- packages=find_packages(exclude=["tests", "tests.*", "examples"]),
+ packages=find_packages(exclude=["tests", "tests.*", "examples*"]),
install_requires=[
"graphql-core>=3.1.0b1,<4",
"graphql-relay>=3.0,<4",
|
Update excluded packages list to properly exclude examples pack… (#<I>)
* examples package will not be installed with graphene
|
graphql-python_graphene
|
train
|
py
|
907a4fed7f7129bfe40003760f15bc5ed1fc54d0
|
diff --git a/rxandroidble/src/main/java/com/polidea/rxandroidble/internal/RxBleLog.java b/rxandroidble/src/main/java/com/polidea/rxandroidble/internal/RxBleLog.java
index <HASH>..<HASH> 100644
--- a/rxandroidble/src/main/java/com/polidea/rxandroidble/internal/RxBleLog.java
+++ b/rxandroidble/src/main/java/com/polidea/rxandroidble/internal/RxBleLog.java
@@ -3,6 +3,8 @@ package com.polidea.rxandroidble.internal;
import android.support.annotation.IntDef;
import android.util.Log;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -12,6 +14,7 @@ import java.util.regex.Pattern;
public class RxBleLog {
@IntDef({VERBOSE, DEBUG, INFO, WARN, ERROR, NONE})
+ @Retention(RetentionPolicy.SOURCE)
public @interface LogLevel {
}
|
Fixed retention policy of RxBleLog log levels.
|
Polidea_RxAndroidBle
|
train
|
java
|
5230178f41619b180ed975fd7bc4c521979a7d2f
|
diff --git a/lib/pool.js b/lib/pool.js
index <HASH>..<HASH> 100644
--- a/lib/pool.js
+++ b/lib/pool.js
@@ -22,32 +22,16 @@ class Pool {
}, () => new Client(url, options))
}
- stream (opts, factory, cb) {
- if (cb === undefined) {
- return new Promise((resolve, reject) => {
- this.stream(opts, factory, (err, data) => {
- return err ? reject(err) : resolve(data)
- })
- })
- }
-
- getNext(this).stream(opts, factory, cb)
+ stream (opts, factory, callback) {
+ return getNext(this).stream(opts, factory, callback)
}
pipeline (opts, handler) {
return getNext(this).pipeline(opts, handler)
}
- request (opts, cb) {
- if (cb === undefined) {
- return new Promise((resolve, reject) => {
- this.request(opts, (err, data) => {
- return err ? reject(err) : resolve(data)
- })
- })
- }
-
- getNext(this).request(opts, cb)
+ request (opts, callback) {
+ return getNext(this).request(opts, callback)
}
upgrade (opts, callback) {
|
refactor: pool doesn't need to create promise
|
mcollina_undici
|
train
|
js
|
6efa10f6687d78f15ee0a3a192b5b41f215c84a9
|
diff --git a/api/server/router/volume/volume.go b/api/server/router/volume/volume.go
index <HASH>..<HASH> 100644
--- a/api/server/router/volume/volume.go
+++ b/api/server/router/volume/volume.go
@@ -5,13 +5,13 @@ import (
"github.com/docker/docker/api/server/router/local"
)
-// volumesRouter is a router to talk with the volumes controller
+// volumeRouter is a router to talk with the volumes controller
type volumeRouter struct {
backend Backend
routes []router.Route
}
-// NewRouter initializes a new volumes router
+// NewRouter initializes a new volumeRouter
func NewRouter(b Backend) router.Router {
r := &volumeRouter{
backend: b,
|
Modify improper comments in api/server/router/volume/volume.go
|
moby_moby
|
train
|
go
|
be487959fd6eda993dbc705be8c838e90a215fc3
|
diff --git a/src/FamilySearch.js b/src/FamilySearch.js
index <HASH>..<HASH> 100644
--- a/src/FamilySearch.js
+++ b/src/FamilySearch.js
@@ -24,7 +24,7 @@
* @param {String} options.tokenCookie Name of the cookie that the access token
* will be saved in.
*/
- var FamilySearch = function(options){
+ var FamilySearch = exports.FamilySearch = function(options){
this.appKey = options.appKey;
this.environment = options.environment || 'sandbox';
this.redirectUri = options.redirectUri;
@@ -98,6 +98,10 @@
options = {};
}
+ if(!callback){
+ callback = function(){};
+ }
+
if(options.method){
method = options.method;
}
@@ -133,7 +137,7 @@
if(typeof body !== 'string'){
// JSON.stringify() if the content-type is JSON
- if(headers['Content-Type'] && headers['Content-Type'].indexOf('json')){
+ if(headers['Content-Type'] && headers['Content-Type'].indexOf('json') !== -1){
body = JSON.stringify(body);
}
|
fix body processing and missing callback error
|
FamilySearch_fs-js-lite
|
train
|
js
|
eaa99305eee46770683a7bf7951360c83ac555aa
|
diff --git a/Classes/Domain/Repository/RedirectionRepository.php b/Classes/Domain/Repository/RedirectionRepository.php
index <HASH>..<HASH> 100644
--- a/Classes/Domain/Repository/RedirectionRepository.php
+++ b/Classes/Domain/Repository/RedirectionRepository.php
@@ -87,6 +87,21 @@ class RedirectionRepository extends Repository
}
/**
+ * @param string $targetUriPath
+ * @param string $host Host or host pattern
+ * @return QueryInterface
+ */
+ public function findByTargetUriPathAndHost($targetUriPath, $host = null)
+ {
+ /** @var Query $query */
+ $query = $this->entityManager->createQuery('SELECT r FROM Neos\RedirectHandler\DatabaseStorage\Domain\Model\Redirection r WHERE r.targetUriPathHash = :targetUriPathHash AND (r.host = :host OR r.host IS NULL)');
+ $query->setParameter('targetUriPathHash', md5(trim($targetUriPath, '/')));
+ $query->setParameter('host', $host);
+
+ return $this->iterate($query->iterate());
+ }
+
+ /**
* Finds all objects and return an IterableResult
*
* @param string $host Full qualified hostname or host pattern
|
TASK: Use DQL and generator to find by target uri and host
|
neos_redirecthandler-databasestorage
|
train
|
php
|
4066c1181bebc52e7a69554fd85e53b480102fd8
|
diff --git a/config/admin/jsonadm/resource.php b/config/admin/jsonadm/resource.php
index <HASH>..<HASH> 100644
--- a/config/admin/jsonadm/resource.php
+++ b/config/admin/jsonadm/resource.php
@@ -250,7 +250,7 @@ return [
* @param array List of user group names
* @since 2017.10
*/
- 'groups' => ['admin', 'super'],
+ 'groups' => ['super'],
],
'language' => [
/** admin/jsonadm/resource/locale/language/groups
@@ -259,7 +259,7 @@ return [
* @param array List of user group names
* @since 2017.10
*/
- 'groups' => ['admin', 'super'],
+ 'groups' => ['super'],
],
'currency' => [
/** admin/jsonadm/resource/locale/currency/groups
@@ -268,7 +268,7 @@ return [
* @param array List of user group names
* @since 2017.10
*/
- 'groups' => ['admin', 'super'],
+ 'groups' => ['super'],
],
],
'media' => [
|
Restrict locale/* resources to super admins only
|
aimeos_ai-admin-jsonadm
|
train
|
php
|
d5033b04a28da4afba21d37e5f9568f7616bdf3a
|
diff --git a/discord/state.py b/discord/state.py
index <HASH>..<HASH> 100644
--- a/discord/state.py
+++ b/discord/state.py
@@ -215,7 +215,7 @@ class ConnectionState:
self.clear()
- def clear(self) -> None:
+ def clear(self, *, views: bool = True) -> None:
self.user: Optional[ClientUser] = None
# Originally, this code used WeakValueDictionary to maintain references to the
# global user mapping.
@@ -233,7 +233,9 @@ class ConnectionState:
self._emojis: Dict[int, Emoji] = {}
self._stickers: Dict[int, GuildSticker] = {}
self._guilds: Dict[int, Guild] = {}
- self._view_store: ViewStore = ViewStore(self)
+ if views:
+ self._view_store: ViewStore = ViewStore(self)
+
self._voice_clients: Dict[int, VoiceProtocol] = {}
# LRU of max size 128
@@ -524,7 +526,7 @@ class ConnectionState:
self._ready_task.cancel()
self._ready_state = asyncio.Queue()
- self.clear()
+ self.clear(views=False)
self.user = ClientUser(state=self, data=data['user'])
self.store_user(data['user'])
|
Don't clear views in READY
|
Rapptz_discord.py
|
train
|
py
|
01640b32aee876d18d2b18b450ac7fbfb8996c71
|
diff --git a/core/Object.php b/core/Object.php
index <HASH>..<HASH> 100755
--- a/core/Object.php
+++ b/core/Object.php
@@ -418,9 +418,12 @@ abstract class Object {
// merge with existing static vars
$extensions = self::uninherited_static($class, 'extensions');
+
// We use unshift rather than push so that module extensions are added before built-in ones.
// in particular, this ensures that the Versioned rewriting is done last.
- array_unshift($extensions, $extension);
+ if($extensions) array_unshift($extensions, $extension);
+ else $extensions = array($extension);
+
self::set_static($class, 'extensions', $extensions);
// load statics now for DataObject classes
|
BUGFIX: Ameneded r<I> so that the application order of extensions is the same as it was previously.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@<I> <I>b<I>ca-7a2a-<I>-9d3b-<I>d<I>a<I>a9
|
silverstripe_silverstripe-framework
|
train
|
php
|
ac5273383b314ac2ef348d232c1e209af9c946d9
|
diff --git a/src/Subjects/AbstractSubject.php b/src/Subjects/AbstractSubject.php
index <HASH>..<HASH> 100644
--- a/src/Subjects/AbstractSubject.php
+++ b/src/Subjects/AbstractSubject.php
@@ -870,7 +870,7 @@ abstract class AbstractSubject implements SubjectInterface, FilesystemSubjectInt
// log a message that the file has successfully been imported,
// use log level warning ONLY if rows have been skipped
$systemLogger->log(
- $skippedRows = $this->getSkippedRows() > 0 ? LogLevel::WARNING : LogLevel::INFO,
+ $skippedRows = $this->getSkippedRows() > 0 ? LogLevel::WARNING : LogLevel::NOTICE,
sprintf(
'Successfully processed file "%s" with "%d" lines (skipping "%d") in "%f" s',
basename($filename),
|
Switch log level for message when a file has successfully been processed from info to notice to make it visible on CLI
|
techdivision_import
|
train
|
php
|
08199fc4cb0cdf1f169136c56d58dbaa1c5c02ca
|
diff --git a/src/cmdline/settings.py b/src/cmdline/settings.py
index <HASH>..<HASH> 100644
--- a/src/cmdline/settings.py
+++ b/src/cmdline/settings.py
@@ -170,11 +170,12 @@ class SettingsParser(BaseCommand):
parser.add_argument(arg, **_info)
- if subcommands:
+ command_info = args.get('_COMMANDS', {})
+
+ if subcommands or command_info:
self.subparsers = parser.add_subparsers(help='sub-commands')
# go through all the args found for subcommands and create a subparser for them
- command_info = args.get('_COMMANDS', {})
for subcommand, args in subcommands.items():
kwargs = command_info.get(subcommand, {})
subcommand_parser = self.subparsers.add_parser(subcommand, **kwargs)
@@ -182,3 +183,10 @@ class SettingsParser(BaseCommand):
self.parse(args=args, parser=subcommand_parser)
subcommand_parser.set_defaults(subcommand=subcommand)
+
+ # check for any commands listed in command_info without additional settings
+ for subcommand in set(command_info.keys()) - set(subcommands.keys()):
+ kwargs = command_info[subcommand]
+ subcommand_parser = self.subparsers.add_parser(subcommand, **kwargs)
+
+ subcommand_parser.set_defaults(subcommand=subcommand)
|
Add subcommands that do not have any additional settings
|
rca_cmdline
|
train
|
py
|
3cc624aeefe3d5ca525af0872f470509f87d0425
|
diff --git a/lib/Github/Api/Repo.php b/lib/Github/Api/Repo.php
index <HASH>..<HASH> 100644
--- a/lib/Github/Api/Repo.php
+++ b/lib/Github/Api/Repo.php
@@ -143,6 +143,20 @@ class Repo extends AbstractApi
{
return $this->delete('repos/'.rawurlencode($username).'/'.rawurlencode($repository));
}
+
+ /**
+ * Get the readme content for a repository by its username and repository name
+ * @link http://developer.github.com/v3/repos/contents/#get-the-readme
+ *
+ * @param string $username the user who owns the repository
+ * @param string $repository the name of the repository
+ *
+ * @return array the readme content
+ */
+ public function readme($username, $repository)
+ {
+ return $this->get('repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/readme');
+ }
/**
* Manage the collaborators of a repository
|
Add API request to get the readme content
Adding a `readme` method to the repo api to get the readme for a repository. This is described by <URL>
|
KnpLabs_php-github-api
|
train
|
php
|
6ba1a0ea0d0973043082bb0d917222072e94990f
|
diff --git a/src/components/column/Column.js b/src/components/column/Column.js
index <HASH>..<HASH> 100644
--- a/src/components/column/Column.js
+++ b/src/components/column/Column.js
@@ -41,7 +41,8 @@ export class Column extends Component {
excludeGlobalFilter: false,
rowReorder: false,
rowReorderIcon: 'pi pi-bars',
- rowEditor: false
+ rowEditor: false,
+ exportable: true
}
static propTypes = {
@@ -82,6 +83,7 @@ export class Column extends Component {
excludeGlobalFilter: PropTypes.bool,
rowReorder: PropTypes.bool,
rowReorderIcon: PropTypes.string,
- rowEditor: PropTypes.bool
+ rowEditor: PropTypes.bool,
+ exportable: PropTypes.bool
}
}
\ No newline at end of file
|
Fixed #<I> - Add exportable property to Column
|
primefaces_primereact
|
train
|
js
|
3aab8ee2e7152eaddb1617dae603c32d775e5792
|
diff --git a/api/src/main/java/org/ehcache/resilience/ResilienceStrategy.java b/api/src/main/java/org/ehcache/resilience/ResilienceStrategy.java
index <HASH>..<HASH> 100644
--- a/api/src/main/java/org/ehcache/resilience/ResilienceStrategy.java
+++ b/api/src/main/java/org/ehcache/resilience/ResilienceStrategy.java
@@ -24,6 +24,8 @@ import org.ehcache.exceptions.BulkCacheWriterException;
import org.ehcache.exceptions.CacheAccessException;
import org.ehcache.exceptions.CacheLoaderException;
import org.ehcache.exceptions.CacheWriterException;
+import org.ehcache.spi.loader.CacheLoader;
+import org.ehcache.spi.writer.CacheWriter;
/**
* A strategy for providing cache resilience in the face of failure.
@@ -33,6 +35,12 @@ import org.ehcache.exceptions.CacheWriterException;
* these methods are expected to take suitable recovery steps. They can then
* choose between allowing the operation to terminate successfully, or throw an
* exception which will be propagated to the thread calling in to the cache.
+ * <p>
+ * Resilience in this context refers only to resilience against cache failures
+ * and not to resilience against failures of any underlying {@link CacheWriter}
+ * or {@link CacheLoader}. To this end writer or loader failures will only be
+ * reported to the strategy in the context of a coincident cache failure.
+ * Isolated writer and loader exceptions will be thrown directly.
*
* @author Chris Dennis
*/
|
#<I> : add javadoc clarifying writer/loader and resilience strategy interactions
|
ehcache_ehcache3
|
train
|
java
|
a7803c7d298d47ae50a9f86e3c361a7ad8eb2db9
|
diff --git a/nodeserver/src/client/js/corewrapper.js b/nodeserver/src/client/js/corewrapper.js
index <HASH>..<HASH> 100644
--- a/nodeserver/src/client/js/corewrapper.js
+++ b/nodeserver/src/client/js/corewrapper.js
@@ -881,6 +881,7 @@ define(['logManager',
};
ClientNode = function(node,core){
var ownpath = core.getStringPath(node);
+ var ownpathpostfix = ownpath === "" ? "" : "/";
this.getParentId = function(){
var parent = core.getParent(node);
if(parent){
@@ -894,9 +895,8 @@ define(['logManager',
};
this.getChildrenIds = function(){
var children = core.getChildrenRelids(node);
- ownpath += ownpath === "" ? "" : "/";
for(var i=0;i<children.length;i++){
- children[i]=ownpath+children[i];
+ children[i]=ownpath+ownpathpostfix+children[i];
}
return children;
};
@@ -931,7 +931,7 @@ define(['logManager',
};
var getNodePath = function(node){
- var path = core.getStringPath(node);
+ var path = /*core.getStringPath(node)*/ownpath;
if(path === ""){
path = "root";
}
|
getChildrenIds was corrected
Former-commit-id: db7f<I>cbfe<I>c<I>bb<I>c<I>dea<I>f<I>
|
webgme_webgme-engine
|
train
|
js
|
72946fcfaad04010d57a26e8e2bce9664c8b4933
|
diff --git a/lib/util/wrap.js b/lib/util/wrap.js
index <HASH>..<HASH> 100644
--- a/lib/util/wrap.js
+++ b/lib/util/wrap.js
@@ -23,16 +23,16 @@ exports.wrapExport = function (wrapFunction, required, optional) {
var collectOptions = true;
if (length === 1 && (first instanceof Object)) {
assume = true;
- var requiredArg = required[0];
- if (requiredArg && requiredArg instanceof Object) {
- for (var i = 0; i < requiredArg.length; i++) {
- if (first[requiredArg[i]]) {
+ var firstArg = required[0] || optional;
+ if (firstArg && firstArg instanceof Object) {
+ for (var i = 0; i < firstArg.length; i++) {
+ if (first[firstArg[i]]) {
options = first;
collectOptions = false;
break;
}
}
- } else if (requiredArg && first[requiredArg]) {
+ } else if (firstArg && first[firstArg]) {
options = first;
collectOptions = false;
}
|
Fix if there is only one argument and the function has no required arguments
Will now search through all the optional arguments.
|
sentanos_roblox-js
|
train
|
js
|
72813c7f50fcebed70296e0af31f2aed289e096c
|
diff --git a/src/resolvers/helpers/filter.js b/src/resolvers/helpers/filter.js
index <HASH>..<HASH> 100644
--- a/src/resolvers/helpers/filter.js
+++ b/src/resolvers/helpers/filter.js
@@ -77,6 +77,10 @@ export const filterHelperArgs = (
);
}
+ if (inputComposer.getFieldNames().length === 0) {
+ return {};
+ }
+
return {
filter: {
name: 'filter',
|
fix filterHelper, it does not return `filter` arg, if its fields are empty
|
graphql-compose_graphql-compose-mongoose
|
train
|
js
|
70416284c5b784256e7ee30e2704bc5da1d98678
|
diff --git a/src/UrlRoute.php b/src/UrlRoute.php
index <HASH>..<HASH> 100644
--- a/src/UrlRoute.php
+++ b/src/UrlRoute.php
@@ -29,7 +29,7 @@ class UrlRoute extends Route {
return $this->callback;
}
- public function dispatch(array $args) {
+ public function dispatch(array &$args) {
$callback = $args['callback'];
$callback_args = reflectArgs($callback, $args['args']);
@@ -61,10 +61,12 @@ class UrlRoute extends Route {
/**
* Convert a path pattern into its regex.
- * @param string $pattern
+ *
+ * @param string $pattern The route pattern to convert into a regular expression.
+ * @return string Returns the regex pattern for the route.
*/
protected static function patternRegex($pattern) {
- $result = preg_replace_callback('`{([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)}`i', function($match) {
+ $result = preg_replace_callback('`{([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)}`i', function ($match) {
$param = $match[1];
$param_pattern = '[^/]+';
$result = "(?<$param>$param_pattern)";
|
UrlRoute fix and doc comments.
|
vanilla_garden
|
train
|
php
|
615c667c818de67d924442758fa3ad103b734fd6
|
diff --git a/openquake/commands/restore.py b/openquake/commands/restore.py
index <HASH>..<HASH> 100644
--- a/openquake/commands/restore.py
+++ b/openquake/commands/restore.py
@@ -22,6 +22,7 @@ import time
import os.path
import zipfile
import sqlite3
+import requests
from openquake.baselib import sap
from openquake.baselib.general import safeprint
from openquake.server.dbapi import Db
@@ -32,13 +33,19 @@ def restore(archive, oqdata):
"""
Build a new oqdata directory from the data contained in the zip archive
"""
+ if os.path.exists(oqdata):
+ sys.exit('%s exists already' % oqdata)
+ if '://' in archive:
+ # get the zip archive from an URL
+ resp = requests.get(archive)
+ _, archive = archive.rsplit('/', 1)
+ with open(archive, 'wb') as f:
+ f.write(resp.content)
if not os.path.exists(archive):
sys.exit('%s does not exist' % archive)
t0 = time.time()
oqdata = os.path.abspath(oqdata)
assert archive.endswith('.zip'), archive
- if os.path.exists(oqdata):
- sys.exit('%s exists already' % oqdata)
os.mkdir(oqdata)
zipfile.ZipFile(archive).extractall(oqdata)
dbpath = os.path.join(oqdata, 'db.sqlite3')
|
Extended oq restore to download from URLs [skip CI]
Former-commit-id: dcc<I>c<I>a0ff3c<I>d7d<I>e<I>b<I>f<I>f
|
gem_oq-engine
|
train
|
py
|
3dfdba092c408470570df5e781b8e02fd2c2ba5d
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -21,6 +21,7 @@ setup(
version=version,
description='Python API for accessing the REST API of the Xero accounting tool.',
long_description=long_description,
+ long_description_content_type='text/markdown',
author='Russell Keith-Magee',
author_email='russell@keith-magee.com',
url='http://github.com/freakboy3742/pyxero',
|
Corrected markup content type for long description.
|
freakboy3742_pyxero
|
train
|
py
|
17d73b77f0676d9a9188ddc066ee65d76a440721
|
diff --git a/src/components/inputs/select-input/select-input.spec.js b/src/components/inputs/select-input/select-input.spec.js
index <HASH>..<HASH> 100644
--- a/src/components/inputs/select-input/select-input.spec.js
+++ b/src/components/inputs/select-input/select-input.spec.js
@@ -116,6 +116,25 @@ describe('in single mode', () => {
});
});
describe('interacting', () => {
+ describe('when isAutofocussed is `true`', () => {
+ it('should open the list and all options should be visible', () => {
+ const { getByLabelText, getByText } = renderInput({
+ isAutofocussed: true,
+ });
+
+ const input = getByLabelText('Fruit');
+
+ fireEvent.blur(input);
+
+ fireEvent.keyDown(input, {
+ key: 'ArrowDown',
+ });
+
+ expect(getByText('Mango')).toBeInTheDocument();
+ expect(getByText('Lichi')).toBeInTheDocument();
+ expect(getByText('Raspberry')).toBeInTheDocument();
+ });
+ });
it('should open the list and all options should be visible', () => {
const { getByLabelText, getByText } = renderInput();
const input = getByLabelText('Fruit');
|
chore(select-input): add test for when autoFocussed is true (#<I>)
* chore(select-input): add test for when autoFocussed is true
|
commercetools_ui-kit
|
train
|
js
|
9dd187ff074883a40b01aa04a3bd9c709b027bf4
|
diff --git a/test/specs/utils/Sorter.js b/test/specs/utils/Sorter.js
index <HASH>..<HASH> 100644
--- a/test/specs/utils/Sorter.js
+++ b/test/specs/utils/Sorter.js
@@ -1,7 +1,8 @@
-var Sorter = require('undefined');
+// import Sorter from '../../../src/utils/Sorter.js'
-describe('Sorter', () => {
- var fixtures;
+// TODO: Migrate this file to Jest
+
+describe.skip('Sorter', () => {
var fixture;
var obj;
var parent;
|
Skip sorter test (awaiting migrate to jest)
|
artf_grapesjs
|
train
|
js
|
edaafab62fb2ba1b9fba1dcf877a90b27e287397
|
diff --git a/Framework/FileOrganiser.php b/Framework/FileOrganiser.php
index <HASH>..<HASH> 100644
--- a/Framework/FileOrganiser.php
+++ b/Framework/FileOrganiser.php
@@ -4,7 +4,19 @@
* of the FileOrganiser to copy the required files into the webroot when
* required. The files may need to be minified and compiled before they are
* copied.
- * TODO: What about overriding Gt files with App files? (test)
+ *
+ * TODO: Implement these steps.
+ * Steps made in this file:
+ * 1) Loop over all files within Style and Script directories of APPROOT and
+ * GTROOT, making a list of all files to be copied.
+ * 2) For each .js and .css file, check the filemtime against the public
+ * files of the same name, or the compiled Script.js/Style.css file. Remove file
+ * from copy list if not changed.
+ * 3) For each .scss file, check the filemtime against the public files of
+ * the same name, with .css extension, or the compiled Style.css file, and
+ * pre-process if necessary. Remove file from copy list if not changed.
+ * 4) If there are files in the copy list (there is a change), empty the public
+ * www directory and either copy the files or create a compiled file.
*/
public function __construct($config) {
// For production sites, any un-compiled scripts that exist in the
|
Started re-implementing FileOrganiser for #<I>
|
PhpGt_WebEngine
|
train
|
php
|
4f3e38e745c389af48525f6355a19359a374e987
|
diff --git a/lib/dml/mysqli_native_moodle_database.php b/lib/dml/mysqli_native_moodle_database.php
index <HASH>..<HASH> 100644
--- a/lib/dml/mysqli_native_moodle_database.php
+++ b/lib/dml/mysqli_native_moodle_database.php
@@ -853,8 +853,8 @@ class mysqli_native_moodle_database extends moodle_database {
return $sql;
}
// ok, we have verified sql statement with ? and correct number of params
- $parts = explode('?', $sql);
- $return = array_shift($parts);
+ $parts = array_reverse(explode('?', $sql));
+ $return = array_pop($parts);
foreach ($params as $param) {
if (is_bool($param)) {
$return .= (int)$param;
@@ -868,7 +868,7 @@ class mysqli_native_moodle_database extends moodle_database {
$param = $this->mysqli->real_escape_string($param);
$return .= "'$param'";
}
- $return .= array_shift($parts);
+ $return .= array_pop($parts);
}
return $return;
}
|
MDL-<I> improve emulate_bound_params() for mysqli
Looping over large numbers of items with array_shift() is expensive.
Reverse the array and fetch items from the top of the pile.
|
moodle_moodle
|
train
|
php
|
6916743e614f126f95c652def790daa0be8002b4
|
diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -161,7 +161,14 @@ class DissectHtml {
babelJs(js) {
try {
return Babel.transform(js, {
- presets: ['es2015']
+ presets: [
+ ['es2015',
+ {
+ modules: false,
+ blacklist: ['useStrict']
+ },
+ ]
+ ]
}).code
} catch (err) {
console.error(`Error in ${this.path}`) // eslint-disable-line no-console
|
babel blacklist use strict. #9
|
aruntk_wc-loader
|
train
|
js
|
5c042befee5306bb552be98538dca7abb312006f
|
diff --git a/Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/DiscreteMovementCommandsImplementation.java b/Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/DiscreteMovementCommandsImplementation.java
index <HASH>..<HASH> 100755
--- a/Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/DiscreteMovementCommandsImplementation.java
+++ b/Minecraft/src/main/java/com/microsoft/Malmo/MissionHandlers/DiscreteMovementCommandsImplementation.java
@@ -112,8 +112,8 @@ public class DiscreteMovementCommandsImplementation extends CommandBase implemen
double newX = player.posX;
double newZ = player.posZ;
// Are we still in the centre of a square, or did we get shunted?
- double desiredX = ((int)(Math.abs(newX)) + 0.5) * (newX >= 0 ? 1 : -1);
- double desiredZ = ((int)(Math.abs(newZ)) + 0.5) * (newZ >= 0 ? 1 : -1);
+ double desiredX = Math.floor(newX) + 0.5;
+ double desiredZ = Math.floor(newZ) + 0.5;
double deltaX = desiredX - newX;
double deltaZ = desiredZ - newZ;
if (deltaX * deltaX + deltaZ * deltaZ > 0.001)
|
Less stupid fix for discrete -ve movement.
|
Microsoft_malmo
|
train
|
java
|
a54b66b0609d18b77934222cf8ae48742b330b0d
|
diff --git a/spec/viewport_spec.rb b/spec/viewport_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/viewport_spec.rb
+++ b/spec/viewport_spec.rb
@@ -8,6 +8,6 @@ describe Remedy::Viewport do
joke << "A: Purple, because ice cream has no bones!"
screen = ::Remedy::Viewport.new
- screen.draw joke
+ screen.draw joke unless ENV['CI']
end
end
|
Don't actually execute draw if we're on CI, since it will break.
|
acook_remedy
|
train
|
rb
|
6b6eb22ca1b560f13cefc78bd5b0985b3d85a0da
|
diff --git a/lib/test-server/client/slave-client.js b/lib/test-server/client/slave-client.js
index <HASH>..<HASH> 100644
--- a/lib/test-server/client/slave-client.js
+++ b/lib/test-server/client/slave-client.js
@@ -251,7 +251,8 @@
var replaceConsoleFunction = function (console, name, scope) {
var oldFunction = config.localConsole === false ? emptyFunction : console[name] || emptyFunction;
console[name] = function () {
- var res = oldFunction.apply(this, arguments);
+ // IE < 9 compatible: http://stackoverflow.com/questions/5538972/console-log-apply-not-working-in-ie9#comment8444540_5539378
+ var res = Function.prototype.apply.call(oldFunction, this, arguments);
var taskExecutionId = scope.__taskExecutionId;
if (!currentTask || currentTask.taskExecutionId !== taskExecutionId) {
taskExecutionId = -1;
|
fix #<I> On IE versions older than 9 native methods on the "console" object don't have an "apply" method
The workaround is to call the generic "apply" (from "Function"'s prototype) using its own "call" method with proper arguments.
|
attester_attester
|
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.