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 |
|---|---|---|---|---|---|
4a28917796a11f8d710e7e880ec414e9458c3eae | diff --git a/res/tests/axelitus/Base/TestsString.php b/res/tests/axelitus/Base/TestsString.php
index <HASH>..<HASH> 100644
--- a/res/tests/axelitus/Base/TestsString.php
+++ b/res/tests/axelitus/Base/TestsString.php
@@ -474,4 +474,16 @@ class TestsString extends TestCase
$output = strlen(String::trandom());
$this->assertEquals($expected, $output);
}
+
+ public function test_concat()
+ {
+ $expected = 'Winter is coming!';
+ $output = String::concat('Winter ', 'is ', 'coming', '!');
+ $this->assertEquals($expected, $output);
+
+ $expected = 'Some Winterfell characters from Game of Thrones are: Jon Snow, Ned Stark, Arya Stark, Robb Stark.';
+ $output = String::concat('Some Winterfell characters ', 'from Game of Thrones are: ', [
+ 'Jon Snow, ', 'Ned Stark, ', 'Arya Stark, ', 'Robb Stark.']);
+ $this->assertEquals($expected, $output);
+ }
} | Added the concat() function tests. | axelitus_php-base | train | php |
e755ff0593390fd4b896afa6fabd53b16af458aa | diff --git a/Tests/DependencyInjection/PayumExtensionTest.php b/Tests/DependencyInjection/PayumExtensionTest.php
index <HASH>..<HASH> 100644
--- a/Tests/DependencyInjection/PayumExtensionTest.php
+++ b/Tests/DependencyInjection/PayumExtensionTest.php
@@ -47,9 +47,8 @@ class PayumExtensionTest extends TestCase
{
$factory = $this->createMock(StorageFactoryInterface::class);
$factory
- ->expects($this->any())
->method('getName')
- ->will($this->returnValue('theFoo'))
+ ->willReturn('theFoo')
;
$extension = new PayumExtension;
@@ -73,7 +72,7 @@ class PayumExtensionTest extends TestCase
$factoryWithEmptyName
->expects($this->once())
->method('getName')
- ->will($this->returnValue(''))
+ ->willReturn('')
;
$extension = new PayumExtension;
@@ -91,7 +90,7 @@ class PayumExtensionTest extends TestCase
$factory
->expects($this->atLeastOnce())
->method('getName')
- ->will($this->returnValue('theFoo'))
+ ->willReturn('theFoo')
;
$extension = new PayumExtension; | test: upgrade phpunit to <I> | Payum_PayumBundle | train | php |
a8cf47c3e38d4bda9c550ddcfda3f7dbb46b1faa | diff --git a/lib/ui/UnsavedChangesDialog.js b/lib/ui/UnsavedChangesDialog.js
index <HASH>..<HASH> 100644
--- a/lib/ui/UnsavedChangesDialog.js
+++ b/lib/ui/UnsavedChangesDialog.js
@@ -55,10 +55,11 @@ function UnsavedChangesDialog (opts) {
self.on('show', function () { self.cancelButton.focus(); });
var saveAsForm = self.parent.saveAsForm;
var quit = function () { self.parent.quit(); };
+ var quitOnSubmit = function () { saveAsForm.once('save', quit); }
self.saveChangesButton.on('press', function () {
saveAsForm.show();
- saveAsForm.on('save', quit);
- saveAsForm.on('hide', saveAsForm.removeListener.bind(saveAsForm, 'save', quit));
+ saveAsForm.once('submit', quitOnSubmit);
+ saveAsForm.once('cancel', saveAsForm.removeListener.bind(saveAsForm, 'submit', quitOnSubmit));
});
self.quitAnywayButton.on('press', quit);
} | Quits when SaveAsForm saves after UnsavedChangesModal | slap-editor_slap | train | js |
878b59f4066687ff9236aa999fb1abf657ccf587 | diff --git a/app/extensions/Redirector/extension.php b/app/extensions/Redirector/extension.php
index <HASH>..<HASH> 100644
--- a/app/extensions/Redirector/extension.php
+++ b/app/extensions/Redirector/extension.php
@@ -106,13 +106,13 @@ namespace Redirector {
);
// Merge these with the actual configuration definitions
// in config.yml, which take precedence over the defaults
- $this->config = array_merge($config, $this->config);
+ $this['config'] = array_merge($config, $this['config']);
// Assign configuration groups to arrays in object
$configGroups = array('options', 'redirects', 'jits', 'variables');
foreach($configGroups as $group) {
- if (!empty($this->config[$group])) {
- $this->$group = $this->config[$group];
+ if (!empty($this['config'][$group])) {
+ $this->$group = $this['config'][$group];
} else {
// Take 'empty groups' from the .yml file into account.
$this->$group = array(); | Fixed failing unit test by manually pulling in another change from master :( | bolt_bolt | train | php |
866f39e312103dc7396eefc86e3f34cd85b6330e | diff --git a/src/Swarrot/Broker/Message.php b/src/Swarrot/Broker/Message.php
index <HASH>..<HASH> 100644
--- a/src/Swarrot/Broker/Message.php
+++ b/src/Swarrot/Broker/Message.php
@@ -21,6 +21,29 @@ class Message
*/
protected $id;
+ /**
+ * __construct
+ *
+ * In AMQP 0.9.1, a message contains properties. One of this properties is
+ * "headers".
+ * In AMQP 1.0, a message contains both properties and headers.
+ *
+ * For example, RabbitMQ implement AMQP 0.9.1.
+ * The "getHeaders" method of "\AMQPEnvelope" object actually return
+ * message properties AND headers at the same level.
+ * But if you want to have additional informations, you have to put it in
+ * the "headers" property. All unknown properties will be deleted by the
+ * broker.
+ *
+ * More information on AMQP version:
+ * @see: http://www.amqp.org/resources/download
+ *
+ * @param mixed $body
+ * @param array $properties
+ * @param mixed $id
+ *
+ * @return void
+ */
public function __construct($body, array $properties = array(), $id = null)
{
$this->body = $body; | Add more detailled informations about message properties | swarrot_swarrot | train | php |
794893a1c3d643729c811b7b839c5281f1b716a3 | diff --git a/packages/openneuro-server/src/graphql/resolvers/snapshots.js b/packages/openneuro-server/src/graphql/resolvers/snapshots.js
index <HASH>..<HASH> 100644
--- a/packages/openneuro-server/src/graphql/resolvers/snapshots.js
+++ b/packages/openneuro-server/src/graphql/resolvers/snapshots.js
@@ -45,7 +45,7 @@ export const participantCount = async () => {
},
{
$sort: {
- created: -1,
+ created: 1,
},
},
{ | API: Participant count fix to return latest valid snapshot
This was returning earliest valid snapshot. | OpenNeuroOrg_openneuro | train | js |
6d0c0e991bc78629369f5be83b847f5e201222b6 | diff --git a/transport/src/main/java/io/netty/channel/AbstractChannelHandlerContext.java b/transport/src/main/java/io/netty/channel/AbstractChannelHandlerContext.java
index <HASH>..<HASH> 100644
--- a/transport/src/main/java/io/netty/channel/AbstractChannelHandlerContext.java
+++ b/transport/src/main/java/io/netty/channel/AbstractChannelHandlerContext.java
@@ -1109,7 +1109,7 @@ abstract class AbstractChannelHandlerContext implements ChannelHandlerContext, R
private void decrementPendingOutboundBytes() {
if (ESTIMATE_TASK_SIZE_ON_SUBMIT) {
- ctx.pipeline.decrementPendingOutboundBytes(size >= 0 ? size : (size & Integer.MAX_VALUE));
+ ctx.pipeline.decrementPendingOutboundBytes(size & Integer.MAX_VALUE);
}
} | Small simplification to WriteTask optimization (#<I>)
Motiviation
#<I> was just merged which consolidates the flush/no-flush WriteTasks
in AbstractChannelHandlerContext, but after looking at the changes again
I noticed a tiny simplification that would be good to make imo.
Modification
Remove use of conditional operator in decrementPendingOutboundBytes()
Result
Simpler code, one less branch | netty_netty | train | java |
0feaf73df74f3eefa28dfe7f111b87c1653fbdec | diff --git a/metrics/sinks/factory.go b/metrics/sinks/factory.go
index <HASH>..<HASH> 100644
--- a/metrics/sinks/factory.go
+++ b/metrics/sinks/factory.go
@@ -81,7 +81,7 @@ func (this *SinkFactory) BuildAll(uris flags.Uris, historicalUri string) (*metri
for _, uri := range uris {
sink, err := this.Build(uri)
if err != nil {
- glog.Errorf("Failed to create sink: %v", err)
+ glog.Errorf("Failed to create %s sink: %v", sink.Name(), err)
continue
}
if uri.Key == "metric" {
diff --git a/metrics/sinks/kafka/driver.go b/metrics/sinks/kafka/driver.go
index <HASH>..<HASH> 100644
--- a/metrics/sinks/kafka/driver.go
+++ b/metrics/sinks/kafka/driver.go
@@ -36,6 +36,10 @@ type kafkaSink struct {
sync.RWMutex
}
+func (sink *kafkaSink) Name() string {
+ return "kafka"
+}
+
func (sink *kafkaSink) ExportData(dataBatch *core.DataBatch) {
sink.Lock()
defer sink.Unlock() | * Kafka did not implemented core.DataSink Name function.
* Factory now prints the name of the sink failed. | kubernetes-retired_heapster | train | go,go |
95072a6fa42e252fbc44984057a2cebaa46c1916 | diff --git a/ipywidgets/embed.py b/ipywidgets/embed.py
index <HASH>..<HASH> 100644
--- a/ipywidgets/embed.py
+++ b/ipywidgets/embed.py
@@ -221,7 +221,7 @@ def embed_snippet(views,
return snippet_template.format(**values)
-def embed_minimal_html(fp, views, **kwargs):
+def embed_minimal_html(fp, views, title=u'IPyWidget export', template=None, **kwargs):
"""Write a minimal HTML file with widget views embedded.
Parameters
@@ -231,6 +231,8 @@ def embed_minimal_html(fp, views, **kwargs):
views: widget or collection of widgets or None
The widgets to include views for. If None, all DOMWidgets are
included (not just the displayed ones).
+ title: title for the html page
+ template: template string for the html,
Further it accepts keyword args similar to `embed_snippet`.
"""
@@ -238,11 +240,13 @@ def embed_minimal_html(fp, views, **kwargs):
snippet = embed_snippet(views, **kwargs)
values = {
- 'title': u'IPyWidget export',
+ 'title': title,
'snippet': snippet,
}
+ if template is None:
+ template = html_template
- html_code = html_template.format(**values)
+ html_code = template.format(**values)
# Check if fp is writable:
if hasattr(fp, 'write'): | a bit more flexibility for embedding | jupyter-widgets_ipywidgets | train | py |
0ff3ebad718675ddf96f080f6d5bb8d713b5a3ce | diff --git a/src/Charcoal/Model/AbstractModel.php b/src/Charcoal/Model/AbstractModel.php
index <HASH>..<HASH> 100644
--- a/src/Charcoal/Model/AbstractModel.php
+++ b/src/Charcoal/Model/AbstractModel.php
@@ -208,6 +208,15 @@ abstract class AbstractModel extends AbstractEntity implements
}
/**
+ * @return array
+ */
+ public function defaultData()
+ {
+ $metadata = $this->metadata();
+ return $metadata->defaultData();
+ }
+
+ /**
* Sets the data
*
* This function takes a 1-dimensional array and fill the object with its value.
diff --git a/src/Charcoal/Model/ModelInterface.php b/src/Charcoal/Model/ModelInterface.php
index <HASH>..<HASH> 100644
--- a/src/Charcoal/Model/ModelInterface.php
+++ b/src/Charcoal/Model/ModelInterface.php
@@ -32,6 +32,11 @@ interface ModelInterface
/**
* @return array
*/
+ public function defaultData();
+
+ /**
+ * @return array
+ */
public function properties();
/** | Add the defaultData() method to models. | locomotivemtl_charcoal-core | train | php,php |
c8a74629416c553998d030d269e7e9a319cde7ef | diff --git a/glue/pipeline.py b/glue/pipeline.py
index <HASH>..<HASH> 100644
--- a/glue/pipeline.py
+++ b/glue/pipeline.py
@@ -1501,7 +1501,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="3.0" count="1" in
# write the dag node priority if this node has one
if node.get_priority():
- template = """ <profile namespace="dagman" key="priority">%s</profile>\n"""
+ template = """ <profile namespace="condor" key="priority">%s</profile>\n"""
xml = xml + template % (node.get_priority())
if self.is_dax(): | fixed setting of condor priority keyword in dax | gwastro_pycbc-glue | train | py |
76a0ed3832c36d23ec54838e93ca6eea480be1c1 | diff --git a/bokeh/plotting.py b/bokeh/plotting.py
index <HASH>..<HASH> 100644
--- a/bokeh/plotting.py
+++ b/bokeh/plotting.py
@@ -234,16 +234,7 @@ class Figure(Plot):
>>> p.scatter("data1", "data2", source=data_source, ...)
"""
- ds = kwargs.get("source", None)
- names, datasource = _handle_1d_data_args(args, datasource=ds)
- kwargs["source"] = datasource
-
- markertype = kwargs.get("marker", "circle")
-
- if not len(_color_fields.intersection(set(kwargs.keys()))):
- kwargs['color'] = get_default_color()
- if not len(_alpha_fields.intersection(set(kwargs.keys()))):
- kwargs['alpha'] = get_default_alpha()
+ markertype = kwargs.pop("marker", "circle")
if markertype not in _marker_types:
raise ValueError("Invalid marker type '%s'. Use markers() to see a list of valid marker types." % markertype) | fix up scatter to use new glyph functions better | bokeh_bokeh | train | py |
0c633b0680486ba5ba3fcd216bfbd688889ef730 | diff --git a/src/MpaFirephpWrapper/Service/FirephpWrapper.php b/src/MpaFirephpWrapper/Service/FirephpWrapper.php
index <HASH>..<HASH> 100644
--- a/src/MpaFirephpWrapper/Service/FirephpWrapper.php
+++ b/src/MpaFirephpWrapper/Service/FirephpWrapper.php
@@ -21,8 +21,8 @@ class FirephpWrapper
public function __construct(ServiceLocatorInterface $serviceLocator)
{
- $this->firephp = new FirePHP();
- $config = $serviceLocator->get('Config');
+ $this->setFirephp(new FirePHP());
+ $config = $serviceLocator->get('Config');
if (array_key_exists('mpafirephpwrapper', $config)) {
$options = $config['mpafirephpwrapper'];
} else {
@@ -49,4 +49,20 @@ class FirephpWrapper
{
return $this->howManyLogged;
}
+
+ /**
+ * @param \FirePHP $firephp
+ */
+ public function setFirephp($firephp)
+ {
+ $this->firephp = $firephp;
+ }
+
+ /**
+ * @return \FirePHP
+ */
+ public function getFirephp()
+ {
+ return $this->firephp;
+ }
} | added getters/setters for firePHP instance | mpalourdio_MpaFirephpWrapper | train | php |
46bc1848b6ed8f69ae13bb815fc396ed81cfbca1 | diff --git a/syntax.go b/syntax.go
index <HASH>..<HASH> 100644
--- a/syntax.go
+++ b/syntax.go
@@ -25,12 +25,12 @@ type Syntax interface {
func syntaxHighlighter(name, data string) parser.SyntaxHighlighter {
if name == "" {
- return defaultSyntax()
+ return &syntax{}
}
sh, err := syntaxProvider(name, data)
if err != nil {
log.Error("%s, falling back to default syntax", err)
- return defaultSyntax()
+ return &syntax{}
}
return sh
}
@@ -66,13 +66,3 @@ func (s *syntax) ScopeName(p int) string {
func (s *syntax) Flatten() render.ViewRegionMap {
return nil
}
-
-// default syntax highlighter used when there is a problem
-var syntaxhighlighter *syntax
-
-func defaultSyntax() parser.SyntaxHighlighter {
- if syntaxhighlighter == nil {
- syntaxhighlighter = &syntax{}
- }
- return syntaxhighlighter
-} | fixing race on SyntaxHighlighter | limetext_backend | train | go |
06ff71c597d5881c7926ec29d1939b7a48eef691 | diff --git a/salt/modules/rabbitmq.py b/salt/modules/rabbitmq.py
index <HASH>..<HASH> 100644
--- a/salt/modules/rabbitmq.py
+++ b/salt/modules/rabbitmq.py
@@ -13,7 +13,7 @@ import salt.utils
import logging
import random
import string
-from six.moves import range
+from salt.utils.six.moves import range
log = logging.getLogger(__name__) | Replaced module six in file /salt/modules/rabbitmq.py | saltstack_salt | train | py |
59ac27a24c75b16fbe1e967b01588ac183c086b7 | diff --git a/src/router/router.go b/src/router/router.go
index <HASH>..<HASH> 100644
--- a/src/router/router.go
+++ b/src/router/router.go
@@ -132,7 +132,8 @@ func main() {
r.HandleFunc("/elb-ping-router", Ping) // for ELB health check
// Now for everyone else:
- r.HandleFunc("/", ProxyFunc)
+// r.HandleFunc("/", ProxyFunc)
+ r.NotFoundHandler = http.HandlerFunc(ProxyFunc)
http.Handle("/", r)
port := 80
@@ -337,6 +338,7 @@ func (wh *WorkerHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
return
}
fmt.Fprintln(w, "Worker added")
+ golog.Infoln("Worked added.")
}
} | Trying notfoundhandler for proxy. | iron-io_functions | train | go |
f48da8bd83c6bea17929e59a8bbee18879e4f8fb | diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/exceptions.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/exceptions.py
index <HASH>..<HASH> 100644
--- a/tools/azure-devtools/src/azure_devtools/scenario_tests/exceptions.py
+++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/exceptions.py
@@ -10,8 +10,7 @@ class AzureTestError(Exception):
super(AzureTestError, self).__init__(message.format(error_message))
class AzureNameError(Exception):
- def __init__(self, error_message):
- super(AzureNameError, self).__init__(message.format(error_message))
+ pass
class NameInUseError(AzureNameError):
def __init__(self, vault_name): | AzureNameError now just passes to Exception (#<I>) | Azure_azure-sdk-for-python | train | py |
04e4d9931131b01fa6036a1f2172efbb4cfddee7 | diff --git a/pkg/node/node_address_darwin.go b/pkg/node/node_address_darwin.go
index <HASH>..<HASH> 100644
--- a/pkg/node/node_address_darwin.go
+++ b/pkg/node/node_address_darwin.go
@@ -18,8 +18,6 @@ package node
import (
"net"
-
- "github.com/vishvananda/netlink"
)
func firstGlobalV4Addr(intf string) (net.IP, error) { | node: fix unused import
The netlink import wasn't being used, which caused compilation errors when
running unit tests on macOS setups. | cilium_cilium | train | go |
32d29c7fd074abcf90a5d5b1c9cbbe83b9e199a3 | diff --git a/salt/modules/gpg.py b/salt/modules/gpg.py
index <HASH>..<HASH> 100644
--- a/salt/modules/gpg.py
+++ b/salt/modules/gpg.py
@@ -97,7 +97,10 @@ def _check_gpg():
Looks to see if gpg binary is present on the system.
'''
# Get the path to the gpg binary.
- return salt.utils.which('gpg')
+ if salt.utils.which('gpg'):
+ return __virtualname__
+ return (False, 'The gpg execution module cannot be loaded: '
+ 'gpg binary is not in the path.')
def __virtual__(): | modules.gpg: __virtual__ return err msg.
Updated message when gpg binary is not in the path. | saltstack_salt | train | py |
834f4b3d51bf1584717f2080d48d5344b8c46538 | diff --git a/cauldron/render/__init__.py b/cauldron/render/__init__.py
index <HASH>..<HASH> 100644
--- a/cauldron/render/__init__.py
+++ b/cauldron/render/__init__.py
@@ -305,21 +305,21 @@ def plotly(
dom = plotly_lib.offline.plot(
figure_or_data=source,
output_type='div',
- include_plotlyjs=False
+ include_plotlyjs=False,
+ config={'staticPlot': static, 'showLink': False}
)
found = re.search(r'id="(?P<id>[^"]+)"', dom)
dom_id = found.group('id')
- try: # Plotly < 4.0
+ # Plotly < 4.0 requires manually inserting the static value.
+ if static and dom.find('"staticPlot": ') < 0: # pragma: no-cover
insert_index = dom.index('"showLink":')
dom = ''.join([
dom[:insert_index],
'"staticPlot": {}, '.format('true' if static else 'false'),
dom[insert_index:]
])
- except ValueError: # pragma: no-cover
- pass
return templating.render_template(
'plotly-component.html', | Plotly Static Compatibility
Adds Plotly 3.x and 4.x compatible static plotting support. | sernst_cauldron | train | py |
0fbbc740e38fa7178ca274947f791439ed5ea313 | diff --git a/lib/fastlane/actions/install_cocoapods.rb b/lib/fastlane/actions/install_cocoapods.rb
index <HASH>..<HASH> 100644
--- a/lib/fastlane/actions/install_cocoapods.rb
+++ b/lib/fastlane/actions/install_cocoapods.rb
@@ -4,7 +4,7 @@ module Fastlane
def self.run(params)
cmd = []
- cmd << ['bundle exec'] if File.exists?('Gemfile')
+ cmd << ['bundle exec'] if File.exists?('Gemfile') && !params[:skip_bundle_exec]
cmd << ['pod install']
cmd << '--no-clean' unless params[:clean]
@@ -47,6 +47,11 @@ module Fastlane
env_name: "FL_COCOAPODS_ANSI",
description: "Show output with ANSI codes",
default_value: true),
+ FastlaneCore::ConfigItem.new(key: :skip_bundle_exec,
+ env_name: "FL_COCOAPODS_SKIP_BUNDLE_EXEC",
+ description: "Skips bundle exec even if there is a Gemfile",
+ is_string: false,
+ default_value: false),
]
end | added flag to skip `bundle exec` | fastlane_fastlane | train | rb |
227cf2e976d970aedfba7fde5314ee8c3210f227 | diff --git a/lib/translation_center/translation_helpers.rb b/lib/translation_center/translation_helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/translation_center/translation_helpers.rb
+++ b/lib/translation_center/translation_helpers.rb
@@ -41,7 +41,8 @@ module TranslationCenter
def translate_with_adding(locale, key, options = {})
# handle calling translation with a blank key
- return translate_without_adding(locale, key, options) if key.blank?
+ # or translation center tables don't exist
+ return translate_without_adding(locale, key, options) if key.blank? || !ActiveRecord::Base.connection.table_exists?('translation_center_translation_keys')
# add the new key or update it
translation_key = TranslationCenter::TranslationKey.find_or_create_by_name(key) | handle when translation center tables don't exist | BadrIT_translation_center | train | rb |
ea933e0b4aeaa65c0623b7c6df09e13e6f88c49d | diff --git a/h2o-extensions/xgboost/src/main/java/hex/tree/xgboost/XGBoostModel.java b/h2o-extensions/xgboost/src/main/java/hex/tree/xgboost/XGBoostModel.java
index <HASH>..<HASH> 100755
--- a/h2o-extensions/xgboost/src/main/java/hex/tree/xgboost/XGBoostModel.java
+++ b/h2o-extensions/xgboost/src/main/java/hex/tree/xgboost/XGBoostModel.java
@@ -545,7 +545,7 @@ public class XGBoostModel extends Model<XGBoostModel, XGBoostModel.XGBoostParame
try {
booster = model_info.deserializeBooster();
return XGBoostNativeMojoModel.score0(data, offset, preds, _parms._booster.toString(), _parms._ntrees,
- model_info.deserializeBooster(), di._nums, di._cats, di._catOffsets, di._useAllFactorLevels,
+ booster, di._nums, di._cats, di._catOffsets, di._useAllFactorLevels,
_output.nclasses(), _output._priorClassDist, threshold, _output._sparse, _output.hasOffset());
} finally {
if (booster != null) | [xgboost] fix leaking booster (#<I>) | h2oai_h2o-3 | train | java |
36842893fb5d1bc86bcd3b0344a37b967360c3d3 | diff --git a/src/OAuth1/AbstractProvider.php b/src/OAuth1/AbstractProvider.php
index <HASH>..<HASH> 100644
--- a/src/OAuth1/AbstractProvider.php
+++ b/src/OAuth1/AbstractProvider.php
@@ -57,6 +57,23 @@ abstract class AbstractProvider extends BaseProvider
return $user;
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function userFromTokenAndSecret($token, $secret)
+ {
+ $tokenCredentials = new TokenCredentials();
+
+ $tokenCredentials->setIdentifier($token);
+ $tokenCredentials->setSecret($secret);
+
+ $user = $this->mapUserToObject((array)$this->server->getUserDetails($tokenCredentials));
+
+ $user->setToken($tokenCredentials->getIdentifier(), $tokenCredentials->getSecret());
+
+ return $user;
+ }
/**
* Redirect the user to the authentication page for the provider. | Add "get user profile" from `token` and `secret`
Adding get `userFromTokenAndSecret` method to correspond changes already merged into main Socialite package here <URL> | SocialiteProviders_Manager | train | php |
cd2cb3ad0ed2fd750c57b2b6ca5ddd001b1f686a | 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
@@ -61,8 +61,6 @@ class RecordIndexer
}
}
}
-
- $bulk->flush();
}
public function getMapping()
diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/TermIndexer.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/TermIndexer.php
index <HASH>..<HASH> 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/TermIndexer.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer/TermIndexer.php
@@ -56,8 +56,6 @@ class TermIndexer
$bulk->index($params);
}
}
-
- $bulk->flush();
}
private static function thesaurusFromDatabox(databox $databox) | Only the main indexer should flush bulk operation | alchemy-fr_Phraseanet | train | php,php |
d744e51c1bdb4c7a26c0faeea1f2f45baaf5fd3c | diff --git a/src/structures/Role.js b/src/structures/Role.js
index <HASH>..<HASH> 100644
--- a/src/structures/Role.js
+++ b/src/structures/Role.js
@@ -197,8 +197,6 @@ class Role extends Base {
* .catch(console.error);
*/
async edit(data, reason) {
- if (typeof data.permissions !== 'undefined') data.permissions = Permissions.resolve(data.permissions);
- else data.permissions = this.permissions.bitfield;
if (typeof data.position !== 'undefined') {
await Util.setPosition(
this,
@@ -220,7 +218,7 @@ class Role extends Base {
name: data.name || this.name,
color: data.color !== null ? Util.resolveColor(data.color || this.color) : null,
hoist: typeof data.hoist !== 'undefined' ? data.hoist : this.hoist,
- permissions: data.permissions,
+ permissions: typeof data.permissions !== 'undefined' ? new Permissions(data.permissions) : this.permissions,
mentionable: typeof data.mentionable !== 'undefined' ? data.mentionable : this.mentionable,
},
reason, | fix(Role): pass Permissions class, not the bitfield (#<I>) | discordjs_discord.js | train | js |
d4610de2ed5734580ea5668ce4c0deaaccb06fb6 | diff --git a/src/dataviews/histogram-dataview/histogram-data-model.js b/src/dataviews/histogram-dataview/histogram-data-model.js
index <HASH>..<HASH> 100644
--- a/src/dataviews/histogram-dataview/histogram-data-model.js
+++ b/src/dataviews/histogram-dataview/histogram-data-model.js
@@ -13,7 +13,8 @@ module.exports = Model.extend({
url: '',
data: [],
localTimezone: false,
- localOffset: 0
+ localOffset: 0,
+ hasBeenFetched: false
},
url: function () {
@@ -49,7 +50,6 @@ module.exports = Model.extend({
},
initialize: function () {
- this.hasBeenFetched = false;
this.sync = BackboneAbortSync.bind(this);
this._initBinds();
},
@@ -80,7 +80,7 @@ module.exports = Model.extend({
});
this.on('sync', function () {
- this.hasBeenFetched = true;
+ this.set('hasBeenFetched', true);
});
}, | Set `hasBeenFetched` as attribute | CartoDB_carto.js | train | js |
05fb92cb7bc4d70b571a54fcbc92c0e353cd01db | diff --git a/test/integration/test_buildrecords_api.py b/test/integration/test_buildrecords_api.py
index <HASH>..<HASH> 100644
--- a/test/integration/test_buildrecords_api.py
+++ b/test/integration/test_buildrecords_api.py
@@ -91,7 +91,8 @@ def test_get_dependency_artifacts_invalid_param():
def test_get_dependency_artifacts():
- record = builds_api.get_all().content[1]
+ records = builds_api.get_all(q='(buildConfigurationAudited.name=like=%cli-test%)').content
+ record = records[len(records)-1] # latest build performed
artifacts = builds_api.get_dependency_artifacts(id=record.id).content
assert artifacts is not None | use legitimate id for dependency artifacts test | project-ncl_pnc-cli | train | py |
c4af892d9d4019d4cc64d22b7a455edd83d60f1f | diff --git a/liquibase-core/src/main/java/liquibase/configuration/core/DefaultsFileValueProvider.java b/liquibase-core/src/main/java/liquibase/configuration/core/DefaultsFileValueProvider.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/main/java/liquibase/configuration/core/DefaultsFileValueProvider.java
+++ b/liquibase-core/src/main/java/liquibase/configuration/core/DefaultsFileValueProvider.java
@@ -34,13 +34,14 @@ public class DefaultsFileValueProvider extends AbstractMapConfigurationValueProv
// Remove trailing spaces on the property file values
//
private void trimAllProperties() {
- properties.forEach((k, v) -> {
- if (! (v instanceof String)) {
+ properties.forEach((key, value) -> {
+ if (value == null) {
return;
}
- String value = (String)v;
- String newString = (value != null ? value.trim() : null);
- properties.put(k, newString);
+ if (! (value instanceof String)) {
+ return;
+ }
+ properties.put(key, StringUtil.trimToEmpty((String) value));
});
} | New CLI:
- Keep trimmed properties from ending up null
LB-<I> | liquibase_liquibase | train | java |
8a0db81c0672d919f268386d2f28434fd76564fd | diff --git a/src/textures.js b/src/textures.js
index <HASH>..<HASH> 100644
--- a/src/textures.js
+++ b/src/textures.js
@@ -481,14 +481,26 @@ define([
if (crossOrigin !== undefined) {
img.crossOrigin = crossOrigin;
}
- img.onerror = function() {
+
+ function clearEventHandlers() {
+ img.removeEventListener('error', onError); // eslint-disable-line
+ img.removeEventListener('load', onLoad); // eslint-disable-line
+ }
+
+ function onError() {
+ clearEventHandlers();
var msg = "couldn't load image: " + url;
utils.error(msg);
callback(msg, img);
- };
- img.onload = function() {
+ }
+
+ function onLoad() {
+ clearEventHandlers();
callback(null, img);
- };
+ }
+
+ img.addEventListener('error', onError);
+ img.addEventListener('load', onLoad);
img.src = url;
return img;
} | remove image event listeners for GC | greggman_twgl.js | train | js |
16ac4a3c645ff06a97c0261812ab038e37e22ce5 | diff --git a/cmd/bucket-lifecycle-handler.go b/cmd/bucket-lifecycle-handler.go
index <HASH>..<HASH> 100644
--- a/cmd/bucket-lifecycle-handler.go
+++ b/cmd/bucket-lifecycle-handler.go
@@ -80,7 +80,7 @@ func (api objectAPIHandlers) PutBucketLifecycleHandler(w http.ResponseWriter, r
globalNotificationSys.SetBucketLifecycle(ctx, bucket, bucketLifecycle)
// Success.
- writeSuccessNoContent(w)
+ writeSuccessResponseHeadersOnly(w)
}
// GetBucketLifecycleHandler - This HTTP handler returns bucket policy configuration. | PutBucketLifeCycleConfiguration: Return <I> instead of <I> (#<I>) | minio_minio | train | go |
9226b89c1766cb111701596e0b6fa6a00f734d9a | diff --git a/components/lib/tree/UITreeNode.js b/components/lib/tree/UITreeNode.js
index <HASH>..<HASH> 100644
--- a/components/lib/tree/UITreeNode.js
+++ b/components/lib/tree/UITreeNode.js
@@ -81,7 +81,14 @@ export const UITreeNode = React.memo((props) => {
focusNode(listElement.children[0]);
}
else {
- const nextNodeElement = nodeElement.nextElementSibling;
+ let nextNodeElement = nodeElement.nextElementSibling;
+ while (nextNodeElement) {
+ if (!DomHandler.hasClass(nextNodeElement, 'p-treenode-droppoint')) {
+ break;
+ }
+ nextNodeElement = nextNodeElement.nextElementSibling;
+ }
+
if (nextNodeElement) {
focusNode(nextNodeElement);
}
@@ -159,7 +166,7 @@ export const UITreeNode = React.memo((props) => {
}
const focusNode = (element) => {
- element.children[0].focus();
+ element && element.children[0] && element.children[0].focus();
}
const onClick = (event) => { | Fix #<I>: Tree arrow keys with dragdrop enabled (#<I>) | primefaces_primereact | train | js |
bcbbe412037e9657eb2c57dab4de4bb82a537cd0 | diff --git a/lib/fbgraph/client.rb b/lib/fbgraph/client.rb
index <HASH>..<HASH> 100644
--- a/lib/fbgraph/client.rb
+++ b/lib/fbgraph/client.rb
@@ -13,6 +13,12 @@ module FBGraph
return true
end
+ def set_token(new_token)
+ @access_token = new_token
+ @auth = OAuth2::AccessToken.new(oauth_client , @access_token)
+ new_token
+ end
+
def authorization
FBGraph::Authorization.new(self)
end | Added method to allow for setting a client's auth token after its created. | nsanta_fbgraph | train | rb |
1ca737fd0ab0c0e6004cda0757faaa88be319d6a | diff --git a/test/unit/model/indices.js b/test/unit/model/indices.js
index <HASH>..<HASH> 100644
--- a/test/unit/model/indices.js
+++ b/test/unit/model/indices.js
@@ -185,7 +185,7 @@ describe( "A model-related index", () => {
const Adapters = [
[ "default (memory) adapter", undefined ],
[ "FileAdapter", new FileAdapter( {
- dataSource: Path.resolve( __dirname, "../../data" ),
+ dataSource: Path.resolve( __dirname, "../../../data" ),
} ) ],
]; | fixing data folder for index testing moved after moving all tests | hitchyjs_odem | train | js |
dc9f5c7f1efa9e732ac9541ff0e386ab8294dbe0 | diff --git a/src/SupervisorClient/SupervisorClient.php b/src/SupervisorClient/SupervisorClient.php
index <HASH>..<HASH> 100644
--- a/src/SupervisorClient/SupervisorClient.php
+++ b/src/SupervisorClient/SupervisorClient.php
@@ -232,7 +232,7 @@ class SupervisorClient
$this->_socket = fsockopen($this->_hostname, $this->_port, $errno, $errstr, $this->_timeout);
if (!$this->_socket) {
- throw new Exception(printf("Cannot open socket: Error %d: \"%s\"", $errno, $errstr));
+ throw new Exception(sprintf("Cannot open socket: Error %d: \"%s\"", $errno, $errstr));
}
} | Replaced printf with sprintf for thrown exception | mondalaci_supervisord-php-client | train | php |
7d0345843bbc85d299ba53eddbebb7c16f7ec6b7 | diff --git a/buildprocess/karma-saucelabs.conf.js b/buildprocess/karma-saucelabs.conf.js
index <HASH>..<HASH> 100644
--- a/buildprocess/karma-saucelabs.conf.js
+++ b/buildprocess/karma-saucelabs.conf.js
@@ -48,7 +48,7 @@ module.exports = function(config) {
},
// start these browsers
- browsers: ['sl_ie9'],
+ browsers: ['sl_chrome', 'sl_safari', 'sl_firefox', 'sl_firefox_esr', 'sl_ie10', 'sl_ie11'], // 'sl_ie9' temporarily disabled
sauceLabels: {
testName: 'TerriaJS Unit Tests', | Run all but IE9 instead of only IE9. | TerriaJS_terriajs | train | js |
797cf69fc73e27ce2647771440fcbab16d429653 | diff --git a/test/unit/variable.test.js b/test/unit/variable.test.js
index <HASH>..<HASH> 100644
--- a/test/unit/variable.test.js
+++ b/test/unit/variable.test.js
@@ -244,7 +244,7 @@ describe('Variable', function () {
expect(v.get()).to.equal('1,2,[object Object]');
v.valueType('array');
- expect(v.get()).to.be.null;
+ expect(v.get()).to.be.undefined;
});
it('should recast values when type is changed (object)', function () {
@@ -256,7 +256,7 @@ describe('Variable', function () {
expect(v.get()).to.equal('[object Object]');
v.valueType('object');
- expect(v.get()).to.be.null;
+ expect(v.get()).to.be.undefined;
});
it('should handle functions correctly', function () { | Test: set undefined value on recast | postmanlabs_postman-collection | train | js |
05394e9b3a10fd3de4aefa0050a9e12e808aefb2 | diff --git a/src/Friday/Http/Route.php b/src/Friday/Http/Route.php
index <HASH>..<HASH> 100644
--- a/src/Friday/Http/Route.php
+++ b/src/Friday/Http/Route.php
@@ -143,7 +143,7 @@ class Route implements RouteInterface
}
}
$route = trim($route, '/ ');
- $route = (self::$instance->prefix == null) ? $route : self::$instance->prefix.'/'.$route;
+ $route = (self::$instance->prefix == null) ? $route : rtrim(self::$instance->prefix.'/'.$route, '/');
$array = $route === '' ? [] : explode('/', $route);
$size = count($array);
$route = '/'.$route; | group route trailing slash removed' | ironphp_ironphp | train | php |
1c8989f722c1ca467b5736872aac0bd243051108 | diff --git a/lib/websocket_rails/event_queue.rb b/lib/websocket_rails/event_queue.rb
index <HASH>..<HASH> 100644
--- a/lib/websocket_rails/event_queue.rb
+++ b/lib/websocket_rails/event_queue.rb
@@ -1,27 +1,29 @@
-class EventQueue
+module WebsocketRails
+ class EventQueue
- attr_reader :queue
+ attr_reader :queue
- def initialize
- @queue = []
- end
+ def initialize
+ @queue = []
+ end
- def enqueue(event)
- @queue << event
- end
- alias :<< :enqueue
+ def enqueue(event)
+ @queue << event
+ end
+ alias :<< :enqueue
- def last
- @queue.last
- end
+ def last
+ @queue.last
+ end
- def flush(&block)
- unless block.nil?
- @queue.each do |item|
- block.call item
+ def flush(&block)
+ unless block.nil?
+ @queue.each do |item|
+ block.call item
+ end
end
+ @queue = []
end
- @queue = []
- end
+ end
end | Move EventQueue to the correct WebsocketRails module. | websocket-rails_websocket-rails | train | rb |
f477323840c174e8da0b4dc1def658c43fc5fbda | diff --git a/go/api-frontend/aaa/db_token_backend.go b/go/api-frontend/aaa/db_token_backend.go
index <HASH>..<HASH> 100644
--- a/go/api-frontend/aaa/db_token_backend.go
+++ b/go/api-frontend/aaa/db_token_backend.go
@@ -142,7 +142,8 @@ func (tb *DbTokenBackend) TouchTokenInfo(token string) {
expired := timeToExpired(time.Now().Add(tb.inActivityTimeout))
db, err := tb.getDB()
if err != nil {
- panic(err)
+ log.Logger().Error(err.Error())
+ return
}
_, err = db.Exec(
"UPDATE chi_cache SET expires_at = ? WHERE `key` = ?",
@@ -150,7 +151,8 @@ func (tb *DbTokenBackend) TouchTokenInfo(token string) {
tokenKey(tb, token),
)
if err != nil {
- panic(err)
+ log.Logger().Error(err.Error())
+ return
}
} | don't panic when failing to touch the token info | inverse-inc_packetfence | train | go |
4c2edf136d5df7c0e00774b7e2189f66615f5adb | diff --git a/tableschema/table.py b/tableschema/table.py
index <HASH>..<HASH> 100644
--- a/tableschema/table.py
+++ b/tableschema/table.py
@@ -65,9 +65,6 @@ class Table(object):
"""https://github.com/frictionlessdata/tableschema-py#schema
"""
with self.__stream as stream:
- # TODO: remove reset after this issue will be resolved
- # https://github.com/frictionlessdata/tabulator-py/issues/190
- stream.reset()
iterator = stream.iter(extended=True)
iterator = self.__apply_processors(iterator, cast=cast)
for row_number, headers, row in iterator:
@@ -98,9 +95,6 @@ class Table(object):
# Infer (tabulator)
if not self.__storage:
with self.__stream as stream:
- # TODO: remove reset after this issue will be resolved
- # https://github.com/frictionlessdata/tabulator-py/issues/190
- stream.reset()
if self.__schema is None:
self.__schema = Schema()
self.__schema.infer(stream.sample[:limit], headers=stream.headers) | Removed extra tabulator.stream.reset call | frictionlessdata_tableschema-py | train | py |
fd757ce64038e0f15d3ecf4b3d69dce3e278a1af | diff --git a/pandas/tseries/tests/test_offsets.py b/pandas/tseries/tests/test_offsets.py
index <HASH>..<HASH> 100644
--- a/pandas/tseries/tests/test_offsets.py
+++ b/pandas/tseries/tests/test_offsets.py
@@ -2869,4 +2869,3 @@ class TestReprNames(tm.TestCase):
if __name__ == '__main__':
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
exit=False)
- | CLN: fix invalid line in test_offsets.py | pandas-dev_pandas | train | py |
055fb2b07674b7305dc459754ed8903bdfa7b452 | diff --git a/lib/gtm_rails/hooks.rb b/lib/gtm_rails/hooks.rb
index <HASH>..<HASH> 100644
--- a/lib/gtm_rails/hooks.rb
+++ b/lib/gtm_rails/hooks.rb
@@ -5,7 +5,7 @@ module GtmRails
loader = ::GtmRails::YamlLoader.new
- gtms = loader.load.fetch(ENV['RAILS_ENV'] || 'development') || []
+ gtms = loader.load[(ENV['RAILS_ENV'] || 'development')] || []
GtmRails::Config.gtm = gtms.each_with_object({}.with_indifferent_access) {|gtm, ret|
ret[gtm.keys.first] = gtm.values.first | Loose conditions for RAILS_ENV | koic_gtm_rails | train | rb |
5e5629705b3d24c0386abdc0327ab8fd66e56465 | diff --git a/core/phantomas.js b/core/phantomas.js
index <HASH>..<HASH> 100644
--- a/core/phantomas.js
+++ b/core/phantomas.js
@@ -833,7 +833,7 @@ phantomas.prototype = {
// @see http://superuser.com/questions/550048/is-there-an-escape-for-character-in-the-command-prompt
if (osName === 'windows') {
args = args.map(function(arg) {
- return arg.replace(/&/g, '^$&'); // $& - Inserts the matched substring
+ return arg.replace(/&/g, '^^^$&'); // $& - Inserts the matched substring
});
} | runScript: escape ^ as well | macbre_phantomas | train | js |
31e4321ad40149bf4aaed93d6f17563f9ccd5314 | diff --git a/test/core_test.py b/test/core_test.py
index <HASH>..<HASH> 100644
--- a/test/core_test.py
+++ b/test/core_test.py
@@ -288,6 +288,19 @@ class TestCore(unittest.TestCase):
has_none_default_value.parser.call(args=["12", "--b", "yes"]), (12, "yes")
)
+ def test_get_arg_parser_annotation_take_precedence(self):
+ parser = _get_arg_parser(
+ parse_me_full_docstring,
+ [dict, dict, dict],
+ {"one": int, "two": int, "three": int},
+ [("one", _NO_DEFAULT), ("two", _NO_DEFAULT), ("three", _NO_DEFAULT)],
+ ":",
+ )
+ namespace = parser.parse_args("1 2 3".split())
+ self.assertEqual(namespace.one, 1)
+ self.assertEqual(namespace.two, 2)
+ self.assertEqual(namespace.three, 3)
+
def test_get_arg_parser_with_default_value(self):
parser = _get_arg_parser(
parse_me_full_docstring, | Add test to ensure annotations take precedence | bertrandvidal_parse_this | train | py |
893e7726c8974aebceec59b5c38bd17fde5a1eb2 | diff --git a/pharen.php b/pharen.php
index <HASH>..<HASH> 100755
--- a/pharen.php
+++ b/pharen.php
@@ -1246,7 +1246,7 @@ class SpliceWrapper extends UnquoteWrapper{
$last = array_pop($exprs);
foreach($exprs as $expr){
$code .= $expr->$f();
- if($f != "compile_statement"){
+ if($f == 'compile'){
$code .= ", ";
}
} | Removed commas that were being added by SpliceWrapper when it was compiling statements. | Scriptor_pharen | train | php |
0cc065805379560c97dded999ac93422ba2996a5 | diff --git a/py3status/modules/mpd_status.py b/py3status/modules/mpd_status.py
index <HASH>..<HASH> 100644
--- a/py3status/modules/mpd_status.py
+++ b/py3status/modules/mpd_status.py
@@ -97,6 +97,7 @@ def song_attr(song, attr):
class Py3status:
"""
"""
+ c = None
# available configuration parameters
cache_timeout = 2
format = '{state} [[[{artist}] - {title}]|[{file}]]'
@@ -110,8 +111,6 @@ class Py3status:
state_play = '[play]'
state_stop = '[stop]'
- c = None
-
def _mpdc(self):
try:
if self.c is None: | put variables in alphabetical order for travis-ci | ultrabug_py3status | train | py |
2d7e13ac297636d096917d9bd67a93d2443967c1 | diff --git a/scripts/copy-files.js b/scripts/copy-files.js
index <HASH>..<HASH> 100644
--- a/scripts/copy-files.js
+++ b/scripts/copy-files.js
@@ -31,7 +31,7 @@ async function createModulePackages({ from, to }) {
const packageJson = {
sideEffects: false,
module: './index.js',
- main: path.join('../node', directoryPackage, 'index.js'),
+ main: path.posix.join('../node', directoryPackage, 'index.js'),
types: './index.d.ts',
}; | [core] Fix generation of package.json (#<I>) | mui-org_material-ui | train | js |
5708e83b3daa6e37f3e19a51f55d8f2d56b00797 | diff --git a/contribs/gmf/apps/desktop_alt/Controller.js b/contribs/gmf/apps/desktop_alt/Controller.js
index <HASH>..<HASH> 100644
--- a/contribs/gmf/apps/desktop_alt/Controller.js
+++ b/contribs/gmf/apps/desktop_alt/Controller.js
@@ -81,7 +81,6 @@ class Controller extends AbstractDesktopController {
/**
* @param {JQueryEventObject} event keydown event.
*/
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
onKeydown(event) {}
} | Fix no-unused-vars in c2cgeoportal | camptocamp_ngeo | train | js |
50bd66dbd3f97afbb474937540bda27bb7c7e7e4 | diff --git a/app/lib/bump-yaml.js b/app/lib/bump-yaml.js
index <HASH>..<HASH> 100644
--- a/app/lib/bump-yaml.js
+++ b/app/lib/bump-yaml.js
@@ -28,7 +28,7 @@ module.exports = function (data, version, config) {
}
const yamlData = YAML.parseDocument(prefixData?.data || data, config.yaml);
- const oldVersion = yamlData.get("version");
+ const oldVersion = yamlData.get("version") || prefixData?.oldVersion;
if (!hasVersion) {
yamlData.set("version", version); | don't lose YAML defaults | joemaller_version-everything | train | js |
bfa2a458b9c8260189c65ffbacb52ccf18ec90b3 | diff --git a/lib/slimmer/version.rb b/lib/slimmer/version.rb
index <HASH>..<HASH> 100644
--- a/lib/slimmer/version.rb
+++ b/lib/slimmer/version.rb
@@ -1,3 +1,3 @@
module Slimmer
- VERSION = '3.17.0'
+ VERSION = '3.18.0'
end | Bump to version <I> | alphagov_slimmer | train | rb |
3fba676a1317dc2b149e1ccd80a1765d14e9ef51 | diff --git a/hug/interface.py b/hug/interface.py
index <HASH>..<HASH> 100644
--- a/hug/interface.py
+++ b/hug/interface.py
@@ -854,7 +854,7 @@ class HTTP(Interface):
if size:
response.set_stream(content, size)
else:
- response.stream = content
+ response.stream = content # pragma: no cover
else:
response.data = content | Ignore lengthless response stream case | hugapi_hug | train | py |
3e0788532ed03e925c884eeabcdbac1d3c2c2b48 | diff --git a/lib/atdis/validators.rb b/lib/atdis/validators.rb
index <HASH>..<HASH> 100644
--- a/lib/atdis/validators.rb
+++ b/lib/atdis/validators.rb
@@ -42,7 +42,7 @@ module ATDIS
# This attribute itself needs to be valid
class ValidValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
- if (value.respond_to?(:valid?) && !value.valid?) || (!value.respond_to?(:valid?) && !value.all?{|v| v.valid?})
+ if (value.respond_to?(:valid?) && !value.valid?) || (value && !value.respond_to?(:valid?) && !value.all?{|v| v.valid?})
record.errors.add(attribute, "is not valid")
end
end | If value is nil don't try to validate with ValidValidator | openaustralia_atdis | train | rb |
a5a1162ff3c904fd25b033b7c8a83a446d2f2b22 | diff --git a/dci/api/v1/jobstates.py b/dci/api/v1/jobstates.py
index <HASH>..<HASH> 100644
--- a/dci/api/v1/jobstates.py
+++ b/dci/api/v1/jobstates.py
@@ -78,7 +78,7 @@ def get_all_jobstates(user, j_id=None):
args = schemas.args(flask.request.args.to_dict())
embed = args['embed']
- q_bd = v1_utils.QueryBuilder(_TABLE, args['limit'], args['offset'],
+ q_bd = v1_utils.QueryBuilder(_TABLE, args['offset'], args['limit'],
_VALID_EMBED)
q_bd.join(embed) | jobstate: limit and offset was mixed
limit parameter was used as the offset.
Change-Id: Idaf<I>ba<I>a<I>ac<I>aef<I>ba2c9f8c<I>b<I>e<I>e | redhat-cip_dci-control-server | train | py |
3f9ea688e5ddf9e5e25ddbcdcd12122ae77cb300 | diff --git a/lib/util/buffer-transform.js b/lib/util/buffer-transform.js
index <HASH>..<HASH> 100644
--- a/lib/util/buffer-transform.js
+++ b/lib/util/buffer-transform.js
@@ -2,6 +2,10 @@ var Transform = require('pipestream').Transform;
var util = require('util');
var iconv = require('iconv-lite');
+function toBuffer(data) {
+ return data ? (data instanceof Buffer ? data : new Buffer(data + '')) : null;
+}
+
function BufferTransform(data) {
if (!(this instanceof BufferTransform)) {
return new BufferTransform(data);
@@ -10,13 +14,13 @@ function BufferTransform(data) {
Transform.call(this);
if (data.body) {
var body = [];
- data.top && body.push(data.top);
+ data.top && body.push(toBuffer(data.top));
body.push(body);
- data.bottom && body.push(data.bottom);
- data.body = Buffer.concat(body);
+ data.bottom && body.push(toBuffer(data.bottom));
+ data.body = Buffer.concat(toBuffer(body));
} else {
- this._top = data.top;
- this._bottom = data.bottom;
+ this._top = toBuffer(data.top);
+ this._bottom = toBuffer(data.bottom);
}
} | feat: Add readFilesBuffer | avwo_whistle | train | js |
95eb18e6f063ed3bbb885fd59205e540d9900428 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,11 +2,11 @@
from distutils.core import setup
-setup(name='djangodblog',
+setup(name='django-db-log',
version='1.0',
description='Django DB Error Logging',
author='David Cramer',
author_email='dcramer@gmail.com',
- url='http://code.curse.com/p/django-db-log/',
+ url='http://code.google.com/p/django-db-log/',
packages=['djangodblog'],
) | Updated setup.py for pypi release | elastic_apm-agent-python | train | py |
5969c7b0745c2fd88557acf820597d98564a9477 | diff --git a/lib/queue.js b/lib/queue.js
index <HASH>..<HASH> 100644
--- a/lib/queue.js
+++ b/lib/queue.js
@@ -521,6 +521,9 @@ Queue.prototype._processNext = function () {
}
})
+ // Acquire lock on process
+ self._running++;
+
if (self.concurrent - self._running > 1) {
// Continue processing until saturated
self._processNextIfAllowed();
@@ -628,8 +631,6 @@ Queue.prototype._startBatch = function (batch, tickets) {
}
})
- // Acquire lock on process
- self._running++;
try {
worker.start();
} catch (e) { | Fixed issue with drain getting called too early | diamondio_better-queue | train | js |
fdad058eeabbaf22dcf1af435310c3084a2f08e6 | diff --git a/VERSION b/VERSION
index <HASH>..<HASH> 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.4
+0.1.6
diff --git a/lib/supermodel.rb b/lib/supermodel.rb
index <HASH>..<HASH> 100644
--- a/lib/supermodel.rb
+++ b/lib/supermodel.rb
@@ -9,6 +9,7 @@ require "active_support/core_ext/module/aliasing"
require "active_support/core_ext/object/blank"
require "active_support/core_ext/object/try"
require "active_support/core_ext/object/to_query"
+require "active_support/core_ext/class/attribute"
require "active_support/json"
require "active_model"
diff --git a/lib/supermodel/base.rb b/lib/supermodel/base.rb
index <HASH>..<HASH> 100644
--- a/lib/supermodel/base.rb
+++ b/lib/supermodel/base.rb
@@ -17,7 +17,7 @@ module SuperModel
end
def attributes(*attributes)
- self.known_attributes += attributes.map(&:to_s)
+ self.known_attributes |= attributes.map(&:to_s)
end
def records | do not dup known_attributes | maccman_supermodel | train | VERSION,rb,rb |
ad6df40144c372dcac538f8f43054bf521f99695 | diff --git a/lib/appium_capybara/driver/appium/driver.rb b/lib/appium_capybara/driver/appium/driver.rb
index <HASH>..<HASH> 100644
--- a/lib/appium_capybara/driver/appium/driver.rb
+++ b/lib/appium_capybara/driver/appium/driver.rb
@@ -79,6 +79,17 @@ module Appium::Capybara
end
# new
+ def swipe(opts)
+ start_x = opts.fetch :start_x, 0
+ start_y = opts.fetch :start_y, 0
+ end_x = opts.fetch :end_x, 0
+ end_y = opts.fetch :end_y, 0
+ duration = opts.fetch :duration, 200
+
+ Appium::TouchAction.new(browser).swipe(start_x: start_x, start_y: start_y, end_x: end_x, end_y: end_y, duration: duration).perform
+ end
+
+ # new
# Use :landscape or :portrait
def rotate(opts)
browser.rotate opts | feat: Added swipe feature for android and ios (#<I>)
* added swipe feature for android and ios
* replaced offset with xy coordinates
* arguments as keywords for swipe | appium_appium_capybara | train | rb |
17f053931ea3bbf583f197d3318eece0b5a771d6 | diff --git a/railties/lib/rails/test_help.rb b/railties/lib/rails/test_help.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/rails/test_help.rb
+++ b/railties/lib/rails/test_help.rb
@@ -9,8 +9,6 @@ if defined?(ActiveRecord)
class ActiveSupport::TestCase
include ActiveRecord::TestFixtures
self.fixture_path = "#{Rails.root}/test/fixtures/"
- self.use_instantiated_fixtures = false
- self.use_transactional_fixtures = true
end
ActionController::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path | use_instantiated_fixtures and use_transactional_fixtures defaults are set in active_record/fixtures | rails_rails | train | rb |
f223c7d76325d683a7a23a71abbf043a56048dba | diff --git a/lib/factory_bot/declaration/association.rb b/lib/factory_bot/declaration/association.rb
index <HASH>..<HASH> 100644
--- a/lib/factory_bot/declaration/association.rb
+++ b/lib/factory_bot/declaration/association.rb
@@ -6,6 +6,7 @@ module FactoryBot
super(name, false)
@options = options.dup
@overrides = options.extract_options!
+ @factory_name = @overrides.delete(:factory) || name
@traits = options
end
@@ -21,18 +22,25 @@ module FactoryBot
private
+ attr_reader :factory_name, :overrides, :traits
+
def build
ensure_factory_is_not_a_declaration!
- factory_name = @overrides[:factory] || name
- [Attribute::Association.new(name, factory_name, [@traits, @overrides.except(:factory)].flatten)]
+ [
+ Attribute::Association.new(
+ name,
+ factory_name,
+ [traits, overrides].flatten
+ )
+ ]
end
def ensure_factory_is_not_a_declaration!
- if @overrides[:factory].is_a?(Declaration)
+ if factory_name.is_a?(Declaration)
raise ArgumentError.new(<<~MSG)
Association '#{name}' received an invalid factory argument.
- Did you mean? 'factory: :#{@overrides[:factory].name}'
+ Did you mean? 'factory: :#{factory_name.name}'
MSG
end
end | Use attr_readers in association declaration
This commit separates the factory name from the overrides on initialize,
then uses attr_readers throughout instead of manipulating instance
variables.
This is a bit cleaner, and will make it easier to reused the
factory_name and overrides in a future code change. | thoughtbot_factory_bot | train | rb |
49a0354998b28319588fdd63d3b913bb8f93aa00 | diff --git a/tests/forms/gridfield/GridFieldFilterHeaderTest.php b/tests/forms/gridfield/GridFieldFilterHeaderTest.php
index <HASH>..<HASH> 100644
--- a/tests/forms/gridfield/GridFieldFilterHeaderTest.php
+++ b/tests/forms/gridfield/GridFieldFilterHeaderTest.php
@@ -13,6 +13,7 @@ class GridFieldFilterHeaderTest extends SapphireTest {
$method->setAccessible(true);
$this->assertEquals('Title', $method->invoke($header, $class,'Title.ATT'));
$this->assertEquals('isTest', $method->invoke($header, $class, 'isTest.Nice'));
+ $this->assertEquals('Self.isTest.Nice', $method->invoke($header, $class, 'Self.isTest.Nice'));
}
}
@@ -24,4 +25,8 @@ class GridFieldFilterHeaderTest_DataObject extends DataObject implements TestOnl
'isTest' => 'Boolean',
);
+ private static $has_one = array(
+ 'Self' => 'GridFieldFilterHeaderTest_DataObject',
+ );
+
} | Make sure that nested relations dont break | silverstripe_silverstripe-framework | train | php |
b6e2d1d97e7dc08b8d080537352a63aaeb66d30b | diff --git a/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/modules/ApplicationModuleFinder.java b/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/modules/ApplicationModuleFinder.java
index <HASH>..<HASH> 100644
--- a/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/modules/ApplicationModuleFinder.java
+++ b/bootstrap/src/main/java/org/wildfly/swarm/bootstrap/modules/ApplicationModuleFinder.java
@@ -79,6 +79,7 @@ public class ApplicationModuleFinder implements ModuleFinder {
builder.addDependency(DependencySpec.createModuleDependencySpec(ModuleIdentifier.create("org.jboss.msc")));
builder.addDependency(DependencySpec.createModuleDependencySpec(ModuleIdentifier.create("org.jboss.shrinkwrap")));
builder.addDependency(DependencySpec.createModuleDependencySpec(ModuleIdentifier.create("javax.api")));
+ builder.addDependency(DependencySpec.createModuleDependencySpec(ModuleIdentifier.create("sun.jdk")));
builder.addDependency(
DependencySpec.createModuleDependencySpec( | Add sun.jdk:main to swarm.application:main, to support jruby's weirdness. | wildfly-swarm-archive_ARCHIVE-wildfly-swarm | train | java |
ab766257002c0cd8e8be2b9ec26ce460e0b9750a | diff --git a/source/Mocka/ClassMock.php b/source/Mocka/ClassMock.php
index <HASH>..<HASH> 100644
--- a/source/Mocka/ClassMock.php
+++ b/source/Mocka/ClassMock.php
@@ -100,9 +100,11 @@ class ClassMock {
* @return MethodMock
*/
public function mockMethod($name) {
- $reflectionMethod = new \ReflectionMethod($this->_parentClassName, $name);
- if ($reflectionMethod->isFinal()) {
- throw new Exception('Cannot mock final method `' . $name . '`');
+ $reflectionClass = new \ReflectionClass($this->_parentClassName);
+ if ($reflectionClass->hasMethod($name)) {
+ if ($reflectionClass->getMethod($name)->isFinal()) {
+ throw new Exception('Cannot mock final method `' . $name . '`');
+ }
}
$this->_mockedMethods[$name] = new MethodMock();
return $this->_mockedMethods[$name];
@@ -126,7 +128,6 @@ class ClassMock {
return $method->invoke($arguments);
}
-
private function _load() {
$code = $this->generateCode();
eval($code); | Make sure method exists before checking if it's final | tomaszdurka_mocka | train | php |
72ae31fcc225cea1184ed75d82892a0d06339a19 | diff --git a/guava/src/com/google/common/html/HtmlEscapers.java b/guava/src/com/google/common/html/HtmlEscapers.java
index <HASH>..<HASH> 100644
--- a/guava/src/com/google/common/html/HtmlEscapers.java
+++ b/guava/src/com/google/common/html/HtmlEscapers.java
@@ -26,6 +26,9 @@ import com.google.common.escape.Escapers;
* attribute values and <em>most</em> elements' text contents. When possible,
* avoid manual escaping by using templating systems and high-level APIs that
* provide autoescaping.
+ * One Google-authored templating system available for external use is <a
+ * href="https://developers.google.com/closure/templates/">Closure
+ * Templates</a>.
*
* <p>HTML escaping is particularly tricky: For example, <a
* href="http://goo.gl/5TgZb">some elements' text contents must not be HTML | Link to one templating system as an example.
On issue <I>, I said that we try to steer people to templating systems, but that's kind of a weak claim at present.
<URL> | google_guava | train | java |
639d7f19905961e6ea6f1c874dca8a3278bc8988 | diff --git a/views/js/qtiCommonRenderer/helpers/sizeAdapter.js b/views/js/qtiCommonRenderer/helpers/sizeAdapter.js
index <HASH>..<HASH> 100644
--- a/views/js/qtiCommonRenderer/helpers/sizeAdapter.js
+++ b/views/js/qtiCommonRenderer/helpers/sizeAdapter.js
@@ -52,9 +52,11 @@ define([
$container.waitForMedia(function () {
adaptSize.height($elements);
- $(document).on( "load", 'link[rel="stylesheet"]', function() {
- adaptSize.height($elements);
- });
+ document.addEventListener("load", function(e) {
+ if (e.target.rel === "stylesheet") {
+ adaptSize.height($elements);
+ }
+ }, true);
});
}
}; | TAO-<I> Horizontal orientation is not properly in Preview mode | oat-sa_extension-tao-itemqti | train | js |
0909c7b8e8c229b6d95ff035a2b585ba5d5bd70a | diff --git a/src/Listener/Traits/FormTypeTrait.php b/src/Listener/Traits/FormTypeTrait.php
index <HASH>..<HASH> 100644
--- a/src/Listener/Traits/FormTypeTrait.php
+++ b/src/Listener/Traits/FormTypeTrait.php
@@ -47,18 +47,7 @@ trait FormTypeTrait
{
$action = $this->_action();
- $formSubmitButtonText = $action->getConfig('scaffold.form_submit_button_text');
- if ($formSubmitButtonText === null) {
- $formSubmitButtonText = $action->getConfig('scaffold.submit_button_text');
- if ($formSubmitButtonText !== null) {
- $this->deprecatedScaffoldKeyNotice(
- 'scaffold.submit_button_text',
- 'scaffold.form_submit_button_text'
- );
- }
- }
-
- return $formSubmitButtonText ?: __d('crud', 'Save');
+ return $action->getConfig('scaffold.form_submit_button_text') ?: __d('crud', 'Save');
}
/** | fix: remove deprecated method of setting the form submit button text | FriendsOfCake_crud-view | train | php |
b267865e3c6dd77f69d1aff1c11280683f0b62d4 | diff --git a/backend/impl/src/main/java/org/geomajas/internal/configuration/ConfigurationDtoPostProcessor.java b/backend/impl/src/main/java/org/geomajas/internal/configuration/ConfigurationDtoPostProcessor.java
index <HASH>..<HASH> 100644
--- a/backend/impl/src/main/java/org/geomajas/internal/configuration/ConfigurationDtoPostProcessor.java
+++ b/backend/impl/src/main/java/org/geomajas/internal/configuration/ConfigurationDtoPostProcessor.java
@@ -423,8 +423,11 @@ public class ConfigurationDtoPostProcessor {
layer.setMaxExtent(getClientMaxExtent(map.getCrs(), layer.getCrs(), layerInfo.getMaxExtent(), layerId));
completeScale(layer.getMaximumScale(), pixPerUnit);
completeScale(layer.getMinimumScale(), pixPerUnit);
+ completeScale(layer.getZoomToPointScale(), pixPerUnit);
log.debug("Layer " + layer.getId() + " has scale range : " + layer.getMinimumScale().getPixelPerUnit()
+ "," + layer.getMaximumScale().getPixelPerUnit());
+ log.debug("Layer " + layer.getId() + " has zoom-to-point scale : "
+ + layer.getZoomToPointScale().getPixelPerUnit());
if (layer instanceof ClientVectorLayerInfo) {
postProcess((ClientVectorLayerInfo) layer);
} | GBE-<I>: post-processing zoomToPointScale | geomajas_geomajas-project-client-gwt2 | train | java |
a428254eb0974de245ee5fe1d84aba07efbd2895 | diff --git a/lib/metasploit/model/version.rb b/lib/metasploit/model/version.rb
index <HASH>..<HASH> 100644
--- a/lib/metasploit/model/version.rb
+++ b/lib/metasploit/model/version.rb
@@ -8,8 +8,6 @@ module Metasploit
MINOR = 25
# The patch number, scoped to the {MINOR} version number.
PATCH = 2
- # The prerelease version, scoped to the {PATCH} version number.
- PRERELEASE = 'readme'
# The full version string, including the {MAJOR}, {MINOR}, {PATCH}, and optionally, the {PRERELEASE} in the
# {http://semver.org/spec/v2.0.0.html semantic versioning v2.0.0} format. | Remove PRERELEASE from version.rb | rapid7_metasploit-model | train | rb |
d4b26b61f6340eda85b3f35849114f5b3055c1a2 | diff --git a/src/Jaguar/Canvas/Drawable/AbstractDrawable.php b/src/Jaguar/Canvas/Drawable/AbstractDrawable.php
index <HASH>..<HASH> 100644
--- a/src/Jaguar/Canvas/Drawable/AbstractDrawable.php
+++ b/src/Jaguar/Canvas/Drawable/AbstractDrawable.php
@@ -60,5 +60,10 @@ abstract class AbstractDrawable implements DrawableInterface {
return $this->getColor()->equals($other->getColor());
}
+ /** clone the drawable*/
+ public function __clone() {
+ $this->color = clone $this->color;
+ }
+
} | Made AbstractDrawable Handle cloning colors when clone is called | hyyan_jaguar | train | php |
fafb44b7a84ccdd61e8ad6ca3a3ae04c96c8b300 | diff --git a/AuthManager.php b/AuthManager.php
index <HASH>..<HASH> 100755
--- a/AuthManager.php
+++ b/AuthManager.php
@@ -94,7 +94,7 @@ class AuthManager implements FactoryContract
return $this->{$driverMethod}($name, $config);
}
- throw new InvalidArgumentException("Auth guard driver [{$name}] is not defined.");
+ throw new InvalidArgumentException("Auth driver [{$config['driver']}] for guard [{$name}] is not defined.");
}
/** | [<I>] change error message for auth driver not defined (#<I>)
* change error message wording to make it clear that the driver is not defined
* include the name of the undefined driver in error | illuminate_auth | train | php |
b7b71cfce140515c79dcd94273b4d16668e6769b | diff --git a/tapes/__init__.py b/tapes/__init__.py
index <HASH>..<HASH> 100644
--- a/tapes/__init__.py
+++ b/tapes/__init__.py
@@ -1,5 +1,4 @@
-from datetime import datetime
-__version__ = '0.1.dev{}'.format(datetime.now().strftime('%Y%m%d%H%M%S'))
+__version__ = '0.1'
try:
# we need __version__ for setup.py, sphinx stuff, just to generally be nice, etc., | Freeze version to <I> | emilssolmanis_tapes | train | py |
a3e467ff811a0e8e01fe47d07f1c7c1044020fc0 | diff --git a/lib/run/index.js b/lib/run/index.js
index <HASH>..<HASH> 100644
--- a/lib/run/index.js
+++ b/lib/run/index.js
@@ -210,6 +210,7 @@ module.exports = function (options, callback) {
emitter.emit('assertion', (assertion.passed ? null : {
name: errorName,
index: assertion.index,
+ test: assertion.name,
message: _.get(assertion, 'error.message', assertion.name || ''),
stack: errorName + ': ' + _.get(assertion, 'error.message', '') + '\n' + | Added test name to failed assertion details | postmanlabs_newman | train | js |
a789ccc72db424ba91976ed44fa54418ab5bc0d2 | diff --git a/Tests/API/Repository/SetupFactory/Legacy.php b/Tests/API/Repository/SetupFactory/Legacy.php
index <HASH>..<HASH> 100644
--- a/Tests/API/Repository/SetupFactory/Legacy.php
+++ b/Tests/API/Repository/SetupFactory/Legacy.php
@@ -104,6 +104,12 @@ class Legacy extends BaseLegacy
/** END: eztags field type settings */
+ /** START: Look for storage dir in eZ Publish 5 web root */
+
+ $serviceSettings["parameters"]["storage_dir"] = "web/var/storage";
+
+ /** END: Look for storage dir in eZ Publish 5 web root */
+
$serviceSettings["persistence_handler_legacy"]["arguments"]["config"]["dsn"] = self::$dsn;
$serviceSettings["legacy_db_handler"]["arguments"]["dsn"] = self::$dsn; | Set storage dir to look into eZ Publish 5 storage folder | netgen_TagsBundle | train | php |
dd07a4a5b6bf959d855be1ae6ebd51c41deeaee8 | diff --git a/src/Call/Event/GeneratedEvent.php b/src/Call/Event/GeneratedEvent.php
index <HASH>..<HASH> 100644
--- a/src/Call/Event/GeneratedEvent.php
+++ b/src/Call/Event/GeneratedEvent.php
@@ -36,7 +36,9 @@ class GeneratedEvent extends AbstractCallEvent implements
if (null === $generator) {
$generator = call_user_func(
function () {
- if (false) yield; // @codeCoverageIgnore
+ if (false) {
+ yield; // @codeCoverageIgnore
+ }
}
);
} | FUCKING BULLSHIT YOU FUCKING CUNT | eloquent_phony | train | php |
213240ba7722a3769906069b1d60feb8ccbb7d3d | diff --git a/demo/tests/test_fields.py b/demo/tests/test_fields.py
index <HASH>..<HASH> 100644
--- a/demo/tests/test_fields.py
+++ b/demo/tests/test_fields.py
@@ -1,6 +1,8 @@
from django.test import TestCase
from django.core.urlresolvers import reverse
+import six
+
from agnocomplete.fields import (
AgnocompleteField,
AgnocompleteMultipleField,
@@ -38,6 +40,11 @@ class AgnocompleteInstanceTest(TestCase):
with self.assertRaises(UnregisteredAgnocompleteException):
AgnocompleteField('MEUUUUUUH')
+ def test_unicode(self):
+ field = AgnocompleteField(six.u('AutocompleteColor'))
+ self.assertTrue(field.agnocomplete)
+ self.assertTrue(isinstance(field.agnocomplete, AutocompleteColor))
+
def test_instance_url(self):
field = AgnocompleteField(AutocompleteColor())
self.assertFalse(field.agnocomplete.get_url()) | refs #<I> -- failing to load unicode objects as autocomplete class definition | peopledoc_django-agnocomplete | train | py |
3664a263a33cb87d802c1afc197e77c7e6e9330a | diff --git a/curdling/services/base.py b/curdling/services/base.py
index <HASH>..<HASH> 100644
--- a/curdling/services/base.py
+++ b/curdling/services/base.py
@@ -89,7 +89,7 @@ class Service(SignalEmitter):
except BaseException as exception:
self.logger.exception('%s.run(from="%s", data="%s") failed',
name, requester, sender_data)
- self.emit('failed', self.name, exception=exception)
+ self.emit('failed', self.name, exception=exception, **sender_data)
else:
self.logger.debug('%s.run(data="%s"): %s', name, sender_data, result)
self.emit('finished', self.name, **result) | Forward `sender_data` as well to subscribers of failed events | clarete_curdling | train | py |
b4efa3928b937144bf1e3976223deab98cf1ac23 | diff --git a/rtwilio/outgoing.py b/rtwilio/outgoing.py
index <HASH>..<HASH> 100644
--- a/rtwilio/outgoing.py
+++ b/rtwilio/outgoing.py
@@ -1,10 +1,10 @@
import pprint
import logging
-from twilio import TwilioRestException
from twilio.rest import TwilioRestClient
from rapidsms.backends.base import BackendBase
+from rapidsms.errors import MessageSendingError
logger = logging.getLogger(__name__)
@@ -38,12 +38,11 @@ class TwilioBackend(BackendBase):
logger.debug('POST data: %s' % pprint.pformat(data))
try:
self.client.sms.messages.create(**data)
- except TwilioRestException:
- # Twilio says the number is bad. Don't raise this error because
- # it will never succeed on retry
+ except Exception:
failed_identities.append(identity)
logger.exception("Failed to create Twilio message.")
- except Exception:
- logger.exception("Non-Twilio error.")
- raise
- return failed_identities
+ if failed_identities:
+ raise MessageSendingError(
+ "Messages to some identities failed.",
+ failed_identities=failed_identities
+ ) | Update to work with new RapidSMS API | caktus_rapidsms-twilio | train | py |
63319e8798e4e5781793730c21f94d3e8f48b18e | diff --git a/pylas/lasdatas/base.py b/pylas/lasdatas/base.py
index <HASH>..<HASH> 100644
--- a/pylas/lasdatas/base.py
+++ b/pylas/lasdatas/base.py
@@ -162,6 +162,8 @@ class LasBase(object):
Flag to indicate if you want the date to be compressed
"""
+ self.update_header()
+
if do_compress:
try:
_ = self.vlrs.index('ExtraBytesVlr') | Why was the call to update_header removed :thinking: | tmontaigu_pylas | train | py |
796002440cbac72803f55a62adfd574623159aae | diff --git a/lib/modelish/base.rb b/lib/modelish/base.rb
index <HASH>..<HASH> 100644
--- a/lib/modelish/base.rb
+++ b/lib/modelish/base.rb
@@ -11,23 +11,25 @@ module Modelish
include Validations
extend Configuration
- def initialize(attributes = {}, &block)
+ def initialize(options={}, &block)
super(&block)
self.class.defaults.each_pair do |prop, value|
self[prop] = value
end
+ attributes = options ? options.dup : {}
+
attributes.delete_if do |k,v|
if self.class.translations.keys.include?(k.to_sym)
self[k]=v
true
end
- end if attributes
+ end
attributes.each_pair do |att, value|
self[att] = value
- end if attributes
+ end
end | initializer shouldn't modify argument hash | G5_modelish | train | rb |
a81db0301330eff7264315c7ccdbb35e7760b183 | diff --git a/btnamespace/_version.py b/btnamespace/_version.py
index <HASH>..<HASH> 100644
--- a/btnamespace/_version.py
+++ b/btnamespace/_version.py
@@ -1 +1 @@
-__version__ = "2.0.0"
+__version__ = "2.1.0" | Bump to version <I> (#<I>) | venmo_btnamespace | train | py |
aa7a636c345f3a52684772e2fd19888d09fc2ca5 | diff --git a/src/widgets/remote/remote.js b/src/widgets/remote/remote.js
index <HASH>..<HASH> 100644
--- a/src/widgets/remote/remote.js
+++ b/src/widgets/remote/remote.js
@@ -113,7 +113,7 @@
this._requestsNr++;
this._isAborted = false;
- this.xhr = $.ajax ( _.extend ( {}, this.options.ajax, {
+ this.xhr = $.ajax ( _.extend ( {}, this.options.ajax, options, {
beforeSend: this.__beforesend.bind ( this ),
complete: this.__complete.bind ( this ),
error: this.__error.bind ( this ), | Remote: added support for passing options to `request` | svelto_svelto | train | js |
634dc14bc46fa29ab3284546fb46b155a703b13e | diff --git a/models/classes/class.UserService.php b/models/classes/class.UserService.php
index <HASH>..<HASH> 100644
--- a/models/classes/class.UserService.php
+++ b/models/classes/class.UserService.php
@@ -49,7 +49,7 @@ class taoDelivery_models_classes_UserService
* Overrides tao_models_classes_UserService to specify which class to use to instanciate
* new users.
*/
- public function getUserClass(){
+ public function getRootClass(){
$subjectsExt = common_ext_ExtensionsManager::singleton()->getExtensionById('taoSubjects');
$const = $subjectsExt->getConstant('TAO_CLASS_SUBJECT');
return new core_kernel_classes_Class($const); | * reworked SaSModule
* adapted campaign, group services and SaS actions
git-svn-id: <URL> | oat-sa_extension-tao-delivery | train | php |
cdf7c949bbbf4afed189ab9c2756d0ba96010913 | diff --git a/app/helpers/effective_resources_helper.rb b/app/helpers/effective_resources_helper.rb
index <HASH>..<HASH> 100644
--- a/app/helpers/effective_resources_helper.rb
+++ b/app/helpers/effective_resources_helper.rb
@@ -1,11 +1,13 @@
module EffectiveResourcesHelper
def simple_form_submit(form, options = {class: 'form-actions'}, &block)
+ resource = (@_effective_resource || Effective::Resource.new(controller_path))
+
content_tag(:div, class: options[:class]) do
[
form.button(:submit, 'Save', data: { disable_with: 'Saving...' }),
- form.button(:submit, 'Save and Continue', data: { disable_with: 'Saving...' }),
- form.button(:submit, 'Save and Add New', data: { disable_with: 'Saving...' }),
+ (form.button(:submit, 'Save and Continue', data: { disable_with: 'Saving...' }) if resource.index_path(check: true)),
+ (form.button(:submit, 'Save and Add New', data: { disable_with: 'Saving...' }) if resource.new_path(check: true)),
(capture(&block) if block_given?)
].compact.join(' ').html_safe
end | Only display save and continue, save and add new when appropriate | code-and-effect_effective_resources | train | rb |
febf438c3f55f50ebbd5b33da2c60ac147d1f420 | diff --git a/codespell.py b/codespell.py
index <HASH>..<HASH> 100755
--- a/codespell.py
+++ b/codespell.py
@@ -59,17 +59,10 @@ def parse_options(args):
def build_dict(filename):
- if filename == '-':
- f = sys.stdin
- else:
- f = open(filename, mode='r')
-
- for line in f:
- [key, data] = line.split('->')
- misspellings[key] = Mispell(data, data.find(',') + 1)
-
- if f != sys.stdin:
- f.close()
+ with open(filename, 'r') as f:
+ for line in f:
+ [key, data] = line.split('->')
+ misspellings[key] = Mispell(data, data.find(',') + 1)
def parse_file(filename, colors):
with open(filename, 'r') as f: | Do not accept dict from stdin
When checking patches instead of files, it's better to have the patch in
stdin and dict always as a file. Checking stdin instead of a file will
be added later. | codespell-project_codespell | train | py |
3a9ebb9de2c08e12b5cbf1e695b7daf226ed50b9 | diff --git a/src/Routing/MVC.php b/src/Routing/MVC.php
index <HASH>..<HASH> 100755
--- a/src/Routing/MVC.php
+++ b/src/Routing/MVC.php
@@ -245,7 +245,15 @@ class MVC
}
// Execute view method
- self::$views[$this->view]->$method($this->data);
+ $this->getCurrentViewObject()->$method($this->data);
+ }
+
+ /**
+ * @return View
+ */
+ public function getCurrentViewObject()
+ {
+ return self::$views[$this->view];
}
/** | Get view from mvc class in separated views | devp-eu_tmcms-core | train | php |
9906a0e05a1a08fcbba92c12687de7fee2653bcc | diff --git a/go/vt/vtctl/vtctl.go b/go/vt/vtctl/vtctl.go
index <HASH>..<HASH> 100644
--- a/go/vt/vtctl/vtctl.go
+++ b/go/vt/vtctl/vtctl.go
@@ -2001,6 +2001,7 @@ func commandVRWorkflow(ctx context.Context, wr *wrangler.Wrangler, subFlags *fla
_, err = wr.TopoServer().GetKeyspace(ctx, target)
if err != nil {
wr.Logger().Errorf("keyspace %s not found", target)
+ return err
}
vrwp := &wrangler.VReplicationWorkflowParams{
@@ -2057,6 +2058,11 @@ func commandVRWorkflow(ctx context.Context, wr *wrangler.Wrangler, subFlags *fla
if *sourceKeyspace == "" {
return fmt.Errorf("source keyspace is not specified")
}
+ _, err := wr.TopoServer().GetKeyspace(ctx, *sourceKeyspace)
+ if err != nil {
+ wr.Logger().Errorf("keyspace %s not found", *sourceKeyspace)
+ return err
+ }
if !*allTables && *tables == "" {
return fmt.Errorf("no tables specified to move")
} | vtctl: Add missing err checks for VReplication v2
Return error immediately if the target keyspace is unknown. Do
the same for the source keyspace. Currently, the code will
attempt to continue with a bad keyspace name. | vitessio_vitess | train | go |
8779e1feda71db035443904305e2d0bd32024b51 | diff --git a/wkhtmltopdf/test_settings.py b/wkhtmltopdf/test_settings.py
index <HASH>..<HASH> 100644
--- a/wkhtmltopdf/test_settings.py
+++ b/wkhtmltopdf/test_settings.py
@@ -4,6 +4,8 @@ DEBUG = True
DIRNAME = os.path.abspath(os.path.dirname(__file__))
+SECRET_KEY = 'fooooooo'
+
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', | Add SECRET_KEY to settings | incuna_django-wkhtmltopdf | train | py |
d48fd0283db1d49290108606ed0aeb8b6d2bc8c8 | diff --git a/test/es5.js b/test/es5.js
index <HASH>..<HASH> 100644
--- a/test/es5.js
+++ b/test/es5.js
@@ -2,9 +2,6 @@
// transpiling all the tests, which muddies the waters a bit
// So instead just making sure there are no syntax errors or issues with
// missing globals or methods
-require('@babel/core').transform('code', {
- plugins: ['transform-runtime'],
-});
const fetchMock = require('../es5/server');
fetchMock.mock('http://it.at.there/', 200); | stop relying on transform runtime plugin in node6 test | wheresrhys_fetch-mock | train | js |
f45991c8a7664b2cff76f47d97a95bdaba931b0a | diff --git a/cmd/argocd/commands/app_actions.go b/cmd/argocd/commands/app_actions.go
index <HASH>..<HASH> 100644
--- a/cmd/argocd/commands/app_actions.go
+++ b/cmd/argocd/commands/app_actions.go
@@ -160,7 +160,7 @@ func NewApplicationResourceActionsRunCommand(clientOpts *argocdclient.ClientOpti
if all {
commandTail += " --all"
}
- fmt.Printf("\nWarning: \"resume\" action has been deprecated. Please run the action as\n\n\targocd app run %s argoproj.io/Rollout/resume%s\n\n", appName, commandTail)
+ fmt.Printf("\nWarning: this syntax for running the \"resume\" action has been deprecated. Please run the action as\n\n\targocd app actions run %s argoproj.io/Rollout/resume%s\n\n", appName, commandTail)
} else {
group, kind, actionNameOnly = parseActionName(actionName)
} | Error with new `actions run` suggestion (#<I>) | argoproj_argo-cd | train | go |
fe5c055fc58408a6139452c39959cd977aae4160 | diff --git a/lib/arel/visitors/postgresql_jdbc.rb b/lib/arel/visitors/postgresql_jdbc.rb
index <HASH>..<HASH> 100644
--- a/lib/arel/visitors/postgresql_jdbc.rb
+++ b/lib/arel/visitors/postgresql_jdbc.rb
@@ -2,5 +2,5 @@ require 'arel/visitors/compat'
class Arel::Visitors::PostgreSQL
# AREL converts bind argument markers "?" to "$n" for PG, but JDBC wants "?".
- remove_method :visit_Arel_Nodes_BindParam
+ remove_method :visit_Arel_Nodes_BindParam if ArJdbc::AR42
end | Added missing AR<I> condition
Maybe it should be a test for AREL version, not AR version? | jruby_activerecord-jdbc-adapter | train | rb |
cff23e6c751dfafeff3a527bdcf5d6466f91a80a | diff --git a/dist/linter.js b/dist/linter.js
index <HASH>..<HASH> 100644
--- a/dist/linter.js
+++ b/dist/linter.js
@@ -15,7 +15,7 @@ class Config {
'img', 'input', 'keygen', 'link', 'meta',
'param', 'source', 'track', 'wbr'];
this.scopes = ['html', 'body', 'template', 'svg', 'math'];
- this.rules = [];
+ this.rules = null;
this.customRules = [];
}
} | set rules override to null | aurelia_template-lint | train | js |
1357de4b4858e1bfe934d6a2c9170eb36cb6adfa | diff --git a/src/GUI/GUI.js b/src/GUI/GUI.js
index <HASH>..<HASH> 100644
--- a/src/GUI/GUI.js
+++ b/src/GUI/GUI.js
@@ -36,7 +36,7 @@
*
* // output something in the console
* // when the object is clicked
- * onClick:function()
+ * onClick:function(event)
* {
* console.log("clicked!");
* // don't propagate the event
@@ -96,10 +96,10 @@
* function callback for the mousedown event
* @ignore
*/
- clicked : function() {
+ clicked : function(event) {
if (this.isClickable) {
this.updated = true;
- return this.onClick();
+ return this.onClick(event);
}
},
@@ -111,10 +111,10 @@
* @memberOf me.GUI_Object
* @public
* @function
+ * @param {Event} event the event object
*/
- onClick : function() {
-
- return true;
+ onClick : function(event) {
+ return false;
},
/** | more small enhancements to `GUI_Object`
- return false in the actual `onClick` function (to match the
documentation)
- propagate the event object to the `'onClick` function | melonjs_melonJS | train | js |
d9ce8e579d5560f0c21615c172acdb94ef80bb29 | diff --git a/lib/vagrant-vbguest/version.rb b/lib/vagrant-vbguest/version.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant-vbguest/version.rb
+++ b/lib/vagrant-vbguest/version.rb
@@ -1,3 +1,3 @@
module VagrantVbguest
- VERSION = "0.5.1"
+ VERSION = "0.6.0.pre0"
end | version bump to get a preview shipped | dotless-de_vagrant-vbguest | train | rb |
4c3c212ad5f719141622b998bb8e6624e639453b | diff --git a/src/Model/ModelManager.php b/src/Model/ModelManager.php
index <HASH>..<HASH> 100644
--- a/src/Model/ModelManager.php
+++ b/src/Model/ModelManager.php
@@ -400,7 +400,7 @@ class ModelManager implements ModelManagerInterface, LockInterface
* The ORM implementation does nothing special but you still should use
* this method when using the id in a URL to allow for future improvements.
*/
- public function getUrlsafeIdentifier($entity)
+ public function getUrlSafeIdentifier($entity)
{
return $this->getNormalizedIdentifier($entity);
} | Fix camel case for `ModelManager::getUrlSafeIdentifier` method | sonata-project_SonataDoctrineORMAdminBundle | train | php |
b7c1822c4b5443de81e54bdf247cac04378933c4 | diff --git a/src/components/dialogs/show/show.js b/src/components/dialogs/show/show.js
index <HASH>..<HASH> 100644
--- a/src/components/dialogs/show/show.js
+++ b/src/components/dialogs/show/show.js
@@ -73,7 +73,7 @@ var Show = Dialog.extend({
- var data = this.model.entities.getAllPossibleEntities();
+ var data = this.model.state.entities.getAllPossibleEntities();
//sort data alphabetically
data.sort(function(a, b) { | Fix a typo that distrurbed mountain chart and bar rank chart | vizabi_vizabi | train | js |
a4567a915c0fb2b7ec2fba70d5cdd1141e08ca00 | diff --git a/statik/__init__.py b/statik/__init__.py
index <HASH>..<HASH> 100644
--- a/statik/__init__.py
+++ b/statik/__init__.py
@@ -1,3 +1,3 @@
# -*- coding:utf-8 -*-
-__version__ = "0.18.1"
+__version__ = "0.18.2" | bumping version to <I> | thanethomson_statik | train | py |
bed22591c673e8f3c231bda48a644831940ae991 | diff --git a/docroot/modules/custom/ymca_retention/src/LeaderboardManager.php b/docroot/modules/custom/ymca_retention/src/LeaderboardManager.php
index <HASH>..<HASH> 100644
--- a/docroot/modules/custom/ymca_retention/src/LeaderboardManager.php
+++ b/docroot/modules/custom/ymca_retention/src/LeaderboardManager.php
@@ -99,15 +99,18 @@ class LeaderboardManager implements LeaderboardManagerInterface {
$branch_ids[] = $branch['branch'];
}
- // Find location names for found branch ids.
- $location_ids = \Drupal::entityQuery('mapping')
- ->condition('type', 'location')
- ->condition('field_groupex_id', $branch_ids, 'IN')
- ->execute();
-
- $locations = \Drupal::entityTypeManager()
- ->getStorage('mapping')
- ->loadMultiple($location_ids);
+ $locations = [];
+ if ($branch_ids) {
+ // Find location names for found branch ids.
+ $location_ids = \Drupal::entityQuery('mapping')
+ ->condition('type', 'location')
+ ->condition('field_groupex_id', $branch_ids, 'IN')
+ ->execute();
+
+ $locations = \Drupal::entityTypeManager()
+ ->getStorage('mapping')
+ ->loadMultiple($location_ids);
+ }
$locations_list = [
[ | [YSR-<I>] Fixed exception when there are no registered users yet. | ymcatwincities_openy | train | php |
c4f29c51408b9be6ad513d0eaf9e303ac12a19eb | diff --git a/packages/chord/src/ChordCanvas.js b/packages/chord/src/ChordCanvas.js
index <HASH>..<HASH> 100644
--- a/packages/chord/src/ChordCanvas.js
+++ b/packages/chord/src/ChordCanvas.js
@@ -88,7 +88,8 @@ class ChordCanvas extends Component {
this.ctx.translate(centerX, centerY)
- this.ctx.font = `${theme.labels.text.fontSize}px sans-serif`
+ this.ctx.font = `${theme.labels.text.fontSize}px ${theme.labels.text.fontFamily ||
+ 'sans-serif'}`
ribbonGenerator.context(this.ctx)
ribbons.forEach(ribbon => {
diff --git a/website/src/nivoTheme.js b/website/src/nivoTheme.js
index <HASH>..<HASH> 100644
--- a/website/src/nivoTheme.js
+++ b/website/src/nivoTheme.js
@@ -89,6 +89,8 @@ export const lightTheme = {
labels: {
text: {
fill: '#555',
+ fontSize: 12,
+ fontWeight: 500,
},
},
} | feat(chord): add support for font style for ChordCanvas | plouc_nivo | train | js,js |
c77fb755357b76b06ce4162ac6412b1363c3369b | diff --git a/tests/perf_unicorn.py b/tests/perf_unicorn.py
index <HASH>..<HASH> 100644
--- a/tests/perf_unicorn.py
+++ b/tests/perf_unicorn.py
@@ -4,7 +4,7 @@ import os
import time
import angr
-import angr.options as so
+from angr import options as so
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../'))
@@ -19,6 +19,9 @@ def perf_unicorn_0():
pg_unicorn.run()
elapsed = time.time() - start
+ if len(pg_unicorn.errored) > 0:
+ pg_unicorn.errored[0].debug()
+
print "Elapsed %f sec" % elapsed
print pg_unicorn.one_deadended
@@ -33,6 +36,9 @@ def perf_unicorn_1():
pg_unicorn.run()
elapsed = time.time() - start
+ if len(pg_unicorn.errored) > 0:
+ pg_unicorn.errored[0].debug()
+
print "Elapsed %f sec" % elapsed
print pg_unicorn.one_deadended | tests/perf_unicorn.py: fix import error
`import angr.options` does not work anymore (the module is now named
`sim_options`) | angr_angr | train | py |
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.