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 |
|---|---|---|---|---|---|
1e890489e9d77d4cc47ad68f8a824f962e1c2344 | diff --git a/FbBotApp.php b/FbBotApp.php
index <HASH>..<HASH> 100755
--- a/FbBotApp.php
+++ b/FbBotApp.php
@@ -50,33 +50,9 @@ class FbBotApp
*/
public function send($message)
{
- $maxlength = 640;
- //CHECK LENGTH OF TEXT FIRST + MAYBE SEND MULTIPLE MESSAGES
- $data = $message->getData();
+ return $this->call('me/messages', $message->getData(););
- if ( isset($data['message']['text']) && strlen(utf8_decode($data['message']['text'])) > $maxlength ) {
-
- $message_text = $data['message']['text'];
-
- $pages = ceil( strlen(utf8_decode($message_text)) / $maxlength );
-
- for ($x=0; $x<$pages; $x++) {
-
- $text = substr( $message_text, $x*$maxlength, ($x+1)*$maxlength );
-
- $data['message']['text'] = $text;
-
- $res = $this->call('me/messages', $data);
- }
-
- return $res;
-
- } else {
-
- return $this->call('me/messages', $data);
-
- }
}
/** | removed <I> char split | pimax_fb-messenger-php | train | php |
a80337bb30c4c29779f2f9c4aad288e43b77c534 | diff --git a/lib/spaceship/tunes/device_type.rb b/lib/spaceship/tunes/device_type.rb
index <HASH>..<HASH> 100644
--- a/lib/spaceship/tunes/device_type.rb
+++ b/lib/spaceship/tunes/device_type.rb
@@ -1,7 +1,7 @@
module Spaceship
module Tunes
class DeviceType
- @types = ['iphone4', 'iphone35', 'iphone6', 'iphone6Plus', 'ipad', 'watch', 'appleTV']
+ @types = ['iphone4', 'iphone35', 'iphone6', 'iphone6Plus', 'ipad', 'ipadPro', 'watch', 'appleTV']
class << self
attr_accessor :types | Update device_type.rb
Added support for iPad Pro device type | fastlane_fastlane | train | rb |
1b4ee41a2e010756312c5020ac46d14f992d367b | diff --git a/src/Integrations/BindsWorker.php b/src/Integrations/BindsWorker.php
index <HASH>..<HASH> 100644
--- a/src/Integrations/BindsWorker.php
+++ b/src/Integrations/BindsWorker.php
@@ -16,7 +16,7 @@ trait BindsWorker
* @var array
*/
protected $workerImplementations = [
- '5\.[34].*' => Laravel53Worker::class
+ '5\.[345].*' => Laravel53Worker::class
];
/**
@@ -39,4 +39,4 @@ trait BindsWorker
{
$this->app->bind(WorkerInterface::class, $this->findWorkerClass($this->app->version()));
}
-}
\ No newline at end of file
+} | Include Laravel <I> in Laravel<I>Worker implementation | dusterio_laravel-aws-worker | train | php |
d02d9194fa87ca8c3cbf9d98e2d90d47e2b023f8 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -88,17 +88,23 @@
return multiply(fromValue, toValue, multiplier);
}
+ function getDefault (value, defaultValue) {
+ return typeof value === 'undefined' ? defaultValue : value;
+ }
+
function Animation (initial) {
var self = this;
var raf, startTime, lastTime, pausedAfter;
- var fromValues = Immutable.fromJS(initial);
+
+ var fromValues = Immutable.fromJS(getDefault(initial.from, {}));
+ var toValues = Immutable.Map(getDefault(initial.to, {}));
+ var durationMillis = getDefault(initial.duration, 500);
+ var frameRate = 1000 / getDefault(initial.fps, 60);
+ var easing = getDefault(initial.easing, Linear);
+ var shouldLoop = getDefault(initial.loop, false);
+
var currentValues = fromValues;
- var toValues = Immutable.Map();
- var durationMillis = 500;
- var frameRate = 1000 / 60;
- var easing = Linear;
- var shouldLoop = false;
var events = {
all: [], | Initialize animation with all options & defaults | JakeSidSmith_slik | train | js |
c0828f590fb789933e8629b9ff2ed277c193a496 | diff --git a/telethon/client/uploads.py b/telethon/client/uploads.py
index <HASH>..<HASH> 100644
--- a/telethon/client/uploads.py
+++ b/telethon/client/uploads.py
@@ -39,7 +39,7 @@ def _resize_photo_if_needed(
or (isinstance(file, io.IOBase) and not file.seekable())):
return file
- before = file.tell() if isinstance(file, io.IOBase) else None
+ before = file.tell() if isinstance(file, io.IOBase) else 0
if isinstance(file, bytes):
file = io.BytesIO(file) | Fix resize if needed not seeking back for image = bytes | LonamiWebs_Telethon | train | py |
2c083b82191752340c76271876671e18130ad662 | diff --git a/git.go b/git.go
index <HASH>..<HASH> 100644
--- a/git.go
+++ b/git.go
@@ -10,7 +10,7 @@ import (
"time"
)
-const _VERSION = "0.4.12"
+const _VERSION = "0.4.13"
func Version() string {
return _VERSION
diff --git a/repo_tag.go b/repo_tag.go
index <HASH>..<HASH> 100644
--- a/repo_tag.go
+++ b/repo_tag.go
@@ -171,7 +171,7 @@ func (repo *Repository) GetTagsAfter(after string, limit int) (*TagsResult, erro
}
if allTags[i] == after {
hasMatch = true
- if limit > 0 && i-limit > 0 {
+ if limit > 0 && i-limit >= 0 {
previousAfter = allTags[i-limit]
}
continue | repo_tag: fix edge case which the latest tag cannot be set as previousAfter | gogs_git-module | train | go,go |
7501a959d690e1e6481f7832900205c1fc37c60f | diff --git a/lib/gir_ffi-base/glib/boolean.rb b/lib/gir_ffi-base/glib/boolean.rb
index <HASH>..<HASH> 100644
--- a/lib/gir_ffi-base/glib/boolean.rb
+++ b/lib/gir_ffi-base/glib/boolean.rb
@@ -12,11 +12,11 @@ module GLib
TO_NATIVE = FROM_NATIVE.invert
def self.from_native(value, _context)
- FROM_NATIVE[value]
+ FROM_NATIVE.fetch(value)
end
def self.to_native(value, _context)
- TO_NATIVE[value]
+ TO_NATIVE.fetch(value)
end
def self.size | Simplify native value conversion for boolean | mvz_gir_ffi | train | rb |
2b40fac88f968f6cafe279269385252046a76056 | diff --git a/lib/test/test.js b/lib/test/test.js
index <HASH>..<HASH> 100644
--- a/lib/test/test.js
+++ b/lib/test/test.js
@@ -412,7 +412,7 @@ test('cleans on process exit with code', function (t) {
});
child.on('close', function (code) {
- t.is(code, 293, 'exit code 293');
+ t.ok(code !== 0, 'exit code not 0');
var parent = dirname(path);
t.notOk(existent.sync(parent), 'deleted: ' + parent);
});
diff --git a/src/test/test.js b/src/test/test.js
index <HASH>..<HASH> 100644
--- a/src/test/test.js
+++ b/src/test/test.js
@@ -374,7 +374,7 @@ test('cleans on process exit with code', (t) => {
})
child.on('close', (code) => {
- t.is(code, 293, 'exit code 293')
+ t.ok(code !== 0, 'exit code not 0')
const parent = dirname(path)
t.notOk(existent.sync(parent), 'deleted: ' + parent)
}) | Imprecise exit code for clean test | vweevers_tmpgen | train | js,js |
26087ac5d20e8b58d61a6f234672ee9e0c9a029d | diff --git a/mod/assignment/type/upload/assignment.class.php b/mod/assignment/type/upload/assignment.class.php
index <HASH>..<HASH> 100644
--- a/mod/assignment/type/upload/assignment.class.php
+++ b/mod/assignment/type/upload/assignment.class.php
@@ -1034,7 +1034,7 @@ class assignment_upload extends assignment_base {
$mform->addElement('select', 'var4', get_string("trackdrafts", "assignment"), $ynoptions);
$mform->setHelpButton('var4', array('trackdrafts', get_string('trackdrafts', 'assignment'), 'assignment'));
- $mform->setDefault('trackdrafts', 1);
+ $mform->setDefault('var4', 1);
} | MDL-<I> - default wasn't being set on send for marking due to
incorrect element name
thanks to Brian Gray | moodle_moodle | train | php |
236865e22bc940fab628d5e4fb835d3906dbfea2 | diff --git a/tasks/mincss.js b/tasks/mincss.js
index <HASH>..<HASH> 100644
--- a/tasks/mincss.js
+++ b/tasks/mincss.js
@@ -18,7 +18,7 @@ module.exports = function(grunt) {
var options = this.options();
grunt.verbose.writeflags(options, 'Options');
- var files = grunt.file.expandFiles(this.file.src);
+ var files = this.file.src;
files.forEach(function(file) {
sourceCode = grunt.file.read(file);
sourceCompressed = minifyCSS(sourceCode); | remove expandFiles, grunt does it for us now | gruntjs_grunt-contrib-cssmin | train | js |
97529b19259c5a4bfd8cd0e4caa125d20bb3e6bc | diff --git a/index.go b/index.go
index <HASH>..<HASH> 100644
--- a/index.go
+++ b/index.go
@@ -174,8 +174,24 @@ type Index interface {
FieldDictRange(field string, startTerm []byte, endTerm []byte) (index.FieldDict, error)
FieldDictPrefix(field string, termPrefix []byte) (index.FieldDict, error)
+ // DumpAll returns a channel receiving all index rows as
+ // UpsideDownCouchRow, in lexicographic byte order. If the enumeration
+ // fails, an error is sent. The channel is closed once the enumeration
+ // completes or an error is encountered. A read transaction is maintained
+ // for the duration of the enumeration, preventing concurrent write
+ // operations to proceed. The caller must consume all channel entries until
+ // the channel is closed to ensure the transaction and other resources
+ // associated with the enumeration are released.
+ //
+ // DumpAll exists for debugging and tooling purpose and may change in the
+ // future.
DumpAll() chan interface{}
+
+ // DumpDoc works like DumpAll but returns only StoredRows and
+ // TermFrequencyRows related to a document.
DumpDoc(id string) chan interface{}
+
+ // DumpFields works like DumpAll but returns only FieldRows.
DumpFields() chan interface{}
Close() error | index: document DumpAll, DumpDoc and DumpFields methods | blevesearch_bleve | train | go |
cffdc2afddc2bea367ab275cdc721ae2f9d90b92 | diff --git a/MatchMakingLobby/Services/MatchMakingService.php b/MatchMakingLobby/Services/MatchMakingService.php
index <HASH>..<HASH> 100644
--- a/MatchMakingLobby/Services/MatchMakingService.php
+++ b/MatchMakingLobby/Services/MatchMakingService.php
@@ -208,10 +208,10 @@ class MatchMakingService
return $this->db->query(
'SELECT count(*) FROM Players P '.
'INNER JOIN Matches M ON P.matchId = M.id '.
- 'WHERE P.login = %s AND P.`state` < %d AND M.lobbyLogin = %s '.
+ 'WHERE P.login = %s AND P.`state` IN (%s) AND M.lobbyLogin = %s '.
'AND DATE_ADD(M.creationDate, INTERVAL 1 HOUR) > NOW()',
$this->db->quote($playerLogin),
- PlayerInfo::PLAYER_STATE_NOT_CONNECTED,
+ implode(',', array(PlayerInfo::PLAYER_STATE_NOT_CONNECTED, PlayerInfo::PLAYER_STATE_QUITTER, PlayerInfo::PLAYER_STATE_GIVE_UP, PlayerInfo::PLAYER_STATE_REPLACED)),
$this->db->quote($lobbyLogin)
)->fetchSingleValue(0);
} | Canceling match before it starts does not give penalty | maniaplanet_matchmaking-lobby | train | php |
33c6d9a17020dd5b63a5607b19af2868fe71c827 | diff --git a/lib/set.js b/lib/set.js
index <HASH>..<HASH> 100644
--- a/lib/set.js
+++ b/lib/set.js
@@ -158,7 +158,20 @@ Set.prototype._migrate = function (direction, fn, lastMigrationNum) {
self.emit('migration', migration, direction);
try {
- migration[direction](self.db, function (err) {
+ migration[direction](self.db, function (migrationErr) {
+ if (migrationErr) {
+ console.error('Error inside migration: ', migration.title, '\nError: ', migrationErr);
+ //Revert this migration the opposite way
+ return migration[direction === 'up' ? 'down' : 'up'](self.db, function (migrateDownErr) {
+ if (migrateDownErr) {
+ console.error('Error migrating back down: ', migration.title, '\nerr: ', migrateDownErr);
+ console.error('The database may be in a corrupted state!');
+ }
+
+ process.exit(1);
+ });
+ }
+
if (isDirectionUp) {
self.migrationCollection.insert({
num: parseInt(migration.title.match(/\d+.*-/)[0].split('-')[0], 10), | Added migration error handling to revert the migration the opposite way if a migration fails | afloyd_mongo-migrate | train | js |
14259e456496353d4eee3770fa8a78f2c6b08433 | diff --git a/fileutil/io.go b/fileutil/io.go
index <HASH>..<HASH> 100644
--- a/fileutil/io.go
+++ b/fileutil/io.go
@@ -74,8 +74,10 @@ func CopyFile(src, dst string) error {
}
// Create creates a new file with b bytes.
+// If the file already exists, it is truncated. If the file does not exist,
+// it is created with mode 0666 (before umask).
func Create(filename string, b []byte) (err error) {
- file, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE, 0666)
+ file, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
if err != nil {
return err
}
@@ -99,6 +101,7 @@ func CreateString(filename string, s string) error {
}
// Overwrite truncates the named file to zero and writes len(b) bytes.
+// It is created with mode 0666 (before umask).
func Overwrite(filename string, b []byte) (err error) {
file, err := os.OpenFile(filename, os.O_WRONLY|os.O_TRUNC, 0666)
if err != nil { | Add flag to truncate a file at function Create() | tredoe_osutil | train | go |
f706fcc8bc790442af1fae4f526c5e19cd349a3b | diff --git a/openquake/engine/tools/import_hazard_curves.py b/openquake/engine/tools/import_hazard_curves.py
index <HASH>..<HASH> 100644
--- a/openquake/engine/tools/import_hazard_curves.py
+++ b/openquake/engine/tools/import_hazard_curves.py
@@ -45,15 +45,18 @@ def import_hazard_curves(fileobj, user=None):
investigation_time=hazcurve.investigation_time,
imt=hazcurve.imt,
imls=hazcurve.imls,
- quantile=hazcurve.quantile,
+ quantile=hazcurve.quantile_value,
statistics=hazcurve.statistics,
sa_damping=hazcurve.sa_damping,
sa_period=hazcurve.sa_period,
output=out)
hazard_curve_id = str(haz_curve.id)
- for poes, loc in hazcurve:
+ for node in hazcurve:
+ loc = node.location
+ poes = node.poes
poes = '{%s}' % str(poes)[1:-1]
- print >> f, '\t'.join([hazard_curve_id, poes, 'SRID=4326;' + loc])
+ print >> f, '\t'.join([hazard_curve_id, poes,
+ 'SRID=4326;POINT(%s %s)' % (loc.x, loc.y)])
f.reset()
## import the file-like object with a COPY FROM
try: | tests/import_hazard_curves:
Updated the hazard curve import tool to use the updated nrml hazcurve
parser.
Former-commit-id: dd<I>b<I>d<I>c<I>b9dfa8e<I>d0ca1a<I>bc1 | gem_oq-engine | train | py |
5d0f9a090082b4550b8b8fd75cd626cfcc8a9c08 | diff --git a/engine/src/main/java/org/camunda/bpm/engine/FormService.java b/engine/src/main/java/org/camunda/bpm/engine/FormService.java
index <HASH>..<HASH> 100644
--- a/engine/src/main/java/org/camunda/bpm/engine/FormService.java
+++ b/engine/src/main/java/org/camunda/bpm/engine/FormService.java
@@ -248,8 +248,26 @@ public interface FormService {
*/
String getTaskFormKey(String processDefinitionId, String taskDefinitionKey);
+ /**
+ * Retrieves a deployed start form for a process definition with a given id.
+ *
+ *
+ * @throws AuthorizationException
+ * If the user has no {@link Permissions#READ} permission on {@link Resources#PROCESS_DEFINITION}.
+ * @throws DeploymentResourceNotFoundException
+ * If the start form cannot be found in a deployment.
+ */
InputStream getDeployedStartForm(String processDefinitionId);
+ /**
+ * Retrieves a deployed task form for a task with a given id.
+ *
+ *
+ * @throws AuthorizationException
+ * If the user has no {@link Permissions#READ} permission on {@link Resources#TASK}.
+ * @throws DeploymentResourceNotFoundException
+ * If the task form cannot be found in a deployment.
+ */
InputStream getDeployedTaskForm(String taskId);
}
\ No newline at end of file | docs(form-service): add missing java docs
related to CAM-<I> | camunda_camunda-bpm-platform | train | java |
78095116adb60c684b630f624ec2db13d463f965 | diff --git a/app/models/redirect_rule.rb b/app/models/redirect_rule.rb
index <HASH>..<HASH> 100644
--- a/app/models/redirect_rule.rb
+++ b/app/models/redirect_rule.rb
@@ -46,7 +46,7 @@ class RedirectRule < ActiveRecord::Base
def self.match_for(source, environment)
match_scope = where(match_sql_condition.strip, {:true => true, :false => false, :source => source})
- match_scope = match_scope.order('redirect_rules.source_is_regex ASC, LENGTH(redirect_rules.source) DESC')
+ match_scope = match_scope.order(Arel.sql('redirect_rules.source_is_regex ASC, LENGTH(redirect_rules.source) DESC'))
match_scope = match_scope.includes(:request_environment_rules)
match_scope = match_scope.references(:request_environment_rules) if Rails.version.to_i == 4
match_scope.detect do |rule| | Fix Rails <I> unsafe SQL deprecation
Wrap our SQL text in `Arel.sql` to indicate that it's safe.
Fixes vigetlabs#<I> | vigetlabs_redirector | train | rb |
af458b546e6bc483bf32dc3a98a9eeb173bf444a | diff --git a/service-name-handler.js b/service-name-handler.js
index <HASH>..<HASH> 100644
--- a/service-name-handler.js
+++ b/service-name-handler.js
@@ -81,7 +81,7 @@ TChannelServiceNameHandler.prototype.handleRequest = function handleRequest(req,
var self = this;
if (self.isBusy) {
- var busyInfo = self.isBusy();
+ var busyInfo = self.isBusy(req);
if (busyInfo) {
buildRes().sendError('Busy', busyInfo);
return; | pass req through to `isBusy()` | uber_tchannel-node | train | js |
bf80d694ce9f293f51b01274bcfc7bbdd527a0bb | diff --git a/spec/support/shared_examples/querying_examples.rb b/spec/support/shared_examples/querying_examples.rb
index <HASH>..<HASH> 100644
--- a/spec/support/shared_examples/querying_examples.rb
+++ b/spec/support/shared_examples/querying_examples.rb
@@ -274,7 +274,7 @@ shared_examples_for "Sequel Model with translated dataset" do |model_class_name,
it "works with nil values" do
expect(model_class.i18n.exclude(attribute1 => "bar post", attribute2 => nil).select_all(table_name).all).to match_array([@post1, @post2, @post3])
expect(model_class.i18n.exclude(attribute1 => "bar post").exclude(attribute2 => nil).select_all(table_name).all).to eq([@post2])
- expect(model_class.i18n.exclude(attribute1 => nil).exclude(attribute2 => nil).select_all(table_name).all).to eq([@post2, @post3])
+ expect(model_class.i18n.exclude(attribute1 => nil).exclude(attribute2 => nil).select_all(table_name).all).to match_array([@post2, @post3])
end
end | Fix spec so it passes independent of array element order | shioyama_mobility | train | rb |
182f52a540dca1ab563915692056b43a711538e7 | diff --git a/tests/unit/nupic/research/spatial_pooler_cpp_unit_test.py b/tests/unit/nupic/research/spatial_pooler_cpp_unit_test.py
index <HASH>..<HASH> 100755
--- a/tests/unit/nupic/research/spatial_pooler_cpp_unit_test.py
+++ b/tests/unit/nupic/research/spatial_pooler_cpp_unit_test.py
@@ -26,6 +26,7 @@ import numpy as np
from nupic.bindings.math import GetNTAReal
from nupic.bindings.algorithms import SpatialPooler
+# Uncomment below line to use python SpatialPooler
# from nupic.research.spatial_pooler import SpatialPooler
@@ -169,7 +170,7 @@ class SpatialPoolerTest(unittest.TestCase):
sp.setOverlapDutyCycles(initOverlapArr1);
sp.setIterationNum(2000);
sp.setUpdatePeriod(1000);
- sp.updateDutyCycles_(overlaps, active);
+ sp._updateDutyCycles(overlaps, active);
resultOverlapArr2 = np.zeros(5, dtype=realDType)
sp.getOverlapDutyCycles(resultOverlapArr2); | Allow testing with python SP | numenta_nupic | train | py |
0d7a9741780bb6280cac68cbcaad9b67176f289f | diff --git a/tests/test_statemanager.py b/tests/test_statemanager.py
index <HASH>..<HASH> 100644
--- a/tests/test_statemanager.py
+++ b/tests/test_statemanager.py
@@ -517,11 +517,16 @@ class TestStateManager(unittest.TestCase):
draft = MyPost.__dict__['state'].DRAFT
wdraft = ManagedStateWrapper(draft, self.post, MyPost)
self.assertEqual(draft.value, wdraft.value)
- self.assertTrue(wdraft())
+ self.assertTrue(wdraft()) # Result is False
+ self.assertTrue(wdraft) # Object is falsy
self.assertEqual(self.post.state.DRAFT, wdraft)
self.post.submit()
self.assertFalse(wdraft())
- self.assertEqual(self.post.state.DRAFT, wdraft)
+ self.assertFalse(wdraft)
+ self.assertEqual(self.post.state.DRAFT(), wdraft()) # False == False
+ self.assertEqual(self.post.state.DRAFT, wdraft) # Object remains the same even if not active
+ self.assertNotEqual(self.post.state.PENDING, wdraft) # These objects don't match
+ self.assertNotEqual(self.post.state.PENDING(), wdraft()) # True != False
with self.assertRaises(TypeError):
ManagedStateWrapper(MY_STATE.DRAFT, self.post) | Improved ManagedStateWrapper tests (#<I>) | hasgeek_coaster | train | py |
7cc3b24d626ced6f34ec77db00c10a042c52c1db | diff --git a/glue/ldbd.py b/glue/ldbd.py
index <HASH>..<HASH> 100644
--- a/glue/ldbd.py
+++ b/glue/ldbd.py
@@ -38,8 +38,10 @@ import string
import re
import csv
import exceptions
-import DB2
-
+try:
+ import DB2
+except:
+ pass
"""
create the csv parser and initialize a dialect for LIGO_LW streams | add "try except" to "import DB2" | gwastro_pycbc-glue | train | py |
402b82901055aea047f61b5ae82802ac975c7bcb | diff --git a/src/Compilers/BabelCompiler.js b/src/Compilers/BabelCompiler.js
index <HASH>..<HASH> 100644
--- a/src/Compilers/BabelCompiler.js
+++ b/src/Compilers/BabelCompiler.js
@@ -108,6 +108,7 @@ export class BabelCompiler extends Compiler {
if(ext.indexOf(this.supportedExtensions) === -1) {
for(const ext of this.supportedExtensions) {
files.push(`${importPath}.${ext}`)
+ files.push(`${importPath}/index.${ext}`)
}
} else {
files.push(importPath) | Added support for index.js files in BabelCompiler.enumerateImports | grindjs_assets | train | js |
c4d3329c5f564901162304e626359b3f681593a6 | diff --git a/tests/test_vpc.rb b/tests/test_vpc.rb
index <HASH>..<HASH> 100644
--- a/tests/test_vpc.rb
+++ b/tests/test_vpc.rb
@@ -368,10 +368,16 @@ class TestVpc < CiscoTestCase
interface_pc.switchport_mode = :trunk
refute(interface_pc.vpc_peer_link,
'vpc_peer_link should not be set by default')
- interface_pc.vpc_peer_link = true
- assert(interface_pc.vpc_peer_link, 'vpc_peer_link should be set')
- interface_pc.vpc_peer_link = false
- refute(interface_pc.vpc_peer_link, 'vpc_peer_link should not be set')
+ begin
+ # vpc peer-link has linecard limitations
+ interface_pc.vpc_peer_link = true
+ assert(interface_pc.vpc_peer_link, 'vpc_peer_link should be set')
+ interface_pc.vpc_peer_link = false
+ refute(interface_pc.vpc_peer_link, 'vpc_peer_link should not be set')
+ rescue RuntimeError => e
+ raise unless e.message[/Interface needs to be 10G to act as a peer-link/]
+ end
+
# clean up
interface.channel_group = false
refute(interface.channel_group, 'channel group should be unset') | test_vpc needs rescue for incompat intf (#<I>) | cisco_cisco-network-node-utils | train | rb |
b14f9354c971a60fa82581ba83afec822011dfd3 | diff --git a/test/solrj_writer_test.rb b/test/solrj_writer_test.rb
index <HASH>..<HASH> 100644
--- a/test/solrj_writer_test.rb
+++ b/test/solrj_writer_test.rb
@@ -99,10 +99,22 @@ describe "Traject::SolrJWriter" do
assert_equal 1, @mock.things_added.length
assert_kind_of SolrInputDocument, @mock.things_added.first
- assert @mock.committed
assert @mock.shutted_down
+ end
+ end
+
+ it "commits on close when so set" do
+ @settings.merge!("solrj_writer.commit_on_close" => "true")
+ create_solrj_writer
- else
+ @writer.put "title_t" => ["MY TESTING TITLE"], "id" => ["TEST_TEST_TEST_0001"]
+ @writer.close
+
+ # if it's not a mock, we don't really test anything, except that
+ # no exception was raised. oh well. If it's a mock, we can
+ # ask it.
+ if @mock
+ assert @mock.committed, "mock gets commit called on it"
end
end | solrj_writer, test commit_on_close only for mock | traject_traject | train | rb |
af3d9a4114c0134d27521f11ebb5f9c9c183b4f7 | diff --git a/builder.go b/builder.go
index <HASH>..<HASH> 100644
--- a/builder.go
+++ b/builder.go
@@ -2,7 +2,7 @@
package builder
import (
- "github.com/mndrix/ps"
+ "github.com/lann/ps"
"go/ast"
"reflect"
) | Switch to stable fork of ps package | lann_builder | train | go |
b0dc2965f5f092aaee8c2089c6b06dd113628885 | diff --git a/pmagpy/ipmag.py b/pmagpy/ipmag.py
index <HASH>..<HASH> 100755
--- a/pmagpy/ipmag.py
+++ b/pmagpy/ipmag.py
@@ -10891,6 +10891,7 @@ def thellier_magic(meas_file="measurements.txt", dir_path=".", input_dir_path=""
if ans == 'q':
if image_records:
return True, [], []
+ return True, []
if ans == 'a':
files = {key : this_specimen + "_" + key + "." + fmt for (key, value) in zed.items()}
if not set_env.IS_WIN: | fix for thellier_magic to make interactive quit actually work | PmagPy_PmagPy | train | py |
c6cfaaf4756b69963b016b8b4173eabbc269cf12 | diff --git a/src/properties/class-papi-property.php b/src/properties/class-papi-property.php
index <HASH>..<HASH> 100644
--- a/src/properties/class-papi-property.php
+++ b/src/properties/class-papi-property.php
@@ -68,7 +68,7 @@ class Papi_Property extends Papi_Core_Property {
}
// If no valid lang query string exists we have to override the display property.
- return $this->get_option( 'lang' ) === false && papi_is_empty( papi_get_lang() );
+ return $this->get_option( 'lang' ) === false;
}
/** | Fix can render when lang filter is not empty but lang option is | wp-papi_papi | train | php |
05db8aff7fbe79ae612d9ae08bbbbee0845a100f | diff --git a/opts.go b/opts.go
index <HASH>..<HASH> 100644
--- a/opts.go
+++ b/opts.go
@@ -78,8 +78,10 @@ func HTTPClient(client *http.Client) Option {
e, err := errorReporting.New(client)
if err != nil {
return err
- } else {
- ErrorService(e)
+ }
+ err = ErrorService(e)(sh)
+ if err != nil {
+ return err
}
return LoggingService(l)(sh)
@@ -240,8 +242,6 @@ func GoogleServiceAccountCredentialsFile(path string) Option {
// associated with the GCE instance will be used.
func GoogleComputeCredentials(serviceAccount string) Option {
return func(sh *StackdriverHook) error {
- var err error
-
// get compute metadata scopes associated with the service account
scopes, err := metadata.Scopes(serviceAccount)
if err != nil {
@@ -290,7 +290,7 @@ func GoogleLoggingAgent() Option {
Async: true,
})
if err != nil {
- return fmt.Errorf("could not find fluentd agent on 127.0.0.1:24224")
+ return fmt.Errorf("could not find fluentd agent on 127.0.0.1:24224: %v", err)
}
return nil
} | Add missing call to ErrorService option
Other minor improvements | knq_sdhook | train | go |
de1bc577901eb5fb0f2667f765d53dbdbd2ba9c3 | diff --git a/executor/memory_test.go b/executor/memory_test.go
index <HASH>..<HASH> 100644
--- a/executor/memory_test.go
+++ b/executor/memory_test.go
@@ -18,6 +18,7 @@ import (
"context"
"fmt"
"runtime"
+ "runtime/debug"
"testing"
"github.com/pingcap/tidb/executor"
@@ -26,6 +27,8 @@ import (
)
func TestPBMemoryLeak(t *testing.T) {
+ debug.SetGCPercent(1000)
+ defer debug.SetGCPercent(100)
store, clean := testkit.CreateMockStore(t)
defer clean()
tk := testkit.NewTestKit(t, store) | executor: stable test not to automatically gc (#<I>)
close pingcap/tidb#<I> | pingcap_tidb | train | go |
71c7aaa3cd4d2092e19774dd927a8b6fe19631d6 | diff --git a/lib/ronin/product.rb b/lib/ronin/product.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/product.rb
+++ b/lib/ronin/product.rb
@@ -56,5 +56,12 @@ module Ronin
end
end
+ #
+ # Returns the vendor name or the name of the product.
+ #
+ def vendor
+ super || self.name
+ end
+
end
end | Have the vendor default to the name of the product. | ronin-ruby_ronin | train | rb |
cf9897395459693ede353340c52a7fd14b38cb0d | diff --git a/photutils/segmentation/deblend.py b/photutils/segmentation/deblend.py
index <HASH>..<HASH> 100644
--- a/photutils/segmentation/deblend.py
+++ b/photutils/segmentation/deblend.py
@@ -225,7 +225,7 @@ def _deblend_source(data, segment_img, npixels, nlevels=32, contrast=0.001,
source_max = np.nanmax(source_values)
if source_min == source_max:
return segment_img # no deblending
- if source_min < 0:
+ if mode == 'exponential' and source_min < 0:
warnings.warn('Source "{0}" contains negative values, setting '
'deblending mode to "linear"'.format(
segment_img.labels[0]), AstropyUserWarning) | Avoid mode warnings when it is already set to linear | astropy_photutils | train | py |
bdb52070da96a8864e1ef1fd7e22fb242acad243 | diff --git a/python/src/cm_api/endpoints/clusters.py b/python/src/cm_api/endpoints/clusters.py
index <HASH>..<HASH> 100644
--- a/python/src/cm_api/endpoints/clusters.py
+++ b/python/src/cm_api/endpoints/clusters.py
@@ -21,15 +21,21 @@ __docformat__ = "epytext"
CLUSTERS_PATH = "/clusters"
-def create_cluster(resource_root, name, version):
+def create_cluster(resource_root, name, version, fullVersion=None):
"""
Create a cluster
@param resource_root: The root Resource object.
@param name: Cluster name
- @param version: Cluster CDH version
+ @param version: Cluster CDH major version (eg: "4")
+ - The CDH minor version will be assumed to be the
+ latest released version, if 'fullVersion' is not
+ specified.
+ @param fullVersion: Cluster's full CDH version. (eg: "4.6.0")
+ - If specified, 'version' will be ignored.
+ - Since: v6
@return: An ApiCluster object
"""
- apicluster = ApiCluster(resource_root, name, version)
+ apicluster = ApiCluster(resource_root, name, version, fullVersion)
return call(resource_root.post, CLUSTERS_PATH, ApiCluster, True,
data=[apicluster])[0] | [cm-api] OPSAPS-<I>: Allow fullVersion in create_cluster
Allow clusters to be created with a fully specified CDH version. | cloudera_cm_api | train | py |
c0edd3a4332c4822633e7052d4bd1a4b96659fce | diff --git a/internal/service/pinpoint/resource_aws_pinpoint_event_stream.go b/internal/service/pinpoint/resource_aws_pinpoint_event_stream.go
index <HASH>..<HASH> 100644
--- a/internal/service/pinpoint/resource_aws_pinpoint_event_stream.go
+++ b/internal/service/pinpoint/resource_aws_pinpoint_event_stream.go
@@ -14,6 +14,7 @@ import (
"github.com/hashicorp/terraform-provider-aws/internal/conns"
tftags "github.com/hashicorp/terraform-provider-aws/internal/tags"
"github.com/hashicorp/terraform-provider-aws/internal/verify"
+ tfiam "github.com/hashicorp/terraform-provider-aws/internal/service/iam"
)
func ResourceEventStream() *schema.Resource {
@@ -62,7 +63,7 @@ func resourceAwsPinpointEventStreamUpsert(d *schema.ResourceData, meta interface
}
// Retry for IAM eventual consistency
- err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError {
+ err := resource.Retry(tfiam.PropagationTimeout, func() *resource.RetryError {
_, err := conn.PutEventStream(&req)
if tfawserr.ErrMessageContains(err, pinpoint.ErrCodeBadRequestException, "make sure the IAM Role is configured correctly") { | pinpoint: Export/un-export after move | terraform-providers_terraform-provider-aws | train | go |
01be11a093386f2694d5ba353d845c1e87830a2c | diff --git a/grpclib/protocol.py b/grpclib/protocol.py
index <HASH>..<HASH> 100644
--- a/grpclib/protocol.py
+++ b/grpclib/protocol.py
@@ -130,38 +130,6 @@ class Buffer:
for _ in range(self._unacked.qsize()))
-class StreamsLimit:
-
- def __init__(self, limit: Optional[int] = None) -> None:
- self._limit = limit
- self._current = 0
- self._release = Event()
-
- def reached(self) -> bool:
- if self._limit is not None:
- return self._current >= self._limit
- else:
- return False
-
- async def wait(self) -> None:
- # TODO: use FIFO queue for waiters
- if self.reached():
- self._release.clear()
- await self._release.wait()
-
- def acquire(self) -> None:
- self._current += 1
-
- def release(self) -> None:
- self._current -= 1
- if not self.reached():
- self._release.set()
-
- def set(self, value: Optional[int]) -> None:
- assert value is None or value >= 0, value
- self._limit = value
-
-
class Connection:
"""
Holds connection state (write_ready), and manages | Removed unused StreamsLimit class | vmagamedov_grpclib | train | py |
153e73304827b0eb6073a6958f9efb18d44c48ae | diff --git a/app/components/sl-select.js b/app/components/sl-select.js
index <HASH>..<HASH> 100755
--- a/app/components/sl-select.js
+++ b/app/components/sl-select.js
@@ -79,6 +79,11 @@ export default Ember.Component.extend( InputBased, TooltipEnabled, {
*/
optionValuePath: 'value',
+ /**
+ * Update the bound value when the Select2's selection has changed
+ * @method selectionChanged
+ * @param {mixed} data - Select2 data
+ */
selectionChanged: function ( data ) {
var multiple = this.get( 'multiple' ),
optionValuePath = this.get( 'optionValuePath' ),
@@ -219,6 +224,14 @@ export default Ember.Component.extend( InputBased, TooltipEnabled, {
});
});
+ var originalBodyOverflow = document.body.style.overflow || 'auto';
+ input.on( 'select2-open', function () {
+ document.body.style.overflow = 'hidden';
+ });
+ input.on( 'select2-close', function () {
+ document.body.style.overflow = originalBodyOverflow;
+ });
+
if ( !this.get( 'multiple' )) {
this.$( 'input.select2-input' ).attr( 'placeholder', 'Search...' );
} | Remove body scroll when sl-select is open | softlayer_sl-ember-components | train | js |
cc1808d4c339c9d7068d3426f2770e6bbb54c64e | diff --git a/src/PlaygroundUser/Service/User.php b/src/PlaygroundUser/Service/User.php
index <HASH>..<HASH> 100755
--- a/src/PlaygroundUser/Service/User.php
+++ b/src/PlaygroundUser/Service/User.php
@@ -313,15 +313,21 @@ class User extends \ZfcUser\Service\User implements ServiceManagerAwareInterface
* Register the user (associated with a default). It can be a social registration
*
* @param array $data
+ * @param string $formClass
* @return \playgroundUser\Entity\UserInterface
* @throws Exception\InvalidArgumentException
*/
- public function register(array $data)
+ public function register(array $data, $formClass=false)
{
$zfcUserOptions = $this->getServiceManager()->get('zfcuser_module_options');
$class = $zfcUserOptions->getUserEntityClass();
$user = new $class;
- $form = $this->getRegisterForm();
+
+ if($formClass){
+ $form = $this->getServiceManager()->get($formClass);
+ } else {
+ $form = $this->getRegisterForm();
+ }
$form->get('dob')->setOptions(array('format' => 'Y-m-d'));
// Convert birth date format | It's now possible to register a new user with a custom register form | gregorybesson_PlaygroundUser | train | php |
87de7d7180877c554c4320df457d342dc17086a7 | diff --git a/build/prepare_deploy.js b/build/prepare_deploy.js
index <HASH>..<HASH> 100755
--- a/build/prepare_deploy.js
+++ b/build/prepare_deploy.js
@@ -16,10 +16,10 @@ mkdir('-p', 'dist');
cp('-R', '../dist/*', './dist/');
cd('..');
-var version = 'v' + require(path.join(__dirname, '../package.json')).version + '/';
-var versionDir = path.join(paths.releases, version);
+var version = require(path.join(__dirname, '../package.json')).version;
+var versionDir = path.join(paths.releases, 'v' + version + '/');
var latestDir = path.join(paths.releases, 'latest/');
-var v1Dir = path.join(paths.releases, 'v1.x.x/');
+var v1Dir = path.join(paths.releases, 'v' + version.split('.')[0] + '.x.x/');
mkdir('-p', versionDir)
mkdir('-p', latestDir);
mkdir('-p', v1Dir); | build: finish script for CDN releases
closes #<I>, [skip ci] | Rebilly_ReDoc | train | js |
dc70e303abb7a405a666d39d6300168277879676 | diff --git a/packages/d3fc-chart/src/svg/cartesian.js b/packages/d3fc-chart/src/svg/cartesian.js
index <HASH>..<HASH> 100644
--- a/packages/d3fc-chart/src/svg/cartesian.js
+++ b/packages/d3fc-chart/src/svg/cartesian.js
@@ -60,7 +60,7 @@ export default (xScale = scaleIdentity(), yScale = scaleIdentity()) => {
<d3fc-svg class='plot-area' style='flex: 1; overflow: hidden'></d3fc-svg>
<d3fc-svg class='y-axis' style='width: 3em'></d3fc-svg>
<div style='width: 1em; display: flex; align-items: center; justify-content: center'>
- <div class='y-axis-label' style='transform: rotate(90deg)'></div>
+ <div class='y-axis-label' style='transform: rotate(-90deg)'></div>
</div>
</div>
<d3fc-svg class='x-axis' style='height: 2em; margin-${yOrient}: 4em'></d3fc-svg> | fix: flip the vertical axis labels to read ltr (#<I>)
Fixes #9 | d3fc_d3fc | train | js |
54f23bd7bd9b89e60fb295138ec6bd55b989e061 | diff --git a/lib/render.js b/lib/render.js
index <HASH>..<HASH> 100644
--- a/lib/render.js
+++ b/lib/render.js
@@ -13,8 +13,15 @@ module.exports = function render (newInstance, root) {
const patches = diff(instance, newInstance)
node = patch(child, patches)
} else {
+ const child = root.children[0]
node = create(newInstance)
- root.appendChild(node)
+
+ if (child) {
+ root.replaceChild(node, child)
+ } else {
+ root.appendChild(node)
+ }
+
}
cache.setInstance(root, newInstance, node) | Replace previous node with new one if there is one | garbles_yolk | train | js |
3d5490b6c42aaa94a71b624627179798e81e62d0 | diff --git a/glances/exports/glances_rabbitmq.py b/glances/exports/glances_rabbitmq.py
index <HASH>..<HASH> 100644
--- a/glances/exports/glances_rabbitmq.py
+++ b/glances/exports/glances_rabbitmq.py
@@ -44,7 +44,7 @@ class Export(GlancesExport):
self.user = None
self.password = None
self.queue = None
- self.protocol = 'amqp'
+ self.protocol = None
# Optionals configuration keys
# N/A
@@ -68,6 +68,14 @@ class Export(GlancesExport):
"""Init the connection to the rabbitmq server."""
if not self.export_enable:
return None
+
+ # Needed for when protocol is not specified and when protocol is upper case
+ # only amqp and amqps supported
+ if self.protocol is not None and (self.protocol.lower() == 'amqps'):
+ self.protocol = 'amqps'
+ else:
+ self.protocol = 'amqp'
+
try:
parameters = pika.URLParameters(
self.protocol + | Needed to handle case where no protocol was specified in configuration. So added in an if clause to check if the protocol was present | nicolargo_glances | train | py |
4625ab9a8c92103f9f86067b8efa506a3377bbc2 | diff --git a/theme/standard/layout.php b/theme/standard/layout.php
index <HASH>..<HASH> 100644
--- a/theme/standard/layout.php
+++ b/theme/standard/layout.php
@@ -38,7 +38,6 @@
</td>
<?php } ?>
<td id="content">
- <?php echo $OUTPUT->skip_link_target(); ?>
[MAIN CONTENT GOES HERE]
</td>
<?php if ($PAGE->blocks->region_has_content('side-post')) { ?> | themes: MDL-<I> $OUTPUT->header does the main skip destination, layout.php should now. | moodle_moodle | train | php |
27286c63a5adec8c0b53335064fd75d68dd62cb6 | diff --git a/Library/Installation/Updater/Updater021000.php b/Library/Installation/Updater/Updater021000.php
index <HASH>..<HASH> 100644
--- a/Library/Installation/Updater/Updater021000.php
+++ b/Library/Installation/Updater/Updater021000.php
@@ -12,6 +12,7 @@
namespace Claroline\CoreBundle\Library\Installation\Updater;
use Claroline\CoreBundle\Persistence\ObjectManager;
+use Claroline\CoreBundle\Entity\Resource\ResourceIcon;
class Updater021000
{
@@ -107,6 +108,8 @@ class Updater021000
public function updateIcons()
{
+ $this->log('updating icons...');
+
$coreIconWebDirRelativePath = "bundles/clarolinecore/images/resources/icons/";
$resourceImages = array(
array('res_vector.png', 'application/postscript'), | [CoreBundle] Update icons | claroline_Distribution | train | php |
91d36ee125433939c57d9d732ff3bd289a7923f3 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -181,6 +181,7 @@ KinesisStream.prototype._putRecords = function(requestContent) {
try {
self._queueWait = self._queueSendEntries();
if (err) {
+ if (!err.records) err.records = requestContent.Records;
throw err;
} | Add records to the errors (if not already present) | auth0_kinesis-writable | train | js |
dd22d2b27c00fd2680399e0d8c7dcc87b294f5ec | diff --git a/test/test-haiku-render.js b/test/test-haiku-render.js
index <HASH>..<HASH> 100644
--- a/test/test-haiku-render.js
+++ b/test/test-haiku-render.js
@@ -59,7 +59,7 @@ describe('h.render(key, context, callback)', function(){
var $ = cheerio.load(output)
- assert.equal($('.content-list li').length, 6)
+ assert.equal($('.content-list li').length, 7)
assert.equal($('.posts-list li').length, 5)
done() | Changes a test, prob should do a better check... | jxson_haiku | train | js |
49b647bd46f9a357e8219d75197ac8d8d5ace4fc | diff --git a/src/Hal/Application/Config/Validator.php b/src/Hal/Application/Config/Validator.php
index <HASH>..<HASH> 100644
--- a/src/Hal/Application/Config/Validator.php
+++ b/src/Hal/Application/Config/Validator.php
@@ -48,7 +48,7 @@ class Validator
}
$groupsRaw = $config->get('groups');
- $groups = array_map(static function (array $groupRaw): Group {
+ $groups = array_map(static function (array $groupRaw) {
return new Group($groupRaw['name'], $groupRaw['match']);
}, $groupsRaw);
$config->set('groups', $groups); | Removing PHP 7+ return value typehint
This package claims to be good for PHP >=<I> so it cannot include PHP 7 only syntax. | phpmetrics_PhpMetrics | train | php |
05b7a847cab60b9af0a17c56bae0c7c6ab5fe3e9 | diff --git a/lib/pghero/methods/sequences.rb b/lib/pghero/methods/sequences.rb
index <HASH>..<HASH> 100644
--- a/lib/pghero/methods/sequences.rb
+++ b/lib/pghero/methods/sequences.rb
@@ -37,7 +37,7 @@ module PgHero
sequences[i][:last_value] = row[:last_value]
end
- sequences
+ sequences.sort_by { |s| s[:sequence] }
end
def sequence_danger(threshold: 0.9) | Restored sorting for sequences [skip ci] | ankane_pghero | train | rb |
f503c09b875be02c93b41ea46475ba4903c62c2c | diff --git a/packages/react-server-test-pages/pages/navigation/playground.js b/packages/react-server-test-pages/pages/navigation/playground.js
index <HASH>..<HASH> 100644
--- a/packages/react-server-test-pages/pages/navigation/playground.js
+++ b/packages/react-server-test-pages/pages/navigation/playground.js
@@ -116,6 +116,12 @@ export default class NavigationPlaygroundPage {
return next();
}
+ getTitle() {
+ const {page} = this.getRequest().getQuery();
+ return typeof page === "undefined"
+ ?"Navigation Playground"
+ :"Page "+page
+ }
getElements() {
return [
<RootContainer> | Add a title to the navigation playground | redfin_react-server | train | js |
10682f7a9b1c7d8f558630175d4a022849ae5419 | diff --git a/falafel/config/specs.py b/falafel/config/specs.py
index <HASH>..<HASH> 100644
--- a/falafel/config/specs.py
+++ b/falafel/config/specs.py
@@ -188,7 +188,8 @@ static_specs = {
SimpleFileSpec("database-schema-version")]),
"rhn-schema-stats" : First([CommandSpec("/usr/bin/rhn-schema-stats -"),
SimpleFileSpec("database/schema-stats.log")]),
- "rhn_server_xmlrpc.log" : SimpleFileSpec("var/log/rhn/rhn_server_xmlrpc.log", large_content=True),
+ "rhn_server_xmlrpc.log" : First([SimpleFileSpec("var/log/rhn/rhn_server_xmlrpc.log", large_content=True),
+ SimpleFileSpec("rhn-logs/rhn/rhn_server_xmlrpc.log", large_content=True)]),
"rhn_taskomatic_daemon.log" : First([SimpleFileSpec("var/log/rhn/rhn_taskomatic_daemon.log", large_content=True),
SimpleFileSpec("rhn-logs/rhn/rhn_taskomatic_daemon.log", large_content=True)]),
"root_crontab" : First([CommandSpec("/usr/bin/crontab -l -u root"), | Changed to use the first of sosreport and spacewalk-debug paths | RedHatInsights_insights-core | train | py |
627b2f9a240c94ff44002a4c087b47bc017e4364 | diff --git a/pkg/kubectl/resource/mapper.go b/pkg/kubectl/resource/mapper.go
index <HASH>..<HASH> 100644
--- a/pkg/kubectl/resource/mapper.go
+++ b/pkg/kubectl/resource/mapper.go
@@ -42,7 +42,7 @@ func (m *Mapper) InfoForData(data []byte, source string) (*Info, error) {
return nil, fmt.Errorf("unable to parse %q: %v", source, err)
}
data = json
- version, kind, err := m.DataVersionAndKind(data)
+ version, kind, err := runtime.UnstructuredJSONScheme.DataVersionAndKind(data)
if err != nil {
return nil, fmt.Errorf("unable to get type info from %q: %v", source, err)
} | kubectl should use UnstructuredJSONScheme to decode version and kind, as it throws errors if either are missing] | kubernetes_kubernetes | train | go |
b66976719c2df10d9a2f6f91785603844480a5b0 | diff --git a/src/photini/__init__.py b/src/photini/__init__.py
index <HASH>..<HASH> 100644
--- a/src/photini/__init__.py
+++ b/src/photini/__init__.py
@@ -1,4 +1,4 @@
from __future__ import unicode_literals
__version__ = '2021.11.2'
-build = '1888 (95a9b3e)'
+build = '1889 (9b86feb)'
diff --git a/src/photini/spelling.py b/src/photini/spelling.py
index <HASH>..<HASH> 100644
--- a/src/photini/spelling.py
+++ b/src/photini/spelling.py
@@ -48,7 +48,7 @@ def import_Gspell():
from photini.gi import gi, using_pgi, GSListPtr_to_list
gi.require_version('Gspell', '1')
from gi.repository import GLib, GObject, Gspell
- except ImportError as ex:
+ except Exception as ex:
print(str(ex))
if 'gi.repository' in sys.modules: | Widen exception catching when importing GSpell
gi.require_version raises ValueError rather than ImportError if GSpell
is not installed. | jim-easterbrook_Photini | train | py,py |
e032dfd58af7f1fa740dfb846887dcb49b604537 | diff --git a/ZPHP/Conn/Adapter/Yac.php b/ZPHP/Conn/Adapter/Yac.php
index <HASH>..<HASH> 100644
--- a/ZPHP/Conn/Adapter/Yac.php
+++ b/ZPHP/Conn/Adapter/Yac.php
@@ -61,7 +61,7 @@ class Yac implements IConn
}
}
- public function delChannel($uid, $channel)
+ public function delChannel($uid, $channel='ALL')
{
$channelInfo = $this->getChannel($channel);
if(!empty($channelInfo[$uid])) {
@@ -85,16 +85,6 @@ class Yac implements IConn
return true;
}
- private function delChannel($uid, $channel = 'ALL')
- {
- $channelInfo = $this->getChannel($channel);
- if(!empty($channelInfo[$uid])) {
- unset($channelInfo[$uid]);
- $this->yac->set($this->getKey($channel), json_encode($channelInfo));
- }
- return true;
- }
-
public function getChannel($channel = 'ALL')
{
return json_decode($this->yac->get($this->getKey($channel)), true); | yac delChannel multi | shenzhe_zphp | train | php |
f3a6f94dc63b4957f9d5907faa09ea67cd61ee0a | diff --git a/assets/src/ruboto/widget.rb b/assets/src/ruboto/widget.rb
index <HASH>..<HASH> 100644
--- a/assets/src/ruboto/widget.rb
+++ b/assets/src/ruboto/widget.rb
@@ -74,7 +74,13 @@ def ruboto_import_widgets(*widgets)
end
def ruboto_import_widget(class_name, package_name="android.widget")
- klass = ruboto_import("#{package_name}.#{class_name}") || eval("Java::#{package_name}.#{class_name}")
+ if class_name.is_a?(String) or class_name.is_a?(Symbol)
+ klass = ruboto_import("#{package_name}.#{class_name}") || eval("Java::#{package_name}.#{class_name}")
+ else
+ klass = class_name
+ ruboto_import klass
+ class_name = klass.java_class.name.split('.')[-1]
+ end
return unless klass
@@ -110,6 +116,8 @@ def ruboto_import_widget(class_name, package_name="android.widget")
setup_image_button if class_name == :ImageButton
setup_linear_layout if class_name == :LinearLayout
setup_relative_layout if class_name == :RelativeLayout
+
+ klass
end
# | Allow ruboto_import_widget to set up widgets that were generated (i.e., not trying to import them first) | ruboto_ruboto | train | rb |
c7e25064d654b2c1191088d9b5e53e3f6d605d58 | diff --git a/src/test/java/com/klarna/hiverunner/ReservedKeywordTest.java b/src/test/java/com/klarna/hiverunner/ReservedKeywordTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/klarna/hiverunner/ReservedKeywordTest.java
+++ b/src/test/java/com/klarna/hiverunner/ReservedKeywordTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2013 Klarna AB
+ * Copyright 2016 Klarna AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. | Minor: Updated copyright date to <I> | klarna_HiveRunner | train | java |
10a2a74b76461786fde25ceb9747509f73904de6 | diff --git a/welcome.php b/welcome.php
index <HASH>..<HASH> 100644
--- a/welcome.php
+++ b/welcome.php
@@ -63,9 +63,10 @@ class Welcome extends Module
'max' => _PS_VERSION_,
];
- // If the symfony container is not available this constructor will fail
+ // If the symfony container is not available or if we are not in the admin directory
+ // this constructor will fail.
// This can happen during the upgrade process
- if (null == SymfonyContainer::getInstance()) {
+ if (null == SymfonyContainer::getInstance() || !defined('_PS_ADMIN_DIR_')) {
return;
} | Make sure PS_ADMIN_DIR exists before using the OnBoarding | PrestaShop_welcome | train | php |
aa26f2e6a2a252d175f6e40ee4f3a351af0cf5e2 | diff --git a/tooltipmenu.js b/tooltipmenu.js
index <HASH>..<HASH> 100644
--- a/tooltipmenu.js
+++ b/tooltipmenu.js
@@ -1,6 +1,6 @@
const {Plugin} = require("../edit")
const {elt, insertCSS} = require("../util/dom")
-const {Tooltip} = require("../ui")
+const {Tooltip} = require("../tooltip")
const {renderGrouped} = require("./menu") | Split prompt and tooltip modules again
There's no reason for these to be combined | ProseMirror_prosemirror-menu | train | js |
a462549771807c210efcff3eb79c38addcd15336 | diff --git a/tests/formats/visual.py b/tests/formats/visual.py
index <HASH>..<HASH> 100644
--- a/tests/formats/visual.py
+++ b/tests/formats/visual.py
@@ -196,3 +196,18 @@ class VisualFormatReaderTestCase(unittest.TestCase):
self._drop_header('DELIM')
reader = VisualFormatReader(self.fp)
self.assertEqual(reader.delimiter, str(','))
+
+ def test_obstype(self):
+ """
+ Check that observation type matches data in header.
+ """
+ reader = VisualFormatReader(self.fp)
+ self.assertEqual(reader.obstype, str('Visual'))
+
+ def test_missing_obstype(self):
+ """
+ Check that Visual is assumed obstype when OBSTYPE header is missing.
+ """
+ self._drop_header('OBSTYPE')
+ reader = VisualFormatReader(self.fp)
+ self.assertEqual(reader.obstype, 'Visual') | Added tests for OBSTYPE header. | zsiciarz_pyaavso | train | py |
fd01125fc2644b942e4155b724c49356fceaa369 | diff --git a/grade/report/grader/index.php b/grade/report/grader/index.php
index <HASH>..<HASH> 100644
--- a/grade/report/grader/index.php
+++ b/grade/report/grader/index.php
@@ -28,7 +28,7 @@ require_once $CFG->libdir.'/gradelib.php';
require_once $CFG->dirroot.'/grade/lib.php';
require_once $CFG->dirroot.'/grade/report/grader/lib.php';
-$courseid = required_param('id'); // course id
+$courseid = required_param('id', PARAM_INT); // course id
$page = optional_param('page', 0, PARAM_INT); // active page
$perpageurl = optional_param('perpage', 0, PARAM_INT);
$edit = optional_param('edit', -1, PARAM_BOOL); // sticky editting mode | MDL-<I> added missing param type; merged from MOODLE_<I>_STABLE | moodle_moodle | train | php |
0296bb945e1add5bb9f00503ea3eff0dae0d5a4f | diff --git a/src/Server.php b/src/Server.php
index <HASH>..<HASH> 100644
--- a/src/Server.php
+++ b/src/Server.php
@@ -36,6 +36,13 @@ class Server
: null;
}
+ public function httpXNDUuid()
+ {
+ return $this->exists('HTTP_X_ND_UUID')
+ ? $_SERVER['HTTP_X_ND_UUID']
+ : null;
+ }
+
public function remoteAddr()
{
$remoteAddr = $_SERVER['REMOTE_ADDR']; | Added httpXNDUuid method | g4code_predefined-variables | train | php |
70764246af2423f31bad2d11b9b1c908ea89cff3 | diff --git a/frasco_forms/__init__.py b/frasco_forms/__init__.py
index <HASH>..<HASH> 100644
--- a/frasco_forms/__init__.py
+++ b/frasco_forms/__init__.py
@@ -124,7 +124,7 @@ class FormsFeature(Feature):
try:
as_ = opts.get("var_name", getattr(self.form, "as_", "form"))
- form_class = create_from_template(view.app, template, var_name=as_)
+ form_class = create_from_template(current_app, template, var_name=as_)
except NoFormError:
if not name:
raise | updated after changes to Action.init_view | frascoweb_frasco-forms | train | py |
04e96af74c59af7352ca1aa07f8dae414885bb63 | diff --git a/BaragonData/src/main/java/com/hubspot/baragon/worker/BaragonRequestWorker.java b/BaragonData/src/main/java/com/hubspot/baragon/worker/BaragonRequestWorker.java
index <HASH>..<HASH> 100644
--- a/BaragonData/src/main/java/com/hubspot/baragon/worker/BaragonRequestWorker.java
+++ b/BaragonData/src/main/java/com/hubspot/baragon/worker/BaragonRequestWorker.java
@@ -78,14 +78,14 @@ public class BaragonRequestWorker implements Runnable {
if (!conflicts.isEmpty()) {
requestManager.setRequestMessage(request.getLoadBalancerRequestId(), String.format("Invalid request due to base path conflicts: %s", conflicts));
- return InternalRequestStates.FAILED_REVERTED;
+ return InternalRequestStates.INVALID_REQUEST_NOOP;
}
final Set<String> missingGroups = requestManager.getMissingLoadBalancerGroups(request);
if (!missingGroups.isEmpty()) {
requestManager.setRequestMessage(request.getLoadBalancerRequestId(), String.format("Invalid request due to non-existent load balancer groups: %s", missingGroups));
- return InternalRequestStates.FAILED_REVERTED;
+ return InternalRequestStates.INVALID_REQUEST_NOOP;
}
// for (String loadBalancerGroup : request.getLoadBalancerService().getLoadBalancerGroups()) { | missing lb groups, base conflict should be NOOP | HubSpot_Baragon | train | java |
c45c609f6e9dfaaefaa3ce004d36d0dcf82c8180 | diff --git a/lib/promise.js b/lib/promise.js
index <HASH>..<HASH> 100644
--- a/lib/promise.js
+++ b/lib/promise.js
@@ -327,16 +327,20 @@ const page = _d => Q.denodeify((_self, done) => {
.then(d.batch)
.then(series(d))
.then(sd => {
- assert.ok(Array.isArray(sd[d.outputs]), `${method}: the outputs should always be an array`)
-
- accumulator = accumulator.concat(sd[d.outputs])
+ if (d.outpus) {
+ assert.ok(Array.isArray(sd[d.outputs]), `${method}: the outputs should always be an array`)
+ accumulator = accumulator.concat(sd[d.outputs])
+ }
if (sd.cursor && sd.cursor.next) {
process.nextTick(() => {
_run(sd.cursor.next)
})
} else {
- self[d.outputs] = accumulator;
+ if (d.outputs) {
+ self[d.outputs] = accumulator;
+ }
+
done(null, self)
} | don't require output for pager | dpjanes_iotdb-helpers | train | js |
b2c3627a2c2d59d2789683dd15f1985356a20ea6 | diff --git a/zipkin/src/test/java/zipkin/BoundaryTraceIdSamplerTest.java b/zipkin/src/test/java/zipkin/BoundaryTraceIdSamplerTest.java
index <HASH>..<HASH> 100644
--- a/zipkin/src/test/java/zipkin/BoundaryTraceIdSamplerTest.java
+++ b/zipkin/src/test/java/zipkin/BoundaryTraceIdSamplerTest.java
@@ -23,6 +23,6 @@ public class BoundaryTraceIdSamplerTest extends TraceIdSamplerTest {
}
@Override Percentage expectedErrorRate() {
- return withPercentage(4);
+ return withPercentage(5);
}
} | Ups error rate to reduce travis flake | apache_incubator-zipkin | train | java |
4d2fcc5b60a72affb57d4587a4b1aa0eef574039 | diff --git a/src/views/layouts/_after_header.php b/src/views/layouts/_after_header.php
index <HASH>..<HASH> 100644
--- a/src/views/layouts/_after_header.php
+++ b/src/views/layouts/_after_header.php
@@ -1,7 +1,7 @@
<?= $this->registerCss('
body:after {
content: "beta";
- position: fixed;
+ position: absolute;
width: 46px;
height: 19px;
background: #cc006a; | Changed position to absolute for BETA ribbon | hiqdev_hipanel-core | train | php |
a26197f8e316f691da179465e21635dd55e25f14 | diff --git a/hazelcast/src/main/java/com/hazelcast/cluster/client/DestroyHandler.java b/hazelcast/src/main/java/com/hazelcast/cluster/client/DestroyHandler.java
index <HASH>..<HASH> 100644
--- a/hazelcast/src/main/java/com/hazelcast/cluster/client/DestroyHandler.java
+++ b/hazelcast/src/main/java/com/hazelcast/cluster/client/DestroyHandler.java
@@ -20,6 +20,7 @@ import com.hazelcast.client.ClientCommandHandler;
import com.hazelcast.instance.Node;
import com.hazelcast.map.MapService;
import com.hazelcast.nio.Protocol;
+import com.hazelcast.spi.ProxyService;
public class DestroyHandler extends ClientCommandHandler {
@@ -28,8 +29,9 @@ public class DestroyHandler extends ClientCommandHandler {
String[] args = protocol.args;
String type = args[0];
String name = args[1];
+ final ProxyService proxyService = node.nodeEngine.getProxyService();
if("map".equals(type)){
- ((MapService) node.nodeEngine.getService(MapService.SERVICE_NAME)).createDistributedObjectForClient(name).destroy();
+ proxyService.destroyDistributedObject(MapService.SERVICE_NAME, name);
}
return protocol.success();
} | Added client proxy handling to proxy service. | hazelcast_hazelcast | train | java |
fe256447266b172defdeb7797805eebe7b882d73 | diff --git a/lib/liquid/standardfilters.rb b/lib/liquid/standardfilters.rb
index <HASH>..<HASH> 100644
--- a/lib/liquid/standardfilters.rb
+++ b/lib/liquid/standardfilters.rb
@@ -30,7 +30,9 @@ module Liquid
end
def escape_once(input)
- ActionView::Helpers::TagHelper.escape_once(input) rescue input
+ ActionView::Helpers::TagHelper.escape_once(input)
+ rescue NameError
+ input
end
alias_method :h, :escape | Rescue NameError for Rubinius | Shopify_liquid | train | rb |
21f3ea28636ac344c94752fde0117c5f672dac6f | diff --git a/threadedcomments/forms.py b/threadedcomments/forms.py
index <HASH>..<HASH> 100644
--- a/threadedcomments/forms.py
+++ b/threadedcomments/forms.py
@@ -37,5 +37,5 @@ class ThreadedCommentForm(CommentForm):
def get_comment_create_data(self, *args, **kwargs):
d = super(ThreadedCommentForm, self).get_comment_create_data(*args, **kwargs)
d['parent_id'] = self.cleaned_data['parent']
- d['title'] = self.cleaned_data['title']
+ d['title'] = self.cleaned_data.get('title', '') # title can be removed
return d | Allow title to be removed from the form (e.g. via django-fluent-comments) | HonzaKral_django-threadedcomments | train | py |
440db41c205608bf102c597b7c50f760dcbe3e5e | diff --git a/spec/double_entry/line_spec.rb b/spec/double_entry/line_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/double_entry/line_spec.rb
+++ b/spec/double_entry/line_spec.rb
@@ -65,6 +65,25 @@ describe DoubleEntry::Line do
end
end
+ describe '#save' do
+ context 'when balance is sent negative' do
+ let(:account) {
+ DoubleEntry.account(:savings, :scope => '17', :positive_only => true)
+ }
+
+ let(:line) {
+ DoubleEntry::Line.new(
+ :balance => Money.new(-1),
+ :account => account,
+ )
+ }
+
+ it 'raises AccountWouldBeSentNegative exception' do
+ expect { line.save }.to raise_error DoubleEntry::AccountWouldBeSentNegative
+ end
+ end
+ end
+
it "has a table name prefixed with double_entry_" do
expect(DoubleEntry::Line.table_name).to eq "double_entry_lines"
end | Add spec for Line#save | envato_double_entry | train | rb |
2c943cd4ec016a628877a6e83460f69124b9ee07 | diff --git a/src/extensions/default/NavigationAndHistory/NavigationProvider.js b/src/extensions/default/NavigationAndHistory/NavigationProvider.js
index <HASH>..<HASH> 100644
--- a/src/extensions/default/NavigationAndHistory/NavigationProvider.js
+++ b/src/extensions/default/NavigationAndHistory/NavigationProvider.js
@@ -535,7 +535,9 @@ define(function (require, exports, module) {
_reinstateMarkers(editor, jumpForwardStack);
});
FileSystem.on("change", function (event, entry) {
- _handleExternalChange(event, {file: entry});
+ if (entry) {
+ _handleExternalChange(event, {file: entry});
+ }
});
Document.on("_documentRefreshed", function (event, doc) {
_handleExternalChange(event, {file: doc.file}); | Fix NavigationProvider throwing errors when doc.file is missing. Fixes #<I> (#<I>) | adobe_brackets | train | js |
1d825eb685ea047333efdb94b0b7908353a091e3 | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -1126,7 +1126,7 @@ gulp.task('bundles.js.umd.min', ['!bundles.js.umd', '!bundle.ng.polyfills'], fun
// minify production bundles
return gulp.src([
- 'dist/js/bundle/angular-polyfills.js',
+ 'dist/js/bundle/angular2-polyfills.js',
'dist/js/bundle/angular2.umd.js',
'dist/js/bundle/angular2_all.umd.js'
])
@@ -1156,7 +1156,7 @@ gulp.task('!bundle.js.min.deps', ['!bundle.js.min'], function() {
});
gulp.task('!bundle.ng.polyfills', ['clean'],
- function() { return addDevDependencies('angular-polyfills.js'); });
+ function() { return addDevDependencies('angular2-polyfills.js'); });
var JS_DEV_DEPS = [
licenseWrap('node_modules/zone.js/LICENSE', true), | chore(bundles): rename angular-polyfills to angular2-polyfills. | angular_angular | train | js |
273d4fb73d6370fd36c8bf71a732ed3d8ddade2a | diff --git a/lib/db_dynamodb.js b/lib/db_dynamodb.js
index <HASH>..<HASH> 100644
--- a/lib/db_dynamodb.js
+++ b/lib/db_dynamodb.js
@@ -669,7 +669,6 @@ Pool.prototype.queryBulk = function(client, req, callback)
continue;
}
switch (list[i].op) {
- case "add":
case "put":
case "del":
if (!breq[list[i].table]) breq[list[i].table] = []; | ddb bulk does not support add | vseryakov_backendjs | train | js |
d312879fd2c423081ec24b62ce49f8647c24f46b | diff --git a/lib/travis/notifications/webhook/payload.rb b/lib/travis/notifications/webhook/payload.rb
index <HASH>..<HASH> 100644
--- a/lib/travis/notifications/webhook/payload.rb
+++ b/lib/travis/notifications/webhook/payload.rb
@@ -1,17 +1,13 @@
module Travis
module Notifications
class Webhook
- class Payload
+ class Payload < Notifications::Payload
attr_reader :object
def initialize(object)
@object = object
end
- def to_hash
- render(:hash)
- end
-
def render(format)
Travis::Renderer.send(format, object, :type => :webhook, :template => template, :base_dir => base_dir)
end | use the Payload base class here, too | travis-ci_travis-core | train | rb |
328c4adcf8790dfc9de80d85e0d4a0a328c3efd7 | diff --git a/src/Kodeine/Acl/Models/Eloquent/Role.php b/src/Kodeine/Acl/Models/Eloquent/Role.php
index <HASH>..<HASH> 100644
--- a/src/Kodeine/Acl/Models/Eloquent/Role.php
+++ b/src/Kodeine/Acl/Models/Eloquent/Role.php
@@ -2,6 +2,7 @@
namespace Kodeine\Acl\Models\Eloquent;
+use DateTimeInterface;
use Illuminate\Database\Eloquent\Model;
use Kodeine\Acl\Traits\HasPermission;
@@ -23,11 +24,6 @@ class Role extends Model
*/
protected $table;
- protected $dates = [
- 'created_at:Y-m-d H:i:s',
- 'updated_at:Y-m-d H:i:s',
- ];
-
public function __construct(array $attributes = [])
{
$this->table = config('acl.db_prefix') . 'roles';
@@ -36,6 +32,17 @@ class Role extends Model
}
/**
+ * Prepare a date for array / JSON serialization.
+ *
+ * @param DateTimeInterface $date
+ * @return string
+ */
+ protected function serializeDate(DateTimeInterface $date)
+ {
+ return $date->format('Y-m-d H:i:s');
+ }
+
+ /**
* Use the slug of the Role
* instead of the ID.
* | casting date to Y-m-d H:i:s for unit testing | kodeine_laravel-acl | train | php |
faeef9d20923c6930d76fa00525133c229f1006a | diff --git a/core/test/functional/admin/login_test.js b/core/test/functional/admin/login_test.js
index <HASH>..<HASH> 100644
--- a/core/test/functional/admin/login_test.js
+++ b/core/test/functional/admin/login_test.js
@@ -1,4 +1,4 @@
-/*globals casper, __utils__, url, user, falseUser */
+/*globals casper, __utils__, url, newUser, user, falseUser */
CasperTest.begin('Ensure Session is Killed', 1, function suite(test) {
casper.thenOpen(url + 'logout/', function (response) {
@@ -98,6 +98,9 @@ CasperTest.begin("Login limit is in place", 3, function suite(test) {
}, function onTimeout() {
test.assert(false, 'We did not trip the login limit.');
});
+ // This test used login, add a wait to
+ // ensure future tests don't get tripped up by this.
+ casper.wait(2000);
}, true);
CasperTest.begin("Can login to Ghost", 4, function suite(test) { | Fix login test failure
no issue
- added timeout after login limit tests | TryGhost_Ghost | train | js |
0d81a0044d7220c344fedce8b660c892acf5bfea | diff --git a/spec/loadconfig-spec.js b/spec/loadconfig-spec.js
index <HASH>..<HASH> 100644
--- a/spec/loadconfig-spec.js
+++ b/spec/loadconfig-spec.js
@@ -6,13 +6,15 @@ var underTest = require('../src/util/loadconfig'),
path = require('path');
describe('loadConfig', function () {
'use strict';
- var workingdir, exampleConfig;
+ var workingdir, exampleConfig, cwd;
beforeEach(function () {
exampleConfig = {name: 'config'};
workingdir = tmppath();
shell.mkdir(workingdir);
+ cwd = shell.pwd().toString();
});
afterEach(function () {
+ shell.cd(cwd);
shell.rm('-rf', workingdir);
});
it('loads config from the current directory if no directory provided', function (done) { | compat with latest shelljs, needs pwd to exist for cd | claudiajs_claudia | train | js |
6e01e957a4fabfcc9a25ea051320b456d180fc6c | diff --git a/openquake/commands/run_tiles.py b/openquake/commands/run_tiles.py
index <HASH>..<HASH> 100644
--- a/openquake/commands/run_tiles.py
+++ b/openquake/commands/run_tiles.py
@@ -19,9 +19,9 @@ from __future__ import division
import os
import time
import logging
-from openquake.baselib import sap, general, parallel
+from openquake.baselib import sap, general, parallel, datastore
from openquake.hazardlib import valid
-from openquake.commonlib import readinput, datastore, logs
+from openquake.commonlib import readinput, logs
from openquake.commands import engine | Fixed more imports [demos] | gem_oq-engine | train | py |
dd54a0ff9be175117f613418b143099f50bcf761 | diff --git a/generate/generate.go b/generate/generate.go
index <HASH>..<HASH> 100644
--- a/generate/generate.go
+++ b/generate/generate.go
@@ -66,7 +66,27 @@ import (
{{end}}
`
-var tmpl = template.Must(template.New("code").Parse(tmplStr))
+var tmpl *template.Template
+
+func init() {
+ extraFuncs := make(template.FuncMap)
+ extraFuncs["getMethods"] = getMethods
+
+ tmpl = template.New("code")
+ tmpl.Funcs(extraFuncs)
+ tmpl.Parse(tmplStr)
+}
+
+func getMethods(it reflect.Type) []reflect.Method {
+ numMethods := it.NumMethod()
+ methods := make([]reflect.Method, numMethods)
+
+ for i := 0; i < numMethods; i++ {
+ methods[i] = it.Method(i)
+ }
+
+ return methods
+}
// A map from import identifier to package to use that identifier for,
// containing elements for each import needed by a set of mocked interfaces. | Added a getMethods helper function.
For #2. | jacobsa_oglemock | train | go |
6f7f603b7ac9a96dabd5c01ccdd0c610389dae5c | diff --git a/Auth/OpenID/Consumer/Consumer.php b/Auth/OpenID/Consumer/Consumer.php
index <HASH>..<HASH> 100644
--- a/Auth/OpenID/Consumer/Consumer.php
+++ b/Auth/OpenID/Consumer/Consumer.php
@@ -767,14 +767,6 @@ class Auth_OpenID_Consumer {
/**
* @access private
*/
- function _findIdentityInfo($identity_url)
- {
-
- }
-
- /**
- * @access private
- */
function _fetchAssociation($dh, $server_url, $body)
{
$ret = @$this->fetcher->post($server_url, $body); | [project @ Remove unused stub in consumer] | openid_php-openid | train | php |
da111c4fbc220bc9fe49238074bdc54147a2e809 | diff --git a/freewall.js b/freewall.js
index <HASH>..<HASH> 100644
--- a/freewall.js
+++ b/freewall.js
@@ -1010,8 +1010,9 @@
},
refresh: function() {
- var args = arguments.length ? arguments : runtime.currentArguments;
- runtime.currentMethod.apply(this, Array.prototype.slice.call(args, 0));
+ var params = arguments.length ? arguments : runtime.currentArguments;
+ runtime.currentMethod == null && (runtime.currentMethod = this.fitWidth);
+ runtime.currentMethod.apply(this, Array.prototype.slice.call(params, 0));
return this;
}, | set default currentMethod is fitWidth | iraycd_brickwork | train | js |
faaf7c32e9760807c53088507efa8d1d817b0398 | diff --git a/irc3/plugins/async.py b/irc3/plugins/async.py
index <HASH>..<HASH> 100644
--- a/irc3/plugins/async.py
+++ b/irc3/plugins/async.py
@@ -30,7 +30,7 @@ Then you're able to use it in a plugin:
def __init__(self, bot):
self.bot = bot
- self.whois = Whois(context)
+ self.whois = Whois(bot)
def do_whois(self):
# remember {nick} in the regexp? Here it is | Fix a typo in the Async docs | gawel_irc3 | train | py |
8f3a56c0628758f24864148843bd7bc8802e9989 | diff --git a/release.py b/release.py
index <HASH>..<HASH> 100644
--- a/release.py
+++ b/release.py
@@ -38,8 +38,8 @@ def updateHomepage(version):
def commit(version):
subprocess.call(['git', 'commit', '-am', '"chore release: new release %s"' % version], stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
subprocess.call(('git tag %s' % version).split())
- print "Publishing new commit to master"
- subprocess.call('git push origin master'.split(), stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
+ # print "Publishing new commit to master"
+ # subprocess.call('git push origin master'.split(), stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
print "Publishing new tag"
subprocess.call(('git push origin %s' % version).split(), stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
print "Release %s created!" % version | chore release: remove push to master when creating a release | lumapps_lumX | train | py |
276069508849d206b459821efa830894177f50d6 | diff --git a/lib/haml/buffer.rb b/lib/haml/buffer.rb
index <HASH>..<HASH> 100644
--- a/lib/haml/buffer.rb
+++ b/lib/haml/buffer.rb
@@ -118,7 +118,7 @@ module Haml
# Gets <tt>count</tt> tabs. Mostly for internal use.
def tabs(count)
- (count + @tabulation) * ' '
+ ' ' * (count + @tabulation)
end
# Iterates through the classes and ids supplied through <tt>.</tt> | I swear this is the last time I check this file in (until I actually add
something to it, of course).
git-svn-id: svn://hamptoncatlin.com/haml/branches/edge@<I> <I>b-<I>-<I>-af8c-cdc<I>e<I>b9 | sass_ruby-sass | train | rb |
0bd67ef0db547cd58c39642cbf2824b0c72f3667 | diff --git a/lib/nexpose/group.rb b/lib/nexpose/group.rb
index <HASH>..<HASH> 100644
--- a/lib/nexpose/group.rb
+++ b/lib/nexpose/group.rb
@@ -97,15 +97,14 @@ module Nexpose
#
# @param [Connection] connection Connection to console where asset group
# is configured.
- # @return [Array[Hash[Fixnum, Fixnum]]] Array of scan ID and engine ID
- # pairs for each scan launched.
+ # @return [Hash] Hash of scan_id to Scan launch information for each scan.
#
def rescan_assets(connection)
sites_ids = @devices.map { |d| d.site_id }.uniq
- scans = []
+ scans = {}
sites_ids.each do |id|
- dev_ids = @devices.select { |d| d.site_id == id }.map { |d| d.id }
- scans << connection.site_device_scan(id, dev_ids).merge(:site_id => id)
+ to_scan = @devices.select { |d| d.site_id == id }
+ scans[id] = connection.scan_devices(to_scan)
end
scans
end | Updates rescan_assets for ad hoc scans. | rapid7_nexpose-client | train | rb |
b0ca8b184e14910eeb7b2c3543bc0464287e6b12 | diff --git a/vtki/qt_plotting.py b/vtki/qt_plotting.py
index <HASH>..<HASH> 100644
--- a/vtki/qt_plotting.py
+++ b/vtki/qt_plotting.py
@@ -36,9 +36,15 @@ class QSlider(object):
def pyqtSignal(*args, **kwargs): # pragma: no cover
pass
+
class QHBoxLayout(object):
pass
+
+class QFileDialog(object):
+ pass
+
+
try:
from PyQt5.QtCore import pyqtSignal
from vtk.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor | added wrapper for missing pyqt imports | vtkiorg_vtki | train | py |
812d0c88d25ff5a5dac49b5988185bed733a8d8b | diff --git a/src/main/java/com/couchbase/lite/UnsavedRevision.java b/src/main/java/com/couchbase/lite/UnsavedRevision.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/couchbase/lite/UnsavedRevision.java
+++ b/src/main/java/com/couchbase/lite/UnsavedRevision.java
@@ -98,6 +98,19 @@ public class UnsavedRevision extends Revision {
}
/**
+ * A special variant of -save: that always adds the revision, even if its parent is not the
+ * current revision of the document.
+ *
+ * This can be used to resolve conflicts, or to create them. If you're not certain that's what you
+ * want to do, you should use the regular -save: method instead.
+ */
+ @InterfaceAudience.Public
+ public SavedRevision saveAllowingConflict() throws CouchbaseLiteException {
+ // TODO: port iOS Code
+ return save();
+ }
+
+ /**
* Creates or updates an attachment.
* The attachment data will be written to the database when the revision is saved.
* @param attachment A newly-created Attachment (not yet associated with any revision) | stub out saveAllowingConflict() | couchbase_couchbase-lite-java-core | train | java |
8d45d6dcfb424812333b1cdf7d5e9c6efc7a4659 | diff --git a/salt/utils/odict.py b/salt/utils/odict.py
index <HASH>..<HASH> 100644
--- a/salt/utils/odict.py
+++ b/salt/utils/odict.py
@@ -37,7 +37,7 @@ except ImportError:
try:
import ordereddict
- class OrderedDict(ordereddict.OrderedDict):
+ class OrderedDict(ordereddict.OrderedDict): # pylint: disable=W0232
__hash_ = None
except ImportError:
# {{{ http://code.activestate.com/recipes/576693/ (r9) | Fixed pylint warning: [W<I>(no-init), OrderedDict] Class has no __init__ method
From the <URL>, OrderedDict] Class has no __init__ method
Added pylint: disable=W<I> to resolve this warning. | saltstack_salt | train | py |
a9578354ba5369aeb77199998ca04bfeb4e47723 | diff --git a/src/Extension/RouterExtension.php b/src/Extension/RouterExtension.php
index <HASH>..<HASH> 100644
--- a/src/Extension/RouterExtension.php
+++ b/src/Extension/RouterExtension.php
@@ -12,6 +12,7 @@ namespace Nice\Extension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\Extension\Extension;
+use Symfony\Component\DependencyInjection\Scope;
/**
* Sets up FastRoute services
@@ -56,5 +57,7 @@ class RouterExtension extends Extension
->addArgument(new Reference('event_dispatcher'))
->addArgument(new Reference('service_container'))
->addArgument(new Reference('router.controller_resolver'));
+
+ $container->addScope(new Scope('request'));
}
} | Added request scope configuration in RouterExtension | nice-php_framework | train | php |
57b373c97a8cd72f29a6206c5859661d8b926a97 | diff --git a/pandas/tseries/tests/test_timedeltas.py b/pandas/tseries/tests/test_timedeltas.py
index <HASH>..<HASH> 100644
--- a/pandas/tseries/tests/test_timedeltas.py
+++ b/pandas/tseries/tests/test_timedeltas.py
@@ -188,7 +188,6 @@ class TestTimedeltas(tm.TestCase):
self.assertEqual(Timedelta('').value, iNaT)
self.assertEqual(Timedelta('nat').value, iNaT)
self.assertEqual(Timedelta('NAT').value, iNaT)
- self.assertTrue(isnull(Timestamp('nat')))
self.assertTrue(isnull(Timedelta('nat')))
# offset
diff --git a/pandas/tseries/tests/test_timeseries.py b/pandas/tseries/tests/test_timeseries.py
index <HASH>..<HASH> 100644
--- a/pandas/tseries/tests/test_timeseries.py
+++ b/pandas/tseries/tests/test_timeseries.py
@@ -4389,6 +4389,8 @@ class TestTimestamp(tm.TestCase):
result = Timestamp('NaT')
self.assertIs(result, NaT)
+ self.assertTrue(isnull(Timestamp('nat')))
+
def test_roundtrip(self):
# test value to string and back conversions | CLN: Remove a test case about Timestamp to TestTimestamp (#<I>) | pandas-dev_pandas | train | py,py |
20e3fc336c83dd7c2aa7b7b1867dd3efb18ae10a | diff --git a/src/NodeRun.js b/src/NodeRun.js
index <HASH>..<HASH> 100644
--- a/src/NodeRun.js
+++ b/src/NodeRun.js
@@ -1,4 +1,4 @@
-import { ConsoleStyle as Style } from "package:zencmd";
+import { ConsoleStyle as Style } from "package:zen-cmd";
import { parse } from "package:esparse";
import { translate } from "Translator.js";
import { isPackageURI, locatePackage } from "PackageLocator.js";
diff --git a/src/main.js b/src/main.js
index <HASH>..<HASH> 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,4 +1,4 @@
-import { ConsoleCommand } from "package:zencmd";
+import { ConsoleCommand } from "package:zen-cmd";
import { readFile, writeFile } from "AsyncFS.js";
import { runModule, startREPL, formatSyntaxError } from "NodeRun.js";
import { createBundle } from "Bundler.js"; | Rename dependency from "zencmd" to "zen-cmd". | zenparsing_esdown | train | js,js |
d2c24a6814d0f3172f77702691864200847c5664 | diff --git a/test/rql_test/em.rb b/test/rql_test/em.rb
index <HASH>..<HASH> 100644
--- a/test/rql_test/em.rb
+++ b/test/rql_test/em.rb
@@ -91,6 +91,8 @@ $runners = [method(:run1), method(:run2), method(:run3), method(:run4),
method(:brun1), method(:brun2), method(:brun3), method(:brun4)]
r.table_create('test').run rescue nil
+r.table('test').reconfigure(shards: 2, replicas: 1).run
+r.table('test').wait.run
r.table('test').delete.run
r.table('test').insert({id: 0}).run
EM.run {
diff --git a/test/rql_test/init.rb b/test/rql_test/init.rb
index <HASH>..<HASH> 100644
--- a/test/rql_test/init.rb
+++ b/test/rql_test/init.rb
@@ -59,6 +59,8 @@ end
$statelog = []
r.table_create('test').run rescue nil
+r.table('test').reconfigure(shards: 2, replicas: 1).run
+r.table('test').wait.run
r.table('test').index_create('a').run rescue nil
r.table('test').index_wait('a').run
['id', 'a'].each {|field| | Updated tests to test changefeeds on oversharded tables. | rethinkdb_rethinkdb | train | rb,rb |
3c6187fd9f00e188b1299fc93aeafeefa92e7b37 | diff --git a/src/Parser.php b/src/Parser.php
index <HASH>..<HASH> 100644
--- a/src/Parser.php
+++ b/src/Parser.php
@@ -844,7 +844,7 @@ class Parser
$regexp,
$this->text,
$matches[$k],
- \PREG_SET_ORDER | \PREG_OFFSET_CAPTURE
+ PREG_SET_ORDER | PREG_OFFSET_CAPTURE
);
if (!$_cnt) | Not using the full qualified name for PHP constants. No functional change intended | s9e_TextFormatter | train | php |
7d0645c5fe817ca4e8677583e845b95f6723fe97 | diff --git a/cmd/docker/docker.go b/cmd/docker/docker.go
index <HASH>..<HASH> 100644
--- a/cmd/docker/docker.go
+++ b/cmd/docker/docker.go
@@ -69,7 +69,7 @@ func newDockerCommand(dockerCli *command.DockerCli) *cli.TopLevelCommand {
return cli.NewTopLevelCommand(cmd, dockerCli, opts, flags)
}
-func setFlagErrorFunc(dockerCli *command.DockerCli, cmd *cobra.Command) {
+func setFlagErrorFunc(dockerCli command.Cli, cmd *cobra.Command) {
// When invoking `docker stack --nonsense`, we need to make sure FlagErrorFunc return appropriate
// output if the feature is not supported.
// As above cli.SetupRootCommand(cmd) have already setup the FlagErrorFunc, we will add a pre-check before the FlagErrorFunc | Use command.Cli instead of command.DockerCli
The linter is complaining:
cmd/docker/docker.go:<I>:<I>:warning: dockerCli can be github.com/docker/cli/cli/command.Cli (interfacer)
Unclear precisely which change in the preceeding commits caused it to notice
this possibility. | docker_cli | train | go |
9ea46b7971a9e2c50b48f0b42352bd96bf9c84f2 | diff --git a/go/libkb/merkle_client.go b/go/libkb/merkle_client.go
index <HASH>..<HASH> 100644
--- a/go/libkb/merkle_client.go
+++ b/go/libkb/merkle_client.go
@@ -685,7 +685,13 @@ func (mc *MerkleClient) lookupPathAndSkipSequenceHelper(ctx context.Context, q H
defer mc.G().CVTrace(ctx, VLog0, "MerkleClient#lookupPathAndSkipSequence", func() error { return err })()
// Poll for 10s and ask for a race-free state.
- q.Add("poll", I{10})
+ w := 10
+ if mc.G().Env.GetRunMode() == DevelRunMode {
+ // CI can be slow. EXTREMELY slow. So bump this way up to 30.
+ w = 30
+ }
+
+ q.Add("poll", I{w})
// Add the local db sigHints version
if sigHints != nil { | desperate attempt to workaround CI slow as molasses (#<I>) | keybase_client | train | go |
da54b7c07ee4a36a853ca07da5966bae7ea17051 | diff --git a/glue/statedb.py b/glue/statedb.py
index <HASH>..<HASH> 100644
--- a/glue/statedb.py
+++ b/glue/statedb.py
@@ -125,6 +125,7 @@ class StateSegmentDatabase:
self.state_vec['H1'] = {}
self.state_vec['H2'] = {}
self.state_vec['L1'] = {}
+ self.state_vec['G1'] = {}
self.lfn_id = None
self.run = run
self.framereg = re.compile(r'^([A-Za-z]+)\-(\w+)\-(\d+)\-(\d+)\.gwf$') | Added 'G1' to self.state_vec dictionary. | gwastro_pycbc-glue | train | py |
c6edaf1902709f2dcdf007f6b049f093be3cc3d1 | diff --git a/src/Parser/BuiltInFilters.php b/src/Parser/BuiltInFilters.php
index <HASH>..<HASH> 100644
--- a/src/Parser/BuiltInFilters.php
+++ b/src/Parser/BuiltInFilters.php
@@ -381,7 +381,8 @@ class BuiltInFilters
// Test whether host has non-ASCII characters and punycode it if possible
if (preg_match('#[^[:ascii:]]#', $parts['host']) && function_exists('idn_to_ascii'))
{
- $parts['host'] = idn_to_ascii($parts['host']);
+ $variant = (defined('INTL_IDNA_VARIANT_UTS46')) ? INTL_IDNA_VARIANT_UTS46 : 0;
+ $parts['host'] = idn_to_ascii($parts['host'], 0, $variant);
}
return $parts; | BuiltInFilters: added support for PHP <I> | s9e_TextFormatter | train | php |
4c0cf991173ae4d4c424a3fb88fa4b9bb9679f89 | diff --git a/inmem/task_test.go b/inmem/task_test.go
index <HASH>..<HASH> 100644
--- a/inmem/task_test.go
+++ b/inmem/task_test.go
@@ -15,7 +15,6 @@ var (
taskBucket = []byte("tasksv1")
organizationBucket = []byte("organizationsv1")
authBucket = []byte("authorizationsv1")
- urmBucket = []byte("userresourcemappingsv1")
idgen influxdb.IDGenerator = snowflake.NewIDGenerator()
) | chore(inmem): Resolve staticcheck issue | influxdata_influxdb | train | go |
3811f3867416d3d5f7e006d7b06ee7c16191f7d6 | diff --git a/lib/xcresources/model/xcassets/resource_image.rb b/lib/xcresources/model/xcassets/resource_image.rb
index <HASH>..<HASH> 100644
--- a/lib/xcresources/model/xcassets/resource_image.rb
+++ b/lib/xcresources/model/xcassets/resource_image.rb
@@ -91,7 +91,9 @@ module XCResources::XCAssets
self.scale = hash.delete('scale').sub(/x$/, '').to_i unless hash['scale'].nil?
KNOWN_KEYS.each do |key|
- self.send "#{key}=".to_sym, hash.delete(key.to_s.dasherize)
+ value = hash.delete(key.to_s.dasherize)
+ next if value.nil?
+ self.send "#{key}=".to_sym, value
end
self.attributes = hash | [Refactor] ResourceImage#read | xcres_xcres | train | rb |
94c230772a6087d84518ac620384a7dca3f05a56 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -285,8 +285,8 @@ if __name__ == '__main__':
break
except ValueError:
nanoversion = 0
- if nanoversion:
- version_nums.append(nanoversion)
+ if nanoversion != 0:
+ version_nums.append(nanoversion)
if None in version_nums:
print("Failed to get version number in setup.py.") | Minor update of setup.py for package deploying | atztogo_phono3py | train | py |
cb139e5ef073b37c51906e1e6a17e08cf17993f5 | diff --git a/indy_client/test/anon_creds/test_schema.py b/indy_client/test/anon_creds/test_schema.py
index <HASH>..<HASH> 100644
--- a/indy_client/test/anon_creds/test_schema.py
+++ b/indy_client/test/anon_creds/test_schema.py
@@ -9,6 +9,7 @@ from plenum.common.util import randomString
from stp_core.common.log import getlogger
logger = getlogger()
+whitelist = ['Consensus for ReqId:']
def test_submit_schema(submitted_schema, schema): | [INDY-<I>] Add to whitelist "Unordered error" | hyperledger_indy-node | train | py |
3fdf4e0e29276863e801bbecbec7c0aba8b15e83 | diff --git a/pyes/es.py b/pyes/es.py
index <HASH>..<HASH> 100644
--- a/pyes/es.py
+++ b/pyes/es.py
@@ -1380,7 +1380,12 @@ class ResultSet(object):
self.start = query_params.get("start", search.start) or 0
self._max_item = query_params.get("size", search.size)
self._current_item = 0
- self.chuck_size = search.bulk_read or search.size or 10
+ if search.bulk_read is not None:
+ self.chuck_size = search.bulk_read
+ elif search.size is not None:
+ self.chuck_size = search.size
+ else:
+ self.chuck_size = 10
def _do_search(self, auto_increment=False):
self.iterpos = 0 | Bugfix: size set to 0
setting the size in a search to 0 (not None) leads to used size of <I>
in the query. This is not what it should do. If the resultset 0 is
wanted it should query it. | aparo_pyes | train | py |
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.