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
|
---|---|---|---|---|---|
3c4d2b8ca1b0d7ec24c3c5ed9fc0518a039b3dec | diff --git a/pkg/services/alerting/notifier.go b/pkg/services/alerting/notifier.go
index <HASH>..<HASH> 100644
--- a/pkg/services/alerting/notifier.go
+++ b/pkg/services/alerting/notifier.go
@@ -73,11 +73,19 @@ type WebhookNotifier struct {
func (this *WebhookNotifier) Dispatch(alertResult *AlertResult) {
this.log.Info("Sending webhook")
+
+ bodyJSON := simplejson.New()
+ bodyJSON.Set("name", alertResult.AlertJob.Rule.Name)
+ bodyJSON.Set("state", alertResult.State)
+ bodyJSON.Set("trigged", alertResult.TriggeredAlerts)
+
+ body, _ := bodyJSON.MarshalJSON()
+
cmd := &m.SendWebhook{
Url: this.Url,
User: this.User,
Password: this.Password,
- Body: alertResult.Description,
+ Body: string(body),
}
bus.Dispatch(cmd) | feat(alerting): add basic body for webhooks | grafana_grafana | train | go |
6f49e34cc819475526cfb864e6429c757369b2a0 | diff --git a/master/buildbot/test/unit/test_schedulers_forcesched.py b/master/buildbot/test/unit/test_schedulers_forcesched.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/test/unit/test_schedulers_forcesched.py
+++ b/master/buildbot/test/unit/test_schedulers_forcesched.py
@@ -43,16 +43,13 @@ class TestForceScheduler(scheduler.SchedulerMixin, unittest.TestCase):
def makeRequest(self, **args):
r = mock.Mock()
- def get(key, default):
- if key in args:
- a = args[key]
- if type(a)==list:
- return a
- else:
- return [a]
+ def get(key):
+ a = args[key]
+ if type(a)==list:
+ return a
else:
- return default
- r.args.get = get
+ return [a]
+ r.args = dict((k, get(k)) for k in args)
return r
# tests | Use a dict() for r.args (the real one is a dict anyway) | buildbot_buildbot | train | py |
c2ec5026e06ea9d275177c5dc3608c1e12c780ae | diff --git a/app/components/marty/data_import_view.rb b/app/components/marty/data_import_view.rb
index <HASH>..<HASH> 100644
--- a/app/components/marty/data_import_view.rb
+++ b/app/components/marty/data_import_view.rb
@@ -9,6 +9,7 @@ class Marty::DataImportView < Marty::CmFormPanel
end
js_configure do |c|
+
c.set_result = <<-JS
function(html) {
var result = this.netzkeGetComponent('result');
@@ -24,11 +25,16 @@ class Marty::DataImportView < Marty::CmFormPanel
var comboname = form.findField('import_type');
var textname = form.findField('import_data');
+ var importbutton = me.actions["apply"].items[0];
comboname.on('select', function(combo, record) {
textname.setValue("");
me.netzkeGetComponent('result').updateBodyHtml('');
});
+
+ importbutton.on('click', function(t, e, ops) {
+ me.netzkeGetComponent('result').updateBodyHtml('');
+ });
}
JS
end | When the user re-runs the currently selected import, the results/errors text is cleared out. | arman000_marty | train | rb |
6fd5535694ac788d07eaadb90330c93421199ca8 | diff --git a/deployment-scanner/src/main/java/org/jboss/as/server/deployment/scanner/FileSystemDeploymentService.java b/deployment-scanner/src/main/java/org/jboss/as/server/deployment/scanner/FileSystemDeploymentService.java
index <HASH>..<HASH> 100644
--- a/deployment-scanner/src/main/java/org/jboss/as/server/deployment/scanner/FileSystemDeploymentService.java
+++ b/deployment-scanner/src/main/java/org/jboss/as/server/deployment/scanner/FileSystemDeploymentService.java
@@ -987,7 +987,7 @@ class FileSystemDeploymentService implements DeploymentScanner {
if (deployed.containsKey(deploymentName)) {
deployed.remove(deploymentName);
}
- deployed.put(deploymentName, new DeploymentMarker(deployedMarker.lastModified(), archive));
+ deployed.put(deploymentName, new DeploymentMarker(doDeployTimestamp, archive));
}
} | [AS7-<I>] Do not read the modified time back from the file as there is a possibility that the file could have been deleted between creating it and the read, instead use the value that we chose to set.
was: <I>e8a<I>b<I>a7b<I>e<I>db<I>ec7 | wildfly_wildfly-core | train | java |
6840d5d97ad8351c039f390708ae8febb9d10d9d | diff --git a/lib/codemirror.js b/lib/codemirror.js
index <HASH>..<HASH> 100644
--- a/lib/codemirror.js
+++ b/lib/codemirror.js
@@ -943,12 +943,17 @@ var CodeMirror = (function() {
indentLine(sel.from.line, options.enterMode == "keep" ? "prev" : "smart");
}
function handleTab(shift) {
+ function indentSelected(mode) {
+ if (posEq(sel.from, sel.to)) return indentLine(sel.from.line, mode);
+ var e = sel.to.line - (sel.to.ch ? 1 : 0);
+ for (var i = sel.from.line; i < e; ++i) indentLine(i, mode);
+ }
shiftSelecting = null;
switch (options.tabMode) {
case "default":
return false;
case "indent":
- for (var i = sel.from.line, e = sel.to.line; i <= e; ++i) indentLine(i, "smart");
+ indentSelected("smart");
break;
case "classic":
if (posEq(sel.from, sel.to)) {
@@ -957,7 +962,7 @@ var CodeMirror = (function() {
break;
}
case "shift":
- for (var i = sel.from.line, e = sel.to.line; i <= e; ++i) indentLine(i, shift ? "subtract" : "add");
+ indentSelected(shift ? "subtract" : "add");
break;
}
return true; | Don't include lines hanging at the end of the selection when indenting | codemirror_CodeMirror | train | js |
641264e0346e86d3018840e326ffeb347d3bcd3e | diff --git a/tests/Functional/Schema/OracleSchemaManagerTest.php b/tests/Functional/Schema/OracleSchemaManagerTest.php
index <HASH>..<HASH> 100644
--- a/tests/Functional/Schema/OracleSchemaManagerTest.php
+++ b/tests/Functional/Schema/OracleSchemaManagerTest.php
@@ -264,4 +264,27 @@ class OracleSchemaManagerTest extends SchemaManagerFunctionalTestCase
"Skipped for uppercase letters are contained in sequences' names. Fix the schema manager in 3.0."
);
}
+
+ public function testQuotedTableNameRemainsQuotedInSchema(): void
+ {
+ $table = new Table('"tester"');
+ $table->addColumn('"id"', Types::INTEGER);
+ $table->addColumn('"name"', Types::STRING);
+
+ $this->dropAndCreateTable($table);
+
+ $schemaManager = $this->connection->createSchemaManager();
+
+ $fromSchema = $schemaManager->createSchema();
+ $toSchema = clone $fromSchema;
+
+ $toSchema->getTable('"tester"')->dropColumn('"name"');
+ $diff = $schemaManager->createComparator()
+ ->compareSchemas($fromSchema, $toSchema);
+
+ $schemaManager->alterSchema($diff);
+
+ $columns = $schemaManager->listTableColumns('"tester"');
+ self::assertCount(1, $columns);
+ }
} | Add a test for quoting table names in schema | doctrine_dbal | train | php |
b0d5a62e6a8664a6b13a10a56d7c590d2817050c | diff --git a/src/Payments/Methods/Types/AbstractType.php b/src/Payments/Methods/Types/AbstractType.php
index <HASH>..<HASH> 100644
--- a/src/Payments/Methods/Types/AbstractType.php
+++ b/src/Payments/Methods/Types/AbstractType.php
@@ -2,7 +2,7 @@
namespace ByTIC\Common\Payments\Methods\Types;
-use ByTIC\Common\Records\Types\Generic;
+use ByTIC\Common\Records\Properties\Types\Generic;
/**
* Class AbstractType | rename Generic Statuses to Properties Traits | bytic_Common | train | php |
4f1a61a5344a8cd1caa69016974e26ab51081c33 | diff --git a/lib/af_strong_parameters/forbidden_attributes_protection.rb b/lib/af_strong_parameters/forbidden_attributes_protection.rb
index <HASH>..<HASH> 100644
--- a/lib/af_strong_parameters/forbidden_attributes_protection.rb
+++ b/lib/af_strong_parameters/forbidden_attributes_protection.rb
@@ -4,8 +4,8 @@ module AfStrongParameters
module ForbiddenAttributesProtection
def sanitize_for_mass_assignment(*options)
new_attributes = options.first.keys.map(&:to_sym)
- permitted_attributes = Thread.current.thread_variable_get(:permitted_for_mass_assignment).try(:fetch, self.class.to_s.underscore.to_sym, [])
- if Thread.current.thread_variable_get(:permitted_for_mass_assignment).nil? || (new_attributes - permitted_attributes).empty?
+ permitted_attributes = Thread.current.thread_variable_get(:permitted_for_mass_assignment).try(:fetch, self.class.to_s.underscore.to_sym) || []
+ if Thread.current.thread_variable?(:permitted_for_mass_assignment) || (new_attributes - permitted_attributes).empty?
super
else
raise AfStrongParameters::ForbiddenAttributes "#{new_attributes - permitted_attributes} not allowed to be mass-assigned on #{self.class}." | js - small cleanups | appfolio_shields_up | train | rb |
7cbe067f6110aa56cfddd30bab46adf9b0b550fb | diff --git a/as/http.js b/as/http.js
index <HASH>..<HASH> 100644
--- a/as/http.js
+++ b/as/http.js
@@ -60,6 +60,7 @@ HTTPResArg2.RW = bufrw.Struct(HTTPResArg2, {
});
// per RFC2616
+/*eslint-disable complexity*/
HTTPReqArg2.prototype.getHeaders =
HTTPResArg2.prototype.getHeaders =
function getHeaders() {
@@ -105,8 +106,10 @@ function getHeaders() {
}
}
return headers;
+ /*eslint-enable complexity*/
};
+/*eslint-disable complexity*/
HTTPReqArg2.prototype.setHeaders =
HTTPResArg2.prototype.setHeaders =
function setHeaders(headers) {
@@ -146,6 +149,7 @@ function setHeaders(headers) {
}
}
};
+/*eslint-enable complexity*/
function TChannelHTTP(options) {
if (!(this instanceof TChannelHTTP)) { | linting: [as/http] apply the complexity rule | uber_tchannel-node | train | js |
b8606124305fba5d6e33c7a6af0017806dcbc8fe | diff --git a/src/registry/discoverers/etcd3.js b/src/registry/discoverers/etcd3.js
index <HASH>..<HASH> 100644
--- a/src/registry/discoverers/etcd3.js
+++ b/src/registry/discoverers/etcd3.js
@@ -147,9 +147,10 @@ class Etcd3Discoverer extends BaseDiscoverer {
//Handle lease-lost event. Release lease when lost. Next heartbeat will request a new lease
leaseBeat.on('lost', err => {
- this.logger.warn("Lost heartbeat lease. Renewing lease on next heartbeat", err)
+ this.logger.warn("Lost heartbeat lease. Dropping lease and retrying heartbeat.", err)
leaseBeat.release();
this.leaseBeat = null;
+ this.sendHeartbeat();
});
return leaseBeat.grant() // Waiting for the lease creation on the server
@@ -289,9 +290,10 @@ class Etcd3Discoverer extends BaseDiscoverer {
//Handle lease-lost event. Release lease when lost. Next heartbeat will request a new lease
leaseInfo.on('lost', err => {
- this.logger.warn("Lost info lease. Renewing lease on next heartbeat", err)
+ this.logger.warn("Lost info lease. Dropping lease and retrying info-send", err)
leaseInfo.release();
this.leaseInfo = null;
+ this.sendLocalNodeInfo(nodeID);
});
return leaseInfo.grant() // Waiting for the lease creation on the server | Retry heartbeat and info on lease-loss | moleculerjs_moleculer | train | js |
1da8b552d1a7689171a8b73ec58945d8756884e4 | diff --git a/nidmresults/owl/owl_reader.py b/nidmresults/owl/owl_reader.py
index <HASH>..<HASH> 100644
--- a/nidmresults/owl/owl_reader.py
+++ b/nidmresults/owl/owl_reader.py
@@ -211,7 +211,7 @@ class OwlReader():
for class_name in classes:
if not self.is_class(class_name):
- raise Exception('Class '+str(class_name)+' does not exist.')
+ warnings.warn('Class '+str(class_name)+' does not exist.')
if not isinstance(class_name, term.BNode):
prov_type = self.get_prov_class(class_name) | raise warning if class is missing (rather than error) | incf-nidash_nidmresults | train | py |
7d83b382857edc352564b6047adc1621556d039c | diff --git a/spec/support/db.rb b/spec/support/db.rb
index <HASH>..<HASH> 100644
--- a/spec/support/db.rb
+++ b/spec/support/db.rb
@@ -2,7 +2,7 @@ ActiveRecord::Base.connection.tables.each do |t|
ActiveRecord::Base.connection.drop_table t
end
-gems = %w{ documents events linkser presence ostatus }
+gems = %w{ documents events linkser presence ostatus oauth2_server }
gems.each do |g|
require "social_stream/migrations/#{ g }" | Include oauth2_server migrations | ging_social_stream | train | rb |
b20704569fea2e70025ee48af13b0c93c10cb315 | diff --git a/code/DMSDocument.php b/code/DMSDocument.php
index <HASH>..<HASH> 100644
--- a/code/DMSDocument.php
+++ b/code/DMSDocument.php
@@ -6,12 +6,9 @@ class DMSDocument extends DataObject implements DMSDocumentInterface {
"Folder" => "Text"
);
- static $has_many = array(
- 'Tags' => 'DMSTag'
- );
-
static $many_many = array(
- 'Pages' => 'SiteTree'
+ 'Pages' => 'SiteTree',
+ 'Tags' => 'DMSTag'
);
/**
diff --git a/code/DMSTag.php b/code/DMSTag.php
index <HASH>..<HASH> 100644
--- a/code/DMSTag.php
+++ b/code/DMSTag.php
@@ -9,7 +9,7 @@ class DMSTag extends DataObject {
'Value' => 'varchar(1024)'
);
- static $has_one = array(
- 'Document' => 'DMSDocument'
+ static $belongs_many_many = array(
+ 'Documents' => 'DMSDocument'
);
}
\ No newline at end of file | ENHANCEMENT: refactoring DMSTag to have a many_many relation to DMSDocument | silverstripe_silverstripe-dms | train | php,php |
d1e8fe4cbb45bd5913518f8b9bc6d755c1722a7e | diff --git a/lib/iob/calculate.js b/lib/iob/calculate.js
index <HASH>..<HASH> 100644
--- a/lib/iob/calculate.js
+++ b/lib/iob/calculate.js
@@ -25,7 +25,7 @@ function iobCalc(treatment, time, dia) {
var y = (minAgo-peak)/5;
iobContrib = treatment.insulin * (0.001323 * y * y - .054233 * y + .55556);
//activityContrib=sens*treatment.insulin*(2/dia/60-(minAgo-peak)*2/dia/60/(60*dia-peak));
- activityContrib = treatment.insulin * (2 / dia / 60 - (minAgo - peak) * 2 / dia / 60 / (60 * dia - peak));
+ activityContrib = treatment.insulin * (2 / dia / 60 - (minAgo - peak) * 2 / dia / 60 / (60 * 3 - peak));
}
results = { | Fix activityContrib (#<I>) | openaps_oref0 | train | js |
978d0ae3f354fc4e1f74716ef1d5aa4c90093845 | diff --git a/hwt/synthesizer/dummyPlatform.py b/hwt/synthesizer/dummyPlatform.py
index <HASH>..<HASH> 100644
--- a/hwt/synthesizer/dummyPlatform.py
+++ b/hwt/synthesizer/dummyPlatform.py
@@ -15,8 +15,8 @@ class DummyPlatform():
self.afterToRtlImpl = []
self.beforeHdlArchGeneration = [
+ extract_part_drivers,
removeUnconnectedSignals,
markVisibilityOfSignalsAndCheckDrivers,
- extract_part_drivers,
]
self.afterToRtl = [] | DummyPlatform: extract_part_drivers before any signal rm | Nic30_hwt | train | py |
104338b7543eda1c6ef9cfaf0a0dd5834181cc9c | diff --git a/stdlib/promise.rb b/stdlib/promise.rb
index <HASH>..<HASH> 100644
--- a/stdlib/promise.rb
+++ b/stdlib/promise.rb
@@ -8,7 +8,7 @@ class Promise
end
def self.when(*promises)
- When.new(promises.flatten)
+ When.new(promises)
end
attr_reader :value, :error, :prev, :next | Don't flatten in Promise.when | opal_opal | train | rb |
78854de0cfa50d3d051c444b2bf58589ebcd7c23 | diff --git a/meshio/vtk_io.py b/meshio/vtk_io.py
index <HASH>..<HASH> 100755
--- a/meshio/vtk_io.py
+++ b/meshio/vtk_io.py
@@ -291,7 +291,6 @@ def read_buffer(f):
]
points = _generate_points(axis)
c, ct = _generate_cells(dim=dataset["DIMENSIONS"])
- pass
elif dataset["type"] == "RECTILINEAR_GRID":
axis = [
dataset["X_COORDINATES"], | remove unnecessary 'pass' after if statement | nschloe_meshio | train | py |
db0e42715440fbc3255535b0f341e5cb38413723 | diff --git a/sekizai_processors/__init__.py b/sekizai_processors/__init__.py
index <HASH>..<HASH> 100644
--- a/sekizai_processors/__init__.py
+++ b/sekizai_processors/__init__.py
@@ -1 +1 @@
-__version__ = '0.0.1'
+__version__ = '0.1.0' | Bump to version <I> | jrief_django-sass-processor | train | py |
b0ca9be0425ff8b05c465b0870023b9101728dee | diff --git a/pagoda/physics.py b/pagoda/physics.py
index <HASH>..<HASH> 100644
--- a/pagoda/physics.py
+++ b/pagoda/physics.py
@@ -266,11 +266,11 @@ class Motor(object):
the motor.
'''
- def __init__(self, name, world, body_a, body_b=None, feedback=False, dof=3, **kwargs):
+ def __init__(self, name, world, body_a, body_b=None, feedback=False, dof=3, jointgroup=None):
self.name = name
if isinstance(world, World):
world = world.ode_world
- self.ode_motor = self.MOTOR_FACTORY(world)
+ self.ode_motor = self.MOTOR_FACTORY(world, jointgroup=jointgroup)
self.ode_motor.attach(body_a.ode_body, body_b.ode_body if body_b else None)
self.ode_motor.setFeedback(feedback)
self.ode_motor.setNumAxes(dof) | Allow motors to be in a joint group. | EmbodiedCognition_pagoda | train | py |
41c4e0ecc00cf9212b6c338183bf694e067f8673 | diff --git a/src/Typo3SiteConfiguration.php b/src/Typo3SiteConfiguration.php
index <HASH>..<HASH> 100644
--- a/src/Typo3SiteConfiguration.php
+++ b/src/Typo3SiteConfiguration.php
@@ -64,7 +64,7 @@ class Typo3SiteConfiguration extends SiteConfiguration
{
// Check if the data is already cached
$siteConfiguration = $useCache ? $this->getCache()->require($this->cacheIdentifier) : false;
- if ($siteConfiguration !== false) {
+ if ($siteConfiguration !== false && $siteConfiguration !== null) {
return $siteConfiguration;
}
$finder = new Finder(); | [BUGFIX] Fix TypeError in TYPO3 9 | helhum_typo3-config-handling | train | php |
6fe4261daf019bdcebc0124ba70b3f2cec7610f0 | diff --git a/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/rest/server/interceptor/AuditingInterceptor.java b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/rest/server/interceptor/AuditingInterceptor.java
index <HASH>..<HASH> 100644
--- a/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/rest/server/interceptor/AuditingInterceptor.java
+++ b/hapi-fhir-structures-dstu/src/main/java/ca/uhn/fhir/rest/server/interceptor/AuditingInterceptor.java
@@ -114,6 +114,10 @@ public class AuditingInterceptor extends InterceptorAdapter {
log.debug("No auditing configured.");
return true;
}
+ if(theResponseObject == null || theResponseObject.isEmpty()){
+ log.debug("No bundle to audit");
+ return true;
+ }
try{
log.info("Auditing bundle: " + theResponseObject + " from request " + theRequestDetails);
SecurityEvent auditEvent = new SecurityEvent();
@@ -163,6 +167,10 @@ public class AuditingInterceptor extends InterceptorAdapter {
log.debug("No auditing configured.");
return true;
}
+ if(theResponseObject == null){
+ log.debug("No object to audit");
+ return true;
+ }
try{
log.info("Auditing resource: " + theResponseObject + " from request: " + theRequestDetails);
SecurityEvent auditEvent = new SecurityEvent(); | added a check for null resources in auditing interceptor | jamesagnew_hapi-fhir | train | java |
266ce78125e44ec72fa32584ad1ad92735a2ea1f | diff --git a/numina/core/__init__.py b/numina/core/__init__.py
index <HASH>..<HASH> 100644
--- a/numina/core/__init__.py
+++ b/numina/core/__init__.py
@@ -40,3 +40,6 @@ from .dataholders import Product
from .oresult import obsres_from_dict
from .qc import QC
+# FIXME: these two are deprecated
+FrameDataProduct = DataFrameType
+DataProduct = DataProductType | Readd two deprecated types (needed by GTC) | guaix-ucm_numina | train | py |
3b79577fad13fd781d477c863c78ab71b404951f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -41,7 +41,7 @@ extensions = [
]
setup(
- name='dask_ml',
+ name='dask-ml',
description='A library for distributed and parallel machine learning',
long_description=long_description,
url='https://github.com/dask/dask-ml', | PKG: Change name in setup.py | dask_dask-ml | train | py |
d0223261a7f0e37767f7c78250f18b5704dcfe65 | diff --git a/cdm/src/main/java/ucar/nc2/iosp/mcidas/McIDASAreaProjection.java b/cdm/src/main/java/ucar/nc2/iosp/mcidas/McIDASAreaProjection.java
index <HASH>..<HASH> 100644
--- a/cdm/src/main/java/ucar/nc2/iosp/mcidas/McIDASAreaProjection.java
+++ b/cdm/src/main/java/ucar/nc2/iosp/mcidas/McIDASAreaProjection.java
@@ -378,6 +378,10 @@ public class McIDASAreaProjection extends ucar.unidata.geoloc.ProjectionImpl {
|| ProjectionPointImpl.isInfinite(pt2)) {
return true;
}
+ if (Double.isNaN(pt1.getX()) || Double.isNaN(pt1.getY())
+ || Double.isNaN(pt2.getX()) || Double.isNaN(pt2.getY())) {
+ return true;
+ }
// opposite signed X values, larger then 5000 km
return (pt1.getX() * pt2.getX() < 0)
&& (Math.abs(pt1.getX() - pt2.getX()) > 5000.0); | mcidas nav modules produce NaN for missing not Infinite. Add
a check for NaN's to clean up the rendering | Unidata_thredds | train | java |
caa92600958b432543d3a2b08aea40aa786c98a5 | diff --git a/findbugs/src/java/edu/umd/cs/findbugs/FindFinalizeInvocations.java b/findbugs/src/java/edu/umd/cs/findbugs/FindFinalizeInvocations.java
index <HASH>..<HASH> 100644
--- a/findbugs/src/java/edu/umd/cs/findbugs/FindFinalizeInvocations.java
+++ b/findbugs/src/java/edu/umd/cs/findbugs/FindFinalizeInvocations.java
@@ -51,7 +51,8 @@ public class FindFinalizeInvocations extends BytecodeScanningDetector implements
if (seen == INVOKEVIRTUAL && nameConstant.equals("finalize"))
bugReporter.reportBug(new BugInstance("FI_EXPLICIT_INVOCATION", NORMAL_PRIORITY)
.addClassAndMethod(this)
- .addCalledMethod(this));
+ .addCalledMethod(this).describe("METHOD_CALLED")
+ .addSourceLine(this, PC));
if (seen == INVOKESPECIAL && nameConstant.equals("finalize"))
sawSuperFinalize = true;
} | Updated to describe called method annotation more accurately,
and to include a source line annotation for the call site.
git-svn-id: <URL> | spotbugs_spotbugs | train | java |
ce239ea83bf8a478ad8e9f7197e190288484dbbb | diff --git a/src/bootstrap-table.js b/src/bootstrap-table.js
index <HASH>..<HASH> 100644
--- a/src/bootstrap-table.js
+++ b/src/bootstrap-table.js
@@ -385,9 +385,6 @@
},
onResetView: function () {
return false;
- },
- onPostInit: function () {
- return false;
}
};
@@ -481,8 +478,7 @@
'expand-row.bs.table': 'onExpandRow',
'collapse-row.bs.table': 'onCollapseRow',
'refresh-options.bs.table': 'onRefreshOptions',
- 'reset-view.bs.table': 'onResetView',
- 'post-init.bs.table': 'onPostInit'
+ 'reset-view.bs.table': 'onResetView'
};
BootstrapTable.prototype.init = function () {
@@ -496,7 +492,6 @@
this.initPagination();
this.initBody();
this.initServer();
- this.trigger('post-init');
};
BootstrapTable.prototype.initLocale = function () { | Added support fiter-cotnrol | wenzhixin_bootstrap-table | train | js |
cba94b8cf631cfb9f2aabf3115d1a216f72c2ca4 | diff --git a/src/clusterpost-model/index.js b/src/clusterpost-model/index.js
index <HASH>..<HASH> 100644
--- a/src/clusterpost-model/index.js
+++ b/src/clusterpost-model/index.js
@@ -25,6 +25,7 @@ exports.input = Joi.object().keys({
uri: Joi.string()
}).optional(),
local_storage: Joi.boolean().optional(),
+ type: Joi.String().optional(),
local : Joi.object({
"useDefault": Joi.boolean().optional(),
"key": Joi.string().optional(), | ENH: Add type as an option for the input | juanprietob_clusterpost | train | js |
c4d7a40f029c71305acecd229cace733fbb29132 | diff --git a/test_util.go b/test_util.go
index <HASH>..<HASH> 100644
--- a/test_util.go
+++ b/test_util.go
@@ -114,12 +114,14 @@ func (rec *Recorder) T() *testing.T {
// shown when the test fails. Note that a part at the end
// of output that is not newline-terminated is not displayed.
type TestLog struct {
+ buf []byte
acc []byte
t *testing.T
}
func NewTestLog(t *testing.T) *TestLog {
- return &TestLog{make([]byte, 0, 1024), t}
+ buf := make([]byte, 0, 1024)
+ return &TestLog{buf, buf[:0], t}
}
func (tl *TestLog) Write(p []byte) (n int, err error) {
@@ -132,7 +134,7 @@ func (tl *TestLog) Write(p []byte) (n int, err error) {
}
}
if s == len(tl.acc) {
- tl.acc = tl.acc[:0] // try to preserve slice capacity
+ tl.acc = tl.buf[:0]
} else {
tl.acc = tl.acc[s:]
} | Slightly more efficient log buffering for tests. | contactless_wbgo | train | go |
943a939c2995595b39b2e19906c46e4cb0f37cca | diff --git a/retrieval/target.go b/retrieval/target.go
index <HASH>..<HASH> 100644
--- a/retrieval/target.go
+++ b/retrieval/target.go
@@ -227,7 +227,7 @@ func (t *target) StopScraper() {
t.stopScraper <- true
}
-const acceptHeader = `application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=delimited;q=0.7,text/plain;version=0.0.4;q=0.3,application/json;schema=prometheus/telemetry;version=0.0.2;q=0.2,*/*;q=0.1`
+const acceptHeader = `application/vnd.google.protobuf;proto=io.prometheus.client.MetricFamily;encoding=delimited;q=0.7,text/plain;version=0.0.4;q=0.3,application/json;schema="prometheus/telemetry";version=0.0.2;q=0.2,*/*;q=0.1`
func (t *target) scrape(ingester extraction.Ingester) (err error) {
timestamp := clientmodel.Now() | Fix the accept header.
A '/' is a separator and has to be in a quoted string.
Change-Id: If7a3a<I>f<I>f8f<I>d<I>dc<I>b5b<I>e<I>c | prometheus_prometheus | train | go |
94b6e821cc0c2de7ba8bf93b220e7d8019da473a | diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index <HASH>..<HASH> 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,5 +1,5 @@
[bumpversion]
-current_version = 0.4.6
+current_version = 0.4.7
commit = True
tag = True
diff --git a/dbt/version.py b/dbt/version.py
index <HASH>..<HASH> 100644
--- a/dbt/version.py
+++ b/dbt/version.py
@@ -58,7 +58,7 @@ def get_version_information():
def is_latest():
return installed == latest
-__version__ = '0.4.6'
+__version__ = '0.4.7'
installed = get_version()
latest = get_latest_version()
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
import os.path
package_name = "dbt"
-package_version = "0.4.6"
+package_version = "0.4.7"
setup(
name=package_name, | <I> bump b/c of hook bug | fishtown-analytics_dbt | train | cfg,py,py |
c017fec84fafb3d0b44a27008a7b42180f97f72a | diff --git a/src/com/google/javascript/jscomp/TypeInference.java b/src/com/google/javascript/jscomp/TypeInference.java
index <HASH>..<HASH> 100644
--- a/src/com/google/javascript/jscomp/TypeInference.java
+++ b/src/com/google/javascript/jscomp/TypeInference.java
@@ -658,6 +658,12 @@ class TypeInference
private FlowScope traverseObjectLiteral(Node n, FlowScope scope) {
ObjectType objectType = (ObjectType) n.getJSType();
+ if (objectType == null) {
+ // This will only happen if someone didn't run typed scope creation
+ // properly.
+ return scope;
+ }
+
// Object literals can be reflected on other types.
// See CodingConvention#getObjectLiteralCase and goog.object.reflect.
// Ignore these types of literals. | quick shim
DELTA=6 (6 added, 0 deleted, 0 changed)
Revision created by MOE tool push_codebase.
MOE_MIGRATION=<I>
git-svn-id: <URL> | google_closure-compiler | train | java |
414d0307c9b61145ac17cb87b2d00d3dae6babbe | diff --git a/reflect_struct_decoder.go b/reflect_struct_decoder.go
index <HASH>..<HASH> 100644
--- a/reflect_struct_decoder.go
+++ b/reflect_struct_decoder.go
@@ -995,7 +995,7 @@ func (decoder *structFieldDecoder) Decode(ptr unsafe.Pointer, iter *Iterator) {
fieldPtr := decoder.field.UnsafeGet(ptr)
decoder.fieldDecoder.Decode(fieldPtr, iter)
if iter.Error != nil && iter.Error != io.EOF {
- iter.Error = fmt.Errorf("%s: %s", decoder.field.Name, iter.Error.Error())
+ iter.Error = fmt.Errorf("%s: %s", decoder.field.Name(), iter.Error.Error())
}
} | fix struct decoder report error | json-iterator_go | train | go |
545d80c55f196562cc080ef9dafd924cad2b01bb | diff --git a/tasks/deployments.js b/tasks/deployments.js
index <HASH>..<HASH> 100644
--- a/tasks/deployments.js
+++ b/tasks/deployments.js
@@ -198,7 +198,7 @@ module.exports = function(grunt) {
});
grunt.log.writeln("Creating DUMP of remote database");
- cmd = tpl_ssh + " \ " + tpl_mysqldump;
+ cmd = tpl_ssh + " \\ " + tpl_mysqldump;
}
// Capture output... | Corrected JSHint errors | getdave_grunt-deployments | train | js |
907d624bf64a78e55ffbbcc0e1c9f7a719feb31f | diff --git a/base/src/main/java/uk/ac/ebi/atlas/resource/DataFileHub.java b/base/src/main/java/uk/ac/ebi/atlas/resource/DataFileHub.java
index <HASH>..<HASH> 100644
--- a/base/src/main/java/uk/ac/ebi/atlas/resource/DataFileHub.java
+++ b/base/src/main/java/uk/ac/ebi/atlas/resource/DataFileHub.java
@@ -48,7 +48,7 @@ public class DataFileHub {
@Inject
public DataFileHub(@Value("#{configuration['dataFilesLocation']}") String dataFilesLocation){
- Validate.notNull(dataFilesLocation);
+ Validate.notNull(dataFilesLocation, "Data files location not found - if this is a developement environment try maven clean/install");
this.dataFilesLocation = dataFilesLocation;
} | Add an extra line of explanation to be friendly to the future developers of Atlas | ebi-gene-expression-group_atlas | train | java |
1a7ba256dc78250c3e106c253097f9bfa1bdacee | diff --git a/autotest/pst_tests.py b/autotest/pst_tests.py
index <HASH>..<HASH> 100644
--- a/autotest/pst_tests.py
+++ b/autotest/pst_tests.py
@@ -479,6 +479,7 @@ def from_flopy_kl_test():
def from_flopy():
+
import shutil
import numpy as np
import pandas as pd
@@ -673,10 +674,13 @@ def from_flopy():
def from_flopy_test():
+ bd = os.getcwd()
try:
from_flopy()
except Exception as e:
+ os.chdir(bd)
raise Exception("error in from_flopy:"+str(e))
+ #print(os.getcwd())
def from_flopy_reachinput_test():
import pandas as pd
@@ -1010,7 +1014,8 @@ if __name__ == "__main__":
# add_pars_test()
# setattr_test()
# run_array_pars()
- from_flopy()
+ flopy_test()
+ #add_obs_test()
#from_flopy_kl_test()
# from_flopy_reachinput_test()
# plot_flopy_par_ensemble_test() | added chdir to fails coming out of from_flopy | jtwhite79_pyemu | train | py |
838df93cb5269def92cc4fd3cae0cd2a674492cd | diff --git a/src/directives/layertree.js b/src/directives/layertree.js
index <HASH>..<HASH> 100644
--- a/src/directives/layertree.js
+++ b/src/directives/layertree.js
@@ -84,6 +84,7 @@ ngeo.NgeoLayertreeController = function($scope, $element, $attrs) {
$scope['layertreeCtrl'] = this;
this['tree'] = tree;
this['map'] = map;
+ this['uid'] = goog.getUid(this);
$scope.$watch(treeExpr, goog.bind(function(newVal, oldVal) {
this['tree'] = newVal;
diff --git a/src/directives/layertreenode.js b/src/directives/layertreenode.js
index <HASH>..<HASH> 100644
--- a/src/directives/layertreenode.js
+++ b/src/directives/layertreenode.js
@@ -127,6 +127,7 @@ ngeo.LayertreenodeController = function(
this['layer'] = this.layer_;
this['map'] = map;
this['node'] = node;
+ this['uid'] = goog.getUid(this);
}; | Assign a uid to tree and child nodes | camptocamp_ngeo | train | js,js |
285b21a62cde2a1256a609b2e509ea400f682746 | diff --git a/src/KrToolBaseClass.php b/src/KrToolBaseClass.php
index <HASH>..<HASH> 100644
--- a/src/KrToolBaseClass.php
+++ b/src/KrToolBaseClass.php
@@ -31,8 +31,8 @@ class KrToolBaseClass {
protected function show() {}
protected function outputException( Exception $e ) {
- global $kgBaseTool;
- $kgBaseTool->addOut( $e->getMessage() , 'pre' );
+ global $kgBase;
+ $kgBase->addOut( $e->getMessage() , 'pre' );
}
public function handleException( Exception $e ) { | Rename to (follows-up <I>f<I>) | Krinkle_toollabs-base | train | php |
9186ff5bdf72c9984dc15d2525d58d30bb9654a1 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -364,9 +364,10 @@ var V = function(selector) {
}
return this.handler();
};
- V.prototype.prepend = (selectedElement)=>{
+ V.prototype.prepend = (element)=>{
+ let _element = isElement(element) ? element : this.query(document, element)[0];
for (var i = this.nodes.length - 1; i >= 0; i--) {
- this.nodes[i].insertBefore(selectedElement, this.nodes[i].firstChild);
+ this.nodes[i].insertBefore(_element, this.nodes[i].firstChild);
}
return this.handler();
}; | Updated prepend so it accepts CSS selectors | jaszhix_vquery | train | js |
f78c2f53003e41c81149440fbab7abd33cc9e397 | diff --git a/aws/resource_aws_amplify_branch_test.go b/aws/resource_aws_amplify_branch_test.go
index <HASH>..<HASH> 100644
--- a/aws/resource_aws_amplify_branch_test.go
+++ b/aws/resource_aws_amplify_branch_test.go
@@ -49,6 +49,7 @@ func TestAccAWSAmplifyBranch_basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "custom_domains.#", "0"),
resource.TestCheckResourceAttr(resourceName, "destination_branch", ""),
resource.TestCheckResourceAttr(resourceName, "source_branch", ""),
+ resource.TestCheckResourceAttr(resourceName, "tags.%", "0"),
),
},
{ | Ensure that the number of tags is 0 | terraform-providers_terraform-provider-aws | train | go |
9536f9eccbc37dd21129304034728c9bd7819f57 | diff --git a/lib/Doctrine/ODM/PHPCR/Mapping/ClassMetadataFactory.php b/lib/Doctrine/ODM/PHPCR/Mapping/ClassMetadataFactory.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/ODM/PHPCR/Mapping/ClassMetadataFactory.php
+++ b/lib/Doctrine/ODM/PHPCR/Mapping/ClassMetadataFactory.php
@@ -154,8 +154,7 @@ class ClassMetadataFactory extends AbstractClassMetadataFactory
$this->registerParentOnField($subClass, $parentClass, $fieldName);
if ($mapping['type'] == ClassMetadata::MANY_TO_ONE) {
$subClass->mapManyToOne($mapping);
- }
- else {
+ } else {
$subclass->mapManyToMany($mapping);
}
} | Fixed CS (can't get used to that else ...) | doctrine_phpcr-odm | train | php |
6c59412607b9cbd656480c7d69d8f7637674e31f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -16,6 +16,9 @@ setup(
'Programming Language :: Python :: 2.7',
'License :: OSI Approved :: GNU Affero General Public License v3'
],
+ package_data = {
+ '': ['*.html'],
+ },
packages=find_packages(exclude=['*.tests']),
install_requires=[
'bottle>=0.12.5', | include html templates as package_data | UDST_urbansim | train | py |
87f013565977f8ed50d5f2906741b70b5c7024d5 | diff --git a/network/src/main/java/org/jboss/as/network/ClientMapping.java b/network/src/main/java/org/jboss/as/network/ClientMapping.java
index <HASH>..<HASH> 100644
--- a/network/src/main/java/org/jboss/as/network/ClientMapping.java
+++ b/network/src/main/java/org/jboss/as/network/ClientMapping.java
@@ -21,6 +21,7 @@
*/
package org.jboss.as.network;
+import java.io.Serializable;
import java.net.InetAddress;
/**
@@ -30,7 +31,7 @@ import java.net.InetAddress;
*
* @author Jason T. Greene
*/
-public class ClientMapping {
+public class ClientMapping implements Serializable {
private final InetAddress sourceNetworkAddress;
private final byte sourceNetworkMaskBits;
private final String destinationAddress; | Mark ClientMapping as serializable since it gets passed around in a clustered cache (and the ClientMapping contents are itself Serializable anyway) | wildfly_wildfly | train | java |
3e286478fa6fbf2ef9221bbddb37807244d5d062 | diff --git a/src/org/openscience/cdk/controller/AbstractController2D.java b/src/org/openscience/cdk/controller/AbstractController2D.java
index <HASH>..<HASH> 100644
--- a/src/org/openscience/cdk/controller/AbstractController2D.java
+++ b/src/org/openscience/cdk/controller/AbstractController2D.java
@@ -890,7 +890,7 @@ abstract class AbstractController2D implements MouseMotionListener, MouseListene
if (existingBond.getFlag(CDKConstants.ISAROMATIC))
{
newRing.getBond(2).setOrder(2.0);
- newRing.getBond(2).setOrder(2.0);
+ newRing.getBond(4).setOrder(2.0);
} else
{
newRing.getBond(1).setOrder(2.0); | fixes the drawing of benzene rings in jcp (code was strange - must have been a typo)
git-svn-id: <URL> | cdk_cdk | train | java |
df9341ab5967de841ef24ff47f3b4c9d9e41034f | diff --git a/src/Core.php b/src/Core.php
index <HASH>..<HASH> 100644
--- a/src/Core.php
+++ b/src/Core.php
@@ -596,7 +596,15 @@
if (!self::$_db_connection instanceof PDO) {
throw new Exception('Could not connect to the database, but not caught by PDO');
}
- self::getDBLink()->query('SET NAMES UTF8');
+ switch (self::getDBtype())
+ {
+ case 'mysql':
+ self::getDBLink()->query('SET NAMES UTF8');
+ break;
+ case 'pgsql':
+ self::getDBlink()->query('set client_encoding to UTF8');
+ break;
+ }
} catch (PDOException $e) {
throw new Exception("Could not connect to the database [" . $e->getMessage() . "], dsn: ".self::getDSN());
} catch (Exception $e) { | restore utf 8 setting for postgres | thebuggenie_b2db | train | php |
fecf799c00ec13938aa6a59c577e4b74d37784c2 | diff --git a/vendor/golang.org/x/net/http2/server_test.go b/vendor/golang.org/x/net/http2/server_test.go
index <HASH>..<HASH> 100644
--- a/vendor/golang.org/x/net/http2/server_test.go
+++ b/vendor/golang.org/x/net/http2/server_test.go
@@ -2327,7 +2327,7 @@ func TestServer_Response_ManyHeaders_With_Continuation(t *testing.T) {
}
// This previously crashed (reported by Mathieu Lonjaret as observed
-// while using Perkeep) because we got a DATA frame from the client
+// while using Camlistore) because we got a DATA frame from the client
// after the handler exited and our logic at the time was wrong,
// keeping a stream in the map in stateClosed, which tickled an
// invariant check later when we tried to remove that stream (via | vendor: revert Camlistore->Perkeep change made in vendor
Change-Id: Ieeb<I>cb4fab<I>fac<I>f0ce<I>c<I>dfe<I>e | perkeep_perkeep | train | go |
a9336b5510ea980a0a7394625426972d2205a204 | diff --git a/product_files.go b/product_files.go
index <HASH>..<HASH> 100644
--- a/product_files.go
+++ b/product_files.go
@@ -41,6 +41,12 @@ type ProductFile struct {
Size int `json:"size,omitempty" yaml:"size,omitempty"`
}
+const (
+ FileTypeSoftware = "Software"
+ FileTypeDocumentation = "Documentation"
+ FileTypeOpenSourceLicense = "Open Source License"
+)
+
func (p ProductFilesService) List(productSlug string) ([]ProductFile, error) {
url := fmt.Sprintf("/products/%s/product_files", productSlug) | Add file types as constants.
[#<I>] | pivotal-cf_go-pivnet | train | go |
2952dfc03041202e54b8f8addd38f02cf7fa13bd | diff --git a/modules/admin/src/resources/js/controllers.js b/modules/admin/src/resources/js/controllers.js
index <HASH>..<HASH> 100644
--- a/modules/admin/src/resources/js/controllers.js
+++ b/modules/admin/src/resources/js/controllers.js
@@ -112,6 +112,8 @@
return;
}
+ var blockRequest = false;
+
if ($scope.pager) {
if (n.length == 0) {
$timeout.cancel($scope.searchPromise);
@@ -119,15 +121,22 @@
$scope.config.pagerHiddenByAjaxSearch = false;
} else {
$timeout.cancel($scope.searchPromise);
+
+ if (blockRequest) {
+ return;
+ }
+
$scope.searchPromise = $timeout(function() {
if ($scope.config.fullSearchContainer) {
$scope.data.listArray = $filter('filter')($scope.config.fullSearchContainer, n);
$scope.config.pagerHiddenByAjaxSearch = true;
} else {
+ blockRequest = true;
$http.post($scope.config.apiEndpoint + '/full-response?' + $scope.config.apiListQueryString, {query: n}).success(function(response) {
$scope.config.pagerHiddenByAjaxSearch = true;
$scope.config.fullSearchContainer = response;
$scope.data.listArray = $filter('filter')(response, n);
+ blockRequest = false;
});
}
}, 500) | added block request var in order to make sure the full response request
can only run once as it takes usualy longer to resolve the request. #<I> | luyadev_luya | train | js |
00a1eb2b82e5b3f14fafc0a80384f1fab8192aed | diff --git a/lib/config/protractor.js b/lib/config/protractor.js
index <HASH>..<HASH> 100644
--- a/lib/config/protractor.js
+++ b/lib/config/protractor.js
@@ -4,8 +4,7 @@ module.exports = function(_, path, grunt) {// jshint ignore: line
var capabilities = [];
grunt.config('angularToolbox.e2eBrowsers').forEach(function(browser) {
capabilities.push({
- browserName: browser.toLowerCase(),
- platform: 'OS X 10.10'
+ browserName: browser.toLowerCase()
});
}); | chore: stop requireing OSX for protractor tests | Jimdo_grunt-angular-toolbox | train | js |
e5c1a4cabd2861494e58879d7507f0f581939f3d | diff --git a/libnetwork/iptables/firewalld.go b/libnetwork/iptables/firewalld.go
index <HASH>..<HASH> 100644
--- a/libnetwork/iptables/firewalld.go
+++ b/libnetwork/iptables/firewalld.go
@@ -151,7 +151,6 @@ func checkRunning() bool {
if connection != nil {
err = connection.sysobj.Call(dbusInterface+".getDefaultZone", 0).Store(&zone)
- logrus.Infof("Firewalld running: %t", err == nil)
return err == nil
}
return false | Remove firewalld running log
- The info it provides can be found elsewhere
The logs gets printed too often becasue of
the programming being done in the tasks | moby_moby | train | go |
9466f0da97bcd374071a7f8ef9b7258d45a56374 | diff --git a/warehouse/accounts/models.py b/warehouse/accounts/models.py
index <HASH>..<HASH> 100644
--- a/warehouse/accounts/models.py
+++ b/warehouse/accounts/models.py
@@ -59,7 +59,7 @@ class User(db.ModelBase):
return primaries[0].email
@email.expression
- def email(self): # noqa
+ def email(self):
return (
select([Email.email])
.where((Email.user_id == self.id) & (Email.primary == True)) # noqa | Remove a no longer needed # noqa | pypa_warehouse | train | py |
143ac734ba9d1de2caafb506050c7238472190b7 | diff --git a/internal/service/ce/anomaly_monitor_test.go b/internal/service/ce/anomaly_monitor_test.go
index <HASH>..<HASH> 100644
--- a/internal/service/ce/anomaly_monitor_test.go
+++ b/internal/service/ce/anomaly_monitor_test.go
@@ -260,26 +260,6 @@ resource "aws_ce_anomaly_monitor" "test" {
`, rName)
}
-func testAccAnomalyMonitorConfig_Dimension(rDimension string) string {
- return fmt.Sprintf(`
-resource "aws_ce_anomaly_monitor" "test" {
- name = "CEAnomalyTestMonitor"
- monitor_type = "DIMENSIONAL"
- monitor_dimension = %[1]q
-}
-`, rDimension)
-}
-
-func testAccAnomalyMonitorConfig_Type(rType string) string {
- return fmt.Sprintf(`
-resource "aws_ce_anomaly_monitor" "test" {
- name = "CEAnomalyTestMonitor"
- monitor_type = %[1]q
- monitor_dimension = "SERVICE"
-}
-`, rType)
-}
-
func testAccAnomalyMonitorConfig_Custom(rName string) string {
return fmt.Sprintf(`
resource "aws_ce_anomaly_monitor" "test" { | ce: Amend anomaly monitor tests
- Removed test config for Type and Dimension as they are now unused. | terraform-providers_terraform-provider-aws | train | go |
21fa0aa6a276fcced53fba384d926c13aa00d6a9 | diff --git a/backbone.js b/backbone.js
index <HASH>..<HASH> 100644
--- a/backbone.js
+++ b/backbone.js
@@ -731,7 +731,7 @@
};
// Cached regex for cleaning hashes.
- var hashStrip = /^#*/;
+ var hashStrip = /^#*!?/;
// Has the history handling already been started?
var historyStarted = false; | change hashStrip regex to strip bang as well, so hash-bang urls will work transparently | jashkenas_backbone | train | js |
ea3d5f7e8c028c152fe4890c80ed8a0337fcdcc4 | diff --git a/raven/events.py b/raven/events.py
index <HASH>..<HASH> 100644
--- a/raven/events.py
+++ b/raven/events.py
@@ -86,8 +86,8 @@ class Exception(BaseEvent):
'culprit': culprit,
'sentry.interfaces.Exception': {
'value': to_unicode(exc_value),
- 'type': exc_type,
- 'module': exc_module,
+ 'type': str(exc_type),
+ 'module': str(exc_module),
},
'sentry.interfaces.Stacktrace': {
'frames': frames | Ensure we coerce exc_type to a string | elastic_apm-agent-python | train | py |
f6d652235325da5938f38783f0d26e2bd4c7b93c | diff --git a/src/Routing/Router.php b/src/Routing/Router.php
index <HASH>..<HASH> 100644
--- a/src/Routing/Router.php
+++ b/src/Routing/Router.php
@@ -231,14 +231,13 @@ class Router
static::$_request = $request;
$uri = $request->getUri();
- $context = [
+ static::$_requestContext = [
'_scheme' => $uri->getScheme(),
'_host' => $uri->getHost(),
'_port' => $uri->getPort(),
'_base' => $request->getAttribute('base'),
- '_params' => $request->getAttribute('params', []),
+ 'params' => $request->getAttribute('params', []),
];
- static::$_requestContext = $context;
}
/**
@@ -433,8 +432,8 @@ class Router
'action' => 'index',
'_ext' => null,
];
- if (!empty($context['_params'])) {
- $params = $context['_params'];
+ if (!empty($context['params'])) {
+ $params = $context['params'];
}
$frag = ''; | Fix extra key being set in context. | cakephp_cakephp | train | php |
c6c60fadddb90012f94dc2aa105262f50e1c5bdd | diff --git a/pkg/policy/consumer.go b/pkg/policy/consumer.go
index <HASH>..<HASH> 100644
--- a/pkg/policy/consumer.go
+++ b/pkg/policy/consumer.go
@@ -28,7 +28,6 @@ import (
// security identity and an allow/deny decision for traffic from that identity.
type Consumer struct {
ID NumericIdentity
- Reverse *Consumer
DeletionMark bool
}
@@ -277,10 +276,6 @@ func (c *Consumable) BanConsumerLocked(id NumericIdentity) {
if c.wasLastRule(id) {
c.removeFromMaps(id)
}
-
- if consumer.Reverse != nil {
- c.deleteReverseRule(id, c.ID)
- }
}
} | pkg/policy: remove Reserved field from Consumer
This field is useless, as it is never populated. | cilium_cilium | train | go |
cd2f058f6fb93caa7d897b817b618bcf1860b623 | diff --git a/lib/nrser/described/cucumber/tokens/name.rb b/lib/nrser/described/cucumber/tokens/name.rb
index <HASH>..<HASH> 100644
--- a/lib/nrser/described/cucumber/tokens/name.rb
+++ b/lib/nrser/described/cucumber/tokens/name.rb
@@ -107,11 +107,11 @@ class Method < Name
quote :curly
class Singleton < Explicit
- name_class NRSER::Meta::Names::Method::Singleton
+ name_class NRSER::Meta::Names::Method::Explicit::Singleton
end
class Instance < Explicit
- name_class NRSER::Meta::Names::Method::Instance
+ name_class NRSER::Meta::Names::Method::Explicit::Instance
end
end # class Explicit
end # class Method | Had wrong names for explicit method tokens | nrser_nrser.rb | train | rb |
48f03c56d16b1fba80b88cea2f742509497c5645 | diff --git a/tests/tests.py b/tests/tests.py
index <HASH>..<HASH> 100644
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -230,16 +230,16 @@ class TestExtractions(unittest.TestCase):
# self.articleReport.append("TAGS: ")
# self.articleReport.append(article.tags)
# self.articleReport.append('\n')
- self.assertIsNotNone(article, msg=u"Resulting article was NULL!")
+ self.assertNotEqual(article, None, msg=u"Resulting article was NULL!")
if expectedTitle:
title = article.title
- self.assertIsNotNone(title, msg=u"Title was NULL!")
+ self.assertNotEqual(title, None, msg=u"Title was NULL!")
self.assertEqual(title, expectedTitle)
if expectedStart:
articleText = article.cleanedArticleText
- self.assertIsNotNone(articleText,
+ self.assertNotEqual(articleText, None,
msg=u"Resulting article text was NULL!")
self.assertTrue(len(expectedStart) <= len(articleText),
@@ -258,7 +258,7 @@ class TestExtractions(unittest.TestCase):
if expectedDescription:
description = article.metaDescription
- self.assertIsNotNone(description,
+ self.assertNotEqual(description, None,
msg="Meta Description was NULL!")
msg = u"Meta Description was not as expected!\nEXPECTED:%s\nGOT:%s" \
% (expectedDescription, description) | python <I> doesn't support assertIsNotNone | goose3_goose3 | train | py |
6b6197f4f10688084f73636c105096e091bc07f6 | diff --git a/src/ChannelManagers/LocalChannelManager.php b/src/ChannelManagers/LocalChannelManager.php
index <HASH>..<HASH> 100644
--- a/src/ChannelManagers/LocalChannelManager.php
+++ b/src/ChannelManagers/LocalChannelManager.php
@@ -173,7 +173,10 @@ class LocalChannelManager implements ChannelManager
$this->getLocalChannels($connection->app->id)
->then(function ($channels) use ($connection) {
- collect($channels)->each->unsubscribe($connection);
+ collect($channels)
+ ->each(function (Channel $channel) use ($connection) {
+ $channel->unsubscribe($connection);
+ });
collect($channels)
->reject->hasConnections() | fix unsubscribeFromAllChannels / stale connections
the `each->` call silently ran only for the first channel leading to
users on other channels seeming randomly not getting unsubscribed,
stale connections, a frustrated dev and a fishy smell all over the place.
after some serious hours of debugging and searching for this sneaky bug
the websocket-world is now a better place ;) | beyondcode_laravel-websockets | train | php |
20d5dd3336416717c0c308023c4c2aaae82c9535 | diff --git a/src/Aws/S3/StreamWrapper.php b/src/Aws/S3/StreamWrapper.php
index <HASH>..<HASH> 100644
--- a/src/Aws/S3/StreamWrapper.php
+++ b/src/Aws/S3/StreamWrapper.php
@@ -172,8 +172,8 @@ class StreamWrapper
}
// When using mode "x" validate if the file exists before attempting to read
- if ($mode == 'x' && !self::$client->doesObjectExist($params['Bucket'], $params['Key'], $this->getOptions())) {
- $errors[] = "{$path} does not exist on Amazon S3";
+ if ($mode == 'x' && self::$client->doesObjectExist($params['Bucket'], $params['Key'], $this->getOptions())) {
+ $errors[] = "{$path} already exists on Amazon S3";
}
if (!$errors) { | mode x must create if file does not exist | aws_aws-sdk-php | train | php |
1ced36db143a0ef68a0a05fd0faa8daa19205085 | diff --git a/lib/mobilize-base/tasks.rb b/lib/mobilize-base/tasks.rb
index <HASH>..<HASH> 100644
--- a/lib/mobilize-base/tasks.rb
+++ b/lib/mobilize-base/tasks.rb
@@ -127,8 +127,7 @@ namespace :mobilize do
end
end
desc "Set up config and log folders and files, populate from samples"
- task :setup, :env do |t,args|
- ENV['MOBILIZE_ENV']=args.env
+ task :setup_base do
config_dir = (ENV['MOBILIZE_CONFIG_DIR'] ||= "config/mobilize/")
log_dir = (ENV['MOBILIZE_LOG_DIR'] ||= "log/")
sample_dir = File.dirname(__FILE__) + '/../samples/' | updated tasks to have setup_base as method | DeNA_mobilize-base | train | rb |
233d062cbb2e14858aad6bbb1f0359d6dd81ee94 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -82,8 +82,8 @@ kwargs = dict(
packages=find_packages(exclude=['tests']),
install_requires=[
'tzlocal',
- 'pytz',
'python-dateutil',
+ 'pytzdata',
],
include_package_data=True,
tests_require=['pytest'], | Fixes dependencies in setup.py | sdispater_pendulum | train | py |
f07975f01350be25f3c043a28b76b17b53fdc5e5 | diff --git a/web/concrete/core/helpers/mime.php b/web/concrete/core/helpers/mime.php
index <HASH>..<HASH> 100644
--- a/web/concrete/core/helpers/mime.php
+++ b/web/concrete/core/helpers/mime.php
@@ -93,6 +93,7 @@ class Concrete5_Helper_Mime {
);
public function mimeFromExtension($extension) {
+ $extension = strtolower($extension);
$mime = array_search($extension, MimeHelper::$mime_types_and_extensions);
return $mime; | added strtolower to passed extension in mimeFromExtension to handle capitalized file extensions.
Former-commit-id: 9d1ed<I>f<I>bb<I>b<I>afa0b<I>c<I>e<I>a | concrete5_concrete5 | train | php |
c557713e0a8ac1075b28d6d0b31705dca662331c | diff --git a/lib/endpoints.js b/lib/endpoints.js
index <HASH>..<HASH> 100644
--- a/lib/endpoints.js
+++ b/lib/endpoints.js
@@ -8,26 +8,30 @@ module.exports = [
'Geosatellite',
'Gribfiles',
'Icemap',
+ 'Lightning',
'Locationforecast',
'LocationforecastLTS',
+ 'MetAlerts',
'Metgm',
'Mountaineasterobservations',
+ 'Nowcast',
'Oceanforecast',
'Polarsatellite',
'Probabilityforecast',
'Radar',
- 'Seaapproachforecast',
- 'Seasonforecast',
+ 'Radarlightning',
+ 'Sigmets',
+ 'Spotwind',
'Subjectiveforecast',
'Sunrise',
+ 'Tafmetar',
'Temperatureverification',
'Textforecast',
'Textlocation',
'Tidalwater',
- 'Trondheimsleia',
'Turbulence',
'UVforecast',
- 'Weatherformetnosite',
- 'Weathericon',
- 'Windforecast'
+ 'Upperwindweather',
+ 'VerticalProfile',
+ 'Weathericon'
]; | Updated endpoint to match what is currently available (#5)
<URL> | evanshortiss_yr.no-interface | train | js |
2c24e5c83b9857567091efd0a78d94d33c0ef0d0 | diff --git a/forms/HtmlEditorConfig.php b/forms/HtmlEditorConfig.php
index <HASH>..<HASH> 100644
--- a/forms/HtmlEditorConfig.php
+++ b/forms/HtmlEditorConfig.php
@@ -109,7 +109,7 @@ class HtmlEditorConfig {
* @return mixed - The value of the specified option
*/
function getOption($k) {
- return $this->settings[$k];
+ if(isset($this->settings[$k])) return $this->settings[$k];
}
/** | BUGFIX: Don't throw a notice-level error if you access a setting that hasn't been set yet.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/<I>@<I> <I>b<I>ca-7a2a-<I>-9d3b-<I>d<I>a<I>a9 | silverstripe_silverstripe-framework | train | php |
d6135afc8c712c78dee67cdf252490e2726cf598 | diff --git a/src/inject/injectors.py b/src/inject/injectors.py
index <HASH>..<HASH> 100644
--- a/src/inject/injectors.py
+++ b/src/inject/injectors.py
@@ -147,11 +147,7 @@ class Injector(object):
def __contains__(self, type):
'''Return True if type is bound, else return False.'''
- for scope in self._scopes_stack:
- if type in scope:
- return True
-
- return False
+ return self.is_bound(type)
def bind(self, type, to=None):
'''Specify a binding for a type in the application scope.'''
diff --git a/src/inject_tests/injectors_tests.py b/src/inject_tests/injectors_tests.py
index <HASH>..<HASH> 100644
--- a/src/inject_tests/injectors_tests.py
+++ b/src/inject_tests/injectors_tests.py
@@ -175,6 +175,12 @@ class InjectorRegisterTestCase(unittest.TestCase):
def tearDown(self):
Injector.cls_unregister()
+ def testCreate(self):
+ '''Injector.create should instantiate and register and injector.'''
+ injector = Injector.create()
+
+ self.assertTrue(injector.is_registered())
+
def testRegisterUnregister(self):
injector = Injector()
injector2 = Injector() | Injector.create which instaticates and registers an injector. | ivankorobkov_python-inject | train | py,py |
a3e828da692c32fbd8e27a29e17fcc4dfbd94d0f | diff --git a/code/libraries/koowa/components/com_files/databases/rows/node.php b/code/libraries/koowa/components/com_files/databases/rows/node.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/components/com_files/databases/rows/node.php
+++ b/code/libraries/koowa/components/com_files/databases/rows/node.php
@@ -21,7 +21,7 @@ class ComFilesDatabaseRowNode extends KDatabaseRowAbstract
{
parent::__construct($config);
- $this->mixin(new KMixinCommandchain($config->append(array('mixer' => $this))));
+ $this->mixin(new KCommandMixin($config->append(array('mixer' => $this))));
if ($config->validator !== false)
{ | Move KMixin into KObjectMixin | joomlatools_joomlatools-framework | train | php |
8e15c0192402104141f01f8d83c7056426b8053d | diff --git a/src/Gitlab/Models/User.php b/src/Gitlab/Models/User.php
index <HASH>..<HASH> 100644
--- a/src/Gitlab/Models/User.php
+++ b/src/Gitlab/Models/User.php
@@ -350,7 +350,21 @@ class User implements ResponseClassInterface
{
$this->website_url = $website_url;
}
+
+ /**
+ * @return mixed
+ */
+ public function getAvatarUrl()
+ {
+ return $this->avatar_url;
+ }
+ /**
+ * @param string $avatar_url
+ */
+ public function setAvatarUrl($avatar_url)
+ {
+ $this->avatar_url = $avatar_url;
+ }
-
-}
\ No newline at end of file
+} | Missed getter/setted | cnam_gitlab-api | train | php |
5cbfab596e063f3944093d5731b82fc301162ff7 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -5,6 +5,10 @@ from setuptools import setup
from capidup.version import __version__
+def read_file(path):
+ with open(path, 'r') as f:
+ return f.read()
+
setup(
name='capidup',
description='Quickly find duplicate files in directories',
@@ -30,14 +34,5 @@ setup(
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Filesystems',
],
- long_description="""
-CapiDup recursively crawls through all the files in a list of directories and
-identifies duplicate files. Duplicate files are files with the exact same
-content, regardless of their name, location or timestamp.
-
-This program is designed to be quite fast. It uses a smart algorithm to detect
-and group duplicate files using a single pass on each file (that is, CapiDup
-doesn't need to compare each file to every other).
-
-"""
+ long_description=read_file('README.rst'),
) | setup.py: Use long description directly from README.rst.
Will be useful for PyPi, which formats the description nicely. | israel-lugo_capidup | train | py |
94792311333811795af47c198e3e56cd41b837af | diff --git a/roku/core.py b/roku/core.py
index <HASH>..<HASH> 100644
--- a/roku/core.py
+++ b/roku/core.py
@@ -34,6 +34,9 @@ COMMANDS = {
'enter': 'Enter',
'literal': 'Lit',
'power': 'Power',
+ 'volume_down': 'VolumeDown',
+ 'volume_mute': 'VolumeMute',
+ 'volume_up': 'VolumeUp',
}
SENSORS = ('acceleration', 'magnetic', 'orientation', 'rotation') | Segadude volume keys (#<I>)
* Added volume key support
Added support for the Volume Up, Volume Down and Mute buttons for Roku
TVs.
* Renamed volume commands
Renamed volume commands to include underscores between the words
* Removed extra files
Removed the extra directories and files that got added | jcarbaugh_python-roku | train | py |
990f3be0b79463f945520dabb55bcff89336bb62 | diff --git a/vtki/plotting.py b/vtki/plotting.py
index <HASH>..<HASH> 100644
--- a/vtki/plotting.py
+++ b/vtki/plotting.py
@@ -1882,6 +1882,8 @@ class BasePlotter(object):
def write_frame(self):
""" Writes a single frame to the movie file """
+ if not hasattr(self, 'mwriter'):
+ raise AssertionError('This plotter has not opened a movie or GIF file.')
self.mwriter.append_data(self.image)
@property | Add more insightful error for write_frame if movie not open | vtkiorg_vtki | train | py |
c0aec46bf16f44d8143d42cd8c425f08ff63fe55 | diff --git a/lib/Alchemy/Phrasea/Application/Root.php b/lib/Alchemy/Phrasea/Application/Root.php
index <HASH>..<HASH> 100644
--- a/lib/Alchemy/Phrasea/Application/Root.php
+++ b/lib/Alchemy/Phrasea/Application/Root.php
@@ -34,7 +34,9 @@ return call_user_func(function($environment = PhraseaApplication::ENV_PROD) {
return $app->redirectPath('homepage');
}
} else {
- $app['firewall']->requireSetup();
+ if (false === strpos($request->getPathInfo(), '/include/minify')) {
+ $app['firewall']->requireSetup();
+ }
}
}); | Allow call to minifier whenever application is not installed | alchemy-fr_Phraseanet | train | php |
68fa7c0ae94bc9cc782c6777cfa014ebb7c404ab | diff --git a/src/analytics-test.js b/src/analytics-test.js
index <HASH>..<HASH> 100644
--- a/src/analytics-test.js
+++ b/src/analytics-test.js
@@ -215,6 +215,9 @@
var nonexistent = analytics.utils.getUrlParameter(urlSearchParameter, 'variable');
expect(nonexistent).to.equal();
+
+ var nonexistent2 = analytics.utils.getUrlParameter('', 'ajs_event');
+ expect(nonexistent).to.equal();
});
test('isEmail matches emails', function () { | adding another test for blank window.location.search | segmentio_analytics.js-core | train | js |
f0881e30287d22bb842eedd3e03dfa2511e65005 | diff --git a/rb/lib/selenium/webdriver/remote/http/default.rb b/rb/lib/selenium/webdriver/remote/http/default.rb
index <HASH>..<HASH> 100644
--- a/rb/lib/selenium/webdriver/remote/http/default.rb
+++ b/rb/lib/selenium/webdriver/remote/http/default.rb
@@ -32,10 +32,10 @@ module Selenium
MAX_RETRIES = 3
def request(verb, url, headers, payload, redirects = 0)
- request = new_request_for(verb, url, headers, payload)
-
retries = 0
+
begin
+ request = new_request_for(verb, url, headers, payload)
response = response_for(request)
rescue Errno::ECONNABORTED, Errno::ECONNRESET, Errno::EADDRINUSE
# a retry is sometimes needed on Windows XP where we may quickly
@@ -46,11 +46,16 @@ module Selenium
#
# http://msdn.microsoft.com/en-us/library/aa560610%28v=bts.20%29.aspx
raise if retries >= MAX_RETRIES
-
- request = new_request_for(verb, url, headers, payload)
retries += 1
retry
+ rescue Errno::EADDRNOTAVAIL => ex
+ # a retry is sometimes needed when the port becomes temporarily unavailable
+ raise if retries >= MAX_RETRIES
+ retries += 1
+ sleep 2
+ retry
+
rescue Errno::ECONNREFUSED => ex
if use_proxy?
raise ex.class, "using proxy: #{proxy.http}" | rb: retry ports unavailable by EADDRNOTAVAIL
This situation might occur when we exhaust the temporary port range on
a machine with many TCP connections. It takes some time for the
temporary sockets to be returned to the reusable pool, and in that
short timespan there may be race conditions. | SeleniumHQ_selenium | train | rb |
bee4ddb813d880736844346b059221b3c3ff3144 | diff --git a/src/graphite/kernel.js b/src/graphite/kernel.js
index <HASH>..<HASH> 100644
--- a/src/graphite/kernel.js
+++ b/src/graphite/kernel.js
@@ -142,6 +142,7 @@ const runStep = (step: Graph<any>, payload: any, pendingEvents) => {
}
const runGraph = (fifo: FIFO) => {
const {step: graph, firstIndex, scope, resetStop} = fifo.value
+ meta.val = graph.val
for (
let stepn = firstIndex;
stepn < graph.seq.length && !meta.stop;
@@ -187,12 +188,10 @@ const runStep = (step: Graph<any>, payload: any, pendingEvents) => {
meta.stop = false
}
}
- const meta: Meta = {
- callstack: [],
+ const meta = {
pendingEvents,
stop: false,
- scope: [],
- val: {},
+ val: step.val,
}
runFifo() | pass graph's local scope as second argument to commands | zerobias_effector | train | js |
7d19312d44a894693052c3810f54774a0db5bc44 | diff --git a/gns3server/version.py b/gns3server/version.py
index <HASH>..<HASH> 100644
--- a/gns3server/version.py
+++ b/gns3server/version.py
@@ -23,7 +23,7 @@
# or negative for a release candidate or beta (after the base version
# number has been incremented)
-__version__ = "2.1.0rc2"
+__version__ = "2.1.0dev8"
__version_info__ = (2, 1, 0, -99)
# If it's a git checkout try to add the commit | Development on <I>dev8 | GNS3_gns3-server | train | py |
9ba4da95d346e92a9d947fcb838362200bf755fb | diff --git a/qunit/qunit.js b/qunit/qunit.js
index <HASH>..<HASH> 100644
--- a/qunit/qunit.js
+++ b/qunit/qunit.js
@@ -372,6 +372,10 @@ var config = {
i--;
config.noglobals = true;
}
+ else if ( GETParams[i].search('=') != -1 ) {
+ GETParams.splice( i, 1 );
+ i--;
+ }
}
// restrict modules/tests by get parameters | Took into account a fringe case when using qunit with testswarm. Trying to run all the tests with the extra url params from testswarm would make qunit look for a testsuite that did not exist | JamesMGreene_qunit-assert-html | train | js |
b8ba371934c7df93d05e9a7304fba2ce1abae535 | diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/knife/bootstrap_spec.rb
+++ b/spec/unit/knife/bootstrap_spec.rb
@@ -442,6 +442,7 @@ describe Chef::Knife::Bootstrap do
end
it "doesn't create /etc/chef/trusted_certs if :trusted_certs_dir is empty" do
+ allow(Dir).to receive(:glob).and_call_original
expect(Dir).to receive(:glob).with(File.join(trusted_certs_dir, "*.{crt,pem}")).and_return([])
expect(rendered_template).not_to match(%r{mkdir -p /etc/chef/trusted_certs})
end | Fix failing spec
This didn't work due to changes to dir calls in rubygems. | chef_chef | train | rb |
743208af4e2e31dd9c6630c4b92e9a21d80b2420 | diff --git a/WrightTools/fit.py b/WrightTools/fit.py
index <HASH>..<HASH> 100644
--- a/WrightTools/fit.py
+++ b/WrightTools/fit.py
@@ -592,6 +592,7 @@ class Moments(Function):
*args
**kwargs
"""
+ y, x = args
y_internal = np.ma.copy(y)
x_internal = np.ma.copy(x)
# x must be ascending here, because of how np.trapz works | Return line that was accidentally removed from Moments.fit | wright-group_WrightTools | train | py |
8d48a6dede1892fdfd90d880bc8b183ccc99d6e2 | diff --git a/test/tabs4life.spec.js b/test/tabs4life.spec.js
index <HASH>..<HASH> 100644
--- a/test/tabs4life.spec.js
+++ b/test/tabs4life.spec.js
@@ -8,6 +8,8 @@ var execOptions = {
};
describe('Grunt tabs4life', function () {
+ this.timeout(5000);
+
describe('when checking self', function () {
it('should be lint free', function (done) {
exec('grunt', execOptions, function (error, stdout) { | Increased timeout because it's running slow on travis-ci ... | chesleybrown_grunt-tabs4life | train | js |
4bd83443f879c3ce145b9c2720e339b20134be54 | diff --git a/public/app/plugins/datasource/influxdb/queryCtrl.js b/public/app/plugins/datasource/influxdb/queryCtrl.js
index <HASH>..<HASH> 100644
--- a/public/app/plugins/datasource/influxdb/queryCtrl.js
+++ b/public/app/plugins/datasource/influxdb/queryCtrl.js
@@ -35,7 +35,13 @@ function (angular, _, InfluxQueryBuilder) {
$scope.tagSegments.push(MetricSegment.newCondition(tag.condition));
}
$scope.tagSegments.push(new MetricSegment({value: tag.key, type: 'key', cssClass: 'query-segment-key' }));
- $scope.tagSegments.push(MetricSegment.newOperator(tag.operator));
+ if (tag.operator) {
+ $scope.tagSegments.push(MetricSegment.newOperator(tag.operator));
+ } else if (/^\/.*\/$/.test(tag.value)) {
+ $scope.tagSegments.push(MetricSegment.newOperator('=~'));
+ } else {
+ $scope.tagSegments.push(MetricSegment.newOperator('='));
+ }
$scope.tagSegments.push(new MetricSegment({value: tag.value, type: 'value', cssClass: 'query-segment-value'}));
}); | Fixing issue for missing tag.operator
This should fix the case from when we migrate from a version that doesn't contain tag.operator. | grafana_grafana | train | js |
596f0ee284cba84a7b9023410871ceb056263121 | diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Database/Query/Builder.php
+++ b/src/Illuminate/Database/Query/Builder.php
@@ -2577,7 +2577,7 @@ class Builder
}
/**
- * Get an array with the values of a given column.
+ * Get a collection instance containing the values of a given column.
*
* @param string $column
* @param string|null $key | [8.x] Corrected the PHPDoc description for pluck() (#<I>)
* Corrected the PHPDoc description for pluck()
Although the return type was correct, the description mentioned that an array will be returned but in practice, pluck returns a collection.
* Update Builder.php
* Update Builder.php | laravel_framework | train | php |
7e37b8996a170483992548143d9152890eb0531f | diff --git a/tests/compiler.js b/tests/compiler.js
index <HASH>..<HASH> 100644
--- a/tests/compiler.js
+++ b/tests/compiler.js
@@ -694,13 +694,6 @@
{ name: 'thedude', data: {tmpl: 'include.html'} },
'hello world FooInclude thedude');
- equal('hello world {% include "missing.html" ignore missing %}',
- 'hello world ');
-
- equal('hello world {% include "missing.html" ignore missing %}',
- { name: 'thedude' },
- 'hello world ');
-
finish(done);
});
@@ -718,7 +711,7 @@
finish(done);
});
- it('should include templates that does not exist if the error is suppressed', function(done) {
+ it('should fail silently on missing templates if requested', function(done) {
equal('hello world {% include "missing.html" ignore missing %}',
'hello world '); | removed duplicated tests, improved wording of one test | mozilla_nunjucks | train | js |
096b7f4a921f7e36a81478876994debd2d378a86 | diff --git a/cas-server-core/src/main/java/org/jasig/cas/services/DefaultServicesManagerImpl.java b/cas-server-core/src/main/java/org/jasig/cas/services/DefaultServicesManagerImpl.java
index <HASH>..<HASH> 100644
--- a/cas-server-core/src/main/java/org/jasig/cas/services/DefaultServicesManagerImpl.java
+++ b/cas-server-core/src/main/java/org/jasig/cas/services/DefaultServicesManagerImpl.java
@@ -110,7 +110,7 @@ public final class DefaultServicesManagerImpl implements ReloadableServicesManag
final RegisteredService r = this.services.get(id);
try {
- return r == null ? null : (RegisteredService) r.clone();
+ return r == null ? null : r.clone();
} catch (final CloneNotSupportedException e) {
return r;
} | CAS-<I>: Removed the unneeded cast. | apereo_cas | train | java |
11db5f72401ba31b6348e56124f6b560074c6af0 | diff --git a/src/java/voldemort/server/scheduler/DataCleanupJob.java b/src/java/voldemort/server/scheduler/DataCleanupJob.java
index <HASH>..<HASH> 100644
--- a/src/java/voldemort/server/scheduler/DataCleanupJob.java
+++ b/src/java/voldemort/server/scheduler/DataCleanupJob.java
@@ -90,10 +90,8 @@ public class DataCleanupJob<K, V> implements Runnable {
} catch(Exception e) {
logger.error("Error in data cleanup job for store " + store.getName() + ": ", e);
} finally {
- try {
- closeIterator(iterator);
- this.cleanupPermits.release();
- }
+ closeIterator(iterator);
+ this.cleanupPermits.release();
}
} | Removed extra try call from DataCleanUp. | voldemort_voldemort | train | java |
91e0aa43d68812d598696cc3ed674ae217be1f29 | diff --git a/tests/libs/key-event.js b/tests/libs/key-event.js
index <HASH>..<HASH> 100644
--- a/tests/libs/key-event.js
+++ b/tests/libs/key-event.js
@@ -93,11 +93,13 @@
modifiers: modifiersToInclude
}, 'keydown'));
- keyEvents.push(new KeyEvent({
- charCode: charCode,
- keyCode: charCode,
- modifiers: modifiersToInclude
- }, 'keypress'));
+ if (charCode > 0) {
+ keyEvents.push(new KeyEvent({
+ charCode: charCode,
+ keyCode: charCode,
+ modifiers: modifiersToInclude
+ }, 'keypress'));
+ }
repeat--;
} | Do not fire keypress when it wouldn't in a browser | ccampbell_mousetrap | train | js |
ca135940667bcaa4f45f5f0ac276711637456c84 | diff --git a/djedi/templatetags/djedi_admin.py b/djedi/templatetags/djedi_admin.py
index <HASH>..<HASH> 100644
--- a/djedi/templatetags/djedi_admin.py
+++ b/djedi/templatetags/djedi_admin.py
@@ -32,3 +32,5 @@ def djedi_xss_domain():
domain = cio.conf.settings.get('XSS_DOMAIN')
if domain:
return mark_safe(u'<script>document.domain = "{domain}";</script>'.format(domain=domain))
+
+ return u''
diff --git a/djedi/tests/test_admin.py b/djedi/tests/test_admin.py
index <HASH>..<HASH> 100644
--- a/djedi/tests/test_admin.py
+++ b/djedi/tests/test_admin.py
@@ -30,6 +30,7 @@ class PanelTest(ClientTest):
response = self.client.get(url)
self.assertIn(u'<title>djedi cms</title>', smart_unicode(response.content))
self.assertNotIn(u'document.domain', smart_unicode(response.content))
+ self.assertNotIn(u'None', smart_unicode(response.content))
with cio.conf.settings(XSS_DOMAIN='foobar.se'):
response = self.client.get(url) | Dont output None in admin when XSS_DOMAIN not configured | 5monkeys_djedi-cms | train | py,py |
e7bee61ab8e85070345227f287308bc264c8f40c | diff --git a/mongoctl/mongoctl.py b/mongoctl/mongoctl.py
index <HASH>..<HASH> 100644
--- a/mongoctl/mongoctl.py
+++ b/mongoctl/mongoctl.py
@@ -3314,7 +3314,7 @@ def resolve_path(path):
path = os.path.abspath(path)
except OSError, e:
# handle the case where cwd does not exist
- if "No such file or directory" in e.message:
+ if "No such file or directory" in str(e):
pass
else:
raise | Handling error when cwd does not exist (#2) | mongolab_mongoctl | train | py |
5106e2b58a8edd04c23e59736351e7625c938c0c | diff --git a/spiketoolkit/curation/threshold_firing_rate.py b/spiketoolkit/curation/threshold_firing_rate.py
index <HASH>..<HASH> 100644
--- a/spiketoolkit/curation/threshold_firing_rate.py
+++ b/spiketoolkit/curation/threshold_firing_rate.py
@@ -50,10 +50,10 @@ def threshold_firing_rate(sorting, threshold=15.0, threshold_sign='greater', sam
threshold:
The threshold for the given metric.
threshold_sign: str
- If 'less', will threshold any metric less than the given threshold.
- If 'less_or_equal', will threshold any metric less than or equal to the given threshold.
- If 'greater', will threshold any metric greater than the given threshold.
- If 'greater_or_equal', will threshold any metric greater than or equal to the given threshold.
+ If 'less', will remove any units with metric scores less than the given threshold.
+ If 'less_or_equal', will remove any units with metric scores less than or equal to the given threshold.
+ If 'greater', will remove any units with metric scores greater than the given threshold.
+ If 'greater_or_equal', will remove any units with metric scores greater than or equal to the given threshold.
sampling_frequency: float
The sampling frequency of recording
metric_calculator: MetricCalculator | Update threshold_firing_rate.py | SpikeInterface_spiketoolkit | train | py |
3b9acaa0f42d698ef8673043065aa4581b280fb9 | diff --git a/test_apps/rails/spec/rails_helper.rb b/test_apps/rails/spec/rails_helper.rb
index <HASH>..<HASH> 100644
--- a/test_apps/rails/spec/rails_helper.rb
+++ b/test_apps/rails/spec/rails_helper.rb
@@ -15,6 +15,9 @@ Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
# Checks for pending migration and applies them before tests are run.
# If you are not using ActiveRecord, you can remove this line.
+Sapience.configure do |c|
+ c.app_name = "rails_app"
+end
ActiveRecord::Migration.maintain_test_schema!
RSpec.configure do |config|
@@ -32,9 +35,6 @@ RSpec.configure do |config|
Rails.root.join("config/sapience.yml"),
)
Sapience.reset!
- Sapience.configure do |c|
- c.app_name = "rails_app"
- end
end
config.after(:each) do | Set app_name early to be able to run migrations | reevoo_sapience-rb | train | rb |
b196f7f7d89623917852ed96b0b2c8b092f871a4 | diff --git a/MenuBundle.php b/MenuBundle.php
index <HASH>..<HASH> 100644
--- a/MenuBundle.php
+++ b/MenuBundle.php
@@ -21,6 +21,6 @@ class MenuBundle extends BaseBundle
public function getPath()
{
- return __DIR__;
+ return strtr(__DIR__, '\\', '/');
}
} | implemented getPath method as the other bundles | KnpLabs_KnpMenuBundle | train | php |
1e5f072bc2114c7d2e17c5d31d2dbda3fcaa3630 | diff --git a/test/integration/runner/runner_test.go b/test/integration/runner/runner_test.go
index <HASH>..<HASH> 100644
--- a/test/integration/runner/runner_test.go
+++ b/test/integration/runner/runner_test.go
@@ -19,7 +19,7 @@ import (
"time"
)
-var timeout = flag.Duration("sub.timeout", 5*time.Minute, "Specify the timeout for each sub test")
+var timeout = flag.Duration("sub.timeout", 6*time.Minute, "Specify the timeout for each sub test")
var oauthtimeout = flag.Duration("oauth.timeout", 15*time.Minute, "Timeout for the OAuth tests")
var timeoutException = map[string]*time.Duration{
"TestOAuthTimeout": oauthtimeout,
diff --git a/test/util/server/server.go b/test/util/server/server.go
index <HASH>..<HASH> 100644
--- a/test/util/server/server.go
+++ b/test/util/server/server.go
@@ -580,7 +580,7 @@ func startOpenShiftAPIServer(masterConfig *configapi.MasterConfig, clientConfig
}
}
- err = wait.Poll(time.Second, 2*time.Minute, func() (bool, error) {
+ err = wait.Poll(time.Second, 3*time.Minute, func() (bool, error) {
discoveryClient, err := discovery.NewDiscoveryClientForConfig(clientConfig)
if err != nil {
return false, err | Bump timeouts for integration tests | openshift_origin | train | go,go |
b8fd6ce73a1d7978bbbdaa26bfae5d1dea60a3a1 | diff --git a/views/js/qtiCreator/editor/ckEditor/htmlEditor.js b/views/js/qtiCreator/editor/ckEditor/htmlEditor.js
index <HASH>..<HASH> 100755
--- a/views/js/qtiCreator/editor/ckEditor/htmlEditor.js
+++ b/views/js/qtiCreator/editor/ckEditor/htmlEditor.js
@@ -114,7 +114,9 @@ define([
if(_.isFunction(options.change)){
options.change.call(editor, _htmlEncode(editor.getData()));
}
- }, 100));
+ }, 100, {
+ leading: true
+ }));
if(options.data && options.data.container){ | fixed race condition with containerEditor change callback | oat-sa_extension-tao-itemqti | train | js |
73c9521a04a7c59eb6d91391acab5524d66f3652 | diff --git a/command/e2etest/main_test.go b/command/e2etest/main_test.go
index <HASH>..<HASH> 100644
--- a/command/e2etest/main_test.go
+++ b/command/e2etest/main_test.go
@@ -56,4 +56,10 @@ func skipIfCannotAccessNetwork(t *testing.T) {
if !canAccessNetwork() {
t.Skip("network access not allowed; use TF_ACC=1 to enable")
}
+
+ // During the early part of the Terraform v0.12 release process, certain
+ // upstream resources are not yet ready to support it and so these
+ // tests cannot be run. These will be re-enabled prior to Terraform v0.12.0
+ // final.
+ t.Skip("all tests with external network access are temporarily disabled until upstream services are updated")
} | command/e2etest: Temporarily disable tests that access network
Several of these tests rely on external services (e.g. Terraform Registry)
that have not yet been updated to support the needs of Terraform <I>,
so for now we'll skip all of these tests and wait until those systems have
been updated.
This should be removed before Terraform <I> final to enable these
tests to be used as part of pre-release smoke testing. | hashicorp_terraform | train | go |
933e248180121c3ca3f015a936ad9033e8387e6b | diff --git a/visidata/_input.py b/visidata/_input.py
index <HASH>..<HASH> 100644
--- a/visidata/_input.py
+++ b/visidata/_input.py
@@ -232,6 +232,13 @@ def editText(vd, y, x, w, record=True, display=True, **kwargs):
status('"%s"' % v)
if record and vd.cmdlog:
vd.setLastArgs(v)
+
+ # clear keyboard buffer upon exit from input()
+ # input() stops when it reaches an ENTER, and we do not want the expressions
+ # that follow to register as keystrokes
+ # see issue#585
+ curses.flushinp()
+
return v | [input] flush input buffer upon exit from editText()
Closes #<I> | saulpw_visidata | train | py |
d901b3b2034b29419033d5c7faa6e17f466c31fa | diff --git a/lib/graphql-docs/helpers.rb b/lib/graphql-docs/helpers.rb
index <HASH>..<HASH> 100644
--- a/lib/graphql-docs/helpers.rb
+++ b/lib/graphql-docs/helpers.rb
@@ -1,5 +1,3 @@
-require 'commonmarker'
-
module GraphQLDocs
module Helpers
SLUGIFY_PRETTY_REGEXP = Regexp.new("[^[:alnum:]._~!$&'()+,;=@]+").freeze
@@ -18,9 +16,9 @@ module GraphQLDocs
template.result(OpenStruct.new(opts.merge(helper_methods)).instance_eval { binding })
end
- def markdown(string)
+ def to_html(string)
return '' if string.nil?
- ::CommonMarker.render_html(string, :DEFAULT)
+ @renderer.to_html(string)
end
def graphql_operation_types | Drop erroneous Commonmarker dependency | gjtorikian_graphql-docs | train | rb |
f5dabafd346a444a353d1155c3319923a0efb54c | diff --git a/lib/solargraph/api_map.rb b/lib/solargraph/api_map.rb
index <HASH>..<HASH> 100755
--- a/lib/solargraph/api_map.rb
+++ b/lib/solargraph/api_map.rb
@@ -332,6 +332,7 @@ module Solargraph
if type.nil?
# It's a method call
type = inner_infer_signature_type(parts[0], namespace, scope: scope)
+ return type if parts[1].nil?
inner_infer_signature_type(parts[1], type, scope: :instance)
else
inner_infer_signature_type(parts[1], type, scope: :class)
diff --git a/lib/solargraph/code_map.rb b/lib/solargraph/code_map.rb
index <HASH>..<HASH> 100755
--- a/lib/solargraph/code_map.rb
+++ b/lib/solargraph/code_map.rb
@@ -370,7 +370,8 @@ module Solargraph
if parts[1].nil? or parts[1].empty?
result = yp.return_type
else
- result = api_map.infer_signature_type(parts[1], yp.return_type, scope: :instance)
+ newsig = parts[1..-1].join('.')
+ result = api_map.infer_signature_type(newsig, yp.return_type, scope: :instance)
end
end
end | Method chains in yield param types. | castwide_solargraph | train | rb,rb |
15ad875eed448a4b8fa1ef239f314cfb32c41cf2 | diff --git a/tests/vessels_segmentation_test.py b/tests/vessels_segmentation_test.py
index <HASH>..<HASH> 100644
--- a/tests/vessels_segmentation_test.py
+++ b/tests/vessels_segmentation_test.py
@@ -106,7 +106,7 @@ class SegmentationTest(unittest.TestCase):
self.assertLess(errorrate, 0.1)
- @unittest.skipIf(os.environ.get("TRAVIS", True), "Skip on Travis-CI")
+ # @unittest.skipIf(os.environ.get("TRAVIS", True), "Skip on Travis-CI")
def test_uiThreshold_qt(self):
"""
UI threshold segmentation without binary close | ui_threshold_qt is back | mjirik_imtools | train | py |
2162becb10f382b72d70ad3599ea3b8dc51aab19 | diff --git a/lib/bandcamp/album.rb b/lib/bandcamp/album.rb
index <HASH>..<HASH> 100644
--- a/lib/bandcamp/album.rb
+++ b/lib/bandcamp/album.rb
@@ -1,9 +1,11 @@
+require 'bandcamp/associated'
require 'bandcamp/methodical'
module Bandcamp
class Album
include Methodical
+ include Associated
def initialize album_hash
to_methods album_hash
diff --git a/spec/album_spec.rb b/spec/album_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/album_spec.rb
+++ b/spec/album_spec.rb
@@ -2,10 +2,21 @@ require 'bandcamp/album'
module Bandcamp
describe Album do
+
+ let(:album){ Album.new(foo: "bar", band_id: 123456) }
+
+ it "includes the Associated Module" do
+ expect(album.private_methods).to include :retrieve_associated
+ end
+
+ it "includes the Methodical module" do
+ expect(album.private_methods).to include :to_methods
+ end
+
describe ".new" do
it "accepts a hash and returns an Album" do
- expect(Album.new(foo: "bar")).to be_an Album
+ expect(album).to be_an Album
end
it "creates methods based on the hash" do | Album now includes Associated.
Plus a little refactoring of the album spec. | sleepycat_bandcamp_api | train | rb,rb |
6e423855448bb9f19da447d4c0b7a793f0449e40 | diff --git a/code/administrator/components/com_default/controllers/toolbars/menubar.php b/code/administrator/components/com_default/controllers/toolbars/menubar.php
index <HASH>..<HASH> 100644
--- a/code/administrator/components/com_default/controllers/toolbars/menubar.php
+++ b/code/administrator/components/com_default/controllers/toolbars/menubar.php
@@ -21,6 +21,8 @@ class ComDefaultControllerToolbarMenubar extends KControllerToolbarDefault
{
/**
* Add a command
+ *
+ * Disable the menubar only for singular views that are editable.
*
* @param string The command name
* @param mixed Parameters to be passed to the command
@@ -30,7 +32,9 @@ class ComDefaultControllerToolbarMenubar extends KControllerToolbarDefault
{
parent::addCommand($name, $config);
- if(KInflector::isSingular($this->getController()->getView()->getName())) {
+ $controller = $this->getController();
+
+ if($controller->isEditable() && KInflector::isSingular($controller->getView()->getName())) {
$this->_commands[$name]->disabled = true;
} | Disable the menubar only for singular views that are editable. | joomlatools_joomlatools-framework | train | php |
368ee1cae1e6b5c1680e980c60c546b17639036c | diff --git a/gh-pages-publish.js b/gh-pages-publish.js
index <HASH>..<HASH> 100755
--- a/gh-pages-publish.js
+++ b/gh-pages-publish.js
@@ -5,6 +5,10 @@
var ghpages = require('gh-pages');
var path = require('path');
-ghpages.publish(path.join(__dirname, 'demo-build'), function(err) {
- console.log(err);
+ghpages.publish(path.join(__dirname, 'demo-build'), function (err) {
+ if (err) {
+ console.log('Error while publish gh-pages');
+ throw err;
+ }
+ console.log('gh-pages published successfully');
}); | chore(gh-pages): added better logging | valor-software_ngx-bootstrap | train | js |
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.