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 |
|---|---|---|---|---|---|
6ad2906f4221cf7796ebe12e3466c1f479f7a4de | diff --git a/src/main/resources/execute_asciidoctor.rb b/src/main/resources/execute_asciidoctor.rb
index <HASH>..<HASH> 100644
--- a/src/main/resources/execute_asciidoctor.rb
+++ b/src/main/resources/execute_asciidoctor.rb
@@ -1,9 +1,9 @@
+require 'bundler/setup'
require 'asciidoctor'
-require 'find'
-Find.find($srcDir) do |path|
+Dir.glob("#{$srcDir}/**/*.a*").each do |path|
if path =~ /.*\.a((sc(iidoc)?)|d(oc)?)$/
- Asciidoctor.render_file({path, :in_place => true, :safe => Asciidoctor::SafeMode::UNSAFE,
- :base_dir => $srcDir, :backend => $backend})
+ Asciidoctor.render_file(path, {:in_place => false, :safe => Asciidoctor::SafeMode::UNSAFE,
+ :attributes => {'backend' => $backend}, :to_dir => $outputDir})
end
end | Updating to the new <I> and bundler | asciidoctor_asciidoctor-maven-plugin | train | rb |
9d2e4f52dc719acef151ef7ae4d0f44c45296390 | diff --git a/src/main/java/com/smbtec/xo/tinkerpop/blueprints/impl/TinkerPopPropertyManager.java b/src/main/java/com/smbtec/xo/tinkerpop/blueprints/impl/TinkerPopPropertyManager.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/smbtec/xo/tinkerpop/blueprints/impl/TinkerPopPropertyManager.java
+++ b/src/main/java/com/smbtec/xo/tinkerpop/blueprints/impl/TinkerPopPropertyManager.java
@@ -110,6 +110,7 @@ public class TinkerPopPropertyManager implements DatastorePropertyManager<Vertex
@Override
public Iterable<Edge> getRelations(final Vertex source, final RelationTypeMetadata<EdgeMetadata> metadata, final RelationTypeMetadata.Direction direction) {
+ final String label = metadata.getDatastoreMetadata().getDiscriminator();
VertexQuery query = source.query();
switch (direction) {
case TO:
@@ -121,7 +122,7 @@ public class TinkerPopPropertyManager implements DatastorePropertyManager<Vertex
default:
throw new XOException("Unknown direction '" + direction.name() + "'.");
}
- return query.edges();
+ return query.labels(label).edges();
}
@Override | - only return edges with the given label | SMB-TEC_xo-tinkerpop-blueprints | train | java |
c8bb7e0fe406e4afe8fb7f2655d4f350ece528dc | diff --git a/superset/__init__.py b/superset/__init__.py
index <HASH>..<HASH> 100644
--- a/superset/__init__.py
+++ b/superset/__init__.py
@@ -195,13 +195,14 @@ if not issubclass(custom_sm, SupersetSecurityManager):
not FAB's security manager.
See [4565] in UPDATING.md""")
-appbuilder = AppBuilder(
- app,
- db.session,
- base_template='superset/base.html',
- indexview=MyIndexView,
- security_manager_class=custom_sm,
-)
+with app.app_context():
+ appbuilder = AppBuilder(
+ app,
+ db.session,
+ base_template='superset/base.html',
+ indexview=MyIndexView,
+ security_manager_class=custom_sm,
+ )
security_manager = appbuilder.sm | Quick fix to address deadlock issue (#<I>) | apache_incubator-superset | train | py |
6c998750328ba612081b0ad57d36717d05ab4473 | diff --git a/src/Geometry/MultiPolygon.php b/src/Geometry/MultiPolygon.php
index <HASH>..<HASH> 100644
--- a/src/Geometry/MultiPolygon.php
+++ b/src/Geometry/MultiPolygon.php
@@ -29,5 +29,10 @@
return $points;
}
+
+ public function add(Polygon $polygon)
+ {
+ $this->coordinates[] = $polygon;
+ }
}
?> | Include add method in Geometry\MultiPolygon
Adds new Polygons | irwtdvoys_bolt-geojson | train | php |
defce6765dcca70d6874ff8f87d2160ad0808614 | diff --git a/packages/ember/tests/acceptance/sentry-performance-test.js b/packages/ember/tests/acceptance/sentry-performance-test.js
index <HASH>..<HASH> 100644
--- a/packages/ember/tests/acceptance/sentry-performance-test.js
+++ b/packages/ember/tests/acceptance/sentry-performance-test.js
@@ -23,7 +23,11 @@ function assertSentryCall(assert, callNumber, options) {
}
if (options.spans) {
assert.deepEqual(
- event.spans.map(s => `${s.op} | ${s.description}`),
+ event.spans.map(s => {
+ // Normalize span descriptions for internal components so tests work on either side of updated Ember versions
+ const normalizedDescription = s.description === 'component:-link-to' ? 'component:link-to' : s.description;
+ return `${s.op} | ${normalizedDescription}`;
+ }),
options.spans,
`Has correct spans`,
); | ref(ember): Fix tests to be forward compatible with component changes (#<I>)
* ref(ember): Fix tests to be forward compatible with component changes
One of the frameworks provided components, link-to, had a change to it's internal name. It's not really relevant to the test, so normalizing the description should work across the version changes. | getsentry_sentry-javascript | train | js |
6578a3b16304e8be82baed6f6c29a5162aa8f7df | diff --git a/tasks/version-check-grunt.js b/tasks/version-check-grunt.js
index <HASH>..<HASH> 100644
--- a/tasks/version-check-grunt.js
+++ b/tasks/version-check-grunt.js
@@ -59,7 +59,7 @@ function bowerCallback(dependency) {
callback(null, _.merge({
latest : latest,
- upToDate : semver.satisfies(latest, version)
+ upToDate : semver.satisfies(latest, dependency.version)
}, dependency));
});
};
@@ -74,7 +74,7 @@ function npmCallback(dependency) {
callback(null, _.merge({
latest : latest,
- upToDate : semver.satisfies(latest, version)
+ upToDate : semver.satisfies(latest, dependency.version)
}, dependency));
});
}; | Fixed issue introduced by code refactoring. | stevewillard_grunt-version-check | train | js |
fb55f3cc8a88d0a47554187dae28b0a8ab032c0e | diff --git a/pandas/core/nanops.py b/pandas/core/nanops.py
index <HASH>..<HASH> 100644
--- a/pandas/core/nanops.py
+++ b/pandas/core/nanops.py
@@ -12,7 +12,10 @@ except ImportError: # pragma: no cover
_USE_BOTTLENECK = False
def _bottleneck_switch(bn_name, alt, **kwargs):
- bn_func = getattr(bn, bn_name)
+ try:
+ bn_func = getattr(bn, bn_name)
+ except NameError:
+ bn_func = None
def f(values, axis=None, skipna=True):
try:
if _USE_BOTTLENECK and skipna: | BUG: wrap getting bottleneck function in try/catch, GH #<I> | pandas-dev_pandas | train | py |
0bc68d20d8c565f478b23b1fd19934d338c75fdb | diff --git a/src/dawguk/GarminConnect.php b/src/dawguk/GarminConnect.php
index <HASH>..<HASH> 100755
--- a/src/dawguk/GarminConnect.php
+++ b/src/dawguk/GarminConnect.php
@@ -89,7 +89,7 @@ class GarminConnect {
* @return bool
*/
private function checkCookieAuth($strUsername) {
- if (strlen($this->getUsername()) == 0 || $strUsername != $this->getUsername()) {
+ if (strlen($this->getUsername()) == 0) {
$this->objConnector->clearCookie();
return FALSE;
} else { | - Removed username check, as the username != the email address! | dawguk_php-garmin-connect | train | php |
f5cd8164a4b48482f958ab3a8bd785ff0c578c99 | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -8,7 +8,6 @@ Bundler.require(:development)
SimpleCov.start
-require 'pulse_meter_core'
require 'pulse_meter_cli'
PulseMeter.redis = MockRedis.new | removed unneccessary require | savonarola_pulse_meter_cli | train | rb |
f326fe67b1dec620c718e08ad8028abd0a577620 | diff --git a/src/rest/APIRouter.js b/src/rest/APIRouter.js
index <HASH>..<HASH> 100644
--- a/src/rest/APIRouter.js
+++ b/src/rest/APIRouter.js
@@ -22,6 +22,7 @@ function buildRoute(manager) {
versioned: manager.versioned,
route: route.map((r, i) => {
if (/\d{16,19}/g.test(r)) return /channels|guilds/.test(route[i - 1]) ? r : ':id';
+ if (route[i - 1] === 'reactions') return ':reaction';
return r;
}).join('/'),
}, options)).catch(error => {
diff --git a/src/rest/RequestHandler.js b/src/rest/RequestHandler.js
index <HASH>..<HASH> 100644
--- a/src/rest/RequestHandler.js
+++ b/src/rest/RequestHandler.js
@@ -131,7 +131,7 @@ class RequestHandler {
// https://github.com/discordapp/discord-api-docs/issues/182
if (item.request.route.includes('reactions')) {
- this.reset = Date.now() + getAPIOffset(serverDate) + 250;
+ this.reset = new Date(serverDate).getTime() - getAPIOffset(serverDate) + 250;
}
} | fix: reactions ratelimits (#<I>)
* each reaction doesn't have it's own ratelimit
* fix hard-coded reset for reacting | discordjs_discord.js | train | js,js |
17aac70e3770bf8c52302979cd4fe6e3ed30f7c6 | diff --git a/src/components/AuthRoute.js b/src/components/AuthRoute.js
index <HASH>..<HASH> 100644
--- a/src/components/AuthRoute.js
+++ b/src/components/AuthRoute.js
@@ -51,6 +51,11 @@ class AuthRoute extends React.Component<AuthRouteDefaultProps, AuthRouteProps, A
this.state = {
user: null,
};
+ }
+
+ state: AuthRouteState;
+
+ componentDidMount() {
AuthUtils.getLoggedInUserInfo((userInfo: any) => {
this.setState({
user: userInfo,
@@ -58,8 +63,6 @@ class AuthRoute extends React.Component<AuthRouteDefaultProps, AuthRouteProps, A
});
}
- state: AuthRouteState;
-
render() {
// If the user is logged in and has permission for this
// route, then just render the route. | PLAT-<I>: Move the call to the did mount method to avoid waring about setting state in contructor | attivio_suit | train | js |
5fb9ce398034b10ea3493118285af1dd54d550e3 | diff --git a/lib/fastlane/actions/actions_helper.rb b/lib/fastlane/actions/actions_helper.rb
index <HASH>..<HASH> 100644
--- a/lib/fastlane/actions/actions_helper.rb
+++ b/lib/fastlane/actions/actions_helper.rb
@@ -30,6 +30,8 @@ module Fastlane
# Is the required gem installed on the current machine
def self.gem_available?(name)
+ return true if Helper.is_test?
+
Gem::Specification.find_by_name(name)
rescue Gem::LoadError
false
diff --git a/lib/fastlane/actions/deliver.rb b/lib/fastlane/actions/deliver.rb
index <HASH>..<HASH> 100644
--- a/lib/fastlane/actions/deliver.rb
+++ b/lib/fastlane/actions/deliver.rb
@@ -1,8 +1,15 @@
module Fastlane
module Actions
def self.deliver(params)
+ need_gem!'deliver'
+
+ require 'deliver'
ENV["DELIVER_SCREENSHOTS_PATH"] = self.snapshot_screenshots_folder
- sh "deliver --force"
+
+ force = false
+ force = true if params.first == :force
+
+ Deliver::Deliverer.new(Deliver::Deliverfile::Deliverfile::FILE_NAME, force: force)
end
end
end
\ No newline at end of file | Added native deliver integratoin with :force flag | fastlane_fastlane | train | rb,rb |
708f7e9b7cdc7f57b73b92ebcafff234ec91348e | diff --git a/ArgusCore/src/main/java/com/salesforce/dva/argus/service/monitor/DataLagMonitor.java b/ArgusCore/src/main/java/com/salesforce/dva/argus/service/monitor/DataLagMonitor.java
index <HASH>..<HASH> 100644
--- a/ArgusCore/src/main/java/com/salesforce/dva/argus/service/monitor/DataLagMonitor.java
+++ b/ArgusCore/src/main/java/com/salesforce/dva/argus/service/monitor/DataLagMonitor.java
@@ -66,7 +66,10 @@ public class DataLagMonitor extends Thread{
Metric currMetric = metrics.get(0);
if(currMetric.getDatapoints()==null || currMetric.getDatapoints().size()==0) {
_logger.info("Data lag detected as data point list is empty");
- isDataLagging=true;
+ if(!isDataLagging) {
+ isDataLagging=true;
+ sendDataLagEmailNotification();
+ }
continue;
}else {
long lastDataPointTime = 0L; | Made a change to send email notification in case of data lag | salesforce_Argus | train | java |
886cdd9dd361310e1e99861ece5bcac1a59f8367 | diff --git a/plugin/forward/fuzz.go b/plugin/forward/fuzz.go
index <HASH>..<HASH> 100644
--- a/plugin/forward/fuzz.go
+++ b/plugin/forward/fuzz.go
@@ -16,8 +16,8 @@ var f *Forward
func init() {
f = New()
s := dnstest.NewServer(r{}.reflectHandler)
- f.proxies = append(f.proxies, NewProxy(s.Addr, "tcp"))
- f.proxies = append(f.proxies, NewProxy(s.Addr, "udp"))
+ f.SetProxy(NewProxy(s.Addr, "tcp"))
+ f.SetProxy(NewProxy(s.Addr, "udp"))
}
// Fuzz fuzzes forward. | Fix plugin forward fuzz target (#<I>)
using new method to start proxies | coredns_coredns | train | go |
3ff98a52fb8e1a393c6dbe4bbb5eabff137d0b27 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -14,11 +14,17 @@ ESLine configuration is below. Here is what the numbers mean:
module.exports = (function createParser () {
var xpath = require('xpath')
- var jsdom = require('jsdom').jsdom
+ var jsdom = require('jsdom')
var xmlser = require('xmlserializer')
var dom = require('xmldom').DOMParser
var transformations = require('./transformations')
+ jsdom.defaultDocumentFeatures = {
+ FetchExternalResources: false,
+ ProcessExternalResources: false,
+ MutationEvents: false
+ }
+
return {
parse: parse
}
@@ -32,7 +38,7 @@ module.exports = (function createParser () {
transformations[attrname] = externalTransformations[attrname]
}
- var document = jsdom(html.toString())
+ var document = jsdom.jsdom(html.toString())
var xhtml = xmlser.serializeToString(document)
xhtml = xhtml.replace(' xmlns="http://www.w3.org/1999/xhtml"', '') // Ugly hack, for now
var doc = new dom().parseFromString(xhtml) | Prevent running scripts or loading external resources | OpenScraping_openscraping-lib-nodejs | train | js |
f69d704841bd30c08af4a522397b3fe95107bdfd | diff --git a/bigquery/tests/unit/test_table.py b/bigquery/tests/unit/test_table.py
index <HASH>..<HASH> 100644
--- a/bigquery/tests/unit/test_table.py
+++ b/bigquery/tests/unit/test_table.py
@@ -124,7 +124,9 @@ class TestTable(unittest.TestCase, _SchemaBase):
if 'view' in resource:
self.assertEqual(table.view_query, resource['view']['query'])
- self.assertEqual(table.view_use_legacy_sql, resource['view'].get('useLegacySql'))
+ self.assertEqual(
+ table.view_use_legacy_sql,
+ resource['view'].get('useLegacySql'))
else:
self.assertIsNone(table.view_query)
self.assertIsNone(table.view_use_legacy_sql) | Fixing "long line" lint violation in BigQuery unit tests. (#<I>) | googleapis_google-cloud-python | train | py |
b76242ab47dd9750926240298fd9b8a8a4451e6f | diff --git a/PheanstalkProducer.php b/PheanstalkProducer.php
index <HASH>..<HASH> 100644
--- a/PheanstalkProducer.php
+++ b/PheanstalkProducer.php
@@ -7,6 +7,7 @@ namespace Enqueue\Pheanstalk;
use Interop\Queue\Destination;
use Interop\Queue\Exception\InvalidDestinationException;
use Interop\Queue\Exception\InvalidMessageException;
+use Interop\Queue\Exception\PriorityNotSupportedException;
use Interop\Queue\Message;
use Interop\Queue\Producer;
use Pheanstalk\Pheanstalk;
@@ -75,7 +76,7 @@ class PheanstalkProducer implements Producer
return $this;
}
- throw new \LogicException('Not implemented');
+ throw PriorityNotSupportedException::providerDoestNotSupportIt();
}
public function getPriority(): ?int | Fix wrong exceptions in transports
The `setPriority` method have to throw a PriorityNotSupportedException
if the feature is not supported. | php-enqueue_pheanstalk | train | php |
274e2ae1497567efc87a0571cb5bcb7acc98d049 | diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100755
--- a/manifest.php
+++ b/manifest.php
@@ -54,7 +54,7 @@ return array(
'label' => 'TAO Base',
'description' => 'TAO meta-extension',
'license' => 'GPL-2.0',
- 'version' => '40.6.0',
+ 'version' => '40.6.1',
'author' => 'Open Assessment Technologies, CRP Henri Tudor',
'requires' => array(
'generis' => '>=12.5.0',
diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php
index <HASH>..<HASH> 100755
--- a/scripts/update/Updater.php
+++ b/scripts/update/Updater.php
@@ -1288,6 +1288,6 @@ class Updater extends \common_ext_ExtensionUpdater {
$this->setVersion('40.3.4');
}
- $this->skip('40.3.4', '40.6.0');
+ $this->skip('40.3.4', '40.6.1');
}
} | Bumped tao-core version | oat-sa_tao-core | train | php,php |
fad88bc11337c6517a99db28154a668b2e506caa | diff --git a/teslajsonpy/controller.py b/teslajsonpy/controller.py
index <HASH>..<HASH> 100644
--- a/teslajsonpy/controller.py
+++ b/teslajsonpy/controller.py
@@ -256,7 +256,7 @@ class Controller:
)
if not result:
if retries < 5:
- await asyncio.sleep(sleep_delay ** (retries + 2))
+ await asyncio.sleep(15 + sleep_delay ** (retries + 2))
retries += 1
continue
inst.car_online[inst._id_to_vin(car_id)] = False
@@ -272,7 +272,7 @@ class Controller:
kwargs,
)
while not valid_result(result):
- await asyncio.sleep(sleep_delay ** (retries + 1))
+ await asyncio.sleep(15 + sleep_delay ** (retries + 1))
try:
result = await func(*args, **kwargs)
_LOGGER.debug( | fix: increase minimum retry delay to <I> seconds | zabuldon_teslajsonpy | train | py |
ff755fe57a5f30572e06432b92f94798623f1932 | diff --git a/lib/napybara/version.rb b/lib/napybara/version.rb
index <HASH>..<HASH> 100644
--- a/lib/napybara/version.rb
+++ b/lib/napybara/version.rb
@@ -1,3 +1,3 @@
module Napybara
- VERSION = "0.4.1"
+ VERSION = "0.5.0"
end | Bump to <I>. | gsmendoza_napybara | train | rb |
f33c09df284fecd77039f797503a569f0629f662 | diff --git a/lib/types/AbstractBuilder.js b/lib/types/AbstractBuilder.js
index <HASH>..<HASH> 100644
--- a/lib/types/AbstractBuilder.js
+++ b/lib/types/AbstractBuilder.js
@@ -154,7 +154,8 @@ class AbstractBuilder {
this.taskLog.addWork(allTasksCount);
let taskChain = Promise.resolve();
- for (const taskName in this.tasks) {
+ for (let i = 0; i < this.taskExecutionOrder.length; i++) {
+ const taskName = this.taskExecutionOrder[i];
if (this.tasks.hasOwnProperty(taskName) && tasksToRun.includes(taskName)) {
const taskFunction = this.tasks[taskName]; | [INTERNAL] AbstractBuilder: Obey given task execution order | SAP_ui5-builder | train | js |
b82dd708be6ba00daf93d2fb4b79a323c1d11587 | diff --git a/tests/unit/modules/test_cmdmod.py b/tests/unit/modules/test_cmdmod.py
index <HASH>..<HASH> 100644
--- a/tests/unit/modules/test_cmdmod.py
+++ b/tests/unit/modules/test_cmdmod.py
@@ -324,7 +324,8 @@ class CMDMODTestCase(TestCase, LoaderModuleMockMixin):
self.assertEqual(environment, environment2)
- getpwnam_mock.assert_called_with('foobar')
+ if not salt.utils.platform.is_darwin():
+ getpwnam_mock.assert_called_with('foobar')
def test_run_cwd_doesnt_exist_issue_7154(self):
''' | skip getpwnam check on mac in unit test_cmdmod | saltstack_salt | train | py |
b769836796dc489e99ac6ffd26c978f70fd0fece | diff --git a/src/Column/Link.php b/src/Column/Link.php
index <HASH>..<HASH> 100644
--- a/src/Column/Link.php
+++ b/src/Column/Link.php
@@ -11,7 +11,11 @@ class Link extends Generic
public function __construct($page = [])
{
- $this->page = $page[0];
+ if (!is_array($page)) {
+ $this->page = $page;
+ } elseif (isset($page[0]) {
+ $this->page = $page[0];
+ }
}
/** | constructor now supports passing page as string | atk4_ui | train | php |
3f3bdf698b27457bd6e696dd5dee40f1be4be65f | diff --git a/tests/test_wrappers.py b/tests/test_wrappers.py
index <HASH>..<HASH> 100644
--- a/tests/test_wrappers.py
+++ b/tests/test_wrappers.py
@@ -489,3 +489,7 @@ def test_storage_classes():
assert type(req.cookies) is ImmutableTypeConversionDict
assert req.cookies == {'foo': 'bar'}
assert type(req.access_route) is ImmutableList
+
+ MyRequest.list_storage_class = tuple
+ req = Request.from_values()
+ assert type(req.access_route) is tuple | Added another boring test case to test the buildbot. | pallets_werkzeug | train | py |
85d908ad660f2e1d382992830d1b11f73c23221f | diff --git a/upload/system/library/cart.php b/upload/system/library/cart.php
index <HASH>..<HASH> 100644
--- a/upload/system/library/cart.php
+++ b/upload/system/library/cart.php
@@ -309,16 +309,14 @@ class Cart {
}
public function add($product_id, $qty = 1, $option = array(), $profile_id = 0) {
- $key = (int)$product_id . ':';
-
- if ($option) {
- $key .= base64_encode(serialize($option)) . ':';
+ if (!$option) {
+ $key .= (int)$product_id;
} else {
- $key .= ':';
+ $key .= (int)$product_id . ':' . base64_encode(serialize($option));
}
if ($profile_id) {
- $key .= (int)$profile_id;
+ $key .= ':' . (int)$profile_id;
}
if ((int)$qty && ((int)$qty > 0)) { | updated James Allsup's poor coding choices | opencart_opencart | train | php |
5335cc9fa88479f1377ad740cf00f5fc8f1fb4e7 | diff --git a/src/Aimeos/Shop/ShopServiceProvider.php b/src/Aimeos/Shop/ShopServiceProvider.php
index <HASH>..<HASH> 100644
--- a/src/Aimeos/Shop/ShopServiceProvider.php
+++ b/src/Aimeos/Shop/ShopServiceProvider.php
@@ -44,11 +44,11 @@ class ShopServiceProvider extends ServiceProvider {
), 'migrations');
$this->publishes(array(
- $basedir.'views' => base_path('resources/views/vendor/aimeos/shop'),
+ $basedir.'views' => base_path('resources/views/vendor/shop'),
), 'views');
$this->publishes(array(
- dirname($basedir).DIRECTORY_SEPARATOR.'public' => public_path('packages/aimeos/shop'),
+ dirname($basedir).DIRECTORY_SEPARATOR.'public' => public_path('packages/shop'),
), 'public'); | Fixed paths for overwriting views and storing assets | aimeos_aimeos-laravel | train | php |
f90714b1fbd638cbc59c50038e24cfa8cea5b971 | diff --git a/ncclient/operations/retrieve.py b/ncclient/operations/retrieve.py
index <HASH>..<HASH> 100644
--- a/ncclient/operations/retrieve.py
+++ b/ncclient/operations/retrieve.py
@@ -46,6 +46,15 @@ class GetReply(RPCReply):
"Same as :attr:`data_ele`"
+class GetSchemaReply(GetReply):
+ """Reply for GetSchema called with specific parsing hook."""
+
+ def _parsing_hook(self, root):
+ self._data = None
+ if not self._errors:
+ self._data = root.find(qualify("data", NETCONF_MONITORING_NS)).text
+
+
class Get(RPC):
"The *get* RPC."
@@ -91,7 +100,7 @@ class GetSchema(RPC):
"""The *get-schema* RPC."""
- REPLY_CLS = GetReply
+ REPLY_CLS = GetSchemaReply
"""See :class:`GetReply`."""
def request(self, identifier, version=None, format=None): | Use specific reply class for GetSchema
This correctly extracts the YANG model from the reply unlike the generic
GetReply class which uses the wrong namespace. | ncclient_ncclient | train | py |
144e7e7d093c64efb1521d099f196275152292c1 | diff --git a/lib/web/handlers.js b/lib/web/handlers.js
index <HASH>..<HASH> 100644
--- a/lib/web/handlers.js
+++ b/lib/web/handlers.js
@@ -168,6 +168,7 @@ StreamingHandlers.prototype.streamLog = function(socket, log) {
if (!summary.finished) {
self._dreadnot.emitter.on(logPath, emit);
self._dreadnot.emitter.once(endPath, function(success) {
+ self._dreadnot.emitter.removeListener(logPath, emit);
socket.emit(endPath, success);
});
} else { | don't send log messages after a deployment ends | racker_dreadnot | train | js |
c65843606efee48d99e1d40af18ee42c4f974a35 | diff --git a/src/puzzle/AreaManager.js b/src/puzzle/AreaManager.js
index <HASH>..<HASH> 100644
--- a/src/puzzle/AreaManager.js
+++ b/src/puzzle/AreaManager.js
@@ -157,12 +157,12 @@ pzpr.classmgr.makeCommon({
// roommgr.setTopOfRoom_combine() 部屋が繋がったとき、部屋のTOPを設定する
//--------------------------------------------------------------------------------
setTopOfRoom_combine : function(cell1,cell2){
- if(!cell1.room || !cell2.room){ return;}
+ if(!cell1.room || !cell2.room || cell1.room===cell2.room){ return;}
var merged, keep;
var tcell1 = cell1.room.top;
var tcell2 = cell2.room.top;
- if(cell1.bx>cell2.bx || (cell1.bx===cell2.bx && cell1.id>cell2.id)){ merged = tcell1; keep = tcell2;}
- else { merged = tcell2; keep = tcell1;}
+ if(tcell1.bx>tcell2.bx || (tcell1.bx===tcell2.bx && tcell1.by>tcell2.by)){ merged = tcell1; keep = tcell2;}
+ else { merged = tcell2; keep = tcell1;}
// 消える部屋のほうの数字を消す
if(merged.isNum()){ | AreaRoomGraph: Fix number in rooms moves wrong when two rooms are merged | sabo2_pzprjs | train | js |
0b1df8f1f4c14a1e0f238241cf6991d40ca3184f | diff --git a/moco-core/src/main/java/com/github/dreamhead/moco/MocoRecorders.java b/moco-core/src/main/java/com/github/dreamhead/moco/MocoRecorders.java
index <HASH>..<HASH> 100644
--- a/moco-core/src/main/java/com/github/dreamhead/moco/MocoRecorders.java
+++ b/moco-core/src/main/java/com/github/dreamhead/moco/MocoRecorders.java
@@ -4,10 +4,9 @@ import com.github.dreamhead.moco.recorder.DynamicRecordHandler;
import com.github.dreamhead.moco.recorder.DynamicReplayHandler;
import com.github.dreamhead.moco.recorder.RecorderConfig;
import com.github.dreamhead.moco.recorder.RecorderConfigurations;
-import com.github.dreamhead.moco.recorder.MocoGroup;
import com.github.dreamhead.moco.recorder.RecorderIdentifier;
-import com.github.dreamhead.moco.recorder.ReplayModifier;
import com.github.dreamhead.moco.recorder.RecorderTape;
+import com.github.dreamhead.moco.recorder.ReplayModifier;
import com.github.dreamhead.moco.resource.ContentResource;
import static com.github.dreamhead.moco.Moco.and; | removed unused import in moco recorders | dreamhead_moco | train | java |
2fd12cb865b788b6f9fef2a72b026dbd1b2d0df4 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -164,6 +164,7 @@ Phantasma.prototype.open = function (url) {
if(!self.page) return reject('tried to open before page created');
self.page.open(url, function (status) {
+ if (status === 'fail') return reject(status);
resolve(status);
});
}).timeout(this.options.timeout); | handle open failure from Phantom's Web Page Module | petecoop_phantasma | train | js |
ce279fc5bb8c84ca3715210da7e89b48477058ea | diff --git a/lib/swag_dev/project/tools/yardoc/file.rb b/lib/swag_dev/project/tools/yardoc/file.rb
index <HASH>..<HASH> 100644
--- a/lib/swag_dev/project/tools/yardoc/file.rb
+++ b/lib/swag_dev/project/tools/yardoc/file.rb
@@ -37,7 +37,7 @@ class SwagDev::Project::Tools::Yardoc::File
@glob
end
- def to_s_
+ def to_s
filepath
end | yardoc/file (tools) typo | SwagDevOps_kamaze-project | train | rb |
ee43d2ca43501275a62c32ff4a71be84e978425a | diff --git a/src/Billable.php b/src/Billable.php
index <HASH>..<HASH> 100644
--- a/src/Billable.php
+++ b/src/Billable.php
@@ -758,7 +758,7 @@ trait Billable
*/
public function createAsStripeCustomer(array $options = [])
{
- if (! $this->hasStripeId()) {
+ if ($this->hasStripeId()) {
throw CustomerAlreadyCreated::exists($this);
} | Fix bug with createAsStripeCustomer | laravel_cashier | train | php |
4a88422d9f3bac537084990d8e5d06076ea8ce00 | diff --git a/public_header.go b/public_header.go
index <HASH>..<HASH> 100644
--- a/public_header.go
+++ b/public_header.go
@@ -157,14 +157,19 @@ func ParsePublicHeader(b *bytes.Reader, packetSentBy protocol.Perspective) (*Pub
}
if packetSentBy == protocol.PerspectiveServer && publicFlagByte&0x04 > 0 {
- header.DiversificationNonce = make([]byte, 32)
- for i := 0; i < 32; i++ {
- var val byte
- val, err = b.ReadByte()
- if err != nil {
- return nil, err
+ // TODO: remove the if once the Google servers send the correct value
+ // assume that a packet doesn't contain a diversification nonce if the version flag or the reset flag is set, no matter what the public flag says
+ // see https://github.com/lucas-clemente/quic-go/issues/232
+ if !header.VersionFlag && !header.ResetFlag {
+ header.DiversificationNonce = make([]byte, 32)
+ for i := 0; i < 32; i++ {
+ var val byte
+ val, err = b.ReadByte()
+ if err != nil {
+ return nil, err
+ }
+ header.DiversificationNonce[i] = val
}
- header.DiversificationNonce[i] = val
}
} | add workaround for incorrect public flag values sent by Google servers | lucas-clemente_quic-go | train | go |
37ebd76eda9b0ae80b3596f60141bc72df5b1f50 | diff --git a/packages/ad/src/utils/ad-init.js b/packages/ad/src/utils/ad-init.js
index <HASH>..<HASH> 100644
--- a/packages/ad/src/utils/ad-init.js
+++ b/packages/ad/src/utils/ad-init.js
@@ -38,7 +38,7 @@ export default ({ el, data, platform, eventCallback, window }) => {
localInitCalled = true;
window.initCalled = true;
- if (!data.bidInitialiser) {
+ if ((!data.bidInitialiser && isWeb) || !isWeb) {
this.loadScripts();
} | fix: ad native (#<I>) | newsuk_times-components | train | js |
fa5966f366b85d17d85891d391ecc2686eaad50d | diff --git a/build.go b/build.go
index <HASH>..<HASH> 100644
--- a/build.go
+++ b/build.go
@@ -6,7 +6,6 @@ import (
"log"
"os"
"os/exec"
- "path"
"strconv"
)
@@ -16,8 +15,6 @@ type packagesConf struct {
Dependencies map[string]string
}
-// TODO Fetches packages via package manager, puts them in the packages dir
-
func bootDependencies() {
// TODO Inspect for errors
content, err := ioutil.ReadFile("packages.json")
@@ -39,8 +36,9 @@ func bootDependencies() {
for name := range conf.Dependencies {
p := strconv.Itoa(port + i)
log.Println("booting package", name, p)
- pth := path.Join("packages", name, name)
- cmd := exec.Command(pth, "-port", p)
+ // NOTE assumes packages are installed with go install ./...,
+ // matching Heroku's Go buildpack
+ cmd := exec.Command(name, "-port", p)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if err = cmd.Start(); err != nil { | Dependencies load identically across Heroku, dev | itsabot_itsabot | train | go |
4830a656f79304018f66a130f79c43e981d4384d | diff --git a/services/visual_recognition/v3.js b/services/visual_recognition/v3.js
index <HASH>..<HASH> 100644
--- a/services/visual_recognition/v3.js
+++ b/services/visual_recognition/v3.js
@@ -87,8 +87,7 @@ module.exports = function(RED) {
var f = config['image-feature'];
- if (msg.params && msg.params.detect_mode)
- {
+ if (msg.params && msg.params.detect_mode) {
if (msg.params.detect_mode in theOptions) {
f = theOptions[msg.params.detect_mode];
} else { | Allowed Detect Mode to be set in msg.params for Visual Recognition Node | watson-developer-cloud_node-red-node-watson | train | js |
6be750167128bef0965fe9d60ef40f87599f0558 | diff --git a/presto-main/src/main/java/com/facebook/presto/operator/aggregation/FloatingPointBitsConverterUtil.java b/presto-main/src/main/java/com/facebook/presto/operator/aggregation/FloatingPointBitsConverterUtil.java
index <HASH>..<HASH> 100644
--- a/presto-main/src/main/java/com/facebook/presto/operator/aggregation/FloatingPointBitsConverterUtil.java
+++ b/presto-main/src/main/java/com/facebook/presto/operator/aggregation/FloatingPointBitsConverterUtil.java
@@ -23,7 +23,7 @@ final class FloatingPointBitsConverterUtil
*/
public static long doubleToSortableLong(double value)
{
- long bits = Double.doubleToRawLongBits(value);
+ long bits = Double.doubleToLongBits(value);
return bits ^ (bits >> 63) & Long.MAX_VALUE;
} | Discard double NaN differentiation while sorting
NaNs are not comparable (NaN != NaN) and Java's Double.compare(double, double) returns 0 for all NaN representations, thus differentiation between NaNs should be discarded for sorting purposes. | prestodb_presto | train | java |
805c376fab32c4f96d36ff53978c8d09880792da | diff --git a/manager/dispatcher/dispatcher.go b/manager/dispatcher/dispatcher.go
index <HASH>..<HASH> 100644
--- a/manager/dispatcher/dispatcher.go
+++ b/manager/dispatcher/dispatcher.go
@@ -676,16 +676,20 @@ func (d *Dispatcher) Session(r *api.SessionRequest, stream api.Dispatcher_Sessio
}
log := log.G(ctx).WithFields(fields)
- nodeUpdates, cancel := state.Watch(d.store.WatchQueue(),
- state.EventUpdateNode{Node: &api.Node{ID: nodeID},
- Checks: []state.NodeCheckFunc{state.NodeCheckID}},
- )
- defer cancel()
-
var nodeObj *api.Node
- d.store.View(func(readTx store.ReadTx) {
+ nodeUpdates, cancel, err := store.ViewAndWatch(d.store, func(readTx store.ReadTx) error {
nodeObj = store.GetNode(readTx, nodeID)
- })
+ return nil
+ }, state.EventUpdateNode{Node: &api.Node{ID: nodeID},
+ Checks: []state.NodeCheckFunc{state.NodeCheckID}},
+ )
+ if cancel != nil {
+ defer cancel()
+ }
+
+ if err != nil {
+ log.WithError(err).Error("ViewAndWatch Node failed")
+ }
if _, err = d.nodes.GetWithSession(nodeID, sessionID); err != nil {
return err | dispatcher: Use an atomic ViewAndWatch for Node in Session. | docker_swarmkit | train | go |
aef3d6fb79c383ca87994b551adff55588a7f680 | diff --git a/src/de/mrapp/android/preference/activity/PreferenceFragment.java b/src/de/mrapp/android/preference/activity/PreferenceFragment.java
index <HASH>..<HASH> 100644
--- a/src/de/mrapp/android/preference/activity/PreferenceFragment.java
+++ b/src/de/mrapp/android/preference/activity/PreferenceFragment.java
@@ -26,7 +26,6 @@ import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceGroup;
-import android.preference.PreferenceManager;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
@@ -287,8 +286,8 @@ public class PreferenceFragment extends android.preference.PreferenceFragment {
* the fragment.
*/
public final void restoreDefaults() {
- SharedPreferences sharedPreferences = PreferenceManager
- .getDefaultSharedPreferences(getActivity());
+ SharedPreferences sharedPreferences = getPreferenceManager()
+ .getSharedPreferences();
restoreDefaults(getPreferenceScreen(), sharedPreferences);
} | Changed the way, the shared preferences are retrieved. | michael-rapp_AndroidPreferenceActivity | train | java |
1548563a24b4c913e368b2a5dc0db123d6cd194a | diff --git a/holoviews/plotting/bokeh/element.py b/holoviews/plotting/bokeh/element.py
index <HASH>..<HASH> 100644
--- a/holoviews/plotting/bokeh/element.py
+++ b/holoviews/plotting/bokeh/element.py
@@ -1380,6 +1380,9 @@ class ElementPlot(BokehPlot, GenericElementPlot):
for cb in self.callbacks:
cb.initialize()
+ if self.top_level:
+ self.init_links()
+
if not self.overlaid:
self._set_active_tools(plot)
self._process_legend() | Initialize links on ElementPlot when it is top-level | pyviz_holoviews | train | py |
e3abc9c7f1146d3c587bca347d32724ab52f5731 | diff --git a/pkg/ipam/ipam.go b/pkg/ipam/ipam.go
index <HASH>..<HASH> 100644
--- a/pkg/ipam/ipam.go
+++ b/pkg/ipam/ipam.go
@@ -104,6 +104,12 @@ func (ipam *IPAM) reserveLocalRoutes() {
continue
}
+ // ignore black hole route
+ if r.Src == nil && r.Gw == nil {
+ log.WithField("route", r).Debugf("Ignoring route: black hole")
+ continue
+ }
+
log.WithField("route", logfields.Repr(r)).Debug("Considering route")
if allocRange.Contains(r.Dst.IP) { | 1: fix when have black hole route container pod CIDR can cause postIpAMFailure range is full | cilium_cilium | train | go |
3ca63d8fce752a1adb3638cf5df6a896fd780323 | diff --git a/src/compiler/parsing/wasm/decoder.js b/src/compiler/parsing/wasm/decoder.js
index <HASH>..<HASH> 100644
--- a/src/compiler/parsing/wasm/decoder.js
+++ b/src/compiler/parsing/wasm/decoder.js
@@ -500,6 +500,9 @@ export function decode(ab: ArrayBuffer, printDump: boolean = false): Program {
id = func.id;
signature = func.signature;
+ } else if (exportTypes[typeIndex] === "Table") {
+ console.warn("Unsupported export type table");
+ return;
} else if (exportTypes[typeIndex] === "Mem") {
const memNode = state.memoriesInModule[index];
@@ -517,7 +520,8 @@ export function decode(ab: ArrayBuffer, printDump: boolean = false): Program {
signature = null;
} else {
- throw new CompileError("Unsupported export type: " + toHex(typeIndex));
+ console.warn("Unsupported export type: " + toHex(typeIndex));
+ return;
}
state.elementsInExportSection.push({ | fix(wasm): don't panic for unsupported table export | xtuc_webassemblyjs | train | js |
f06fb0fad22f4f64dbe95d5ad5e413dd0fb4869e | diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/RulePriority.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/RulePriority.java
index <HASH>..<HASH> 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/RulePriority.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/RulePriority.java
@@ -37,7 +37,9 @@ public enum RulePriority {
*
* @param level an old priority level : Error or Warning
* @return the corresponding RulePriority
+ * @deprecated in 3.6
*/
+ @Deprecated
public static RulePriority valueOfString(String level) {
try {
return RulePriority.valueOf(level.toUpperCase()); | Deprecate RulePriority#valueOfString() used for upgrading to sonar <I> !! | SonarSource_sonarqube | train | java |
81faa66056bca6e3baa0e584567aba5ce3207134 | diff --git a/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLCreateProperty.java b/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLCreateProperty.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLCreateProperty.java
+++ b/core/src/main/java/com/orientechnologies/orient/core/sql/OCommandExecutorSQLCreateProperty.java
@@ -106,9 +106,11 @@ public class OCommandExecutorSQLCreateProperty extends OCommandExecutorSQLAbstra
case EMBEDDED:
case EMBEDDEDMAP:
case EMBEDDEDLIST:
+ case EMBEDDEDSET:
case LINK:
case LINKMAP:
case LINKLIST:
+ case LINKSET:
// See if the parsed word is a keyword if it is not, then we assume it to
// be the linked type/class.
// TODO handle escaped strings. | Added LINKEDSET and EMBEDDEDSET as types with linked class/types. | orientechnologies_orientdb | train | java |
230246441ab38af6c198b4d76107ac8a08eb2f1f | diff --git a/src/tests/testsFoundations/testsDag.py b/src/tests/testsFoundations/testsDag.py
index <HASH>..<HASH> 100644
--- a/src/tests/testsFoundations/testsDag.py
+++ b/src/tests/testsFoundations/testsDag.py
@@ -106,6 +106,16 @@ class AbstractNodeTestCase(unittest.TestCase):
nodeB = AbstractNode()
self.assertEqual(nodeB.name, "Abstract{0}".format(nodeB.identity))
+ def testHash(self):
+ """
+ This method tests :class:`foundations.dag.AbstractNode` class hash consistency.
+ """
+
+ nodeA = AbstractNode("MyNodeA")
+ self.assertEqual(nodeA.identity, nodeA.__hash__())
+ nodeB = AbstractNode("MyNodeB")
+ dictionary = {nodeA : "MyNodeA", nodeB : "MyNodeB"}
+
def testGetNodeByIdentity(self):
"""
This method tests :meth:`foundations.dag.AbstractNode.getNodeByIdentity` method. | Add hash tests for "foundations.dag.AbstractNode" class. | KelSolaar_Foundations | train | py |
962015f7e73a4ffcec4f77fa670b47682edf53b0 | diff --git a/packages/babel-traverse/src/path/ancestry.js b/packages/babel-traverse/src/path/ancestry.js
index <HASH>..<HASH> 100644
--- a/packages/babel-traverse/src/path/ancestry.js
+++ b/packages/babel-traverse/src/path/ancestry.js
@@ -4,8 +4,10 @@ import * as t from "@babel/types";
import NodePath from "./index";
/**
- * Call the provided `callback` with the `NodePath`s of all the parents.
- * When the `callback` returns a truthy value, we return that node path.
+ * Starting at the parent path of the current `NodePath` and going up the
+ * tree, return the first `NodePath` that causes the provided `callback`
+ * to return a truthy value, or `null` if the `callback` never returns a
+ * truthy value.
*/
export function findParent(callback): ?NodePath {
@@ -18,7 +20,8 @@ export function findParent(callback): ?NodePath {
/**
* Starting at current `NodePath` and going up the tree, return the first
- * `NodePath` that causes the provided `callback` to return a truthy value.
+ * `NodePath` that causes the provided `callback` to return a truthy value,
+ * or `null` if the `callback` never returns a truthy value.
*/
export function find(callback): ?NodePath { | docs: updates docs of `findParent` and `find` (#<I>) [skip ci]
Makes the documentation of `findParent` and `find` consistent and documents their `null` cases. | babel_babel | train | js |
a23b3302480a945253b2b7c62901d33b3e883daf | diff --git a/src/Core/Maintenance/System/Command/SystemInstallCommand.php b/src/Core/Maintenance/System/Command/SystemInstallCommand.php
index <HASH>..<HASH> 100644
--- a/src/Core/Maintenance/System/Command/SystemInstallCommand.php
+++ b/src/Core/Maintenance/System/Command/SystemInstallCommand.php
@@ -87,6 +87,12 @@ class SystemInstallCommand extends Command
[
'command' => 'dal:refresh:index',
],
+ [
+ 'command' => 'scheduled-task:register',
+ ],
+ [
+ 'command' => 'plugin:refresh',
+ ],
];
/** @var Application $application */ | NEXT-<I> - Add plugin:refresh and scheduled:task:register to system:install | shopware_platform | train | php |
e3b2e70b21c002434f47fcc140aa2089dcd65925 | diff --git a/tests/_mock.py b/tests/_mock.py
index <HASH>..<HASH> 100644
--- a/tests/_mock.py
+++ b/tests/_mock.py
@@ -7,6 +7,7 @@ Markus Juenemann, 04-Feb-2016
import time
from gpsdshm.shm import MAXCHANNELS
+from gpsdshm import Satellite
class MockFix(object):
def __init__(self):
@@ -38,13 +39,14 @@ class MockDop(object):
self.gdop = 2.4342743978108503
-class MockSatellite(object):
+class MockSatellite(Satellite):
def __init__(self, prn):
- self.ss = 0.0
- self.prn = self.PRN = prn
- self.used = True
- self.elevation = prn
- self.azimuth = prn
+ super(MockSatellite, self).__init__(ss=0.0, used=True, prn=prn, elevation=prn, azimuth=prn)
+ #self.ss = 0.0
+ #self.prn = self.PRN = prn
+ #self.used = True
+ #self.elevation = prn
+ #self.azimuth = prn
class MockShm(object): | Add tests for Satellite() even when mocking. | mjuenema_python-gpsdshm | train | py |
65d617574d67fc1c01ca346329473aed964a2e2d | diff --git a/src/Interfaces/EncryptionInterface.php b/src/Interfaces/EncryptionInterface.php
index <HASH>..<HASH> 100644
--- a/src/Interfaces/EncryptionInterface.php
+++ b/src/Interfaces/EncryptionInterface.php
@@ -16,13 +16,9 @@ interface EncryptionInterface
/**
* EncryptionInterface constructor.
*
- * @throws \PHPSess\Exception\UnknownEncryptionAlgorithmException
- * @throws \PHPSess\Exception\UnknownHashAlgorithmException
- * @param string $appKey Defines the App Key.
- * @param string $hashAlgorithm Defines the algorithm used to create hashes.
- * @param string $encryptionAlgorithm Defines the algorithm to encrypt/decrypt data.
+ * @param string $appKey The app-key that will make part of the encryption key and identifier hash.
*/
- public function __construct(string $appKey, string $hashAlgorithm, string $encryptionAlgorithm);
+ public function __construct(string $appKey);
/**
* Makes a session identifier based on the session id. | Remove hashAlgorithm and encryptionAlgorithm from EncryptionInterface constructor | phpsess_session-handler | train | php |
9d97dfc5dc32490012023f637d06564634ac4e91 | diff --git a/source/interface/getFile.js b/source/interface/getFile.js
index <HASH>..<HASH> 100644
--- a/source/interface/getFile.js
+++ b/source/interface/getFile.js
@@ -7,7 +7,7 @@ const fetch = require("../request.js").fetch;
function getFileContentsBuffer(filePath, options) {
return makeFileRequest(filePath, options).then(function(res) {
- return res.buffer();
+ return res.arrayBuffer();
});
}
diff --git a/test/specs/getFileContents.spec.js b/test/specs/getFileContents.spec.js
index <HASH>..<HASH> 100644
--- a/test/specs/getFileContents.spec.js
+++ b/test/specs/getFileContents.spec.js
@@ -1,5 +1,3 @@
-"use strict";
-
const path = require("path");
const fs = require("fs"); | Update .buffer to .arrayBuffer | perry-mitchell_webdav-client | train | js,js |
8e00fd58596a471ddf1019c6169433b00aa32e80 | diff --git a/queue.go b/queue.go
index <HASH>..<HASH> 100644
--- a/queue.go
+++ b/queue.go
@@ -235,6 +235,8 @@ func (queue *redisQueue) AddBatchConsumer(tag string, batchSize int, consumer Ba
return queue.AddBatchConsumerWithTimeout(tag, batchSize, defaultBatchTimeout, consumer)
}
+// Timeout limits the amount of time waiting to fill an entire batch
+// The timer is only started when the first message in a batch is received
func (queue *redisQueue) AddBatchConsumerWithTimeout(tag string, batchSize int, timeout time.Duration, consumer BatchConsumer) string {
name := queue.addConsumer(tag)
go queue.consumerBatchConsume(batchSize, timeout, consumer) | Adding comment about batched timeout behaviour | adjust_rmq | train | go |
24a768ceb2789ac11e6db9d6b1fd93e48c10b997 | diff --git a/src/js/Menus/MenuButton.js b/src/js/Menus/MenuButton.js
index <HASH>..<HASH> 100644
--- a/src/js/Menus/MenuButton.js
+++ b/src/js/Menus/MenuButton.js
@@ -174,6 +174,8 @@ export default class MenuButton extends PureComponent {
buttonId,
menuStyle,
menuClassName,
+ listStyle,
+ listClassName,
buttonChildren,
children,
fullWidth,
@@ -185,6 +187,7 @@ export default class MenuButton extends PureComponent {
...props
} = this.props;
delete props.onClick;
+ delete props.onMenuToggle;
delete props.defaultOpen;
const toggle = (
@@ -204,6 +207,8 @@ export default class MenuButton extends PureComponent {
listId={listId}
style={menuStyle}
className={menuClassName}
+ listStyle={listStyle}
+ listClassName={listClassName}
toggle={toggle}
isOpen={isOpen}
onClose={this._closeMenu} | Updated MenuButton to pass correct props
The MenuButton was not actually passing the listStyle and listClassName
props correctly to the Menu. Also removed the onMenuToggle prop from the
remaining props passed to the button. Closes #<I> | mlaursen_react-md | train | js |
fdb88bac7e34ec8b93d36cdc967c1d89759efe25 | diff --git a/src/cmd/serial.js b/src/cmd/serial.js
index <HASH>..<HASH> 100644
--- a/src/cmd/serial.js
+++ b/src/cmd/serial.js
@@ -1559,7 +1559,7 @@ module.exports = class SerialCommand {
message: 'Which device did you mean?',
choices: devices.map((d) => {
return {
- name: d.port + ' - ' + d.type,
+ name: d.port + ' - ' + d.type + ' - ' + d.deviceId,
value: d
};
}) | Add Device ID to the serial identify command. | particle-iot_particle-cli | train | js |
9e8efe95cb89aa7cd8805a31635b5545c7e6865e | diff --git a/spec/stream_spec.rb b/spec/stream_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/stream_spec.rb
+++ b/spec/stream_spec.rb
@@ -15,8 +15,8 @@ describe T::Stream do
context '--csv' do
before :each do
@stream.options = @stream.options.merge("csv" => true)
- @tweetstream_client.stub(:on_timeline_status)
- .and_yield(fixture("status.json"))
+ @tweetstream_client.stub(:on_timeline_status).
+ and_yield(fixture("status.json"))
end
it "should output in CSV format" do | fix build failure in Ruby <I> | sferik_t | train | rb |
be2089949c9e80b674c83c762fbceb473302d737 | diff --git a/mode/go/go.js b/mode/go/go.js
index <HASH>..<HASH> 100644
--- a/mode/go/go.js
+++ b/mode/go/go.js
@@ -86,7 +86,7 @@ CodeMirror.defineMode("go", function(config) {
var escaped = false, next, end = false;
while ((next = stream.next()) != null) {
if (next == quote && !escaped) {end = true; break;}
- escaped = !escaped && next == "\\";
+ escaped = !escaped && quote != "`" && next == "\\";
}
if (end || !(escaped || quote == "`"))
state.tokenize = tokenBase; | [go mode] Better handle raw strings
Don't treat backslashes specially inside of them
Closes #<I> | codemirror_CodeMirror | train | js |
56fcc364f7567c2f42879e8d054007f0313182b3 | diff --git a/demos/s3server/s3server.py b/demos/s3server/s3server.py
index <HASH>..<HASH> 100644
--- a/demos/s3server/s3server.py
+++ b/demos/s3server/s3server.py
@@ -221,7 +221,7 @@ class ObjectHandler(BaseRequestHandler):
self.set_header("Content-Type", "application/unknown")
self.set_header("Last-Modified", datetime.datetime.utcfromtimestamp(
info.st_mtime))
- object_file = open(path, "r")
+ object_file = open(path, "rb")
try:
self.finish(object_file.read())
finally: | Fix s3server.py to stop truncating downloads of images and other non-text files | tornadoweb_tornado | train | py |
4a712712840e4ef5b75a3a06fee89839bc6e5b43 | diff --git a/io.go b/io.go
index <HASH>..<HASH> 100644
--- a/io.go
+++ b/io.go
@@ -36,20 +36,13 @@ func Cat(filenames ...string) Filter {
// for debugging.
func WriteLines(writer io.Writer) Filter {
return FilterFunc(func(arg Arg) error {
- b := bufio.NewWriter(writer)
for s := range arg.In {
- if _, err := b.Write([]byte(s)); err != nil {
- return err
- }
- if err := b.WriteByte('\n'); err != nil {
+ if _, err := writer.Write(append([]byte(s),'\n')); err != nil {
return err
}
arg.Out <- s
- if err := b.Flush(); err != nil {
- return err
- }
}
- return b.Flush()
+ return nil
})
} | Removed write buffer from WriteLines | ghemawat_stream | train | go |
592eb4b8efb06f0be782537a3d733d58f746c233 | diff --git a/compose.go b/compose.go
index <HASH>..<HASH> 100644
--- a/compose.go
+++ b/compose.go
@@ -13,7 +13,7 @@ type ComposeTarget interface {
// ComposeMethod is a Porter-Duff composition method.
type ComposeMethod int
-// Here's the list of all available Porter-Duff composition methods. User ComposeOver for the basic
+// Here's the list of all available Porter-Duff composition methods. Use ComposeOver for the basic
// alpha blending.
const (
ComposeOver ComposeMethod = iota | fix type in ComposeMethod doc | faiface_pixel | train | go |
cb9aecbf040f7f5f4c69ce9b90d22c590391fdbf | diff --git a/plugins/outputs/kafka/kafka.go b/plugins/outputs/kafka/kafka.go
index <HASH>..<HASH> 100644
--- a/plugins/outputs/kafka/kafka.go
+++ b/plugins/outputs/kafka/kafka.go
@@ -56,7 +56,7 @@ var sampleConfig = `
## Kafka topic for producer messages
topic = "telegraf"
## Telegraf tag to use as a routing key
- ## ie, if this tag exists, it's value will be used as the routing key
+ ## ie, if this tag exists, its value will be used as the routing key
routing_tag = "host"
## CompressionCodec represents the various compression codecs recognized by
@@ -93,7 +93,7 @@ var sampleConfig = `
# insecure_skip_verify = false
## Data format to output.
- ## Each data format has it's own unique set of configuration options, read
+ ## Each data format has its own unique set of configuration options, read
## more about them here:
## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
data_format = "influx" | it's -> its (#<I>) | influxdata_telegraf | train | go |
3950f262f170ee563cff417975897378030bbf8b | diff --git a/src/Bkwld/Decoy/Models/Base.php b/src/Bkwld/Decoy/Models/Base.php
index <HASH>..<HASH> 100644
--- a/src/Bkwld/Decoy/Models/Base.php
+++ b/src/Bkwld/Decoy/Models/Base.php
@@ -244,8 +244,7 @@ abstract class Base extends Eloquent {
* Find by the slug and fail if missing. Like "findOrFail()" but use the slug column instead
*/
static public function findBySlugOrFail($slug) {
- if ($row = self::findBySlug($slug)) return $row;
- throw new ModelNotFoundException(get_called_class().' model not found');
+ return static::where('slug', '=', $slug)->firstOrFail();
}
//--------------------------------------------------------------------------- | Making use of an Eloquent method for findBySlugOrFail | BKWLD_decoy | train | php |
c97e53efe1a9741bb8762659aaac339961318b73 | diff --git a/examples/with-sentry/next.config.js b/examples/with-sentry/next.config.js
index <HASH>..<HASH> 100644
--- a/examples/with-sentry/next.config.js
+++ b/examples/with-sentry/next.config.js
@@ -21,6 +21,7 @@ const COMMIT_SHA =
VERCEL_BITBUCKET_COMMIT_SHA
process.env.SENTRY_DSN = SENTRY_DSN
+const basePath = ''
module.exports = withSourceMaps({
serverRuntimeConfig: {
@@ -63,12 +64,12 @@ module.exports = withSourceMaps({
include: '.next',
ignore: ['node_modules'],
stripPrefix: ['webpack://_N_E/'],
- urlPrefix: '~/_next',
+ urlPrefix: `~${basePath}/_next`,
release: COMMIT_SHA,
})
)
}
-
return config
},
+ basePath,
}) | basePath should also append in urlPrefix (#<I>)
Fix <URL> | zeit_next.js | train | js |
40cdfb6f90fbadda0408488853c6f20acea2cb70 | diff --git a/core/model/src/main/java/it/unibz/inf/ontop/iq/node/impl/LeftJoinNodeImpl.java b/core/model/src/main/java/it/unibz/inf/ontop/iq/node/impl/LeftJoinNodeImpl.java
index <HASH>..<HASH> 100644
--- a/core/model/src/main/java/it/unibz/inf/ontop/iq/node/impl/LeftJoinNodeImpl.java
+++ b/core/model/src/main/java/it/unibz/inf/ontop/iq/node/impl/LeftJoinNodeImpl.java
@@ -914,6 +914,18 @@ public class LeftJoinNodeImpl extends JoinLikeNodeImpl implements LeftJoinNode {
.map(s -> s.composeWith(ascendingSubstitution))
.orElse(ascendingSubstitution);
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (!(o instanceof ChildLiftingState))
+ return false;
+
+ ChildLiftingState other = (ChildLiftingState) o;
+ return leftChild.isEquivalentTo(other.leftChild)
+ && rightChild.isEquivalentTo(other.rightChild)
+ && ljCondition.equals(other.ljCondition)
+ && ascendingSubstitution.equals(other.ascendingSubstitution);
+ }
}
/** | LeftJoin binding lift can now converge. | ontop_ontop | train | java |
1f9b5a3ca1094d0d587c220d2c22cd06f703107b | diff --git a/Webpage/MenuEntry/MenuEntry.php b/Webpage/MenuEntry/MenuEntry.php
index <HASH>..<HASH> 100644
--- a/Webpage/MenuEntry/MenuEntry.php
+++ b/Webpage/MenuEntry/MenuEntry.php
@@ -9,7 +9,7 @@ use vxPHP\Webpage\MenuEntry\MenuEntryInterface;
* MenuEntry class
* manages a single menu entry
*
- * @version 0.3.1 2013-09-09
+ * @version 0.3.2 2013-09-12
*/
class MenuEntry implements MenuEntryInterface {
protected static $count = 1;
@@ -114,11 +114,16 @@ class MenuEntry implements MenuEntryInterface {
}
if($GLOBALS['config']->site->use_nice_uris == 1) {
- $script = basename($this->menu->getScript(), '.php') . '/';
- if($script == 'index') {
+
+ if(($script = basename($this->menu->getScript(), '.php')) == 'index') {
$script = '';
}
+
+ else {
+ $script .= '/';
+ }
}
+
else {
$script = $this->menu->getScript() . '/';
} | Bugfix: with nice URIs the script name was not filtered properly | Vectrex_vxPHP | train | php |
33b32d87cd68290d70329b106530fbc82b608ec8 | diff --git a/framework/messages/pt-PT/yii.php b/framework/messages/pt-PT/yii.php
index <HASH>..<HASH> 100644
--- a/framework/messages/pt-PT/yii.php
+++ b/framework/messages/pt-PT/yii.php
@@ -1,4 +1,4 @@
-<?php
+<?php
/**
* Message translations.
* | Removed U+FEFF character from pt-PT language file to fixe #<I> | yiisoft_yii-core | train | php |
d9deeba582b64b75e249f6ecd86768e5a49e22a6 | diff --git a/lib/devise/controllers/sign_in_out.rb b/lib/devise/controllers/sign_in_out.rb
index <HASH>..<HASH> 100644
--- a/lib/devise/controllers/sign_in_out.rb
+++ b/lib/devise/controllers/sign_in_out.rb
@@ -6,7 +6,10 @@ module Devise
# Included by default in all controllers.
module SignInOut
# Return true if the given scope is signed in session. If no scope given, return
- # true if any scope is signed in. Does not run authentication hooks.
+ # true if any scope is signed in. This will run authentication hooks, which may
+ # cause exceptions to be thrown from this method; if you simply want to check
+ # if a scope has already previously been authenticated without running
+ # authentication hooks, you can directly call `warden.authenticated?(scope: scope)`
def signed_in?(scope=nil)
[scope || Devise.mappings.keys].flatten.any? do |_scope|
warden.authenticate?(scope: _scope) | Fix `signed_in?` docs w.r.t. running auth hooks (#<I>)
Addresses #<I>
The docs previously mentioned that authentication hooks are not run when `signed_in?` is called, when in fact they are. This commit fixes the comment and suggests calling `authenticated?` on warden directly as an alternative for when you _don't_ want to run auth hooks. | plataformatec_devise | train | rb |
cdb36a3bf2882414f66e7ca637a67a9e2df48a3a | diff --git a/src/ol/format/IIIFInfo.js b/src/ol/format/IIIFInfo.js
index <HASH>..<HASH> 100644
--- a/src/ol/format/IIIFInfo.js
+++ b/src/ol/format/IIIFInfo.js
@@ -286,6 +286,7 @@ class IIIFInfo {
/**
* @param {Object|string} imageInfo Deserialized image information JSON response
* object or JSON response as string
+ * @api
*/
setImageInfo(imageInfo) {
if (typeof imageInfo == 'string') {
@@ -297,6 +298,7 @@ class IIIFInfo {
/**
* @returns {Versions} Major IIIF version.
+ * @api
*/
getImageApiVersion() {
if (this.imageInfo === undefined) {
@@ -395,6 +397,7 @@ class IIIFInfo {
/**
* @param {PreferredOptions} opt_preferredOptions Optional options for preferred format and quality.
* @returns {import("../source/IIIF.js").Options} IIIF tile source ready constructor options.
+ * @api
*/
getTileSourceOptions(opt_preferredOptions) {
const options = opt_preferredOptions || {}, | Expose IIIFInfo methods for doc | openlayers_openlayers | train | js |
ad168ba88c8d18b3755f3c49ced4cb6c34248fc7 | diff --git a/spacy/__init__.py b/spacy/__init__.py
index <HASH>..<HASH> 100644
--- a/spacy/__init__.py
+++ b/spacy/__init__.py
@@ -30,6 +30,7 @@ def load(name, **overrides):
else:
model_path = util.ensure_path(overrides['path'])
data_path = model_path.parent
+ model_name = ''
meta = util.parse_package_meta(data_path, model_name, require=False)
lang = meta['lang'] if meta and 'lang' in meta else name
cls = util.get_lang_class(lang) | Set model name to empty string if path override exists
Required for parse_package_meta, which composes path of data_path and
model_name (needs to be fixed in the future) | explosion_spaCy | train | py |
c8dd6fe75138442f9c6be1c63bc72c301e8dc835 | diff --git a/src/React/Widgets/AnnotationEditorWidget/index.js b/src/React/Widgets/AnnotationEditorWidget/index.js
index <HASH>..<HASH> 100644
--- a/src/React/Widgets/AnnotationEditorWidget/index.js
+++ b/src/React/Widgets/AnnotationEditorWidget/index.js
@@ -47,7 +47,7 @@ export default function annotationEditorWidget(props) {
};
const onAnnotationChange = (event) => {
- const value = event.target.value;
+ const value = (event.target.type === 'number') ? +event.target.value : event.target.value;
const name = event.target.name;
const type = event.type; | fix(AnnotationEditorWidget): convert 'weight' to number
Make sure the 'weight' parameter is coverted to a number,
by checking for input type==='number'. | Kitware_paraviewweb | train | js |
f6aa70acddc3ab529c63c8265036d22336f26ab2 | diff --git a/core/model.js b/core/model.js
index <HASH>..<HASH> 100644
--- a/core/model.js
+++ b/core/model.js
@@ -36,7 +36,7 @@ exports.ModelUpdate.prototype._find = function(index) {
if (index != 0)
throw new Error('invalid index ' + index)
- return { index: i - 1, offset: 0 }
+ return { index: i - 1, offset: range.length }
}
exports.ModelUpdate.prototype.reset = function(model) { | return real index and offset == length for last segment | pureqml_qmlcore | train | js |
d75739fc8ddce7e938fe96e2649ce6a01064b1b5 | diff --git a/Kwf/User/Auth/PasswordFields.php b/Kwf/User/Auth/PasswordFields.php
index <HASH>..<HASH> 100644
--- a/Kwf/User/Auth/PasswordFields.php
+++ b/Kwf/User/Auth/PasswordFields.php
@@ -67,7 +67,6 @@ class Kwf_User_Auth_PasswordFields extends Kwf_User_Auth_Abstract implements Kwf
} else {
throw new Kwf_Exception_NotYetImplemented('hashing type not yet implemented');
}
- $row->activate_token = '';
return true;
} | Fix problem with password-auth-methods and activation-auth-method
password-auth-method resets activation_token. There is
clearActivationToken for this purpose. | koala-framework_koala-framework | train | php |
c374ba17537c0ce9ef78a3a9247d1a2a65908827 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -156,12 +156,13 @@ class Vimeo extends React.Component {
}
render() {
- const { id, className } = this.props;
+ const { id, className, style } = this.props;
return (
<div
id={id}
className={className}
+ style={style}
ref={this.refContainer}
/>
);
@@ -186,6 +187,10 @@ if (process.env.NODE_ENV !== 'production') {
*/
className: PropTypes.string,
/**
+ * Inline style for container element.
+ */
+ style: PropTypes.object,
+ /**
* Width of the player element.
*/
width: PropTypes.oneOfType([ | add styling prop to container (#<I>) | u-wave_react-vimeo | train | js |
0b857452149f4cf70604feb671a6edca5c3c5806 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -2,6 +2,11 @@ import React from 'react'
const withGesture = Wrapped =>
class extends React.Component {
+ static defaultProps = {
+ touch: true,
+ mouse: true
+ }
+
state = {
x: 0,
y: 0,
@@ -16,6 +21,7 @@ const withGesture = Wrapped =>
// Touch handlers
handleTouchStart = e => {
+ if (!this.props.touch) return
window.addEventListener('touchmove', this.handleTouchMove)
window.addEventListener('touchend', this.handleTouchEnd)
this.handleDown(e.touches[0])
@@ -31,6 +37,7 @@ const withGesture = Wrapped =>
// Mouse handlers
handleMouseDown = e => {
+ if (!this.props.mouse) return
window.addEventListener('mousemove', this.handleMouseMoveRaf)
window.addEventListener('mouseup', this.handleMouseUp)
this.handleDown(e) | Add touch/mouse props to optionally disable specific events | react-spring_react-use-gesture | train | js |
03730458b861459f3c0a2fd85401085fccee7894 | diff --git a/src/migrations/config-server.js b/src/migrations/config-server.js
index <HASH>..<HASH> 100644
--- a/src/migrations/config-server.js
+++ b/src/migrations/config-server.js
@@ -15,10 +15,10 @@ const migrations = [
const newSchema = {
...schema,
version: 1,
- ha_boolean: 'y|yes|true|on|home|open',
- rejectUnauthorizedCerts: true,
- connectionDelay: true,
- cacheJson: true,
+ ha_boolean: schema.ha_boolean || 'y|yes|true|on|home|open',
+ rejectUnauthorizedCerts: schema.rejectUnauthorizedCerts || true,
+ connectionDelay: schema.connectionDelay || true,
+ cacheJson: schema.cacheJson || true,
};
return newSchema;
}, | refactor: Use existing values for config-server during version 1 migration | zachowj_node-red-contrib-home-assistant-websocket | train | js |
c975e30f3a290d342bc0c3e6a9f262ada7d19afd | diff --git a/commands/filter.py b/commands/filter.py
index <HASH>..<HASH> 100644
--- a/commands/filter.py
+++ b/commands/filter.py
@@ -33,7 +33,8 @@ def cmd(send, msg, args):
"removevowels": textutils.removevowels,
"binary": textutils.gen_binary,
"xkcd": textutils.do_xkcd_sub,
- "praise": textutils.gen_praise
+ "praise": textutils.gen_praise,
+ "reverse": textutils.reverse
}
if args['type'] == 'privmsg':
send('Ahamilto wants to know all about your doings!')
diff --git a/helpers/textutils.py b/helpers/textutils.py
index <HASH>..<HASH> 100644
--- a/helpers/textutils.py
+++ b/helpers/textutils.py
@@ -196,3 +196,7 @@ def do_xkcd_sub(msg, hook=False):
return None if hook else msg
else:
return output
+
+
+def reverse(msg):
+ return msg[::-1] | re-add !filter reverse | tjcsl_cslbot | train | py,py |
86af8e7a8315464aa86520d7bee9278aeb70c0f4 | diff --git a/Request/ParamFetcher.php b/Request/ParamFetcher.php
index <HASH>..<HASH> 100644
--- a/Request/ParamFetcher.php
+++ b/Request/ParamFetcher.php
@@ -222,7 +222,7 @@ class ParamFetcher implements ParamFetcherInterface
$config->requirements
),
));
- }else{
+ } else {
$constraint = new Regex(array(
'pattern' => '#^'.$config->requirements["rule"].'$#xsu',
'message' => $config->requirements["error_message"]
@@ -241,9 +241,9 @@ class ParamFetcher implements ParamFetcherInterface
if (0 !== count($errors)) {
if ($strict) {
- if(isset($config->requirements["error_message"])){
+ if (isset($config->requirements["error_message"])) {
$errorMessage = $config->requirements["error_message"];
- }else{
+ } else {
$errorMessage = $this->violationFormatter->formatList($config, $errors);
}
throw new BadRequestHttpException($errorMessage); | clean ups for code standarts. | FriendsOfSymfony_FOSRestBundle | train | php |
8120b40a8d33c4ada64222e85c006f3769013990 | diff --git a/grails-plugin-url-mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/DefaultUrlMappingInfo.java b/grails-plugin-url-mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/DefaultUrlMappingInfo.java
index <HASH>..<HASH> 100644
--- a/grails-plugin-url-mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/DefaultUrlMappingInfo.java
+++ b/grails-plugin-url-mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/DefaultUrlMappingInfo.java
@@ -51,7 +51,7 @@ public class DefaultUrlMappingInfo extends AbstractUrlMappingInfo implements Url
private UrlMappingData urlData;
private Object viewName;
private ServletContext servletContext;
- private static final String SETTING_GRAILS_WEB_DISABLE_MULTIPART = "grails.web.disable.multipart";
+ private static final String SETTING_GRAILS_WEB_DISABLE_MULTIPART = "grails.disableCommonsMultipart";
private boolean parsingRequest;
private Object uri; | GRAILS-<I> made the property names consistent | grails_grails-core | train | java |
25e079583d56b451d6138ac1ea6e58afa7b331f1 | diff --git a/go/cmd/vtgate/vtgate.go b/go/cmd/vtgate/vtgate.go
index <HASH>..<HASH> 100644
--- a/go/cmd/vtgate/vtgate.go
+++ b/go/cmd/vtgate/vtgate.go
@@ -12,7 +12,6 @@ import (
"github.com/youtube/vitess/go/vt/servenv"
"github.com/youtube/vitess/go/vt/topo"
"github.com/youtube/vitess/go/vt/vtgate"
- _ "github.com/youtube/vitess/go/vt/zktopo"
)
var ( | make vtgate topo agnostic
Topo server support is controlled by plugins. Not everyone needs
zookeeper support. | vitessio_vitess | train | go |
6ee855dd3c392beba28e7701a111e6ded7cd9b74 | diff --git a/src/SslClient.py b/src/SslClient.py
index <HASH>..<HASH> 100644
--- a/src/SslClient.py
+++ b/src/SslClient.py
@@ -6,7 +6,7 @@ from X509Certificate import X509Certificate
DEFAULT_BUFFER_SIZE = 4096
-class SslClient:
+class SslClient(object):
"""
High level API implementing an SSL client.
""" | make SslClient an object | nabla-c0d3_nassl | train | py |
f1484df4b8dd180a2ec56c93ad4eed4beef7b0b1 | diff --git a/upup/pkg/fi/cloudup/alitasks/rampolicy.go b/upup/pkg/fi/cloudup/alitasks/rampolicy.go
index <HASH>..<HASH> 100644
--- a/upup/pkg/fi/cloudup/alitasks/rampolicy.go
+++ b/upup/pkg/fi/cloudup/alitasks/rampolicy.go
@@ -103,12 +103,10 @@ func (_ *RAMPolicy) RenderALI(t *aliup.ALIAPITarget, a, e, changes *RAMPolicy) e
return fmt.Errorf("error rendering PolicyDocument: %v", err)
}
- policyRequest := ram.PolicyRequest{}
-
if a == nil {
klog.V(2).Infof("Creating RAMPolicy with Name:%q", fi.StringValue(e.Name))
- policyRequest = ram.PolicyRequest{
+ policyRequest := ram.PolicyRequest{
PolicyName: fi.StringValue(e.Name),
PolicyDocument: policy,
PolicyType: ram.Type(fi.StringValue(e.PolicyType)), | upup/pkg/fi/cloudup/alitasks/rampolicy: Fix ineffectual assignment to policyRequest | kubernetes_kops | train | go |
e399cfbe370df0c7a1cb57d350f01f8eb378dd64 | diff --git a/lib/diarize/speaker.rb b/lib/diarize/speaker.rb
index <HASH>..<HASH> 100644
--- a/lib/diarize/speaker.rb
+++ b/lib/diarize/speaker.rb
@@ -62,9 +62,7 @@ module Diarize
end
def rdf_mapping
- {
- 'ws:gender' => gender,
- }
+ { 'ws:gender' => gender }
end
protected | Closing the mapping in speaker model | bbc_diarize-jruby | train | rb |
a0fb6e4e56013b91e57ce387db34ec58e6588967 | diff --git a/tests/codeception/_support/WorkingSilex.php b/tests/codeception/_support/WorkingSilex.php
index <HASH>..<HASH> 100644
--- a/tests/codeception/_support/WorkingSilex.php
+++ b/tests/codeception/_support/WorkingSilex.php
@@ -49,4 +49,10 @@ class WorkingSilex extends Silex
$this->client = new Client($this->app, [], null, $this->cookieJar);
$this->client->followRedirects();
}
+
+ protected function clientRequest($method, $uri, array $parameters = [], array $files = [], array $server = [], $content = null, $changeHistory = true)
+ {
+ $this->reloadApp();
+ return parent::clientRequest($method, $uri, $parameters, $files, $server, $content, $changeHistory);
+ }
} | [Codeception] Reload the app for every request. | bolt_bolt | train | php |
205496ce0624800d192d51a95b86a34e3bc79ae7 | diff --git a/src/Seboettg/CiteProc/Rendering/Text.php b/src/Seboettg/CiteProc/Rendering/Text.php
index <HASH>..<HASH> 100644
--- a/src/Seboettg/CiteProc/Rendering/Text.php
+++ b/src/Seboettg/CiteProc/Rendering/Text.php
@@ -91,7 +91,12 @@ class Text implements Rendering
break;
case 'variable':
if ($this->toRenderTypeValue === "citation-number") {
- $renderedText = $citationNumber + 1;
+ $var = "citation-number";
+ if (isset($data->$var)) {
+ $renderedText = $data->$var;
+ } else {
+ $renderedText = $citationNumber + 1;
+ }
break;
}
@@ -192,4 +197,4 @@ class Text implements Rendering
}
return $page;
}
-}
\ No newline at end of file
+} | Update Text.php
Why do we need it? Cos when we are trying to render a citation and it is part of a number of bibliography but it's not the number 1 we will be able to send the field "citation-number" and render with it. | seboettg_citeproc-php | train | php |
eb11212a341c063cb804adc808553fd0cf158330 | diff --git a/Eloquent/Relations/Concerns/CanBeOneOfMany.php b/Eloquent/Relations/Concerns/CanBeOneOfMany.php
index <HASH>..<HASH> 100644
--- a/Eloquent/Relations/Concerns/CanBeOneOfMany.php
+++ b/Eloquent/Relations/Concerns/CanBeOneOfMany.php
@@ -137,7 +137,7 @@ trait CanBeOneOfMany
{
return $this->ofMany(collect(Arr::wrap($column))->mapWithKeys(function ($column) {
return [$column => 'MAX'];
- })->all(), 'MAX', $relation ?: $this->guessRelationship());
+ })->all(), 'MAX', $relation);
}
/**
@@ -152,7 +152,7 @@ trait CanBeOneOfMany
{
return $this->ofMany(collect(Arr::wrap($column))->mapWithKeys(function ($column) {
return [$column => 'MIN'];
- })->all(), 'MIN', $relation ?: $this->guessRelationship());
+ })->all(), 'MIN', $relation);
}
/** | ofMany to decide relationship name when it is null (#<I>) | illuminate_database | train | php |
f46dacc516566a2ad63157f2e7fff27f47987162 | diff --git a/lib/lcg.js b/lib/lcg.js
index <HASH>..<HASH> 100644
--- a/lib/lcg.js
+++ b/lib/lcg.js
@@ -20,6 +20,8 @@
'use strict';
+var Buffer = require('buffer').Buffer;
+
function LCG(seed) {
var self = this;
if (typeof seed === 'number') { | linting: [lib/lcg] comply with no-undef rule | uber_tchannel-node | train | js |
d1ba798ec7a4b3f3c4678f0a107e05aba36a6f0e | diff --git a/tests/test_SlocusPop.py b/tests/test_SlocusPop.py
index <HASH>..<HASH> 100644
--- a/tests/test_SlocusPop.py
+++ b/tests/test_SlocusPop.py
@@ -143,6 +143,10 @@ class testPythonObjects(unittest.TestCase):
self.assertEqual(up.popdata_user, self.pop.generation)
self.assertEqual(self.pop, up)
+ def testMutationLookupTable(self):
+ for i in self.pop.mut_lookup:
+ self.assertEqual(i[0], pop.mutations[i[1]].pos)
+
if __name__ == "__main__":
unittest.main() | add test for contents of Population.mut_lookup | molpopgen_fwdpy11 | train | py |
2f0177710581a6c90f7eeed199a2eab048ab2da8 | diff --git a/tools/vcli/bw/repl/repl.go b/tools/vcli/bw/repl/repl.go
index <HASH>..<HASH> 100644
--- a/tools/vcli/bw/repl/repl.go
+++ b/tools/vcli/bw/repl/repl.go
@@ -201,7 +201,7 @@ func REPL(driver storage.Store, input *os.File, rl ReadLiner, chanSize, bulkSize
if len(table.Bindings()) > 0 {
fmt.Println(table.String())
}
- fmt.Println("[OK] Time spent: ", time.Now().Sub(now))
+ fmt.Printf("[OK] %d rows retrived. Time spent: %v.\n", table.NumRows(), time.Now().Sub(now))
}
done <- false
} | Add row number of row results to BQL | google_badwolf | train | go |
761e18f70ab637522e6e8e4c537432761b78fd73 | diff --git a/lib/coral_core.rb b/lib/coral_core.rb
index <HASH>..<HASH> 100644
--- a/lib/coral_core.rb
+++ b/lib/coral_core.rb
@@ -142,7 +142,15 @@ coral_require(core_dir, :core)
#---
# Include core utilities
-[ :cli, :disk, :process, :batch, :shell, :ssh ].each do |name|
+[ :liquid,
+ :cli,
+ :disk,
+ :process,
+ :batch,
+ :package,
+ :shell,
+ :ssh
+].each do |name|
coral_require(util_dir, name)
end | Loading new utility classes in the coral loader. | coralnexus_corl | train | rb |
85ae4c90bf0d183e49d7e764240a5861b64cf235 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -126,7 +126,7 @@ if (typeof window !== 'undefined' && window.Vue) {
};
module.exports = {
- version: '1.0.0-rc.4',
+ version: '1.0.0-rc.5',
install,
SelectDropdown,
Pagination, | [build] <I>-rc<I> | ElemeFE_element | train | js |
aab2fa1e7ef1765f73b02eb3a93f84c2c1a891d0 | diff --git a/src/Message/AbstractRequest.php b/src/Message/AbstractRequest.php
index <HASH>..<HASH> 100644
--- a/src/Message/AbstractRequest.php
+++ b/src/Message/AbstractRequest.php
@@ -181,7 +181,8 @@ abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest
if ($discountItems->getPrice() < 0) {
$discount = $discounts->addChild('discount');
$discount->addChild('fixed', $discountItems->getPrice() * -1);
- $discount->addChild('description',htmlspecialchars($discountItems->getName(),ENT_QUOTES,"UTF-8"));
+ $discount->
+ addChild('description', htmlspecialchars($discountItems->getName(), ENT_QUOTES, "UTF-8"));
}
}
} | addChild on a new line | thephpleague_omnipay-sagepay | train | php |
c095efba01e1a160a3d71687706529388080b16b | diff --git a/src/feat/database/query.py b/src/feat/database/query.py
index <HASH>..<HASH> 100644
--- a/src/feat/database/query.py
+++ b/src/feat/database/query.py
@@ -379,6 +379,19 @@ class BaseQueryViewController(object):
return dict(startkey=(field, ), endkey=(field, {}))
+class KeepValueController(BaseQueryViewController):
+ '''
+ Use this controller if you want to define a field which later you can
+ query with include_values paramater.
+ This is usefull for loading collations.
+ '''
+
+ keeps_value = True
+
+ def parse_view_result(self, rows):
+ return [(x[2], x[0][1]) for x in rows]
+
+
class HighestValueFieldController(BaseQueryViewController):
'''
Use this controller to extract the value of a joined field. | Implement a view query controller making it easy to extract data
from the index. | f3at_feat | train | py |
49e76ecf58dc2601e147e373ae5957019c03febb | diff --git a/builtin/providers/google/resource_pubsub_subscription.go b/builtin/providers/google/resource_pubsub_subscription.go
index <HASH>..<HASH> 100644
--- a/builtin/providers/google/resource_pubsub_subscription.go
+++ b/builtin/providers/google/resource_pubsub_subscription.go
@@ -75,7 +75,7 @@ func resourcePubsubSubscriptionCreate(d *schema.ResourceData, meta interface{})
var ackDeadlineSeconds int64
ackDeadlineSeconds = 10
if v, ok := d.GetOk("ack_deadline_seconds"); ok {
- ackDeadlineSeconds = v.(int64)
+ ackDeadlineSeconds = int64(v.(int))
}
var subscription *pubsub.Subscription | google_pubsub_subscription crashes when ack_deadline_seconds is provided | hashicorp_terraform | train | go |
3017e9de84cff40be65e61af880c72b634aa1980 | diff --git a/src/Response/GetLogResponse.php b/src/Response/GetLogResponse.php
index <HASH>..<HASH> 100644
--- a/src/Response/GetLogResponse.php
+++ b/src/Response/GetLogResponse.php
@@ -53,11 +53,11 @@ class GetLogResponse extends AbstractResponse
$this->account = EntityFactory::createAccount($data['account']);
}
if (array_key_exists('log', $data)) {
- $log = $data['log'];
- if (!is_array($log)) {
- $log = [];
+ $tmpLog = $data['log'];
+ if (!is_array($tmpLog)) {
+ $tmpLog = [];
}
- $this->log = $log;
+ $this->log = $tmpLog;
}
} | Fix sonar - rename variable which has the same name as field | adshares_ads-php-client | train | php |
7ed1e4466e1996ce4933859e79364b2189dc6aea | diff --git a/js/feature-tier.js b/js/feature-tier.js
index <HASH>..<HASH> 100644
--- a/js/feature-tier.js
+++ b/js/feature-tier.js
@@ -116,7 +116,9 @@ DasTier.prototype.styleForFeature = function(f) {
}
if (sh.type) {
if (sh.type == 'default') {
- maybe = sh.style;
+ if (!maybe) {
+ maybe = sh.style;
+ }
continue;
} else if (sh.type != f.type) {
continue; | Tweak to style-precedences. | dasmoth_dalliance | train | js |
f7459a1536447bcbf6dfbd5a4c8a718a13f20142 | diff --git a/salt/modules/virtualenv_mod.py b/salt/modules/virtualenv_mod.py
index <HASH>..<HASH> 100644
--- a/salt/modules/virtualenv_mod.py
+++ b/salt/modules/virtualenv_mod.py
@@ -274,7 +274,7 @@ def create(path,
return ret
-def _install_script(source, cwd, python, runas, ret):
+def _install_script(source, cwd, python, runas):
env = 'base'
if not salt.utils.is_windows():
tmppath = salt.utils.mkstemp(dir=cwd) | We're no longer passing `ret`. Remove it from args. | saltstack_salt | train | py |
fce236d1cd49a133a5843e8daf70236207591642 | diff --git a/colly.go b/colly.go
index <HASH>..<HASH> 100644
--- a/colly.go
+++ b/colly.go
@@ -837,6 +837,11 @@ func (c *Collector) OnScraped(f ScrapedCallback) {
c.lock.Unlock()
}
+// SetClient will override the previously set http.Client
+func (c *Collector) SetClient(client *http.Client) {
+ c.backend.Client = client
+}
+
// WithTransport allows you to set a custom http.RoundTripper (transport)
func (c *Collector) WithTransport(transport http.RoundTripper) {
c.backend.Client.Transport = transport | Add SetClient to set custom http client
So we can use http client and cookie jar across collectors and outside collector | gocolly_colly | train | go |
fe2a2ccfa48a21985892282c3e68dd747e7ae7ce | diff --git a/packages/styled-components/src/sheet/Rehydration.js b/packages/styled-components/src/sheet/Rehydration.js
index <HASH>..<HASH> 100644
--- a/packages/styled-components/src/sheet/Rehydration.js
+++ b/packages/styled-components/src/sheet/Rehydration.js
@@ -5,7 +5,7 @@ import { getIdForGroup, setGroupForId } from './GroupIDAllocator';
import type { Sheet } from './types';
const SELECTOR = `style[${SC_ATTR}][${SC_ATTR_VERSION}="${SC_VERSION}"]`;
-const RULE_RE = /(?:\s*)?(.*?){((?:{[^}]*}|(?!{).*?)*?)}/g;
+const RULE_RE = /(?:\s*)?(.*?){((?:{[^}]*}|(?!{).*?)*)}/g;
const MARKER_RE = new RegExp(`^${SC_ATTR}\\.g(\\d+)\\[id="([\\w\\d-]+)"\\]`);
export const outputSheet = (sheet: Sheet) => { | adjust rehydration regex to handle deeply-nested MQs (#<I>)
fixes #<I> | styled-components_styled-components | train | js |
f421ce0636621693d6d7f2d94e1cd78eb5ffb923 | diff --git a/retrieval/scrape.go b/retrieval/scrape.go
index <HASH>..<HASH> 100644
--- a/retrieval/scrape.go
+++ b/retrieval/scrape.go
@@ -47,12 +47,11 @@ var (
},
[]string{"interval"},
)
- targetSkippedScrapes = prometheus.NewCounterVec(
+ targetSkippedScrapes = prometheus.NewCounter(
prometheus.CounterOpts{
Name: "prometheus_target_skipped_scrapes_total",
Help: "Total number of scrapes that were skipped because the metric storage was throttled.",
},
- []string{"interval"},
)
targetReloadIntervalLength = prometheus.NewSummaryVec(
prometheus.SummaryOpts{
@@ -430,7 +429,7 @@ func (sl *scrapeLoop) run(interval, timeout time.Duration, errc chan<- error) {
sl.report(start, time.Since(start), len(samples), err)
last = start
} else {
- targetSkippedScrapes.WithLabelValues(interval.String()).Inc()
+ targetSkippedScrapes.Inc()
}
select { | Remove label from prometheus_target_skipped_scrapes_total (#<I>)
This avoids it not being intialised, and breaking out by
interval wasn't partiuclarly useful.
Fixes #<I> | prometheus_prometheus | train | go |
92721e730685956358bfdd0f4d3f106079916912 | diff --git a/synapse/lib/service.py b/synapse/lib/service.py
index <HASH>..<HASH> 100644
--- a/synapse/lib/service.py
+++ b/synapse/lib/service.py
@@ -128,8 +128,6 @@ class SvcProxy:
self._addSvcTufo(svcfo)
- self.fire('syn:svc:init', svcfo=svcfo)
-
def _addSvcTufo(self, svcfo):
iden = svcfo[0]
@@ -147,8 +145,6 @@ class SvcProxy:
self.bytag.pop(svcfo[0])
self.byiden.pop(svcfo[0],None)
- self.fire('syn:svc:fini', svcfo=svcfo)
-
def getSynSvc(self, iden):
'''
Return the tufo for the specified svc iden ( or None ). | svcproxy is not an eventbus | vertexproject_synapse | train | py |
bb4d4c17aa98bacaf7ada1627543d7623c3ff49b | diff --git a/src/Storage/Mapping/MetadataDriver.php b/src/Storage/Mapping/MetadataDriver.php
index <HASH>..<HASH> 100644
--- a/src/Storage/Mapping/MetadataDriver.php
+++ b/src/Storage/Mapping/MetadataDriver.php
@@ -209,6 +209,15 @@ class MetadataDriver implements MappingDriver
];
if ($data['type']==='repeater') {
+
+ foreach ($data['fields'] as $key => &$value) {
+ if (isset($this->typemap[$value['type']])) {
+ $value['fieldtype'] = $this->typemap[$value['type']];
+ } else {
+ $value['fieldtype'] = $this->typemap['text'];
+ }
+ }
+
$this->metadata[$className]['fields'][$key] = $mapping;
$this->metadata[$className]['fields'][$key]['data'] = $data;
}
@@ -354,8 +363,9 @@ class MetadataDriver implements MappingDriver
/**
* Get the field type for a given column.
*
- * @param string $name
+ * @param string $name
* @param \Doctrine\DBAL\Schema\Column $column
+ * @return string
*/
protected function getFieldTypeFor($name, $column)
{ | improve metadata setup for rpeating fields | bolt_bolt | 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.