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 |
|---|---|---|---|---|---|
475469b7ac1944491224174cbe17a6310c5a8037 | diff --git a/lib/ITip/Broker.php b/lib/ITip/Broker.php
index <HASH>..<HASH> 100644
--- a/lib/ITip/Broker.php
+++ b/lib/ITip/Broker.php
@@ -936,9 +936,9 @@ class Broker {
if (isset($attendees[$attendee->getNormalizedValue()])) {
$attendees[$attendee->getNormalizedValue()]['instances'][$recurId] = [
- 'id' => $recurId,
- 'partstat' => $partStat,
- 'force-send' => $forceSend,
+ 'id' => $recurId,
+ 'partstat' => $partStat,
+ 'forceSend' => $forceSend,
];
} else {
$attendees[$attendee->getNormalizedValue()] = [ | Fix obvious typo in SCHEDULE-FORCE-SEND handling (#<I>) | sabre-io_vobject | train | php |
42f1dc25b8a4e5a38abb4be96f4d36d7c3f1b3b6 | diff --git a/lib/translations/cs_CZ.js b/lib/translations/cs_CZ.js
index <HASH>..<HASH> 100644
--- a/lib/translations/cs_CZ.js
+++ b/lib/translations/cs_CZ.js
@@ -9,7 +9,8 @@ jQuery.extend( jQuery.fn.pickadate.defaults, {
clear: 'vymazat',
firstDay: 1,
format: 'd. mmmm yyyy',
- formatSubmit: 'yyyy/mm/dd'
+ formatSubmit: 'yyyy/mm/dd',
+ close: 'zavřít'
});
jQuery.extend( jQuery.fn.pickatime.defaults, { | Update cs_CZ.js
Added close option translation | amsul_pickadate.js | train | js |
f133e73434c8b3cc6ddab0de43afbf30ecca2124 | diff --git a/heron/tools/cli/src/python/restart.py b/heron/tools/cli/src/python/restart.py
index <HASH>..<HASH> 100644
--- a/heron/tools/cli/src/python/restart.py
+++ b/heron/tools/cli/src/python/restart.py
@@ -66,9 +66,13 @@ def run(command, parser, cl_args, unknown_args):
Log.debug("Restart Args: %s", cl_args)
container_id = cl_args['container-id']
+ message = "restart topology"
+ if container_id >= 0:
+ message = "restart container " + str(container_id) + " of topology"
+
if cl_args['deploy_mode'] == config.SERVER_MODE:
dict_extra_args = {"container_id": str(container_id)}
- return cli_helper.run_server(command, cl_args, "restart topology", extra_args=dict_extra_args)
+ return cli_helper.run_server(command, cl_args, message, extra_args=dict_extra_args)
else:
list_extra_args = ["--container_id", str(container_id)]
- return cli_helper.run_direct(command, cl_args, "restart topology", extra_args=list_extra_args)
+ return cli_helper.run_direct(command, cl_args, message, extra_args=list_extra_args) | Update output message of restart command to include container id (#<I>) | apache_incubator-heron | train | py |
c8d10da11d1bea991a508b00c04e03c45ba2ed5d | diff --git a/subsystem/render.js b/subsystem/render.js
index <HASH>..<HASH> 100644
--- a/subsystem/render.js
+++ b/subsystem/render.js
@@ -57,6 +57,9 @@ phoxy._.render =
{
phoxy._.render.CheckIfMultiplySpawned(target, ejs, data);
phoxy._.render.Replace.call(phoxy, target, obj.html, arguments);
+
+ // Flag ENJS that anchor appeared
+ obj.try_discover_dom();
}
function async_strategy_birth(obj, ejs, data)
@@ -89,6 +92,9 @@ phoxy._.render =
{
phoxy._.render.AfterENJSFinished(target, obj, ejs, data, rendered_callback);
phoxy._.render.Replace.call(phoxy, target, obj.html, arguments);
+
+ // Flag ENJS that anchor appeared
+ obj.try_discover_dom();
}
phoxy._.time.Appeared(target, sync_strategy_wait_for_apperance); | Speedup ENJS render by flagging ancor is appeared | phoxy_phoxy | train | js |
172349d634a015b6aebb02ec5c17b53dcbf9eabf | diff --git a/bin/templates/scripts/cordova/lib/build.js b/bin/templates/scripts/cordova/lib/build.js
index <HASH>..<HASH> 100644
--- a/bin/templates/scripts/cordova/lib/build.js
+++ b/bin/templates/scripts/cordova/lib/build.js
@@ -95,7 +95,7 @@ module.exports.run = function (buildOpts) {
var pathToApp = path.join(buildOutputDir, projectName + '.app');
var pathToIpa = path.join(buildOutputDir, projectName + '.ipa');
var xcRunArgs = ['-sdk', 'iphoneos', 'PackageApplication',
- '-v', pathToApp,
+ pathToApp,
'-o', pathToIpa];
if (buildOpts.codeSignIdentity) {
xcRunArgs.concat('--sign', buildOpts.codeSignIdentity); | CB-<I> - Remove verbose mode from xcrun in build.js to prevent logging of environment variables. | apache_cordova-ios | train | js |
21e35c4bd3c75d4f803ec8c76422e26f1bd62a33 | diff --git a/renderer/tasks/patch.js b/renderer/tasks/patch.js
index <HASH>..<HASH> 100644
--- a/renderer/tasks/patch.js
+++ b/renderer/tasks/patch.js
@@ -22,6 +22,9 @@ module.exports = function(project) {
let projectName = path.join( project.workpath, project.template );
let replaceToPath = path.join( process.cwd(), project.workpath, path.sep); // absolute path
+ // escape single backslash to double in win
+ replaceToPath = replaceToPath.replace('\\', '\\\\');
+
// read project file contents
fs.readFile(projectName, (err, bin) => {
if (err) return reject(err); | fix for esacping backslash for pathcer | inlife_nexrender | train | js |
9512b82ae9e814ffb058b38c37791937707691e0 | diff --git a/sacred/observers/mongo.py b/sacred/observers/mongo.py
index <HASH>..<HASH> 100644
--- a/sacred/observers/mongo.py
+++ b/sacred/observers/mongo.py
@@ -130,7 +130,7 @@ class MongoObserver(RunObserver):
def completed_event(self, stop_time, result):
self.run_entry['stop_time'] = stop_time
- self.run_entry['result'] = result
+ self.run_entry['result'] = flatten(result)
self.run_entry['status'] = 'COMPLETED'
self.final_save(attempts=10) | Added flattening for results (to handle returned numpy arrays) | IDSIA_sacred | train | py |
1932938b933866e27de31bf3860d8f7070a8530a | diff --git a/lib/CORL/machine/raspberrypi.rb b/lib/CORL/machine/raspberrypi.rb
index <HASH>..<HASH> 100644
--- a/lib/CORL/machine/raspberrypi.rb
+++ b/lib/CORL/machine/raspberrypi.rb
@@ -107,7 +107,10 @@ class Raspberrypi < Nucleon.plugin_class(:CORL, :machine)
def reload(options = {})
super do
- node.command('reboot', { :as_admin => true })
+ success = node.command('reboot', { :as_admin => true })
+ sleep 5
+ sleep 1 until running?
+ success
end
end | Adding a wait for reboot completion to the reload method of the raspberry pi machine provider. | coralnexus_corl | train | rb |
6d028c755fe64903c852b018d1622a092da349d6 | diff --git a/ui/src/kapacitor/containers/KapacitorPage.js b/ui/src/kapacitor/containers/KapacitorPage.js
index <HASH>..<HASH> 100644
--- a/ui/src/kapacitor/containers/KapacitorPage.js
+++ b/ui/src/kapacitor/containers/KapacitorPage.js
@@ -68,11 +68,18 @@ class KapacitorPage extends Component {
handleSubmit(e) {
e.preventDefault()
- const {addFlashMessage, source, params, router} = this.props
+ const {
+ addFlashMessage,
+ source,
+ source: {kapacitors = []},
+ params,
+ router,
+ } = this.props
const {kapacitor} = this.state
- const kapNames = source.kapacitors.map(k => k.name)
- if (kapNames.includes(kapacitor.name)) {
+ const isNameTaken = kapacitors.some(k => k.name === kapacitor.name)
+
+ if (isNameTaken) {
addFlashMessage({
type: 'error',
text: `There is already a Kapacitor configuration named "${kapacitor.name}"`, | Fix inability to add kapacitor from source page
The kapacitors array on source was not yet defined. So, I added
a default empty array to the kapacitors key off of source. Also,
cleaned up some logic regarding the duplication of kapacitor names. | influxdata_influxdb | train | js |
961b261e7af2d4b93bc7fdf49cae6ea4c79c718e | diff --git a/src/oauth/JiraOAuthServiceProvider.php b/src/oauth/JiraOAuthServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/oauth/JiraOAuthServiceProvider.php
+++ b/src/oauth/JiraOAuthServiceProvider.php
@@ -25,6 +25,7 @@ use Silex\Application;
use Silex\ServiceProviderInterface;
use GuzzleHttp\Client;
use GuzzleHttp\Subscriber\Oauth\Oauth1;
+use Exception;
class JiraOAuthServiceProvider implements ServiceProviderInterface {
protected $config; | oauth: Add missing use statement
PHP Exception was use without a proper use statement, possible leading
to a wrong inclusion. | bmwcarit_silex-jira-oauth-provider | train | php |
e1f0ddd0f839158e9de679b04008d6f76fc3c12a | diff --git a/code/AssetGalleryField.php b/code/AssetGalleryField.php
index <HASH>..<HASH> 100644
--- a/code/AssetGalleryField.php
+++ b/code/AssetGalleryField.php
@@ -242,7 +242,7 @@ class AssetGalleryField extends FormField {
Requirements::css(ASSET_GALLERY_FIELD_DIR . "/public/dist/main.css");
Requirements::javascript(ASSET_GALLERY_FIELD_DIR . "/public/dist/bundle.js");
Requirements::customScript("
- window.SS_ASSET_GALLERY = window.SS_ASSET_GALLEY || {};
+ window.SS_ASSET_GALLERY = window.SS_ASSET_GALLERY || {};
window.SS_ASSET_GALLERY['{$name}'] = {$items};
"); | BUGFIX: Fix typo in JS global var | silverstripe_silverstripe-asset-admin | train | php |
00cd31d92fee0451784a95ee7c4eb0c3131def27 | diff --git a/closure/goog/editor/plugin.js b/closure/goog/editor/plugin.js
index <HASH>..<HASH> 100644
--- a/closure/goog/editor/plugin.js
+++ b/closure/goog/editor/plugin.js
@@ -320,7 +320,7 @@ goog.editor.Plugin.prototype.handleSelectionChange;
* in conjunction with ctrl/meta keys OR when a small subset of keys (defined
* in goog.editor.Field.POTENTIAL_SHORTCUT_KEYCODES_) are pressed without
* ctrl/meta keys. We specifically don't invoke it when altKey is pressed since
- * alt key is used in many i8n UIs to enter certain characters.
+ * alt key is used in many i18n UIs to enter certain characters.
* @param {!goog.events.BrowserEvent} e The browser event.
* @param {string} key The key pressed.
* @param {boolean} isModifierPressed Whether the ctrl/meta key was pressed or | Very minor fix on a comment found while trying to verify that I had eradicated that misspelling in my own code.
RELNOTES: n/a
-------------
Created by MOE: <URL> | google_closure-library | train | js |
5ed4c3f2908ed79bb7acf0080826db18e0ef46ce | diff --git a/main.go b/main.go
index <HASH>..<HASH> 100644
--- a/main.go
+++ b/main.go
@@ -71,11 +71,13 @@ func Open(dialect string, args ...interface{}) (db *DB, err error) {
dialect: newDialect(dialect, dbSQL),
}
db.parent = db
-
- if err == nil {
- // Send a ping to make sure the database connection is alive.
- if err = db.DB().Ping(); err != nil {
- db.DB().Close()
+ if err != nil {
+ return
+ }
+ // Send a ping to make sure the database connection is alive.
+ if d, ok := dbSQL.(*sql.DB); ok {
+ if err = d.Ping(); err != nil {
+ d.Close()
}
}
return | Allow open to take transaction.
Need to skip the ping, otherwise results in a nil dereference. | jinzhu_gorm | train | go |
0d617922e312d8a2f6f70e1dc766017e953f57e6 | diff --git a/src/modules/addimage.js b/src/modules/addimage.js
index <HASH>..<HASH> 100644
--- a/src/modules/addimage.js
+++ b/src/modules/addimage.js
@@ -49,6 +49,7 @@
JPEG2000: [[0x00, 0x00, 0x00, 0x0C, 0x6A, 0x50, 0x20, 0x20]],
GIF87a: [[0x47, 0x49, 0x46, 0x38, 0x37, 0x61]],
GIF89a: [[0x47, 0x49, 0x46, 0x38, 0x39, 0x61]],
+ WEBP: [[0x52,0x49,0x46,0x46,undefined, undefined, undefined, undefined, 0x57, 0x45, 0x42, 0x50]],
BMP: [
[0x42, 0x4D], //BM - Windows 3.1x, 95, NT, ... etc.
[0x42, 0x41], //BA - OS/2 struct bitmap array | Add WebP FileRecognition (but not support) (#<I>)
* add webp recognition
* formatting | MrRio_jsPDF | train | js |
09e05248923b8aba2f4c0589ed2d49a4e597a06d | diff --git a/tensorflow_probability/python/edward2/__init__.py b/tensorflow_probability/python/edward2/__init__.py
index <HASH>..<HASH> 100644
--- a/tensorflow_probability/python/edward2/__init__.py
+++ b/tensorflow_probability/python/edward2/__init__.py
@@ -12,7 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
-"""Edward2 probabilistic programming language."""
+
+"""Edward2 probabilistic programming language.
+
+For user guides, see:
+
++ [Overview](
+ https://github.com/tensorflow/probability/blob/master/tensorflow_probability/python/edward2/README.md)
++ [Upgrading from Edward to Edward2](
+ https://github.com/tensorflow/probability/blob/master/tensorflow_probability/python/edward2/Upgrading_From_Edward_To_Edward2.md)
+
+"""
from __future__ import absolute_import
from __future__ import division | Point to Edward2 user guides from API.
The Edward2 module API is currently barebones:
<URL> | tensorflow_probability | train | py |
e0c18cf91705080685cd5f4bf37924505ab67987 | diff --git a/app/helpers/remote_execution_helper.rb b/app/helpers/remote_execution_helper.rb
index <HASH>..<HASH> 100644
--- a/app/helpers/remote_execution_helper.rb
+++ b/app/helpers/remote_execution_helper.rb
@@ -62,6 +62,10 @@ module RemoteExecutionHelper
def template_invocation_status(task)
if task.nil?
icon_text('question', 'N/A', :kind => 'fa')
+ elsif task.state == 'running'
+ icon_text('running', _('running'), :kind => 'pficon')
+ elsif task.state == 'planned'
+ icon_text('build', _('planned'), :kind => 'pficon')
else
case task.result
when 'warning', 'error'
@@ -72,8 +76,6 @@ module RemoteExecutionHelper
end
when 'success'
icon_text('ok', _('success'), :kind => 'pficon')
- when 'pending'
- icon_text('question', _('pending'), :kind => 'fa')
else
task.result
end | Fixes #<I> - Distinguish between planned and running | theforeman_foreman_remote_execution | train | rb |
504a1e282d7b089b7198b28039d2230b5952fecb | diff --git a/lib/client_side_validations/action_view/form_helper.rb b/lib/client_side_validations/action_view/form_helper.rb
index <HASH>..<HASH> 100644
--- a/lib/client_side_validations/action_view/form_helper.rb
+++ b/lib/client_side_validations/action_view/form_helper.rb
@@ -41,9 +41,9 @@ module ClientSideValidations::ActionView::Helpers
options[:html][:validate] = true if options[:validate]
end
- def fields_for(record_or_name_or_array, *args, &block)
+ def fields_for(record_or_name_or_array, record_object = nil, options = {}, &block)
output = super
- @validators.merge!(args.last[:validators]) if @validators
+ @validators.merge!(options[:validators]) if @validators
output
end | fields_for incorrectly assumed that *args would not be nil | DavyJonesLocker_client_side_validations | train | rb |
aa9b0932ecf2b35794de3836a1abb2cab39650de | diff --git a/activesupport/lib/active_support/notifications/instrumenter.rb b/activesupport/lib/active_support/notifications/instrumenter.rb
index <HASH>..<HASH> 100644
--- a/activesupport/lib/active_support/notifications/instrumenter.rb
+++ b/activesupport/lib/active_support/notifications/instrumenter.rb
@@ -56,8 +56,9 @@ module ActiveSupport
def self.clock_gettime_supported? # :nodoc:
defined?(Process::CLOCK_PROCESS_CPUTIME_ID) &&
- !Gem.win_platform?
+ !Gem.win_platform?
end
+ private_class_method :clock_gettime_supported?
def initialize(name, start, ending, transaction_id, payload)
@name = name | Don't expose internal `clock_gettime_supported?` class method | rails_rails | train | rb |
b3574af866131e239ce85a862638f9c25b568b11 | diff --git a/ng-device-detector.js b/ng-device-detector.js
index <HASH>..<HASH> 100644
--- a/ng-device-detector.js
+++ b/ng-device-detector.js
@@ -17,9 +17,9 @@ angular.module("ng.deviceDetector",[])
firefoxos:/\bFirefox\b/.test(ua) && /\Mobile\b/.test(ua)
},
browser:{
- chrome:/\bChrome\b/.test(ua),
+ chrome:/\bChrome\b/.test(ua) || /\bCriOS\b/.test(ua),
firefox:/\Firefox\b/.test(ua),
- safari:/\Safari\b/.test(ua),
+ safari:/^((?!CriOS).)*\Safari\b.*$/.test(ua),
opera:/\Opera\b/.test(ua),
ie:/\bMSIE\b/.test(ua) || /\Trident\b/.test(ua),
}, | chrome on ipad erroneously was detected as safari
resolves #<I> | srfrnk_ng-device-detector | train | js |
645abdc9275db97270532b77896a3e926f967203 | diff --git a/RAKE/RAKE.py b/RAKE/RAKE.py
index <HASH>..<HASH> 100644
--- a/RAKE/RAKE.py
+++ b/RAKE/RAKE.py
@@ -7,6 +7,7 @@ from __future__ import absolute_import
import re
import operator
+import io
__all__ = [
'Rake',
@@ -63,7 +64,9 @@ def RanksNLStoplist():
def load_stop_words(stop_word_file, regex):
- with open(stop_word_file, encoding='utf8') as stop_word_file:
+ # Looks like using `io.open()` is needed for compatibility support
+ # https://stackoverflow.com/a/25050323/845248
+ with io.open(stop_word_file, encoding='utf8') as stop_word_file:
stop_words = re.split(regex, stop_word_file.read())
return [word for word in stop_words if word not in ('', ' ')] # filters empty string matches | Updated to explicitly use for compatiblity support | fabianvf_python-rake | train | py |
c8dfe158ad0d28ad62965d5da9fb8dc860251be0 | diff --git a/redis/commands/core.py b/redis/commands/core.py
index <HASH>..<HASH> 100644
--- a/redis/commands/core.py
+++ b/redis/commands/core.py
@@ -1244,7 +1244,7 @@ class BasicKeyCommands:
pushing it as the first/last element on the destination list.
Returns the element being popped and pushed.
- For more information check https://redis.io/commands/lmov
+ For more information check https://redis.io/commands/lmove
"""
params = [first_list, second_list, src, dest]
return self.execute_command("LMOVE", *params) | Fix link in lmove docstring (#<I>) | andymccurdy_redis-py | train | py |
ede995ac610ba3b0bd57a53779f32eb81646b613 | diff --git a/lib/client.js b/lib/client.js
index <HASH>..<HASH> 100755
--- a/lib/client.js
+++ b/lib/client.js
@@ -175,7 +175,7 @@ ImboClient.prototype.addImageFromBlob = function(blob, callback) {
}
- callback(undefined, res.headers['x-imbo-image-identifier'], res);
+ callback(undefined, res.headers['x-imbo-imageidentifier'], res);
}
});
}.bind(this)); | Image identifier header does not contain a dash between 'image' and 'identifier' | imbo_imboclient-js | train | js |
e8d5b7505a6f0a164b6b7366748f2ccf1ca7ecde | diff --git a/event.py b/event.py
index <HASH>..<HASH> 100644
--- a/event.py
+++ b/event.py
@@ -56,3 +56,34 @@ class Subscriber(object):
def on_event(self, event, **data):
func = getattr(self, 'on_%s' % event, None)
if func: func(**data)
+
+
+class Collector(object):
+ """ Collects events from multiple channels and broadcasts them into one. """
+
+ def __init__(self, output, *inputs):
+ self.output = output
+ self.inputs = inputs
+ for channel in self.inputs:
+ channel.subscribe(self)
+
+ def set_inputs(self, inputs):
+ for channel in self.inputs:
+ channel.unsubscribe(self)
+ self.inputs = inputs
+ for channel in self.inputs:
+ channel.subscribe(self)
+
+ def on_event(self, event, **data):
+ self.output.broadcast(event, **data)
+
+
+class Distributor(object):
+ """ Passes any event to multiple channels. """
+
+ def __init__(self, *channels):
+ self.channels = channels
+
+ def on_event(self, event, **data):
+ for channel in self.channels:
+ channel.broadcast(event, **data) | Add Collector and Distributor classes for extended event messaging | Gjum_agarnet | train | py |
afac120c41f6c53d82e1c118fa970ac0e051c746 | diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -134,11 +134,6 @@ describe('electricity.static', function() {
it('sends a 302 redirect if the hash does not match the current file', function(done) {
var redirected = false;
req.path = '/robots-ca121b5d03245bf82db00d1455555555.txt';
- req.get = function(header) {
- if (header == 'Host') {
- return 'test.com';
- }
- }
res = {
redirect: function(url) {
if (url === '/robots-ca121b5d03245bf82db00d14cee04e22.txt') {
@@ -164,11 +159,6 @@ describe('electricity.static', function() {
var statusSet = false;
req.path = '/robots-ca121b5d03245bf82db00d14cee04e22.txt';
req.method = 'HEAD';
- req.get = function(header) {
- if (header == 'Host') {
- return 'test.com';
- }
- };
res = {
set: function(headers) {
var mtime = fs.statSync('test/public/robots.txt').mtime; | Cleaned up fake Host header from request mocks | mediocre_electricity | train | js |
5ace54a0fce35c1617be532e6e5e1157f3f13c42 | diff --git a/backtrader/plot/plot.py b/backtrader/plot/plot.py
index <HASH>..<HASH> 100644
--- a/backtrader/plot/plot.py
+++ b/backtrader/plot/plot.py
@@ -173,6 +173,9 @@ class Plot_OldSync(with_metaclass(MetaParams, object)):
# Create the rest on a per data basis
dt0, dt1 = self.pinf.xreal[0], self.pinf.xreal[-1]
for data in strategy.datas:
+ if not data.plotinfo.plot:
+ continue
+
self.pinf.xdata = self.pinf.x
if len(data) < self.pinf.xlen:
self.pinf.xdata = xdata = [] | Correct no-plotting of datas | backtrader_backtrader | train | py |
5e9bacf6654552ef20648c8fc64d041e98d61b7f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -36,4 +36,5 @@ setup(
'test': ['coverage', 'pytest', 'pytest-watch', 'tox',
'python-dateutil>=2.6.1,<3']
},
+ test_suite='tests',
) | Add testsuite to setup.py | RuneHistory_pyrunehistory | train | py |
46b629e259f81a5b0c832955a1f5f143443b6ecc | diff --git a/src/MediaCollections/Commands/CleanCommand.php b/src/MediaCollections/Commands/CleanCommand.php
index <HASH>..<HASH> 100644
--- a/src/MediaCollections/Commands/CleanCommand.php
+++ b/src/MediaCollections/Commands/CleanCommand.php
@@ -23,7 +23,8 @@ class CleanCommand extends Command
protected $signature = 'media-library:clean {modelType?} {collectionName?} {disk?}
{--dry-run : List files that will be removed without removing them},
{--force : Force the operation to run when in production},
- {--rate-limit= : Limit the number of requests per second }';
+ {--rate-limit= : Limit the number of requests per second },
+ {--skip-conversions: Do not remove deprecated conversions}';
protected $description = 'Clean deprecated conversions and files without related model.';
@@ -56,8 +57,10 @@ class CleanCommand extends Command
$this->isDryRun = $this->option('dry-run');
$this->rateLimit = (int) $this->option('rate-limit');
-
- $this->deleteFilesGeneratedForDeprecatedConversions();
+
+ if(!$this->option('skip-conversions') {
+ $this->deleteFilesGeneratedForDeprecatedConversions();
+ }
$this->deleteOrphanedDirectories(); | Update CleanCommand.php (#<I>)
* Update CleanCommand.php
Add the option to skip 'deprecated conversions' when cleaning the media directory.
* Update CleanCommand.php | spatie_laravel-medialibrary | train | php |
c620864ad807ad56a4b643ad40f7ba4c85129eb0 | diff --git a/matgendb/creator.py b/matgendb/creator.py
index <HASH>..<HASH> 100644
--- a/matgendb/creator.py
+++ b/matgendb/creator.py
@@ -130,7 +130,7 @@ class VaspToDbTaskDrone(AbstractDrone):
self.update_duplicates = update_duplicates
self.mapi_key = mapi_key
if not simulate_mode:
- conn = MongoClient(self.host, self.port)
+ conn = MongoClient(self.host, self.port, j=True)
db = conn[self.database]
if self.user:
db.authenticate(self.user, self.password) | Enable journalling in VasptoTaskDrone. | materialsproject_pymatgen-db | train | py |
a1da11c625156c4cc0da888ec5f564bc7294f914 | diff --git a/fc/io.py b/fc/io.py
index <HASH>..<HASH> 100644
--- a/fc/io.py
+++ b/fc/io.py
@@ -679,7 +679,9 @@ class FCSData(np.ndarray):
def __getitem__(self, key):
"""
- Extended __getitem__ function.
+ Get an element or elements of the array.
+
+ This function extends ``ndarray.__getitem__``.
If the second value of the provided `key` is a string corresponding
to a valid channel name, this function converts it to a number and
@@ -744,7 +746,9 @@ class FCSData(np.ndarray):
def __setitem__(self, key, item):
"""
- Extended __setitem__ function.
+ Set an element or elements of the array.
+
+ This function extends ``ndarray.__setitem__``.
If the second value of the provided `key` is a string corresponding
to a valid channel name, this function converts it to a number and | Changed summary line in FCSData.__getitem__ and FCSData.__setitem__. | taborlab_FlowCal | train | py |
0d52c69a5928dd6af394a2a85edb3d146fbe1ba0 | diff --git a/tibber/__init__.py b/tibber/__init__.py
index <HASH>..<HASH> 100644
--- a/tibber/__init__.py
+++ b/tibber/__init__.py
@@ -475,7 +475,13 @@ class TibberHome:
currency
minPower
averagePower
- maxPower
+ maxPower
+ voltagePhase1
+ voltagePhase2
+ voltagePhase3
+ currentPhase1
+ currentPhase2
+ currentPhase3
}
}
''' % self.home_id) | Add voltage and current phase (#<I>) | Danielhiversen_pyTibber | train | py |
a1eee6326967209ac0a4984d915086e673a99c1e | diff --git a/closure/goog/debug/debug.js b/closure/goog/debug/debug.js
index <HASH>..<HASH> 100644
--- a/closure/goog/debug/debug.js
+++ b/closure/goog/debug/debug.js
@@ -14,7 +14,6 @@ goog.provide('goog.debug');
goog.require('goog.array');
goog.require('goog.debug.errorcontext');
-goog.require('goog.userAgent');
/** @define {boolean} Whether logging should be enabled. */
@@ -51,15 +50,6 @@ goog.debug.catchErrors = function(logFunc, opt_cancel, opt_target) {
var oldErrorHandler = target.onerror;
var retVal = !!opt_cancel;
- // Chrome interprets onerror return value backwards (http://crbug.com/92062)
- // until it was fixed in webkit revision r94061 (Webkit 535.3). This
- // workaround still needs to be skipped in Safari after the webkit change
- // gets pushed out in Safari.
- // See https://bugs.webkit.org/show_bug.cgi?id=67119
- if (goog.userAgent.WEBKIT && !goog.userAgent.isVersionOrHigher('535.3')) {
- retVal = !retVal;
- }
-
/**
* New onerror handler for this target. This onerror handler follows the spec
* according to | Strip isVersionOrHigher checks for old browser versions
RELNOTES: Remove support for IE8 and before, Gecko 3.x and before, and Safari <I> and before.
PiperOrigin-RevId: <I>
Change-Id: Icce3cc<I>ca<I>f<I>c<I>cbdf9b<I>c9b | google_closure-library | train | js |
39ea61a4015f7f3e9159579e655835ffe1fc8c99 | diff --git a/redisdl.py b/redisdl.py
index <HASH>..<HASH> 100755
--- a/redisdl.py
+++ b/redisdl.py
@@ -84,7 +84,11 @@ def _reader(r, pretty, encoding):
key = key.decode(encoding)
type = r.type(key).decode('ascii')
if type == 'string':
- value = r.get(key).decode(encoding)
+ value = r.get(key)
+ if value is None:
+ # key was deleted between the type call and the get call
+ continue
+ value = value.decode(encoding)
elif type == 'list':
value = [v.decode(encoding) for v in r.lrange(key, 0, -1)]
elif type == 'set': | A key may be deleted between the calls to type and get | p_redis-dump-load | train | py |
f893558d782396f10c2fe49a8bc73deff4a36d14 | diff --git a/btcec/ciphering.go b/btcec/ciphering.go
index <HASH>..<HASH> 100644
--- a/btcec/ciphering.go
+++ b/btcec/ciphering.go
@@ -41,7 +41,7 @@ var (
)
// GenerateSharedSecret generates a shared secret based on a private key and a
-// private key using Diffie-Hellman key exchange (ECDH) (RFC 4753).
+// public key using Diffie-Hellman key exchange (ECDH) (RFC 4753).
// RFC5903 Section 9 states we should only return x.
func GenerateSharedSecret(privkey *PrivateKey, pubkey *PublicKey) []byte {
x, _ := pubkey.Curve.ScalarMult(pubkey.X, pubkey.Y, privkey.D.Bytes()) | Minor correction to GenerateSharedSecret documentation. (#<I>) | btcsuite_btcd | train | go |
ef2a011a0ab3844cb5cba33f81b6f6080f0d037c | diff --git a/lib/eventemitter2.js b/lib/eventemitter2.js
index <HASH>..<HASH> 100644
--- a/lib/eventemitter2.js
+++ b/lib/eventemitter2.js
@@ -1,4 +1,3 @@
-
;!function(exports, undefined) {
var isArray = Array.isArray;
@@ -251,6 +250,9 @@
};
EventEmitter.prototype.on = function(type, listener) {
+ if (typeof listener !== 'function') {
+ throw new Error('on only accepts instances of Function');
+ }
this._events || init.call(this);
// To avoid recursion in the case that type == "newListeners"! Before | throw errors when adding a listener that is not a function | EventEmitter2_EventEmitter2 | train | js |
95ba9d57aac7ea803c7b433eea65311c4dcd3f91 | diff --git a/src/sap.ui.core/src/sap/ui/test/BlanketReporter.js b/src/sap.ui.core/src/sap/ui/test/BlanketReporter.js
index <HASH>..<HASH> 100644
--- a/src/sap.ui.core/src/sap/ui/test/BlanketReporter.js
+++ b/src/sap.ui.core/src/sap/ui/test/BlanketReporter.js
@@ -99,10 +99,10 @@ sap.ui.define([
oHtml = oView.byId("blanket-source"),
oModel = oView.getModel(),
oTable = oView.byId("Files"),
- iSelectedIndex = oTable.getSelectedIndex();
+ iSelectedRow = oTable.getSelectedIndex() - oTable.getFirstVisibleRow();
- if (iSelectedIndex >= 0) {
- oContext = oTable.getRows()[iSelectedIndex].getBindingContext();
+ if (iSelectedRow >= 0) {
+ oContext = oTable.getRows()[iSelectedRow].getBindingContext();
sFile = oContext.getObject("name");
iLinesOfContext = oModel.getProperty("/linesOfContext");
aStatistics = oModel.getObject("/coverageData").files[sFile]; | [INTERNAL] sap.ui.test.BlanketReporter: fix file selection
After scrolling down in the file list, a selection caused the wrong file
to be shown.
Change-Id: I<I>e8f5b<I>c<I>d<I>d<I>e<I>e | SAP_openui5 | train | js |
70028a335eee56a57938384cd457bf6196be7eb7 | diff --git a/lib/pushbullet/channel.rb b/lib/pushbullet/channel.rb
index <HASH>..<HASH> 100644
--- a/lib/pushbullet/channel.rb
+++ b/lib/pushbullet/channel.rb
@@ -12,7 +12,9 @@ module Pushbullet
end
def self.get_info(tag)
- new Pushbullet.client.get("channel-info?tag=#{tag}")
+ Pushbullet.client.get("channel-info?tag=#{tag}")["recent_pushes"].map do |push|
+ Pushbullet::Push.new push
+ end
end
def self.path
diff --git a/spec/pushbullet/channel_spec.rb b/spec/pushbullet/channel_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/pushbullet/channel_spec.rb
+++ b/spec/pushbullet/channel_spec.rb
@@ -7,7 +7,7 @@ describe Pushbullet::Channel do
it 'returns channel info' do
VCR.use_cassette('channel_info') do
- expect(described_class.get_info tag).to be_a described_class
+ expect(described_class.get_info tag).to be_a Array
end
end
end | Get info method on channel now returns pushes
Test changed to for testing return of an array | letz_ruby-pushbullet | train | rb,rb |
6605df196a92d8241ac786aa0824bdded555bc10 | diff --git a/extension/data/test/dataTest.js b/extension/data/test/dataTest.js
index <HASH>..<HASH> 100644
--- a/extension/data/test/dataTest.js
+++ b/extension/data/test/dataTest.js
@@ -4,7 +4,7 @@ var assert = require("assert"),
path = require("path"),
describeReporting = require("../../../test/helpers.js").describeReporting;
-describeReporting(path.join(__dirname, "../../"), ["data"], function (reporter) {
+describeReporting(path.join(__dirname, "../../"), ["templates","data"], function (reporter) {
describe('data', function() { | usage of nedb in tests: grunt file refactoring, tests refactoring; excel-parser extension replaced dataParser.js | jsreport_jsreport-data | train | js |
a15e6e70cede1fa7219410601f6103089ad8d054 | diff --git a/quasar/src/components/input/QInput.js b/quasar/src/components/input/QInput.js
index <HASH>..<HASH> 100644
--- a/quasar/src/components/input/QInput.js
+++ b/quasar/src/components/input/QInput.js
@@ -97,6 +97,9 @@ export default Vue.extend({
__emitValue (val, stopWatcher) {
const fn = () => {
+ if (this.hasOwnProperty('tempValue') === true) {
+ delete this.tempValue
+ }
if (this.value !== val) {
stopWatcher === true && (this.stopValueWatcher = true)
this.$emit('input', val)
@@ -105,6 +108,7 @@ export default Vue.extend({
if (this.debounce !== void 0) {
clearTimeout(this.emitTimer)
+ this.tempValue = val
this.emitTimer = setTimeout(fn, this.debounce)
}
else {
@@ -154,7 +158,9 @@ export default Vue.extend({
attrs,
on,
domProps: {
- value: this.innerValue
+ value: this.hasOwnProperty('tempValue') === true
+ ? this.tempValue
+ : this.innerValue
}
})
} | fix(QInput): model when using debounce prop and Vue re-renders before QInput emits | quasarframework_quasar | train | js |
a8c7ad30eebd7cfbe8dec0a2b14b37444b717c36 | diff --git a/lib/vagrant/config/loader.rb b/lib/vagrant/config/loader.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant/config/loader.rb
+++ b/lib/vagrant/config/loader.rb
@@ -200,6 +200,13 @@ module Vagrant
rescue SyntaxError => e
# Report syntax errors in a nice way.
raise Errors::VagrantfileSyntaxError, :file => e.message
+ rescue SystemExit
+ # Continue raising that exception...
+ raise
+ rescue Vagrant::Errors::VagrantError
+ # Continue raising known Vagrant errors since they already
+ # contain well worded error messages and context.
+ raise
rescue Exception => e
@logger.error("Vagrantfile load error: #{e.message}")
@logger.error(e.backtrace.join("\n")) | Be a bit more fine grained about errors that are reported for Vfiles | hashicorp_vagrant | train | rb |
488cee65ac6ea5dd6bb9734b982159e591de6f0e | diff --git a/src/Graby.php b/src/Graby.php
index <HASH>..<HASH> 100644
--- a/src/Graby.php
+++ b/src/Graby.php
@@ -471,7 +471,7 @@ class Graby
if ($mimeInfo['mime'] == 'application/pdf') {
$parser = new PdfParser();
$pdf = $parser->parseFile($effective_url);
- $infos['html'] = nl2br($pdf->getText());
+ $infos['html'] = Encoding::toUTF8(nl2br($pdf->getText()));
// update title in case of details are present
$details = $pdf->getDetails(); | Ensure PDF content are UTF8
It was the case for this pdf: <URL> | j0k3r_graby | train | php |
17a6cba86165b81af343a7c0f8ab4931a073ff10 | diff --git a/linguist/cache.py b/linguist/cache.py
index <HASH>..<HASH> 100644
--- a/linguist/cache.py
+++ b/linguist/cache.py
@@ -63,7 +63,8 @@ class CachedTranslation(object):
Returns lookup for get() and filter() methods.
"""
lookup = dict((k, getattr(self, k)) for k in self.fields)
- lookup.pop('field_value')
+ for field_name in ['field_value', 'updated_at']:
+ lookup.pop(field_name)
return lookup
@classmethod | updated_at should not be in lookup (not in the unique_together fields) | ulule_django-linguist | train | py |
6ac060f1418192798270526447c823ffbbf76e43 | diff --git a/broadlink/__init__.py b/broadlink/__init__.py
index <HASH>..<HASH> 100644
--- a/broadlink/__init__.py
+++ b/broadlink/__init__.py
@@ -21,6 +21,8 @@ def get_devices() -> Dict[int, Tuple[Type[device], str, str]]:
return {
0x0000: (sp1, "SP1", "Broadlink"),
0x2711: (sp2, "SP2", "Broadlink"),
+ 0x2716: (sp2, "NEO PRO", "Ankuoo"),
+ 0x2717: (sp2, "NEO", "Ankuoo"),
0x2719: (sp2, "SP2-compatible", "Honeywell"),
0x271a: (sp2, "SP2-compatible", "Honeywell"),
0x2720: (sp2, "SP mini", "Broadlink"), | Add support for Ankuoo NEO and NEO PRO | mjg59_python-broadlink | train | py |
7241abb096f266cb59e559cf61b050ba847726f7 | diff --git a/core-bundle/src/Resources/contao/library/Contao/DcaExtractor.php b/core-bundle/src/Resources/contao/library/Contao/DcaExtractor.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/Resources/contao/library/Contao/DcaExtractor.php
+++ b/core-bundle/src/Resources/contao/library/Contao/DcaExtractor.php
@@ -291,8 +291,8 @@ class DcaExtractor extends \Controller
$this->loadDataContainer($this->strTable);
}
- // Return if the DC type is "File" or "Folder"
- if ($GLOBALS['TL_DCA'][$this->strTable]['config']['dataContainer'] == 'File' || $GLOBALS['TL_DCA'][$this->strTable]['config']['dataContainer'] == 'Folder')
+ // Return if the DC type is "File"
+ if ($GLOBALS['TL_DCA'][$this->strTable]['config']['dataContainer'] == 'File')
{
return;
} | [Core] Create DCA extracts for the "Folder" DCA type (see #<I>) | contao_contao | train | php |
b82f3a61fa2da2b00c25282e412cc99c7479667a | diff --git a/h2o-core/src/main/java/water/fvec/Chunk.java b/h2o-core/src/main/java/water/fvec/Chunk.java
index <HASH>..<HASH> 100644
--- a/h2o-core/src/main/java/water/fvec/Chunk.java
+++ b/h2o-core/src/main/java/water/fvec/Chunk.java
@@ -493,7 +493,10 @@ public abstract class Chunk extends Iced implements Cloneable {
abstract boolean setNA_impl(int idx);
boolean set_impl (int idx, String str) { throw new IllegalArgumentException("Not a String"); }
- public int nextNZ(int rid){return rid+1;}
+ public int nextNZ(int rid){
+ while(++rid < _len && atd(rid) == 0);
+ return rid;
+ }
/** Sparse Chunks have a significant number of zeros, and support for
* skipping over large runs of zeros in a row.
@@ -548,6 +551,8 @@ public abstract class Chunk extends Iced implements Cloneable {
return s;
}
+
+
/** Custom serializers implemented by Chunk subclasses: the _mem field
* contains ALL the fields already. */
abstract public AutoBuffer write_impl( AutoBuffer ab ); | Updated default sparse interface to use return only non-zeros even for dense chunks ( so that no further checks are needed in case we rely on numbers coming out being non-zeros). | h2oai_h2o-3 | train | java |
584c3ba1aad5f28a5144d9dbafa67c19e014c7de | diff --git a/lib/kaminari/models/mongoid_criteria_methods.rb b/lib/kaminari/models/mongoid_criteria_methods.rb
index <HASH>..<HASH> 100644
--- a/lib/kaminari/models/mongoid_criteria_methods.rb
+++ b/lib/kaminari/models/mongoid_criteria_methods.rb
@@ -13,17 +13,15 @@ module Kaminari
end
def total_count #:nodoc:
- @total_count ||=
- if embedded?
- unpage.count
+ @total_count ||= if embedded?
+ unpage.count
+ else
+ if options[:max_scan] && options[:max_scan] < count
+ options[:max_scan]
else
- counter_result = count
- if options[:max_scan] and options[:max_scan] < counter_result
- options[:max_scan]
- else
- counter_result
- end
+ count
end
+ end
end
private | Eliminate unneeded local variable in MongoidCriteriaMethods
* #count already caches the result
* change indent
* we prefer && to `and` | kaminari_kaminari | train | rb |
e984d7b6549988586210eae4109133e014f26393 | diff --git a/src/Session/SessionInterface.php b/src/Session/SessionInterface.php
index <HASH>..<HASH> 100644
--- a/src/Session/SessionInterface.php
+++ b/src/Session/SessionInterface.php
@@ -19,4 +19,9 @@ interface SessionInterface extends AuthenticationResultInterface
* @return string
*/
public function getSessionId();
+
+ /**
+ * @return string
+ */
+ public function getSessionTtl();
} | Add function getSessionTtl() to SessionInterface.
It is required to set dynamic expiration time for session or cookie. | activecollab_authentication | train | php |
0ee92b652092e87c15aa41164d76e67ffb405424 | diff --git a/hwd/wrapper.py b/hwd/wrapper.py
index <HASH>..<HASH> 100644
--- a/hwd/wrapper.py
+++ b/hwd/wrapper.py
@@ -7,7 +7,7 @@ class Wrapper:
def __init__(self, dev):
self.name = dev.sys_name
- self._device = None
+ self._device = dev
@property
def device(self):
@@ -23,6 +23,9 @@ class Wrapper:
'Device {} no longer present in context'.format(self.name))
return self._device
+ def refresh(self):
+ self._device = None
+
@property
def system_path(self):
return self.device.sys_path | Keep initial refrence to Device object | Othernet-Project_hwd | train | py |
a407c2c7b5489a832fc71c426b4ad0cd9c87c683 | diff --git a/tools/buildgen/plugins/make_fuzzer_tests.py b/tools/buildgen/plugins/make_fuzzer_tests.py
index <HASH>..<HASH> 100644
--- a/tools/buildgen/plugins/make_fuzzer_tests.py
+++ b/tools/buildgen/plugins/make_fuzzer_tests.py
@@ -50,6 +50,6 @@ def mako_plugin(dictionary):
'platforms': ['mac', 'linux'],
'ci_platforms': ['linux'],
'flaky': False,
- 'language': 'c',
+ 'language': 'c++',
'cpu_cost': 0.1,
}) | turn generated fuzzer tests from tests.json to c++ to match build_autogenerated.yaml | grpc_grpc | train | py |
cc7518925993611e7a8e7f446c8fd648279aad23 | diff --git a/client/src/main/java/com/netflix/conductor/client/task/WorkflowTaskCoordinator.java b/client/src/main/java/com/netflix/conductor/client/task/WorkflowTaskCoordinator.java
index <HASH>..<HASH> 100644
--- a/client/src/main/java/com/netflix/conductor/client/task/WorkflowTaskCoordinator.java
+++ b/client/src/main/java/com/netflix/conductor/client/task/WorkflowTaskCoordinator.java
@@ -75,6 +75,7 @@ public class WorkflowTaskCoordinator {
private static Map<Worker, Map<String, Object>> environmentData = new HashMap<>();
private static final String DOMAIN = "domain";
+ private static final String ALL_WORKERS = "all";
/**
*
@@ -271,6 +272,9 @@ public class WorkflowTaskCoordinator {
return;
}
String domain = PropertyFactory.getString(worker.getTaskDefName(), DOMAIN, null);
+ if(domain == null){
+ domain = PropertyFactory.getString(ALL_WORKERS, DOMAIN, null);
+ }
logger.debug("Polling {}, domain={}, count = {} timeout = {} ms", worker.getTaskDefName(), domain, worker.getPollCount(), worker.getLongPollTimeoutInMS());
try{ | Added support to set the domain for "all" workers | Netflix_conductor | train | java |
aca58b7659f4771d3aa74f9289b885723877be49 | diff --git a/backbone.js b/backbone.js
index <HASH>..<HASH> 100644
--- a/backbone.js
+++ b/backbone.js
@@ -1093,11 +1093,12 @@
// optional `selector` or catches all `eventName` events. Subclasses can
// override this to utilize an alternative DOM event management API.
_delegate: function(eventName, selector, method) {
+ var $el = this.$el;
eventName += '.delegateEvents' + this.cid;
if (!selector) {
- this.$el.on(eventName, method);
+ $el.on(eventName, method);
} else {
- this.$el.on(eventName, selector, method);
+ $el.on(eventName, selector, method);
}
}, | No reason jQuery can't be a little faster too | jashkenas_backbone | train | js |
c863f7e6f00103b95a5be8234a2db9eb9bfc0f4d | diff --git a/lib/shoulda/matchers/active_record/association_matcher.rb b/lib/shoulda/matchers/active_record/association_matcher.rb
index <HASH>..<HASH> 100644
--- a/lib/shoulda/matchers/active_record/association_matcher.rb
+++ b/lib/shoulda/matchers/active_record/association_matcher.rb
@@ -240,7 +240,15 @@ module Shoulda # :nodoc:
end
def foreign_key
- reflection.respond_to?(:foreign_key) ? reflection.foreign_key : reflection.primary_key_name
+ fk_reflection = reflection
+ if [:has_one, :has_many].include?(@macro) && reflection.options.include?(:inverse_of)
+ fk_reflection = associated_class.reflect_on_association(
+ reflection.options[:inverse_of]
+ )
+ end
+ fk_reflection.respond_to?(:foreign_key) ?
+ fk_reflection.foreign_key :
+ fk_reflection.primary_key_name
end
def through? | association_matcher foreign_key refinement
<URL>
corrected by having have_one and have_many association tests check for an
:inverse_of on their association, and use the inverse relationship's
foreign key info if it can be found | thoughtbot_shoulda-matchers | train | rb |
09b1520f5c73b5649ed43fe5ae4afb95cf80ea3f | diff --git a/src/basic/lines.js b/src/basic/lines.js
index <HASH>..<HASH> 100644
--- a/src/basic/lines.js
+++ b/src/basic/lines.js
@@ -136,7 +136,7 @@ Line.getStyle = function(c3ss, id, ord) {
base: 'lines',
blend: getBlending(c3ss),
dash: getDashed(c3ss),
- blend_order: isFinite(ord) ? ord + 1 : 1
+ blend_order: typeof ord === 'number' ? ord + 1 : 1
};
return style; | Change isInfinity for typeof, wrong language :P | CartoDB_tangram-cartocss | train | js |
0c85a797391f0c5ae9531597c4190790deae563e | diff --git a/pyperform/__init__.py b/pyperform/__init__.py
index <HASH>..<HASH> 100644
--- a/pyperform/__init__.py
+++ b/pyperform/__init__.py
@@ -80,7 +80,7 @@ def remove_decorators(src):
n_deleted = 0
for n in xrange(len(src_lines)):
line = src_lines[n - n_deleted].strip()
- if 'Benchmark' in line or multi_line:
+ if (line.startswith('@') and 'Benchmark' in line) or multi_line:
del src_lines[n - n_deleted]
n_deleted += 1
if line.endswith(')'):
@@ -116,6 +116,7 @@ def generate_call_statement(func, is_class_method, *args, **kwargs):
class ValidationError(Exception):
pass
+
class Benchmark(object):
enable = True
@@ -165,7 +166,7 @@ class Benchmark(object):
setup_src = ''
src = '\n'.join([imports, setup_src, func_src])
- self.setup_src = remove_decorators(src) + '\n'
+ self.setup_src = src + '\n'
self.log.write(self.setup_src)
self.stmt = generate_call_statement(caller, self.is_class_method, *self._args, **self._kwargs) | Check for '@' in remove_demorators() so that the function does not fail when coming across the text 'Benchmark' in another context | lobocv_pyperform | train | py |
c252f9792fb8940ecb16336d2ed25f942a2552cb | diff --git a/openquake/hazardlib/calc/disagg.py b/openquake/hazardlib/calc/disagg.py
index <HASH>..<HASH> 100644
--- a/openquake/hazardlib/calc/disagg.py
+++ b/openquake/hazardlib/calc/disagg.py
@@ -39,12 +39,10 @@ from openquake.hazardlib.site import SiteCollection
from openquake.hazardlib.gsim.base import ContextMaker
-def make_iml4(R, iml_disagg, imtls=None, poes_disagg=(None,), curves=()):
+def make_iml4(R, iml_disagg, imtls, poes_disagg=(None,), curves=()):
"""
:returns: a list of N arrays of shape (R, M, P)
"""
- if imtls is None:
- imtls = {imt: [iml] for imt, iml in iml_disagg.items()}
N = len(curves) or 1
M = len(imtls)
P = len(poes_disagg) | More cleanup [skip CI] | gem_oq-engine | train | py |
42e441677952e165c17c3a57dd7014666043239e | diff --git a/packages/node_modules/@webex/internal-plugin-ediscovery/test/unit/spec/report.js b/packages/node_modules/@webex/internal-plugin-ediscovery/test/unit/spec/report.js
index <HASH>..<HASH> 100644
--- a/packages/node_modules/@webex/internal-plugin-ediscovery/test/unit/spec/report.js
+++ b/packages/node_modules/@webex/internal-plugin-ediscovery/test/unit/spec/report.js
@@ -41,7 +41,7 @@ describe('EDiscovery Report API Tests', () => {
describe('Get Reports Tests', () => {
it('getReportsSuccess', async () => {
- const result = spark.internal.ediscovery.getReports().then((res) => {
+ const result = spark.internal.ediscovery.getReports({}).then((res) => {
expect(res.statusCode).to.equal(200);
}); | fix(ediscovery): fix test failure | webex_spark-js-sdk | train | js |
49fa0a0786b7f90f0efc0e7e246df693fb29fd89 | diff --git a/tensorpack/dataflow/imgaug/crop.py b/tensorpack/dataflow/imgaug/crop.py
index <HASH>..<HASH> 100644
--- a/tensorpack/dataflow/imgaug/crop.py
+++ b/tensorpack/dataflow/imgaug/crop.py
@@ -5,6 +5,7 @@ import numpy as np
import cv2
from ...utils.argtools import shape2d
+from ...utils.develop import log_deprecated
from .base import ImageAugmentor
from .transform import CropTransform, TransformAugmentorBase
from .misc import ResizeShortestEdge
@@ -67,10 +68,10 @@ class RandomCropRandomShape(TransformAugmentorBase):
Args:
wmin, hmin, wmax, hmax: range to sample shape.
- max_aspect_ratio (float): the upper bound of ``max(w,h)/min(w,h)``.
+ max_aspect_ratio (float): this argument has no effect and is deprecated.
"""
- if max_aspect_ratio is None:
- max_aspect_ratio = 9999999
+ if max_aspect_ratio is not None:
+ log_deprecated("RandomCropRandomShape(max_aspect_ratio)", "It is never implemented!", "2020-06-06")
self._init(locals())
def _get_augment_params(self, img): | remove max_aspect_ratio (fix #<I>) | tensorpack_tensorpack | train | py |
3462d6556108960196b2db092d1c80a192e5f7bd | diff --git a/app/controllers/rails_admin/main_controller.rb b/app/controllers/rails_admin/main_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/rails_admin/main_controller.rb
+++ b/app/controllers/rails_admin/main_controller.rb
@@ -93,7 +93,7 @@ module RailsAdmin
end.flatten.uniq.collect(&:to_s) << 'id' << '_destroy'
fields.each { |f| f.parse_input(target_params) }
target_params.slice!(*allowed_methods)
- target_params.permit!
+ target_params.permit! if target_params.respond_to?(:permit!)
fields.select(&:nested_form).each do |association|
children_params = association.multiple? ? target_params[association.method_name].try(:values) : [target_params[association.method_name]].compact
(children_params || []).each do |children_param| | params might not be ActionController::Paramerers | sferik_rails_admin | train | rb |
1f679327fdb01111a228feb73ae82258aa21449c | diff --git a/marrow/mailer/transport/smtp.py b/marrow/mailer/transport/smtp.py
index <HASH>..<HASH> 100644
--- a/marrow/mailer/transport/smtp.py
+++ b/marrow/mailer/transport/smtp.py
@@ -36,7 +36,11 @@ class SMTPTransport(object):
self.connection = None
self.messages_sent = 0
-
+
+ def startup(self):
+ if not self.connected:
+ self.connect_to_server()
+
def shutdown(self):
if self.connected:
log.debug("Closing SMTP connection")
@@ -118,9 +122,9 @@ class SMTPTransport(object):
cls_name = e.__class__.__name__
log.debug("%s EXCEPTION %s", message.id, cls_name, exc_info=True)
- if message.nr_retries >= 0:
+ if message.retries >= 0:
log.warning("%s DEFERRED %s", message.id, cls_name)
- message.nr_retries -= 1
+ message.retries -= 1
else:
log.exception("%s REFUSED %s", message.id, cls_name)
raise TransportFailedException | Some minor rearrangement and the addition of a stub startup() method. | marrow_mailer | train | py |
b40e5d8de79d069c76e1cc51c10d441fd6ace479 | diff --git a/lib/nydp/version.rb b/lib/nydp/version.rb
index <HASH>..<HASH> 100644
--- a/lib/nydp/version.rb
+++ b/lib/nydp/version.rb
@@ -1,3 +1,3 @@
module Nydp
- VERSION = "0.0.1"
+ VERSION = "0.0.2"
end | version: bump to <I> | conanite_nydp | train | rb |
2741487fa30f4cfdc3516d62d5b5dda464d02adc | diff --git a/lxd/node/config.go b/lxd/node/config.go
index <HASH>..<HASH> 100644
--- a/lxd/node/config.go
+++ b/lxd/node/config.go
@@ -154,7 +154,7 @@ var ConfigSchema = config.Schema{
"core.https_address": {Validator: validate.Optional(validate.IsListenAddress(true, true, false))},
// Network address for cluster communication
- "cluster.https_address": {Validator: validate.Optional(validate.IsListenAddress(false, false, false))},
+ "cluster.https_address": {Validator: validate.Optional(validate.IsListenAddress(true, false, false))},
// Network address for the debug server
"core.debug_address": {Validator: validate.Optional(validate.IsListenAddress(true, true, false))}, | lxd/node: Relax constraint on cluster address | lxc_lxd | train | go |
e69c6bd00fcccfdc552da6e53c8be78f8eec2577 | diff --git a/packages/neos-ui/src/Containers/LeftSideBar/NodeTree/Node/index.js b/packages/neos-ui/src/Containers/LeftSideBar/NodeTree/Node/index.js
index <HASH>..<HASH> 100644
--- a/packages/neos-ui/src/Containers/LeftSideBar/NodeTree/Node/index.js
+++ b/packages/neos-ui/src/Containers/LeftSideBar/NodeTree/Node/index.js
@@ -1,9 +1,9 @@
import React, {PureComponent} from 'react';
import PropTypes from 'prop-types';
import {$get} from 'plow-js';
-import {compose} from 'redux';
import {connect} from 'react-redux';
+import compose from 'lodash.compose';
import Tree from '@neos-project/react-ui-components/src/Tree/';
import {stripTags, decodeHtml} from '@neos-project/utils-helpers';
@@ -162,8 +162,8 @@ export default class Node extends PureComponent {
}
decodeLabel = compose(
- decodeHtml,
- stripTags
+ decodeHtml,
+ stripTags
);
render() { | TASK: Use `lodash.compose` instead of redux very own compose helper | neos_neos-ui | train | js |
b388722fcc70d2787b91b5a4492cb9659cea7a42 | diff --git a/parsl/providers/torque/template.py b/parsl/providers/torque/template.py
index <HASH>..<HASH> 100644
--- a/parsl/providers/torque/template.py
+++ b/parsl/providers/torque/template.py
@@ -3,7 +3,6 @@ template_string = '''#!/bin/bash
#PBS -S /bin/bash
#PBS -N ${jobname}
#PBS -m n
-#PBS -k eo
#PBS -l walltime=$walltime
#PBS -l nodes=${nodes_per_block}:ppn=${tasks_per_node}
#PBS -o ${submit_script_dir}/${jobname}.submit.stdout | Remove line which was preventing stdout redirect
I think this line tries to send stdout and stderr to the same file. I'm
not really sure why removing it causes the later specification of the
stdout and stderr lines to be respected, but we don't want them in the
same file in any case. Fixes #<I>. | Parsl_parsl | train | py |
a52756eda98e6d2e6ad0162ebb57e5e676446c1c | diff --git a/options-interface.php b/options-interface.php
index <HASH>..<HASH> 100644
--- a/options-interface.php
+++ b/options-interface.php
@@ -216,15 +216,15 @@ function optionsframework_fields() {
$output .= '<select class="of-input" name="'.$option_name.'['.$value['id'].']" id="'. $value['id'] .'">';
$select_value = $settings[($value['id'])];
- foreach ($value['options'] as $option_value => $option) {
+ foreach ($value['options'] as $key => $option ) {
$selected = '';
if($select_value != '') {
- if ( $select_value == $option_value) { $selected = ' selected="selected"';}
+ if ( $select_value == $key) { $selected = ' selected="selected"';}
} else {
if ( isset($value['std']) )
- if ($value['std'] == $option_value) { $selected = ' selected="selected"'; }
+ if ($value['std'] == $key) { $selected = ' selected="selected"'; }
}
- $output .= '<option'. $selected .' value="' . $option_value . '">';
+ $output .= '<option'. $selected .' value="' . $key . '">';
$output .= $option;
$output .= '</option>';
} | Normalize naming of "select_with_values" with the "radio" type. | wpplex_wp-options | train | php |
45eb1aa04f44e3503c9838a945baa5611b1fc090 | diff --git a/src/Command/PullRequest/PullRequestPatOnTheBackCommand.php b/src/Command/PullRequest/PullRequestPatOnTheBackCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/PullRequest/PullRequestPatOnTheBackCommand.php
+++ b/src/Command/PullRequest/PullRequestPatOnTheBackCommand.php
@@ -104,11 +104,6 @@ EOF
}
}
- /**
- * @param array $pats
- *
- * @return string
- */
private function choosePat(array $pats)
{
return $this->getHelper('gush_style')->choice('Please, choose a pat ', $pats, reset($pats)); | Remove docblock at `PullRequestPatOnTheBackCommand::choosePat()` | gushphp_gush | train | php |
d22dd0f0193414a1d1c064ed0c59ec8c03f61667 | diff --git a/src/components/compiled/primitives/select.js b/src/components/compiled/primitives/select.js
index <HASH>..<HASH> 100644
--- a/src/components/compiled/primitives/select.js
+++ b/src/components/compiled/primitives/select.js
@@ -45,6 +45,8 @@ module.exports = function ( React, tools ) {
, spec = this._spec()
, meta = this._meta();
+ if ( meta.isHidden ) return null;
+
return (
React.createElement("select", {id: config.fieldID,
disabled: meta.isDisabled, | Add unit-tests for <select> primitive | AZaviruha_react-form-generator | train | js |
e0bbf83b88e4a20e0a6900b9e3656732212aa7bd | diff --git a/packages/vaex-core/vaex/json.py b/packages/vaex-core/vaex/json.py
index <HASH>..<HASH> 100644
--- a/packages/vaex-core/vaex/json.py
+++ b/packages/vaex-core/vaex/json.py
@@ -52,12 +52,18 @@ class NumpySerializer:
@staticmethod
def encode(obj):
- values = obj.tolist()
+ if np.ma.isMaskedArray(obj):
+ values = obj.data.tolist()
+ mask = obj.mask.tolist()
+ else:
+ values = obj.tolist()
+ mask = None
dtype = str(obj.dtype)
return {
'type': 'ndarray',
'data': {
'values': values,
+ 'mask': mask,
'dtype': dtype
}
}
@@ -69,7 +75,10 @@ class NumpySerializer:
@staticmethod
def decode(data):
dtype = np.dtype(data['data']['dtype'])
- value = np.array(data['data']['values'], dtype)
+ if 'mask' in data['data'] and data['data']['mask'] is not None:
+ value = np.ma.array(data['data']['values'], mask=data['data']['mask'], dtype=dtype)
+ else:
+ value = np.array(data['data']['values'], dtype)
return value | feat(core): serialize masked arrays into JSON | vaexio_vaex | train | py |
f2fc9814035757bcdb6e351538d444aa41f46591 | diff --git a/spyderlib/widgets/qteditor/qtebase.py b/spyderlib/widgets/qteditor/qtebase.py
index <HASH>..<HASH> 100644
--- a/spyderlib/widgets/qteditor/qtebase.py
+++ b/spyderlib/widgets/qteditor/qtebase.py
@@ -614,7 +614,12 @@ class TextEditBaseWidget(QPlainTextEdit):
if forward:
moves += [QTextCursor.NextWord, QTextCursor.Start]
if changed:
- cursor.movePosition(QTextCursor.PreviousWord)
+ if cursor.selectedText().isEmpty():
+ cursor.movePosition(QTextCursor.PreviousWord)
+ else:
+ new_position = min([cursor.selectionStart(),
+ cursor.selectionEnd()])
+ cursor.setPosition(new_position)
else:
moves += [QTextCursor.End]
regexp = QRegExp(r"\b%s\b" % QRegExp.escape(text) if words else text, | QtEditor-Find/replace-bugfix: when pressing "Ctrl+F" with a selected text containing "/" (for example), selection was moved to next occurence | spyder-ide_spyder | train | py |
3b19b67cd8684d61604d6150d6073ca58919431f | diff --git a/admin/generator.php b/admin/generator.php
index <HASH>..<HASH> 100755
--- a/admin/generator.php
+++ b/admin/generator.php
@@ -39,6 +39,9 @@ class generator {
'course_modules' => array('required' => true, 'toclean' => true),
'course_sections' => array('required' => true, 'toclean' => true),
'data' => array('required' => false, 'toclean' => true),
+ 'data_content' => array('required' => false, 'toclean' => true),
+ 'data_fields' => array('required' => false, 'toclean' => true),
+ 'data_records' => array('required' => false, 'toclean' => true),
'event' => array('required' => true, 'toclean' => true),
'forum' => array('required' => false, 'toclean' => true),
'forum_discussions' => array('required' => false, 'toclean' => true), | MDL-<I> adding data mod tables to list of tables to clean up | moodle_moodle | train | php |
8a67724d895844265843aac987b7130d53da6e0a | diff --git a/lib/vocab.js b/lib/vocab.js
index <HASH>..<HASH> 100644
--- a/lib/vocab.js
+++ b/lib/vocab.js
@@ -205,8 +205,12 @@ module.exports = function(modulename) {
schema = _M.propertiesToPropertySchema(schema);
}
- // Keep track of order of definition for oada-formats-viz:
- schema.registrationOrder = _M._registrationOrder++;
+ // Store original vocab source definition in the schema itself for reference later
+ schema.vocab = {
+ module: modulename,
+ term,
+ registrationOrder: _M.registrationOrder++,
+ };
// Store term in global vocab object:
_M._vocab[term] = schema; | Added vocab object to any vocab schemas to retain the original vocab source info (term, module, and registrationOrder) | OADA_oada-formats | train | js |
852f6f0b8bb70f2b03487c6073d7e17c7a97a566 | diff --git a/epab/cmd/release.py b/epab/cmd/release.py
index <HASH>..<HASH> 100644
--- a/epab/cmd/release.py
+++ b/epab/cmd/release.py
@@ -69,7 +69,6 @@ def release(ctx, new_version):
do(ctx, sys.executable.replace('\\', '/') + ' setup.py bdist_wheel')
do(ctx, 'twine upload dist/* --skip-existing', mute_stdout=True, mute_stderr=True)
- repo_push(ctx)
repo_checkout(ctx, 'develop')
repo_push(ctx)
diff --git a/epab/utils/_repo.py b/epab/utils/_repo.py
index <HASH>..<HASH> 100644
--- a/epab/utils/_repo.py
+++ b/epab/utils/_repo.py
@@ -89,7 +89,7 @@ def repo_push(ctx: click.Context):
_info('Pushing repo to origin')
if dry_run(ctx):
return
- do(ctx, ['git', 'push', '--tags'])
+ do(ctx, ['git', 'push', '--all', '--tags'])
def repo_is_dirty(ctx: click.Context) -> bool: | fix: push all refs after release | etcher-be_epab | train | py,py |
1736ab96932dc882c1fe75aaa017457282d7a6d0 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -40,8 +40,10 @@ function getConfig (files, opts) {
let resolveModulesPaths = [
path.join(process.cwd(), 'node_modules')
]
- config.resolveLoader = { modules: resolveModulesPaths }
- config.resolve = { modules: resolveModulesPaths }
+ if (!config.resolveLoader) config.resolveLoader = { }
+ if (!config.resolve) config.resolve = { }
+ config.resolveLoader.modules = resolveModulesPaths
+ config.resolve.modules = resolveModulesPaths
return config
} | Do not overwrite config.resolve | ai_size-limit | train | js |
1124450cf78f52f42828d2a3814a8c117ce884b2 | diff --git a/dedupe/api.py b/dedupe/api.py
index <HASH>..<HASH> 100644
--- a/dedupe/api.py
+++ b/dedupe/api.py
@@ -1347,8 +1347,6 @@ class Dedupe(ActiveMatching, DedupeMatching):
self.active_learner = self.ActiveLearner(
self.data_model,
data,
- blocked_proportion,
- sample_size,
index_include=examples,
)
@@ -1419,8 +1417,6 @@ class Link(ActiveMatching):
self.data_model,
data_1,
data_2,
- blocked_proportion,
- sample_size,
index_include=examples,
)
diff --git a/dedupe/labeler.py b/dedupe/labeler.py
index <HASH>..<HASH> 100644
--- a/dedupe/labeler.py
+++ b/dedupe/labeler.py
@@ -431,8 +431,6 @@ class DedupeDisagreementLearner(DisagreementLearner):
self,
data_model: DataModel,
data: Data,
- blocked_proportion: float,
- sample_size: int,
index_include: TrainingExamples,
):
@@ -469,8 +467,6 @@ class RecordLinkDisagreementLearner(DisagreementLearner):
data_model: DataModel,
data_1: Data,
data_2: Data,
- blocked_proportion: float,
- sample_size: int,
index_include: TrainingExamples,
): | Remove unused sample_size and blocked_proportion
from public API
These are just thrown away in DisagreementLearner,
so let's not fool ourselves that they're used.
NExt step would be to remove them from the public API, but that's
breaking so I wanted to wait. Regardless of if we do that, this change
is an improvement | dedupeio_dedupe | train | py,py |
9065ebda82dd7851ca0fbe14f26cdcae2f27fe3f | diff --git a/tests/e2e/data/services/test_bq_datasets.py b/tests/e2e/data/services/test_bq_datasets.py
index <HASH>..<HASH> 100644
--- a/tests/e2e/data/services/test_bq_datasets.py
+++ b/tests/e2e/data/services/test_bq_datasets.py
@@ -44,7 +44,12 @@ class TestBQUserDataset(unittest.TestCase):
unique_table_name = 'cf_test_table_' + str(uuid.uuid4()).replace('-', '_')
dataset = BQUserDataset.name(unique_table_name) \
.column(name='cartodb_id', type='INT64') \
- .column('the_geom', 'GEOMETRY')
-
- dataset.ttl_seconds(30)
+ .column('the_geom', 'GEOMETRY') \
+ .ttl_seconds(30)
dataset.create()
+
+ # do a quick check on the resulting table
+ result = dataset.download_stream()
+ df = pandas.read_csv(result)
+ self.assertEqual(df.shape, (0, 2))
+ self.assertEqual(df.to_csv(index=False), 'cartodb_id,the_geom\n') | Improve the test by checking created dataset
This requires <URL> | CartoDB_cartoframes | train | py |
2be79aa7482fec2d32728876b5e1c646466725a1 | diff --git a/spec/integration/qless_spec.rb b/spec/integration/qless_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integration/qless_spec.rb
+++ b/spec/integration/qless_spec.rb
@@ -2061,6 +2061,16 @@ module Qless
expect { client.bulk_cancel([a, b, c]) }.to raise_error(/is a dependency/)
end
+
+ it 'ignores unknown jids given to bulk_cancel as they may represent previously cancelled jobs' do
+ jid_1, jid_2 = create_dep_graph
+ jids = ["not_a_real_jid_1", jid_1, "not_a_real_jid_2", jid_2, "not_a_real_jid_3"]
+
+ expect { client.bulk_cancel(jids) }.to change { q.length }.to(0)
+ expect(client.jobs[jid_1]).to be_nil
+ expect(client.jobs[jid_2]).to be_nil
+ end
+
it "unlocks a job only after its dependencies have completely finished" do
# If we make B depend on A, and then move A through several
# queues, then B should only be availble once A has finished | Add a spec for an existing behavior that is important to preserve. | seomoz_qless | train | rb |
c5ee8b2cff91d16ea6ba4e405c3bdc6845f42b26 | diff --git a/server/events.go b/server/events.go
index <HASH>..<HASH> 100644
--- a/server/events.go
+++ b/server/events.go
@@ -484,13 +484,11 @@ func (s *Server) updateRemoteServer(ms *ServerInfo) {
if su == nil {
s.sys.servers[ms.ID] = &serverUpdate{ms.Seq, time.Now()}
} else {
+ // Should alwqys be going up.
if ms.Seq <= su.seq {
s.Errorf("Received out of order remote server update from: %q", ms.ID)
return
}
- if ms.Seq != su.seq+1 {
- s.Errorf("Missed [%d] remote server updates from: %q", ms.Seq-su.seq+1, ms.ID)
- }
su.seq = ms.Seq
su.ltime = time.Now()
} | Server sequences outbound may not appear sequential to other listening servers. | nats-io_gnatsd | train | go |
040a14d2cfe59c2c4c821d87aabb0974d80b80c1 | diff --git a/src/client/pps.go b/src/client/pps.go
index <HASH>..<HASH> 100644
--- a/src/client/pps.go
+++ b/src/client/pps.go
@@ -523,7 +523,7 @@ func (c APIClient) CreatePipelineService(
},
},
)
- return sanitizeErr(err)
+ return grpcutil.ScrubGRPC(err)
}
// GarbageCollect garbage collects unused data. Currently GC needs to be | Fix a compilation error from merge. | pachyderm_pachyderm | train | go |
6024be16f23c89ed425bc8b9b269859db22bf1bd | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -1,7 +1,6 @@
'use strict';
const os = require('os');
-const toarray = require('lodash/toArray');
const defaults = require('lodash/defaults');
const map = require('lodash/map');
const debug = require('debug')('asset-resolver');
@@ -20,7 +19,7 @@ module.exports.getResource = function(file, opts) {
opts.base = [opts.base];
}
- opts.base = resolver.glob(toarray(opts.base));
+ opts.base = resolver.glob([...opts.base]);
return Bluebird.any(
map(opts.base, base => { | Use the spread operator instead of lodash/toArray. | bezoerb_asset-resolver | train | js |
18d4e28481ee666670c9d8a07f9d5b4e9cb36995 | diff --git a/js/exmo.js b/js/exmo.js
index <HASH>..<HASH> 100644
--- a/js/exmo.js
+++ b/js/exmo.js
@@ -469,7 +469,7 @@ module.exports = class exmo extends Exchange {
'broad': {
'range period is too long': BadRequest,
'invalid syntax': BadRequest,
- 'API rate limit exceeded': RateLimitExceeded, // {"result":false,"error":"API rate limit exceeded for 99.33.55.224. Retry after 60 sec.","history":[],"begin":1579392000,"end":1579478400}
+ 'API rate limit exceeded': RateLimitExceeded, // {"result":false,"error":"API rate limit exceeded for x.x.x.x. Retry after 60 sec.","history":[],"begin":1579392000,"end":1579478400}
},
},
'orders': {}, // orders cache / emulation | exmo minor edits / comments | ccxt_ccxt | train | js |
d12eb0e14032485e21b2e0a32755f4076369e336 | diff --git a/cli/drivers/StatamicValetDriver.php b/cli/drivers/StatamicValetDriver.php
index <HASH>..<HASH> 100644
--- a/cli/drivers/StatamicValetDriver.php
+++ b/cli/drivers/StatamicValetDriver.php
@@ -69,13 +69,16 @@ class StatamicValetDriver extends ValetDriver
$sitePathPrefix = ($isAboveWebroot) ? $sitePath.'/public' : $sitePath;
if ($locale = $this->getUriLocale($uri)) {
- // Force trailing slashes on locale roots.
- if ($uri === '/' . $locale) {
- header('Location: ' . $uri . '/'); die;
+ if ($this->isActualFile($localeIndexPath = $sitePathPrefix . '/' . $locale . '/index.php')) {
+ // Force trailing slashes on locale roots.
+ if ($uri === '/' . $locale) {
+ header('Location: ' . $uri . '/');
+ die;
+ }
+
+ $indexPath = $localeIndexPath;
+ $scriptName = '/' . $locale . '/index.php';
}
-
- $indexPath = $sitePathPrefix . '/' . $locale . '/index.php';
- $scriptName = '/' . $locale . '/index.php';
}
$_SERVER['SCRIPT_NAME'] = $scriptName; | Only serve recognized locales if the file exists. | laravel_valet | train | php |
b15a0056ff160ad2aef3ec44e199500ac83cb83a | diff --git a/sphinxcontrib/spelling/builder.py b/sphinxcontrib/spelling/builder.py
index <HASH>..<HASH> 100644
--- a/sphinxcontrib/spelling/builder.py
+++ b/sphinxcontrib/spelling/builder.py
@@ -204,9 +204,9 @@ class SpellingBuilder(Builder):
# Check the text of the node.
misspellings = self.checker.check(node.astext())
- for word, suggestions, context_line, line_offs in misspellings:
+ for word, suggestions, context_line, line_offset in misspellings:
msg_parts = [
- f'{source}:{lineno+line_offs}: ',
+ f'{source}:{lineno+line_offset}: ',
'Spell check',
red(word),
]
diff --git a/sphinxcontrib/spelling/checker.py b/sphinxcontrib/spelling/checker.py
index <HASH>..<HASH> 100644
--- a/sphinxcontrib/spelling/checker.py
+++ b/sphinxcontrib/spelling/checker.py
@@ -58,9 +58,9 @@ class SpellingChecker:
suggestions = self.dictionary.suggest(word) if self.suggest else []
line = line_of_index(text, pos) if self.context_line else ""
- line_offs = text.count("\n", 0, pos)
+ line_offset = text.count("\n", 0, pos)
- yield word, suggestions, line, line_offs
+ yield word, suggestions, line, line_offset
def line_of_index(text, index): | Renamed line_offs to line_offset | sphinx-contrib_spelling | train | py,py |
06ebc1c3af5b8fdd93e6b24cd6f7691a5c1108ba | diff --git a/lib/http/public/javascripts/job.js b/lib/http/public/javascripts/job.js
index <HASH>..<HASH> 100644
--- a/lib/http/public/javascripts/job.js
+++ b/lib/http/public/javascripts/job.js
@@ -189,7 +189,7 @@ Job.prototype.renderUpdate = function(){
if (this.attempts.made) {
view.attempts(this.attempts.made + '/' + this.attempts.max);
} else {
- view.attempts().remove();
+ view.attempts().parent().remove();
}
// title | Fixed removal of attempts parent tr | Automattic_kue | train | js |
fc5f6eff5d0e76d716de227db3eccf48142ba99b | diff --git a/lib/Request.js b/lib/Request.js
index <HASH>..<HASH> 100644
--- a/lib/Request.js
+++ b/lib/Request.js
@@ -107,6 +107,7 @@ Request.prototype = {
data = JSON.parse(data);
} catch (err) {
reject(err);
+ return;
} finally {
//释放当前请求数
var count = +(config.requestLimit * (eval(res.headers[API_CALL_LIMIT]) + 1e-6)).toFixed(0); | fix: Cannot read property 'length' of undefined | yeezon_yhsd-api-node | train | js |
116592879ca2e184484d715cb4ccb3fa1c71e0b8 | diff --git a/lib/chewy/type.rb b/lib/chewy/type.rb
index <HASH>..<HASH> 100644
--- a/lib/chewy/type.rb
+++ b/lib/chewy/type.rb
@@ -14,7 +14,7 @@ require 'chewy/type/witchcraft'
module Chewy
class Type
- IMPORT_OPTIONS_KEYS = %i[batch_size bulk_size refresh consistency replication raw_import journal].freeze
+ IMPORT_OPTIONS_KEYS = %i[batch_size bulk_size refresh consistency replication raw_import journal pipeline].freeze
include Search
include Mapping | Adding pipeline support
Adding pipeline support to default_import_options for simple use of
pipeline at specific type | toptal_chewy | train | rb |
8b9422b3c6f028d0822a9b903d95eedbc09dffe7 | diff --git a/lxc/main.go b/lxc/main.go
index <HASH>..<HASH> 100644
--- a/lxc/main.go
+++ b/lxc/main.go
@@ -155,7 +155,7 @@ func run() error {
// and this is the first time the client has been run by the user, then check to see
// if LXD has been properly configured. Don't display the message if the var path
// does not exist (LXD not installed), as the user may be targeting a remote daemon.
- if os.Args[0] != "help" && os.Args[0] != "version" && shared.PathExists(shared.VarPath("")) && !shared.PathExists(conf.ConfigDir) {
+ if os.Args[0] != "help" && os.Args[0] != "version" && shared.PathExists(shared.VarPath("")) && !shared.PathExists(configPath) {
// Create the config dir so that we don't get in here again for this user.
err = os.MkdirAll(conf.ConfigDir, 0750)
if err != nil { | lxc: Detect first-run based on conf file not dir
Closes #<I> | lxc_lxd | train | go |
9de814537eed3b571a52581376fe7d72c6f505f3 | diff --git a/webapps/ui/cockpit/client/scripts/pages/dashboard.js b/webapps/ui/cockpit/client/scripts/pages/dashboard.js
index <HASH>..<HASH> 100644
--- a/webapps/ui/cockpit/client/scripts/pages/dashboard.js
+++ b/webapps/ui/cockpit/client/scripts/pages/dashboard.js
@@ -37,20 +37,6 @@ var Controller = [
$scope.mainPlugins = [];
$scope.miscPlugins = [];
- Views.getProviders({
- component: 'cockpit.dashboard.section'
- }).forEach(function(plugin) {
- (plugin.priority >= 0 ? $scope.mainPlugins : $scope.miscPlugins).push(plugin);
- if (plugin.getSparklineData) {
- if (typeof plugin.getSparklineData === 'function') {
- plugin.sparklineData = plugin.getSparklineData();
- }
- else if (Array.isArray(plugin.getSparklineData)) {
- plugin.sparklineData = $injector.invoke(plugin.getSparklineData);
- }
- }
- });
-
// old plugins are still shown on the dashboard
$scope.dashboardVars = { read: [ 'processData' ] };
$scope.deprecateDashboardProviders = Views.getProviders({ component: 'cockpit.dashboard'}); | refactor(dashboard): remove some dead code | camunda_camunda-bpm-platform | train | js |
e34236631c26c5e4378b50b61b10c815e439581b | diff --git a/lib/cacheable_flash.rb b/lib/cacheable_flash.rb
index <HASH>..<HASH> 100644
--- a/lib/cacheable_flash.rb
+++ b/lib/cacheable_flash.rb
@@ -39,6 +39,8 @@ module CacheableFlash
# Base must define cookies, as in Rails
cookies['flash'] = cookie_flash.to_json.gsub("+", "%2B")
# Base must define flash, as in Rails
+ # TODO: Does not support flash.now feature of the FlashHash in Rails,
+ # because flashes are only removed from cookies when they are used.
flash.clear
end
end | Note: Does not support flash.now feature of the FlashHash in Rails | pboling_cacheable-flash | train | rb |
6cab2a5b0e656a7878922d1500e06aa72ce59837 | diff --git a/init.php b/init.php
index <HASH>..<HASH> 100644
--- a/init.php
+++ b/init.php
@@ -41,7 +41,7 @@ if ( !defined( 'PODS_VERSION' ) && !defined( 'PODS_DIR' ) ) {
require_once( PODS_DIR . 'functions.php' );
- if ( is_admin() ) { // note the use of is_admin() to double check that this is happening in the admin
+ if ( isset($_GET['pods_force_refresh']) && is_admin()) { // note the use of is_admin() to double check that this is happening in the admin
// GitHub Plugin Updater
// https://github.com/jkudish/WordPress-GitHub-Plugin-Updater
require_once( PODS_DIR . 'updater.php' );
@@ -101,4 +101,4 @@ else {
}
add_action( 'init', 'pods_deactivate_1_x' );
-}
\ No newline at end of file
+} | Only start the updater if we have pods_force_refresh set, big speed boost. | pods-framework_pods | train | php |
c94476c9dd6357c844e56d0bf61ee7ab81cb5106 | diff --git a/classes/Sledge/Controller/Cms/Assets.php b/classes/Sledge/Controller/Cms/Assets.php
index <HASH>..<HASH> 100644
--- a/classes/Sledge/Controller/Cms/Assets.php
+++ b/classes/Sledge/Controller/Cms/Assets.php
@@ -254,6 +254,7 @@ class Sledge_Controller_Cms_Assets extends Sledge_Controller
$type = Arr::get($query_data, 'type');
$sortby = Arr::get($query_data, 'sortby');
$order = Arr::get($query_data, 'order');
+ $title = Arr::get($query_data, 'title');
// Prepare the database query.
$query = DB::select()
@@ -271,6 +272,12 @@ class Sledge_Controller_Cms_Assets extends Sledge_Controller
->where('tags.path', 'like', $tag->path . '%');
}
+ // Filtering by title?
+ if ($title)
+ {
+ $query->where('title', 'like', "%$title%");
+ }
+
if (($sortby == 'last_modified' OR $sortby == 'title' OR $sortby == 'filesize') AND ($order == 'desc' OR $order == 'asc'))
{
// A valid sort column and direction was given so use them. | Addd JS for asset manager autocomplete | boomcms_boom-core | train | php |
9e2c05e08aeae96f34dce2b8b750aaa384b0fdfd | diff --git a/samples/javafx/hello_jrubyfx.rb b/samples/javafx/hello_jrubyfx.rb
index <HASH>..<HASH> 100755
--- a/samples/javafx/hello_jrubyfx.rb
+++ b/samples/javafx/hello_jrubyfx.rb
@@ -11,10 +11,8 @@ class HelloJRubyFX < JRubyFX::Application
layout_scene(:dark_blue) do
group do
rectangle(x: 10, y: 40, width: 50, height: 50, fill: :red) do
- translate_x = translateXProperty
-
timeline(cycle_count: :indefinite, auto_reverse: true) do
- animate translate_x, 0.sec => 1.sec, 0 => 200
+ animate translateXProperty, 0.sec => 1.sec, 0 => 200
end.play
end
end | shortening hello_jrubyfx just a hair | jruby_jrubyfx | train | rb |
3539f0582e7c77958140ef4370b0d795f1a068f6 | diff --git a/AegeanTools/cluster.py b/AegeanTools/cluster.py
index <HASH>..<HASH> 100644
--- a/AegeanTools/cluster.py
+++ b/AegeanTools/cluster.py
@@ -279,7 +279,7 @@ def regroup(catalog, eps, far=None, dist=norm_dist):
sources = []
for group in islands:
- sources.extend(group)
+ sources.append(group)
return sources | ensure sources are returned in groups of islands | PaulHancock_Aegean | train | py |
b3f23d9e8e49ae9931f661a2a90095893e3078c5 | diff --git a/src/autosize.js b/src/autosize.js
index <HASH>..<HASH> 100644
--- a/src/autosize.js
+++ b/src/autosize.js
@@ -110,9 +110,17 @@ function assign(ta, {setOverflowX = true, setOverflowY = true} = {}) {
ta.dispatchEvent(evt);
}
}
+
+ var lastPageWidth = document.documentElement.clientWidth;
+ function pageResize() {
+ if (document.documentElement.clientWidth != lastPageWidth) {
+ lastPageWidth = document.documentElement.clientWidth;
+ update();
+ }
+ }
const destroy = style => {
- window.removeEventListener('resize', update);
+ window.removeEventListener('resize', pageResize);
ta.removeEventListener('input', update);
ta.removeEventListener('keyup', update);
ta.removeEventListener('autosize:destroy', destroy);
@@ -138,7 +146,7 @@ function assign(ta, {setOverflowX = true, setOverflowY = true} = {}) {
ta.addEventListener('keyup', update);
}
- window.addEventListener('resize', update);
+ window.addEventListener('resize', pageResize);
ta.addEventListener('input', update);
ta.addEventListener('autosize:update', update);
set.add(ta); | #<I> Only update when clientWidth changes
Issue #<I>, fixes kinetic scrolling jerkiness on iOS. | jackmoore_autosize | train | js |
876c16110dab4286fc4419175d522a195c3ae5fb | diff --git a/lib/stream-serialize.js b/lib/stream-serialize.js
index <HASH>..<HASH> 100644
--- a/lib/stream-serialize.js
+++ b/lib/stream-serialize.js
@@ -1,6 +1,7 @@
var stream = require('stream');
var util = require('util');
var Tile = require('./stream-util').Tile;
+var Info = require('./stream-util').Info;
module.exports = Serialize;
util.inherits(Serialize, stream.Transform);
@@ -12,6 +13,6 @@ function Serialize() {
}
Serialize.prototype._transform = function(chunk, enc, callback) {
- if (chunk instanceof Tile) this.push(chunk.serialize());
+ if (chunk instanceof Tile || chunk instanceof Info) this.push(chunk.serialize());
callback();
};
diff --git a/lib/stream-util.js b/lib/stream-util.js
index <HASH>..<HASH> 100644
--- a/lib/stream-util.js
+++ b/lib/stream-util.js
@@ -40,6 +40,16 @@ function Info(info) {
return this;
}
+Info.prototype.serialize = function() {
+ return JSON.stringify(this) + '\n';
+};
+
+Info.prototype.deserialize = function(data) {
+ var obj = JSON.parse(data);
+ Info.call(this, obj);
+ return;
+};
+
function Stats() {
this.ops = 0;
this.total = 0; | de/serialize Info objects | mapbox_tilelive | train | js,js |
6cd352d76bb23395ddfef72d7d0c945cab586423 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -6,7 +6,7 @@ require 'simplecov'
SimpleCov.start do
if Support::Travis::travis?
add_filter do |source_file|
- ['order_spec.rb', 'order.rb', 'status_spec.rb', 'status.rb'].include?(File.basename(source_file.filename))
+ ['product_spec.rb', 'product.rb', 'order_spec.rb', 'order.rb', 'status_spec.rb', 'status.rb'].include?(File.basename(source_file.filename))
end
end
end | Skipping travis on product specs. | anthonator_shirtsio | train | rb |
3eeecc8bd1bdc38a1651932661529f9ffdadec3a | diff --git a/shared/global-errors/index.native.js b/shared/global-errors/index.native.js
index <HASH>..<HASH> 100644
--- a/shared/global-errors/index.native.js
+++ b/shared/global-errors/index.native.js
@@ -95,7 +95,7 @@ class GlobalError extends Component<void, Props, State> {
</Box>
</NativeTouchableWithoutFeedback>
<NativeScrollView>
- <Text type='BodySmall' style={detailStyle}>{details}</Text>
+ <Text type='BodySmall' style={detailStyle}>{this.props.error && this.props.error.message}{'\n\n'}{details}</Text>
</NativeScrollView>
</Box>
) | WIP (#<I>) | keybase_client | train | js |
a464299e973a14945b1b5c7ca01d83664098bb9b | diff --git a/pkg/kubelet/pod_container_deletor.go b/pkg/kubelet/pod_container_deletor.go
index <HASH>..<HASH> 100644
--- a/pkg/kubelet/pod_container_deletor.go
+++ b/pkg/kubelet/pod_container_deletor.go
@@ -48,7 +48,9 @@ func newPodContainerDeletor(runtime kubecontainer.Runtime, containersToKeep int)
go wait.Until(func() {
for {
id := <-buffer
- runtime.DeleteContainer(id)
+ if err := runtime.DeleteContainer(id); err != nil {
+ klog.Warningf("[pod_container_deletor] DeleteContainer returned error for (id=%v): %v", id, err)
+ }
}
}, 0, wait.NeverStop) | add logging around pod_container_deletor DeleteContainer | kubernetes_kubernetes | train | go |
2562d2bde2ed5f4dbf426e040ddfb0e7ab94303e | diff --git a/celerymon/bin/celerymon.py b/celerymon/bin/celerymon.py
index <HASH>..<HASH> 100644
--- a/celerymon/bin/celerymon.py
+++ b/celerymon/bin/celerymon.py
@@ -52,15 +52,17 @@ Configuration ->
OPTION_LIST = (
)
+PID_FILE = 'celerymon.pid'
+
class MonitorCommand(Command):
namespace = 'celerymon'
enable_config_from_cmdline = True
- preload_options = Command.preload_options + daemon_options('celerymon.pid')
+ preload_options = Command.preload_options + daemon_options(PID_FILE)
version = __version__
def run(self, loglevel='ERROR', logfile=None, http_port=8989,
- http_address='', app=None, detach=False, pidfile=None,
+ http_address='', app=None, detach=False, pidfile=PID_FILE,
uid=None, gid=None, umask=None, working_directory=None, **kwargs):
print('celerymon %s is starting.' % self.version)
app = self.app | Unable to start as python manage.py celery mon - fixed. | celery_celerymon | train | py |
6b115f332d69baebb7cae30ab763cedbc3ec21c2 | diff --git a/satpy/writers/mitiff.py b/satpy/writers/mitiff.py
index <HASH>..<HASH> 100644
--- a/satpy/writers/mitiff.py
+++ b/satpy/writers/mitiff.py
@@ -618,6 +618,11 @@ class MITIFFWriter(ImageWriter):
else:
LOG.debug("Saving datasets as enhanced image")
img = get_enhanced_image(datasets.squeeze(), enhance=self.enhancer)
+ if 'bands' in img.data.sizes and 'bands' not in datasets.sizes:
+ LOG.debug("Datasets without 'bands' become image with 'bands' due to enhancement.")
+ LOG.debug("Needs to regenerate mitiff image description")
+ image_description = self._make_image_description(img.data, **kwargs)
+ tif.SetField(IMAGEDESCRIPTION, (image_description).encode('utf-8'))
for i, band in enumerate(img.data['bands']):
chn = img.data.sel(bands=band)
data = chn.values.clip(0, 1) * 254. + 1 | Need to handle bands/no bands dimmension and enhancements correctly | pytroll_satpy | train | py |
a3e3b0a04ad1bcdb3fb273a348d253b16a336238 | diff --git a/Console/Migrations/StatusCommand.php b/Console/Migrations/StatusCommand.php
index <HASH>..<HASH> 100644
--- a/Console/Migrations/StatusCommand.php
+++ b/Console/Migrations/StatusCommand.php
@@ -33,7 +33,7 @@ class StatusCommand extends BaseCommand
* Create a new migration rollback command instance.
*
* @param \Illuminate\Database\Migrations\Migrator $migrator
- * @return \Illuminate\Database\Console\Migrations\StatusCommand
+ * @return void
*/
public function __construct(Migrator $migrator)
{ | Add missing return docblocks (#<I>) | illuminate_database | train | php |
4739bdb9f15bb6959cff90ecc2d37ea1f5b12201 | diff --git a/spinoff/util/testing/common.py b/spinoff/util/testing/common.py
index <HASH>..<HASH> 100644
--- a/spinoff/util/testing/common.py
+++ b/spinoff/util/testing/common.py
@@ -4,7 +4,7 @@ import types
import warnings
from contextlib import contextmanager
-from gevent import idle, Timeout
+from gevent import idle, Timeout, sleep
from nose.tools import eq_
@@ -40,8 +40,13 @@ def expect_num_warnings(n, message=None, timeout=None):
eq_(len(w), n, message or "expected %s warnings but found %s: %s" % (n, len(w), ', '.join(map(str, w))))
-def expect_no_warnings(message=None):
- return expect_num_warnings(0, message)
+@contextmanager
+def expect_no_warnings(during, message=None):
+ with warnings.catch_warnings(record=True) as w:
+ warnings.simplefilter("always")
+ yield
+ sleep(during + 0.001) # + 0.001 so that warnings occuring exactly in `during` seconds would be noticed
+ eq_(len(w), 0, message or "expected no warnings but found %s: %s" % (len(w), ', '.join(map(str, w))))
def expect_one_warning(message=None): | Fixed expect_no_warnings to actually work properly--all previous implementations were completely broken | eallik_spinoff | train | py |
1a131b6eaf371913fd350ca6e8aac24a68d9704d | diff --git a/simulator/src/main/java/com/hazelcast/simulator/coordinator/Coordinator.java b/simulator/src/main/java/com/hazelcast/simulator/coordinator/Coordinator.java
index <HASH>..<HASH> 100644
--- a/simulator/src/main/java/com/hazelcast/simulator/coordinator/Coordinator.java
+++ b/simulator/src/main/java/com/hazelcast/simulator/coordinator/Coordinator.java
@@ -53,6 +53,8 @@ public final class Coordinator {
static final String SIMULATOR_VERSION = getSimulatorVersion();
+ private static final int WAIT_FOR_WORKER_FAILURE_RETRY_COUNT = 10;
+
private static final Logger LOGGER = Logger.getLogger(Coordinator.class);
private final TestPhaseListenerContainer testPhaseListenerContainer = new TestPhaseListenerContainer();
@@ -250,7 +252,7 @@ public final class Coordinator {
LOGGER.info((format("Finished starting of %s Worker JVMs (%s seconds)", totalWorkerCount, elapsed)));
echo(HORIZONTAL_RULER);
} catch (Exception e) {
- while (failureContainer.getFailureCount() == 0) {
+ for (int i = 0; i < WAIT_FOR_WORKER_FAILURE_RETRY_COUNT && failureContainer.getFailureCount() == 0; i++) {
sleepSeconds(1);
}
throw new CommandLineExitException("Failed to start Workers", e); | Limited wait timeout for worker startup failures in Coordinator to <I> seconds. | hazelcast_hazelcast-simulator | train | java |
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.