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 |
|---|---|---|---|---|---|
dc0a22ad51fd1825716f73b28a572e10f1126ac9 | diff --git a/swipe.js b/swipe.js
index <HASH>..<HASH> 100644
--- a/swipe.js
+++ b/swipe.js
@@ -61,7 +61,7 @@ Swipe.prototype = {
if (this.length < 2) return null;
// determine width of each slide
- this.width = ("getBoundingClientRect" in this.container) ? this.container.getBoundingClientRect().width : this.container.offsetWidth;
+ this.width = Math.ceil(("getBoundingClientRect" in this.container) ? this.container.getBoundingClientRect().width : this.container.offsetWidth);
// return immediately if measurement fails
if (!this.width) return null;
@@ -70,7 +70,7 @@ Swipe.prototype = {
this.container.style.visibility = 'hidden';
// dynamic css
- this.element.style.width = (this.slides.length * this.width) + 'px';
+ this.element.style.width = Math.ceil(this.slides.length * this.width) + 'px';
var index = this.slides.length;
while (index--) {
var el = this.slides[index]; | Using Math.ceil on withs | lyfeyaj_swipe | train | js |
b9660db34452238f39645a155bee300e4aecba85 | diff --git a/mygeotab/cli.py b/mygeotab/cli.py
index <HASH>..<HASH> 100644
--- a/mygeotab/cli.py
+++ b/mygeotab/cli.py
@@ -13,7 +13,6 @@ import click
import mygeotab
import mygeotab.api
-
class Session(object):
def __init__(self):
self.credentials = None
@@ -198,7 +197,7 @@ def console(session, database=None, user=None, password=None, server=None):
click.echo('Your session has expired. Please login again.')
api = login(session, user, password, database, server)
- methods = dict(api=api, mygeotab=mygeotab)
+ methods = dict(my=api, mygeotab=mygeotab)
mygeotab_version = 'MyGeotab Python Console {0}'.format(mygeotab.__version__)
python_version = 'Python {0} on {1}'.format(sys.version.replace('\n', ''), sys.platform)
auth_line = ('Logged in as: %s' % session.credentials) if session.credentials else 'Not logged in' | Changed the "api" var in the console to "my" | Geotab_mygeotab-python | train | py |
58b00a78ab14b18eb793075883464bc2e19733ce | diff --git a/src/Transformers/RouteTransformer.php b/src/Transformers/RouteTransformer.php
index <HASH>..<HASH> 100644
--- a/src/Transformers/RouteTransformer.php
+++ b/src/Transformers/RouteTransformer.php
@@ -6,6 +6,7 @@ use CatLab\Charon\Collections\RouteCollection;
use CatLab\Charon\Laravel\Middleware\InputTransformer;
use CatLab\Charon\Laravel\Middleware\InputValidator;
use CatLab\Charon\Library\TransformerLibrary;
+use CatLab\Charon\Models\Routing\Parameters\Base\Parameter;
use CatLab\Charon\Transformers\ArrayTransformer;
use \Route;
@@ -39,6 +40,12 @@ class RouteTransformer
// transformation (for example DateTimes) are transformed before the controller takes charge.
foreach ($route->getParameters() as $parameter) {
+ // Body parameter are not transformed or validated at middleware stage.
+ // That's why we skip them here.
+ if ($parameter->getIn() === Parameter::IN_BODY) {
+ continue;
+ }
+
// Now check if the parameter has an array
if ($parameter->getTransformer()) { | Body parameters should never be validated or transformed in middleware. | CatLabInteractive_charon-laravel | train | php |
b6780191a3be7367f1e108edc30264b5be6c1722 | diff --git a/src/Parser/Xml/StateMachineDefinitionParser.php b/src/Parser/Xml/StateMachineDefinitionParser.php
index <HASH>..<HASH> 100644
--- a/src/Parser/Xml/StateMachineDefinitionParser.php
+++ b/src/Parser/Xml/StateMachineDefinitionParser.php
@@ -117,15 +117,11 @@ class StateMachineDefinitionParser implements IParser
protected function literalize($value)
{
- if (is_int($value)) {
+ if (preg_match('/^\d+$/', $value)) {
return (int)$value;
+ } else {
+ return $this->literalizeString($value);
}
-
- if (!is_string($value)) {
- return $value;
- }
-
- return $this->literalizeString($value);
}
protected function literalizeString($value) | fixed is_int check for xml parser
is_int is not usefull and is_numeric catches too many cases.
so we have to switch to regex here, meh. | shrink0r_workflux | train | php |
b31a8110b31ce2611a17061ed0ab03fc40d4fa90 | diff --git a/bin/convert-argv.js b/bin/convert-argv.js
index <HASH>..<HASH> 100644
--- a/bin/convert-argv.js
+++ b/bin/convert-argv.js
@@ -25,12 +25,15 @@ module.exports = function(optimist, argv, convertOptions) {
argv["optimize-minimize"] = true;
}
+ var configFileLoaded = false;
if(argv.config) {
options = require(path.resolve(argv.config));
+ configFileLoaded = true;
} else {
var configPath = path.resolve("webpack.config.js");
if(fs.existsSync(configPath)) {
options = require(configPath);
+ configFileLoaded = true;
}
}
if(typeof options !== "object" || options === null) {
@@ -405,6 +408,8 @@ module.exports = function(optimist, argv, convertOptions) {
options.output.filename = argv._.pop();
options.output.path = path.dirname(options.output.filename);
options.output.filename = path.basename(options.output.filename);
+ } else if(configFileLoaded) {
+ throw new Error("'output.filename' is required, either in config file or as --output-file");
} else {
optimist.showHelp();
process.exit(-1); | Throw error when output.filename is missing
#<I> | webpack_webpack | train | js |
c6bd4cf111e57dfcfaa1348b3d8eb51331bb3db9 | diff --git a/spyderlib/spyder.py b/spyderlib/spyder.py
index <HASH>..<HASH> 100644
--- a/spyderlib/spyder.py
+++ b/spyderlib/spyder.py
@@ -1479,6 +1479,12 @@ class MainWindow(QMainWindow):
actions.append(action)
add_actions(self.toolbars_menu, actions)
+ def createPopupMenu(self):
+ menu = QMenu('', self)
+ actions = self.help_menu_actions[:3] + [None, self.help_menu_actions[-1]]
+ add_actions(menu, actions)
+ return menu
+
def set_splash(self, message):
"""Set splash message"""
if message: | Main Window: Redefine createPopupMenu to show some of the Help menu actions | spyder-ide_spyder | train | py |
6da99b7353649807e3c07c27910c92eea76172d5 | diff --git a/tests/unit/Codeception/Module/PhpBrowserTest.php b/tests/unit/Codeception/Module/PhpBrowserTest.php
index <HASH>..<HASH> 100644
--- a/tests/unit/Codeception/Module/PhpBrowserTest.php
+++ b/tests/unit/Codeception/Module/PhpBrowserTest.php
@@ -53,7 +53,7 @@ class PhpBrowserTest extends TestsForMink
$this->assertFalse($guzzle->getConfig('CURLOPT_CERTINFO'));
$module = new \Codeception\Module\PhpBrowser();
- $module->_setConfig(array('url' => 'http://localhost:8000', 'curl' => array('CURLOPT_MUTE' => true)));
+ $module->_setConfig(array('url' => 'http://google.com', 'curl' => array('CURLOPT_MUTE' => true)));
$module->_initialize();
$guzzle = $module->guzzle;
$this->assertTrue($guzzle->getConfig('CURLOPT_MUTE')); | fix to failed phpbrowser test | Codeception_base | train | php |
37252e96ee216cbffc4ed6369e0377a10dd451af | diff --git a/unfriendly/__init__.py b/unfriendly/__init__.py
index <HASH>..<HASH> 100644
--- a/unfriendly/__init__.py
+++ b/unfriendly/__init__.py
@@ -1,2 +1,2 @@
-VERSION = (0, 2)
+VERSION = (0, 2, 1)
__version__ = '.'.join([str(x) for x in VERSION]) | Bumped version -> <I> | tomatohater_django-unfriendly | train | py |
a5545f9772ab669f98056f74fb008933ce0479c9 | diff --git a/openid/httpclient.py b/openid/httpclient.py
index <HASH>..<HASH> 100644
--- a/openid/httpclient.py
+++ b/openid/httpclient.py
@@ -33,38 +33,35 @@ def getHTTPClient():
return ParanoidHTTPClient()
class SimpleHTTPClient(HTTPClient):
+ def _fetch(self, req):
+ f = urllib2.urlopen(req)
+ try:
+ data = f.read()
+ finally:
+ f.close()
+ return (f.geturl(), data)
+
def get(self, url):
try:
- f = urllib2.urlopen(url)
- try:
- data = f.read()
- finally:
- f.close()
+ return self._fetch(url)
except urllib2.HTTPError, why:
why.close()
return None
- return (f.geturl(), data)
-
def post(self, url, body):
req = urllib2.Request(url, body)
try:
- f = urllib2.urlopen(req)
- try:
- data = f.read()
- finally:
- f.close()
+ return self._fetch(req)
except urllib2.HTTPError, why:
try:
if why.code == 400:
data = why.read()
+ return (why.geturl(), data)
else:
return None
finally:
why.close()
- return (f.geturl(), data)
-
class ParanoidHTTPClient(HTTPClient):
"""A paranoid HTTPClient that uses pycurl for fecthing.
See http://pycurl.sourceforge.net/""" | [project @ Fix SimpleHTTPClient.post's handling of <I> error responses] | openid_python-openid | train | py |
db02792f03a0452cfbb6ba506f5e006887bb2542 | diff --git a/addon/faker.js b/addon/faker.js
index <HASH>..<HASH> 100644
--- a/addon/faker.js
+++ b/addon/faker.js
@@ -16,18 +16,6 @@ var list = {
}
};
+faker.list = list;
-export default {
- name: faker.name,
- address: faker.address,
- phone: faker.phone,
- internet: faker.internet,
- company: faker.company,
- image: faker.image,
- lorem: faker.lorem,
- date: faker.date,
- random: faker.random,
- finance: faker.finance,
- hacker: faker.hacker,
- list: list
-};
+export default faker; | Expose all of faker via shim.
Resolves #<I> | samselikoff_ember-cli-mirage | train | js |
bc6516e7781e0aa99fd2f87e294dbdff10c6a1bd | diff --git a/lib/setup.js b/lib/setup.js
index <HASH>..<HASH> 100644
--- a/lib/setup.js
+++ b/lib/setup.js
@@ -45,7 +45,11 @@ function setup_test_instance(opt, cb) {
return;
}
- bounce(support_port, { headers: { connection: 'close' }});
+ var opts = {};
+ if (req.headers.connection !== 'Upgrade') {
+ opts.headers = { connection: 'close' };
+ }
+ bounce(support_port, opts);
});
bouncer.listen(bouncer_port, bouncer_active); | Allow upgrade requests to bounce through unchanged
This fixes web socket requests that proxy through zuul to the support
server | airtap_airtap | train | js |
afbf6bfdc72bf15e9402db43cb5de8b927cd1443 | diff --git a/src/Symfony/Component/HttpFoundation/Response.php b/src/Symfony/Component/HttpFoundation/Response.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/HttpFoundation/Response.php
+++ b/src/Symfony/Component/HttpFoundation/Response.php
@@ -64,6 +64,7 @@ class Response
415 => 'Unsupported Media Type',
416 => 'Requested Range Not Satisfiable',
417 => 'Expectation Failed',
+ 418 => 'I\'m a teapot',
500 => 'Internal Server Error',
501 => 'Not Implemented',
502 => 'Bad Gateway', | Added missing HTTP status code <I> | symfony_symfony | train | php |
75c635b7aa0c5fd779b1735ff01b69cdbd892d0a | diff --git a/sos/plugins/general.py b/sos/plugins/general.py
index <HASH>..<HASH> 100644
--- a/sos/plugins/general.py
+++ b/sos/plugins/general.py
@@ -32,7 +32,12 @@ class General(Plugin):
"/etc/os-release"
])
- self.add_cmd_output("hostname", root_symlink="hostname")
+ self.add_cmd_output(
+ "hostname -f",
+ root_symlink="hostname",
+ suggest_filename="hostname"
+ )
+
self.add_cmd_output("date", root_symlink="date")
self.add_cmd_output("uptime", root_symlink="uptime") | Try to ensure FQDN of host is collected
Not all systems are required to have the generic hostname command return
the FQDN. We have encountered customers who require the a short name by
default. Adding the "-f" output helps to get that information. | sosreport_sos | train | py |
6db8fd82f54daf130a4597283fd22739d8deb791 | diff --git a/openstack_dashboard/settings.py b/openstack_dashboard/settings.py
index <HASH>..<HASH> 100644
--- a/openstack_dashboard/settings.py
+++ b/openstack_dashboard/settings.py
@@ -229,6 +229,11 @@ USE_I18N = True
USE_L10N = True
USE_TZ = True
+LOCALE_PATHS = [
+ 'horizon/locale',
+ 'openstack_dashboard/locale',
+]
+
OPENSTACK_KEYSTONE_DEFAULT_ROLE = '_member_'
DEFAULT_EXCEPTION_REPORTER_FILTER = 'horizon.exceptions.HorizonReporterFilter' | Add LOCALE_PATHS to settings
manage.py compilemessages doesn't seem to function without this setting
Change-Id: I0efad<I>e6dee<I>a<I>e<I>ef0d<I>
Closes-Bug: <I> | openstack_horizon | train | py |
f0917aa854d755af8195e3b987750d523344470c | diff --git a/src/Commands/RestoreRevisions.php b/src/Commands/RestoreRevisions.php
index <HASH>..<HASH> 100644
--- a/src/Commands/RestoreRevisions.php
+++ b/src/Commands/RestoreRevisions.php
@@ -9,6 +9,7 @@ use Mediawiki\Bot\Config\AppConfig;
use Mediawiki\DataModel\Content;
use Mediawiki\DataModel\EditInfo;
use Mediawiki\DataModel\Revision;
+use RuntimeException;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
@@ -50,6 +51,13 @@ class RestoreRevisions extends Command {
$userDetails = $this->appConfig->get( 'users.' . $user );
$wikiDetails = $this->appConfig->get( 'wikis.' . $wiki );
+ if( $userDetails === null ) {
+ throw new RuntimeException( 'User not found in config' );
+ }
+ if( $wikiDetails === null ) {
+ throw new RuntimeException( 'Wiki not found in config' );
+ }
+
$api = new MediawikiApi( $wikiDetails['url'] );
$loggedIn = $api->login( new ApiUser( $userDetails['username'], $userDetails['password'] ) );
if( !$loggedIn ) { | Die if wiki or user is not configured | addwiki_addwiki | train | php |
68da64c88feb67ca906c16dec5ff45f819971c7b | diff --git a/plenum/common/util.py b/plenum/common/util.py
index <HASH>..<HASH> 100644
--- a/plenum/common/util.py
+++ b/plenum/common/util.py
@@ -262,12 +262,6 @@ def distributedConnectionMap(names: List[str]) -> OrderedDict:
def checkPortAvailable(ha):
"""Checks whether the given port is available"""
- def logErrorAndRaise(e, msg=None):
- erroMsg = msg or "Checked port availability for opening and address, " \
- "got error: {}".format(str(e))
- logging.warning(erroMsg)
- raise e
-
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
sock.bind(ha)
@@ -611,3 +605,9 @@ def check_endpoint_valid(endpoint, required: bool=True):
raise InvalidEndpointIpAddress(endpoint) from exc
if not (port.isdigit() and int(port) in range(1, 65536)):
raise InvalidEndpointPort(endpoint)
+
+
+def getFormattedErrorMsg(msg):
+ msgHalfLength = int(len(msg) / 2)
+ errorLine = "-" * msgHalfLength + "ERROR" + "-" * msgHalfLength
+ return "\n\n" + errorLine + "\n " + msg + "\n" + errorLine + "\n"
\ No newline at end of file | added a helper method to print more readable/noticable error on agent console, refactored checkPortAvailable function as well | hyperledger_indy-plenum | train | py |
06a31ba272866ee7052b53f7e3162ceb590491f1 | diff --git a/pandas/tests/test_common.py b/pandas/tests/test_common.py
index <HASH>..<HASH> 100644
--- a/pandas/tests/test_common.py
+++ b/pandas/tests/test_common.py
@@ -254,6 +254,9 @@ def test_pprint_thing():
# GH #2038
assert not "\t" in pp_t("a\tb")
+ assert not "\n" in pp_t("a\nb")
+ assert "\n" in pp_t("a\nb",escape_chars=("\t",))
+
class TestTake(unittest.TestCase):
_multiprocess_can_split_ = True | TST: more escaping in com.pprint_thing() | pandas-dev_pandas | train | py |
a4fd2ab40c15853c5bca017f274145203e24a270 | diff --git a/src/toil/batchSystems/slurm.py b/src/toil/batchSystems/slurm.py
index <HASH>..<HASH> 100644
--- a/src/toil/batchSystems/slurm.py
+++ b/src/toil/batchSystems/slurm.py
@@ -269,7 +269,7 @@ class SlurmBatchSystem(BatchSystemSupport):
# Closes the file handle associated with the results file.
self.slurmResultsFileHandle.close()
- def issueBatchJob(self, command, memory, cores, disk):
+ def issueBatchJob(self, command, memory, cores, disk, preemptable):
self.checkResourceRequest(memory, cores, disk)
jobID = self.nextJobID
self.nextJobID += 1 | Fix missing argument in SLURM method signature | DataBiosphere_toil | train | py |
d42f27ad40aa23261a80e7f1aa53ee8ee003afb8 | diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Order.php b/lib/Alchemy/Phrasea/Controller/Prod/Order.php
index <HASH>..<HASH> 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Order.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Order.php
@@ -155,9 +155,10 @@ class Order implements ControllerProviderInterface
try {
$records = RecordsRequest::fromRequest($app, $request, true, array('cancmd'));
- $query = new \User_Query($app);
foreach ($records as $key => $record) {
+ $query = new \User_Query($app);
+
if ($collectionHasOrderAdmins->containsKey($record->get_base_id())) {
if (!$collectionHasOrderAdmins->get($record->get_base_id())) {
$records->remove($key);
@@ -182,8 +183,8 @@ class Order implements ControllerProviderInterface
}
$noAdmins = $collectionHasOrderAdmins->forAll(function ($key, $hasAdmin) {
- return false === $hasAdmin;
- });
+ return false === $hasAdmin;
+ });
if ($noAdmins) {
$msg = _('There is no one to validate orders, please contact an administrator'); | Fix PHRAS-<I> Order of a basket generates an error when the content comes from two different collections | alchemy-fr_Phraseanet | train | php |
4c08e7da5d89eefd011530cd23f66356e2d3f033 | diff --git a/Tests/FeaturesTest.php b/Tests/FeaturesTest.php
index <HASH>..<HASH> 100644
--- a/Tests/FeaturesTest.php
+++ b/Tests/FeaturesTest.php
@@ -2,6 +2,7 @@
namespace Mapbender\DataSourceBundle\Tests;
use Mapbender\DataSourceBundle\Component\FeatureType;
+use Mapbender\DataSourceBundle\Component\FeatureTypeService;
use Mapbender\DataSourceBundle\Entity\Feature;
use Symfony\Bundle\FrameworkBundle\Client;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
@@ -42,8 +43,9 @@ class FeaturesTest extends WebTestCase
self::markTestSkipped("No feature declaration found");
return;
}
+ $fts = new FeatureTypeService(self::$container, self::$definitions);
- self::$featureType = self::$container->get('features')->get(key(self::$definitions));
+ self::$featureType = $fts->getDataStoreByName(key(self::$definitions));
self::$fieldName = current(self::$featureType->getFields());
} | Remove test assumption on "features" service existance | mapbender_data-source | train | php |
7794fc8566daa7274a72a62b554a00b53396c338 | diff --git a/tasks/package.js b/tasks/package.js
index <HASH>..<HASH> 100644
--- a/tasks/package.js
+++ b/tasks/package.js
@@ -16,7 +16,7 @@ module.exports = function(grunt) {
mode: 'tgz'
},
files: [
- {expand: true, cwd: '<%= config.buildPaths.html %>', src: ['**', '!sites/*/files/**'], dest: 'docroot/'},
+ {expand: true, cwd: '<%= config.buildPaths.html %>', src: ['**', '!sites/*/files/**', '!xmlrpc.php', '!modules/php/*'], dest: 'docroot/'},
{expand: true, src: ['README*', 'bin/**']}
]
} | Blacklist xmlrpc.php and PHP module from packaging. | phase2_grunt-drupal-tasks | train | js |
c37f7705856bd82f5416cef4bb82e1786c3f508c | diff --git a/tests/__init__.py b/tests/__init__.py
index <HASH>..<HASH> 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -16,3 +16,8 @@ import logging
log = logging.getLogger()
log.setLevel('DEBUG')
+# if nose didn't already attach a log handler, add one here
+if not log.handlers:
+ handler = logging.StreamHandler()
+ handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s [%(module)s:%(lineno)s]: %(message)s'))
+ log.addHandler(handler) | Add test logger if not added by nose | datastax_python-driver | train | py |
f22f67182391cca7e826f05a2bd1079c48aa5279 | diff --git a/src/Rebing/GraphQL/Support/Type.php b/src/Rebing/GraphQL/Support/Type.php
index <HASH>..<HASH> 100644
--- a/src/Rebing/GraphQL/Support/Type.php
+++ b/src/Rebing/GraphQL/Support/Type.php
@@ -39,7 +39,7 @@ class Type extends Fluent
return [];
}
- protected function getFieldResolver($name, $field)
+ protected function getFieldResolver(string $name, array $field): ?callable
{
if (isset($field['resolve'])) {
return $field['resolve'];
@@ -64,6 +64,8 @@ class Type extends Fluent
return $type->{$alias};
};
}
+
+ return null;
}
public function getFields() | Add types to \Rebing\GraphQL\Support\Type::getFieldResolver | rebing_graphql-laravel | train | php |
37994a4efc000f16a1182d7497ce7c0010dcbdd1 | diff --git a/cfgrib/dataset.py b/cfgrib/dataset.py
index <HASH>..<HASH> 100644
--- a/cfgrib/dataset.py
+++ b/cfgrib/dataset.py
@@ -447,12 +447,6 @@ class Dataset(object):
stream = messages.FileStream(path, message_class=cfmessage.CfMessage, errors=errors)
return cls(*build_dataset_components(stream, **flavour_kwargs))
- @classmethod
- def frompath(cls, *args, **kwargs):
- """Deprecated! Use `.from_path` instead."""
- warnings.warn(".frompath is deprecated, use .from_path instead", FutureWarning)
- return cls.from_path(*args, **kwargs)
-
def open_file(path, **kwargs):
"""Open a GRIB file as a ``cfgrib.Dataset``.""" | Drop a deprecated alpha interface. | ecmwf_cfgrib | train | py |
a9edd6cf932b299e28677cb1e0af397c533caffe | diff --git a/activerecord/test/cases/identity_map_test.rb b/activerecord/test/cases/identity_map_test.rb
index <HASH>..<HASH> 100644
--- a/activerecord/test/cases/identity_map_test.rb
+++ b/activerecord/test/cases/identity_map_test.rb
@@ -26,10 +26,13 @@ class IdentityMapTest < ActiveRecord::TestCase
:posts, :tags, :taggings, :comments, :subscribers
def test_find_id
- assert_same(
- Client.find(3),
- Client.find(3)
- )
+ assert_same(Client.find(3), Client.find(3))
+ end
+
+ def test_find_id_without_identity_map
+ IdentityMap.without do
+ assert_not_same(Client.find(3), Client.find(3))
+ end
end
def test_find_pkey | Add test to show that when IdentityMap is disabled finders returns different objects. | rails_rails | train | rb |
f88e941abebc428648b31055f9401d0d665480c6 | diff --git a/lib/travis/cli.rb b/lib/travis/cli.rb
index <HASH>..<HASH> 100644
--- a/lib/travis/cli.rb
+++ b/lib/travis/cli.rb
@@ -20,7 +20,8 @@ module Travis
end
def command(name)
- constant = CLI.const_get(command_name(name)) rescue nil
+ const_name = command_name(name)
+ constant = CLI.const_get(const_name) if const_defined? const_name
if command? constant
constant
else | don't swallow exceptions when loading command | travis-ci_travis.rb | train | rb |
e650878aee11c3b326887e6b717e27fb3d6e78a8 | diff --git a/modules/social_features/social_tagging/src/Plugin/Block/SocialGroupTagsBlock.php b/modules/social_features/social_tagging/src/Plugin/Block/SocialGroupTagsBlock.php
index <HASH>..<HASH> 100644
--- a/modules/social_features/social_tagging/src/Plugin/Block/SocialGroupTagsBlock.php
+++ b/modules/social_features/social_tagging/src/Plugin/Block/SocialGroupTagsBlock.php
@@ -75,9 +75,15 @@ class SocialGroupTagsBlock extends BlockBase implements ContainerFactoryPluginIn
*/
protected function blockAccess(AccountInterface $account) {
// If tagging is off, deny access always.
- if (!$this->tagService->active()) {
+ if (!$this->tagService->active() || !$this->tagService->groupActive()) {
return AccessResult::forbidden();
}
+
+ // Don't display on group edit.
+ if ($this->routeMatch->getRouteName() == 'entity.group.edit_form') {
+ return AccessResult::forbidden();
+ }
+
// Get group from route.
$group = $this->routeMatch->getParameter('group'); | <I> by jochemvn: Don't display block on edit group page AND when group tags are turned off | goalgorilla_open_social | train | php |
ce160b37e15ddb86c45314d080718f833e551aa3 | diff --git a/libcontainerd/remote_linux.go b/libcontainerd/remote_linux.go
index <HASH>..<HASH> 100644
--- a/libcontainerd/remote_linux.go
+++ b/libcontainerd/remote_linux.go
@@ -50,6 +50,7 @@ type remote struct {
eventTsPath string
pastEvents map[string]*containerd.Event
runtimeArgs []string
+ daemonWaitCh chan struct{}
}
// New creates a fresh instance of libcontainerd remote.
@@ -129,6 +130,7 @@ func (r *remote) handleConnectionChange() {
transientFailureCount = 0
if utils.IsProcessAlive(r.daemonPid) {
utils.KillProcess(r.daemonPid)
+ <-r.daemonWaitCh
}
if err := r.runContainerdDaemon(); err != nil { //FIXME: Handle error
logrus.Errorf("error restarting containerd: %v", err)
@@ -388,7 +390,11 @@ func (r *remote) runContainerdDaemon() error {
return err
}
- go cmd.Wait() // Reap our child when needed
+ r.daemonWaitCh = make(chan struct{})
+ go func() {
+ cmd.Wait()
+ close(r.daemonWaitCh)
+ }() // Reap our child when needed
r.daemonPid = cmd.Process.Pid
return nil
} | Wait for containerd to die before restarting it | moby_moby | train | go |
db8cd4e8c5afc1778bc88fc2dccdcd59206720aa | diff --git a/tests/src/test/java/org/sonarqube/tests/upgrade/UpgradeTest.java b/tests/src/test/java/org/sonarqube/tests/upgrade/UpgradeTest.java
index <HASH>..<HASH> 100644
--- a/tests/src/test/java/org/sonarqube/tests/upgrade/UpgradeTest.java
+++ b/tests/src/test/java/org/sonarqube/tests/upgrade/UpgradeTest.java
@@ -205,7 +205,7 @@ public class UpgradeTest {
private void scanProject() {
MavenBuild build = MavenBuild.create(new File("projects/struts-1.3.9-diet/pom.xml"))
- .setCleanSonarGoals()
+ .setCleanPackageSonarGoals()
// exclude pom.xml, otherwise it will be published in SQ 6.3+ and not in previous versions, resulting in a different number of components
.setProperty("sonar.exclusions", "**/pom.xml")
.setProperty("sonar.dynamicAnalysis", "false") | Add "clean package" goals before analysing project
The Java plugin now requires compiled classes | SonarSource_sonarqube | train | java |
b75f5f44e9c76dc3237749737f5a2a1d894bac59 | diff --git a/src/sap.m/src/sap/m/Input.js b/src/sap.m/src/sap/m/Input.js
index <HASH>..<HASH> 100644
--- a/src/sap.m/src/sap/m/Input.js
+++ b/src/sap.m/src/sap/m/Input.js
@@ -1564,7 +1564,7 @@ function(
// Close the ValueStateMessage when the suggestion popup is being opened.
// Only do this in case a popup is used.
if (!this._bUseDialog && this._oSuggPopover
- && this._oSuggPopover._oPopover.isOpen()) {
+ && this._oSuggPopover._oPopover && this._oSuggPopover._oPopover.isOpen()) {
this.closeValueStateMessage();
} | [INTERNAL][FIX] sap.m.SuggestionsPopover: onfocusin function corrected
The input may receive focus when the suggestions popover is instantiated
but the internal _oPopover is still not available.
Change-Id: Ia0e<I>a7a8ca3f8a0c<I>adfdbaf0ddca<I>a<I>
BCP: <I> | SAP_openui5 | train | js |
41febdfdfb9dcf5c8a108e8b818b8c67f408179d | diff --git a/cli/cmd/service.go b/cli/cmd/service.go
index <HASH>..<HASH> 100644
--- a/cli/cmd/service.go
+++ b/cli/cmd/service.go
@@ -839,7 +839,7 @@ func (c *ServicedCli) cmdServiceRestart(ctx *cli.Context) {
if err := c.driver.StopRunningService(runningSvc.HostID, runningSvc.ID); err != nil {
fmt.Fprintln(os.Stderr, err)
} else {
- fmt.Printf("Restarting service\n")
+ fmt.Printf("Restarting 1 service(s)\n")
}
}
} | Make message consistent with non-instance case | control-center_serviced | train | go |
7af11a65150d1bcd208ce05ad8de5e797ae2f26d | diff --git a/snuggs/__init__.py b/snuggs/__init__.py
index <HASH>..<HASH> 100644
--- a/snuggs/__init__.py
+++ b/snuggs/__init__.py
@@ -201,9 +201,7 @@ def handleLine(line):
msg = "expected a function or operator"
err = ExpressionError(msg)
err.text = line
- err.filename = "<string>"
err.offset = int(m.group(2)) + 1
- err.lineno = int(m.group(3))
raise err | No need to set filename or lineno.
We're not using these anywhere. | mapbox_snuggs | train | py |
dae8c08cf2fcf2b3741e8ce3c86e54f57d890fc4 | diff --git a/gffutils/db.py b/gffutils/db.py
index <HASH>..<HASH> 100644
--- a/gffutils/db.py
+++ b/gffutils/db.py
@@ -61,17 +61,30 @@ class DBCreator(object):
child text,
level int,
primary key(parent,child,level) );
+
+ CREATE TABLE meta (
+ filetype text
+ );
''')
self.conn.commit()
+
+ def set_filetype(self):
+ c = self.conn.cursor()
+ c.execute('''
+ INSERT INTO meta VALUES (?)''', (self.filetype,))
+ self.conn.commit()
+
def create(self):
self.init_tables()
self.populate_from_features(self.features)
self.update_relations()
+ self.set_filetype()
class GFFDBCreator(DBCreator):
def __init__(self, *args, **kwargs):
+ self.filetype = 'gff'
DBCreator.__init__(self, *args, **kwargs)
def populate_from_features(self, features): | added "meta" table to db when created for storing filetype | daler_gffutils | train | py |
8d9efd9c0f09c227a891934e50564a68539854ab | diff --git a/misc/utils.py b/misc/utils.py
index <HASH>..<HASH> 100644
--- a/misc/utils.py
+++ b/misc/utils.py
@@ -76,6 +76,13 @@ def get_hierarchy_uploader(root):
"""
Returns uploader, that uses get_hierarch_path to store files
"""
+ # Workaround to avoid Django 1.7 makemigrations wierd behaviour:
+ # More details: https://code.djangoproject.com/ticket/22436
+ import sys
+ if len(sys.argv) > 1 and sys.argv[1] in ('makemigrations', 'migrate'):
+ # Hide ourselves from Django migrations
+ return None
+
from pymisc.utils.files import get_hierarchy_path
def upload_to(instance, filename):
file_name, file_ext = os.path.splitext(filename) | Added a workaround for Django <I> in get_hierarchy_uploader | ilblackdragon_django-misc | train | py |
8b4c3e752bf1bc1360f26b78f00bc0cb60e3ade5 | diff --git a/steam_idle_qt/steam_idle.py b/steam_idle_qt/steam_idle.py
index <HASH>..<HASH> 100755
--- a/steam_idle_qt/steam_idle.py
+++ b/steam_idle_qt/steam_idle.py
@@ -237,6 +237,8 @@ def main_idle(apps):
p = Idle(appid, args)
p.start()
processes.append((endtime, p))
+ # Steam client will crash if childs spawn too fast; Fixes #1
+ sleep(1)
if args.verbose:
print('Multi-Ideling %d apps' % len(processes)) | Steam client will crash if childs spawn too fast; Fixes #1 | jayme-github_steam_idle | train | py |
1d7c2eac2d849dab40b35db95eab0dc00eba07fd | diff --git a/promise-stream.js b/promise-stream.js
index <HASH>..<HASH> 100644
--- a/promise-stream.js
+++ b/promise-stream.js
@@ -11,7 +11,9 @@ function mixinPromise (Promise, stream) {
obj[MAKEPROMISE] = function () {
this[PROMISE] = new Promise((resolve, reject) => {
- this.once('finish', resolve)
+ this.once('result', resolve)
+ // finish should always lose any race w/ result
+ this.once('finish', () => setImmediate(resolve))
this.once('error', reject)
})
} | promise-stream: Make sure finish always loses races w/ result | iarna_funstream | train | js |
ff514171fc46f3190f2be47f2694fde431ae2d80 | diff --git a/source/application/translations/de/lang.php b/source/application/translations/de/lang.php
index <HASH>..<HASH> 100644
--- a/source/application/translations/de/lang.php
+++ b/source/application/translations/de/lang.php
@@ -280,7 +280,6 @@ $aLang = array(
'LOGIN_WITH' => 'Anmelden mit',
'LOGOUT' => 'Abmelden',
'LOW_STOCK' => 'Wenige Exemplare auf Lager - schnell bestellen!',
-'MAKE_PAYMENT' => 'Zahlung durchf�hren',
'MANUFACTURER' => 'Hersteller',
'MANUFACTURER_S' => '| Hersteller: %s',
'MANY_GREETINGS' => 'Viele Gr��e,', | Deleted 'MAKE_PAYMENT' as it occured in lang files only | OXID-eSales_oxideshop_ce | train | php |
192755960ab8d89e05662d80af2593dbdf527a16 | diff --git a/applications/jupyter-extension/nteract_on_jupyter/nteractapp.py b/applications/jupyter-extension/nteract_on_jupyter/nteractapp.py
index <HASH>..<HASH> 100644
--- a/applications/jupyter-extension/nteract_on_jupyter/nteractapp.py
+++ b/applications/jupyter-extension/nteract_on_jupyter/nteractapp.py
@@ -14,7 +14,7 @@ from .utils import cmd_in_new_dir
webpack_port = 8357
-webpack_hot = {"address": f'http://localhost:{webpack_port}/',
+webpack_hot = {"address": 'http://localhost:{webpack_port}/'.format(webpack_port=webpack_port),
"command": ["yarn", "workspace", "nteract-on-jupyter",
"run", "hot", "--port", str(webpack_port)]}
nteract_flags = dict(flags)
@@ -74,7 +74,7 @@ class NteractApp(NotebookApp):
pass
else:
raise Exception(
- f"Webpack dev server exited - return code {exit_code}")
+ "Webpack dev server exited - return code {exit_code}".format(exit_code=exit_code))
# Now wait for webpack to have the initial bundle mostly ready
time.sleep(5) | Fix compatibility with python < <I> | nteract_nteract | train | py |
60aebf3b26a4d7dd50412c029bac9e2a83148534 | diff --git a/nodes/ccu-connection.js b/nodes/ccu-connection.js
index <HASH>..<HASH> 100644
--- a/nodes/ccu-connection.js
+++ b/nodes/ccu-connection.js
@@ -614,7 +614,7 @@ module.exports = function (RED) {
regaPoll() {
this.logger.trace('regaPoll');
if (this.regaPollPending) {
- this.logger.error('rega poll already pending');
+ this.logger.warn('rega poll already pending');
} else {
this.regaPollPending = true;
clearTimeout(this.regaPollTimeout); | reduce "rega poll already pending" severity to warning | rdmtc_node-red-contrib-ccu | train | js |
a0cf6e6d8e2975a561d81e0744a09d3d08344404 | diff --git a/user/config-sample.php b/user/config-sample.php
index <HASH>..<HASH> 100644
--- a/user/config-sample.php
+++ b/user/config-sample.php
@@ -61,6 +61,10 @@ $yourls_user_passwords = array(
'username2' => 'password2' // You can have one or more 'login'=>'password' lines
);
+/** Debug mode to output some internal information
+ ** Default is false for live site. Enable when coding or before submitting a new issue */
+define( 'YOURLS_DEBUG', false );
+
/*
** URL Shortening settings
*/ | Add emphasis on turning debug on prior to submitting an issue | YOURLS_YOURLS | train | php |
fbc449204b5d429b8794c8cba528fa583585e129 | diff --git a/source/jsCalendar.js b/source/jsCalendar.js
index <HASH>..<HASH> 100644
--- a/source/jsCalendar.js
+++ b/source/jsCalendar.js
@@ -716,6 +716,7 @@ var jsCalendar = (function(){
// Update calendar
JsCalendar.prototype._update = function() {
+ if (true === this._isFrozen) return this;
// Get month info
var month = this._getVisibleMonth(this._date);
// Save data
@@ -956,8 +957,6 @@ var jsCalendar = (function(){
// Refresh
// Safe _update
JsCalendar.prototype.refresh = function(date) {
- if (true === this._isFrozen) return this;
-
// If date provided
if (typeof date !== 'undefined') {
// If date is in range | checking freeze state should be done in the _update function | GramThanos_jsCalendar | train | js |
33b9a83669a9328a502fd7a76b0e0f8e21e7d507 | diff --git a/shoebot/grammar/bot.py b/shoebot/grammar/bot.py
index <HASH>..<HASH> 100644
--- a/shoebot/grammar/bot.py
+++ b/shoebot/grammar/bot.py
@@ -105,6 +105,8 @@ class Bot(Grammar):
def __init__(self, canvas, namespace = None):
Grammar.__init__(self, canvas, namespace)
+ canvas.set_bot(self)
+
self._autoclosepath = True
self._path = None
diff --git a/shoebot/sbot.py b/shoebot/sbot.py
index <HASH>..<HASH> 100644
--- a/shoebot/sbot.py
+++ b/shoebot/sbot.py
@@ -70,6 +70,5 @@ def run(src, grammar = NODEBOX, format = None, outputfile = None, iterations = N
#SHOEBOT : Shoebot,
}
bot = BOT_CLASSES[grammar](canvas)
- canvas.set_bot(bot)
bot.sb_run(src, iterations, run_forever = window if close_window == False else False, frame_limiter = window) | Call set_bot from inside bot instead of outside (should make usage easier) | shoebot_shoebot | train | py,py |
ac2e5481e28b6b91799ac73b7a4965253ec7c81b | diff --git a/spec/integration/relationship_many_to_many_through_spec.rb b/spec/integration/relationship_many_to_many_through_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/integration/relationship_many_to_many_through_spec.rb
+++ b/spec/integration/relationship_many_to_many_through_spec.rb
@@ -20,11 +20,11 @@ describe 'Relationship - Many To Many with generated mappers' do
insert_song_tag 2, 2, 2
class Song
- attr_reader :id, :title, :tags, :infos, :info_contents, :good_info_contents
+ attr_reader :id, :title, :tags, :good_tags, :infos, :good_infos, :info_contents, :good_info_contents
def initialize(attributes)
- @id, @title, @tags, @infos, @info_contents, @good_info_contents = attributes.values_at(
- :id, :title, :tags, :infos, :info_contents, :good_info_contents
+ @id, @title, @tags, @good_tags, @infos, @good_infos, @info_contents, @good_info_contents = attributes.values_at(
+ :id, :title, :tags, :good_tags, :infos, :good_infos, :info_contents, :good_info_contents
)
end
end | Add missing ivar (initialization) in m2m_through_spec | rom-rb_rom | train | rb |
fe2b6493f3b20c3d6b01d6f519f02caec4bb08a5 | diff --git a/IronCore.class.php b/IronCore.class.php
index <HASH>..<HASH> 100644
--- a/IronCore.class.php
+++ b/IronCore.class.php
@@ -42,6 +42,7 @@ class IronCore{
public $max_retries = 5;
public $debug_enabled = false;
+ public $ssl_verifypeer = true;
protected static function dateRfc3339($timestamp = 0) {
@@ -200,7 +201,7 @@ class IronCore{
curl_setopt($s, CURLOPT_URL, $fullUrl);
break;
}
- curl_setopt($s, CURLOPT_SSL_VERIFYPEER, false);
+ curl_setopt($s, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);
curl_setopt($s, CURLOPT_RETURNTRANSFER, true);
curl_setopt($s, CURLOPT_HTTPHEADER, $this->compiledHeaders());
return $this->callWithRetries($s); | ssl_verifypeer support | iron-io_iron_core_php | train | php |
91c644f1949381d961ef17354e0e1a3b8be95e53 | diff --git a/terraform/version.go b/terraform/version.go
index <HASH>..<HASH> 100644
--- a/terraform/version.go
+++ b/terraform/version.go
@@ -1,9 +1,9 @@
package terraform
// The main version number that is being run at the moment.
-const Version = "0.6.15"
+const Version = "0.6.16"
// A pre-release marker for the version. If this is "" (empty string)
// then it means that it is a final release. Otherwise, this is a pre-release
// such as "dev" (in development), "beta", "rc1", etc.
-const VersionPrerelease = ""
+const VersionPrerelease = "dev" | release: clean up after <I> | hashicorp_terraform | train | go |
5263c73e2eadfb9cabdf52d3cfcf1dc7e2832e44 | diff --git a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowNotification.java b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowNotification.java
index <HASH>..<HASH> 100644
--- a/shadows/framework/src/main/java/org/robolectric/shadows/ShadowNotification.java
+++ b/shadows/framework/src/main/java/org/robolectric/shadows/ShadowNotification.java
@@ -43,8 +43,7 @@ public class ShadowNotification {
if (getApiLevel() >= N) {
return realNotification.extras.getCharSequence(Notification.EXTRA_INFO_TEXT);
} else {
- String resourceName = getApiLevel() >= N ? "header_text" : "info";
- return findText(applyContentView(), resourceName);
+ return findText(applyContentView(), "info");
}
}
@@ -72,8 +71,7 @@ public class ShadowNotification {
if (getApiLevel() >= N) {
return realNotification.extras.getCharSequence(Notification.EXTRA_SUMMARY_TEXT);
} else {
- String resourceName = getApiLevel() >= N ? "header_text" : "text";
- return findText(applyBigContentView(), resourceName);
+ return findText(applyBigContentView(), "text");
}
} | Cleaned up dead and unreachable code in ShadowNotification | robolectric_robolectric | train | java |
2850995062b8dbefac70bf56aecc2ceb429cf974 | diff --git a/discord/http.py b/discord/http.py
index <HASH>..<HASH> 100644
--- a/discord/http.py
+++ b/discord/http.py
@@ -193,8 +193,8 @@ class HTTPClient:
continue
- # we've received a 502, unconditional retry
- if r.status == 502 and tries <= 5:
+ # we've received a 500 or 502, unconditional retry
+ if r.status in {500, 502} and tries <= 5:
yield from asyncio.sleep(1 + tries * 2, loop=self.loop)
continue | Retry on <I> in HTTPClient.request
Discord official client retries on <I>, so worst case scenario, we're
not any worse than the official client which seriously outnumbers us. | Rapptz_discord.py | train | py |
becf73746ec3a733018b0c2e1002f68444a5e18b | diff --git a/lxd/container.go b/lxd/container.go
index <HASH>..<HASH> 100644
--- a/lxd/container.go
+++ b/lxd/container.go
@@ -1402,14 +1402,6 @@ func (c *containerLXD) applyProfile(p string) error {
k = r[0].(string)
v = r[1].(string)
- shared.Debugf("Applying %s: %s", k, v)
- if k == "raw.lxc" {
- if _, ok := c.config["raw.lxc"]; ok {
- shared.Debugf("Ignoring overridden raw.lxc from profile '%s'", p)
- continue
- }
- }
-
config[k] = v
} | Drop annoying debug and dead code
The special case of raw.lxc there isn't needed as the default behavior
(apply all profiles, then override with container config) already takes
care of this. | lxc_lxd | train | go |
0663c727451814244b0a37a4d9a575967eb8c507 | diff --git a/lib/ruboto/util/update.rb b/lib/ruboto/util/update.rb
index <HASH>..<HASH> 100644
--- a/lib/ruboto/util/update.rb
+++ b/lib/ruboto/util/update.rb
@@ -159,6 +159,7 @@ EOF
end
if min_sdk.to_i >= 11
verify_manifest.elements['application'].attributes['android:hardwareAccelerated'] ||= 'true'
+ verify_manifest.elements['application'].attributes['android:largeHeap'] ||= 'true'
end
app_element = verify_manifest.elements['application']
if app_element.elements["activity[@android:name='org.ruboto.RubotoActivity']"]
@@ -177,10 +178,6 @@ EOF
else
verify_manifest.add_element 'uses-sdk', {"android:minSdkVersion" => min_sdk, "android:targetSdkVersion" => target}
end
- # # <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
- # unless sdcard_permission_element = verify_manifest.elements["uses-permission[@android:name='android.permission.WRITE_EXTERNAL_STORAGE']"]
- # verify_manifest.add_element 'uses-permission', {"android:name" => 'android.permission.WRITE_EXTERNAL_STORAGE'}
- # end
save_manifest
end
end | * Issue #<I> Increase max heap size for Android 3 devices | ruboto_ruboto | train | rb |
3aa9ac50fd3255fbf5695a1aaab61fd1b818c300 | diff --git a/example.py b/example.py
index <HASH>..<HASH> 100644
--- a/example.py
+++ b/example.py
@@ -56,6 +56,12 @@ exampleTimeTicks = agent.TimeTicks("EXAMPLE-MIB::exampleTimeTicks")
exampleIPAddress = agent.IPAddress("EXAMPLE-MIB::exampleIPAddress")
exampleString = agent.DisplayString("EXAMPLE-MIB::exampleString")
+# Just to verify that all variables were created successfully. You wouldn't
+# need to do this in production code.
+print "Registered SNMP variables: "
+vars = agent.getVars().__str__()
+print vars.replace("},", "}\n")
+
# Finally, we tell the agent to "start". This actually connects the
# agent to the master agent.
agent.start() | Let example.py print the registered vars for debugging and ease of use | pief_python-netsnmpagent | train | py |
630582ab9007f7a063f9a735a1ff01aa47ffb8d1 | diff --git a/lib/jsonld-signatures.js b/lib/jsonld-signatures.js
index <HASH>..<HASH> 100644
--- a/lib/jsonld-signatures.js
+++ b/lib/jsonld-signatures.js
@@ -736,4 +736,4 @@ if(_nodejs) {
wrap(global.jsigs);
}
-})(window ? window : this);
\ No newline at end of file
+})(typeof window !== 'undefined' ? window : this); | Make inclusion of jsonld-signatures in non-browser JS engines work. | digitalbazaar_jsonld-signatures | train | js |
fcda4b734df68080869e7ccb6b062a6e91b4f72e | diff --git a/mongo_connector/connector.py b/mongo_connector/connector.py
index <HASH>..<HASH> 100755
--- a/mongo_connector/connector.py
+++ b/mongo_connector/connector.py
@@ -112,7 +112,7 @@ class Connector(threading.Thread):
self.oplog_checkpoint)
logging.info(info_str)
try:
- # Truncate the progress log
+ # Create oplog progress file
open(self.oplog_checkpoint, "w").close()
except IOError as e:
logging.critical("MongoConnector: Could not " | corrected a comment (truncate a file -> create a file) | yougov_mongo-connector | train | py |
adcecc268fb80cf46027aa0eaacb53c6886843dc | diff --git a/app/lib/helpers/banner.js b/app/lib/helpers/banner.js
index <HASH>..<HASH> 100644
--- a/app/lib/helpers/banner.js
+++ b/app/lib/helpers/banner.js
@@ -19,6 +19,10 @@ module.exports = function (argv, cmd, details) {
Pkg @quasar/app... ${green('v' + cliAppVersion)}
Debugging......... ${cmd === 'dev' || argv.debug ? green('enabled') : grey('no')}`
+ if (cmd === 'build') {
+ banner += `\n Publishing........ ${argv.publish !== void 0 ? green('yes') : grey('no')}`
+ }
+
if (details) {
banner += `
================== | feat(app): Addition to onPublish hooks | quasarframework_quasar | train | js |
aef1b89fba7866cab30df1e7a42b374b615bcc26 | diff --git a/shared/util/dev.js b/shared/util/dev.js
index <HASH>..<HASH> 100644
--- a/shared/util/dev.js
+++ b/shared/util/dev.js
@@ -1,7 +1,7 @@
// @flow
const injectReactQueryParams = (url: string): string => {
- if (!__DEV__) {
+ if (!__DEV__ || process.env.KEYBASE_DISABLE_REACT_PERF) {
return url
} | env flag to disable react perf (#<I>) | keybase_client | train | js |
1e8cd0e61e7bb442af7eab9997da487a82c91673 | diff --git a/superset/views/core.py b/superset/views/core.py
index <HASH>..<HASH> 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -1084,7 +1084,10 @@ class Superset(BaseSupersetView):
return json_error_response(utils.error_msg_from_exception(e))
status = 200
- if payload.get('status') == QueryStatus.FAILED:
+ if (
+ payload.get('status') == QueryStatus.FAILED or
+ payload.get('error') is not None
+ ):
status = 400
return json_success(viz_obj.json_dumps(payload), status=status) | [payload] Set status code on error rather than query status | apache_incubator-superset | train | py |
3beae217546e796e585f20df36485669e8b90aed | diff --git a/Tests/Auth/OpenID/StoreTest.php b/Tests/Auth/OpenID/StoreTest.php
index <HASH>..<HASH> 100644
--- a/Tests/Auth/OpenID/StoreTest.php
+++ b/Tests/Auth/OpenID/StoreTest.php
@@ -363,7 +363,8 @@ explicitly');
// If the postgres extension isn't loaded or loadable, succeed
// because we can't run the test.
if (!(extension_loaded('pgsql') ||
- @dl('pgsql.' . PHP_SHLIB_SUFFIX))) {
+ @dl('pgsql.so') ||
+ @dl('php_pgsql.dll'))) {
print "Warning: not testing PostGreSQL store";
$this->pass();
return;
@@ -473,7 +474,8 @@ explicitly');
// If the postgres extension isn't loaded or loadable, succeed
// because we can't run the test.
if (!(extension_loaded('sqlite') ||
- @dl('sqlite.' . PHP_SHLIB_SUFFIX))) {
+ @dl('sqlite.so') ||
+ @dl('php_sqlite.dll'))) {
print "Warning: not testing SQLite store";
$this->pass();
return; | [project @ Make the tests try to load the Windows versions of the sqlite and Postgres extensions] | openid_php-openid | train | php |
a349bf75825cbc76990a05f6de444215e9ba6da8 | diff --git a/glue.php b/glue.php
index <HASH>..<HASH> 100644
--- a/glue.php
+++ b/glue.php
@@ -58,7 +58,8 @@
if (class_exists($class)) {
$obj = new $class;
if (method_exists($obj, $method)) {
- $obj->$method($matches);
+ call_user_func_array(array($obj, $method),
+ array_slice($matches, 1));
} else {
throw new BadMethodCallException("Method, $method, not supported.");
} | Applied matches to methods straight away. | Etenil_atlatl | train | php |
87581cd29ddcbf3e1003bbfde64c24c32742a575 | diff --git a/src/EventSubscriber.php b/src/EventSubscriber.php
index <HASH>..<HASH> 100644
--- a/src/EventSubscriber.php
+++ b/src/EventSubscriber.php
@@ -84,7 +84,7 @@ class EventSubscriber implements EventSubscriberInterface
*/
public function configureComposerJson(Event $event)
{
- static::$plugin->getInstanceOf(ComposerConfigurator::class)->configure($event->getComposer(), $event->getIO());
+ static::$plugin->getInstanceOf(ComposerConfigurator::class, $event->getComposer(), $event->getIO())->configure();
}
/** | ComposerConfigurator construct fix | CupOfTea696_WordPress-Composer | train | php |
2e26030835d0089ff61aaf26c78a309d45ea70f5 | diff --git a/crawler4j/src/main/java/edu/uci/ics/crawler4j/url/TLDList.java b/crawler4j/src/main/java/edu/uci/ics/crawler4j/url/TLDList.java
index <HASH>..<HASH> 100644
--- a/crawler4j/src/main/java/edu/uci/ics/crawler4j/url/TLDList.java
+++ b/crawler4j/src/main/java/edu/uci/ics/crawler4j/url/TLDList.java
@@ -114,7 +114,10 @@ public class TLDList {
try (InputStream tldFile = TLDList.class.getClassLoader()
.getResourceAsStream(TLD_NAMES_TXT_FILENAME)) {
- int n = readStream(tldFile, tldSet);
+ int n = 0;
+ if (tldFile != null) {
+ n = readStream(tldFile, tldSet);
+ }
logger.info("Obtained {} TLD from packaged file {}", n, TLD_NAMES_TXT_FILENAME);
} catch (IOException e) {
logger.error("Couldn't read the TLD list from file"); | Fix issues of NullPointerException when frontier/ is empty | yasserg_crawler4j | train | java |
7855ae78e919e71d9d87fc4cea832a3cb40622e2 | diff --git a/jsmpp/src/main/java/org/jsmpp/bean/DeliveryReceipt.java b/jsmpp/src/main/java/org/jsmpp/bean/DeliveryReceipt.java
index <HASH>..<HASH> 100644
--- a/jsmpp/src/main/java/org/jsmpp/bean/DeliveryReceipt.java
+++ b/jsmpp/src/main/java/org/jsmpp/bean/DeliveryReceipt.java
@@ -409,7 +409,9 @@ public class DeliveryReceipt implements DeliveryReceiptInterface<DeliveryReceipt
* format is less than 10.
*/
private static Date string2Date(String date) {
-
+ if (date == null) {
+ return null;
+ }
int year = Integer.parseInt(date.substring(0, 2));
int month = Integer.parseInt(date.substring(2, 4));
int day = Integer.parseInt(date.substring(4, 6)); | #<I> NPE in DeliveryReceipt constructor
Fixed NPE in DeliveryReceipt constructor thrown when the delivery
receipt does not have a submit date or done date. | opentelecoms-org_jsmpp | train | java |
6df3afc6a704e611690d0d132f842003fea567e8 | diff --git a/gandi/cli/commands/record.py b/gandi/cli/commands/record.py
index <HASH>..<HASH> 100644
--- a/gandi/cli/commands/record.py
+++ b/gandi/cli/commands/record.py
@@ -58,9 +58,9 @@ def list(gandi, domain, zone_id, output, format):
record['type'], record['value']))
gandi.echo(format_record)
if format == 'json':
- format_record = json.dumps(records, sort_keys=True,
- indent=4, separators=(',', ': '))
- gandi.echo(format_record)
+ format_record = json.dumps(records, sort_keys=True,
+ indent=4, separators=(',', ': '))
+ gandi.echo(format_record)
return records
@@ -129,7 +129,13 @@ def delete(gandi, domain, zone_id, name, type, value):
gandi.echo('No zone records found, domain %s doesn\'t seems to be '
'managed at Gandi.' % domain)
return
-
+ if not name and not type and not value:
+ proceed = click.confirm('This command without parameters --type, '
+ '--name or --value will remove all records'
+ ' in this zone file. Are you sur to '
+ 'perform this action ?')
+ if not proceed:
+ return
record = {'name': name, 'type': type, 'value': value}
result = gandi.record.delete(zone_id, record)
return result | Add a deletion confirmation on record if there is no parameters Issue#<I> | Gandi_gandi.cli | train | py |
dc6705c74a8428ac1ba2dbfc0368806b54301ca2 | diff --git a/system/src/Grav/Common/Page/Medium/ImageMedium.php b/system/src/Grav/Common/Page/Medium/ImageMedium.php
index <HASH>..<HASH> 100644
--- a/system/src/Grav/Common/Page/Medium/ImageMedium.php
+++ b/system/src/Grav/Common/Page/Medium/ImageMedium.php
@@ -1,6 +1,7 @@
<?php
namespace Grav\Common\Page\Medium;
+use RocketTheme\Toolbox\Event\Event;
use Grav\Common\Data\Blueprint;
use Gregwar\Image\Image as ImageFile;
@@ -37,6 +38,11 @@ class ImageMedium extends Medium
protected $debug_watermarked = false;
/**
+ * @var string
+ */
+ public $result;
+
+ /**
* @var array
*/
public static $magic_actions = [
@@ -375,9 +381,11 @@ class ImageMedium extends Medium
$this->image->merge(ImageFile::open($overlay));
}
- $result = $this->image->cacheFile($this->format, $this->quality);
+ $this->result = $this->image->cacheFile($this->format, $this->quality);
+
+ self::getGrav()->fireEvent('onImageMediumSaved', new Event(['image' => $this]));
- return $result;
+ return $this->result;
}
/** | added a new `onImageMediumSaved` event - useful for compression services | getgrav_grav | train | php |
d45a5ffd52e69eb31d8475bc7041f44151152049 | diff --git a/lib/test/ServiceTest.js b/lib/test/ServiceTest.js
index <HASH>..<HASH> 100644
--- a/lib/test/ServiceTest.js
+++ b/lib/test/ServiceTest.js
@@ -30,11 +30,36 @@ module.exports = oo({
* setup
*/
setup: function() {
+ function sleep(ms, cb) {
+ setTimeout(function() {
+ cb()
+ }, ms)
+ }
+
if (this.suppressServiceLogging) {
this.service.verbosity = 'fatal'
}
- this.service.start()
+ for (var i=0; i<3; i++) {
+ try {
+ this.service.start()
+ break
+ } catch (e) {
+ if (i === 2) {
+ throw new Error(
+ 'Failed to start server. Port ' +
+ this.service.port +
+ ' already bound.')
+ }
+ if (e.message.includes('EADDRINUSE')) {
+ console.warn('caught EADDRINUSE, will try again in 1 second...')
+ sleep.sync(1000)
+ } else {
+ throw e
+ }
+ }
+ }
+
// XXX: Service.sslOptions is not initialized until start is called
var sslOptions = this.service.sslOptions
var scheme = (sslOptions && sslOptions.isEnabled()) ? 'https' : 'http' | robustify service start in ServiceTest | carbon-io_carbond | train | js |
eba688e48a843d2308703c52b36af6018637140a | diff --git a/File/MARCJSON.php b/File/MARCJSON.php
index <HASH>..<HASH> 100755
--- a/File/MARCJSON.php
+++ b/File/MARCJSON.php
@@ -115,8 +115,8 @@ class File_MARCJSON extends File_MARCBASE
* ?>
* </code>
*
- * @param string $source A raw MARC-in-JSON string
- * @param string $record_class Record class, defaults to File_MARC_Record
+ * @param string $source A raw MARC-in-JSON string
+ * @param string $record_class Record class, defaults to File_MARC_Record
*/
function __construct($source, $record_class = null)
{
@@ -161,7 +161,7 @@ class File_MARCJSON extends File_MARCBASE
{
if ($this->text) {
$marc = $this->_decode($this->text);
- $this->text = NULL;
+ $this->text = null;
return $marc;
} else {
return false; | Adhere to PHP_CodeSniffer requirements | pear_File_MARC | train | php |
4048681e132a2d59a6c47b6083317031fa92b8ca | diff --git a/ricloud/backup.py b/ricloud/backup.py
index <HASH>..<HASH> 100644
--- a/ricloud/backup.py
+++ b/ricloud/backup.py
@@ -11,8 +11,10 @@ class BackupClient(object):
DATA_CALL_HISTORY = 8
DATA_CONTACTS = 16
DATA_INSTALLED_APPS = 32
+ DATA_WHATSAPP_MESSAGES = 512
DATA_WEB_CONTACTS = 64
+ DATA_WEB_LOCATION = 256
AVAILABLE_DATA = (
(DATA_SMS, 'SMS Messages'),
@@ -21,8 +23,10 @@ class BackupClient(object):
(DATA_CALL_HISTORY, 'Call History'),
(DATA_CONTACTS, 'Contacts'),
(DATA_INSTALLED_APPS, 'Installed Apps'),
+ (DATA_WHATSAPP_MESSAGES, 'WhatsApp Messages'),
(DATA_WEB_CONTACTS, 'Contacts stored on www.icloud.com'),
+ (DATA_WEB_LOCATION, 'Location stored on www.icloud.com'),
)
MIN_REQUEST_DATE = datetime.datetime(year=1900, month=1, day=1) | added whatsapp and location to ricloud | reincubate_ricloud | train | py |
9a6edc8a7a0bcc588a9f863d0f4f6a7e79871d92 | diff --git a/jaulp.wicket.base/src/main/java/org/jaulp/wicket/base/utils/WicketUrlUtils.java b/jaulp.wicket.base/src/main/java/org/jaulp/wicket/base/utils/WicketUrlUtils.java
index <HASH>..<HASH> 100644
--- a/jaulp.wicket.base/src/main/java/org/jaulp/wicket/base/utils/WicketUrlUtils.java
+++ b/jaulp.wicket.base/src/main/java/org/jaulp/wicket/base/utils/WicketUrlUtils.java
@@ -125,11 +125,7 @@ public class WicketUrlUtils {
* @return the url as string
*/
public static String getUrlAsString(WebPage page) {
- Url pageUrl = getPageUrl(page);
- Url url = getBaseUrl(page);
- url.resolveRelative(pageUrl);
- String contextPath = getContextPath(page);
- return String.format("%s/%s", contextPath, url);
+ return getUrlAsString(page.getClass());
}
/**
@@ -180,7 +176,7 @@ public class WicketUrlUtils {
getBaseUrl().toString());
if(0 <indexOf){
domainUrl = WicketComponentUtils.getRequestURL().substring(0,
- indexOf-1);
+ indexOf);
}
return domainUrl;
} | Extended WicketUrlUtils and created a example page for it. | astrapi69_jaulp-wicket | train | java |
24f6cb0162e941d1dd786e7fa70027a506f81b42 | diff --git a/beprof/curve.py b/beprof/curve.py
index <HASH>..<HASH> 100644
--- a/beprof/curve.py
+++ b/beprof/curve.py
@@ -105,7 +105,7 @@ class Curve(np.ndarray):
print('Error2')
return self
y = np.interp(domain, self.x, self.y)
- obj = Curve(np.stack((domain, y), axis=1))
+ obj = Curve(np.stack((domain, y), axis=1), **self.__dict__)
return obj
def rebinned(self, step=0.1, fixp=0):
@@ -170,17 +170,19 @@ def main():
print("X:", c.x)
print("Y:", c.y)
- new = c.change_domain([1, 2, 3, 5, 6, 7, 9])
+ new = k.change_domain([1, 2, 3, 5, 6, 7, 9])
print("X:", new.x)
print("Y:", new.y)
+ print('M:', new.metadata)
print('\n', '*'*30,'\nfixed_step_domain:')
- print("X:", c.x)
- print("Y:", c.y)
- test = c.rebinned(0.7, -1)
+ print("X:", k.x)
+ print("Y:", k.y)
+ test = k.rebinned(0.7, -1)
print("X:", test.x)
print("Y:", test.y)
+ print('M:', test.metadata)
if __name__ == '__main__':
main() | Fixed rebinning methods
change_domain() function now passes extra parameter which is **self.__dict__ of processed curve to Curve.__new__ method.
Metadata is no longer lost when using rebinning methods. | DataMedSci_beprof | train | py |
fc16e895e8501eb561b2af7f6e43d0feefca8688 | diff --git a/rfhub/app.py b/rfhub/app.py
index <HASH>..<HASH> 100644
--- a/rfhub/app.py
+++ b/rfhub/app.py
@@ -1,19 +1,19 @@
-import flask
-import argparse
-from kwdb import KeywordTable
from flask import current_app
-import blueprints
-import os
-import sys
-from robot.utils.argumentparser import ArgFileParser
-import robot.errors
+from kwdb import KeywordTable
from rfhub.version import __version__
-import importlib
-import inspect
-from tornado.wsgi import WSGIContainer
+from robot.utils.argumentparser import ArgFileParser
from tornado.httpserver import HTTPServer
+from tornado.wsgi import WSGIContainer
import tornado.ioloop
+import argparse
+import blueprints
+import flask
+import importlib
+import inspect
+import os
+import robot.errors
import signal
+import sys
class RobotHub(object): | reordered import statements; no functionality changed | boakley_robotframework-hub | train | py |
dfdf0760626c733af73ac8b107694d5d3c109f23 | diff --git a/mem.go b/mem.go
index <HASH>..<HASH> 100644
--- a/mem.go
+++ b/mem.go
@@ -31,10 +31,6 @@ func (buf *Memory) Write(p []byte) (n int, err error) {
return LimitWriter(buf.Buffer, Gap(buf)).Write(p)
}
-func (buf *Memory) WriteTo(w io.Writer) (n int64, err error) {
- return buf.Buffer.WriteTo(w)
-}
-
// Must Add io.ErrShortWrite
func (buf *Memory) WriteAt(p []byte, off int64) (n int, err error) {
if off > buf.Len() { | WriteTo was already supported by embeded bytes.Buffer | djherbis_buffer | train | go |
29f99526a2abbfa1b7da7d801290d37db559425c | diff --git a/ldap-maven-plugin/src/main/java/com/btmatthews/maven/plugins/ldap/mojo/IncludeServerDependenciesComponentConfigurator.java b/ldap-maven-plugin/src/main/java/com/btmatthews/maven/plugins/ldap/mojo/IncludeServerDependenciesComponentConfigurator.java
index <HASH>..<HASH> 100644
--- a/ldap-maven-plugin/src/main/java/com/btmatthews/maven/plugins/ldap/mojo/IncludeServerDependenciesComponentConfigurator.java
+++ b/ldap-maven-plugin/src/main/java/com/btmatthews/maven/plugins/ldap/mojo/IncludeServerDependenciesComponentConfigurator.java
@@ -176,6 +176,7 @@ public class IncludeServerDependenciesComponentConfigurator extends AbstractComp
for (final Artifact artifact : result.getMissingArtifacts()) {
if (!first) {
builder.append(',');
+ } else {
first = false;
}
builder.append(artifact.getGroupId()); | Fixed list of missing artifacts | bmatthews68_ldap-maven-plugin | train | java |
d67668ceb38023189240f17f37dd93036cf21d1f | diff --git a/lib/lhc/request.rb b/lib/lhc/request.rb
index <HASH>..<HASH> 100644
--- a/lib/lhc/request.rb
+++ b/lib/lhc/request.rb
@@ -1,4 +1,5 @@
require 'typhoeus'
+require 'active_support/core_ext/object/deep_dup'
# The request is doing an http-request using typhoeus.
# It provides functionalities to access and alter request data | add dependency on LHC::Request | local-ch_lhc | train | rb |
514fc5f1cd83b7c90753164a5100b642903543ef | diff --git a/modules/rubiconBidAdapter.js b/modules/rubiconBidAdapter.js
index <HASH>..<HASH> 100644
--- a/modules/rubiconBidAdapter.js
+++ b/modules/rubiconBidAdapter.js
@@ -73,6 +73,7 @@ var sizeMap = {
145: '980x150',
159: '320x250',
195: '600x300',
+ 198: '640x360',
199: '640x200',
213: '1030x590',
214: '980x360', | Added <I>x<I> size (#<I>) | prebid_Prebid.js | train | js |
d00b539c1498ac76a2999d6935cc1a1149e0cdac | diff --git a/test/prefixes_test.rb b/test/prefixes_test.rb
index <HASH>..<HASH> 100644
--- a/test/prefixes_test.rb
+++ b/test/prefixes_test.rb
@@ -1,6 +1,6 @@
require 'test_helper'
-class SimpleEnumTest < ActiveSupport::TestCase
+class PrefixesTest < ActiveSupport::TestCase
def setup
reload_db
end | fixed class name of test class (copy & past error =D) | lwe_simple_enum | train | rb |
e2e988f8d6619e903769667dd1b25f8c213cb1c0 | diff --git a/oauth2client/django_orm.py b/oauth2client/django_orm.py
index <HASH>..<HASH> 100644
--- a/oauth2client/django_orm.py
+++ b/oauth2client/django_orm.py
@@ -116,14 +116,19 @@ class Storage(BaseStorage):
credential.set_store(self)
return credential
- def locked_put(self, credentials):
+ def locked_put(self, credentials, overwrite=False):
"""Write a Credentials to the datastore.
Args:
credentials: Credentials, the credentials to store.
"""
args = {self.key_name: self.key_value}
- entity = self.model_class(**args)
+
+ if overwrite:
+ entity, is_new = self.model_class.objects.get_or_create(**args)
+ else:
+ entity = self.model_class(**args)
+
setattr(entity, self.property_name, credentials)
entity.save() | Added option to overwrite existing stored credentials.
Added an option to django_orm.Storage locked_put method to allow for
overwriting an existing credential record rather than the creation of a
new one. | googleapis_oauth2client | train | py |
62e0bf13086aa8fa39b2ec36f2cf713b43d9814a | diff --git a/snakebite/minicluster.py b/snakebite/minicluster.py
index <HASH>..<HASH> 100644
--- a/snakebite/minicluster.py
+++ b/snakebite/minicluster.py
@@ -202,8 +202,17 @@ class MiniCluster(object):
result = []
for line in i.split("\n"):
if line:
- (length, path) = re.split("\s+", line)
- result.append({"path": path.replace(base_path, ""), "length": long(length)})
+ fields = re.split("\s+", line)
+ if len(fields) == 3:
+ (length, space_consumed, path) = re.split("\s+", line)
+ elif len(fields) == 2:
+ (length, path) = re.split("\s+", line)
+ else:
+ raise ValueError("Result of du operation should contain 2"
+ " or 3 field, but there's %d fields"
+ % len(fields))
+ result.append({"path": path.replace(base_path, ""),
+ "length": long(length)})
return result
def _transform_count_output(self, i, base_path): | Fix #<I> - adjust du output parser to HADOOP-<I>
HADOOP-<I> introduced another column (spaceConsumed) in du output.
Since snakebite still outputs only size (length), and path for now we
ignore spaceConsumed - this should change in #<I>. | spotify_snakebite | train | py |
060c9b3de7e0727e1cc5232bc7ff24d39b1cc6c5 | diff --git a/lib/stack.js b/lib/stack.js
index <HASH>..<HASH> 100644
--- a/lib/stack.js
+++ b/lib/stack.js
@@ -18,7 +18,8 @@ const skip = (process.cwd() !== tapDir ||
/node_modules[\/\\]tap[\/\\]/,
/at internal\/.*\.js:\d+:\d+/m,
new RegExp(resc(path.resolve(osHomedir(), '.node-spawn-wrap-')) + '.*'),
- new RegExp(resc(tapDir) + '\\b', 'i')
+ new RegExp(resc(tapDir) + '\\b', 'i'),
+ new RegExp('at ' + resc('Generator.next (<anonymous>)'), 'i'),
].concat(/* istanbul ignore next */ require.resolve
? [
new RegExp(resc(require.resolve('function-loop'))), | Ignore Generator.next(<anonymous>) in stacks | tapjs_node-tap | train | js |
d88104ef9c0cf0a87375e2532adac070b742066d | diff --git a/subdownloader/project.py b/subdownloader/project.py
index <HASH>..<HASH> 100644
--- a/subdownloader/project.py
+++ b/subdownloader/project.py
@@ -5,6 +5,7 @@ import os
"""
Name of the project.
+Forks MUST change this to a non-ambiguous alternative namex.
"""
TITLE = 'SubDownloader' | project: add line about forking in documentation of project name string | subdownloader_subdownloader | train | py |
3b382f7f958199f71f03faaaed125397ae5b2da4 | diff --git a/src/NumericalAnalysis/RootFinding/BisectionMethod.php b/src/NumericalAnalysis/RootFinding/BisectionMethod.php
index <HASH>..<HASH> 100644
--- a/src/NumericalAnalysis/RootFinding/BisectionMethod.php
+++ b/src/NumericalAnalysis/RootFinding/BisectionMethod.php
@@ -34,10 +34,7 @@ class BisectionMethod
// Validate input arguments
self::validate($function, $a, $b, $tol);
- // Initialize
- $dif = $tol + 1;
-
- while ($dif > $tol) {
+ do {
$f⟮a⟯ = $function($a);
$p = ($a + $b)/2; // construct the midpoint
$f⟮p⟯ = $function($p);
@@ -47,7 +44,7 @@ class BisectionMethod
} else {
$a = $p; // the new startpoint is our original endpoint
}
- }
+ } while ($dif > $tol);
return $p;
} | Replaced initializing early with a do while loop | markrogoyski_math-php | train | php |
e4db9e64197a2f6eaef8f3a1ae3d33fc5ab2a2a8 | diff --git a/lib/android/app/src/main/java/com/reactnativenavigation/presentation/OverlayManager.java b/lib/android/app/src/main/java/com/reactnativenavigation/presentation/OverlayManager.java
index <HASH>..<HASH> 100644
--- a/lib/android/app/src/main/java/com/reactnativenavigation/presentation/OverlayManager.java
+++ b/lib/android/app/src/main/java/com/reactnativenavigation/presentation/OverlayManager.java
@@ -1,5 +1,6 @@
package com.reactnativenavigation.presentation;
+import android.support.annotation.Nullable;
import android.view.ViewGroup;
import com.reactnativenavigation.utils.CommandListener;
@@ -10,7 +11,11 @@ import java.util.HashMap;
public class OverlayManager {
private final HashMap<String, ViewController> overlayRegistry = new HashMap<>();
- public void show(ViewGroup root, ViewController overlay, CommandListener listener) {
+ public void show(@Nullable ViewGroup root, ViewController overlay, CommandListener listener) {
+ if (root == null) {
+ listener.onError("Can't show Overlay before setRoot is called. This will be resolved in #3899");
+ return;
+ }
overlayRegistry.put(overlay.getId(), overlay);
overlay.setOnAppearedListener(() -> listener.onSuccess(overlay.getId()));
root.addView(overlay.getView()); | Handle NPE when showing Overlay before setRoot is called
Rejecting the promise is a temporary solution, Overlay should not be coupled to root. | wix_react-native-navigation | train | java |
faf36a8214701292ca0b5c9dda05375efa9a1e90 | diff --git a/cli/polyaxon/utils/cli_constants.py b/cli/polyaxon/utils/cli_constants.py
index <HASH>..<HASH> 100644
--- a/cli/polyaxon/utils/cli_constants.py
+++ b/cli/polyaxon/utils/cli_constants.py
@@ -21,6 +21,7 @@ INIT_COMMAND = (
)
DEFAULT_IGNORE_LIST = """
+./.polyaxon
.git
.eggs
eggs
@@ -32,7 +33,36 @@ var
*.pyc
*.swp
.DS_Store
-./.polyaxon
+__pycache__/
+.pytest_cache/
+*.py[cod]
+*$py.class
+.mypy_cache/
+.vscode/
+.mr.developer.cfg
+.pydevproject
+.project
+.settings/
+.idea/
+.DS_Store
+# temp files
+*~
+# C extensions
+*.so
+# Distribution / packaging
+.Python
+dist/
+pydist/
+*.egg-info/
+.installed.cfg
+*.egg
+# PyInstaller
+*.manifest
+*.spec
+# IPython Notebook
+.ipynb_checkpoints
+# pyenv
+.python-version
"""
INIT_FILE_PATH = "polyaxonfile.yaml" | Improve default ignore manager with common python ignore patterns | polyaxon_polyaxon-cli | train | py |
2bb9e531061316da85d642fd8486e2de10d16a40 | diff --git a/course/format/renderer.php b/course/format/renderer.php
index <HASH>..<HASH> 100644
--- a/course/format/renderer.php
+++ b/course/format/renderer.php
@@ -506,7 +506,7 @@ abstract class format_section_renderer_base extends plugin_renderer_base {
$completioninfo = new completion_info($course);
echo $completioninfo->display_help_icon();
- print_section($course, $thissection, $mods, $modnamesused, true);
+ print_section($course, $thissection, $mods, $modnamesused, true, '100%', false, true);
if ($PAGE->user_is_editing()) {
print_section_add_menus($course, $displaysection, $modnames);
} | MDL-<I> course/format: Return to correct section
When editing a single section mode item | moodle_moodle | train | php |
fa74ef9e2294c798743d689d30fd8aa6138a2e44 | diff --git a/lib/jsdom/living/post-message.js b/lib/jsdom/living/post-message.js
index <HASH>..<HASH> 100644
--- a/lib/jsdom/living/post-message.js
+++ b/lib/jsdom/living/post-message.js
@@ -16,7 +16,7 @@ module.exports = function (message, targetOrigin) {
// TODO: targetOrigin === '/' - requires reference to source window
// See https://github.com/tmpvar/jsdom/pull/1140#issuecomment-111587499
- if (targetOrigin !== "*" && targetOrigin !== this.origin) {
+ if (targetOrigin !== "*" && targetOrigin !== this.location.origin) {
return;
} | Fix origin-checking logic in postMessage
This allows us to post messages where the origin is something other than `*`. Closes #<I>. | jsdom_jsdom | train | js |
ea7fe12e8f5c2795d1f39ddff185cdb5edd8245a | diff --git a/tests/asyncio/test_tcp_server.py b/tests/asyncio/test_tcp_server.py
index <HASH>..<HASH> 100644
--- a/tests/asyncio/test_tcp_server.py
+++ b/tests/asyncio/test_tcp_server.py
@@ -26,7 +26,7 @@ async def test_complets_on_half_close(event_loop: asyncio.AbstractEventLoop) ->
server = TCPServer(
echo_framework, event_loop, Config(), MemoryReader(), MemoryWriter() # type: ignore
)
- asyncio.ensure_future(server.run())
+ task = event_loop.create_task(server.run())
await server.reader.send(b"GET / HTTP/1.1\r\nHost: hypercorn\r\n\r\n") # type: ignore
server.reader.close() # type: ignore
await asyncio.sleep(0)
@@ -35,3 +35,4 @@ async def test_complets_on_half_close(event_loop: asyncio.AbstractEventLoop) ->
data
== b"HTTP/1.1 200 \r\ncontent-length: 335\r\ndate: Thu, 01 Jan 1970 01:23:20 GMT\r\nserver: hypercorn-h11\r\n\r\n" # noqa: E501
)
+ await task | Fix test to ensure correct shutdown
Otherwise misleading warnings are printed during the tests. | pgjones_hypercorn | train | py |
5f94bf4cbee3204a6dff213330a4236675e0b6e5 | diff --git a/src/test/java/com/github/olivergondza/dumpling/factory/PidRuntimeFactoryTest.java b/src/test/java/com/github/olivergondza/dumpling/factory/PidRuntimeFactoryTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/github/olivergondza/dumpling/factory/PidRuntimeFactoryTest.java
+++ b/src/test/java/com/github/olivergondza/dumpling/factory/PidRuntimeFactoryTest.java
@@ -56,7 +56,7 @@ public class PidRuntimeFactoryTest extends AbstractCliTest {
ProcessThread thread = pidRuntime.getThreads().where(nameIs("process-thread")).onlyThread();
assertThat(thread.getStatus(), equalTo(ThreadStatus.SLEEPING));
- assertFalse(thread.getAcquiredLocks().isEmpty());
+ assertFalse(thread.toString(), thread.getAcquiredLocks().isEmpty());
assertThat(
thread.getAcquiredLocks().iterator().next().getClassName(),
equalTo("java.util.concurrent.locks.ReentrantLock$NonfairSync") | Better defect localization in PidRuntimeFactoryTest | olivergondza_dumpling | train | java |
217da54030c195051a57e216beb9e1a2a609b8d2 | diff --git a/core/src/main/java/lucee/runtime/tag/Image.java b/core/src/main/java/lucee/runtime/tag/Image.java
index <HASH>..<HASH> 100755
--- a/core/src/main/java/lucee/runtime/tag/Image.java
+++ b/core/src/main/java/lucee/runtime/tag/Image.java
@@ -395,7 +395,7 @@ public final class Image extends TagImpl {
if(base64) {
String b64 = source.getBase64String(format);
- pageContext.write("<img src=\"data:image/"+ImageUtil.getMimeTypeFromFormat(format)+";base64,"+b64+"\" width=\""+source.getWidth()+"\" height=\""+source.getHeight()+"\""+add+" />");
+ pageContext.write("<img src=\"data:"+ImageUtil.getMimeTypeFromFormat(format)+";base64,"+b64+"\" width=\""+source.getWidth()+"\" height=\""+source.getHeight()+"\""+add+" />");
return;
}
pageContext.write("<img src=\""+path+"\" width=\""+source.getWidth()+"\" height=\""+source.getHeight()+"\""+add+" />"); | fix issue with inline images in <cfimage> | lucee_Lucee | train | java |
b346baf390922358ecd2b6fe28d6213554ee4d8e | diff --git a/app.js b/app.js
index <HASH>..<HASH> 100644
--- a/app.js
+++ b/app.js
@@ -69,6 +69,12 @@ app.listen(port, function () {
},
function () {
console.log('Geocoder initialized and ready.');
+ console.log('Endpoints:');
+ console.log(`- http://localhost:${port}/healthcheck`);
+ console.log(`- http://localhost:${port}/deep-healthcheck`);
+ console.log(`- http://localhost:${port}/geocode`);
+ console.log('Examples:');
+ console.log(`- http://localhost:${port}/geocode?latitude=54.6875248&longitude=9.7617254`);
isGeocodeInitialized = true;
}
); | Added examples to app.js
(cherry picked from commit a<I>b<I>b<I>be<I>df<I>e1ec<I>b6b<I>) | tomayac_local-reverse-geocoder | train | js |
9e72b7ff2cfa18f2b5ff5c8e7b0888f378253690 | diff --git a/lib/slackhook/webhook_service.rb b/lib/slackhook/webhook_service.rb
index <HASH>..<HASH> 100644
--- a/lib/slackhook/webhook_service.rb
+++ b/lib/slackhook/webhook_service.rb
@@ -6,8 +6,10 @@ require "json"
module WebhookService
class Webhook
def initialize options = {}
+ raise ArgumentError.new('icon_type and icon_url are mutualy exclusive!') if options[:icon_type].present? && options[:icon_url].present?
@text = options.fetch(:text, nil)
@icon_type = options.fetch(:icon_type, nil)
+ @icon_url = options.fetch(:icon_url, nil)
@channel = options.fetch(:channel, nil)
@username = options.fetch(:username, nil)
@webhook_url = options.fetch(:webhook_url, nil)
@@ -15,7 +17,14 @@ module WebhookService
def send
uri = URI::encode(@webhook_url)
- @toSend = { channel: @channel, text: @text, username: @username, icon_emoji: @icon_type}
+ @toSend = { channel: @channel, text: @text, username: @username }
+
+ if @icon_type.present?
+ @toSend.merge!(icon_emoji: @icon_type)
+ elsif @icon_url.present?
+ @toSend.merge!(icon_url: @icon_url)
+ end
+
uri = URI.parse(uri)
https = Net::HTTP.new(uri.host,uri.port)
https.use_ssl = true | Add support for icon_url and make sure that only one icon config is used. | Urielable_slackhook | train | rb |
f28176ad2f651d63dad420125ae04cbce318acdf | diff --git a/Repository/ExerciseRepository.php b/Repository/ExerciseRepository.php
index <HASH>..<HASH> 100755
--- a/Repository/ExerciseRepository.php
+++ b/Repository/ExerciseRepository.php
@@ -28,13 +28,15 @@ class ExerciseRepository extends EntityRepository
$dql = 'SELECT sum(r.mark) as noteExo, p.id as paper
FROM UJM\ExoBundle\Entity\Response r JOIN r.paper p JOIN p.exercise e
WHERE e.id= ?1 AND p.interupt=0 group by p.id ';
+ $params = array(1 => $exoId);
if ($order != '') {
$dql .= ' ORDER BY ?2';
+ $params[2] = $order;
}
$query = $this->_em->createQuery($dql)
- ->setParameters(array(1 => $exoId, 2 => $order));
+ ->setParameters($params);
return $query->getResult();
} | [ExoBundle] Refactoring for test insight | claroline_Distribution | train | php |
434a10915f90b13e25c9f63c49167b2134d5831f | diff --git a/core/src/main/java/hudson/PluginWrapper.java b/core/src/main/java/hudson/PluginWrapper.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/PluginWrapper.java
+++ b/core/src/main/java/hudson/PluginWrapper.java
@@ -210,7 +210,7 @@ public final class PluginWrapper {
* Returns a one-line descriptive name of this plugin.
*/
public String getLongName() {
- String name = manifest.getMainAttributes().getValue("Long-PluginName");
+ String name = manifest.getMainAttributes().getValue("Long-Name");
if(name!=null) return name;
return shortName;
} | PluginWrapper.getLongName() was using the wrong property name to get the plugin
long name from the manifest file. Change "Long-PluginName" to "Long-Name" to
match manifest contents.
git-svn-id: <URL> | jenkinsci_jenkins | train | java |
3031813c5e80f8a8ac7950c1b3634e38b0f781bd | diff --git a/wayback-core/src/main/java/org/archive/wayback/exception/ResourceNotAvailableException.java b/wayback-core/src/main/java/org/archive/wayback/exception/ResourceNotAvailableException.java
index <HASH>..<HASH> 100644
--- a/wayback-core/src/main/java/org/archive/wayback/exception/ResourceNotAvailableException.java
+++ b/wayback-core/src/main/java/org/archive/wayback/exception/ResourceNotAvailableException.java
@@ -26,6 +26,9 @@ package org.archive.wayback.exception;
import javax.servlet.http.HttpServletResponse;
+import org.archive.wayback.core.CaptureSearchResults;
+import org.archive.wayback.core.SearchResults;
+
/**
* Exception class for queries which matching resource is not presently
* accessible
@@ -39,6 +42,7 @@ public class ResourceNotAvailableException extends WaybackException {
*/
private static final long serialVersionUID = 1L;
protected static final String ID = "resourceNotAvailable";
+ private CaptureSearchResults results;
/**
* Constructor
@@ -65,4 +69,13 @@ public class ResourceNotAvailableException extends WaybackException {
public int getStatus() {
return HttpServletResponse.SC_SERVICE_UNAVAILABLE;
}
+ /**
+ * @param results
+ */
+ public void setCaptureSearchResults(CaptureSearchResults results) {
+ this.results = results;
+ }
+ public CaptureSearchResults getCaptureSearchResults() {
+ return results;
+ }
} | FEATURE: add CaptureSearchResults to the exception if the problem is ResourceNotAvailable, allowing jsp to offer alternate versions.
git-svn-id: <URL> | iipc_openwayback | train | java |
d4f03b6a71db566441b336b553605cea62a7742f | diff --git a/pages/Reviews/connector.js b/pages/Reviews/connector.js
index <HASH>..<HASH> 100644
--- a/pages/Reviews/connector.js
+++ b/pages/Reviews/connector.js
@@ -6,7 +6,7 @@
*/
import { connect } from 'react-redux';
-import { getCurrentProductReviews } from '@shopgate/pwa-common-commerce/reviews/selectors';
+import { getProductReviews } from '@shopgate/pwa-common-commerce/reviews/selectors';
/**
* Maps the contents of the state to the component props.
@@ -14,7 +14,7 @@ import { getCurrentProductReviews } from '@shopgate/pwa-common-commerce/reviews/
* @return {Object} The extended component props.
*/
const mapStateToProps = state => ({
- reviews: getCurrentProductReviews(state),
+ reviews: getProductReviews(state),
});
export default connect(mapStateToProps, null, null, { withRef: true }); | CON-<I> - renamed getCurrentProductReviews selector to getProductReviews to make it clear that this selector the state of whole product reviews list | shopgate_pwa | train | js |
c869c29f84578ad4cd75f0289ed05cb4eed60a27 | diff --git a/views/js/controller/creator/index.js b/views/js/controller/creator/index.js
index <HASH>..<HASH> 100644
--- a/views/js/controller/creator/index.js
+++ b/views/js/controller/creator/index.js
@@ -70,10 +70,8 @@ define([
* The entrypoint
*/
start() {
-
//TODO move module config away from controllers
const config = module.config();
- config.properties.allowCustomTemplate = config.plugins.some(({ name }) => name === 'xmlResponseProcessing');
const logger = loggerFactory('controller/creator');
/**
@@ -95,12 +93,15 @@ define([
//load plugins dynamically
if (config) {
if(config.plugins){
+ config.properties.allowCustomTemplate = config.plugins.some(({ name }) => name === 'xmlResponseProcessing');
+
_.forEach(config.plugins, plugin => {
if(plugin && plugin.module){
pluginLoader.add(plugin);
}
});
}
+
if(config.contextPlugins){
_.forEach(config.contextPlugins, plugin => {
if(plugin && plugin.module){ | fix: Use xmlResponseProcessing only when plugins are exists in the config | oat-sa_extension-tao-itemqti | train | js |
05dbdbde9840a220e5c280430c3ce3c26ecd4c05 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -502,7 +502,11 @@ function verifyProofs (proofs, uri, callback) {
if (_.isObject(proof) && _.has(proof, 'proof') && _.isString(proof.proof)) {
// Probably result of `submitProofs()` call. Extract proof String
return proof.proof
- } else if (_.isString(proof)) {
+ } else if (_.isObject(proof) && _.has(proof, 'type') && proof.type === 'Chainpoint') {
+ // Probably a JS Object Proof
+ return proof
+ } else if (_.isString(proof) && (validator.isJSON(proof) || validator.isBase64(proof))) {
+ // Probably a JSON String or Base64 encoded binary proof
return proof
} else {
throw new Error('proofs arg Array has elements that are not Objects or Strings') | Allow verifyProofs Array to contain proofs in Object, JSON-LD, or Base<I> form | chainpoint_chainpoint-client-js | train | js |
738928accdcd3be38cfa18e81138be7f1f534f82 | diff --git a/datadog_checks_base/datadog_checks/base/__init__.py b/datadog_checks_base/datadog_checks/base/__init__.py
index <HASH>..<HASH> 100644
--- a/datadog_checks_base/datadog_checks/base/__init__.py
+++ b/datadog_checks_base/datadog_checks/base/__init__.py
@@ -2,8 +2,22 @@
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from .__about__ import __version__
+from .checks import AgentCheck
+from .checks.openmetrics import OpenMetricsBaseCheck
+from .config import is_affirmative
+from .errors import ConfigurationError
+
+# Windows-only
+try:
+ from .checks.win import PDHBaseCheck
+except ImportError:
+ PDHBaseCheck = None
__all__ = [
- '__version__'
+ '__version__',
+ 'AgentCheck',
+ 'OpenMetricsBaseCheck',
+ 'PDHBaseCheck',
+ 'ConfigurationError',
+ 'is_affirmative',
]
-__path__ = __import__('pkgutil').extend_path(__path__, __name__) | Expose core functionality at the root (#<I>)
* Expose core functionality at the root | DataDog_integrations-core | train | py |
d15ac52ce5d315f735f99ba7620d22cc2bc45c4a | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -127,6 +127,8 @@ function queryOptionsToMongo(query, options) {
limit = options.maxLimit || 0
if (fields) hash.fields = fields
+ // omit intentionally overwrites fields if both have been specified in the query
+ // mongo does not accept mixed true/fals field specifiers for projections
if (omitFields) hash.fields = omitFields
if (sort) hash.sort = sort | added comment re overwriting of field hash | pbatey_query-to-mongo | train | js |
3150524147ce0334513535756abd5601887be9bd | diff --git a/example/php/index.php b/example/php/index.php
index <HASH>..<HASH> 100644
--- a/example/php/index.php
+++ b/example/php/index.php
@@ -2,6 +2,5 @@
require_once 'vendor/autoload.php';
-$config = new Bugsnag\Configuration('YOUR-API-KEY-HERE');
-$bugsnag = new Bugsnag\Client($config);
+$bugsnag = Bugsnag\Client::make('YOUR-API-KEY-HERE');
$bugsnag->notifyError('Broken', 'Something broke', ['tab' => ['paying' => true, 'object' => (object) ['key' => 'value'], 'null' => null, 'string' => 'test', 'int' => 4]]); | Updated the example to use our static make method (#<I>) | bugsnag_bugsnag-php | train | php |
87fdb42b3365163f6ff408c842ab439b3ee41287 | diff --git a/src/main/java/org/acra/ACRA.java b/src/main/java/org/acra/ACRA.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/acra/ACRA.java
+++ b/src/main/java/org/acra/ACRA.java
@@ -279,9 +279,8 @@ public final class ACRA {
@Nullable
private static String getCurrentProcessName() {
- final int processId = android.os.Process.myPid();
try {
- return IOUtils.streamToString(new FileInputStream("/proc/"+processId+"/cmdline")).trim();
+ return IOUtils.streamToString(new FileInputStream("/proc/self/cmdline")).trim();
} catch (IOException e) {
return null;
} | `android.os.Process.myPid()` call removed in favor of `/proc/self` | ACRA_acra | train | java |
0a4aff63a64bdf1b9dca202323efb843df8d7bc6 | diff --git a/spec/support/time.rb b/spec/support/time.rb
index <HASH>..<HASH> 100644
--- a/spec/support/time.rb
+++ b/spec/support/time.rb
@@ -1,6 +1,6 @@
# For the purposes of tests, we ignore fractions of a second when comparing Time objects
class Time
def ==(other)
- super(other) || to_s == other.to_s
+ super(other) || utc.to_s == other.utc.to_s if other
end
end | Fix Time equality for Ruby <I> | spohlenz_mongomodel | train | rb |
cb96c74294cbda4b23e70f69ce820f6d25eb7298 | diff --git a/lib/larch/imap/mailbox.rb b/lib/larch/imap/mailbox.rb
index <HASH>..<HASH> 100644
--- a/lib/larch/imap/mailbox.rb
+++ b/lib/larch/imap/mailbox.rb
@@ -256,7 +256,7 @@ class Mailbox
debug "removing #{expected_uids.length} deleted messages from the database..."
Larch.db.transaction do
- expected_uids.each do |uid|
+ expected_uids.each_key do |uid|
@db_mailbox.messages_dataset.filter(:uid => uid).destroy
end
end | This'll probably work better if we don't pass an array to Sequel | rgrove_larch | train | rb |
3dd4bbe53ef1422e7163c7f2e176c13091a6ca38 | diff --git a/src/main/java/com/blackducksoftware/integration/hub/dataservice/phonehome/PhoneHomeResponse.java b/src/main/java/com/blackducksoftware/integration/hub/dataservice/phonehome/PhoneHomeResponse.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/blackducksoftware/integration/hub/dataservice/phonehome/PhoneHomeResponse.java
+++ b/src/main/java/com/blackducksoftware/integration/hub/dataservice/phonehome/PhoneHomeResponse.java
@@ -36,12 +36,14 @@ public class PhoneHomeResponse {
return phoneHomeTask;
}
- public void endPhoneHome() {
+ public boolean endPhoneHome() {
if (phoneHomeTask != null) {
if (!phoneHomeTask.isDone()) {
- phoneHomeTask.cancel(true);
+ return phoneHomeTask.cancel(true);
}
}
+
+ return false;
}
} | making the response a little nicer | blackducksoftware_blackduck-common | train | java |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.