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 |
|---|---|---|---|---|---|
db46f77ef3cbe5a0fb21f6155596ac0efe283ad2 | diff --git a/src/Condition/Compiler.php b/src/Condition/Compiler.php
index <HASH>..<HASH> 100644
--- a/src/Condition/Compiler.php
+++ b/src/Condition/Compiler.php
@@ -152,7 +152,7 @@ class Compiler
}
$conditions = $model->getPermissionWheres($this->user, $where['permission']);
- if (!$conditions->wheres) {
+ if (!$conditions->wheres || (count($conditions->wheres) === 1 && $conditions->wheres[0]['type'] === 'raw' && $conditions->wheres[0]['sql'] === 'TRUE')) {
return $query;
} | If there's only one condition and it's satisfied, don't need to continue | tobscure_permissible | train | php |
ccedb54aef89214e3ee6af208a217ffd63389d13 | diff --git a/pagelet.js b/pagelet.js
index <HASH>..<HASH> 100644
--- a/pagelet.js
+++ b/pagelet.js
@@ -461,20 +461,28 @@ Pagelet.prototype.emit = function emit(event) {
* @api public
*/
Pagelet.prototype.broadcast = function broadcast(event) {
- EventEmitter.prototype.emit.apply(this, arguments);
+ var pagelet = this;
- var name = this.name +':'+ event;
+ /**
+ * Broadcast the event with namespaced name.
+ *
+ * @param {String} name Event name.
+ * @returns {Pagelet}
+ * @api private
+ */
+ function shout(name) {
+ pagelet.bigpipe.emit.apply(pagelet.bigpipe, [
+ name.join(':'),
+ pagelet
+ ].concat(Array.prototype.slice.call(arguments, 1)));
- if (this.parent) {
- name = this.parent.name +':'+ name;
+ return pagelet;
}
- this.bigpipe.emit.apply(this.bigpipe, [
- name,
- this
- ].concat(Array.prototype.slice.call(arguments, 1)));
+ EventEmitter.prototype.emit.apply(this, arguments);
- return this;
+ if (this.parent) shout([this.parent.name, this.name, event]);
+ return shout([this.name, event]);
};
/** | [minor] emit events both namespaced to parent and self
Improve the reusability of pagelet and especially recursive pagelets as standalone units. | bigpipe_bigpipe.js | train | js |
3ffa4f0295465b85557223f97598a08f70470e25 | diff --git a/bundles/target/src/main/java/org/jscsi/target/Activator.java b/bundles/target/src/main/java/org/jscsi/target/Activator.java
index <HASH>..<HASH> 100644
--- a/bundles/target/src/main/java/org/jscsi/target/Activator.java
+++ b/bundles/target/src/main/java/org/jscsi/target/Activator.java
@@ -61,7 +61,6 @@ public class Activator implements BundleActivator {
public void stop(BundleContext context) throws Exception {
// Need to provide a shutdown method within the jscsi target
runner.shutdown();
- System.exit(-1);
}
} | [MOD] Removed an exit command from the activator, since it influenced
the container. | sebastiangraf_jSCSI | train | java |
394679fc70343a4f693317e376df39a8216776e5 | diff --git a/src/platforms/web/compiler/index.js b/src/platforms/web/compiler/index.js
index <HASH>..<HASH> 100644
--- a/src/platforms/web/compiler/index.js
+++ b/src/platforms/web/compiler/index.js
@@ -58,6 +58,8 @@ export function compile (
})
if (process.env.NODE_ENV !== 'production') {
compiled.errors = errors.concat(detectErrors(compiled.ast))
+ } else {
+ compiled.errors = errors
}
return compiled
} | ensure errors Array is always present in compiler output | IOriens_wxml-transpiler | train | js |
0f05c6f9776eb05e75d55a83a29190541cdcd4e9 | diff --git a/lib/Thelia/Form/Definition/FrontForm.php b/lib/Thelia/Form/Definition/FrontForm.php
index <HASH>..<HASH> 100644
--- a/lib/Thelia/Form/Definition/FrontForm.php
+++ b/lib/Thelia/Form/Definition/FrontForm.php
@@ -29,4 +29,5 @@ final class FrontForm
const ADDRESS_UPDATE = 'thelia.front.address.update';
const CONTACT = 'thelia.front.contact';
const NEWSLETTER = 'thelia.front.newsletter';
+ const CART_ADD = 'thelia.cart.add';
} | use the correct method to get the correct CartAdd form
This allow to use the action TheliaEvents::FORM_AFTER_BUILD.".thelia_cart_add" during to build the form AND to submit the form :) | thelia_core | train | php |
2f5a9422a9282d682880ec945ac00cfc8afdc672 | diff --git a/filer/admin/fileadmin.py b/filer/admin/fileadmin.py
index <HASH>..<HASH> 100644
--- a/filer/admin/fileadmin.py
+++ b/filer/admin/fileadmin.py
@@ -114,7 +114,8 @@ class FileAdmin(PrimitivePermissionAwareModelAdmin):
url = r.get("Location", None)
# Account for custom Image model
- image_change_list_url_name = 'admin:filer_{0}_changelist'.format(Image._meta.model_name)
+ image_change_list_url_name = 'admin:{0}_{1}_changelist'.format(Image._meta.app_label,
+ Image._meta.model_name)
# Check against filer_file_changelist as file deletion is always made by
# the base class
if (url in ["../../../../", "../../"] or | You can set an app_label on your custom image model. Account for this in image admin changelist url. | divio_django-filer | train | py |
9e8298b5935d13d4d3be70695c0a5ab43811cfe7 | diff --git a/secedgar/filings/__init__.py b/secedgar/filings/__init__.py
index <HASH>..<HASH> 100644
--- a/secedgar/filings/__init__.py
+++ b/secedgar/filings/__init__.py
@@ -2,3 +2,4 @@ from secedgar.filings.filing import Filing # noqa:F401
from secedgar.filings.cik_lookup import CIKLookup # noqa: F401
from secedgar.filings.filing_types import FilingType # noqa:F401
from secedgar.filings.daily import DailyFilings # noqa:F401
+from secedgar.filings.master import MasterFilings # noqa:F401 | STRUCT: Add MasterFilings to filings package | coyo8_sec-edgar | train | py |
8927a13abff76ee022a7732e24b38c4bd6ddef81 | diff --git a/lib/modules/kss-splitter.js b/lib/modules/kss-splitter.js
index <HASH>..<HASH> 100644
--- a/lib/modules/kss-splitter.js
+++ b/lib/modules/kss-splitter.js
@@ -49,6 +49,7 @@ module.exports = {
kss: '',
code: []
},
+ firstBlock = true,
pairs = [],
isKssMarkupBlock = /Styleguide [0-9]+/
@@ -58,7 +59,7 @@ module.exports = {
// Check if KSS
if (isKssMarkupBlock.test(block.content)) {
// Save old pair
- if (pair) {
+ if (pair && !firstBlock) {
pair.code = pair.code.join('');
pairs.push(pair)
}
@@ -77,6 +78,8 @@ module.exports = {
pair.code.push(block.content)
}
+ firstBlock = false;
+
});
// Push last pair | Do not save first empty block into pair | SC5_sc5-styleguide | train | js |
696542a7fe7248b403da2833d2a41b15b4c4b750 | diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index <HASH>..<HASH> 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -352,5 +352,9 @@ def test_base_colorize(base_app):
# But if we create a fresh Cmd() instance, it will
fresh_app = cmd2.Cmd()
color_test = fresh_app.colorize('Test', 'red')
- assert color_test == '\x1b[31mTest\x1b[39m'
+ # Actually, colorization only ANSI escape codes is only applied on non-Windows systems
+ if sys.platform == 'win32':
+ assert out.startswith('Elapsed: 0:00:00')
+ else:
+ assert color_test == '\x1b[31mTest\x1b[39m' | Fix to colorize unit test for Windows | python-cmd2_cmd2 | train | py |
2dac75c440d5ac5d2a2473e22baaeb51281953e7 | diff --git a/pyairtable/api/api.py b/pyairtable/api/api.py
index <HASH>..<HASH> 100644
--- a/pyairtable/api/api.py
+++ b/pyairtable/api/api.py
@@ -267,7 +267,7 @@ class Api(ApiAbstract):
Args:
base_id: |arg_base_id|
table_name: |arg_table_name|
- records(``list``): List of dict: [{"id": record_id, "field": fields_to_update_dict}]
+ records(``list``): List of dict: [{"id": record_id, "fields": fields_to_update_dict}]
Keyword Args:
replace (``bool``, optional): If ``True``, record is replaced in its entirety | Minor doc change on batch_update
Current docstring says to use "field" as the key, but it needs to be "fields". | gtalarico_airtable-python-wrapper | train | py |
67990ed7ee175f96495e58c258304731d654c627 | diff --git a/engines/bastion/Gruntfile.js b/engines/bastion/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/engines/bastion/Gruntfile.js
+++ b/engines/bastion/Gruntfile.js
@@ -132,7 +132,7 @@ module.exports = function (grunt) {
reporters: ['progress', 'coverage'],
preprocessors: {
'app/assets/javascripts/bastion/**/*.html': ['ng-html2js'],
- 'app/assets/javascripts/bsation/**/*.js': ['coverage']
+ 'app/assets/javascripts/bastion/**/*.js': ['coverage']
},
coverageReporter: {
type: 'cobertura', | Fixes #<I>, fixing typo in karma coverage configuration. | Katello_katello | train | js |
40f6db588516dac1c57a895ef1275550b32b544e | diff --git a/api/src/main/java/org/project/neutrino/nfvo/api/RestVimInstances.java b/api/src/main/java/org/project/neutrino/nfvo/api/RestVimInstances.java
index <HASH>..<HASH> 100644
--- a/api/src/main/java/org/project/neutrino/nfvo/api/RestVimInstances.java
+++ b/api/src/main/java/org/project/neutrino/nfvo/api/RestVimInstances.java
@@ -13,7 +13,7 @@ import java.util.List;
@RestController
-@RequestMapping("/api/v1/datacenters")
+@RequestMapping("/api/v1/vim-instances")
public class RestVimInstances {
// TODO add log prints | from datacenter to vim-instances | openbaton_openbaton-client | train | java |
cb246d678aa8556cd7918d7f741cce407efb9bc8 | diff --git a/lib/coderunner/class_methods.rb b/lib/coderunner/class_methods.rb
index <HASH>..<HASH> 100644
--- a/lib/coderunner/class_methods.rb
+++ b/lib/coderunner/class_methods.rb
@@ -390,13 +390,27 @@ EOF
FileUtils.makedirs tl
unless ENV['CODE_RUNNER_LAUNCHER'] =~ /serial/
- Thread.new{loop{`cp #{tl}/queue_status.txt #{tl}/queue_status2.txt; ps > #{tl}/queue_status.txt`; sleep 1}}
-
mutex = Mutex.new
processes= []
Thread.new do
loop do
+ `cp #{tl}/queue_status.txt #{tl}/queue_status2.txt`
+ `ps > #{tl}/queue_status.txt`
+ mutex.synchronize do
+ File.open("#{tl}/queue_status.txt", 'a') do |f|
+ # This ensures that the right pids will be listed,
+ # regardless of the way that ps behaves
+ f.puts processes
+ end
+ end
+ sleep 1
+ end
+ end
+
+
+ Thread.new do
+ loop do
Dir.entries(tl).each do |file|
next unless file =~ (/(^.*)\.stop/)
pid = $1 | --Small patch to ensure that the correct pids always show up in the queue_status for launcher | coderunner-framework_coderunner | train | rb |
69aaffcccf1143c675bd2977d0bba47178623690 | diff --git a/lib/elastomer.js b/lib/elastomer.js
index <HASH>..<HASH> 100644
--- a/lib/elastomer.js
+++ b/lib/elastomer.js
@@ -190,8 +190,22 @@ Elastomer.prototype._injectHtml = function () {
if (this.useNative) {
this.shadowRoot.innerHTML = this.html.toString()
- this.css(this.shadowRoot)
+ // this.css(this.shadowRoot)
this._bind(this.shadowRoot)
+ if (this.css) {
+ if (typeof this.css === 'function') {
+ this.css(this.shadowRoot)
+ } else {
+ var style = document.createElement('style')
+ style.setAttribute('type', 'text/css')
+ this.shadowRoot.appendChild(style)
+ if (style.styleSheet) {
+ style.styleSheet.cssText = this.css.toString()
+ } else {
+ style.textContent = this.css.toString()
+ }
+ }
+ }
} else {
this.shadowRoot.innerHTML = this.html.toString()
this._bind(this.shadowRoot.shadow) | fix: Support raw css in native mode | nodys_elastomer | train | js |
ccd550df2a2c18beaddbdf085968518663d35dcf | diff --git a/src/svg.js b/src/svg.js
index <HASH>..<HASH> 100644
--- a/src/svg.js
+++ b/src/svg.js
@@ -1,9 +1,14 @@
module.exports = {
draw: function(parent, svgString, config) {
if (!parent) return;
- var el = root.getElement(svgString, config);
+ var el = module.exports.getElement(svgString, config);
if (el) {
- $(parent).append(el);
+ if (parent.append) {
+ parent.append(el);
+ } else {
+ //regular dom doc
+ parent.appendChild(el);
+ }
}
},
getElement: function(svgString, config) { | fixed issue with reference to missing jquery | OpenTriply_YASGUI.utils | train | js |
38ffed9d05d920e6f8cdae6c908c609a94692045 | diff --git a/src/main/java/com/github/tomakehurst/wiremock/http/HttpClientFactory.java b/src/main/java/com/github/tomakehurst/wiremock/http/HttpClientFactory.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/github/tomakehurst/wiremock/http/HttpClientFactory.java
+++ b/src/main/java/com/github/tomakehurst/wiremock/http/HttpClientFactory.java
@@ -74,6 +74,7 @@ public class HttpClientFactory {
.disableRedirectHandling()
.disableContentCompression()
.setMaxConnTotal(maxConnections)
+ .setMaxConnPerRoute(maxConnections)
.setDefaultRequestConfig(RequestConfig.custom().setStaleConnectionCheckEnabled(true).build())
.setDefaultSocketConfig(SocketConfig.custom().setSoTimeout(timeoutMilliseconds).build())
.useSystemProperties(); | Made max connections per route the same as max connections for proxying as the default is low and sometimes presents a bottleneck | tomakehurst_wiremock | train | java |
f8a6624df4013eedb3abf49f9b09187ba2c945f6 | diff --git a/lib/action_subscriber/configuration.rb b/lib/action_subscriber/configuration.rb
index <HASH>..<HASH> 100644
--- a/lib/action_subscriber/configuration.rb
+++ b/lib/action_subscriber/configuration.rb
@@ -72,7 +72,7 @@ module ActionSubscriber
::ActionSubscriber.config.__send__("#{key}=", setting) if setting
end
- nil
+ true
end
end
end | Configuration memo should return something truthy or this will change | mxenabled_action_subscriber | train | rb |
4a81fc333ec045f246b13477774fb1282a606792 | diff --git a/lib/excon.rb b/lib/excon.rb
index <HASH>..<HASH> 100644
--- a/lib/excon.rb
+++ b/lib/excon.rb
@@ -145,6 +145,9 @@ module Excon
request_params[:headers]['Authorization'] ||= 'Basic ' << ['' << user << ':' << pass].pack('m').delete(Excon::CR_NL)
end
end
+ if request_params.has_key?(:headers)
+ request_params[:headers] = Excon::Headers.new
+ end
if block_given?
if response_params
raise(ArgumentError.new("stub requires either response_params OR a block")) | use case-insensitive header stuff for stubs
closes #<I> | excon_excon | train | rb |
4624b67272843bded690055ae8b512924a107904 | diff --git a/lib/middleware.js b/lib/middleware.js
index <HASH>..<HASH> 100644
--- a/lib/middleware.js
+++ b/lib/middleware.js
@@ -29,13 +29,14 @@ module.exports = uglifyjs.middleware = function (options) {
console[type]('%s'.cyan + ': ' + '%s'.green, key, val);
};
- return function (req, res, next) {
+ return function uglifyjsMiddleware (req, res, next) {
// Only handle GET and HEAD requests
if (req.method.toUpperCase() !== "GET" && req.method.toUpperCase() !== "HEAD") {
return next();
}
var filename = url.parse(req.url).pathname;
+ log('source', filename);
return next();
}; | Named the returning function and logging the source filename | Zweer_uglify.js-middleware | train | js |
1743d7d4bd869035e073fe48af27241668873f4f | diff --git a/test/to-string.js b/test/to-string.js
index <HASH>..<HASH> 100644
--- a/test/to-string.js
+++ b/test/to-string.js
@@ -223,3 +223,11 @@ test('utf8 replacement chars for anything in the surrogate pair range', function
)
t.end()
})
+
+test('utf8 don\'t replace the replacement char', function (t) {
+ t.equal(
+ new B('\uFFFD').toString(),
+ '\uFFFD'
+ )
+ t.end()
+}) | add failing test for replacing the utf8 replacement char | feross_buffer | train | js |
1a4aff9588069a906b95944447296c85f5efc534 | diff --git a/assess_model_migration.py b/assess_model_migration.py
index <HASH>..<HASH> 100755
--- a/assess_model_migration.py
+++ b/assess_model_migration.py
@@ -223,10 +223,6 @@ def ensure_migration_including_resources_succeeds(source_client, dest_client):
- Migrate that model to the other environment
- Ensure it's operating as expected
- Add a new unit to the application to ensure the model is functional
- - Migrate the model back to the original environment
- - Note: Test for lp:1607457, lp:1641824
- - Ensure it's operating as expected
- - Add a new unit to the application to ensure the model is functional
"""
resource_contents = get_random_string()
@@ -237,11 +233,6 @@ def ensure_migration_including_resources_succeeds(source_client, dest_client):
assert_model_migrated_successfully(
migration_target_client, application, resource_contents)
- migrate_back_client = migrate_model_to_controller(
- migration_target_client, source_client)
- assert_model_migrated_successfully(
- migrate_back_client, application, resource_contents)
-
migration_target_client.remove_service(application)
log.info('SUCCESS: resources migrated') | Move re-migration to new branch | juju_juju | train | py |
64227b327ec0f5cb7adc8eb5851ffbe5ee2aeaa5 | diff --git a/definitions/npm/socket.io-client_v2.x.x/flow_v0.34.x-/socket.io-client_v2.x.x.js b/definitions/npm/socket.io-client_v2.x.x/flow_v0.34.x-/socket.io-client_v2.x.x.js
index <HASH>..<HASH> 100644
--- a/definitions/npm/socket.io-client_v2.x.x/flow_v0.34.x-/socket.io-client_v2.x.x.js
+++ b/definitions/npm/socket.io-client_v2.x.x/flow_v0.34.x-/socket.io-client_v2.x.x.js
@@ -48,6 +48,7 @@ declare module "socket.io-client" {
declare export class Socket extends Emitter<Socket> {
constructor(io: Manager, nsp: string, opts?: SocketOptions): Socket;
+ id: string;
open(): Socket;
connect(): Socket;
send(...args: any[]): Socket; | socket.io-client: Add missing id definition (#<I>)
For socket.io-client_v2.x.x | flow-typed_flow-typed | train | js |
d2f57e96804739c055ed4b2e4e0bc2512f1bfb63 | diff --git a/src/Illuminate/Support/helpers.php b/src/Illuminate/Support/helpers.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Support/helpers.php
+++ b/src/Illuminate/Support/helpers.php
@@ -893,13 +893,13 @@ if (! function_exists('throw_if')) {
*
* @param bool $boolean
* @param \Throwable|string $exception
- * @param string $message
+ * @param array ...$parameters
* @return void
*/
- function throw_if($boolean, $exception, $message = '')
+ function throw_if($boolean, $exception, ...$parameters)
{
if ($boolean) {
- throw (is_string($exception) ? new $exception($message) : $exception);
+ throw (is_string($exception) ? new $exception(...$parameters) : $exception);
}
}
}
@@ -910,13 +910,13 @@ if (! function_exists('throw_unless')) {
*
* @param bool $boolean
* @param \Throwable|string $exception
- * @param string $message
+ * @param array ...$parameters
* @return void
*/
- function throw_unless($boolean, $exception, $message)
+ function throw_unless($boolean, $exception, ...$parameters)
{
if (! $boolean) {
- throw (is_string($exception) ? new $exception($message) : $exception);
+ throw (is_string($exception) ? new $exception(...$parameters) : $exception);
}
}
} | [<I>] Use of argument (un)packing in throw_if/unless helpers (#<I>)
* Use of argument (un)packing in throw_if/unless helpers
* Replace $arguments with $parameters
because "argument is the value/variable/reference being passed in, parameter is the receiving variable used w/in the function/block" :) | laravel_framework | train | php |
ba2bcb8017ac82f3887fe0d2cd5a22464053df18 | diff --git a/sharq/utils.py b/sharq/utils.py
index <HASH>..<HASH> 100644
--- a/sharq/utils.py
+++ b/sharq/utils.py
@@ -18,7 +18,7 @@ def is_valid_identifier(identifier):
- _ (underscore)
- - (hypen)
"""
- if not isinstance(identifier, basestring):
+ if not isinstance(identifier, str):
return False
if len(identifier) > 100 or len(identifier) < 1:
@@ -32,7 +32,7 @@ def is_valid_interval(interval):
"""Checks if the given interval is valid. A valid interval
is always a positive, non-zero integer value.
"""
- if not isinstance(interval, (int, long)):
+ if not isinstance(interval, int):
return False
if interval <= 0:
@@ -46,7 +46,7 @@ def is_valid_requeue_limit(requeue_limit):
A valid requeue limit is always greater than
or equal to -1.
"""
- if not isinstance(requeue_limit, (int, long)):
+ if not isinstance(requeue_limit, int):
return False
if requeue_limit <= -2: | change to python 3 semantics | plivo_sharq | train | py |
878e9b7616c5a7aa93b7552ff699ef44346b2633 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -35,7 +35,7 @@ setup(
author = "Kristen Thyng",
author_email = "kthyng@gmail.com",
url = 'https://github.com/matplotlib/cmocean',
- download_url = 'https://github.com/matplotlib/cmocean/tarball/0.2.1',
+ download_url = 'https://github.com/matplotlib/cmocean/tarball/0.2.2',
description = ("Colormaps for Oceanography"),
long_description=open('README.rst').read(),
classifiers=[ | updated version manually to update pypi | matplotlib_cmocean | train | py |
00ba0f7c0fdffc6046a5a8f6bea43257f3208a38 | diff --git a/lib/vestal_versions.rb b/lib/vestal_versions.rb
index <HASH>..<HASH> 100644
--- a/lib/vestal_versions.rb
+++ b/lib/vestal_versions.rb
@@ -97,7 +97,7 @@ module LaserLemon
return {} if chain.empty?
backward = chain.first > chain.last
- backward ? chain.pop : chain.shift
+ backward ? chain.pop : chain.shift unless [from_number, to_number].include?(1)
chain.inject({}) do |changes, version|
version.changes.each do |attribute, change| | Don't pop or shift the reversion chain when dealing with version number 1.
This is because when dealing with version number 1, a corresponding version record will not exist in the chain. | laserlemon_vestal_versions | train | rb |
695e2522505c3e55d975cefb2eba529c733a0d19 | diff --git a/src/puzzle/Puzzle.js b/src/puzzle/Puzzle.js
index <HASH>..<HASH> 100644
--- a/src/puzzle/Puzzle.js
+++ b/src/puzzle/Puzzle.js
@@ -518,11 +518,11 @@ function parseImageOption(){ // (type,quality,option)のはず
type = argv;
break;
case 'number':
- if(argv>1.1){ cellsize = argv;}else{ quality = argv;}
+ if(argv>1.01){ cellsize = argv;}else{ quality = argv;}
break;
case 'object':
- cellsize = argv.cellsize || 0;
- bgcolor = argv.bgcolor || '';
+ if('cellsize' in argv){ cellsize = argv.cellsize;}
+ if('bgcolor' in argv){ bgcolor = argv.bgcolor;}
break;
}
} | Puzzle: Fix illegal handling of option value in outputting image functions | sabo2_pzprjs | train | js |
632d4490f0acd8b5a29a6e0ef1d6140aa726c95f | diff --git a/network.go b/network.go
index <HASH>..<HASH> 100644
--- a/network.go
+++ b/network.go
@@ -851,14 +851,25 @@ func (n *network) updateSvcRecord(ep *endpoint, localEps []*endpoint, isAdd bool
if iface := ep.Iface(); iface.Address() != nil {
myAliases := ep.MyAliases()
if isAdd {
- if !ep.isAnonymous() {
+ // If anonymous endpoint has an alias use the first alias
+ // for ip->name mapping. Not having the reverse mapping
+ // breaks some apps
+ if ep.isAnonymous() {
+ if len(myAliases) > 0 {
+ n.addSvcRecords(myAliases[0], iface.Address().IP, true)
+ }
+ } else {
n.addSvcRecords(epName, iface.Address().IP, true)
}
for _, alias := range myAliases {
n.addSvcRecords(alias, iface.Address().IP, false)
}
} else {
- if !ep.isAnonymous() {
+ if ep.isAnonymous() {
+ if len(myAliases) > 0 {
+ n.deleteSvcRecords(myAliases[0], iface.Address().IP, true)
+ }
+ } else {
n.deleteSvcRecords(epName, iface.Address().IP, true)
}
for _, alias := range myAliases { | If anonymous container has alias names use it for DNS PTR record | docker_libnetwork | train | go |
97fcb20210044605d6d3378a09de670544e54d62 | diff --git a/tests/AttributeInjectors/HostnameAttributeInjectorTest.php b/tests/AttributeInjectors/HostnameAttributeInjectorTest.php
index <HASH>..<HASH> 100644
--- a/tests/AttributeInjectors/HostnameAttributeInjectorTest.php
+++ b/tests/AttributeInjectors/HostnameAttributeInjectorTest.php
@@ -12,13 +12,13 @@ class HostnameAttributeInjectorTest extends TestCase
$injector = new HostnameAttributeInjector();
$this->assertEquals('hostname', $injector->getAttributeKey());
- $injector = new HostnameAttributeInjectorTest('custom_attribute');
+ $injector = new HostnameAttributeInjector('custom_attribute');
$this->assertEquals('custom_attribute', $injector->getAttributeKey());
}
public function testGetAttributeValue()
{
- $injector = new HostnameAttributeInjectorTest();
+ $injector = new HostnameAttributeInjector();
$this->assertEquals(gethostname(), $injector->getAttributeValue());
}
} | fix the broken unit test, for realsies | Superbalist_php-event-pubsub | train | php |
0fa27832b7aeb1b40111627f56a83a166b3d30c6 | diff --git a/src/store-enhancer.js b/src/store-enhancer.js
index <HASH>..<HASH> 100644
--- a/src/store-enhancer.js
+++ b/src/store-enhancer.js
@@ -12,6 +12,8 @@ import { default as matcherFactory } from './create-matcher';
import attachRouterToReducer from './reducer-enhancer';
import { locationDidChange } from './action-creators';
+import matchCache from './match-cache';
+
import validateRoutes from './util/validate-routes';
import flattenRoutes from './util/flatten-routes';
@@ -61,6 +63,7 @@ export default ({
history.listen(newLocation => {
/* istanbul ignore else */
if (newLocation) {
+ matchCache.clear();
store.dispatch(locationDidChange({
location: newLocation, matchRoute
})); | Clear the MatchCache whenever the location changes
This way the cache will not get stale | FormidableLabs_redux-little-router | train | js |
4e37c79f4c054e484e01e40692384edfd3e717ef | diff --git a/lib/workers/scheduler.rb b/lib/workers/scheduler.rb
index <HASH>..<HASH> 100644
--- a/lib/workers/scheduler.rb
+++ b/lib/workers/scheduler.rb
@@ -57,7 +57,6 @@ module Workers
return nil
rescue Exception => e
- puts e.inspect
end
def process_overdue
diff --git a/lib/workers/timer.rb b/lib/workers/timer.rb
index <HASH>..<HASH> 100644
--- a/lib/workers/timer.rb
+++ b/lib/workers/timer.rb
@@ -38,7 +38,6 @@ module Workers
begin
@callback.call if @callback
rescue Exception => e
- puts "EXCEPTION: #{e.message}\n#{e.backtrace.join("\n")}\n--"
end
return nil | Remove puts. Will replace with logger.error in future. | chadrem_workers | train | rb,rb |
466165f879abb6fe7653243c0a14b23217312a22 | diff --git a/python_modules/dagster/dagster/core/definitions/decorators/repository.py b/python_modules/dagster/dagster/core/definitions/decorators/repository.py
index <HASH>..<HASH> 100644
--- a/python_modules/dagster/dagster/core/definitions/decorators/repository.py
+++ b/python_modules/dagster/dagster/core/definitions/decorators/repository.py
@@ -211,7 +211,7 @@ def repository(
def __init__(self, yaml_directory):
self._yaml_directory = yaml_directory
- def get_all_jobs(self):
+ def get_all_pipelines(self):
return [
self._construct_job_def_from_yaml_file(
self._yaml_file_for_job_name(file_name) | Update RepositoryData docs to reflect what method you actually need to override when building one (#<I>)
Summary:
Currently RepositoryData has two methods, get_all_pipelines and get_all_jobs, and (presumably for back-compat reasons), get_all_pipelines returns both pipelines and jobs. The doc incorrectly implies that you only need to override get_all_jobs.
We may want to change this in the future as CRAG rolls out more, but for now update the docs to reflect reality. | dagster-io_dagster | train | py |
a182de7f1e534ec62694222c9acc71cad9de7ad2 | diff --git a/server/config.js b/server/config.js
index <HASH>..<HASH> 100644
--- a/server/config.js
+++ b/server/config.js
@@ -4,7 +4,7 @@ const config = {
port: process.env.PORT || 1337,
apiUrl: process.env.API_URL || 'http://localhost:3000',
authPort: process.env.AUTH_PORT || 3005,
- appDomain: `app.${process.env.APP_DOMAIN}` || 'localhost',
+ appDomain: process.env.APP_DOMAIN || 'localhost',
timeout: 60000
} | Fix app_domain env for build app | nossas_bonde-client | train | js |
ff7e65e5a09c9ba54d7eefb7bec416d00dcb275a | diff --git a/semver.js b/semver.js
index <HASH>..<HASH> 100644
--- a/semver.js
+++ b/semver.js
@@ -161,8 +161,8 @@ var LONETILDE = R++;
src[LONETILDE] = '(?:~>?)';
var TILDETRIM = R++;
-src[TILDETRIM] = src[LONETILDE] + '\s+';
-var tildeTrimReplace = '$1';
+src[TILDETRIM] = src[LONETILDE] + '\\s+';
+var tildeTrimReplace = '~';
var TILDE = R++;
src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'; | Fix typo in tilde trim expression | npm_node-semver | train | js |
93e85eb227652f5c5b535550b8afcb8ee6fe1de8 | diff --git a/perceval/backends/core/telegram.py b/perceval/backends/core/telegram.py
index <HASH>..<HASH> 100644
--- a/perceval/backends/core/telegram.py
+++ b/perceval/backends/core/telegram.py
@@ -61,7 +61,7 @@ class Telegram(Backend):
:param tag: label used to mark the data
:param archive: archive to store/retrieve items
"""
- version = '0.9.1'
+ version = '0.9.2'
CATEGORIES = [CATEGORY_MESSAGE]
@@ -101,9 +101,14 @@ class Telegram(Backend):
return items
- def fetch_items(self, **kwargs):
- """Fetch the messages"""
+ def fetch_items(self, category, **kwargs):
+ """Fetch the messages
+ :param category: the category of items to fetch
+ :param kwargs: backend arguments
+
+ :returns: a generator of items
+ """
offset = kwargs['offset']
chats = kwargs['chats'] | [telegram] Set category when calling fetch and fetch_from_archive
This patch adds to the params of the fetch_items method the category.
Thus, it allows to handle fetching operations
(fetch and fetch_from_archive) with multiple categories | chaoss_grimoirelab-perceval | train | py |
7c63bbcc19a7eec66d430404bbae5fb755980b96 | diff --git a/includes/pb-utility.php b/includes/pb-utility.php
index <HASH>..<HASH> 100644
--- a/includes/pb-utility.php
+++ b/includes/pb-utility.php
@@ -382,7 +382,7 @@ function check_epubcheck_install() {
}
}
- return false;
+ return apply_filters( 'pb_epub_has_dependencies', false );
}
/** | add filter hook 'pb_epub_has_dependencies' to epub export class (#<I>)
* add filter hook 'pb_epub_has_dependencies' to epub export class
this allows a user to hook into the filter and enable epub exports
without having to install the dependency EpubCheck
* apply pb_epub_as_dependencies filter to check_epubcheck_install function | pressbooks_pressbooks | train | php |
6a3f5ae9fb2f045a5a22eb58b50cfe6feed57176 | diff --git a/src/components/Editor/Tab.js b/src/components/Editor/Tab.js
index <HASH>..<HASH> 100644
--- a/src/components/Editor/Tab.js
+++ b/src/components/Editor/Tab.js
@@ -188,7 +188,7 @@ class Tab extends PureComponent<Props> {
<div
className={className}
key={sourceId}
- onMouseUp={handleTabClick}
+ onClick={handleTabClick}
onContextMenu={e => this.onTabContextMenu(e, sourceId)}
title={getFileURL(source)}
> | Change Tab click handler event from onMouseUp to onClick to avoid conflict with CloseButton (#<I>) | firefox-devtools_debugger | train | js |
d874743017a5e580e36981ef49e108014fbde8fc | diff --git a/classes/phing/tasks/system/condition/IsTrueCondition.php b/classes/phing/tasks/system/condition/IsTrueCondition.php
index <HASH>..<HASH> 100644
--- a/classes/phing/tasks/system/condition/IsTrueCondition.php
+++ b/classes/phing/tasks/system/condition/IsTrueCondition.php
@@ -35,11 +35,11 @@ class IsTrueCondition extends ProjectComponent implements Condition
/**
* Set the value to be tested.
*
- * @param boolean $value
+ * @param mixed $value
*/
- public function setValue(bool $value)
+ public function setValue($value)
{
- $this->value = $value;
+ $this->value = (bool) $value;
}
/** | Fixed IsTrueCondition (#<I>) | phingofficial_phing | train | php |
cb57d9464e7e221b90eb048449714a9b2cee1250 | diff --git a/packages/@ember/-internals/runtime/lib/mixins/array.js b/packages/@ember/-internals/runtime/lib/mixins/array.js
index <HASH>..<HASH> 100644
--- a/packages/@ember/-internals/runtime/lib/mixins/array.js
+++ b/packages/@ember/-internals/runtime/lib/mixins/array.js
@@ -693,6 +693,13 @@ const ArrayMixin = Mixin.create(Enumerable, {
```javascript
function(item, index, array);
+ let arr = [1, 2, 3, 4, 5, 6];
+
+ arr.map(element => element * element);
+ // [1, 4, 9, 16, 25, 36];
+
+ arr.map((element, index) => element + index);
+ // [1, 3, 5, 7, 9, 11];
```
- `item` is the current item in the iteration.
@@ -725,6 +732,16 @@ const ArrayMixin = Mixin.create(Enumerable, {
Similar to map, this specialized function returns the value of the named
property on all items in the enumeration.
+ ```javascript
+ let people = [{name: 'Joe'}, {name: 'Matt'}];
+
+ people.mapBy('name');
+ // ['Joe', 'Matt'];
+
+ people.mapBy('unknownProperty');
+ // [undefined, undefined];
+ ```
+
@method mapBy
@param {String} key name of the property
@return {Array} The mapped array. | Adds doc for map and mapBy methods of EmberArray | emberjs_ember.js | train | js |
599e38f00bbe49e5f8f62aa067e7f5cbbf38064d | diff --git a/packages/material-ui/src/Popper/Popper.js b/packages/material-ui/src/Popper/Popper.js
index <HASH>..<HASH> 100644
--- a/packages/material-ui/src/Popper/Popper.js
+++ b/packages/material-ui/src/Popper/Popper.js
@@ -183,7 +183,7 @@ const Popper = React.forwardRef(function Popper(props, ref) {
role="tooltip"
style={{
// Prevents scroll issue, waiting for Popper.js to add this style once initiated.
- position: 'absolute',
+ position: 'fixed',
}}
{...other}
> | [Popper] Fix scroll jump when content contains autofocus input (#<I>) (#<I>)
closes #<I> | mui-org_material-ui | train | js |
b0182e56025382e3320041bc71cf202bcf9bd82f | diff --git a/cli.js b/cli.js
index <HASH>..<HASH> 100755
--- a/cli.js
+++ b/cli.js
@@ -13,7 +13,7 @@ var USAGE = 'Usage:\n' +
' ' + pkg.name + ' --config="path/to/browserlist/file"\n' +
' ' + pkg.name + ' --coverage "QUERIES"\n' +
' ' + pkg.name + ' --coverage=US "QUERIES"\n' +
- ' ' + pkg.name + ' --coverage=US,RU,world "QUERIES"\n' +
+ ' ' + pkg.name + ' --coverage=US,RU,global "QUERIES"\n' +
' ' + pkg.name + ' --env="environment name defined in config"\n' +
' ' + pkg.name + ' --stats="path/to/browserlist/stats/file"' | In `--help`, rename world to global (#<I>) | browserslist_browserslist | train | js |
e6e0fb38b7e4f5a3c3449c4ff83d0da11fe7690a | diff --git a/trailblazer/analyze/cli.py b/trailblazer/analyze/cli.py
index <HASH>..<HASH> 100644
--- a/trailblazer/analyze/cli.py
+++ b/trailblazer/analyze/cli.py
@@ -80,8 +80,10 @@ def start(context, ccp, config, executable, gene_list, email, priority, dryrun,
if email:
user = api.user(email)
new_entry.user = user
- commit_analysis(context.obj['manager'], new_entry)
- context.obj['manager'].commit()
+
+ if not dryrun:
+ commit_analysis(context.obj['manager'], new_entry)
+ context.obj['manager'].commit()
@analyze.command() | don't log pending if dryrun | Clinical-Genomics_trailblazer | train | py |
98518d7730e704dadccd7286a0fffe48fb743862 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@ setup(
author='Kyle Conroy',
author_email='help@twilio.com',
description='Simple framework for creating REST APIs',
- packages=find_packages(),
+ packages=find_packages(exclude=['tests']),
zip_safe=False,
include_package_data=True,
platforms='any', | Don't install 'tests' package | flask-restful_flask-restful | train | py |
a806443d851d057059e64786bc4e04a724082d8f | diff --git a/apiserver/common/crossmodel/interface.go b/apiserver/common/crossmodel/interface.go
index <HASH>..<HASH> 100644
--- a/apiserver/common/crossmodel/interface.go
+++ b/apiserver/common/crossmodel/interface.go
@@ -7,9 +7,8 @@ import (
"time"
"github.com/juju/charm/v8"
- "gopkg.in/macaroon.v2"
-
"github.com/juju/names/v4"
+ "gopkg.in/macaroon.v2"
"github.com/juju/juju/core/crossmodel"
"github.com/juju/juju/core/network" | fix incorrect change made to import ordering by my ide. | juju_juju | train | go |
0cb1b74d77fd3c46715b1722e8a43eb3ccc00cda | diff --git a/killer.py b/killer.py
index <HASH>..<HASH> 100644
--- a/killer.py
+++ b/killer.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
-__version__ = '0.1.4'
+__version__ = '0.1.4-1'
__author__ = 'Lvl4Sword'
import argparse
@@ -132,4 +132,5 @@ if __name__ == '__main__':
detect_usb()
detect_ac()
detect_battery()
+ detect_tray(cdrom_drive)
time.sleep(rest) | <I>-1 - Actually run detect_tray(cdrom_drive)
- detect_tray(cdrom_drive) wasn't actually running, it is now. | Lvl4Sword_Killer | train | py |
e00bd0409e466b7f4dfc242b1537bf7d54f5c968 | diff --git a/gtabview/dataio.py b/gtabview/dataio.py
index <HASH>..<HASH> 100644
--- a/gtabview/dataio.py
+++ b/gtabview/dataio.py
@@ -3,6 +3,7 @@ from __future__ import print_function, unicode_literals, absolute_import
import os
import sys
+import warnings
from .compat import *
@@ -79,6 +80,8 @@ def read_table(fd_or_path, enc, delimiter, hdr_rows, sheet_index=0):
try:
data = read_xlrd(fd_or_path, sheet_index)
except ImportError:
+ warnings.warn("xlrd module not installed")
+ except:
pass
if data is None:
data = read_csv(fd_or_path, enc, delimiter, hdr_rows) | Improved XLS[X] handling
- Issue a warning when xlrd is not available but an xls[x] file has been
provided.
- Fallback trying to read the xls[x] file with read_csv to handle disguised
files correctly (yes, this happens quite often in windows-land to simply use
excel as a viewer). | TabViewer_gtabview | train | py |
73c3fca9f9afc46eba2a3986bebea079185d4d0f | diff --git a/lib/metasploit_data_models/active_record_models/vuln_attempt.rb b/lib/metasploit_data_models/active_record_models/vuln_attempt.rb
index <HASH>..<HASH> 100755
--- a/lib/metasploit_data_models/active_record_models/vuln_attempt.rb
+++ b/lib/metasploit_data_models/active_record_models/vuln_attempt.rb
@@ -1,7 +1,7 @@
module MetasploitDataModels::ActiveRecordModels::VulnAttempt
def self.included(base)
base.class_eval {
- belongs_to :vuln, :class_name => "Mdm::VulnAttempt", :counter_cache => :vuln_attempt_count
+ belongs_to :vuln, :class_name => "Mdm::Vuln", :counter_cache => :vuln_attempt_count
validates :vuln_id, :presence => true
}
end | Fix a bad classname that prevented cache_counters from working | rapid7_metasploit_data_models | train | rb |
203d84cd8e1fe62ff2da9ebf670d8aeca4bbbbf9 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -47,7 +47,7 @@ requirements = [
'tokenizers==0.8.1',
'click>=7.0', # Dependency of youtokentome
'youtokentome>=1.0.6',
- 'fasttext>=0.9.2'
+ 'fasttext>=0.9.1,!=0.9.2' # Fix to 0.9.1 due to https://github.com/facebookresearch/fastText/issues/1052
]
setup( | [Fix][SageMaker] Make sure that the installation works in SageMaker (#<I>)
* Fasttext to <I>
* Update setup.py | dmlc_gluon-nlp | train | py |
56d7a5247cea3c0c8ca559048217467bcf09b4d8 | diff --git a/js/idex.js b/js/idex.js
index <HASH>..<HASH> 100644
--- a/js/idex.js
+++ b/js/idex.js
@@ -586,6 +586,8 @@ module.exports = class idex extends Exchange {
'type': undefined,
'name': name,
'active': undefined,
+ 'deposit': undefined,
+ 'withdraw': undefined,
'fee': undefined,
'precision': parseInt (precisionString),
'limits': { | idex: add deposit/withdraw flag in currencies ccxt/ccxt#<I> | ccxt_ccxt | train | js |
5b75368d6245d5448ce8814f0872859e9ae0da56 | diff --git a/concrete/src/Database/Driver/PDOStatement.php b/concrete/src/Database/Driver/PDOStatement.php
index <HASH>..<HASH> 100644
--- a/concrete/src/Database/Driver/PDOStatement.php
+++ b/concrete/src/Database/Driver/PDOStatement.php
@@ -29,15 +29,6 @@ class PDOStatement extends \Doctrine\DBAL\Driver\PDOStatement
/**
* @deprecated
- * alias to old ADODB method
- */
- public function free()
- {
- return $this->closeCursor();
- }
-
- /**
- * @deprecated
* alias to old ADODB result method
*/
public function numRows() | Remove deprecated PDOStatement::free()
Its signature is not compatible with the DBAL PDOStatement implementation | concrete5_concrete5 | train | php |
379cceb46ed6c38abeec0d0c2edac6050c23d8dd | diff --git a/test/utils/TestContext.js b/test/utils/TestContext.js
index <HASH>..<HASH> 100644
--- a/test/utils/TestContext.js
+++ b/test/utils/TestContext.js
@@ -29,11 +29,11 @@ function initGL(){
antialias : true,
premultipliedAlpha : true,
preserveDrawingBuffer : false,
- preferLowPowerToHighPerformance : false,
+ preferLowPowerToHighPerformance : true,
failIfMajorPerformanceCaveat : false
}
- gl = cvs.getContext( 'webgl', opts ) || cvs.getContext( 'experimental-webgl', opts );
+ gl = cvs.getContext( 'webgl', opts ) || cvs.getContext( 'experimental-webgl', opts ) || cvs.getContext( 'webgl');
gl.viewport( 0,0,glSize, glSize )
gl.clearColor( 1, 0, 0, 1)
gl.clear( gl.COLOR_BUFFER_BIT ) | try to fallback to context with no attributes in tests | plepers_nanogl | train | js |
76bd1397d4f2d71b5e3afd60927c2c2f049705b0 | diff --git a/src/selectors/entities/channels.js b/src/selectors/entities/channels.js
index <HASH>..<HASH> 100644
--- a/src/selectors/entities/channels.js
+++ b/src/selectors/entities/channels.js
@@ -20,6 +20,7 @@ import {
} from 'selectors/entities/preferences';
import {getLastPostPerChannel} from 'selectors/entities/posts';
import {getCurrentTeamId, getCurrentTeamMembership} from 'selectors/entities/teams';
+import {isCurrentUserSystemAdmin} from 'selectors/entities/users';
import {
buildDisplayableChannelList,
@@ -138,6 +139,19 @@ export const getCurrentChannelStats = createSelector(
}
);
+export function isCurrentChannelReadOnly(state) {
+ return isChannelReadOnly(state, getCurrentChannel(state));
+}
+
+export function isChannelReadOnlyById(state, channelId) {
+ return isChannelReadOnly(state, getChannel(state, channelId));
+}
+
+export function isChannelReadOnly(state, channel) {
+ return channel && channel.name === General.DEFAULT_CHANNEL &&
+ !isCurrentUserSystemAdmin(state) && getConfig(state).ExperimentalTownSquareIsReadOnly === 'true';
+}
+
export const getChannelSetInCurrentTeam = createSelector(
getCurrentTeamId,
getChannelsInTeam, | Add selectors to check if current channel and a channel is ReadOnly. (#<I>) | mattermost_mattermost-redux | train | js |
161596fd1166c18fd8f2c7c4fc4c3ebc11142690 | diff --git a/tests/Database/Core/DatabaseStatementTest.php b/tests/Database/Core/DatabaseStatementTest.php
index <HASH>..<HASH> 100644
--- a/tests/Database/Core/DatabaseStatementTest.php
+++ b/tests/Database/Core/DatabaseStatementTest.php
@@ -20,4 +20,14 @@ class DatabaseStatementTest extends TestCase
$row = $result->next();
self::assertEquals('superman', $row->name);
}
+
+ public function testEmptyResultSet()
+ {
+ $db = new Database(new DatabaseSource());
+ $db->query('CREATE TABLE heroes(id NUMERIC PRIMARY KEY, name TEXT NULL, enabled INTEGER, power REAL);');
+ $db->query("INSERT INTO heroes(id, name, enabled, power) VALUES (1, 'Batman', 1, 5.6);");
+ $result = $db->query("SELECT power FROM heroes WHERE id = 99");
+ self::assertEquals("SELECT power FROM heroes WHERE id = 99", $result->getPdoStatement()->queryString);
+ self::assertNull($result->next());
+ }
} | test: add tests for DatabaseStatement | dadajuice_zephyrus | train | php |
a5c09803383025306116a400765909e98e14afb3 | diff --git a/src/js/core/drop.js b/src/js/core/drop.js
index <HASH>..<HASH> 100644
--- a/src/js/core/drop.js
+++ b/src/js/core/drop.js
@@ -109,6 +109,7 @@ export default {
disconnected() {
if (this.isActive()) {
+ this.hide(false);
active = null;
}
}, | fix: ensure eventlisteners are removed on disconnect | uikit_uikit | train | js |
5463e26f6ccc4b7966d07372d7468c5fc9076b48 | diff --git a/fc/excel_io.py b/fc/excel_io.py
index <HASH>..<HASH> 100644
--- a/fc/excel_io.py
+++ b/fc/excel_io.py
@@ -11,7 +11,6 @@
import collections
import xlrd
-import xlwt
import openpyxl
def import_rows(workbook_name, worksheet_name): | xlwt dependency has been removed. | taborlab_FlowCal | train | py |
4b37e2a491748d2007344029b4ca462d4b2145fb | diff --git a/js/shared/javascript.js b/js/shared/javascript.js
index <HASH>..<HASH> 100755
--- a/js/shared/javascript.js
+++ b/js/shared/javascript.js
@@ -130,14 +130,23 @@ exports.getPromise = function() {
return promise
}
-exports.bytesToString = function(byteArray, offset) {
- return byteArray.toString();
- return String.fromCharCode.apply(String, Array.prototype.slice.call(byteArray, offset || 0))
-}
-
-exports.recall = function(self, args, timeout) {
- var fn = args.callee
- return function(){ return fn.apply(self, args) }
+exports.getDependable = function() {
+ var dependants = [],
+ dependable = {}
+
+ dependable.depend = function(onFulfilled) {
+ dependants.push(onFulfilled)
+ if (dependable.fulfillment) {
+ onFulfilled.apply(this, dependable.fulfillment)
+ }
+ }
+ dependable.fulfill = function() {
+ dependable.fulfillment = arguments
+ for (var i=0; i < dependants.length; i++) {
+ dependants[i].apply(this, dependable.fulfillment)
+ }
+ }
+ return dependable
}
exports.assert = function(shouldBeTrue, msg, values) { | Remove unused functions bytesToString and recall, and add new function getDependable, where a dependable is an object that may fulfill multiple times | marcuswestin_fin | train | js |
f620871d5a70ac0d478efc94c961a610391e6b83 | diff --git a/mock.py b/mock.py
index <HASH>..<HASH> 100644
--- a/mock.py
+++ b/mock.py
@@ -15,6 +15,7 @@
__all__ = (
'Mock',
+ 'MagicMock',
'mocksignature',
'patch',
'patch_object', | Adding MagicMock to mock.__all__ | testing-cabal_mock | train | py |
a8263597272cb0d9fef1546f595634da33a71492 | diff --git a/tests/test_flac.py b/tests/test_flac.py
index <HASH>..<HASH> 100644
--- a/tests/test_flac.py
+++ b/tests/test_flac.py
@@ -1,9 +1,8 @@
import shutil, os
from tests import TestCase, add
-from mutagen.flac import (to_int_be, Padding, VCFLACDict, MetadataBlock,
- StreamInfo, SeekTable, CueSheet, FLAC, delete,
- Picture)
+from mutagen.flac import to_int_be, Padding, VCFLACDict, MetadataBlock
+from mutagen.flac import StreamInfo, SeekTable, CueSheet, FLAC, delete, Picture
from tests.test__vorbis import TVCommentDict, VComment
try: from os.path import devnull
except ImportError: devnull = "/dev/null" | Python <I> compatibility. | quodlibet_mutagen | train | py |
e46804656cc4b4ddde00305adf24e584605f5455 | diff --git a/DependencyInjection/HttplugExtension.php b/DependencyInjection/HttplugExtension.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/HttplugExtension.php
+++ b/DependencyInjection/HttplugExtension.php
@@ -15,6 +15,7 @@ use Http\Message\Authentication\Wsse;
use Http\Mock\Client as MockClient;
use Psr\Http\Message\UriInterface;
use Symfony\Component\Config\FileLocator;
+use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\ChildDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
@@ -54,7 +55,7 @@ class HttplugExtension extends Extension
// Set main aliases
foreach ($config['main_alias'] as $type => $id) {
- $container->setAlias(sprintf('httplug.%s', $type), $id);
+ $container->setAlias(sprintf('httplug.%s', $type), new Alias($id, true));
}
// Configure toolbar | Make main aliases public
Symfony <I>+ is making services private by default, so this requires configuring the visibility explicitly. | php-http_HttplugBundle | train | php |
e0a369fec549498071504e19070bfdd69c49478b | diff --git a/packages/react-jsx-highcharts/src/components/PlotBandLine/UsePlotBandLineLifecycle.js b/packages/react-jsx-highcharts/src/components/PlotBandLine/UsePlotBandLineLifecycle.js
index <HASH>..<HASH> 100644
--- a/packages/react-jsx-highcharts/src/components/PlotBandLine/UsePlotBandLineLifecycle.js
+++ b/packages/react-jsx-highcharts/src/components/PlotBandLine/UsePlotBandLineLifecycle.js
@@ -29,10 +29,12 @@ export default function usePlotBandLineLifecycle(props, plotType) {
setPlotbandline({
id: myId,
getPlotBandLine: () => {
- const plotbandlineObject = axis.object.plotLinesAndBands.find(
- plb => plb.id === myId
- );
- return plotbandlineObject;
+ if (axis && axis.object && axis.object.plotLinesAndBands) {
+ const plotbandlineObject = axis.object.plotLinesAndBands.find(
+ plb => plb.id === myId
+ );
+ return plotbandlineObject;
+ }
}
});
} | Fix plotband label unmount crashing | whawker_react-jsx-highcharts | train | js |
6e4fd135899f79245a38686c054bf8fd1eb32ee1 | diff --git a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/jaxrs/RestResourcePreview.java b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/jaxrs/RestResourcePreview.java
index <HASH>..<HASH> 100644
--- a/app/src/main/java/org/jboss/hal/client/runtime/subsystem/jaxrs/RestResourcePreview.java
+++ b/app/src/main/java/org/jboss/hal/client/runtime/subsystem/jaxrs/RestResourcePreview.java
@@ -69,7 +69,7 @@ import static org.jboss.hal.resources.CSS.*;
class RestResourcePreview extends PreviewContent<RestResource> {
private static final String LINK = "link";
- private static final JsRegExp REGEX = new JsRegExp("\\{([\\w-\\.]+)\\}", "g"); //NON-NLS
+ private static final JsRegExp REGEX = new JsRegExp("\\{(.+)\\}", "g"); //NON-NLS
private final Environment environment;
private final ServerActions serverActions; | Fix regexp in runtime rest preview | hal_console | train | java |
c74d79e4e0b479e116d74d406ef86506508e4a22 | diff --git a/GCR/base.py b/GCR/base.py
index <HASH>..<HASH> 100644
--- a/GCR/base.py
+++ b/GCR/base.py
@@ -185,7 +185,14 @@ class BaseGenericCatalog(object):
Get information of a certain quantity.
If *key* is `None`, return the full dict for that quantity.
"""
- d = self._get_quantity_info_dict(quantity, default if key is None else dict())
+ d = self._get_quantity_info_dict(quantity, default=None)
+ if d is None and quantity in self._quantity_modifiers:
+ native = self._quantity_modifiers[quantity]
+ if native:
+ d = self._get_quantity_info_dict(native, default=None)
+
+ if d is None:
+ return default
if key is None:
return d | allow alias in get_quantity_info | yymao_generic-catalog-reader | train | py |
706e66dac26799c5cde0b6b67604488e1081904f | diff --git a/src/mimerender.py b/src/mimerender.py
index <HASH>..<HASH> 100644
--- a/src/mimerender.py
+++ b/src/mimerender.py
@@ -286,7 +286,7 @@ try:
del flask.request.environ[key]
def _make_response(self, content, content_type, status):
- response = flask._make_response(content)
+ response = flask.make_response(content)
response.status = status
response.headers['Content-Type'] = content_type
return response | fixed call to flask.make_response | martinblech_mimerender | train | py |
da4104bd595079b4e233d920707e676c282678ab | diff --git a/tests/test_orbit.py b/tests/test_orbit.py
index <HASH>..<HASH> 100644
--- a/tests/test_orbit.py
+++ b/tests/test_orbit.py
@@ -3031,6 +3031,7 @@ def test_SkyCoord():
assert numpy.all(numpy.fabs(decs-o.dec(times)) < 10.**-13.), 'Orbit SkyCoord dec and direct dec do not agree'
assert numpy.all(numpy.fabs(dists-o.dist(times)) < 10.**-13.), 'Orbit SkyCoord distance and direct distance do not agree'
# Check that the GC frame parameters are correctly propagated
+ if not _APY3: return None # not done in python 2
o= Orbit([120.,60.,2.,0.5,0.4,30.],radec=True,ro=10.,zo=1.,
solarmotion=[-10.,34.,12.])
assert numpy.fabs(o.SkyCoord().galcen_distance.to(units.kpc).value-numpy.sqrt(10.**2.+1.**2.)) < 10.**-13., 'Orbit SkyCoord GC frame attributes are incorrect' | Don't check galcen parameters in SkyCoord Orbit output for Python2 (because not done, because astropy does not support this) | jobovy_galpy | train | py |
a28b71084c00c92d3c06516d17c75d07376683df | diff --git a/app/models/fluentd/setting_archive/backup_file.rb b/app/models/fluentd/setting_archive/backup_file.rb
index <HASH>..<HASH> 100644
--- a/app/models/fluentd/setting_archive/backup_file.rb
+++ b/app/models/fluentd/setting_archive/backup_file.rb
@@ -2,15 +2,18 @@ class Fluentd
module SettingArchive
class BackupFile
include Archivable
+ attr_reader :note
FILE_EXTENSION = ".conf".freeze
def self.find_by_file_id(backup_dir, file_id)
- new(file_path_of(backup_dir, file_id))
+ note = Note.find_by_file_id(backup_dir, file_id) rescue nil
+ new(file_path_of(backup_dir, file_id), note)
end
- def initialize(file_path)
+ def initialize(file_path, note = nil)
@file_path = file_path
+ @note = note || Note.new(file_path.sub(/#{FILE_EXTENSION}$/, Note::FILE_EXTENSION))
end
end
end | Associate a note with a backup file. | fluent_fluentd-ui | train | rb |
f8ac29dab67e1d0f3512c1d52ef357d9d7148064 | diff --git a/src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java b/src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
+++ b/src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
@@ -128,4 +128,4 @@ public abstract class AbstractUnArchiver
protected abstract void execute()
throws ArchiverException, IOException;
-}
\ No newline at end of file
+} | o Adding newline at end of file. | sonatype_plexus-archiver | train | java |
7e9775bdb03f2f6648fe58958645fd8e31b5c79b | diff --git a/railties/lib/rails/test_unit/reporter.rb b/railties/lib/rails/test_unit/reporter.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/rails/test_unit/reporter.rb
+++ b/railties/lib/rails/test_unit/reporter.rb
@@ -5,7 +5,7 @@ module Rails
def report
return if passed?
io.puts
- io.puts "Failed test:"
+ io.puts "Failed tests:"
io.puts
io.puts aggregated_results
end | pluralize rerun snippet heading. | rails_rails | train | rb |
0e492b62c901ea3ddb48026a6a9bc4f1e54dca5c | diff --git a/authCipher.js b/authCipher.js
index <HASH>..<HASH> 100644
--- a/authCipher.js
+++ b/authCipher.js
@@ -44,8 +44,7 @@ StreamCipher.prototype._update = function (chunk) {
if (!this._called && this._alen) {
var rump = 16 - (this._alen % 16)
if (rump < 16) {
- rump = Buffer.from(rump)
- rump.fill(0)
+ rump = Buffer.alloc(rump, 0)
this._ghash.update(rump)
}
} | authCipher: fix Buffer.from using from rather than alloc | crypto-browserify_browserify-aes | train | js |
a3175462620a91935e41ccbaceb3f140483dd264 | diff --git a/visidata/basesheet.py b/visidata/basesheet.py
index <HASH>..<HASH> 100644
--- a/visidata/basesheet.py
+++ b/visidata/basesheet.py
@@ -145,7 +145,7 @@ class BaseSheet(DrawablePane):
cmd = self.getCommand(cmd or keystrokes)
if not cmd:
if keystrokes:
- vd.fail('no command for %s' % keystrokes)
+ vd.status('no command for %s' % keystrokes)
return False
escaped = False | [command-] do not fail/abort on unknown command | saulpw_visidata | train | py |
2f126e9277bc4bbf3527319d29b89d7b9abe3492 | diff --git a/src/main/java/org/joda/beans/ser/SerDeserializerProvider.java b/src/main/java/org/joda/beans/ser/SerDeserializerProvider.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/joda/beans/ser/SerDeserializerProvider.java
+++ b/src/main/java/org/joda/beans/ser/SerDeserializerProvider.java
@@ -22,6 +22,9 @@ package org.joda.beans.ser;
* Implementations of this interface can introspect the bean type when choosing a deserializer.
* This allows deserializers to be provided that can handle multiple bean types, for example all beans
* in a particular package, any bean with a particular supertype or with a particular annotation.
+ * <p>
+ * In the simple case where an exact match is needed, the class implementing {@link SerDeserializer}
+ * can also implement {@link SerDeserializerProvider} with a singleton constant instance.
*
* @author Stephen Colebourne
*/ | Add advice on implementing SerDeserializerProvider | JodaOrg_joda-beans | train | java |
61b03493a7abf8bc2ae9162c85210b48b4406fe6 | diff --git a/Controller/Adminhtml/Node/UploadImage.php b/Controller/Adminhtml/Node/UploadImage.php
index <HASH>..<HASH> 100644
--- a/Controller/Adminhtml/Node/UploadImage.php
+++ b/Controller/Adminhtml/Node/UploadImage.php
@@ -1,5 +1,7 @@
<?php
+declare(strict_types=1);
+
namespace Snowdog\Menu\Controller\Adminhtml\Node;
use Magento\Backend\App\Action; | [<I>] Enable strict mode in node admin controller image upload action | SnowdogApps_magento2-menu | train | php |
7edd0b89272d168bd7b2cb77efd58b158d65ecd7 | diff --git a/tests/Behat/Mink/Driver/web-fixtures/cookie_page1.php b/tests/Behat/Mink/Driver/web-fixtures/cookie_page1.php
index <HASH>..<HASH> 100644
--- a/tests/Behat/Mink/Driver/web-fixtures/cookie_page1.php
+++ b/tests/Behat/Mink/Driver/web-fixtures/cookie_page1.php
@@ -1,5 +1,5 @@
<?php
- setcookie('srvr_cookie', 'srv_var_is_set');
+ setcookie('srvr_cookie', 'srv_var_is_set', null, '/');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru"> | Set cookie to `/` path to please headless drivers | minkphp_Mink | train | php |
4b3c99df38e1320fecd8534a085456797b7f255e | diff --git a/lib/core/validation/validators/email.js b/lib/core/validation/validators/email.js
index <HASH>..<HASH> 100644
--- a/lib/core/validation/validators/email.js
+++ b/lib/core/validation/validators/email.js
@@ -14,6 +14,7 @@ ngModule.factory('avValEmail', avValPattern => {
validate(context) {
+ context.constraint = context.constraint || {};
context.constraint.value = EMAIL_PATTERN;
return avValPattern.validate(context);
diff --git a/lib/core/validation/validators/phone.js b/lib/core/validation/validators/phone.js
index <HASH>..<HASH> 100644
--- a/lib/core/validation/validators/phone.js
+++ b/lib/core/validation/validators/phone.js
@@ -13,6 +13,7 @@ ngModule.factory('avValPhone', avValPattern => {
}
validate(context) {
+ context.constraint = context.contraint || {};
context.constraint.value = PHONE_PATTERN;
return avValPattern.validate(context);
} | create new contraint object when missing from validate | Availity_availity-angular | train | js,js |
f1fc45d1e535076fe0ca24b1ee638543cbffdf54 | diff --git a/lib/Condorcet/Condorcet.php b/lib/Condorcet/Condorcet.php
index <HASH>..<HASH> 100644
--- a/lib/Condorcet/Condorcet.php
+++ b/lib/Condorcet/Condorcet.php
@@ -1058,6 +1058,6 @@ class Condorcet
// Interface with the aim of verifying the good modular implementation of algorithms.
interface Condorcet_Algo
{
- public function getResult();
+ public function getResult($options);
public function getStats();
} | Update interface for <I> modular algorithms | julien-boudry_Condorcet | train | php |
726da8269536c00fa4eda52fc6236bc3fcbbbd1e | diff --git a/tests/src/test/java/alluxio/collections/IndexedSetConcurrencyTest.java b/tests/src/test/java/alluxio/collections/IndexedSetConcurrencyTest.java
index <HASH>..<HASH> 100644
--- a/tests/src/test/java/alluxio/collections/IndexedSetConcurrencyTest.java
+++ b/tests/src/test/java/alluxio/collections/IndexedSetConcurrencyTest.java
@@ -378,7 +378,7 @@ public class IndexedSetConcurrencyTest {
}
@Test
- public void concurrentAddTest() throws Exception {
+ public void concurrentAdd() throws Exception {
List<Future<?>> futures = new ArrayList<>();
// Add random number of each task type. | [ALLUXIO-<I>] remote one unnecessary 'Test' suffix | Alluxio_alluxio | train | java |
5de1d5dd8fb29cbef454352950fd6abc11a3ba27 | diff --git a/lib/handlers/upgrade.js b/lib/handlers/upgrade.js
index <HASH>..<HASH> 100644
--- a/lib/handlers/upgrade.js
+++ b/lib/handlers/upgrade.js
@@ -410,7 +410,9 @@ upgrade.processPayment = function (req, res, next) {
return getCustomerByUser(req.session.user).then(function (results) {
var result = results[0];
debug('.then, stripe.customers.retrieve(%s)', result.stripe_id); // jshint ignore:line
- return stripe.customers.retrieve(result.stripe_id).catch(function (err) {
+ return stripe.customers.update(result.stripe_id, {
+ source: stripSubscriptionData.card
+ }).catch(function (err) {
// failed to subscribe existing user to stripe
metrics.increment('upgrade.fail.existing-user-change-subscription');
console.error('upgrade.fail.existing-user-change-subscription'); | fix: fail to re-upgrade
Fixes: #<I>
Fixes: #<I>
Fixes: #<I>
Fixes: #<I>
Fixes: #<I>
Fixes: #<I>
This was existing users that had customer records, but Stripe was using their original card details upon resubscribing. This fix updates their profile with the card that they just entered. | jsbin_jsbin | train | js |
891a141d965c9a84df5df48d45ae874e6dc33324 | diff --git a/spec/vcr/library_hooks/typhoeus_0.4_spec.rb b/spec/vcr/library_hooks/typhoeus_0.4_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/vcr/library_hooks/typhoeus_0.4_spec.rb
+++ b/spec/vcr/library_hooks/typhoeus_0.4_spec.rb
@@ -16,7 +16,7 @@ describe "Typhoeus 0.4 hook", :with_monkey_patches => :typhoeus_0_4 do
def directly_stub_request(method, url, response_body)
response = ::Typhoeus::Response.new(:code => 200, :body => response_body)
- allow(::Typhoeus::Hydra).to receive(method, url).and_return(response)
+ ::Typhoeus::Hydra.stub(method, url).and_return(response)
end
it_behaves_like 'a hook into an HTTP library', :typhoeus, 'typhoeus 0.4' | This was Typhoeus::Hydra.stub, not rspec's stub. | vcr_vcr | train | rb |
8e9e48ea13341b79347d34151641259363d1f2eb | diff --git a/lib/brainstem/presenter_collection.rb b/lib/brainstem/presenter_collection.rb
index <HASH>..<HASH> 100644
--- a/lib/brainstem/presenter_collection.rb
+++ b/lib/brainstem/presenter_collection.rb
@@ -279,15 +279,11 @@ module Brainstem
end
extracted_filters = extract_filters(options)
- extracted_filters.each do |key, val|
- if val[:arg].nil?
- extracted_filters.delete(key)
- else
- extracted_filters[key] = val[:arg]
- end
+ extracted_filters_for_search = extracted_filters.each.with_object({}) do |(key, val), hash|
+ hash[key] = val[:arg] unless val[:arg].nil?
end
- search_options.reverse_merge!(extracted_filters)
+ search_options.reverse_merge!(extracted_filters_for_search)
result_ids, count = options[:presenter].search_block.call(options[:params][:search], search_options)
if result_ids | use .each.with_object for extracted_filters_for_search | mavenlink_brainstem | train | rb |
230fab472636be0e7f18815197f8d88ea29af6fa | diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/SortMergeResultPartition.java b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/SortMergeResultPartition.java
index <HASH>..<HASH> 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/SortMergeResultPartition.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/SortMergeResultPartition.java
@@ -317,7 +317,6 @@ public class SortMergeResultPartition extends ResultPartition {
availabilityListener,
resultFile);
readers.add(reader);
- availabilityListener.notifyDataAvailable();
return reader;
} | [hotfix][network] Remove redundant data availability notification in SortMergeResultPartition
Remove redundant data availability notification in SortMergeResultPartition for FLINK-<I> has moved the notification to the requester.
This closes #<I>. | apache_flink | train | java |
81b84fb12b67d4f673c83e6db4d3042e416774c7 | diff --git a/plugins/inputs/sysstat/sysstat.go b/plugins/inputs/sysstat/sysstat.go
index <HASH>..<HASH> 100644
--- a/plugins/inputs/sysstat/sysstat.go
+++ b/plugins/inputs/sysstat/sysstat.go
@@ -122,7 +122,7 @@ func (s *Sysstat) collect(tempfile string) error {
collectInterval := s.interval - parseInterval
// If true, interval is not defined yet and Gather is run for the first time.
- if collectInterval < 0 {
+ if collectInterval <= 0 {
collectInterval = 1 // In that case we only collect for 1 second.
} | fix: avoid calling sadc with invalid 0 interval (#<I>) | influxdata_telegraf | train | go |
3443ae17e1891778fec20ec077a8292c2d04a340 | diff --git a/web/ext/base/handler.py b/web/ext/base/handler.py
index <HASH>..<HASH> 100644
--- a/web/ext/base/handler.py
+++ b/web/ext/base/handler.py
@@ -13,7 +13,7 @@ from webob import Response
from web.core.compat import str, unicode
-__all__ = ['serve', 'response', 'textual', 'empty', 'wsgi']
+__all__ = ['serve', 'response', 'textual', 'generator', 'empty', 'wsgi']
log = __import__('logging').getLogger(__name__)
@@ -70,13 +70,11 @@ def textual(context, result):
return True
-#@kinds(types.GeneratorType, collections.Iterable)
-#def primary(context, result):
-# if isinstance(result, (tuple, dict)):
-# return False
-#
-# context.response.body = result
-# return True
+@kinds(types.GeneratorType)
+def generator(context, result):
+ context.response.encoding = 'utf8'
+ context.response.app_iter = ((i.encode('utf8') if isinstance(i, unicode) else i) for i in result if i is not None)
+ return True
@kinds(type(None)) | Added iterable return type support back, to support direct use of cinje. | marrow_WebCore | train | py |
e8342519ada109e6fc77dd513c250dcb2e1fb9b8 | diff --git a/fun-stream.js b/fun-stream.js
index <HASH>..<HASH> 100644
--- a/fun-stream.js
+++ b/fun-stream.js
@@ -17,7 +17,10 @@ class FunStream {
return this
}
pipe (into, opts) {
- this.on('error', (err, stream) => into.emit('error', err, stream || this))
+ this.on('error', err => {
+ if (err.src === undefined) err.src = this
+ into.emit('error', err)
+ })
return mixinFun(super.pipe(into, opts), this[OPTS])
}
filter (filterWith, opts) {
@@ -114,7 +117,10 @@ function mixinFun (stream, opts) {
const originalPipe = obj.pipe
obj.pipe = function (into, opts) {
- this.on('error', (err, stream) => into.emit('error', err, stream || this))
+ this.on('error', err => {
+ if (err.src === undefined) err.src = this
+ into.emit('error', err)
+ })
return mixinFun(originalPipe.call(this, into, opts), this[OPTS])
}
return obj | Record which stream originally emitted an error | iarna_funstream | train | js |
c54cfcb19cac5be2e49dfb09e4a92a5e8b2d0f8a | diff --git a/lib/nugrant/bag.rb b/lib/nugrant/bag.rb
index <HASH>..<HASH> 100644
--- a/lib/nugrant/bag.rb
+++ b/lib/nugrant/bag.rb
@@ -9,6 +9,14 @@ module Nugrant
end
end
+ def method_missing(method, *args, &block)
+ return self[method]
+ end
+
+ ##
+ ### Hash Overriden Methods (for string & symbol indifferent access)
+ ##
+
def [](input)
key = __convert_key(input)
raise KeyError, "Undefined parameter '#{key}'" if not key?(key)
@@ -20,8 +28,8 @@ module Nugrant
super(__convert_key(input), value)
end
- def method_missing(method, *args, &block)
- return self[method]
+ def key?(key)
+ super(__convert_key(key))
end
## | Changed a bit Bag
* Overidde key? for indifferent access (symbol or string). Will explore
'insensitive_hash' eventually. | maoueh_nugrant | train | rb |
191354ffb02a79d17b1afae7efabef5642816354 | diff --git a/myql/myql.py b/myql/myql.py
index <HASH>..<HASH> 100755
--- a/myql/myql.py
+++ b/myql/myql.py
@@ -108,9 +108,9 @@ class YQL(object):
'''Formats conditions
args is a list of ['column', 'operator', 'value']
'''
-
if cond[1].lower() == 'in':
- if len(cond[2]) > 1:
+ #if len(cond[2]) > 1:
+ if not isinstance(cond[2], str):
cond[2] = "({0})".format(','.join(map(str,["'{0}'".format(e) for e in cond[2]])))
else:
cond[2] = "({0})".format(','.join(map(str,["{0}".format(e) for e in cond[2]]))) | fix #<I>: handling of one symbol OK | josuebrunel_myql | train | py |
1c0ee5ad51c494a3525314d48a13b745bdb546a5 | diff --git a/screen_widgets.go b/screen_widgets.go
index <HASH>..<HASH> 100644
--- a/screen_widgets.go
+++ b/screen_widgets.go
@@ -7,6 +7,7 @@ type TextSize struct {
type TileDef struct {
Events []TileDefEvent `json:"events,omitempty"`
+ Markers []TimeseriesMarker `json:"markers,omitempty"`
Requests []TimeseriesRequest `json:"requests,omitempty"`
Viz string `json:"viz,omitempty"`
}
@@ -22,6 +23,12 @@ type TimeseriesRequestStyle struct {
Palette string `json:"palette,omitempty"`
}
+type TimeseriesMarker struct {
+ Label string `json:"label,omitempty"`
+ Type string `json:"type,omitempty"`
+ Value string `json:"value,omitempty"`
+}
+
type TileDefEvent struct {
Query string `json:"q"`
} | Add markers to timeseries widgets | zorkian_go-datadog-api | train | go |
a15bf8f8f7ca06911a12b03184b7428d4a8c1716 | diff --git a/salt/cloud/__init__.py b/salt/cloud/__init__.py
index <HASH>..<HASH> 100644
--- a/salt/cloud/__init__.py
+++ b/salt/cloud/__init__.py
@@ -194,7 +194,9 @@ class CloudClient(object):
opts['show_deploy_args'] = False
opts['script_args'] = ''
# Update it with the passed kwargs
- opts.update(kwargs['kwargs'])
+ if 'kwargs' in kwargs:
+ opts.update(kwargs['kwargs'])
+ opts.update(kwargs)
return opts
def low(self, fun, low):
diff --git a/salt/runners/cloud.py b/salt/runners/cloud.py
index <HASH>..<HASH> 100644
--- a/salt/runners/cloud.py
+++ b/salt/runners/cloud.py
@@ -133,6 +133,10 @@ def create(provider, names, **kwargs):
image=ami-1624987f size='Micro Instance' ssh_username=ec2-user \
securitygroup=default delvol_on_destroy=True
'''
+ create_kwargs = {}
+ for kwarg in kwargs:
+ if not kwarg.startswith('__'):
+ create_kwargs[kwarg] = kwargs[kwarg]
client = _get_client()
- info = client.create(provider, names, **kwargs)
+ info = client.create(provider, names, **create_kwargs)
return info | Fixing passing kwargs in cloud.create runner | saltstack_salt | train | py,py |
153987e515fe348d387cf530bf228a4aa67abf69 | diff --git a/spec/lib/aixm/document_spec.rb b/spec/lib/aixm/document_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/aixm/document_spec.rb
+++ b/spec/lib/aixm/document_spec.rb
@@ -1815,7 +1815,7 @@ describe AIXM::Document do
AIXM.config.mid = true
_(subject.to_xml).must_equal <<~"END"
<?xml version="1.0" encoding="UTF-8"?>
- <OFMX-Snapshot xmlns:xsi="http://schema.openflightmaps.org/0/OFMX-Snapshot.xsd" version="0" origin="rubygem aixm-0.3.9" namespace="00000000-0000-0000-0000-000000000000" created="2018-01-01T12:00:00+01:00" effective="2018-01-01T12:00:00+01:00">
+ <OFMX-Snapshot xmlns:xsi="http://schema.openflightmaps.org/0/OFMX-Snapshot.xsd" version="0" origin="rubygem aixm-#{AIXM::VERSION}" namespace="00000000-0000-0000-0000-000000000000" created="2018-01-01T12:00:00+01:00" effective="2018-01-01T12:00:00+01:00">
<!-- Organisation: FRANCE -->
<Org source="LF|GEN|0.0 FACTORY|0|0">
<OrgUid region="LF" mid="971ba0a9-3714-12d5-d139-d26d5f1d6f25"> | Fix hard coded origin version in document spec | svoop_aixm | train | rb |
702ce34418a0471bfab0617339ca154dea2f63d5 | diff --git a/src/Version.php b/src/Version.php
index <HASH>..<HASH> 100644
--- a/src/Version.php
+++ b/src/Version.php
@@ -49,7 +49,7 @@ final class Version
}
$parts = explode(' ', static::VERSION, 2);
- $version = $parts[0] . '@' . $parts[1];
+ $version = $parts[0] . '-' . $parts[1];
$version = str_replace(' ', '', strtolower($version));
return $version; | Change the separator for Composer versions | bolt_bolt | train | php |
ea96bad761538e5dcf059163cea7065351797499 | diff --git a/spec/cobweb/cobweb_spec.rb b/spec/cobweb/cobweb_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/cobweb/cobweb_spec.rb
+++ b/spec/cobweb/cobweb_spec.rb
@@ -3,12 +3,8 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe Cobweb do
before(:each) do
-
@base_url = "http://www.baseurl.com/"
-
@cobweb = Cobweb.new :quiet => true, :cache => nil
-
-
end
it "should generate a cobweb object" do | commit to trigger travisci | stewartmckee_cobweb | train | rb |
f6ea9e0236c030f40ae72fe5d5d3fb1d42080de6 | diff --git a/services/modules/ips4/manager.py b/services/modules/ips4/manager.py
index <HASH>..<HASH> 100644
--- a/services/modules/ips4/manager.py
+++ b/services/modules/ips4/manager.py
@@ -48,7 +48,7 @@ class Ips4Manager:
@staticmethod
def _gen_pwhash(password):
- return bcrypt.encrypt(password.encode('utf-8'), rounds=13)
+ return bcrypt.using(ident='2a').encrypt(password.encode('utf-8'), rounds=13)
@staticmethod
def _get_salt(pw_hash): | Force bcrypt version 2a
Insecure, but 2b is not supported by IPS4 according to user reports. This manager needs to be changed to use the IPS4 API at some point anyway, so really a stop gap measure. | allianceauth_allianceauth | train | py |
41454ce8dab87dfbca3dd13f28b7af7ddeedd01f | diff --git a/lib/tabulo/table.rb b/lib/tabulo/table.rb
index <HASH>..<HASH> 100644
--- a/lib/tabulo/table.rb
+++ b/lib/tabulo/table.rb
@@ -237,9 +237,7 @@ module Tabulo
return self if column_registry.none?
columns = column_registry.values
- columns.each do |column|
- column.width = wrapped_width(column.header)
- end
+ columns.each { |column| column.width = wrapped_width(column.header) }
@sources.each do |source|
columns.each do |column| | Very minor tweak
This addresses one of the Code Climate "code smells". | matt-harvey_tabulo | train | rb |
bfaa6fac9eb93fa29b125a1e6f5acab644f8d89a | diff --git a/gtabview/viewer.py b/gtabview/viewer.py
index <HASH>..<HASH> 100644
--- a/gtabview/viewer.py
+++ b/gtabview/viewer.py
@@ -67,7 +67,8 @@ class Header4ExtModel(QtCore.QAbstractTableModel):
return QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter
if role != QtCore.Qt.DisplayRole:
return None
- return section if self.axis == (orientation - 1) else \
+ orient_axis = 0 if orientation == QtCore.Qt.Horizontal else 1
+ return section if self.axis == orient_axis else \
self.model.name(self.axis, section)
def data(self, index, role):
@@ -134,7 +135,7 @@ class Level4ExtModel(QtCore.QAbstractTableModel):
elif role == QtCore.Qt.BackgroundRole:
return self._background
elif role == QtCore.Qt.BackgroundRole:
- return self._palette.background()
+ return self._palette.window()
return None | Fix Viewer when used with PySide | TabViewer_gtabview | train | py |
89a431747c2a82d0be3162a8c7a08ce4e2bf0e1c | diff --git a/spec/art-decomp/fsm_spec.rb b/spec/art-decomp/fsm_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/art-decomp/fsm_spec.rb
+++ b/spec/art-decomp/fsm_spec.rb
@@ -147,6 +147,7 @@ module ArtDecomp describe FSM do
@mc.input_relevance.should == [nil, nil, 2, 1, 0]
@opus.input_relevance.should == [nil, nil, nil, nil, 2, 3, 4, 0, 1]
@s8.input_relevance.should == [3, 2, 1, 0, nil, nil, nil]
+ @tt.input_relevance.should == [1, 3, 2]
end
it 'should report whether it’s a truth table or a full-blown FSM' do | make sure FSM#input_relevance also works for truth tables | chastell_art-decomp | train | rb |
b819b5bd1476310881ff480eaff3b0facd995b16 | diff --git a/lib/vestal_versions/version.rb b/lib/vestal_versions/version.rb
index <HASH>..<HASH> 100644
--- a/lib/vestal_versions/version.rb
+++ b/lib/vestal_versions/version.rb
@@ -9,6 +9,7 @@ module VestalVersions
# Associate polymorphically with the parent record.
belongs_to :versioned, :polymorphic => true
+ attr_accessible :modifications, :number, :user, :tag, :reverted_from
# ActiveRecord::Base#changes is an existing method, so before serializing the +changes+ column,
# the existing +changes+ method is undefined. The overridden +changes+ method pertained to | adding whitelist attributes for active record <I> | laserlemon_vestal_versions | train | rb |
1e51f2402a6fd4b8f31ab1290fe919f2c534e71d | diff --git a/src/Repositories/Corporation/Extractions.php b/src/Repositories/Corporation/Extractions.php
index <HASH>..<HASH> 100644
--- a/src/Repositories/Corporation/Extractions.php
+++ b/src/Repositories/Corporation/Extractions.php
@@ -38,7 +38,7 @@ trait Extractions
{
// retrieve any valid extraction for the current corporation
return CorporationIndustryMiningExtraction::with(
- 'moon', 'moon.system', 'moon.constellation', 'moon.region', 'moon.moon_contents', 'moon.moon_contents.type',
+ 'moon', 'moon.system', 'moon.constellation', 'moon.region', 'moon.moon_content',
'structure', 'structure.info', 'structure.services')
->where('corporation_id', $corporation_id)
->where('natural_decay_time', '>', carbon()->subSeconds(CorporationIndustryMiningExtraction::THEORETICAL_DEPLETION_COUNTDOWN)) | refactor(moons): simplify relationships
use pivot instead complex dependencies for moon_content, materials and reactions. | eveseat_services | train | php |
8b98969bf7a4270a038cd3bb219572c113a0453d | diff --git a/addon/mixins/imgix-path-behavior.js b/addon/mixins/imgix-path-behavior.js
index <HASH>..<HASH> 100644
--- a/addon/mixins/imgix-path-behavior.js
+++ b/addon/mixins/imgix-path-behavior.js
@@ -143,6 +143,9 @@ export default Ember.Mixin.create({
* @method _incrementResizeCounter
*/
_incrementResizeCounter: function () {
+ if( this.get('isDestroyed') || this.get('isDestroying') ) {
+ return;
+ }
this.incrementProperty('_resizeCounter');
}, | the debounced call doesn't guarentee the object will still be undestroyed, and can't set properties of destroyed objects | imgix_ember-cli-imgix | train | js |
5aafc4db0d97da9428116e4edb06e3a696d8e480 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -68,6 +68,7 @@ function verifyChallenge (challenge, state) {
return null
state.remote.kx_pk = remote_pk
+ state.remote.app_mac = mac
state.secret = shared(state.local.kx_sk, state.remote.kx_pk)
state.shash = hash(state.secret) | remember the app_mac so it can be used as the nonce for the bulk encryption | auditdrivencrypto_secret-handshake | train | js |
49735cfde544174ec1513e8679bd95abc0e34c39 | diff --git a/lib/dust-helpers.js b/lib/dust-helpers.js
index <HASH>..<HASH> 100644
--- a/lib/dust-helpers.js
+++ b/lib/dust-helpers.js
@@ -229,6 +229,7 @@ var helpers = {
* @param key is the value to perform math against
* @param method is the math method, is a valid string supported by math helper like mod, add, subtract
* @param operand is the second value needed for operations like mod, add, subtract, etc.
+ * @param round is a flag to assure that an integer is returned
*/
"math": function ( chunk, context, bodies, params ) {
//key and method are required for further processing | Updated comments to include reference to round parameter for the math helper | linkedin_dustjs-helpers | train | js |
1892dc5bf19be2fd873cd809aa22e2810ca5a7c3 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -11,6 +11,7 @@ from os import listdir
from os.path import isfile, join
import re
import logging
+import sys
from setuptools import setup, find_packages
logging.basicConfig(level=logging.WARNING)
@@ -40,6 +41,13 @@ tests_require = [
extras_require["test"] = tests_require
+# Check for 'pytest-runner' only if setup.py was invoked with 'test'.
+# This optimizes setup.py for cases when pytest-runner is not needed,
+# using the approach that is suggested upstream.
+#
+# See https://pypi.org/project/pytest-runner/#conditional-requirement
+needs_pytest = {"pytest", "test", "ptr"}.intersection(sys.argv)
+pytest_runner = ["pytest-runner"] if needs_pytest else []
setup(
# Description
@@ -96,7 +104,7 @@ setup(
'windows-curses;platform_system=="Windows"',
"filelock",
],
- setup_requires=["pytest-runner"],
+ setup_requires=pytest_runner,
extras_require=extras_require,
tests_require=tests_require,
) | setup.py: require pytest-runner only when necessary (#<I>)
This optimizes setup.py for cases when pytest-runner is not needed,
using the approach that is suggested upstream:
<URL> | hardbyte_python-can | train | py |
e7c7ddaf38897f1e65535035ce8539bab152ba5d | diff --git a/test/exec-errors.js b/test/exec-errors.js
index <HASH>..<HASH> 100644
--- a/test/exec-errors.js
+++ b/test/exec-errors.js
@@ -24,7 +24,6 @@ suite.addBatch({
'a `ChildProcess` object is returned': childProcessTest,
'an error is sent to the callback': function(childProcess, err, stdout) {
assert(err);
- assert.equal(err.toString(), 'Error: spawn nonexistant ENOENT');
},
'the result is the null string': function(childProcess, err, stdout) {
assert.equal(stdout, ''); | Don't test the error string of exec errors
These errors are generated directly by the Node.js runtime and passed
on unchanged. Making assertions about their contents is needlessly
coupling things to implementation, doesn't give us anything, and in
fact actively harms us because the fact that the error text varies
across Node versions causes CI failures.
Therefore, remove the relevant assertion. | strugee_node-smart-spawn | train | js |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.