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
|
---|---|---|---|---|---|
4ec49a3c4c28060016b570d4b74cefc26e534183 | diff --git a/lib/templates.js b/lib/templates.js
index <HASH>..<HASH> 100644
--- a/lib/templates.js
+++ b/lib/templates.js
@@ -139,6 +139,9 @@ module.exports = function(self) {
data = JSON.stringify(data); // , null, ' ');
data = data.replace(/<\!\-\-/g, '<\\!--');
data = data.replace(/<\/script\>/gi, '<\\/script>');
+ // unicode line separator and paragraph separator break JavaScript parsing
+ data = data.replace("\u2028", "\\u2028");
+ data = data.replace("\u2029", "\\u2029");
return data;
}; | JSON output in HTML markup must not crash on illegal unicode characters (the line separator and paragraph separator unicode characters) fixes #<I> | apostrophecms_apostrophe | train | js |
fe8437c572f657e2b5a51a26e4c4cd8583bfa58f | diff --git a/src/main/java/org/gitlab4j/api/CommitsApi.java b/src/main/java/org/gitlab4j/api/CommitsApi.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/gitlab4j/api/CommitsApi.java
+++ b/src/main/java/org/gitlab4j/api/CommitsApi.java
@@ -1,7 +1,5 @@
package org.gitlab4j.api;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
import java.util.Date;
import java.util.List;
import java.util.Optional; | Removed unused imports (#<I>). | gmessner_gitlab4j-api | train | java |
edf3bbd006d6e7495cf88393168c2d18346fc277 | diff --git a/quart/datastructures.py b/quart/datastructures.py
index <HASH>..<HASH> 100644
--- a/quart/datastructures.py
+++ b/quart/datastructures.py
@@ -30,11 +30,11 @@ class _WerkzeugMultidictMixin:
return self.getall(key) # type: ignore
-class MultiDict(_WerkzeugMultidictMixin, AIOMultiDict):
+class MultiDict(_WerkzeugMultidictMixin, AIOMultiDict): # type: ignore
pass
-class CIMultiDict(_WerkzeugMultidictMixin, AIOCIMultiDict):
+class CIMultiDict(_WerkzeugMultidictMixin, AIOCIMultiDict): # type: ignore
pass | Fix typing in 8b<I>ffdb9ec9a<I>fd5d<I>abd<I>a4b
The latest version of mypy complains (whereas the previous version did
not). | pgjones_quart | train | py |
ba8b9d257005f3b42b8ec4e238fbd6b4cc403a2a | diff --git a/nhe/mfd/base.py b/nhe/mfd/base.py
index <HASH>..<HASH> 100644
--- a/nhe/mfd/base.py
+++ b/nhe/mfd/base.py
@@ -104,7 +104,7 @@ class BaseMFD(object):
@abc.abstractmethod
def get_annual_occurrence_rates(self):
"""
- Return an MFD histogram.
+ Return an MFD annual occurrence rates histogram.
This method must be implemented by subclasses.
@@ -113,5 +113,7 @@ class BaseMFD(object):
``(magnitude, occurrence_rate)``. Each pair represents
a single bin of the histogram with ``magnitude`` being
the center of the bin. Magnitude values are monotonically
- increasing by value of bin width.
+ increasing by value of bin width. ``occurence_rate``
+ represents the number of events per year with magnitude
+ that falls in between bin's boundaries.
"""
diff --git a/nhe/mfd/truncated_gr.py b/nhe/mfd/truncated_gr.py
index <HASH>..<HASH> 100644
--- a/nhe/mfd/truncated_gr.py
+++ b/nhe/mfd/truncated_gr.py
@@ -93,7 +93,7 @@ class TruncatedGR(BaseMFD):
along with the first bin center abscissa (magnitude) value.
Rounds ``min_mag`` and ``max_mag`` with respect to ``bin_width``
- to make the distance between them include even number of bins.
+ to make the distance between them include integer number of bins.
:returns:
A tuple of two items: first bin center and total number of bins. | mfd: more small enhancements in docs | gem_oq-engine | train | py,py |
9741d3c71ec3efe1c8b253ee50073ce5fb2758a9 | diff --git a/tools/gopy/gopy.go b/tools/gopy/gopy.go
index <HASH>..<HASH> 100644
--- a/tools/gopy/gopy.go
+++ b/tools/gopy/gopy.go
@@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"github.com/sbinet/go-python"
+ "os"
"reflect"
)
@@ -34,6 +35,7 @@ var pyinit = false
func Init() (err error) {
if !pyinit {
if err = python.Initialize(); err == nil {
+ python.PySys_SetArgv(os.Args)
pyinit = true
}
} | gopy: Added explicit call python.PySys_SetArgv during initialize
With higher versions of salt, we need to explicitly
initialize argv, as its done by default in cgo.
Change-Id: Id<I>e<I>f<I>aa<I>ef3a1f<I>fcc<I>cb<I>b7 | skyrings_skyring-common | train | go |
85e4a8fd67b3789fc82e67e4d367928c9503ceed | diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/HttpKernel/Kernel.php
+++ b/src/Symfony/Component/HttpKernel/Kernel.php
@@ -76,12 +76,12 @@ abstract class Kernel implements KernelInterface, RebootableInterface, Terminabl
private static $freshCache = [];
- public const VERSION = '4.4.38-DEV';
+ public const VERSION = '4.4.38';
public const VERSION_ID = 40438;
public const MAJOR_VERSION = 4;
public const MINOR_VERSION = 4;
public const RELEASE_VERSION = 38;
- public const EXTRA_VERSION = 'DEV';
+ public const EXTRA_VERSION = '';
public const END_OF_MAINTENANCE = '11/2022';
public const END_OF_LIFE = '11/2023'; | Update VERSION for <I> | symfony_symfony | train | php |
938a926be7969026eff95ce6c93cf98d01c444e4 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -33,7 +33,7 @@ setup(name='cwltool',
'rdflib >= 4.2.0',
'rdflib-jsonld >= 0.3.0',
'shellescape',
- 'schema_salad >= 1.0.7'
+ 'schema_salad >= 1.1.0'
],
test_suite='tests',
tests_require=[], | Bump dependency to schema salad <I> | common-workflow-language_cwltool | train | py |
33ffd173eacec160603abd8073893171e97dd9a9 | diff --git a/lib/ec2-autoscaling-groups.js b/lib/ec2-autoscaling-groups.js
index <HASH>..<HASH> 100644
--- a/lib/ec2-autoscaling-groups.js
+++ b/lib/ec2-autoscaling-groups.js
@@ -63,14 +63,18 @@ module.exports = function fetchAutoScalingGroups(config, result, cb) {
var defName = nameTag.Value.split('-')[0];
var instances = _.pluck(autoScalingGroup.Instances, 'InstanceId');
- var groups = _.chain(instances).map(function(instance) {
+ var group = _.chain(instances).map(function(instance) {
return result.topology.containers[instance];
}).map(function(instance) {
return instance.specific.securityGroups;
- }).flatten().pluck('GroupName').value();
+ }).flatten().pluck('GroupName').value()[0];
+
+ var elb = _.find(autoScalingGroup.LoadBalancerNames, function(elb) {
+ return result.topology.containers[elb];
+ });
// the parent is either the ELB or the Security Group.
- var containedBy = autoScalingGroup.LoadBalancerNames[0] || groups[0];
+ var containedBy = elb || group;
// at this point we have already looked up both the security groups
// and the elbs, so it is safe to assume the parent is there | Do not crash if the elb is not missing. | nearform_nscale-aws-analyzer | train | js |
ef8bcbbb72633711f4182ef874c51b3dfaa1cfa4 | diff --git a/test/client-test.js b/test/client-test.js
index <HASH>..<HASH> 100644
--- a/test/client-test.js
+++ b/test/client-test.js
@@ -79,6 +79,7 @@ vows.describe('Client').addBatch({
}
// Test long method response, which requires multiple chunks returned from
// the http request
+ // Only one test relying on HTTP server can be used. See Issue #20.
/*, 'with a very long response' : {
topic: function () {
var that = this | Adds note about HTTP servers and client-test.js tests.
See Issue #<I>. | baalexander_node-xmlrpc | train | js |
097ca1ac101622b3b0769a8970a0509aa898165e | diff --git a/src/Illuminate/Database/Eloquent/Builder.php b/src/Illuminate/Database/Eloquent/Builder.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Database/Eloquent/Builder.php
+++ b/src/Illuminate/Database/Eloquent/Builder.php
@@ -79,6 +79,7 @@ class Builder
* @var string[]
*/
protected $passthru = [
+ 'aggregate',
'average',
'avg',
'count', | Add aggregate method to Eloquent passthru (#<I>) | laravel_framework | train | php |
be0d22cd3ba42669e829206de12ac338861dcc5e | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -50,8 +50,11 @@ function merge(oldMap, newMap) {
})
var mergedMap = JSON.parse(mergedMapGenerator.toString())
- mergedMap.sources = oldMap.sources
- mergedMap.sourcesContent = oldMap.sourcesContent
+
+ mergedMap.sourcesContent = mergedMap.sources.map(function (source) {
+ return oldMapConsumer.sourceContentFor(source)
+ })
+
mergedMap.sourceRoot = oldMap.sourceRoot
return mergedMap | fix bug that was causing mappings to map to the wrong file
When merging source maps, we were replacing the new sources list by the old one.
This was causing the mappings to be pointing to the wrong index in the sources array. | keik_merge-source-map | train | js |
3f27ae249a92a88935aa7037e272b609b656727d | diff --git a/lib/screenshotHandler.js b/lib/screenshotHandler.js
index <HASH>..<HASH> 100644
--- a/lib/screenshotHandler.js
+++ b/lib/screenshotHandler.js
@@ -48,6 +48,8 @@ var screenshotHandler = function() {
})
+ .then(this.addWhiteBackground)
+
.then(this.toBuffer);
};
@@ -92,6 +94,39 @@ var screenshotHandler = function() {
return deferred.promise;
};
+ // If the page doesn't set a background color, the default PhantomJS one is transparent.
+ // When transforming PNG to JPG, transparent pixels become black.
+ // This is why we need to had a transparent background.
+ this.addWhiteBackground = function(image) {
+ var deferred = Q.defer();
+
+ // Create a canvas with the same dimensions as your image:
+ lwip.create(image.width(), image.height(), 'white', function(err, canvas){
+ if (err) {
+ debug('Could not create a white canvas');
+ debug(err);
+
+ deferred.reject(err);
+ } else {
+ // Paste original image on top of the canvas
+ canvas.paste(0, 0, image, function(err, image){
+ if (err) {
+ debug('Could not paste image on the white canvas');
+ debug(err);
+
+ deferred.reject(err);
+ } else {
+ // Now image has a white background...
+ debug('White background correctly added');
+ deferred.resolve(image);
+ }
+ });
+ }
+ });
+
+ return deferred.promise;
+ };
+
this.toBuffer = function(image) {
var deferred = Q.defer(); | Add a white background to screenshots | gmetais_YellowLabTools | train | js |
ec4f083516bf7b2270f09e25b7aa3b51ea86db7c | diff --git a/features/support/filesystem.rb b/features/support/filesystem.rb
index <HASH>..<HASH> 100644
--- a/features/support/filesystem.rb
+++ b/features/support/filesystem.rb
@@ -73,6 +73,10 @@ module Filesystem
FileUtils.mkdir_p(dirname) unless File.directory?(dirname)
end
+ def rmdir(dirname)
+ FileUtils.rm_rf(dirname) unless File.directory?(dirname)
+ end
+
def current_dir
File.join(*dirs)
end
diff --git a/features/support/spinach_runner.rb b/features/support/spinach_runner.rb
index <HASH>..<HASH> 100644
--- a/features/support/spinach_runner.rb
+++ b/features/support/spinach_runner.rb
@@ -8,7 +8,7 @@ module Integration
Spinach.hooks.before_scenario do
if respond_to?(:in_current_dir)
in_current_dir do
- run "rm -fR rails_app"
+ rmdir "rails_app"
end
end
end | Do not shell out just to remove a directory | codegram_spinach | train | rb,rb |
53739f1b66cbffc17f3ab95779acdf3cd6b39990 | diff --git a/src/angular-dragdrop.js b/src/angular-dragdrop.js
index <HASH>..<HASH> 100644
--- a/src/angular-dragdrop.js
+++ b/src/angular-dragdrop.js
@@ -139,7 +139,7 @@ jqyoui.invokeDrop = function($draggable, $droppable, scope, $timeout, event, ui)
jqyoui.mutateDraggable(scope, dropSettings, dragSettings, dragModel, dropModel, dropItem, $draggable);
jqyoui.mutateDroppable(scope, dropSettings, dragSettings, dropModel, dragItem, jqyoui_pos);
if (dropSettings.onDrop) {
- scope[dropSettings.onDrop](event, ui);
+ scope[dropSettings.onDrop](event, ui, dragItem);
}
});
});
@@ -148,7 +148,7 @@ jqyoui.invokeDrop = function($draggable, $droppable, scope, $timeout, event, ui)
jqyoui.mutateDraggable(scope, dropSettings, dragSettings, dragModel, dropModel, dropItem, $draggable);
jqyoui.mutateDroppable(scope, dropSettings, dragSettings, dropModel, dragItem, jqyoui_pos);
if (dropSettings.onDrop) {
- scope[dropSettings.onDrop](event, ui);
+ scope[dropSettings.onDrop](event, ui, dragItem);
}
});
} | Returns the dragItem to the onDrop function
This change returns the dragItem to the onDrop
function. This allows manipulation of the object
that is dragged directly. | codef0rmer_angular-dragdrop | train | js |
0a7ccd7ca8924c001029be303df8fe41356a602d | diff --git a/config/basics.php b/config/basics.php
index <HASH>..<HASH> 100644
--- a/config/basics.php
+++ b/config/basics.php
@@ -97,7 +97,10 @@ if (!function_exists('snapshot')) {
$plugins = $PluginTable->find()
->select(['name', 'package', 'status'])
- ->order(['ordering' => 'ASC'])
+ ->order([
+ 'ordering' => 'ASC',
+ 'name' => 'ASC',
+ ])
->all();
$nodeTypes = $NodeTypesTable->find()
->select(['slug']) | changing the the order in which plugins are loaded | quickapps_cms | train | php |
405fbbec120a5fd3a7425b27412dc48facde8e00 | diff --git a/lib/client.js b/lib/client.js
index <HASH>..<HASH> 100644
--- a/lib/client.js
+++ b/lib/client.js
@@ -213,7 +213,9 @@ p.onDataRow = function(msg) {
var converters = this.converters || [];
var len = msg.fields.length;
for(var i = 0; i < len; i++) {
- fields[i] = this.converters[i] (fields[i]);
+ if(fields[i] !== null) {
+ fields[i] = this.converters[i] (fields[i]);
+ }
}
msg.fields = fields;
this.emit('row', msg);
diff --git a/test/unit/client/typed-query-results.js b/test/unit/client/typed-query-results.js
index <HASH>..<HASH> 100644
--- a/test/unit/client/typed-query-results.js
+++ b/test/unit/client/typed-query-results.js
@@ -58,6 +58,11 @@ test('typed results', function() {
dataTypeID: 16,
actual: 'f',
expected: false
+ },{
+ name: 'boolean null',
+ dataTypeID: 16,
+ actual: null,
+ expected: null
}]; | nulls supported in all currently supported type coercions | brianc_node-postgres | train | js,js |
2657ccd0e7324443403921c6908a5c7533b986f0 | diff --git a/lib/CssCrush/Template.php b/lib/CssCrush/Template.php
index <HASH>..<HASH> 100644
--- a/lib/CssCrush/Template.php
+++ b/lib/CssCrush/Template.php
@@ -140,7 +140,7 @@ class Template
public static function unTokenize($str)
{
- $str = Crush::$process->tokens->restore($str, array('u', 's'), true);
+ $str = Crush::$process->tokens->restore($str, ['u', 's']);
return $str;
}
diff --git a/lib/CssCrush/Url.php b/lib/CssCrush/Url.php
index <HASH>..<HASH> 100644
--- a/lib/CssCrush/Url.php
+++ b/lib/CssCrush/Url.php
@@ -43,9 +43,13 @@ class Url
$this->simplify();
}
+ if ($this->isData) {
+ return 'url("' . preg_replace('~(?<!\x5c)"~', '\\"', $this->value) . '")';
+ }
+
// Only wrap url with quotes if it contains tricky characters.
$quote = '';
- if ($this->isData || preg_match('~[()*\s]~S', $this->value)) {
+ if (preg_match('~[()*\s]~S', $this->value)) {
$quote = '"';
} | Add support for svg literals. Fix related issue with tokens being dropped from mixins | peteboere_css-crush | train | php,php |
f6854d6e25b308d6e5102eff8b112570707f4f82 | diff --git a/cf/commands/servicekey/service_keys.go b/cf/commands/servicekey/service_keys.go
index <HASH>..<HASH> 100644
--- a/cf/commands/servicekey/service_keys.go
+++ b/cf/commands/servicekey/service_keys.go
@@ -85,6 +85,7 @@ func (cmd ServiceKeys) Run(c *cli.Context) {
map[string]interface{}{"ServiceInstanceName": terminal.EntityNameColor(serviceInstanceName)}))
return
} else {
+ cmd.ui.Say("")
table.Print()
}
}
diff --git a/cf/commands/servicekey/service_keys_test.go b/cf/commands/servicekey/service_keys_test.go
index <HASH>..<HASH> 100644
--- a/cf/commands/servicekey/service_keys_test.go
+++ b/cf/commands/servicekey/service_keys_test.go
@@ -89,6 +89,7 @@ var _ = Describe("service-keys command", func() {
[]string{"fake-service-key-1"},
[]string{"fake-service-key-2"},
))
+ Expect(ui.Outputs[1]).To(BeEmpty())
Expect(serviceKeyRepo.ListServiceKeysMethod.InstanceGuid).To(Equal("fake-instance-guid"))
}) | add a new line before the table of listing keys
implement story [#<I>] | cloudfoundry_cli | train | go,go |
47f85533aeef123e11f54118184be22f38efc32b | diff --git a/iavl/iavl_tree.go b/iavl/iavl_tree.go
index <HASH>..<HASH> 100644
--- a/iavl/iavl_tree.go
+++ b/iavl/iavl_tree.go
@@ -159,11 +159,16 @@ func (t *IAVLTree) GetByIndex(index int) (key []byte, value []byte) {
}
func (t *IAVLTree) GetWithProof(key []byte) ([]byte, *KeyExistsProof, *KeyNotExistsProof, error) {
- value, proof := t.ConstructKeyExistsProof(key)
- if proof == nil {
- return nil, nil, nil, nil
+ value, eproof := t.ConstructKeyExistsProof(key)
+ if eproof != nil && value != nil {
+ return value, eproof, nil, nil
+ }
+
+ neproof, err := t.ConstructKeyNotExistsProof(key)
+ if neproof != nil {
+ return nil, nil, neproof, nil
}
- return value, proof, nil, nil
+ return nil, nil, nil, err
}
func (t *IAVLTree) Remove(key []byte) (value []byte, removed bool) { | GetWithProof can return different proofs | tendermint_iavl | train | go |
6542da5fde77b010f19c63746e30d9bd4a3725ba | diff --git a/app/controllers/admin/configuration_controller.rb b/app/controllers/admin/configuration_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/admin/configuration_controller.rb
+++ b/app/controllers/admin/configuration_controller.rb
@@ -1,7 +1,7 @@
class Admin::ConfigurationController < ApplicationController
before_filter :initialize_config
- only_allow_access_to :show, :edit, :update,
+ only_allow_access_to :edit, :update,
:when => [:admin],
:denied_url => { :controller => 'admin/configuration', :action => 'show' },
:denied_message => 'You must have admin privileges to edit site configuration.'
diff --git a/features/step_definitions/admin/pagination_steps.rb b/features/step_definitions/admin/pagination_steps.rb
index <HASH>..<HASH> 100644
--- a/features/step_definitions/admin/pagination_steps.rb
+++ b/features/step_definitions/admin/pagination_steps.rb
@@ -27,7 +27,7 @@ Then /^I should see page (\d+) of the results$/ do |p|
end
Then /^I should see a depagination link$/ do
- response.body.should have_tag("a", :text => "show all")
+ response.body.should have_tag("a", :href => "/admin/readers?pp=all")
end
Then /^I should mention the request parameters$/ do | mending features: non-admin user can see but not edit configuration, depagination link check more apt | radiant_radiant | train | rb,rb |
5efcd1be49093d6b411582f34d87d3df13444ec2 | diff --git a/tests/Database/DatabaseEloquentMorphOneOfManyTest.php b/tests/Database/DatabaseEloquentMorphOneOfManyTest.php
index <HASH>..<HASH> 100644
--- a/tests/Database/DatabaseEloquentMorphOneOfManyTest.php
+++ b/tests/Database/DatabaseEloquentMorphOneOfManyTest.php
@@ -94,6 +94,15 @@ class DatabaseEloquentMorphOneOfManyTest extends TestCase
$this->assertSame('active', $product->current_state->state);
}
+ public function testForceCreateMorphType()
+ {
+ $product = MorphOneOfManyTestProduct::create();
+ $product->states()->forceCreate([
+ 'state' => 'active',
+ ]);
+ $this->assertSame(MorphOneOfManyTestProduct::class, $product->current_state->stateful_type);
+ }
+
public function testExists()
{
$product = MorphOneOfManyTestProduct::create(); | Added test for morph many not including type bug | laravel_framework | train | php |
52f42f63d5fcb58dd478fede4b40131157126378 | diff --git a/spambl.py b/spambl.py
index <HASH>..<HASH> 100644
--- a/spambl.py
+++ b/spambl.py
@@ -287,8 +287,8 @@ class GoogleSafeBrowsing(object):
try:
response.raise_for_status()
- except HTTPError as e:
- if e.code == 401:
+ except HTTPError:
+ if response.status_code == 401:
raise UnathorizedAPIKeyError('The API key is not authorized'), None, exc_info()[2]
return response | Fix checking for error code in GoogleSafeBrowsing._query_once
The HTTPError class doesn't have a code property, so the status_code
property of response is checked instead | piotr-rusin_spam-lists | train | py |
be92e8b619067235dcedbc00ef314be4dd57d876 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ except ImportError:
from setuptools import setup, find_packages
setup(name="pygg",
- version="0.1.0",
+ version="0.1.1",
description="ggplot2 syntax for python. Runs R version of ggplot2 under the covers",
license="MIT",
author="Eugene Wu",
@@ -20,6 +20,6 @@ setup(name="pygg",
'bin/runpygg.py'
],
install_requires = [
- 'click'
+ 'click', 'pandas'
],
keywords= "") | added pandas req to setup | sirrice_pygg | train | py |
95349826657dfec1f784ef0f5a9f71aab32136d2 | diff --git a/Imager.js b/Imager.js
index <HASH>..<HASH> 100644
--- a/Imager.js
+++ b/Imager.js
@@ -268,7 +268,7 @@
};
Imager.prototype.determineAppropriateResolution = function (image) {
- return Imager.getClosestValue(image.clientWidth, this.availableWidths);
+ return Imager.getClosestValue(image.parentNode.clientWidth, this.availableWidths);
};
/** | `{width}` calculation is now performed against parent size. | BBC-News_Imager.js | train | js |
6b92cb9e980e49cde5e9d8e08263275e9aca928a | diff --git a/Model/Menu/Node/Image/File.php b/Model/Menu/Node/Image/File.php
index <HASH>..<HASH> 100644
--- a/Model/Menu/Node/Image/File.php
+++ b/Model/Menu/Node/Image/File.php
@@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Snowdog\Menu\Model\Menu\Node\Image;
use Magento\Framework\App\Filesystem\DirectoryList;
+use Magento\Framework\File\Uploader;
use Magento\Framework\Filesystem;
use Magento\Framework\Image\AdapterFactory as ImageAdapterFactory;
use Magento\Framework\UrlInterface; | [<I>] Add the missing file uploader class to menu node image file model | SnowdogApps_magento2-menu | train | php |
c98cbc05109aeece5e1b02794dc544cb68774e21 | diff --git a/upload/extension/opencart/admin/controller/report/sale_tax.php b/upload/extension/opencart/admin/controller/report/sale_tax.php
index <HASH>..<HASH> 100644
--- a/upload/extension/opencart/admin/controller/report/sale_tax.php
+++ b/upload/extension/opencart/admin/controller/report/sale_tax.php
@@ -98,7 +98,7 @@ class SaleTax extends \Opencart\System\Engine\Controller {
}
if (isset($this->request->get['page'])) {
- $page = $this->request->get['page'];
+ $page = (int)$this->request->get['page'];
} else {
$page = 1;
}
@@ -194,4 +194,4 @@ class SaleTax extends \Opencart\System\Engine\Controller {
$this->response->setOutput($this->load->view('extension/opencart/report/sale_tax', $data));
}
-}
\ No newline at end of file
+} | Added integer on $page get request. | opencart_opencart | train | php |
028c70af94c80fb5f2cdc0a742d6fe3aeaed07e2 | diff --git a/lib/mwlib/src/MW/Container/Content/CSV.php b/lib/mwlib/src/MW/Container/Content/CSV.php
index <HASH>..<HASH> 100644
--- a/lib/mwlib/src/MW/Container/Content/CSV.php
+++ b/lib/mwlib/src/MW/Container/Content/CSV.php
@@ -123,7 +123,11 @@ class MW_Container_Content_CSV
*/
function key()
{
- return $this->_position;
+ if( $this->_data !== null ) {
+ return $this->_position;
+ }
+
+ return null;
}
@@ -178,7 +182,7 @@ class MW_Container_Content_CSV
{
$data = fgetcsv( $this->_fh, 0, $this->_separator, $this->_enclosure, $this->_escape );
- if( $data === false ) {
+ if( $data === false || $data === null ) {
return null;
}
} | Improves compliance to Iterator interface | Arcavias_arcavias-core | train | php |
37c3864cd564e6fe9f895223bac7258165a0c5fe | diff --git a/benchmark/lib/fakesP.js b/benchmark/lib/fakesP.js
index <HASH>..<HASH> 100644
--- a/benchmark/lib/fakesP.js
+++ b/benchmark/lib/fakesP.js
@@ -44,22 +44,7 @@ else if(global.useLie) {
}
}
else if(global.useThenPromise) {
- var Promise = require('promise');
- var slicer = [].slice;
- var lifter = function lifter(nodefn) {
- return function() {
- var $_len = arguments.length;
- var args = new Array($_len);
- for(var $_i = 0; $_i < $_len; ++$_i) {args[$_i] = arguments[$_i];}
- return new Promise(function (resolve, reject){
- args[args.length++] = function(err, res) {
- if (err) reject(err);
- else resolve(res)
- };
- nodefn.apply(this, args);
- });
- }
- }
+ var lifter = require("promise").denodeify;
}
else if( global.useRSVP ) {
var lifter = require("rsvp").denodeify; | use then-promise's denodify | petkaantonov_bluebird | train | js |
9f5773920beae8f6698a1633a30bdceed499f633 | diff --git a/bin/tessera.js b/bin/tessera.js
index <HASH>..<HASH> 100755
--- a/bin/tessera.js
+++ b/bin/tessera.js
@@ -87,9 +87,9 @@ if(opts.version) {
} else if(!opts.uri && !opts.config) {
return nomnom.print(nomnom.getUsage());
} else if(opts.multithreaded) {
- console.log("Launching in multithreaded mode with " + opts.threads + " threads.");
var cluster = require('cluster');
if (cluster.isMaster) {
+ console.log("Launching in multithreaded mode with " + opts.threads + " threads.");
for (var i = 0; i < opts.threads; i += 1) {
cluster.fork();
} | Dont repeat log message about multithreaded mode on each thread | mojodna_tessera | train | js |
84df69a7078f036b833665b892a81b393a9014ba | diff --git a/public/js/src/router.js b/public/js/src/router.js
index <HASH>..<HASH> 100644
--- a/public/js/src/router.js
+++ b/public/js/src/router.js
@@ -79,7 +79,8 @@ App.Router = Backbone.Router.extend({
logout: function logout() {
App.session.destroy();
App.session.clear();
- App.router.navigate('dashboard', {trigger: true});
+ document.location.hash = '';
+ document.location.reload();
},
dashboard: function dashboard() { | Redirecting to /login on logout | shinuza_captain-admin | train | js |
24cb09d6c05eb2ab12c07c7c21c04dfcc25688ef | diff --git a/active_admin/effective_orders.rb b/active_admin/effective_orders.rb
index <HASH>..<HASH> 100644
--- a/active_admin/effective_orders.rb
+++ b/active_admin/effective_orders.rb
@@ -18,6 +18,12 @@ if defined?(ActiveAdmin)
include EffectiveOrdersHelper
def scoped_collection
+ scoped = end_of_association_chain
+
+ if EffectiveOrders.orders_collection_scope.respond_to?(:call)
+ scoped = EffectiveOrders.orders_collection_scope.call(scoped)
+ end
+
scoped = end_of_association_chain.includes(:user).includes(order_items: :purchasable)
scoped = scoped.where(user: current_user) if !authorized?(:admin, :effective_orders)
scoped
diff --git a/app/models/effective/datatables/orders.rb b/app/models/effective/datatables/orders.rb
index <HASH>..<HASH> 100644
--- a/app/models/effective/datatables/orders.rb
+++ b/app/models/effective/datatables/orders.rb
@@ -70,6 +70,10 @@ if defined?(EffectiveDatatables)
.includes(:user)
.includes(:order_items)
+ if EffectiveOrders.orders_collection_scope.respond_to?(:call)
+ collection = EffectiveOrders.orders_collection_scope.call(collection)
+ end
+
attributes[:user_id].present? ? collection.where(user_id: attributes[:user_id]) : collection
end | Add config.orders_collection_scope | code-and-effect_effective_orders | train | rb,rb |
0c12f78d55943bc0207f257aafe4479989289b76 | diff --git a/bcbio/ngsalign/alignprep.py b/bcbio/ngsalign/alignprep.py
index <HASH>..<HASH> 100644
--- a/bcbio/ngsalign/alignprep.py
+++ b/bcbio/ngsalign/alignprep.py
@@ -374,9 +374,10 @@ def _prep_grabix_indexes(in_files, data):
if _ready_gzip_fastq(in_files, data) and (not _ready_gzip_fastq(in_files, data, require_bgzip=True)
or dd.get_align_split_size(data) is False):
for in_file in in_files:
- with file_transaction(data, in_file + ".gbi") as tx_gbi_file:
- with open(tx_gbi_file, "w") as out_handle:
- out_handle.write("Not grabix indexed; index added for compatibility.\n")
+ if not utils.file_exists(in_file + ".gbi"):
+ with file_transaction(data, in_file + ".gbi") as tx_gbi_file:
+ with open(tx_gbi_file, "w") as out_handle:
+ out_handle.write("Not grabix indexed; index added for compatibility.\n")
else:
items = [[{"bgzip_file": x, "config": copy.deepcopy(data["config"])}] for x in in_files if x]
run_multicore(_grabix_index, items, data["config"]) | Avoid creating fake grabix index if already exists | bcbio_bcbio-nextgen | train | py |
42703e019b6734b014dda016136a3e419cc68636 | diff --git a/tasks/connect.js b/tasks/connect.js
index <HASH>..<HASH> 100644
--- a/tasks/connect.js
+++ b/tasks/connect.js
@@ -153,7 +153,8 @@ module.exports = function(grunt) {
key: options.key || grunt.file.read(path.join(__dirname, 'certs', 'server.key')).toString(),
cert: options.cert || grunt.file.read(path.join(__dirname, 'certs', 'server.crt')).toString(),
ca: options.ca || grunt.file.read(path.join(__dirname, 'certs', 'ca.crt')).toString(),
- passphrase: options.passphrase || 'grunt'
+ passphrase: options.passphrase || 'grunt',
+ secureProtocol: options.secureProtocol || '',
};
middleware.forEach(function (m) { | Added secureProtocol property in httpsOptions | gruntjs_grunt-contrib-connect | train | js |
f2997b3d2983a6a85821f6043174ce4868e2d384 | diff --git a/dallinger/command_line.py b/dallinger/command_line.py
index <HASH>..<HASH> 100755
--- a/dallinger/command_line.py
+++ b/dallinger/command_line.py
@@ -304,6 +304,8 @@ def debug(verbose, bot):
ready = True
break
+ epipe = 0
+ participant = None
if ready:
host = config.get('host')
port = config.get('port')
@@ -333,6 +335,33 @@ def debug(verbose, bot):
else:
webbrowser.open(url, new=1, autoraise=True)
+ # Is recruitment over? We can end this debug session.
+ match = re.search('Close recruitment.$', line)
+ if match:
+ if participant:
+ # make sure there are no stray phantomjs processes
+ participant.driver.quit()
+ p.kill()
+ break
+
+ # Check for bot exceptions
+ match = re.search('Exception on ', line)
+ if participant and match:
+ log("There was an error running the experiment.")
+ participant.driver.quit()
+ p.kill()
+ break
+
+ # Check for unexpected bot hangs
+ match = re.search('Ignoring EPIPE', line)
+ if participant and match:
+ epipe = epipe + 1
+ if epipe >= 2:
+ log("The experiment finished but recruitment was not closed.")
+ participant.driver.quit()
+ p.kill()
+ break
+
log("Completed debugging of experiment with id " + id)
os.chdir(cwd) | add code to correctly exit debug mode after running experiment | Dallinger_Dallinger | train | py |
188178395c452c86f54384707e2a61ab9a3ba042 | diff --git a/src/main/java/apoc/cypher/Cypher.java b/src/main/java/apoc/cypher/Cypher.java
index <HASH>..<HASH> 100644
--- a/src/main/java/apoc/cypher/Cypher.java
+++ b/src/main/java/apoc/cypher/Cypher.java
@@ -48,7 +48,7 @@ public class Cypher {
public KernelTransaction tx;
@Procedure
- @Description("apoc.cypher.doIt(fragment, params) yield value - executes reading fragment with the given parameters")
+ @Description("apoc.cypher.run(fragment, params) yield value - executes reading fragment with the given parameters")
public Stream<MapResult> run(@Name("cypher") String statement, @Name("params") Map<String, Object> params) {
if (params == null) params = Collections.emptyMap();
return db.execute(compiled(statement, params.keySet()), params).stream().map(MapResult::new);
@@ -132,7 +132,7 @@ public class Cypher {
}
}
- public String compiled(@Name("cypher") String fragment, Collection<String> keys) {
+ public static String compiled(String fragment, Collection<String> keys) {
if (keys.isEmpty()) return fragment;
String declaration = " WITH " + join(", ", keys.stream().map(s -> format(" {`%s`} as `%s` ", s, s)).collect(toList()));
return declaration + fragment; | Made compiled() static to be used from the outside | neo4j-contrib_neo4j-apoc-procedures | train | java |
88d98e14b9b785922eda21678b177e8b5973b21d | diff --git a/library/CM/Model/Entity/Abstract.php b/library/CM/Model/Entity/Abstract.php
index <HASH>..<HASH> 100755
--- a/library/CM/Model/Entity/Abstract.php
+++ b/library/CM/Model/Entity/Abstract.php
@@ -37,7 +37,7 @@ abstract class CM_Model_Entity_Abstract extends CM_Model_Abstract {
*/
final public function isOwner(CM_Model_User $user = null) {
try {
- return $this->getUser()->equals($user);
+ return $this->getUser(true)->equals($user);
} catch (CM_Exception_Nonexistent $ex) {
return false;
} | explicitly pass Entity::getUser(true) to deal with different default values | cargomedia_cm | train | php |
9dba70ef9e547571a9c4e8119911922a94e5303f | diff --git a/graylog2-server/src/main/java/org/graylog2/bundles/BundleService.java b/graylog2-server/src/main/java/org/graylog2/bundles/BundleService.java
index <HASH>..<HASH> 100644
--- a/graylog2-server/src/main/java/org/graylog2/bundles/BundleService.java
+++ b/graylog2-server/src/main/java/org/graylog2/bundles/BundleService.java
@@ -39,7 +39,7 @@ import java.util.Set;
@Singleton
public class BundleService {
private static final Logger LOG = LoggerFactory.getLogger(BundleService.class);
- private static final String COLLECTION_NAME = "config_bundles";
+ private static final String COLLECTION_NAME = "content_packs";
private final JacksonDBCollection<ConfigurationBundle, ObjectId> dbCollection;
private final BundleImporterProvider bundleImporterProvider; | Rename MongoDB collection for content packs to "content_packs"
In order to be consistent in the terminology used throughout Graylog2, the
collection for content packs should be named accordingly.
We still have to rename the classes, though. | Graylog2_graylog2-server | train | java |
38d9f828f9cf845e9f9c7746e0d108fabea25026 | diff --git a/jose/utils.py b/jose/utils.py
index <HASH>..<HASH> 100644
--- a/jose/utils.py
+++ b/jose/utils.py
@@ -30,7 +30,7 @@ except ImportError:
if blocksize == 0:
return ret
else:
- assert len(ret) >= blocksize
+ assert len(ret) <= blocksize
padding = blocksize - len(ret)
return b'\x00' * padding + ret | Fix faulty comparison in assertion (should be the other way around). | mpdavis_python-jose | train | py |
16176d4371930f051b2201e49a34995aadbcfb83 | diff --git a/core/src/main/java/hudson/model/Cause.java b/core/src/main/java/hudson/model/Cause.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/model/Cause.java
+++ b/core/src/main/java/hudson/model/Cause.java
@@ -195,7 +195,7 @@ public abstract class Cause {
*/
public @CheckForNull Run<?,?> getUpstreamRun() {
Job<?,?> job = Jenkins.getInstance().getItemByFullName(upstreamProject, Job.class);
- return job.getBuildByNumber(upstreamBuild);
+ return job != null ? job.getBuildByNumber(upstreamBuild) : null;
}
@Exported(visibility=3) | don't throw NPE if job was deleted in the mean time | jenkinsci_jenkins | train | java |
3460e400a00bb955d69a5f8aaf69628f2d392f11 | diff --git a/h5p.classes.php b/h5p.classes.php
index <HASH>..<HASH> 100644
--- a/h5p.classes.php
+++ b/h5p.classes.php
@@ -2356,10 +2356,7 @@ class H5PCore {
*/
public function getDisable(&$sources, $current) {
foreach (H5PCore::$disable as $bit => $option) {
- if ($option === 'download') {
- $option = 'export';
- }
- if ($this->h5pF->getOption($option, TRUE) ) {
+ if ($this->h5pF->getOption(($bit & H5PCore::DISABLE_DOWNLOAD ? 'export' : $option), TRUE)) {
if (!isset($sources[$option]) || !$sources[$option]) {
$current |= $bit; // Disable
} | Fixed special case for export/download. | h5p_h5p-php-library | train | php |
b73d5030dd7c6171f53fb391bfa3dd338a3018c7 | diff --git a/websocketproxy.go b/websocketproxy.go
index <HASH>..<HASH> 100644
--- a/websocketproxy.go
+++ b/websocketproxy.go
@@ -62,6 +62,11 @@ func (w *WebsocketProxy) CloseNotify() {
// ServeHTTP implements the http.Handler that proxies WebSocket connections.
func (w *WebsocketProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
backendURL := w.Backend(req)
+ if backendURL == nil {
+ log.Println("websocketproxy: backend URL is nil")
+ http.Error(rw, "internal server error", http.StatusInternalServerError)
+ return
+ }
dialer := w.Dialer
if w.Dialer == nil { | websocketproxy: return with known error if backend url is nil | koding_websocketproxy | train | go |
406915cb781e38255a30ad2a0609e33952b9ec50 | diff --git a/lib/devise/models/authenticatable.rb b/lib/devise/models/authenticatable.rb
index <HASH>..<HASH> 100644
--- a/lib/devise/models/authenticatable.rb
+++ b/lib/devise/models/authenticatable.rb
@@ -152,7 +152,8 @@ module Devise
# # If the record is new or changed then delay the
# # delivery until the after_commit callback otherwise
# # send now because after_commit will not be called.
- # if new_record? || changed?
+ # # For Rails < 6 is `changed?` instead of `saved_changes?`.
+ # if new_record? || saved_changes?
# pending_devise_notifications << [notification, args]
# else
# render_and_send_devise_message(notification, *args) | `changed?` behaviour has been updated (#<I>)
* `changed?` behaviour has been updated
Due to <URL> | plataformatec_devise | train | rb |
01c30c5c47dc5c5e8c14998c3f5bcd7efe1d26f8 | diff --git a/lib/fog/libvirt/models/compute/nic.rb b/lib/fog/libvirt/models/compute/nic.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/libvirt/models/compute/nic.rb
+++ b/lib/fog/libvirt/models/compute/nic.rb
@@ -7,6 +7,7 @@ module Fog
class Nic < Fog::Model
identity :mac
+ attribute :id
attribute :type
attribute :network
attribute :bridge | Add :id attribute to libvirt nic model
My cutting edge version of libvirt (<I> Archlinux) seems to reply with :id for NICs, causing the nic model to break. | fog_fog | train | rb |
8018066028f005e9032851dfecb371d921d9e9a1 | diff --git a/spatialist/raster.py b/spatialist/raster.py
index <HASH>..<HASH> 100644
--- a/spatialist/raster.py
+++ b/spatialist/raster.py
@@ -193,10 +193,8 @@ class Raster(object):
raise RuntimeError('Raster subsetting is only supported for Vector objects with one type of geometry')
geomtype = geomtypes[0]
if geomtype == 'POLYGON':
- # reproject Vector object on the fly
- index.reproject(self.proj4)
- # intersect vector object with raster bounding box
- inter = intersect(self.bbox(), index)
+ # intersect bounding boxes of vector and raster object
+ inter = intersect(index.bbox(), self.bbox())
if inter is None:
raise RuntimeError('no intersection between Raster and Vector object')
else: | [Raster] fixed bug in subsetting with Vector objects | johntruckenbrodt_spatialist | train | py |
8c66e7770aa2864cb50315514ced5440ed26c141 | diff --git a/devices/philips.js b/devices/philips.js
index <HASH>..<HASH> 100644
--- a/devices/philips.js
+++ b/devices/philips.js
@@ -1247,6 +1247,15 @@ module.exports = [
ota: ota.zigbeeOTA,
},
{
+ zigbeeModel: ['929003099101'],
+ model: '929003099101',
+ vendor: 'Philips',
+ description: 'Hue white ambiance Aurelle rectangle panel light',
+ meta: {turnsOffAtBrightness1: true},
+ extend: hueExtend.light_onoff_brightness_colortemp({colorTempRange: [153, 454]}),
+ ota: ota.zigbeeOTA,
+ },
+ {
zigbeeModel: ['LTC016'],
model: '3216431P5',
vendor: 'Philips', | Add <I> (#<I>) | Koenkk_zigbee-shepherd-converters | train | js |
71c7c14927fc0b7b296e1ee9d237d65908637542 | diff --git a/source/rafcon/gui/controllers/main_window.py b/source/rafcon/gui/controllers/main_window.py
index <HASH>..<HASH> 100644
--- a/source/rafcon/gui/controllers/main_window.py
+++ b/source/rafcon/gui/controllers/main_window.py
@@ -21,6 +21,7 @@
"""
+import os
import logging
import gtk
from functools import partial
@@ -490,6 +491,8 @@ class MainWindowController(ExtendedController):
widget_name = window_key.lower()
undocked_window_view = getattr(self.view, undocked_window_name)
undocked_window = undocked_window_view.get_top_widget()
+ if os.getenv("RAFCON_START_MINIMIZED", False):
+ undocked_window.iconify()
gui_helper_label.set_window_size_and_position(undocked_window, window_key)
self.view[widget_name].reparent(undocked_window_view['central_eventbox']) | feat(rafcon.gui): Open pane windows minimized for RAFCON_START_MINIMIZED
Now also the undocked sidebars/pane windows are opened minimized, when
the env variable RAFCON_START_MINIMIZED is set. This does not affect the
docking_window test. | DLR-RM_RAFCON | train | py |
49184a49261d9a9fbf74685fb11c6d35216d0411 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100755
--- a/index.js
+++ b/index.js
@@ -1957,14 +1957,14 @@ Pod.prototype = {
filter = {
owner_id : channel.owner_id,
channel_id : channel.id,
- bip_id : sysImports.bip.id,
+ bip_id : sysImports.bip && sysImports.bip.id,
value : objVal
},
props = {
last_update : helper.nowUTCMS(),
owner_id : channel.owner_id,
channel_id : channel.id,
- bip_id : sysImports.bip.id,
+ bip_id : sysImports.bip && sysImports.bip.id,
value : objVal
}; | Fixed bug when pod is used as a self-sufficient entity | bipio-server_bip-pod | train | js |
69234155b9ab701d2afe7d4e244df66922c6f116 | diff --git a/salt/modules/pkgutil.py b/salt/modules/pkgutil.py
index <HASH>..<HASH> 100644
--- a/salt/modules/pkgutil.py
+++ b/salt/modules/pkgutil.py
@@ -30,7 +30,7 @@ def refresh_db():
salt '*' pkgutil.refresh_db
'''
- return __salt__['cmd.retcode']('/opt/csw/bin/pkgutil -U > /dev/null 2>&1') == 0
+ return __salt__['cmd.retcode']('/opt/csw/bin/pkgutil -U') == 0
def upgrade_available(name):
@@ -44,7 +44,7 @@ def upgrade_available(name):
salt '*' pkgutil.upgrade_available CSWpython
'''
version_num = None
- cmd = '/opt/csw/bin/pkgutil -c --parse --single {0} 2>/dev/null'.format(
+ cmd = '/opt/csw/bin/pkgutil -c --parse --single {0}'.format(
name)
out = __salt__['cmd.run_stdout'](cmd)
if out: | No need to handle stderr/stdout when cmdmod will do it for you | saltstack_salt | train | py |
2364276c388a22f3dd8d1e27fe1c1f7350768373 | diff --git a/config/admin/jqadm/resource.php b/config/admin/jqadm/resource.php
index <HASH>..<HASH> 100644
--- a/config/admin/jqadm/resource.php
+++ b/config/admin/jqadm/resource.php
@@ -325,7 +325,7 @@ return [
* @param array List of user group names
* @since 2017.10
*/
- 'groups' => ['admin', 'super'],
+ 'groups' => ['super'],
],
'language' => [
/** admin/jqadm/resource/locale/language/groups | Allow only super users access to locale site panel | aimeos_ai-admin-jqadm | train | php |
1eb4398b6c028c47aded4896dcaf806ca66c346f | diff --git a/registry/consul/options.go b/registry/consul/options.go
index <HASH>..<HASH> 100644
--- a/registry/consul/options.go
+++ b/registry/consul/options.go
@@ -18,13 +18,13 @@ func Config(c *consul.Config) registry.Option {
}
//
-// RegisterTCPCheck will tell the service provider to check the service address
+// TCPCheck will tell the service provider to check the service address
// and port every `t` interval. It will enabled only if `t` is greater than 0.
// See `TCP + Interval` for more information [1].
//
// [1] https://www.consul.io/docs/agent/checks.html
//
-func RegisterTCPCheck(t time.Duration) registry.Option {
+func TCPCheck(t time.Duration) registry.Option {
return func(o *registry.Options) {
if t <= time.Duration(0) {
return
@@ -32,7 +32,6 @@ func RegisterTCPCheck(t time.Duration) registry.Option {
if o.Context == nil {
o.Context = context.Background()
}
- o.Context = context.WithValue(o.Context,
- registry.ConsulRegisterTCPCheckKey, t)
+ o.Context = context.WithValue(o.Context, "consul_register_tcp_check", t)
}
} | registry/consul: rename "RegisterTCPCheck" to "TCPCheck" | micro_go-micro | train | go |
03643d18136798fac80374305d0e17f44180d8fa | diff --git a/docs/source/conf.py b/docs/source/conf.py
index <HASH>..<HASH> 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -55,9 +55,9 @@ copyright = u'2014, Mist.io Inc'
# built documents.
#
# The short X.Y version.
-version = '0.0.2'
+version = '0.1.0'
# The full version, including alpha/beta/rc tags.
-release = '0.0.2'
+release = '0.1.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. | Change version in sphinx conf.py | mistio_mist.client | train | py |
a8af69ab676ee24442c5f5fa70d69c3eb2e0f45a | diff --git a/lib/wmi-lite/version.rb b/lib/wmi-lite/version.rb
index <HASH>..<HASH> 100644
--- a/lib/wmi-lite/version.rb
+++ b/lib/wmi-lite/version.rb
@@ -1,3 +1,3 @@
module WmiLite
- VERSION = '1.0.0'
+ VERSION = "1.0.1".freeze
end | Fix the version file to match the promotion
Without the double quotes expeditor didn't bump this | chef_wmi-lite | train | rb |
1780fbb9b4c30715aa3d01a2b19e18b56b03dade | diff --git a/lib/torrent.js b/lib/torrent.js
index <HASH>..<HASH> 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -475,6 +475,11 @@ Torrent.prototype._onMetadata = function (metadata) {
self.addWebSeed(url)
})
+ // start off selecting the entire torrent with low priority
+ if (self.pieces.length !== 0) {
+ self.select(0, self.pieces.length - 1, false)
+ }
+
self._rarityMap = new RarityMap(self)
self.store = new ImmediateChunkStore(
@@ -610,11 +615,6 @@ Torrent.prototype._onStore = function () {
if (self.destroyed) return
self._debug('on store')
- // start off selecting the entire torrent with low priority
- if (self.pieces.length !== 0) {
- self.select(0, self.pieces.length - 1, false)
- }
-
self.ready = true
self.emit('ready') | Allow entire torrent deselect() to be called earlier
// Remove default selection (whole torrent)
torrent.deselect(0, torrent.pieces.length - 1, false)
Can now be called earlier, after 'metadata' instead of after 'ready'
<URL> | webtorrent_webtorrent | train | js |
eafc4dc751425f39114b03c30990cc9f998af8c1 | diff --git a/test/blob_test.rb b/test/blob_test.rb
index <HASH>..<HASH> 100644
--- a/test/blob_test.rb
+++ b/test/blob_test.rb
@@ -36,6 +36,7 @@ context "Rugged::Blob tests" do
"\xE3\xC3\nK\xCD<!\xEA-_\x9E\xDC=40000 examples\x00"+
"\xAE\xCB\xE9d!|\xB9\xA6\x96\x024],U\xEE\x99\xA2\xEE\xD4\x92"
+ content.force_encoding('binary') if content.respond_to?(:force_encoding)
obj = Rugged::RawObject.new('tree', content)
sha = @repo.write(obj) | force encoding on binary string to binary for proper comparison in <I> | libgit2_rugged | train | rb |
5b1e428b58706afc917e913617055d4d9e81d86b | diff --git a/kerncraft/cacheprediction.py b/kerncraft/cacheprediction.py
index <HASH>..<HASH> 100755
--- a/kerncraft/cacheprediction.py
+++ b/kerncraft/cacheprediction.py
@@ -66,7 +66,7 @@ def sympy_expr_abs_distance_key(e):
assert coeff_imag == 0, "Not supporting imaginary coefficients."
# Sort order: exponent (cpart), factor
key.append(cpart + (coeff_real,))
- key[0] = (key[0][0], abs(key[0][1]))
+ key[0] = (key[0][0], key[0][1])
# build key
key.sort(reverse=True)
# add missing exponent, coefficient tuples | fixed sympy sorting with negative constants | RRZE-HPC_kerncraft | train | py |
6601fd41470eef4915c38fe29ebff658363b597e | diff --git a/pyeda/expr.py b/pyeda/expr.py
index <HASH>..<HASH> 100755
--- a/pyeda/expr.py
+++ b/pyeda/expr.py
@@ -1035,6 +1035,10 @@ def naive_sat_one(expr):
else:
# var=0 and var=1 both result in a simpler formula
point = naive_sat_one(cf0)
- if point is None:
+ if point is not None:
+ point[var] = 0
+ else:
point = naive_sat_one(cf1)
+ if point is not None:
+ point[var] = 1
return point | Fixing more bugs with naive SAT solver
Clearly the author is more naive than the algorithm itself. | cjdrake_pyeda | train | py |
9741d304d618f1b45570d298cdeac981bd384d66 | diff --git a/luigi/server.py b/luigi/server.py
index <HASH>..<HASH> 100644
--- a/luigi/server.py
+++ b/luigi/server.py
@@ -169,7 +169,12 @@ def run_api_threaded(api_port=8082, address=None):
sock_names = _init_api(_create_scheduler(), None, api_port, address)
import threading
- threading.Thread(target=tornado.ioloop.IOLoop.instance().start).start()
+ def scheduler_thread():
+ # this is wrapped in a function so we get the instance
+ # from the scheduler thread and not from the main thread
+ tornado.ioloop.IOLoop.instance().start()
+
+ threading.Thread(target=scheduler_thread).start()
return sock_names | Wraps ioloop fetcher for unit tests in a function.
Otherwise, the ioloop instance is fetched in the main loop
but launched in a separate thread, which seems to cause problems.
Hopefully this fixes sporadic deadlocks in unit tests | spotify_luigi | train | py |
85760f9a3624923f7fd0d1d06f61ba267bd0264e | diff --git a/pyinfra/api/connectors/util.py b/pyinfra/api/connectors/util.py
index <HASH>..<HASH> 100644
--- a/pyinfra/api/connectors/util.py
+++ b/pyinfra/api/connectors/util.py
@@ -195,7 +195,7 @@ def remove_any_sudo_askpass_file(host):
@memoize
-def show_use_su_login_warning():
+def _show_use_su_login_warning():
logger.warning((
'Using `use_su_login` may not work: '
'some systems (MacOS, OpenBSD) ignore the flag when executing a command, '
@@ -276,7 +276,7 @@ def make_unix_command(
command_bits.append('su')
if use_su_login:
- show_use_su_login_warning()
+ _show_use_su_login_warning()
command_bits.append('-l')
if preserve_su_env: | Rename private/internal function with `_` prefix. | Fizzadar_pyinfra | train | py |
4f8899e47c9b50e1f0db06726c060659aa2e24b5 | diff --git a/CLI/commands/dividends_manager.js b/CLI/commands/dividends_manager.js
index <HASH>..<HASH> 100644
--- a/CLI/commands/dividends_manager.js
+++ b/CLI/commands/dividends_manager.js
@@ -128,8 +128,13 @@ async function start_explorer(){
await transferTokens(_to2,_amount2);
break;
case 'Create checkpoint':
- let createCheckpointAction = securityToken.methods.createCheckpoint();
- await common.sendTransaction(Issuer, createCheckpointAction, defaultGasPrice);
+ if (await isDividendsModuleAttached()) {
+ let createCheckpointAction = currentDividendsModule.methods.createCheckpoint();
+ await common.sendTransaction(Issuer, createCheckpointAction, defaultGasPrice);
+ } else {
+ console.log("You must to attach Dividends module to perform this action.");
+ process.exit(1);
+ }
break;
case 'Set default exclusions for dividends':
await setDefaultExclusions(); | Add support for createCheckpoint() from dividends modules | PolymathNetwork_polymath-core | train | js |
98d588d8385731f344645feea6583cc3d9110b87 | diff --git a/tests/rdfsupport_tests/test_fhirrdf.py b/tests/rdfsupport_tests/test_fhirrdf.py
index <HASH>..<HASH> 100644
--- a/tests/rdfsupport_tests/test_fhirrdf.py
+++ b/tests/rdfsupport_tests/test_fhirrdf.py
@@ -48,12 +48,12 @@ class FhirDataLoaderTestCase(unittest.TestCase):
json_file = fname + ".json"
turtle_file = fname + ".ttl"
- source = FHIRResource(self.fhir_ontology, os.path.join(self.base_dir, json_file), "http://hl7.org/fhir/")
+ target = FHIRResource(self.fhir_ontology, os.path.join(self.base_dir, json_file), "http://hl7.org/fhir/")
turtle_fname = os.path.join(self.base_dir, turtle_file)
- target = PrettyGraph()
- target.load(turtle_fname, format="turtle")
+ source = PrettyGraph()
+ source.load(turtle_fname, format="turtle")
self.maxDiff = None
- self.assertEqual('', rdf_compare(source.graph, target, ignore_owl_version=False))
+ self.assertEqual(*rdf_compare(source, target.graph, ignore_owl_version=False))
def test_observation_example_bmd(self):
self.do_test('observation-example-bmd') | Switch source and target in test to conform to expected/actual idiom | BD2KOnFHIR_fhirtordf | train | py |
e2f8fb9bef8e05a837ad41a4a8516bb1fffdb405 | diff --git a/test.js b/test.js
index <HASH>..<HASH> 100644
--- a/test.js
+++ b/test.js
@@ -502,11 +502,11 @@ function runTests (options) {
var watcher = chokidar.watch(fixturesPath, options)
.on('all', spy)
.on('ready', readySpy);
- delay(function() {
+ ddelay(function() {
readySpy.should.have.been.calledOnce;
spy.should.have.been.calledWith('add', filePath);
fs.writeFileSync(filePath, 'c');
- ddelay(function() {
+ delay(function() {
fs.unlinkSync(filePath);
watcher.close();
spy.should.have.been.calledWith('change', filePath); | Fix polling-mode timing of new test | paulmillr_chokidar | train | js |
0d9372d992f72acee26537a2c9ae787fa2ecb3eb | diff --git a/jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/JqmEngine.java b/jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/JqmEngine.java
index <HASH>..<HASH> 100644
--- a/jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/JqmEngine.java
+++ b/jqm-all/jqm-engine/src/main/java/com/enioka/jqm/tools/JqmEngine.java
@@ -362,7 +362,8 @@ class JqmEngine implements JqmEngineMBean
{
em.getTransaction().begin();
for (JobInstance ji : em
- .createQuery("SELECT ji FROM JobInstance ji WHERE ji.node = :node AND (ji.state = 'ATTRIBUTED' OR ji.state = 'RUNNING')",
+ .createQuery(
+ "SELECT ji FROM JobInstance ji WHERE ji.node = :node AND (ji.state = 'ATTRIBUTED' OR ji.state = 'RUNNING' OR ji.state = 'KILLED')",
JobInstance.class).setParameter("node", node).getResultList())
{
History h = em.find(History.class, ji.getId()); | Bugfix: asked to die instances were not purged on node rebbot
Fixes #<I> | enioka_jqm | train | java |
cea17acd8cc5190684da944924116fe10742ad81 | diff --git a/src/transformers/generation_utils.py b/src/transformers/generation_utils.py
index <HASH>..<HASH> 100644
--- a/src/transformers/generation_utils.py
+++ b/src/transformers/generation_utils.py
@@ -401,7 +401,7 @@ class GenerationMixin:
# First if `inputs_embeds` are given, but no `attention_mask` assume that full attention_mask is used
if inputs_embeds is not None:
- return torch.ones((inputs_embeds.shape[0], inputs_embeds.shape[1]), dtype=torch.long)
+ return torch.ones((inputs_embeds.shape[0], inputs_embeds.shape[1]), dtype=torch.long, device=self.device)
# Otherwise, use `input_ids`
is_pad_token_in_inputs_ids = (pad_token_id is not None) and (pad_token_id in input_ids) | [Generate] Fix generate with inputs_embeds on GPU (#<I>) | huggingface_pytorch-pretrained-BERT | train | py |
c6c4d56d6d54da66201e9e0e6a61aa2b13f36e37 | diff --git a/library/src/main/java/com/liulishuo/filedownloader/connection/FileDownloadUrlConnection.java b/library/src/main/java/com/liulishuo/filedownloader/connection/FileDownloadUrlConnection.java
index <HASH>..<HASH> 100644
--- a/library/src/main/java/com/liulishuo/filedownloader/connection/FileDownloadUrlConnection.java
+++ b/library/src/main/java/com/liulishuo/filedownloader/connection/FileDownloadUrlConnection.java
@@ -107,7 +107,10 @@ public class FileDownloadUrlConnection implements FileDownloadConnection {
@Override
public void ending() {
- // for reuse,so do nothing.
+ try {
+ mConnection.getInputStream().close();
+ } catch (IOException ignored) {
+ }
} | fix: close intput stream when connection ending avoid input-stream leak especially for the trial connection | lingochamp_FileDownloader | train | java |
0c592e0fb54003339a87bbc20e2c200ee1918b2c | diff --git a/test/test_big_pgn_collection.rb b/test/test_big_pgn_collection.rb
index <HASH>..<HASH> 100644
--- a/test/test_big_pgn_collection.rb
+++ b/test/test_big_pgn_collection.rb
@@ -2,7 +2,7 @@ require 'test_helper'
class ChessTest < Minitest::Test
- if File.exist?(TestHelper::BIG_PGN_COLLECTION)
+ if ENV['BIG_PGN_COLLECTION'] && File.exist?(TestHelper::BIG_PGN_COLLECTION)
puts 'Loading tests for a big PGN collection...'
300_000.times do |i|
filename = sprintf("%06d.pgn", i+1) | Enable test_big_pgn_collection only if env variable BIG_PGN_COLLECTION is set | pioz_chess | train | rb |
65acb3048a466dc05c054ba00b7eb4558e6cb211 | diff --git a/lib/command/run-multiple.js b/lib/command/run-multiple.js
index <HASH>..<HASH> 100644
--- a/lib/command/run-multiple.js
+++ b/lib/command/run-multiple.js
@@ -3,6 +3,7 @@ const {
} = require('./utils');
const fork = require('child_process').fork;
const path = require('path');
+const crypto = require('crypto');
const runHook = require('../hooks');
const event = require('../event');
const collection = require('./run-multiple/collection');
@@ -121,7 +122,9 @@ function executeRun(runName, runConfig) {
if (browserConfig.outputName) {
outputDir += typeof browserConfig.outputName === 'function' ? browserConfig.outputName() : browserConfig.outputName;
} else {
- outputDir += JSON.stringify(browserConfig).replace(/[^\d\w]+/g, '_');
+ const hash = crypto.createHash('md5');
+ hash.update(JSON.stringify(browserConfig));
+ outputDir += hash.digest('hex');
}
outputDir += `_${runId}`; | Hash name for screenshots output directory (#<I>) | Codeception_CodeceptJS | train | js |
1515c5e7d19f2a3e12bbf7613d7e2c748a5e6fbd | diff --git a/simuvex/plugins/symbolic_memory.py b/simuvex/plugins/symbolic_memory.py
index <HASH>..<HASH> 100644
--- a/simuvex/plugins/symbolic_memory.py
+++ b/simuvex/plugins/symbolic_memory.py
@@ -181,6 +181,10 @@ class SimPagedMemory(collections.MutableMapping):
differences = set()
for c in candidates:
+ if c in differences:
+ # Skip all offsets that might have been added to difference set before
+ continue
+
if c not in self and c in other:
differences.add(c)
elif c in self and c not in other:
@@ -199,6 +203,13 @@ class SimPagedMemory(collections.MutableMapping):
# self_byte, other_byte,
# self[c].object.model, other[c].object.model)
differences.add(c)
+ if self[c].base == other[c].base and \
+ self[c].size() == other[c].size() and \
+ self[c].size() / 8 <= 8:
+ # We want to consider the MO as a whole
+ # Add all other bytes to differences set
+ for i in range(self[c].base, self[c].base + self[c].size() / 8):
+ differences.add(i)
else:
# this means the byte is in neither memory
pass | Logic change in memory merging: we merge memory objects first for those ones that is equal to or less than 8 bytes (which might be a variable) even if there is only one byte difference between them. | angr_angr | train | py |
e492a5578cb1bc6b0200e2b99f58eebb76884a16 | diff --git a/pre_commit/languages/python.py b/pre_commit/languages/python.py
index <HASH>..<HASH> 100644
--- a/pre_commit/languages/python.py
+++ b/pre_commit/languages/python.py
@@ -34,6 +34,7 @@ def bin_dir(venv: str) -> str:
def get_env_patch(venv: str) -> PatchesT:
return (
+ ('PIP_DISABLE_PIP_VERSION_CHECK', '1'),
('PYTHONHOME', UNSET),
('VIRTUAL_ENV', venv),
('PATH', (bin_dir(venv), os.pathsep, Var('PATH'))), | disable pip version check in python hooks | pre-commit_pre-commit | train | py |
b3982e981e09b7b43ceb432d528256aea89f90bb | diff --git a/src/locale/bootstrap-table-fr-FR.js b/src/locale/bootstrap-table-fr-FR.js
index <HASH>..<HASH> 100644
--- a/src/locale/bootstrap-table-fr-FR.js
+++ b/src/locale/bootstrap-table-fr-FR.js
@@ -38,7 +38,7 @@ $.fn.bootstrapTable.locales['fr-FR'] = {
return 'Recherche'
},
formatNoMatches () {
- return 'Pas de lignes trouvés'
+ return 'Aucun résultat'
},
formatPaginationSwitch () {
return 'Cacher/Afficher pagination' | Update no result french translation (#<I>)
Sounds better in my opinion | wenzhixin_bootstrap-table | train | js |
10324b355427c1b3be847c7c0a6841488791539d | diff --git a/lib/virtualmonkey/mysql_runner.rb b/lib/virtualmonkey/mysql_runner.rb
index <HASH>..<HASH> 100644
--- a/lib/virtualmonkey/mysql_runner.rb
+++ b/lib/virtualmonkey/mysql_runner.rb
@@ -26,11 +26,16 @@ module VirtualMonkey
end
def run_reboot_operations
- reboot_all(true) # serially_reboot = true
+# Duplicate code here because we need to wait between the master and the slave time
+ #reboot_all(true) # serially_reboot = true
+ @servers.each do |s|
+ s.reboot(true)
+ s.wait_for_state("operational")
+# TODO put a check in here to see if mysql is fully up before rebooting the next server
+# The slave was rebooting to soon after the master came up.
+ sleep 300
+ end
wait_for_all("operational")
- # This sleep is for waiting for the slave to catch up to the master since they both reboot at once
- # This sleep does more than that. It waits for the master to be fully up.
- sleep 120
run_reboot_checks
end | Added wait between mysql reboots | jeremyd_virtualmonkey | train | rb |
a297acbaff2a46ed4615e10f89beca08949e81a5 | diff --git a/salt/states/cmd.py b/salt/states/cmd.py
index <HASH>..<HASH> 100644
--- a/salt/states/cmd.py
+++ b/salt/states/cmd.py
@@ -12,8 +12,7 @@ def run(name,
unless=None,
cwd='/root',
user=None,
- group=None,
- timeout=60):
+ group=None):
'''
Ensure that the named command is executed
@@ -26,8 +25,6 @@ def run(name,
cwd -- Run the command from this directory, defaults to /root
user -- Run the command as this user
group -- run the command as this group
- timeout -- The number of seconds to wait for the command to complete,
- return False if the command does not return in time
'''
ret = {'name': name,
'changes': {}, | Remove timeout option, it no worky | saltstack_salt | train | py |
a12983b774784b080605a4c3023a606e22083837 | diff --git a/OpenPNM/Utilities/IO.py b/OpenPNM/Utilities/IO.py
index <HASH>..<HASH> 100644
--- a/OpenPNM/Utilities/IO.py
+++ b/OpenPNM/Utilities/IO.py
@@ -108,8 +108,7 @@ class PNM(object):
a = obj._models[item].keywords
#Store path to model, name of model and argument key:value pairs in a dict
model = {}
- model['path'] = f.__module__
- model['name'] = f.__name__
+ model['func'] = f
model['args'] = {}
for item in a:
#remove default arguments used in all add_model calls
@@ -180,10 +179,8 @@ class PNM(object):
def _load_model(obj,model):
r'''
'''
- #Import model using stored path and name
- mod = eval(model['path']+'.'+model['name'])
#Apply model to object using info in dict
- obj.add_model(model=mod,**model['args'])
+ obj.add_model(model=model['func'],**model['args'])
class VTK():
r""" | PNM.save/load now saves models as functions directly, rather than as string references to the location of the function...duh, why didn't I do this originally? | PMEAL_OpenPNM | train | py |
27c903b1582fc9d89194733137192064819db727 | diff --git a/rackspace_monitoring/__init__.py b/rackspace_monitoring/__init__.py
index <HASH>..<HASH> 100644
--- a/rackspace_monitoring/__init__.py
+++ b/rackspace_monitoring/__init__.py
@@ -1,2 +1,2 @@
__all__ = ['__version__']
-__version__ = '0.5.0'
+__version__ = '0.5.1-dev' | Indicate we are now developing <I>-dev. | racker_rackspace-monitoring | train | py |
8fb1183e72e39a5bc177eece0af24b022d657a0f | diff --git a/src/Presenters/BackgroundStatusAdminPresenter.php b/src/Presenters/BackgroundStatusAdminPresenter.php
index <HASH>..<HASH> 100644
--- a/src/Presenters/BackgroundStatusAdminPresenter.php
+++ b/src/Presenters/BackgroundStatusAdminPresenter.php
@@ -78,6 +78,9 @@ class BackgroundStatusAdminPresenter extends AdminPresenter
return $control;
}
+ /**
+ * @admin-access-level write
+ */
public function handleRetry($id)
{
$task = $this->hermesTasksRepository->find($id); | Fix access-level on few ACL actions
- Adds access-level for new `BackgroundStatusAdminPresenter->handleRetry()`.
- Changes access-level for `PaymentsAdminPresenter->handleExportPayments()`,
action generates export.
Removed forgotten debug variable.
remp/crm#<I> | remp2020_crm-admin-module | train | php |
d7c57c9f8c315c64d41ee1ba81643a443fdec286 | diff --git a/lib/temple/core.rb b/lib/temple/core.rb
index <HASH>..<HASH> 100644
--- a/lib/temple/core.rb
+++ b/lib/temple/core.rb
@@ -1,4 +1,27 @@
module Temple
+ # == The Core Abstraction
+ #
+ # The core abstraction is what every template evetually should be compiled
+ # to. Currently it consists of four essential and two convenient types:
+ # multi, static, dynamic, block, newline and capture.
+ #
+ # === [:multi, *exp]
+ #
+ # Multi is what glues everything together. It's simply a sexp which combines
+ # several others sexps:
+ #
+ # [:multi,
+ # [:static, "Hello "],
+ # [:dynamic, "@world"]]
+ #
+ # === [:static, string]
+ #
+ # Static denotes that the given string should be appended to the result.
+ #
+ # === [:dynamic, rby]
+ # === [:block, rby]
+ # === [:newline]
+ # === [:capture, name, exp]
module Core
# _buf = []
# _buf << "static" | Start working on documentation of the core-abs | judofyr_temple | train | rb |
7ae4532ea7561eda48d7534ae473f23a8ad8bf46 | diff --git a/lib/git.js b/lib/git.js
index <HASH>..<HASH> 100644
--- a/lib/git.js
+++ b/lib/git.js
@@ -18,7 +18,7 @@ const downloadRepo = async repoPath => {
url = `https://gitlab.com/${pathParts.main}/repository/archive.tar` + ref
break
case 'Bitbucket':
- url = `https://bitbucket.org/${pathParts.main}/get/${pathParts.ref || 'master'}.zip`
+ url = `https://bitbucket.org/${pathParts.main}/get/${pathParts.ref || 'default'}.zip`
break
default:
url = `https://api.github.com/repos/${pathParts.main}/tarball/${pathParts.ref}` | Bitbucket's master branches are default | zeit_now-cli | train | js |
511a2c10f6bb3f18fd03fe0a5ac105729a8bcf0e | diff --git a/cumulus/storage.py b/cumulus/storage.py
index <HASH>..<HASH> 100644
--- a/cumulus/storage.py
+++ b/cumulus/storage.py
@@ -211,6 +211,27 @@ class CloudFilesStorage(Storage):
"""
return '%s/%s' % (self.container_url, name)
+ def modified_time(self, name):
+ # CloudFiles return modified date in different formats
+ # depending on whether or not we pre-loaded objects.
+ # When pre-loaded, timezone is not included but we
+ # assume UTC. Since FileStorage returns localtime, and
+ # collectstatic compares these dates, we need to depend
+ # on dateutil to help us convert timezones.
+ try:
+ from dateutil import parser, tz
+ except ImportError:
+ raise NotImplementedError()
+ obj = self.container.get_object(name)
+ # convert to string to date
+ date = parser.parse(obj.last_modified)
+ # if the date has no timzone, assume UTC
+ if date.tzinfo == None:
+ date = date.replace(tzinfo=tz.tzutc())
+ # convert date to local time w/o timezone
+ date = date.astimezone(tz.tzlocal()).replace(tzinfo=None)
+ return date
+
class CloudStorageDirectory(File):
""" | Resurrected bendavis<I>'s modified_time support to aid with collectstatic | django-cumulus_django-cumulus | train | py |
7ccf661c685b019dd59ba1ccf4baab8f16ee002a | diff --git a/core.js b/core.js
index <HASH>..<HASH> 100644
--- a/core.js
+++ b/core.js
@@ -155,7 +155,9 @@ class History extends EventEmitter {
class Event {
constructor(type, init = {}) {
this.type = type;
- this.target = init.target ? init.target : null;
+ this.target = init.target !== undefined ? init.target : null;
+ this.bubbles = init.bubbles !== undefined ? init.bubbles : false;
+ this.cancelable = init.cancelable !== undefined ? init.cancelable : false;
this.defaultPrevented = false;
this.propagationStopped = false; | Add Event bubbles/cancelable properties | exokitxr_exokit | train | js |
b3f66fa98e4781155a5e36b877b82b5fd119061f | diff --git a/src/SQLManager.php b/src/SQLManager.php
index <HASH>..<HASH> 100644
--- a/src/SQLManager.php
+++ b/src/SQLManager.php
@@ -285,7 +285,7 @@ class SQLManager
*/
private function setDBorSchema($db_name)
{
- if (strtolower($this->connectionType[$db_name]) === 'postgres9') {
+ if (strtolower($this->connectionType($db_name)) === 'postgres9') {
$adapter = $this->getAdapter($this->connectionType($db_name));
$selectDbQuery = $adapter->useNamedDB($db_name);
return $this->connections[$db_name]->Execute($selectDbQuery); | connectionType is a method not array | CORE-POS_Common-Bundle | train | php |
0f1504c09121370891b668e86b295acbc9b6299e | diff --git a/labm8/py/hashcache_test.py b/labm8/py/hashcache_test.py
index <HASH>..<HASH> 100644
--- a/labm8/py/hashcache_test.py
+++ b/labm8/py/hashcache_test.py
@@ -16,8 +16,6 @@ import pathlib
import tempfile
import time
-import pytest
-
from labm8.py import app
from labm8.py import hashcache
from labm8.py import test
@@ -91,6 +89,7 @@ def test_HashCache_GetHash_unmodified_directory(database_path, hash_fn):
assert hash_1 == hash_2
[email protected](reason="Fix me")
@test.Parametrize("hash_fn", HASH_FUNCTIONS)
def test_HashCache_GetHash_modified_directory(database_path, hash_fn):
"""Test that modifying a directory changes the hash."""
@@ -99,6 +98,7 @@ def test_HashCache_GetHash_modified_directory(database_path, hash_fn):
hash_1 = c.GetHash(pathlib.Path(d))
time.sleep(1)
(pathlib.Path(d) / "a").touch()
+ (pathlib.Path(d) / "b").touch()
hash_2 = c.GetHash(pathlib.Path(d))
assert hash_1 != hash_2 | labm8: Mark XFail on hashcache tests.
Insufficient bandwidth to fix.
Signed-off-by: format <I> <github.com/ChrisCummins/format> | ChrisCummins_labm8 | train | py |
d65db784274d5e15f2adc820e45d77b811b1e51f | diff --git a/cpmorphology.py b/cpmorphology.py
index <HASH>..<HASH> 100755
--- a/cpmorphology.py
+++ b/cpmorphology.py
@@ -791,6 +791,7 @@ def triangle_areas(p1,p2,p3):
a /= 2.0
del v1, v2, cross1, cross2
a = a.copy() # a is a view on v1; shed one dimension.
+ a = np.abs(a)
#
# Handle small round-off errors
# | cpmorphology's triangle_areas can handle both winding orders. EditObjectsManually picks the control points using a greedy approach that consecutively finds the point that improves the approximation the most. | CellProfiler_centrosome | train | py |
d2c527f2fdccd91fb51949fc092fce2ff1cc418d | diff --git a/language/en_EN.interface.php b/language/en_EN.interface.php
index <HASH>..<HASH> 100644
--- a/language/en_EN.interface.php
+++ b/language/en_EN.interface.php
@@ -342,6 +342,8 @@ return [
'tr_meliscore_tool_platform_update_marketplace' => 'Allow updates from the marketplace',
'tr_meliscore_tool_platform_update_marketplace tooltip' => 'Check to allow updates from the marketplace or uncheck to disallow them',
'tr_meliscore_common_allow' => 'Allow',
+ 'tr_meliscore_tool_platform_invalid_platform_name' => 'The name of the platform can only contain letters and numbers, no spaces or special characters',
+
// Language Tool Translations
'tr_meliscore_tool_language' => 'Back-Office languages', | Missing enlish translation on platfrom validated added | melisplatform_melis-core | train | php |
8e10a1c93c354f71bf4122cd6d1931a57da06d47 | diff --git a/sources/scalac/backend/jvm/GenJVM.java b/sources/scalac/backend/jvm/GenJVM.java
index <HASH>..<HASH> 100644
--- a/sources/scalac/backend/jvm/GenJVM.java
+++ b/sources/scalac/backend/jvm/GenJVM.java
@@ -495,6 +495,12 @@ class GenJVM {
if (value instanceof Integer) {
generatedType = JType.INT;
ctx.code.emitPUSH((Integer)value);
+ } else if (value instanceof Short) {
+ generatedType = JType.SHORT;
+ ctx.code.emitPUSH((Short)value);
+ } else if (value instanceof Byte) {
+ generatedType = JType.BYTE;
+ ctx.code.emitPUSH((Byte)value);
} else if (value instanceof Long) {
generatedType = JType.LONG;
ctx.code.emitPUSH((Long)value); | I hacked the problem with Byte, Short, etc.
<I>% okay, but at least the programs do compile and run now. | scala_scala | train | java |
4426b017ca6bb256ff9f690a27623c7f942f1557 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -253,7 +253,7 @@ with open('README.rst', 'r', 'utf-8') as f:
setup(
name='yara-python',
- version='3.5.0',
+ version='3.6.0',
description='Python interface for YARA',
long_description=readme,
license='Apache 2.0', | Set version number to <I> | VirusTotal_yara-python | train | py |
0524bff0590b7cdcaa16de8cb9dbd71efeab11c0 | diff --git a/examples/angular-demo/app/js/neonDemoController.js b/examples/angular-demo/app/js/neonDemoController.js
index <HASH>..<HASH> 100644
--- a/examples/angular-demo/app/js/neonDemoController.js
+++ b/examples/angular-demo/app/js/neonDemoController.js
@@ -28,15 +28,6 @@ angular.module('neonDemo.controllers', []).controller('neonDemoController', ['$s
$scope.createFilters = false;
$scope.chartOptions = false;
$scope.filterCount = 0;
- $scope.versionString = 'test value';
-
- neon.util.infoUtils.getNeonVersion( function(result) {
- // Wrap this is timeout to push this update to the next $apply pass, since this runs while
- // other modules may be loading.
- $timeout(function() {
- $scope.versionString = result;
- })
- });
/**
* Simple toggle method for tracking whether or not the create filters tray should be visible. | Removing extraneous neon version request from the main controller. This has moved to the powered by neon directive. | NextCenturyCorporation_neon | train | js |
7a421e5ba7a6a9fedcb89e110632f249df17895b | diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java
index <HASH>..<HASH> 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/RuleActivator.java
@@ -130,13 +130,14 @@ public class RuleActivator {
persist(change, context, dbSession);
}
+ if (!changes.isEmpty()) {
+ updateProfileDates(dbSession, context);
+ }
+
if (!stopCascading) {
changes.addAll(propagateActivationToDescendants(dbSession, activation, context));
}
- if (!changes.isEmpty()) {
- updateProfileDates(dbSession, context);
- }
return changes;
} | SONAR-<I> Quality Profiles updates correctly when it has a child profile (#<I>) | SonarSource_sonarqube | train | java |
391430d041b33b5c632a27e7fa406a535c548679 | diff --git a/test/options.js b/test/options.js
index <HASH>..<HASH> 100644
--- a/test/options.js
+++ b/test/options.js
@@ -47,5 +47,11 @@ var uuidFirst = uuid.v1({
clockseq: 0,
node: [0, 0, 0, 0, 0, 0]
});
+var uuidLast = uuid.v1({
+ timestamp: 0,
+ clockseq: 0x3fff,
+ node: [0xff, 0xff, 0xff, 0xff, 0xff, 0xff]
+});
console.log(uuidFirst);
+console.log(uuidLast); | Add generation of last timestamp for a given millisecond interval to tests | kelektiv_node-uuid | train | js |
2e8d52e69aed03168ba3f6b6165e80c6ee731565 | diff --git a/bin/css-smash.js b/bin/css-smash.js
index <HASH>..<HASH> 100755
--- a/bin/css-smash.js
+++ b/bin/css-smash.js
@@ -1,6 +1,22 @@
#!/usr/bin/env node
-var css = require("../lib/css");
-var nopt = require("nopt");
+var css = require("../lib/css"),
+ nopt = require("nopt"),
+ knownOpts = {
+ },
+ shortHands = {
+ },
+ usage = "Usage: css-smash [options] <cssfile1> <cssfile2> <cssfile3> ...\n\nThis compresses each of the specified css files and outputs the compressed results. By default css-smash outputs to stdout.\n\nWhere the options are:\n\n\t-o, --output\n\t\tPath to output compressed CSS to.\n\nExamples:\n\n\tcss-smash my.css\n\tcss-smash -o smashed.css file1.css file2.css",
+ parsed = nopt(knownOpts, shortHands, process.argv);
-console.log("Hello!");
+function die(why) {
+ console.warn(why);
+ console.warn(usage);
+ process.exit(1);
+}
+
+if (!parsed.argv.remain.length) {
+ die("No files specified!");
+}
+
+console.log(parsed); | Add usage and option parsing to css-smash CLI. | MarkBennett_css-smasher | train | js |
d9179dbd812f3c4aae00cbca50d36a35f2f38560 | diff --git a/pypet/tests/run_coverage.py b/pypet/tests/run_coverage.py
index <HASH>..<HASH> 100644
--- a/pypet/tests/run_coverage.py
+++ b/pypet/tests/run_coverage.py
@@ -1,4 +1,38 @@
__author__ = 'Robert Meyer'
+
+import multiprocessing
+
+
+# Monkey Patch from here: https://bitbucket.org/ned/coveragepy/issue/117/enable-coverage-measurement-of-code-run-by
+def coverage_multiprocessing_process(): # pragma: no cover
+ try:
+ import coverage as _coverage
+ _coverage
+ except:
+ return
+
+ from coverage.collector import Collector
+ from coverage import coverage
+ # detect if coverage was running in forked process
+ if Collector._collectors:
+ original = multiprocessing.Process._bootstrap
+ class Process_WithCoverage(multiprocessing.Process):
+ def _bootstrap(self):
+ cov = coverage(data_suffix=True,config_file=os.environ['COVERAGE_PROCESS_START'])
+ cov.start()
+ try:
+ return original(self)
+ finally:
+ cov.stop()
+ cov.save()
+ return Process_WithCoverage
+
+ProcessCoverage = coverage_multiprocessing_process()
+if ProcessCoverage:
+ multiprocessing.Process = ProcessCoverage
+ print('Added Monkey-Patch for multiprocessing and code-coverage')
+
+
import sys
import os
pypetpath=os.path.abspath(os.getcwd()) | trying monkey-patched multiprocessing for coverage | SmokinCaterpillar_pypet | train | py |
88b3f12b32a2e87742c32e7f3b7e5a2899f12896 | diff --git a/src/serializers/paw/base-importer/BaseImporter.js b/src/serializers/paw/base-importer/BaseImporter.js
index <HASH>..<HASH> 100644
--- a/src/serializers/paw/base-importer/BaseImporter.js
+++ b/src/serializers/paw/base-importer/BaseImporter.js
@@ -303,7 +303,9 @@ export default class BaseImporter {
components.push(dv)
}
- components.push(ref.slice(baseIndex, ref.length))
+ components.push(this._unescapeURIFragment(
+ ref.slice(baseIndex, ref.length)
+ ))
return new DynamicString(...components)
} | end of string is now unescaped wrt to jsoin pointers | luckymarmot_API-Flow | train | js |
4586a5d70be43e8d0c76788a1d9dfd1f711e952c | diff --git a/src/Assert.php b/src/Assert.php
index <HASH>..<HASH> 100644
--- a/src/Assert.php
+++ b/src/Assert.php
@@ -811,7 +811,7 @@ class Assert
if (!preg_match('/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/', $value)) {
throw static::createInvalidArgumentException(sprintf(
- $message ?: 'Value "%s" is not a valid UUID.',
+ $message ?: 'Value %s is not a valid UUID.',
static::valueToString($value)
));
} | string quoted twice in uuid error message | webmozart_assert | train | php |
77c5f696afc14fd9b9104bda9aa89a708fedeb3b | diff --git a/test/tests-collection.js b/test/tests-collection.js
index <HASH>..<HASH> 100644
--- a/test/tests-collection.js
+++ b/test/tests-collection.js
@@ -552,4 +552,13 @@
ok(false, err.stack || err);
}).finally(start);
});
+
+ asyncTest("Issue #102 Passing an empty array to anyOf throws exception", function() {
+ db.users.where("username").anyOf([]).count(function(count) {
+ equal(count, 0, "Zarro items matched the query anyOf([])");
+ }).catch(function(err) {
+ ok(false, "Error when calling anyOf([]): " + err);
+ }).finally(start);
+ });
+
})();
\ No newline at end of file | Unit test for issue #<I>
Added a unit test to reproduce issue #<I>. However, the test passes
src/Dexie.js but not the minified version of latest stable. Need to
investigate whether this is a minification bug or something that has
been solved in another issue. | dfahlander_Dexie.js | train | js |
eba9834bb15bc0c09fcf8841f8441b11200e0156 | diff --git a/post-processor/vagrant/aws.go b/post-processor/vagrant/aws.go
index <HASH>..<HASH> 100644
--- a/post-processor/vagrant/aws.go
+++ b/post-processor/vagrant/aws.go
@@ -5,6 +5,7 @@ import (
"github.com/mitchellh/mapstructure"
"github.com/mitchellh/packer/packer"
"io/ioutil"
+ "log"
"os"
"path/filepath"
"strings"
@@ -75,6 +76,7 @@ func (p *AWSBoxPostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact
vagrantfileContents := defaultAWSVagrantfile
if p.config.VagrantfileTemplate != "" {
+ log.Printf("Using vagrantfile template: %s", p.config.VagrantfileTemplate)
f, err := os.Open(p.config.VagrantfileTemplate)
if err != nil {
return nil, false, err | post-processor/vagrant: Extra logging | hashicorp_packer | train | go |
ae99039e4d686de0999631828f6385378dc3b2a3 | diff --git a/src/helpers/helpers.dom.js b/src/helpers/helpers.dom.js
index <HASH>..<HASH> 100644
--- a/src/helpers/helpers.dom.js
+++ b/src/helpers/helpers.dom.js
@@ -80,6 +80,12 @@ function getConstraintHeight(domNode) {
function _calculatePadding(container, padding, parentDimension) {
padding = getStyle(container, padding);
+ // If the padding is not set at all and the node is not in the DOM, this can be an empty string
+ // In that case, we need to handle it as no padding
+ if (padding === '') {
+ return 0;
+ }
+
return padding.indexOf('%') > -1 ? parentDimension * parseInt(padding, 10) / 100 : parseInt(padding, 10);
} | When the container padding is an empty string, handle it as 0px (#<I>) | chartjs_Chart.js | train | js |
79f7fe69ef6d7d90fe8b7a52b9aa1bc05daa65b1 | diff --git a/zipline/transforms/utils.py b/zipline/transforms/utils.py
index <HASH>..<HASH> 100644
--- a/zipline/transforms/utils.py
+++ b/zipline/transforms/utils.py
@@ -136,7 +136,8 @@ class StatefulTransform(object):
log.info('Running StatefulTransform [%s]' % self.get_hash())
for message in stream_in:
# we only handle TRADE events.
- if message.type != DATASOURCE_TYPE.TRADE:
+ if (hasattr(message, 'type')
+ and message.type != DATASOURCE_TYPE.TRADE):
continue
# allow upstream generators to yield None to avoid
# blocking.
@@ -217,8 +218,8 @@ class EventWindow(object):
def update(self, event):
- if event.type != DATASOURCE_TYPE.TRADE:
- continue
+ if hasattr(event, 'type') and event.type != DATASOURCE_TYPE.TRADE:
+ return
self.assert_well_formed(event)
# Add new event and increment totals. | Checks to make sure that an Event has a type before checking type.
The Dividend event is currently missing 'type', causing the type
check to fail.
TODO: Add a type to Dividends. | quantopian_zipline | train | py |
e2fa99e45050d678838125e5bee83503496bf35a | diff --git a/drools-core/src/main/java/org/drools/core/rule/constraint/MvelConstraint.java b/drools-core/src/main/java/org/drools/core/rule/constraint/MvelConstraint.java
index <HASH>..<HASH> 100644
--- a/drools-core/src/main/java/org/drools/core/rule/constraint/MvelConstraint.java
+++ b/drools-core/src/main/java/org/drools/core/rule/constraint/MvelConstraint.java
@@ -735,7 +735,7 @@ public class MvelConstraint extends MutableTypeConstraint implements IndexableCo
return value2 == null;
}
if (value1 instanceof String) {
- return value1.equals(value2.toString());
+ return value2 != null && value1.equals(value2.toString());
}
return value1.equals( value2 );
} | [DROOLS-<I>] avoid NPE in MVELConstraint | kiegroup_drools | train | java |
9e34169616ce76e79c5bd2f2e442cd50672fc163 | diff --git a/test/unit/i_base_info_test.rb b/test/unit/i_base_info_test.rb
index <HASH>..<HASH> 100644
--- a/test/unit/i_base_info_test.rb
+++ b/test/unit/i_base_info_test.rb
@@ -1,11 +1,11 @@
require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
-describe GirFFI::IBaseInfo do
+describe GObjectIntrospection::IBaseInfo do
describe "#safe_name" do
it "makes names starting with an underscore safe" do
stub(ptr = Object.new).null? { false }
- info = GirFFI::IBaseInfo.wrap ptr
+ info = GObjectIntrospection::IBaseInfo.wrap ptr
stub(info).name { "_foo" } | Fix namespace of IBaseInfo in merged test. | mvz_gir_ffi | train | rb |
19f8e66d788a1fd4db0ea0c90de3a66415e37a2c | diff --git a/concrete/src/Filesystem/FileLocator/ThemeLocation.php b/concrete/src/Filesystem/FileLocator/ThemeLocation.php
index <HASH>..<HASH> 100644
--- a/concrete/src/Filesystem/FileLocator/ThemeLocation.php
+++ b/concrete/src/Filesystem/FileLocator/ThemeLocation.php
@@ -51,9 +51,12 @@ class ThemeLocation extends AbstractLocation
if ($this->pkgHandle) {
return DIR_REL
. '/'
+ . DIRNAME_PACKAGES
+ . '/'
. $this->pkgHandle
. '/'
. DIRNAME_THEMES
+ . '/'
. $this->themeHandle;
} else {
return DIR_REL . '/' . DIRNAME_THEMES . '/' . $this->themeHandle; | Fix URL of locator records in packaged themes | concrete5_concrete5 | train | php |
a3a632ad28de68eb375168f39639dc160fac067d | diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go
index <HASH>..<HASH> 100644
--- a/libcontainer/container_linux.go
+++ b/libcontainer/container_linux.go
@@ -600,9 +600,24 @@ func (c *linuxContainer) checkCriuFeatures(criuOpts *CriuOpts, rpcOpts *criurpc.
logrus.Debugf("Feature check says: %s", criuFeatures)
missingFeatures := false
- if *criuFeat.MemTrack && !*criuFeatures.MemTrack {
- missingFeatures = true
- logrus.Debugf("CRIU does not support MemTrack")
+ // The outer if checks if the fields actually exist
+ if (criuFeat.MemTrack != nil) &&
+ (criuFeatures.MemTrack != nil) {
+ // The inner if checks if they are set to true
+ if *criuFeat.MemTrack && !*criuFeatures.MemTrack {
+ missingFeatures = true
+ logrus.Debugf("CRIU does not support MemTrack")
+ }
+ }
+
+ // This needs to be repeated for every new feature check.
+ // Is there a way to put this in a function. Reflection?
+ if (criuFeat.LazyPages != nil) &&
+ (criuFeatures.LazyPages != nil) {
+ if *criuFeat.LazyPages && !*criuFeatures.LazyPages {
+ missingFeatures = true
+ logrus.Debugf("CRIU does not support LazyPages")
+ }
}
if missingFeatures { | checkpoint: add support to query for lazy page support
Before adding the actual lazy migration support, this adds the feature
check for lazy-pages. Right now lazy migration, which is based on
userfaultd is only available in the criu-dev branch and not yet in a
release. As the check does not dependent on a certain version but on
a CRIU feature which can be queried it can be part of runC without a new
version check depending on a feature from criu-dev. | opencontainers_runc | train | go |
026e1697e01aa24b0bde57fa7f66d9d53819f9ae | diff --git a/lib/fluent/test/input_test.rb b/lib/fluent/test/input_test.rb
index <HASH>..<HASH> 100644
--- a/lib/fluent/test/input_test.rb
+++ b/lib/fluent/test/input_test.rb
@@ -75,17 +75,17 @@ module Fluent
all
end
- def register_run_post_condition(proc)
- if proc.respond_to?(:call)
+ def register_run_post_condition(&block)
+ if block
@run_post_conditions ||= []
- @run_post_conditions << proc
+ @run_post_conditions << block
end
end
- def register_run_breaking_condition(proc)
- if proc.respond_to?(:call)
+ def register_run_breaking_condition(&block)
+ if block
@run_breaking_conditions ||= []
- @run_breaking_conditions << proc
+ @run_breaking_conditions << block
end
end
@@ -118,11 +118,17 @@ module Fluent
# Events of expected length will be emitted at the end.
max_length = @expected_emits_length
max_length ||= @expects.length if @expects
- register_run_post_condition(lambda { i == max_length }) if max_length
+ if max_length
+ register_run_post_condition do
+ i == max_length
+ end
+ end
# Set runnning timeout to avoid infinite loop caused by some errors.
started_at = Time.now
- register_run_breaking_condition(lambda { Time.now >= started_at + @run_timeout })
+ register_run_breaking_condition do
+ Time.now >= started_at + @run_timeout
+ end
until run_should_stop?
if j >= @emit_streams.length | Accept not a proc but a block as an argument | fluent_fluentd | train | rb |
Subsets and Splits