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 |
|---|---|---|---|---|---|
0d7c1295e90032a013379e35b52ba09d48778160 | diff --git a/lib/networkOut.js b/lib/networkOut.js
index <HASH>..<HASH> 100644
--- a/lib/networkOut.js
+++ b/lib/networkOut.js
@@ -25,10 +25,11 @@ module.exports = function(connection, request) {
if (cb) { cb(); };
},
- stdout: function(str) {
+ stdout: function(str, level) {
var result = {request: request,
responseType: 'stdout',
- stdout: str};
+ stdout: str,
+ level: level || 'debug'};
connection.write(JSON.stringify(result) + '\n');
}, | improving build output with level (debug, info, warn, error) | nearform_nscale-protocol | train | js |
f00515262d1629a2a1f810eb57b8998db9cee115 | diff --git a/lib/ProMotion/tabs/tabs.rb b/lib/ProMotion/tabs/tabs.rb
index <HASH>..<HASH> 100644
--- a/lib/ProMotion/tabs/tabs.rb
+++ b/lib/ProMotion/tabs/tabs.rb
@@ -41,7 +41,8 @@ module ProMotion
item = UITabBarItem.alloc.initWithTitle(title, image: item_image, tag: tag)
if item_selected || item_unselected
- item.setFinishedSelectedImage(item_selected, withFinishedUnselectedImage: item_unselected)
+ item.image = item_unselected
+ item.selectedImage = item_selected
end
item | As per apple docs, setFinishedSelectedImage:withFinishedUnselectedImage: is deprecated as of <I> | infinitered_ProMotion | train | rb |
0d763dc509f7cacbc3572197706b8e6e64534b16 | diff --git a/core/components/broker/brokerManager.go b/core/components/broker/brokerManager.go
index <HASH>..<HASH> 100644
--- a/core/components/broker/brokerManager.go
+++ b/core/components/broker/brokerManager.go
@@ -62,7 +62,7 @@ func (b component) ValidateOTAA(bctx context.Context, req *core.ValidateOTAABrok
// UpsertABP implements the core.BrokerManager interface
func (b component) UpsertABP(bctx context.Context, req *core.UpsertABPBrokerReq) (*core.UpsertABPBrokerRes, error) {
- b.Ctx.Debug("Handle ValidateOTAA request")
+ b.Ctx.Debug("Handle UpsertABP request")
// 1. Validate the request
re := regexp.MustCompile("^([-\\w]+\\.?)+:\\d+$") | [log] Fix copy/paste mistake | TheThingsNetwork_ttn | train | go |
c24e0e04c57641edd47cffa4c68cc95cf0f256d7 | diff --git a/neuron/lang.js b/neuron/lang.js
index <HASH>..<HASH> 100755
--- a/neuron/lang.js
+++ b/neuron/lang.js
@@ -163,25 +163,20 @@ K.mix(K, {
* method to encapsulate the delayed function
*/
delay: function(fn, delay, isInterval){
- var timer;
-
- return {
+ var ret = {
start: function(){
- this.cancel();
- return timer = isInterval ? setInterval(fn, delay) : setTimeout(fn, delay);
+ ret.cancel();
+ return ret.id = isInterval ? setInterval(fn, delay) : setTimeout(fn, delay);
},
cancel: function(){
- isInterval ? clearInterval(timer) : clearTimeout(timer);
- return this;
+ var timer = ret.id;
+
+ ret.id = isInterval ? clearInterval(timer) : clearTimeout(timer);
+ return ret;
}
- }
- },
-
- /**
- *
- */
- each: function(obj, fn, stop){
+ };
+ return ret;
},
makeArray: function(obj){ | adjust KM.delay method, setting timer id as a public member | kaelzhang_neuron.js | train | js |
ba6aa9d37e4b15c8ac12d74099a3170f16f5ea97 | diff --git a/rosetta/views.py b/rosetta/views.py
index <HASH>..<HASH> 100644
--- a/rosetta/views.py
+++ b/rosetta/views.py
@@ -219,6 +219,8 @@ def home(request):
if ref_entry is not None and ref_entry.msgstr:
o.ref_txt = ref_entry.msgstr
LANGUAGES = list(settings.LANGUAGES) + [('msgid', 'MSGID')]
+ else:
+ LANGUAGES = settings.LANGUAGES
if 'page' in request.GET and int(request.GET.get('page')) <= paginator.num_pages and int(request.GET.get('page')) > 0:
page = int(request.GET.get('page')) | Fixed a crash when reflang wouldn't be enabled.
This crash was introduced by the merge with mbi/develop. | mbi_django-rosetta | train | py |
a6856f1dd94ab252332502479e1e21fea569ab1b | diff --git a/src/main/java/org/minimalj/frontend/impl/swing/toolkit/SwingFrontend.java b/src/main/java/org/minimalj/frontend/impl/swing/toolkit/SwingFrontend.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/minimalj/frontend/impl/swing/toolkit/SwingFrontend.java
+++ b/src/main/java/org/minimalj/frontend/impl/swing/toolkit/SwingFrontend.java
@@ -140,11 +140,7 @@ public class SwingFrontend extends Frontend {
@Override
public IComponent createVerticalGroup(IComponent... components) {
- if (components.length == 1) {
- return components[0];
- } else {
- return new SwingVerticalGroup(components);
- }
+ return new SwingVerticalGroup(components);
}
@Override | SwingFrontend: don't optimize vertical group
Layouting is different for a vertical group. | BrunoEberhard_minimal-j | train | java |
fac709b16aa120baa1735dd37bb50b86d6df8bb3 | diff --git a/sedge/cli.py b/sedge/cli.py
index <HASH>..<HASH> 100644
--- a/sedge/cli.py
+++ b/sedge/cli.py
@@ -81,7 +81,7 @@ def command_update(args):
# do not edit this file manually, edit the source file and re-run `sedge'
#
-''' % (args.output_file))
+''' % (args.config_file))
write_to(ConfigOutput(tmpf.file))
tmpf.close()
if args.verbose: | fix path sedge config path in generated SSH config | grahame_sedge | train | py |
af4dca73efe7c45c841f8d877a9587684bc817a6 | diff --git a/pythonforandroid/bootstraps/common/build/build.py b/pythonforandroid/bootstraps/common/build/build.py
index <HASH>..<HASH> 100644
--- a/pythonforandroid/bootstraps/common/build/build.py
+++ b/pythonforandroid/bootstraps/common/build/build.py
@@ -616,6 +616,10 @@ tools directory of the Android SDK.
default=default_min_api, type=int,
help=('Minimum Android SDK version that the app supports. '
'Defaults to {}.'.format(default_min_api)))
+ ap.add_argument('--allow-minsdk-ndkapi-mismatch', default=False,
+ action='store_true',
+ help=('Allow the --minsdk argument to be different from '
+ 'the discovered ndk_api in the dist'))
ap.add_argument('--intent-filters', dest='intent_filters',
help=('Add intent-filters xml rules to the '
'AndroidManifest.xml file. The argument is a ' | Re-added argument that was lost during build.py merge | kivy_python-for-android | train | py |
c1b3d65b62a5f14c5ca489e7da93e46239d6bef6 | diff --git a/polyfills/Array/from/tests.js b/polyfills/Array/from/tests.js
index <HASH>..<HASH> 100644
--- a/polyfills/Array/from/tests.js
+++ b/polyfills/Array/from/tests.js
@@ -92,27 +92,6 @@ describe('returns an array with', function () {
}
}
- it('can convert from a user-defined iterator', function () {
- function iterator(cnt) {
- return {
- next: function () {
- return cnt === 0
- ? {
- done: true
- }
- : {
- value: cnt--,
- done: false
- };
- }
- };
- }
- proclaim.deepEqual(Array.from(iterator(0)), []);
- proclaim.deepEqual(Array.from(iterator(1)), [1]);
- proclaim.deepEqual(Array.from(iterator(2)), [2, 1]);
- proclaim.deepEqual(Array.from(iterator(3)), [3, 2, 1]);
- });
-
if ('Symbol' in window && 'iterator' in Symbol) {
it('can understand objects which have a property named Symbol.iterator', function () {
var o = {}; | Remove incorrect test for userland defined iterator on Array.from (#<I>)
This is not a user defined iterator | Financial-Times_polyfill-service | train | js |
34d2968aa3d78539317e3cfdee583c39efa5f803 | diff --git a/repository.go b/repository.go
index <HASH>..<HASH> 100644
--- a/repository.go
+++ b/repository.go
@@ -268,8 +268,12 @@ func (r *Repository) ListTags(rbo *RepositoryTagOptions) (*RepositoryTags, error
if err != nil {
return nil, err
}
-
- return decodeRepositoryTags(response)
+ bodyBytes, err := ioutil.ReadAll(response)
+ if err != nil {
+ return nil, err
+ }
+ bodyString := string(bodyBytes)
+ return decodeRepositoryTags(bodyString)
}
func (r *Repository) Delete(ro *RepositoryOptions) (interface{}, error) {
@@ -575,10 +579,10 @@ func decodeRepositoryBranch(branchResponseStr string) (*RepositoryBranch, error)
return &repositoryBranch, nil
}
-func decodeRepositoryTags(tagResponse interface{}) (*RepositoryTags, error) {
+func decodeRepositoryTags(tagResponseStr string) (*RepositoryTags, error) {
var tagResponseMap map[string]interface{}
- err := json.Unmarshal(tagResponse.([]byte), &tagResponseMap)
+ err := json.Unmarshal([]byte(tagResponseStr), &tagResponseMap)
if err != nil {
return nil, err
} | Fix ListTags (#<I>) (#<I>) | ktrysmt_go-bitbucket | train | go |
b093e1b2d88d34c0f4efcc79442e37d217196bcb | diff --git a/Tests/TestCase.php b/Tests/TestCase.php
index <HASH>..<HASH> 100755
--- a/Tests/TestCase.php
+++ b/Tests/TestCase.php
@@ -16,7 +16,7 @@
*/
namespace AlphaLemon\AlphaLemonCmsBundle\Tests;
-class TestCase extends \PHPUnit_Framework_TestCase
+abstract class TestCase extends \PHPUnit_Framework_TestCase
{
protected $connection = null;
diff --git a/Tests/WebTestCaseFunctional.php b/Tests/WebTestCaseFunctional.php
index <HASH>..<HASH> 100644
--- a/Tests/WebTestCaseFunctional.php
+++ b/Tests/WebTestCaseFunctional.php
@@ -34,7 +34,7 @@ use AlphaLemon\AlphaLemonCmsBundle\Core\Repository\Factory\AlFactoryRepository;
*
* @author alphalemon <webmaster@alphalemon.com>
*/
-class WebTestCaseFunctional extends WebTestCase
+abstract class WebTestCaseFunctional extends WebTestCase
{
protected $client;
protected static $languages; | made base class for unit and functional tests abstract | redkite-labs_RedKiteCmsBundle | train | php,php |
ecbedef6265e7b8964d981cfd57eaf751d610e23 | diff --git a/config/generators.php b/config/generators.php
index <HASH>..<HASH> 100644
--- a/config/generators.php
+++ b/config/generators.php
@@ -14,6 +14,7 @@ return [
'component' => '.component.js',
'componentView' => '.component.html',
'dialog' => '.dialog.js',
+ 'dialogView' => '.dialog.html',
'service' => '.service.js',
'config' => '.config.js',
'filter' => '.filter.js',
diff --git a/src/Console/Commands/AngularDialog.php b/src/Console/Commands/AngularDialog.php
index <HASH>..<HASH> 100644
--- a/src/Console/Commands/AngularDialog.php
+++ b/src/Console/Commands/AngularDialog.php
@@ -61,7 +61,7 @@ class AngularDialog extends Command
File::makeDirectory($folder, 0775, true);
//create view (.html)
- File::put($folder.'/'.$name.'.html', $html);
+ File::put($folder.'/'.$name.config('generators.prefix.dialogView', '.html'), $html);
//create controller (.js)
File::put($folder.'/'.$name.config('generators.prefix.dialog'), $js); | dialog view is now .dialog.html | jadjoubran_laravel-ng-artisan-generators | train | php,php |
41819975e869beeb9b42ffe10c68612f7baf5d62 | diff --git a/cake/libs/controller/components/auth.php b/cake/libs/controller/components/auth.php
index <HASH>..<HASH> 100644
--- a/cake/libs/controller/components/auth.php
+++ b/cake/libs/controller/components/auth.php
@@ -209,12 +209,6 @@ class AuthComponent extends Component {
*/
public $logoutRedirect = null;
-/**
- * The name of model or model object, or any other object has an isAuthorized method.
- *
- * @var string
- */
- public $object = null;
/**
* Error to display when user login fails. For security purposes, only one error is used for all | Removing a dead property. | cakephp_cakephp | train | php |
29dc723c75b3d231762d691ebff4e4f468d8e18b | diff --git a/lib/listen/adapter/linux.rb b/lib/listen/adapter/linux.rb
index <HASH>..<HASH> 100644
--- a/lib/listen/adapter/linux.rb
+++ b/lib/listen/adapter/linux.rb
@@ -12,7 +12,8 @@ module Listen
:delete,
:move,
:close_write
- ]
+ ],
+ wait_for_delay: 0.1
}
private
diff --git a/lib/listen/adapter/polling.rb b/lib/listen/adapter/polling.rb
index <HASH>..<HASH> 100644
--- a/lib/listen/adapter/polling.rb
+++ b/lib/listen/adapter/polling.rb
@@ -8,7 +8,7 @@ module Listen
class Polling < Base
OS_REGEXP = // # match every OS
- DEFAULTS = { latency: 1.0 }
+ DEFAULTS = { latency: 1.0, wait_for_delay: 0.01 }
private
diff --git a/spec/acceptance/listen_spec.rb b/spec/acceptance/listen_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/acceptance/listen_spec.rb
+++ b/spec/acceptance/listen_spec.rb
@@ -1,7 +1,7 @@
# encoding: UTF-8
RSpec.describe 'Listen', acceptance: true do
- let(:base_options) { { wait_for_delay: 0.1, latency: 0.1 } }
+ let(:base_options) { { latency: 0.1 } }
let(:polling_options) { {} }
let(:options) { {} }
let(:all_options) { base_options.merge(polling_options).merge(options) } | make wait_for_delay default adapter specific | guard_listen | train | rb,rb,rb |
eff23f1265715720313dcbd510e9cd7c8aea7f5f | diff --git a/runcommands/command.py b/runcommands/command.py
index <HASH>..<HASH> 100644
--- a/runcommands/command.py
+++ b/runcommands/command.py
@@ -12,7 +12,7 @@ from .exc import CommandError, RunCommandsError
from .util import cached_property, camel_to_underscore, get_hr, printer
-__all__ = ['command', 'Command']
+__all__ = ['command', 'subcommand', 'Command']
class Command: | Add subcommand to command.__all__
Amends b<I>a7da6bee4 | wylee_runcommands | train | py |
d43f85063a0e40fdb5d02fb63d82639f2ca278f5 | diff --git a/spec/unit/application/inspect_spec.rb b/spec/unit/application/inspect_spec.rb
index <HASH>..<HASH> 100755
--- a/spec/unit/application/inspect_spec.rb
+++ b/spec/unit/application/inspect_spec.rb
@@ -246,9 +246,9 @@ describe Puppet::Application::Inspect do
@inspect.run_command
@report.status.should == "failed"
- @report.logs.select{|log| log.message =~ /Could not inspect/}.count.should == 1
- @report.resource_statuses.count.should == 1
- @report.resource_statuses['Stub_type[foo]'].events.count.should == 1
+ @report.logs.select{|log| log.message =~ /Could not inspect/}.size.should == 1
+ @report.resource_statuses.size.should == 1
+ @report.resource_statuses['Stub_type[foo]'].events.size.should == 1
event = @report.resource_statuses['Stub_type[foo]'].events.first
event.property.should == "content"
@@ -265,7 +265,7 @@ describe Puppet::Application::Inspect do
@inspect.run_command
- @report.resource_statuses.count.should == 2
+ @report.resource_statuses.size.should == 2
@report.resource_statuses.keys.should =~ ['Stub_type[foo]', 'Stub_type[bar]']
end
end | maint: Ruby < <I> knows size but not count
Reviewd-by: Nick Lewis | puppetlabs_puppet | train | rb |
75e04d49b852819ddc9610605d68c0f5ba94c105 | diff --git a/lib/Fakturoid.php b/lib/Fakturoid.php
index <HASH>..<HASH> 100644
--- a/lib/Fakturoid.php
+++ b/lib/Fakturoid.php
@@ -279,4 +279,3 @@ class Fakturoid {
}
}
-?> | Omit closing `?>`.
It's considered as a best-practice (<URL>)
to avoid issue with whitespace being sent as a response before headers
are sent. | fakturoid_fakturoid-php | train | php |
589173c4c2ca30f82d6b89aa15c2ce86cf0c77a2 | diff --git a/tests/TestCase.php b/tests/TestCase.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -20,4 +20,16 @@ abstract class TestCase extends PHPUnitTestCase
parent::expectExceptionMessageRegExp($regularExpression);
}
}
+
+ /**
+ * Backwards compatibility for PHPUnit 7.5.
+ */
+ public static function assertDirectoryDoesNotExist(string $directory, string $message = ''): void
+ {
+ if (method_exists(PHPUnitTestCase::class, 'expectExceptionMessageMatches')) {
+ parent::assertDirectoryDoesNotExist($directory, $message);
+ } else {
+ static::assertFalse(is_dir($directory), $message);
+ }
+ }
} | Add backwards compatibility for assertDirectoryDoesNotExist | scheb_tombstone | train | php |
f7ef0f238bf0d2c83619102d0aefe61347a4dc71 | diff --git a/pypelogs.py b/pypelogs.py
index <HASH>..<HASH> 100644
--- a/pypelogs.py
+++ b/pypelogs.py
@@ -5,10 +5,6 @@ import pypein
import pypef
import pypeout
from g11pyutils import StopWatch
-# Execfile doesn't seem to do anything with imports,
-# So add some common ones here
-import hashlib
-import base64
LOG = logging.getLogger("pypelogs")
@@ -26,7 +22,7 @@ def main():
if args.config:
LOG.info("Running config file %s" % args.config)
- execfile(args.config)
+ execfile(args.config, globals())
process(args.specs) | Pass globals to execfile so imports are available. | gear11_pypelogs | train | py |
57bc3351b69e2282476c8542a961de75062e0105 | diff --git a/lib/generamba/version.rb b/lib/generamba/version.rb
index <HASH>..<HASH> 100644
--- a/lib/generamba/version.rb
+++ b/lib/generamba/version.rb
@@ -1,3 +1,3 @@
module Generamba
- VERSION = '0.7.4'
+ VERSION = '0.7.5'
end | Increased version number to <I> | strongself_Generamba | train | rb |
046d6dc19f712f1b7f3683ffabf15210d9ee7c5e | diff --git a/lib/dialect/postgres.js b/lib/dialect/postgres.js
index <HASH>..<HASH> 100644
--- a/lib/dialect/postgres.js
+++ b/lib/dialect/postgres.js
@@ -1061,7 +1061,7 @@ Postgres.prototype.handleDistinct = function(actions,filters) {
*/
function dontParenthesizeSubQuery(parentQuery){
if (!parentQuery) return false;
- if (parentQuery.nodes.length == 0) return false;
+ if (parentQuery.nodes.length === 0) return false;
if (parentQuery.nodes[0].type != 'INSERT') return false;
return true;
} | jshint-fix: fix for jshint error | brianc_node-sql | train | js |
59fc34a97c6cdea22bccef7a61d111954954c96a | diff --git a/utilitybelt.py b/utilitybelt.py
index <HASH>..<HASH> 100644
--- a/utilitybelt.py
+++ b/utilitybelt.py
@@ -283,11 +283,7 @@ def ipvoid_check(ip):
detect_site = each.parent.parent.td.text.lstrip()
detect_url = each.parent.a['href']
return_dict[detect_site] = detect_url
- else:
- return None
- if len(return_dict) == 0:
- return None
return return_dict
@@ -309,8 +305,6 @@ def urlvoid_check(name):
detect_url = each.parent.a['href']
return_dict[detect_site] = detect_url
- if len(return_dict) == 0:
- return None
return return_dict
@@ -334,9 +328,5 @@ def urlvoid_ip_check(ip):
return_dict['bad_names'].append(each.parent.text.strip())
for each in data.findAll('img', alt='Valid'):
return_dict['other_names'].append(each.parent.text.strip())
- else:
- return None
- if len(return_dict) == 0:
- return None
return return_dict | Remove branches we should not reach that would fail silently if we did | yolothreat_utilitybelt | train | py |
4daa11d9ecd90f1f427a7e017fa867987cb3e570 | diff --git a/lib/deep_cover/node/mixin/has_child.rb b/lib/deep_cover/node/mixin/has_child.rb
index <HASH>..<HASH> 100644
--- a/lib/deep_cover/node/mixin/has_child.rb
+++ b/lib/deep_cover/node/mixin/has_child.rb
@@ -73,8 +73,8 @@ module DeepCover
if remap.is_a? Hash
type_map = remap
remap = -> (child) do
- klass = type_map[child.class]
- klass ||= type_map[child.type] if child.respond_to? :type
+ klass = type_map[child.type] if child.respond_to? :type
+ klass ||= type_map[child.class]
klass
end
types.concat(type_map.values).uniq! | Remap based on type first, then on Class | deep-cover_deep-cover | train | rb |
714bf3217ec8391ee8194543b0cbbe60673304e7 | diff --git a/static/slidey/js/slidey.js b/static/slidey/js/slidey.js
index <HASH>..<HASH> 100644
--- a/static/slidey/js/slidey.js
+++ b/static/slidey/js/slidey.js
@@ -383,10 +383,12 @@ function Slidey()
}
switch (e.keyCode) {
+ case 33: // Page up
case 37: // Left
e.preventDefault();
slidey.precDiscover();
break;
+ case 34: // Page down
case 39: // Right
e.preventDefault();
slidey.nextDiscover(); | Adding pg down/up support | Gregwar_Slidey | train | js |
2dbcdc2244b578bcfccc0001b4b222225ffacbab | diff --git a/src/serialization/sb2.js b/src/serialization/sb2.js
index <HASH>..<HASH> 100644
--- a/src/serialization/sb2.js
+++ b/src/serialization/sb2.js
@@ -215,7 +215,7 @@ const parseScratchObject = function (object, runtime, extensions, topLevel, zip)
const sprite = new Sprite(blocks, runtime);
// Sprite/stage name from JSON.
if (object.hasOwnProperty('objName')) {
- sprite.name = object.objName;
+ sprite.name = topLevel ? 'Stage' : object.objName;
}
// Costumes from JSON.
const costumePromises = []; | The stage should always be called 'Stage'. | LLK_scratch-vm | train | js |
5c835fcc4fa03e74dd03bf7661b65771bf539adc | diff --git a/server/fsm.go b/server/fsm.go
index <HASH>..<HASH> 100644
--- a/server/fsm.go
+++ b/server/fsm.go
@@ -541,8 +541,12 @@ func (h *FSMHandler) recvMessageWithError() error {
if len(h.holdTimerResetCh) == 0 {
h.holdTimerResetCh <- true
}
+ if m.Header.Type == bgp.BGP_MSG_KEEPALIVE {
+ return nil
+ }
case bgp.BGP_MSG_NOTIFICATION:
h.reason = "Notification received"
+ return nil
}
}
} | server: don't put keepalive & notification to incoming ch
these msgs are garbage for server's main loop and just wasting channel
buffer. | osrg_gobgp | train | go |
002545901e04401d4101578c7ce558a3a3855a57 | diff --git a/src/Commands/CrudCommand.php b/src/Commands/CrudCommand.php
index <HASH>..<HASH> 100644
--- a/src/Commands/CrudCommand.php
+++ b/src/Commands/CrudCommand.php
@@ -20,7 +20,7 @@ class CrudCommand extends Command
{--view-path= : The name of the view path.}
{--namespace= : Namespace of the controller.}
{--route-group= : Prefix of the route group.}
- {--pagination=15 : The amount of models per page for index pages.}
+ {--pagination=25 : The amount of models per page for index pages.}
{--indexes= : The fields to add an index to.}
{--foreign-keys= : Any foreign keys for the table.}
{--relationships= : The relationships for the model}
diff --git a/src/Commands/CrudControllerCommand.php b/src/Commands/CrudControllerCommand.php
index <HASH>..<HASH> 100644
--- a/src/Commands/CrudControllerCommand.php
+++ b/src/Commands/CrudControllerCommand.php
@@ -18,7 +18,7 @@ class CrudControllerCommand extends GeneratorCommand
{--view-path= : The name of the view path.}
{--required-fields= : Required fields for validations.}
{--route-group= : Prefix of the route group.}
- {--pagination=15 : The amount of models per page for index pages.}';
+ {--pagination=25 : The amount of models per page for index pages.}';
/**
* The console command description. | changed default items per page from <I> to <I> | appzcoder_crud-generator | train | php,php |
c2196f25214e25801ebf867315b44a5dd6059c17 | diff --git a/richtextfx/src/integrationTest/java/org/fxmisc/richtext/api/HitTests.java b/richtextfx/src/integrationTest/java/org/fxmisc/richtext/api/HitTests.java
index <HASH>..<HASH> 100644
--- a/richtextfx/src/integrationTest/java/org/fxmisc/richtext/api/HitTests.java
+++ b/richtextfx/src/integrationTest/java/org/fxmisc/richtext/api/HitTests.java
@@ -5,6 +5,7 @@ import javafx.geometry.Bounds;
import javafx.geometry.Insets;
import javafx.geometry.Point2D;
import javafx.geometry.Pos;
+import javafx.stage.Stage;
import org.fxmisc.richtext.InlineCssTextAreaAppTest;
import org.fxmisc.richtext.model.NavigationActions;
import org.junit.Before;
@@ -19,6 +20,15 @@ import static org.junit.Assert.assertEquals;
@RunWith(NestedRunner.class)
public class HitTests extends InlineCssTextAreaAppTest {
+ @Override
+ public void start(Stage stage) throws Exception {
+ super.start(stage);
+
+ // insure stage width doesn't change irregardless of changes in superclass' start method
+ stage.setWidth(400);
+ stage.setHeight(400);
+ }
+
private void moveCaretToAreaEnd() {
area.moveTo(area.getLength());
} | Prevent super class stage dimension changes from messing up assertions | FXMisc_RichTextFX | train | java |
0e1b9be52710721dd0172f75013c4bcca0a2407e | diff --git a/MediaBundle/DisplayBlock/Strategies/DisplayMediaStrategy.php b/MediaBundle/DisplayBlock/Strategies/DisplayMediaStrategy.php
index <HASH>..<HASH> 100644
--- a/MediaBundle/DisplayBlock/Strategies/DisplayMediaStrategy.php
+++ b/MediaBundle/DisplayBlock/Strategies/DisplayMediaStrategy.php
@@ -46,10 +46,10 @@ class DisplayMediaStrategy extends AbstractStrategy
public function show(ReadBlockInterface $block)
{
$linkUrl = null;
- $nodeName = $block->getAttribute('linkUrl');
+ $nodeToLink = $block->getAttribute('nodeToLink');
- if (!empty($nodeName)) {
- $linkUrl = $this->nodeRepository->findOneByNodeIdAndLanguageWithPublishedAndLastVersionAndSiteId($nodeName);
+ if (!empty($nodeToLink)) {
+ $linkUrl = $this->nodeRepository->findOneByNodeIdAndLanguageWithPublishedAndLastVersionAndSiteId($nodeToLink);
}
$parameters = array( | rename linkUrl into nodeToLink | open-orchestra_open-orchestra-media-bundle | train | php |
a1a0a69dcc052acfbd1333210046acaf41f40832 | diff --git a/src/KeenIO/Service/KeenIO.php b/src/KeenIO/Service/KeenIO.php
index <HASH>..<HASH> 100644
--- a/src/KeenIO/Service/KeenIO.php
+++ b/src/KeenIO/Service/KeenIO.php
@@ -140,7 +140,7 @@ final class KeenIO
* @param $allowed_operations - what operations the generated scoped key will allow
* @return string
*/
- public static function getScopedKey($apiKey, $filters, $allowed_operations)
+ public static function getScopedKey($apiKey, $filters, $allowed_operations, $source = MCRYPT_DEV_RANDOM)
{
self::validateConfiguration();
@@ -153,7 +153,7 @@ final class KeenIO
$optionsJson = self::padString(json_encode($options));
$ivLength = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
- $iv = mcrypt_create_iv($ivLength);
+ $iv = mcrypt_create_iv($ivLength, $source);
$encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $apiKey, $optionsJson, MCRYPT_MODE_CBC, $iv); | allow to choose the "random source" when generating scoped keys | keenlabs_KeenClient-PHP | train | php |
9ba988df4bc79426d81aa7e04c0cf31b3071de0a | diff --git a/installation-bundle/src/Database/Installer.php b/installation-bundle/src/Database/Installer.php
index <HASH>..<HASH> 100644
--- a/installation-bundle/src/Database/Installer.php
+++ b/installation-bundle/src/Database/Installer.php
@@ -104,7 +104,7 @@ class Installer
{
$return = ['CREATE' => [], 'ALTER_CHANGE' => [], 'ALTER_ADD' => [], 'DROP' => [], 'ALTER_DROP' => []];
$fromSchema = $this->connection->getSchemaManager()->createSchema();
- $toSchema = System::getContainer()->get('contao.migrations.schema_provider')->createSchema();
+ $toSchema = System::getContainer()->get('contao.doctrine.schema_provider')->createSchema();
$diff = $fromSchema->getMigrateToSql($toSchema, $this->connection->getDatabasePlatform()); | [Installation] Changed service name of schema provider | contao_contao | train | php |
fb9761fa9762ecebdc921f1a2f0b32dc93118f5f | diff --git a/outline/wsgi.py b/outline/wsgi.py
index <HASH>..<HASH> 100644
--- a/outline/wsgi.py
+++ b/outline/wsgi.py
@@ -9,6 +9,8 @@ https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "replan.settings")
+os.environ.setdefault('DJANGO_CONFIGURATION', 'Dev')
+
+from configurations.wsgi import get_wsgi_application
-from django.core.wsgi import get_wsgi_application
application = get_wsgi_application() | Adding django-configurations hook up for wsgi file. | powellc_outline | train | py |
9f40b100e5f0abc8ab1bfba6d63918027f6ef9f9 | diff --git a/src/Symfony/Component/Yaml/Tests/ParserTest.php b/src/Symfony/Component/Yaml/Tests/ParserTest.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/Yaml/Tests/ParserTest.php
+++ b/src/Symfony/Component/Yaml/Tests/ParserTest.php
@@ -25,12 +25,12 @@ class ParserTest extends TestCase
/** @var Parser */
protected $parser;
- protected function setUp()
+ private function doSetUp()
{
$this->parser = new Parser();
}
- protected function tearDown()
+ private function doTearDown()
{
$this->parser = null; | [Yaml] fix test for PHP <I> | symfony_symfony | train | php |
10f91852ac1dba6124744d51c8f5d6b2dbc9743f | diff --git a/src/routes.php b/src/routes.php
index <HASH>..<HASH> 100644
--- a/src/routes.php
+++ b/src/routes.php
@@ -10,7 +10,9 @@
|
*/
-Route::get($this->app['lazy-strings']->getStringsRoute(), function () {
+$stringsRoute = (is_array($this->app['lazy-strings']->getStringsRoute())) ? 'lazy/build-copy' : $this->app['lazy-strings']->getStringsRoute();
+
+Route::get($stringsRoute, function () {
$lazyStrings = $this->app['lazy-strings'];
$lazyStrings->generateStrings();
}); | Give a default hardcoded value to lazy route.
Add this value when LazyStrings is initialized with no configuration. | Nobox_Lazy-Strings | train | php |
33d25d6ef09d4b3d4cd67307ad307ec37d0deb02 | diff --git a/demos/single_song_demo/js/player.js b/demos/single_song_demo/js/player.js
index <HASH>..<HASH> 100644
--- a/demos/single_song_demo/js/player.js
+++ b/demos/single_song_demo/js/player.js
@@ -1,8 +1,6 @@
(function () {
var
- //AUDIO_FILE = '../songs/Fire Hive (Krewella fuck on me remix).ogg',
- //AUDIO_FILE = '../songs/One Minute.ogg',
AUDIO_FILE = '../songs/zircon_devils_spirit.ogg',
PARTICLE_COUNT = 250,
MAX_PARTICLE_SIZE = 12, | Woops, that shouldn't be there | jsantell_dancer.js | train | js |
bcc1542cae2f77601334f61614aafac393369fef | diff --git a/certificate/certificate.go b/certificate/certificate.go
index <HASH>..<HASH> 100644
--- a/certificate/certificate.go
+++ b/certificate/certificate.go
@@ -88,7 +88,7 @@ func FromPemBytes(bytes []byte, password string) (tls.Certificate, error) {
if block.Type == "CERTIFICATE" {
cert.Certificate = append(cert.Certificate, block.Bytes)
}
- if block.Type == "PRIVATE KEY" || strings.HasSuffix(block.Type, "PRIVATE KEY") {
+ if strings.HasSuffix(block.Type, "PRIVATE KEY") {
key, err := unencryptPrivateKey(block, password)
if err != nil {
return tls.Certificate{}, err | Simplify FromPemBytes conditional (#<I>)
- Simplify logic. strings.HasSuffix can check both for suffix and for equality | sideshow_apns2 | train | go |
6a11cad68ca9249a1a90dac77c82a54a383895c4 | diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -98,13 +98,13 @@ exports['Test on and off'] = function (test) {
count++;
};
- orange.once('test', cb1);
- orange.once('test2', cb2);
+ orange.on('test', cb1);
+ orange.on('test2', cb2);
orange.test();
test.equal(count, 1);
- orange.off(cb1);
+ orange.off('test', cb1);
orange.test();
test.equal(count, 1); | Fix test to actually test on and off. | HenrikJoreteg_wildemitter | train | js |
15e910ce12f34497b32946e468205e08b019034d | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@ setup(
'developed by Kenneth O. Stanley for evolving arbitrary neural networks.',
packages=['neat', 'neat/iznn', 'neat/nn', 'neat/ctrnn'],
classifiers=[
- 'Development Status :: 3 - Alpha',
+ 'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research', | This revision was uploaded to PyPI as release <I>. | CodeReclaimers_neat-python | train | py |
cf55c27cdd1e112fb47d93837b380f9e6c20ab3c | diff --git a/examples/index.php b/examples/index.php
index <HASH>..<HASH> 100644
--- a/examples/index.php
+++ b/examples/index.php
@@ -14,8 +14,6 @@ use Zend\Expressive\Application;
use Zend\Expressive\Router\FastRouteRouter;
require_once __DIR__ . '/vendor/autoload.php';
-require_once __DIR__ . '/../src/PSR7Csrf/Factory.php';
-require_once __DIR__ . '/../src/PSR7Csrf/CSRFCheckerMiddleware.php';
$app = new Application(new FastRouteRouter()); | Removing manual requires (incorrect) | Ocramius_PSR7Csrf | train | php |
c6924ebaa080a2c247dbb52e91d95d74bc5c37e3 | diff --git a/src/frontend/org/voltdb/SnapshotDaemon.java b/src/frontend/org/voltdb/SnapshotDaemon.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/SnapshotDaemon.java
+++ b/src/frontend/org/voltdb/SnapshotDaemon.java
@@ -709,6 +709,15 @@ public class SnapshotDaemon implements SnapshotCompletionInterest {
success = false;
}
+ if ( result.getColumnCount() == 2
+ && "RESULT".equals(result.getColumnName(0))
+ && "ERR_MSG".equals(result.getColumnName(1))) {
+ boolean advanced = result.advanceRow();
+ assert(advanced);
+ loggingLog.error("Snapshot failed with failure response: " + result.getString("ERR_MSG"));
+ success = false;
+ }
+
//assert(result.getColumnName(1).equals("TABLE"));
if (success) {
while (result.advanceRow()) { | ENG-<I> handle better client response in snapshot save callbacks | VoltDB_voltdb | train | java |
37813f2755b87ebf02e9ecc5dcc9a9d570331c7e | diff --git a/test/test.backbone_db.js b/test/test.backbone_db.js
index <HASH>..<HASH> 100644
--- a/test/test.backbone_db.js
+++ b/test/test.backbone_db.js
@@ -4,7 +4,7 @@ var MyModel = setup.MyModel;
var MyCollection = setup.MyCollection;
var shared = require('backbone-db/test');
-describe('backbone-db-mongodb', function () {
+describe('backbone-db tests', function () {
before(function (next) {
var self = this;
setup.setupDb(function () {
@@ -23,4 +23,4 @@ describe('backbone-db-mongodb', function () {
});
-});
\ No newline at end of file
+}); | rename to backbone-db tests | Everyplay_backbone-db-mongodb | train | js |
94dae3d23d31108ec1b9fbc35693a4f8cd8561b5 | diff --git a/paypal/standard/models.py b/paypal/standard/models.py
index <HASH>..<HASH> 100644
--- a/paypal/standard/models.py
+++ b/paypal/standard/models.py
@@ -176,8 +176,8 @@ class PayPalStandardBase(Model):
flag = models.BooleanField(default=False, blank=True)
flag_code = models.CharField(max_length=16, blank=True)
flag_info = models.TextField(blank=True)
- query = models.TextField(blank=True) # What we sent to PayPal.
- response = models.TextField(blank=True) # What we got back.
+ query = models.TextField(blank=True) # What Paypal sent to us initially
+ response = models.TextField(blank=True) # What we got back from our request
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True) | Corrected comments on some fields on standard model | spookylukey_django-paypal | train | py |
1814b5b45d9bbf5fb38ff3d7362713fa6b14e30b | diff --git a/tests/test_section.py b/tests/test_section.py
index <HASH>..<HASH> 100644
--- a/tests/test_section.py
+++ b/tests/test_section.py
@@ -5,6 +5,7 @@ import requests_mock
from util import register_uris
from pycanvas.enrollment import Enrollment
from pycanvas import Canvas
+from pycanvas import Section
class TestSection(unittest.TestCase):
@@ -15,7 +16,7 @@ class TestSection(unittest.TestCase):
def setUpClass(self):
requires = {
'generic': ['not_found'],
- 'section': ['get_by_id', 'list_enrollments', 'list_enrollments_2']
+ 'section': ['decross_section', 'get_by_id', 'list_enrollments', 'list_enrollments_2']
}
adapter = requests_mock.Adapter()
@@ -36,3 +37,8 @@ class TestSection(unittest.TestCase):
assert len(enrollment_list) == 4
assert isinstance(enrollment_list[0], Enrollment)
+
+ def test_decross_list_section(self):
+ section = self.section.test_decross_list_section()
+
+ assert isinstance(section, Section) | Added tests for decross list section | ucfopen_canvasapi | train | py |
182b10946757724a4119ef0fc198f713ebbb6cbf | diff --git a/shared/validate/validate.go b/shared/validate/validate.go
index <HASH>..<HASH> 100644
--- a/shared/validate/validate.go
+++ b/shared/validate/validate.go
@@ -107,12 +107,14 @@ func IsBool(value string) error {
}
// IsOneOf checks whether the string is present in the supplied slice of strings.
-func IsOneOf(value string, valid []string) error {
- if !stringInSlice(value, valid) {
- return fmt.Errorf("Invalid value %q (not one of %s)", value, valid)
- }
+func IsOneOf(valid ...string) func(value string) error {
+ return func(value string) error {
+ if !stringInSlice(value, valid) {
+ return fmt.Errorf("Invalid value %q (not one of %s)", value, valid)
+ }
- return nil
+ return nil
+ }
}
// IsAny accepts all strings as valid.
@@ -605,7 +607,7 @@ func IsCompressionAlgorithm(value string) error {
// IsArchitecture validates whether the value is a valid LXD architecture name.
func IsArchitecture(value string) error {
- return IsOneOf(value, osarch.SupportedArchitectures())
+ return IsOneOf(osarch.SupportedArchitectures()...)(value)
}
// IsCron checks that it's a valid cron pattern or alias. | shared/validate: Change IsOneOf to return validator | lxc_lxd | train | go |
4211f75c4861b1c727d8b402626ea9d9fefebba0 | diff --git a/jpype/__init__.py b/jpype/__init__.py
index <HASH>..<HASH> 100644
--- a/jpype/__init__.py
+++ b/jpype/__init__.py
@@ -49,6 +49,7 @@ __all__.extend(_jcustomizer.__all__)
__all__.extend(_gui.__all__)
__version__ = "0.7.5"
+__version_info__ = __version__.split('.')
@_core.deprecated | added missing version_info tuple | jpype-project_jpype | train | py |
105ec490bc5cec033f4409f60ddb8306e0548ab1 | diff --git a/src/main/java/fr/univnantes/termsuite/engines/gatherer/TermMerger.java b/src/main/java/fr/univnantes/termsuite/engines/gatherer/TermMerger.java
index <HASH>..<HASH> 100644
--- a/src/main/java/fr/univnantes/termsuite/engines/gatherer/TermMerger.java
+++ b/src/main/java/fr/univnantes/termsuite/engines/gatherer/TermMerger.java
@@ -64,7 +64,8 @@ public class TermMerger extends SimpleEngine {
logger.debug("Merging {} relations", relationsToMerge.size());
relationsToMerge.forEach(rel -> {
- logger.trace("Merging variant {} into variant {}", rel.getTo(), rel.getFrom());
+ if(logger.isTraceEnabled())
+ logger.trace("Merging variant {} into variant {}", rel.getTo(), rel.getFrom());
watch(rel.getRelation());
Collection<TermOccurrence> occurrences = occStore.getOccurrences(rel.getTo().getTerm()); | Prevent logger.trace from tracing when not enabled | termsuite_termsuite-core | train | java |
3210d5ba53e1f36463de1cf1dd7a0d56ac446fe0 | diff --git a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php b/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
+++ b/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
@@ -267,7 +267,9 @@ class BelongsToMany extends Relation {
{
$query->select(new \Illuminate\Database\Query\Expression('count(*)'));
- $query->from($this->table.' as '.$hash = $this->getRelationCountHash());
+ $tablePrefix = $this->query->getQuery()->getConnection()->getTablePrefix();
+
+ $query->from($this->table.' as '.$tablePrefix.$hash = $this->getRelationCountHash());
$key = $this->wrap($this->getQualifiedParentKeyName()); | Table prefix was missing in BelongsToMany@getRelationCountQueryForSelfJoin
Table prefix was missing in
BelongsToMany@getRelationCountQueryForSelfJoin | laravel_framework | train | php |
56968fb1fb454ed592d98cc978deda8f1eb936b1 | diff --git a/src/Passport/Client.php b/src/Passport/Client.php
index <HASH>..<HASH> 100644
--- a/src/Passport/Client.php
+++ b/src/Passport/Client.php
@@ -69,4 +69,14 @@ class Client extends Model
{
return $this->personal_access_client || $this->password_client;
}
+
+ /**
+ * Determine if the client should skip the authorization prompt.
+ *
+ * @return bool
+ */
+ public function skipsAuthorization()
+ {
+ return false;
+ }
} | fix: for designmynight/dmn#<I> fix issue with missing function | designmynight_laravel-mongodb-passport | train | php |
521ecb489714cc7c8285d1b22f3aaa39daede8b7 | diff --git a/py3status/modules/window_title.py b/py3status/modules/window_title.py
index <HASH>..<HASH> 100644
--- a/py3status/modules/window_title.py
+++ b/py3status/modules/window_title.py
@@ -6,8 +6,6 @@ Configuration parameters:
cache_timeout: How often we refresh this module in seconds (default 0.5)
max_width: If width of title is greater, shrink it and add '...'
(default 120)
- empty_title: string that will be shown instead of the title when
- the title is hidden. (default "")
Requires:
i3-py: (https://github.com/ziberna/i3-py)
@@ -44,7 +42,6 @@ class Py3status:
# available configuration parameters
cache_timeout = 0.5
max_width = 120
- empty_title = ""
def __init__(self):
self.text = ''
@@ -55,7 +52,7 @@ class Py3status:
transformed = False
if window and 'name' in window and window['name'] != self.text:
if window['name'] is None:
- window['name'] = self.empty_title
+ window['name'] = ''
self.text = (len(window['name']) > self.max_width and
"..." + window['name'][-(self.max_width - 3):] or | Do not use empty_title config value in window_title (maybe now travis test will success) | ultrabug_py3status | train | py |
61bed0bd4fc57a4bc8f83c27ff9c0715ac4a864f | diff --git a/lib/magnum-pi/api/consumer.rb b/lib/magnum-pi/api/consumer.rb
index <HASH>..<HASH> 100644
--- a/lib/magnum-pi/api/consumer.rb
+++ b/lib/magnum-pi/api/consumer.rb
@@ -49,7 +49,10 @@ module MagnumPI
def request(method, url, params)
puts "#{method.upcase} #{url} #{"(#{params.inspect[1..-2]})" if params && params.size > 0}" if MagnumPI.debug_output?
- agent.send method, url, params, nil, request_headers(method, url, params)
+ args = [method, url, params]
+ args << nil if method.to_s.upcase == "GET"
+ args << request_headers(method, url, params)
+ agent.send *args
rescue Mechanize::ResponseCodeError => e
raise Error, e.message, e.backtrace
end | Fixed sending request headers for non-GET requests | archan937_magnum-pi | train | rb |
b8cbf24f621a79e86c64ca44a3ebe56b1a203cae | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -120,8 +120,8 @@ function getTouch (touches, id) {
function listeners (e, enabled) {
return function (data) {
- if (enabled) e.addEventListener(data.type, data.listener)
- else e.removeEventListener(data.type, data.listener)
+ if (enabled) e.addEventListener(data.type, data.listener, { passive: false })
+ else e.removeEventListener(data.type, data.listener, { passive: false })
}
} | Disable "passive" event listening.
Upcoming change in Chrome/Android:
<URL> will no longer work.
This commit passes { passive: false } into event listeners,
ensuring that the current behaviour is maintained in newer
versions of Android and Chrome.
Note that there are cases where { passive: true } will improve
performance, and that you may want to expose this as an option
in "touches"' public API:
<URL> | Jam3_touches | train | js |
c540943eb2f0c63f268e22e38afd61ba51177ad4 | diff --git a/src/utils/merge.js b/src/utils/merge.js
index <HASH>..<HASH> 100644
--- a/src/utils/merge.js
+++ b/src/utils/merge.js
@@ -11,7 +11,12 @@ export default function mergeObjects (dest, ...sources) {
// (e.g. don't merge arrays, those are treated as scalar values; null values will overwrite/erase
// the previous destination value)
if (value !== null && typeof value === 'object' && !Array.isArray(value)) {
- dest[key] = mergeObjects(dest[key] || {}, value);
+ if (dest[key] !== null && typeof dest[key] === 'object' && !Array.isArray(dest[key])) {
+ dest[key] = mergeObjects(dest[key], value);
+ }
+ else {
+ dest[key] = mergeObjects({}, value); // destination not an object, overwrite
+ }
}
// Overwrite the previous destination value if the source property is: a scalar (number/string),
// an array, or a null value | merge: source object should replace destination scalar/array | tangrams_tangram | train | js |
b67e87cc789c7b7c1d6d2aa6bf1ecae042c4c5e1 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
+from setuptools.command.sdist import sdist
+import subprocess
with open('README.md', 'r', encoding='utf-8') as f:
readme = f.read()
@@ -8,6 +10,13 @@ with open('README.md', 'r', encoding='utf-8') as f:
with open('requirements.txt') as f:
required = f.read().splitlines()
+
+class chainerui_sdist(sdist):
+ def run(self):
+ subprocess.call('cd frontend && npm run build', shell=True)
+ sdist.run(self)
+
+
setup(
name='chainerui',
version='0.0.9',
@@ -30,4 +39,7 @@ setup(
]
},
tests_require=['pytest'],
+ cmdclass={
+ 'sdist': chainerui_sdist
+ },
) | Add `npm run build` executer when run `python setup.py sdist` | chainer_chainerui | train | py |
51003e82112a559f505e488e3b9b5da172b227df | diff --git a/concrete/src/Url/Resolver/RouteUrlResolver.php b/concrete/src/Url/Resolver/RouteUrlResolver.php
index <HASH>..<HASH> 100644
--- a/concrete/src/Url/Resolver/RouteUrlResolver.php
+++ b/concrete/src/Url/Resolver/RouteUrlResolver.php
@@ -81,7 +81,7 @@ class RouteUrlResolver implements UrlResolverInterface
strtolower(substr($route_handle, 0, 6)) == 'route/' &&
is_array($route_parameters)) {
$route_handle = substr($route_handle, 6);
- if ($route = $this->getRouteList()->get($route_handle)) {
+ if ($this->getRouteList()->get($route_handle)) {
if ($path = $this->getGenerator()->generate($route_handle, $route_parameters, UrlGeneratorInterface::ABSOLUTE_PATH)) {
return $this->pathUrlResolver->resolve(array($path));
} | Remove unused variable in RouteUrlResolver::resolve() | concrete5_concrete5 | train | php |
3b78375b8d832ae43ec4786bc9e5b5b91db047e7 | diff --git a/files/api/user/models/User.js b/files/api/user/models/User.js
index <HASH>..<HASH> 100755
--- a/files/api/user/models/User.js
+++ b/files/api/user/models/User.js
@@ -10,6 +10,7 @@ const path = require('path');
// Public node modules.
const _ = require('lodash');
const anchor = require('anchor');
+const bcrypt = require('bcryptjs');
// Model settings
const settings = require('./User.settings.json'); | Add bcrypt dependency in user model | strapi_strapi-generate-users | train | js |
0de090717bd038ed2cdc3d75deb09d7bee4a6f0b | diff --git a/spec/unpacker_spec.rb b/spec/unpacker_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unpacker_spec.rb
+++ b/spec/unpacker_spec.rb
@@ -635,7 +635,7 @@ describe MessagePack::Unpacker do
MessagePack.unpack(MessagePack.pack(array)).size.should == 10_000
end
- it 'preserve string encoding (issue #200)' do
+ it 'preserves string encoding (issue #200)' do
string = 'a'.force_encoding(Encoding::UTF_8)
MessagePack.unpack(MessagePack.pack(string)).encoding.should == string.encoding | spec description: Grammar fix preserve->preserves | msgpack_msgpack-ruby | train | rb |
43efc3dc2707b3821b36293647154705a3bec38e | diff --git a/src/GameQ/GameQ.php b/src/GameQ/GameQ.php
index <HASH>..<HASH> 100644
--- a/src/GameQ/GameQ.php
+++ b/src/GameQ/GameQ.php
@@ -517,7 +517,7 @@ class GameQ
throw new \Exception($e->getMessage(), $e->getCode(), $e);
}
- break;
+ continue;
}
// Clean up the sockets, if any left over | Changed break to continue when QueryException is caught
Change the QueryException to a continue to allow the loop to continue. See #<I> for more information. | Austinb_GameQ | train | php |
2c2f8e729114670936fb9ef861b6d9a01270c3fc | diff --git a/uploadservice/src/main/java/net/gotev/uploadservice/UploadTask.java b/uploadservice/src/main/java/net/gotev/uploadservice/UploadTask.java
index <HASH>..<HASH> 100644
--- a/uploadservice/src/main/java/net/gotev/uploadservice/UploadTask.java
+++ b/uploadservice/src/main/java/net/gotev/uploadservice/UploadTask.java
@@ -47,7 +47,7 @@ public abstract class UploadTask implements Runnable {
/**
* Contains the absolute local path of the successfully uploaded files.
*/
- private List<String> successfullyUploadedFiles = new ArrayList<>();
+ private final List<String> successfullyUploadedFiles = new ArrayList<>();
/**
* Flag indicating if the operation should continue or is cancelled. You should never | successfullyUploadedFiles list is now final, as it's created only once and never re-assigned. | gotev_android-upload-service | train | java |
a9d0038ec0042b39a96c0141e0d8c78a6fa3f362 | diff --git a/src/Symfony/Component/VarDumper/Caster/Caster.php b/src/Symfony/Component/VarDumper/Caster/Caster.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/VarDumper/Caster/Caster.php
+++ b/src/Symfony/Component/VarDumper/Caster/Caster.php
@@ -53,13 +53,9 @@ class Caster
$hasDebugInfo = $class->hasMethod('__debugInfo');
$class = $class->name;
}
- if ($hasDebugInfo) {
- $a = $obj->__debugInfo();
- } elseif ($obj instanceof \Closure) {
- $a = [];
- } else {
- $a = (array) $obj;
- }
+
+ $a = $obj instanceof \Closure ? [] : (array) $obj;
+
if ($obj instanceof \__PHP_Incomplete_Class) {
return $a;
}
@@ -93,6 +89,17 @@ class Caster
}
}
+ if ($hasDebugInfo && \is_array($debugInfo = $obj->__debugInfo())) {
+ foreach ($debugInfo as $k => $v) {
+ if (!isset($k[0]) || "\0" !== $k[0]) {
+ $k = self::PREFIX_VIRTUAL.$k;
+ }
+
+ unset($a[$k]);
+ $a[$k] = $v;
+ }
+ }
+
return $a;
} | [VarDumper] fix dumping objects that implement __debugInfo() | symfony_symfony | train | php |
50e53e27d5e589c455f9dab927ceb9a8502b64fc | diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py
index <HASH>..<HASH> 100755
--- a/tools/run_tests/run_tests.py
+++ b/tools/run_tests/run_tests.py
@@ -346,6 +346,7 @@ def runs_per_test_type(arg_str):
try:
n = int(arg_str)
if n <= 0: raise ValueError
+ return n
except:
msg = "'{}' isn't a positive integer or 'inf'".format(arg_str)
raise argparse.ArgumentTypeError(msg) | Fix bug with finite runs per test | grpc_grpc | train | py |
b2b0f4fcb64358e77029ee49da7bbadafe98c00e | diff --git a/scoop/launcher.py b/scoop/launcher.py
index <HASH>..<HASH> 100644
--- a/scoop/launcher.py
+++ b/scoop/launcher.py
@@ -186,7 +186,7 @@ class ScoopApp(object):
def showHostDivision(self, headless):
"""Show the worker distribution over the hosts."""
- scoop.logger.info('Worker d--istribution: ')
+ scoop.logger.info('Worker distribution: ')
for worker, number in self.worker_hosts:
first_worker = (worker == self.worker_hosts[0][0])
scoop.logger.info(' {0}:\t{1} {2}'.format( | * launcher.py (ScoopApp.showHostDivision): Fix typo in log output. | soravux_scoop | train | py |
5bd318089ac2d18e51749ef1767bba6e45b35b45 | diff --git a/src/components/tables/DataTable.js b/src/components/tables/DataTable.js
index <HASH>..<HASH> 100644
--- a/src/components/tables/DataTable.js
+++ b/src/components/tables/DataTable.js
@@ -74,6 +74,8 @@ export default {
customSort: {
type: Function,
default: (items, index, descending) => {
+ if (index === null) return items
+
return items.sort((a, b) => {
let sortA = getObjectValueByPath(a, index)
let sortB = getObjectValueByPath(b, index) | Fix for #<I> (#<I>) | vuetifyjs_vuetify | train | js |
e8830e0c3c5c7388d71b9fb5cafa32d504ccd04d | diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/RecordIndexer.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/RecordIndexer.php
index <HASH>..<HASH> 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/RecordIndexer.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/RecordIndexer.php
@@ -112,7 +112,8 @@ class RecordIndexer
public function populateIndex(BulkOperation $bulk, array $databoxes)
{
foreach ($databoxes as $databox) {
- $submitted_records = [];
+
+ $submited_records = [];
$this->logger->info(sprintf('Indexing database %s...', $databox->get_viewname())); | #PHRAS-<I> time 5m
removed filter on dbox, must be done only in task | alchemy-fr_Phraseanet | train | php |
b4064f0066342eeb9d9915baaac7dbd31dccb7bd | diff --git a/allennlp/service/db.py b/allennlp/service/db.py
index <HASH>..<HASH> 100644
--- a/allennlp/service/db.py
+++ b/allennlp/service/db.py
@@ -90,6 +90,7 @@ class PostgresDemoDatabase(DemoDatabase):
password=self.password,
dbname=self.dbname,
connect_timeout=5)
+ self.conn.set_session(autocommit=True)
logger.info("successfully initialized database connection")
except psycopg2.Error as error:
logger.exception("unable to connect to database") | Autocommit database modifications (#<I>) | allenai_allennlp | train | py |
4f0e5b1e26c8323f9a40a8c9ee39a18f1ec3f658 | diff --git a/test/all.js b/test/all.js
index <HASH>..<HASH> 100644
--- a/test/all.js
+++ b/test/all.js
@@ -17,7 +17,7 @@ vows.describe("block.io node.js api wrapper").addBatch({
assert.isObject(res.data);
assert.isArray(res.data.addresses);
assert.isString(res.data.addresses[0].address);
- assert.isString(res.data.addresses[0].address_label);
+ assert.isString(res.data.addresses[0].label);
}
})
}).addBatch({ | Address#address_label -> Address#label | BlockIo_block_io-nodejs | train | js |
d7cb386147650d7025dad8d2d2baeff3ce46c5c8 | diff --git a/test/aes-test.js b/test/aes-test.js
index <HASH>..<HASH> 100644
--- a/test/aes-test.js
+++ b/test/aes-test.js
@@ -27,5 +27,23 @@ describe("aes", () => {
});
});
+ describe("encrypt(str, key)", () => {
+
+ it("should throw error on invalid key", () => {
+ assert.throws(() => aes.encrypt("data", "1515"), Error, "invalid key length");
+ });
+
+ it("should encrypt string of any length with given key that will decryptable by decrypt() function", () => {
+ function test(str, key) {
+ let encrypted = aes.encrypt(str, key);
+ let decrypted = aes.decrypt(encrypted, key);
+ expect(decrypted).to.be.equal(str);
+ }
+ test("1337");
+ test("русские буквы");
+ test("•ݹmÙO_‼|s¬¹Íе£—I♠f⌂5▓");
+ test("aaaaaaaa$aaaaaaaaaaaaa3abbbbbbt59bbbbbbbbbbbbbbb5)bbbbccccccc_ccccccc");
+ });
+ });
});
\ No newline at end of file | Updates aes-test.js
* Adds test to check encryption/decryptoin. | alikhil_zaes-js | train | js |
2d546aef14a9eba219d10202aa307e23c8773610 | diff --git a/lib/jpmobile/util.rb b/lib/jpmobile/util.rb
index <HASH>..<HASH> 100644
--- a/lib/jpmobile/util.rb
+++ b/lib/jpmobile/util.rb
@@ -297,7 +297,7 @@ module Jpmobile
def invert_table(hash)
result = {}
- hash.keys.each do |key|
+ hash.each_key do |key|
if result[hash[key]]
if !key.is_a?(Array) && !result[hash[key]].is_a?(Array) && result[hash[key]] > key
result[hash[key]] = key | Apply Style/HashEachMethods | jpmobile_jpmobile | train | rb |
dad0b49a877edb8e7d5b879a2f81c891f0c6eb7a | diff --git a/ontobio/golr/golr_query.py b/ontobio/golr/golr_query.py
index <HASH>..<HASH> 100644
--- a/ontobio/golr/golr_query.py
+++ b/ontobio/golr/golr_query.py
@@ -455,7 +455,7 @@ class GolrSearchQuery(GolrAbstractQuery):
if results.highlighting:
for doc in results.docs:
hl = self._process_highlight(results, doc)
- highlighting[doc['id']] = hl
+ highlighting[doc['id']] = hl._asdict()
payload = SearchResults(
facet_counts=translate_facet_field(results.facets), | return tuple as dict | biolink_ontobio | train | py |
3c69653d6caa2c7c04315b360459b4eb289a25b8 | diff --git a/jooby/src/main/java/io/jooby/internal/ValueInjector.java b/jooby/src/main/java/io/jooby/internal/ValueInjector.java
index <HASH>..<HASH> 100644
--- a/jooby/src/main/java/io/jooby/internal/ValueInjector.java
+++ b/jooby/src/main/java/io/jooby/internal/ValueInjector.java
@@ -250,6 +250,9 @@ public final class ValueInjector {
if (FileUpload.class == rawType) {
return true;
}
+ if (rawType.isEnum()) {
+ return true;
+ }
/**********************************************************************************************
* Static method: valueOf
* ********************************************************************************************
@@ -337,6 +340,9 @@ public final class ValueInjector {
}
throw new TypeMismatchException(value.name(), FileUpload.class);
}
+ if (rawType.isEnum()) {
+ return Enum.valueOf(rawType, value.get(0).value());
+ }
/**********************************************************************************************
* Static method: valueOf
* ******************************************************************************************** | First fix enums from using reflection | jooby-project_jooby | train | java |
aae85f572e3121361f5a4ec8cb231cee4d0707b3 | diff --git a/addons/Dexie.Observable/src/Dexie.Observable.js b/addons/Dexie.Observable/src/Dexie.Observable.js
index <HASH>..<HASH> 100644
--- a/addons/Dexie.Observable/src/Dexie.Observable.js
+++ b/addons/Dexie.Observable/src/Dexie.Observable.js
@@ -242,7 +242,7 @@ function Observable(db) {
});
}
// Add new sync node or if this is a reopening of the database after a close() call, update it.
- return db.transaction('rw', '_syncNodes', () => {
+ return Dexie.ignoreTransaction(() => {
return db._syncNodes
.where('isMaster').equals(1)
.first(currentMaster => { | Do not re-use current transaction when observation begins
Resolves #<I> | dfahlander_Dexie.js | train | js |
579418fb95b42d3b8c6406a9d5ff54e7608f5e32 | diff --git a/src/main/java/org/gitlab4j/api/Constants.java b/src/main/java/org/gitlab4j/api/Constants.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/gitlab4j/api/Constants.java
+++ b/src/main/java/org/gitlab4j/api/Constants.java
@@ -156,7 +156,7 @@ public interface Constants {
/** Enum to use for ordering the results of getPipelines(). */
public enum PipelineOrderBy {
- ID, STATUS, REF, USER_ID;
+ ID, STATUS, REF, UPDATED_AT, USER_ID;
private static JacksonJsonEnumHelper<PipelineOrderBy> enumHelper = new JacksonJsonEnumHelper<>(PipelineOrderBy.class); | Added UPDATED_AT to PipelineOrderBy (#<I>) | gmessner_gitlab4j-api | train | java |
b3ee751162ecb315c775e87eaee81dd2f83b156b | diff --git a/aerofiles/openair/reader.py b/aerofiles/openair/reader.py
index <HASH>..<HASH> 100644
--- a/aerofiles/openair/reader.py
+++ b/aerofiles/openair/reader.py
@@ -140,7 +140,7 @@ class LowLevelReader:
if len(values) != num:
raise ValueError()
- return [cast(value) for value, cast in zip(values, types)]
+ return [cast(v) for v, cast in zip(values, types)]
def coordinate(value): | openair: Fixed flake8 issues | Turbo87_aerofiles | train | py |
371ccc4a2eae55f53d7a5ace9c79f72a3fde6afc | diff --git a/spec/puppetserver/ca/action/generate_spec.rb b/spec/puppetserver/ca/action/generate_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/puppetserver/ca/action/generate_spec.rb
+++ b/spec/puppetserver/ca/action/generate_spec.rb
@@ -52,6 +52,8 @@ RSpec.describe Puppetserver::Ca::Action::Generate do
expect(File.exist?(File.join(tmpdir, 'ca', 'root_key.pem'))).to be true
expect(File.exist?(File.join(tmpdir, 'ca', 'ca_crl.pem'))).to be true
expect(File.exist?(File.join(tmpdir, 'ssl', 'certs', 'foocert.pem'))).to be true
+ expect(File.exist?(File.join(tmpdir, 'ssl', 'private_keys', 'foocert.pem'))).to be true
+ expect(File.exist?(File.join(tmpdir, 'ssl', 'public_keys', 'foocert.pem'))).to be true
end
end
end | (maint) Test that we create master keys w/ generate | puppetlabs_puppetserver-ca-cli | train | rb |
08ef845ebd1f3c68257b33051ab848393f8445d9 | diff --git a/src/react-webcam.js b/src/react-webcam.js
index <HASH>..<HASH> 100644
--- a/src/react-webcam.js
+++ b/src/react-webcam.js
@@ -148,7 +148,20 @@ export default class Webcam extends Component {
Webcam.mountedInstances.splice(index, 1);
if (Webcam.mountedInstances.length === 0 && this.state.hasUserMedia) {
- if (this.stream.stop) this.stream.stop();
+ if (this.stream.stop) {
+ this.stream.stop();
+ } else {
+ if (this.stream.getVideoTracks) {
+ for (let track of this.stream.getVideoTracks()) {
+ track.stop();
+ }
+ }
+ if (this.stream.getAudioTracks) {
+ for (let track of this.stream.getAudioTracks()) {
+ track.stop();
+ }
+ }
+ }
Webcam.userMediaRequested = false;
window.URL.revokeObjectURL(this.state.src);
} | add support for stopping audio and video tracks with new chrome API | mozmorris_react-webcam | train | js |
527de81b724cde4be65d33cccc8a0565ddb1e107 | diff --git a/mir_eval/util.py b/mir_eval/util.py
index <HASH>..<HASH> 100644
--- a/mir_eval/util.py
+++ b/mir_eval/util.py
@@ -639,30 +639,6 @@ def validate_events(events, max_time=30000.):
raise ValueError('Events should be in increasing order.')
-def filter_labeled_intervals(intervals, labels):
- r'''Remove all invalid intervals (start >= end) and corresponding labels.
-
- :parameters:
- - intervals : np.ndarray
- Array of interval times (seconds)
-
- - labels : list
- List of labels
-
- :returns:
- - filtered_intervals : np.ndarray
- Valid interval times.
- - filtered_labels : list
- Corresponding filtered labels
- '''
- filt_intervals, filt_labels = [], []
- for interval, label in zip(intervals, labels):
- if interval[0] < interval[1]:
- filt_intervals.append(interval)
- filt_labels.append(label)
- return np.array(filt_intervals), filt_labels
-
-
def filter_kwargs(function, *args, **kwargs):
'''
Given a function and args and keyword args to pass to it, call the function | This function is no longer used in mir_eval | craffel_mir_eval | train | py |
2338fcb4fd9123ac6754cc51ab52c5df32726dff | diff --git a/interface.js b/interface.js
index <HASH>..<HASH> 100644
--- a/interface.js
+++ b/interface.js
@@ -86,7 +86,8 @@ function genericResult(err, value, buffer, offset) {
}
function fromBufferResult(rw, buffer, offset) {
- var res = rw.readFrom(buffer, offset || 0);
+ var start = offset || 0;
+ var res = rw.readFrom(buffer, start);
res = checkAllReadFrom(res, buffer);
return genericResult(res.err, res.value, buffer, res.offset);
} | interface: explicate out fromBufferResult start | uber_bufrw | train | js |
7d88680fa5125e66817d796e1fdd14e4c8e8be21 | diff --git a/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/ContextManager.java b/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/ContextManager.java
index <HASH>..<HASH> 100644
--- a/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/ContextManager.java
+++ b/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/ContextManager.java
@@ -498,7 +498,8 @@ public class ContextManager {
if (isKerberosBindAuth()) {
try {
Subject subject = handleKerberos();
- env.put(javax.security.sasl.Sasl.CREDENTIALS, SubjectHelper.getGSSCredentialFromSubject(subject));
+ // Using javax.security.sasl.Sasl.CREDENTIALS caused intermittent compile failures on Java 8
+ env.put("javax.security.sasl.credentials", SubjectHelper.getGSSCredentialFromSubject(subject));
} catch (LoginException e) {
NamingException ne = new NamingException(e.getMessage());
ne.setRootCause(e); | Issue <I>: Swap out CRED constants for string on Ldap Kerberos | OpenLiberty_open-liberty | train | java |
780631bc49e2dab2805cca4a714abda231fa73b1 | diff --git a/symphony/content/content.publish.php b/symphony/content/content.publish.php
index <HASH>..<HASH> 100644
--- a/symphony/content/content.publish.php
+++ b/symphony/content/content.publish.php
@@ -622,6 +622,11 @@
$section = $sectionManager->fetch($entry->get('section_id'));
}
}
+
+ ###
+ # Delegate: EntryPreRender
+ # Description: Just prior to rendering of an Entry edit form. Entry object can be modified.
+ $this->_Parent->ExtensionManager->notifyMembers('EntryPreRender', '/publish/edit/', array('section' => $section, 'entry' => &$entry, 'fields' => $fields));
if(isset($this->_context['flag'])){ | Added EntryPreRender delegate allowing for modification of Entry object just before rendering the Edit form. To be used in Entry Revisions extension. | symphonycms_symphony-2 | train | php |
458bcdff332f5b929e2e0461a9a01546437cb50e | diff --git a/core/committer/committer_impl.go b/core/committer/committer_impl.go
index <HASH>..<HASH> 100644
--- a/core/committer/committer_impl.go
+++ b/core/committer/committer_impl.go
@@ -17,8 +17,6 @@ limitations under the License.
package committer
import (
- "fmt"
-
"github.com/hyperledger/fabric/core/committer/txvalidator"
"github.com/hyperledger/fabric/core/ledger"
"github.com/hyperledger/fabric/events/producer"
@@ -65,8 +63,7 @@ func (lc *LedgerCommitter) Commit(block *common.Block) error {
// send block event *after* the block has been committed
if err := producer.SendProducerBlockEvent(block); err != nil {
- logger.Errorf("Error sending block event %s", err)
- return fmt.Errorf("Error sending block event %s", err)
+ logger.Errorf("Error publishing block %d, because: %v", block.Header.Number, err)
}
return nil | [FAB-<I>] Event publishing failure fails block commit
The committer implementation reports an error if the publishing
of a block committing event failures due to an error that is related
to the eventhub server.
The method shouldn't return a failure, but only log a message to the log,
because if it returns failure- the state transfer module in gossip/state/state.go
doesn't update its metadata.
Change-Id: I<I>f1ce<I>eb<I>fedfa2c<I>c<I>da | hyperledger_fabric | train | go |
af827b9468c8d9b18ae1f51c0417e4c7c5b40050 | diff --git a/state/metrics.go b/state/metrics.go
index <HASH>..<HASH> 100644
--- a/state/metrics.go
+++ b/state/metrics.go
@@ -31,7 +31,7 @@ type MetricBatch struct {
type metricBatchDoc struct {
UUID string `bson:"_id"`
- EnvUUID string `bson:"envuuid"`
+ EnvUUID string `bson:"env-uuid"`
Unit string `bson:"unit"`
CharmUrl string `bson:"charmurl"`
Sent bool `bson:"sent"` | Align metricsDoc.EnvUUID serialization.
Follow the multi-environment document convention of serializing EnvUUID
as "env-uuid". | juju_juju | train | go |
6e4c605da17fe5cda3920bd5fbe51d2e794b623f | diff --git a/framework/core/src/Queue/QueueServiceProvider.php b/framework/core/src/Queue/QueueServiceProvider.php
index <HASH>..<HASH> 100644
--- a/framework/core/src/Queue/QueueServiceProvider.php
+++ b/framework/core/src/Queue/QueueServiceProvider.php
@@ -107,6 +107,13 @@ class QueueServiceProvider extends AbstractServiceProvider
protected function registerCommands()
{
$this->app['events']->listen(Configuring::class, function (Configuring $event) {
+ $queue = $this->app->make(Queue::class);
+
+ // There is no need to have the queue commands when using the sync driver.
+ if ($queue instanceof SyncQueue) {
+ return;
+ }
+
foreach ($this->commands as $command) {
$event->addCommand($command);
} | only show queue commands if using another driver than sync | flarum_core | train | php |
c3f8bf6549e4b195909c5ee3d0250cb6f07db635 | diff --git a/tests/unit/test_client.py b/tests/unit/test_client.py
index <HASH>..<HASH> 100644
--- a/tests/unit/test_client.py
+++ b/tests/unit/test_client.py
@@ -1,6 +1,7 @@
import unittest
from mock import patch
+from quickbooks.exceptions import QuickbooksException
from quickbooks import client
@@ -141,3 +142,23 @@ class ClientTest(unittest.TestCase):
qbService.get_auth_session.assert_called_with('token', 'secret', data={'oauth_verifier': 'oauth_verifier'})
self.assertFalse(session is None)
+
+ def test_get_instance(self):
+ qb_client = client.QuickBooks()
+
+ instance = qb_client.get_instance()
+ self.assertEquals(qb_client, instance)
+
+ @patch('quickbooks.client.OAuth1Session')
+ def test_create_session(self, auth_Session):
+ qb_client = client.QuickBooks()
+ session = qb_client.create_session()
+
+ self.assertTrue(auth_Session.called)
+ self.assertFalse(session is None)
+
+ def test_create_session_missing_auth_info_exception(self):
+ qb_client = client.QuickBooks()
+ qb_client.consumer_secret = None
+
+ self.assertRaises(QuickbooksException, qb_client.create_session) | Added tests for create_session and get_instance in client. | sidecars_python-quickbooks | train | py |
7108c52c6cf00b6fe68e5f94c3bbabcca69183a8 | diff --git a/rope/__init__.py b/rope/__init__.py
index <HASH>..<HASH> 100644
--- a/rope/__init__.py
+++ b/rope/__init__.py
@@ -1,7 +1,7 @@
"""rope, a python refactoring library"""
INFO = __doc__
-VERSION = '0.10.6'
+VERSION = '0.10.7'
COPYRIGHT = """\
Copyright (C) 2015-2016 Nicholas Smith
Copyright (C) 2014-2015 Matej Cepl | Update version to match bump to <I> | python-rope_rope | train | py |
0711542b99e6e3708bb83284151e285653ccb138 | diff --git a/girder/utility/plugin_utilities.py b/girder/utility/plugin_utilities.py
index <HASH>..<HASH> 100644
--- a/girder/utility/plugin_utilities.py
+++ b/girder/utility/plugin_utilities.py
@@ -85,9 +85,11 @@ def loadPlugin(name, root):
:param root: The root node of the web API.
"""
pluginDir = os.path.join(ROOT_DIR, 'plugins', name)
+ isPluginDir = os.path.isdir(os.path.join(pluginDir, 'server'))
+ isPluginFile = os.path.isfile(os.path.join(pluginDir, 'server.py'))
if not os.path.exists(pluginDir):
raise Exception('Plugin directory does not exist: {}'.format(pluginDir))
- if not os.path.isdir(os.path.join(pluginDir, 'server')):
+ if not isPluginDir and not isPluginFile:
# This plugin does not have any server-side python code.
return | Adding support for server.py instead of a server folder in plugins. | girder_girder | train | py |
c9e9b54689e93207890bb3eca2c98a1716545d94 | diff --git a/sklearn_evaluation/report.py b/sklearn_evaluation/report.py
index <HASH>..<HASH> 100644
--- a/sklearn_evaluation/report.py
+++ b/sklearn_evaluation/report.py
@@ -3,10 +3,14 @@ import plots
from cStringIO import StringIO
import base64
import os
-import mistune
from datetime import datetime
from utils import get_model_name
+try:
+ import mistune
+except:
+ raise Exception('You need to install mistune to use the report module')
+
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure | adds exception when trying to use the report module without mistune installed | edublancas_sklearn-evaluation | train | py |
fa5f93698d33469249d9ca5b122002a617ad39e6 | diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index <HASH>..<HASH> 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -3,6 +3,7 @@ require 'action_mailer/tmail_compat'
require 'action_mailer/collector'
require 'active_support/core_ext/array/wrap'
require 'active_support/core_ext/object/blank'
+require 'active_support/core_ext/proc'
module ActionMailer #:nodoc:
# Action Mailer allows you to send email from your application using a mailer model and views. | Added missing require, we are using bind method defined on active_support/core_ext/proc
[#<I> state:committed] | rails_rails | train | rb |
ea2850b96a97d1c454d1f6ca0c8c7958cc63ea70 | diff --git a/activemodel/lib/active_model/attribute_assignment.rb b/activemodel/lib/active_model/attribute_assignment.rb
index <HASH>..<HASH> 100644
--- a/activemodel/lib/active_model/attribute_assignment.rb
+++ b/activemodel/lib/active_model/attribute_assignment.rb
@@ -19,10 +19,10 @@ module ActiveModel
# cat = Cat.new
# cat.assign_attributes(name: "Gorby", status: "yawning")
# cat.name # => 'Gorby'
- # cat.status => 'yawning'
+ # cat.status # => 'yawning'
# cat.assign_attributes(status: "sleeping")
# cat.name # => 'Gorby'
- # cat.status => 'sleeping'
+ # cat.status # => 'sleeping'
def assign_attributes(new_attributes)
if !new_attributes.respond_to?(:stringify_keys)
raise ArgumentError, "When assigning attributes, you must pass a hash as an argument." | Docs: Fix output representation [ci skip]
The output of two string attributes is displayed differently in the docs. Standardize the output by always showing it as a comment. | rails_rails | train | rb |
ebf74aa87cc3649ac522a3e841a27a182215b9e9 | diff --git a/build/dice.js b/build/dice.js
index <HASH>..<HASH> 100644
--- a/build/dice.js
+++ b/build/dice.js
@@ -1,5 +1,5 @@
dice = {
- version: "0.5.0",
+ version: "0.7.0",
roll: function(str, scope){
var parsed = dice.parse.parse(str); | Fixed and bumped version number. | lordnull_dice.js | train | js |
49e07dec8e96d6c84586c6132dd0e361b06ef668 | diff --git a/dss/events/chunkedtask/_awsimpl.py b/dss/events/chunkedtask/_awsimpl.py
index <HASH>..<HASH> 100644
--- a/dss/events/chunkedtask/_awsimpl.py
+++ b/dss/events/chunkedtask/_awsimpl.py
@@ -40,6 +40,3 @@ class AWSRuntime(Runtime[dict, typing.Any]):
@staticmethod
def log(client_key: str, task_id: str, message: str):
log_message(awsconstants.get_worker_sns_topic(client_key), task_id, message)
- # TODO: (ttung) remove this when the existing branches that depend on the old log group have landed.
- # Additionally, the chunked_task_worker perm for the ci-cd user should be removed.
- log_message("chunked_task_worker", task_id, message) | remove old logger (#<I>) | HumanCellAtlas_cloud-blobstore | train | py |
ee5b70e6a604623b26374a83679ec20eca7bd65b | diff --git a/electionnight/management/commands/bootstrap_elex.py b/electionnight/management/commands/bootstrap_elex.py
index <HASH>..<HASH> 100644
--- a/electionnight/management/commands/bootstrap_elex.py
+++ b/electionnight/management/commands/bootstrap_elex.py
@@ -131,12 +131,18 @@ class Command(BaseCommand):
else:
party = None
- return election.Election.objects.get(
- election_day=election_day,
- division=race.office.division,
- race=race,
- party=party
- )
+ try:
+ election.Election.objects.get(
+ election_day=election_day,
+ division=race.office.division,
+ race=race,
+ party=party
+ )
+ except:
+ print('Could not find election for {0} {1} {2}'.format(
+ race, party, row['last']
+ ))
+ return None
def get_or_create_party(self, row):
"""
@@ -261,6 +267,9 @@ class Command(BaseCommand):
race = self.get_race(row, division)
election = self.get_election(row, race)
+ if not election:
+ return None
+
party = self.get_or_create_party(row)
candidate = self.get_or_create_candidate(row, party, race)
candidate_election = self.get_or_create_candidate_election( | don't error out if we don't find an election during bootstrap | The-Politico_politico-civic-election-night | train | py |
1182e4e4f02a7f63e9184f174510c68ac0e137d3 | diff --git a/cmd/githubwiki/githubwiki.go b/cmd/githubwiki/githubwiki.go
index <HASH>..<HASH> 100644
--- a/cmd/githubwiki/githubwiki.go
+++ b/cmd/githubwiki/githubwiki.go
@@ -72,7 +72,7 @@ func (g git) exec(args ...string) (string, error) {
cmd.Dir = string(g)
output, err := cmd.CombinedOutput()
if err != nil {
- return "", fmt.Errorf("%v failed: %v", cmd.Args, err)
+ return "", fmt.Errorf("%v failed\nError: %v\nOutput: %s", cmd.Args, err, string(output))
}
return strings.TrimSpace(string(output)), nil
} | Add more detailed output for github-wiki task (#<I>)
Print output of git command in addition to error in error output. | palantir_godel | train | go |
939c3b563f1100d7cba4e7eb40fe4801e48010e6 | diff --git a/lib/ood_core/job/adapters/slurm.rb b/lib/ood_core/job/adapters/slurm.rb
index <HASH>..<HASH> 100644
--- a/lib/ood_core/job/adapters/slurm.rb
+++ b/lib/ood_core/job/adapters/slurm.rb
@@ -74,7 +74,7 @@ module OodCore
def get_jobs(id: "", filters: [])
delim = ";" # don't use "|" because FEATURES uses this
options = filters.empty? ? fields : fields.slice(*filters)
- args = ["--all", "--array", "--states=all", "--noconvert"]
+ args = ["--all", "--states=all", "--noconvert"]
args += ["-o", "#{options.values.join(delim)}"]
args += ["-j", id.to_s] unless id.to_s.empty?
lines = call("squeue", *args).split("\n").map(&:strip) | don't break up job arrays
A job array initially starts off as a single job with a single job id.
But as one of those jobs in the array changes state (e.g., runs) then it
will be given a new job id and be treated as a separate job. This new
job will be on a new line in `squeue` and we don't need to use
`--array`. | OSC_ood_core | train | rb |
8f9d0c8cdde18517a5befc698abaf5c328e06449 | diff --git a/lib/config.js b/lib/config.js
index <HASH>..<HASH> 100644
--- a/lib/config.js
+++ b/lib/config.js
@@ -6,6 +6,11 @@ module.exports = function(c){
_(config).extend(c);
+ // attempt to prime the creds by getting them now instead of on
+ // the first request.
+ var creds = new AWS.Credentials();
+ creds.get();
+
AWS.config.update({
accessKeyId: c.accessKeyId,
secretAccessKey: c.secretAccessKey,
@@ -17,6 +22,6 @@ module.exports = function(c){
if (c.endpoint && c.endpoint !== '') opts.endpoint = new AWS.Endpoint(c.endpoint);
config.dynamo = new AWS.DynamoDB(opts);
-
+
return config;
}; | by calling creds.get() this give a chance for creds to get cached before many requests at once try to get them [live test] | mapbox_dyno | train | js |
e06bddb50f305df6b02cd6b4d96a3feb74c598bf | diff --git a/tests/hexadecimal-utils/test_is_hexstr.py b/tests/hexadecimal-utils/test_is_hexstr.py
index <HASH>..<HASH> 100644
--- a/tests/hexadecimal-utils/test_is_hexstr.py
+++ b/tests/hexadecimal-utils/test_is_hexstr.py
@@ -15,6 +15,7 @@ from eth_utils import is_hexstr
("0xabcdef1234567890", True),
("0xABCDEF1234567890", True),
("0xAbCdEf1234567890", True),
+ ("0XAbCdEf1234567890", True),
("12345", True), # odd length
("0x12345", True), # odd length
("123456xx", False), # non-hex character
@@ -22,7 +23,7 @@ from eth_utils import is_hexstr
("0\u0080", False), # triggers different exceptions in py2 and py3
(1, False), # int
(b"", False), # bytes
- ({}, False), # dicitionary
+ ({}, False), # dictionary
(lambda: None, False) # lambda function
),
) | Typo fix and added test with '0X' prefix | ethereum_eth-utils | train | py |
2b677450f20740bdb3670a47ade8fc964448fc25 | diff --git a/lib/active_decorator/decorator.rb b/lib/active_decorator/decorator.rb
index <HASH>..<HASH> 100644
--- a/lib/active_decorator/decorator.rb
+++ b/lib/active_decorator/decorator.rb
@@ -17,14 +17,14 @@ module ActiveDecorator
obj.each do |r|
decorate r
end
- elsif defined?(ActiveRecord) && obj.is_a?(ActiveRecord::Relation) && !obj.is_a?(ActiveDecorator::RelationDecorator) && !obj.is_a?(ActiveDecorator::RelationDecoratorLegacy)
+ elsif defined?(ActiveRecord) && obj.is_a?(ActiveRecord::Relation)
# don't call each nor to_a immediately
if obj.respond_to?(:records)
# Rails 5.0
- obj.extend ActiveDecorator::RelationDecorator
+ obj.extend ActiveDecorator::RelationDecorator unless obj.is_a? ActiveDecorator::RelationDecorator
else
# Rails 3.x and 4.x
- obj.extend ActiveDecorator::RelationDecoratorLegacy
+ obj.extend ActiveDecorator::RelationDecoratorLegacy unless obj.is_a? ActiveDecorator::RelationDecoratorLegacy
end
else
d = decorator_for obj.class | Should not fallback to `else` when the Relation is already decorated | amatsuda_active_decorator | train | rb |
1372ca92f352b9bbf7d08a49684755639efba6ad | diff --git a/src/org/jgroups/protocols/UNICAST.java b/src/org/jgroups/protocols/UNICAST.java
index <HASH>..<HASH> 100644
--- a/src/org/jgroups/protocols/UNICAST.java
+++ b/src/org/jgroups/protocols/UNICAST.java
@@ -32,7 +32,7 @@ import java.util.concurrent.atomic.AtomicInteger;
* whenever a message is received: the new message is added and then we try to remove as many messages as
* possible (until we stop at a gap, or there are no more messages).
* @author Bela Ban
- * @version $Id: UNICAST.java,v 1.135 2009/04/29 12:36:06 belaban Exp $
+ * @version $Id: UNICAST.java,v 1.136 2009/04/29 12:48:27 belaban Exp $
*/
@MBean(description="Reliable unicast layer")
@DeprecatedProperty(names={"immediate_ack", "use_gms", "enabled_mbrs_timeout", "eager_lock_release"})
@@ -435,6 +435,7 @@ public class UNICAST extends Protocol implements AckSenderWindow.RetransmitComma
/**
* This method is public only so it can be invoked by unit testing, but should not otherwise be used !
*/
+ @ManagedOperation(description="Trashes all connections to other nodes. This is only used for testing")
public void removeAllConnections() {
synchronized(connections) {
for(Entry entry: connections.values()) { | made removeAllConnections() a managed op | belaban_JGroups | train | java |
f1f7bb372052c1431ba04cab4d3293274326b5ec | diff --git a/ui/src/data_explorer/reducers/timeRange.js b/ui/src/data_explorer/reducers/timeRange.js
index <HASH>..<HASH> 100644
--- a/ui/src/data_explorer/reducers/timeRange.js
+++ b/ui/src/data_explorer/reducers/timeRange.js
@@ -1,5 +1,3 @@
-import update from 'react-addons-update';
-
const initialState = {
upper: null,
lower: 'now() - 15m',
@@ -9,11 +7,12 @@ export default function timeRange(state = initialState, action) {
switch (action.type) {
case 'SET_TIME_RANGE': {
const {upper, lower} = action.payload;
+ const newState = {
+ upper,
+ lower,
+ };
- return update(state, {
- ['lower']: {$set: lower},
- ['upper']: {$set: upper},
- });
+ return {...state, ...newState};
}
}
return state; | Use es6 flavorz in timeRange reducer | influxdata_influxdb | train | js |
b9055d43e27c936ca05898f96e4a33b04ca81c72 | diff --git a/ratethisapp/src/main/java/com/kobakei/ratethisapp/RateThisApp.java b/ratethisapp/src/main/java/com/kobakei/ratethisapp/RateThisApp.java
index <HASH>..<HASH> 100644
--- a/ratethisapp/src/main/java/com/kobakei/ratethisapp/RateThisApp.java
+++ b/ratethisapp/src/main/java/com/kobakei/ratethisapp/RateThisApp.java
@@ -170,6 +170,14 @@ public class RateThisApp {
showRateDialog(context, builder);
}
+ /**
+ * Stop showing the rate dialog
+ * @param context
+ */
+ public static void stopRateDialog(final Context context){
+ setOptOut(context, true);
+ }
+
private static void showRateDialog(final Context context, AlertDialog.Builder builder) {
int titleId = sConfig.mTitleId != 0 ? sConfig.mTitleId : R.string.rta_dialog_title;
int messageId = sConfig.mMessageId != 0 ? sConfig.mMessageId : R.string.rta_dialog_message; | Update RateThisApp.java
Create a stop showing method | kobakei_Android-RateThisApp | train | java |
c28d33e22c7de34217012f11cf17080810b3542d | diff --git a/spec/functional/resource/env_spec.rb b/spec/functional/resource/env_spec.rb
index <HASH>..<HASH> 100755
--- a/spec/functional/resource/env_spec.rb
+++ b/spec/functional/resource/env_spec.rb
@@ -126,7 +126,7 @@ describe Chef::Resource::Env, :windows_only do
context 'when using PATH' do
let(:random_name) { Time.now.to_i }
let(:env_val) { "#{env_value_expandable}_#{random_name}"}
- let!(:path_before) { test_resource.provider_for_action(test_resource.action).env_value('PATH') }
+ let!(:path_before) { test_resource.provider_for_action(test_resource.action).env_value('PATH') || '' }
let!(:env_path_before) { ENV['PATH'] }
it 'should expand PATH' do
@@ -143,9 +143,6 @@ describe Chef::Resource::Env, :windows_only do
test_resource.key_name('PATH')
test_resource.value(path_before)
test_resource.run_action(:create)
- if test_resource.provider_for_action(test_resource.action).env_value('PATH') != path_before
- raise 'Failed to cleanup after ourselves'
- end
ENV['PATH'] = env_path_before
end
end | Deal with nil system path in env_spec | chef_chef | train | rb |
3bbe571bd365452aa8a40d92d20561fb70fb60dc | diff --git a/init/index.js b/init/index.js
index <HASH>..<HASH> 100644
--- a/init/index.js
+++ b/init/index.js
@@ -48,7 +48,11 @@ util.inherits(Generator, BBBGenerator);
Generator.prototype.askFor = function askFor() {
var done = this.async();
- var force = (this.constructor._name === "bbb:init") || grunt.file.isFile(".bbb-rc.json");
+ var force = false;
+ if (this.constructor._name === "bbb:init"
+ || !grunt.file.isFile(path.join(this.destinationRoot(), ".bbb-rc.json"))) {
+ force = true;
+ }
// Display the BBB ASCII
console.log(grunt.file.read(path.join(__dirname, "../ascii.txt"))); | Fix question prompt so it does not reask answered question when .bbb-rc.json file is present. | backbone-boilerplate_generator-bbb | 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.