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
|
---|---|---|---|---|---|
14bc1e4daabdd57d4d0eda0a090fece9a161e352
|
diff --git a/src/Behat/Behat/Context/ClassGenerator/SimpleContextClassGenerator.php b/src/Behat/Behat/Context/ClassGenerator/SimpleContextClassGenerator.php
index <HASH>..<HASH> 100644
--- a/src/Behat/Behat/Context/ClassGenerator/SimpleContextClassGenerator.php
+++ b/src/Behat/Behat/Context/ClassGenerator/SimpleContextClassGenerator.php
@@ -20,7 +20,7 @@ class SimpleContextClassGenerator implements ContextClassGenerator
/**
* @var string
*/
- private static $template = <<<'PHP'
+ protected static $template = <<<'PHP'
<?php
{namespace}use Behat\Behat\Context\TurnipAcceptingContext;
|
Fixed the support of inheritance in the SimpleContextClassGenerator
- Using late static binding to access a private property will trigger a
fatal error if the class is extended as the method in the parent class
will try to access a private property of the child class.
- Switching the visibility to protected while keeping the late static
binding allows to overwrite the template in child classes.
|
Behat_Behat
|
train
|
php
|
e50858315bb07f4eb4513f28d5b6a5df4c505a5d
|
diff --git a/zipline/algorithm.py b/zipline/algorithm.py
index <HASH>..<HASH> 100644
--- a/zipline/algorithm.py
+++ b/zipline/algorithm.py
@@ -267,6 +267,7 @@ class TradingAlgorithm(object):
self.algoscript = kwargs.pop('script', None)
self._initialize = None
+ self._analyze = kwargs.pop('analyze', None)
self._before_trading_start = None
self._analyze = None
|
BUG: Issue #<I> Initializing TradingAlgorithm Object Does Not Set
_analyze Method in algorithm.py
Added one line to check for the keyword argument 'analyze' and set the
the _analyze method when a TradingAlgorithm object is initialized
within a script.
|
quantopian_zipline
|
train
|
py
|
f593bebf1ebf883e97947892780308f0ec56a320
|
diff --git a/myfitnesspal/client.py b/myfitnesspal/client.py
index <HASH>..<HASH> 100644
--- a/myfitnesspal/client.py
+++ b/myfitnesspal/client.py
@@ -67,11 +67,11 @@ class Client(MFPBase):
return name
return self.ABBREVIATIONS[name]
- def _get_url_for_date(self, date):
+ def _get_url_for_date(self, date, username):
return os.path.join(
self.BASE_URL,
'food/diary',
- self.username,
+ username,
) + '?date=%s' % (
date.strftime('%Y-%m-%d')
)
@@ -175,7 +175,7 @@ class Client(MFPBase):
return meals
- def get_date(self, *args):
+ def get_date(self, *args, **kwargs):
if len(args) == 3:
date = datetime.date(
int(args[0]),
@@ -192,7 +192,8 @@ class Client(MFPBase):
)
document = self._get_document_for_url(
self._get_url_for_date(
- date
+ date,
+ kwargs.get('username', self.username)
)
)
|
#6 Adding support for keyword argument 'username'
This argument allows you to optionally retrieve the food diary of a
friend instead of retrieving your own.
|
coddingtonbear_python-myfitnesspal
|
train
|
py
|
6a1bcecb9c5ec5f53c08b3ac30f07840cd0f2f49
|
diff --git a/structr/structr-ui/src/main/webapp/structr/js/resources.js b/structr/structr-ui/src/main/webapp/structr/js/resources.js
index <HASH>..<HASH> 100644
--- a/structr/structr-ui/src/main/webapp/structr/js/resources.js
+++ b/structr/structr-ui/src/main/webapp/structr/js/resources.js
@@ -741,8 +741,9 @@ var _Resources = {
blur: function(e) {
e.stopPropagation();
var self = $(this);
+ console.log(self.contents().first());
if (debug) console.log('blur contentSourceId: ' + contentSourceId);
- _Resources.updateContent(contentSourceId, self.text());
+ _Resources.updateContent(contentSourceId, self.contents().first().text());
contentSourceId = null;
self.attr('contenteditable', false);
self.removeClass('structr-editable-area-active');
|
update content node with first element text (still buggy: should support multiple lines)
|
structr_structr
|
train
|
js
|
dce857ad5340b1be8803d7936fcf80fb40e684b1
|
diff --git a/orcas/l1l2.go b/orcas/l1l2.go
index <HASH>..<HASH> 100644
--- a/orcas/l1l2.go
+++ b/orcas/l1l2.go
@@ -705,6 +705,7 @@ func (l *L1L2Orca) Gat(req common.GATRequest) error {
if err == common.ErrKeyNotFound {
// this is a problem. L1 had the item but L2 doesn't. To avoid an
// inconsistent view, return the same ErrNotFound and fail the op.
+ metrics.IncCounter(MetricInconsistencyDetected)
metrics.IncCounter(MetricCmdGatTouchMissesL2)
metrics.IncCounter(MetricCmdGatMisses)
} else {
diff --git a/orcas/types.go b/orcas/types.go
index <HASH>..<HASH> 100644
--- a/orcas/types.go
+++ b/orcas/types.go
@@ -209,4 +209,7 @@ var (
MetricCmdGatTouchMissesL1 = metrics.AddCounter("cmd_gat_touch_misses_l1")
MetricCmdGatTouchErrorsL1 = metrics.AddCounter("cmd_gat_touch_errors_l1")
MetricCmdGatTouchHitsL1 = metrics.AddCounter("cmd_gat_touch_hits_l1")
+
+ // Special metrics
+ MetricInconsistencyDetected = metrics.AddCounter("inconsistency_detected")
)
|
Adding inconsistency metric
|
Netflix_rend
|
train
|
go,go
|
80d64ed2e8dee96071f47f46f6798a1e90feae95
|
diff --git a/app/Http/RequestHandlers/TreePreferencesPage.php b/app/Http/RequestHandlers/TreePreferencesPage.php
index <HASH>..<HASH> 100644
--- a/app/Http/RequestHandlers/TreePreferencesPage.php
+++ b/app/Http/RequestHandlers/TreePreferencesPage.php
@@ -139,7 +139,7 @@ class TreePreferencesPage implements RequestHandlerInterface
return Auth::isMember($tree, $user);
});
- $ignore_facts = ['CHAN', 'CHIL', 'FAMC', 'FAMS', 'HUSB', 'NOTE', 'OBJE', 'SOUR', 'SUBM', 'WIFE'];
+ $ignore_facts = ['CHAN', 'CHIL', 'FAMC', 'FAMS', 'HUSB', 'NOTE', 'OBJE', 'SOUR', 'SUBM', 'WIFE', 'NAME', 'SEX'];
$all_family_facts = Collection::make(Registry::elementFactory()->make('FAM')->subtags())
->filter(static fn (string $value, string $key): bool => !in_array($key, $ignore_facts, true))
|
Fix: #<I> - do not allow SEX/NAME to be added to the new individual page (again)
|
fisharebest_webtrees
|
train
|
php
|
7936c73fdf4bfe43e1039f5da9a98f9d0ea5cb50
|
diff --git a/xlsxwriter.class.php b/xlsxwriter.class.php
index <HASH>..<HASH> 100644
--- a/xlsxwriter.class.php
+++ b/xlsxwriter.class.php
@@ -224,7 +224,7 @@ class XLSXWriter
$cell = self::xlsCell($row_number, $column_number);
$s = isset($styles[$cell_format]) ? $styles[$cell_format] : '0';
- if (!is_scalar($value) || $value==='') { //objects, array, empty
+ if (!is_scalar($value) || $value=='') { //objects, array, empty
$file->write('<c r="'.$cell.'" s="'.$s.'"/>');
} elseif ($cell_format=='date') {
$file->write('<c r="'.$cell.'" s="'.$s.'" t="n"><v>'.intval(self::convert_date_time($value)).'</v></c>');
|
Update xlsxwriter.class.php
|
mk-j_PHP_XLSXWriter
|
train
|
php
|
f3fdadb9df7b2f532550e612fa86f01b25b68c0c
|
diff --git a/src/main/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java b/src/main/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
index <HASH>..<HASH> 100644
--- a/src/main/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
+++ b/src/main/org/codehaus/groovy/runtime/metaclass/MetaClassRegistryImpl.java
@@ -217,6 +217,7 @@ public class MetaClassRegistryImpl implements MetaClassRegistry{
* @param handle the handle
*/
public void setMetaClassCreationHandle(MetaClassCreationHandle handle) {
+ if(handle == null) throw new IllegalArgumentException("Cannot set MetaClassCreationHandle to null value!");
metaClassCreationHandle = handle;
}
|
added IAE when setting meta class creation handle to null (shouldn't be allowed)
git-svn-id: <URL>
|
apache_groovy
|
train
|
java
|
44d74ec03031ad5f976b230006e3a1533622dc8c
|
diff --git a/tests/TestCase/View/Form/FormContextTest.php b/tests/TestCase/View/Form/FormContextTest.php
index <HASH>..<HASH> 100644
--- a/tests/TestCase/View/Form/FormContextTest.php
+++ b/tests/TestCase/View/Form/FormContextTest.php
@@ -196,9 +196,21 @@ class FormContextTest extends TestCase
$this->assertEquals(['The provided value is invalid'], $context->error('email'));
$this->assertEquals(['The provided value is invalid'], $context->error('name'));
$this->assertEquals(['The provided value is invalid'], $context->error('pass.password'));
-
$this->assertEquals([], $context->error('Alias.name'));
$this->assertEquals([], $context->error('nope.nope'));
+
+ $mock = $this->getMock('Cake\Validation\Validator', ['errors']);
+ $mock->expects($this->once())
+ ->method('errors')
+ ->willReturn(['key' => 'should be an array, not a string']);
+ $form->validator($mock);
+ $form->validate([]);
+ $context = new FormContext($this->request, ['entity' => $form]);
+ $this->assertEquals(
+ ['should be an array, not a string'],
+ $context->error('key'),
+ 'This test should not produce a PHP warning from array_values().'
+ );
}
/**
|
Add an example test.
This test will error without the `(array)` cast in the previous commit.
|
cakephp_cakephp
|
train
|
php
|
f1b5cc73f9e98e1cf16edee7b42bec78d8d76d25
|
diff --git a/retry.go b/retry.go
index <HASH>..<HASH> 100644
--- a/retry.go
+++ b/retry.go
@@ -59,7 +59,7 @@ func RetryNotify(operation Operation, b BackOff, notify Notify) error {
select {
case <-cb.Context().Done():
- return err
+ return cb.Context().Err();
case <-t.C:
}
}
|
Return context error from RetryNotify when done
Previously, when the context used by RetryNotify is done, we return whatever error the last operation returned. The last operation may have run a long time ago (especially when using exponential backoff), so returning last operation error may be very confusing. It makes more sense to return the context's error, which indicates exactly why the context is done.
|
cenkalti_backoff
|
train
|
go
|
0c86fd2d155e431b5055046eced247a9037b9099
|
diff --git a/src/Illuminate/Support/HigherOrderCollectionProxy.php b/src/Illuminate/Support/HigherOrderCollectionProxy.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Support/HigherOrderCollectionProxy.php
+++ b/src/Illuminate/Support/HigherOrderCollectionProxy.php
@@ -3,14 +3,14 @@
namespace Illuminate\Support;
/**
- * @mixin \Illuminate\Support\Collection
+ * @mixin \Illuminate\Support\Enumerable
*/
class HigherOrderCollectionProxy
{
/**
* The collection being operated on.
*
- * @var \Illuminate\Support\Collection
+ * @var \Illuminate\Support\Enumerable
*/
protected $collection;
@@ -24,11 +24,11 @@ class HigherOrderCollectionProxy
/**
* Create a new proxy instance.
*
- * @param \Illuminate\Support\Collection $collection
+ * @param \Illuminate\Support\Enumerable $collection
* @param string $method
* @return void
*/
- public function __construct(Collection $collection, $method)
+ public function __construct(Enumerable $collection, $method)
{
$this->method = $method;
$this->collection = $collection;
|
Support all Enumerables in proxy
|
laravel_framework
|
train
|
php
|
e4b22f833c84a73578c4488d93140e23b3a49bf6
|
diff --git a/catalog/app/containers/Bucket/requests/requestsUntyped.js b/catalog/app/containers/Bucket/requests/requestsUntyped.js
index <HASH>..<HASH> 100644
--- a/catalog/app/containers/Bucket/requests/requestsUntyped.js
+++ b/catalog/app/containers/Bucket/requests/requestsUntyped.js
@@ -812,7 +812,7 @@ export const countPackages = withErrorHandling(async ({ req, bucket, filter }) =
),
})
const result = await req(`/search${qs}`)
- return result.aggregations.total_handles.value
+ return result.aggregations?.total_handles?.value ?? 0
})
export const listPackages = withErrorHandling(
|
fix countPackages request for empty bucket / index (#<I>)
|
quiltdata_quilt
|
train
|
js
|
e1b3272fa3684aa745ffbd7f98cda90eb5dd3cf6
|
diff --git a/tests/bundle/Controller/API/Kernel/AppKernel.php b/tests/bundle/Controller/API/Kernel/AppKernel.php
index <HASH>..<HASH> 100644
--- a/tests/bundle/Controller/API/Kernel/AppKernel.php
+++ b/tests/bundle/Controller/API/Kernel/AppKernel.php
@@ -31,12 +31,12 @@ class AppKernel extends Kernel
public function getCacheDir()
{
- return sys_get_temp_dir() . '/sfcache';
+ return sys_get_temp_dir() . '/ngcb/cache';
}
public function getLogDir()
{
- return sys_get_temp_dir() . '/sflogs';
+ return sys_get_temp_dir() . '/ngcb/logs';
}
public function registerContainerConfiguration(LoaderInterface $loader)
|
Update path to test cache and logs
|
netgen-layouts_content-browser
|
train
|
php
|
ebe67d1e7411a57958a2ce1120ad10618208d517
|
diff --git a/charmhelpers/contrib/openstack/utils.py b/charmhelpers/contrib/openstack/utils.py
index <HASH>..<HASH> 100644
--- a/charmhelpers/contrib/openstack/utils.py
+++ b/charmhelpers/contrib/openstack/utils.py
@@ -856,6 +856,9 @@ def git_clone_and_install(projects_yaml, core_project):
update_requirements=False)
requirements_dir = repo_dir
constraints = os.path.join(repo_dir, "upper-constraints.txt")
+ # upper-constraints didn't exist until after icehouse
+ if not os.path.isfile(constraints):
+ constraints = None
else:
repo_dir = _git_clone_and_install_single(repo, branch, depth,
parent_dir, http_proxy,
|
Ensure upper-constraints.txt exists before using it
|
juju_charm-helpers
|
train
|
py
|
f2477000ab25ec45f2609fa93aa9d0fc875132d8
|
diff --git a/pycanvas/course.py b/pycanvas/course.py
index <HASH>..<HASH> 100644
--- a/pycanvas/course.py
+++ b/pycanvas/course.py
@@ -502,6 +502,21 @@ class Course(CanvasObject):
)
return Section(self._requester, response.json())
+ def show_front_page(self):
+ """
+ Retrieve the content of the front page.
+
+ :calls: `GET /api/v1/courses/:course_id/front_page \
+ <https://canvas.instructure.com/doc/api/pages.html#method.wiki_pages_api.show_front_page>`_
+
+ :rtype: :class:`pycanvas.course.Course`
+ """
+ response = self._requester.request(
+ 'GET',
+ 'courses/%s/front_page' % (self.id)
+ )
+ return Page(self._requester, response.json())
+
class CourseNickname(CanvasObject):
@@ -527,3 +542,12 @@ class CourseNickname(CanvasObject):
'users/self/course_nicknames/%s' % (self.course_id)
)
return CourseNickname(self._requester, response.json())
+
+
+class Page(CanvasObject):
+
+ def __str__(self):
+ return "url: %s, title: %s" % (
+ self.url,
+ self.title
+ )
|
added class for page and method for show front page
|
ucfopen_canvasapi
|
train
|
py
|
43c5eb2127ccee9b40fa6f4846b991862242071a
|
diff --git a/django_transfer/__init__.py b/django_transfer/__init__.py
index <HASH>..<HASH> 100644
--- a/django_transfer/__init__.py
+++ b/django_transfer/__init__.py
@@ -132,14 +132,17 @@ class TransferMiddleware(MiddlewareMixin):
if method != 'POST':
request.method = 'POST'
try:
- # There is a fair chance this will fail. If it does, log the
- # error and move on.
- request._load_post_and_files()
+ try:
+ # There is a fair chance this will fail. If it does, log
+ # the error and move on.
+ request._load_post_and_files()
+ finally:
+ # Don't forget to restore the method.
+ request.method = method
except MultiPartParserError:
LOGGER.info('Error attempting to parse non-POST data',
exc_info=True)
- # Don't forget to restore the method.
- request.method = method
+ return
if not is_enabled():
return
if get_server_name() != SERVER_NGINX:
|
If it fails, nothing to do.
|
smartfile_django-transfer
|
train
|
py
|
61451fe94bc76fe9757f01e2e4cb949ace19dbca
|
diff --git a/source/Application/Model/Basket.php b/source/Application/Model/Basket.php
index <HASH>..<HASH> 100644
--- a/source/Application/Model/Basket.php
+++ b/source/Application/Model/Basket.php
@@ -1964,7 +1964,7 @@ class Basket extends \oxSuperCfg
*
* @param string $sId cost id ( optional )
*
- * @return array
+ * @return array|oxPrice|null
*/
public function getCosts($sId = null)
{
|
fix wrong return type in docblock
if $sId is not set, getCosts will return an array with all costs
if it's set it will return an oxPrice object, if that exists
if it's set and the oxPrice object doesn't exist, it will return null
|
OXID-eSales_oxideshop_ce
|
train
|
php
|
169db1fe29ed3bab25ac3ded7cc6a707f4c0b605
|
diff --git a/dvc/__init__.py b/dvc/__init__.py
index <HASH>..<HASH> 100644
--- a/dvc/__init__.py
+++ b/dvc/__init__.py
@@ -5,7 +5,7 @@ Make your data science projects reproducible and shareable.
"""
import os
-VERSION_BASE = '0.12.0'
+VERSION_BASE = '0.13.0'
__version__ = VERSION_BASE
PACKAGEPATH = os.path.abspath(os.path.dirname(__file__))
|
dvc: bump to <I>
|
iterative_dvc
|
train
|
py
|
d0607725327063e01888b0d4c05112cfc3c5c5b9
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -72,7 +72,7 @@ install_requires = [
'counter-robots>=2018.6',
'Flask>=0.11.1',
'invenio-cache>=1.0.0',
- 'invenio-queues>=1.0.0a1',
+ 'invenio-queues>=1.0.0a2',
'maxminddb-geolite2>=2017.0404',
'python-dateutil>=2.6.1',
'python-geoip>=1.2',
|
bump: invenio-queues to <I>a2
|
inveniosoftware_invenio-stats
|
train
|
py
|
e969673f7be2d2795aa4df56761f70c75839bd72
|
diff --git a/public/js/base.js b/public/js/base.js
index <HASH>..<HASH> 100644
--- a/public/js/base.js
+++ b/public/js/base.js
@@ -355,7 +355,8 @@ $(document).ready(function () {
}).bind("move_node.jstree", function (e, data) {
$.post(
window.location.href.toString() + "/move/" + data.node.id, {
- "parent_id": data.node.parent
+ "parent_id": data.node.parent,
+ "_token": tree.data('token')
}
);
});
|
Added csrf token to node moves
|
stevebauman_maintenance
|
train
|
js
|
f2ba9217c42d2082e184e2a0d156825806b353c5
|
diff --git a/py/selenium/webdriver/firefox/options.py b/py/selenium/webdriver/firefox/options.py
index <HASH>..<HASH> 100644
--- a/py/selenium/webdriver/firefox/options.py
+++ b/py/selenium/webdriver/firefox/options.py
@@ -86,11 +86,11 @@ class Options(object):
returns a dictionary with everything
"""
- required = {}
+ desired = {}
if self.binary_location:
- required["binary"] = self.binary_location
+ desired["binary"] = self.binary_location
if self._profile:
- required["firefox_profile"] = self._profile.encoded
- required["args"] = self.arguments
- capabilities = {"requiredCapabilities": required}
+ desired["firefox_profile"] = self._profile.encoded
+ desired["args"] = self.arguments
+ capabilities = {"desiredCapabilities": desired}
return capabilities
|
Move capabilities passed through to be only desiredCapabilities
Having it as required is causing issue with intermediary nodes, using desired
as this is a topic that will be discussed in Seattle in the next W3C F2F
|
SeleniumHQ_selenium
|
train
|
py
|
c921062fbbfebcc53da10c5c755c44ab6813d514
|
diff --git a/sos/sos_step.py b/sos/sos_step.py
index <HASH>..<HASH> 100755
--- a/sos/sos_step.py
+++ b/sos/sos_step.py
@@ -635,8 +635,12 @@ class Base_Step_Executor:
self.step.sigil
)
)
- # temporarily create task signature to obtain sig_id
- task_id = RuntimeInfo(self.step.md5, self.step.task, task_vars['_input'],
+ # if no output (thus no signature)
+ if task_vars['_output'] is None:
+ task_id = self.step.md5
+ else:
+ # temporarily create task signature to obtain sig_id
+ task_id = RuntimeInfo(self.step.md5, self.step.task, task_vars['_input'],
task_vars['_output'], task_vars['_depends'],
task_vars['__signature_vars__'], task_vars).sig_id
job_file = os.path.join(os.path.expanduser('~'), '.sos', task_id + '.task')
|
Fix task_id where no signature would be used (no _output)
|
vatlab_SoS
|
train
|
py
|
868aba827492a5a484a4494c4cb81b93738d5a29
|
diff --git a/lib/adhearsion/tasks/configuration.rb b/lib/adhearsion/tasks/configuration.rb
index <HASH>..<HASH> 100644
--- a/lib/adhearsion/tasks/configuration.rb
+++ b/lib/adhearsion/tasks/configuration.rb
@@ -1,6 +1,6 @@
namespace :config do
desc "Show configuration values; accepts a parameter: [nil|platform|<plugin-name>|all]"
- task :show, :name, :needs => :environment do |t, args|
+ task :show, [:name] => [:environment] do |t, args|
name = args.name.nil? ? :all : args.name.to_sym
puts "\nAdhearsion.config do |config|\n\n"
puts Adhearsion.config.description name, :show_values => true
|
[BUGFIX] Fix deprecated Rake task syntax
|
adhearsion_adhearsion
|
train
|
rb
|
fe1028bb39803363620640916cef8368cb0ca904
|
diff --git a/src/Ouzo/Core/Controller.php b/src/Ouzo/Core/Controller.php
index <HASH>..<HASH> 100644
--- a/src/Ouzo/Core/Controller.php
+++ b/src/Ouzo/Core/Controller.php
@@ -13,8 +13,12 @@ use Ouzo\Utilities\Strings;
class Controller
{
+ /** @var View */
public $view;
+
+ /** @var Layout */
public $layout;
+
public $before = array();
public $after = array();
public $currentController = '';
|
Added annotations for view and layout
|
letsdrink_ouzo
|
train
|
php
|
9a1a17c7a2fef7afc35271a801a94d9cc3ab2199
|
diff --git a/go_agent/src/bosh/app/app.go b/go_agent/src/bosh/app/app.go
index <HASH>..<HASH> 100644
--- a/go_agent/src/bosh/app/app.go
+++ b/go_agent/src/bosh/app/app.go
@@ -31,6 +31,7 @@ type app struct {
type options struct {
InfrastructureName string
PlatformName string
+ BaseDirectory string
}
func New(logger boshlog.Logger) (app app) {
@@ -45,7 +46,7 @@ func (app app) Run(args []string) (err error) {
return
}
- dirProvider := boshdirs.NewDirectoriesProvider("/var/vcap")
+ dirProvider := boshdirs.NewDirectoriesProvider(opts.BaseDirectory)
infProvider := boshinf.NewProvider(app.logger)
infrastructure, err := infProvider.Get(opts.InfrastructureName)
@@ -129,6 +130,7 @@ func parseOptions(args []string) (opts options, err error) {
flagSet.SetOutput(ioutil.Discard)
flagSet.StringVar(&opts.InfrastructureName, "I", "", "Set Infrastructure")
flagSet.StringVar(&opts.PlatformName, "P", "", "Set Platform")
+ flagSet.StringVar(&opts.BaseDirectory, "B", "/var/vcap", "Set Base Directory")
err = flagSet.Parse(args[1:])
return
|
Agent takes B flag for base directory - defaults to /var/vcap
|
cloudfoundry_bosh
|
train
|
go
|
8f7f4dadb286053c7aa3a10359a7facb417139fb
|
diff --git a/slf4j-ext/src/main/java/org/slf4j/instrumentation/ToStringHelper.java b/slf4j-ext/src/main/java/org/slf4j/instrumentation/ToStringHelper.java
index <HASH>..<HASH> 100644
--- a/slf4j-ext/src/main/java/org/slf4j/instrumentation/ToStringHelper.java
+++ b/slf4j-ext/src/main/java/org/slf4j/instrumentation/ToStringHelper.java
@@ -42,13 +42,16 @@ public class ToStringHelper {
* don't have usable toString methods.
*
* @param o
+ * incoming object to render.
* @return
*/
+
public static String render(Object o) {
if (o == null) {
return String.valueOf(o);
}
Class<?> objectClass = o.getClass();
+
if (unrenderableClasses.containsKey(objectClass) == false) {
try {
if (objectClass.isArray()) {
@@ -58,12 +61,15 @@ public class ToStringHelper {
}
} catch (Exception e) {
Long now = new Long(System.currentTimeMillis());
+
System.err.println("Disabling exception throwing class "
+ objectClass.getName() + ", " + e.getMessage());
+
unrenderableClasses.put(objectClass, now);
}
}
- return o.getClass().getName() + "@" + Integer.toHexString(o.hashCode());
+ String name = o.getClass().getName();
+ return name + "@" + Integer.toHexString(o.hashCode());
}
/**
|
Experimented with detecting recursive calls on the same object, but it
didn't work well. Ended up adding recommendation to disable logging for
troublesome classes in the log backend configuration.
|
qos-ch_slf4j
|
train
|
java
|
0f3bc82cb894b6fb67b3006b6b749a9171710062
|
diff --git a/tests/test_build_ext.py b/tests/test_build_ext.py
index <HASH>..<HASH> 100644
--- a/tests/test_build_ext.py
+++ b/tests/test_build_ext.py
@@ -1,5 +1,6 @@
import sys
import os
+import tempfile
import shutil
from io import StringIO
@@ -22,8 +23,7 @@ class BuildExtTestCase(unittest.TestCase):
def setUp(self):
# Create a simple test environment
# Note that we're making changes to sys.path
- self.tmp_dir = os.path.join(os.path.dirname(__file__), 'xx')
- os.mkdir(self.tmp_dir)
+ self.tmp_dir = tempfile.mkdtemp(prefix="pythontest_")
self.sys_path = sys.path[:]
sys.path.append(self.tmp_dir)
shutil.copy(_get_source_filename(), self.tmp_dir)
|
Merged revisions <I> via svnmerge from
svn+ssh://<EMAIL>/python/trunk
........
r<I> | tarek.ziade | <I>-<I>-<I> <I>:<I>:<I> <I> (Fri, <I> Feb <I>) | 1 line
reverted leak fix, to use the one done in py3k branch (r<I>)
........
|
pypa_setuptools
|
train
|
py
|
26701139c22d25f215391980b1dea83893678c58
|
diff --git a/perceval/backends/bugzilla.py b/perceval/backends/bugzilla.py
index <HASH>..<HASH> 100755
--- a/perceval/backends/bugzilla.py
+++ b/perceval/backends/bugzilla.py
@@ -493,11 +493,14 @@ class Bugzilla(Backend):
def get_changes_html(issue_id):
base_url = self._get_domain()
+ changes_html = None
# Try to get changes from cache
- changes_html = self._cache_get_changes(issue_id)
- if changes_html:
- logging.debug("Cache changes for %s found" % issue_id)
- else:
+ if self.use_cache:
+ changes_html = self._cache_get_changes(issue_id)
+ if changes_html:
+ logging.debug("Cache changes for %s found" % issue_id)
+
+ if not changes_html:
activity_url = base_url + "show_activity.cgi?id=" + issue_id
logging.debug("Getting changes for issue %s from %s" %
(issue_id, activity_url))
|
Just use cache to retrieve changes when use_cache is True.
|
chaoss_grimoirelab-elk
|
train
|
py
|
04aeffe4445df0621a1fa195425a334be7a5ff12
|
diff --git a/core-bundle/src/Resources/contao/library/Contao/Config.php b/core-bundle/src/Resources/contao/library/Contao/Config.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/Resources/contao/library/Contao/Config.php
+++ b/core-bundle/src/Resources/contao/library/Contao/Config.php
@@ -301,13 +301,28 @@ class Config
/**
- * Return true if the installation is completed
+ * Return true if the installation is complete
*
- * @return boolean True if the local configuration file exists
+ * @return boolean True if the installation is complete
*/
public function isComplete()
{
- return static::$blnHasLcf;
+ if (!static::$blnHasLcf)
+ {
+ return false;
+ }
+
+ if (!$this->get('licenseAccepted'))
+ {
+ return false;
+ }
+
+ if ($this->get('dbDriver') == '')
+ {
+ return false;
+ }
+
+ return true;
}
|
[Core] Check if a DB driver has been configured in Config::isComplete() (see #<I>)
|
contao_contao
|
train
|
php
|
8879ade957818763d0b0523f4033f99df36a148c
|
diff --git a/digitalocean/Action.py b/digitalocean/Action.py
index <HASH>..<HASH> 100644
--- a/digitalocean/Action.py
+++ b/digitalocean/Action.py
@@ -11,11 +11,18 @@ class Action(BaseAPI):
self.resource_id = None
self.resource_type = None
self.region = None
+ # Custom, not provided by the json object.
+ self.droplet_id = None
super(Action, self).__init__(*args, **kwargs)
def load(self):
- action = self.get_data("actions/%s" % self.id)
+ action = self.get_data(
+ "droplets/%s/actions/%s" % (
+ self.droplet_id,
+ self.id
+ )
+ )
if action:
action = action[u'action']
# Loading attributes
diff --git a/digitalocean/Droplet.py b/digitalocean/Droplet.py
index <HASH>..<HASH> 100644
--- a/digitalocean/Droplet.py
+++ b/digitalocean/Droplet.py
@@ -279,8 +279,10 @@ class Droplet(BaseAPI):
"""
actions = []
for action_id in self.action_ids:
- action = Action(action_id)
+ action = Action()
+ action.id = action_id
action.token = self.token
+ action.droplet_id = self.id
action.load()
actions.append(action)
return actions
|
Fixed a bug that was not loading correctly the Actions.
|
koalalorenzo_python-digitalocean
|
train
|
py,py
|
6f50c2b6707afb301ddd231c693f2bc9c07e26bd
|
diff --git a/test/db/mysql/connection_test.rb b/test/db/mysql/connection_test.rb
index <HASH>..<HASH> 100644
--- a/test/db/mysql/connection_test.rb
+++ b/test/db/mysql/connection_test.rb
@@ -8,8 +8,14 @@ class MySQLConnectionTest < Test::Unit::TestCase
def test_mysql_strict_mode_disabled
run_without_connection do |orig_connection|
- ActiveRecord::Base.establish_connection(orig_connection.merge({:strict => false}))
- assert_equal [['']], select_rows("SELECT @@SESSION.sql_mode") if ! mariadb_driver?
+ ActiveRecord::Base.establish_connection(orig_connection.merge(:strict => false))
+ sql_mode = select_rows("SELECT @@SESSION.sql_mode")
+ version = ActiveRecord::Base.connection.send(:version)
+ if version[0] > 6 || ( version[0] == 5 && version[1] >= 6 )
+ assert ! sql_mode.flatten.include?("STRICT_ALL_TABLES")
+ else
+ assert_equal [['']], sql_mode unless mariadb_driver?
+ end
end
end
|
make MySQL pass our tests under <I>
Conflicts:
test/db/mysql/connection_test.rb
|
jruby_activerecord-jdbc-adapter
|
train
|
rb
|
f197debd938af75883b0b1e919fb1b56e6baa50e
|
diff --git a/request.go b/request.go
index <HASH>..<HASH> 100644
--- a/request.go
+++ b/request.go
@@ -195,10 +195,7 @@ func (r *Request) parseParams() (err os.Error) {
r.Params = map[string]string{}
json.Unmarshal(b, r.Params)
case "multipart/form-data":
- _, params, err := mime.ParseMediaType(ct)
- if err != nil {
- return err
- }
+ _, params := mime.ParseMediaType(ct)
boundary, ok := params["boundary"]
if !ok {
return os.NewError("Missing Boundary")
@@ -224,10 +221,7 @@ func (r *Request) parseParams() (err os.Error) {
continue
}
name := part.FormName()
- d, params, err := mime.ParseMediaType(v)
- if err != nil {
- return err
- }
+ d, params := mime.ParseMediaType(v)
if d != "form-data" {
continue
}
|
Fix for release.r<I>
|
hoisie_web
|
train
|
go
|
22b15838cb2345795fd04067d44b23616beff9c8
|
diff --git a/distributed/src/main/java/com/orientechnologies/orient/server/distributed/impl/ONewDistributedResponseManager.java b/distributed/src/main/java/com/orientechnologies/orient/server/distributed/impl/ONewDistributedResponseManager.java
index <HASH>..<HASH> 100644
--- a/distributed/src/main/java/com/orientechnologies/orient/server/distributed/impl/ONewDistributedResponseManager.java
+++ b/distributed/src/main/java/com/orientechnologies/orient/server/distributed/impl/ONewDistributedResponseManager.java
@@ -118,7 +118,7 @@ public class ONewDistributedResponseManager implements ODistributedResponseManag
@Override
public int getQuorum() {
- return 0;
+ return quorum;
}
public synchronized boolean collectResponse(OTransactionPhase1TaskResult response, String senderNodeName) {
|
Fixed quorum '0' not reached
|
orientechnologies_orientdb
|
train
|
java
|
d5322fd282760a36659bdbdbf024ea3435725eed
|
diff --git a/laces.js b/laces.js
index <HASH>..<HASH> 100644
--- a/laces.js
+++ b/laces.js
@@ -315,14 +315,15 @@ LacesMap.prototype.set = function(key, value, options) {
setter = function(newValue) { self._setValue(key, "" + newValue); };
}
setter(value);
- } else if (options.newFilter) {
+ } else if (options.setFilter) {
setter = function(newValue) {
try {
- self._setValue(key, options.newFilter(newValue));
+ self._setValue(key, options.setFilter(newValue));
} catch (exception) {
self.log("Invalid value for property " + key + ": " + newValue);
}
};
+ setter(value);
} else {
this._setValue(key, value);
}
|
Fixes to setFilter option.
|
arendjr_laces.js
|
train
|
js
|
e38ad507cfe86346a2ae5d3398578a8a5dac3267
|
diff --git a/fabric/connection.py b/fabric/connection.py
index <HASH>..<HASH> 100644
--- a/fabric/connection.py
+++ b/fabric/connection.py
@@ -569,7 +569,7 @@ class Connection(Context):
# Listener for local forwarding). See if we can use more of Paramiko's
# API (or improve it and then do so) so that isn't necessary.
tunnels = []
- def callback(channel, (src_addr, src_port), (dst_addr, dst_port)):
+ def callback(channel, src_addr_tup, dst_addr_tup):
sock = socket.socket()
# TODO: handle connection failure such that channel, etc get closed
sock.connect((local_host, local_port))
|
Python 3 removed tuple unpacking noooooooo
|
fabric_fabric
|
train
|
py
|
3bb539d3bf9e7072774bf8a806ff6030bae20634
|
diff --git a/certvalidator/context.py b/certvalidator/context.py
index <HASH>..<HASH> 100644
--- a/certvalidator/context.py
+++ b/certvalidator/context.py
@@ -281,7 +281,7 @@ class ValidationContext():
# some of which separate the hex char pairs via spaces or colons
whitelisted_cert = whitelisted_cert.replace(' ', '').replace(':', '')
self._whitelisted_certs.add(
- binascii.unhexlify(whitelisted_cert)
+ binascii.unhexlify(whitelisted_cert.encode('ascii'))
)
self.certificate_registry = CertificateRegistry(
|
Fix a bug with whitelisting a certificate on Python <I>
|
wbond_certvalidator
|
train
|
py
|
1995219b550de89b8adfac2aa43a4668ad048134
|
diff --git a/image.go b/image.go
index <HASH>..<HASH> 100644
--- a/image.go
+++ b/image.go
@@ -80,6 +80,16 @@ func (i *Image) Fill(clr color.Color) error {
//
// When the given image is as same as i, DrawImage panics.
//
+// DrawImage works more efficiently as batches
+// when the successive calls of DrawImages satisfies the below conditions:
+//
+// * All render targets are same (A in A.DrawImage(B, op))
+// * All render sources are same (B in A.DrawImage(B, op))
+// * All ColorM values are same
+// * All CompositeMode values are same
+//
+// For more performance tips, see https://github.com/hajimehoshi/ebiten/wiki/Performance-Tips.
+//
// DrawImage always returns nil as of 1.5.0-alpha.
func (i *Image) DrawImage(img *Image, options *DrawImageOptions) error {
if i == img {
|
graphics: Add performance tips on DrawImage
|
hajimehoshi_ebiten
|
train
|
go
|
64747cf3bc3f3321f0ad7c00b9f04ea91b71987d
|
diff --git a/extract.js b/extract.js
index <HASH>..<HASH> 100644
--- a/extract.js
+++ b/extract.js
@@ -3,9 +3,9 @@ var cachingStream = require('./lib/util/caching-stream')
var dezalgo = require('dezalgo')
var extractStream = require('./lib/util/extract-stream')
var pipe = require('mississippi').pipe
+var pipeline = require('mississippi').pipeline
var optCheck = require('./lib/util/opt-check')
var rps = require('realize-package-specifier')
-var through = require('mississippi').through
module.exports = extract
function extract (spec, dest, opts, cb) {
@@ -79,11 +79,11 @@ function tryFullFetch (spec, opts, cb) {
}
function pipeToDest (stream, dest, pkg, opts, cb) {
+ if (opts.cache) {
+ stream = pipeline(stream, cachingStream(pkg, opts))
+ }
pipe(
stream,
- opts.cache
- ? cachingStream(pkg, opts)
- : through(),
extractStream(dest, opts),
function (err) {
if (err) { return cb(err) }
|
extract: small refactor for stream stuff
|
zkat_pacote
|
train
|
js
|
85b2b551d72b8029665700cc1248a7d92413aff8
|
diff --git a/tartpy/runtime.py b/tartpy/runtime.py
index <HASH>..<HASH> 100644
--- a/tartpy/runtime.py
+++ b/tartpy/runtime.py
@@ -61,6 +61,14 @@ class SimpleRuntime(AbstractRuntime):
def error(self, message):
print('ERROR: {0}'.format(pprint.pformat(message)))
+
+class Runtime(SimpleRuntime):
+
+ def __init__(self):
+ super().__init__()
+ self.evloop = EventLoop()
+ self.evloop.run_in_thread()
+
class Actor(object):
|
Add runtime that starts event loop automatically
|
waltermoreira_tartpy
|
train
|
py
|
62cd251327ca5618feb75cf77df84fae8b1aa057
|
diff --git a/src/sku/components/SkuRowItem.js b/src/sku/components/SkuRowItem.js
index <HASH>..<HASH> 100644
--- a/src/sku/components/SkuRowItem.js
+++ b/src/sku/components/SkuRowItem.js
@@ -47,9 +47,8 @@ export default createComponent({
genImage(classPrefix) {
const { imgUrl } = this;
-
- if (imgUrl && this.largePicturePreview) {
- if (this.lazyLoad) {
+ if (imgUrl) {
+ if (this.largePicturePreview && this.lazyLoad) {
return (
<img class={`${classPrefix}-img`} src={imgUrl} vLazy={imgUrl} />
);
@@ -83,7 +82,13 @@ export default createComponent({
/>
)}
{this.genImage(classPrefix)}
- <span class={`${classPrefix}-name`}>{this.skuValue.name}</span>
+ <div class={`${classPrefix}-name`}>
+ <span
+ class={this.largePicturePreview ? 'van-multi-ellipsis--l2' : ''}
+ >
+ {this.skuValue.name}
+ </span>
+ </div>
</span>
);
},
|
fix(Sku): small image mode and text ellipsis (#<I>)
|
youzan_vant
|
train
|
js
|
659eda144bec79c18ca1a6cd14289bd86af5f338
|
diff --git a/lib/VideoCoverFallback.js b/lib/VideoCoverFallback.js
index <HASH>..<HASH> 100644
--- a/lib/VideoCoverFallback.js
+++ b/lib/VideoCoverFallback.js
@@ -63,7 +63,6 @@ class VideoCoverFallback extends Component {
render() {
const { innerRatio, outerRatio } = this.state;
const style = {
- ...this.props.style,
width: innerRatio > outerRatio ? 'auto' : '100%',
height: innerRatio > outerRatio ? '100%' : 'auto',
@@ -81,6 +80,7 @@ class VideoCoverFallback extends Component {
const outerStyle = {
width: '100%',
height: '100%',
+ ...this.props.style,
position: 'relative',
overflow: 'hidden',
};
|
if the fallback is used, styles are now applied to video-container.
probably more useful.
|
tkloht_react-video-cover
|
train
|
js
|
df0beed25cc1f17bae38ef1756658d859ff00962
|
diff --git a/src/Access/Utils.php b/src/Access/Utils.php
index <HASH>..<HASH> 100644
--- a/src/Access/Utils.php
+++ b/src/Access/Utils.php
@@ -418,7 +418,7 @@ class Utils
* @param string $userId ID of user
* @return array list of user's capabilities or empty array
*/
- public function fetchUserCapabilities($userId)
+ public static function fetchUserCapabilities($userId)
{
$entities = [];
@@ -444,7 +444,7 @@ class Utils
* @param array $actions Controller actions
* @return array
*/
- public function getCapabilities($controllerName = null, array $actions = [])
+ public static function getCapabilities($controllerName = null, array $actions = [])
{
$result = [];
@@ -486,7 +486,7 @@ class Utils
* @param array $url Controller url
* @return bool
*/
- public function hasTypeAccess($type, array $actionCapabilities, array $user, array $url)
+ public static function hasTypeAccess($type, array $actionCapabilities, array $user, array $url)
{
// skip if action has no access capabilities for specified type
if (!isset($actionCapabilities[$type])) {
@@ -524,7 +524,7 @@ class Utils
* @param string $userId user id
* @return bool
*/
- public function hasAccessInCapabilities($capability, $userId)
+ public static function hasAccessInCapabilities($capability, $userId)
{
$userCaps = static::fetchUserCapabilities($userId);
if (in_array($capability, $userCaps)) {
|
Fixed methods definitions in the static Utils class
|
QoboLtd_cakephp-roles-capabilities
|
train
|
php
|
b2d338cb8a6f2836e247da4e8f252c33be5368c2
|
diff --git a/library/src/main/java/com/tokenautocomplete/TokenCompleteTextView.java b/library/src/main/java/com/tokenautocomplete/TokenCompleteTextView.java
index <HASH>..<HASH> 100644
--- a/library/src/main/java/com/tokenautocomplete/TokenCompleteTextView.java
+++ b/library/src/main/java/com/tokenautocomplete/TokenCompleteTextView.java
@@ -1017,7 +1017,7 @@ public abstract class TokenCompleteTextView extends MultiAutoCompleteTextView im
text.delete(spanEnd, spanEnd + 1);
}
- if (spanStart >= 0 && text.charAt(spanStart) == ',') {
+ if (spanStart > 0 && text.charAt(spanStart) == ',') {
text.delete(spanStart, spanStart + 1);
}
}
|
Fix deleteSelectedObject IndexOutOfBoundsException
Fix the object occurs IndexOutOfBoundsException which is generated by addObject(obj) when delete KeyEvent triggered.
|
splitwise_TokenAutoComplete
|
train
|
java
|
6124bf6ded64bf292549ad66a5aaaa216d5c3019
|
diff --git a/replication.go b/replication.go
index <HASH>..<HASH> 100644
--- a/replication.go
+++ b/replication.go
@@ -19,10 +19,9 @@ type followerReplication struct {
stopCh chan uint64
triggerCh chan struct{}
- currentTerm uint64
- matchIndex uint64
- nextIndex uint64
- lastCommitIndex uint64
+ currentTerm uint64
+ matchIndex uint64
+ nextIndex uint64
lastContact time.Time
failures uint64
@@ -118,11 +117,6 @@ START:
req.Entries = append(req.Entries, oldLog)
}
- // Skip the RPC call if there is nothing to do
- if len(req.Entries) == 0 && req.LeaderCommitIndex == s.lastCommitIndex {
- return
- }
-
// Make the RPC call
start = time.Now()
if err := r.trans.AppendEntries(s.peer, &req, &resp); err != nil {
@@ -150,7 +144,6 @@ START:
// Update the indexes
s.matchIndex = maxIndex
s.nextIndex = maxIndex + 1
- s.lastCommitIndex = req.LeaderCommitIndex
// Clear any failures
s.failures = 0
|
Removing optimization around appendEntries RPC
The optimization avoids an appendEntries call when the follower is
up-to-date. However, if a follower restarts, its log may be complete
but the commit index will be 0 until the next appendEntries call. This
can potentially be a very long time if there is no activity, which
results in stale results on the followers.
|
hashicorp_raft
|
train
|
go
|
bb58fbebb80bd7232427772bd6cb713bc6dbe6ec
|
diff --git a/lib/method.rb b/lib/method.rb
index <HASH>..<HASH> 100644
--- a/lib/method.rb
+++ b/lib/method.rb
@@ -61,15 +61,15 @@ module Atomy
skip = g.new_label
argmis = g.new_label
- g.dup
- recv.matches?(g) # TODO: skip kind_of matches
- g.gif skip
-
if reqs.size > min_reqs
g.passed_arg(reqs.size - 1)
g.gif skip
end
+ g.dup
+ recv.matches?(g) # TODO: skip kind_of matches
+ g.gif skip
+
if recv.bindings > 0
g.push_self
recv.deconstruct(g, locals)
@@ -133,7 +133,6 @@ module Atomy
argmis.set!
g.pop
- g.goto skip
skip.set!
end
|
check arg count before matching the receiver
|
vito_atomy
|
train
|
rb
|
e11dcbc3e4b2ff4727e2427f9e5333ae9c451ee4
|
diff --git a/tools/run_tests/artifacts/artifact_targets.py b/tools/run_tests/artifacts/artifact_targets.py
index <HASH>..<HASH> 100644
--- a/tools/run_tests/artifacts/artifact_targets.py
+++ b/tools/run_tests/artifacts/artifact_targets.py
@@ -107,6 +107,11 @@ class PythonArtifact:
self.py_version = py_version
if 'manylinux' in platform:
self.labels.append('linux')
+ if 'linux_extra' in platform:
+ # linux_extra wheels used to be built by a separate kokoro job.
+ # Their build is now much faster, so they can be included
+ # in the regular artifact build.
+ self.labels.append('linux')
def pre_build_jobspecs(self):
return []
|
Include "linux_extra" python artifacts in regular linux build (#<I>)
|
grpc_grpc
|
train
|
py
|
de35f11b74a91e2fc156780bf6fc66f5a36502e1
|
diff --git a/keyboard.py b/keyboard.py
index <HASH>..<HASH> 100644
--- a/keyboard.py
+++ b/keyboard.py
@@ -19,6 +19,7 @@ def _update_state(event):
handlers = [_update_state]
listening_thread = Thread(target=listen, args=(handlers,))
+listening_thread.is_daemon = True
def add_handler(handler):
""" Adds a function to receive each keyboard event captured. """
|
Make listening thread a daemon
|
boppreh_keyboard
|
train
|
py
|
c4f7ef0702f269161a60489ccbbc9f1241ad1265
|
diff --git a/version.go b/version.go
index <HASH>..<HASH> 100644
--- a/version.go
+++ b/version.go
@@ -19,7 +19,7 @@ var (
ErrInvalidSemVer = errors.New("Invalid Semantic Version")
)
-// The regular expression used to parse a semantic version.
+// SemVerRegex id the regular expression used to parse a semantic version.
const SemVerRegex string = `v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?` +
`(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` +
`(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?`
@@ -200,7 +200,7 @@ func compareSegment(v, o int64) int {
func comparePrerelease(v, o string) int {
- // split the prelease versions by their part. The seperator, per the spec,
+ // split the prelease versions by their part. The separator, per the spec,
// is a .
sparts := strings.Split(v, ".")
oparts := strings.Split(o, ".")
@@ -235,7 +235,7 @@ func comparePrerelease(v, o string) int {
}
}
- // Reaching here means two verisons are of equal value but have different
+ // Reaching here means two versions are of equal value but have different
// metadata (the part following a +). They are not identical in string form
// but the version comparison finds them to be equal.
return 0
|
Fixed a couple misspellings and an exported const comment.
|
Masterminds_semver
|
train
|
go
|
1598716786896a5c0a695bd10f2d5454bf17f345
|
diff --git a/src/language/JSLintUtils.js b/src/language/JSLintUtils.js
index <HASH>..<HASH> 100644
--- a/src/language/JSLintUtils.js
+++ b/src/language/JSLintUtils.js
@@ -227,7 +227,7 @@ define(function (require, exports, module) {
var $jslintResults = $("#jslint-results"),
$jslintContent = $("#jslint-results .table-container");
- StatusBar.addIndicator(module.id, $("#gold-star"), true);
+ StatusBar.addIndicator(module.id, $("#gold-star"), true, "", Strings.JSLINT_DISABLED);
});
// Define public API
|
Adding tooltip to JSLint start on start-up with JSLint disabled
|
adobe_brackets
|
train
|
js
|
87cd7584a5cf8302bcb3f6d84fb7fed42908f855
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -64,6 +64,7 @@ setup(
],
extras_require={
'dev': [
+ 'tox',
'wheel',
'bumpversion',
'gitchangelog',
|
doc: List 'tox' as a dev dependency.
|
RescueTime_cwmon
|
train
|
py
|
5a0f480929d280dcedae74e1f715a58a62a4709d
|
diff --git a/code/administrator/components/com_files/configs/state.php b/code/administrator/components/com_files/configs/state.php
index <HASH>..<HASH> 100644
--- a/code/administrator/components/com_files/configs/state.php
+++ b/code/administrator/components/com_files/configs/state.php
@@ -10,6 +10,18 @@
class ComFilesConfigState extends KConfigState
{
+ /**
+ * Needed to make sure form filter does not add config to the form action
+ */
+ public function getData($unique = false)
+ {
+ $data = parent::getData($unique);
+
+ unset($data['config']);
+
+ return $data;
+ }
+
public function get($name, $default = null)
{
$result = parent::get($name, $default);
|
re #<I>: Make sure config state does not get passed to the template filter
|
joomlatools_joomlatools-framework
|
train
|
php
|
d1cccee45095c1f084c019e67718ebc983e73fa5
|
diff --git a/ui/src/components/table/QTable.js b/ui/src/components/table/QTable.js
index <HASH>..<HASH> 100644
--- a/ui/src/components/table/QTable.js
+++ b/ui/src/components/table/QTable.js
@@ -264,6 +264,9 @@ export default Vue.extend({
items: this.computedRows,
type: '__qtable'
},
+ on: {
+ 'virtual-scroll': (e) => this.$emit('virtual-scroll', e)
+ },
class: this.tableClass,
style: this.tableStyle,
scopedSlots: {
|
Added Virtual Scroll event to QTable (#<I>)
With the event we can include a infinite Scroll logic into the QTable
|
quasarframework_quasar
|
train
|
js
|
a99b84929eab0e8644498fea39c926a0d74ed28c
|
diff --git a/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
index <HASH>..<HASH> 100644
--- a/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
+++ b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
@@ -1115,6 +1115,12 @@ public abstract class StreamTask<OUT, OP extends StreamOperator<OUT>>
checkpointMetaData.getCheckpointId());
}
} catch (Exception e) {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("{} - asynchronous part of checkpoint {} could not be completed.",
+ owner.getName(),
+ checkpointMetaData.getCheckpointId(),
+ e);
+ }
handleExecutionException(e);
} finally {
owner.cancelables.unregisterCloseable(this);
|
[FLINK-<I>][checkpointing] Log exceptions during async checkpoint
|
apache_flink
|
train
|
java
|
cbbd55ae178b052169d6d911929bebb973357428
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from __future__ import absolute_import
from distutils.core import setup
setup(name='autograd',
- version='1.0.3',
+ version='1.0.4',
description='Efficiently computes derivatives of numpy code.',
author='Dougal Maclaurin and David Duvenaud',
author_email="[email protected], [email protected]",
|
Updated version number to <I>
|
HIPS_autograd
|
train
|
py
|
b52f5d441ac4d372dedb1237ac2823e78a407763
|
diff --git a/treeherder/perf/models.py b/treeherder/perf/models.py
index <HASH>..<HASH> 100644
--- a/treeherder/perf/models.py
+++ b/treeherder/perf/models.py
@@ -147,5 +147,5 @@ class PerformanceAlert(models.Model):
unique_together = ('summary', 'series_signature')
def __str__(self):
- return "{} {} {}%".format(self.alert_summary, self.series_signature,
+ return "{} {} {}%".format(self.summary, self.series_signature,
self.amount_pct)
|
Bug <I> - Fix print method for performance alert
|
mozilla_treeherder
|
train
|
py
|
49622c9bff08a6c7f395845a5a3e9ac5fc570c14
|
diff --git a/packages/www/gulpfile.js b/packages/www/gulpfile.js
index <HASH>..<HASH> 100644
--- a/packages/www/gulpfile.js
+++ b/packages/www/gulpfile.js
@@ -58,8 +58,7 @@ gulp.task("docs:dist", () => {
gulp.task("docs:index", () => {
return gulp
.src([
- "dist/*.html",
- "dist/*.ico"
+ "dist/*.html"
])
.pipe(gulp.dest("."));
});
|
chore(www): `docs` task doesn't need to copy `*.ico` anymore.
|
randytarampi_me
|
train
|
js
|
17240c7519cd819fc1f35e643dd9b7d58b2a6089
|
diff --git a/tests/lax_numpy_test.py b/tests/lax_numpy_test.py
index <HASH>..<HASH> 100644
--- a/tests/lax_numpy_test.py
+++ b/tests/lax_numpy_test.py
@@ -1532,7 +1532,6 @@ class LaxBackedNumpyTests(jtu.JaxTestCase):
for q_dtype in [onp.float32]
for q_shape in scalar_shapes + [(4,)]
for keepdims in [False, True]))
- @jtu.skip_on_devices("tpu") # TODO(phawkins): investigate this failure
def testQuantile(self, op, a_rng, q_rng, a_shape, a_dtype, q_shape, q_dtype,
axis, keepdims):
if op == "quantile" and numpy_version < (1, 15):
|
Enable quantile test on TPU.
|
tensorflow_probability
|
train
|
py
|
d0daecfb2f3284382a4241f6af40e19b86c8e275
|
diff --git a/lib/twitch.init.js b/lib/twitch.init.js
index <HASH>..<HASH> 100644
--- a/lib/twitch.init.js
+++ b/lib/twitch.init.js
@@ -30,7 +30,7 @@
}
else if (options.electron) {
gui_type = "electron";
- BrowserWindow = require("browser-window");
+ BrowserWindow = require('remote').require('browser-window');
}
initSession(options.session, callback);
|
Fix electron BrowserWindow hook
The require needs a require for remote first to function correctly. (Electron handles the rest)
|
Spiffyk_twitch-node-sdk
|
train
|
js
|
2ec73052ecbe9b24e7a03923e501fa20c9a1e3a4
|
diff --git a/operator/k8s_cep_gc.go b/operator/k8s_cep_gc.go
index <HASH>..<HASH> 100644
--- a/operator/k8s_cep_gc.go
+++ b/operator/k8s_cep_gc.go
@@ -163,7 +163,7 @@ func doCiliumEndpointSyncGC(ctx context.Context, once bool, stopCh chan struct{}
ctx,
cep.Name,
meta_v1.DeleteOptions{PropagationPolicy: &PropagationPolicy})
- if !k8serrors.IsNotFound(err) {
+ if err != nil && !k8serrors.IsNotFound(err) {
scopedLog.WithError(err).Warning("Unable to delete orphaned CEP")
return err
}
|
operator: do not early return on CEP GC
Fixes: b3adc4d<I>c ("k8s: delete IPs from ipcache for no running Pods")
|
cilium_cilium
|
train
|
go
|
9007c0c006c03d2fc02e2964dbe28da555942903
|
diff --git a/android/app/src/main/java/com/reactnativenavigation/layouts/BottomTabsLayout.java b/android/app/src/main/java/com/reactnativenavigation/layouts/BottomTabsLayout.java
index <HASH>..<HASH> 100644
--- a/android/app/src/main/java/com/reactnativenavigation/layouts/BottomTabsLayout.java
+++ b/android/app/src/main/java/com/reactnativenavigation/layouts/BottomTabsLayout.java
@@ -114,7 +114,7 @@ public class BottomTabsLayout extends BaseLayout implements AHBottomNavigation.O
private void createSnackbarContainer() {
snackbarAndFabContainer = new SnackbarAndFabContainer(getContext(), this);
- RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(MATCH_PARENT, MATCH_PARENT);
+ RelativeLayout.LayoutParams lp = new RelativeLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT);
lp.addRule(ABOVE, bottomTabs.getId());
getScreenStackParent().addView(snackbarAndFabContainer, lp);
}
|
Snackbar does not block content
|
wix_react-native-navigation
|
train
|
java
|
bdd608ee32392cfd5d100fffbe2cf34a7f9b2cef
|
diff --git a/rtpipe/parsesdm.py b/rtpipe/parsesdm.py
index <HASH>..<HASH> 100644
--- a/rtpipe/parsesdm.py
+++ b/rtpipe/parsesdm.py
@@ -518,7 +518,7 @@ def read_sources(sdmname):
def read_scans(sdmfile, bdfdir=''):
""" Use sdmpy to get all scans and info needed for rtpipe as dict """
- sdm = getsdm(sdmfile, bdfdir)
+ sdm = getsdm(sdmfile, bdfdir=bdfdir)
scandict = {}
skippedscans = []
diff --git a/rtpipe/version.py b/rtpipe/version.py
index <HASH>..<HASH> 100644
--- a/rtpipe/version.py
+++ b/rtpipe/version.py
@@ -1 +1 @@
-__version__ = '1.48'
+__version__ = '1.49'
|
bug fix to get bdfdir into sdmpy
|
caseyjlaw_rtpipe
|
train
|
py,py
|
23bd7d88e1986cff132716ebc76dc6d4300dcefa
|
diff --git a/ryu/ofproto/ofproto_v1_2_parser.py b/ryu/ofproto/ofproto_v1_2_parser.py
index <HASH>..<HASH> 100644
--- a/ryu/ofproto/ofproto_v1_2_parser.py
+++ b/ryu/ofproto/ofproto_v1_2_parser.py
@@ -286,9 +286,9 @@ class OFPPortStatus(MsgBase):
def parser(cls, datapath, version, msg_type, msg_len, xid, buf):
msg = super(OFPPortStatus, cls).parser(datapath, version, msg_type,
msg_len, xid, buf)
- (msg.reason,) = struct.unpack_from(
+ msg.reason = struct.unpack_from(
ofproto_v1_2.OFP_PORT_STATUS_PACK_STR, msg.buf,
- ofproto_v1_2.OFP_HEADER_SIZE)
+ ofproto_v1_2.OFP_HEADER_SIZE)[0]
msg.desc = OFPPort.parser(msg.buf,
ofproto_v1_2.OFP_PORT_STATUS_DESC_OFFSET)
return msg
|
of<I>: add unittest workaround to OFPPortStatus parser
Add unittest workaround to OFPPortStatus parser. Another Option is
defining something like OFP_PORT_STATUS_PACK_STR0, 'B'. I don't care
much. Let's just do as we do with OF<I>.
|
osrg_ryu
|
train
|
py
|
c201d969e62dd37a20fa78470f55c4970123ea49
|
diff --git a/spec/heroku/command/stack_spec.rb b/spec/heroku/command/stack_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/heroku/command/stack_spec.rb
+++ b/spec/heroku/command/stack_spec.rb
@@ -20,7 +20,7 @@ module Heroku::Command
=== example Available Stacks
aspen-mri-1.8.6
bamboo-ree-1.8.7
- cedar (beta)
+ cedar-10 (beta)
* bamboo-mri-1.9.2
STDOUT
|
Update spec to match the new behavior of stacks
|
heroku_legacy-cli
|
train
|
rb
|
e52a46de65d766e30890ea588a1976a15e69ed9a
|
diff --git a/worker/peergrouper/worker.go b/worker/peergrouper/worker.go
index <HASH>..<HASH> 100644
--- a/worker/peergrouper/worker.go
+++ b/worker/peergrouper/worker.go
@@ -213,6 +213,15 @@ func (w *pgWorker) loop() error {
case <-configChanges:
// Controller config has changed.
logger.Tracef("<-w.configChanges")
+
+ // If a config change wakes up the loop before the topology has
+ // been represented in the worker's machine trackers, ignore it;
+ // errors will occur when trying to determine peer group changes.
+ // Continuing is OK because subsequent invocations of the loop will
+ // pick up the most recent config from state anyway.
+ if len(w.machineTrackers) == 0 {
+ continue
+ }
case <-updateChan:
// Scheduled update.
logger.Tracef("<-updateChan")
@@ -302,19 +311,7 @@ func (w *pgWorker) watchForConfigChanges() (<-chan struct{}, error) {
if err := w.catacomb.Add(controllerConfigWatcher); err != nil {
return nil, errors.Trace(err)
}
-
- out := make(chan struct{})
- go func() {
- for {
- select {
- case <-w.catacomb.Dying():
- return
- case <-controllerConfigWatcher.Changes():
- out <- struct{}{}
- }
- }
- }()
- return out, nil
+ return controllerConfigWatcher.Changes(), nil
}
// updateControllerMachines updates the peergrouper's current list of
|
Avoids creating a new goroutine to watch controller config changes.
If a config changes wakes the loop before the machine-trackers have been populated, do not attempt to process changes.
|
juju_juju
|
train
|
go
|
58d22781fbff97952182b5e88a2c18ea2683d631
|
diff --git a/test_addict.py b/test_addict.py
index <HASH>..<HASH> 100644
--- a/test_addict.py
+++ b/test_addict.py
@@ -357,6 +357,12 @@ class Tests(unittest.TestCase):
self.assertDictEqual(org, correct)
self.assertIsInstance(org.b[0], dict)
+ def test_update_with_kws(self):
+ org = Dict(one=1, two=2)
+ someother = Dict(one=3)
+ someother.update(one=1, two=3)
+ self.assertDictEqual(org, someother)
+
def test_hook_in_constructor(self):
a_dict = Dict(TEST_DICT)
self.assertIsInstance(a_dict['a'], Dict)
|
Tests: add test for Dict.update called with keywords
|
mewwts_addict
|
train
|
py
|
8ec5de6d29d4c78d1198ceba18738569bcb321da
|
diff --git a/app/controllers/spree/admin/admin_controller_decorator.rb b/app/controllers/spree/admin/admin_controller_decorator.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/spree/admin/admin_controller_decorator.rb
+++ b/app/controllers/spree/admin/admin_controller_decorator.rb
@@ -3,9 +3,9 @@ if defined?(Spree::Admin::BaseController)
Spree::Admin::BaseController.class_eval do
protected
def model_class
- const_name = "Spree::#{controller_name.classify}"
- if Object.const_defined?(const_name)
- return const_name.constantize
+ const_name = controller_name.classify
+ if Spree.const_defined?(const_name)
+ return "Spree::#{const_name}".constantize
end
nil
end
|
Correctly reference constants within Admin::BaseController decorator
Conflicts:
app/controllers/spree/admin/admin_controller_decorator.rb
|
spree_spree_auth_devise
|
train
|
rb
|
25dc66816d0a379a738422df383649da88e538a6
|
diff --git a/src/XdrModel/Signer.php b/src/XdrModel/Signer.php
index <HASH>..<HASH> 100755
--- a/src/XdrModel/Signer.php
+++ b/src/XdrModel/Signer.php
@@ -42,4 +42,38 @@ class Signer implements XdrEncodableInterface
return $bytes;
}
+
+ /**
+ * @return SignerKey
+ */
+ public function getKey()
+ {
+ return $this->key;
+ }
+
+ /**
+ * @param SignerKey $key
+ */
+ public function setKey($key)
+ {
+ $this->key = $key;
+ }
+
+ /**
+ * @return int
+ */
+ public function getWeight()
+ {
+ return $this->weight;
+ }
+
+ /**
+ * @param int $weight
+ */
+ public function setWeight($weight)
+ {
+ if ($weight > 255 || $weight < 0) throw new \InvalidArgumentException('weight must be between 0 and 255');
+
+ $this->weight = $weight;
+ }
}
\ No newline at end of file
|
Signer - added accessors
|
zulucrypto_stellar-api
|
train
|
php
|
b0c9f3b7c2808fe63626a0d0f60a0dd1c472cf78
|
diff --git a/vendor/k8s.io/kubernetes/test/e2e/framework/kubelet_stats.go b/vendor/k8s.io/kubernetes/test/e2e/framework/kubelet_stats.go
index <HASH>..<HASH> 100644
--- a/vendor/k8s.io/kubernetes/test/e2e/framework/kubelet_stats.go
+++ b/vendor/k8s.io/kubernetes/test/e2e/framework/kubelet_stats.go
@@ -609,12 +609,12 @@ func (r *resourceCollector) collectStats(oldStatsMap map[string]*stats.Container
defer r.lock.Unlock()
for _, name := range r.containers {
cStats, ok := cStatsMap[name]
- if !ok {
+ if !ok || cStats.CPU == nil {
Logf("Missing info/stats for container %q on node %q", name, r.node)
return
}
- if oldStats, ok := oldStatsMap[name]; ok {
+ if oldStats, ok := oldStatsMap[name]; ok && oldStats.CPU != nil {
if oldStats.CPU.Time.Equal(cStats.CPU.Time) {
// No change -> skip this stat.
continue
|
UPSTREAM: <drop>: Continue to carry the cAdvisor patch
|
openshift_origin
|
train
|
go
|
8a371fdac919da6ecc953b23fd8d2b54c7cdd727
|
diff --git a/lib/rails_email_preview/integrations/comfortable_mexica_sofa.rb b/lib/rails_email_preview/integrations/comfortable_mexica_sofa.rb
index <HASH>..<HASH> 100644
--- a/lib/rails_email_preview/integrations/comfortable_mexica_sofa.rb
+++ b/lib/rails_email_preview/integrations/comfortable_mexica_sofa.rb
@@ -48,7 +48,7 @@ module RailsEmailPreview
site: site
)
p = {site_id: site.id}
- edit_path = if snippet
+ edit_path = if snippet.persisted?
p[:id] = snippet.id
if snippet.content.blank? && default_site && (default_snippet = default_site.snippets.find_by_identifier(snippet_id))
p[:snippet] = {
|
Fix regression introduced by a merge #<I>
|
glebm_rails_email_preview
|
train
|
rb
|
9f122de481479e5bfa9b42dcf7ccb7b8b7f5cf57
|
diff --git a/lxd/api_cluster_test.go b/lxd/api_cluster_test.go
index <HASH>..<HASH> 100644
--- a/lxd/api_cluster_test.go
+++ b/lxd/api_cluster_test.go
@@ -346,7 +346,7 @@ func TestCluster_JoinDifferentServerAddress(t *testing.T) {
assert.Equal(t, "Online", nodes[1].Status)
}
-// If an LXD node is already for networking and the user asks to configure a
+// If a LXD node is already for networking and the user asks to configure a
// the same address as cluster address, the request still succeeds.
func TestCluster_JoinSameServerAddress(t *testing.T) {
t.Skip("issue #6122")
|
lxd/api: LXD is pronounced lex-dee
|
lxc_lxd
|
train
|
go
|
7f82d4761b07e58a26b04f2db63882a2083feb97
|
diff --git a/lib/Opauth/Opauth.php b/lib/Opauth/Opauth.php
index <HASH>..<HASH> 100644
--- a/lib/Opauth/Opauth.php
+++ b/lib/Opauth/Opauth.php
@@ -22,8 +22,8 @@ class Opauth{
*/
public $strategyMap;
- public function __construct($config = array()){
-
+ public function __construct($config = array(), $run = true){
+
/**
* Configurable settings
*/
@@ -63,9 +63,18 @@ class Opauth{
}
$this->_loadStrategies();
- $this->_parseUri();
-
+
+ if ($run) $this->_run();
+ }
+
+/**
+ * Run Opauth:
+ * Parses request URI and perform defined authentication actions based based on it.
+ */
+ private function _run(){
/* Run */
+ $this->_parseUri();
+
if (!empty($this->env['params']['strategy'])){
if (strtolower($this->env['params']['strategy']) == 'callback'){
$this->callback();
|
Opauth can now be instantiated without running
|
opauth_opauth
|
train
|
php
|
da17219fe186ea0ce86904091791ca65f27bad67
|
diff --git a/Classes/Plugin/Results/LastSearchesCommand.php b/Classes/Plugin/Results/LastSearchesCommand.php
index <HASH>..<HASH> 100644
--- a/Classes/Plugin/Results/LastSearchesCommand.php
+++ b/Classes/Plugin/Results/LastSearchesCommand.php
@@ -28,6 +28,7 @@ namespace ApacheSolrForTypo3\Solr\Plugin\Results;
use ApacheSolrForTypo3\Solr\Domain\Search\LastSearches\LastSearchesService;
use ApacheSolrForTypo3\Solr\Plugin\CommandPluginBase;
use ApacheSolrForTypo3\Solr\Plugin\PluginCommand;
+use ApacheSolrForTypo3\Solr\System\Configuration\TypoScriptConfiguration;
use ApacheSolrForTypo3\Solr\Template;
use TYPO3\CMS\Core\Utility\GeneralUtility;
@@ -44,14 +45,14 @@ class LastSearchesCommand implements PluginCommand
/**
* Parent plugin
*
- * @var Results
+ * @var CommandPluginBase
*/
protected $parentPlugin;
/**
* Configuration
*
- * @var array
+ * @var TypoScriptConfiguration
*/
protected $configuration;
|
[TASK] Fix scrutinizer issues in LastSearchesCommand
|
TYPO3-Solr_ext-solr
|
train
|
php
|
b81e9a15a8f525a89f1666b3a9408ea279d6c1c2
|
diff --git a/lib/Dicer.js b/lib/Dicer.js
index <HASH>..<HASH> 100644
--- a/lib/Dicer.js
+++ b/lib/Dicer.js
@@ -1,5 +1,4 @@
-var WritableStream = require('stream').Writable
- || require('readable-stream').Writable,
+var WritableStream = require('stream').Writable,
inherits = require('util').inherits;
var StreamSearch = require('streamsearch');
diff --git a/lib/PartStream.js b/lib/PartStream.js
index <HASH>..<HASH> 100644
--- a/lib/PartStream.js
+++ b/lib/PartStream.js
@@ -1,5 +1,5 @@
var inherits = require('util').inherits,
- ReadableStream = require('stream').Readable || require('readable-stream');
+ ReadableStream = require('stream').Readable;
function PartStream(opts) {
ReadableStream.call(this, opts);
diff --git a/package.json b/package.json
index <HASH>..<HASH> 100644
--- a/package.json
+++ b/package.json
@@ -4,8 +4,7 @@
"description": "A very fast streaming multipart parser for node.js",
"main": "./lib/Dicer",
"dependencies": {
- "streamsearch": "0.1.2",
- "readable-stream": "1.1.x"
+ "streamsearch": "0.1.2"
},
"scripts": {
"test": "node test/test.js"
|
lib: remove readable-stream
|
mscdex_dicer
|
train
|
js,js,json
|
ef08cabbdc5198437ec686071789e99716a1c0ce
|
diff --git a/tests/changelog.py b/tests/changelog.py
index <HASH>..<HASH> 100644
--- a/tests/changelog.py
+++ b/tests/changelog.py
@@ -499,6 +499,14 @@ def _doctree(name='changelog'):
doctree.append(source)
return doctree
+def _assert_changlogged(doctree):
+ header, issues = doctree[0][1]
+ assert '<h2' in str(header)
+ assert '1.0.2' in str(header)
+ assert isinstance(issues, bullet_list)
+ assert isinstance(issues[0], list_item)
+ assert '27' in str(issues[0])
+
class integration(Spec):
"""
@@ -506,13 +514,13 @@ class integration(Spec):
"""
def full_changelog_build_no_kaboom(self):
# Make a changelog 'page'
- doctree = _doctree()
+ doc = _doctree()
# Parse it
- generate_changelog(_app(), doctree)
+ generate_changelog(_app(), doc)
# Expect that it has been modified (lol side effects)
- header, issues = doctree[0][1]
- assert '<h2' in str(header)
- assert '1.0.2' in str(header)
- assert isinstance(issues, bullet_list)
- assert isinstance(issues[0], list_item)
- assert '27' in str(issues[0])
+ _assert_changlogged(doc)
+
+ def configurable_document_name(self):
+ doc = _doctree('notchangelog')
+ generate_changelog(_app(), doc)
+ _assert_changlogged(doc)
|
Refactor assertions & add failing test re: changelog name
|
bitprophet_releases
|
train
|
py
|
b39c5cb7e6a721425c59ae3f67a8729312792571
|
diff --git a/lib/crash_log/payload.rb b/lib/crash_log/payload.rb
index <HASH>..<HASH> 100644
--- a/lib/crash_log/payload.rb
+++ b/lib/crash_log/payload.rb
@@ -38,6 +38,8 @@ module CrashLog
end
def deliver
+ error("Not configured, please run CrashLog.configure") && return unless reporter
+
if reporter.notify(self.body)
reporter.result
end
@@ -84,7 +86,8 @@ module CrashLog
def notifier
{
:name => "crashlog",
- :version => CrashLog::VERSION
+ :version => CrashLog::VERSION,
+ :language => 'Ruby'
}
end
|
Display an error if reporter is not configured
|
crashlog_crashlog
|
train
|
rb
|
354aac5fadcdb26eda2e27ad4bd58ebf4578135e
|
diff --git a/indra/databases/mesh_client.py b/indra/databases/mesh_client.py
index <HASH>..<HASH> 100644
--- a/indra/databases/mesh_client.py
+++ b/indra/databases/mesh_client.py
@@ -230,6 +230,27 @@ def mesh_isa(mesh_id1, mesh_id2):
return False
+def get_mesh_tree_number(mesh_id):
+ query_body = """
+ SELECT DISTINCT ?tn
+ FROM <http://id.nlm.nih.gov/mesh>
+ WHERE {
+ mesh:%s meshv:treeNumber ?tn
+ }
+ """ % mesh_id
+ mesh_json = submt_sparql_query(query_body)
+ if mesh_json is None:
+ return None
+ try:
+ results = mesh_json['results']['bindings']
+ tree_uri = results[0]['tn']['value']
+ m = re.match('http://id.nlm.nih.gov/mesh/([A-Z0-9.]*)', tree_uri)
+ tree = m.groups()[0]
+ return tree
+ except Exception:
+ return None
+
+
def get_go_id(mesh_id):
"""Return a GO ID corresponding to the given MeSH ID.
|
Add function to get an entry's tree number
|
sorgerlab_indra
|
train
|
py
|
e2554b4c8bf6725a723aaf064e6ec0d74a6cc634
|
diff --git a/acceptance/tests/resource/package/does_not_exist.rb b/acceptance/tests/resource/package/does_not_exist.rb
index <HASH>..<HASH> 100644
--- a/acceptance/tests/resource/package/does_not_exist.rb
+++ b/acceptance/tests/resource/package/does_not_exist.rb
@@ -5,7 +5,7 @@ test_name "Puppet returns only resource package declaration when querying an uni
ensure => '(?:purged|absent)',
\}@m
- package_apply_regex = %r@Notice: Compiled catalog for [\w-]+.delivery.puppetlabs.net in environment production in \d+\.\d{2} seconds(?:\e\[0m)?
+ package_apply_regex = %r@Notice: Compiled catalog for .* in environment production in \d+\.\d{2} seconds(?:\e\[0m)?
(?:\e\[m)?Notice: Finished catalog run in \d+\.\d{2} seconds@m
agents.each do |agent|
|
(#<I>) Loosen the host regex for package apply test on debian
Previously was testing for an fqdn which could vary from test system to
test system, but really we don't care how the host name is specified in
the output for this test.
|
puppetlabs_puppet
|
train
|
rb
|
e600af442c5c7908065bbb69d942bf1e7ed291e2
|
diff --git a/vyked/services.py b/vyked/services.py
index <HASH>..<HASH> 100644
--- a/vyked/services.py
+++ b/vyked/services.py
@@ -32,9 +32,11 @@ def get_decorated_fun(method, path, required_params):
params = required_params
if not isinstance(required_params, list):
params = [required_params]
- if any(map(lambda x: x not in query_params, params)):
+ missing_params = list(filter(lambda x: x not in query_params, params))
+ if len(missing_params) > 0:
return Response(status=400, content_type='application/json',
- body=json.dumps({'error': 'Required params not found'}).encode())
+ body=json.dumps({'error': 'Required params {} not found'.format(
+ ','.join(missing_params))}).encode())
wrapped_func = func
if not iscoroutinefunction(func):
wrapped_func = coroutine(func)
|
Required params error now informs about missing params
|
kashifrazzaqui_vyked
|
train
|
py
|
98167d18b101016552149e8487d660b40f1bb267
|
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ from setuptools import setup
setup(
name='vtjp',
- version='0.1.5',
+ version='0.1.7',
description='Västtrafik API.',
long_description='Python implementation of Västtrafik Journy planner'
'(vtjp) public API.',
diff --git a/vasttrafik/__main__.py b/vasttrafik/__main__.py
index <HASH>..<HASH> 100644
--- a/vasttrafik/__main__.py
+++ b/vasttrafik/__main__.py
@@ -210,7 +210,6 @@ def main():
args = parser.parse_args()
planner = JournyPlanner(
- response_format='JSON',
key=args.key,
secret=args.secret)
|
remove format from vtjp
|
persandstrom_python-vasttrafik
|
train
|
py,py
|
95556f741cc62f36d141f714b8e5132329e38574
|
diff --git a/src/main/java/net/seninp/gi/rulepruner/RulePrunerFactory.java b/src/main/java/net/seninp/gi/rulepruner/RulePrunerFactory.java
index <HASH>..<HASH> 100644
--- a/src/main/java/net/seninp/gi/rulepruner/RulePrunerFactory.java
+++ b/src/main/java/net/seninp/gi/rulepruner/RulePrunerFactory.java
@@ -170,10 +170,10 @@ public class RulePrunerFactory {
continueSearch = true;
break;
}
- else {
- System.out.println(
- "rule " + grammarRules.get(currentRule).getRuleName() + " can't be removed");
- }
+ // else {
+ // System.out.println(
+ // "rule " + grammarRules.get(currentRule).getRuleName() + " can't be removed");
+ // }
}
}
@@ -417,10 +417,13 @@ public class RulePrunerFactory {
}
+ // int ctr = 0;
for (boolean b : isNotCovered) {
if (b) {
+ // System.out.println("not covered: " + (min + ctr));
return false;
}
+ // ctr++;
}
return true;
|
allrighty. seems like am done with the pruner.
|
jMotif_GI
|
train
|
java
|
6ff49b1b7b202d59a8026391cfa53784edba9171
|
diff --git a/fs/fs.go b/fs/fs.go
index <HASH>..<HASH> 100644
--- a/fs/fs.go
+++ b/fs/fs.go
@@ -62,9 +62,6 @@ type fileSystem struct {
// The collection of live inodes, keyed by inode ID. No ID less than
// fuseops.RootInodeID is ever used.
//
- // TODO(jacobsa): Implement ForgetInode support in the fuse package, then
- // implement the method here and clean up these maps.
- //
// INVARIANT: All values are of type *inode.DirInode or *inode.FileInode
// INVARIANT: For all keys k, k >= fuseops.RootInodeID
// INVARIANT: For all keys k, inodes[k].ID() == k
|
Removed a TODO covered by issue #<I>.
|
jacobsa_timeutil
|
train
|
go
|
6fa38da141b287127422b76817c4848e4aa0a172
|
diff --git a/src/base/model.js b/src/base/model.js
index <HASH>..<HASH> 100644
--- a/src/base/model.js
+++ b/src/base/model.js
@@ -559,11 +559,14 @@ var Model = EventSource.extend({
filters = this._getAllFilters(exceptions, splashScreen);
// make root $and explicit
- var explicitAndFilters = { '$and': [] };
- for (var filterKey in filters) {
- var filter = {};
- filter[filterKey] = filters[filterKey];
- explicitAndFilters['$and'].push(filter);
+ var explicitAndFilters = {};
+ if (Object.keys(filters).length > 0) {
+ explicitAndFilters['$and'] = [];
+ for (var filterKey in filters) {
+ var filter = {};
+ filter[filterKey] = filters[filterKey];
+ explicitAndFilters['$and'].push(filter);
+ }
}
// order by
|
Don't add explicit $and when where is empty
|
vizabi_vizabi
|
train
|
js
|
6805e0ad38f4a015e773f5cbd4e316e1f6acb901
|
diff --git a/app/models/scholarship/team.rb b/app/models/scholarship/team.rb
index <HASH>..<HASH> 100644
--- a/app/models/scholarship/team.rb
+++ b/app/models/scholarship/team.rb
@@ -27,6 +27,7 @@ module Scholarship
membership = memberships.new(roles: [:team_leader])
membership.user_id = leader.try(:id)
membership.save!
+ membership.accept!
end
end
end
\ No newline at end of file
diff --git a/dummy/spec/models/scholarship/team_spec.rb b/dummy/spec/models/scholarship/team_spec.rb
index <HASH>..<HASH> 100644
--- a/dummy/spec/models/scholarship/team_spec.rb
+++ b/dummy/spec/models/scholarship/team_spec.rb
@@ -11,7 +11,9 @@ describe Scholarship::Team do
team.leader = user
team.save!
- Scholarship::TeamMembership.where(team_id: team.id, user_id: user.id).first.roles.should == [:team_leader]
+ team_membership = Scholarship::TeamMembership.where(team_id: team.id, user_id: user.id).first
+ team_membership.roles.should == [:team_leader]
+ team_membership.accepted?.should be_true
end
end
|
Accept after scholarship team creation membership automatically. refs #9
|
volontariat_voluntary_scholarship
|
train
|
rb,rb
|
12651ff7d96d7e2ae9f291e46541a79e7f578146
|
diff --git a/Mapping/Proxy/ProxyLoader.php b/Mapping/Proxy/ProxyLoader.php
index <HASH>..<HASH> 100644
--- a/Mapping/Proxy/ProxyLoader.php
+++ b/Mapping/Proxy/ProxyLoader.php
@@ -86,18 +86,4 @@ class ProxyLoader
return $this->cacheDir . DIRECTORY_SEPARATOR . strtolower(substr($namespace, strrpos($namespace, '\\') + 1));
}
-
- /**
- * Returns Filesystem object.
- *
- * @return Filesystem
- */
- private function getFilesystem()
- {
- if (!$this->fileSystem) {
- $this->fileSystem = new Filesystem();
- }
-
- return $this->fileSystem;
- }
}
|
Removed unused method from ProxyLoader
|
ongr-io_ElasticsearchBundle
|
train
|
php
|
e8819d31dd9c765fd654b524b5496575a7ed305b
|
diff --git a/smack-experimental/src/test/java/org/jivesoftware/smackx/mam/PagingTest.java b/smack-experimental/src/test/java/org/jivesoftware/smackx/mam/PagingTest.java
index <HASH>..<HASH> 100644
--- a/smack-experimental/src/test/java/org/jivesoftware/smackx/mam/PagingTest.java
+++ b/smack-experimental/src/test/java/org/jivesoftware/smackx/mam/PagingTest.java
@@ -47,7 +47,7 @@ public class PagingTest extends MamTest {
assertEquals(mamQueryIQ.getDataForm(), dataForm);
assertEquals(mamQueryIQ.getDataForm().getFields().get(0).getValues().get(0).toString(), "urn:xmpp:mam:1");
- assertEquals(mamQueryIQ.toXML(StreamOpen.CLIENT_NAMESPACE).toString(), pagingStanza);
+ assertEquals(pagingStanza, mamQueryIQ.toXML(StreamOpen.CLIENT_NAMESPACE).toString());
}
}
|
PagingTest: Call assertsEquals with the correct order of arguments
first expected, then actual.
|
igniterealtime_Smack
|
train
|
java
|
dc8b4abeac704dd03cd2d623ffe714a477ba1659
|
diff --git a/src/com/jayantkrish/jklol/training/StochasticGradientTrainer.java b/src/com/jayantkrish/jklol/training/StochasticGradientTrainer.java
index <HASH>..<HASH> 100644
--- a/src/com/jayantkrish/jklol/training/StochasticGradientTrainer.java
+++ b/src/com/jayantkrish/jklol/training/StochasticGradientTrainer.java
@@ -253,8 +253,17 @@ public class StochasticGradientTrainer implements GradientOptimizer {
if (rand < frequency && l2Penalty != 0.0) {
objectiveValue -= l2Penalty * currentParameters.getL2Norm() / (2.0 * frequency);
gradient.increment(currentParameters, (-1 * l2Penalty) / frequency);
+
+ System.out.println("Regularizing by: " + (-1 * l2Penalty) / frequency);
+ System.out.println(gradient.getL2Norm());
+ System.out.println(currentParameters.getL2Norm());
}
currentParameters.increment(gradient, currentStepSize);
+
+ if (rand < frequency) {
+ System.out.println(currentParameters.getL2Norm());
+ }
+
return objectiveValue;
}
}
|
stochastic l2 regularization
|
jayantk_jklol
|
train
|
java
|
607a1cc0b1fa399fe5a2396eb408cd65fa640a34
|
diff --git a/Evtx/Nodes.py b/Evtx/Nodes.py
index <HASH>..<HASH> 100644
--- a/Evtx/Nodes.py
+++ b/Evtx/Nodes.py
@@ -1387,7 +1387,7 @@ class BooleanTypeNode(VariantTypeNode):
return 4
def string(self):
- if self.int32 > 0:
+ if self.int32() > 0:
return "True"
return "False"
|
nodes: fix egregious bug in parsing of boolean values
|
williballenthin_python-evtx
|
train
|
py
|
af25320521b1dfbdad8f00c0ffa2e6881e966f23
|
diff --git a/lib/solargraph/api_map.rb b/lib/solargraph/api_map.rb
index <HASH>..<HASH> 100755
--- a/lib/solargraph/api_map.rb
+++ b/lib/solargraph/api_map.rb
@@ -54,6 +54,7 @@ module Solargraph
# @return [Solargraph::YardMap]
def yard_map
+ refresh
if @yard_map.nil? || @yard_map.required != required
@yard_map = Solargraph::YardMap.new(required: required, workspace: workspace)
end
diff --git a/lib/solargraph/server.rb b/lib/solargraph/server.rb
index <HASH>..<HASH> 100755
--- a/lib/solargraph/server.rb
+++ b/lib/solargraph/server.rb
@@ -141,6 +141,7 @@ module Solargraph
Thread.new do
@@semaphore.synchronize do
api_map = Solargraph::ApiMap.new(directory)
+ api_map.yard_map
@@api_hash[directory] = api_map
end
end
|
Preparing workspace also prepares YardMap.
|
castwide_solargraph
|
train
|
rb,rb
|
5fd3e3b0f9501babe6288dc1c552b2c0f2622d5a
|
diff --git a/lib/yap.rb b/lib/yap.rb
index <HASH>..<HASH> 100644
--- a/lib/yap.rb
+++ b/lib/yap.rb
@@ -1,7 +1,7 @@
-module Yap
- autoload :Shell, "yap/shell"
- autoload :World, "yap/world"
+require 'yap/shell'
+require 'yap/world'
+module Yap
module WorldAddons
def self.syntax_ok?(file)
`ruby -c #{file}`
|
Move some autoloads to an explicit require for the main yap file.
|
zdennis_yap-shell-core
|
train
|
rb
|
91a5fd40debcb978ef023e93f52e96078057129c
|
diff --git a/apitools/base/py/credentials_lib.py b/apitools/base/py/credentials_lib.py
index <HASH>..<HASH> 100644
--- a/apitools/base/py/credentials_lib.py
+++ b/apitools/base/py/credentials_lib.py
@@ -21,6 +21,7 @@ import datetime
import json
import os
import threading
+import warnings
import httplib2
import oauth2client
@@ -258,9 +259,12 @@ class GceAssertionCredentials(gce.AppAssertionCredentials):
self._WriteCacheFile(cache_filename, scopes)
# We check the scopes above, but don't need them again after
- # this point; in addition, the parent class spits out a
- # warning if we pass them here, so we purposely drop them.
- super(GceAssertionCredentials, self).__init__(**kwds)
+ # this point. Newer versions of oauth2client let us drop them
+ # here, but since we support older versions as well, we just
+ # catch and squelch the warning.
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore')
+ super(GceAssertionCredentials, self).__init__(scopes, **kwds)
@classmethod
def Get(cls, *args, **kwds):
|
Play nice with older oauth2client versions.
This reverts part of a previous change to be compatible with older
oauth2client versions. In particular, we don't expect that the `scopes`
argument to `gce.AppAssertionCredentials` is optional.
|
google_apitools
|
train
|
py
|
0fc11bf2492f9638ef28e004894b5b83eff7f99e
|
diff --git a/pynes/tests/cli_test.py b/pynes/tests/cli_test.py
index <HASH>..<HASH> 100644
--- a/pynes/tests/cli_test.py
+++ b/pynes/tests/cli_test.py
@@ -4,14 +4,15 @@ import unittest
from pynes.compiler import lexical, syntax, semantic
+
class CliTest(unittest.TestCase):
def test_cli_sngl(self):
tokens = lexical('CLI')
- self.assertEquals(1 , len(tokens))
+ self.assertEquals(1, len(tokens))
self.assertEquals('T_INSTRUCTION', tokens[0]['type'])
ast = syntax(tokens)
- self.assertEquals(1 , len(ast))
+ self.assertEquals(1, len(ast))
self.assertEquals('S_IMPLIED', ast[0]['type'])
code = semantic(ast)
- self.assertEquals(code, [0x58])
\ No newline at end of file
+ self.assertEquals(code, [0x58])
|
PEP8 fixes on tests/cli_test.py
|
gutomaia_nesasm_py
|
train
|
py
|
4b8af4d453e0685ac7e9b8db618a1571a5fac547
|
diff --git a/pymatgen/ext/matproj.py b/pymatgen/ext/matproj.py
index <HASH>..<HASH> 100644
--- a/pymatgen/ext/matproj.py
+++ b/pymatgen/ext/matproj.py
@@ -1634,6 +1634,7 @@ class MPRester:
# return a list of URLs for NoMaD Downloads containing the list of files
# for every external_id in `task_ids`
+ # For reference, please visit https://nomad-lab.eu/prod/rae/api/
prefix = "https://nomad-lab.eu/prod/rae/api/repo/query?"
if file_patterns is not None:
for file_pattern in file_patterns:
|
code style check passed
api link added in comment
|
materialsproject_pymatgen
|
train
|
py
|
5262be780a1203a7214704eb99630610066c2f9d
|
diff --git a/lib/celluloid/notices.rb b/lib/celluloid/notices.rb
index <HASH>..<HASH> 100644
--- a/lib/celluloid/notices.rb
+++ b/lib/celluloid/notices.rb
@@ -4,7 +4,7 @@ module Celluloid
@@notices = []
def backported
- @@notices << [:debug, "Celluloid #{Celluloid::VERSION} is running in BACKPORTED mode. [ http://git.io/vJf3J ]"]
+ @@notices << [:info, "Celluloid #{Celluloid::VERSION} is running in BACKPORTED mode. [ http://git.io/vJf3J ]"]
end
def output
|
:debug is now squelched by default, so use :info
|
celluloid_celluloid
|
train
|
rb
|
4b8e7bb0606432b71ec21417453525f5067e0a86
|
diff --git a/lib/fog/joyent/models/compute/keys.rb b/lib/fog/joyent/models/compute/keys.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/joyent/models/compute/keys.rb
+++ b/lib/fog/joyent/models/compute/keys.rb
@@ -22,8 +22,8 @@ module Fog
end
def create(params = {})
- raise ArgumentError, "Key name required" unless params.key?(:name)
- raise ArgumentError, "Key body required" unless params.key?(:body)
+ raise ArgumentError, "option [name] required" unless params.key?(:name)
+ raise ArgumentError, "option [key] required" unless params.key?(:key)
self.connection.create_key(params)
end
|
[joyent|compute] Fixes issue where params are not properly passed to #keys_create
from #create_key
|
fog_fog
|
train
|
rb
|
c3a6d00099cf0460481cd7981f0e39e0fb3134dd
|
diff --git a/pkg/cloudprovider/aws/aws_test.go b/pkg/cloudprovider/aws/aws_test.go
index <HASH>..<HASH> 100644
--- a/pkg/cloudprovider/aws/aws_test.go
+++ b/pkg/cloudprovider/aws/aws_test.go
@@ -156,7 +156,7 @@ func TestList(t *testing.T) {
}
}
-func TestIPAddress(t *testing.T) {
+func TestNodeAddresses(t *testing.T) {
// Note these instances have the same name
// (we test that this produces an error)
instances := make([]ec2.Instance, 2)
|
Rename TestIPAddress -> TestNodeAddresses
|
kubernetes_kubernetes
|
train
|
go
|
62586d7028d654d888ad909883792729941ba934
|
diff --git a/src/main/java/jcifs/smb/DirFileEntryEnumIteratorBase.java b/src/main/java/jcifs/smb/DirFileEntryEnumIteratorBase.java
index <HASH>..<HASH> 100644
--- a/src/main/java/jcifs/smb/DirFileEntryEnumIteratorBase.java
+++ b/src/main/java/jcifs/smb/DirFileEntryEnumIteratorBase.java
@@ -222,6 +222,12 @@ public abstract class DirFileEntryEnumIteratorBase implements CloseableIterator<
catch ( CIFSException e ) {
log.warn("Enumeration failed", e);
this.next = null;
+ try {
+ doClose();
+ }
+ catch ( CIFSException e1 ) {
+ log.debug("Failed to close enum", e);
+ }
}
return n;
}
@@ -239,8 +245,9 @@ public abstract class DirFileEntryEnumIteratorBase implements CloseableIterator<
}
}
+
@Override
- public void remove() {
+ public void remove () {
throw new UnsupportedOperationException("remove");
}
}
|
Close file enumeration on errors.
|
AgNO3_jcifs-ng
|
train
|
java
|
237d81696eff1a582686c80045e54db5b177d6ab
|
diff --git a/sos/plugins/systemd.py b/sos/plugins/systemd.py
index <HASH>..<HASH> 100644
--- a/sos/plugins/systemd.py
+++ b/sos/plugins/systemd.py
@@ -40,7 +40,8 @@ class Systemd(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
"ls -l /lib/systemd",
"ls -l /lib/systemd/system-shutdown",
"ls -l /lib/systemd/system-generators",
- "ls -l /lib/systemd/user-generators"
+ "ls -l /lib/systemd/user-generators",
+ "timedatectl"
])
if self.get_option("verify"):
|
[systemd] Collect timedatectl for timezone
There is currently no way to see the system timezone in text format on
a systemd system (eg: "America/New_York"). timedatectl provides this.
Closes #<I>
|
sosreport_sos
|
train
|
py
|
8b92e70be20b67fa004cbc8dacb4cb95556435f8
|
diff --git a/commands/v2/common/errors.go b/commands/v2/common/errors.go
index <HASH>..<HASH> 100644
--- a/commands/v2/common/errors.go
+++ b/commands/v2/common/errors.go
@@ -69,7 +69,7 @@ func (e NoTargetedOrgError) Error() string {
func (e NoTargetedOrgError) Translate(translate func(string, ...interface{}) string) string {
return translate(e.Error(), map[string]interface{}{
- "Command": fmt.Sprintf("%s login", e.BinaryName),
+ "Command": fmt.Sprintf("%s target -o ORG", e.BinaryName),
})
}
@@ -83,7 +83,7 @@ func (e NoTargetedSpaceError) Error() string {
func (e NoTargetedSpaceError) Translate(translate func(string, ...interface{}) string) string {
return translate(e.Error(), map[string]interface{}{
- "Command": fmt.Sprintf("%s login", e.BinaryName),
+ "Command": fmt.Sprintf("%s target -s SPACE", e.BinaryName),
})
}
|
better error for unset org or space
[#<I>, #<I>]
|
cloudfoundry_cli
|
train
|
go
|
c885640e0cf8245f7454a18b1a3de0242509c5c2
|
diff --git a/lib/IDS/Caching/File.php b/lib/IDS/Caching/File.php
index <HASH>..<HASH> 100644
--- a/lib/IDS/Caching/File.php
+++ b/lib/IDS/Caching/File.php
@@ -100,12 +100,22 @@ class IDS_Caching_File implements IDS_Caching_Interface {
* Writes cache data into the file
*
* @param array $data
+ * @throws Exception
* @return object $this
*/
public function setCache(array $data) {
+ if(!is_writable(preg_replace('/[\/][^\/]+\.[^\/]++$/', null, $this->path))) {
+ throw new Exception("Temp directory seems not writable");
+ }
+
if ((!file_exists($this->path) || (time()-filectime($this->path)) > $this->config['expiration_time'])) {
- $handle = fopen($this->path , 'w');
+ $handle = @fopen($this->path , 'w+');
+
+ if(!$handle) {
+ throw new Exception("Cache file couldn't be created");
+ }
+
fwrite($handle, serialize($data));
fclose($handle);
}
|
Added better exception coverage to file caching handler
|
PHPIDS_PHPIDS
|
train
|
php
|
8693d8b9df18478a49ac7b6d308db4e016971426
|
diff --git a/tests/Provide/Transfer/HttpResponderTest.php b/tests/Provide/Transfer/HttpResponderTest.php
index <HASH>..<HASH> 100644
--- a/tests/Provide/Transfer/HttpResponderTest.php
+++ b/tests/Provide/Transfer/HttpResponderTest.php
@@ -22,7 +22,10 @@ class HttpResponderTest extends \PHPUnit_Framework_TestCase
{
$ro = (new FakeResource)->onGet();
$ro->transfer($this->responder, []);
- $expectedArgs = [['Cache-Control: max-age=0', false]];
+ $expectedArgs = [
+ ['Cache-Control: max-age=0', false],
+ ['content-type: application/json', false],
+ ];
$this->assertEquals($expectedArgs, FakeHttpResponder::$headers);
$expect = '{"greeting":"hello world"}';
$actual = FakeHttpResponder::$content;
|
fix tests to have content-type filed in http responder
|
bearsunday_BEAR.Sunday
|
train
|
php
|
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.