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 |
|---|---|---|---|---|---|
0a6bb9fdb1ac9d656d4acb6ca63e687d316561cd | diff --git a/drivers/overlay/overlay.go b/drivers/overlay/overlay.go
index <HASH>..<HASH> 100644
--- a/drivers/overlay/overlay.go
+++ b/drivers/overlay/overlay.go
@@ -1530,7 +1530,7 @@ func (d *Driver) get(id string, disableShifting bool, options graphdriver.MountO
diffDir := path.Join(id, "diff")
opts = fmt.Sprintf("lowerdir=%s,upperdir=%s,workdir=%s", strings.Join(relLowers, ":"), diffDir, workdir)
} else {
- opts = fmt.Sprintf("lowerdir=%s", strings.Join(absLowers, ":"))
+ opts = fmt.Sprintf("lowerdir=%s", strings.Join(relLowers, ":"))
}
if len(optsList) > 0 {
opts = fmt.Sprintf("%s,%s", opts, strings.Join(optsList, ",")) | overlay: mountFrom read-only mounts using relative paths
When we need to shell out to a helper binary to be able to pass relative
locations for directories listed in the mount options, whether or not
the mount is meant to be writable isn't a factor. | containers_storage | train | go |
c2a1fa694d01de09e7c54db7d22990a8f55f7ba0 | diff --git a/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java b/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java
index <HASH>..<HASH> 100644
--- a/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java
+++ b/platform/android/Rhodes/src/com/rhomobile/rhodes/geolocation/GeoLocationImpl.java
@@ -219,6 +219,10 @@ public class GeoLocationImpl {
}
private synchronized void setLocation(Location location) {
+ if (location == null) {
+ Logger.T(TAG, "setCurrentGpsLocation: location = null");
+ return;
+ }
Logger.T(TAG, "setCurrentGpsLocation: location=" + location);
try {
// We've received location update | fix NPE in GeoLocation Android | rhomobile_rhodes | train | java |
da614455e5576cc822d3489c3465c6eea6faa82d | diff --git a/tests/test_summary.py b/tests/test_summary.py
index <HASH>..<HASH> 100644
--- a/tests/test_summary.py
+++ b/tests/test_summary.py
@@ -149,10 +149,10 @@ def test_seasons_extended():
assert len(seasons[0].episodes) == 14
assert seasons[0].episodes[5].pk == (0, 5)
- assert seasons[0].episodes[5].title == u'2011 Comic Con Panel'
+ assert seasons[0].episodes[5].title == '2011 Comic Con Panel'
assert seasons[0].episodes[13].pk == (0, 13)
- assert seasons[0].episodes[13].title == u'World Premiere'
+ assert seasons[0].episodes[13].title == 'World Premiere'
# Season 5
assert seasons[5].pk == 5
@@ -165,10 +165,10 @@ def test_seasons_extended():
assert len(seasons[5].episodes) == 10
assert seasons[5].episodes[7].pk == (5, 7)
- assert seasons[5].episodes[7].title == u'The Gift'
+ assert seasons[5].episodes[7].title == 'The Gift'
assert seasons[5].episodes[9].pk == (5, 9)
- assert seasons[5].episodes[9].title == u'The Dance of Dragons'
+ assert seasons[5].episodes[9].title == 'The Dance of Dragons'
@responses.activate | Fixed compatibility issue running tests on Python <I> | fuzeman_trakt.py | train | py |
f0b015f1ed0e5e7af7f9303746dc7a4e14369de1 | diff --git a/cherrypy/_cperror.py b/cherrypy/_cperror.py
index <HASH>..<HASH> 100644
--- a/cherrypy/_cperror.py
+++ b/cherrypy/_cperror.py
@@ -459,7 +459,7 @@ def get_error_page(status, **kwargs):
if v is None:
kwargs[k] = ""
else:
- kwargs[k] = tonative(_escape(kwargs[k]))
+ kwargs[k] = _escape(kwargs[k])
# Use a custom template or callable for the error page?
pages = cherrypy.serving.request.error_page | Backed out changeset: 4edcd<I>
A better fix is in cherrypy-<I>.x (<I>a<I>b<I>e) | cherrypy_cheroot | train | py |
5806d8a238f6207c54de68f379561310ce78565a | diff --git a/tests/test_about_time.py b/tests/test_about_time.py
index <HASH>..<HASH> 100644
--- a/tests/test_about_time.py
+++ b/tests/test_about_time.py
@@ -146,6 +146,7 @@ def test_duration_human(duration, expected):
(1., 10, '10.0/s'),
(1., 2500, '2500.0/s'),
(1., 1825000, '1825000.0/s'),
+ (5.47945205e-07, 1, '1825000.0/s'),
(2., 1, '30.0/m'),
(2., 10, '5.0/s'),
(2., 11, '5.5/s'), | test(*) test very small duration in throughput_human | rsalmei_about-time | train | py |
ee7ca2ebccf08009dc8e0b95ce21ee9cc87ab752 | diff --git a/lib/Widget/DbCache.php b/lib/Widget/DbCache.php
index <HASH>..<HASH> 100644
--- a/lib/Widget/DbCache.php
+++ b/lib/Widget/DbCache.php
@@ -24,6 +24,13 @@ class DbCache extends AbstractCache
protected $table = 'cache';
/**
+ * Whether check if table is exists or not
+ *
+ * @var bool
+ */
+ protected $checkTable = true;
+
+ /**
* The SQL to check if table exists
*
* @var array
@@ -66,7 +73,7 @@ class DbCache extends AbstractCache
$driver = $db->getDriver();
$tableExistsSql = sprintf($this->checkTableSqls[$driver], $this->table);
- if (!$this->db->fetchColumn($tableExistsSql)) {
+ if ($this->checkTable && !$this->db->fetchColumn($tableExistsSql)) {
$createTableSql = sprintf($this->createTableSqls[$driver], $this->table);
$db->executeUpdate($createTableSql);
} | added checkTable option for dbCache widget | twinh_wei | train | php |
9ad863423aa8d5b51b2f13505073887f73546c35 | diff --git a/deploy_stack.py b/deploy_stack.py
index <HASH>..<HASH> 100755
--- a/deploy_stack.py
+++ b/deploy_stack.py
@@ -247,7 +247,7 @@ def deploy_job():
base_env = os.environ['ENV']
job_name = os.environ['JOB_NAME']
charm_prefix = os.environ['CHARM_PREFIX']
- machines = os.environ.get('MACHINES', '').split()
+ machines = os.environ.get('MANUAL_MACHINES', '').split()
new_path = '%s:%s' % (os.environ['NEW_JUJU_BIN'], os.environ['PATH'])
upgrade = bool(os.environ.get('UPGRADE') == 'true')
debug = bool(os.environ.get('DEBUG') == 'true') | Jenkins strips MACHINE from the env...use MANUAL_MACHINES. | juju_juju | train | py |
bdaed91bc2f5e5584abdc503d91f78e7bcb0a1d9 | diff --git a/cov_core.py b/cov_core.py
index <HASH>..<HASH> 100644
--- a/cov_core.py
+++ b/cov_core.py
@@ -13,7 +13,8 @@ def multiprocessing_start(obj):
def multiprocessing_finish(cov):
- cov.stop()
+ if cov._started:
+ cov.stop()
cov.save()
diff --git a/cov_core_init.py b/cov_core_init.py
index <HASH>..<HASH> 100644
--- a/cov_core_init.py
+++ b/cov_core_init.py
@@ -67,5 +67,7 @@ def init():
except ImportError:
pass
+ return cov
+
except Exception:
pass | Fixed API-breaking change.
Regression from b<I>d6f. | pytest-dev_pytest-cov | train | py,py |
53a64f714c452bd91f647ba655d1d055acb4542d | diff --git a/go/vt/discovery/fake_healthcheck.go b/go/vt/discovery/fake_healthcheck.go
index <HASH>..<HASH> 100644
--- a/go/vt/discovery/fake_healthcheck.go
+++ b/go/vt/discovery/fake_healthcheck.go
@@ -317,9 +317,9 @@ func (fhc *FakeHealthCheck) GetAllTablets() map[string]*topodatapb.Tablet {
func simpleCopy(th *TabletHealth) *TabletHealth {
return &TabletHealth{
Conn: th.Conn,
- Tablet: th.Tablet,
- Target: th.Target,
- Stats: th.Stats,
+ Tablet: proto.Clone(th.Tablet).(*topodatapb.Tablet),
+ Target: proto.Clone(th.Target).(*querypb.Target),
+ Stats: proto.Clone(th.Stats).(*querypb.RealtimeStats),
LastError: th.LastError,
PrimaryTermStartTime: th.PrimaryTermStartTime,
Serving: th.Serving, | recursively copy structs in broadcast to avoid data races in tests | vitessio_vitess | train | go |
290b8e7f3e52212cf4fd9cbbee568e948c945d81 | diff --git a/source/internal/_assoc.js b/source/internal/_assoc.js
index <HASH>..<HASH> 100644
--- a/source/internal/_assoc.js
+++ b/source/internal/_assoc.js
@@ -1,5 +1,5 @@
-import _isArray from './_isArray';
-import _isInteger from './_isInteger';
+import _isArray from './_isArray.js';
+import _isInteger from './_isInteger.js';
/**
* Makes a shallow clone of an object, setting or overriding the specified
diff --git a/source/internal/_dissoc.js b/source/internal/_dissoc.js
index <HASH>..<HASH> 100644
--- a/source/internal/_dissoc.js
+++ b/source/internal/_dissoc.js
@@ -1,6 +1,6 @@
-import _isInteger from './_isInteger';
-import _isArray from './_isArray';
-import remove from '../remove';
+import _isInteger from './_isInteger.js';
+import _isArray from './_isArray.js';
+import remove from '../remove.js';
/**
* Returns a new object that does not contain a `prop` property. | Add extension to dissoc and assoc | ramda_ramda | train | js,js |
3fbd1cc80965a0f49bfd6c505a1c021af95354fb | diff --git a/test/test_producer.py b/test/test_producer.py
index <HASH>..<HASH> 100644
--- a/test/test_producer.py
+++ b/test/test_producer.py
@@ -50,7 +50,7 @@ class TestKafkaProducer(unittest.TestCase):
client.get_partition_ids_for_topic.return_value = [0, 1]
producer = KeyedProducer(client)
topic = b"test-topic"
- key = 'testkey'
+ key = b"testkey"
bad_data_types = (u'你怎么样?', 12, ['a', 'list'],
('a', 'tuple'), {'a': 'dict'},) | Producer test fix for python3 | dpkp_kafka-python | train | py |
db0e35ca36b3a53a77c3cafdea598c7b915aa3d7 | diff --git a/s3transfer/__init__.py b/s3transfer/__init__.py
index <HASH>..<HASH> 100644
--- a/s3transfer/__init__.py
+++ b/s3transfer/__init__.py
@@ -609,6 +609,7 @@ class S3Transfer(object):
'SSECustomerKey',
'SSECustomerKeyMD5',
'SSEKMSKeyId',
+ 'Tagging',
]
def __init__(self, client, config=None, osutil=None):
diff --git a/s3transfer/manager.py b/s3transfer/manager.py
index <HASH>..<HASH> 100644
--- a/s3transfer/manager.py
+++ b/s3transfer/manager.py
@@ -177,6 +177,7 @@ class TransferManager(object):
'SSECustomerKey',
'SSECustomerKeyMD5',
'SSEKMSKeyId',
+ 'Tagging',
'WebsiteRedirectLocation'
]
@@ -188,7 +189,8 @@ class TransferManager(object):
'CopySourceSSECustomerAlgorithm',
'CopySourceSSECustomerKey',
'CopySourceSSECustomerKeyMD5',
- 'MetadataDirective'
+ 'MetadataDirective',
+ 'TaggingDirective',
]
ALLOWED_DELETE_ARGS = [ | added Tagging and TaggingDirective to ALLOWED_UPLOAD_ARGS | boto_s3transfer | train | py,py |
ae152cec09b496101841dcbc59613cc7a3d133a4 | diff --git a/pytorch_transformers/tokenization_utils.py b/pytorch_transformers/tokenization_utils.py
index <HASH>..<HASH> 100644
--- a/pytorch_transformers/tokenization_utils.py
+++ b/pytorch_transformers/tokenization_utils.py
@@ -266,7 +266,7 @@ class PreTrainedTokenizer(object):
with open(added_tokens_file, 'w', encoding='utf-8') as f:
if self.added_tokens_encoder:
- out_str = json.dumps(self.added_tokens_decoder, ensure_ascii=False)
+ out_str = json.dumps(self.added_tokens_encoder, ensure_ascii=False)
else:
out_str = u"{}"
f.write(out_str) | make save_pretrained work with added tokens
right now it's dumping the *decoder* when it should be dumping the *encoder*. this fixes that. | huggingface_pytorch-pretrained-BERT | train | py |
119b048037b81c0d59629649f6bf8a764baeeb04 | diff --git a/src/common.js b/src/common.js
index <HASH>..<HASH> 100644
--- a/src/common.js
+++ b/src/common.js
@@ -27,7 +27,7 @@ exports.routingKeyToString = function(entry, routingKey) {
word = '' + word;
}
assert(typeof(word) === 'string', "non-string routingKey entry: "
- + key.name);
+ + key.name + ": " + word);
assert(word.length <= key.maxSize,
"routingKey word: '" + word + "' for '" + key.name +
"' is longer than maxSize: " + key.maxSize);
diff --git a/src/exchanges.js b/src/exchanges.js
index <HASH>..<HASH> 100644
--- a/src/exchanges.js
+++ b/src/exchanges.js
@@ -95,6 +95,8 @@ var Publisher = function(entries, exchangePrefix, options) {
contentEncoding: 'utf-8',
CC: CCs
}, (err, val) => {
+ // NOTE: many channel errors will not invoke this callback at all,
+ // hence the 12-second timeout
done = true;
if (monitor) {
var d = process.hrtime(start); | add comment, better error handling for non-string rk entry | taskcluster_pulse-publisher | train | js,js |
3871662a9530e9f3c25f0c169ea8fbbfded1e1bc | diff --git a/src/client/voice/VoiceConnection.js b/src/client/voice/VoiceConnection.js
index <HASH>..<HASH> 100644
--- a/src/client/voice/VoiceConnection.js
+++ b/src/client/voice/VoiceConnection.js
@@ -139,7 +139,7 @@ class VoiceConnection extends EventEmitter {
this.sockets.ws.sendPacket({
op: VoiceOPCodes.SPEAKING,
d: {
- speaking: true,
+ speaking: this.speaking,
delay: 0,
},
}).catch(e => { | fix(setSpeaking) Fix #<I> (#<I>) | discordjs_discord.js | train | js |
71a9d9f0c9c48c5ffbbddf201d1c34bcbb8789dd | diff --git a/js/binance.js b/js/binance.js
index <HASH>..<HASH> 100644
--- a/js/binance.js
+++ b/js/binance.js
@@ -1887,6 +1887,8 @@ module.exports = class binance extends Exchange {
method = 'privateGetMyTrades';
} else if (type === 'future') {
method = 'fapiPrivateGetUserTrades';
+ } else if (type === 'delivery') {
+ method = 'dapiPrivateGetUserTrades';
}
params = this.omit (params, 'type');
const request = { | Fetch user trades for binance dapi | ccxt_ccxt | train | js |
036cbf7542a71eca88a229b739ba36defeff4722 | diff --git a/lib/linux-io.js b/lib/linux-io.js
index <HASH>..<HASH> 100644
--- a/lib/linux-io.js
+++ b/lib/linux-io.js
@@ -116,7 +116,10 @@ LinuxIO.prototype.digitalRead = function(pin, handler) {
this.on(event, handler);
if (!this._digitalReportsTimeoutId) {
- this._digitalReportsTimeoutId = setTimeout(this._tick.bind(this), this._samplingInterval);
+ this._digitalReportsTimeoutId = setTimeout(
+ this._digitalReportsTick.bind(this),
+ this._samplingInterval
+ );
}
return this;
@@ -320,7 +323,7 @@ LinuxIO.prototype.i2cReadOnce = function(address, register, size, handler) {
return this;
};
-LinuxIO.prototype._tick = function() {
+LinuxIO.prototype._digitalReportsTick = function() {
this._digitalReports.forEach(function (report) {
var value = this._digitalReadSync(report.pinData);
@@ -330,7 +333,10 @@ LinuxIO.prototype._tick = function() {
}
}.bind(this));
- this._digitalReportsTimeoutId = setTimeout(this._tick.bind(this), this._samplingInterval);
+ this._digitalReportsTimeoutId = setTimeout(
+ this._digitalReportsTick.bind(this),
+ this._samplingInterval
+ );
};
LinuxIO.prototype._analogReportsTick = function() { | _tick renamed to _digitalReportsTick | fivdi_linux-io | train | js |
b34b92474b102a280bd6ac48cd2ab3ecb9a4b9e8 | diff --git a/lib/auth.strategies/oauth/_oauthservices.js b/lib/auth.strategies/oauth/_oauthservices.js
index <HASH>..<HASH> 100644
--- a/lib/auth.strategies/oauth/_oauthservices.js
+++ b/lib/auth.strategies/oauth/_oauthservices.js
@@ -77,8 +77,8 @@ exports.OAuthServices= function(provider, legs) {
this.providerProvidesValidateNotReplay= (Object.prototype.toString.call(provider.validateNotReplay) === "[object Function]");
this.providerProvidesValidateNotReplayClient= (Object.prototype.toString.call(provider.validateNotReplayClient) === "[object Function]");
- if( !this.providerProvidesTokenByConsumer && !this.providerProvidesTokenByTokenAndConsumer) {
- throw new Error("Data provider must provide either tokenByConsumer() or tokenByTokenAndConsumer()");
+ if( !this.providerProvidesValidateNotReplay && !this.providerProvidesValidateNotReplayClient) {
+ throw new Error("Data provider must provide either validateNotReplay() or validateNotReplayClient()");
} else {
} | Better error reporting for missing validateNotReplay*() method | ciaranj_connect-auth | train | js |
84f597026edcd5741869e476fd4853405affa809 | diff --git a/src/libs/eventhandler.js b/src/libs/eventhandler.js
index <HASH>..<HASH> 100644
--- a/src/libs/eventhandler.js
+++ b/src/libs/eventhandler.js
@@ -197,6 +197,15 @@ export default class Eventhandler {
}
/**
+ * existsEvent
+ * @param {string} eventype
+ * @return {boolean}
+ */
+ existsEvent(eventType){
+ return this.config.events[eventType] ? true : false;
+ }
+
+ /**
* Return event callbacks
* @param {String} eventType
* @return {Array|null} | Eventhandler: added new method "existsEvent" | SerkanSipahi_app-decorators | train | js |
dc49c773b4d48ab600ec095ed1d38f1833eeb5e0 | diff --git a/src/Auditor.php b/src/Auditor.php
index <HASH>..<HASH> 100644
--- a/src/Auditor.php
+++ b/src/Auditor.php
@@ -30,7 +30,7 @@ class Auditor extends Manager implements Contracts\Auditor
*/
public function getDefaultDriver()
{
- return $this->app['config']['audit.driver'];
+ return 'database';
}
/** | fix(Auditor): hardcode the default driver | owen-it_laravel-auditing | train | php |
701503e0ab6ef8875cd5a634ee5766758625475f | diff --git a/resources/views/menu/admin.blade.php b/resources/views/menu/admin.blade.php
index <HASH>..<HASH> 100644
--- a/resources/views/menu/admin.blade.php
+++ b/resources/views/menu/admin.blade.php
@@ -15,7 +15,7 @@
data-icon_class="{{ $item->icon_class }}"
data-color="{{ $item->color }}"
data-route="{{ $item->route }}"
- data-parameters="{{ htmlspecialchars(json_encode($item->parameters)) }}"
+ data-parameters="{{ json_encode($item->parameters) }}"
>
<i class="voyager-edit"></i> {{ __('voyager::generic.edit') }}
</div>
@@ -25,7 +25,7 @@
@include('voyager::multilingual.input-hidden', [
'isModelTranslatable' => true,
'_field_name' => 'title'.$item->id,
- '_field_trans' => htmlspecialchars(json_encode($item->getTranslationsOf('title')))
+ '_field_trans' => json_encode($item->getTranslationsOf('title'))
])
@endif
<span>{{ $item->title }}</span> <small class="url">{{ $item->link() }}</small> | fix broken translation in menu builder (#<I>)
* fix broken translation in menu builder
* remove extra htmlspecialchars() | the-control-group_voyager | train | php |
7b08c1ee4cc55e7ba6bf63815219a6f9193540c4 | diff --git a/code/pages/RegistrableEvent.php b/code/pages/RegistrableEvent.php
index <HASH>..<HASH> 100644
--- a/code/pages/RegistrableEvent.php
+++ b/code/pages/RegistrableEvent.php
@@ -264,11 +264,11 @@ class RegistrableEvent_Controller extends Page_Controller {
public function registration($request) {
$id = $request->param('ID');
if (!ctype_digit($id)) {
- $this->httpError(404);
+ return $this->httpError(404);
}
$rego = EventRegistration::get()->byID($id);
if (!$rego || $rego->EventID != $this->ID) {
- $this->httpError(404);
+ return $this->httpError(404);
}
$request->shift();
$request->shiftAllParams(); | Halt execution in RegistribleEvent_controller registration action on <I> not found | registripe_registripe-core | train | php |
2ca53a85c8d89116455169df5420dd9facea5f1f | diff --git a/sanji/core.py b/sanji/core.py
index <HASH>..<HASH> 100644
--- a/sanji/core.py
+++ b/sanji/core.py
@@ -153,7 +153,7 @@ class Sanji(object):
if handler["schema"] is not None:
handler["schema"](message.data)
args_len = len(inspect.getargspec(handler["callback"]).args)
- if args_len == 3:
+ if args_len >= 3:
handler["callback"](self, result["message"], resp)
else:
logger.debug("Route callback's arguments must be" + | Arguments may larger than 3 for there may be schema exist. | Sanji-IO_sanji | train | py |
a848bd55bbee2312a24e728fa2cd1712d65f8cfa | diff --git a/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerJSON.java b/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerJSON.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerJSON.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/serialization/serializer/record/string/ORecordSerializerJSON.java
@@ -385,7 +385,7 @@ public class ORecordSerializerJSON extends ORecordSerializerStringAbstract {
}
}
}
- } else if (iFieldValueAsString.startsWith("{") && iFieldValueAsString.endsWith("}"))
+ } else if (iFieldValue.startsWith("{") && iFieldValue.endsWith("}"))
iType = OType.EMBEDDED;
else {
if (iFieldValueAsString.length() >= 4 && iFieldValueAsString.charAt(0) == ORID.PREFIX && iFieldValueAsString.contains(":")) { | Fixed issue <I>: JSON parser fails to parse fields with curly braces | orientechnologies_orientdb | train | java |
2daff94d894249fca7f3cc2b48c0023ea1f01743 | diff --git a/scan/scanner.go b/scan/scanner.go
index <HASH>..<HASH> 100644
--- a/scan/scanner.go
+++ b/scan/scanner.go
@@ -443,7 +443,7 @@ func swaggerSchemaForType(typeName string, prop swaggerTypable) error {
case "uintptr":
prop.Typed("integer", "uint64")
default:
- return fmt.Errorf("unknown builtin %q", typeName)
+ return fmt.Errorf("unsupported type %q", typeName)
}
return nil
} | change unsupported builtin error message, closes #<I> | go-swagger_go-swagger | train | go |
8d2e89011a7534c9018fde0973aa42e0ae59e2e6 | diff --git a/fastlane/lib/fastlane/actions/actions_helper.rb b/fastlane/lib/fastlane/actions/actions_helper.rb
index <HASH>..<HASH> 100644
--- a/fastlane/lib/fastlane/actions/actions_helper.rb
+++ b/fastlane/lib/fastlane/actions/actions_helper.rb
@@ -1,4 +1,5 @@
module Fastlane
+ # rubocop:disable Metrics/ModuleLength
module Actions
module SharedValues
LANE_NAME = :LANE_NAME
@@ -144,4 +145,5 @@ module Fastlane
is_class_action?(class_ref) && class_ref.category == :deprecated
end
end
+ # rubocop:enable Metrics/ModuleLength
end | Allowing longer module length on actions_helper | fastlane_fastlane | train | rb |
9fb4f6536638cffd12555493a7911bed94a52bd6 | diff --git a/lib/ronin/script/script.rb b/lib/ronin/script/script.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/script/script.rb
+++ b/lib/ronin/script/script.rb
@@ -96,6 +96,20 @@ module Ronin
#
module ClassMethods
#
+ # The shortened name of the Script class.
+ #
+ # @return [String]
+ # The shortened name.
+ #
+ # @since 1.4.0
+ #
+ # @api semipublic
+ #
+ def short_name
+ @short_name ||= self.name.split('::').last
+ end
+
+ #
# Loads the {Script} of the same class.
#
# @param [String] path | Added Script::ClassMethods#short_name. | ronin-ruby_ronin | train | rb |
7b6793a3735b4add8ddc71bb5c6f7001983d3c57 | diff --git a/packages/blueprint-sequelize/app/services/sequelize.js b/packages/blueprint-sequelize/app/services/sequelize.js
index <HASH>..<HASH> 100644
--- a/packages/blueprint-sequelize/app/services/sequelize.js
+++ b/packages/blueprint-sequelize/app/services/sequelize.js
@@ -1,7 +1,8 @@
const { Service, computed } = require ('@onehilltech/blueprint');
const Sequelize = require ('sequelize');
-const { forOwn } = require ('lodash');
+const { forOwn, mapValues } = require ('lodash');
+const Bluebird = require ('bluebird');
/**
* @class sequelize
@@ -64,5 +65,9 @@ module.exports = Service.extend ({
model (name, o) {
+ },
+
+ start () {
+ return Bluebird.props (mapValues (this._connections, connection => connection.authenticate ()));
}
}); | feat: open connection to database when service starts | onehilltech_blueprint | train | js |
1fa68179edb128f0dbe5bcbacfd09193517cea0b | diff --git a/lib/styleguide.js b/lib/styleguide.js
index <HASH>..<HASH> 100644
--- a/lib/styleguide.js
+++ b/lib/styleguide.js
@@ -103,7 +103,7 @@ function jsonSections(sections) {
deprecated: section.deprecated(),
experimental: section.experimental(),
reference: section.reference(),
- markup: section.markup()
+ markup: section.markup().toString()
}
});
}
@@ -115,7 +115,7 @@ function jsonModifiers(modifiers) {
name: modifier.name(),
description: sanitize(modifier.description()),
className: modifier.className(),
- markup: modifier.markup()
+ markup: modifier.markup().toString()
}
});
}
\ No newline at end of file | Fix front end problems with markup type | SC5_sc5-styleguide | train | js |
321caf6db6517b0b053aa8c26b5edcf498fd34f9 | diff --git a/lib/Cake/Controller/Component/AuthComponent.php b/lib/Cake/Controller/Component/AuthComponent.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/Controller/Component/AuthComponent.php
+++ b/lib/Cake/Controller/Component/AuthComponent.php
@@ -314,7 +314,7 @@ class AuthComponent extends Component {
if (!$this->_getUser()) {
if (!$request->is('ajax')) {
$this->flash($this->authError);
- $this->Session->write('Auth.redirect', Router::reverse($request));
+ $this->Session->write('Auth.redirect', $request->here());
$controller->redirect($loginAction);
return false;
} elseif (!empty($this->ajaxLogin)) { | Fix incorrect value being stored in Auth.redirect.
An incorrect value would be stored in Auth.redirect when
a custom route with the `pass` key set.
Fixes #<I> | cakephp_cakephp | train | php |
5c5af0e021ff61dca0afbe6daacf775071305a0c | diff --git a/phy/utils/logging.py b/phy/utils/logging.py
index <HASH>..<HASH> 100644
--- a/phy/utils/logging.py
+++ b/phy/utils/logging.py
@@ -1,3 +1,4 @@
+from __future__ import absolute_import
"""Logger utility classes and functions."""
# ----------------------------------------------------------------------------- | Added future statement to avoid absolute/relative import bug in Python 2. | kwikteam_phy | train | py |
254ae5132c002d1b43b3f1294ed91767ef312962 | diff --git a/pytablewriter/writer/_elasticsearch.py b/pytablewriter/writer/_elasticsearch.py
index <HASH>..<HASH> 100644
--- a/pytablewriter/writer/_elasticsearch.py
+++ b/pytablewriter/writer/_elasticsearch.py
@@ -48,6 +48,23 @@ class ElasticsearchWriter(AbstractTableWriter):
def support_split_write(self):
return True
+ @property
+ def table_name(self):
+ return super(ElasticsearchWriter, self).table_name
+
+ @table_name.setter
+ def table_name(self, value):
+ from pathvalidate import (
+ ElasticsearchIndexNameSanitizer,
+ NullNameError,
+ )
+
+ try:
+ self._table_name = ElasticsearchIndexNameSanitizer(
+ value).sanitize(replacement_text="_")
+ except NullNameError:
+ self._table_name = None
+
def __init__(self):
super(ElasticsearchWriter, self).__init__() | Add a property override to sanitize index name when a value setting | thombashi_pytablewriter | train | py |
b7662a9224637b92a83797533f4cbc5bc308c6ae | diff --git a/src/main/java/water/api/Upload.java b/src/main/java/water/api/Upload.java
index <HASH>..<HASH> 100644
--- a/src/main/java/water/api/Upload.java
+++ b/src/main/java/water/api/Upload.java
@@ -10,7 +10,7 @@ public class Upload extends HTMLOnlyRequest {
+ "<script type='text/javascript' src='jquery.fileupload/js/jquery.fileupload.js'></script>"
+ "<script type='text/javascript' src='jquery.fileupload/js/main.js'></script>"
+ "<div class='container' style='margin: 0px auto'>"
- + "<h3>Request Upload ( <a href='Upload.help'>help</a> )</h3>"
+ + "<h3>Request Upload<a href='Upload.help'><i class='icon-question-sign'></i></a></h3>"
+ "<p>Please specify the file to be uploaded.</p>"
+ "<form id='Fileupload'>"
+ " <span class='btn but-success fileinput-button'>" | Minor UI fix in upload page. | h2oai_h2o-2 | train | java |
85c27e558904d2b0dd23158107618e90ad9a388d | diff --git a/lib/coaster/core_ext/standard_error.rb b/lib/coaster/core_ext/standard_error.rb
index <HASH>..<HASH> 100644
--- a/lib/coaster/core_ext/standard_error.rb
+++ b/lib/coaster/core_ext/standard_error.rb
@@ -10,6 +10,7 @@ class StandardError
def status
999999 # Unknown
end
+ alias_method :code, :status
def http_status
500
@@ -86,7 +87,7 @@ class StandardError
end
def code
- attributes[:code] || http_status
+ attributes[:code] || status
end
# description is user friendly messages, do not use error's message
diff --git a/lib/coaster/version.rb b/lib/coaster/version.rb
index <HASH>..<HASH> 100644
--- a/lib/coaster/version.rb
+++ b/lib/coaster/version.rb
@@ -1,3 +1,3 @@
module Coaster
- VERSION = '0.1.6'
+ VERSION = '0.1.7'
end | add alias method code to status | frograms_coaster | train | rb,rb |
981ee384065698e73e2d75c6ec9cc760aa4deeba | diff --git a/frontend/dockerfile/dockerfile2llb/convert.go b/frontend/dockerfile/dockerfile2llb/convert.go
index <HASH>..<HASH> 100644
--- a/frontend/dockerfile/dockerfile2llb/convert.go
+++ b/frontend/dockerfile/dockerfile2llb/convert.go
@@ -172,10 +172,6 @@ func Dockerfile2LLB(ctx context.Context, dt []byte, opt ConvertOpt) (*llb.State,
}
}
- if len(allDispatchStates.states) == 1 {
- allDispatchStates.states[0].stageName = ""
- }
-
var target *dispatchState
if opt.Target == "" {
target = allDispatchStates.lastTarget()
@@ -211,6 +207,10 @@ func Dockerfile2LLB(ctx context.Context, dt []byte, opt ConvertOpt) (*llb.State,
return nil, nil, fmt.Errorf("circular dependency detected on stage: %s", state.stageName)
}
+ if len(allDispatchStates.states) == 1 {
+ allDispatchStates.states[0].stageName = ""
+ }
+
eg, ctx := errgroup.WithContext(ctx)
for i, d := range allDispatchStates.states {
reachable := isReachable(target, d) | [convert] move 'stageName = ""' in covert after checking for circular dependency
To have stageName in error output in case one stage depends on itself | moby_buildkit | train | go |
cfe369553a75397edaa5f762090d3bb84eef4566 | diff --git a/flex/http.py b/flex/http.py
index <HASH>..<HASH> 100644
--- a/flex/http.py
+++ b/flex/http.py
@@ -229,7 +229,7 @@ class Response(URLMixin):
def data(self):
if self.content is EMPTY:
return self.content
- elif self.content_type == 'application/json':
+ elif self.content_type.startswith('application/json'):
if isinstance(self.content, six.binary_type):
return json.loads(six.text_type(self.content, encoding='utf-8'))
else: | Support for application/json with encoding for the response | pipermerriam_flex | train | py |
b6e5183e0770cd60d70c50a680baf47b5914f237 | diff --git a/spec/converter/metadata_spec.rb b/spec/converter/metadata_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/converter/metadata_spec.rb
+++ b/spec/converter/metadata_spec.rb
@@ -24,4 +24,14 @@ version "1.0.0"
EOH
end # /context with a license header
end # /describe #generate
+
+ describe '#write' do
+ let(:output) { double('output') } # sentinel
+ before { allow(described_class).to receive(:generate).and_return(output) }
+
+ it 'should write out metadata' do
+ expect(IO).to receive(:write).with('/test/metadata.rb', output)
+ described_class.write(nil, '/test')
+ end
+ end # /describe #write
end | Spec for Metadata#write. | poise_halite | train | rb |
19c0b2b4e8981c43204d6336b7ef41db973fddb9 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@ install_requires = [
setup(
name='Flask-Table',
packages=['flask_table'],
- version='0.2.4',
+ version='0.2.5',
author='Andrew Plummer',
author_email='plummer574@gmail.com',
url='https://github.com/plumdog/flask_table', | Bump to version <I> | plumdog_flask_table | train | py |
038a2261eb89509e9cf6c9ceffcc166e96710e72 | diff --git a/ontquery/plugins/services/scigraph.py b/ontquery/plugins/services/scigraph.py
index <HASH>..<HASH> 100644
--- a/ontquery/plugins/services/scigraph.py
+++ b/ontquery/plugins/services/scigraph.py
@@ -14,7 +14,7 @@ except ModuleNotFoundError:
class SciGraphRemote(OntService): # incomplete and not configureable yet
cache = True
- verbose = True
+ verbose = False
known_inverses = ('', ''),
def __init__(self, apiEndpoint=None, OntId=oq.OntId): # apiEndpoint=None -> default from pyontutils.devconfig
try: | scigraph remote not verbose by default | tgbugs_ontquery | train | py |
c5549fd99bf6d63bd1fdfccf2f32db0c13dad6e9 | diff --git a/lib/stevenson.rb b/lib/stevenson.rb
index <HASH>..<HASH> 100755
--- a/lib/stevenson.rb
+++ b/lib/stevenson.rb
@@ -7,6 +7,9 @@ require 'thor'
module Stevenson
autoload :Input, 'stevenson/input'
+ def self.inputs
+ @inputs ||= {}
+ end
class Application < Thor
desc 'stevenson new PROJECT_NAME', 'generates a Jekyll at PROJECT_NAME'
diff --git a/lib/stevenson/input.rb b/lib/stevenson/input.rb
index <HASH>..<HASH> 100644
--- a/lib/stevenson/input.rb
+++ b/lib/stevenson/input.rb
@@ -5,5 +5,27 @@ module Stevenson
autoload :Select, 'stevenson/input/select'
autoload :Text, 'stevenson/input/text'
autoload :Url, 'stevenson/input/url'
+
+ module Base
+
+ def self.included(input)
+ input.extend ClassMethods
+
+ Stevenson.inputs[input.input_name] = input
+ end
+
+ module ClassMethods
+ def input_name
+ name.gsub(/^.*::/, '').downcase.to_sym
+ end
+ end
+ end
+
+ def input_for(options, default_value)
+ input_klass = Stevenson.inputs[options['type']]
+ raise Configurator::InvalidYAMLException.new "Type \'#{options['type']}\' is not a valid input type." unless input_klass
+
+ input_klass.new(options, default_value)
+ end
end
end | Create Input::Base class
This commit creates an Input::Base class for extracting shared logic.
It also registers the inputs so that they may be fetched and created
easier. | RootsRated_stevenson | train | rb,rb |
d125657c45214e8d220fb39c59f789309b5dcdfc | diff --git a/test/extended/cli/mustgather.go b/test/extended/cli/mustgather.go
index <HASH>..<HASH> 100644
--- a/test/extended/cli/mustgather.go
+++ b/test/extended/cli/mustgather.go
@@ -204,6 +204,8 @@ var _ = g.Describe("[sig-cli] oc adm must-gather", func() {
fileName := filepath.Base(path)
if (strings.Contains(fileName, "-termination-") && strings.HasSuffix(fileName, ".log.gz")) ||
strings.HasSuffix(fileName, "termination.log.gz") ||
+ (strings.Contains(fileName, "-startup-") && strings.HasSuffix(fileName, ".log.gz")) ||
+ strings.HasSuffix(fileName, "startup.log.gz") ||
fileName == ".lock" ||
fileName == "lock.log" {
// these are expected, but have unstructured log format | must-gather: Ignore startup logs in kube-apiserver audit logs | openshift_origin | train | go |
381c16c833627668a7f8ef3b7e1a33f38ddc7bc8 | diff --git a/lumen-test/bootstrap/app.php b/lumen-test/bootstrap/app.php
index <HASH>..<HASH> 100644
--- a/lumen-test/bootstrap/app.php
+++ b/lumen-test/bootstrap/app.php
@@ -2,7 +2,7 @@
require_once __DIR__.'/../vendor/autoload.php';
-Dotenv::load(__DIR__.'/../');
+// Dotenv::load(__DIR__.'/../');
/*
|-------------------------------------------------------------------------- | no env file for the lumen-test | webNeat_lumen-generators | train | php |
170e8ae610a25811841dc0584e759966fd58dbe0 | diff --git a/oembed/providers.py b/oembed/providers.py
index <HASH>..<HASH> 100644
--- a/oembed/providers.py
+++ b/oembed/providers.py
@@ -529,7 +529,7 @@ class DjangoProvider(BaseProvider):
# resize image if we have a photo, otherwise use the given maximums
if self.resource_type == 'photo' and self.get_image(obj):
self.resize_photo(obj, mapping, maxwidth, maxheight)
- elif self.resource_type in ('html', 'rich', 'photo'):
+ elif self.resource_type in ('video', 'rich', 'photo'):
width, height = size_to_nearest(
maxwidth,
maxheight, | Fixing a reference to an invalid resource type | worldcompany_djangoembed | train | py |
cc64ec9d96dccbe777df2215ee7472942547701c | diff --git a/tests/test_apps/nptxn-perf-benchmark/client/np/NPBenchmark.java b/tests/test_apps/nptxn-perf-benchmark/client/np/NPBenchmark.java
index <HASH>..<HASH> 100644
--- a/tests/test_apps/nptxn-perf-benchmark/client/np/NPBenchmark.java
+++ b/tests/test_apps/nptxn-perf-benchmark/client/np/NPBenchmark.java
@@ -393,9 +393,9 @@ class NPBenchmark {
config.duration,
totalInvoc,
thruput,
- avgLatcy,
- k95pLatcy,
k99pLatcy,
+ k95pLatcy,
+ avgLatcy,
internalLatcy,
0.0,
0.0, | NP txn benchmark: replaced the <I>% latency column with avg latency (#<I>)
Currently there are 4 columns in the output result used for jenkins display: the duration / total invoc, <I>% and <I>% latency. Replaced the <I>% latency column with avg latency, which is more useful. | VoltDB_voltdb | train | java |
28a800c3d1001c3291aeac320fbf9c6b7d961b89 | diff --git a/src/sap.ui.core/src/sap/ui/thirdparty/mobiscroll/js/mobiscroll-scroller.js b/src/sap.ui.core/src/sap/ui/thirdparty/mobiscroll/js/mobiscroll-scroller.js
index <HASH>..<HASH> 100644
--- a/src/sap.ui.core/src/sap/ui/thirdparty/mobiscroll/js/mobiscroll-scroller.js
+++ b/src/sap.ui.core/src/sap/ui/thirdparty/mobiscroll/js/mobiscroll-scroller.js
@@ -174,9 +174,9 @@
onKeyDown = function (e) {
if (e.which == 38 && !e.altKey) {
- step(e, $(this), plus); // up
+ step(e, $(this), minus); // up
} else if (e.which == 40 && !e.altKey) {
- step(e, $(this), minus); // down
+ step(e, $(this), plus); // down
} else if (e.which == 33) {
step(e, $(this), pageUp); // page up
} else if (e.which == 34) { | [FIX] sap.m.DateTimeInput: Keyboard handling fix for arrow up/down.
- When up key is pressed select the value which is above the
current value.
- When down key is pressed select the value which is below the
current value.
Fixes <URL> | SAP_openui5 | train | js |
875a2783911368e036eff52da8c7e15ffaebbc36 | diff --git a/js/cw/clock.js b/js/cw/clock.js
index <HASH>..<HASH> 100644
--- a/js/cw/clock.js
+++ b/js/cw/clock.js
@@ -696,6 +696,7 @@ cw.clock.JumpDetectingClock = function(jumpDetector) {
* [2]th item is the expected next firing time.
*
* @type {!Object.<string, !Array.<(boolean|number)>>}
+ * // TODO: types for tuples
* @private
*/
this.timeouts_ = {};
diff --git a/js/cw/env.js b/js/cw/env.js
index <HASH>..<HASH> 100644
--- a/js/cw/env.js
+++ b/js/cw/env.js
@@ -230,6 +230,7 @@ cw.env.compressPluginSignature_ = function(psig) {
*
* @return {!Array.<(!Array|!Object.<string, number>|string)>} A three-item array:
* [a "copy" of navigator.plugins, a description map, the signature string].
+ * // TODO: types for tuples
*
* TODO: improve above type signature after Closure Compiler supports
* tuple annotations. | Mark two places with 'TODO: types for tuples' to make them easy to find when Closure Compiler starts supporting ES4 tuple type annotations | ludiosarchive_Coreweb | train | js,js |
1e8e04dad31ee3648288a8a2b1d05873ce781661 | diff --git a/src/server/worker/master.go b/src/server/worker/master.go
index <HASH>..<HASH> 100644
--- a/src/server/worker/master.go
+++ b/src/server/worker/master.go
@@ -770,7 +770,13 @@ func (a *APIServer) waitJob(pachClient *client.APIClient, jobInfo *pps.JobInfo,
return err
}
if a.pipelineInfo.S3Out {
- err = pachClient.FinishCommit(oc.Repo.Name, oc.ID)
+ _, err = pachClient.PfsAPIClient.FinishCommit(
+ pachClient.Ctx(),
+ &pfs.FinishCommitRequest{
+ Commit: oc,
+ Datums: datums,
+ },
+ )
} else {
// Finish the job's output commit
_, err = pachClient.PfsAPIClient.FinishCommit(ctx, &pfs.FinishCommitRequest{ | worker/master.go put datums in output commitinfo | pachyderm_pachyderm | train | go |
29c80027bd7f9b887ff6cdec34ef322ab200d9b9 | diff --git a/trainerdex/client.py b/trainerdex/client.py
index <HASH>..<HASH> 100644
--- a/trainerdex/client.py
+++ b/trainerdex/client.py
@@ -123,14 +123,13 @@ class Client:
r.raise_for_status()
return Trainer(r.json())
- def create_update(self, trainer, xp):
+ def create_update(self, trainer, xp, time_updated=maya.now(), **kwargs):
"""Add a Update object to the database"""
url = api_url+'update/'
- payload = {
- 'trainer': int(trainer),
- 'xp': int(xp),
- 'datetime': maya.now().iso8601()
- }
+
+ payload = {'trainer': int(trainer),'xp': int(xp),'datetime': time_updated.iso8601()}
+ if kwargs:
+ payload.update(kwargs)
r = requests.post(url, data=json.dumps(payload), headers=self.headers)
print(request_status(r)) | Creating an update now takes kwargs | TrainerDex_TrainerDex.py | train | py |
d7691bdf462569fae0afe9e9c9089dc8caa37eab | diff --git a/spec/tangle_directed_acyclic_partial_order_spec.rb b/spec/tangle_directed_acyclic_partial_order_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/tangle_directed_acyclic_partial_order_spec.rb
+++ b/spec/tangle_directed_acyclic_partial_order_spec.rb
@@ -11,6 +11,8 @@ RSpec.describe PartialOrder do
@order_a = PartialOrder.new(@dag, 'a')
@order_b = PartialOrder.new(@dag, 'b')
@order_c = PartialOrder.new(@dag, 'c')
+ @other_dag = Tangle::DAG[%w[d]]
+ @order_d = PartialOrder.new(@other_dag, 'd')
end
it 'partially orders vertices' do
@@ -22,4 +24,8 @@ RSpec.describe PartialOrder do
expect(@order_a <= @order_c).to be false
expect(@order_c <= @order_a).to be false
end
+
+ it 'fails to order vertices in different graphs' do
+ expect { @order_c <= @order_d }.to raise_error Tangle::GraphError
+ end
end | Add spec for failure case in PartialOrder | notCalle_ruby-tangle | train | rb |
1589e6bef5a93e288266e7557a1037da823d12b3 | diff --git a/hca/util/__init__.py b/hca/util/__init__.py
index <HASH>..<HASH> 100755
--- a/hca/util/__init__.py
+++ b/hca/util/__init__.py
@@ -234,7 +234,7 @@ class _PaginatingClientMethodFactory(_ClientMethodFactory):
for file in page.json()['bundle']['files']:
yield file
else:
- for collection in page.json().get('collections'):
+ for collection in page.json().get('collections', []):
yield collection
def paginate(self, **kwargs): | Fix get collection iteration bug. (#<I>) | HumanCellAtlas_dcp-cli | train | py |
fe470e74d0f736574101633da58df6f5f7ddfc0c | diff --git a/spec/watirspec/browser_spec.rb b/spec/watirspec/browser_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/watirspec/browser_spec.rb
+++ b/spec/watirspec/browser_spec.rb
@@ -10,8 +10,9 @@ describe "Browser" do
end
it "returns false after IE#close" do
- browser.close
- browser.should_not exist
+ b = WatirSpec.new_browser
+ b.close
+ b.should_not exist
end
end | Don't call #close on the global browser instance. | watir_watir | train | rb |
9496689b35cf2dda105c23bcff47a389365ab633 | diff --git a/desktop/api/src/main/java/org/datacleaner/windows/ErrorDialog.java b/desktop/api/src/main/java/org/datacleaner/windows/ErrorDialog.java
index <HASH>..<HASH> 100644
--- a/desktop/api/src/main/java/org/datacleaner/windows/ErrorDialog.java
+++ b/desktop/api/src/main/java/org/datacleaner/windows/ErrorDialog.java
@@ -78,7 +78,14 @@ public class ErrorDialog extends AbstractDialog {
@Override
protected JComponent getDialogContent() {
- final JXEditorPane detailedMessagePane = new JXEditorPane("text/html", _detailedMessage);
+ final String detailedMessage;
+ if (_detailedMessage.contains("<br>") || _detailedMessage.contains("<br/>")) {
+ detailedMessage = _detailedMessage;
+ } else {
+ detailedMessage = _detailedMessage.replace("\n", "<br/>");
+ }
+
+ final JXEditorPane detailedMessagePane = new JXEditorPane("text/html", detailedMessage);
detailedMessagePane.setEditable(false);
detailedMessagePane.setOpaque(false);
detailedMessagePane.addHyperlinkListener(new HyperlinkListener() { | Allow non-html contents of ErrorDialog to be enriched with line-breaks. | datacleaner_DataCleaner | train | java |
594533e25bdd7b92a68ba2025df6d488fbc95731 | diff --git a/lib/adhearsion/initializer.rb b/lib/adhearsion/initializer.rb
index <HASH>..<HASH> 100644
--- a/lib/adhearsion/initializer.rb
+++ b/lib/adhearsion/initializer.rb
@@ -179,7 +179,7 @@ module Adhearsion
end
def launch_console
- Thread.new do
+ Adhearsion::Process.important_threads << Thread.new do
begin
puts "Starting console"
Adhearsion::Console.run | [FEATURE] Make the console an important thread | adhearsion_adhearsion | train | rb |
dd34c588c90ce06a80174207dac752c395113a8b | diff --git a/baron/dumper.py b/baron/dumper.py
index <HASH>..<HASH> 100644
--- a/baron/dumper.py
+++ b/baron/dumper.py
@@ -31,6 +31,20 @@ def endl(node):
yield node["indent"]
+@node()
+def ternary_operator(node):
+ yield dump_node(node["first"])
+ yield dump_node_list(node["first_formatting"])
+ yield "if"
+ yield dump_node_list(node["second_formatting"])
+ yield dump_node(node["value"])
+ yield dump_node_list(node["third_formatting"])
+ yield "else"
+ yield dump_node_list(node["forth_formatting"])
+ yield dump_node(node["second"])
+ d(node)
+
+
@node("int")
@node("name")
@node("space")
diff --git a/baron/test_dumper.py b/baron/test_dumper.py
index <HASH>..<HASH> 100644
--- a/baron/test_dumper.py
+++ b/baron/test_dumper.py
@@ -203,3 +203,6 @@ def test_dict_one():
def test_dict_more():
check_dumps("{ a : b ,\n123 : 'pouet' }")
+
+def test_ternary_operator():
+ check_dumps("a if b else c") | [enh] dumps ternary operator | PyCQA_baron | train | py,py |
6363d518806056c3c92cf41f0abee63e662062fe | diff --git a/packages/colony-js-client/src/ColonyClient/index.js b/packages/colony-js-client/src/ColonyClient/index.js
index <HASH>..<HASH> 100644
--- a/packages/colony-js-client/src/ColonyClient/index.js
+++ b/packages/colony-js-client/src/ColonyClient/index.js
@@ -1146,6 +1146,7 @@ export default class ColonyClient extends ContractClient {
]);
this.addEvent('TaskRoleUserSet', [
['taskId', 'number'],
+ // $FlowFixMe
['role', 'role'],
['user', 'tokenAddress'], // XXX because 0x0 is valid
]); | Add flow fix to allow for type `role` | JoinColony_colonyJS | train | js |
781be1213d619cd9c3f23045ec7e1b994a939979 | diff --git a/lib/flex/template/common.rb b/lib/flex/template/common.rb
index <HASH>..<HASH> 100644
--- a/lib/flex/template/common.rb
+++ b/lib/flex/template/common.rb
@@ -7,7 +7,7 @@ module Flex
def setup(host_flex, name=nil, *vars)
@host_flex = host_flex
@name = name
- @source_vars = Vars.new(*vars) if self.class == Flex::Template
+ @source_vars = Vars.new(*vars) if is_a?(Flex::Template)
self
end | fix for source vars of Template subclasses | elastics_elastics | train | rb |
6c66d0fffdd169b9b97a107f217e4a37fffba312 | diff --git a/molgenis-omx-biobankconnect/src/main/java/org/molgenis/omx/biobankconnect/ontology/repository/OntologyTermIndexRepository.java b/molgenis-omx-biobankconnect/src/main/java/org/molgenis/omx/biobankconnect/ontology/repository/OntologyTermIndexRepository.java
index <HASH>..<HASH> 100644
--- a/molgenis-omx-biobankconnect/src/main/java/org/molgenis/omx/biobankconnect/ontology/repository/OntologyTermIndexRepository.java
+++ b/molgenis-omx-biobankconnect/src/main/java/org/molgenis/omx/biobankconnect/ontology/repository/OntologyTermIndexRepository.java
@@ -118,10 +118,7 @@ public class OntologyTermIndexRepository extends AbstractOntologyRepository impl
entity.set(ONTOLOGY_TERM_DEFINITION, classContainer.getClassDefinition());
entity.set(ONTOLOGY_TERM_IRI, cls.getIRI().toString());
entity.set(ENTITY_TYPE, TYPE_ONTOLOGYTERM);
- entity.set(
- SYNONYMS,
- classContainer.getClassLabel().replaceAll(ILLEGAL_CHARACTERS_PATTERN,
- ILLEGAL_CHARACTERS_REPLACEMENT));
+ entity.set(SYNONYMS, classContainer.getClassLabel());
entity.set(ALTERNATIVE_DEFINITION, classContainer.getAssociatedClasses());
if (classContainer.getAllDatabaseIds() != null) | do not replace the characters in synonym of the ontology | molgenis_molgenis | train | java |
26ff083cb5c36857dc8d741cd69054c29d580878 | diff --git a/src/widgets/zoomable/zoomable.js b/src/widgets/zoomable/zoomable.js
index <HASH>..<HASH> 100644
--- a/src/widgets/zoomable/zoomable.js
+++ b/src/widgets/zoomable/zoomable.js
@@ -389,6 +389,7 @@
if ( this.options.original.substitute ) {
this.$zoomable.attr ( 'src', this.options.original.src );
+ this.$zoomable.attr ( 'srcset', this.options.original.src );
} | Zoomable: added support for `srcset` | svelto_svelto | train | js |
6ae45e42033f688d8de1edda002d167de27b9da2 | diff --git a/lib/swarm.js b/lib/swarm.js
index <HASH>..<HASH> 100644
--- a/lib/swarm.js
+++ b/lib/swarm.js
@@ -75,8 +75,10 @@ Swarm.prototype.isMember = function(peripheral) {
var manufacturer = peripheral.advertisement.manufacturerData;
if (this.targets.length === 0) {
// handle "any" case
- var localNameMatch = localName && localName.indexOf('RS_') === 0;
- var manufacturerMatch = manufacturer && manufacturer.toString('hex') === '4300cf1900090100';
+ var localNameMatch = localName
+ && (localName.indexOf('RS_') === 0 || localName.indexOf('Mars_') === 0 || localName.indexOf('Travis_') === 0 || localName.indexOf('Maclan_')=== 0);
+ var manufacturerMatch = manufacturer
+ && (['4300cf1900090100', '4300cf1909090100', '4300cf1907090100'].indexOf(manufacturer) >= 0);
// Is true for EITHER an "RS_" name OR manufacturer code.
return localNameMatch || manufacturerMatch; | copied the fixes for drone.js to swarm.js | voodootikigod_node-rolling-spider | train | js |
d892d1b7ead2f8fd605967cc95b9648620dac2a2 | diff --git a/lib/schema.js b/lib/schema.js
index <HASH>..<HASH> 100644
--- a/lib/schema.js
+++ b/lib/schema.js
@@ -617,8 +617,7 @@ var RootSchema = Object.create({
db.get(sql, v, function(error) {
if(error) {
- winston.error(sql + " : " + v.join(','));
- winston.error(error);
+ winston.error(error, { sql: sql + " : " + v.join(',')});
}
});
}; | winston error within on statement + sql attribute | arlac77_sorm | train | js |
45afd98bb3dcfaff9a27cf6df10b73b01dd4bbcb | diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -9,7 +9,7 @@ const assert = require('assert').strict;
const Vinyl = require('vinyl');
describe('gulp-unassert', () => {
- ['es2018', 'es2019'].forEach((name) => {
+ for (const name of ['es2018', 'es2019']) {
it(name + ' syntax', (done) => {
const stream = unassert();
const srcStream = new Vinyl({
@@ -40,7 +40,7 @@ describe('gulp-unassert', () => {
stream.write(srcStream);
stream.end();
});
- });
+ }
it('should produce expected file via buffer', (done) => {
const stream = unassert(); | refactor: prefer for-of | unassert-js_gulp-unassert | train | js |
5c38f9da11be26e2f6e70ae787c9dbca5e78bf97 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ from setuptools import setup
setup(
name = 'pyopening_hours',
- version = '0.1',
+ version = '0.1.1',
description = 'Python module providing access to the opening_hours.js library which is written in JavaScript.',
author = 'Robin `ypid` Schneider',
author_email = 'ypid23@aol.de', | Released <I> to test pip install. | opening-hours_pyopening_hours | train | py |
99823c83ee61f40d550e7f6db4beb89eff9d10bc | diff --git a/lib/instana/version.rb b/lib/instana/version.rb
index <HASH>..<HASH> 100644
--- a/lib/instana/version.rb
+++ b/lib/instana/version.rb
@@ -1,4 +1,4 @@
module Instana
- VERSION = "1.7.15"
+ VERSION = "1.8.0"
VERSION_FULL = "instana-#{VERSION}"
end | Bump gem version to <I> | instana_ruby-sensor | train | rb |
04436b4895a03a2134bcad3ab12e951d7cd929da | diff --git a/src/apm-base.js b/src/apm-base.js
index <HASH>..<HASH> 100644
--- a/src/apm-base.js
+++ b/src/apm-base.js
@@ -55,11 +55,17 @@ class ApmBase {
config (config) {
this.configService.setConfig(config)
}
+
// Should call this method before 'load' event on window is fired
setInitialPageLoadName (name) {
var transactionService = this.serviceFactory.getService('TransactionService')
transactionService.initialPageLoadName = name
}
+
+ captureError (error) {
+ var errorLogging = this.serviceFactory.getService('ErrorLogging')
+ return errorLogging.logError(error)
+ }
}
// function inBrowser () {
diff --git a/test/specs/apm-base.spec.js b/test/specs/apm-base.spec.js
index <HASH>..<HASH> 100644
--- a/test/specs/apm-base.spec.js
+++ b/test/specs/apm-base.spec.js
@@ -12,11 +12,10 @@ describe('ApmBase', function () {
return Promise.resolve()
}
}
- var errorLogging = apmBase.serviceFactory.getService('ErrorLogging')
try {
throw new Error('ApmBase test error')
} catch(error) {
- var promise = errorLogging.logErrorEvent({error: error})
+ var promise = apmBase.captureError(error)
promise.then(function () {
done()
}) | feat: add captureError to ApmBase | elastic_apm-agent-rum-js | train | js,js |
709f0641cb2d5561c9fc6a3ee1efabd0d4970352 | diff --git a/src/main/java/com/marklogic/client/impl/JerseyServices.java b/src/main/java/com/marklogic/client/impl/JerseyServices.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/marklogic/client/impl/JerseyServices.java
+++ b/src/main/java/com/marklogic/client/impl/JerseyServices.java
@@ -5613,13 +5613,6 @@ public class JerseyServices implements RESTServices {
params.add("default-rulesets", qdef.getIncludeDefaultRulesets() ? "include" : "exclude");
}
- // TODO: remove next six lines once the server supports application/xml and application/json (Bug 34421)
- HandleImplementation baseHandle = HandleAccessor.checkHandle(output, "graphs/sparql");
- if ( baseHandle.getFormat() == Format.JSON ) {
- baseHandle.setMimetype("application/sparql-results+json");
- } else if ( baseHandle.getFormat() == Format.XML ) {
- baseHandle.setMimetype("application/sparql-results+xml");
- }
return postResource(reqlog, "/graphs/sparql", transaction, params, input, output);
} | now that bug <I> is fixed, remove defaults for mimetype for XML & JSON handles | marklogic_java-client-api | train | java |
03571fc16a084cd2966ecaad4f5dcb13f279be02 | diff --git a/lib/reform/form.rb b/lib/reform/form.rb
index <HASH>..<HASH> 100644
--- a/lib/reform/form.rb
+++ b/lib/reform/form.rb
@@ -27,7 +27,7 @@ module Reform
# DISCUSS: we should never hit @mapper here (which writes to the models) when a block is passed.
return yield self, to_nested_hash if block_given?
- mapper.save(self)
+ @mapper.new(model).from_hash(to_hash) # DISCUSS: move to Composition?
end
private
diff --git a/test/reform_test.rb b/test/reform_test.rb
index <HASH>..<HASH> 100644
--- a/test/reform_test.rb
+++ b/test/reform_test.rb
@@ -182,6 +182,21 @@ class ReformTest < MiniTest::Spec
})
end
end
+
+ describe "#save" do
+ let (:comp) { SongAndArtist.new(:artist => OpenStruct.new, :song => OpenStruct.new) }
+ let (:form) { SongForm.new(SongAndArtistMap, comp) }
+
+
+
+ it "pushes data to models" do
+ form.validate("name" => "Diesel Boy")
+ form.save
+
+ comp.artist.name.must_equal "Diesel Boy"
+ comp.song.title.must_equal nil
+ end
+ end
end
# TODO: test errors | make Form#save without block work. | trailblazer_reform | train | rb,rb |
9982d6c0db791167b211c271cad72576c2b55566 | diff --git a/lib/bumbleworks/process_definition.rb b/lib/bumbleworks/process_definition.rb
index <HASH>..<HASH> 100644
--- a/lib/bumbleworks/process_definition.rb
+++ b/lib/bumbleworks/process_definition.rb
@@ -2,12 +2,17 @@ module Bumbleworks
class DefinitionNotFound < StandardError; end
class DefinitionFileNotFound < StandardError; end
class DefinitionInvalid < StandardError; end
+ class DefinitionDuplicate < StandardError; end
class ProcessDefinition
attr_accessor :definition
class << self
def define(name, *args, &block)
+ if Bumbleworks.engine.variables[name]
+ raise DefinitionDuplicate, "the process '#{name}' has already been defined"
+ end
+
args.unshift({:name => name})
pdef = Ruote.define *args, &block
Bumbleworks.engine.variables[name] = pdef
diff --git a/spec/lib/process_definition_spec.rb b/spec/lib/process_definition_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/process_definition_spec.rb
+++ b/spec/lib/process_definition_spec.rb
@@ -34,5 +34,15 @@ describe Bumbleworks::ProcessDefinition do
[["nike", {"ok"=>nil}, []],
["adidas", {"nice"=>nil}, []]]]
end
+
+ it 'should raise an error when duplicate process names are detected' do
+ described_class.define('foot-traffic') do
+ end
+
+ expect do
+ described_class.define('foot-traffic') do
+ end
+ end.to raise_error
+ end
end
end | Raise an error when a duplicate process definition name is detected. | bumbleworks_bumbleworks | train | rb,rb |
b75a53eb0003fdf558d7ee239862b7e407fd9d6b | diff --git a/test/babelish/commands/test_command_strings2csv.rb b/test/babelish/commands/test_command_strings2csv.rb
index <HASH>..<HASH> 100644
--- a/test/babelish/commands/test_command_strings2csv.rb
+++ b/test/babelish/commands/test_command_strings2csv.rb
@@ -92,4 +92,20 @@ class TestStrings2CSVCommand < Test::Unit::TestCase
end
+
+ def test_strings2csv_with_comments_outputs_right_headers
+ expected_content = <<-EOF
+Variables,test/data/test_comments.strings,Comments
+MY_CONSTANT,This 'is' ok,this is a comment
+ EOF
+
+ options = {:filenames => ["test/data/test_comments.strings"]}
+ Commandline.new([], options).strings2csv
+
+ csv_content = %x(cat translations.csv)
+
+ assert_equal expected_content, csv_content, "Content of generated file differs from expected one"
+ #clean up
+ system("rm -f translations.csv")
+ end
end | Add test on strings2base headers output for comments | netbe_Babelish | train | rb |
f708b808f2b7ae43d4da78dbc41712b610895283 | diff --git a/salt/utils/args.py b/salt/utils/args.py
index <HASH>..<HASH> 100644
--- a/salt/utils/args.py
+++ b/salt/utils/args.py
@@ -24,7 +24,8 @@ def condition_input(args, kwargs):
'''
ret = []
for arg in args:
- if isinstance(arg, six.integer_types):
+ if (six.PY3 and isinstance(arg, six.integer_types)) or \
+ (six.PY2 and isinstance(arg, long)):
ret.append(str(arg))
else:
ret.append(arg) | Make the check conditional to the python version | saltstack_salt | train | py |
69d02da52276b5b6cc441425db0a9d45692e7e45 | diff --git a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/TrackRunBox.java b/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/TrackRunBox.java
index <HASH>..<HASH> 100644
--- a/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/TrackRunBox.java
+++ b/isoparser/src/main/java/com/coremedia/iso/boxes/fragment/TrackRunBox.java
@@ -228,10 +228,9 @@ public class TrackRunBox extends AbstractFullBox {
entry.sampleFlags = new SampleFlags(content);
}
if ((getFlags() & 0x800) == 0x800) { //sampleCompositionTimeOffsetPresent
- if (getVersion() == 0) {
- entry.sampleCompositionTimeOffset = IsoTypeReader.readUInt32(content);
- } else {
- entry.sampleCompositionTimeOffset = content.getInt();
+ entry.sampleCompositionTimeOffset = content.getInt();
+ if (getVersion() == 0 && entry.sampleCompositionTimeOffset<0) {
+ throw new RuntimeException("trun boxes of version 0 cannot have negative cts");
}
}
entries.add(entry); | track run box with version 0 will also accept negative cts | sannies_mp4parser | train | java |
7729337cfb04328748f84e065f4e098437ad8d44 | diff --git a/lib/csvlint/validate.rb b/lib/csvlint/validate.rb
index <HASH>..<HASH> 100644
--- a/lib/csvlint/validate.rb
+++ b/lib/csvlint/validate.rb
@@ -200,10 +200,10 @@ module Csvlint
@link_headers = @headers["link"].split(",") rescue nil
@link_headers.each do |link_header|
match = LINK_HEADER_REGEXP.match(link_header)
- uri = match["uri"].gsub(/(^\<|\>$)/, "")
- rel = match["rel-relationship"].gsub(/(^\"|\"$)/, "")
+ uri = match["uri"].gsub(/(^\<|\>$)/, "") rescue nil
+ rel = match["rel-relationship"].gsub(/(^\"|\"$)/, "") rescue nil
param = match["param"]
- param_value = match["param-value"].gsub(/(^\"|\"$)/, "")
+ param_value = match["param-value"].gsub(/(^\"|\"$)/, "") rescue nil
if rel == "describedby" && param == "type" && ["application/csvm+json", "application/ld+json", "application/json"].include?(param_value)
begin
url = URI.join(@source_url, uri) | This got lost in the rebase | theodi_csvlint.rb | train | rb |
c366f2a0bd1b72c1777808993b330e34138fb938 | diff --git a/commands/SetupCommand/index.js b/commands/SetupCommand/index.js
index <HASH>..<HASH> 100644
--- a/commands/SetupCommand/index.js
+++ b/commands/SetupCommand/index.js
@@ -68,9 +68,7 @@ SetupCommand.prototype.setup = function setup(shortcut) {
this.checkArguments(arguments);
- if (shortcut === 'wifi') {
- return serial.configureWifi();
- }
+ this.forceWiFi = !!(shortcut === 'wifi');
console.log(chalk.bold.cyan(utilities.banner()));
console.log(arrow, "Setup is easy! Let's get started...");
@@ -362,7 +360,7 @@ SetupCommand.prototype.findDevice = function() {
self.newSpin('Getting device information...').start();
serial.supportsClaimCode(device).then(function (supported) {
- if (supported) {
+ if (supported && !self.forceWiFi) {
self.stopSpin();
console.log(
chalk.cyan('!'), | `particle setup wifi` now forces wifi setup, rather than simply doing the serial wifi setup. (Serial wifi setup is available still via `particle serial wifi`) | particle-iot_particle-cli | train | js |
64358a8b1afd80a28d1cce269b11b58804e2df98 | diff --git a/examples/hello-world/index.js b/examples/hello-world/index.js
index <HASH>..<HASH> 100644
--- a/examples/hello-world/index.js
+++ b/examples/hello-world/index.js
@@ -1,8 +1,6 @@
var Bitbundler = require("bit-bundler");
-var bitbundler = new Bitbundler();
-
-bitbundler.bundle({
+Bitbundler.bundle({
src: "src/main.js",
dest: "dest/out.js"
}); | trimmed up the hello world example to use the very minimum required to bundle something | MiguelCastillo_bit-bundler | train | js |
161fce6ccc101f600b7d2eb7a6c2ad7fbbb11a68 | diff --git a/runner.go b/runner.go
index <HASH>..<HASH> 100644
--- a/runner.go
+++ b/runner.go
@@ -975,6 +975,7 @@ func newWatcher(config *Config, clients *dep.ClientSet, once bool) (*watch.Watch
RetryFunc: func(current time.Duration) time.Duration {
return config.Retry
},
+ RenewVault: config.Vault.Renew,
})
if err != nil {
return nil, err | Pass the config to the watcher | hashicorp_consul-template | train | go |
b11afcf66d59f9152f8522370d2f504e953a54cd | diff --git a/mvc.go b/mvc.go
index <HASH>..<HASH> 100644
--- a/mvc.go
+++ b/mvc.go
@@ -313,8 +313,8 @@ func (c *Controller) Render(extraRenderArgs ...interface{}) Result {
template, err := templateLoader.Template(c.Name + "/" + viewName + ".html")
if err != nil {
// TODO: Instead of writing output directly, return an error Result
- if err, ok := err.(*Error); ok {
- c.Response.out.Write([]byte(err.Html()))
+ if prettyErr, ok := err.(*Error); ok {
+ c.Response.out.Write([]byte(prettyErr.Html()))
} else {
c.Response.out.Write([]byte(err.Error()))
} | Fix for showing non-pretty template errors. | revel_revel | train | go |
6df0a03129aa4ced034b217fcd0820692137b29a | diff --git a/src/main/java/net/openhft/chronicle/network/AlwaysStartOnPrimaryConnectionStrategy.java b/src/main/java/net/openhft/chronicle/network/AlwaysStartOnPrimaryConnectionStrategy.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/openhft/chronicle/network/AlwaysStartOnPrimaryConnectionStrategy.java
+++ b/src/main/java/net/openhft/chronicle/network/AlwaysStartOnPrimaryConnectionStrategy.java
@@ -94,7 +94,7 @@ public class AlwaysStartOnPrimaryConnectionStrategy extends SelfDescribingMarsha
continue;
}
- Jvm.warn().on(getClass(), "successfully connected to " + socketAddressSupplier);
+ Jvm.debug().on(getClass(), "successfully connected to " + socketAddressSupplier);
// success
return socketChannel; | Improved handling and checking of discarded resource, closes <URL> | OpenHFT_Chronicle-Network | train | java |
d40dc919d891938dbcd99a4f37702a041242af24 | diff --git a/test/unit/vagrant/plugin/v2/plugin_test.rb b/test/unit/vagrant/plugin/v2/plugin_test.rb
index <HASH>..<HASH> 100644
--- a/test/unit/vagrant/plugin/v2/plugin_test.rb
+++ b/test/unit/vagrant/plugin/v2/plugin_test.rb
@@ -1,10 +1,8 @@
require File.expand_path("../../../../base", __FILE__)
describe Vagrant::Plugin::V2::Plugin do
- after(:each) do
- # We want to make sure that the registered plugins remains empty
- # after each test.
- described_class.manager.reset!
+ before do
+ described_class.stub(manager: Vagrant::Plugin::V2::Manager.new)
end
it "should be able to set and get the name" do | core: plugin tests no longer obliterate manager | hashicorp_vagrant | train | rb |
efa9c276bf8cf9e01b3554fc0a6da6b0082965a1 | diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/Configuration.php
+++ b/DependencyInjection/Configuration.php
@@ -162,6 +162,21 @@ class Configuration implements ConfigurationInterface
->isRequired()
->info('Sets connection for manager.')
->end()
+ ->integerNode('bulk_size')
+ ->min(0)
+ ->defaultValue(100)
+ ->info(
+ 'Maximum documents size in the bulk container. ' .
+ 'When the limit is reached it will auto-commit.'
+ )
+ ->end()
+ ->enumNode('commit_mode')
+ ->values(['refresh', 'flush'])
+ ->defaultValue('refresh')
+ ->info(
+ 'The type of commit to the elasticsearch'
+ )
+ ->end()
->booleanNode('profiler')
->info('Enables elasticsearch profiler in the sf web profiler toolbar.')
->defaultFalse()
diff --git a/Service/ManagerFactory.php b/Service/ManagerFactory.php
index <HASH>..<HASH> 100644
--- a/Service/ManagerFactory.php
+++ b/Service/ManagerFactory.php
@@ -113,6 +113,9 @@ class ManagerFactory
$this->converter
);
+ $manager->setCommitMode($managerConfig['commit_mode']);
+ $manager->setBulkCommitSize($managerConfig['bulk_size']);
+
return $manager;
}
} | added bulk_size and commit_mode to the configuration | ongr-io_ElasticsearchBundle | train | php,php |
b824daa847a3edd7041b6ef1d2c0d0632505ab4a | diff --git a/.buildkite/nightly.py b/.buildkite/nightly.py
index <HASH>..<HASH> 100644
--- a/.buildkite/nightly.py
+++ b/.buildkite/nightly.py
@@ -33,6 +33,7 @@ if __name__ == "__main__":
# Create ~/.pypirc
'.buildkite/scripts/pypi.sh',
# Publish
+ 'export PYTHONDONTWRITEBYTECODE=1',
'python bin/publish.py publish --nightly --autoclean',
)
.build(), | [nightly] PYTHONDONTWRITEBYTECODE
Test Plan: push_n_pray
Reviewers: nate, max
Reviewed By: nate
Differential Revision: <URL> | dagster-io_dagster | train | py |
5294b1d3bf6250b37e6f7f1cbea3aae5f820ceff | diff --git a/files/index.php b/files/index.php
index <HASH>..<HASH> 100644
--- a/files/index.php
+++ b/files/index.php
@@ -755,7 +755,7 @@ function displaydir ($wdir) {
print_cell("right", $filedate, 'date');
if ($choose) {
- $edittext = "<b><a onMouseDown=\"return set_value('$selectfile')\" href=\"\">$strchoose</a></b> ";
+ $edittext = "<strong><a onclick=\"return set_value('$selectfile')\" href=\"#\">$strchoose</a></strong> ";
} else {
$edittext = '';
} | Merged bug <I> from stable | moodle_moodle | train | php |
a1048649e4ca368b7cb694d5d2ebe13a1bd441b4 | diff --git a/source/rafcon/gui/shortcut_manager.py b/source/rafcon/gui/shortcut_manager.py
index <HASH>..<HASH> 100644
--- a/source/rafcon/gui/shortcut_manager.py
+++ b/source/rafcon/gui/shortcut_manager.py
@@ -56,8 +56,8 @@ class ShortcutManager(object):
self.accel_group.connect(keyval, modifier_mask, Gtk.AccelFlags.VISIBLE, callback)
def __on_shortcut(self, action, accel_group, window, key_value, modifier_mask):
- res = self.trigger_action(action, key_value, modifier_mask,
- (self.main_window.get_pointer().x, self.main_window.get_pointer().y))
+ pointer = self.main_window.get_pointer()
+ res = self.trigger_action(action, key_value, modifier_mask, cursor_position=(pointer.x, pointer.y))
# If returning False, the shortcut is forwarded to GTK to be used for default actions (like copy and paste in
# a text field). If a controller wants to prevent this, it has to return True.
return res | Update source/rafcon/gui/shortcut_manager.py
style(shortcut_manager): increased code readability
separated to lines, to improve code readability. | DLR-RM_RAFCON | train | py |
f48d15bcac7ed379423a2dd9ef45885b9430401e | diff --git a/src/features/page.js b/src/features/page.js
index <HASH>..<HASH> 100644
--- a/src/features/page.js
+++ b/src/features/page.js
@@ -54,7 +54,7 @@ function getDataFromRouter (router, args) {
export default function page (...args) {
const value = args[0]
- if (value.constructor.name === 'VueRouter') {
+ if ('currentRoute' in value) {
ga('send', 'pageview', getDataFromRouter(value, args))
return
} | fix(page): VueRouter constructor name changes if uglyfied
the constructor name could change if functions name are mangled during minification
to avoid this, we simply check if the value has a currentRoute property
so that we know that we are talking about a VueRouter instance
close #<I> | MatteoGabriele_vue-analytics | train | js |
fbb695ad71717750f7701b495995f3090cbc88a9 | diff --git a/src/core-export.js b/src/core-export.js
index <HASH>..<HASH> 100644
--- a/src/core-export.js
+++ b/src/core-export.js
@@ -0,0 +1,14 @@
+;(function($$){
+
+ $$.fn.core({
+
+ png: function(){
+ var cy = this;
+ var renderer = this._private.renderer;
+
+ return renderer.png();
+ }
+
+ });
+
+})( cytoscape );
\ No newline at end of file
diff --git a/src/extensions/cytoscape.renderer.canvas.js b/src/extensions/cytoscape.renderer.canvas.js
index <HASH>..<HASH> 100644
--- a/src/extensions/cytoscape.renderer.canvas.js
+++ b/src/extensions/cytoscape.renderer.canvas.js
@@ -95,6 +95,12 @@
this.redraw();
};
+ CanvasRenderer.prototype.png = function(){
+ var canvas = this.data.bufferCanvases[0];
+
+ return canvas.toDataURL("image/png");
+ };
+
// @O Initialization functions
{
CanvasRenderer.prototype.load = function() { | add png export of graph
re #<I> but needs docs | cytoscape_cytoscape.js | train | js,js |
ad4c7211ea13fb647eb13c1d6b33424eb047acb2 | diff --git a/Moss/Kernel/App.php b/Moss/Kernel/App.php
index <HASH>..<HASH> 100644
--- a/Moss/Kernel/App.php
+++ b/Moss/Kernel/App.php
@@ -174,7 +174,7 @@ class App implements AppInterface
*/
function __get($name)
{
- // TODO: Implement __get() method.
+ return $this->get($name);
} | added __get for backward compatibility | mossphp_moss-framework | train | php |
4d684978331e95d349272897e41eb757710bd5d3 | diff --git a/src/test/java/net/greghaines/jesque/json/TestCompositeDateFormat.java b/src/test/java/net/greghaines/jesque/json/TestCompositeDateFormat.java
index <HASH>..<HASH> 100644
--- a/src/test/java/net/greghaines/jesque/json/TestCompositeDateFormat.java
+++ b/src/test/java/net/greghaines/jesque/json/TestCompositeDateFormat.java
@@ -70,7 +70,9 @@ public class TestCompositeDateFormat {
}
private static void assertWithinASecond(final Date expected, final Date actual) {
- Assert.assertTrue(Math.abs(expected.getTime() - actual.getTime()) < 1000);
+ final double delta = expected.getTime() - actual.getTime();
+ Assert.assertTrue("expected=" + expected + " actual=" + actual + " delta=" + delta,
+ Math.abs(delta) < 1000);
}
private static void assertNotWithinASecond(final Date expected, final Date actual) { | Better test fail message for debugging why travis fails | gresrun_jesque | train | java |
746c25c7659e501b89c19c0f14c188982603e02f | diff --git a/hangups/user.py b/hangups/user.py
index <HASH>..<HASH> 100644
--- a/hangups/user.py
+++ b/hangups/user.py
@@ -77,7 +77,7 @@ class User(object):
self.full_name = user_.full_name
self.first_name = user_.first_name
self.name_type = user_.name_type
- logging.debug('Added {} name to User "{}": {}'.format(
+ logger.debug('Added {} name to User "{}": {}'.format(
self.name_type.name.lower(), self.full_name, self))
@staticmethod | Fix rogue use of the root logger | tdryer_hangups | train | py |
0a8be94279d1d749eb3d4b1e1471824438cc917a | diff --git a/ovp_users/serializers.py b/ovp_users/serializers.py
index <HASH>..<HASH> 100644
--- a/ovp_users/serializers.py
+++ b/ovp_users/serializers.py
@@ -34,7 +34,7 @@ class UserUpdateSerializer(UserCreateSerializer):
fields = ['name', 'phone', 'password', 'avatar']
extra_kwargs = {'password': {'write_only': True}}
-class UserSearchSerializer(serializers.ModelSerializer):
+class UserPublicRetrieveSerializer(serializers.ModelSerializer):
class Meta:
model = models.User
fields = ['name', 'avatar']
diff --git a/ovp_users/views.py b/ovp_users/views.py
index <HASH>..<HASH> 100644
--- a/ovp_users/views.py
+++ b/ovp_users/views.py
@@ -69,6 +69,6 @@ class UserResourceViewSet(mixins.CreateModelMixin, viewsets.GenericViewSet):
if self.action == 'current_user':
if request.method == "GET":
- return serializers.UserSearchSerializer
+ return serializers.UserPublicRetrieveSerializer
elif request.method in ["PUT", "PATCH"]:
return serializers.UserUpdateSerializer | Rename UserSearchSerializer to UserPublicRetrieveSerializer | OpenVolunteeringPlatform_django-ovp-users | train | py,py |
d9435ef8647171a89003410efe17bcc5a18bc41b | diff --git a/odl/discr/lp_discr.py b/odl/discr/lp_discr.py
index <HASH>..<HASH> 100644
--- a/odl/discr/lp_discr.py
+++ b/odl/discr/lp_discr.py
@@ -478,6 +478,7 @@ class DiscreteLpVector(DiscretizationVector):
"""Axis ordering for array flattening."""
return self.space.order
+ @property
def real(self):
"""Real part of this element."""
rspace = self.space.astype(self.space._real_dtype) | MAINT: add missing property to real | odlgroup_odl | train | py |
37af07eab459340b1dde85b14361b732db21cefc | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -36,7 +36,7 @@ setup(
'': ['*.po', '*.mo'],
},
install_requires=[
- 'django>=1.11.29,<3.0',
+ 'django>=1.11.29',
],
keywords='django choices models enum',
classifiers=[ | Remove Django<3 install_requires
Django <I> support was mentioned in <I>ad4c<I>bdd4cca3a6fde7d<I>cc<I>a<I>e0a1, but still setup.py forces the downgrade | mbourqui_django-echoices | train | py |
a7cc750f1912fd20de6e197485b4e582d09c0e7c | diff --git a/languagetool-server/src/main/java/org/languagetool/server/HTTPServer.java b/languagetool-server/src/main/java/org/languagetool/server/HTTPServer.java
index <HASH>..<HASH> 100644
--- a/languagetool-server/src/main/java/org/languagetool/server/HTTPServer.java
+++ b/languagetool-server/src/main/java/org/languagetool/server/HTTPServer.java
@@ -126,7 +126,7 @@ public class HTTPServer extends Server {
}
public static void main(String[] args) {
- if (args.length > 5 || usageRequested(args)) {
+ if (args.length > 7 || usageRequested(args)) {
System.out.println("Usage: " + HTTPServer.class.getSimpleName() + " [--config propertyFile] [--port|-p port] [--public]");
System.out.println(" --config FILE a Java property file (one key=value entry per line) with values for:");
printCommonConfigFileOptions(); | fix displaying of usage: "--allow-origin *" together with 2 more parameters wasn't possible | languagetool-org_languagetool | train | java |
8dd065af8e269311fbd15b591a9832467a5463be | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
setup(
name = 'untp',
- version = '1.1.2',
+ version = '1.1.3',
description = 'A command line tool to split TexturePacker published files.',
url = 'https://github.com/justbilt/untp',
author = 'justbilt', | bomp version to <I> | justbilt_untp | train | py |
608ab2fc69fbba4b80c00357a0a3d12d295f3f2f | diff --git a/jss/distribution_points.py b/jss/distribution_points.py
index <HASH>..<HASH> 100644
--- a/jss/distribution_points.py
+++ b/jss/distribution_points.py
@@ -28,6 +28,7 @@ import subprocess
import casper
import requests
+import urllib
PKG_TYPES = ['.PKG', '.DMG']
@@ -411,8 +412,9 @@ class AFPDistributionPoint(MountedRepository):
def _build_url(self):
"""Helper method for building mount URL strings."""
if self.connection.get('username') and self.connection.get('password'):
+
auth = "%s:%s@" % (self.connection['username'],
- self.connection['password'])
+ urllib.quote(self.connection['password']))
else:
auth = ''
@@ -450,8 +452,8 @@ class SMBDistributionPoint(MountedRepository):
"""Helper method for building mount URL strings."""
# Build auth string
if self.connection.get('username') and self.connection.get('password'):
- auth = "%s:%s@" % (self.connection['username'],
- self.connection['password'])
+ auth = "%s:%s@" % (self.connection['username'],
+ urllib.quote(self.connection['password']))
if self.connection.get('domain'):
auth = r"%s;%s" % (self.connection['domain'], auth)
else: | Address issue where mount would fail when password had special characters. | jssimporter_python-jss | train | py |
2d3ec80b0278497c42284b562ef7d3b04f574546 | diff --git a/core/tools/candleLoader.js b/core/tools/candleLoader.js
index <HASH>..<HASH> 100644
--- a/core/tools/candleLoader.js
+++ b/core/tools/candleLoader.js
@@ -85,6 +85,9 @@ const handleCandles = (err, data) => {
if(DONE) {
reader.close();
+
+ setTimeout(doneFn, 100);
+
} else {
shiftIterator();
getBatch();
@@ -93,6 +96,4 @@ const handleCandles = (err, data) => {
const handleBatchedCandles = candle => {
result.push(candle);
- if(DONE)
- doneFn();
}
\ No newline at end of file | make sure the candleLoader cb is always ran | askmike_gekko | train | js |
e96a6d72a789b87f8405d6c7805738b4a0027889 | diff --git a/testapps/testapp_setup/setup.py b/testapps/testapp_setup/setup.py
index <HASH>..<HASH> 100644
--- a/testapps/testapp_setup/setup.py
+++ b/testapps/testapp_setup/setup.py
@@ -4,15 +4,25 @@ from pythonforandroid.bdist_apk import register_args
register_args('--requirements=sdl2,pyjnius,kivy,python2',
'--android-api=19',
'--ndk-dir=/home/asandy/android/crystax-ndk-10.3.1',
- '--dist-name=bdisttest')
+ '--dist-name=bdisttest',
+ '--ndk-version=10.3.1')
from setuptools import setup, find_packages
from distutils.extension import Extension
+package_data = {'': ['*.py',
+ '*.png']
+ }
+
+packages = find_packages()
+print('packages are', packages)
+
setup(
name='testapp_setup',
version='1.1',
description='p4a setup.py test',
author='Alexander Taylor',
author_email='alexanderjohntaylor@gmail.com',
+ packages=find_packages(),
+ package_data={'testapp': ['*.py', '*.png']}
) | Added package_data to testapp_setup | kivy_python-for-android | train | py |
8e0479b117dc01e89c9b71c40dc611cd10910353 | diff --git a/core/codegen/platform/src/main/java/org/overture/codegen/ir/VdmNodeInfo.java b/core/codegen/platform/src/main/java/org/overture/codegen/ir/VdmNodeInfo.java
index <HASH>..<HASH> 100644
--- a/core/codegen/platform/src/main/java/org/overture/codegen/ir/VdmNodeInfo.java
+++ b/core/codegen/platform/src/main/java/org/overture/codegen/ir/VdmNodeInfo.java
@@ -99,4 +99,10 @@ public class VdmNodeInfo
return true;
}
+
+ @Override
+ public String toString()
+ {
+ return "Node: " + node + ". Reason: " + reason;
+ }
} | Added toString for VDMNodeInfo | overturetool_overture | train | java |
4b72b27f20182cb315b63abdc5ea1ecb4045c2f5 | diff --git a/lib/puppet/face/module/generate.rb b/lib/puppet/face/module/generate.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/face/module/generate.rb
+++ b/lib/puppet/face/module/generate.rb
@@ -17,16 +17,14 @@ Puppet::Face.define(:module, '1.0.0') do
$ puppet module generate puppetlabs-ssh
notice: Generating module at /Users/kelseyhightower/puppetlabs-ssh
puppetlabs-ssh
- puppetlabs-ssh/tests
- puppetlabs-ssh/tests/init.pp
- puppetlabs-ssh/spec
- puppetlabs-ssh/spec/spec_helper.rb
- puppetlabs-ssh/spec/spec.opts
- puppetlabs-ssh/README
puppetlabs-ssh/Modulefile
- puppetlabs-ssh/metadata.json
+ puppetlabs-ssh/README
puppetlabs-ssh/manifests
puppetlabs-ssh/manifests/init.pp
+ puppetlabs-ssh/spec
+ puppetlabs-ssh/spec/spec_helper.rb
+ puppetlabs-ssh/tests
+ puppetlabs-ssh/tests/init.pp
EOT
arguments "<name>" | Updated the example text of 'puppet module generate puppetlabs-ssh' while personally exploring/learning what functionality 'puppet module generate' provides to users | puppetlabs_puppet | train | rb |
cfd8126f2668930afd18d4cd9c3833e959ac8644 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -54,4 +54,5 @@ setup(
'nose',
],
},
+ test_suite='haproxy.tests',
) | Explicitly set test_suite on setup.py to ease running tests | gforcada_haproxy_log_analysis | train | py |
746ff83dec6ba2c5daa14f7f0cb951411cf18599 | diff --git a/src/Illuminate/Html/FormBuilder.php b/src/Illuminate/Html/FormBuilder.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Html/FormBuilder.php
+++ b/src/Illuminate/Html/FormBuilder.php
@@ -565,7 +565,7 @@ class FormBuilder {
*/
public function image($url, $name = null, $attributes = array())
{
- $attributes['src'] = URL::asset($url);
+ $attributes['src'] = $this->url->asset($url);
return $this->input('image', $name, null, $attributes);
} | Update FormBuilder.php
[REPLACE] URL::asset($url) by $this->url->asset($url) | laravel_framework | train | php |
e7a035099cfde8eaf8a1fb329f19bf7dd6ec5532 | diff --git a/python/phonenumbers/phonemetadata.py b/python/phonenumbers/phonemetadata.py
index <HASH>..<HASH> 100644
--- a/python/phonenumbers/phonemetadata.py
+++ b/python/phonenumbers/phonemetadata.py
@@ -229,8 +229,8 @@ class PhoneMetadata(UnicodeMixin, ImmutableMixin):
loader = kls._region_available.get(region_code, None)
if loader is not None:
# Region metadata is available but has not yet been loaded. Do so now.
- kls._region_available[region_code] = None
loader()
+ kls._region_available[region_code] = None
return kls._region_metadata.get(region_code, default)
@classmethod
@@ -238,8 +238,8 @@ class PhoneMetadata(UnicodeMixin, ImmutableMixin):
loader = kls._country_code_available.get(country_code, None)
if loader is not None:
# Region metadata is available but has not yet been loaded. Do so now.
- kls._country_code_available[country_code] = None
loader()
+ kls._country_code_available[country_code] = None
return kls._country_code_metadata.get(country_code, default)
@classmethod | Safer to load before clearing loader.
Performing the import twice has no ill effect. However,
if a second thread were to come in between the clear of
the loader and its invocation, there would be no metadata
and no loader for it either. | daviddrysdale_python-phonenumbers | train | py |
bd22eb2ce47a7a7afef907a7d35c70dab16692b6 | diff --git a/src/Behat/Behat/Definition/Annotation/Definition.php b/src/Behat/Behat/Definition/Annotation/Definition.php
index <HASH>..<HASH> 100644
--- a/src/Behat/Behat/Definition/Annotation/Definition.php
+++ b/src/Behat/Behat/Definition/Annotation/Definition.php
@@ -132,7 +132,13 @@ abstract class Definition extends Annotation implements DefinitionInterface
*/
public function run(ContextInterface $context, $tokens = array())
{
- $oldHandler = set_error_handler(array($this, 'errorHandler'), E_ALL ^ E_WARNING);
+ if (defined('BEHAT_ERROR_REPORTING')) {
+ $errorLevel = BEHAT_ERROR_REPORTING;
+ } else {
+ $errorLevel = E_ALL ^ E_WARNING;
+ }
+
+ $oldHandler = set_error_handler(array($this, 'errorHandler'), $errorLevel);
$callback = $this->getCallback();
$values = $this->getValues(); | added support for BEHAT_ERROR_REPORTING constant (defines report level for errors in your steps) | Behat_Behat | train | php |
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.