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 |
|---|---|---|---|---|---|
c8423930fec8ea4dec678307e881b715f9f34920 | diff --git a/canvasapi/communication_channel.py b/canvasapi/communication_channel.py
index <HASH>..<HASH> 100644
--- a/canvasapi/communication_channel.py
+++ b/canvasapi/communication_channel.py
@@ -161,7 +161,7 @@ class CommunicationChannel(CanvasObject):
try:
if not bool(value['frequency']):
return False
- except:
+ except KeyError:
return False
kwargs['notification_preferences'] = notification_preferences | added KeyError specific exception to make linters happy | ucfopen_canvasapi | train | py |
79afcb6b37ad4c543ff3c77578177a04770baf18 | diff --git a/lib/phusion_passenger/packaging.rb b/lib/phusion_passenger/packaging.rb
index <HASH>..<HASH> 100644
--- a/lib/phusion_passenger/packaging.rb
+++ b/lib/phusion_passenger/packaging.rb
@@ -63,8 +63,8 @@ module Packaging
'lib/phusion_passenger/templates/*',
'lib/phusion_passenger/templates/apache2/*',
'lib/phusion_passenger/templates/nginx/*',
- 'lib/phusion_passenger/templates/lite/*',
- 'lib/phusion_passenger/templates/lite_default_root/*',
+ 'lib/phusion_passenger/templates/standalone/*',
+ 'lib/phusion_passenger/templates/standalone_default_root/*',
'bin/*',
'doc/**/*',
'man/*', | Oops, fix packaging of Phusion Passenger Standalone. | phusion_passenger | train | rb |
4b1cb363439eff4ed6a478d8334dd0a23736cb91 | diff --git a/examples/nautilus.py b/examples/nautilus.py
index <HASH>..<HASH> 100755
--- a/examples/nautilus.py
+++ b/examples/nautilus.py
@@ -37,7 +37,7 @@ class ChooseHandler(object):
def __init__(self, config, video, subtitles):
self.config = config
self.video = video
- self.subtitles = {s.id: s for s in subtitles}
+ self.subtitles = {s.provider_name + '-' + s.id: s for s in subtitles}
def on_subtitles_treeview_row_activated(self, treeview, path, view_column):
model = treeview.get_model()
@@ -48,7 +48,7 @@ class ChooseHandler(object):
return
# get the subtitle object
- subtitle = self.subtitles[model.get_value(iter, 0)]
+ subtitle = self.subtitles[model.get_value(iter, 3).lower() + '-' + model.get_value(iter, 0)]
# download the subtitle
with ProviderPool(providers=self.config.providers, provider_configs=self.config.provider_configs) as pool: | Make sure dict keys are unique in nautilus | Diaoul_subliminal | train | py |
2a0c2be24c9855d937ff03824d7fc86df6311fe7 | diff --git a/src/Hashing/BcryptHashing.php b/src/Hashing/BcryptHashing.php
index <HASH>..<HASH> 100644
--- a/src/Hashing/BcryptHashing.php
+++ b/src/Hashing/BcryptHashing.php
@@ -47,7 +47,7 @@ class BcryptHashing extends AbstractHashing
{
$this->setCost($options['cost']);
- $this->verifyAlgorithm = $options['verify'];
+ $this->verifyAlgorithm = (isset($options['verify'])) ? $options['verify'] : false;
}
/** | Update BcryptHashing.php | zestframework_Zest_Framework | train | php |
602c43e8028b434b2e8a836fc236284708cf3401 | diff --git a/app/Module/StoriesModule.php b/app/Module/StoriesModule.php
index <HASH>..<HASH> 100644
--- a/app/Module/StoriesModule.php
+++ b/app/Module/StoriesModule.php
@@ -168,7 +168,7 @@ class StoriesModule extends AbstractModule implements ModuleConfigInterface, Mod
*/
public function isGrayedOut(Individual $individual): bool
{
- return $this->getStoriesForIndividual($individual) !== [];
+ return $this->getStoriesForIndividual($individual) === [];
}
/** | Tab should be grayed out when the array is empty (#<I>) | fisharebest_webtrees | train | php |
5dc252053a39eff2d42bff71ca8a6e534001d5b5 | diff --git a/cmd/env.go b/cmd/env.go
index <HASH>..<HASH> 100644
--- a/cmd/env.go
+++ b/cmd/env.go
@@ -857,7 +857,8 @@ func printPropertyValueDiff(b *bytes.Buffer, title func(string), diff resource.V
printPropertyValue(b, delete, deleteIndent(newIndent))
b.WriteString(colors.Reset)
} else if update, isupdate := a.Updates[i]; isupdate {
- printPropertyValueDiff(b, title, update, causedReplace, indent)
+ title(indent)
+ printPropertyValueDiff(b, func(string) {}, update, causedReplace, newIndent)
} else {
title(indent)
printPropertyValue(b, a.Sames[i], newIndent) | Fix a slight diffing formatting bug | pulumi_pulumi | train | go |
c66ab773e116d1eec3ac409a423bffeaae74dddf | diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index <HASH>..<HASH> 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -5,6 +5,7 @@ $loader = require dirname(__DIR__) . '/vendor/autoload.php';
/** @var $loader \Composer\Autoload\ClassLoader */
$loader->addPsr4('BEAR\Package\\', __DIR__);
$loader->addPsr4('FakeVendor\HelloWorld\\', __DIR__ . '/Fake/FakeVendor/HelloWorld/src');
+\Doctrine\Common\Annotations\AnnotationRegistry::registerLoader([$loader, 'loadClass']);
$_ENV['TEST_DIR'] = __DIR__;
$_ENV['TMP_DIR'] = __DIR__ . '/tmp'; | add annotation loader at tests/bootstrap | bearsunday_BEAR.Package | train | php |
5da5b32603f3996eee81ea0699dc04c0250cf862 | diff --git a/spec/lib/matchers/include.rb b/spec/lib/matchers/include.rb
index <HASH>..<HASH> 100644
--- a/spec/lib/matchers/include.rb
+++ b/spec/lib/matchers/include.rb
@@ -4,7 +4,7 @@ module Matchers; module Include
matcher :include_in_any_order do |*matchers|
match do |enumerable|
@not_matched = []
- expected.each do |matcher|
+ expected_as_array.each do |matcher|
if enumerable.empty?
break
end | (PUP-<I>) Update to use expected_as_array in rspec 3 | puppetlabs_puppet | train | rb |
47faf0f32d675021a3ed35133e8e9a1452ee56d7 | diff --git a/values.js b/values.js
index <HASH>..<HASH> 100644
--- a/values.js
+++ b/values.js
@@ -12,7 +12,7 @@ ValueStream.prototype.resume = function () {
while(!this.sink.paused && !(this.ended = this._i >= this._values.length))
this.sink.write(this._values[this._i++])
- if(this.ended && !this.sink.paused && !this.sink.ended)
+ if(this.ended && !this.sink.ended)
this.sink.end()
} | ended does not wait for unpaused | push-stream_push-stream | train | js |
be398236e2f07e9cfe25def72b10f0cbea6fd5bd | diff --git a/documentation-website/src/client/Guides/GettingStarted.js b/documentation-website/src/client/Guides/GettingStarted.js
index <HASH>..<HASH> 100644
--- a/documentation-website/src/client/Guides/GettingStarted.js
+++ b/documentation-website/src/client/Guides/GettingStarted.js
@@ -27,17 +27,16 @@ export default ({ name }) => (
</p>
<PrismBlock lang='javascript'>
{
-`import Browser from '@hickory/browser';
-import Hash from '@hickory/hash';
-import InMemory from '@hickory/in-memory';
-
-// Use Browser when your website has a dynamic server
+`// Use Browser when your website has a dynamic server
+import Browser from '@hickory/browser';
const browserHistory = Browser();
// Use Hash when your website uses a static file server
+import Hash from '@hickory/hash';
const hashHistory = Hash();
// Use InMemory when your application doesn't run in a browser
+import InMemory from '@hickory/in-memory';
const memoryHistory = InMemory();`
}
</PrismBlock> | (Docs) Tweak Getting started guide [ci skip] | pshrmn_curi | train | js |
4e64684358f9d1073d236d354f8368d01f31bf14 | diff --git a/lib/foreigner/connection_adapters/sql2003.rb b/lib/foreigner/connection_adapters/sql2003.rb
index <HASH>..<HASH> 100644
--- a/lib/foreigner/connection_adapters/sql2003.rb
+++ b/lib/foreigner/connection_adapters/sql2003.rb
@@ -47,10 +47,7 @@ module Foreigner
def proper_table_name(to_table)
if ActiveRecord::Migration.instance_methods(false).include? :proper_table_name
- ActiveRecord::Migration.new.proper_table_name(to_table, options = {
- table_name_prefix: ActiveRecord::Base.table_name_prefix,
- table_name_suffix: ActiveRecord::Base.table_name_suffix
- })
+ ActiveRecord::Migration.new.proper_table_name(to_table)
else
ActiveRecord::Migrator.proper_table_name(to_table)
end | (maybe I don't need to explicitly send in the prefix and suffix?) | matthuhiggins_foreigner | train | rb |
8c05167bc6441f5c3a5d4276afb71bcb1ab8ffaa | diff --git a/tests/Token/IncludeTest.php b/tests/Token/IncludeTest.php
index <HASH>..<HASH> 100644
--- a/tests/Token/IncludeTest.php
+++ b/tests/Token/IncludeTest.php
@@ -73,8 +73,8 @@ class PHP_Reflect_Token_IncludeTest extends PHPUnit_Framework_TestCase
}
/**
- * @covers PHP_TokenIncludes::getName
- * @covers PHP_TokenIncludes::getType
+ * @covers PHP_Reflect_Token_Includes::getName
+ * @covers PHP_Reflect_Token_Includes::getType
*/
public function testGetIncludes()
{
@@ -85,8 +85,8 @@ class PHP_Reflect_Token_IncludeTest extends PHPUnit_Framework_TestCase
}
/**
- * @covers PHP_TokenIncludes::getName
- * @covers PHP_TokenIncludes::getType
+ * @covers PHP_Reflect_Token_Includes::getName
+ * @covers PHP_Reflect_Token_Includes::getType
*/
public function testGetIncludesCategorized()
{ | FIX typo errors on classnames covers | llaville_php-reflect | train | php |
ead082882ed5eaebffde891e7ab6cddc8448d33f | diff --git a/galpy/potential/NumericalPotentialDerivativesMixin.py b/galpy/potential/NumericalPotentialDerivativesMixin.py
index <HASH>..<HASH> 100644
--- a/galpy/potential/NumericalPotentialDerivativesMixin.py
+++ b/galpy/potential/NumericalPotentialDerivativesMixin.py
@@ -10,9 +10,11 @@ class NumericalPotentialDerivativesMixin(object):
def _Rforce(self,R,z,phi=0.,t=0.):
# Do forward difference because R cannot be negative
RplusdR= R+self._dR
- dR= RplusdR-R
- return (self._evaluate(R,z,phi=phi,t=t)
- -self._evaluate(RplusdR,z,phi=phi,t=t))/dR
+ Rplus2dR= R+2.*self._dR
+ dR= (Rplus2dR-R)/2.
+ return (1.5*self._evaluate(R,z,phi=phi,t=t)
+ -2.*self._evaluate(RplusdR,z,phi=phi,t=t)
+ +0.5*self._evaluate(Rplus2dR,z,phi=phi,t=t))/dR
def _zforce(self,R,z,phi=0.,t=0.):
# Central difference to get derivative at z=0 right | Switch to 2nd-order forward difference method for numerical R derivative | jobovy_galpy | train | py |
5b669faa805602bcb114bb5680d72121c878491a | diff --git a/hazelcast/src/main/java/com/hazelcast/examples/TestApp.java b/hazelcast/src/main/java/com/hazelcast/examples/TestApp.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/main/java/com/hazelcast/examples/TestApp.java
+++ b/hazelcast/src/main/java/com/hazelcast/examples/TestApp.java
@@ -1152,12 +1152,12 @@ public class TestApp implements EntryListener, ItemListener, MessageListener {
silent = silentBefore;
}
- void println(Object obj) {
+ public void println(Object obj) {
if (!silent)
System.out.println(obj);
}
- void print(Object obj) {
+ public void print(Object obj) {
if (!silent)
System.out.print(obj);
} | made print methods public in order to be able to override
git-svn-id: <URL> | hazelcast_hazelcast | train | java |
e784371a260ae3cb5043b47caa90ed99b7a7abec | diff --git a/simulator/src/main/java/com/hazelcast/simulator/agent/workerjvm/WorkerJvmFailureMonitor.java b/simulator/src/main/java/com/hazelcast/simulator/agent/workerjvm/WorkerJvmFailureMonitor.java
index <HASH>..<HASH> 100644
--- a/simulator/src/main/java/com/hazelcast/simulator/agent/workerjvm/WorkerJvmFailureMonitor.java
+++ b/simulator/src/main/java/com/hazelcast/simulator/agent/workerjvm/WorkerJvmFailureMonitor.java
@@ -229,7 +229,7 @@ public class WorkerJvmFailureMonitor {
Response response = agentConnector.write(SimulatorAddress.COORDINATOR, operation);
if (response.getFirstErrorResponseType() != ResponseType.SUCCESS) {
LOGGER.error(format("Could not send failure to coordinator! %s", operation));
- } else {
+ } else if (isFailure) {
LOGGER.info("Failure successfully sent to Coordinator!");
}
} catch (SimulatorProtocolException e) { | Suppressed "Failure successfully sent to Coordinator" Agent logs for normally finished workers. | hazelcast_hazelcast-simulator | train | java |
97e0ae64ce3a31a0b358ccfe1571c25467407153 | diff --git a/travis_docs_builder.py b/travis_docs_builder.py
index <HASH>..<HASH> 100644
--- a/travis_docs_builder.py
+++ b/travis_docs_builder.py
@@ -183,3 +183,26 @@ def commit_docs(*, built_docs='docs/_build/html', gh_pages_docs='docs', tmp_dir=
run(['git', 'push', '-q', 'origin_token', 'gh-pages'])
else:
print("The docs have not changed. Not updating")
+
+if __name__ == '__main__':
+ on_travis = os.environ.get("TRAVIS_JOB_NUMBER", '')
+
+ if on_travis:
+ # TODO: Get this automatically
+ repo = sys.argv[1]
+ setup_GitHub_push()
+ commit_docs()
+ else:
+ repo = input("What repo to you want to build the docs for? ")
+ username = input("What is your GitHub username? ")
+
+ token = generate_GitHub_token(username)
+ encrypted_variable = encrypt_variable("GH_TOKEN={token}".format(token=token), repo=repo)
+ travis_content = """
+env:
+ global:
+ secure: "{encrypted_variable}
+
+""".format(encrypted_variable=encrypted_variable)
+
+ print("Put", travis_content, "in your .travis.yml") | First pass at running the command (not tested yet) | drdoctr_doctr | train | py |
47126f2d68b8b9ac7cd7adbfb0abdeb56a37cd04 | diff --git a/bcbio/install.py b/bcbio/install.py
index <HASH>..<HASH> 100644
--- a/bcbio/install.py
+++ b/bcbio/install.py
@@ -212,7 +212,8 @@ def _update_conda_packages():
"""If installed in an anaconda directory, upgrade conda packages.
"""
conda_bin = _get_conda_bin()
- assert conda_bin, "Could not find anaconda distribution for upgrading bcbio"
+ assert conda_bin, ("Could not find anaconda distribution for upgrading bcbio.\n"
+ "Using python at %s but could not find conda." % (os.path.realpath(sys.executable)))
req_file = "bcbio-update-requirements.txt"
if os.path.exists(req_file):
os.remove(req_file) | Better error message for not finding conda install
Tries to provide better clues for debugging install problems #<I> | bcbio_bcbio-nextgen | train | py |
2a6ebcbad0599e039d268917e530be6f9bf77929 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -3,6 +3,7 @@
let Service, Characteristic;
const request = require("request");
const async = require("async");
+const packageJSON = require('./package.json');
module.exports = function (homebridge) {
Service = homebridge.hap.Service;
@@ -61,7 +62,7 @@ HTTP_SWITCH.prototype = {
.setCharacteristic(Characteristic.Manufacturer, "Andreas Bauer")
.setCharacteristic(Characteristic.Model, "HTTP Switch")
.setCharacteristic(Characteristic.SerialNumber, "SW01")
- .setCharacteristic(Characteristic.FirmwareRevision, "0.3.1");
+ .setCharacteristic(Characteristic.FirmwareRevision, packageJSON.version);
return [informationService, this.homebridgeService];
}, | Automatically reflect current package version in FirmwareRevision characteristic | Supereg_homebridge-http-switch | train | js |
c69f3db607f7b283f41faf99d176683a0aa4afdf | diff --git a/app/src/Bolt/CronEvent.php b/app/src/Bolt/CronEvent.php
index <HASH>..<HASH> 100644
--- a/app/src/Bolt/CronEvent.php
+++ b/app/src/Bolt/CronEvent.php
@@ -50,7 +50,6 @@ class CronEvent extends Event
}
}
-
/**
* Hourly jobs
*/
@@ -58,7 +57,6 @@ class CronEvent extends Event
{
}
-
/**
* Daily jobs
*/
@@ -67,7 +65,6 @@ class CronEvent extends Event
// Check for Bolt updates
}
-
/**
* Weekly jobs
*/
@@ -82,7 +79,6 @@ class CronEvent extends Event
$this->notify("Trimming logs");
}
-
/**
* Monthly jobs
*/
@@ -90,7 +86,6 @@ class CronEvent extends Event
{
}
-
/**
* Yearly jobs
*/
@@ -98,7 +93,6 @@ class CronEvent extends Event
{
}
-
/**
* If we're passed an OutputInterface, we're called from Nut and can notify
* the end user | PSR-2 clean up of CronEvent.php | bolt_bolt | train | php |
7c8fef9ee06acca35816ffa4bc312f8541378c19 | diff --git a/lib/Drawer/Item.js b/lib/Drawer/Item.js
index <HASH>..<HASH> 100644
--- a/lib/Drawer/Item.js
+++ b/lib/Drawer/Item.js
@@ -59,7 +59,6 @@ const styles = {
},
icon: {
position: 'relative',
- top: -1
},
value: {
flex: 1, | Final Fix : Drawer menu items are not centered | xotahal_react-native-material-ui | train | js |
9cc4b7687c906ca526a06fc24313ee606a538f0d | diff --git a/pypd/mixins.py b/pypd/mixins.py
index <HASH>..<HASH> 100644
--- a/pypd/mixins.py
+++ b/pypd/mixins.py
@@ -92,7 +92,7 @@ class ClientMixin(object):
if add_headers is not None:
headers.update(**add_headers)
- for k, v in query_params.items():
+ for k, v in query_params.copy().items():
if isinstance(v, stringtype):
continue
elif isinstance(v, Number):
diff --git a/test/unit/clientmixin.py b/test/unit/clientmixin.py
index <HASH>..<HASH> 100644
--- a/test/unit/clientmixin.py
+++ b/test/unit/clientmixin.py
@@ -83,5 +83,15 @@ class ClientMixinTestCase(unittest.TestCase):
headers=''
)
+ def test_statuses_array(self, m):
+ method = 'GET'
+ body = {'status': 'OK'}
+ url = '%s?statuses[]=triggered&statuses[]=acknowledged' % self.url
+ m.register_uri(method, url, json=body)
+ result = self.requester.request(method, self.endpoint,
+ query_params={'statuses': ['triggered',
+ 'acknowledged']})
+ self.assertEqual(body, result)
+
if __name__ == '__main__':
unittest.main() | Python3 reevaluates the map at each iteration of the loop, use a copy of query_params to avoid reprocessing already seen items | PagerDuty_pagerduty-api-python-client | train | py,py |
abb47983917eba302634587395533d8b36c1394a | diff --git a/staging/src/k8s.io/kubelet/config/v1beta1/types.go b/staging/src/k8s.io/kubelet/config/v1beta1/types.go
index <HASH>..<HASH> 100644
--- a/staging/src/k8s.io/kubelet/config/v1beta1/types.go
+++ b/staging/src/k8s.io/kubelet/config/v1beta1/types.go
@@ -327,10 +327,10 @@ type KubeletConfiguration struct {
// status to master if node status does not change. Kubelet will ignore this
// frequency and post node status immediately if any change is detected. It is
// only used when node lease feature is enabled. nodeStatusReportFrequency's
- // default value is 1m. But if nodeStatusUpdateFrequency is set explicitly,
+ // default value is 5m. But if nodeStatusUpdateFrequency is set explicitly,
// nodeStatusReportFrequency's default value will be set to
// nodeStatusUpdateFrequency for backward compatibility.
- // Default: "1m"
+ // Default: "5m"
// +optional
NodeStatusReportFrequency metav1.Duration `json:"nodeStatusReportFrequency,omitempty"`
// nodeLeaseDurationSeconds is the duration the Kubelet will set on its corresponding Lease, | bump NodeStatusReportFrequency default value to 5min in comment | kubernetes_kubernetes | train | go |
9d506eb0c6df33e1df48131ea9486588a914e310 | diff --git a/src/Sylius/Bundle/CoreBundle/Command/InstallSampleDataCommand.php b/src/Sylius/Bundle/CoreBundle/Command/InstallSampleDataCommand.php
index <HASH>..<HASH> 100644
--- a/src/Sylius/Bundle/CoreBundle/Command/InstallSampleDataCommand.php
+++ b/src/Sylius/Bundle/CoreBundle/Command/InstallSampleDataCommand.php
@@ -52,7 +52,7 @@ EOT
$outputStyle->writeln(sprintf(
'Loading sample data for environment <info>%s</info> from suite <info>%s</info>.',
$this->getEnvironment(),
- $suite
+ $suite ?? 'default'
));
$outputStyle->writeln('<error>Warning! This action will erase your database.</error>');
@@ -72,10 +72,10 @@ EOT
return 1;
}
- $parameters = ['--no-interaction' => true];
- if (null !== $suite) {
- $parameters['suite'] = $suite;
- }
+ $parameters = [
+ 'suite' => $suite,
+ '--no-interaction' => true,
+ ];
$commands = [
'sylius:fixtures:load' => $parameters, | Added: Suggested fixes | Sylius_Sylius | train | php |
0064f3cfbb68168b6fa3313083b0a735c5f4d970 | diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php
index <HASH>..<HASH> 100644
--- a/lib/outputrenderers.php
+++ b/lib/outputrenderers.php
@@ -2511,7 +2511,10 @@ EOD;
if ($item->hidden) {
$link->add_class('dimmed');
}
- $link->text = $content.$link->text; // add help icon
+ if (!empty($content)) {
+ // Providing there is content we will use that for the link content.
+ $link->text = $content;
+ }
$content = $this->render($link);
} else if ($item->action instanceof moodle_url) {
$attributes = array();
@@ -2896,4 +2899,4 @@ class core_renderer_ajax extends core_renderer {
* @param string $id
*/
public function heading($text, $level = 2, $classes = 'main', $id = null) {}
-}
\ No newline at end of file
+} | MDL-<I> navigation: Fixed up issue when rendering action_link instances for the navigation | moodle_moodle | train | php |
3509165fe0413192f18ddd46e0eaccd15ad02c7c | diff --git a/Helper/Logger.php b/Helper/Logger.php
index <HASH>..<HASH> 100644
--- a/Helper/Logger.php
+++ b/Helper/Logger.php
@@ -69,7 +69,7 @@ class Logger
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/checkoutcom_magento2.log');
$logger = new \Zend\Log\Logger();
$logger->addWriter($writer);
- $logger->info(json_encode($msg, JSON_PRETTY_PRINT));
+ $logger->info($msg);
}
}
@@ -93,7 +93,13 @@ class Logger
);
if ($debug && $gatewayResponses) {
- $output = json_encode($response, JSON_PRETTY_PRINT);
+ // Prepare the output
+ $output = json_encode(
+ json_decode($response),
+ JSON_PRETTY_PRINT
+ );
+
+ // Display the content
$this->messageManager->addComplexSuccessMessage(
'ckoMessages',
['output' => $output] | Updated the logger class outputs | checkout_checkout-magento2-plugin | train | php |
10c9d69c451ce19d6385315f05d85cea476fa5c4 | diff --git a/dragonlib/utils/logging_utils.py b/dragonlib/utils/logging_utils.py
index <HASH>..<HASH> 100755
--- a/dragonlib/utils/logging_utils.py
+++ b/dragonlib/utils/logging_utils.py
@@ -66,7 +66,7 @@ def setup_logging(level, logger_name=None, handler=None, log_formatter=None):
root_logger.info("Set %i level to logger %r", level, logger_name)
if level == 100:
- logger.handlers = ()
+ logger.handlers = (logging.NullHandler(),)
logger.disabled = True
return | Bugfix disable logging:
in logging is something like:
if len(root.handlers) == 0:
basicConfig()
;) | 6809_dragonlib | train | py |
1195406a447bb60ea01202a7837fc78a22a9c6a7 | diff --git a/lib/Doctrine/Common/Proxy/ProxyGenerator.php b/lib/Doctrine/Common/Proxy/ProxyGenerator.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/Common/Proxy/ProxyGenerator.php
+++ b/lib/Doctrine/Common/Proxy/ProxyGenerator.php
@@ -7,7 +7,6 @@ use Doctrine\Common\Proxy\Exception\UnexpectedValueException;
use Doctrine\Common\Util\ClassUtils;
use Doctrine\Persistence\Mapping\ClassMetadata;
use ReflectionMethod;
-use ReflectionNamedType;
use ReflectionParameter;
use ReflectionProperty;
use ReflectionType;
@@ -1110,7 +1109,7 @@ EOT;
* @return string
*/
private function formatType(
- ReflectionNamedType $type,
+ ReflectionType $type,
ReflectionMethod $method,
?ReflectionParameter $parameter = null
) { | Loosen up type constraint from ReflectionNamedType to ReflectionType. | doctrine_common | train | php |
8445f04b2416abe8f98abc1e28b59c9277d4d130 | diff --git a/src/biojs-io-biom.js b/src/biojs-io-biom.js
index <HASH>..<HASH> 100644
--- a/src/biojs-io-biom.js
+++ b/src/biojs-io-biom.js
@@ -590,5 +590,6 @@ export class Biom {
throw new Error('The given biomString is not in json format and no conversion server is specified.\n' + e.message);
}
}
+ return new Biom(json_obj);
}
} | Add return of the newly created biom object | molbiodiv_biojs-io-biom | train | js |
168885101a742ce0fde762e7a0be4109dc920922 | diff --git a/scapy/layers/dhcp6.py b/scapy/layers/dhcp6.py
index <HASH>..<HASH> 100644
--- a/scapy/layers/dhcp6.py
+++ b/scapy/layers/dhcp6.py
@@ -1169,7 +1169,7 @@ class DHCP6_RelayReply(DHCP6_RelayForward):
return inet_pton(socket.AF_INET6, self.peeraddr)
def answers(self, other):
return (isinstance(other, DHCP6_RelayForward) and
- self.count == other.count and
+ self.hopcount == other.hopcount and
self.linkaddr == other.linkaddr and
self.peeraddr == other.peeraddr ) | Use "hopcount" instead of "count" for DHCPv6 RelayForward msgs. | secdev_scapy | train | py |
251be131d94ee33b1cd9a6c9869c87397624e67f | diff --git a/src/python/twitter/pants/commands/goal.py b/src/python/twitter/pants/commands/goal.py
index <HASH>..<HASH> 100644
--- a/src/python/twitter/pants/commands/goal.py
+++ b/src/python/twitter/pants/commands/goal.py
@@ -452,7 +452,8 @@ if NailgunTask.killall:
# TODO(John Sirois): Resolve eggs
goal(
name='ivy',
- action=IvyResolve
+ action=IvyResolve,
+ dependencies=['gen']
).install('resolve').with_description('Resolves jar dependencies and produces dependency reports.') | Make resolve depend on gen.
This is so any deps injected into synthetic codegen targets
participate in the resolve.
(sapling split of 9bc6d<I>b<I>bc8d<I>f<I>bf<I>fc<I>cf<I>d<I>) | pantsbuild_pants | train | py |
1ab025e40bedc6cb4367e05f5ff406d7726b5717 | diff --git a/structr-core/src/main/java/org/structr/core/script/polyglot/PolyglotWrapper.java b/structr-core/src/main/java/org/structr/core/script/polyglot/PolyglotWrapper.java
index <HASH>..<HASH> 100644
--- a/structr-core/src/main/java/org/structr/core/script/polyglot/PolyglotWrapper.java
+++ b/structr-core/src/main/java/org/structr/core/script/polyglot/PolyglotWrapper.java
@@ -139,17 +139,6 @@ public abstract class PolyglotWrapper {
}
}
- protected static List<Object> wrapIterable(ActionContext actionContext, final Iterable<Object> iterable) {
-
- final List<Object> wrappedList = new ArrayList<>();
-
- for (Object o : iterable) {
-
- wrappedList.add(wrap(actionContext, o));
- }
- return wrappedList;
- }
-
protected static List<Object> unwrapIterable(final ActionContext actionContext, final Iterable<Object> iterable) {
final List<Object> unwrappedList = new ArrayList<>();
@@ -208,6 +197,8 @@ public abstract class PolyglotWrapper {
public FunctionWrapper(final ActionContext actionContext, final Value func) {
+ this.actionContext = actionContext;
+
if (func.canExecute()) {
this.func = func; | Fixes minor issue in polyglot FunctionWrapper. | structr_structr | train | java |
325a50f2bb556d185d77413cf8c6ede7555221d9 | diff --git a/backbone.js b/backbone.js
index <HASH>..<HASH> 100644
--- a/backbone.js
+++ b/backbone.js
@@ -826,6 +826,7 @@
// Get the model at the given index.
at: function(index) {
+ if (index < 0) index += this.length;
return this.models[index];
}, | Allow Collection.at to accept negative indexes
This allows you to do things like
```javascript
mycollection.at(-2) // get second to last, etc.
``` | jashkenas_backbone | train | js |
b5b914e6686a694d84c94481e51733fcf4accc3e | diff --git a/pyemma/_base/serialization/h5file.py b/pyemma/_base/serialization/h5file.py
index <HASH>..<HASH> 100644
--- a/pyemma/_base/serialization/h5file.py
+++ b/pyemma/_base/serialization/h5file.py
@@ -72,7 +72,7 @@ class H5File(object):
# used during saving.
if name in self._parent:
if overwrite:
- logger.info('overwriting model "%s" in file %s', name, self._file.name)
+ logger.info('overwriting model "%s" in file %s', name, self._file.filename)
self.__group = self._parent[name]
del self._current_model_group
else:
@@ -96,7 +96,7 @@ class H5File(object):
# not existent and read only
if model_name not in self._parent and self._file.mode == 'r':
- raise ValueError('model_name "{n}" not found in file {f}'.format(n=model_name, f=self._file.name))
+ raise ValueError('model_name "{n}" not found in file {f}'.format(n=model_name, f=self._file.filename))
self.__group = self._parent.require_group(model_name)
@_current_model_group.deleter | [serialization] fix file name in exceptions | markovmodel_PyEMMA | train | py |
ac5b185347629fc3f4ee7dc0b635451d88658203 | diff --git a/stories/DynamicWidgets.stories.js b/stories/DynamicWidgets.stories.js
index <HASH>..<HASH> 100644
--- a/stories/DynamicWidgets.stories.js
+++ b/stories/DynamicWidgets.stories.js
@@ -22,15 +22,4 @@ storiesOf('ais-dynamic-widgets', module)
],
};
},
- methods: {
- transformItems(_attributes, { results }) {
- if (results._state.query === 'dog') {
- return ['categories'];
- }
- if (results._state.query === 'lego') {
- return ['categories', 'brand'];
- }
- return ['brand', 'hierarchicalCategories.lvl0', 'categories'];
- },
- },
})); | chore(stories): dynamic widgets dashboard usage | algolia_vue-instantsearch | train | js |
1e22c1cc787d6d41aef551137fb3d7660899c0c1 | diff --git a/test/pogoplug/client_test.rb b/test/pogoplug/client_test.rb
index <HASH>..<HASH> 100644
--- a/test/pogoplug/client_test.rb
+++ b/test/pogoplug/client_test.rb
@@ -188,7 +188,6 @@ module PogoPlug
file_to_download = @fileListing.files.select { |f| f.file? }.first
if file_to_download
io = @client.download(@device.id, @service, file_to_download)
- file = ::File.write(file_to_download.name, io, nil, mode: 'wb')
assert_equal(file_to_download.size, io.size, "File should be the same size as the descriptor said it would be")
end
end | no need to write the downloaded file to disk | trumant_pogoplug | train | rb |
cf1bb7cd49e0c60a01e03a94f8a2bb645c11b834 | diff --git a/ImagePanel.py b/ImagePanel.py
index <HASH>..<HASH> 100644
--- a/ImagePanel.py
+++ b/ImagePanel.py
@@ -469,7 +469,7 @@ class InfoOverlayCanvasItem(CanvasItem.AbstractCanvasItem):
drawing_context.fill_text(self.data_item.calibrations[0].convert_to_calibrated_size_str(scale_marker_image_width), origin[1], origin[0] - scale_marker_height - 4)
data_item_properties = self.data_item.properties
info_items = list()
- voltage = data_item_properties.get("voltage", 0)
+ voltage = data_item_properties.get("extra_high_tension", 0)
if voltage:
units = "V"
if voltage % 1000 == 0: | Rename 'voltage' property to 'extra_high_tension'.
svn r<I> | nion-software_nionswift | train | py |
e188b6196024d0939ef27b41b31e2a4d4048d7f5 | diff --git a/spacy/cli/train.py b/spacy/cli/train.py
index <HASH>..<HASH> 100644
--- a/spacy/cli/train.py
+++ b/spacy/cli/train.py
@@ -165,12 +165,9 @@ def train(cmd, lang, output_dir, train_data, dev_data, n_iter=30, n_sents=0,
gpu_wps=gpu_wps)
finally:
print("Saving model...")
- try:
- with (output_path / 'model-final.pickle').open('wb') as file_:
- with nlp.use_params(optimizer.averages):
- dill.dump(nlp, file_, -1)
- except:
- print("Error saving model")
+ with (output_path / 'model-final.pickle').open('wb') as file_:
+ with nlp.use_params(optimizer.averages):
+ dill.dump(nlp, file_, -1)
def _render_parses(i, to_render): | Make cli/train.py not eat exception | explosion_spaCy | train | py |
431a554174b5c6a7ca3f6cbbab3c4adcd3890805 | diff --git a/lib/taskHandlers/action.js b/lib/taskHandlers/action.js
index <HASH>..<HASH> 100644
--- a/lib/taskHandlers/action.js
+++ b/lib/taskHandlers/action.js
@@ -5,7 +5,7 @@ var configStore = require("../configStore");
var {dbErrors} = require("../const");
class PerformAction extends TaskHandlerBase {
- __run(cb, actionDesc, user, args, item) {
+ __run(actionDesc, user, args, item, cb) {
if (actionDesc.hidden(user, item)) {
return cb(new Error("Action is hidden"), null);
}
@@ -45,7 +45,7 @@ class PerformAction extends TaskHandlerBase {
return cb(new Error("Invalid args: request"), null);
}
if (actionDesc.storeAction || storeName === "_nav") {
- return this.__run(cb, actionDesc, user, args);
+ return this.__run(actionDesc, user, args, null, cb);
}
let storeDesc = configStore.getStoreDesc(storeName, user), createBaseIfNotFound = false;
if (storeDesc.type === "single" || storeDesc.display === "single") {
@@ -67,7 +67,7 @@ class PerformAction extends TaskHandlerBase {
return;
}
}
- this.__run(cb, actionDesc, user, args, item);
+ this.__run(actionDesc, user, args, item, cb);
});
}
} | moved cb to the last argument in PerformAction.__run | getblank_blank-node-worker | train | js |
e0abd618cfcc4fd2ded2b2f49e1501ce011361cf | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -23,13 +23,14 @@ def readme():
def version():
- return '0.1.5'
+ return '0.1.6'
setuptools.setup(
name='qj',
description='qj: logging designed for debugging.',
long_description=readme(),
+ long_description_content_type='text/markdown',
version=version(),
url='https://github.com/iansf/qj',
download_url='https://github.com/iansf/qj/archive/%s.tar.gz' % version(),
@@ -39,5 +40,5 @@ setuptools.setup(
license='Apache 2.0',
install_requires=[],
test_suite='nose.collector',
- tests_require=['nose'],
+ tests_require=['nose', 'mock'],
) | Update setup.py for new pypi requirements. Update version to <I>. All tests pass on <I> and <I>. | iansf_qj | train | py |
26c162a302a1b66a43c7958b0a3a0e14aadb3b63 | diff --git a/tests/comment_test.py b/tests/comment_test.py
index <HASH>..<HASH> 100644
--- a/tests/comment_test.py
+++ b/tests/comment_test.py
@@ -38,7 +38,7 @@ class CommentTest(PyPumpTest):
},
"url": "https://example.com/testuser/comment/UOsxSKbITXixW5r_HAyO2A",
"id": "https://example.com/api/comment/UOsxSKbITXixW5r_HAyO2A",
- "liked": False,
+ "liked": True,
"pump_io": {
"shared": False
} | change Comment.liked test to expose bug | xray7224_PyPump | train | py |
770713d08557f8efa57ff47209e7d9f2187b68cc | diff --git a/tests/test_auto_fit.py b/tests/test_auto_fit.py
index <HASH>..<HASH> 100644
--- a/tests/test_auto_fit.py
+++ b/tests/test_auto_fit.py
@@ -282,14 +282,14 @@ class TestAutoFit(unittest.TestCase):
xx, yy = np.meshgrid(xcentres, ycentres, sparse=False, indexing='ij')
x0 = Parameter(value=1.1 * mean[0], min=0.0, max=1.0)
- sig_x = Parameter(1.1 * 0.2, min=0.0, max=0.3)
+ sig_x = Parameter(value=1.1 * 0.2, min=0.0, max=0.3)
y0 = Parameter(value=1.1 * mean[1], min=0.0, max=1.0)
- sig_y = Parameter(1.1 * 0.1, min=0.0, max=0.3)
+ sig_y = Parameter(value=1.1 * 0.1, min=0.0, max=0.3)
A = Parameter(value=1.1 * np.mean(ydata), min=0.0)
b = Parameter(value=1.2 * background, min=0.0)
- x = Variable()
- y = Variable()
- g = Variable()
+ x = Variable('x')
+ y = Variable('y')
+ g = Variable('g')
model = Model({g: A * Gaussian(x, x0, sig_x) * Gaussian(y, y0, sig_y) + b}) | Updated tests to reflect inspectless style | tBuLi_symfit | train | py |
87e1dd9ea40f4f59ad53867b3c08343368139171 | diff --git a/table/policy.go b/table/policy.go
index <HASH>..<HASH> 100644
--- a/table/policy.go
+++ b/table/policy.go
@@ -1100,6 +1100,16 @@ func NewExtCommunitySet(c config.ExtCommunitySet) (*ExtCommunitySet, error) {
}, nil
}
+func (s *ExtCommunitySet) Append(arg DefinedSet) error {
+ err := s.regExpSet.Append(arg)
+ if err != nil {
+ return err
+ }
+ sList := arg.(*ExtCommunitySet).subtypeList
+ s.subtypeList = append(s.subtypeList, sList...)
+ return nil
+}
+
type LargeCommunitySet struct {
regExpSet
} | policy: avoid crash when getting ext-community | osrg_gobgp | train | go |
701756f48fc627ed1f9cef77e6ad887c2e95e0f8 | diff --git a/allauth/socialaccount/providers/discord/views.py b/allauth/socialaccount/providers/discord/views.py
index <HASH>..<HASH> 100644
--- a/allauth/socialaccount/providers/discord/views.py
+++ b/allauth/socialaccount/providers/discord/views.py
@@ -10,9 +10,9 @@ from allauth.socialaccount.providers.oauth2.views import (
class DiscordOAuth2Adapter(OAuth2Adapter):
provider_id = DiscordProvider.id
- access_token_url = 'https://discordapp.com/api/oauth2/token'
- authorize_url = 'https://discordapp.com/api/oauth2/authorize'
- profile_url = 'https://discordapp.com/api/users/@me'
+ access_token_url = 'https://discord.com/api/oauth2/token'
+ authorize_url = 'https://discord.com/api/oauth2/authorize'
+ profile_url = 'https://discord.com/api/users/@me'
def complete_login(self, request, app, token, **kwargs):
headers = { | fix(discord): Switch to new API domain | pennersr_django-allauth | train | py |
79c19e6d1c0baa379ebca7a0703da7ad27f80cc8 | diff --git a/lib/objectFactory.js b/lib/objectFactory.js
index <HASH>..<HASH> 100644
--- a/lib/objectFactory.js
+++ b/lib/objectFactory.js
@@ -14,27 +14,39 @@ var create = function (params) {
*/
var extendThese = params.extends,
- implementsInterfaces = params.implements || [];
+ implementsInterfaces = params.implements || [],
+ constructor = params.constructor;
if (params.extends) {
delete params.extends;
- }
+ };
if (params.implements) {
delete params.implements
- }
+ };
+
+ if (params.constructor) {
+ // Rename the constructor param so it can be added with the
+ // other params
+ params._constructor = params.constructor;
+ delete params.constructor;
+ };
var outp = function (data) {
+ // Run the constructor
+ this._constructor && this._constructor(data);
+
+ // Then add passed params/data
for (var key in data) {
this[key] = data[key];
};
- };
-
+ };
+
outp.prototype._implements = []
// If extends other do first so they get overridden by those passed as params
// Inehrited prototypes with lower index have precedence
- common.extendPrototypeWithThese(outp, extendThese)
+ common.extendPrototypeWithThese(outp, extendThese);
// The rest of the params are added as methods, overriding previous
common.addMembers(outp, params); | Allow passing and inheriting a constructor method, stored as _constructor | jhsware_component-registry | train | js |
deaceab0d58de5b569747406fce1ce2f5674491d | diff --git a/src/fn/DI/Container.php b/src/fn/DI/Container.php
index <HASH>..<HASH> 100644
--- a/src/fn/DI/Container.php
+++ b/src/fn/DI/Container.php
@@ -32,6 +32,8 @@ class Container extends \DI\Container implements MutableDefinitionSource
);
}
parent::__construct($this->definitionSource = $definitionSource, $proxyFactory, $wrapperContainer);
+ $this->resolvedEntries[self::class] = $this;
+ $this->resolvedEntries[static::class] = $this;
}
/**
diff --git a/tests/fixtures/extra-empty/test.php b/tests/fixtures/extra-empty/test.php
index <HASH>..<HASH> 100644
--- a/tests/fixtures/extra-empty/test.php
+++ b/tests/fixtures/extra-empty/test.php
@@ -5,6 +5,10 @@
fn\Composer\di() instanceof fn\Composer\DI || fn\fail(__LINE__);
+call_user_func(require 'vendor/autoload.php', function(fn\Composer\DI $composer, fn\DI\Container $di) {
+ $composer === $di || fn\fail(__LINE__);
+});
+
echo call_user_func(require 'vendor/autoload.php', function(Psr\Container\ContainerInterface $container) {
return get_class($container);
}); | add class fn\DI\Container and every derived class to resolved entries | php-fn_php-fn-di | train | php,php |
0db788bb950b2c2b8ff9c5c9f146a61c68d1fa6d | diff --git a/patroni/ctl.py b/patroni/ctl.py
index <HASH>..<HASH> 100644
--- a/patroni/ctl.py
+++ b/patroni/ctl.py
@@ -1101,7 +1101,7 @@ def edit_config(obj, cluster_name, force, quiet, kvpairs, pgkvpairs, apply_filen
@ctl.command('show-config', help="Show cluster configuration")
-@click.argument('cluster_name')
+@arg_cluster_name
@click.pass_obj
def show_config(obj, cluster_name):
cluster = get_dcs(obj, cluster_name).get_cluster() | Make show-config work with cluster_name from config file (#<I>)
similar to edit-config, list and so on | zalando_patroni | train | py |
83954bb4875fb8daf05753b652636a1fc2a8392b | diff --git a/generators/cucumber/templates/env.rb b/generators/cucumber/templates/env.rb
index <HASH>..<HASH> 100644
--- a/generators/cucumber/templates/env.rb
+++ b/generators/cucumber/templates/env.rb
@@ -1,5 +1,5 @@
require 'cucumber'
-require 'capybara/cucumber'
+require 'capybara-screenshot/cucumber'
require_relative '../../config/boot'
require_relative '../../config/capybara'
@@ -12,6 +12,7 @@ Howitzer::Cache.store(:cloud, :start_time, Time.now.utc)
Howitzer::Cache.store(:cloud, :status, true)
Before do |scenario|
+ Capybara.use_default_driver
Howitzer::Log.print_feature_name(scenario.feature.name)
Howitzer::Log.print_scenario_name(scenario.name)
@session_start = CapybaraHelpers.duration(Time.now.utc - Howitzer::Cache.extract(:cloud, :start_time))
@@ -28,6 +29,7 @@ After do |scenario|
page.execute_script("void(document.execCommand('ClearAuthenticationCache', false));")
end
Howitzer::Cache.clear_all_ns
+ Capybara.reset_sessions!
end
at_exit do | removed extra capybara dsl including | strongqa_howitzer | train | rb |
e98d8002d8ce1646d00be54d82d2489cb549d354 | diff --git a/core/src/main/java/hudson/util/AtomicFileWriter.java b/core/src/main/java/hudson/util/AtomicFileWriter.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/util/AtomicFileWriter.java
+++ b/core/src/main/java/hudson/util/AtomicFileWriter.java
@@ -130,7 +130,7 @@ public class AtomicFileWriter extends Writer {
try {
// Try to make an atomic move.
Files.move(tmpFile, destFile, StandardCopyOption.ATOMIC_MOVE);
- } catch (IOException e) {
+ } catch (AtomicMoveNotSupportedException e) {
// If it falls here that means that Atomic move is not supported by the OS.
// In this case we need to fall-back to a copy option which is supported by all OSes.
Files.move(tmpFile, destFile, StandardCopyOption.REPLACE_EXISTING); | Only catch AtomicMoveNotSupportedException. | jenkinsci_jenkins | train | java |
7f4e64db9ca183b13f558b4e28c19366e723194c | diff --git a/js/lib/mediawiki.Util.js b/js/lib/mediawiki.Util.js
index <HASH>..<HASH> 100644
--- a/js/lib/mediawiki.Util.js
+++ b/js/lib/mediawiki.Util.js
@@ -877,7 +877,7 @@ normalizeOut = function ( out ) {
// http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#serializing-html-fragments
out = normalizeNewlines( out );
return out
- .replace(/<span typeof="mw:(?:(?:Placeholder|Nowiki|Object\/Template|Entity))"(?:\s+[^\s"'>\/=]+(?:\s*=\s*"[^"]*")?)*\s*>((?:[^<]+|(?!<\/span).)*)<\/span>/g, '$1')
+ .replace(/<span typeof="mw:(?:(?:Placeholder|Nowiki|Object\/Template|Entity))"(?:\s+[^\s\"\'>\/=]+(?:\s*=\s*"[^"]*")?)*\s*>((?:[^<]+|(?!<\/span).)*)<\/span>/g, '$1')
// Ignore these attributes for now
.replace(/ (data-parsoid|typeof|resource|rel|prefix|about|rev|datatype|inlist|property|vocab|content|title|class)="[^"]*"/g, '')
// replace mwt ids | Escape a single quote so we don't screw up emacs' syntax coloring.
Change-Id: I<I>eca7b0f<I>ac8d<I>a8d<I>e<I>a8f<I>bb5d | wikimedia_parsoid | train | js |
dd051aae3f70cd3fce95e21056096996b4c01ebb | diff --git a/controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java b/controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java
index <HASH>..<HASH> 100644
--- a/controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java
+++ b/controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java
@@ -415,7 +415,8 @@ public abstract class AttributeDefinition {
}
private ModelNode convertToExpectedType(final ModelNode node) {
- if (node.getType() == type || node.getType() == ModelType.EXPRESSION || Util.isExpression(node.asString()) || !node.isDefined()) {
+ ModelType nodeType = node.getType();
+ if (nodeType == type || nodeType == ModelType.UNDEFINED || nodeType == ModelType.EXPRESSION || Util.isExpression(node.asString())) {
return node;
}
switch (type) { | Check for undefined early to improve perf | wildfly_wildfly-core | train | java |
b93bb1ec4abc31e7babc2b437e9ee6c0b03ccfbb | diff --git a/spec/unit/mixin/shell_out_spec.rb b/spec/unit/mixin/shell_out_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/mixin/shell_out_spec.rb
+++ b/spec/unit/mixin/shell_out_spec.rb
@@ -33,12 +33,13 @@ describe Ohai::Mixin::ShellOut, "shell_out" do
else
# this just replicates the behavior of default_paths in chef-utils
default_paths = ( [ ENV['PATH'] ? ENV['PATH'].split(':').reverse : nil, RbConfig::CONFIG["bindir"] ].uniq.reverse + [ "/usr/local/sbin", "/usr/local/bin", "/usr/sbin", "/usr/bin", "/sbin", "/bin" ] ).compact.uniq.join(":")
+ default_locale = ChefConfig::Config.guess_internal_locale
{
timeout: timeout,
environment: {
- "LANG" => "en_US.UTF-8",
- "LANGUAGE" => "en_US.UTF-8",
- "LC_ALL" => "en_US.UTF-8",
+ "LANG" => default_locale,
+ "LANGUAGE" => default_locale,
+ "LC_ALL" => default_locale,
"PATH" => default_paths,
},
} | fix the deafult locale
we need to call out to the ChefConfig helper to set this | chef_ohai | train | rb |
cc9ed84c81b98a83925630b417ddb67b7567b677 | diff --git a/webpype/client.py b/webpype/client.py
index <HASH>..<HASH> 100644
--- a/webpype/client.py
+++ b/webpype/client.py
@@ -26,10 +26,17 @@ class WebPypeBaseClient(object):
resp = urlopen(request)
return resp.read()
- def _wrapinput(self, inputs, array_wrap=False):
+ def _validate_input(self, inputs):
+ if isinstance(inputs, unicode):
+ inputs = str(inputs)
if not isinstance(inputs, dict) and not isinstance(inputs, str):
raise TypeError('''Your input value must be a dictionary or
string. Got: %s''' % inputs)
+ return inputs
+
+ def _wrapinput(self, inputs, array_wrap=False):
+ inputs = self._validateinput(inputs)
+
if array_wrap:
if isinstance(inputs, dict):
data = json.dumps({'inputs': inputs}) | Added _validate_input(), and moved input validation away
from _wrapinput(). Now it can also handle unicode | ajvb_webpype | train | py |
9ae150feabcafef8c8ecb0576b2fa3852325a9f4 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -136,7 +136,7 @@ export default class OneSignal {
static sendTag(key, value) {
if (!checkIfInitialized(RNOneSignal)) return;
- if (!key || !value) {
+ if (!key || (!value && value !== "")) {
console.error("OneSignal: sendTag: must include a key and a value");
} | Small Nit: We Should Allow for the setting of blank strings as values
Motivation: tags can be removed by sending a blank string. Here we're updating the logic to allow for that | geektimecoil_react-native-onesignal | train | js |
a3fb251891b27866a95f6010ee8ee32f7fc6846e | diff --git a/test/test_shell.rb b/test/test_shell.rb
index <HASH>..<HASH> 100644
--- a/test/test_shell.rb
+++ b/test/test_shell.rb
@@ -47,9 +47,13 @@ class ShellTest < Test::Unit::TestCase
end
def test_parse_input
- cmdpath, args = RVC::Shell.parse_input "module.cmd --longarg -s vm1 vm2"
+ cmdpath, args = RVC::Shell.parse_input 'module.cmd --longarg -s vm1 vm2 "spacy vm"'
assert_equal [:module, :cmd], cmdpath
- assert_equal ['--longarg', '-s', 'vm1', 'vm2'], args
+ assert_equal ['--longarg', '-s', 'vm1', 'vm2', 'spacy vm'], args
+
+ cmdpath, args = RVC::Shell.parse_input 'module.cmd --longarg -s vm1 vm2 "spacy vm'
+ assert_equal [:module, :cmd], cmdpath
+ assert_equal ['--longarg', '-s', 'vm1', 'vm2', 'spacy vm'], args
end
def test_lookup_cmd | add tests for Shell.parse_input with quotes | vmware_rvc | train | rb |
866e7ab5affcd2fb2bda72e779849b50c69deec6 | diff --git a/src/Probability/Distribution/StudentTDistribution.php b/src/Probability/Distribution/StudentTDistribution.php
index <HASH>..<HASH> 100644
--- a/src/Probability/Distribution/StudentTDistribution.php
+++ b/src/Probability/Distribution/StudentTDistribution.php
@@ -2,7 +2,7 @@
namespace Math\Probability\Distribution;
use Math\Functions\Special;
-class TDistribution extends ContinuousNew {
+class TDistribution extends Continuous {
public static function PDF($t, $ν){
if(!is_int($ν)) return false;
$π = \M_PI; | Update StudentTDistribution.php | markrogoyski_math-php | train | php |
66cbdc0e80208adcc969643d7816122865b42355 | diff --git a/pandas/tests/test_series.py b/pandas/tests/test_series.py
index <HASH>..<HASH> 100644
--- a/pandas/tests/test_series.py
+++ b/pandas/tests/test_series.py
@@ -2603,8 +2603,8 @@ class TestSeries(unittest.TestCase, CheckNameIntegration):
self.assertEquals(a.dot(b['2'].values), expected['2'])
#Check series argument
- self.assertEquals(a.dot(b['1']), expected['1'])
- self.assertEquals(a.dot(b2['1']), expected['1'])
+ assert_almost_equal(a.dot(b['1']), expected['1'])
+ assert_almost_equal(a.dot(b2['1']), expected['1'])
self.assertRaises(Exception, a.dot, a.values[:3])
self.assertRaises(ValueError, a.dot, b.T) | BUG: tests should use almost_equal for comparing float equal | pandas-dev_pandas | train | py |
9498e662b8bf178f196ac7288a246c7f80a65a91 | diff --git a/progressbar/__about__.py b/progressbar/__about__.py
index <HASH>..<HASH> 100644
--- a/progressbar/__about__.py
+++ b/progressbar/__about__.py
@@ -19,7 +19,7 @@ A Python Progressbar library to provide visual (yet text based) progress to
long running operations.
'''.strip()
__email__ = 'wolph@wol.ph'
-__version__ = '3.5.0'
+__version__ = '3.5.1'
__license__ = 'BSD'
__copyright__ = 'Copyright 2015 Rick van Hattem (Wolph)'
__url__ = 'https://github.com/WoLpH/python-progressbar'
diff --git a/progressbar/bar.py b/progressbar/bar.py
index <HASH>..<HASH> 100644
--- a/progressbar/bar.py
+++ b/progressbar/bar.py
@@ -57,7 +57,7 @@ class ResizableMixin(DefaultFdMixin):
signal.signal(signal.SIGWINCH, self._handle_resize)
self.signal_set = True
except: # pragma: no cover
- raise
+ pass
def _handle_resize(self, signum=None, frame=None):
'Tries to catch resize signals sent from the terminal.' | removed debug code, the exception shouldnt raise | WoLpH_python-progressbar | train | py,py |
e0fa8d6b5b94466dec52805ff81d211556af5910 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100755
--- a/index.js
+++ b/index.js
@@ -12,6 +12,7 @@ var execSync = require('child_process').execSync;
var execFile = require('child_process').execFile;
var spawn = require('child_process').spawn;
var os = require('os');
+var node_path = require('path');
// ****************************************************************************
// NodeClam class definition
@@ -531,10 +532,18 @@ NodeClam.prototype.scan_dir = function(path, end_cb, file_cb) {
(function get_file_stats() {
if (files.length > 0) {
var file = files.pop();
+ file = node_path.join(path, file);
fs.stat(file, function(err, info) {
- if (info.isFile()) good_files.push(file);
+ if (!err) {
+ if (info.isFile()) {
+ good_files.push(file);
+ }
+ } else {
+ if (self.settings.debug_mode)
+ console.log("node-clam: Error scanning file in directory: ", err);
+ }
get_file_stats();
- });
+ });
} else {
self.scan_files(good_files, end_file, file_cb);
} | Fixed a bug caused when scanning directories with clamdscan with scan_recursively set to false. | kylefarris_clamscan | train | js |
f4f0ca27e2a75b034dbc87c246929991f9ca7abd | diff --git a/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/BindProxyProperties.php b/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/BindProxyProperties.php
index <HASH>..<HASH> 100644
--- a/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/BindProxyProperties.php
+++ b/src/ProxyManager/ProxyGenerator/AccessInterceptorScopeLocalizer/MethodGenerator/BindProxyProperties.php
@@ -64,6 +64,10 @@ class BindProxyProperties extends MethodGenerator
foreach ($originalClass->getProperties() as $originalProperty) {
$propertyName = $originalProperty->getName();
+ if ($originalProperty->isStatic()) {
+ continue;
+ }
+
if ($originalProperty->isPrivate()) {
$localizedProperties[] = "\\Closure::bind(function () use (\$localizedObject) {\n "
. '$this->' . $propertyName . ' = & $localizedObject->' . $propertyName . ";\n" | Skipping static properties when binding properties in a scope localizer | Ocramius_ProxyManager | train | php |
029b77c81f1ee8299c5422cb69c4f8d07baa4043 | diff --git a/lib/active_scaffold.rb b/lib/active_scaffold.rb
index <HASH>..<HASH> 100644
--- a/lib/active_scaffold.rb
+++ b/lib/active_scaffold.rb
@@ -286,7 +286,7 @@ module ActiveScaffold
as_path = File.join(ActiveScaffold::Config::Core.plugin_directory, 'app', 'views')
index = view_paths.find_index { |p| p.to_s == as_path }
if index
- view_paths.insert index, path
+ self.view_paths = view_paths[0..index-1] + Array(path) + view_paths[index..-1]
else
append_view_path path
end | fix add_active_scaffold_path, it was changing view_paths for all controllers | activescaffold_active_scaffold | train | rb |
5cf9ed5c18e4fefd8b0dc33c38c151d8322f5757 | diff --git a/modules/activiti-engine/src/main/java/org/activiti/engine/impl/cfg/ProcessEngineConfigurationImpl.java b/modules/activiti-engine/src/main/java/org/activiti/engine/impl/cfg/ProcessEngineConfigurationImpl.java
index <HASH>..<HASH> 100644
--- a/modules/activiti-engine/src/main/java/org/activiti/engine/impl/cfg/ProcessEngineConfigurationImpl.java
+++ b/modules/activiti-engine/src/main/java/org/activiti/engine/impl/cfg/ProcessEngineConfigurationImpl.java
@@ -604,14 +604,14 @@ public abstract class ProcessEngineConfigurationImpl extends ProcessEngineConfig
log.debug("using database type: {}", databaseType);
} catch (SQLException e) {
- e.printStackTrace();
+ log.error("Exception while initializing Database connection", e);
} finally {
try {
if (connection!=null) {
connection.close();
}
} catch (SQLException e) {
- e.printStackTrace();
+ log.error("Exception while closing the Database connection", e);
}
}
} | Changed logging IOException to the configured logger. Printing stacktrace may not be optimum. | Activiti_Activiti | train | java |
afc22c7bbba1548179ea1334a6b6c9b974508e00 | diff --git a/command/v2/bind_security_group_command.go b/command/v2/bind_security_group_command.go
index <HASH>..<HASH> 100644
--- a/command/v2/bind_security_group_command.go
+++ b/command/v2/bind_security_group_command.go
@@ -97,7 +97,7 @@ func (cmd BindSecurityGroupCommand) Execute(args []string) error {
}
for _, space := range spacesToBind {
- cmd.UI.DisplayText("Assigning security group {{.security_group}} to space {{.space}} in org {{.organization}} as {{.username}}...", map[string]interface{}{
+ cmd.UI.DisplayTextWithFlavor("Assigning security group {{.security_group}} to space {{.space}} in org {{.organization}} as {{.username}}...", map[string]interface{}{
"security_group": securityGroup.Name,
"space": space.Name,
"organization": org.Name, | display assigning text with flavor
[finishes #<I>] | cloudfoundry_cli | train | go |
dcbf35c552a53e7779d7da917cbce78ecf109021 | diff --git a/src/java/org/apache/cassandra/io/util/MmappedSegmentedFile.java b/src/java/org/apache/cassandra/io/util/MmappedSegmentedFile.java
index <HASH>..<HASH> 100644
--- a/src/java/org/apache/cassandra/io/util/MmappedSegmentedFile.java
+++ b/src/java/org/apache/cassandra/io/util/MmappedSegmentedFile.java
@@ -54,10 +54,10 @@ public class MmappedSegmentedFile extends SegmentedFile
*/
private Segment floor(long position)
{
- assert 0 <= position && position < length: position + " vs " + length;
+ assert 0 <= position && position < length: String.format("%d >= %d in %s", position, length, path);
Segment seg = new Segment(position, null);
int idx = Arrays.binarySearch(segments, seg);
- assert idx != -1 : "Bad position " + position + " in segments " + Arrays.toString(segments);
+ assert idx != -1 : String.format("Bad position %d for segments %s in %s", position, Arrays.toString(segments), path);
if (idx < 0)
// round down to entry at insertion point
idx = -(idx + 2); | add path to MmappedSegmentedFile assertions | Stratio_stratio-cassandra | train | java |
67d2498a1761b73624efce6b8c5ee9df2196585f | diff --git a/src/funnies.js b/src/funnies.js
index <HASH>..<HASH> 100644
--- a/src/funnies.js
+++ b/src/funnies.js
@@ -151,4 +151,5 @@ export default [
"Please hold on as we reheat our coffee",
"Kindly hold on as we convert this bug to a feature...",
"Kindly hold on as our intern quits vim...",
+ "Winter is coming...",
]; | Winter is coming... added to funny phrases (#<I>) | 1egoman_funnies | train | js |
107e8c0be4e9a5208c38fa0492e8d06ad47df3c6 | diff --git a/integrated-build.js b/integrated-build.js
index <HASH>..<HASH> 100644
--- a/integrated-build.js
+++ b/integrated-build.js
@@ -3,6 +3,7 @@
const addCacheBusting = require('./add-cache-busting.js');
const addCspCompliance = require('./add-csp-compliance.js');
const injectCustomElementsEs5Adapter = require('./inject-custom-elements-es5-adapter.js');
+const lazypipe = require('lazypipe');
const optimizeAssets = require('./optimize-assets.js');
const polymerBuild = require('./polymer-build.js');
@@ -10,11 +11,16 @@ const polymerBuild = require('./polymer-build.js');
* Best practice build pipeline. This only only chains up the various build steps.
*
* @param {Object} config Content of polymer.json
+ * @return
*/
-exports.build = function build(config) {
- return polymerBuild(config)
- .pipe(addCspCompliance())
- .pipe(addCacheBusting())
- .pipe(optimizeAssets())
- .pipe(injectCustomElementsEs5Adapter());
+function build(config) {
+ return lazypipe()
+ .pipe(() => polymerBuild(config))
+ .pipe(() => addCspCompliance())
+ .pipe(() => addCacheBusting())
+ .pipe(() => optimizeAssets())
+ .pipe(() => injectCustomElementsEs5Adapter());
}
+
+module.exports = build;
+ | Plugin needs to expose a lazypipe for later initialization | Collaborne_gulp-polymer-build-utils | train | js |
d74f2ce97167722a3fcb8d9e6ca639ee73f75645 | diff --git a/spec/a9n_spec.rb b/spec/a9n_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/a9n_spec.rb
+++ b/spec/a9n_spec.rb
@@ -97,7 +97,7 @@ describe A9n do
its(:app_url) { should_not be_nil }
its(:app_url) { should == subject.fetch(:app_url) }
- its(:page_title) { should == 'Base Kiełbasa' }
+ its(:page_title) { should == 'Base Kielbasa' }
its(:api_key) { should == 'base1234' }
specify {
expect { subject.app_host }.to raise_error(described_class::NoSuchConfigurationVariable)
@@ -115,7 +115,7 @@ describe A9n do
end
its(:app_host) { should_not be_nil }
- its(:page_title) { should == 'Local Kiełbasa' }
+ its(:page_title) { should == 'Local Kielbasa' }
its(:api_key) { should == 'local1234' }
specify {
expect { subject.app_url }.to raise_error(described_class::NoSuchConfigurationVariable) | Remove non-utf chars | knapo_a9n | train | rb |
9eef414903e3842c00ad04ee36f3ee212a490ed1 | diff --git a/lib/patron/request.rb b/lib/patron/request.rb
index <HASH>..<HASH> 100644
--- a/lib/patron/request.rb
+++ b/lib/patron/request.rb
@@ -88,7 +88,7 @@ module Patron
end
def timeout=(new_timeout)
- if new_timeout.to_i < 1
+ if new_timeout && new_timeout.to_i < 1
raise ArgumentError, "Timeout must be a positive integer greater than 0"
end
@@ -96,7 +96,7 @@ module Patron
end
def connect_timeout=(new_timeout)
- if new_timeout.to_i < 1
+ if new_timeout && new_timeout.to_i < 1
raise ArgumentError, "Timeout must be a positive integer greater than 0"
end | Allow nil timeout to turn off the timeout feature | toland_patron | train | rb |
11c6e1b5f8a7476919ab0b375fc87abf93ab1690 | diff --git a/tests/base.py b/tests/base.py
index <HASH>..<HASH> 100644
--- a/tests/base.py
+++ b/tests/base.py
@@ -15,13 +15,14 @@ class PrioCORO:
prio = priority.CORO
priorities = (PrioCORO, PrioOP, PrioFIRST, PrioLAST)
-from cogen.core.proactors import has_iocp, \
+from cogen.core.proactors import has_iocp, has_ctypes_iocp, \
has_kqueue, has_stdlib_kqueue, \
has_epoll, has_stdlib_epoll, \
has_poll, has_select
proactors_available = [
j for j in [
i() for i in (
+ has_ctypes_iocp,
has_iocp,
has_stdlib_kqueue,
has_kqueue, | added ctypes iocp to tests | ionelmc_python-cogen | train | py |
c2fc91adc7ca05e66a6b4a03303236c4e9a5325d | diff --git a/pkg/volume/vsphere_volume/vsphere_volume_util.go b/pkg/volume/vsphere_volume/vsphere_volume_util.go
index <HASH>..<HASH> 100644
--- a/pkg/volume/vsphere_volume/vsphere_volume_util.go
+++ b/pkg/volume/vsphere_volume/vsphere_volume_util.go
@@ -94,11 +94,12 @@ func (util *VsphereDiskUtil) CreateVolume(v *vsphereVolumeProvisioner, selectedZ
}
capacity := v.options.PVC.Spec.Resources.Requests[v1.ResourceName(v1.ResourceStorage)]
- // vSphere works with kilobytes, convert to KiB with rounding up
- volSizeKiB, err := volumehelpers.RoundUpToKiBInt(capacity)
+ // vSphere works with KiB, but its minimum allocation unit is 1 MiB
+ volSizeMiB, err := volumehelpers.RoundUpToMiBInt(capacity)
if err != nil {
return nil, err
}
+ volSizeKiB := volSizeMiB * 1024
name := volumeutil.GenerateVolumeName(v.options.ClusterName, v.options.PVName, 255)
volumeOptions := &vclib.VolumeOptions{
CapacityKB: volSizeKiB, | Fix rounding-up of Vsphere volume size | kubernetes_kubernetes | train | go |
fdc8c9ec93de5e91ac2b21e953d1e705a50959ce | diff --git a/plexapi/myplex.py b/plexapi/myplex.py
index <HASH>..<HASH> 100644
--- a/plexapi/myplex.py
+++ b/plexapi/myplex.py
@@ -634,15 +634,10 @@ class MyPlexAccount(PlexObject):
"""
return self.batchingItems(self.NEWS, maxresults)
- return items
-
- def podcasts(self):
+ def podcasts(self, maxresults=50):
""" Returns a list of Podcasts Hub items :class:`~plexapi.library.Hub`
"""
- items = []
- data = self.query(url=self.PODCASTS)
- for elem in data:
- items.append(Hub(server=self._server, data=elem))
+ return self.batchingItems(self.PODCASTS, maxresults)
return items | update podcasts to use batchingItems | pkkid_python-plexapi | train | py |
c826f31d1fc22bbab93c722d9da3475619ac2a8c | diff --git a/itests/standalone/src/test/java/org/wildfly/camel/test/csv/CSVIntegrationTest.java b/itests/standalone/src/test/java/org/wildfly/camel/test/csv/CSVIntegrationTest.java
index <HASH>..<HASH> 100644
--- a/itests/standalone/src/test/java/org/wildfly/camel/test/csv/CSVIntegrationTest.java
+++ b/itests/standalone/src/test/java/org/wildfly/camel/test/csv/CSVIntegrationTest.java
@@ -35,6 +35,7 @@ import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.Assert;
+import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.wildfly.camel.test.core.subA.Customer;
@@ -53,6 +54,7 @@ public class CSVIntegrationTest {
}
@Test
+ @Ignore("[FIXME #464] Object may get marshalled to wrong CSV order")
public void testMarshal() throws Exception {
CamelContext camelctx = new DefaultCamelContext(); | [FIXME #<I>] Object may get marshalled to wrong CSV order | wildfly-extras_wildfly-camel | train | java |
1859170e69f8765e0656b1259363dc40f8ac59fc | diff --git a/codec-http2/src/test/java/io/netty/handler/codec/http2/LastInboundHandler.java b/codec-http2/src/test/java/io/netty/handler/codec/http2/LastInboundHandler.java
index <HASH>..<HASH> 100644
--- a/codec-http2/src/test/java/io/netty/handler/codec/http2/LastInboundHandler.java
+++ b/codec-http2/src/test/java/io/netty/handler/codec/http2/LastInboundHandler.java
@@ -99,7 +99,7 @@ public class LastInboundHandler extends ChannelDuplexHandler {
@Override
public void channelWritabilityChanged(ChannelHandlerContext ctx) throws Exception {
- if (writabilityStates == "") {
+ if ("".equals(writabilityStates)) {
writabilityStates = String.valueOf(ctx.channel().isWritable());
} else {
writabilityStates += "," + ctx.channel().isWritable(); | Change String comparison to equals() from == (#<I>)
Motivation:
Even if it was stored in the string constant pool, I thought it was safe to compare it through the Equals() method.
Modification:
So, I changed "==" comparison to equals() comparison
Result:
It has become safer to compare String values with different references and with the same values. | netty_netty | train | java |
55f58370cfda6ba48ab9c08cf22039dbbf5b99b0 | diff --git a/src/Leevel/Protocol/Server.php b/src/Leevel/Protocol/Server.php
index <HASH>..<HASH> 100755
--- a/src/Leevel/Protocol/Server.php
+++ b/src/Leevel/Protocol/Server.php
@@ -580,8 +580,8 @@ abstract class Server
throw new InvalidArgumentException($e);
}
- if (version_compare(phpversion('swoole'), '4.4.0', '<')) {
- $e = 'Swoole 4.4.0 OR Higher';
+ if (version_compare(phpversion('swoole'), '4.4.2', '<')) {
+ $e = 'Swoole 4.4.2 OR Higher';
throw new InvalidArgumentException($e);
} | chore: update swoole version | hunzhiwange_framework | train | php |
a9bdd0c170f2d932d9fabf01f27febf3189c0ac4 | diff --git a/lib/appsignal/railtie.rb b/lib/appsignal/railtie.rb
index <HASH>..<HASH> 100644
--- a/lib/appsignal/railtie.rb
+++ b/lib/appsignal/railtie.rb
@@ -1,8 +1,5 @@
module Appsignal
class Railtie < Rails::Railtie
- rake_tasks do
- load "tasks/auth_check.rake"
- end
initializer "appsignal.configure_rails_initialization" do |app|
# Some apps when run from the console do not have Rails.root set, there's | Remove rake task in favor of CLI | appsignal_appsignal-ruby | train | rb |
98c12bf14c3c2b13f1c75bbc2c2cf88a3068f77d | diff --git a/core/src/test/java/com/google/errorprone/bugpatterns/testdata/BadComparablePositiveCases.java b/core/src/test/java/com/google/errorprone/bugpatterns/testdata/BadComparablePositiveCases.java
index <HASH>..<HASH> 100644
--- a/core/src/test/java/com/google/errorprone/bugpatterns/testdata/BadComparablePositiveCases.java
+++ b/core/src/test/java/com/google/errorprone/bugpatterns/testdata/BadComparablePositiveCases.java
@@ -16,6 +16,7 @@
package com.google.errorprone.bugpatterns.testdata;
+import java.io.File;
import java.util.Comparator;
/** @author irogers@google.com (Ian Rogers) */
@@ -53,4 +54,12 @@ public class BadComparablePositiveCases {
return (int) (n1 - n2);
}
};
+
+ static final Comparator<File> COMPARATOR_FILE_INT_CAST =
+ new Comparator<File>() {
+ public int compare(File lhs, File rhs) {
+ // BUG: Diagnostic contains: return Long.compare(rhs.lastModified(), lhs.lastModified())
+ return (int) (rhs.lastModified() - lhs.lastModified());
+ }
+ };
} | BadComparable test case with File.
This was a motivating case for BadComparable and so it makes a nice test.
RELNOTES: extra BadComparable test.
-------------
Created by MOE: <URL> | google_error-prone | train | java |
d88ae75e9c68bf148917e97a400596de7d49712a | diff --git a/js/angular/components/notification/notification.js b/js/angular/components/notification/notification.js
index <HASH>..<HASH> 100644
--- a/js/angular/components/notification/notification.js
+++ b/js/angular/components/notification/notification.js
@@ -230,7 +230,9 @@
// close if autoclose
if (scope.autoclose) {
setTimeout(function() {
- scope.hide();
+ if (scope.active) {
+ scope.hide();
+ }
}, parseInt(scope.autoclose));
};
} else if (msg == 'close' || msg == 'hide') {
@@ -240,7 +242,9 @@
// close if autoclose
if (scope.autoclose) {
setTimeout(function() {
- scope.toggle();
+ if (scope.active) {
+ scope.toggle();
+ }
}, parseInt(scope.autoclose));
};
} | Change to autoclose notification to prevent notification from reappearing after swipe. | zurb_foundation-apps | train | js |
7471e9df12b999b3c3dbc905758ed7d86cbfd103 | diff --git a/src/main/java/io/github/lukehutch/fastclasspathscanner/json/JSONMapper.java b/src/main/java/io/github/lukehutch/fastclasspathscanner/json/JSONMapper.java
index <HASH>..<HASH> 100644
--- a/src/main/java/io/github/lukehutch/fastclasspathscanner/json/JSONMapper.java
+++ b/src/main/java/io/github/lukehutch/fastclasspathscanner/json/JSONMapper.java
@@ -69,7 +69,7 @@ public class JSONMapper {
* fields.
*/
public static String toJSON(final Object obj, final int indentWidth) {
- return JSONSerializer.toJSON(obj, 0);
+ return JSONSerializer.toJSON(obj, indentWidth);
}
// ------------------------------------------------------------------------------------------------------------- | Pass in indentWidth | classgraph_classgraph | train | java |
6a5b73b347c233300bf48390c87137d5f36dcde8 | diff --git a/generators/generator-constants.js b/generators/generator-constants.js
index <HASH>..<HASH> 100644
--- a/generators/generator-constants.js
+++ b/generators/generator-constants.js
@@ -54,7 +54,7 @@ const DOCKER_JAVA_JRE = 'eclipse-temurin:11-jre-focal';
const DOCKER_MYSQL = 'mysql:8.0.27';
const DOCKER_MARIADB = 'mariadb:10.7.1';
const DOCKER_POSTGRESQL = 'postgres:14.1';
-const DOCKER_MONGODB = 'mongo:4.4.10';
+const DOCKER_MONGODB = 'mongo:4.4.11';
const DOCKER_COUCHBASE = 'couchbase/server:7.0.0';
const DOCKER_CASSANDRA = 'cassandra:3.11.11';
const DOCKER_MSSQL = 'mcr.microsoft.com/mssql/server:2019-CU13-ubuntu-20.04'; | Update mongo docker image version to <I> | jhipster_generator-jhipster | train | js |
cde0951a4707bc6c2a07e7d2e7a621ca08e58acc | diff --git a/sunspot/lib/sunspot/query/restriction.rb b/sunspot/lib/sunspot/query/restriction.rb
index <HASH>..<HASH> 100644
--- a/sunspot/lib/sunspot/query/restriction.rb
+++ b/sunspot/lib/sunspot/query/restriction.rb
@@ -353,6 +353,10 @@ module Sunspot
@field.to_indexed(value)
end
+ def to_negative_boolean_phrase
+ %Q(-"#{to_positive_boolean_phrase}")
+ end
+
def to_positive_boolean_phrase
"{!field f=#{@field.indexed_name} op=#{operation}}#{solr_value}"
end | negative boolean phrase for AbstractRange | sunspot_sunspot | train | rb |
796c77100bf9ac00eff58d670daac8c4ceae548e | diff --git a/lib/app.js b/lib/app.js
index <HASH>..<HASH> 100644
--- a/lib/app.js
+++ b/lib/app.js
@@ -5,7 +5,7 @@ var Performer = require('./performer')
function App(opts) {
var options = opts || {};
- var ydmHome = process.env.YDM_HOME || path.join(process.env.HOME, '.ydm')
+ var ydmHome = process.env.YDM_HOME || (process.env.HOME ? path.join(process.env.HOME, '.ydm') : null)
this.scopesPath = options.scopesPath || path.join(ydmHome, 'scopes')
this.dropsPath = options.dropsPath
if (this.dropsPath) mkdirp.sync(this.dropsPath) | don't break when no HOME set | kfatehi_ydm | train | js |
97411e81b1ce12f33a08cf75e212ba5e0358530f | diff --git a/Package/Loader/LazyAssetPackageLoader.php b/Package/Loader/LazyAssetPackageLoader.php
index <HASH>..<HASH> 100644
--- a/Package/Loader/LazyAssetPackageLoader.php
+++ b/Package/Loader/LazyAssetPackageLoader.php
@@ -174,6 +174,10 @@ class LazyAssetPackageLoader implements LazyLoaderInterface
if (false === $data) {
$this->driver->cleanup();
+ if (!$this->verbose) {
+ $this->io->overwrite('', false);
+ }
+
return false;
} | Fix output without verbose option when package file is not found | fxpio_composer-asset-plugin | train | php |
1b5bedb125a3c20e99dfba4278be0357cacb290e | diff --git a/ara/cli/playbook.py b/ara/cli/playbook.py
index <HASH>..<HASH> 100644
--- a/ara/cli/playbook.py
+++ b/ara/cli/playbook.py
@@ -92,8 +92,29 @@ class PlaybookList(Lister):
query["limit"] = args.limit
playbooks = client.get("/api/v1/playbooks", **query)
- columns = ("id", "status", "path", "started", "duration")
+ # Send items to columns
+ for playbook in playbooks["results"]:
+ playbook["plays"] = playbook["items"]["plays"]
+ playbook["tasks"] = playbook["items"]["tasks"]
+ playbook["results"] = playbook["items"]["results"]
+ playbook["hosts"] = playbook["items"]["hosts"]
+ playbook["files"] = playbook["items"]["files"]
+ playbook["records"] = playbook["items"]["records"]
+
# fmt: off
+ columns = (
+ "id",
+ "status",
+ "path",
+ "plays",
+ "tasks",
+ "results",
+ "hosts",
+ "files",
+ "records",
+ "started",
+ "duration"
+ )
return (
columns, (
[playbook[column] for column in columns] | CLI: Add number of items in 'playbook list'
This adds columns to display the number of plays, tasks, results, hosts,
files and records in each playbook.
Change-Id: If<I>e<I>e<I>b<I>d3c<I>e0ec<I>fee<I>f9c<I> | ansible-community_ara | train | py |
d2fccd70ff3d11650bdd246c19cfeab73c8dcb7b | diff --git a/lib/query_report/report_pdf.rb b/lib/query_report/report_pdf.rb
index <HASH>..<HASH> 100755
--- a/lib/query_report/report_pdf.rb
+++ b/lib/query_report/report_pdf.rb
@@ -50,7 +50,7 @@ module QueryReport
end
def humanized_table_header
- report_columns.collect(&:humanize)
+ report_columns.collect { |h| fix_content h.humanize }
end
def table_content_for(report)
@@ -59,7 +59,7 @@ module QueryReport
item_values = []
report_columns.collect(&:humanize).each do |column|
- item_values << item[column].to_s
+ item_values << fix_content(item[column].to_s)
end
item_values
end
@@ -89,6 +89,10 @@ module QueryReport
end
end
+ def fix_content(content)
+ content
+ end
+
private
def report_columns
report.columns.select { |c| !c.only_on_web? }
diff --git a/spec/report/paginate_spec.rb b/spec/report/paginate_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/report/paginate_spec.rb
+++ b/spec/report/paginate_spec.rb
@@ -5,6 +5,10 @@ require 'query_report/paginate'
describe QueryReport::PaginateModule do
class DummyClass
include QueryReport::PaginateModule
+
+ def paginate?
+ true
+ end
end
let(:object) { DummyClass.new } | Added feature to sanitize the pdf content | ashrafuzzaman_query_report | train | rb,rb |
ec316b319b32e7f6e90dbed341fbbd8814001303 | diff --git a/nipap/nipap/nipapconfig.py b/nipap/nipap/nipapconfig.py
index <HASH>..<HASH> 100644
--- a/nipap/nipap/nipapconfig.py
+++ b/nipap/nipap/nipapconfig.py
@@ -25,7 +25,7 @@ class NipapConfig(ConfigParser.SafeConfigParser):
raise NipapConfigError("missing configuration file")
self._cfg_path = cfg_path
- ConfigParser.ConfigParser.__init__(self, default, allow_no_value = True)
+ ConfigParser.ConfigParser.__init__(self, default)
self.read_file() | Python <I> compliance
Removed allow_no_value from config object as it's newer than Python <I>. | SpriteLink_NIPAP | train | py |
68c0d87d421476279b1e3ead84658f91a65b4d6a | diff --git a/patroni/postgresql.py b/patroni/postgresql.py
index <HASH>..<HASH> 100644
--- a/patroni/postgresql.py
+++ b/patroni/postgresql.py
@@ -1216,7 +1216,8 @@ class Postgresql(object):
if data:
data = data.decode('utf-8').splitlines()
# pg_controldata output depends on major verion. Some of parameters are prefixed by 'Current '
- result = {l.split(':')[0].replace('Current ', '', 1): l.split(':', 1)[1].strip() for l in data if l}
+ result = {l.split(':')[0].replace('Current ', '', 1): l.split(':', 1)[1].strip() for l in data
+ if l and ':' in l}
except subprocess.CalledProcessError:
logger.exception("Error when calling pg_controldata")
return result | check if output lines of controldata are possible to split (#<I>)
Otherwise it fails with scary stacktrace | zalando_patroni | train | py |
7db5d00e282f7fcf3f01cac48930774df01a20a4 | diff --git a/graphsrv/static/js/graphsrv.mtr.js b/graphsrv/static/js/graphsrv.mtr.js
index <HASH>..<HASH> 100644
--- a/graphsrv/static/js/graphsrv.mtr.js
+++ b/graphsrv/static/js/graphsrv.mtr.js
@@ -44,6 +44,9 @@ $gs.components.register(
},
+ "init_popover": function() {
+ },
+
"default_options" : function() {
options = this.Graph_default_options();
options.max_targets = 1;
@@ -133,7 +136,6 @@ $gs.components.register(
for(i = 0; i < hops.length; i++) {
colors[hops[i]] = this.colors[i]
}
- console.log(colors, hops)
var bars = this.d3.data.selectAll("g")
.data(hops) | disable popover in mtr graph for now | 20c_graphsrv | train | js |
ce0dae524ff6ec1167f7f9f4a6a319849589b6ae | diff --git a/app/assets/javascripts/lentil/buttonhandler.js b/app/assets/javascripts/lentil/buttonhandler.js
index <HASH>..<HASH> 100644
--- a/app/assets/javascripts/lentil/buttonhandler.js
+++ b/app/assets/javascripts/lentil/buttonhandler.js
@@ -2,7 +2,7 @@ function buttonhandler() {
$(".like-btn, .flag-confirm").click(function(e) {
button = $(this);
- imageId = $(".fancybox-wrap").attr("id");
+ imageId = $(".fancybox-wrap, .image-show").attr("id");
if (!$(button).is(".already-clicked")) {
url = $(button).attr("href");
$.post(url, function() { | check for image id on standalone image page | NCSU-Libraries_lentil | train | js |
86623f913daaa76fe6659955f8058a8e4776b02e | diff --git a/salt/utils/sanitisers.py b/salt/utils/sanitisers.py
index <HASH>..<HASH> 100644
--- a/salt/utils/sanitisers.py
+++ b/salt/utils/sanitisers.py
@@ -55,5 +55,7 @@ class InputSanitizer(object):
'''
return re.sub(r'[^a-zA-Z0-9.-]', '', InputSanitizer.trim(value))
+ id = hostname
+
clean = InputSanitizer() | Add a stub for ID sanitiser (at the moment same as hostname) | saltstack_salt | train | py |
62227426cb03e0a457259803ef75d25fc878c8b0 | diff --git a/lib/gearman/multiserver-worker.js b/lib/gearman/multiserver-worker.js
index <HASH>..<HASH> 100644
--- a/lib/gearman/multiserver-worker.js
+++ b/lib/gearman/multiserver-worker.js
@@ -21,11 +21,10 @@ var log = require('../log');
* @return {Object}
*/
-function MultiserverWorker(servers, func_name, callback, Worker) {
- Worker = Worker || gearman.Worker;
+function MultiserverWorker(servers, func_name, callback) {
var that = this;
Multiserver.call(this, servers, function(server, index) {
- return new Worker(func_name, function(payload, worker) {
+ return new gearman.Worker(func_name, function(payload, worker) {
that._debug('received job from', that._serverString(index));
return callback(payload, worker);
}, server); | Remove dependecy injection from MultiserverClient | meetings_gearsloth | train | js |
1f055b871664973707a75785dd8786a8619ac87c | diff --git a/dpark/schedule.py b/dpark/schedule.py
index <HASH>..<HASH> 100644
--- a/dpark/schedule.py
+++ b/dpark/schedule.py
@@ -748,7 +748,7 @@ class DAGScheduler(Scheduler):
if self.loghub_dir:
self._dump_stats(stats)
except Exception as e:
- logger.exception("Fail to dump job stats: %s.", e)
+ logger.warning("Fail to dump job stats: %s.", e)
def _dump_stats(self, stats):
name = "_".join(map(str, ['sched', self.id, "job", self.runJobTimes])) + ".json" | Adjust log level of ""Fail to dump job stats" to warning. | douban_dpark | train | py |
594a597c3bb33d0230ffb8cb0145705987f9a37a | diff --git a/src/main/java/com/parship/roperty/KeyValues.java b/src/main/java/com/parship/roperty/KeyValues.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/parship/roperty/KeyValues.java
+++ b/src/main/java/com/parship/roperty/KeyValues.java
@@ -58,7 +58,7 @@ public class KeyValues {
return addOrChangeDomainSpecificValue(changeSet, value, domainKeyParts);
}
- private synchronized DomainSpecificValue addOrChangeDomainSpecificValue(final String changeSet, final Object value, final String[] domainKeyParts) {
+ private DomainSpecificValue addOrChangeDomainSpecificValue(final String changeSet, final Object value, final String[] domainKeyParts) {
DomainSpecificValue domainSpecificValue = domainSpecificValueFactory.create(value, changeSet, domainKeyParts);
if (domainSpecificValues.contains(domainSpecificValue)) { | Removed synchronized modifier, because ConcurrentSkipListSet has an own concurrency mechanism | parship_roperty | train | java |
9573d1bfec50d7bf802d49ad2c1535bbf0f924f7 | diff --git a/terraform/resource_test.go b/terraform/resource_test.go
index <HASH>..<HASH> 100644
--- a/terraform/resource_test.go
+++ b/terraform/resource_test.go
@@ -40,6 +40,12 @@ func TestResourceConfigGet(t *testing.T) {
Value interface{}
}{
{
+ Config: nil,
+ Key: "foo",
+ Value: nil,
+ },
+
+ {
Config: map[string]interface{}{
"foo": "${var.foo}",
},
@@ -74,12 +80,16 @@ func TestResourceConfigGet(t *testing.T) {
}
for i, tc := range cases {
- rawC, err := config.NewRawConfig(tc.Config)
- if err != nil {
- t.Fatalf("err: %s", err)
+ var rawC *config.RawConfig
+ if tc.Config != nil {
+ var err error
+ rawC, err = config.NewRawConfig(tc.Config)
+ if err != nil {
+ t.Fatalf("err: %s", err)
+ }
}
- rc := NewResourceConfig(rawC)
+ rc := NewResourceConfig(rawC)
if tc.Vars != nil {
ctx := NewContext(&ContextOpts{Variables: tc.Vars})
if err := rc.interpolate(ctx); err != nil { | terraform: test to make sure nil in RawConfig is okay | hashicorp_terraform | train | go |
903eff860ebed17acef3182f773fd915ba40ba5f | diff --git a/hystrix-core/src/main/java/com/netflix/hystrix/AbstractCommand.java b/hystrix-core/src/main/java/com/netflix/hystrix/AbstractCommand.java
index <HASH>..<HASH> 100644
--- a/hystrix-core/src/main/java/com/netflix/hystrix/AbstractCommand.java
+++ b/hystrix-core/src/main/java/com/netflix/hystrix/AbstractCommand.java
@@ -1442,9 +1442,7 @@ import com.netflix.hystrix.util.HystrixTimer.TimerListener;
public ExecutionResult addEvents(HystrixEventType... events) {
ArrayList<HystrixEventType> newEvents = new ArrayList<>();
newEvents.addAll(this.events);
- for (HystrixEventType e : events) {
- newEvents.add(e);
- }
+ Collections.addAll(newEvents, events);
return new ExecutionResult(Collections.unmodifiableList(newEvents), executionTime, exception);
} | Replace explicit iteration with library support for fast list creation | Netflix_Hystrix | train | java |
e680a2de274ee783e9a7040034a692a6a58b5b38 | diff --git a/tornadis/__init__.py b/tornadis/__init__.py
index <HASH>..<HASH> 100644
--- a/tornadis/__init__.py
+++ b/tornadis/__init__.py
@@ -4,14 +4,12 @@
# This file is part of tornadis library released under the MIT license.
# See the LICENSE file for more information.
-version_info = (0, 0, '1')
+version_info = (0, 1, 0)
__version__ = ".".join([str(x) for x in version_info])
DEFAULT_HOST = '127.0.0.1'
DEFAULT_PORT = 6379
DEFAULT_CONNECT_TIMEOUT = 20
-DEFAULT_WRITE_TIMEOUT = 20
-DEFAULT_READ_TIMEOUT = 20
DEFAULT_READ_PAGE_SIZE = 65536
DEFAULT_WRITE_PAGE_SIZE = 65536 | remove two unused const and preparing <I> release | thefab_tornadis | train | py |
b419181446105a39ee9f58f601a2e8f08495ac20 | diff --git a/packages/node-krl-parser/tests/parser.test.js b/packages/node-krl-parser/tests/parser.test.js
index <HASH>..<HASH> 100644
--- a/packages/node-krl-parser/tests/parser.test.js
+++ b/packages/node-krl-parser/tests/parser.test.js
@@ -2059,6 +2059,11 @@ test("Action setting", function(t){
var src = "ruleset rs{rule r1{select when a b; "+src_action+"}}";
var ast = parser(src).rules[0].action_block.actions[0];
t.deepEquals(normalizeAST(rmLoc(ast)), normalizeAST(expected));
+
+ //test it also in defaction
+ src = "ruleset rs{global{a=defaction(){"+src_action+"}}}";
+ ast = parser(src).global[0].actions[0];
+ t.deepEquals(normalizeAST(rmLoc(ast)), normalizeAST(expected));
};
testAction("http:post(\"url\") with qs = {\"foo\": \"bar\"}", { | testing action setting support in defaction | Picolab_pico-engine | train | js |
6cea002ba0b45f1b5ee67c75d89e95c201f545f5 | diff --git a/fuse.py b/fuse.py
index <HASH>..<HASH> 100644
--- a/fuse.py
+++ b/fuse.py
@@ -382,15 +382,15 @@ class Stat(FuseStruct):
def __init__(self, **kw):
self.st_mode = None
- self.st_ino = None
- self.st_dev = None
+ self.st_ino = 0
+ self.st_dev = 0
self.st_nlink = None
- self.st_uid = None
- self.st_gid = None
- self.st_size = None
- self.st_atime = None
- self.st_mtime = None
- self.st_ctime = None
+ self.st_uid = 0
+ self.st_gid = 0
+ self.st_size = 0
+ self.st_atime = 0
+ self.st_mtime = 0
+ self.st_ctime = 0
FuseStruct.__init__(self, **kw) | the FuseStat initializatior sets a default zero value for some of the stat fields | libfuse_python-fuse | train | py |
b8fa39ffa4cfedc660d7303a0198655d5a2433ff | diff --git a/openid/codecutil.py b/openid/codecutil.py
index <HASH>..<HASH> 100644
--- a/openid/codecutil.py
+++ b/openid/codecutil.py
@@ -50,13 +50,7 @@ def _in_escape_range(octet):
return False
-def _pct_escape_handler(err):
- '''
- Encoding error handler that does percent-escaping of Unicode, to be used
- with codecs.register_error
- TODO: replace use of this with urllib.parse.quote as appropriate
- '''
- chunk = err.object[err.start:err.end]
+def _pct_encoded_replacements(chunk):
replacements = []
for character in chunk:
codepoint = ord(character)
@@ -65,6 +59,17 @@ def _pct_escape_handler(err):
replacements.append("%%%X" % char)
else:
replacements.append(chr(codepoint))
+ return replacements
+
+
+def _pct_escape_handler(err):
+ '''
+ Encoding error handler that does percent-escaping of Unicode, to be used
+ with codecs.register_error
+ TODO: replace use of this with urllib.parse.quote as appropriate
+ '''
+ chunk = err.object[err.start:err.end]
+ replacements = _pct_encoded_replacements(chunk)
return ("".join(replacements), err.end)
codecs.register_error("oid_percent_escape", _pct_escape_handler) | Factor out percent-encoding into separate function in codecutil, for debugging / testing | necaris_python3-openid | train | py |
093756d335711b9e4578b061f2e62806bf8c2aec | diff --git a/lib/validation.js b/lib/validation.js
index <HASH>..<HASH> 100644
--- a/lib/validation.js
+++ b/lib/validation.js
@@ -2,6 +2,9 @@
const Joi = require( 'joi' );
+// pre-load
+require( 'joi/lib/any' );
+
const utils = require( './utils' );
const ignoredProperties = require( './ignored-properties' );
@@ -115,6 +118,23 @@ function configure( userSchema ) {
if( userSchema ) {
schema = userSchema;
+
+ // warm up during load phase
+ try {
+
+ let testEvent = {};
+
+ Object.keys( schema ).forEach( function( key ) {
+
+ testEvent[ key ] = 'test-data';
+ });
+
+ verify( testEvent );
+ }
+ catch( err ) {
+
+ // ignore
+ }
}
} | Added preload and warm-up code for validation testing - reduces time for cold runs | vandium-io_vandium-node | train | js |
0f5cfffa35c3e52df15f5b81cad15a44e74a77a3 | diff --git a/tests/integration/price/testcases/basket/testFrontendOrderStep1DeliverySortedWithCategories(1).php b/tests/integration/price/testcases/basket/testFrontendOrderStep1DeliverySortedWithCategories(1).php
index <HASH>..<HASH> 100644
--- a/tests/integration/price/testcases/basket/testFrontendOrderStep1DeliverySortedWithCategories(1).php
+++ b/tests/integration/price/testcases/basket/testFrontendOrderStep1DeliverySortedWithCategories(1).php
@@ -16,6 +16,8 @@
*/
$aData = array(
+ 'skipped' => 1,
+
'categories' => array (
0 => array (
'oxid' => 'testCategory1',
diff --git a/tests/integration/price/testcases/basket/testFrontendOrderStep1DeliverySortedWithCategories(2).php b/tests/integration/price/testcases/basket/testFrontendOrderStep1DeliverySortedWithCategories(2).php
index <HASH>..<HASH> 100644
--- a/tests/integration/price/testcases/basket/testFrontendOrderStep1DeliverySortedWithCategories(2).php
+++ b/tests/integration/price/testcases/basket/testFrontendOrderStep1DeliverySortedWithCategories(2).php
@@ -16,6 +16,8 @@
*/
$aData = array(
+ 'skipped' => 1,
+
'categories' => array (
0 => array (
'oxid' => 'testCategory1', | marked as skipped (cherry picked from commit <I>b1c5) (cherry picked from commit 7c9cbdd) | OXID-eSales_oxideshop_ce | train | php,php |
66712e39d70a60a69f5d93fdd940c1dc425a2b48 | diff --git a/lib/schema_monkey/railtie.rb b/lib/schema_monkey/railtie.rb
index <HASH>..<HASH> 100644
--- a/lib/schema_monkey/railtie.rb
+++ b/lib/schema_monkey/railtie.rb
@@ -8,10 +8,14 @@ module SchemaMonkey
end
rake_tasks do
- load 'rails/tasks/database.rake'
+ namespace :schema_monkey do
+ task :insert do
+ SchemaMonkey.insert
+ end
+ end
['db:schema:dump', 'db:schema:load'].each do |name|
if task = Rake.application.tasks.find { |task| task.name == name }
- task.enhance(["schema_monkey:load"])
+ task.enhance(["schema_monkey:insert"])
end
end
end | bug fix: replace dangling rails/tasks/database.rake with the correct task inline | SchemaPlus_schema_monkey | train | rb |
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.