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 |
|---|---|---|---|---|---|
14be40e05a7822ed2f94bbad5dbf594a2fefdbd7 | diff --git a/helios-system-tests/src/main/java/com/spotify/helios/system/ZooKeeperCuratorFailoverTest.java b/helios-system-tests/src/main/java/com/spotify/helios/system/ZooKeeperCuratorFailoverTest.java
index <HASH>..<HASH> 100644
--- a/helios-system-tests/src/main/java/com/spotify/helios/system/ZooKeeperCuratorFailoverTest.java
+++ b/helios-system-tests/src/main/java/com/spotify/helios/system/ZooKeeperCuratorFailoverTest.java
@@ -27,6 +27,7 @@ import com.spotify.helios.ZooKeeperClusterTestManager;
import org.apache.zookeeper.KeeperException;
import org.junit.After;
import org.junit.Before;
+import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
@@ -35,6 +36,8 @@ import org.junit.runner.RunWith;
import static java.util.concurrent.TimeUnit.MINUTES;
import static org.junit.Assert.assertArrayEquals;
+@Ignore("This is an expensive test that tests the curator framework, not helios. " +
+ "It is disabled as it likely gives travis grief")
@RunWith(Parallelized.class)
public class ZooKeeperCuratorFailoverTest { | disable curator failover test
This test is only in there to build confidence that a three node
zookeeper can recover from losing a node.
It takes long time to run serially and spawns a lot of subprocesses
concurrently when run in parallel, so it likely causes problems on
travis. | spotify_helios | train | java |
4ac515fde468f8d0845ae68fa4416ed4525bce90 | diff --git a/docs/storage/layerwriter.go b/docs/storage/layerwriter.go
index <HASH>..<HASH> 100644
--- a/docs/storage/layerwriter.go
+++ b/docs/storage/layerwriter.go
@@ -109,6 +109,10 @@ func (lw *layerWriter) ReadFrom(r io.Reader) (n int64, err error) {
}
func (lw *layerWriter) Close() error {
+ if lw.err != nil {
+ return lw.err
+ }
+
if err := lw.storeHashState(); err != nil {
return err
} | Prevent Close() from being called after Finish() | docker_distribution | train | go |
9ce020b13d7cb5dc06d204831b98be4cafebfac4 | diff --git a/trailblazer/add/core.py b/trailblazer/add/core.py
index <HASH>..<HASH> 100644
--- a/trailblazer/add/core.py
+++ b/trailblazer/add/core.py
@@ -71,7 +71,7 @@ def parse_sampleinfo(sampleinfo):
analysis_type = 'exomes' if analysis_type_raw == 'wes' else 'genomes'
analysis_start = sampleinfo['analysis_date']
analysis_out = path(sampleinfo['log_file_dir']).parent
- customer = ped_data['customer']
+ customer = ped_data['owner']
case_id = "{}-{}".format(customer, fam_key)
config_path = analysis_out.joinpath("{}_config.yaml".format(fam_key))
sacct_path = "{}.status".format(sampleinfo['last_log_file_path']) | parse owner/cust from ped | Clinical-Genomics_trailblazer | train | py |
03dd051b9cae2b00b101c5e6ad89c618493572fc | diff --git a/src/Model/User.php b/src/Model/User.php
index <HASH>..<HASH> 100644
--- a/src/Model/User.php
+++ b/src/Model/User.php
@@ -9,7 +9,6 @@ use Phwoolcon\Model;
* @package Phwoolcon\Model
*
* @property Di $_dependencyInjector
- * @property Di $_dependencyInjector
* @method UserProfile|false getUserProfile()
* @method $this setUserProfile(UserProfile $profile)
*/ | docs: remove duplicated ide helper property in user model | phwoolcon_phwoolcon | train | php |
b245ca851c6d22c501594009b77aaa87240be654 | diff --git a/src/src/com/tns/AssetExtractor.java b/src/src/com/tns/AssetExtractor.java
index <HASH>..<HASH> 100644
--- a/src/src/com/tns/AssetExtractor.java
+++ b/src/src/com/tns/AssetExtractor.java
@@ -32,7 +32,7 @@ public class AssetExtractor
}
else if (extractPolicy.shouldExtract(context))
{
- String appRoot = context.getFilesDir().getPath() + "/";
+ String appRoot = context.getFilesDir().getPath() + File.separator;
String apkPath = context.getPackageCodePath();
boolean forceOverwrite = extractPolicy.forceOverwrite(); | little change on appRoot path generation | NativeScript_android-runtime | train | java |
c2b31487de2613821ca79a3f09b1bdf93d88db47 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -46,7 +46,7 @@ var letta = module.exports = function letta (fn, args) {
return
}
utils.relike.promise = letta.promise
- utils.relike.promisify(fn).apply(self, args).then(resolve, reject)
+ utils.relike.promisify.call(self, fn).apply(self, args).then(resolve, reject)
})
return normalizePromise(promise, Promize) | .call with context, close #6 | hybridables_letta | train | js |
27934b537a0e0f560b3831b4acb679700a29399d | diff --git a/server/resource_controller.go b/server/resource_controller.go
index <HASH>..<HASH> 100644
--- a/server/resource_controller.go
+++ b/server/resource_controller.go
@@ -167,7 +167,6 @@ func (rc *ResourceController) ConditionalUpdateHandler(c *gin.Context) {
c.Set("Resource", rc.Name)
c.Header("Location", responseURL(c.Request, rc.Name, id).String())
- c.Header("Access-Control-Allow-Origin", "*")
if createdNew {
c.Set("Action", "create")
c.JSON(http.StatusCreated, resource)
@@ -190,7 +189,6 @@ func (rc *ResourceController) DeleteHandler(c *gin.Context) {
c.Set("Resource", rc.Name)
c.Set("Action", "delete")
- c.Header("Access-Control-Allow-Origin", "*")
c.Status(http.StatusNoContent)
}
@@ -207,7 +205,6 @@ func (rc *ResourceController) ConditionalDeleteHandler(c *gin.Context) {
c.Set("Resource", rc.Name)
c.Set("Action", "delete")
- c.Header("Access-Control-Allow-Origin", "*")
c.Status(http.StatusNoContent)
} | Removed headers
Removed additional Access-Control-Allow-Origin headers that I missed on
the first pass. | intervention-engine_fhir | train | go |
14b5e23904988dfd4244e539dad97f71af7b43b7 | diff --git a/test/e2e/safari/webview/web-specs.js b/test/e2e/safari/webview/web-specs.js
index <HASH>..<HASH> 100644
--- a/test/e2e/safari/webview/web-specs.js
+++ b/test/e2e/safari/webview/web-specs.js
@@ -22,7 +22,7 @@ describe('Web', function () {
const args = [{
[elType]: 5000
}];
- driver.convertElementsForAtoms(args).should.eql([{ELEMENT: 123, [util.W3C_WEB_ELEMENT_IDENTIFIER]: 123}]);
+ driver.convertElementsForAtoms(args).should.eql([{ELEMENT: 123}]);
}
});
}); | Fix outdated test (#<I>) | appium_appium-ios-driver | train | js |
e8389ac9e88d11bf50ebb170ce27f1d9b43a7483 | diff --git a/lib/redlock/client.rb b/lib/redlock/client.rb
index <HASH>..<HASH> 100644
--- a/lib/redlock/client.rb
+++ b/lib/redlock/client.rb
@@ -118,8 +118,6 @@ module Redlock
else
@redis = Redis.new(connection)
end
-
- load_scripts
end
def lock(resource, val, ttl, allow_new_lock) | Don't load scripts on client initialization
The `recover_from_script_flush` block will load scripts if they're not
loaded yet, so there's no need to load the scripts for every new client
instantiation. The loads ought to be redundant more often than not. | leandromoreira_redlock-rb | train | rb |
7ba98929b87ee86582e4c0c840d2c7bcde4f5d1c | diff --git a/bootstrap-unexpected-markdown.js b/bootstrap-unexpected-markdown.js
index <HASH>..<HASH> 100644
--- a/bootstrap-unexpected-markdown.js
+++ b/bootstrap-unexpected-markdown.js
@@ -1,6 +1,7 @@
/*global unexpected:true*/
-unexpected = require('unexpected').clone();
-unexpected.use(require('./lib/unexpected-set'));
+unexpected = require('unexpected')
+ .clone()
+ .use(require('./lib/unexpected-set'));
unexpected.output.preferredWidth = 80;
require('es6-set/implement'); | Tidy up bootstrap-unexpected-markdown.js a bit | unexpectedjs_unexpected-set | train | js |
450e60ae592385237995415b6b032dc4f944f13c | diff --git a/spec/javascripts/vec3_spec.js b/spec/javascripts/vec3_spec.js
index <HASH>..<HASH> 100644
--- a/spec/javascripts/vec3_spec.js
+++ b/spec/javascripts/vec3_spec.js
@@ -16,4 +16,15 @@ describe("vec3", function() {
expect(vec[1]).toEqual(2);
expect(vec[2]).toEqual(3);
});
+
+ describe("set", function() {
+ beforeEach(function() { vec = vec3.create() });
+
+ it("should assign values", function() {
+ vec3.set([1,2,3], vec);
+ expect(vec[0]).toEqual(1);
+ expect(vec[1]).toEqual(2);
+ expect(vec[2]).toEqual(3);
+ });
+ });
}); | added test for vec3.set | toji_gl-matrix | train | js |
024a934722f91f05e80bf6901ace646d8e73b0a7 | diff --git a/src/Controller/Component/FilterComponent.php b/src/Controller/Component/FilterComponent.php
index <HASH>..<HASH> 100644
--- a/src/Controller/Component/FilterComponent.php
+++ b/src/Controller/Component/FilterComponent.php
@@ -656,7 +656,7 @@ class FilterComponent extends Component
$sortField['custom'] = [$sortField['custom']];
}
foreach ($sortField['custom'] as $sortEntry) {
- $options['order'][] = $sortEntry;
+ $options['order'][] = preg_replace('/:dir/', $dir, $sortEntry);
}
} else {
$options['order'][] = $sortField['modelField'] . ' ' . $dir; | enable dynamic sort directions for custom sort options by using ":dir" | frankfoerster_cakephp-filter | train | php |
8419fed3ed8ccf1272bb5910cb5678ee37725caf | diff --git a/install-pngcrush.js b/install-pngcrush.js
index <HASH>..<HASH> 100755
--- a/install-pngcrush.js
+++ b/install-pngcrush.js
@@ -9,7 +9,7 @@
// Credit to Obvious Corp for finding this fix.
var originalPath = process.env.PATH;
// NPM adds bin directories to the path, which will cause `which` to find the
- // bin for this package not the actual phantomjs bin.
+ // bin for this package not the actual pngcrush bin.
process.env.PATH = originalPath.replace(/:[^:]*node_modules[^:]*/g, '');
try { | This comment was kept because the code was found by somebody else, changing the comment slightly | jefflembeck_pngcrush-installer | train | js |
8dbada8f06b196b3950ff10a5adb46d8a2691d09 | diff --git a/dtool_create/dataset.py b/dtool_create/dataset.py
index <HASH>..<HASH> 100644
--- a/dtool_create/dataset.py
+++ b/dtool_create/dataset.py
@@ -329,6 +329,12 @@ def show(dataset_uri):
@proto_dataset_uri_argument
@click.argument('input', type=click.File('r'))
def write(proto_dataset_uri, input):
+ """Use YAML from a file or stdin to populate the readme.
+
+ To stream content from stdin use "-", e.g.
+
+ echo "desc: my data" | dtool readme write <DS_URI> -
+ """
proto_dataset = dtoolcore.ProtoDataSet.from_uri(
uri=proto_dataset_uri
) | Add docstring to 'dtool readme write' | jic-dtool_dtool-create | train | py |
84d4aa5488930ccc1d33843998600835440397d7 | diff --git a/db/migrate/20150331132115_remove_old_permissions.rb b/db/migrate/20150331132115_remove_old_permissions.rb
index <HASH>..<HASH> 100644
--- a/db/migrate/20150331132115_remove_old_permissions.rb
+++ b/db/migrate/20150331132115_remove_old_permissions.rb
@@ -2,12 +2,12 @@ class RemoveOldPermissions < ActiveRecord::Migration
def up
# remove invalid permissions causing http://projects.theforeman.org/issues/9963
perms = Permission.where("name like '%_discovered_hosts' and resource_type is null").destroy_all
- puts "Removed invalid permissions: #{perms.inspect}" if perms.size > 0
+ say "Removed invalid permissions: #{perms.inspect}" if perms.size > 0
# unassociate and remove unused role "Discovery" (renamed to "Discovery Manager")
if old_role = Role.where(:name => "Discovery").first
UserRole.where(:role_id => old_role.id).destroy_all
- puts "Role 'Discovery' was removed, use 'Discovery Manager' instead" if old_role.destroy
+ say "Role 'Discovery' was removed, use 'Discovery Manager' instead" if old_role.destroy
end
end | Refs #<I> - changing puts to say in permissions migration | theforeman_foreman_discovery | train | rb |
d4e5feb3fa2f9d574915e665d5b78233d0297766 | diff --git a/lib/websearch_external_collections_getter_tests.py b/lib/websearch_external_collections_getter_tests.py
index <HASH>..<HASH> 100644
--- a/lib/websearch_external_collections_getter_tests.py
+++ b/lib/websearch_external_collections_getter_tests.py
@@ -39,8 +39,9 @@ class AsyncDownloadTest(unittest.TestCase):
## - test 1 unresolvable name : rjfreijoiregjreoijgoirg.fr
## - test 1 bad ip : 1.2.3.4
## Return the list of errors.
-
- checks = [ {'url': 'http://public.web.cern.ch/public/', 'content': "<title>CERN - The world's largest particle physics laboratory</title>"},
+ # {'url': 'http://public.web.cern.ch/public/', 'content': "<title>CERN - The world's largest particle physics laboratory</title>"},
+ checks = [
+ {'url': 'http://cdsware.cern.ch/invenio/index.html', 'content': '<title>CDS Invenio: Overview</title>'},
{'url': 'http://cdsware.cern.ch/invenio/index.html', 'content': '<title>CDS Invenio: Overview</title>'},
{'url': 'http://rjfreijoiregjreoijgoirg.fr'},
{'url': 'http://1.2.3.4/'} ] | demobibdata with citation stuff. adjusted the tests | inveniosoftware_invenio-records | train | py |
a18e9f52f553f49edd08f6ed6366778a5ab9ca59 | diff --git a/crawler.js b/crawler.js
index <HASH>..<HASH> 100644
--- a/crawler.js
+++ b/crawler.js
@@ -174,6 +174,9 @@ Crawler.prototype._crawlUrl = function(url, referer, depth) {
if ((depth === 0) || this.knownUrls[url]) {
return;
}
+
+ this.knownUrls[url] = true;
+
var self = this;
this._startedCrawling(url);
@@ -189,7 +192,6 @@ Crawler.prototype._crawlUrl = function(url, referer, depth) {
//If no redirects, then response.request.uri.href === url, otherwise last url
var lastUrlInRedirectChain = response.request.uri.href;
if (self.shouldCrawl(lastUrlInRedirectChain)) {
- self.knownUrls[url] = true;
_.each(this.redirects, function(redirect) {
self.knownUrls[redirect.redirectUri] = true;
}); | Sets knownUrls immediately in _crawlUrl to avoid re-crawling failed urls | antivanov_js-crawler | train | js |
50a409f8dd2e17b4f83507b5d67f4a3210621376 | diff --git a/dataviews/options.py b/dataviews/options.py
index <HASH>..<HASH> 100644
--- a/dataviews/options.py
+++ b/dataviews/options.py
@@ -128,12 +128,14 @@ class Options(object):
def __call__(self, obj):
- if not hasattr(obj, 'style'):
- raise Exception('Supplied object requires style attribute.')
+
+ if isinstance(obj, str):
+ name = obj
elif isinstance(obj.style, list):
return self.opt_type()
+ else:
+ name = obj.style
- name = obj.style
matches = sorted((len(key), style) for key, style in self._items.items()
if name.endswith(key))
if matches == []: | Options can now be generated by string in __call__ methods | pyviz_holoviews | train | py |
f183afbe9d7e4e4551ccb266a850db13d6afdf06 | diff --git a/brother_ql/raster.py b/brother_ql/raster.py
index <HASH>..<HASH> 100644
--- a/brother_ql/raster.py
+++ b/brother_ql/raster.py
@@ -186,7 +186,7 @@ class BrotherQLRaster(object):
def add_raster_data(self, image, second_image=None):
""" image: Pillow Image() """
- logger.info("raster_image_size: {0}x{1}".format(*image.size))
+ logger.debug("raster_image_size: {0}x{1}".format(*image.size))
if image.size[0] != self.get_pixel_width():
fmt = 'Wrong pixel width: {}, expected {}'
raise BrotherQLRasterError(fmt.format(image.size[0], self.get_pixel_width())) | BrotherQLRaster: log raster_image_size as debug, not info | pklaus_brother_ql | train | py |
8363feeef23aca83cebc8b3a1dcd6802398f5ced | diff --git a/codebase/base_connector.php b/codebase/base_connector.php
index <HASH>..<HASH> 100644
--- a/codebase/base_connector.php
+++ b/codebase/base_connector.php
@@ -230,7 +230,7 @@ class DataItem{
@return
escaped string
*/
- protected function xmlentities($string) {
+ public function xmlentities($string) {
return str_replace( array( '&', '"', "'", '<', '>', '’' ), array( '&' , '"', ''' , '<' , '>', ''' ), $string);
} | [fix] set xmlentities to public, must fix some backward compatibility issues | DHTMLX_connector-php | train | php |
7063952671e8bedafd77f82ba27f024ed7b11869 | diff --git a/tests/unit/Codeception/Module/BeanstalkdTest.php b/tests/unit/Codeception/Module/BeanstalkdTest.php
index <HASH>..<HASH> 100644
--- a/tests/unit/Codeception/Module/BeanstalkdTest.php
+++ b/tests/unit/Codeception/Module/BeanstalkdTest.php
@@ -19,7 +19,7 @@ class Beanstalkd_Test extends \PHPUnit_Framework_TestCase
{
$this->module = new \Codeception\Module\Queue(make_container());
$this->module->_setConfig($this->config);
- $this->module->_before(Stub::makeEmpty('\Codeception\TestCase'));
+ $this->module->_before(Stub::makeEmpty('\Codeception\TestInterface'));
try {
$this->module->clearQueue('default');
} catch (ConnectionException $e) { | Pass correct stub to _before hook of Beanstalkd module | Codeception_base | train | php |
1de81725eb44e712cc5ea259fc211ac0bc14fcc3 | diff --git a/lib/Doctrine/DBAL/Migrations/Version.php b/lib/Doctrine/DBAL/Migrations/Version.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/DBAL/Migrations/Version.php
+++ b/lib/Doctrine/DBAL/Migrations/Version.php
@@ -148,8 +148,18 @@ class Version
public function markMigrated()
{
+ $this->markVersion('up');
+ }
+
+ private function markVersion($direction)
+ {
+ if ($direction == 'up') {
+ $action = 'insert';
+ } else {
+ $action = 'delete';
+ }
$this->configuration->createMigrationTable();
- $this->connection->insert(
+ $this->connection->$action(
$this->configuration->getMigrationsTableName(),
[$this->configuration->getMigrationsColumnName() => $this->version]
);
@@ -157,11 +167,7 @@ class Version
public function markNotMigrated()
{
- $this->configuration->createMigrationTable();
- $this->connection->delete(
- $this->configuration->getMigrationsTableName(),
- [$this->configuration->getMigrationsColumnName() => $this->version]
- );
+ $this->markVersion('down');
}
/** | refactoring the mark version migrated / not migrated code | doctrine_migrations | train | php |
3fee22c15bb8dd5e5fd304ac76bd66c44b1f36fe | diff --git a/tests/gui/widget/test_history.py b/tests/gui/widget/test_history.py
index <HASH>..<HASH> 100644
--- a/tests/gui/widget/test_history.py
+++ b/tests/gui/widget/test_history.py
@@ -181,6 +181,7 @@ def create_sm_model(with_gui=False, add_state_machine=False):
# TODO introduce test_add_remove_history with_gui=True to have a more reliable unit-test
def test_add_remove_history(caplog):
+ testing_utils.dummy_gui(None)
##################
# Root_state elements | fix(test_history): Add missing call to dummy_gui in test_add_remove_hist | DLR-RM_RAFCON | train | py |
9e015ce05d113628e76308bc3f4fe5b12359a3b1 | diff --git a/src/Munee/Asset/Type/Css.php b/src/Munee/Asset/Type/Css.php
index <HASH>..<HASH> 100644
--- a/src/Munee/Asset/Type/Css.php
+++ b/src/Munee/Asset/Type/Css.php
@@ -173,7 +173,8 @@ class Css extends Type
$changedContent = preg_replace_callback($regEx, function ($match) use ($originalFile, $webroot) {
$filePath = trim($match[2]);
// Skip conversion if the first character is a '/' since it's already an absolute path
- if ($filePath[0] !== '/') {
+ // Also skip conversion if the string has an protocol in url
+ if ($filePath[0] !== '/' && strpos($filePath, '://') === false) {
$basePath = SUB_FOLDER . str_replace($webroot, '', dirname($originalFile));
$basePathParts = array_reverse(array_filter(explode('/', $basePath)));
$numOfRecursiveDirs = substr_count($filePath, '../'); | Ignore urls with protocols in CSS. | meenie_munee | train | php |
21e9b3123f32f086f2f276e5513a4dba5fae260b | diff --git a/help_text.php b/help_text.php
index <HASH>..<HASH> 100644
--- a/help_text.php
+++ b/help_text.php
@@ -31,9 +31,7 @@
define('WT_SCRIPT_NAME', 'help_text.php');
require './includes/session.php';
-Zend_Session::writeClose();
-
-$controller=new WT_Controller_Simple();
+$controller=new WT_Controller_Ajax();
$help=safe_GET('help');
switch ($help) {
@@ -1862,11 +1860,7 @@ default:
break;
}
-$controller->setPageTitle($title);
$controller->pageHeader();
echo '<div class="helpheader">', $title, '</div>';
echo '<div class="helpcontent">', $text,'</div>';
-//echo '<div class="helpfooter">';
-//echo '<a href="#" onclick="window.close();">', WT_I18N::translate('Close Window'), '</a>';
-// '</div>'; | help_text.php is now an AJAX response, rather than a popup window, so send the correct headers. | fisharebest_webtrees | train | php |
5a618132e1f5475a5cd1899f467a7cc81b610372 | diff --git a/dolo/compiler/compiler_python.py b/dolo/compiler/compiler_python.py
index <HASH>..<HASH> 100644
--- a/dolo/compiler/compiler_python.py
+++ b/dolo/compiler/compiler_python.py
@@ -25,6 +25,7 @@ class GModel(object):
calibration = None
functions = None
symbols = None
+ infos = dict()
@property
def variables(self):
@@ -56,6 +57,11 @@ class GModel(object):
self.model_type = self.recipe['model_type']
+ self.infos['model_type'] = self.model_type
+ self.infos['data_layout'] = order
+
+ # TODO: find a good name to replace "data_layout"
+
self.__create_functions__(compiler, order=order)
def __create_functions__(self, compiler, order='rows'): | Added infos structure to python models. | EconForge_dolo | train | py |
7a360b9e1daf1992efc532a50a6c1f3279677564 | diff --git a/test_schema.py b/test_schema.py
index <HASH>..<HASH> 100644
--- a/test_schema.py
+++ b/test_schema.py
@@ -445,8 +445,6 @@ def test_optional_key_convert_failed_randomly_while_with_another_optional_object
'created_at': '2015-10-10 00:00:00'
}
validated_data = s.validate(data)
- if not isinstance(validated_data['created_at'], datetime.datetime):
- print "'Optiona(created_at)'convert failed at {count}".format(count=i+1)
# is expected to be converted to a datetime instance, but fails randomly(most of the time)
assert isinstance(validated_data['created_at'], datetime.datetime)
# assert isinstance(validated_data['created_at'], basestring) | Remove print for py3+ | keleshev_schema | train | py |
22ab50aa7e05c7df16c51b30c3ff02391c8d4979 | diff --git a/pkg/drivers/kvm/gpu.go b/pkg/drivers/kvm/gpu.go
index <HASH>..<HASH> 100644
--- a/pkg/drivers/kvm/gpu.go
+++ b/pkg/drivers/kvm/gpu.go
@@ -62,7 +62,7 @@ type PCIDevice struct {
func getDevicesXML() (string, error) {
unboundNVIDIADevices, err := getPassthroughableNVIDIADevices()
if err != nil {
- return "", fmt.Errorf("coundn't generate devices XML: %v", err)
+ return "", fmt.Errorf("couldn't generate devices XML: %v", err)
}
var pciDevices []PCIDevice
for _, device := range unboundNVIDIADevices { | Correct typo in the returned message
coundn't->couldn't | kubernetes_minikube | train | go |
47d53c48fc2697160a297f62e350af58a4ef54b9 | diff --git a/lib/extract_jwt.js b/lib/extract_jwt.js
index <HASH>..<HASH> 100644
--- a/lib/extract_jwt.js
+++ b/lib/extract_jwt.js
@@ -40,7 +40,7 @@ extractors.fromUrlQueryParameter = function (param_name) {
return function (request) {
var token = null,
parsed_url = url.parse(request.url, true);
- if (parsed_url.query && parsed_url.query.hasOwnProperty(param_name)) {
+ if (parsed_url.query && Object.prototype.hasOwnProperty.call(parsed_url.query, param_name)) {
token = parsed_url.query[param_name];
}
return token; | Switch to using hasOwnProperty from the object prototype since the response from url.parse no longer inherits from it. | mikenicholson_passport-jwt | train | js |
474a1a076606bf40e1bbb8dd5cab3e8daf063dbb | diff --git a/src/Ouzo/Goodies/Tests/CatchException.php b/src/Ouzo/Goodies/Tests/CatchException.php
index <HASH>..<HASH> 100644
--- a/src/Ouzo/Goodies/Tests/CatchException.php
+++ b/src/Ouzo/Goodies/Tests/CatchException.php
@@ -8,6 +8,22 @@ namespace Ouzo\Tests;
use Throwable;
+/**
+ * Class CatchException can be used as alternative to try{...}catch(...){...} block in tests.
+ * It can be used in presented way:
+ *
+ * class ThrowableClass{
+ * public function throwableMethod(){...}
+ * }
+ *
+ * $throwableObject = new ThrowableClass();
+ *
+ * CatchException::when($throwableObject)->throwableMethod();
+ *
+ * CatchException::assertThat()->isInstanceOf(ThrowableClass::class);
+ *
+ * @package Ouzo\Tests
+ */
class CatchException
{
/** @var Throwable|null */ | Few words of docs in CatchException class | letsdrink_ouzo | train | php |
249f33da163f6dc634f5513ec15934e26f5188d9 | diff --git a/lib/manager.js b/lib/manager.js
index <HASH>..<HASH> 100644
--- a/lib/manager.js
+++ b/lib/manager.js
@@ -1,4 +1,3 @@
-
/*!
* socket.io-node
* Copyright(c) 2011 LearnBoost <dev@learnboost.com>
@@ -821,9 +820,9 @@ Manager.prototype.handshakeData = function (data) {
, connectionAddress;
if (connection.address) {
- connectionAddress = connection.address();
+ connectionAddress = connection.remoteAddress; // Bug fix, returns client IP instead of .address() which was returning server IP
} else if (connection.socket && connection.socket.address) {
- connectionAddress = connection.socket.address()
+ connectionAddress = connection.socket.address(); // Do we need .remoteAddress here too?
}
return { | Updated Manager.prototype.handshakeData to provide connection.remoteAddress instead of .address() because .address() was returning server IP and .remoteAddress returns client IP. | socketio_socket.io | train | js |
94160de8601665b64fad9be7fbd80a4357d918d1 | diff --git a/client/request.php b/client/request.php
index <HASH>..<HASH> 100644
--- a/client/request.php
+++ b/client/request.php
@@ -21,7 +21,9 @@ class Request {
// ensure params are utf8
if ($params !== null) {
foreach ($params as &$param) {
- $param = utf8_encode($param);
+ if(is_string($param)){
+ $param = utf8_encode($param);
+ }
}
} | Only UTF8 encode strings to preserve other data types | EvilScott_junior | train | php |
966c41ac7f0890401a2e3d4d4c38f1667122b58d | diff --git a/scapy/volatile.py b/scapy/volatile.py
index <HASH>..<HASH> 100644
--- a/scapy/volatile.py
+++ b/scapy/volatile.py
@@ -295,7 +295,7 @@ class RandIP6(RandString):
remain = random.randint(0,remain)
for j in range(remain):
ip.append("%04x" % random.randint(0,65535))
- if n == 0:
+ elif n == 0:
ip.append("0")
elif not n:
ip.append("") | RandIP6() with default '**' fails, this seems to do the right thing | phaethon_kamene | train | py |
053068c65b95a2703a161bda54519a56bd20e25c | diff --git a/clam/clamdispatcher.py b/clam/clamdispatcher.py
index <HASH>..<HASH> 100755
--- a/clam/clamdispatcher.py
+++ b/clam/clamdispatcher.py
@@ -261,6 +261,7 @@ def main():
if os.path.exists(projectdir + '.pid'): os.unlink(projectdir + '.pid')
#update project index cache
+ print("[CLAM Dispatcher] Updating project index", file=sys.stderr)
updateindex(projectdir) | a bit more verbosity | proycon_clam | train | py |
a75b7857be983aff9aa19a591d97382d384a62c9 | diff --git a/server/sonar-web/src/main/js/apps/issues/models/issue.js b/server/sonar-web/src/main/js/apps/issues/models/issue.js
index <HASH>..<HASH> 100644
--- a/server/sonar-web/src/main/js/apps/issues/models/issue.js
+++ b/server/sonar-web/src/main/js/apps/issues/models/issue.js
@@ -4,9 +4,7 @@ define([
return Issue.extend({
reset: function (attrs, options) {
- // TODO remove me soon
- var keepFields = ['index', 'selected', 'componentUuid', 'componentLongName', 'componentQualifier',
- 'projectLongName', 'projectUuid', 'ruleName', 'comments'];
+ var keepFields = ['index', 'selected', 'comments'];
keepFields.forEach(function (field) {
attrs[field] = this.get(field);
}.bind(this)); | SONAR-<I> decrease the list of kept issue fields | SonarSource_sonarqube | train | js |
661a0cca2317c66e7e560f107e5afc6d1fd5fb01 | diff --git a/lib/Cake/Console/Command/Task/ProjectTask.php b/lib/Cake/Console/Command/Task/ProjectTask.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/Console/Command/Task/ProjectTask.php
+++ b/lib/Cake/Console/Command/Task/ProjectTask.php
@@ -388,7 +388,7 @@ class ProjectTask extends Shell {
))->addOption('empty', array(
'help' => __d('cake_console', 'Create empty files in each of the directories. Good if you are using git')
))->addOption('skel', array(
- 'default' => current(App::core('Console')) . DS . 'templates' . DS . 'skel',
+ 'default' => current(App::core('Console')) . 'templates' . DS . 'skel',
'help' => __d('cake_console', 'The directory layout to use for the new application skeleton. Defaults to cake/console/templates/skel of CakePHP used to create the project.')
));
} | removing DS, App::core('Console') already ends with DS | cakephp_cakephp | train | php |
13e7f8a082d8b1a70779bd2591ba01678f040ff9 | diff --git a/test/ssl_test.js b/test/ssl_test.js
index <HASH>..<HASH> 100644
--- a/test/ssl_test.js
+++ b/test/ssl_test.js
@@ -126,7 +126,7 @@ test('before cert expiration, fallback to newest cert bundle and stick if node d
TestHelper.config.instrumental.tlsVariationTimeout = 500;
- var timeBetweenSends = 1000;
+ var timeBetweenSends = 2000;
var actions = [];
// node default certs
@@ -229,7 +229,7 @@ test('after cert expiration, fallback to newest cert bundle and stick if node de
TestHelper.config.instrumental.tlsVariationTimeout = 500;
- var timeBetweenSends = 1000;
+ var timeBetweenSends = 2000;
var actions = [];
// node default certs | Fix intermittent test failures
There seems to be occasional failures with these tests related to timing
issues. This adds some additional buffer time and seems to resolve the
issues. | Instrumental_statsd-instrumental-backend | train | js |
323ecbbb06781c753d5db4d531dda001d655eb77 | diff --git a/core/core.js b/core/core.js
index <HASH>..<HASH> 100644
--- a/core/core.js
+++ b/core/core.js
@@ -428,7 +428,8 @@ exports._setup = function() {
_globals.core.Item.prototype.addChild = function(child) {
_globals.core.Object.prototype.addChild.apply(this, arguments)
if ('_tryFocus' in child)
- child._tryFocus()
+ if (child._tryFocus())
+ this._propagateFocusToParents()
}
_globals.core.Item.prototype._update = function(name, value) {
@@ -502,7 +503,7 @@ exports._setup = function() {
_globals.core.Item.prototype._propagateFocusToParents = function() {
var item = this;
- while(item.parent && !item.parent.focusedChild) {
+ while(item.parent && (!item.parent.focusedChild || !item.parent.focusedChild.visible)) {
item.parent._focusChild(item)
item = item.parent
} | propagate focus over invisible childs and from addChild | pureqml_qmlcore | train | js |
72b5290182611d0900d194cb14ffc75951c64f16 | diff --git a/classes/Tools/Storage/StorageTool.php b/classes/Tools/Storage/StorageTool.php
index <HASH>..<HASH> 100755
--- a/classes/Tools/Storage/StorageTool.php
+++ b/classes/Tools/Storage/StorageTool.php
@@ -3011,7 +3011,11 @@ class StorageTool extends Tool
public function handleSmushImageOptimizer( $postId, $stats )
{
- $this->handleImageOptimizer( $postId );
+ // wp_smush_image_optimised runs inside of a wp_update_attachment_metadata
+ // filter hook, so any metadata written by processImport will be overwritten.
+ // We'll use the standard handleUpdateAttachmentMetadata() method to handle
+ // the upload instead.
+ $this->processingOptimized = true;
}
public function handleImagifyImageOptimizer( $postId, $data ) | fix: Media Cloud metadata is not saved when Smush is active
fixes #<I> | Interfacelab_ilab-media-tools | train | php |
cb55136fa97a78a6e6cf8bdc483c30fe2eb562e6 | diff --git a/fakeca_test.go b/fakeca_test.go
index <HASH>..<HASH> 100644
--- a/fakeca_test.go
+++ b/fakeca_test.go
@@ -155,7 +155,10 @@ func TestPFX(t *testing.T) {
}
func assertNoPanic(t *testing.T, cb func()) {
- t.Helper()
+ // Check that t.Helper() is defined for Go<1.9
+ if h, ok := interface{}(t).(interface{ Helper() }); ok {
+ h.Helper()
+ }
defer func() {
if r := recover(); r != nil { | *testing.T doesn't have Helper() method before go <I> | mastahyeti_fakeca | train | go |
3df97da0d286f68a90d8ee49ecfacd0be448b3df | diff --git a/lib/comfortable_mexican_sofa/form_builder.rb b/lib/comfortable_mexican_sofa/form_builder.rb
index <HASH>..<HASH> 100644
--- a/lib/comfortable_mexican_sofa/form_builder.rb
+++ b/lib/comfortable_mexican_sofa/form_builder.rb
@@ -43,7 +43,7 @@ class ComfortableMexicanSofa::FormBuilder < ActionView::Helpers::FormBuilder
end
def label_for(field, options={})
- label = options.delete(:label) || object.class.human_attribute_name(field).capitalize
+ label = options.delete(:label) || object.class.human_attribute_name(field)
for_value = options[:id] || "#{object_name}_#{field}"
%Q{<label for="#{for_value}">#{label}</label>}.html_safe
end | Removed annoying capitalize from labels in sofa's form builder. | comfy_comfortable-mexican-sofa | train | rb |
f0bd11497167d16d99d05202a34e2746b74d57fc | diff --git a/lib/mongodb/connection/connection.js b/lib/mongodb/connection/connection.js
index <HASH>..<HASH> 100644
--- a/lib/mongodb/connection/connection.js
+++ b/lib/mongodb/connection/connection.js
@@ -12,7 +12,7 @@ var Connection = exports.Connection = function(id, socketOptions) {
// Store all socket options
this.socketOptions = socketOptions ? socketOptions : {host:'localhost', port:27017, domainSocket:false};
// Set keep alive default if not overriden
- if(!this.socketOptions.keepAlive && process.platform !== "sunos") this.socketOptions.keepAlive = 100;
+ if(!this.socketOptions.keepAlive && (process.platform !== "sunos" || process.platform !== "win32")) this.socketOptions.keepAlive = 100;
// Id for the connection
this.id = id;
// State of the connection | disabled keepalive by default for win<I> | mongodb_node-mongodb-native | train | js |
3dc7f234695816bc9994be4ee98dce78f6a3b903 | diff --git a/shoebot/data/bezier.py b/shoebot/data/bezier.py
index <HASH>..<HASH> 100644
--- a/shoebot/data/bezier.py
+++ b/shoebot/data/bezier.py
@@ -272,7 +272,7 @@ class ClippingPath(BezierPath):
class EndClip(Grob):
def __init__(self, canvas, **kwargs):
- Grob.__init__(canvas = canvas)
+ Grob.__init__(self, canvas = canvas)
def _render(self, ctx):
pass | Wasn't passing self to EndClip | shoebot_shoebot | train | py |
3314ab16c0d14fe3bf0a9c5739dfcd0bdc84f3c6 | diff --git a/scripts/merge-pr.py b/scripts/merge-pr.py
index <HASH>..<HASH> 100755
--- a/scripts/merge-pr.py
+++ b/scripts/merge-pr.py
@@ -297,11 +297,17 @@ if not bool(pr["mergeable"]):
continue_maybe(msg)
print("\n=== Pull Request #%s ===" % pr_num)
+
+# we may have un-printable unicode in our title
+try:
+ title = title.encode('raw_unicode_escape')
+except Exception:
+ pass
+
print("title\t{title}\nsource\t{source}\ntarget\t{target}\nurl\t{url}".format(
title=title, source=pr_repo_desc, target=target_ref, url=url))
-
merged_refs = [target_ref]
print("\nProceed with updating or merging pull request #%s?" % pr_num) | ADMIN: edit in merge-pr script to handle unicode titles | pandas-dev_pandas | train | py |
88fd6beeae2d292a7860e10a8868359765a2b96c | diff --git a/src/actions/GlideAction.php b/src/actions/GlideAction.php
index <HASH>..<HASH> 100644
--- a/src/actions/GlideAction.php
+++ b/src/actions/GlideAction.php
@@ -5,6 +5,7 @@ namespace trntv\glide\actions;
use Symfony\Component\HttpFoundation\Request;
use Yii;
use yii\base\Action;
+use yii\web\Response;
use yii\base\NotSupportedException;
use yii\web\BadRequestHttpException;
use yii\web\NotFoundHttpException;
@@ -39,6 +40,7 @@ class GlideAction extends Action
}
try {
+ Yii::$app->getResponse()->format = Response::FORMAT_RAW;
$this->getServer()->outputImage($path, Yii::$app->request->get());
} catch (\Exception $e) {
throw new NotSupportedException($e->getMessage()); | fix image show problem
directly browser url like '<URL> | trntv_yii2-glide | train | php |
b2f2a4682f954302f08f7baeb5290aaf6835ffa0 | diff --git a/test/timezone_test.rb b/test/timezone_test.rb
index <HASH>..<HASH> 100644
--- a/test/timezone_test.rb
+++ b/test/timezone_test.rb
@@ -33,6 +33,7 @@ class TimezoneTest < Test::Unit::TestCase
def test_getting_utc_offset
assert_equal 36000, Timezone::Zone.new(:zone => 'Australia/Sydney').utc_offset
assert_equal -28800, Timezone::Zone.new(:zone => 'America/Los_Angeles').utc_offset
+ assert_equal 20700, Timezone::Zone.new(:zone => 'Asia/Kathmandu').utc_offset
end
def test_loading_GMT_timezone | Added a test for utc_offset in half zones as well. | panthomakos_timezone | train | rb |
7f519a08ebcc2f36a001b9c63dcb47d3c4f8ec76 | diff --git a/cassandra/query.py b/cassandra/query.py
index <HASH>..<HASH> 100644
--- a/cassandra/query.py
+++ b/cassandra/query.py
@@ -100,8 +100,8 @@ class Statement(object):
def _set_routing_key(self, key):
if isinstance(key, (list, tuple)):
- self._routing_key = "".join(struct.pack("HsB", len(component), component, 0)
- for component in key)
+ self._routing_key = b"".join(struct.pack("HsB", len(component), component, 0)
+ for component in key)
else:
self._routing_key = key
@@ -358,7 +358,7 @@ class BoundStatement(Statement):
val = self.values[statement_index]
components.append(struct.pack("HsB", len(val), val, 0))
- self._routing_key = "".join(components)
+ self._routing_key = b"".join(components)
return self._routing_key | Use bytes literals for joining routing key components | datastax_python-driver | train | py |
464a187c889dae0dde9e84f1acf8517ebb4e4c8e | diff --git a/entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java b/entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java
index <HASH>..<HASH> 100644
--- a/entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java
+++ b/entity-store/src/main/java/jetbrains/exodus/entitystore/PersistentEntityStoreImpl.java
@@ -1701,6 +1701,7 @@ public class PersistentEntityStoreImpl implements PersistentEntityStore, FlushLo
}
entityTypes.logOperations(txn, flushLog);
propertyIds.logOperations(txn, flushLog);
+ propertyCustomTypeIds.logOperations(txn, flushLog);
linkIds.logOperations(txn, flushLog);
for (final TableCreationOperation op : tableCreationLog) {
op.persist(txn); | #XD-<I> fixed | JetBrains_xodus | train | java |
8bade13dca52a30c8f301cbc09e850ecc0e99d82 | diff --git a/tests/test_apps/kafkaimporter/client/kafkaimporter/KafkaImportBenchmark.java b/tests/test_apps/kafkaimporter/client/kafkaimporter/KafkaImportBenchmark.java
index <HASH>..<HASH> 100644
--- a/tests/test_apps/kafkaimporter/client/kafkaimporter/KafkaImportBenchmark.java
+++ b/tests/test_apps/kafkaimporter/client/kafkaimporter/KafkaImportBenchmark.java
@@ -365,10 +365,18 @@ public class KafkaImportBenchmark {
long importRowCount = MatchChecks.getImportRowCount(client);
boolean testResult = true;
+ // so counts that might help debugging....
+ log.info("mirrorRows: " + mirrorRows);
+ log.info("importRows: " + importRows);
+ log.info("importRowCount: " + importRowCount);
+ if (config.useexport) {
+ log.info("exportRowCount: " + exportRowCount);
+ }
+
if (config.useexport) {
log.info("Total rows exported: " + finalInsertCount);
log.info("Unmatched Rows remaining in the export Mirror Table: " + mirrorRows);
- log.info("Unmatched Rows received from Kafka to Import Table (duplicate rows): " + importRowCount);
+ log.info("Unmatched Rows received from Kafka to Import Table (duplicate rows): " + importRows);
if (mirrorRows != 0) {
log.error(mirrorRows + " Rows are missing from the import stream, failing test"); | ENG-<I>, release <I>.x: straightening out some mix ups | VoltDB_voltdb | train | java |
0338a955a930286beaa7b66c5167be9b15d34d78 | diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
index <HASH>..<HASH> 100644
--- a/sos/plugins/__init__.py
+++ b/sos/plugins/__init__.py
@@ -488,7 +488,7 @@ class Plugin(object):
self.soslog.warning("command '%s' timed out after %ds"
% (prog, timeout))
if status == 127:
- self.soslog.warning("could not run '%s': command not found" % prog)
+ self.soslog.info("could not run '%s': command not found" % prog)
return (status, output, runtime)
def call_ext_prog(self, prog, timeout=300):
diff --git a/sos/sosreport.py b/sos/sosreport.py
index <HASH>..<HASH> 100644
--- a/sos/sosreport.py
+++ b/sos/sosreport.py
@@ -659,6 +659,7 @@ class SoSReport(object):
flog.setLevel(logging.DEBUG)
elif self.opts.verbosity and self.opts.verbosity > 0:
console.setLevel(logging.INFO)
+ flog.setLevel(logging.DEBUG)
else:
console.setLevel(logging.WARNING)
self.soslog.addHandler(console) | Fix verbose file logging
Prior versions of sos enable debug logging to the embedded log
file (sos_logs/sos.log) when a single '-v' is given. Restore this
behaviour and ensure that command-not-found messages are reported
at 'info' rather than 'warning' level. | sosreport_sos | train | py,py |
4b8852204d40676d51fc47c82d81a99542264ea0 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -69,7 +69,7 @@ setup(name='django-defender',
include_package_data=True,
packages=get_packages('defender'),
package_data=get_package_data('defender'),
- install_requires=['Django>=1.6,<1.9', 'redis==2.10.3',
+ install_requires=['Django>=1.6,<1.10', 'redis==2.10.3',
'hiredis==0.2.0', 'mockredispy==2.9.0.11'],
tests_require=['mock', 'mockredispy', 'coverage', 'celery'],
) | Django <I> is supported in installation requirements. | kencochrane_django-defender | train | py |
397dc7ac51803fef700eb11ddfb686eec196a7d5 | diff --git a/gpcharts.py b/gpcharts.py
index <HASH>..<HASH> 100644
--- a/gpcharts.py
+++ b/gpcharts.py
@@ -8,7 +8,7 @@
# Python3 compatibility
import sys
python_version = sys.version_info[0]
-if python_version == 3:
+if python_version >= 3:
try:
from past.builtins import xrange
except ImportError: | Fixing Python 4 compatibility issue
It is presumed that Python4 will be mostly, if not completely, backwards
compatible with Python3. At the same time, it will not revert to Python2
compatibility. As such, Python3 patches like this should also be written to be
seen by future versions of Python. | Dfenestrator_GooPyCharts | train | py |
8252ca8bc8d5301453f638a99ef1c93ef58b249a | diff --git a/examples/example_filter_listbox.py b/examples/example_filter_listbox.py
index <HASH>..<HASH> 100644
--- a/examples/example_filter_listbox.py
+++ b/examples/example_filter_listbox.py
@@ -2,8 +2,9 @@
# This example shows how to change the items of a ListBox widget
# when the current selection of a DropDown widget changes.
#
-from picotui.screen import *
+from picotui.screen import Screen
from picotui.widgets import *
+from picotui.defs import *
if __name__ == "__main__": | examples/example_filter_listbox: Clean up imports, import defs. | pfalcon_picotui | train | py |
6890d1b6b534c4fe9c3e4ef004c28379427767c6 | diff --git a/bot/action/standard/logger.py b/bot/action/standard/logger.py
index <HASH>..<HASH> 100644
--- a/bot/action/standard/logger.py
+++ b/bot/action/standard/logger.py
@@ -1,6 +1,7 @@
from bot.action.core.action import IntermediateAction
from bot.logger.logger import LoggerFactory
from bot.logger.message_sender.factory import MessageSenderFactory
+from bot.logger.worker_logger import WorkerStartStopLogger
class LoggerAction(IntermediateAction):
@@ -22,6 +23,12 @@ class LoggerAction(IntermediateAction):
def post_setup(self):
self.sender_builder.with_api(self.api)
self.logger = self.new_logger(self.config.log_chat_id)
+ self.__update_scheduler_callbacks()
+
+ def __update_scheduler_callbacks(self):
+ # update scheduler callbacks to use this logger instead of the admin one
+ worker_logger = WorkerStartStopLogger(self.logger)
+ self.scheduler.set_callbacks(worker_logger.worker_start, worker_logger.worker_stop)
def new_logger(self, chat_id, logger_type: str = None, reuse_max_length: int = None, reuse_max_time: int = None,
async: bool = None): | Update scheduler callbacks to use LoggerAction logger once it is created | alvarogzp_telegram-bot-framework | train | py |
86465840261a8af2a777c87a6f09a3b4f5390c73 | diff --git a/graphistry/plotter.py b/graphistry/plotter.py
index <HASH>..<HASH> 100644
--- a/graphistry/plotter.py
+++ b/graphistry/plotter.py
@@ -71,6 +71,11 @@ class Plotter(object):
else:
g = graph
n = self.nodes if nodes is None else nodes
+
+ if self.source is None or self.destination is None:
+ raise ValueError('Source/destination must be bound before plotting.')
+ if n is not None and self.node is None:
+ raise ValueError('Node identifier must be bound when using node dataframe')
dataset = self._plot_dispatch(g, n)
if dataset is None:
raise TypeError('Expected Pandas dataframe or Igraph graph') | NewAPI: Check that at least source/dest are bound before attempting to plot | graphistry_pygraphistry | train | py |
d036807925631e8eed3787e96b079be8d89b488b | diff --git a/public/javascripts/wymeditor/jquery.refinery.wymeditor.js b/public/javascripts/wymeditor/jquery.refinery.wymeditor.js
index <HASH>..<HASH> 100755
--- a/public/javascripts/wymeditor/jquery.refinery.wymeditor.js
+++ b/public/javascripts/wymeditor/jquery.refinery.wymeditor.js
@@ -2437,7 +2437,8 @@ WYMeditor.XhtmlValidator = {
"allowscriptaccess",
"wmode",
"type",
- "src"
+ "src",
+ "flashvars"
],
"inside":"object"
}, | support flashvars in an embed code | refinery_refinerycms | train | js |
7794f62df06e84cc90289fc7f5cccc6a0eb42d3d | diff --git a/spec/features/translations_spec.rb b/spec/features/translations_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/features/translations_spec.rb
+++ b/spec/features/translations_spec.rb
@@ -99,13 +99,11 @@ describe "translations" do
expect(page).to have_content("Language")
locales.each{|locale| expect(page).to have_css("select#locale option[value=#{locale}]")}
select("es", from: "locale")
- wait_for_ajax
expect(page).to have_content("Un idioma nunca es suficiente")
expect(page).to have_content("¿Cómo se llama Usted?")
click_button "Dos"
expect(page).to have_content("¿Cuál es tu color favorito?")
select("he", from: "locale")
- wait_for_ajax
expect(page).to have_content("מהו הצבע האהוב עליך?")
end
context "without translations" do | removing 'wait for ajax' in js testing | NUBIC_surveyor | train | rb |
9e19255198b766263c2892c013c56d07b025a7f6 | diff --git a/lxd/patches.go b/lxd/patches.go
index <HASH>..<HASH> 100644
--- a/lxd/patches.go
+++ b/lxd/patches.go
@@ -3464,7 +3464,7 @@ var legacyPatches = map[int](func(d *Daemon) error){
30: patchUpdateFromV29,
31: patchUpdateFromV30,
}
-var legacyPatchesNeedingDB = []int{11, 12, 16} // Legacy patches doing DB work
+var legacyPatchesNeedingDB = []int{11, 16} // Legacy patches doing DB work
func patchUpdateFromV10(d *Daemon) error {
if shared.PathExists(shared.VarPath("lxc")) {
@@ -3483,13 +3483,15 @@ func patchUpdateFromV10(d *Daemon) error {
}
func patchUpdateFromV11(d *Daemon) error {
- cNames, err := d.cluster.LegacyContainersList(db.CTypeSnapshot)
+ containers, err := containersOnDisk()
if err != nil {
return err
}
errors := 0
+ cNames := containers["default"]
+
for _, cName := range cNames {
snapParentName, snapOnlyName, _ := containerGetParentAndSnapshotName(cName)
oldPath := shared.VarPath("containers", snapParentName, "snapshots", snapOnlyName) | Don't use the db in legacy patch <I> | lxc_lxd | train | go |
28a0ed43b26ffae295dbec94dd4cbe3255fe1f9e | diff --git a/src/layers/cip/objects/Connection.js b/src/layers/cip/objects/Connection.js
index <HASH>..<HASH> 100644
--- a/src/layers/cip/objects/Connection.js
+++ b/src/layers/cip/objects/Connection.js
@@ -609,11 +609,18 @@ const InstanceAttributeDataTypes = {
[InstanceAttributeCodes.ConsumedConnectionPath]: DataType.EPATH(false),
[InstanceAttributeCodes.ProductionInhibitTime]: DataType.UINT,
[InstanceAttributeCodes.ConnectionTimeoutMultiplier]: DataType.USINT,
- [InstanceAttributeCodes.ConnectionBindingList]: DataType.STRUCT([DataType.SMEMBER(DataType.UINT, true), DataType.PLACEHOLDER], function (members) {
- if (members.length === 1) {
- return DataType.ARRAY(DataType.UINT, 0, members[0]);
+ [InstanceAttributeCodes.ConnectionBindingList]: DataType.TRANSFORM(
+ DataType.STRUCT([
+ DataType.UINT,
+ DataType.PLACEHOLDER(length => DataType.ABBREV_ARRAY(DataType.UINT, length))
+ ], function (members, dt) {
+ if (members.length === 1) {
+ return dt.resolve(members[0]);
+ }
+ }), function(val) {
+ return val[1];
}
- })
+ )
}; | Updated CIP Connection binding list instance attribute data type | jmmoser_node-drivers | train | js |
d6cdf923de566f759d51c597dd0a3595b3a334a3 | diff --git a/tests/helpers.py b/tests/helpers.py
index <HASH>..<HASH> 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -1,10 +1,4 @@
-from nose import SkipTest
-from nose.tools import assert_raises
from flask.app import Flask
-try:
- from flask import __version__ as FLASK_VERSION
-except ImportError:
- FLASK_VERSION = '0.6'
from webassets.test import TempEnvironmentHelper as BaseTempEnvironmentHelper
from flask.ext.assets import Environment
@@ -24,13 +18,6 @@ __all__ = ('TempEnvironmentHelper', 'Module', 'Blueprint')
class TempEnvironmentHelper(BaseTempEnvironmentHelper):
def _create_environment(self, **kwargs):
- if FLASK_VERSION < '0.7':
- # Older Flask versions do not support the
- # static_folder argument, which we need to use
- # a temporary folder for static files, without
- # having to do sys.path hacking.
- raise SkipTest()
-
if not hasattr(self, 'app'):
self.app = Flask(__name__, static_folder=self.tempdir, **kwargs)
self.env = Environment(self.app) | Don't skip test when Flask <I>
Just don't skip test, since Flask-Assets requires at least Flask <I>. | miracle2k_flask-assets | train | py |
f9b1a6450e8d2951180a9ca32b6fc4e6c3c31145 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -866,8 +866,8 @@ function flameGraph (opts) {
}
chart.getNodeRect = id => {
- // returns the node position and size on canvas, or false.
- return typeof (id) === 'number' && getNodeRect(id)
+ // returns the node position and size on canvas, or null.
+ return typeof (id) === 'number' ? getNodeRect(id) : null
}
chart.on = dispatch.on.bind(dispatch) | fixing the return value when no node is found | davidmarkclements_d3-fg | train | js |
a4c0961c54213733568a200a44101c77265baa22 | diff --git a/lib/accesslib.php b/lib/accesslib.php
index <HASH>..<HASH> 100755
--- a/lib/accesslib.php
+++ b/lib/accesslib.php
@@ -3023,7 +3023,7 @@ function get_enrolled_sql($context, $withcapability = '', $groupid = 0, $onlyact
$ctxids = implode(',', $contextids);
$roleids = implode(',', array_keys($prohibited));
$joins[] = "LEFT JOIN {role_assignments} {$prefix}ra4 ON ({$prefix}ra4.userid = {$prefix}u.id AND {$prefix}ra4.roleid IN ($roleids) AND {$prefix}ra4.contextid IN ($ctxids))";
- $wheres[] = "{$prefix}ra4 IS NULL";
+ $wheres[] = "{$prefix}ra4.id IS NULL";
}
if ($groupid) { | lib MDL-<I> Added missing field in get_enrolled_sql causing errors when capability had prohibited roles | moodle_moodle | train | php |
4524e35858439bd04a3eafea94edb45096b88b9f | diff --git a/src/Concerns/InteractsWithElements.php b/src/Concerns/InteractsWithElements.php
index <HASH>..<HASH> 100644
--- a/src/Concerns/InteractsWithElements.php
+++ b/src/Concerns/InteractsWithElements.php
@@ -187,6 +187,11 @@ trait InteractsWithElements
if (is_null($value)) {
$options[array_rand($options)]->click();
} else {
+
+ if (is_bool($value)) {
+ $value = $value ? '1' : '0';
+ }
+
foreach ($options as $option) {
if ((string) $option->getAttribute('value') === (string) $value) {
$option->click(); | Update InteractsWithElements.php
cast boolean value to their appropriate string integer value. | laravel_dusk | train | php |
db02ecf25997a9fa3c021058764d6b66e4c81929 | diff --git a/Parsedown.php b/Parsedown.php
index <HASH>..<HASH> 100755
--- a/Parsedown.php
+++ b/Parsedown.php
@@ -90,7 +90,6 @@ class Parsedown
'<' => array('Markup'),
'=' => array('Setext'),
'>' => array('Quote'),
- '[' => array('Reference'),
'_' => array('Rule'),
'`' => array('FencedCode'),
'|' => array('Table'), | "reference" is a definition | erusev_parsedown | train | php |
3fb339d258364ded095bc6de8c79fb8bebbd807f | diff --git a/cfs/main.go b/cfs/main.go
index <HASH>..<HASH> 100644
--- a/cfs/main.go
+++ b/cfs/main.go
@@ -73,6 +73,7 @@ func (NullWriter) Write([]byte) (int, error) { return 0, nil }
func main() {
+ fusermountPath()
flag.Usage = printUsage
flag.Parse()
clargs := getArgs(flag.Args())
@@ -178,6 +179,16 @@ func getArgs(args []string) map[string]string {
return clargs
}
+func fusermountPath() {
+ // Grab the current path
+ currentPath := os.Getenv("PATH")
+ if len(currentPath) == 0 {
+ // using mount seem to not have a path
+ // fusermount is in /bin
+ os.Setenv("PATH", "/bin")
+ }
+}
+
// printUsage will display usage
func printUsage() {
fmt.Println("Usage:") | Running with mount command has no environment PATH
The environment PATH variable has to contain the path to
/bin/fusermount | creiht_formic | train | go |
4645772206073334ddf04a81f128e231cb6bebf9 | diff --git a/discovery-model/src/main/java/com/ticketmaster/discovery/model/Page.java b/discovery-model/src/main/java/com/ticketmaster/discovery/model/Page.java
index <HASH>..<HASH> 100644
--- a/discovery-model/src/main/java/com/ticketmaster/discovery/model/Page.java
+++ b/discovery-model/src/main/java/com/ticketmaster/discovery/model/Page.java
@@ -51,7 +51,7 @@ public class Page<T> {
private Boolean templated;
public String getRelativeHref() {
- if (templated) {
+ if (templated != null && templated) {
return href.replaceAll(TEMPLATE_PATTERN, "");
} else {
return href; | fix NPE in case when none templated links appears in response JSON | ticketmaster-api_sdk-java | train | java |
02e1be24eaf804f907e95b08a3d948cc750ed11e | diff --git a/fints/client.py b/fints/client.py
index <HASH>..<HASH> 100644
--- a/fints/client.py
+++ b/fints/client.py
@@ -498,12 +498,12 @@ class FinTS3Client:
)
logger.info('Fetching done.')
- statement = []
- for seg in responses:
- # Note: MT940 messages are encoded in the S.W.I.F.T character set,
- # which is a subset of ISO 8859. There are no character in it that
- # differ between ISO 8859 variants, so we'll arbitrarily chose 8859-1.
- statement += mt940_to_array(seg.statement_booked.decode('iso-8859-1'))
+ # Note 1: Some banks send the HIKAZ data in arbitrary splits.
+ # So better concatenate them before MT940 parsing.
+ # Note 2: MT940 messages are encoded in the S.W.I.F.T character set,
+ # which is a subset of ISO 8859. There are no character in it that
+ # differ between ISO 8859 variants, so we'll arbitrarily chose 8859-1.
+ statement = mt940_to_array(''.join([seg.statement_booked.decode('iso-8859-1') for seg in responses]))
logger.debug('Statement: {}'.format(statement)) | Concatenate HIKAZ data before MT<I> parsing.
Some banks (especially Sparkasse) send HIKAZ data split over multiple segments, which led to MT<I> parsing errors.
The patch changes the way the segments are parsed. Fixes #<I> . | raphaelm_python-fints | train | py |
134ec95abb650d4075c766e3180c2c9bf810e9fc | diff --git a/lib/stripe_event.rb b/lib/stripe_event.rb
index <HASH>..<HASH> 100644
--- a/lib/stripe_event.rb
+++ b/lib/stripe_event.rb
@@ -52,7 +52,6 @@ module StripeEvent
'plan.updated',
'plan.deleted',
'coupon.created',
- 'coupon.updated',
'coupon.deleted',
'transfer.created',
'transfer.updated', | Remove old event type
coupon.updated event no longer exists | integrallis_stripe_event | train | rb |
87a8828bdfde53f00ddc41e40a97f3e9cb8d80c2 | 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
@@ -267,3 +267,10 @@ texinfo_documents = [
# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'http://docs.python.org/': None}
+
+
+def setup(app):
+ from sphinx.util.texescape import tex_replacements
+ tex_replacements.append(
+ (u'\u2212', u'-'),
+ ) | Re-add workaround for rendering of Unicode minus sign in PDF output. | mdickinson_bigfloat | train | py |
9fbde039baf8871cf2dd286bf8883a124f153aa3 | diff --git a/lib/Doctrine/Record.php b/lib/Doctrine/Record.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/Record.php
+++ b/lib/Doctrine/Record.php
@@ -1513,15 +1513,14 @@ abstract class Doctrine_Record extends Doctrine_Record_Abstract implements Count
{
static $methods = array();
if ( isset( $methods[$method])) {
- $methodArray = $methods[$method];
- $template = $methodArray["template"];
+ $template = $methods[$method];
$template->setInvoker($this);
- return call_user_func_array( array( $template, $method ), $methodArray["args"]);
+ return call_user_func_array( array($template, $method ), $args);
}
foreach ($this->_table->getTemplates() as $template) {
if (method_exists($template, $method)) {
$template->setInvoker($this);
- $methods[$method] = array("template" => $template, "args" => $args);
+ $methods[$method] = $template;
return call_user_func_array(array($template, $method), $args);
} | remove caching of args. it is just plain wrong | doctrine_annotations | train | php |
8c83c0969d10cbc4bbf611366e68507a7138b3e4 | diff --git a/equal/main.go b/equal/main.go
index <HASH>..<HASH> 100644
--- a/equal/main.go
+++ b/equal/main.go
@@ -24,7 +24,7 @@ func main() {
if equal {
fmt.Println("equal: files match")
- os.Exit(0)
+ return // cleaner than os.Exit(0)
}
fmt.Println("equal: files differ") | return from main is cleaner than os.Exit(0). | udhos_equalfile | train | go |
66a856e2d0870f2783f310971d037e73334f834b | diff --git a/src/main/java/com/googlecode/lanterna/gui2/AbstractInteractableComponent.java b/src/main/java/com/googlecode/lanterna/gui2/AbstractInteractableComponent.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/googlecode/lanterna/gui2/AbstractInteractableComponent.java
+++ b/src/main/java/com/googlecode/lanterna/gui2/AbstractInteractableComponent.java
@@ -40,12 +40,12 @@ public abstract class AbstractInteractableComponent<T extends AbstractInteractab
}
@Override
- public Interactable takeFocus() {
+ public T takeFocus() {
BasePane basePane = getBasePane();
if(basePane != null) {
basePane.setFocusedInteractable(this);
}
- return this;
+ return self();
}
/** | Adjusting method so it turns the parameterized type instead of the general interface | mabe02_lanterna | train | java |
48c40c87bc4f4cbb2d3987e579692449d3970826 | diff --git a/main.go b/main.go
index <HASH>..<HASH> 100644
--- a/main.go
+++ b/main.go
@@ -1,6 +1,7 @@
package main
import (
+ "crypto/tls"
"encoding/json"
"flag"
"fmt"
@@ -51,7 +52,27 @@ func main() {
http.HandleFunc("/report", reportHandler)
http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static"))))
- err = http.ListenAndServeTLS(fmt.Sprintf(":%d", *port), *certFile, *keyFile, nil)
+ cert, err := tls.LoadX509KeyPair(*certFile, *keyFile)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ cfg := &tls.Config{
+ Certificates: []tls.Certificate{cert},
+ SessionTicketsDisabled: true,
+ }
+
+ listener, err := tls.Listen("tcp", fmt.Sprintf(":%d", *port), cfg)
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ srv := http.Server{
+ ReadTimeout: 5 * time.Second,
+ WriteTimeout: 5 * time.Second,
+ }
+
+ err = srv.Serve(listener)
if err != nil {
log.Fatal(err)
} | Set read and write timeouts on HTTPS requests | syncthing_syncthing | train | go |
a6ede0ca8ea007202ab52c1515c54ca9d51de54a | diff --git a/Classes/Helper/InlineHelper.php b/Classes/Helper/InlineHelper.php
index <HASH>..<HASH> 100644
--- a/Classes/Helper/InlineHelper.php
+++ b/Classes/Helper/InlineHelper.php
@@ -289,6 +289,10 @@ class InlineHelper
foreach ($rows as $element) {
if ($inWorkspacePreviewMode) {
$element = BackendUtility::getRecordWSOL($childTable, $element['uid']);
+ // Ignore disabled elements in backend preview.
+ if ($element[$GLOBALS['TCA'][$childTable]['ctrl']['enablecolumns']['disabled']] ?? false) {
+ continue;
+ }
}
$elements[$element['uid']] = $element;
} | [BUGFIX] Ignore disabled elements in backend preview | Gernott_mask | train | php |
20b38d25adf9408ad0b953724b1331970843aec4 | diff --git a/graylog2-server/src/main/java/org/graylog2/plugin/Message.java b/graylog2-server/src/main/java/org/graylog2/plugin/Message.java
index <HASH>..<HASH> 100644
--- a/graylog2-server/src/main/java/org/graylog2/plugin/Message.java
+++ b/graylog2-server/src/main/java/org/graylog2/plugin/Message.java
@@ -35,6 +35,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nonnull;
+import javax.annotation.concurrent.NotThreadSafe;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Collection;
@@ -54,6 +55,7 @@ import static org.graylog2.plugin.Tools.ES_DATE_FORMAT_FORMATTER;
import static org.graylog2.plugin.Tools.buildElasticSearchTimeFormat;
import static org.joda.time.DateTimeZone.UTC;
+@NotThreadSafe
public class Message implements Messages {
private static final Logger LOG = LoggerFactory.getLogger(Message.class); | Mark Message class as not thread-safe (#<I>)
Refs #<I> | Graylog2_graylog2-server | train | java |
d19485bd976be2d6e5d45e182b6b550efe4084c1 | diff --git a/src/Collection/CollectionInterface.php b/src/Collection/CollectionInterface.php
index <HASH>..<HASH> 100644
--- a/src/Collection/CollectionInterface.php
+++ b/src/Collection/CollectionInterface.php
@@ -855,5 +855,5 @@ interface CollectionInterface extends Iterator, JsonSerializable
*
* @return \Iterator
*/
- public function _unwrap();
+ public function unwrap();
}
diff --git a/src/Collection/CollectionTrait.php b/src/Collection/CollectionTrait.php
index <HASH>..<HASH> 100644
--- a/src/Collection/CollectionTrait.php
+++ b/src/Collection/CollectionTrait.php
@@ -544,7 +544,7 @@ trait CollectionTrait
* {@inheritDoc}
*
*/
- public function _unwrap()
+ public function unwrap()
{
$iterator = $this;
while (get_class($iterator) === 'Cake\Collection\Collection') {
@@ -552,4 +552,15 @@ trait CollectionTrait
}
return $iterator;
}
+
+ /**
+ * Backwards compatible wrapper for unwrap()
+ *
+ * @return \Iterator
+ * @deprecated
+ */
+ public function _unwrap()
+ {
+ return $this->unwrap();
+ }
} | Making unwrap public, because "Coding Standards" | cakephp_cakephp | train | php,php |
98b64f572e52f2d1173a0f6201dd607f40c45077 | diff --git a/lib/transflow/transaction.rb b/lib/transflow/transaction.rb
index <HASH>..<HASH> 100644
--- a/lib/transflow/transaction.rb
+++ b/lib/transflow/transaction.rb
@@ -62,7 +62,7 @@ module Transflow
alias_method :[], :call
def to_s
- "Transaction(#{steps.keys.join(' => ')})"
+ "Transaction(#{steps.keys.reverse.join(' => ')})"
end
def fn(obj)
diff --git a/spec/unit/transaction_spec.rb b/spec/unit/transaction_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/transaction_spec.rb
+++ b/spec/unit/transaction_spec.rb
@@ -50,4 +50,12 @@ RSpec.describe Transflow::Transaction do
end
end
end
+
+ describe '#to_s' do
+ it 'returns a string representation of a transaction' do
+ transaction = Transflow::Transaction.new(three: proc {}, two: proc {}, one: proc {})
+
+ expect(transaction.to_s).to eql('Transaction(one => two => three)')
+ end
+ end
end | Fix order of steps in Transaction#to_s | solnic_transflow | train | rb,rb |
132daf62f94ac9951f6b316f7318980d3e5eb7bf | diff --git a/client.js b/client.js
index <HASH>..<HASH> 100644
--- a/client.js
+++ b/client.js
@@ -4,6 +4,6 @@
*/
var common = require("./common");
-common.controller = require("./core/ClientController");
+common.ClientController = require("./core/ClientController");
module.exports = common;
\ No newline at end of file | Fixing one more file to follow the capitalization convention. | redfin_react-server | train | js |
c15f561f6334fd6e7abc1315d3ac72942dae8b20 | diff --git a/lib/knife-solo/berkshelf.rb b/lib/knife-solo/berkshelf.rb
index <HASH>..<HASH> 100644
--- a/lib/knife-solo/berkshelf.rb
+++ b/lib/knife-solo/berkshelf.rb
@@ -19,8 +19,12 @@ module KnifeSolo
path = berkshelf_path
ui.msg "Installing Berkshelf cookbooks to '#{path}'..."
- berkshelf_options = KnifeSolo::Tools.config_value(config, :berkshelf_options) || {}
- berksfile = ::Berkshelf::Berksfile.from_file('Berksfile',berkshelf_options)
+ if defined?(::Berkshelf) && Gem::Version.new(::Berkshelf::VERSION) >= Gem::Version.new("3.0.0")
+ berkshelf_options = KnifeSolo::Tools.config_value(config, :berkshelf_options) || {}
+ berksfile = ::Berkshelf::Berksfile.from_file('Berksfile',berkshelf_options)
+ else
+ berksfile = ::Berkshelf::Berksfile.from_file('Berksfile')
+ end
if berksfile.respond_to?(:vendor)
FileUtils.rm_rf(path)
berksfile.vendor(path) | Fixed for compatibility with Berkshelf 2 | matschaffer_knife-solo | train | rb |
b8bc19fca99580fb018193c92166a65d21c2b8f0 | diff --git a/lib/amee.rb b/lib/amee.rb
index <HASH>..<HASH> 100644
--- a/lib/amee.rb
+++ b/lib/amee.rb
@@ -11,6 +11,9 @@ class String
def is_json?
slice(0,1) == '{'
end
+ def is_v2_json?
+ is_json? && match('"apiVersion".*?:.*?"2.0"')
+ end
def is_xml?
slice(0,5) == '<?xml'
end | Add tests for v2 JSON responses | OpenAMEE_amee-ruby | train | rb |
320da690e1109309b148db99e0d8cb3781bd586f | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -7,7 +7,7 @@ module.exports = function (grunt) {
cfg.connect = {
src: {
options: {
- port: 9200
+ port: 9210
, base: 'src/'
}
}
diff --git a/karma.conf.js b/karma.conf.js
index <HASH>..<HASH> 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -34,7 +34,7 @@ port = 9876;
// cli runner port
-runnerPort = 9200;
+runnerPort = 9210;
// enable / disable colors in the output (reporters and logs) | try port <I> for karma | LuvDaSun_angular-hal | train | js,js |
9bc3dc37f4430bd45fc7a76d8d67505d75fa3ebc | diff --git a/scs_osio/cmd/cmd_user_topics.py b/scs_osio/cmd/cmd_user_topics.py
index <HASH>..<HASH> 100644
--- a/scs_osio/cmd/cmd_user_topics.py
+++ b/scs_osio/cmd/cmd_user_topics.py
@@ -6,8 +6,6 @@ Created on 2 Jul 2017
import optparse
-from scs_core.data.localized_datetime import LocalizedDatetime
-
# -------------------------------------------------------------------------------------------------------------------- | Added OPCMonitor class. | south-coast-science_scs_osio | train | py |
dd773b0f81b4c77f1103f0b0082138cc84cb3806 | diff --git a/lib/fluent/plugin/in_exec.rb b/lib/fluent/plugin/in_exec.rb
index <HASH>..<HASH> 100644
--- a/lib/fluent/plugin/in_exec.rb
+++ b/lib/fluent/plugin/in_exec.rb
@@ -98,7 +98,7 @@ module Fluent::Plugin
router.emit(tag, time, record)
rescue => e
log.error "exec failed to emit", tag: tag, record: Yajl.dump(record), error: e
- router.emit_error_event(tag, time, record, "exec failed to emit")
+ router.emit_error_event(tag, time, record, e) if tag && time && record
end
end
end
diff --git a/lib/fluent/plugin/out_exec_filter.rb b/lib/fluent/plugin/out_exec_filter.rb
index <HASH>..<HASH> 100644
--- a/lib/fluent/plugin/out_exec_filter.rb
+++ b/lib/fluent/plugin/out_exec_filter.rb
@@ -305,7 +305,7 @@ module Fluent::Plugin
log.error_backtrace e.backtrace
@next_log_time = Time.now.to_i + @suppress_error_log_interval
end
- router.emit_error_event(tag, time, record, "exec_filter failed to emit") if tag && time && record
+ router.emit_error_event(tag, time, record, e) if tag && time && record
end
end
end | fix to pass error object into error stream | fluent_fluentd | train | rb,rb |
900ce2f91c38f0184012ddc447dfaa31a04e2693 | diff --git a/src/main/java/me/legrange/mikrotik/ApiConnection.java b/src/main/java/me/legrange/mikrotik/ApiConnection.java
index <HASH>..<HASH> 100644
--- a/src/main/java/me/legrange/mikrotik/ApiConnection.java
+++ b/src/main/java/me/legrange/mikrotik/ApiConnection.java
@@ -429,8 +429,10 @@ public class ApiConnection {
private List<Result> getResults() throws ApiCommandException, ApiConnectionException {
try {
- synchronized (this) {
- wait();
+ synchronized (this) { // don't wait if we already have a result.
+ if ((err == null) && results.isEmpty()) {
+ wait();
+ }
}
} catch (InterruptedException ex) {
throw new ApiConnectionException(ex.getMessage(), ex); | Fixed possible race condition in short-lived synchrynous commands | GideonLeGrange_mikrotik-java | train | java |
763b61572f1b5352efc7838d7ef98b928b8cb575 | diff --git a/bokeh/embed.py b/bokeh/embed.py
index <HASH>..<HASH> 100644
--- a/bokeh/embed.py
+++ b/bokeh/embed.py
@@ -386,7 +386,8 @@ def file_html(models,
resources,
title=None,
template=FILE,
- template_variables={}):
+ template_variables={},
+ theme=None):
''' Return an HTML document that embeds Bokeh Model or Document objects.
The data for the plot is stored directly in the returned HTML, with
@@ -412,7 +413,7 @@ def file_html(models,
'''
models = _check_models(models)
- with _ModelInDocument(models):
+ with _ModelInDocument(models, apply_theme=theme):
(docs_json, render_items) = _standalone_docs_json_and_render_items(models)
title = _title_from_models(models, title)
bundle = _bundle_for_objs_and_resources(models, resources) | Support themes in file_html embedding
Currently, themes are only applied when using `components` to embed plots | bokeh_bokeh | train | py |
bfa6e3c948ec2aaf41486da6021061d1ea09e24c | diff --git a/src/Illuminate/Foundation/Testing/TestResponse.php b/src/Illuminate/Foundation/Testing/TestResponse.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Foundation/Testing/TestResponse.php
+++ b/src/Illuminate/Foundation/Testing/TestResponse.php
@@ -3,7 +3,6 @@
namespace Illuminate\Foundation\Testing;
use Closure;
-use Illuminate\Support\Str;
use Illuminate\Http\Response;
use Illuminate\Contracts\View\View;
use PHPUnit_Framework_Assert as PHPUnit; | Apply fixes from StyleCI (#<I>) | laravel_framework | train | php |
de0df944e340d5e4c1b9161ac66b2ae6d6f57174 | diff --git a/jmock2/src/org/jmock/Mockery.java b/jmock2/src/org/jmock/Mockery.java
index <HASH>..<HASH> 100644
--- a/jmock2/src/org/jmock/Mockery.java
+++ b/jmock2/src/org/jmock/Mockery.java
@@ -188,6 +188,9 @@ public class Mockery implements SelfDescribing {
*
* The builder is responsible for interpreting high-level, readable API calls to
* construct an expectation.
+ *
+ * This method can be called multiple times per test and the expectations defined in
+ * each block are combined as if they were defined in same order within a single block.
*/
public void checking(ExpectationBuilder expectations) {
expectations.buildExpectations(defaultAction, dispatcher); | Javadoc improvements (JMOCK-<I>) | jmock-developers_jmock-library | train | java |
f96d3e26ddff55ede52c5922171d60a74a04fcc2 | diff --git a/c3d.py b/c3d.py
index <HASH>..<HASH> 100644
--- a/c3d.py
+++ b/c3d.py
@@ -866,7 +866,7 @@ class Reader(Manager):
gen_scale = param.float_value
self._handle.seek((self.header.data_block - 1) * 512)
- for frame_no in xrange(self.first_frame(), self.last_frame() + 1):
+ for frame_no in range(self.first_frame(), self.last_frame() + 1):
raw = np.fromfile(self._handle, dtype=point_dtype,
count=4 * self.header.point_count).reshape((ppf, 4))
@@ -1018,7 +1018,7 @@ class Writer(Manager):
dimensions=[len(point_units)], bytes=point_units)
point_group.add_param(
'LABELS', desc='labels', data_size=-1, dimensions=[5, ppf],
- bytes=''.join('M%03d ' % i for i in xrange(ppf)))
+ bytes=''.join('M%03d ' % i for i in range(ppf)))
point_group.add_param(
'DESCRIPTIONS', desc='descriptions', data_size=-1,
dimensions=[16, ppf], bytes=' ' * 16 * ppf) | Further py3k changes. | EmbodiedCognition_py-c3d | train | py |
ad6552d8cc3db2952096ddf8f37793fbfb0033f7 | diff --git a/src/robotto.js b/src/robotto.js
index <HASH>..<HASH> 100644
--- a/src/robotto.js
+++ b/src/robotto.js
@@ -83,6 +83,7 @@ robotto.parse = function(robotsFile) {
};
robotto.check = function(userAgent, urlParam, rulesObj) {
+ delete rulesObj.comments;
let userAgents = Object.keys(rulesObj);
let desiredRoute = (url.parse(urlParam).pathname + '/').split('/')[1];
let allowed = true; | Deleting unuseful comments key before checking routes | trachelas_robotto | train | js |
6ed6601d1bf874ef6dcb7a5c7020e6047a6cdc31 | diff --git a/src/Rocketeer/Services/Tasks/TasksBuilder.php b/src/Rocketeer/Services/Tasks/TasksBuilder.php
index <HASH>..<HASH> 100644
--- a/src/Rocketeer/Services/Tasks/TasksBuilder.php
+++ b/src/Rocketeer/Services/Tasks/TasksBuilder.php
@@ -339,8 +339,8 @@ class TasksBuilder
protected function isCallable($task)
{
// Check for container bindings
- if (is_array($task)) {
- return count($task) === 2 && $this->app->bound($task[0]);
+ if (is_array($task) ) {
+ return count($task) === 2 && $this->app->bound($task[0]) || is_callable($task);
}
return is_callable($task) && !$task instanceof Closure; | Fix slight bug in TasksBuilder | rocketeers_rocketeer | train | php |
f599b44a70fc7431fb60b5bc86b2e866faa61350 | diff --git a/lib/accounting/bank.rb b/lib/accounting/bank.rb
index <HASH>..<HASH> 100644
--- a/lib/accounting/bank.rb
+++ b/lib/accounting/bank.rb
@@ -2,6 +2,6 @@ module Accounting
class Bank < ActiveRecord::Base
has_many :accounts
- belongs_to :vcard, :class_name => 'Vcards::Vcard'
+ has_vcards
end
end | Use has_vcards from vcards plugin. | huerlisi_has_accounts | train | rb |
ea37f57ebf7388e8883e900495449775a06652cb | diff --git a/src/ossos-pipeline/ossos/fitsviewer/displayable.py b/src/ossos-pipeline/ossos/fitsviewer/displayable.py
index <HASH>..<HASH> 100644
--- a/src/ossos-pipeline/ossos/fitsviewer/displayable.py
+++ b/src/ossos-pipeline/ossos/fitsviewer/displayable.py
@@ -280,6 +280,8 @@ class Marker(object):
def add_to_axes(self, axes):
axes.add_patch(self.circle)
+ self.vline.set_transform(axes.transData)
+ self.hline.set_transform(axes.transData)
axes.lines.extend([self.vline, self.hline])
def remove_from_axes(self): | Fixed coordinate offset for crosshair on source marker. | OSSOS_MOP | train | py |
d490bb2f1637461ada81d99e899ab948c41c1503 | diff --git a/tasks/lib/compile/dependencies.js b/tasks/lib/compile/dependencies.js
index <HASH>..<HASH> 100644
--- a/tasks/lib/compile/dependencies.js
+++ b/tasks/lib/compile/dependencies.js
@@ -36,7 +36,6 @@ function parseClassExtend (content, absPath) {
hierarchy[parentName].children.push(childName);
- hierarchy[childName].parent = parentName;
hierarchy[childName].absPath = absPath;
return true; | {Update: dependencies.js} Remove unnecessary assignment of parent. | jeanamarante_catena | train | js |
78fab76d2886702d386141767c39446e3f791aef | diff --git a/odl/space/npy_tensors.py b/odl/space/npy_tensors.py
index <HASH>..<HASH> 100644
--- a/odl/space/npy_tensors.py
+++ b/odl/space/npy_tensors.py
@@ -1856,7 +1856,10 @@ def _lincomb_impl(a, x1, b, x2, out):
_lincomb_impl(a + b, x1, 0, x1, out)
elif out is x1 and out is x2:
# All the vectors are aligned -> out = (a+b)*out
- scal(a + b, out_arr, size)
+ if (a + b) != 0:
+ scal(a + b, out_arr, size)
+ else:
+ out_arr[:] = 0
elif out is x1:
# out is aligned with x1 -> out = a*out + b*x2
if a != 1: | BUG: Fix bug with zero-assignment with nans, see #<I> | odlgroup_odl | train | py |
65707fa0f8aa2aeafbb8aca20928ab6c434a42d0 | diff --git a/uncompyle6/parsers/parse3.py b/uncompyle6/parsers/parse3.py
index <HASH>..<HASH> 100644
--- a/uncompyle6/parsers/parse3.py
+++ b/uncompyle6/parsers/parse3.py
@@ -1532,7 +1532,7 @@ class Python3Parser(PythonParser):
# FIXME: Put more in this table
self.reduce_check_table = {
"except_handler_else": except_handler_else,
- "ifstmt": ifstmt,
+ # "ifstmt": ifstmt,
"ifstmtl": ifstmt,
"ifelsestmtc": ifstmt,
"ifelsestmt": ifelsestmt, | FIx bug that snuck in last commit. | rocky_python-uncompyle6 | train | py |
6921f29fabbf13de5b945cbff7ac3c365f9a8758 | diff --git a/src/numdifftools/multicomplex.py b/src/numdifftools/multicomplex.py
index <HASH>..<HASH> 100644
--- a/src/numdifftools/multicomplex.py
+++ b/src/numdifftools/multicomplex.py
@@ -50,7 +50,9 @@ def c_min(x, y):
def c_abs(z):
- return np.where(np.real(z) >= 0, z, -z)
+ if np.all(np.iscomplex(z)):
+ return np.where(np.real(z) >= 0, z, -z)
+ return np.abs(z)
class Bicomplex(object): | Fixed c_abs so it works with algopy on python <I>. | pbrod_numdifftools | train | py |
881ccebfe7521c3f752947877faca8155298b897 | diff --git a/src/extensions/cytoscape.renderer.canvas.js b/src/extensions/cytoscape.renderer.canvas.js
index <HASH>..<HASH> 100644
--- a/src/extensions/cytoscape.renderer.canvas.js
+++ b/src/extensions/cytoscape.renderer.canvas.js
@@ -174,7 +174,7 @@
}
// no parent node: no node to add to the drag layer
- if (parent == node)
+ if (parent == node && inDragLayer)
{
return;
} | minor bug fix for touch events to remove compound nodes from the drag layer | cytoscape_cytoscape.js | train | js |
33df946f856940373729d4581e4c90bea119cd5d | diff --git a/aeron-client/src/main/java/io/aeron/logbuffer/TermBlockScanner.java b/aeron-client/src/main/java/io/aeron/logbuffer/TermBlockScanner.java
index <HASH>..<HASH> 100644
--- a/aeron-client/src/main/java/io/aeron/logbuffer/TermBlockScanner.java
+++ b/aeron-client/src/main/java/io/aeron/logbuffer/TermBlockScanner.java
@@ -60,7 +60,7 @@ public class TermBlockScanner
{
if (termOffset == offset)
{
- offset += align(frameLength, FRAME_ALIGNMENT);
+ offset += alignedFrameLength;
}
break; | [Java] Replace redundant alignment calculation in term block scanner. | real-logic_aeron | train | java |
ca0f57fb1074d2da401fbd145dfa4931a152279a | diff --git a/resources/assets/js/helpers.js b/resources/assets/js/helpers.js
index <HASH>..<HASH> 100644
--- a/resources/assets/js/helpers.js
+++ b/resources/assets/js/helpers.js
@@ -526,7 +526,7 @@ $.extend(true, laravelValidation, {
* @returns {*|string}
*/
allElementValues: function (validator, element) {
- if (element.name.indexOf('[') !== -1 && element.name.indexOf(']') !== -1) {
+ if (element.name.indexOf('[]') !== -1) {
return validator.findByName(element.name).map(function (i, e) {
return validator.elementValue(e);
}).get(); | fix: min / max array rules (#<I>) | proengsoft_laravel-jsvalidation | train | js |
5fa3122837cf9e8c809d4a4cfd0876e970761699 | diff --git a/web/concrete/single_pages/dashboard/composer/drafts.php b/web/concrete/single_pages/dashboard/composer/drafts.php
index <HASH>..<HASH> 100644
--- a/web/concrete/single_pages/dashboard/composer/drafts.php
+++ b/web/concrete/single_pages/dashboard/composer/drafts.php
@@ -21,9 +21,9 @@ if (count($drafts) > 0) { ?>
} ?></a></td>
<td><?=$dr->getCollectionTypeName()?></td>
<td><?
- $mask = 'F jS Y - g:i a';
+ $mask = DATE_APP_GENERIC_MDYT;
if ($today == $dr->getCollectionDateLastModified("Y-m-d")) {
- $mask = 'g:i a';
+ $mask = DATE_APP_GENERIC_T;
}
print $dr->getCollectionDateLastModified($mask)?></td>
<? } ?> | localization fixes to composer drafts
Former-commit-id: e<I>eb<I>b<I>a<I>c<I>fba<I>a4aa<I>e<I>bc | concrete5_concrete5 | 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.