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 |
|---|---|---|---|---|---|
478112ed85477f910167587055c0b2bf51b4f416 | diff --git a/tests/types/array.test.js b/tests/types/array.test.js
index <HASH>..<HASH> 100644
--- a/tests/types/array.test.js
+++ b/tests/types/array.test.js
@@ -4,6 +4,7 @@ import expect from 'expect';
import ArrayType from '../../src/types/array';
import { create } from '../../src/microstates';
import { valueOf } from '../../src/meta';
+import { Store } from '../../index';
describe("ArrayType", function() {
@@ -477,4 +478,15 @@ describe("ArrayType", function() {
expect(array.remove(null)).toBe(array);
});
});
+
+ describe('within a Store', ()=> {
+ it('return undefined at the end of an iteration', ()=> {
+ let array = Store(create([Number], [1,2]));
+ let iterator = array[Symbol.iterator]();
+ iterator.next();
+ iterator.next();
+ expect(iterator.next().value).toBe(undefined);
+ });
+ });
+
}); | Cover the case of an iterable inside a store. | microstates_microstates.js | train | js |
96bba7c36d9f699b62ebe7ede797ffa9b698b7c9 | diff --git a/tests/implemented.py b/tests/implemented.py
index <HASH>..<HASH> 100755
--- a/tests/implemented.py
+++ b/tests/implemented.py
@@ -41,6 +41,7 @@ DUMMY_CARDS = (
# Dynamic buffs set by their parent
"CS2_236e", # Divine Spirit
"EX1_304e", # Consume (Void Terror)
+ "LOE_030e" # Hollow (Unused)
"NEW1_018e", # Treasure Crazed (Bloodsail Raider)
) | Mark Hollow enchant as a dynamic buff | jleclanche_fireplace | train | py |
20f4a8c6a33bcdd3cf007589bcd176e4e2689fde | diff --git a/ospd/ospd.py b/ospd/ospd.py
index <HASH>..<HASH> 100644
--- a/ospd/ospd.py
+++ b/ospd/ospd.py
@@ -199,7 +199,8 @@ class OSPDaemon(object):
specific options eg. the w3af profile for w3af wrapper.
"""
- def __init__(self, certfile, keyfile, cafile, customvtfilter=None):
+ def __init__(self, certfile, keyfile, cafile,
+ customvtfilter=None, wrapper_logger=None):
""" Initializes the daemon's internal data. """
# @todo: Actually it makes sense to move the certificate params to
# a separate function because it is not mandatory anymore to
@@ -234,6 +235,9 @@ class OSPDaemon(object):
self.vts_filter = customvtfilter
else:
self.vts_filter = VtsFilter()
+ if wrapper_logger:
+ global logger
+ logger = wrapper_logger
def set_command_attributes(self, name, attributes):
""" Sets the xml attributes of a specified command. """ | Allows to set the logging domain from the wrapper.
This allows to run different ospd-wrappers and to log in the same file, and distinguish which wrapper is coming from. If no logger is set from the wrapper, the default one "ospd.ospd" domain will be used. | greenbone_ospd | train | py |
959eb945879c7b992c8245a6ff2b5584866595bd | diff --git a/client.go b/client.go
index <HASH>..<HASH> 100644
--- a/client.go
+++ b/client.go
@@ -12,7 +12,7 @@ import (
)
const (
- libraryVersion = "0.1.0"
+ libraryVersion = "0.4.0"
)
type Response http.Response | Update version to <I> in preparation for refactor | akamai_AkamaiOPEN-edgegrid-golang | train | go |
e95a064c1dcf27a570b6c1d77539f9a2ff6c54f7 | diff --git a/go/kbfs/libkbfs/folder_branch_ops.go b/go/kbfs/libkbfs/folder_branch_ops.go
index <HASH>..<HASH> 100644
--- a/go/kbfs/libkbfs/folder_branch_ops.go
+++ b/go/kbfs/libkbfs/folder_branch_ops.go
@@ -8502,8 +8502,8 @@ func (fbo *folderBranchOps) Reset(
return err
}
oldHandle.SetFinalizedInfo(finalizedInfo)
- // This can't be subject to the WaitGroup due to a potential deadlock,
- // so we use a raw goroutine here instead of `goTracked`.
+ // FIXME: This can't be subject to the WaitGroup due to a potential
+ // deadlock, so we use a raw goroutine here instead of `goTracked`.
go fbo.observers.tlfHandleChange(ctx, oldHandle)
return nil
} | folder_branch_ops: clarify comment | keybase_client | train | go |
a606f6c25ea8ffa24244926024672f5082a170eb | diff --git a/Gruntfile.js b/Gruntfile.js
index <HASH>..<HASH> 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -151,6 +151,19 @@ module.exports = function(grunt) {
fs.renameSync(oldFileName + fileExtension, newFileName + fileExtension);
});
+ grunt.registerTask("delete_coverage_dir", function() {
+ var done = this.async();
+ var rimraf = require("rimraf");
+ rimraf("coverage", function(err) {
+ if(err) {
+ console.log("Error while deleting coverage directory from the package.");
+ done(false);
+ }
+
+ done();
+ });
+ });
+
grunt.registerTask("test", ["ts:devall", "shell:ci_unit_tests"]);
grunt.registerTask("pack", [
"ts:release_build",
@@ -161,6 +174,7 @@ module.exports = function(grunt) {
"shell:ci_unit_tests",
"set_package_version",
+ "delete_coverage_dir",
"shell:build_package",
"setPackageName"
]); | Delete coverage dir from build package - really
Delete coverage dir from build package - this time really. Our package is buid with grunt pack command - add new async grunt task in order to delete the coverage directory.
<URL> | Icenium_icenium-cli | train | js |
32270aa9a8bea5fe5f188c7a1456b242b281f8eb | diff --git a/src/pfs/server/combined_api_server.go b/src/pfs/server/combined_api_server.go
index <HASH>..<HASH> 100644
--- a/src/pfs/server/combined_api_server.go
+++ b/src/pfs/server/combined_api_server.go
@@ -115,7 +115,9 @@ func (a *combinedAPIServer) GetFileInfo(ctx context.Context, getFileInfoRequest
if !ok {
return &pfs.GetFileInfoResponse{}, nil
}
- return &pfs.GetFileInfoResponse{fileInfo}, nil
+ return &pfs.GetFileInfoResponse{
+ FileInfo: fileInfo,
+ }, nil
}
func (a *combinedAPIServer) MakeDirectory(ctx context.Context, makeDirectoryRequest *pfs.MakeDirectoryRequest) (*google_protobuf.Empty, error) { | fix go vet for pfs | pachyderm_pachyderm | train | go |
239c8dd479bfb0dc8d74052615ef8d745297f1f8 | diff --git a/raft/log.go b/raft/log.go
index <HASH>..<HASH> 100644
--- a/raft/log.go
+++ b/raft/log.go
@@ -44,6 +44,8 @@ type raftLog struct {
applied uint64
}
+// newLog returns log using the given storage. It recovers the log to the state
+// that it just commits and applies the lastest snapshot.
func newLog(storage Storage) *raftLog {
if storage == nil {
log.Panic("storage must not be nil")
@@ -68,7 +70,7 @@ func newLog(storage Storage) *raftLog {
}
func (l *raftLog) String() string {
- return fmt.Sprintf("unstable=%d committed=%d applied=%d", l.unstable, l.committed, l.applied)
+ return fmt.Sprintf("unstable=%d committed=%d applied=%d len(unstableEntries)=%d", l.unstable, l.committed, l.applied, len(l.unstableEnts))
}
// maybeAppend returns (0, false) if the entries cannot be appended. Otherwise, | raft: add comment to newLog | etcd-io_etcd | train | go |
5af2b4eaab4579cce208f254c1e8b2859cc0fe19 | diff --git a/lib/codecs.js b/lib/codecs.js
index <HASH>..<HASH> 100644
--- a/lib/codecs.js
+++ b/lib/codecs.js
@@ -3,7 +3,13 @@
* Current id.
*/
-var id = 0;
+var id = 1;
+
+/**
+ * Max codecs.
+ */
+
+var max = 9;
/**
* Name map.
@@ -23,6 +29,7 @@ exports.define = function(name, fns){
if ('string' != typeof name) throw new Error('codec name required');
if ('function' != typeof fns.encode) throw new Error('codec .encode required');
if ('function' != typeof fns.decode) throw new Error('codec .decode required');
+ if (id === max) throw new Error('too many codecs');
exports[name] = {
encode: fns.encode, | Sets a maximum number of codecs defined and changes the intial codec.id too 1 rather than 0. | orangemi_axon | train | js |
d0d2497c2a00da7d96f12b3240af266428a1d579 | diff --git a/actionview/lib/action_view/helpers/form_tag_helper.rb b/actionview/lib/action_view/helpers/form_tag_helper.rb
index <HASH>..<HASH> 100644
--- a/actionview/lib/action_view/helpers/form_tag_helper.rb
+++ b/actionview/lib/action_view/helpers/form_tag_helper.rb
@@ -469,13 +469,17 @@ module ActionView
# # => <button data-disable-with="Please wait..." name="button" type="submit">Checkout</button>
#
def button_tag(content_or_options = nil, options = nil, &block)
+ options ||= {}
+ default_options = { 'name' => 'button', 'type' => 'submit' }
if content_or_options.is_a?(Hash)
options = content_or_options
content_or_options = nil
end
- options = button_tag_options_with_defaults(options)
+ options = options.stringify_keys
+ options.reverse_merge default_options
+
content_tag :button, content_or_options || 'Button', options, &block
end
@@ -742,14 +746,6 @@ module ActionView
def sanitize_to_id(name)
name.to_s.delete(']').gsub(/[^-a-zA-Z0-9:.]/, "_")
end
-
- def button_tag_options_with_defaults(options)
- options = options || {}
- options = options.stringify_keys
-
- default_options = { 'name' => 'button', 'type' => 'submit' }
- options.reverse_merge default_options
- end
end
end
end | cleanup and move extracted method right into the helper | rails_rails | train | rb |
96ce47c15e16851df1553998879f070c2ff27d9d | diff --git a/src/AbstractNormalizedEventManager.php b/src/AbstractNormalizedEventManager.php
index <HASH>..<HASH> 100644
--- a/src/AbstractNormalizedEventManager.php
+++ b/src/AbstractNormalizedEventManager.php
@@ -152,8 +152,26 @@ abstract class AbstractNormalizedEventManager extends AbstractWpEventManager
*/
protected function _registerCacheClearHandler(EventInterface $event)
{
- $me = $this;
$priority = static::CACHE_CLEAR_HANDLER_PRIORITY;
+ $callback = $this->_createCacheClearHandler($event);
+
+ $this->_addHook($event->getName(), $callback, $priority);
+
+ return $this;
+ }
+
+ /**
+ * Creates a cache clear handler.
+ *
+ * @since [*next-version*]
+ *
+ * @param EventInterface $event The event instance to be cleared from cache by the handler.
+ *
+ * @return \callable The created handler.
+ */
+ protected function _createCacheClearHandler(EventInterface $event)
+ {
+ $me = $this;
$callback = function($value) use ($me, $event, &$callback, $priority) {
$me->_zRemoveCachedEvent($event->getName());
@@ -162,9 +180,7 @@ abstract class AbstractNormalizedEventManager extends AbstractWpEventManager
return $value;
};
- $me->_addHook($event->getName(), $callback, $priority);
-
- return $this;
+ return $callback;
}
/** | Separated clear cache handler creation and registration (#6) | Dhii_wp-events | train | php |
c734967e24b546c8173a30df76b1ec3ffa317cd3 | diff --git a/library/src/main/java/de/mrapp/android/dialog/view/DialogRootView.java b/library/src/main/java/de/mrapp/android/dialog/view/DialogRootView.java
index <HASH>..<HASH> 100644
--- a/library/src/main/java/de/mrapp/android/dialog/view/DialogRootView.java
+++ b/library/src/main/java/de/mrapp/android/dialog/view/DialogRootView.java
@@ -250,7 +250,8 @@ public class DialogRootView extends LinearLayout implements AreaListener {
* The view may not be null
*/
private boolean applyDialogPaddingTop(@NonNull final Area area, @NonNull final View view) {
- if (area != Area.HEADER && area != Area.BUTTON_BAR) {
+ if (area != Area.HEADER && area != Area.BUTTON_BAR &&
+ view.getVisibility() == View.VISIBLE) {
view.setPadding(view.getPaddingLeft(), dialogPadding[1], view.getPaddingRight(),
view.getPaddingBottom());
return true; | A dialog's top padding is now correctly applied when no title is shown. | michael-rapp_AndroidMaterialDialog | train | java |
c9d08b7564aece8e179a0bddc82d8e87517cc0d4 | diff --git a/src/config/hisite.php b/src/config/hisite.php
index <HASH>..<HASH> 100644
--- a/src/config/hisite.php
+++ b/src/config/hisite.php
@@ -159,9 +159,6 @@ $config = [
'assets' => [
\hipanel\assets\AppAsset::class,
],
- 'pathDirs' => [
- 'hisite' => '@hipanel',
- ],
],
'menuManager' => [
'class' => \hiqdev\menumanager\MenuManager::class, | removed expired pathDirs config | hiqdev_hipanel-core | train | php |
e3c21020805099d3673362b69882a53dbd258ce8 | diff --git a/ledis/dump.go b/ledis/dump.go
index <HASH>..<HASH> 100644
--- a/ledis/dump.go
+++ b/ledis/dump.go
@@ -46,21 +46,22 @@ func (l *Ledis) Dump(w io.Writer) error {
var commitID uint64
var snap *store.Snapshot
- {
- l.wLock.Lock()
- defer l.wLock.Unlock()
-
- if l.r != nil {
- if commitID, err = l.r.LastCommitID(); err != nil {
- return err
- }
- }
+ l.wLock.Lock()
- if snap, err = l.ldb.NewSnapshot(); err != nil {
+ if l.r != nil {
+ if commitID, err = l.r.LastCommitID(); err != nil {
+ l.wLock.Unlock()
return err
}
}
+ if snap, err = l.ldb.NewSnapshot(); err != nil {
+ l.wLock.Unlock()
+ return err
+ }
+
+ l.wLock.Unlock()
+
wb := bufio.NewWriterSize(w, 4096)
h := &DumpHead{commitID} | closure defer not works as I think | siddontang_ledisdb | train | go |
0d325e7398b946e5781e9a914861e0c78e829537 | diff --git a/core-bundle/contao/library/Contao/File.php b/core-bundle/contao/library/Contao/File.php
index <HASH>..<HASH> 100644
--- a/core-bundle/contao/library/Contao/File.php
+++ b/core-bundle/contao/library/Contao/File.php
@@ -832,6 +832,7 @@ class File extends \System
'qt' => array('video/quicktime', 'iconVIDEO.gif'),
'rv' => array('video/vnd.rn-realvideo', 'iconVIDEO.gif'),
'avi' => array('video/x-msvideo', 'iconVIDEO.gif'),
+ 'ogv' => array('video/ogg', 'iconVIDEO.gif'),
'movie' => array('video/x-sgi-movie', 'iconVIDEO.gif')
); | [Core] Add `ogv` to the mime types of the `Files` class (see #<I>) | contao_contao | train | php |
c07dac091af09fefd2aed2678c16091e30231d0e | diff --git a/bosh-director/lib/bosh/director/api/controller.rb b/bosh-director/lib/bosh/director/api/controller.rb
index <HASH>..<HASH> 100644
--- a/bosh-director/lib/bosh/director/api/controller.rb
+++ b/bosh-director/lib/bosh/director/api/controller.rb
@@ -585,12 +585,7 @@ module Bosh::Director
end
end
- # JMS and MB: We don't know why this code exists. According to JP it shouldn't. We want to remove it.
- # To get comforable with that idea, we log something we can look for in production.
- #
- # GET /resources/deadbeef
get '/resources/:id' do
- @logger.warn('Something is proxying a blob through the director. Find out why before we remove this method. ZAUGYZ')
tmp_file = @resource_manager.get_resource_path(params[:id])
send_disposable_file(tmp_file, :type => 'application/x-gzip')
end | removed stale comment - used for fetch_logs | cloudfoundry_bosh | train | rb |
8dbe22540489facf86a1dbd6a0815be43831a1c4 | diff --git a/src/Sluggable/SluggableTrait.php b/src/Sluggable/SluggableTrait.php
index <HASH>..<HASH> 100644
--- a/src/Sluggable/SluggableTrait.php
+++ b/src/Sluggable/SluggableTrait.php
@@ -70,6 +70,12 @@ trait SluggableTrait
$id = $model->findRecordIdForSlugFromCmsTable($slug, $locale);
+ // if it is translated, return by entry ID instead
+ if ($model->isTranslationModel()) {
+
+ return $model->where(config('pxlcms.translatable.translation_foreign_key'), $id)->first();
+ }
+
return $model->find($id);
} | fixed incorrect return for findBySlug on translations | czim_laravel-pxlcms | train | php |
d913d5379846c4cf627033350434cdfd0c76ced7 | diff --git a/lib/brcobranca/currency.rb b/lib/brcobranca/currency.rb
index <HASH>..<HASH> 100755
--- a/lib/brcobranca/currency.rb
+++ b/lib/brcobranca/currency.rb
@@ -1,3 +1,5 @@
+# -*- encoding: utf-8 -*-
+
# @author Fernando Vieira do http://simplesideias.com.br
module Brcobranca #:nodoc:[all]
module Currency #:nodoc:[all]
@@ -63,4 +65,4 @@ end
[ String ].each do |klass|
klass.class_eval { include Brcobranca::Currency::String }
-end
\ No newline at end of file
+end
diff --git a/lib/brcobranca/retorno/base.rb b/lib/brcobranca/retorno/base.rb
index <HASH>..<HASH> 100755
--- a/lib/brcobranca/retorno/base.rb
+++ b/lib/brcobranca/retorno/base.rb
@@ -1,3 +1,5 @@
+# encoding: utf-8
+
module Brcobranca
module Retorno
class Base # Classe base para retornos bancários | fix to run on <I> | kivanio_brcobranca | train | rb,rb |
d11e6adde1c9b8350c7fb8c88cc5cf5ed7acd2ff | diff --git a/src/main/java/org/wololo/geojson/Feature.java b/src/main/java/org/wololo/geojson/Feature.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/wololo/geojson/Feature.java
+++ b/src/main/java/org/wololo/geojson/Feature.java
@@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
-@JsonPropertyOrder({"type", "id", "geometry", "property"})
+@JsonPropertyOrder({"type", "id", "geometry", "properties"})
public class Feature extends GeoJSON {
@JsonInclude(Include.NON_EMPTY)
private final Object id; | Fixed a typo in the JsonPropertyOrder of class Feature | bjornharrtell_jts2geojson | train | java |
81543a8e40d225f5047f9cf729d3c255f775d4ce | diff --git a/src/scs_core/aqcsv/connector/datum_mapping.py b/src/scs_core/aqcsv/connector/datum_mapping.py
index <HASH>..<HASH> 100644
--- a/src/scs_core/aqcsv/connector/datum_mapping.py
+++ b/src/scs_core/aqcsv/connector/datum_mapping.py
@@ -108,7 +108,7 @@ class DatumMapping(JSONable):
# position...
gps = self.gps(datum)
- if gps is not None:
+ if gps is not None and gps.elv is not None:
lat = gps.pos.lat
lon = gps.pos.lng
gis_datum = AQCSVRecord.GIS_DATUM | Fixed a GPS handling bug in DatumMapping. | south-coast-science_scs_core | train | py |
30cc41e6cfdaa205f75bae3d264d04582eaae261 | diff --git a/server/workers/swf_meta.py b/server/workers/swf_meta.py
index <HASH>..<HASH> 100644
--- a/server/workers/swf_meta.py
+++ b/server/workers/swf_meta.py
@@ -57,8 +57,15 @@ def test():
import zerorpc
c = zerorpc.Client()
c.connect("tcp://127.0.0.1:4242")
+
+ # Generate the input data for this worker
md5 = c.store_sample('unknown.swf', open('../../data/swf/unknown.swf', 'rb').read(), 'pe')
- output = c.work_request('swf_meta', md5)
+ input_data = c.get_sample(md5)
+ input_data.update(c.work_request('meta', md5))
+
+ # Execute the worker
+ worker = SWFMeta()
+ output = worker.execute(input_data)
print 'SWFMeta: '
import pprint
pprint.pprint(output) | small reorg of test so that debugger/coverage work locally
Former-commit-id: d<I>ab7c<I>bdd<I>f0c9d6c9e<I>d<I>a | SuperCowPowers_workbench | train | py |
c6970c44c89017248c01faed053b9d909ca1b6a8 | diff --git a/ccmlib/node.py b/ccmlib/node.py
index <HASH>..<HASH> 100644
--- a/ccmlib/node.py
+++ b/ccmlib/node.py
@@ -1100,4 +1100,4 @@ class Node():
sh_file = os.path.join(common.CASSANDRA_CONF_DIR, common.CASSANDRA_WIN_ENV)
dst = os.path.join(self.get_path(), sh_file)
common.replace_in_file(dst, "JMX_PORT=", " $JMX_PORT=\"" + self.jmx_port + "\"")
- common.replace_in_file(dst,'CASSANDRA_PARAMS=',' $env:CASSANDRA_PARAMS="-Dcassandra -Dlogback.configurationFile=logback.xml -Dcassandra.config=file:/$env:CASSANDRA_CONF/cassandra.yaml"')
+ common.replace_in_file(dst,'CASSANDRA_PARAMS=',' $env:CASSANDRA_PARAMS="-Dcassandra -Dlogback.configurationFile=/$env:CASSANDRA_CONF/logback.xml -Dcassandra.config=file:/$env:CASSANDRA_CONF/cassandra.yaml"') | Switched to full pathing for logback.xml | riptano_ccm | train | py |
ade97e2be211383991be2dd0344ac3727f4ff5cb | diff --git a/build.js b/build.js
index <HASH>..<HASH> 100644
--- a/build.js
+++ b/build.js
@@ -5,7 +5,8 @@
*/
-/*jslint anon:true, sloppy:true, nomen:true, regexp:true, stupid:true*/
+/*jslint anon:true, sloppy:true, nomen:true, regexp:true, stupid:true,
+ continue: true*/
var libpath = require('path'),
diff --git a/start.js b/start.js
index <HASH>..<HASH> 100644
--- a/start.js
+++ b/start.js
@@ -74,7 +74,7 @@ exports.run = function(params, opts, callback) {
pack = {};
}
- options.port = params[0] || appConfig.appPort || 8666;
+ options.port = params[0] || appConfig.appPort || process.env.PORT || 8666;
if (inputOptions.context) {
options.context = utils.contextCsvToObject(inputOptions.context);
} | Delinted changed js files. | YahooArchive_mojito-cli-start | train | js,js |
3ba21adad2ac301e3523125338ef93bd3239b447 | diff --git a/minorminer/package_info.py b/minorminer/package_info.py
index <HASH>..<HASH> 100644
--- a/minorminer/package_info.py
+++ b/minorminer/package_info.py
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-__version__ = "0.2.0"
+__version__ = "0.2.1"
__author__ = "Kelly Boothby"
__authoremail__ = "boothby@dwavesys.com"
__description__ = "heuristic algorithm to find graph minor embeddings" | Update version <I> -> <I>
Fixed issue with false K_4 embeddings. | dwavesystems_minorminer | train | py |
722834c900ea09fa635495ab92d6938e5c7295b8 | diff --git a/kie-api/src/main/java/org/kie/api/runtime/manager/audit/NodeInstanceLog.java b/kie-api/src/main/java/org/kie/api/runtime/manager/audit/NodeInstanceLog.java
index <HASH>..<HASH> 100644
--- a/kie-api/src/main/java/org/kie/api/runtime/manager/audit/NodeInstanceLog.java
+++ b/kie-api/src/main/java/org/kie/api/runtime/manager/audit/NodeInstanceLog.java
@@ -37,6 +37,11 @@ public interface NodeInstanceLog {
public static final int TYPE_EXIT = 1;
/**
+ * Inidcates that the node instace was left because an abort operation (it is not active anymore)
+ */
+ public static final int TYPE_ABORTED = 2;
+
+ /**
* @return process instance identifier
*/
Long getProcessInstanceId(); | [RHPAM-<I>] AchievedAtDate for milestone is not preserved when case is reopen
added a new event log for node instance to be able to tell the different when
a node is left or aborted | kiegroup_drools | train | java |
8319a33b1e4c0a37a3fca7003216335e3f705a85 | diff --git a/src/scripts/utils/scitran.js b/src/scripts/utils/scitran.js
index <HASH>..<HASH> 100644
--- a/src/scripts/utils/scitran.js
+++ b/src/scripts/utils/scitran.js
@@ -314,7 +314,7 @@ export default {
createSnapshot (projectId, callback) {
request.post(config.scitran.url + 'snapshots', {
- body: {project: projectId}
+ query: {project: projectId}
}, callback);
}, | updated snapshot creation to pass projectId as query param instead of body property | OpenNeuroOrg_openneuro | train | js |
b12744765e8a312997b731dd33c1cd611b8c0bc6 | diff --git a/src/radical/ensemblemd/__init__.py b/src/radical/ensemblemd/__init__.py
index <HASH>..<HASH> 100644
--- a/src/radical/ensemblemd/__init__.py
+++ b/src/radical/ensemblemd/__init__.py
@@ -16,6 +16,7 @@ from radical.ensemblemd.file import File
from radical.ensemblemd.kernel import Kernel
# Execution Patterns
+from radical.ensemblemd.patterns.all_pairs_pattern import AllPairsPattern
from radical.ensemblemd.patterns.pipeline import Pipeline
from radical.ensemblemd.patterns.replica_exchange import ReplicaExchange
from radical.ensemblemd.patterns.simulation_analysis_loop import SimulationAnalysisLoop | Update __init__.py
Added All Pairs Pattern in the Patterns imports | radical-cybertools_radical.entk | train | py |
f6ab43e775d2bc5e60ef7e5b204adeaa0e69f1d5 | diff --git a/lib/js/structure.js b/lib/js/structure.js
index <HASH>..<HASH> 100644
--- a/lib/js/structure.js
+++ b/lib/js/structure.js
@@ -97,13 +97,13 @@ function process(ast, context){
}
},
'object': function(token, scope){
- token.obj = {};
- token.objSource = {};
- for (var i = 0, prop; prop = token[1][i]; i++)
- {
- token.obj[prop[0]] = scope.resolve(prop[1]) || prop[1];
- token.objSource[prop[0]] = token;
- }
+ var props = token[1];
+ var obj = {};
+
+ for (var i = 0, prop; prop = props[i]; i++)
+ obj[prop[0]] = scope.resolve(prop[1]) || prop[1];
+
+ token.obj = obj;
},
'assign': function(token, scope){
var op = token[1]; | don't add objSource for js ast nodes | basisjs_basisjs-tools-ast | train | js |
87c08c52015b31330d4a13f1dbc5261819e13f89 | diff --git a/gwpy/detector/units.py b/gwpy/detector/units.py
index <HASH>..<HASH> 100644
--- a/gwpy/detector/units.py
+++ b/gwpy/detector/units.py
@@ -27,6 +27,9 @@ from astropy.units.format.generic import Generic
__author__ = "Duncan Macleod <duncan.macleod@ligo.org>"
+# container for new units (so that each one only gets created once)
+UNRECOGNIZED_UNITS = {}
+
# -- parser to handle any unit ------------------------------------------------
@@ -78,7 +81,12 @@ class GWpyFormat(Generic):
'should work, but conversions to other units '
'will not.'.format(str(exc).rstrip(' ')),
category=units.UnitsWarning)
- return units.def_unit(name, doc='Unrecognized unit')
+ try: # return previously created unit
+ return UNRECOGNIZED_UNITS[name]
+ except KeyError: # or create new one now
+ u = UNRECOGNIZED_UNITS[name] = units.def_unit(
+ name, doc='Unrecognized unit')
+ return u
return cls._parse_unit(alt) | detector.units: cache unrecognised units
that have been created on-the-fly. this is required so that `IrreducibleUnit('blah') == IrreducibleUnit('blah')` evaluates to `True`, which is required by `TimeSeries.is_compatible` and friends | gwpy_gwpy | train | py |
1498f7d83baf85b33b88a854acb594c828476935 | diff --git a/ipfsApi/commands.py b/ipfsApi/commands.py
index <HASH>..<HASH> 100644
--- a/ipfsApi/commands.py
+++ b/ipfsApi/commands.py
@@ -2,7 +2,6 @@ from __future__ import absolute_import
import os
import fnmatch
-import functools
import mimetypes
from . import filestream | removed unneeded functools import | ipfs_py-ipfs-api | train | py |
c7f404a4262c619524836a15e57440c779009f9c | diff --git a/volume/volume.go b/volume/volume.go
index <HASH>..<HASH> 100644
--- a/volume/volume.go
+++ b/volume/volume.go
@@ -16,6 +16,8 @@ package volume
import (
"errors"
+ "github.com/zenoss/glog"
+
"fmt"
)
@@ -160,3 +162,20 @@ func Mount(driverName, volumeName, rootDir string) (volume Volume, err error) {
}
return volume, nil
}
+
+// ShutdownActiveDrivers shuts down all drivers that have been initialized
+func ShutdownActiveDrivers() error {
+ errs := []error{}
+ for _, driver := range driversByRoot {
+ glog.Infof("Shutting down %s driver for %s", driver.GetFSType(), driver.Root())
+ if err := driver.Cleanup(); err != nil {
+ glog.Errorf("Unable to clean up %s driver for %s: %s", driver.GetFSType(), driver.Root(), err)
+ errs = append(errs, err)
+ }
+ }
+ if len(errs) > 0 {
+ // TODO: Something better
+ return fmt.Errorf("Errors unmounting volumes: %s")
+ }
+ return nil
+} | Add ShutdownActiveDrivers method | control-center_serviced | train | go |
284cbeb6a6b4b8d633890139b8e5c5319f67bde3 | diff --git a/lib/puppet/provider/service/gentoo.rb b/lib/puppet/provider/service/gentoo.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/provider/service/gentoo.rb
+++ b/lib/puppet/provider/service/gentoo.rb
@@ -38,7 +38,7 @@ Puppet::Type.type(:service).provide :gentoo, :parent => :init do
return :false unless line
# If it's enabled then it will print output showing service | runlevel
- if output =~ /#{@resource[:name]}\s*\|\s*(boot|default)/
+ if output =~ /^\s*#{@resource[:name]}\s*\|\s*(boot|default)/
return :true
else
return :false | Fixes #<I> - service provider for gentoo fails with ambiguous suffixes | puppetlabs_puppet | train | rb |
ed69d7692ef883d52bff052b6482cbed6f449c85 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -13,7 +13,7 @@ setup(
author_email='wes@1stvamp.org',
url='https://github.com/1stvamp/marked.py',
install_requires=[
- 'BeautifulSoup >= 3.0',
+ 'beautifulsoup4 >= 4.3',
'markgen >= 0.9'
],
packages=find_packages(exclude=['marked_tests']), | Switch to beautifulsoup4 package | 1stvamp_marked | train | py |
ebe2099ab21b169fb1c9fe1878749e792741af49 | diff --git a/lib/pseudohiki/blockparser.rb b/lib/pseudohiki/blockparser.rb
index <HASH>..<HASH> 100644
--- a/lib/pseudohiki/blockparser.rb
+++ b/lib/pseudohiki/blockparser.rb
@@ -293,6 +293,8 @@ module PseudoHiki
['//', CommentOutLeaf],
['----\s*$', HrLeaf]]
+ IRREGULAR_LEAFS = [:entire_matched_part, BlockNodeEnd, VerbatimLeaf, HrLeaf]
+
def self.assign_head_re
irregular_leafs = [BlockNodeEnd, VerbatimLeaf, HrLeaf]
irregular_head_pats, regular_leaf_types, head_to_leaf = [], [], {}
@@ -345,7 +347,7 @@ module PseudoHiki
def select_leaf_type(line)
matched = IRREGULAR_HEAD_PAT.match(line)
- 1.upto(NUMBER_OF_IRREGULAR_LEAF_TYPES) {|i| return IRREGULAR_LEAF_TYPES[i] if matched[i] } if matched
+ 1.upto(NUMBER_OF_IRREGULAR_LEAF_TYPES) {|i| return IRREGULAR_LEAFS[i] if matched[i] } if matched
REGULAR_LEAF_TYPES.each {|head| return HEAD_TO_LEAF[head] if line.start_with?(head) }
ParagraphLeaf
end | introduced IRREGULAR_LEAFS | nico-hn_PseudoHikiParser | train | rb |
d0ba242c46f2b4b08d7a02d302883b07906dcd08 | diff --git a/src/_pytest/python_api.py b/src/_pytest/python_api.py
index <HASH>..<HASH> 100644
--- a/src/_pytest/python_api.py
+++ b/src/_pytest/python_api.py
@@ -211,9 +211,7 @@ class ApproxScalar(ApproxBase):
the pre-specified tolerance.
"""
if _is_numpy_array(actual):
- import numpy as np
-
- return np.all(abs(self.expected - actual) <= self.tolerance)
+ return all(a == self for a in actual)
# Short-circuit exact equality.
if actual == self.expected: | Implement change suggested by @kalekundert in PR | pytest-dev_pytest | train | py |
4648a9e9563685d42b31af83cabd9c65fcf6e2ee | diff --git a/responsys/client.py b/responsys/client.py
index <HASH>..<HASH> 100644
--- a/responsys/client.py
+++ b/responsys/client.py
@@ -232,6 +232,21 @@ class InteractClient(object):
return [DeleteResult(delete_result) for delete_result in result]
return [DeleteResult(result)]
+ def merge_table_records(self, table, record_data, match_column_names):
+ """ Responsys.mergeTableRecords call
+
+ Accepts:
+ InteractObject table
+ RecordData record_data
+ list match_column_names
+
+ Returns a MergeResult
+ """
+ table = table.get_soap_object(self.client)
+ record_data = record_data.get_soap_object(self.client)
+ return MergeResult(self.call(
+ 'mergeTableRecords', table, record_data, match_column_names))
+
def merge_table_records_with_pk(self, table, record_data, insert_on_no_match, update_on_match):
""" Responsys.mergeTableRecordsWithPK call | Add merge_table_records method | jslang_responsys | train | py |
e3a2b4027c93883fc8e2853c05eb3645f074e21a | diff --git a/ImapClient/IncomingMessage.php b/ImapClient/IncomingMessage.php
index <HASH>..<HASH> 100644
--- a/ImapClient/IncomingMessage.php
+++ b/ImapClient/IncomingMessage.php
@@ -387,7 +387,14 @@ class IncomingMessage
}
}
if (isset($objNew->plain)) {
- $objNew->text = quoted_printable_decode( mb_convert_encoding( $objNew->plain, "utf-8", $objNew->plain->charset ));
+ switch ($objNew->plain->structure->encoding) {
+ case 3:
+ $objNew->text = imap_base64(mb_convert_encoding( $objNew->plain, "utf-8", $objNew->plain->charset ));
+ break;
+ default:
+ $objNew->text = quoted_printable_decode(mb_convert_encoding( $objNew->plain, "utf-8", $objNew->plain->charset ));
+ break;
+ }
$objNew->types[] = 'text';
} else {
$objNew->text = null; | Added support for base<I> encoded mail | SSilence_php-imap-client | train | php |
f42dd2fb3a39f42403836a6a3f3b9096d1afc548 | diff --git a/lib/lyber_core/log.rb b/lib/lyber_core/log.rb
index <HASH>..<HASH> 100644
--- a/lib/lyber_core/log.rb
+++ b/lib/lyber_core/log.rb
@@ -13,6 +13,8 @@ module LyberCore
# Initial state
@@logfile = DEFAULT_LOGFILE
@@log ||= Logger.new(@@logfile)
+ # $stdout.reopen(@@logfile)
+ # $stderr.reopen(@@logfile)
@@log.level = DEFAULT_LOG_LEVEL
@@log.formatter = DEFAULT_FORMATTER
@@ -43,7 +45,9 @@ module LyberCore
current_log_level = @@log.level
current_formatter = @@log.formatter
@@logfile = new_logfile
- @@log = Logger.new(@@logfile)
+ @@log = Logger.new(@@logfile)
+ # $stdout.reopen(@@logfile)
+ # $stderr.reopen(@@logfile)
@@log.level = current_log_level
@@log.formatter = current_formatter
rescue Exception => e | We can redirect stdout and stderr to the log file if we want to, but I tried it and it doesn't seem that useful. | sul-dlss_lyber-core | train | rb |
2fd556ea9082e9d5164b44bcb6d6b8d00f5c25ab | diff --git a/calloway/settings.py b/calloway/settings.py
index <HASH>..<HASH> 100644
--- a/calloway/settings.py
+++ b/calloway/settings.py
@@ -170,5 +170,5 @@ NATIVE_TAGS = (
ADMIN_TOOLS_MENU = 'calloway.menu.CustomMenu'
STORY_RELATION_MODELS = ['massmedia.audio', 'massmedia.image', 'massmedia.document',
- 'massmedia.video', 'massmedia.collection', 'stories.story','viewpoint.entry','viewpoint.blog','pullquote.quote',]
+ 'massmedia.video', 'massmedia.collection', 'stories.story','viewpoint.entry','viewpoint.blog',] | removed pullquote from story relations, had it backwards | callowayproject_Calloway | train | py |
a87ccb121b48b05ad11290d660907597ed54e61f | diff --git a/countly.js b/countly.js
index <HASH>..<HASH> 100644
--- a/countly.js
+++ b/countly.js
@@ -16,6 +16,8 @@
crashSegments = null,
autoExtend = true,
lastBeat,
+ failTimeout = 0,
+ failTimeoutAmount = 60,
startTime;
Countly.init = function(ob){
@@ -444,17 +446,18 @@
}
//process request queue with event queue
- if(requestQueue.length > 0){
- var params = requestQueue.shift();
- log("Processing request", params);
- sendXmlHttpRequest(params, function(err, params){
- log("Request Finished", params, err);
- if(err){
- requestQueue.unshift(params);
- store("cly_queue", requestQueue, true);
- }
- });
- store("cly_queue", requestQueue, true);
+ if(requestQueue.length > 0 && getTimestamp() > failTimeout){
+ var params = requestQueue.shift();
+ log("Processing request", params);
+ sendXmlHttpRequest(params, function(err, params){
+ log("Request Finished", params, err);
+ if(err){
+ requestQueue.unshift(params);
+ store("cly_queue", requestQueue, true);
+ failTimeout = getTimestamp() + failTimeoutAmount;
+ }
+ });
+ store("cly_queue", requestQueue, true);
}
setTimeout(heartBeat, beatInterval); | [requests] added <I> seconds cooldown for failed requests | Countly_countly-sdk-web | train | js |
613f538dc237e97d1e340a510cc656b434baea40 | diff --git a/src/com/opera/core/systems/scope/internal/OperaIntervals.java b/src/com/opera/core/systems/scope/internal/OperaIntervals.java
index <HASH>..<HASH> 100644
--- a/src/com/opera/core/systems/scope/internal/OperaIntervals.java
+++ b/src/com/opera/core/systems/scope/internal/OperaIntervals.java
@@ -12,13 +12,13 @@ public enum OperaIntervals {
POLL_INVERVAL(10),
SCRIPT_RETRY(5),
SCRIPT_RETRY_INTERVAL(50),
- EXEC_SLEEP(10),
+ EXEC_SLEEP(100),
HANDSHAKE_TIMEOUT(30000),
SERVER_PORT(7001),
ENABLE_DEBUGGER(1),
- KILL_GRACE_TIMEOUT(1000),
+ KILL_GRACE_TIMEOUT(1000),
BACKWARDS_COMPATIBLE(1),
- DEFAULT_RESPONSE_TIMEOUT(10000);
+ DEFAULT_RESPONSE_TIMEOUT(10000);
private long value; | Changes to exec sleep and indention fixes | operasoftware_operaprestodriver | train | java |
6e52e8411b5eae1eb5b7f8feeb986625a647fef7 | diff --git a/test/protractor/test.spec.js b/test/protractor/test.spec.js
index <HASH>..<HASH> 100644
--- a/test/protractor/test.spec.js
+++ b/test/protractor/test.spec.js
@@ -1,4 +1,5 @@
'use strict';
+require('./../protractor_coverage_test.js');
describe('Ensure that the plugin works', function() {
it('should not really do much.', function() {
browser.sleep(3000); | including require in specfile for testing purposes | r3b_grunt-protractor-coverage | train | js |
234cf82cad6f5fdc3ca689ec52be9a33f95e178c | diff --git a/test/define/class/check.js b/test/define/class/check.js
index <HASH>..<HASH> 100644
--- a/test/define/class/check.js
+++ b/test/define/class/check.js
@@ -92,20 +92,6 @@ describe("define/class/check", function () {
});
});
- it("supports only $abstract = true", function () {
- var exceptionCaught;
- try {
- _gpfDefineBuildTypedEntity({
- $type: "class",
- $name: "Test",
- $abstract: false
- });
- } catch (e) {
- exceptionCaught = e;
- }
- assert(exceptionCaught instanceof gpf.Error.InvalidClass$AbstractSpecification);
- });
-
});
} | Isolates $abstract (#<I>) | ArnaudBuchholz_gpf-js | train | js |
4cd43578d97a61b0814d9dfab5c4886b4fae35c4 | diff --git a/lib/Thelia/Coupon/Type/RemoveXPercent.php b/lib/Thelia/Coupon/Type/RemoveXPercent.php
index <HASH>..<HASH> 100644
--- a/lib/Thelia/Coupon/Type/RemoveXPercent.php
+++ b/lib/Thelia/Coupon/Type/RemoveXPercent.php
@@ -64,7 +64,7 @@ class RemoveXPercent extends AbstractRemove
*/
public function exec()
{
- return round($this->facade->getCartTotalTaxPrice($this->isAvailableOnSpecialOffers()) * $this->percentage/100, 2);
+ return ($this->facade->getCartTotalTaxPrice($this->isAvailableOnSpecialOffers()) * $this->percentage/100);
}
/** | No round for discount, saved as decimal(<I>,6) | thelia_core | train | php |
bf6091fc174201393c147335a99013aa6996d85e | diff --git a/swifter/__init__.py b/swifter/__init__.py
index <HASH>..<HASH> 100644
--- a/swifter/__init__.py
+++ b/swifter/__init__.py
@@ -1,4 +1,5 @@
from .swifter import SeriesAccessor, DataFrameAccessor
+from .tqdm_dask_progressbar import TQDMDaskProgressBar
__all__ = ['SeriesAccessor, DataFrameAccessor']
-__version__ = '0.225'
+__version__ = '0.241' | Access to TQDMDaskProgressBar | jmcarpenter2_swifter | train | py |
6d47f0002dfd06b0b8329991d706d0eb2d388b20 | diff --git a/bundle/Controller/LayoutWizard.php b/bundle/Controller/LayoutWizard.php
index <HASH>..<HASH> 100644
--- a/bundle/Controller/LayoutWizard.php
+++ b/bundle/Controller/LayoutWizard.php
@@ -41,6 +41,12 @@ final class LayoutWizard extends Controller
'location' => $location,
'form' => $form->createView(),
],
+ new Response(
+ null,
+ $form->isSubmitted() ?
+ Response::HTTP_UNPROCESSABLE_ENTITY :
+ Response::HTTP_OK
+ ),
);
} | Return HTTP <I> status code is form for layout wizard is not valid | netgen_NetgenAdminUIBundle | train | php |
61c69bb3034aa25715ef78b5badbaaa76f7a0590 | diff --git a/lib/primalize/single.rb b/lib/primalize/single.rb
index <HASH>..<HASH> 100644
--- a/lib/primalize/single.rb
+++ b/lib/primalize/single.rb
@@ -53,6 +53,10 @@ module Primalize
Float.new(&coerce)
end
+ def number &coerce
+ Number.new(&coerce)
+ end
+
def optional *types, &coerce
Optional.new(types, &coerce)
end
@@ -146,6 +150,18 @@ module Primalize
end
end
+ class Number
+ include Type
+
+ def === value
+ ::Numeric === value
+ end
+
+ def inspect
+ 'number'
+ end
+ end
+
class String
include Type
diff --git a/spec/primalize/single_spec.rb b/spec/primalize/single_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/primalize/single_spec.rb
+++ b/spec/primalize/single_spec.rb
@@ -23,6 +23,7 @@ module Primalize
address: optional(string),
state: enum(1, 2, 3, 4),
order: primalize(order_serializer_class),
+ value: number,
created_at: timestamp,
)
end
@@ -44,6 +45,7 @@ module Primalize
price_cents: 123_45,
payment_method: 'card_123456',
),
+ value: 21.3,
created_at: Time.new(1999, 12, 31, 23, 59, 59),
}
end
@@ -218,6 +220,7 @@ module Primalize
address: optional(string),
state: enum(1, 2, 3, 4),
order: primalize(OrderSerializer),
+ value: number,
)
EOF | Primalize all types of primitive numbers | jgaskins_primalize | train | rb,rb |
921f71aea0f555463b545a84939ffd553cce796d | diff --git a/modules/core/templates/logout-iframe.php b/modules/core/templates/logout-iframe.php
index <HASH>..<HASH> 100644
--- a/modules/core/templates/logout-iframe.php
+++ b/modules/core/templates/logout-iframe.php
@@ -105,6 +105,8 @@ foreach ($SPs AS $assocId => $sp) {
echo '<tr>';
+ echo '<td style="width: 3em;"></td>';
+
echo '<td>';
echo '<img class="logoutstatusimage" id="statusimage-' . $spId . '" src="' . htmlspecialchars($stateImage[$spState]) . '" alt="' . htmlspecialchars($stateText[$spState]) . '"/>';
echo '</td>'; | Logout: indent the service list. | simplesamlphp_saml2 | train | php |
1de37f912ea0bd12348293e57b9e7ae9a8ed0a11 | diff --git a/lib/active_interaction/grouped_input.rb b/lib/active_interaction/grouped_input.rb
index <HASH>..<HASH> 100644
--- a/lib/active_interaction/grouped_input.rb
+++ b/lib/active_interaction/grouped_input.rb
@@ -4,5 +4,16 @@ require 'ostruct'
module ActiveInteraction
class GroupedInput < OpenStruct
+ def [](name)
+ return super if self.class.superclass.method_defined?(:[])
+
+ send(name)
+ end
+
+ def []=(name, value)
+ return super if self.class.superclass.method_defined?(:[]=)
+
+ send("#{name}=", value)
+ end
end
end | Define methods for backwards compatibility | AaronLasseigne_active_interaction | train | rb |
69f962bfc9379f91d019f7f93d1e351784561d57 | diff --git a/atomic_reactor/plugins/pre_flatpak_create_dockerfile.py b/atomic_reactor/plugins/pre_flatpak_create_dockerfile.py
index <HASH>..<HASH> 100644
--- a/atomic_reactor/plugins/pre_flatpak_create_dockerfile.py
+++ b/atomic_reactor/plugins/pre_flatpak_create_dockerfile.py
@@ -35,7 +35,10 @@ LABEL com.redhat.component="{name}"
LABEL version="{stream}"
LABEL release="{version}"
-RUN dnf -y --nogpgcheck --disablerepo=* --enablerepo=atomic-reactor-module-* \\
+RUN dnf -y --nogpgcheck \\
+ --disablerepo=* \\
+ --enablerepo=atomic-reactor-koji-plugin-* \\
+ --enablerepo=atomic-reactor-module-* \\
--installroot=/var/tmp/flatpak-build install {packages}
RUN rpm --root=/var/tmp/flatpak-build {rpm_qf_args} > /var/tmp/flatpak-build.rpm_qf
COPY cleanup.sh /var/tmp/flatpak-build/tmp/ | flatpak_create_dockerfile: Enable the repository from the 'koji' plugin
With the switch to "Hybrid" modularity in Fedora, modules typically need
to pull packages from a base package set as well. The build tag of the
Koji target provides a way to pass in an appropriate base package set, so
we'll make odcs-client enable the 'koji' plugin, and the Dockerfile should
enable the resulting repository. | projectatomic_atomic-reactor | train | py |
f6d08c5dcdb1f3f7cb61c129ab7183850a3e8ac0 | diff --git a/djstripe/views.py b/djstripe/views.py
index <HASH>..<HASH> 100644
--- a/djstripe/views.py
+++ b/djstripe/views.py
@@ -133,7 +133,6 @@ class SyncHistoryView(CsrfExemptMixin, LoginRequiredMixin, View):
# ============================================================================ #
class ConfirmFormView(LoginRequiredMixin, FormValidMessageMixin, SubscriptionMixin, FormView):
- """TODO: Add stripe_token to the form and use form_valid() instead of post()."""
form_class = PlanForm
template_name = "djstripe/confirm_form.html"
@@ -188,7 +187,6 @@ class SubscribeView(LoginRequiredMixin, SubscriptionMixin, TemplateView):
class ChangePlanView(LoginRequiredMixin, FormValidMessageMixin, SubscriptionMixin, FormView):
"""
- TODO: This logic should be in form_valid() instead of post().
TODO: Work in a trial_days kwarg
Also, this should be combined with ConfirmFormView. | Remove TODOs that don't make any sense. | dj-stripe_dj-stripe | train | py |
be8202267da0a282b885675c3040f3f483669d47 | diff --git a/spec/support/connection_string.rb b/spec/support/connection_string.rb
index <HASH>..<HASH> 100644
--- a/spec/support/connection_string.rb
+++ b/spec/support/connection_string.rb
@@ -214,9 +214,6 @@ module Mongo
# Replica Set Options
'replicaset' => :replica_set,
- # Auth Source
- 'authsource' => :auth_source,
-
# Timeout Options
'connecttimeoutms' => :connect_timeout,
'sockettimeoutms' => :socket_timeout, | RUBY-<I> Remove duplicate key from test map (#<I>) | mongodb_mongo-ruby-driver | train | rb |
3fb487bebea8c040bb056bd0fe857ed1ead26457 | diff --git a/lib/bigcommerce/version.rb b/lib/bigcommerce/version.rb
index <HASH>..<HASH> 100644
--- a/lib/bigcommerce/version.rb
+++ b/lib/bigcommerce/version.rb
@@ -1,6 +1,6 @@
module Bigcommerce
major = 0
- minor = 8
- patch = 4
+ minor = 9
+ patch = 0
VERSION = [major, minor, patch].join('.') unless defined? Bigcommerce::VERSION
end | Bumped version to <I> | bigcommerce_bigcommerce-api-ruby | train | rb |
af3b3899128285b8a17568bb7936824759a12873 | diff --git a/jsonrpc.go b/jsonrpc.go
index <HASH>..<HASH> 100644
--- a/jsonrpc.go
+++ b/jsonrpc.go
@@ -8,6 +8,7 @@ import (
"errors"
"fmt"
"net/http"
+ "strconv"
"sync"
)
@@ -58,6 +59,10 @@ type RPCError struct {
Data interface{} `json:"data"`
}
+func (e *RPCError) Error() string {
+ return strconv.Itoa(e.Code) + ": " + e.Message
+}
+
// RPCClient sends jsonrpc requests over http to the provided rpc backend.
// RPCClient is created using the factory function NewRPCClient().
type RPCClient struct { | implemented Error interface on RPCError (#8)
implemented Error interface on RPCError | ybbus_jsonrpc | train | go |
c6bd6e1fa559b98561d7397e70791e4f594e4661 | diff --git a/test/test_producer_integration.py b/test/test_producer_integration.py
index <HASH>..<HASH> 100644
--- a/test/test_producer_integration.py
+++ b/test/test_producer_integration.py
@@ -19,7 +19,6 @@ from test.fixtures import ZookeeperFixture, KafkaFixture
from test.testutil import KafkaIntegrationTestCase, kafka_versions
class TestKafkaProducerIntegration(KafkaIntegrationTestCase):
- topic = b'produce_topic'
@classmethod
def setUpClass(cls): # noqa | Use a different topic for each producer integration test for isolation | dpkp_kafka-python | train | py |
1f6a4acf0aca40a869980c9b771f8fecee4930ea | diff --git a/lib/metior/version.rb b/lib/metior/version.rb
index <HASH>..<HASH> 100644
--- a/lib/metior/version.rb
+++ b/lib/metior/version.rb
@@ -6,6 +6,6 @@
module Metior
# The current version of the Metior gem
- VERSION = '0.1.4'
+ VERSION = '0.1.4' unless defined? Metior::VERSION
end | Don't redefine VERSION constant | koraktor_metior | train | rb |
ea4af508c7d29a873e0361589b13b3523295d121 | diff --git a/photos/actions.js b/photos/actions.js
index <HASH>..<HASH> 100644
--- a/photos/actions.js
+++ b/photos/actions.js
@@ -43,7 +43,7 @@ actions.searchPhotos = (req, res, next) => {
.then((flattenedPhotos) => {
return _.sortBy(flattenedPhotos, [
(photo) => {
- return photo.dateCreated ? photo.dateCreated.valueOf() * -1 : photo.datePublished.valueOf() * -1;
+ return photo.dateCreated ? photo.dateCreated.valueOf() * -1 : photo.datePublished ? photo.datePublished.valueOf() * -1 : 0;
}
]);
}) | Hmmm. Apparently `datePublished` can be falsy, so guard against it.
Need to figure out exactly where I left off with this... | randytarampi_me | train | js |
7f8ea618c208dcc8caffa9de7e578fc53a51e126 | diff --git a/examples/duplicate_table.py b/examples/duplicate_table.py
index <HASH>..<HASH> 100644
--- a/examples/duplicate_table.py
+++ b/examples/duplicate_table.py
@@ -120,8 +120,10 @@ logger.info('Response: {}'.format(res))
copy_src_client = CopySQLClient(auth_src_client)
copy_dst_client = CopySQLClient(auth_dst_client)
-# COPY (streaming) the data from the source to the dest table
-# we use here all the COPY defaults
+# COPY (streaming) the data from the source to the dest table. We use
+# here all the COPY defaults. Note that we take the `response` from
+# the `copyto`, which can be iterated, and we pipe it directly into
+# the `copyfrom`.
logger.info("Streaming the data from source to destination...")
response = copy_src_client.copyto('COPY %s TO STDOUT' % TABLE_NAME)
result = copy_dst_client.copyfrom('COPY %s FROM STDIN' % TABLE_NAME, response) | Better comment the gist of the example | CartoDB_carto-python | train | py |
a6431cc501240c0fd2da1f38677b56356b550b3c | diff --git a/app/app.js b/app/app.js
index <HASH>..<HASH> 100644
--- a/app/app.js
+++ b/app/app.js
@@ -80,9 +80,9 @@ function (app, $, _, Backbone, Bootstrap, Helpers, Utils, FauxtonAPI, Couchdb) {
var cookies = parseCookies(document.cookie);
var csrf = cookies['CouchDB-CSRF'] ? cookies['CouchDB-CSRF'] : 'true';
var origBeforeSend = settings.beforeSend;
- var newBeforeSend = function (xhr) {
+ var newBeforeSend = function (xhr, o) {
if (origBeforeSend) {
- origBeforeSend(xhr);
+ origBeforeSend(xhr, o);
}
xhr.setRequestHeader('X-CouchDB-CSRF', csrf);
}; | Pass the second param to beforeSend
I forgot to send this argument on which broke attachment uploading
COUCHDB-<I> | apache_couchdb-fauxton | train | js |
e9bff89cc6db5c30508eee68cbb0590edc68ab05 | diff --git a/tensorboard/pip_package/setup.py b/tensorboard/pip_package/setup.py
index <HASH>..<HASH> 100644
--- a/tensorboard/pip_package/setup.py
+++ b/tensorboard/pip_package/setup.py
@@ -64,6 +64,7 @@ setup(
},
install_requires=REQUIRED_PACKAGES,
tests_require=REQUIRED_PACKAGES,
+ python_requires=">=3.6",
# PyPI package information.
classifiers=[
"Development Status :: 4 - Beta", | pip: explicitly require Python <I> above (#<I>)
With `python_requires`, we can disallow other versions of Pythons from
installing TensorBoard. Removal in the earlier change was done without
completely understanding its intent. | tensorflow_tensorboard | train | py |
db8ff0a5829db8c35b610ef1c9c25b3aae02674c | diff --git a/command/agent/dns_test.go b/command/agent/dns_test.go
index <HASH>..<HASH> 100644
--- a/command/agent/dns_test.go
+++ b/command/agent/dns_test.go
@@ -1405,7 +1405,7 @@ func TestDNS_RecursorTimeout(t *testing.T) {
testClientTimeout := serverClientTimeout + 5*time.Second
dir, srv := makeDNSServerConfig(t, func(c *Config) {
- c.DNSRecursor = "127.0.0.77" // must be an unreachable host
+ c.DNSRecursor = "10.255.255.1" // host must cause a connection|read|write timeout
}, func(c *DNSConfig) {
c.RecursorTimeout = serverClientTimeout
}) | Made the dns recursor timeout test more reliable | hashicorp_consul | train | go |
8f7435930722ea99eddd9e16f49813795d39f0af | diff --git a/tests/Api/LeadsTest.php b/tests/Api/LeadsTest.php
index <HASH>..<HASH> 100644
--- a/tests/Api/LeadsTest.php
+++ b/tests/Api/LeadsTest.php
@@ -13,16 +13,8 @@ class LeadsTest extends ContactsTest
{
public function setUp()
{
+ parent::setUp();
$this->api = $this->getContext('leads');
- $this->testPayload = array(
- 'firstname' => 'test',
- 'lastname' => 'test',
- 'points' => 3,
- 'tags' => array(
- 'APItag1',
- 'APItag2',
- )
- );
}
// Use the method from ContactsTest to test the 'leads' endpoint for BC | Use payload from ContactsTest for LeadsTest to ensure both test the same | mautic_api-library | train | php |
7dc5fdb39091b1e9249bcc20487e5cc2aefa44b6 | diff --git a/packages/babel-plugin-proposal-object-rest-spread/src/index.js b/packages/babel-plugin-proposal-object-rest-spread/src/index.js
index <HASH>..<HASH> 100644
--- a/packages/babel-plugin-proposal-object-rest-spread/src/index.js
+++ b/packages/babel-plugin-proposal-object-rest-spread/src/index.js
@@ -455,6 +455,11 @@ export default declare((api, opts) => {
try {
helper = file.addHelper("objectSpread2");
} catch {
+ // TODO: This is needed to workaround https://github.com/babel/babel/issues/10187
+ // and https://github.com/babel/babel/issues/10179 for older @babel/core versions
+ // where #10187 isn't fixed.
+ this.file.declarations["objectSpread2"] = null;
+
// objectSpread2 has been introduced in v7.5.0
// We have to maintain backward compatibility.
helper = file.addHelper("objectSpread"); | Workaround #<I> in proposal-object-rest-spread (#<I>) | babel_babel | train | js |
63063baf782a647d00ef3e6582a5c1c25f1f0583 | diff --git a/lib/dimples/page.rb b/lib/dimples/page.rb
index <HASH>..<HASH> 100644
--- a/lib/dimples/page.rb
+++ b/lib/dimples/page.rb
@@ -10,29 +10,23 @@ module Dimples
attr_accessor :filename
attr_accessor :extension
attr_accessor :layout
+ attr_accessor :contents
attr_accessor :rendered_contents
- attr_writer :contents
-
def initialize(site, path = nil)
@site = site
@extension = @site.config['file_extensions']['pages']
+ @path = path
- if path
- @path = path
- @filename = File.basename(path, File.extname(path))
- @contents = read_with_yaml(path)
+ if @path
+ @filename = File.basename(@path, File.extname(@path))
+ @contents = read_with_yaml(@path)
else
- @path = nil
@filename = 'index'
@contents = ''
end
end
- def contents
- @contents
- end
-
def output_file_path(parent_path)
parts = [parent_path] | Switched to an attr_accessor for contents. Simplified the initialiser's path code. | waferbaby_dimples | train | rb |
31a170930d74f6c76f6b81d068334b68ef800833 | diff --git a/lib/grade/grade_category.php b/lib/grade/grade_category.php
index <HASH>..<HASH> 100644
--- a/lib/grade/grade_category.php
+++ b/lib/grade/grade_category.php
@@ -377,6 +377,7 @@ class grade_category extends grade_object {
}
$this->aggregate_grades($prevuser, $items, $grade_values, $oldgrade, $excluded);//the last one
}
+ rs_close($rs);
}
return true;
diff --git a/lib/grade/grade_item.php b/lib/grade/grade_item.php
index <HASH>..<HASH> 100644
--- a/lib/grade/grade_item.php
+++ b/lib/grade/grade_item.php
@@ -629,6 +629,7 @@ class grade_item extends grade_object {
}
}
}
+ rs_close($rs);
}
return $result;
@@ -1430,6 +1431,7 @@ class grade_item extends grade_object {
$return = false;
}
}
+ rs_close($rs);
}
return $return; | added proper rs_close($rs) | moodle_moodle | train | php,php |
d9e882115901f366253e4e9b91220d662b943acf | diff --git a/src/main/java/com/buschmais/jqassistant/scm/maven/ScanMojo.java b/src/main/java/com/buschmais/jqassistant/scm/maven/ScanMojo.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/buschmais/jqassistant/scm/maven/ScanMojo.java
+++ b/src/main/java/com/buschmais/jqassistant/scm/maven/ScanMojo.java
@@ -64,14 +64,14 @@ public class ScanMojo extends AbstractModuleMojo {
@Override
public void execute(MavenProject mavenProject, Store store) throws MojoExecutionException, MojoFailureException {
List<ScannerPlugin<?, ?>> scannerPlugins;
+ ScannerContext scannerContext = new ScannerContextImpl(store);
ScannerPluginRepository scannerPluginRepository = pluginRepositoryProvider.getScannerPluginRepository();
try {
- scannerPlugins = scannerPluginRepository.getScannerPlugins(getPluginProperties());
+ scannerPlugins = scannerPluginRepository.getScannerPlugins(scannerContext, getPluginProperties());
} catch (PluginRepositoryException e) {
throw new MojoExecutionException("Cannot determine scanner plugins.", e);
}
ScopePluginRepository scopePluginRepository = pluginRepositoryProvider.getScopePluginRepository();
- ScannerContext scannerContext = new ScannerContextImpl(store);
Scanner scanner = new ScannerImpl(scannerContext, scannerPlugins, scopePluginRepository.getScopes());
store.beginTransaction();
try { | #<I> provide scanner context during configuration of plugins | buschmais_jqa-maven-plugin | train | java |
f7bf82368a96c7146ed15ee5857221acaf713646 | diff --git a/test/ocsp/helper/helper.go b/test/ocsp/helper/helper.go
index <HASH>..<HASH> 100644
--- a/test/ocsp/helper/helper.go
+++ b/test/ocsp/helper/helper.go
@@ -122,6 +122,9 @@ func Req(fileName string) (*ocsp.Response, error) {
http.DefaultClient.Timeout = 5 * time.Second
httpResp, err := sendHTTPRequest(req, ocspURL)
+ if err != nil {
+ return nil, err
+ }
fmt.Printf("HTTP %d\n", httpResp.StatusCode)
for k, v := range httpResp.Header {
for _, vv := range v { | Return error from `sendHTTPRequest` immediately. (#<I>)
Prior to this commit the `httpResp` result of `sendHTTPRequest` was
examined even in the case where `sendHTTPRequest` returns a non-nil
error. This can cause a nil panic since the `httpResp` may be `nil` when
the error is not. This commit returns an error from `Req()` immediately
when `sendHTTPRequest` returns one. | letsencrypt_boulder | train | go |
a722ab02527295d2801740bf4f819bf9e2da800b | diff --git a/opal/browser/compatibility.rb b/opal/browser/compatibility.rb
index <HASH>..<HASH> 100644
--- a/opal/browser/compatibility.rb
+++ b/opal/browser/compatibility.rb
@@ -66,16 +66,17 @@ module Compatibility
end
def self.new_event?
- %x{
- try {
- new Event("x");
+ return @new_event if defined?(@new_event)
- return true;
- }
- catch (e) {
- return false;
- }
- }
+ begin
+ `new Event("*")`
+
+ @new_event = true
+ rescue
+ @new_event = false
+ end
+
+ @new_event
end
def self.create_event?
@@ -107,7 +108,11 @@ module Compatibility
end
def self.post_message?
- return false unless has?(:postMessage) && !has?(:importScripts)
+ return @post_message if defined?(@post_message)
+
+ unless has?(:postMessage) && !has?(:importScripts)
+ return @post_message = false
+ end
%x{
var ok = true,
@@ -117,7 +122,7 @@ module Compatibility
window.postMessage("", "*")
window.onmessage = old;
- return ok;
+ return #@post_message = ok;
}
end | compatibility: cache some heavy predicates | opal_opal-browser | train | rb |
77b1843bdcb416a5259209844e8f6164cdb140ca | diff --git a/src/Entity/Task.php b/src/Entity/Task.php
index <HASH>..<HASH> 100644
--- a/src/Entity/Task.php
+++ b/src/Entity/Task.php
@@ -79,7 +79,7 @@ class Task
public function getStatus()
{
- return $this->progress;
+ return $this->status;
}
public function setStatus($status) | Fix can't save task because null status | tienvx_mbt-bundle | train | php |
d5890bdf660f670271a8f60bd091bd11db4c23b3 | diff --git a/actionpack/lib/abstract_controller/base.rb b/actionpack/lib/abstract_controller/base.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/abstract_controller/base.rb
+++ b/actionpack/lib/abstract_controller/base.rb
@@ -149,7 +149,7 @@ module AbstractController
# ==== Parameters
# * <tt>action_name</tt> - The name of an action to be tested
def available_action?(action_name)
- _find_action_name(action_name).present?
+ _find_action_name(action_name)
end
# Returns true if the given controller is capable of rendering | remove present? call; we do not need it | rails_rails | train | rb |
bd9dbfda7166b945d2aac9a0bcfc57325a08a5c5 | diff --git a/src/net/tootallnate/websocket/WebSocketServer.java b/src/net/tootallnate/websocket/WebSocketServer.java
index <HASH>..<HASH> 100644
--- a/src/net/tootallnate/websocket/WebSocketServer.java
+++ b/src/net/tootallnate/websocket/WebSocketServer.java
@@ -218,7 +218,7 @@ public abstract class WebSocketServer implements Runnable, WebSocketListener {
// if isWritable == true
// then we need to send the rest of the data to the client
- if (key.isWritable()) {
+ if (key.isValid() && key.isWritable()) {
WebSocket conn = (WebSocket)key.attachment();
if (conn.handleWrite()) {
conn.socketChannel().register(selector, | Fixed an issue with WebSocketServer that was causing a CancelledKeyException to be thrown when a client disconnected. | TooTallNate_Java-WebSocket | train | java |
6cae883bbb8a329ce1dc604db91f7a396100f2b3 | diff --git a/app/app.go b/app/app.go
index <HASH>..<HASH> 100644
--- a/app/app.go
+++ b/app/app.go
@@ -539,12 +539,14 @@ func (a *App) Log(message string, source string) error {
log.Printf(message)
messages := strings.Split(message, "\n")
for _, msg := range messages {
- l := Applog{
- Date: time.Now(),
- Message: msg,
- Source: source,
+ if msg != "" {
+ l := Applog{
+ Date: time.Now(),
+ Message: msg,
+ Source: source,
+ }
+ a.Logs = append(a.Logs, l)
}
- a.Logs = append(a.Logs, l)
}
return db.Session.Apps().Update(bson.M{"name": a.Name}, a)
} | app: fix blank line logging issue | tsuru_tsuru | train | go |
91b8a5823d6dcf76d2bcad0f3b1e1338a4e1db9c | diff --git a/lib/sfn/command_module/stack.rb b/lib/sfn/command_module/stack.rb
index <HASH>..<HASH> 100644
--- a/lib/sfn/command_module/stack.rb
+++ b/lib/sfn/command_module/stack.rb
@@ -74,7 +74,7 @@ module Sfn
# @param action [String] create or update
# @return [TrueClass]
def unpack_nesting(name, file, action)
- config.apply_stacks ||= []
+ config[:apply_stacks] ||= []
stack_count = 0
file['Resources'].each do |stack_resource_name, stack_resource| | Fix apply stack reference to access via hash method | sparkleformation_sfn | train | rb |
d939628b26b18bc6af98bee29409f84866cbaf38 | diff --git a/spec/dummy/config/application.rb b/spec/dummy/config/application.rb
index <HASH>..<HASH> 100644
--- a/spec/dummy/config/application.rb
+++ b/spec/dummy/config/application.rb
@@ -24,9 +24,6 @@ module Dummy
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
config.i18n.default_locale = :nl
-
- # Do not swallow errors in after_commit/after_rollback callbacks.
- config.active_record.raise_in_transactional_callbacks = true
end
end | Get rid of deprecated app setting. | udongo_udongo | train | rb |
7d820ea97cd61d41f2fc5d8af946801c9a1ca192 | diff --git a/text-minimessage/src/test/java/net/kyori/adventure/text/minimessage/tag/TagResolverTest.java b/text-minimessage/src/test/java/net/kyori/adventure/text/minimessage/tag/TagResolverTest.java
index <HASH>..<HASH> 100644
--- a/text-minimessage/src/test/java/net/kyori/adventure/text/minimessage/tag/TagResolverTest.java
+++ b/text-minimessage/src/test/java/net/kyori/adventure/text/minimessage/tag/TagResolverTest.java
@@ -86,10 +86,6 @@ class TagResolverTest {
@Test
void testParseInResolver() {
- final List<TagResolver> placeholders = Arrays.asList(
- Placeholder.parsed("foo", "<red>Hello</red>"),
- Placeholder.parsed("bar", "<yellow>World</yellow>")
- );
final Context ctx = TestBase.dummyContext("dummy text");
final Component input = ctx.parse("<foo> <bar>",
Placeholder.parsed("foo", "<red>Hello</red>"), Placeholder.parsed("bar", "<yellow>World</yellow>")); | minimessage-text: Cleanup test ParseInResolver | KyoriPowered_text | train | java |
9aa91b4e7b706e99b45a83590381a13553eb36d0 | diff --git a/test_pyout.py b/test_pyout.py
index <HASH>..<HASH> 100644
--- a/test_pyout.py
+++ b/test_pyout.py
@@ -178,8 +178,8 @@ def test_tabular_write_update():
fd = StringIO()
out = Tabular(["name", "status"],
stream=fd, force_styling=True)
- data = [{"name": "foo", "path": "/tmp/foo", "status": "unknown"},
- {"name": "bar", "path": "/tmp/bar", "status": "installed"}]
+ data = [{"name": "foo", "status": "unknown"},
+ {"name": "bar", "status": "installed"}]
for row in data:
out(row) | TST: Remove an unused field | pyout_pyout | train | py |
3315070da27a5c5ec6b12113638a7abd5917f2ee | diff --git a/public/js/clients/chrome/events.js b/public/js/clients/chrome/events.js
index <HASH>..<HASH> 100644
--- a/public/js/clients/chrome/events.js
+++ b/public/js/clients/chrome/events.js
@@ -11,6 +11,10 @@ function scriptParsed(scriptId, url, startLine, startColumn,
endLine, endColumn, executionContextId, hash,
isContentScript, isInternalScript, isLiveEdit,
sourceMapURL, hasSourceURL, deprecatedCommentWasUsed) {
+ if (isInternalScript || isContentScript) {
+ return;
+ }
+
actions.newSource(Source({
id: scriptId,
url, | Exclude internal sources (#<I>) | firefox-devtools_debugger | train | js |
b3b84db837437f8aa8d7d9bbaabaffe16fa5fefb | diff --git a/webroot/js/calendar.js b/webroot/js/calendar.js
index <HASH>..<HASH> 100644
--- a/webroot/js/calendar.js
+++ b/webroot/js/calendar.js
@@ -565,6 +565,12 @@ Vue.component('calendar-modal', {
calendarId: function() {
this.getEventTypes();
},
+ isRecurring: function() {
+ if (!this.isRecurring) {
+ this.rrule = null;
+ this.rruleResult = null;
+ }
+ },
},
methods: {
searchAttendees: function(search, loading) { | Resetting reccuring rule on checkbox off (task #<I>) | QoboLtd_cakephp-calendar | train | js |
3e1194e5ffdfabc234fb81be544d6925d9aa58c6 | diff --git a/main.go b/main.go
index <HASH>..<HASH> 100644
--- a/main.go
+++ b/main.go
@@ -151,7 +151,17 @@ func main() {
// GUI
if !opts.NoGUI && opts.GUIAddr != "" {
- startGUI(opts.GUIAddr, m)
+ host, port, err := net.SplitHostPort(opts.GUIAddr)
+ if err != nil {
+ warnf("Cannot start GUI on %q: %v", opts.GUIAddr, err)
+ } else {
+ if len(host) > 0 {
+ infof("Starting web GUI on http://%s", opts.GUIAddr)
+ } else {
+ infof("Starting web GUI on port %s", port)
+ }
+ startGUI(opts.GUIAddr, m)
+ }
}
// Walk the repository and update the local model before establishing any | Show web GUI address on startup (fixes #<I>) | syncthing_syncthing | train | go |
23b53ea619b407065801db8abdc11d00ec197720 | diff --git a/Reminders/DatabaseReminderRepository.php b/Reminders/DatabaseReminderRepository.php
index <HASH>..<HASH> 100755
--- a/Reminders/DatabaseReminderRepository.php
+++ b/Reminders/DatabaseReminderRepository.php
@@ -139,7 +139,7 @@ class DatabaseReminderRepository implements ReminderRepositoryInterface {
*/
public function deleteExpired()
{
- $expired = Carbon::now()->addSeconds($this->expires);
+ $expired = Carbon::now()->subSeconds($this->expires);
$this->getTable()->where('created_at', '<', $expired)->delete();
} | We should remove the seconds and not add it to the current DateTime. | illuminate_auth | train | php |
3adfe75b69a3f4ddadc56f2b05655a163bd5e7f8 | diff --git a/scoop/_control.py b/scoop/_control.py
index <HASH>..<HASH> 100644
--- a/scoop/_control.py
+++ b/scoop/_control.py
@@ -105,7 +105,6 @@ def runController(callable, *args, **kargs):
else:
future = execQueue.pop()
else:
- execQueue.append(future)
future = execQueue.pop()
else:
# future is in progress; run next future from pending execution queue. | Fixed a memory leak in the controller. It seems to enhance greatly the performances. | soravux_scoop | train | py |
0ac0d6f66d1c329a334f4e0703ab97329e610c5c | diff --git a/nodeconductor/server/base_settings.py b/nodeconductor/server/base_settings.py
index <HASH>..<HASH> 100644
--- a/nodeconductor/server/base_settings.py
+++ b/nodeconductor/server/base_settings.py
@@ -46,6 +46,13 @@ MIDDLEWARE_CLASSES = (
REST_FRAMEWORK = {
'TEST_REQUEST_DEFAULT_FORMAT': 'json',
+ 'DEFAULT_AUTHENTICATION_CLASSES': (
+ 'rest_framework.authentication.BasicAuthentication',
+ 'rest_framework.authentication.SessionAuthentication',
+ ),
+ 'DEFAULT_PERMISSION_CLASSES': (
+ 'rest_framework.permissions.IsAuthenticated',
+ )
}
ROOT_URLCONF = 'nodeconductor.server.urls' | Enabled basic and session authentication.
- NC-4
- Made all requests require authentication by default. | opennode_waldur-core | train | py |
ac7ad438e8e0bf049da19bcce5c65e83afad095e | diff --git a/src/Content/Migration/Base.php b/src/Content/Migration/Base.php
index <HASH>..<HASH> 100644
--- a/src/Content/Migration/Base.php
+++ b/src/Content/Migration/Base.php
@@ -129,6 +129,21 @@ class Base
}
/**
+ * Helper function for logging messages
+ *
+ * @param string $message
+ * @param string $type (info, warning, error, success)
+ * @return void
+ **/
+ public function log($message, $type='info')
+ {
+ $this->callback('migration', 'log', [
+ 'message' => $message,
+ 'type' => $type
+ ]);
+ }
+
+ /**
* Get option - these are specified/overwritten by the individual migrations/hooks
*
* @param string $key | [feat] Adding helper for logging messages | hubzero_framework | train | php |
8d6d29dc29649815615d7bc310b48948e2f0180f | diff --git a/aioxmpp/security_layer.py b/aioxmpp/security_layer.py
index <HASH>..<HASH> 100644
--- a/aioxmpp/security_layer.py
+++ b/aioxmpp/security_layer.py
@@ -713,11 +713,6 @@ class STARTTLSProvider:
`certificate_verifier_factory` must be a callable providing a
:class:`CertificateVerifer` instance which will hooked up to the transport
and the SSL context to perform certificate validation.
-
- .. note::
-
- Partial DANE support is provided by :mod:`dane`.
-
"""
def __init__(self, | Remove incorrect documentation on dane support | horazont_aioxmpp | train | py |
eb742cb4c0d33ddab761aa1291092faba93ec7bf | diff --git a/src/Entry.php b/src/Entry.php
index <HASH>..<HASH> 100644
--- a/src/Entry.php
+++ b/src/Entry.php
@@ -59,7 +59,7 @@ class Entry implements EntryInterface
return $this->resolvedLinks[$key];
}
- if (is_array($this->fields[$key]) && array_values($this->fields[$key])[0] instanceof Link) {
+ if (is_array($this->fields[$key]) && count($this->fields[$key]) > 0 && array_values($this->fields[$key])[0] instanceof Link) {
if (!isset($this->resolvedLinks[$key])) {
$this->resolvedLinks[$key] = array_map(function ($link) {
return call_user_func($this->resolveLinkFunction, $link); | handle case where entry field is empty collection | usemarkup_contentful | train | php |
5006d72156a2d94b0bc95c5dab4bb40ee833440a | diff --git a/paper/scripts/k2sc_cdpp.py b/paper/scripts/k2sc_cdpp.py
index <HASH>..<HASH> 100755
--- a/paper/scripts/k2sc_cdpp.py
+++ b/paper/scripts/k2sc_cdpp.py
@@ -22,7 +22,7 @@ import warnings
from urllib.error import HTTPError
from scipy.signal import savgol_filter
-for campaign in range(4,7):
+for campaign in range(3,7):
print("\nRunning campaign %02d..." % campaign) | add c3 to k2sc | rodluger_everest | train | py |
b6081e0b7145acaf045277f235a33aa369c85af5 | diff --git a/lib/load-grunt-configs.js b/lib/load-grunt-configs.js
index <HASH>..<HASH> 100644
--- a/lib/load-grunt-configs.js
+++ b/lib/load-grunt-configs.js
@@ -17,7 +17,7 @@ var path = require('path');
module.exports = function(grunt, options){
- options = _.merge({
+ options = _.assign({
config: {
src : ['config/*.js*', 'config/*.coffee']
}
@@ -54,7 +54,6 @@ module.exports = function(grunt, options){
runner = runner[key];
});
});
-
});
return options;
}; | fixes incorrect overwrite of passedin options for this task | creynders_load-grunt-configs | train | js |
5442e297c971ab4df8ddfabb7318db491560c56c | diff --git a/xwiki-commons-core/xwiki-commons-job/src/test/java/org/xwiki/job/internal/DefaultRequestTest.java b/xwiki-commons-core/xwiki-commons-job/src/test/java/org/xwiki/job/internal/DefaultRequestTest.java
index <HASH>..<HASH> 100644
--- a/xwiki-commons-core/xwiki-commons-job/src/test/java/org/xwiki/job/internal/DefaultRequestTest.java
+++ b/xwiki-commons-core/xwiki-commons-job/src/test/java/org/xwiki/job/internal/DefaultRequestTest.java
@@ -38,7 +38,7 @@ public class DefaultRequestTest
DefaultRequest request2 = new DefaultRequest(request);
Assert.assertEquals(request.getId(), request2.getId());
- Assert.assertEquals(request.getProperty("property"), request2.getProperty("property"));
+ Assert.assertEquals(request.getProperty("property"), (String) request2.getProperty("property"));
Assert.assertEquals(request.isRemote(), request2.isRemote());
Assert.assertEquals(request.isInteractive(), request2.isInteractive());
} | [Misc] Don't use the assertEquals (Object[], Object[]) signature which is deprecated | xwiki_xwiki-commons | train | java |
5e539876fa8fc52a28353a97e1fd657f294cd2f6 | diff --git a/src/main/lombok/ast/resolve/Resolver.java b/src/main/lombok/ast/resolve/Resolver.java
index <HASH>..<HASH> 100644
--- a/src/main/lombok/ast/resolve/Resolver.java
+++ b/src/main/lombok/ast/resolve/Resolver.java
@@ -124,6 +124,16 @@ public class Resolver {
String name = typeReference.getTypeName();
if (name.equals(wanted)) return true;
+ /* checks array dimensions */ {
+ int dims1 = typeReference.astArrayDimensions();
+ int dims2 = 0;
+ while (wanted.endsWith("[]")) {
+ dims2++;
+ wanted = wanted.substring(0, wanted.length() - 2);
+ }
+ if (dims1 != dims2) return false;
+ }
+
int dot = wanted.lastIndexOf('.');
String wantedPkg = dot == -1 ? "" : wanted.substring(0, dot);
String wantedName = dot == -1 ? wanted : wanted.substring(dot + 1); | resolver work - we don't use this yet, huh. | rzwitserloot_lombok.ast | train | java |
c72e4cda6ee8e8d81ff5b0b11b94f4a89463fb3a | diff --git a/lib/vaulted_billing/gateways/ipcommerce.rb b/lib/vaulted_billing/gateways/ipcommerce.rb
index <HASH>..<HASH> 100644
--- a/lib/vaulted_billing/gateways/ipcommerce.rb
+++ b/lib/vaulted_billing/gateways/ipcommerce.rb
@@ -90,7 +90,7 @@ module VaultedBilling
response = http.get
raise(UnavailableKeyError, 'Unable to renew service keys.') unless response.success?
@expires_at = Time.now + 30.minutes
- @key = response.body.try(:[], 1...-1)
+ store_key(response.body.try(:[], 1...-1))
end
private | Tokenization should store the keys using the store_key method. | envylabs_vaulted_billing | train | rb |
803659a83e3ea7d6f3ba95bdab914b60a2203013 | diff --git a/test/integration/serverless/test/index.test.js b/test/integration/serverless/test/index.test.js
index <HASH>..<HASH> 100644
--- a/test/integration/serverless/test/index.test.js
+++ b/test/integration/serverless/test/index.test.js
@@ -13,6 +13,7 @@ import {
renderViaHTTP,
} from 'next-test-utils'
import qs from 'querystring'
+import path from 'path'
import fetch from 'node-fetch'
const appDir = join(__dirname, '../')
@@ -62,6 +63,17 @@ describe('Serverless', () => {
expect(legacy).toMatch(`new static folder`)
})
+ it('should not infinity loop on a 404 static file', async () => {
+ expect.assertions(2)
+
+ // ensure top-level static does not exist (important for test)
+ // we expect /public/static, though.
+ expect(existsSync(path.join(appDir, 'static'))).toBe(false)
+
+ const res = await fetchViaHTTP(appPort, '/static/404')
+ expect(res.status).toBe(404)
+ })
+
it('should render the page with dynamic import', async () => {
const html = await renderViaHTTP(appPort, '/dynamic')
expect(html).toMatch(/Hello!/) | Test static folder (#<I>)
* Test for infinite loop
* remove focus | zeit_next.js | train | js |
186e43e60beab2d43cd609153f7346684800bc81 | diff --git a/code/MemberTableField.php b/code/MemberTableField.php
index <HASH>..<HASH> 100755
--- a/code/MemberTableField.php
+++ b/code/MemberTableField.php
@@ -349,7 +349,7 @@ class MemberTableField extends ComplexTableField {
$message = sprintf(
_t('ComplexTableField.SUCCESSADD', 'Added %s %s %s'),
$childData->singular_name(),
- '<a href="' . $this->Link() . '">' . $childData->Title . '</a>',
+ '<a href="' . $this->Link() . '">' . htmlspecialchars($childData->Title, ENT_QUOTES) . '</a>',
$closeLink
);
$form->sessionMessage($message, 'good'); | BUGFIX: Removed XSS holes (from r<I>) (from r<I>)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@<I> <I>b<I>ca-7a2a-<I>-9d3b-<I>d<I>a<I>a9 | silverstripe_silverstripe-siteconfig | train | php |
275057a296323cdb24e8e702f34ba17f8f6efa1f | diff --git a/src/cloudant/client.py b/src/cloudant/client.py
index <HASH>..<HASH> 100755
--- a/src/cloudant/client.py
+++ b/src/cloudant/client.py
@@ -95,7 +95,7 @@ class CouchDB(dict):
authentication if necessary.
"""
if self.r_session:
- return
+ self.session_logout()
if self.admin_party:
self.r_session = ClientSession(timeout=self._timeout)
@@ -132,7 +132,9 @@ class CouchDB(dict):
"""
Ends a client authentication session, performs a logout and a clean up.
"""
- self.session_logout()
+ if self.r_session:
+ self.session_logout()
+
self.r_session = None
self.clear() | Allow multiple calls to client .connect() | cloudant_python-cloudant | train | py |
18c5297087ca01de85518e2b55078f444144aa1b | diff --git a/StreamSelectLoop.php b/StreamSelectLoop.php
index <HASH>..<HASH> 100644
--- a/StreamSelectLoop.php
+++ b/StreamSelectLoop.php
@@ -182,8 +182,11 @@ class StreamSelectLoop implements LoopInterface
// There is a pending timer, only block until it is due ...
} elseif ($scheduledAt = $this->timers->getFirst()) {
- if (0 > $timeout = $scheduledAt - $this->timers->getTime()) {
+ $timeout = $scheduledAt - $this->timers->getTime();
+ if ($timeout < 0) {
$timeout = 0;
+ } else {
+ $timeout *= self::MICROSECONDS_PER_SECOND;
}
// The only possible event is stream activity, so wait forever ...
@@ -195,7 +198,7 @@ class StreamSelectLoop implements LoopInterface
break;
}
- $this->waitForStreamActivity($timeout * self::MICROSECONDS_PER_SECOND);
+ $this->waitForStreamActivity($timeout);
}
} | Fix <I>% cpu usage for idle StreamSelectLoop with no timers.
A null timeout must not be multiplied by an integer.
Fixes #<I> | reactphp_event-loop | train | php |
1553ed0cdf50584fad7a468a0a376ab0906ea12a | diff --git a/coaster/views.py b/coaster/views.py
index <HASH>..<HASH> 100644
--- a/coaster/views.py
+++ b/coaster/views.py
@@ -70,8 +70,8 @@ def get_next_url(referrer=False, external=False, session=False, default=__marker
This function looks for a ``next`` parameter in the request or in the session
(depending on whether parameter ``session`` is True). If no ``next`` is present,
it checks the referrer (if enabled), and finally returns either the provided
- default (which can be any value including ``None``) or ``url_for('index')``.
- If your app does not have a URL endpoint named ``index``, ``/`` is returned.
+ default (which can be any value including ``None``) or the script root
+ (typically ``/``).
"""
if session:
next_url = request_session.pop('next', None) or request.args.get('next', '') | We're no longer assuming presence of a route named 'index'. | hasgeek_coaster | train | py |
f91eaef41641255f65724c85b53a342aaf840859 | diff --git a/worker.go b/worker.go
index <HASH>..<HASH> 100644
--- a/worker.go
+++ b/worker.go
@@ -64,7 +64,7 @@ type Worker struct {
// ConfigureQorResourceBeforeInitialize a method used to config Worker for qor admin
func (worker *Worker) ConfigureQorResourceBeforeInitialize(res resource.Resourcer) {
if res, ok := res.(*admin.Resource); ok {
- admin.RegisterViewPath("github.com/qor/worker/views")
+ res.GetAdmin().RegisterViewPath("github.com/qor/worker/views")
res.UseTheme("worker")
worker.Admin = res.GetAdmin() | Upgrade to new RegisterViewPath API | qor_worker | train | go |
e1fc215cdf1aa9be893243a4f99b0b7b840e8373 | diff --git a/classes/taxonomy.class.php b/classes/taxonomy.class.php
index <HASH>..<HASH> 100644
--- a/classes/taxonomy.class.php
+++ b/classes/taxonomy.class.php
@@ -68,7 +68,7 @@ class Cuztom_Taxonomy
add_action( 'init', array( &$this, 'register_taxonomy_for_object_type' ) );
}
- if( ( get_bloginfo( 'version' ) < '3.5' ) && ( isset( $args['show_column'] ) && $args['show_column'] ) )
+ if( ( get_bloginfo( 'version' ) < '3.5' ) && ( isset( $args['show_admin_column'] ) && $args['show_admin_column'] ) )
{
add_filter( 'manage_' . $this->post_type_name . '_posts_columns', array( &$this, 'add_column' ) );
add_action( 'manage_' . $this->post_type_name . '_posts_custom_column', array( &$this, 'add_column_content' ), 10, 2 );
@@ -124,7 +124,7 @@ class Cuztom_Taxonomy
'show_ui' => true,
'show_in_nav_menus' => true,
'_builtin' => false,
- 'show_column' => false
+ 'show_admin_column' => false
),
// Given | Show_columns changed to show_admin_column
With compatability for versions below <I> | gizburdt_cuztom | train | php |
3bab0a1eaeaa36d64d8256a9a22ffcbba8c5ee5e | diff --git a/src/controllers/playlists.js b/src/controllers/playlists.js
index <HASH>..<HASH> 100755
--- a/src/controllers/playlists.js
+++ b/src/controllers/playlists.js
@@ -219,7 +219,8 @@ export const createPlaylistItems = function createPlaylistItems(id, playlistID,
_playlistItem = new PlaylistItem({
'media': media,
'artist': media.artist,
- 'title': media.title
+ 'title': media.title,
+ 'end': media.duration
});
return _playlistItem.save(); | set end to media.duration at creation | u-wave_http-api | train | js |
500acdbb7d3c7149b9e7ab55f86fe3946134d0d9 | diff --git a/internal/services/compute/dedicated_host_resource.go b/internal/services/compute/dedicated_host_resource.go
index <HASH>..<HASH> 100644
--- a/internal/services/compute/dedicated_host_resource.go
+++ b/internal/services/compute/dedicated_host_resource.go
@@ -264,7 +264,7 @@ func resourceDedicatedHostDelete(d *pluginsdk.ResourceData, meta interface{}) er
future, err := client.Delete(ctx, id.ResourceGroup, id.HostGroupName, id.HostName)
if err != nil {
- return fmt.Errorf("deleting %: %+v", *id, err)
+ return fmt.Errorf("deleting %s: %+v", *id, err)
}
if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { | r/dedicated_host: adding a missing formatting placeholder | terraform-providers_terraform-provider-azurerm | train | go |
dc6aeb05469f9aa325c3c581c482131c3bb43ad1 | diff --git a/tests/App/AppKernel.php b/tests/App/AppKernel.php
index <HASH>..<HASH> 100644
--- a/tests/App/AppKernel.php
+++ b/tests/App/AppKernel.php
@@ -120,7 +120,7 @@ final class AppKernel extends Kernel
$containerBuilder->loadFromExtension('twig', [
'default_path' => sprintf('%s/templates', $this->getProjectDir()),
- 'strict_variables' => '%kernel.debug%',
+ 'strict_variables' => true,
'exception_controller' => null,
'form_themes' => ['@SonataAdmin/Form/form_admin_fields.html.twig'],
]); | Use strict_variables in tests (#<I>) | sonata-project_SonataAdminBundle | train | php |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.