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
|
---|---|---|---|---|---|
37d5433a01020d387b5236f3949822e522898450 | diff --git a/src/Exceptions/Handlers/ExceptionHandler.php b/src/Exceptions/Handlers/ExceptionHandler.php
index <HASH>..<HASH> 100644
--- a/src/Exceptions/Handlers/ExceptionHandler.php
+++ b/src/Exceptions/Handlers/ExceptionHandler.php
@@ -86,6 +86,10 @@ abstract class ExceptionHandler
// Make sure we handle fatal errors too.
register_shutdown_function(function () use ($exceptionHandler) {
+ if (!self::$exceptionTrappingOn) {
+ return;
+ }
+
$error = error_get_last();
if ($error != null) { | Disabled shutdown function execution if exception trapping is turned off | RhubarbPHP_Rhubarb | train | php |
bf53f0882bffb16f965d81e575ce6e914b3aecea | diff --git a/server/src/main/java/io/atomix/copycat/server/state/ClusterState.java b/server/src/main/java/io/atomix/copycat/server/state/ClusterState.java
index <HASH>..<HASH> 100644
--- a/server/src/main/java/io/atomix/copycat/server/state/ClusterState.java
+++ b/server/src/main/java/io/atomix/copycat/server/state/ClusterState.java
@@ -344,9 +344,12 @@ final class ClusterState implements Cluster, AutoCloseable {
} else if (type == Member.Type.ACTIVE) {
context.transition(CopycatServer.State.FOLLOWER);
joinFuture.complete(null);
- } else if (type == Member.Type.PASSIVE) {
+ } else if (type == Member.Type.PASSIVE || type == Member.Type.PROMOTABLE) {
context.transition(CopycatServer.State.PASSIVE);
joinFuture.complete(null);
+ } else if (type == Member.Type.RESERVE) {
+ context.transition(CopycatServer.State.RESERVE);
+ joinFuture.complete(null);
} else {
joinFuture.completeExceptionally(new IllegalStateException("unknown member type: " + type));
} | Ensure server transitions to RESERVE upon join. | atomix_copycat | train | java |
9e44b4e115d4ec303db1315453fc4524fed53b71 | diff --git a/src/webroot/cms/media-library/medialibrary/MedialibraryAction.php b/src/webroot/cms/media-library/medialibrary/MedialibraryAction.php
index <HASH>..<HASH> 100644
--- a/src/webroot/cms/media-library/medialibrary/MedialibraryAction.php
+++ b/src/webroot/cms/media-library/medialibrary/MedialibraryAction.php
@@ -429,9 +429,10 @@ class MedialibraryAction extends MediaLibraryAbstractAction
$folderPath = $this->getRequest()
->getPostValue('folderPath', '');
- $folderPathParts = explode('/', trim(str_replace('\\', '/', $folderPath), '/'));
+ $folderPath = trim(str_replace('\\', '/', $folderPath), '/');
- if ( ! empty($folderPathParts)) {
+ if ( ! empty($folderPath)) {
+ $folderPathParts = explode('/', $folderPath);
foreach ($folderPathParts as $part) {
$folderFound = false; | Fixed media library creating folders with empty name | sitesupra_sitesupra | train | php |
980c3e069c866ad5bca58a2442872b780285e0f6 | diff --git a/liquibase-core/src/main/java/liquibase/integration/commandline/Main.java b/liquibase-core/src/main/java/liquibase/integration/commandline/Main.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/main/java/liquibase/integration/commandline/Main.java
+++ b/liquibase-core/src/main/java/liquibase/integration/commandline/Main.java
@@ -1404,7 +1404,7 @@ public class Main {
);
Database database = null;
- if (this.url != null) {
+ if (dbConnectionNeeded(command) && this.url != null) {
database = CommandLineUtils.createDatabaseObject(fileOpener, this.url,
this.username, this.password, this.driver, this.defaultCatalogName, this.defaultSchemaName,
Boolean.parseBoolean(outputDefaultCatalog), Boolean.parseBoolean(outputDefaultSchema),
@@ -1904,6 +1904,10 @@ public class Main {
}
}
+ private boolean dbConnectionNeeded(String command) {
+ return ! COMMANDS.REGISTER_CHANGELOG.equalsIgnoreCase(command);
+ }
+
private boolean isLicenseableCommand(String formatValue) {
return COMMANDS.ROLLBACK_ONE_CHANGE_SET.equalsIgnoreCase(command) ||
COMMANDS.ROLLBACK_ONE_CHANGE_SET_SQL.equalsIgnoreCase(command) || | We do not need to connect to the DB for registerChangeLog even if there is a URL specified LB-<I> | liquibase_liquibase | train | java |
f61b8721e65cf64c2297b24bd710dcf3c117c755 | diff --git a/examples/module-native/test.js b/examples/module-native/test.js
index <HASH>..<HASH> 100644
--- a/examples/module-native/test.js
+++ b/examples/module-native/test.js
@@ -1,4 +1,4 @@
-var dockerLambda = require('..')
+var dockerLambda = require('../..')
var match = dockerLambda({event: {password: 'lambda-docker'}}) | Fix path for module-native example | lambci_docker-lambda | train | js |
a4d4b401776e77a4680dfbe1354541ddc348907b | diff --git a/plugins/homepage/server/__init__.py b/plugins/homepage/server/__init__.py
index <HASH>..<HASH> 100644
--- a/plugins/homepage/server/__init__.py
+++ b/plugins/homepage/server/__init__.py
@@ -54,7 +54,7 @@ def getOrCreateAssetsFolder():
collection = ModelImporter.model('collection').createCollection(
NAME, public=False, reuseExisting=True)
folder = ModelImporter.model('folder').createFolder(
- collection, NAME, parentType='collection', public=False,
+ collection, NAME, parentType='collection', public=True,
reuseExisting=True)
return folder
diff --git a/plugins/homepage/web_client/js/ConfigView.js b/plugins/homepage/web_client/js/ConfigView.js
index <HASH>..<HASH> 100644
--- a/plugins/homepage/web_client/js/ConfigView.js
+++ b/plugins/homepage/web_client/js/ConfigView.js
@@ -25,7 +25,7 @@ girder.views.homepage_ConfigView = girder.View.extend({
parent: this.folder,
enableUploads: true,
maxUploadSize: 1024 * 1024 * 10,
- allowedExtensions: ['png', 'jpeg', 'jpg', 'gif'],
+ allowedExtensions: ['png', 'jpeg', 'jpg', 'gif']
});
this.render();
this.editor.val(resp['homepage.markdown']); | Public folder. Remove trailing comma. | girder_girder | train | py,js |
795dfd0df10ee598b138cf9be4617adaf02acad1 | diff --git a/fusionbox/fabric_helpers.py b/fusionbox/fabric_helpers.py
index <HASH>..<HASH> 100644
--- a/fusionbox/fabric_helpers.py
+++ b/fusionbox/fabric_helpers.py
@@ -39,7 +39,7 @@ def update_git(branch):
try:
loc = tempfile.mkdtemp()
put(StringIO(local('git rev-parse %s' % branch, capture=True) + "\n"), 'static/.git_version.txt', mode=0775)
- local("git archive %s | tar xf - -C %s" % (branch, loc))
+ local("cd `git rev-parse --show-toplevel` && git archive %s | tar xf - -C %s" % (branch, loc))
local("chmod -R g+rwX %s" % (loc)) # force group permissions
# env.cwd is documented as private, but I'm not sure how else to do this
with settings(warn_only=True): | cd to git root before archiving, the whole project always needs to be updated | fusionbox_django-argonauts | train | py |
bed6b90e61051345d41e1b2f5b0cfb0e79f96904 | diff --git a/storage/storagepb/kv.pb.go b/storage/storagepb/kv.pb.go
index <HASH>..<HASH> 100644
--- a/storage/storagepb/kv.pb.go
+++ b/storage/storagepb/kv.pb.go
@@ -68,8 +68,9 @@ type Event struct {
// a put event contains the current key-value
// a delete/expire event contains the previous
// key-value
- Kv *KeyValue `protobuf:"bytes,2,opt,name=kv" json:"kv,omitempty"`
- WatchID int64 `protobuf:"varint,3,opt,name=watchID,proto3" json:"watchID,omitempty"`
+ Kv *KeyValue `protobuf:"bytes,2,opt,name=kv" json:"kv,omitempty"`
+ // watchID is the ID of watching this event is sent to.
+ WatchID int64 `protobuf:"varint,3,opt,name=watchID,proto3" json:"watchID,omitempty"`
}
func (m *Event) Reset() { *m = Event{} } | storagepb: minor updates from genproto
I ran genproto with the most recent protocol buffer
and it adds one line of missing comment. | etcd-io_etcd | train | go |
b6f9bdd6d00a6c405267e90ceb39588ce4e1c217 | diff --git a/lib/rake/file_utils.rb b/lib/rake/file_utils.rb
index <HASH>..<HASH> 100644
--- a/lib/rake/file_utils.rb
+++ b/lib/rake/file_utils.rb
@@ -3,7 +3,7 @@
# added to the FileUtils utility functions.
#
module FileUtils
- # Path to the currently running ruby.
+ # Path to the currently running Ruby program
RUBY = File.join(
Config::CONFIG['bindir'],
Config::CONFIG['ruby_install_name'] + Config::CONFIG['EXEEXT']). | Added comment about the RUBY constant | ruby_rake | train | rb |
f166177426decc28e3f3df59c60f3739a5cc97bd | diff --git a/client/index.js b/client/index.js
index <HASH>..<HASH> 100644
--- a/client/index.js
+++ b/client/index.js
@@ -5,7 +5,7 @@
const url = require('url');
const stripAnsi = require('strip-ansi');
-const log = require('loglevel');
+const log = require('loglevel').getLogger('webpack-dev-server');
const socket = require('./socket');
const overlay = require('./overlay'); | Fixes issue #<I> by switching to a named logger (#<I>) | webpack_webpack-dev-server | train | js |
054e27ccd0196b197f55532d154fe53940f396f0 | diff --git a/src/main/java/com/typesafe/config/impl/AbstractConfigValue.java b/src/main/java/com/typesafe/config/impl/AbstractConfigValue.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/typesafe/config/impl/AbstractConfigValue.java
+++ b/src/main/java/com/typesafe/config/impl/AbstractConfigValue.java
@@ -4,6 +4,13 @@ import com.typesafe.config.ConfigOrigin;
import com.typesafe.config.ConfigResolveOptions;
import com.typesafe.config.ConfigValue;
+/**
+ *
+ * Trying very hard to avoid a parent reference in config values; when you have
+ * a tree like this, the availability of parent() tends to result in a lot of
+ * improperly-factored and non-modular code. Please don't add parent().
+ *
+ */
abstract class AbstractConfigValue implements ConfigValue {
final private ConfigOrigin origin; | add comment about not having ConfigValue.parent() | lightbend_config | train | java |
d73e17af2a9329063bdd043c0622ce109cd68bce | diff --git a/ca/config.go b/ca/config.go
index <HASH>..<HASH> 100644
--- a/ca/config.go
+++ b/ca/config.go
@@ -29,13 +29,13 @@ const (
)
const (
- rootCN = "cluster-ca"
+ rootCN = "swarm-ca"
// ManagerRole represents the Manager node type, and is used for authorization to endpoints
- ManagerRole = "cluster-manager"
+ ManagerRole = "swarm-manager"
// AgentRole represents the Agent node type, and is used for authorization to endpoints
- AgentRole = "cluster-worker"
+ AgentRole = "swarm-worker"
// CARole represents the CA node type, and is used for clients attempting to get new certificates issued
- CARole = "cluster-ca"
+ CARole = "swarm-ca"
)
// AgentSecurityConfig is used to configure the security params of the agents
diff --git a/ca/server.go b/ca/server.go
index <HASH>..<HASH> 100644
--- a/ca/server.go
+++ b/ca/server.go
@@ -218,7 +218,7 @@ func (s *Server) evaluateAndSignCert(ctx context.Context, rCertificate *api.Regi
// FIXME(aaronl): Right now, this automatically signs any pending certificate. We need to
// add more flexible logic on acceptance modes.
- if rCertificate.Role == AgentRole && rCertificate.Status.State != api.IssuanceStatePending {
+ if rCertificate.Status.State != api.IssuanceStatePending {
return
} | Changing cluster to swarm. For the third time | docker_swarmkit | train | go,go |
49dbcdf0cfc1ae029bf139a13ddf773aaef6d579 | diff --git a/lib/ridgepole/version.rb b/lib/ridgepole/version.rb
index <HASH>..<HASH> 100644
--- a/lib/ridgepole/version.rb
+++ b/lib/ridgepole/version.rb
@@ -1,3 +1,3 @@
module Ridgepole
- VERSION = '0.7.0.beta2'
+ VERSION = '0.7.0.beta3'
end | Bump up version [ci skip] | winebarrel_ridgepole | train | rb |
c64034ca8fb351423f2c700b508f886de0f87e3d | diff --git a/lib/metacrunch/elasticsearch/index_creator.rb b/lib/metacrunch/elasticsearch/index_creator.rb
index <HASH>..<HASH> 100644
--- a/lib/metacrunch/elasticsearch/index_creator.rb
+++ b/lib/metacrunch/elasticsearch/index_creator.rb
@@ -14,7 +14,7 @@ class Metacrunch::Elasticsearch::IndexCreator < Metacrunch::Processor
def initialize(options = {})
(@client_args = options).deep_symbolize_keys!
- extract_options!(@client_args, :_client_options_, :default_mapping, :delete_existing_index, :logger)
+ extract_options!(@client_args, :_client_options_, :default_mapping, :delete_existing_index, :logger, :number_of_shards, :number_of_replicas)
raise ArgumentError.new("You have to supply an index name!") if @client_args[:index].blank?
end
@@ -33,7 +33,15 @@ class Metacrunch::Elasticsearch::IndexCreator < Metacrunch::Processor
end
end
- client.indices.create(@client_args)
+ client.indices.create(@client_args.merge(
+ {
+ body: {
+ number_of_shards: @number_of_shards,
+ number_of_replicas: @number_of_replicas
+ }.compact
+ }
+ ))
+
log_index_created(logger, @client_args[:index], client) if logger
if @default_mapping | Added number of shards/replicas option to index creator | ubpb_metacrunch-elasticsearch | train | rb |
23e7243b84c7fbe9f9abf032a82740375323bb45 | diff --git a/generate.js b/generate.js
index <HASH>..<HASH> 100755
--- a/generate.js
+++ b/generate.js
@@ -5,7 +5,6 @@ set("-e");
cd(`${__dirname}`);
-const fs = require("fs");
const package = require("./package.json");
const thisFolder = $("pwd");
const specFilename = `spec-v1-swagger.json`;
@@ -30,7 +29,7 @@ eval(
swaggerConfig = require(swaggerConfigFilename);
swaggerConfig.npmName = package.name;
swaggerConfig.npmVersion = package.version;
-fs.writeFileSync(swaggerConfigFilename, JSON.stringify(swaggerConfig, null, 2));
+writeFile(swaggerConfigFilename, JSON.stringify(swaggerConfig, null, 2));
/// Share the current folder with docker, and then run the generator, pointing to the given template
eval(`docker run --rm -v ${ | Use jBash writeFile helper | ynab_ynab-sdk-js | train | js |
5d14769a0eb769ebb1afa0181f06d41a8df47178 | diff --git a/spec/platform/helpers/extensions/test.rb b/spec/platform/helpers/extensions/test.rb
index <HASH>..<HASH> 100644
--- a/spec/platform/helpers/extensions/test.rb
+++ b/spec/platform/helpers/extensions/test.rb
@@ -17,8 +17,4 @@ ronin_extension do
:method
end
- def run_method
- @var = :running
- end
-
end | Removed an unused method from the test extension. | ronin-ruby_ronin | train | rb |
c715972827474304be5733e0916d81e0e3228958 | diff --git a/tests/TestCase.php b/tests/TestCase.php
index <HASH>..<HASH> 100755
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -196,6 +196,13 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase
/**
* @return string
*/
+ public static function wsdlYandexDirectApiLivePath()
+ {
+ return __DIR__ . '/resources/directapi/live.wsdl';
+ }
+ /**
+ * @return string
+ */
public static function wsdlDocDataPaymentsPath()
{
return __DIR__ . '/resources/docdatapayments/1_3.wsdl'; | issue #<I> - add utility method for direct api live wsdl | WsdlToPhp_PackageGenerator | train | php |
57c276c80aba6cb13a859369f4f194470df594d7 | diff --git a/src/trumbowyg.js b/src/trumbowyg.js
index <HASH>..<HASH> 100644
--- a/src/trumbowyg.js
+++ b/src/trumbowyg.js
@@ -1376,10 +1376,25 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', {
var t = this,
prefix = t.o.prefix,
fullscreenCssClass = prefix + 'fullscreen',
- isFullscreen;
+ fullscreenPlaceholderClass = fullscreenCssClass + '-placeholder',
+ isFullscreen,
+ editorHeight = t.$box.outerHeight();
t.$box.toggleClass(fullscreenCssClass);
isFullscreen = t.$box.hasClass(fullscreenCssClass);
+
+ if (isFullscreen) {
+ t.$box.before(
+ $('<div/>', {
+ class: fullscreenPlaceholderClass
+ }).css({
+ height: editorHeight + 'px'
+ })
+ );
+ } else {
+ $('.' + fullscreenPlaceholderClass).remove();
+ }
+
$('body').toggleClass(prefix + 'body-fullscreen', isFullscreen);
$(window).trigger('scroll');
t.$c.trigger('tbw' + (isFullscreen ? 'open' : 'close') + 'fullscreen'); | fix: add a placeholder while fullscreen to keep editor space
fix #<I> | Alex-D_Trumbowyg | train | js |
890b000d35123157a83a2630a9b548704e493e35 | diff --git a/src/detectSeries.js b/src/detectSeries.js
index <HASH>..<HASH> 100644
--- a/src/detectSeries.js
+++ b/src/detectSeries.js
@@ -5,7 +5,7 @@ export default function detectSeries(collection, predicate, notFound = undefined
return collection.reduce(
(promise, item, index, collection) => {
return promise.then(() => {
- return tryFn(predicate ,item, index, collection)
+ return tryFn(predicate, item, index, collection)
.then((result) => {
if (result === true) {
return Promise.reject(new PromiseBreak(item)); | Fix lint issue in detectSeries | jgornick_asyncp | train | js |
fdcea3ee113e65ab7c10790807ca1e59dd180d8c | diff --git a/core-bundle/contao/drivers/DC_Table.php b/core-bundle/contao/drivers/DC_Table.php
index <HASH>..<HASH> 100644
--- a/core-bundle/contao/drivers/DC_Table.php
+++ b/core-bundle/contao/drivers/DC_Table.php
@@ -15,7 +15,7 @@ namespace Contao;
* Provide methods to modify the database.
*
* @author Leo Feyer <https://github.com/leofeyer>
- * @author Andreas Schempp <https://github.com/schempp>
+ * @author Andreas Schempp <https://github.com/aschempp>
*/
class DC_Table extends \DataContainer implements \listable, \editable
{
diff --git a/core-bundle/contao/elements/ContentGallery.php b/core-bundle/contao/elements/ContentGallery.php
index <HASH>..<HASH> 100644
--- a/core-bundle/contao/elements/ContentGallery.php
+++ b/core-bundle/contao/elements/ContentGallery.php
@@ -286,9 +286,6 @@ class ContentGallery extends \ContentElement
// Do not index or cache the page if the page number is outside the range
if ($page < 1 || $page > max(ceil($total/$this->perPage), 1))
{
- /** @var \PageModel $objPage */
- global $objPage;
-
$objPage->noSearch = 1;
$objPage->cache = 0; | [Core] Fixed two minor issues found by @aschempp | contao_contao | train | php,php |
5b26255f934146902115236a0561baa5ff6fa245 | diff --git a/src/Shell/Task/ExtractTask.php b/src/Shell/Task/ExtractTask.php
index <HASH>..<HASH> 100644
--- a/src/Shell/Task/ExtractTask.php
+++ b/src/Shell/Task/ExtractTask.php
@@ -522,7 +522,9 @@ class ExtractTask extends Shell
$occurrences = [];
foreach ($files as $file => $lines) {
$lines = array_unique($lines);
- $occurrences[] = $file . ':' . implode(';', $lines);
+ foreach ($lines as $line) {
+ $occurrences[] = $file . ':' . $line;
+ }
}
$occurrences = implode("\n#: ", $occurrences);
$header = ''; | Improve generated .pot references compatibility with editors
Most PO editors do not support references like File.php:<I>;<I>, each line must be listed separately as File.php:<I> File.php:<I>. | cakephp_cakephp | train | php |
a6b527f9a353fcc05866ed7b8f98abb19911ae1f | diff --git a/src/tagadvance/gilligan/text/Ordinal.php b/src/tagadvance/gilligan/text/Ordinal.php
index <HASH>..<HASH> 100644
--- a/src/tagadvance/gilligan/text/Ordinal.php
+++ b/src/tagadvance/gilligan/text/Ordinal.php
@@ -33,7 +33,7 @@ class Ordinal {
self::RD
];
$index = $n % 10;
- return isset ( $suffixes [$index] ) ? $suffixes [$index] : self::TH;
+ return $suffixes [$index] ?? self::TH;
}
}
\ No newline at end of file | replace ternary operator with null coalesce operator | tagadvance_Gilligan | train | php |
d525003337051f1d27d688a26af39ed74ef1835c | diff --git a/cherrypy/lib/cptools.py b/cherrypy/lib/cptools.py
index <HASH>..<HASH> 100644
--- a/cherrypy/lib/cptools.py
+++ b/cherrypy/lib/cptools.py
@@ -370,7 +370,8 @@ Message: %(error_msg)s
if path.endswith('login_screen'):
if self.debug:
cherrypy.log('routing %r to login_screen' % path, 'TOOLS.SESSAUTH')
- return self.login_screen(**request.params)
+ response.body = self.login_screen()
+ return True
elif path.endswith('do_login'):
if request.method != 'POST':
response.headers['Allow'] = "POST" | cptools.SessionAuth: fix login_screen page handler
The login_screen page handler erroneously returned the formatted HTML page,
which was simply interpreted as a boolean that controls whether the call
to the controller function was suppressed or not.
Set the response.body instead and return a literal True that suppresses the
call to the page handler. | cherrypy_cheroot | train | py |
7230bd1096396448fee73fca0327da767585e8a2 | diff --git a/pkg/kubelet/rkt/rkt.go b/pkg/kubelet/rkt/rkt.go
index <HASH>..<HASH> 100644
--- a/pkg/kubelet/rkt/rkt.go
+++ b/pkg/kubelet/rkt/rkt.go
@@ -998,6 +998,7 @@ func (r *Runtime) GetPods(all bool) ([]*kubecontainer.Pod, error) {
}
pods := make(map[types.UID]*kubecontainer.Pod)
+ var podIDs []types.UID
for _, pod := range listResp.Pods {
pod, err := r.convertRktPod(pod)
if err != nil {
@@ -1009,16 +1010,17 @@ func (r *Runtime) GetPods(all bool) ([]*kubecontainer.Pod, error) {
oldPod, found := pods[pod.ID]
if !found {
pods[pod.ID] = pod
+ podIDs = append(podIDs, pod.ID)
continue
}
oldPod.Containers = append(oldPod.Containers, pod.Containers...)
}
- // Convert map to list.
+ // Convert map to list, using the consistent order from the podIDs array.
var result []*kubecontainer.Pod
- for _, p := range pods {
- result = append(result, p)
+ for _, id := range podIDs {
+ result = append(result, pods[id])
}
return result, nil | Fix rkt GetPods() order
Use an array to store the pod IDs and use that to build the pod array with consistent ordering,
instead of map ordering, which is random and causes test flakes. | kubernetes_kubernetes | train | go |
7c51f1369547c308cb37a6a919917e5559b137b3 | diff --git a/packages/core/renderers/renderer-hyperhtml.js b/packages/core/renderers/renderer-hyperhtml.js
index <HASH>..<HASH> 100644
--- a/packages/core/renderers/renderer-hyperhtml.js
+++ b/packages/core/renderers/renderer-hyperhtml.js
@@ -34,11 +34,13 @@ export function BoltComponent(Base = HTMLElement) {
// this.innerHTML = JSON.parse(this.dataset.ssrContent);
// }
this._checkSlots();
- super.connectedCallback && super.connectedCallback();
+ this.connecting && this.connecting();
+ this.connected && this.connected();
}
disconnectedCallback() {
- super.disconnectedCallback && super.disconnectedCallback();
+ this.disconnecting && this.disconnecting();
+ this.disconnected && this.disconnected();
}
addStyles(stylesheet) { | fix: updating hyperhtml renderer to prevent extra connectedCallbacks from running unexpectedly | bolt-design-system_bolt | train | js |
bb11073a73994167fd632402d74842e8459d6f43 | diff --git a/tests/ResultTest.php b/tests/ResultTest.php
index <HASH>..<HASH> 100644
--- a/tests/ResultTest.php
+++ b/tests/ResultTest.php
@@ -91,7 +91,7 @@ class ResultTest extends TestCase{
* @expectedExceptionMessage invalid callback
*/
public function testEachInvalidCallback(){
- $this->result->__each('foo');
+ $this->result->__each([$this, 'foo']);
}
public function testMerge(){ | :octocat: WTB consistent behaviour of the "callable" type hint | chillerlan_php-database | train | php |
49eb7526d6bd8a7df669d27b13d16c960c233f04 | diff --git a/tests/UriTemplateTest.php b/tests/UriTemplateTest.php
index <HASH>..<HASH> 100644
--- a/tests/UriTemplateTest.php
+++ b/tests/UriTemplateTest.php
@@ -119,7 +119,7 @@ class UriTemplateTest extends \PHPUnit_Framework_TestCase
*/
public function testExpandsUriTemplates($template, $expansion, $params)
{
- $uri = new UriTemplate($template);
+ $uri = new UriTemplate();
$this->assertEquals($expansion, $uri->expand($template, $params));
}
@@ -162,7 +162,7 @@ class UriTemplateTest extends \PHPUnit_Framework_TestCase
*/
public function testParsesExpressions($exp, $data)
{
- $template = new UriTemplate($exp);
+ $template = new UriTemplate();
// Access the config object
$class = new \ReflectionClass($template); | Fix UriTemplate does not have constructor args | guzzle_guzzle | train | php |
87ab0362e4a6aff07c92a966a800f3455f73350a | diff --git a/src/exceptions/Handler.php b/src/exceptions/Handler.php
index <HASH>..<HASH> 100644
--- a/src/exceptions/Handler.php
+++ b/src/exceptions/Handler.php
@@ -25,8 +25,12 @@ class Handler {
*/
public static function error( $severity, $message, $file, $line ) {
+ // Latest Twig raises a warning when accessing missing cached views - we can ignore it
+ if( preg_match('/filemtime/', $message) )
+ return;
+
// if the error was a type hint failure then throw an InvalidArgumentException instead
- if( preg_match('/^Argument (\d+) passed to ([\w\\\\]+)::(\w+)\(\) must be an instance of ([\w\\\\]+), ([\w\\\\]+) given, called in ([\w\s\.\/_-]+) on line (\d+)/', $message, $m) )
+ elseif( preg_match('/^Argument (\d+) passed to ([\w\\\\]+)::(\w+)\(\) must be an instance of ([\w\\\\]+), ([\w\\\\]+) given, called in ([\w\s\.\/_-]+) on line (\d+)/', $message, $m) )
throw new \InvalidArgumentException("Argument {$m[1]} to {$m[2]}::{$m[3]}() should be an instance of {$m[4]}, {$m[5]} given", $severity, new \ErrorException($message, 0, $severity, $m[6], $m[7]));
// convert the error to an exception | Ignore stupid Twig warnings | gamernetwork_yolk-core | train | php |
dbcc1edbdc03e2e7bcc31ff9dd8516912ae12c38 | diff --git a/lib/fast-tcpn/tcpn.rb b/lib/fast-tcpn/tcpn.rb
index <HASH>..<HASH> 100644
--- a/lib/fast-tcpn/tcpn.rb
+++ b/lib/fast-tcpn/tcpn.rb
@@ -142,14 +142,8 @@ module FastTCPN
end
def add_marking_for(name, m)
- if m.kind_of? Hash
- token = m[:val]
- timestamp = m[:ts]
- find_place(name).add token, timestamp
- else
- token = m
- find_place(name).add token
- end
+ token = m
+ find_place(name).add token
end
private | Removed obsolete Hash handing form TCPN#add_marking_for | wrzasa_fast-tcpn | train | rb |
c0aad507f828b935a8fa6c74b69b6890f0791592 | diff --git a/src/Tonic/Request.php b/src/Tonic/Request.php
index <HASH>..<HASH> 100644
--- a/src/Tonic/Request.php
+++ b/src/Tonic/Request.php
@@ -98,6 +98,8 @@ class Request {
$uri = $options['uri'];
} elseif (isset($_SERVER['REDIRECT_URL']) && isset($_SERVER['SCRIPT_NAME'])) { // use redirection URL from Apache environment
$uri = substr($_SERVER['REDIRECT_URL'], strlen(dirname($_SERVER['SCRIPT_NAME'])));
+ } elseif (isset($_SERVER['REQUEST_URI']) && isset($_SERVER['SCRIPT_NAME'])) { // use redirection URL from Apache environment
+ $uri = substr($_SERVER['REQUEST_URI'], strlen($_SERVER['SCRIPT_NAME']));
} elseif (isset($_SERVER['QUERY_STRING'])) { // use querystring if not using redirection
if ($pos = strpos($_SERVER['QUERY_STRING'], '?')) {
$uri = substr($_SERVER['QUERY_STRING'], 0, $pos); | Use REQUEST_URI to get URI also | peej_tonic | train | php |
c8f287650928c8486e35a697b31e2863542fb5be | diff --git a/src/js/color.js b/src/js/color.js
index <HASH>..<HASH> 100644
--- a/src/js/color.js
+++ b/src/js/color.js
@@ -209,8 +209,8 @@
l: 1,
a: 1
};
- if (r.hasOwnProperty('s')) hsl.g = clamp(number(r.s), 255);
- if (r.hasOwnProperty('l')) hsl.b = clamp(number(r.l), 255);
+ if (r.hasOwnProperty('s')) hsl.s = clamp(number(r.s), 1);
+ if (r.hasOwnProperty('l')) hsl.l = clamp(number(r.l), 1);
if (r.hasOwnProperty('a')) hsl.a = clamp(number(r.a), 1);
this.rgb(hslToRgb(hsl));
@@ -492,7 +492,7 @@
r: hue(h + 1 / 3) * 255,
g: hue(h) * 255,
b: hue(h - 1 / 3) * 255,
- a: 1
+ a: a
};
return r; | * fix color constructor with hsl object. | easysoft_zui | train | js |
c9df87871332e5251e3160d88b0e12567b5451d0 | diff --git a/scripts/homestead.rb b/scripts/homestead.rb
index <HASH>..<HASH> 100644
--- a/scripts/homestead.rb
+++ b/scripts/homestead.rb
@@ -91,7 +91,10 @@ class Homestead
# Register All Of The Configured Shared Folders
if settings.include? 'folders'
settings["folders"].each do |folder|
- mount_opts = folder["type"] == "nfs" ? ['actimeo=1'] : []
+ mount_opts = []
+ if (folder["type"] == "nfs")
+ mount_opts = folder["mount_opts"] ? folder["mount_opts"] : ['actimeo=1']
+ end
config.vm.synced_folder folder["map"], folder["to"], type: folder["type"] ||= nil, mount_options: mount_opts
end
end | Adding the option of setting mount_opts on Homestead.yaml | laravel_homestead | train | rb |
9d4ea5be8ecc11f07d3ad5b27b2ad3e5581eb5d6 | diff --git a/pretrainedmodels/models/utils.py b/pretrainedmodels/models/utils.py
index <HASH>..<HASH> 100644
--- a/pretrainedmodels/models/utils.py
+++ b/pretrainedmodels/models/utils.py
@@ -4,7 +4,7 @@ from .resnext import pretrained_settings as resnext_settings
from .inceptionv4 import pretrained_settings as inceptionv4_settings
from .inceptionresnetv2 import pretrained_settings as inceptionresnetv2_settings
from .torchvision_models import pretrained_settings as torchvision_models_settings
-from .nasnet_mobile import pretrained_settings as nasnet_settings
+from .nasnet_mobile import pretrained_settings as nasnet_mobile_settings
from .nasnet import pretrained_settings as nasnet_settings
from .dpn import pretrained_settings as dpn_settings
from .xception import pretrained_settings as xception_settings
@@ -17,6 +17,7 @@ all_settings = [
inceptionv4_settings,
inceptionresnetv2_settings,
torchvision_models_settings,
+ nasnet_mobile_settings,
nasnet_settings,
dpn_settings,
xception_settings, | bugfix: nasnet mobile was not listed in pretrainedmodels.model_names | Cadene_pretrained-models.pytorch | train | py |
0df36658a5f74d0ba01aab09a41dffc09ce0e313 | diff --git a/steamfiles/appinfo.py b/steamfiles/appinfo.py
index <HASH>..<HASH> 100644
--- a/steamfiles/appinfo.py
+++ b/steamfiles/appinfo.py
@@ -179,6 +179,8 @@ class AppinfoDecoder:
return byte
def read_string(self):
+ # This method is pretty fast, provided we iterate over a memoryview.
+ # It's also easier to read then the most performant ones, which is more important.
for index, value in enumerate(self.data[self.offset:]):
# NUL-byte – a string's end
if value != 0: | Add a bit of an explanation to a string-parsing function | leovp_steamfiles | train | py |
1ac7fc21125ae8d19487b7cc881b8d8ee22a5093 | diff --git a/lib/agent/actions/lock/index.js b/lib/agent/actions/lock/index.js
index <HASH>..<HASH> 100644
--- a/lib/agent/actions/lock/index.js
+++ b/lib/agent/actions/lock/index.js
@@ -78,7 +78,7 @@ function open(password, cb) {
child = lock;
child.stdout.on('data', function(data) {
- if (child.impersonating && data.toString().match(/PID:? (\d+)/)) {
+ if (child && child.impersonating && data.toString().match(/PID:? (\d+)/)) {
child.impersonated_pid = data.toString().match(/PID:? (\d+)/)[1];
} else if (emitter && data.toString().match(/invalid password/i)) {
diff --git a/lib/system/index.js b/lib/system/index.js
index <HASH>..<HASH> 100644
--- a/lib/system/index.js
+++ b/lib/system/index.js
@@ -107,6 +107,8 @@ var as_logged_user = function(type, bin, args, opts, cb) {
if (typeof opts == 'function') {
var cb = opts;
var opts = {};
+ } else if (!opts) {
+ var opts = {};
}
system.get_logged_user(function(err, user) { | Two small validations in lock and system libs. | prey_prey-node-client | train | js,js |
9ad0eca0dfef882bd887e85d32da9bff3eedb6ac | diff --git a/src/Processes/Model.php b/src/Processes/Model.php
index <HASH>..<HASH> 100644
--- a/src/Processes/Model.php
+++ b/src/Processes/Model.php
@@ -35,7 +35,7 @@ class Model
public static function set($class , $table)
{
$txt = "<?php\n\nuse Vinala\Kernel\MVC\ORM;\n\n";
- $txt.="class $class extends ORM\n{\n\t/**\n\t* Name of the DataTable\n\t*/\n\tpublic static ".'$table'."='$table';\n\n}";
+ $txt.="class $class extends ORM\n{\n\t/**\n\t* Name of the DataTable\n\t*/\n\tpublic static ".'$_table'."='$table';\n\n}";
// $txt.="class $class extends ORM\n{\n\t//Name of the table in database\n\tpublic static ".'$table'."='$table';\n\tprotected static ".'$foreignKeys=array();'."\n\n}";
//
return $txt; | update table prop name to deal with new orm names | vinala_kernel | train | php |
6b60b8dcf5cd206a17842e08f1547310170c821c | diff --git a/buildprocess/configureWebpack.js b/buildprocess/configureWebpack.js
index <HASH>..<HASH> 100644
--- a/buildprocess/configureWebpack.js
+++ b/buildprocess/configureWebpack.js
@@ -183,7 +183,7 @@ function configureWebpack(terriaJSBasePath, config, devMode, hot) {
req.url.indexOf('/convert') < 0 &&
req.url.indexOf('/proxyabledomains') < 0 &&
req.url.indexOf('/errorpage') < 0 &&
- req.url.indexOf('/initfile') < 0) {
+ req.url.indexOf('/init') < 0) {
return req.originalUrl;
}
} | Make webpack server pass /init to normal server. | TerriaJS_terriajs | train | js |
e555ea3a225101c881e0de29e70c3d59386a9d1c | diff --git a/tests/test_localfs.py b/tests/test_localfs.py
index <HASH>..<HASH> 100644
--- a/tests/test_localfs.py
+++ b/tests/test_localfs.py
@@ -8,6 +8,7 @@ import stat
import sys
from unittest import TestCase
from abl.vpath.base import URI
+from .common import mac_only
#-------------------------------------------------------------------------------
@@ -50,6 +51,7 @@ class TestLocalFSInfo(TestCase):
self.assert_(p.info().mtime.timetuple()[:6] >= now.timetuple()[:6])
+ @mac_only
def test_info_on_symlinks(self):
a_file = URI("test.txt")
a_link = URI("test_link") | Only run symlink test on Mac OSX
Linux doesn't provide lchmod and we don't want to fail silently either. | AbletonAG_abl.vpath | train | py |
675d3c0e20dfc1d6cf6f5ba5b46741bd404c8be7 | diff --git a/lib/grape_entity/entity.rb b/lib/grape_entity/entity.rb
index <HASH>..<HASH> 100644
--- a/lib/grape_entity/entity.rb
+++ b/lib/grape_entity/entity.rb
@@ -153,7 +153,7 @@ module Grape
#
# @example as: a proc or lambda
#
- # object = OpenStruct(awesomness: 'awesome_key', awesome: 'not-my-key', other: 'other-key' )
+ # object = OpenStruct(awesomeness: 'awesome_key', awesome: 'not-my-key', other: 'other-key' )
#
# class MyEntity < Grape::Entity
# expose :awesome, as: proc { object.awesomeness } | Fix typo in comments in lib/grape_entity/entity.rb (#<I>) | ruby-grape_grape-entity | train | rb |
4c1f76eaab670ffa95d185374ea91f0d2e2818c7 | diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -1614,11 +1614,6 @@ MSG
self
end
- def initialize_clone(other)
- super
- @persisted = other.persisted?
- end
-
# Returns +true+ if the record is read only. Records loaded through joins with piggy-back
# attributes will be marked as read only since they cannot be saved.
def readonly? | initialize_clone can go away | rails_rails | train | rb |
ee613f6c37df97fcdac921d27602a01780a7e644 | diff --git a/config/Netcraft.php b/config/Netcraft.php
index <HASH>..<HASH> 100644
--- a/config/Netcraft.php
+++ b/config/Netcraft.php
@@ -26,6 +26,7 @@ return [
'Source',
'Date',
'Domain',
+ 'Ip',
],
],
@@ -39,6 +40,7 @@ return [
'Source',
'Date',
'Download-Link',
+ 'Ip',
],
],
],
diff --git a/src/Netcraft.php b/src/Netcraft.php
index <HASH>..<HASH> 100644
--- a/src/Netcraft.php
+++ b/src/Netcraft.php
@@ -136,4 +136,3 @@ class Netcraft extends Parser
return $this->success();
}
}
- | remove extra newline and protect IP field | AbuseIO_parser-netcraft | train | php,php |
8507e1d341723e956604b17a58a4485cb2db177e | diff --git a/lib/consts/consts.go b/lib/consts/consts.go
index <HASH>..<HASH> 100644
--- a/lib/consts/consts.go
+++ b/lib/consts/consts.go
@@ -8,7 +8,7 @@ import (
)
// Version contains the current semantic version of k6.
-var Version = "0.26.1" //nolint:gochecknoglobals
+var Version = "0.26.2" //nolint:gochecknoglobals
// VersionDetails can be set externally as part of the build process
var VersionDetails = "" // nolint:gochecknoglobals | Actually bump the version to <I> | loadimpact_k6 | train | go |
a3f163e2dc5ac66e1a426ce12568701a2d4ebc58 | diff --git a/Generator/Generator.php b/Generator/Generator.php
index <HASH>..<HASH> 100644
--- a/Generator/Generator.php
+++ b/Generator/Generator.php
@@ -4,7 +4,7 @@ namespace Admingenerator\GeneratorBundle\Generator;
use Symfony\Component\Finder\Finder;
use Symfony\Component\Routing\RouterInterface;
-use Symfony\Component\HttpKernel\HttpKernelInterface;
+use Symfony\Component\HttpKernel\KernelInterface;
use Admingenerator\GeneratorBundle\Validator\ValidatorInterface;
use Admingenerator\GeneratorBundle\Builder\Generator as AdminGenerator;
use Doctrine\Common\Cache as DoctrineCache;
@@ -78,7 +78,7 @@ abstract class Generator implements GeneratorInterface
protected $twig;
/**
- * @var HttpKernelInterface
+ * @var KernelInterface
*/
protected $kernel;
@@ -292,10 +292,10 @@ abstract class Generator implements GeneratorInterface
}
/**
- * @param HttpKernelInterface $kernel
+ * @param KernelInterface $kernel
* @return void
*/
- public function setKernel(HttpKernelInterface $kernel)
+ public function setKernel(KernelInterface $kernel)
{
$this->kernel = $kernel;
} | Update Generator.php
Fix scrutinizer issues | symfony2admingenerator_GeneratorBundle | train | php |
25fcb1ac146e8e107b12955a4b735147c5b51961 | diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js
index <HASH>..<HASH> 100644
--- a/src/nls/root/strings.js
+++ b/src/nls/root/strings.js
@@ -515,7 +515,7 @@ define({
"EXTENSION_NOT_INSTALLED" : "Couldn't remove extension {0} because it wasn't installed.",
"NO_EXTENSIONS" : "No extensions installed yet.<br>Click on the Available tab above to get started.",
"NO_EXTENSION_MATCHES" : "No extensions match your search.",
- "REGISTRY_SANITY_CHECK_WARNING" : "NOTE: These extensions may come from different authors than Brackets itself. Be cautious when installing extensions from an unknown source.",
+ "REGISTRY_SANITY_CHECK_WARNING" : "NOTE: These extensions may come from different authors than {APP_NAME} itself. Extensions are not reviewed and have full local privileges. Be cautious when installing extensions from an unknown source.",
"EXTENSIONS_INSTALLED_TITLE" : "Installed",
"EXTENSIONS_AVAILABLE_TITLE" : "Available",
"EXTENSIONS_UPDATES_TITLE" : "Updates", | Updated notice per comments and review. | adobe_brackets | train | js |
b2763fee200e523a91907f8418d16bd9966a4c77 | diff --git a/glue/ligolw/lsctables.py b/glue/ligolw/lsctables.py
index <HASH>..<HASH> 100644
--- a/glue/ligolw/lsctables.py
+++ b/glue/ligolw/lsctables.py
@@ -536,7 +536,7 @@ class ExperimentTable(table.Table):
"experiment_id": "ilwd:char",
"search_group": "lstring",
"search": "lstring",
- "lars_id": "ilwd:char",
+ "lars_id": "lstring",
"instruments": "lstring",
"gps_start_time": "int_4s",
"gps_end_time": "int_4s", | Changed lars_id in experiment table to lstring. | gwastro_pycbc-glue | train | py |
f9b72505fb101db83581c5fce08e7a4a8b7660b0 | diff --git a/superset/config.py b/superset/config.py
index <HASH>..<HASH> 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -656,7 +656,7 @@ DISPLAY_MAX_ROW = 10000
# Default row limit for SQL Lab queries. Is overridden by setting a new limit in
# the SQL Lab UI
-DEFAULT_SQLLAB_LIMIT = 10000
+DEFAULT_SQLLAB_LIMIT = 1000
# Maximum number of tables/views displayed in the dropdown window in SQL Lab.
MAX_TABLE_NAMES = 3000 | fix: revert DEFAULT_SQLLAB_LIMIT to default (#<I>) | apache_incubator-superset | train | py |
f9be4410e4bae7949bf4a69b7d2918834433cb3a | diff --git a/lib/origami/graphics/xobject.rb b/lib/origami/graphics/xobject.rb
index <HASH>..<HASH> 100644
--- a/lib/origami/graphics/xobject.rb
+++ b/lib/origami/graphics/xobject.rb
@@ -666,15 +666,15 @@ module Origami
raise ArgumentError, "Missing file format" if format.nil?
case format.downcase
- when 'jpg', 'jpeg', 'jpe', 'jif', 'jfif', 'jfi'
+ when '.jpg', 'jpeg', '.jpe', '.jif', '.jfif', '.jfi'
image.setFilter :DCTDecode
image.encoded_data = data
- when 'jp2','jpx','j2k','jpf','jpm','mj2'
+ when '.jp2','.jpx','.j2k','.jpf','.jpm','.mj2'
image.setFilter :JPXDecode
image.encoded_data = data
- when 'jb2', 'jbig', 'jbig2'
+ when '.jb2', '.jbig', '.jbig2'
image.setFilter :JBIG2Decode
image.encoded_data = data
else | graphics/xobject: fix extensions in from_image_file | gdelugre_origami | train | rb |
028e580bb85b4daa660b037b9ba686f877740c4c | diff --git a/lib/jekyll/site.rb b/lib/jekyll/site.rb
index <HASH>..<HASH> 100644
--- a/lib/jekyll/site.rb
+++ b/lib/jekyll/site.rb
@@ -23,12 +23,12 @@ module Jekyll
self.pygments = config['pygments']
self.baseurl = config['baseurl']
self.permalink_style = config['permalink'].to_sym
- self.exclude = config['exclude'] || []
- self.include = config['include'] || []
+ self.exclude = config['exclude']
+ self.include = config['include']
self.future = config['future']
- self.show_drafts = config['show_drafts'] || nil
- self.limit_posts = config['limit_posts'] || nil
- self.keep_files = config['keep_files'] || []
+ self.show_drafts = config['show_drafts']
+ self.limit_posts = config['limit_posts']
+ self.keep_files = config['keep_files']
self.reset
self.setup | Remove short-circuits from Site | jekyll_jekyll | train | rb |
1297c23622ef7d4799f0b810371303c78acf6eb0 | diff --git a/src/ef-version.py b/src/ef-version.py
index <HASH>..<HASH> 100755
--- a/src/ef-version.py
+++ b/src/ef-version.py
@@ -597,7 +597,7 @@ def cmd_set(context):
print("would set key: {} with value: {} {} {} {} {}".format(s3_key, context.value, context.build_number, context.commit_hash, context.location, s3_version_status))
else:
context.aws_client("s3").put_object(
- ACL = 'bucket-owner-read',
+ ACL = 'bucket-owner-full-control',
Body = context.value,
Bucket = EFConfig.S3_VERSION_BUCKET,
ContentEncoding = EFConfig.S3_VERSION_CONTENT_ENCODING, | Changing ef-version s3 policy to have object be bucket-owner-full-control (#<I>) | crunchyroll_ef-open | train | py |
fa66f1aa3496a45a61d2da221337b5ee7c674f3f | diff --git a/models/classes/preview/ItemPreviewerService.php b/models/classes/preview/ItemPreviewerService.php
index <HASH>..<HASH> 100644
--- a/models/classes/preview/ItemPreviewerService.php
+++ b/models/classes/preview/ItemPreviewerService.php
@@ -72,10 +72,7 @@ class ItemPreviewerService extends ConfigurableService
$config = $registry->get(self::REGISTRY_ENTRY_KEY);
}
- if (isset($config[self::PREVIEWERS_KEY])) {
- return $config[self::PREVIEWERS_KEY];
- }
- return [];
+ return $config[self::PREVIEWERS_KEY] ?? [];
}
/**
@@ -90,10 +87,7 @@ class ItemPreviewerService extends ConfigurableService
$config = $registry->get(self::REGISTRY_ENTRY_KEY);
}
- if (isset($config[self::PLUGINS_KEY])) {
- return $config[self::PLUGINS_KEY];
- }
- return [];
+ return $config[self::PLUGINS_KEY] ?? [];
}
/** | refactor: use null coalescing operator | oat-sa_extension-tao-item | train | php |
24166ed9d4927e188216b576445d65351e876c34 | diff --git a/init.js b/init.js
index <HASH>..<HASH> 100644
--- a/init.js
+++ b/init.js
@@ -1,5 +1,5 @@
"use strict";
-var mode = 'dev';
+var mode = process.env['ROADS_ENV'] || 'dev';
var Models = require('roads-models');
require('./libs/roadsmodelpromise.js').mixin(Models.ModelRequest.prototype);
@@ -113,4 +113,4 @@ module.exports.webserver = function (fn) {
}
return server;
-};
\ No newline at end of file
+};
diff --git a/server.js b/server.js
index <HASH>..<HASH> 100644
--- a/server.js
+++ b/server.js
@@ -5,11 +5,6 @@
* MIT Licensed
*/
-// This file sucks. Todo: make this suck less
-
-var mode = 'dev';
-//var mode = 'prod';
-
var init = require('./init');
init.config(); | allow environment to be defined through the ROADS_ENV variable | Dashron_roads | train | js,js |
bb3cbfb9f71cba41983b25ce977aa29c22cafce0 | diff --git a/lib/transit/rolling_cache.rb b/lib/transit/rolling_cache.rb
index <HASH>..<HASH> 100644
--- a/lib/transit/rolling_cache.rb
+++ b/lib/transit/rolling_cache.rb
@@ -51,15 +51,11 @@ module Transit
def encache(name)
clear if cache_full?
- if existing_key = @value_to_key[name]
- existing_key
- else
- encode_key(@key_to_value.size).tap do |key|
- @key_to_value[key] = name
- @value_to_key[name] = key
- end
- name
- end
+ @value_to_key[name] || begin
+ key = encode_key(@key_to_value.size)
+ @value_to_key[name] = key
+ @key_to_value[key] = name
+ end
end
def encode_key(i) | slightly cleaner, no faster or slower (again) | cognitect_transit-ruby | train | rb |
b36926d8d965190767fbc4937d8466bdad95fb35 | diff --git a/python-package/lightgbm/basic.py b/python-package/lightgbm/basic.py
index <HASH>..<HASH> 100644
--- a/python-package/lightgbm/basic.py
+++ b/python-package/lightgbm/basic.py
@@ -803,7 +803,7 @@ class Dataset(object):
assert num_data == len(used_indices)
for i in range_(len(used_indices)):
for j in range_(predictor.num_class):
- sub_init_score[i * redictor.num_class + j] = init_score[used_indices[i] * redictor.num_class + j]
+ sub_init_score[i * predictor.num_class + j] = init_score[used_indices[i] * predictor.num_class + j]
init_score = sub_init_score
if predictor.num_class > 1:
# need to regroup init_score | [python] Variable Typo: redictor -> predictor (#<I>)
I believe that this should be a typo, right? | Microsoft_LightGBM | train | py |
de8c253b49f793ea85644610ca0cdef0cf4d024a | diff --git a/src/service/translate.js b/src/service/translate.js
index <HASH>..<HASH> 100644
--- a/src/service/translate.js
+++ b/src/service/translate.js
@@ -532,6 +532,7 @@ function $translate($STORAGE_KEY, $windowProvider, $translateSanitizationProvide
return $storageKey;
}
$storageKey = key;
+ return this;
};
this.storageKey = storageKey; | fix(service): make provider's storageKey chainable
Solves #<I> | angular-translate_angular-translate | train | js |
cebfc170c2cc887122c5ffee9c2e48e4ada6140a | diff --git a/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java b/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java
index <HASH>..<HASH> 100755
--- a/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java
+++ b/client/src/main/java/com/orientechnologies/orient/client/remote/OStorageRemote.java
@@ -1799,6 +1799,14 @@ public class OStorageRemote extends OStorageAbstract implements OStorageProxy {
}
OLogManager.instance().error(this, "Can not open database with url " + currentURL, e);
+ } catch (OOfflineNodeException e) {
+ if (network != null) {
+ // REMOVE THE NETWORK CONNECTION IF ANY
+ engine.getConnectionManager().remove(network);
+ network = null;
+ }
+
+ OLogManager.instance().error(this, "Can not open database with url " + currentURL, e);
} catch (OSecurityException ex) {
OLogManager.instance().debug(this, "Invalidate token for url=%s", ex, currentURL);
tokens.remove(currentURL); | add offline node handling on reopen operation | orientechnologies_orientdb | train | java |
f5fa5dd0a1ef00e48b7d114510e115d322dbd01b | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -29,7 +29,7 @@
}
}
} else if (argType === 'object') {
- if (arg.toString === Object.prototype.toString) {
+ if (!arg.hasOwnProperty('toString')) {
for (var key in arg) {
if (hasOwn.call(arg, key) && arg[key]) {
classes.push(key); | Bugfix - Class names being returned as [object Object]
Updated to use `hasOwnProperty` over trying to compare the Object prototype which fails with some build pipelines after transpilation. See issue #<I>. | JedWatson_classnames | train | js |
f4be993e5e7188943ebf61599d8e209b70c704bc | diff --git a/doc/source/conf.py b/doc/source/conf.py
index <HASH>..<HASH> 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -18,7 +18,7 @@ import os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
-#sys.path.insert(0, os.path.abspath('.'))
+sys.path.insert(0, os.path.abspath('../../'))
# -- General configuration ------------------------------------------------ | Enh: Doc - Make compilation work on rtd | Alignak-monitoring_alignak | train | py |
2a0587c772b2f3ce475a2e54aa3ef410bef87271 | diff --git a/src/Sham/DataGenerator.php b/src/Sham/DataGenerator.php
index <HASH>..<HASH> 100644
--- a/src/Sham/DataGenerator.php
+++ b/src/Sham/DataGenerator.php
@@ -466,6 +466,22 @@ class DataGenerator
}
/**
+ * Generates and adds fake data for a choice attribute on a entity.
+ *
+ * @param EntityInterface $entity an instance of the entity to fill with fake data.
+ * @param AttributeInterface $attribute an instance of the Choice to fill with fake data.
+ * @param array $options array of options to customize fake data creation.
+ *
+ * @return void
+ */
+ protected function addChoice(EntityInterface $entity, AttributeInterface $attribute, array $options = array())
+ {
+ $allowed_values = $attribute->getOption('allowed_values');
+ $choice = $allowed_values[array_rand($allowed_values)];
+ $this->setValue($entity, $attribute, $choice, $options);
+ }
+
+ /**
* Generates and adds fake data for a KeyValue on a entity.
*
* @param EntityInterface $entity an instance of the entity to fill with fake data. | Support for Choice in DataGenerator | honeybee_trellis | train | php |
7833ad328de91ded4ed9b58e34301a17bf8fe444 | diff --git a/Neos.Flow/Classes/Core/Bootstrap.php b/Neos.Flow/Classes/Core/Bootstrap.php
index <HASH>..<HASH> 100644
--- a/Neos.Flow/Classes/Core/Bootstrap.php
+++ b/Neos.Flow/Classes/Core/Bootstrap.php
@@ -547,7 +547,7 @@ class Bootstrap
}
define('FLOW_ONLY_COMPOSER_LOADER', $onlyUseComposerAutoLoaderForPackageClasses);
- define('FLOW_VERSION_BRANCH', '5.1');
+ define('FLOW_VERSION_BRANCH', '5.2');
define('FLOW_APPLICATION_CONTEXT', (string)$this->context);
} | BUGFIX: Set FLOW_VERSION_BRANCH to <I> | neos_flow-development-collection | train | php |
1fb9b21c119bc6aedb7b9272fff9fdf1a0c8a781 | diff --git a/src/Hodor/MessageQueue/Adapter/Amqp/Factory.php b/src/Hodor/MessageQueue/Adapter/Amqp/Factory.php
index <HASH>..<HASH> 100644
--- a/src/Hodor/MessageQueue/Adapter/Amqp/Factory.php
+++ b/src/Hodor/MessageQueue/Adapter/Amqp/Factory.php
@@ -17,7 +17,7 @@ class Factory implements FactoryInterface
/**
* @var ChannelFactory
*/
- private $channel_manager;
+ private $channel_factory;
/**
* @var Consumer[]
@@ -69,11 +69,11 @@ class Factory implements FactoryInterface
public function disconnectAll()
{
- if (!$this->channel_manager) {
+ if (!$this->channel_factory) {
return;
}
- $this->channel_manager->disconnectAll();
+ $this->channel_factory->disconnectAll();
}
/**
@@ -81,12 +81,12 @@ class Factory implements FactoryInterface
*/
private function getChannelFactory()
{
- if ($this->channel_manager) {
- return $this->channel_manager;
+ if ($this->channel_factory) {
+ return $this->channel_factory;
}
- $this->channel_manager = new ChannelFactory($this->config);
+ $this->channel_factory = new ChannelFactory($this->config);
- return $this->channel_manager;
+ return $this->channel_factory;
}
} | Rename channel manager variable to be consistent
The object is called channel factory everywhere else, and I think
'channel manager' is a relic from the past | hold-the-door_ravens | train | php |
b5d1ff03c407c8e3c8f10819c990c6e538440e88 | diff --git a/cutlass/cf.go b/cutlass/cf.go
index <HASH>..<HASH> 100644
--- a/cutlass/cf.go
+++ b/cutlass/cf.go
@@ -184,11 +184,16 @@ func CountBuildpack(language string) (int, error) {
}
func CreateOrUpdateBuildpack(language, file, stack string) error {
- if err := createBuildpack(language, file); err != nil {
- return UpdateBuildpack(language, file, stack)
+ count, err := CountBuildpack(language)
+ if err != nil {
+ return err
}
- return nil
+ if count == 0 {
+ return createBuildpack(language, file)
+ }
+
+ return UpdateBuildpack(language, file, stack)
}
func (a *App) ConfirmBuildpack(version string) error { | Corrects create/update buildpack logic
Should always update, and only create if it does not exist | cloudfoundry_libbuildpack | train | go |
f242ae16d3a59fe0204d90c165c0fb493721f2dd | diff --git a/src/Core/Database/Exporter/MysqlExporter.php b/src/Core/Database/Exporter/MysqlExporter.php
index <HASH>..<HASH> 100644
--- a/src/Core/Database/Exporter/MysqlExporter.php
+++ b/src/Core/Database/Exporter/MysqlExporter.php
@@ -80,12 +80,15 @@ class MysqlExporter extends AbstractExporter
* @param $table
*
* @return mixed|null|string
+ *
+ * @throws \InvalidArgumentException
+ * @throws \RuntimeException
*/
protected function getInserts($table)
{
- $db = $this->db;
- $query = $db->getQuery(true);
- $iterator = $db->getReader($query->select('*')->from($table))->getIterator();
+ $db = $this->db;
+ $query = $db->getQuery(true);
+ $iterator = $db->getReader($query->select('*')->from($table))->getIterator();
if (!count($iterator))
{
@@ -101,7 +104,7 @@ class MysqlExporter extends AbstractExporter
$data = array_map(
function($d) use ($query)
{
- return $query->q($d);
+ return $query->q($d) ? : 'NULL';
},
$data
); | Fix Export SQL cannot restore #<I> | ventoviro_windwalker-core | train | php |
e441557ee90e1b93ac1f42ab8904845fd8d6e637 | diff --git a/rpc_util.go b/rpc_util.go
index <HASH>..<HASH> 100644
--- a/rpc_util.go
+++ b/rpc_util.go
@@ -685,23 +685,17 @@ func rpcInfoFromContext(ctx context.Context) (s *rpcInfo, ok bool) {
// Code returns the error code for err if it was produced by the rpc system.
// Otherwise, it returns codes.Unknown.
//
-// Deprecated: use status.FromError and Code method instead.
+// Deprecated: use status.Code instead.
func Code(err error) codes.Code {
- if s, ok := status.FromError(err); ok {
- return s.Code()
- }
- return codes.Unknown
+ return status.Code(err)
}
// ErrorDesc returns the error description of err if it was produced by the rpc system.
// Otherwise, it returns err.Error() or empty string when err is nil.
//
-// Deprecated: use status.FromError and Message method instead.
+// Deprecated: use status.Convert and Message method instead.
func ErrorDesc(err error) string {
- if s, ok := status.FromError(err); ok {
- return s.Message()
- }
- return err.Error()
+ return status.Convert(err).Message()
}
// Errorf returns an error containing an error code and a description; | rpc_util: update deprecated messages (#<I>)
The status package now has `Convert()` and `Code()` utilities.
This patch updates the deprecation description for `ErrorDesc()` and
`Code()` to recommend using those functions, and forward the deprecated
functions to use the `status.Code()` and `status.Convert()` functions. | grpc_grpc-go | train | go |
b594df1b467182a5a08679f97677f301c10d8b50 | diff --git a/src/main/java/org/fluentd/logger/Config.java b/src/main/java/org/fluentd/logger/Config.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/fluentd/logger/Config.java
+++ b/src/main/java/org/fluentd/logger/Config.java
@@ -17,8 +17,5 @@
//
package org.fluentd.logger;
-public class Config {
-
- public static final String FLUENT_SENDER_CLASS = "fluentd.logger.sender.class";
-
-}
\ No newline at end of file
+public class Config implements Constants {
+}
diff --git a/src/main/java/org/fluentd/logger/Constants.java b/src/main/java/org/fluentd/logger/Constants.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/fluentd/logger/Constants.java
+++ b/src/main/java/org/fluentd/logger/Constants.java
@@ -19,4 +19,8 @@ package org.fluentd.logger;
public interface Constants {
+ String FLUENT_SENDER_CLASS = "fluentd.logger.sender.class";
+
+ String FLUENT_RECONNECTOR_CLASS = "fluentd.logger.reconnector.class";
+
} | changed Config and Constants classes | fluent_fluent-logger-java | train | java,java |
7bd8a47be85ff7a02d1fa6692d314a1fa45540cc | diff --git a/l/tests/test_core.py b/l/tests/test_core.py
index <HASH>..<HASH> 100644
--- a/l/tests/test_core.py
+++ b/l/tests/test_core.py
@@ -3,23 +3,7 @@ from unittest import TestCase
from bp.memory import MemoryFS, MemoryPath
-from l.core import ls, show
-
-
-class TestLS(TestCase):
- def setUp(self):
- self.fs = MemoryFS()
- self.root = MemoryPath(fs=self.fs, path=("test-dir",))
- self.root.createDirectory()
-
- def test_it_lists_directories(self):
- one, two = self.root.child("one"), self.root.child("two")
- one.setContent("")
- two.setContent("")
-
- files = ls(path=self.root)
-
- self.assertEqual(files, [one, two])
+from l import core
class TestShow(TestCase):
@@ -30,7 +14,7 @@ class TestShow(TestCase):
def assertShows(self, result, **kwargs):
self.assertEqual(
- show(**kwargs),
+ core.show(**kwargs),
dedent(result).strip("\n") + "\n",
) | Remove this for now, it's useless. | Julian_L | train | py |
45eff8fc961ff6f1959b52208fa9ad0cd1acf953 | diff --git a/example/elements.js b/example/elements.js
index <HASH>..<HASH> 100644
--- a/example/elements.js
+++ b/example/elements.js
@@ -10,6 +10,11 @@ regl.clear({
depth: 1
})
+var lineWidth = 3
+if (lineWidth > regl.limits.lineWidthDims[1]) {
+ lineWidth = regl.limits.lineWidthDims[1]
+}
+
regl({
frag: `
precision mediump float;
@@ -49,5 +54,5 @@ regl({
[3, 4]
],
- lineWidth: 3
+ lineWidth: lineWidth
})()
diff --git a/example/graph.js b/example/graph.js
index <HASH>..<HASH> 100644
--- a/example/graph.js
+++ b/example/graph.js
@@ -362,6 +362,11 @@ const renderPoints = regl({
elements: null
})
+var lineWidth = 2
+if (lineWidth > regl.limits.lineWidthDims[1]) {
+ lineWidth = regl.limits.lineWidthDims[1]
+}
+
const renderEdges = regl({
vert: `
precision highp float;
@@ -402,7 +407,7 @@ const renderEdges = regl({
depth: {enable: false, mask: false},
count: ARCS.length,
primitive: 'lines',
- lineWidth: 2
+ lineWidth: lineWidth
})
const splatMouse = regl({ | Fix so that 'elements' and 'graph' respect the max lineWidth of the device. | regl-project_regl | train | js,js |
14a06c52474999e4ef1775d803cf6c3e8eb5410d | diff --git a/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java b/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java
index <HASH>..<HASH> 100644
--- a/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java
+++ b/aws-java-sdk-sqs/src/main/java/com/amazonaws/services/sqs/buffered/QueueBuffer.java
@@ -174,6 +174,8 @@ class QueueBuffer {
rq, callback);
future.setBuffer(this);
return future;
+ } else if (handler != null) {
+ return realSqs.receiveMessageAsync(rq, handler);
} else {
return realSqs.receiveMessageAsync(rq);
} | When bypassing buffered receives, pass through the AsyncHandler to receiveMessageAsync if present. | aws_aws-sdk-java | train | java |
547073e7e96bb3c7e0702021d8523306b6cda22c | diff --git a/src/Auth/User/Provider.php b/src/Auth/User/Provider.php
index <HASH>..<HASH> 100644
--- a/src/Auth/User/Provider.php
+++ b/src/Auth/User/Provider.php
@@ -9,13 +9,13 @@ final class Provider implements \Illuminate\Contracts\Auth\UserProvider, \Auth0\
/**
* A repository instance.
*/
- private Repository $repository;
+ private \Auth0\Laravel\Contract\Auth\User\Repository $repository;
/**
* @inheritdoc
*/
public function __construct(
- \Auth0\Laravel\Auth\User\Repository $repository
+ \Auth0\Laravel\Contract\Auth\User\Repository $repository
) {
$this->repository = $repository;
} | Update `Auth\User\Provider::__construct()` to accept a Repository Interface, rather than Class (#<I>) | auth0_laravel-auth0 | train | php |
90b7d8f2e05e30e8b495764d788a095ec3ef36b7 | diff --git a/tests/unit/Dotenv_FileTest.php b/tests/unit/Dotenv_FileTest.php
index <HASH>..<HASH> 100644
--- a/tests/unit/Dotenv_FileTest.php
+++ b/tests/unit/Dotenv_FileTest.php
@@ -54,7 +54,9 @@ class Dotenv_FileTest extends PHPUnit_Framework_TestCase
*/
public function it_throws_an_exception_if_the_file_is_not_writable()
{
- Dotenv_File::writable($this->get_fixture_path('env-unwritable'));
+ $filepath = $this->get_fixture_path('env-unwritable');
+ chmod($filepath, 0444);
+ Dotenv_File::writable($filepath);
}
/** | ensure file is not writable in test | aaemnnosttv_wp-cli-dotenv-command | train | php |
ae53f17b2a439dbd21269caaf010e774b0551acd | diff --git a/lib/tower_cli/resources/group.py b/lib/tower_cli/resources/group.py
index <HASH>..<HASH> 100644
--- a/lib/tower_cli/resources/group.py
+++ b/lib/tower_cli/resources/group.py
@@ -226,6 +226,20 @@ class Resource(models.Resource):
isid = self._get_inventory_source_id(group)
return isrc.update(isid, monitor=monitor, timeout=timeout, **kwargs)
+ @resources.command(use_fields_as_options=False)
+ @click.option('--group', type=types.Related('group'))
+ @click.option('--parent', type=types.Related('group'))
+ def associate(self, group, parent):
+ """Associate this group with the specified group."""
+ return self._assoc('children', parent, group)
+
+ @resources.command(use_fields_as_options=False)
+ @click.option('--group', type=types.Related('group'))
+ @click.option('--parent', type=types.Related('group'))
+ def disassociate(self, group, parent):
+ """Disassociate this group from the specified group."""
+ return self._disassoc('children', parent, group)
+
def _get_inventory_source_id(self, group):
"""Return the inventory source ID given a group dictionary returned
from the Tower API. | Allow associate/disassociate on group to allow for child groups. | ansible_tower-cli | train | py |
0747f74dfbfc94a846cae63d9c01351560e3ad43 | diff --git a/internal/services/automation/automation_account_data_source.go b/internal/services/automation/automation_account_data_source.go
index <HASH>..<HASH> 100644
--- a/internal/services/automation/automation_account_data_source.go
+++ b/internal/services/automation/automation_account_data_source.go
@@ -51,7 +51,7 @@ func dataSourceAutomationAccountRead(d *pluginsdk.ResourceData, meta interface{}
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()
- id := parse.NewAutomationAccountID(client.SubscriptionID, d.Get("name").(string), d.Get("resource_group_name").(string))
+ id := parse.NewAutomationAccountID(client.SubscriptionID, d.Get("resource_group_name").(string), d.Get("name").(string))
resp, err := client.Get(ctx, id.ResourceGroup, id.Name)
if err != nil { | Automation datasource initialization
Invert resource group name and account name for datasource Automation account to fix an not found error. | terraform-providers_terraform-provider-azurerm | train | go |
17011bca318e6e08c89db1efe14fa93e7cd4c25c | diff --git a/src/Html5Video/Html5Video.php b/src/Html5Video/Html5Video.php
index <HASH>..<HASH> 100644
--- a/src/Html5Video/Html5Video.php
+++ b/src/Html5Video/Html5Video.php
@@ -64,7 +64,7 @@ class Html5Video {
* @param object $cache Cache object to store ffmpeg settings
*/
function __construct($config = array(), $process = null, $cache = null) {
- $this->config = array_merge((array) $config, $this->defaults);
+ $this->config = array_merge($this->defaults, (array) $config);
$this->config['profile.dirs'] = (array) $this->config['profile.dirs'];
$this->config['profile.dirs'][] = __DIR__ . DIRECTORY_SEPARATOR . 'Profiles'; | Fix config merging in constructor | xemle_html5-video-php | train | php |
5cd4430a8db82727b6690776302a50a8b80b610d | diff --git a/swarm/api/http/server.go b/swarm/api/http/server.go
index <HASH>..<HASH> 100644
--- a/swarm/api/http/server.go
+++ b/swarm/api/http/server.go
@@ -115,7 +115,11 @@ func handler(w http.ResponseWriter, r *http.Request, a *api.Api) {
switch {
case r.Method == "POST" || r.Method == "PUT":
- key, err := a.Store(r.Body, r.ContentLength, nil)
+ if r.Header.Get("content-length") == "" {
+ http.Error(w, "Missing Content-Length header in request.", http.StatusBadRequest)
+ return
+ }
+ key, err := a.Store(io.LimitReader(r.Body, r.ContentLength), r.ContentLength, nil)
if err == nil {
glog.V(logger.Debug).Infof("Content for %v stored", key.Log())
} else { | swarm/api/http: reject requests without content-length | ethereum_go-ethereum | train | go |
be8550e4037f84bbb72ca1783d9e51030dff1124 | diff --git a/bids/variables/io.py b/bids/variables/io.py
index <HASH>..<HASH> 100644
--- a/bids/variables/io.py
+++ b/bids/variables/io.py
@@ -365,7 +365,7 @@ def _load_tsv_variables(layout, suffix, dataset=None, columns=None,
for f in files:
- _data = pd.read_csv(f.path, sep='\t')
+ _data = f.get_df(include_timing=False)
# Entities can be defined either within the first column of the .tsv
# file (for entities that vary by row), or from the full file path | load DFs via BIDSDataFile; closes #<I> | bids-standard_pybids | train | py |
9e399b02fa3d110a04965505de362e4c258d5e3f | diff --git a/src/Elcodi/CurrencyBundle/Entity/Money.php b/src/Elcodi/CurrencyBundle/Entity/Money.php
index <HASH>..<HASH> 100644
--- a/src/Elcodi/CurrencyBundle/Entity/Money.php
+++ b/src/Elcodi/CurrencyBundle/Entity/Money.php
@@ -77,6 +77,10 @@ class Money extends StubMoney implements MoneyInterface
*/
public function setCurrency(CurrencyInterface $currency)
{
+ $this->wrappedMoney = new WrappedMoney(
+ $this->amount,
+ new WrappedCurrency($currency->getIso())
+ );
$this->currency = $currency;
return $this;
@@ -101,6 +105,12 @@ class Money extends StubMoney implements MoneyInterface
*/
public function setAmount($amount)
{
+ $amount = intval($amount);
+
+ $this->wrappedMoney = new WrappedMoney(
+ $amount,
+ new WrappedCurrency($this->currency->getIso())
+ );
$this->amount = $amount;
return $this;
@@ -113,6 +123,7 @@ class Money extends StubMoney implements MoneyInterface
*/
public function getAmount()
{
+ //var_dump($this->wrappedMoney->getAmount());
return $this->wrappedMoney->getAmount();
} | Setters for Money value object
Although setters for individual fields should not be allowed
in value objects, it was necessary to implement setCurrency and
setAmount in order to make the class collaborate with a Symfony
form types. Internally, the Form component uses setters to "attach" form
data to entity classes, so public setters were needed | elcodi_elcodi | train | php |
2216b2d70682b538409c121137d5e1cdc95351ef | diff --git a/lib/data_mapper/resource.rb b/lib/data_mapper/resource.rb
index <HASH>..<HASH> 100644
--- a/lib/data_mapper/resource.rb
+++ b/lib/data_mapper/resource.rb
@@ -350,13 +350,7 @@ module DataMapper
#-
# @api public
def repository(name = nil, &block)
- if name
- DataMapper.repository(name, &block)
- elsif Repository.context.last
- DataMapper.repository(nil, &block)
- else
- DataMapper.repository(default_repository_name, &block)
- end
+ DataMapper.repository( Repository.context.last ? nil : name || default_repository_name ,&block)
end
## | cleaned up Resource::ClassMethods#repository | datamapper_dm-core | train | rb |
da39c6ce553d7d14faae92835fee8f40ca204348 | diff --git a/pkg/setting/provider.go b/pkg/setting/provider.go
index <HASH>..<HASH> 100644
--- a/pkg/setting/provider.go
+++ b/pkg/setting/provider.go
@@ -49,6 +49,8 @@ type Provider interface {
// RegisterReloadHandler registers a handler for validation and reload
// of configuration updates tied to a specific section
RegisterReloadHandler(section string, handler ReloadHandler)
+ // IsFeatureToggleEnabled checks if the feature's toggle is enabled
+ IsFeatureToggleEnabled(name string) bool
}
// Section is a settings section copy
@@ -129,6 +131,10 @@ func (o *OSSImpl) Section(section string) Section {
func (OSSImpl) RegisterReloadHandler(string, ReloadHandler) {}
+func (o OSSImpl) IsFeatureToggleEnabled(name string) bool {
+ return o.Cfg.FeatureToggles[name]
+}
+
type keyValImpl struct {
key *ini.Key
} | Settings: Add a method to Provider interface to check if a feature is enabled (#<I>)
* Settings: Add method to Provider interface to get feature toggles
* Apply review comment | grafana_grafana | train | go |
47fe94f8fafab031065dfe8f46dbbb4b3f90ce47 | diff --git a/lib/chef/formatters/base.rb b/lib/chef/formatters/base.rb
index <HASH>..<HASH> 100644
--- a/lib/chef/formatters/base.rb
+++ b/lib/chef/formatters/base.rb
@@ -213,7 +213,7 @@ class Chef
end
def deprecation(message, location=caller(2..2)[0])
- Chef.log_deprecation("#{message} at #{location}")
+ Chef::Log.deprecation("#{message} at #{location}")
end
end | I think this was a bad search-and-replace, causes an infinite loop. | chef_chef | train | rb |
91ede1231d7558b03ca5ed994ef4f42f0e17cecb | diff --git a/tests/test_menu_launcher.py b/tests/test_menu_launcher.py
index <HASH>..<HASH> 100644
--- a/tests/test_menu_launcher.py
+++ b/tests/test_menu_launcher.py
@@ -273,22 +273,12 @@ def test_running_menu():
# go to logs menu
child.sendline('1')
child.expect('Return to System Commands menu')
- # go to containers menu
- child.sendline('1')
- child.expect('error')
- # kill child
- child.close()
- # create new child
- child1 = pexpect.spawn(cmd)
- child1.timeout = 600
- # expect Main Menu
- child1.expect('Exit')
- # go to System Commands
- child.sendline('5')
- child.expect('Return to Vent menu')
- # go to logs menu
- child.sendline('1')
- child.expect('Return to System Commands menu')
+
+ # # go to containers menu
+ # child.sendline('1')
+ # # curses blows up because the length of the menu exceeds the terminal size
+ # child.expect('error')
+
# go to namespace menu
child.sendline('2')
child.expect('Please select a namespace:') | identified issue with logs > container logs; commenting out until solved in menu_launcher. | CyberReboot_vent | train | py |
49f4288818fd42b2498a754b227ae14f286a9499 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1 +1 @@
-module.exports = new (require('./lib/logtrail'));
\ No newline at end of file
+module.exports = new (require('./lib/logtrail'));
diff --git a/lib/formatters/default.js b/lib/formatters/default.js
index <HASH>..<HASH> 100644
--- a/lib/formatters/default.js
+++ b/lib/formatters/default.js
@@ -15,13 +15,14 @@ exports.format = function (entry, type, args, stack) {
}
if (this._confs.timestamps && this._confs.timestamps.enabled) {
- now = ' ' + moment().format(this._confs.timestamps.format).grey;
+ now = moment().format(this._confs.timestamps.format).grey;
}
if (this._confs.stacktrace) {
- stacktrace = path.relative(this._confs.basedir, stack[0].getFileName()) + ':' + stack[0].getLineNumber();
+ stacktrace = path.relative(this._confs.basedir, stack[0].getFileName()) +
+ ':' + stack[0].getLineNumber();
stacktrace = stacktrace.grey;
}
- return util.format('%s%s %s\n', stacktrace, now, matter);
-}
\ No newline at end of file
+ return util.format('%s %s %s\n', now, stacktrace, matter);
+} | just some cosmetic changes to formatters
move along, nothing to see here | CastawayLabs_logtrail | train | js,js |
1fe1eaa1b63b7df0059438b90d79730251b665d4 | diff --git a/Tests/Functional/TestKernel.php b/Tests/Functional/TestKernel.php
index <HASH>..<HASH> 100644
--- a/Tests/Functional/TestKernel.php
+++ b/Tests/Functional/TestKernel.php
@@ -16,9 +16,9 @@ namespace Hackzilla\Bundle\TicketBundle\Tests\Functional;
use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use Hackzilla\Bundle\TicketBundle\HackzillaTicketBundle;
use Hackzilla\Bundle\TicketBundle\Model\TicketMessageWithAttachment;
-use Hackzilla\Bundle\TicketBundle\Tests\Functional\Entity\Ticket;
-use Hackzilla\Bundle\TicketBundle\Tests\Functional\Entity\TicketMessage;
-use Hackzilla\Bundle\TicketBundle\Tests\Functional\Entity\User;
+use Hackzilla\Bundle\TicketBundle\Tests\Fixtures\Entity\Ticket;
+use Hackzilla\Bundle\TicketBundle\Tests\Fixtures\Entity\TicketMessage;
+use Hackzilla\Bundle\TicketBundle\Tests\Fixtures\Entity\User;
use Knp\Bundle\PaginatorBundle\KnpPaginatorBundle;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; | Update use statements to reflect entities moved to fixtures | hackzilla_TicketBundle | train | php |
02f30f7bfcf835fcf5324e2dd7539bb45ba5517c | diff --git a/lib/providers/MongoDB.Provider.js b/lib/providers/MongoDB.Provider.js
index <HASH>..<HASH> 100644
--- a/lib/providers/MongoDB.Provider.js
+++ b/lib/providers/MongoDB.Provider.js
@@ -97,9 +97,11 @@ function MongoDB(config) {
// uniform error messages
this.missing_data_err = "Missing 'data' argument.";
- this.missing_data_id_err = "Missing 'data._id' property.";
+ this.missing_data_id_err = "Missing 'data._id' argument.";
this.missing_key_err = "Missing 'key' argument.";
this.missing_callback_err = "Missing 'callback' argument.";
+ this.callback_not_an_Object_err = "Argument 'data' must be of type Object.";
+ this.callback_not_an_Array_err = "Argument 'data' must be of type Array.";
this.callback_not_a_function_err = "Argument 'callback' must be of type Function.";
this.no_connection_err = "There is no open connection to the dabase server. Call connect function first."; | Renamed and added new error constant messages | Crafity_crafity-storage | train | js |
5b544964a72d37422d12183edae9f71a7dde0559 | diff --git a/Service/OS/AndroidGCMNotification.php b/Service/OS/AndroidGCMNotification.php
index <HASH>..<HASH> 100644
--- a/Service/OS/AndroidGCMNotification.php
+++ b/Service/OS/AndroidGCMNotification.php
@@ -49,11 +49,12 @@ class AndroidGCMNotification implements OSNotificationServiceInterface
* Constructor
*
* @param $apiKey
+ * @param MultiCurl $client (optional)
*/
- public function __construct($apiKey)
+ public function __construct($apiKey, MultiCurl $client = null)
{
$this->apiKey = $apiKey;
- $this->browser = new Browser(new MultiCurl());
+ $this->browser = new Browser($client ?: new MultiCurl());
}
/** | Allowing injecting a client
I've been having problems with GCM timeouts, this allows me to configure a
client with a reasonable timeout and inject it | richsage_RMSPushNotificationsBundle | train | php |
90fbbceeb2e0b5617ea8bec13d8ffeecf2669eb5 | diff --git a/src/Cyscon.php b/src/Cyscon.php
index <HASH>..<HASH> 100644
--- a/src/Cyscon.php
+++ b/src/Cyscon.php
@@ -1,6 +1,7 @@
<?php
namespace AbuseIO\Parsers;
+
use AbuseIO\Models\Incident;
/**
@@ -48,7 +49,7 @@ class Cyscon extends Parser
$report = array_combine($matches[1], $matches[2]);
if ($this->hasRequiredFields($report) === true) {
- // Event has all requirements met, filter and add!
+ // incident has all requirements met, filter and add!
$report = $this->applyFilters($report);
$report['domain'] = preg_replace('/^www\./', '', $report['domain']);
@@ -66,7 +67,7 @@ class Cyscon extends Parser
$incident->timestamp = strtotime($report['last_seen']);
$incident->information = json_encode($report);
- $this->events[] = $incident;
+ $this->incidents[] = $incident;
}
} else { // Unable to build report
$this->warningCount++; | refactor event to incident to prevent model confusion | AbuseIO_parser-cyscon | train | php |
ab17055a623b6e596c22481e42388459823ac6ff | diff --git a/replicaset/replicaset_test.go b/replicaset/replicaset_test.go
index <HASH>..<HASH> 100644
--- a/replicaset/replicaset_test.go
+++ b/replicaset/replicaset_test.go
@@ -400,9 +400,9 @@ func (s *MongoSuite) TestIsReadyMinority(c *gc.C) {
c.Check(ready, jc.IsFalse)
}
-func (s *MongoSuite) TestIsReadyConnectionDropped(c *gc.C) {
+func (s *MongoSuite) checkConnectionFailure(c *gc.C, failure error) {
s.PatchValue(&getCurrentStatus,
- func(session *mgo.Session) (*Status, error) { return nil, io.EOF },
+ func(session *mgo.Session) (*Status, error) { return nil, failure },
)
session := s.root.MustDial()
defer session.Close()
@@ -413,6 +413,10 @@ func (s *MongoSuite) TestIsReadyConnectionDropped(c *gc.C) {
c.Check(ready, jc.IsFalse)
}
+func (s *MongoSuite) TestIsReadyConnectionDropped(c *gc.C) {
+ s.checkConnectionFailure(c, io.EOF)
+}
+
func (s *MongoSuite) TestIsReadyError(c *gc.C) {
failure := errors.New("failed!")
s.PatchValue(&getCurrentStatus, | Factor out checkConnectionFailure. | juju_juju | train | go |
ef979dc782d99300f5c70d82f933cdd05071fac4 | diff --git a/html_text/html_text.py b/html_text/html_text.py
index <HASH>..<HASH> 100644
--- a/html_text/html_text.py
+++ b/html_text/html_text.py
@@ -138,7 +138,7 @@ def etree_to_text(tree,
def selector_to_text(sel, guess_punct_space=True, guess_layout=True):
- """ Convert a cleaned selector to text.
+ """ Convert a cleaned parsel.Selector to text.
See html_text.extract_text docstring for description of the approach
and options.
""" | DOC make it more explicit selector_to_text is parsel-specific | TeamHG-Memex_html-text | train | py |
589523c34bff1ded7dde6372a0300b78014d9029 | diff --git a/CHANGES.md b/CHANGES.md
index <HASH>..<HASH> 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -1,4 +1,4 @@
-0.11 (unreleased)
+0.11 (2018-11-14)
-----------------
- Fixed the home button in the toolbar to reset limits in addition to the
diff --git a/glue_vispy_viewers/version.py b/glue_vispy_viewers/version.py
index <HASH>..<HASH> 100644
--- a/glue_vispy_viewers/version.py
+++ b/glue_vispy_viewers/version.py
@@ -1 +1 @@
-__version__ = '0.11.dev0'
+__version__ = '0.11'
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -40,7 +40,7 @@ for subpackage in ['antialias', 'arrowheads', 'arrows', 'collections',
install_requires = ['numpy',
'pyopengl',
- 'glue-core>=0.12',
+ 'glue-core>=0.14',
'qtpy',
'scipy',
'astropy>=1.1', | Preparing release <I> | glue-viz_glue-vispy-viewers | train | md,py,py |
703f8a4240a71ec0db9d9bd19a3df2b0af37341d | diff --git a/src/I18n/TranslatorRegistry.php b/src/I18n/TranslatorRegistry.php
index <HASH>..<HASH> 100644
--- a/src/I18n/TranslatorRegistry.php
+++ b/src/I18n/TranslatorRegistry.php
@@ -145,7 +145,9 @@ class TranslatorRegistry extends TranslatorLocator
return $this->registry[$name][$locale] = $this->_getTranslator($name, $locale);
}
- $key = "translations.$name.$locale";
+ // Cache keys cannot contain / if they go to file engine.
+ $keyName = str_replace('/', '.', $name);
+ $key = "translations.{$keyName}.{$locale}";
$translator = $this->_cacher->get($key);
if (!$translator || !$translator->getPackage()) {
$translator = $this->_getTranslator($name, $locale); | Fix invalid key in TranslatorRegistry. | cakephp_cakephp | train | php |
67f258dd6aa63d7d3335dd5f36ac2ebc4635cc4d | diff --git a/src/ai-did-you-mean-this/setup.py b/src/ai-did-you-mean-this/setup.py
index <HASH>..<HASH> 100644
--- a/src/ai-did-you-mean-this/setup.py
+++ b/src/ai-did-you-mean-this/setup.py
@@ -44,8 +44,7 @@ setup(
# TODO: Update author and email, if applicable
author="Christopher O'Toole",
author_email='[email protected]',
- # TODO: consider pointing directly to your source code instead of the generic repo
- url='https://github.com/Azure/azure-cli-extensions/ai-did-you-mean-this',
+ url='https://github.com/Azure/azure-cli-extensions/tree/master/src/ai-did-you-mean-this',
long_description=README + '\n\n' + HISTORY,
license='MIT',
classifiers=CLASSIFIERS, | Fix broken URL in setup.py file (#<I>) | Azure_azure-cli-extensions | train | py |
07539820c364a50bd9da11a7c922b14a76b478f0 | diff --git a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
index <HASH>..<HASH> 100644
--- a/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
+++ b/smack-tcp/src/main/java/org/jivesoftware/smack/tcp/XMPPTCPConnection.java
@@ -1494,13 +1494,8 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
* </p>
*
* @param listener the listener to add.
- * @throws StreamManagementNotEnabledException if Stream Management is not enabled.
*/
- public void addStanzaAcknowledgedListener(PacketListener listener) throws StreamManagementNotEnabledException {
- // Prevent users from adding callbacks that will never get removed
- if (!smWasEnabledAtLeastOnce) {
- throw new StreamManagementException.StreamManagementNotEnabledException();
- }
+ public void addStanzaAcknowledgedListener(PacketListener listener) {
stanzaAcknowledgedListeners.add(listener);
} | Make addStanzaAck…Listener() not throw
users may want to add listeners before the connection is connected. The
comment was also wrong, those listeners never got auto removed. | igniterealtime_Smack | train | java |
104ab5c43f42abdb345d034bb8dbdf7f730c38d2 | diff --git a/quickbooks/objects/purchaseorder.py b/quickbooks/objects/purchaseorder.py
index <HASH>..<HASH> 100644
--- a/quickbooks/objects/purchaseorder.py
+++ b/quickbooks/objects/purchaseorder.py
@@ -50,6 +50,7 @@ class PurchaseOrder(DeleteMixin, QuickbooksManagedObject, QuickbooksTransactionE
self.DueDate = None
self.ExchangeRate = 1
self.GlobalTaxCalculation = "TaxExcluded"
+ self.Memo = None
self.TxnTaxDetail = None
self.VendorAddr = None | Added memo field
Memo field mapped to "Your message to vendor" in UI | sidecars_python-quickbooks | train | py |
54bfc428accf94e11c87492e0b0c652f4fcf9475 | diff --git a/app/models/manager_refresh/inventory_object.rb b/app/models/manager_refresh/inventory_object.rb
index <HASH>..<HASH> 100644
--- a/app/models/manager_refresh/inventory_object.rb
+++ b/app/models/manager_refresh/inventory_object.rb
@@ -4,7 +4,7 @@ module ManagerRefresh
attr_reader :inventory_collection, :data
delegate :manager_ref, :base_class_name, :model_class, :to => :inventory_collection
- delegate :[], :to => :data
+ delegate :[], :[]=, :to => :data
def initialize(inventory_collection, data)
@inventory_collection = inventory_collection
@@ -85,12 +85,6 @@ module ManagerRefresh
!inventory_collection.saved?
end
- def []=(key, value)
- data[key] = value
- inventory_collection.actualize_dependency(key, value)
- value
- end
-
def allowed_writers
return [] unless model_class | We don't need to actualize dependendencies per assignement
We don't need to actualize dependendencies per assignement, it's
being solved in the separate scanning step.
(transferred from ManageIQ/manageiq@5be<I>f7a0d<I>a<I>d9c1a<I>e3d<I>a4fb<I>b1) | ManageIQ_inventory_refresh | train | rb |
43215e6970e96b0de76bfbfb25ec09ce2bf5ecb2 | diff --git a/mockserver-core/src/main/java/org/mockserver/logging/MockServerLogger.java b/mockserver-core/src/main/java/org/mockserver/logging/MockServerLogger.java
index <HASH>..<HASH> 100644
--- a/mockserver-core/src/main/java/org/mockserver/logging/MockServerLogger.java
+++ b/mockserver-core/src/main/java/org/mockserver/logging/MockServerLogger.java
@@ -117,6 +117,7 @@ public class MockServerLogger {
}
public static boolean isEnabled(final Level level) {
- return logLevel() != null && level.toInt() >= logLevel().toInt();
+ return (logLevel() == null && level.toInt() >= Level.WARN.toInt())
+ || (logLevel() != null && level.toInt() >= logLevel().toInt());
}
} | ensured WARN and ERROR is logged even if logLevel not yet initialised | jamesdbloom_mockserver | train | java |
476f74cc194df0c2116e73d57a8be8af397626dc | diff --git a/lib/rescue_from_duplicate/active_record/extension.rb b/lib/rescue_from_duplicate/active_record/extension.rb
index <HASH>..<HASH> 100644
--- a/lib/rescue_from_duplicate/active_record/extension.rb
+++ b/lib/rescue_from_duplicate/active_record/extension.rb
@@ -45,7 +45,7 @@ module RescueFromDuplicate::ActiveRecord
def exception_handler(exception)
columns = exception_columns(exception)
return unless columns
- columns.sort!
+ columns = columns.sort
self.class._rescue_from_duplicate_handlers.detect do |handler|
handler.rescue? && columns == handler.columns | Do not mutate Active Record internal data | Shopify_activerecord-rescue_from_duplicate | train | rb |
b517dee21c726c90a084203bbbfe84a40b360fad | diff --git a/app/models/ample_assets/file.rb b/app/models/ample_assets/file.rb
index <HASH>..<HASH> 100644
--- a/app/models/ample_assets/file.rb
+++ b/app/models/ample_assets/file.rb
@@ -69,12 +69,12 @@ module AmpleAssets
:uid => attachment_uid,
:filename => attachment_name,
:document => is_doc? ? 'true' : 'false',
- :orientation => orientation,
+ :orientation => (is_image? ? orientation : nil),
:mime_type => attachment_mime_type,
:keywords => search_terms,
:url => attachment.url,
:gravity => attachment_gravity,
- :size => "#{attachment.width}x#{attachment.height}",
+ :size => (is_image? ? "#{attachment.width}x#{attachment.height}" : nil),
:sizes => { :tn => thumbnail, :md => medium }
}
end | Only reference orientation & dimensions for images. | ample_ample_assets | train | rb |
c67e1a641f4c72fea501804f0a3846678f412f20 | diff --git a/passphrase/calc.py b/passphrase/calc.py
index <HASH>..<HASH> 100644
--- a/passphrase/calc.py
+++ b/passphrase/calc.py
@@ -50,10 +50,6 @@ def entropy_bits(
# Some NumPy replacements
counts = [lst.count(x) for x in lst]
probs = [c / n_lst for c in counts]
- n_classes = len([x for x in probs if x != 0])
-
- if n_classes <= 1:
- return 0.0
# Compute entropy
entropy = 0.0 | Remove unused code from calc
That piece of code was not being used, and the condition never
reached: for `n_classes` to be <=1, `probs` had to be just 1
element because no element could ever be 0, given that each
element is a quotient, and the dividend is never 0. And for
`probs` to be just 1 element, `counts` should also be, which is
prevented by a previous check. | HacKanCuBa_passphrase-py | train | py |
e199a02c34d8098fac775d11980c8bb423a222c5 | diff --git a/src/htmlminifier.js b/src/htmlminifier.js
index <HASH>..<HASH> 100644
--- a/src/htmlminifier.js
+++ b/src/htmlminifier.js
@@ -76,7 +76,9 @@
function canRemoveAttributeQuotes(value) {
// http://mathiasbynens.be/notes/unquoted-attribute-values
- return (/^[^\x20\t\n\f\r"'`=<>]+$/).test(value) && !(/\/$/ ).test(value);
+ return (/^[^\x20\t\n\f\r"'`=<>]+$/).test(value) && !(/\/$/ ).test(value) &&
+ // make sure trailing slash is not interpreted as HTML self-closing tag
+ !(/\/$/).test(value);
}
function attributesInclude(attributes, attribute) { | Added a comment to make the reason behind the expression more verbose | kangax_html-minifier | train | js |
9097316eda854035caa5a3312856d21ffcfe5a9a | diff --git a/src/saml2/attribute_resolver.py b/src/saml2/attribute_resolver.py
index <HASH>..<HASH> 100644
--- a/src/saml2/attribute_resolver.py
+++ b/src/saml2/attribute_resolver.py
@@ -55,21 +55,18 @@ class AttributeResolver(object):
:return: A dictionary with all the collected information about the
subject
"""
- extended_identity = {}
+ result = []
for member in vo_members:
for ass in self.metadata.attribute_services(member):
for attr_serv in ass.attribute_service:
log and log.info("Send attribute request to %s" % \
attr_serv.location)
- (resp, issuer,
- not_on_or_after) = self.saml2client.attribute_query(
+ session_info = self.saml2client.attribute_query(
subject_id,
issuer,
attr_serv.location,
sp_name_qualifier=sp_name_qualifier,
format=name_id_format, log=log)
- if resp:
- # unnecessary
- del resp["__userid"]
- extended_identity[issuer] = (not_on_or_after, resp)
- return extended_identity
\ No newline at end of file
+ if session_info:
+ result.append(session_info)
+ return result
\ No newline at end of file | completed the update to follow changes in saml2.client | IdentityPython_pysaml2 | train | py |
b5d155a417ecd2967808285f14cfe9321b4523d7 | diff --git a/user/selector/lib.php b/user/selector/lib.php
index <HASH>..<HASH> 100644
--- a/user/selector/lib.php
+++ b/user/selector/lib.php
@@ -737,7 +737,6 @@ class group_members_selector extends groups_user_selector_base {
list($wherecondition, $params) = $this->search_sql($search, 'u');
list($sort, $sortparams) = users_order_by_sql('u', $search, $this->accesscontext);
- $orderby = ' ORDER BY ' . $sort;
$roles = groups_get_members_by_role($this->groupid, $this->courseid,
$this->required_fields_sql('u') . ', gm.component', | MDL-<I> gropus UI: delete unused var. | moodle_moodle | train | php |
9ccac531318ae1a4fd98a05bf5ef3e84f2891f42 | diff --git a/sos/plugins/lvm2.py b/sos/plugins/lvm2.py
index <HASH>..<HASH> 100644
--- a/sos/plugins/lvm2.py
+++ b/sos/plugins/lvm2.py
@@ -22,8 +22,8 @@ class Lvm2(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
plugin_name = 'lvm2'
option_list = [("lvmdump", 'collect an lvmdump tarball', 'fast', False),
- ("lvmdump-a", 'use the -a option of lvmdump (implies the ' \
- + '"lvmdump" option)', 'slow', False)]
+ ("lvmdump-am", 'use the -a -m options of lvmdump ' \
+ '(implies the "lvmdump" option)', 'slow', False)]
def do_lvmdump(self):
"""Collects an lvmdump in standard format with optional metadata | Make lvm2 plugin lvmdump option collect metadata
The lvmdump-a option currently collects 'advanced' data but not
raw metadata. Since it's off by default and the metadata is often
of interest in support cases rename the option to lvmdump-am and
have it also pass the '-m' (raw metadata) option to the lvmdump
script. | sosreport_sos | train | py |
Subsets and Splits